From 65eaa0d7c1f586877912e4de1826737ac41f75ac Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 1 Jul 2022 14:30:52 -0500 Subject: [PATCH 001/215] Allow table/partitionedtable arrays to grow as needed in JS Figure (#2617) Fixes #2612 --- .../io/deephaven/web/client/api/widget/plot/JsFigure.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java index bb433a310b3..6a83b2be784 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java @@ -649,8 +649,8 @@ private static class DefaultFigureTableFetch implements FigureTableFetch { @Override public Promise fetch(JsFigure figure, FetchObjectResponse response) { - JsTable[] tables = new JsTable[response.getTypedExportIdList().length]; - JsPartitionedTable[] partitionedTables = new JsPartitionedTable[response.getTypedExportIdList().length]; + JsTable[] tables = new JsTable[0]; + JsPartitionedTable[] partitionedTables = new JsPartitionedTable[0]; Promise[] promises = new Promise[response.getTypedExportIdList().length]; From 0a9bbaaf34a71488bcfe6cd445161185616a12f2 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:32:35 -0600 Subject: [PATCH 002/215] Add PartitionedTable keys() helper method (#2615) * Add PartitionedTable keys() method * Call view() when unique-keys is true for perf --- py/server/deephaven/table.py | 8 ++++++++ py/server/tests/test_partitioned_table.py | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 5680adf178e..e24cf41de5d 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -1455,6 +1455,14 @@ def key_columns(self) -> List[str]: self._key_columns = list(self.j_partitioned_table.keyColumnNames().toArray()) return self._key_columns + def keys(self) -> Table: + """Returns a Table containing all the keys of the underlying partitioned table.""" + if self.unique_keys: + return self.table.view(self.key_columns) + else: + return self.table.select_distinct(self.key_columns) + + @property def unique_keys(self) -> bool: """Whether the keys in the underlying table must always be unique. If keys must be unique, one can expect diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index 3f2c9c77467..286a5df736d 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -201,6 +201,19 @@ def test_from_constituent_tables(self): with self.subTest("Compatible table definition"): pt = PartitionedTable.from_constituent_tables([test_table, test_table1, test_table3], test_table.columns) + def test_keys(self): + keys_table = self.partitioned_table.keys() + select_distinct_table = self.test_table.select_distinct(["c", "e"]) + self.assertEqual(keys_table.size, select_distinct_table.size) + + with ugp.shared_lock(): + test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) + pt = test_table.partition_by("Y") + self.wait_ticking_table_update(test_table, row_count=20, timeout=5) + keys_table = pt.keys() + select_distinct_table = test_table.select_distinct(["Y"]) + self.assertEqual(keys_table.size, select_distinct_table.size) + if __name__ == '__main__': unittest.main() From b407f7d3289cd6147975d133bfa1798e3b36a979 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 1 Jul 2022 13:01:15 -0700 Subject: [PATCH 003/215] Package and publish applications / wheels (#2603) --- .github/workflows/publish-ci.yml | 34 +++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-ci.yml b/.github/workflows/publish-ci.yml index b7e05f2e0ae..64d41748d60 100644 --- a/.github/workflows/publish-ci.yml +++ b/.github/workflows/publish-ci.yml @@ -37,11 +37,14 @@ jobs: echo "org.gradle.java.installations.paths=${{ steps.setup-java-11.outputs.path }},${{ steps.setup-java-17.outputs.path }}," >> gradle.properties cat gradle.properties + # TODO(deephaven-core#2614): Improve gradle/CI assemble and publishing of artifacts + - name: Publish to Maven Local if: ${{ !startsWith(github.ref, 'refs/heads/release/v') }} uses: burrunan/gradle-cache-action@v1 with: - arguments: publishToMavenLocal -x signMavenJavaPublication -x signMyPlatformPublication + job-id: publish-local + arguments: server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build publishToMavenLocal -x signMavenJavaPublication -x signMyPlatformPublication gradle-version: wrapper - name: Publish @@ -51,10 +54,35 @@ jobs: job-id: publish # Note: even though we specify org.gradle.parallel=false in our CI gradle.properties, we want to be explicit # here about no parallelism to ensure we don't create disjointed staging repositories. - arguments: --no-parallel publish + arguments: --no-parallel server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build publish gradle-version: wrapper env: ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.CI_AT_DEEPHAVEN_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.CI_AT_DEEPHAVEN_PASSWORD }} \ No newline at end of file + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.CI_AT_DEEPHAVEN_PASSWORD }} + + - name: Upload Applications + if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} + uses: actions/upload-artifact@v3 + with: + name: applications + path: | + server/jetty-app/build/distributions/ + server/netty-app/build/distributions/ + + - name: Publish deephaven-core to PyPi + if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.DEEPHAVENCORE_PYPI_TOKEN }} + packages_dir: py/server/build/wheel/ + + - name: Publish deephaven-server to PyPi + if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.DEEPHAVENSERVER_PYPI_TOKEN }} + packages_dir: py/embedded-server/build/wheel/ From 130fd2b485ec944561bb6c54d7532c61d0b964eb Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 4 Jul 2022 06:09:33 -0700 Subject: [PATCH 004/215] Bump to 0.15.0 (#2619) --- .github/workflows/build-ci.yml | 20 +++++++++---------- .../io.deephaven.common-conventions.gradle | 2 +- py/client/README.md | 2 +- py/client/pydeephaven/__init__.py | 2 +- py/client/setup.py | 2 +- py/server/deephaven/__init__.py | 2 +- server/jetty-app/README.md | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index c3f6978aba9..07274ffed7b 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -57,7 +57,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Docker meta server nltk @@ -71,7 +71,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Docker meta server pytorch @@ -85,7 +85,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Docker meta server sklearn @@ -99,7 +99,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Docker meta server tensorflow @@ -113,7 +113,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Docker meta server slim @@ -127,7 +127,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -290,7 +290,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -377,7 +377,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -440,7 +440,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Setup JDK 11 @@ -536,7 +536,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.14.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest type=ref,event=branch - name: Setup JDK 11 diff --git a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle index 35a3d1b8986..df05ff667f1 100644 --- a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle @@ -4,7 +4,7 @@ plugins { } group = 'io.deephaven' -version = '0.14.0' +version = '0.15.0' if (!name.startsWith('deephaven-')) { archivesBaseName = "deephaven-${name}" diff --git a/py/client/README.md b/py/client/README.md index 6c279ff9c3c..efd795101ef 100644 --- a/py/client/README.md +++ b/py/client/README.md @@ -35,7 +35,7 @@ $ python3 -m examples.demo_asof_join ``` ## Install ``` shell -$ pip3 install dist/pydeephaven-0.14.0-py3-none-any.whl +$ pip3 install dist/pydeephaven-0.15.0-py3-none-any.whl ``` ## Quick start diff --git a/py/client/pydeephaven/__init__.py b/py/client/pydeephaven/__init__.py index cd37bc3672c..eae0facaf70 100644 --- a/py/client/pydeephaven/__init__.py +++ b/py/client/pydeephaven/__init__.py @@ -30,4 +30,4 @@ from .constants import SortDirection, MatchRule from .query import Query -__version__ = "0.14.0" +__version__ = "0.15.0" diff --git a/py/client/setup.py b/py/client/setup.py index 22fede7f396..389bf984c03 100644 --- a/py/client/setup.py +++ b/py/client/setup.py @@ -12,7 +12,7 @@ setup( name='pydeephaven', - version='0.14.0', + version='0.15.0', description='The Deephaven Python Client', long_description=README, long_description_content_type="text/markdown", diff --git a/py/server/deephaven/__init__.py b/py/server/deephaven/__init__.py index b64904b285f..776ebaf966b 100644 --- a/py/server/deephaven/__init__.py +++ b/py/server/deephaven/__init__.py @@ -7,7 +7,7 @@ """ -__version__ = "0.14.0" +__version__ = "0.15.0" from .dherror import DHError from .table import SortDirection, AsOfMatchRule diff --git a/server/jetty-app/README.md b/server/jetty-app/README.md index 41ab096e301..bcb48491482 100644 --- a/server/jetty-app/README.md +++ b/server/jetty-app/README.md @@ -24,17 +24,17 @@ be sure to first set `PYTHON_CONFIGURE_OPTS="--enabled-shared"`. ```shell $ python -m pip install --upgrade pip # First upgrade pip $ pip install wheel - $ export DEEPHAVEN_VERSION=0.14.0 # this should match the current version of your git repo + $ export DEEPHAVEN_VERSION=0.15.0 # this should match the current version of your git repo $ cd py/jpy $ export JAVA_HOME=/path/to/your/java/home # Customize this to fit your computer $ python setup.py bdist_wheel - $ pip install dist/deephaven_jpy-0.14.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform + $ pip install dist/deephaven_jpy-0.15.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform $ cd - $ cd Integrations/python $ python setup.py bdist_wheel - $ pip install dist/deephaven-0.14.0-py2.py3-none-any.whl + $ pip install dist/deephaven-0.15.0-py2.py3-none-any.whl $ cd - ``` From d09b94a0a238ad63861300323362e0dad4bfe0bc Mon Sep 17 00:00:00 2001 From: Cristian Ferretti <37232625+jcferretti@users.noreply.github.com> Date: Tue, 5 Jul 2022 10:34:07 -0400 Subject: [PATCH 005/215] Fix DeephavenApiServer.run() javadoc regarding blocking. (#2621) * Fix DeephavenApiServer.run() javadoc regarding blocking. * Spotlessfy. --- .../java/io/deephaven/server/runner/DeephavenApiServer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index e7c258237ec..aeb2d68d3e1 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -77,9 +77,8 @@ SessionService sessionService() { /** - * Starts the various server components, and blocks until the gRPC server has shut down. That shutdown is mediated - * by the ShutdownManager, and will call the gRPC server to shut it down when the process is itself shutting down. - * Only once that is complete will this method return. + * Starts the various server components, and returns without blocking. Shutdown is mediated by the ShutdownManager, + * who will call the gRPC server to shut it down when the process is itself shutting down. * * @throws IOException thrown in event of an error with logging, finding and running an application, and starting * the gRPC service. From ff2b4264b1c08045451276f8515e39b41e7404fb Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 6 Jul 2022 07:57:17 -0700 Subject: [PATCH 006/215] Treemaps (#2560) * Add Treemap plotting Co-authored-by: Colin Alworth Co-authored-by: mikebender --- .../util/GeneratePlottingConvenience.java | 3 +- .../plot/util/GeneratePyV2FigureAPI.java | 8 ++ .../src/main/java/io/deephaven/plot/Axes.java | 19 +++ .../main/java/io/deephaven/plot/AxesImpl.java | 43 +++++++ .../java/io/deephaven/plot/ChartType.java | 7 +- .../main/java/io/deephaven/plot/Figure.java | 2 + .../java/io/deephaven/plot/FigureImpl.java | 6 + .../java/io/deephaven/plot/PlotStyle.java | 6 +- .../deephaven/plot/PlottingConvenience.java | 7 ++ .../CategoryTreeMapDataSeriesTableMap.java | 112 ++++++++++++++++++ .../java/io/deephaven/gui/color/Color.java | 3 + .../figure/FigureWidgetTranslator.java | 21 +++- .../main/proto/deephaven/proto/console.proto | 5 + py/server/deephaven/plot/color.py | 3 + py/server/deephaven/plot/figure.py | 68 +++++++++++ .../web/client/api/widget/plot/JsFigure.java | 3 +- .../api/widget/plot/enums/JsChartType.java | 1 + .../widget/plot/enums/JsSeriesPlotStyle.java | 1 + .../api/widget/plot/enums/JsSourceType.java | 3 + .../figuredescriptor/SeriesPlotStyleMap.java | 6 + .../figuredescriptor/SourceTypeMap.java | 18 +++ .../chartdescriptor/ChartTypeMap.java | 6 + 22 files changed, 346 insertions(+), 5 deletions(-) create mode 100644 Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java index 6e87f2df5f5..20273e98b04 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java @@ -392,7 +392,8 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio "errorBarY", "errorBarYBy", "catErrorBar", - "catErrorBarBy")); + "catErrorBarBy", + "treeMapPlot")); @SuppressWarnings("unchecked") GeneratePlottingConvenience gen = new GeneratePlottingConvenience(staticImports, imports, diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java index e7f2cf01e5f..74a76d24728 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java @@ -1112,6 +1112,12 @@ private static Map getPyArgs() { rst.put("pointSizes", rst.get("pointSize")); rst.put("pointLabelFormat", new PyArg(84, "label_format", taStr, "point label format.", null)); rst.put("visible", new PyArg(85, "visible", taInt, "true to draw the design element; false otherwise.", null)); + rst.put("values", new PyArg(10, "values_column", taStr, "", null)); + rst.put("ids", new PyArg(10, "ids_column", taStr, "", null)); + rst.put("parents", new PyArg(10, "parents_column", taStr, "", null)); + rst.put("labels", new PyArg(10, "labels_column", taStr, "", null)); + rst.put("text", new PyArg(10, "text_column", taStr, "", null)); + rst.put("hoverText", new PyArg(10, "hover_text_column", taStr, "", null)); //////////////////////////////////////////////////////////////// @@ -1220,6 +1226,8 @@ private static List getPyFuncs() { rst.add(new PyFunc("plot_ohlc", SINGLETON, new String[] {"ohlcPlot", "ohlcPlotBy"}, new String[] {"series_name"}, "Creates an open-high-low-close plot.")); + rst.add(new PyFunc("plot_tree_map", SINGLETON, new String[] {"treeMapPlot"}, + new String[] {"t", "ids", "parents"}, "")); //////////////////////////////////////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/Axes.java b/Plot/src/main/java/io/deephaven/plot/Axes.java index 8f858175120..e4d0c4ab75c 100644 --- a/Plot/src/main/java/io/deephaven/plot/Axes.java +++ b/Plot/src/main/java/io/deephaven/plot/Axes.java @@ -21,6 +21,7 @@ import io.deephaven.gui.color.Paint; import io.deephaven.time.calendar.BusinessCalendar; import groovy.lang.Closure; +import org.jetbrains.annotations.Nullable; import java.io.Serializable; import java.util.Date; @@ -1363,6 +1364,24 @@ CategoryDataSeries piePlot(final Comparable seriesName, final Table t, final Str CategoryDataSeries piePlot(final Comparable seriesName, final SelectableDataSet sds, final String categories, final String y); + ////////////////////////// tree map plot ////////////////////////// + + /** + * Creates a treemap plot. Required columns are values, ids, and parents, the rest can be null. + * @param seriesName + * @param t + * @param values + * @param ids + * @param parents + * @param labels + * @param text + * @param color + * @param hoverText + * @return + */ + CategoryDataSeries treeMapPlot(Comparable seriesName, Table t, String values, String ids, String parents, @Nullable String labels, @Nullable String text, @Nullable String color, @Nullable String hoverText); + + ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// ////////////////////////////// TO REGENERATE RUN GenerateAxesPlotMethods ////////////////////////////// ////////////////////////////// AND THEN RUN GeneratePlottingConvenience ////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java index 98894e264b3..6ad1d3f594c 100644 --- a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java @@ -47,6 +47,7 @@ import io.deephaven.gui.color.Paint; import io.deephaven.time.calendar.BusinessCalendar; import groovy.lang.Closure; +import org.jetbrains.annotations.Nullable; import java.io.Serializable; import java.util.*; @@ -213,6 +214,8 @@ public PlotStyle getPlotStyle() { return PlotStyle.OHLC; case PIE: return PlotStyle.PIE; + case TREEMAP: + return PlotStyle.TREEMAP; default: throw new PlotUnsupportedOperationException( "No default plot style for chart type: " + chart.getChartType(), this); @@ -251,6 +254,14 @@ private void configureOHLCPlot() { initialize(); } + private void configureTreeMapPlot() { + this.setDimension(2); + chart.setChartType(ChartType.TREEMAP); + xAxis().setType(AxisImpl.Type.CATEGORY); + yAxis().setType(AxisImpl.Type.NUMBER); + initialize(); + } + private void initialize() { chart.setInitialized(true); } @@ -1854,6 +1865,38 @@ public CategoryDataSeriesInternal piePlot(final Comparable seriesName, final Sel } // endregion + // region Tree Map + + private CategoryDataSeriesInternal treeMapPlot(final CategoryDataSeriesInternal ds, final TableHandle[] tableHandles, + final SwappableTable[] swappableTables) { + configureTreeMapPlot(); + + if (tableHandles != null) { + for (TableHandle tableHandle : tableHandles) { + ds.addTableHandle(tableHandle); + } + } + + if (swappableTables != null) { + for (SwappableTable swappableTable : swappableTables) { + ds.addSwappableTable(swappableTable); + } + } + + registerDataSeries(SeriesCollection.SeriesType.CATEGORY, false, ds); + return ds; + } + + + @Override + public CategoryDataSeries treeMapPlot(Comparable seriesName, Table t, String values, String ids, String parents, @Nullable String labels, @Nullable String text, @Nullable String color, @Nullable String hoverText) { + final TableHandle h = PlotUtils.createCategoryTableHandle(t, new String[] { ids }, values, parents, labels, text, color, hoverText); + return treeMapPlot(new CategoryTreeMapDataSeriesTableMap(this, dataSeries.nextId(), seriesName, h, ids, parents, labels, values, text, color, hoverText), new TableHandle[]{h}, null); + } + + + // endregion + ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// ////////////////////////////// TO REGENERATE RUN GenerateAxesPlotMethods ////////////////////////////// ////////////////////////////// AND THEN RUN GeneratePlottingConvenience ////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/ChartType.java b/Plot/src/main/java/io/deephaven/plot/ChartType.java index 4147ebfa18a..b0e10864bf9 100644 --- a/Plot/src/main/java/io/deephaven/plot/ChartType.java +++ b/Plot/src/main/java/io/deephaven/plot/ChartType.java @@ -25,5 +25,10 @@ public enum ChartType { /** * Has one discrete axis. */ - CATEGORY + CATEGORY, + + /** + * A category axis for hierarchy, and a numeric axis for values. + */ + TREEMAP, } diff --git a/Plot/src/main/java/io/deephaven/plot/Figure.java b/Plot/src/main/java/io/deephaven/plot/Figure.java index 809d33e889d..1f291f140a1 100644 --- a/Plot/src/main/java/io/deephaven/plot/Figure.java +++ b/Plot/src/main/java/io/deephaven/plot/Figure.java @@ -817,6 +817,8 @@ public interface Figure extends java.io.Serializable, io.deephaven.plot.BaseFigu @Override Figure transform( io.deephaven.plot.axistransformations.AxisTransform transform ); + @Override Figure treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ); + @Override Figure twin( ); @Override Figure twin( java.lang.String name ); diff --git a/Plot/src/main/java/io/deephaven/plot/FigureImpl.java b/Plot/src/main/java/io/deephaven/plot/FigureImpl.java index 3dc19811dd5..122c006fbe6 100644 --- a/Plot/src/main/java/io/deephaven/plot/FigureImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/FigureImpl.java @@ -2731,6 +2731,12 @@ private FigureImpl applyFunctionalProperties() { return make(null, axis); } + @Override public FigureImpl treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ) { + final BaseFigureImpl fc = this.figure.copy(); + final DataSeriesInternal series = (DataSeriesInternal) axes(fc).treeMapPlot( seriesName, t, values, ids, parents, labels, text, color, hoverText); + return make(series); + } + @Override public FigureImpl twin( ) { final BaseFigureImpl fc = this.figure.copy(); final AxesImpl axes = (AxesImpl) axes(fc).twin(); diff --git a/Plot/src/main/java/io/deephaven/plot/PlotStyle.java b/Plot/src/main/java/io/deephaven/plot/PlotStyle.java index 3434ce34423..72e01f91b33 100644 --- a/Plot/src/main/java/io/deephaven/plot/PlotStyle.java +++ b/Plot/src/main/java/io/deephaven/plot/PlotStyle.java @@ -72,8 +72,12 @@ public enum PlotStyle { * * Points are not displayed by default. */ - ERROR_BAR; + ERROR_BAR, + /** + * A treemap plot. + */ + TREEMAP; /** * Returns the requested plot style. diff --git a/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java b/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java index 06ece704d80..1731b336d0d 100644 --- a/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java +++ b/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java @@ -2693,5 +2693,12 @@ public static io.deephaven.plot.Figure plotBy( java.lang.Comparable seriesName, return FigureFactory.figure().plotBy( seriesName, sds, x, y, byColumns ); } + /** + * See {@link io.deephaven.plot.Figure#treeMapPlot} + **/ + public static io.deephaven.plot.Figure treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ) { + return FigureFactory.figure().treeMapPlot( seriesName, t, values, ids, parents, labels, text, color, hoverText ); + } + } diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java b/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java new file mode 100644 index 00000000000..4bde81f8b3b --- /dev/null +++ b/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java @@ -0,0 +1,112 @@ +package io.deephaven.plot.datasets.category; + +import io.deephaven.engine.table.Table; +import io.deephaven.plot.AxesImpl; +import io.deephaven.plot.TableSnapshotSeries; +import io.deephaven.plot.util.tables.TableHandle; + +import java.util.Collection; + +public class CategoryTreeMapDataSeriesTableMap extends AbstractTableBasedCategoryDataSeries + implements CategoryTableDataSeriesInternal, TableSnapshotSeries { + + private final TableHandle tableHandle; + private final String idColumn; + private final String parentColumn; + private final String labelColumn; + private final String valueColumn; + private final String colorColumn; + private final String hoverTextColumn; + + private final String textColumn; + + public CategoryTreeMapDataSeriesTableMap(AxesImpl axes, int id, Comparable name, TableHandle h, String idColumn, + String parentColumn, String labelColumn, String valueColumn, String textColumn, String colorColumn, + String hoverTextColumn) { + super(axes, id, name, null); + this.tableHandle = h; + this.idColumn = idColumn; + this.parentColumn = parentColumn; + this.labelColumn = labelColumn; + this.valueColumn = valueColumn; + this.textColumn = textColumn; + this.colorColumn = colorColumn; + this.hoverTextColumn = hoverTextColumn; + } + + public CategoryTreeMapDataSeriesTableMap(CategoryTreeMapDataSeriesTableMap series, AxesImpl axes) { + super(series, axes); + this.tableHandle = series.getTableHandle(); + this.idColumn = series.getCategoryCol(); + this.parentColumn = series.getParentColumn(); + this.labelColumn = series.getLabelColumn(); + this.valueColumn = series.getValueCol(); + this.textColumn = series.getTextColumn(); + this.colorColumn = series.getColorColumn(); + this.hoverTextColumn = series.getHoverTextColumn(); + } + + @Override + public int size() { + throw new UnsupportedOperationException("size()"); + } + + @Override + protected Table getTable() { + return tableHandle.getTable(); + } + + public TableHandle getTableHandle() { + return tableHandle; + } + + @Override + public String getCategoryCol() { + return idColumn; + } + + @Override + public String getValueCol() { + return valueColumn; + } + + public String getTextColumn() { + return textColumn; + } + + public String getParentColumn() { + return parentColumn; + } + + public String getLabelColumn() { + return labelColumn; + } + + public String getColorColumn() { + return colorColumn; + } + + public String getHoverTextColumn() { + return hoverTextColumn; + } + + @Override + public CategoryDataSeriesInternal copy(AxesImpl axes) { + return new CategoryTreeMapDataSeriesTableMap(this, axes); + } + + @Override + public Collection categories() { + throw new UnsupportedOperationException("categories()"); + } + + @Override + public Number getValue(Comparable category) { + throw new UnsupportedOperationException("getValue()"); + } + + @Override + public long getCategoryLocation(Comparable category) { + throw new UnsupportedOperationException("getCategoryLocation()"); + } +} diff --git a/engine/table/src/main/java/io/deephaven/gui/color/Color.java b/engine/table/src/main/java/io/deephaven/gui/color/Color.java index 571b2c49f88..aad4061a629 100644 --- a/engine/table/src/main/java/io/deephaven/gui/color/Color.java +++ b/engine/table/src/main/java/io/deephaven/gui/color/Color.java @@ -130,6 +130,9 @@ public Color(final float r, final float g, final float b, final float a) { color = new java.awt.Color(r, g, b, a); } + public String toHex() { + return String.format("#%02X%02X%02X", color.getRed(), color.getGreen(), color.getBlue()); + } ////////////////////////// internal functionality ////////////////////////// diff --git a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java index d1bee5b793b..e29a678dd30 100644 --- a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java +++ b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java @@ -20,6 +20,7 @@ import io.deephaven.plot.datasets.AbstractDataSeries; import io.deephaven.plot.datasets.category.AbstractCategoryDataSeries; import io.deephaven.plot.datasets.category.CategoryDataSeriesMap; +import io.deephaven.plot.datasets.category.CategoryTreeMapDataSeriesTableMap; import io.deephaven.plot.datasets.category.CategoryDataSeriesPartitionedTable; import io.deephaven.plot.datasets.category.CategoryDataSeriesSwappablePartitionedTable; import io.deephaven.plot.datasets.data.IndexableNumericData; @@ -354,6 +355,24 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) { makeSourceDescriptor(series.getSwappableTable(), series.getNumericCol(), numAxis == xAxis ? SourceType.X : SourceType.Y, numAxis)); + } else if (s instanceof CategoryTreeMapDataSeriesTableMap) { + CategoryTreeMapDataSeriesTableMap series = (CategoryTreeMapDataSeriesTableMap) s; + clientAxes + .add(makeSourceDescriptor(series.getTableHandle(), series.getCategoryCol(), + catAxis == xAxis ? SourceType.X : SourceType.Y, catAxis)); + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), series.getValueCol(), + numAxis == xAxis ? SourceType.X : SourceType.Y, numAxis)); + + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getParentColumn(), SourceType.PARENT, null)); + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getLabelColumn(), SourceType.LABEL, null)); + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getColorColumn(), SourceType.COLOR, null)); + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getHoverTextColumn(), SourceType.HOVER_TEXT, null)); + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getTextColumn(), SourceType.TEXT, null)); } else if (s instanceof CategoryDataSeriesMap) {// bar and plot from constant data errorList.add("OpenAPI presently does not support series of type " + s.getClass()); } @@ -688,7 +707,7 @@ private SourceDescriptor makeSourceDescriptor(TableHandle tableHandle, String co source.setColumnName(columnName); source.setTableId(tablePositionMap.get(tableHandle)); source.setPartitionedTableId(-1); - source.setAxisId(axis.getId()); + source.setAxisId(axis == null ? "-1" : axis.getId()); source.setType(sourceType); return source.build(); diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto index 4309271ba07..377f00e94fd 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto @@ -232,6 +232,7 @@ message FigureDescriptor { CATEGORY = 3; XYZ = 4; CATEGORY_3D = 5; + TREEMAP = 6; } int32 colspan = 1; int32 rowspan = 2; @@ -265,6 +266,7 @@ message FigureDescriptor { SCATTER = 8; STEP = 9; ERROR_BAR = 10; + TREEMAP = 11; } message SeriesDescriptor { @@ -438,6 +440,9 @@ message FigureDescriptor { SIZE = 13; LABEL = 14; COLOR = 15; + PARENT = 16; + HOVER_TEXT = 17; + TEXT = 18; } message SourceDescriptor { string axis_id = 1; diff --git a/py/server/deephaven/plot/color.py b/py/server/deephaven/plot/color.py index 574dde752dd..d1ae7f6c53e 100644 --- a/py/server/deephaven/plot/color.py +++ b/py/server/deephaven/plot/color.py @@ -27,6 +27,9 @@ def j_object(self) -> jpy.JType: def __init__(self, j_color: jpy.JType): self.j_color = j_color + def to_hex(self) -> str: + return self.j_color.toHex() + @staticmethod def of_name(name: str) -> Color: """ Creates a Color instance represented by the name string. diff --git a/py/server/deephaven/plot/figure.py b/py/server/deephaven/plot/figure.py index 5c4ab09ca92..338a44d3293 100644 --- a/py/server/deephaven/plot/figure.py +++ b/py/server/deephaven/plot/figure.py @@ -1202,6 +1202,74 @@ def plot_pie( else: raise DHError(f"unsupported parameter combination: {non_null_args}") + def plot_tree_map( + self, + t: Union[Table, SelectableDataSet], + series_name: str = None, + hover_text_column: str = None, + ids_column: str = None, + labels_column: str = None, + parents_column: str = None, + text_column: str = None, + values_column: str = None, + color: Union[str, int, Color] = None, + ) -> Figure: + """ + + Args: + t (Union[Table, SelectableDataSet]): table or selectable data set (e.g. OneClick filterable table) + series_name (str): name of the data series + hover_text_column (str): + ids_column (str): + labels_column (str): + parents_column (str): + text_column (str): + values_column (str): + color (Union[str, int, Color]): color + + Returns: + a new Figure + + Raises: + DHError + """ + if not t: + raise DHError("required parameter is not set: t") + non_null_args = set() + + if t is not None: + non_null_args.add("t") + t = _convert_j("t", t, [Table, SelectableDataSet]) + if series_name is not None: + non_null_args.add("series_name") + series_name = _convert_j("series_name", series_name, [str]) + if hover_text_column is not None: + non_null_args.add("hover_text_column") + hover_text_column = _convert_j("hover_text_column", hover_text_column, [str]) + if ids_column is not None: + non_null_args.add("ids_column") + ids_column = _convert_j("ids_column", ids_column, [str]) + if labels_column is not None: + non_null_args.add("labels_column") + labels_column = _convert_j("labels_column", labels_column, [str]) + if parents_column is not None: + non_null_args.add("parents_column") + parents_column = _convert_j("parents_column", parents_column, [str]) + if text_column is not None: + non_null_args.add("text_column") + text_column = _convert_j("text_column", text_column, [str]) + if values_column is not None: + non_null_args.add("values_column") + values_column = _convert_j("values_column", values_column, [str]) + if color is not None: + non_null_args.add("color") + color = _convert_j("color", color, [str, int, Color]) + + if non_null_args == {"series_name", "t", "values_column", "ids_column", "parents_column", "labels_column", "text_column", "color", "hover_text_column"}: + return Figure(self.j_figure.treeMapPlot(series_name, t, values_column, ids_column, parents_column, labels_column, text_column, color, hover_text_column)) + else: + raise DHError(f"unsupported parameter combination: {non_null_args}") + def plot_xy( self, series_name: str, diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java index 6a83b2be784..a08a49036e4 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java @@ -442,7 +442,8 @@ private DownsampleParams makeParamsForSeries(JsSeries s) { // ... again, loop and find x axis, this time also y cols for (int i = 0; i < s.getSources().length; i++) { SeriesDataSource source = s.getSources()[i]; - DownsampledAxisDetails downsampledAxisDetails = downsampled.get(source.getAxis().getDescriptor()); + DownsampledAxisDetails downsampledAxisDetails = + source.getAxis() != null ? downsampled.get(source.getAxis().getDescriptor()) : null; if (downsampledAxisDetails == null) { yCols[yCols.length] = source.getDescriptor().getColumnName(); } else { diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsChartType.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsChartType.java index 6835def2ec2..df6f895c6ea 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsChartType.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsChartType.java @@ -15,4 +15,5 @@ public class JsChartType { public static final int CATEGORY = ChartDescriptor.ChartType.getCATEGORY(); public static final int XYZ = ChartDescriptor.ChartType.getXYZ(); public static final int CATEGORY_3D = ChartDescriptor.ChartType.getCATEGORY_3D(); + public static final int TREEMAP = ChartDescriptor.ChartType.getTREEMAP(); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSeriesPlotStyle.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSeriesPlotStyle.java index 369b2e7251e..a0f77a19a70 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSeriesPlotStyle.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSeriesPlotStyle.java @@ -20,4 +20,5 @@ public class JsSeriesPlotStyle { public static final int SCATTER = FigureDescriptor.SeriesPlotStyle.getSCATTER(); public static final int STEP = FigureDescriptor.SeriesPlotStyle.getSTEP(); public static final int ERROR_BAR = FigureDescriptor.SeriesPlotStyle.getERROR_BAR(); + public static final int TREEMAP = FigureDescriptor.SeriesPlotStyle.getTREEMAP(); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java index 9364f29b03a..839a17664e7 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java @@ -25,4 +25,7 @@ public class JsSourceType { public static final int SIZE = FigureDescriptor.SourceType.getSIZE(); public static final int LABEL = FigureDescriptor.SourceType.getLABEL(); public static final int COLOR = FigureDescriptor.SourceType.getCOLOR(); + public static final int PARENT = FigureDescriptor.SourceType.getPARENT(); + public static final int HOVER_TEXT = FigureDescriptor.SourceType.getHOVER_TEXT(); + public static final int TEXT = FigureDescriptor.SourceType.getTEXT(); } diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SeriesPlotStyleMap.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SeriesPlotStyleMap.java index 2a989893d67..807394a04f0 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SeriesPlotStyleMap.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SeriesPlotStyleMap.java @@ -53,6 +53,9 @@ static SeriesPlotStyleMap create() { @JsProperty(name = "STEP") int getSTEP(); + @JsProperty(name = "TREEMAP") + int getTREEMAP(); + @JsProperty(name = "AREA") void setAREA(int AREA); @@ -85,4 +88,7 @@ static SeriesPlotStyleMap create() { @JsProperty(name = "STEP") void setSTEP(int STEP); + + @JsProperty(name = "TREEMAP") + void setTREEMAP(int TREEMAP); } diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SourceTypeMap.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SourceTypeMap.java index 6e29cfc7c29..2e05c8e574f 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SourceTypeMap.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/SourceTypeMap.java @@ -29,6 +29,12 @@ static SourceTypeMap create() { @JsProperty(name = "HIGH") int getHIGH(); + @JsProperty(name = "HOVER_TEXT") + int getHOVER_TEXT(); + + @JsProperty(name = "TEXT") + int getTEXT(); + @JsProperty(name = "LABEL") int getLABEL(); @@ -38,6 +44,9 @@ static SourceTypeMap create() { @JsProperty(name = "OPEN") int getOPEN(); + @JsProperty(name = "PARENT") + int getPARENT(); + @JsProperty(name = "SHAPE") int getSHAPE(); @@ -77,6 +86,12 @@ static SourceTypeMap create() { @JsProperty(name = "HIGH") void setHIGH(int HIGH); + @JsProperty(name = "HOVER_TEXT") + void setHOVER_TEXT(int HOVER_TEXT); + + @JsProperty(name = "TEXT") + void setTEXT(int TEXT); + @JsProperty(name = "LABEL") void setLABEL(int LABEL); @@ -86,6 +101,9 @@ static SourceTypeMap create() { @JsProperty(name = "OPEN") void setOPEN(int OPEN); + @JsProperty(name = "PARENT") + void setPARENT(int PARENT); + @JsProperty(name = "SHAPE") void setSHAPE(int SHAPE); diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/chartdescriptor/ChartTypeMap.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/chartdescriptor/ChartTypeMap.java index 44514a83404..73ce2d90bfc 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/chartdescriptor/ChartTypeMap.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/figuredescriptor/chartdescriptor/ChartTypeMap.java @@ -32,6 +32,9 @@ static ChartTypeMap create() { @JsProperty(name = "PIE") int getPIE(); + @JsProperty(name = "TREEMAP") + int getTREEMAP(); + @JsProperty(name = "XY") int getXY(); @@ -50,6 +53,9 @@ static ChartTypeMap create() { @JsProperty(name = "PIE") void setPIE(int PIE); + @JsProperty(name = "TREEMAP") + void setTREEMAP(int TREEMAP); + @JsProperty(name = "XY") void setXY(int XY); From efd93f52daec21350d3ba5e28b91072b41578e2e Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 8 Jul 2022 12:05:36 -0500 Subject: [PATCH 007/215] Remove unnecessary null checks in js api for figures (#2620) Follow-up to #2612, #2617 --- .../web/client/api/widget/plot/JsFigure.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java index a08a49036e4..93ff24325af 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java @@ -149,15 +149,11 @@ public Promise refetch() { for (int i = 0; i < tables.length; i++) { JsTable table = tables[i]; - if (table != null) { - registerTableWithId(table, Js.cast(JsArray.of((double) i))); - } + registerTableWithId(table, Js.cast(JsArray.of((double) i))); } for (int i = 0; i < partitionedTables.length; i++) { JsPartitionedTable partitionedTable = partitionedTables[i]; - if (partitionedTable != null) { - registerPartitionedTableWithId(partitionedTable, Js.cast(JsArray.of((double) i))); - } + registerPartitionedTableWithId(partitionedTable, Js.cast(JsArray.of((double) i))); } Arrays.stream(charts) .flatMap(c -> Arrays.stream(c.getSeries())) @@ -497,7 +493,7 @@ public int getPixelCount() { public void enqueueSubscriptionCheck() { if (!subCheckEnqueued) { for (JsTable table : tables) { - if (table != null && table.isClosed()) { + if (table.isClosed()) { throw new IllegalStateException("Cannot subscribe, at least one table is disconnected"); } } @@ -536,7 +532,7 @@ public void close() { } if (tables != null) { - Arrays.stream(tables).filter(t -> t != null && !t.isClosed()).forEach(JsTable::close); + Arrays.stream(tables).filter(t -> !t.isClosed()).forEach(JsTable::close); } if (partitionedTables != null) { Arrays.stream(partitionedTables).forEach(JsPartitionedTable::close); From 6ee716160d30dc2cf468f3fce8b83ddfcf6404bf Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 8 Jul 2022 13:49:35 -0700 Subject: [PATCH 008/215] Bump node (#2630) --- docker/registry/node/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index c6f382e71c9..6822a0dd3f0 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:ce156f9b2e9dbe73139cf0619a71188960e6c9eaba0ff832a5dfa0febf9eee27 +deephaven.registry.imageId=node@sha256:ff56fbc429bf3b3c111827f9903e5ab05078ef233328dcf1666f40f63ddb9972 From 9a160ed23a060dafb38af318ec47fd611650eef8 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 11 Jul 2022 10:52:50 -0700 Subject: [PATCH 009/215] Bump node and protoc-base images (#2634) --- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index 6822a0dd3f0..73190d5633c 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:ff56fbc429bf3b3c111827f9903e5ab05078ef233328dcf1666f40f63ddb9972 +deephaven.registry.imageId=node@sha256:0c571044148fd772bbc03fd42d293939ce3e39d7aa1e095dd87c33ce89796829 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 9735537a27e..30299345e6a 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:8b67d4a73d406e37b8ea56d509bf31a24daee654d3877a286fadd958b03bc702 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:37bbd8e00c12c6e21a78b71c8dee3995aab7305f29f71ed4168ddad066a99dcf From c4415bcb389ad182a8c0890416f3c2728a31c54b Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 11 Jul 2022 12:43:21 -0700 Subject: [PATCH 010/215] UpdateBy config changes in support of gRPC (#2633) --- .../engine/table/impl/BucketedUpdateBy.java | 23 +- .../deephaven/engine/table/impl/UpdateBy.java | 4 +- .../table/impl/UpdateByOperatorFactory.java | 20 +- .../engine/table/impl/ZeroKeyUpdateBy.java | 7 +- .../ema/BasePrimitiveEMAOperator.java | 22 +- .../updateby/ema/BigDecimalEMAOperator.java | 14 +- .../updateby/ema/BigIntegerEMAOperator.java | 18 +- .../updateby/ema/BigNumberEMAOperator.java | 18 +- .../impl/updateby/ema/DoubleEMAOperator.java | 2 +- .../impl/updateby/ema/FloatEMAOperator.java | 2 +- .../table/impl/updateby/TestCumProd.java | 2 +- .../table/impl/updateby/TestCumSum.java | 2 +- .../engine/table/impl/updateby/TestEma.java | 62 ++-- .../impl/updateby/TestUpdateByGeneral.java | 18 +- .../api/updateby/BadDataBehavior.java | 8 +- .../io/deephaven/api/updateby/EmaControl.java | 94 +++++-- .../api/updateby/UpdateByControl.java | 264 +++++++++++++----- .../deephaven/api/updateby/spec/EmaSpec.java | 49 ++-- 18 files changed, 383 insertions(+), 246 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java index e711060bd91..8c1fc20611f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java @@ -128,11 +128,12 @@ private class BucketedContext implements SafeCloseable { BucketedContext(@NotNull final TableUpdate upstream, @NotNull final ModifiedColumnSet keyModifiedColumnSet, @Nullable final ModifiedColumnSet[] inputModifiedColumnSets) { - final int updateSize = UpdateSizeCalculator.chunkSize(upstream, control.chunkCapacity()); + final int updateSize = UpdateSizeCalculator.chunkSize(upstream, control.chunkCapacityOrDefault()); this.inputChunkPopulated = new boolean[operators.length]; this.keysModified = upstream.modifiedColumnSet().containsAny(keyModifiedColumnSet); - this.chunkSize = UpdateSizeCalculator.chunkSize(updateSize, upstream.shifted(), control.chunkCapacity()); + this.chunkSize = + UpdateSizeCalculator.chunkSize(updateSize, upstream.shifted(), control.chunkCapacityOrDefault()); this.opAffected = new boolean[operators.length]; // noinspection unchecked this.fillContexts = new SizedSafeCloseable[operators.length]; @@ -722,7 +723,7 @@ public void processBucketedUpdates() { } try (final RowSequence.Iterator okIt = modifiedBucketIndex.getRowSequenceIterator()) { - final int newChunkSize = (int) Math.min(control.chunkCapacity(), modifiedBucketIndex.size()); + final int newChunkSize = (int) Math.min(control.chunkCapacityOrDefault(), modifiedBucketIndex.size()); setChunkSize(newChunkSize); initializeFor(modifiedBucketIndex, UpdateType.Reprocess); @@ -957,7 +958,7 @@ private class GroupedContext implements SafeCloseable { final WritableChunk[] postWorkingChunks; GroupedContext(final TableUpdate upstream) { - this.chunkSize = Math.min((int) source.size(), control.chunkCapacity()); + this.chunkSize = Math.min((int) source.size(), control.chunkCapacityOrDefault()); this.inputChunkPopulated = new boolean[operators.length]; this.fillContexts = new ChunkSource.FillContext[operators.length]; this.opContext = new UpdateByOperator.UpdateContext[operators.length]; @@ -1068,20 +1069,20 @@ private BucketedUpdateBy(@NotNull final UpdateByOperator[] operators, this.keySources = keySources; if (source.isRefreshing() && !source.isAddOnly()) { - final int hashTableSize = control.initialHashTableSize(); - slotTracker = new UpdateBySlotTracker(control.chunkCapacity()); + final int hashTableSize = control.initialHashTableSizeOrDefault(); + slotTracker = new UpdateBySlotTracker(control.chunkCapacityOrDefault()); this.hashTable = new IncrementalUpdateByStateManager(keySources, hashTableSize, - control.maximumLoadFactor(), - control.targetLoadFactor()); + control.maximumLoadFactorOrDefault(), + control.targetLoadFactorOrDefault()); } else { slotTracker = null; if (!useGrouping) { - final int hashTableSize = control.initialHashTableSize(); + final int hashTableSize = control.initialHashTableSizeOrDefault(); this.hashTable = new AddOnlyUpdateByStateManager(keySources, hashTableSize, - control.maximumLoadFactor(), - control.targetLoadFactor()); + control.maximumLoadFactorOrDefault(), + control.targetLoadFactorOrDefault()); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java index 87f810868cc..2ea7e478334 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java @@ -87,10 +87,10 @@ public static Table updateBy(@NotNull final QueryTable source, @NotNull final UpdateByControl control) { WritableRowRedirection rowRedirection = null; - if (control.useRedirection()) { + if (control.useRedirectionOrDefault()) { if (!source.isRefreshing()) { if (!source.isFlat() && SparseConstants.sparseStructureExceedsOverhead(source.getRowSet(), - control.maxStaticSparseMemoryOverhead())) { + control.maxStaticSparseMemoryOverheadOrDefault())) { rowRedirection = new InverseRowRedirectionImpl(source.getRowSet()); } } else { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java index 57e03e7b4ec..213a323f80e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java @@ -225,28 +225,28 @@ private UpdateByOperator makeEmaOperator(@NotNull final MatchPair pair, final long timeScaleUnits = ema.timeScale().timescaleUnits(); if (csType == byte.class || csType == Byte.class) { - return new ByteEMAOperator(pair, affectingColumns, ema.control(), recorder, timeScaleUnits, + return new ByteEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == short.class || csType == Short.class) { - return new ShortEMAOperator(pair, affectingColumns, ema.control(), recorder, timeScaleUnits, + return new ShortEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == int.class || csType == Integer.class) { - return new IntEMAOperator(pair, affectingColumns, ema.control(), recorder, timeScaleUnits, + return new IntEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == long.class || csType == Long.class) { - return new LongEMAOperator(pair, affectingColumns, ema.control(), recorder, timeScaleUnits, + return new LongEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == float.class || csType == Float.class) { - return new FloatEMAOperator(pair, affectingColumns, ema.control(), recorder, timeScaleUnits, + return new FloatEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == double.class || csType == Double.class) { - return new DoubleEMAOperator(pair, affectingColumns, ema.control(), recorder, + return new DoubleEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == BigDecimal.class) { - return new BigDecimalEMAOperator(pair, affectingColumns, ema.control(), recorder, + return new BigDecimalEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } else if (csType == BigInteger.class) { - return new BigIntegerEMAOperator(pair, affectingColumns, ema.control(), recorder, + return new BigIntegerEMAOperator(pair, affectingColumns, ema.controlOrDefault(), recorder, timeScaleUnits, columnSource, rowRedirection); } @@ -285,7 +285,7 @@ private UpdateByOperator makeCumProdOperator(MatchPair fc, TableWithDefaults sou } else if (csType == double.class || csType == Double.class) { return new DoubleCumProdOperator(fc, rowRedirection); } else if (csType == BigDecimal.class) { - return new BigDecimalCumProdOperator(fc, rowRedirection, control.mathContext()); + return new BigDecimalCumProdOperator(fc, rowRedirection, control.mathContextOrDefault()); } else if (csType == BigInteger.class) { return new BigIntegerCumProdOperator(fc, rowRedirection); } @@ -333,7 +333,7 @@ private UpdateByOperator makeCumSumOperator(MatchPair fc, TableWithDefaults sour } else if (csType == double.class || csType == Double.class) { return new DoubleCumSumOperator(fc, rowRedirection); } else if (csType == BigDecimal.class) { - return new BigDecimalCumSumOperator(fc, rowRedirection, control.mathContext()); + return new BigDecimalCumSumOperator(fc, rowRedirection, control.mathContextOrDefault()); } else if (csType == BigInteger.class) { return new BigIntegerCumSumOperator(fc, rowRedirection); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/ZeroKeyUpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/ZeroKeyUpdateBy.java index 93eee7a88cd..9a15d6260c0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/ZeroKeyUpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/ZeroKeyUpdateBy.java @@ -133,9 +133,10 @@ private class UpdateContext implements SafeCloseable { UpdateContext(@NotNull final TableUpdate upstream, @Nullable final ModifiedColumnSet[] inputModifiedColumnSets, final boolean isInitializeStep) { - final int updateSize = UpdateSizeCalculator.chunkSize(upstream, control.chunkCapacity()); + final int updateSize = UpdateSizeCalculator.chunkSize(upstream, control.chunkCapacityOrDefault()); - this.chunkSize = UpdateSizeCalculator.chunkSize(updateSize, upstream.shifted(), control.chunkCapacity()); + this.chunkSize = + UpdateSizeCalculator.chunkSize(updateSize, upstream.shifted(), control.chunkCapacityOrDefault()); this.opAffected = new boolean[operators.length]; // noinspection unchecked this.fillContexts = new SizedSafeCloseable[operators.length]; @@ -413,7 +414,7 @@ private void reprocessRows(RowSetShiftData shifted) { final RowSet sourceRowSet = source.getRowSet(); try (final RowSet indexToReprocess = sourceRowSet.subSetByKeyRange(smallestModifiedKey, sourceRowSet.lastRowKey())) { - final int newChunkSize = (int) Math.min(control.chunkCapacity(), indexToReprocess.size()); + final int newChunkSize = (int) Math.min(control.chunkCapacityOrDefault(), indexToReprocess.size()); setChunkSize(newChunkSize); final long keyBefore; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java index 7bbc1e9a704..273e2745d2b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java @@ -288,25 +288,25 @@ void handleBadData(@NotNull final EmaContext ctx, final boolean isNullTime) { boolean doReset = false; if (isNull) { - if (control.onNullValue() == BadDataBehavior.Throw) { + if (control.onNullValueOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered null value during EMA processing"); } - doReset = control.onNullValue() == BadDataBehavior.Reset; + doReset = control.onNullValueOrDefault() == BadDataBehavior.RESET; } else if (isNan) { - if (control.onNanValue() == BadDataBehavior.Throw) { + if (control.onNanValueOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered NaN value during EMA processing"); - } else if (control.onNanValue() == BadDataBehavior.Poison) { + } else if (control.onNanValueOrDefault() == BadDataBehavior.POISON) { ctx.curVal = Double.NaN; } else { - doReset = control.onNanValue() == BadDataBehavior.Reset; + doReset = control.onNanValueOrDefault() == BadDataBehavior.RESET; } } if (isNullTime) { - if (control.onNullTime() == BadDataBehavior.Throw) { + if (control.onNullTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered null timestamp during EMA processing"); } - doReset = control.onNullTime() == BadDataBehavior.Reset; + doReset = control.onNullTimeOrDefault() == BadDataBehavior.RESET; } if (doReset) { @@ -318,15 +318,15 @@ void handleBadData(@NotNull final EmaContext ctx, void handleBadTime(@NotNull final EmaContext ctx, final long dt) { boolean doReset = false; if (dt == 0) { - if (control.onZeroDeltaTime() == BadDataBehavior.Throw) { + if (control.onZeroDeltaTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered zero delta time during EMA processing"); } - doReset = control.onZeroDeltaTime() == BadDataBehavior.Reset; + doReset = control.onZeroDeltaTimeOrDefault() == BadDataBehavior.RESET; } else if (dt < 0) { - if (control.onNegativeDeltaTime() == BadDataBehavior.Throw) { + if (control.onNegativeDeltaTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered negative delta time during EMA processing"); } - doReset = control.onNegativeDeltaTime() == BadDataBehavior.Reset; + doReset = control.onNegativeDeltaTimeOrDefault() == BadDataBehavior.RESET; } if (doReset) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java index 1a0e310a970..de7011ddcc7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java @@ -57,9 +57,9 @@ void computeWithTicks(final EmaContext ctx, if (ctx.curVal == null) { ctx.curVal = input; } else { - ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContext()) - .add(input.multiply(ctx.oneMinusAlpha, control.bigValueContext()), - control.bigValueContext()); + ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContextOrDefault()) + .add(input.multiply(ctx.oneMinusAlpha, control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()); } } @@ -90,11 +90,11 @@ void computeWithTime(final EmaContext ctx, handleBadTime(ctx, dt); } else { ctx.alpha = BigDecimal.valueOf(Math.exp(-dt / timeScaleUnits)); - ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContext()) + ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContextOrDefault()) .add(input.multiply( - BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContext()), - control.bigValueContext()), - control.bigValueContext()); + BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()); ctx.lastStamp = timestamp; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java index 9b4e5324d55..b61137c43d5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java @@ -55,15 +55,15 @@ void computeWithTicks(final EmaContext ctx, if(input == null) { handleBadData(ctx, true, false); } else { - final BigDecimal decimalInput = new BigDecimal(input, control.bigValueContext()); + final BigDecimal decimalInput = new BigDecimal(input, control.bigValueContextOrDefault()); if(ctx.curVal == null) { ctx.curVal = decimalInput; } else { - ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContext()) + ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContextOrDefault()) .add(decimalInput.multiply( - BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContext()), - control.bigValueContext()), - control.bigValueContext()); + BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()); } } @@ -86,7 +86,7 @@ void computeWithTime(final EmaContext ctx, if(isNull || isNullTime) { handleBadData(ctx, isNull, isNullTime); } else { - final BigDecimal decimalInput = new BigDecimal(input, control.bigValueContext()); + final BigDecimal decimalInput = new BigDecimal(input, control.bigValueContextOrDefault()); if(ctx.curVal == null) { ctx.curVal = decimalInput; ctx.lastStamp = timestamp; @@ -96,9 +96,9 @@ void computeWithTime(final EmaContext ctx, handleBadTime(ctx, dt); } else { ctx.alpha = BigDecimal.valueOf(Math.exp(-dt / timeScaleUnits)); - ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContext()) - .add(decimalInput.multiply(BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContext()), control.bigValueContext()), - control.bigValueContext()); + ctx.curVal = ctx.curVal.multiply(ctx.alpha, control.bigValueContextOrDefault()) + .add(decimalInput.multiply(BigDecimal.ONE.subtract(ctx.alpha, control.bigValueContextOrDefault()), control.bigValueContextOrDefault()), + control.bigValueContextOrDefault()); ctx.lastStamp = timestamp; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java index 6823a9ae411..90ccfd147e4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java @@ -43,7 +43,7 @@ public abstract class BigNumberEMAOperator extends BaseObjectUpdateByOperator class EmaContext extends Context { BigDecimal alpha = BigDecimal.valueOf(Math.exp(-1 / timeScaleUnits)); BigDecimal oneMinusAlpha = - timeRecorder == null ? BigDecimal.ONE.subtract(alpha, control.bigValueContext()) : null; + timeRecorder == null ? BigDecimal.ONE.subtract(alpha, control.bigValueContextOrDefault()) : null; long lastStamp = NULL_LONG; EmaContext(final int chunkSize) { @@ -291,17 +291,17 @@ void handleBadData(@NotNull final EmaContext ctx, final boolean isNullTime) { boolean doReset = false; if (isNull) { - if (control.onNullValue() == BadDataBehavior.Throw) { + if (control.onNullValueOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered invalid data during EMA processing"); } - doReset = control.onNullValue() == BadDataBehavior.Reset; + doReset = control.onNullValueOrDefault() == BadDataBehavior.RESET; } if (isNullTime) { - if (control.onNullTime() == BadDataBehavior.Throw) { + if (control.onNullTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered null timestamp during EMA processing"); } - doReset = control.onNullTime() == BadDataBehavior.Reset; + doReset = control.onNullTimeOrDefault() == BadDataBehavior.RESET; } if (doReset) { @@ -313,15 +313,15 @@ void handleBadData(@NotNull final EmaContext ctx, void handleBadTime(@NotNull final EmaContext ctx, final long dt) { boolean doReset = false; if (dt == 0) { - if (control.onZeroDeltaTime() == BadDataBehavior.Throw) { + if (control.onZeroDeltaTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered zero delta time during EMA processing"); } - doReset = control.onZeroDeltaTime() == BadDataBehavior.Reset; + doReset = control.onZeroDeltaTimeOrDefault() == BadDataBehavior.RESET; } else if (dt < 0) { - if (control.onNegativeDeltaTime() == BadDataBehavior.Throw) { + if (control.onNegativeDeltaTimeOrDefault() == BadDataBehavior.THROW) { throw new TableDataException("Encountered negative delta time during EMA processing"); } - doReset = control.onNegativeDeltaTime() == BadDataBehavior.Reset; + doReset = control.onNegativeDeltaTimeOrDefault() == BadDataBehavior.RESET; } if (doReset) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java index 5d46cbaff63..d09a101d815 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java @@ -128,6 +128,6 @@ boolean isValueValid(long atKey) { // Note that we don't care about Reset because in that case the current EMA at this key would be null // and the superclass will do the right thing. - return !Double.isNaN(value) || control.onNanValue() != BadDataBehavior.Skip; + return !Double.isNaN(value) || control.onNanValueOrDefault() != BadDataBehavior.SKIP; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java index 14256c3aa4e..b26f5d5261d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java @@ -123,6 +123,6 @@ boolean isValueValid(long atKey) { // Note that we don't care about Reset because in that case the current EMA at this key would be null // and the superclass will do the right thing. - return !Float.isNaN(value) || control.onNanValue() != BadDataBehavior.Skip; + return !Float.isNaN(value) || control.onNanValueOrDefault() != BadDataBehavior.SKIP; } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java index 69da28afc9b..6253739316d 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java @@ -289,7 +289,7 @@ public static Object[] cumprod(Object[] values, final boolean isBD) { result[i] = result[i - 1]; } else if (isBD) { result[i] = ((BigDecimal) result[i - 1]).multiply((BigDecimal) values[i], - UpdateByControl.defaultInstance().mathContext()); + UpdateByControl.mathContextDefault()); } else { result[i] = ((BigInteger) result[i - 1]).multiply((BigInteger) values[i]); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java index 23e638d99ca..e54bf746953 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java @@ -321,7 +321,7 @@ public static Object[] cumSum(Object[] values, final boolean isBD) { result[i] = result[i - 1]; } else if (isBD) { result[i] = ((BigDecimal) result[i - 1]).add((BigDecimal) values[i], - UpdateByControl.defaultInstance().mathContext()); + UpdateByControl.mathContextDefault()); } else { result[i] = ((BigInteger) result[i - 1]).add((BigInteger) values[i]); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java index 072070824e1..a6650bb76d0 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java @@ -48,12 +48,12 @@ public void testStaticZeroKey() { convertDateTime("2022-03-09T16:30:00.000 NY"))}).t; final EmaControl skipControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Skip) - .onNanValue(BadDataBehavior.Skip).build(); + .onNullValue(BadDataBehavior.SKIP) + .onNanValue(BadDataBehavior.SKIP).build(); final EmaControl resetControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Reset) - .onNanValue(BadDataBehavior.Reset).build(); + .onNullValue(BadDataBehavior.RESET) + .onNanValue(BadDataBehavior.RESET).build(); computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, skipControl); computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, resetControl); @@ -82,12 +82,12 @@ private void doTestStaticBucketed(boolean grouped) { convertDateTime("2022-03-09T16:30:00.000 NY"))}).t; final EmaControl skipControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Skip) - .onNanValue(BadDataBehavior.Skip).build(); + .onNullValue(BadDataBehavior.SKIP) + .onNanValue(BadDataBehavior.SKIP).build(); final EmaControl resetControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Reset) - .onNanValue(BadDataBehavior.Reset).build(); + .onNullValue(BadDataBehavior.RESET) + .onNanValue(BadDataBehavior.RESET).build(); computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, skipControl, "Sym"); computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, resetControl, "Sym"); @@ -98,7 +98,7 @@ private void doTestStaticBucketed(boolean grouped) { @Test public void testThrowBehaviors() { final EmaControl throwControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Throw).build(); + .onNullValue(BadDataBehavior.THROW).build(); final TableWithDefaults bytes = testTable(RowSetFactory.flat(4).toTracking(), byteCol("col", (byte) 0, (byte) 1, NULL_BYTE, (byte) 3)); @@ -133,12 +133,12 @@ public void testThrowBehaviors() { assertThrows(TableDataException.class, () -> floats.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.Throw).build(), 10)), + UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.THROW).build(), 10)), "Encountered null value during EMA processing"); assertThrows(TableDataException.class, () -> floats.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.Throw).build(), 10)), + UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.THROW).build(), 10)), "Encountered NaN value during EMA processing"); TableWithDefaults doubles = testTable(RowSetFactory.flat(4).toTracking(), @@ -146,12 +146,12 @@ public void testThrowBehaviors() { assertThrows(TableDataException.class, () -> doubles.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.Throw).build(), 10)), + UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.THROW).build(), 10)), "Encountered null value during EMA processing"); assertThrows(TableDataException.class, () -> doubles.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.Throw).build(), 10)), + UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.THROW).build(), 10)), "Encountered NaN value during EMA processing"); @@ -227,16 +227,16 @@ private void testThrowsInternal(TableWithDefaults table) { assertThrows(TableDataException.class, () -> table.updateBy(UpdateByClause.Ema( EmaControl.builder() - .onNegativeDeltaTime(BadDataBehavior.Skip) - .onZeroDeltaTime(BadDataBehavior.Throw).build(), + .onNegativeDeltaTime(BadDataBehavior.SKIP) + .onZeroDeltaTime(BadDataBehavior.THROW).build(), "ts", 100)), "Encountered zero delta time during EMA processing"); assertThrows(TableDataException.class, () -> table.updateBy(UpdateByClause.Ema( EmaControl.builder() - .onNegativeDeltaTime(BadDataBehavior.Skip) - .onNullTime(BadDataBehavior.Throw).build(), + .onNegativeDeltaTime(BadDataBehavior.SKIP) + .onNullTime(BadDataBehavior.THROW).build(), "ts", 100)), "Encountered null timestamp during EMA processing"); } @@ -283,7 +283,7 @@ public void testResetBehavior() { // Test reset for NaN values final EmaControl resetControl = EmaControl.builder() - .onNanValue(BadDataBehavior.Reset) + .onNanValue(BadDataBehavior.RESET) .build(); TableWithDefaults input = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, Double.NaN, 1)); @@ -298,9 +298,9 @@ public void testResetBehavior() { } private void testResetBehaviorInternal(Table expected, final ColumnHolder ts, final ColumnHolder col) { - final EmaControl resetControl = EmaControl.builder().onNegativeDeltaTime(BadDataBehavior.Reset) - .onNullTime(BadDataBehavior.Reset) - .onZeroDeltaTime(BadDataBehavior.Reset) + final EmaControl resetControl = EmaControl.builder().onNegativeDeltaTime(BadDataBehavior.RESET) + .onNullTime(BadDataBehavior.RESET) + .onZeroDeltaTime(BadDataBehavior.RESET) .build(); TableWithDefaults input = testTable(RowSetFactory.flat(6).toTracking(), ts, col); @@ -310,10 +310,10 @@ private void testResetBehaviorInternal(Table expected, final ColumnHolder ts, fi @Test public void testPoison() { - final EmaControl nanCtl = EmaControl.builder().onNanValue(BadDataBehavior.Poison) - .onNullValue(BadDataBehavior.Reset) - .onNullTime(BadDataBehavior.Reset) - .onNegativeDeltaTime(BadDataBehavior.Reset) + final EmaControl nanCtl = EmaControl.builder().onNanValue(BadDataBehavior.POISON) + .onNullValue(BadDataBehavior.RESET) + .onNullTime(BadDataBehavior.RESET) + .onNegativeDeltaTime(BadDataBehavior.RESET) .build(); Table expected = testTable(RowSetFactory.flat(5).toTracking(), @@ -381,12 +381,12 @@ private void doTestTicking(boolean bucketed, boolean appendOnly) { } final EmaControl skipControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Skip) - .onNanValue(BadDataBehavior.Skip).build(); + .onNullValue(BadDataBehavior.SKIP) + .onNanValue(BadDataBehavior.SKIP).build(); final EmaControl resetControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Reset) - .onNanValue(BadDataBehavior.Reset).build(); + .onNullValue(BadDataBehavior.RESET) + .onNanValue(BadDataBehavior.RESET).build(); final EvalNugget[] nuggets = new EvalNugget[] { new EvalNugget() { @@ -464,10 +464,10 @@ private void computeEma(TableWithDefaults source, String... groups) { final boolean useTicks = StringUtils.isNullOrEmpty(tsCol); final ByEmaSimple bes = new ByEmaSimple( - control.onNullValue() == BadDataBehavior.Reset + control.onNullValueOrDefault() == BadDataBehavior.RESET ? ByEma.BadDataBehavior.BD_RESET : ByEma.BadDataBehavior.BD_SKIP, - control.onNanValue() == BadDataBehavior.Reset + control.onNanValueOrDefault() == BadDataBehavior.RESET ? ByEma.BadDataBehavior.BD_RESET : ByEma.BadDataBehavior.BD_SKIP, useTicks ? AbstractMa.Mode.TICK : AbstractMa.Mode.TIME, diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java index a62aa0ccc0e..97f4d21ce8a 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java @@ -76,8 +76,8 @@ private void doTestTicking(boolean redirected, boolean bucketed, boolean appendO } final EmaControl skipControl = EmaControl.builder() - .onNullValue(BadDataBehavior.Skip) - .onNanValue(BadDataBehavior.Skip).build(); + .onNullValue(BadDataBehavior.SKIP) + .onNanValue(BadDataBehavior.SKIP).build(); final EvalNugget[] nuggets = new EvalNugget[] { new EvalNugget() { @@ -100,19 +100,7 @@ protected Table e() { UpdateByClause.CumMax(makeOpColNames(columnNamesArray, "_max", "boolCol")), UpdateByClause .CumProd(makeOpColNames(columnNamesArray, "_prod", "Sym", "ts", "boolCol"))); - - final UpdateByControl control; - if (redirected) { - control = new UpdateByControl() { - @Override - public boolean useRedirection() { - return true; - } - }; - } else { - control = UpdateByControl.defaultInstance(); - } - + final UpdateByControl control = UpdateByControl.builder().useRedirection(redirected).build(); return bucketed ? base.updateBy(control, clauses, Selectable.from("Sym")) : base.updateBy(control, clauses); diff --git a/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java b/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java index 30a725e96ed..ac76bd218f9 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java @@ -5,14 +5,14 @@ */ public enum BadDataBehavior { /** Reset the state for the bucket to {@code null} when invalid data is encountered */ - Reset, + RESET, /** Skip and do not process the invalid data without changing state */ - Skip, + SKIP, /** Throw an exception and abort processing when bad data is encountered */ - Throw, + THROW, /** Allow the bad data to poison the result. This is only valid for use with NaN */ - Poison + POISON } diff --git a/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java b/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java index c8c7fb4e717..98f823645d7 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java @@ -1,10 +1,11 @@ package io.deephaven.api.updateby; +import org.immutables.value.Value; import org.immutables.value.Value.Immutable; -import org.immutables.value.Value.Default; import io.deephaven.annotations.BuildableStyle; import java.math.MathContext; +import java.util.Optional; /** *

@@ -29,67 +30,102 @@ public static Builder builder() { return ImmutableEmaControl.builder(); } - public final static EmaControl DEFAULT = ImmutableEmaControl.builder().build(); + public static EmaControl defaultInstance() { + return builder().build(); + } + + public abstract Optional onNullValue(); + + public abstract Optional onNanValue(); + + public abstract Optional onNullTime(); + + public abstract Optional onNegativeDeltaTime(); + + public abstract Optional onZeroDeltaTime(); + + public abstract Optional bigValueContext(); /** - * Get the behavior for when null values are encountered. + * Get the behavior for when {@code null} values are encountered. Defaults to {@link BadDataBehavior#SKIP SKIP}. * - * @return the behavior for null values. + * @return the behavior for {@code null} values. */ - @Default - public BadDataBehavior onNullValue() { - return BadDataBehavior.Skip; + @Value.Derived + public BadDataBehavior onNullValueOrDefault() { + return onNullValue().orElse(BadDataBehavior.SKIP); } /** - * Get the behavior for when NaN values are encountered. + * Get the behavior for when {@link Double#NaN} values are encountered. Defaults to {@link BadDataBehavior#SKIP + * SKIP}. * - * @return the behavior for NaN values + * @return the behavior for {@link Double#NaN} values */ - @Default - public BadDataBehavior onNanValue() { - return BadDataBehavior.Skip; + @Value.Derived + public BadDataBehavior onNanValueOrDefault() { + return onNanValue().orElse(BadDataBehavior.SKIP); } /** - * Get the behavior for when null timestamps are encountered. + * Get the behavior for when {@code null} timestamps are encountered. Defaults to {@link BadDataBehavior#SKIP SKIP}. * - * @return the behavior for null timestamps. + * @return the behavior for {@code null} timestamps. */ - @Default - public BadDataBehavior onNullTime() { - return BadDataBehavior.Skip; + @Value.Derived + public BadDataBehavior onNullTimeOrDefault() { + return onNullTime().orElse(BadDataBehavior.SKIP); } /** - * Get the behavior for when negative sample-to-sample time differences are encountered + * Get the behavior for when negative sample-to-sample time differences are encountered. Defaults to + * {@link BadDataBehavior#THROW THROW}. * * @return the behavior for when dt is negative */ - @Default - public BadDataBehavior onNegativeDeltaTime() { - return BadDataBehavior.Throw; + @Value.Derived + public BadDataBehavior onNegativeDeltaTimeOrDefault() { + return onNegativeDeltaTime().orElse(BadDataBehavior.THROW); } /** - * Get the behavior for when zero sample-to-sample-time differences are encountered. + * Get the behavior for when zero sample-to-sample-time differences are encountered. Defaults to + * {@link BadDataBehavior#SKIP SKIP}. * * @return the behavior for when dt is zero */ - @Default - public BadDataBehavior onZeroDeltaTime() { - return BadDataBehavior.Skip; + @Value.Derived + public BadDataBehavior onZeroDeltaTimeOrDefault() { + return onZeroDeltaTime().orElse(BadDataBehavior.SKIP); } /** * Get the {@link MathContext} to use when processing {@link java.math.BigInteger} and {@link java.math.BigDecimal} - * values. + * values. Defaults to {@link MathContext#DECIMAL128}. * * @return the {@link MathContext} */ - @Default - public MathContext bigValueContext() { - return MathContext.DECIMAL128; + @Value.Derived + public MathContext bigValueContextOrDefault() { + return bigValueContext().orElse(MathContext.DECIMAL128); + } + + /** + * Create a new instance with all of the explicit-or-default values from {@code this}. This may be useful from the + * context of a client who wants to use client-side configuration defaults instead of server-side configuration + * defaults. + * + * @return the explicit new instance + */ + public final EmaControl materialize() { + return builder() + .onNullValue(onNullValueOrDefault()) + .onNanValue(onNanValueOrDefault()) + .onNullTime(onNullTimeOrDefault()) + .onNegativeDeltaTime(onNegativeDeltaTimeOrDefault()) + .onZeroDeltaTime(onZeroDeltaTimeOrDefault()) + .bigValueContext(bigValueContextOrDefault()) + .build(); } public interface Builder { diff --git a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByControl.java b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByControl.java index bd422a330e2..6395e0c4315 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByControl.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByControl.java @@ -1,11 +1,15 @@ package io.deephaven.api.updateby; import io.deephaven.annotations.BuildableStyle; +import org.immutables.value.Value; import org.immutables.value.Value.Check; import org.immutables.value.Value.Immutable; -import org.immutables.value.Value.Default; +import javax.annotation.Nullable; import java.math.MathContext; +import java.util.Optional; +import java.util.OptionalDouble; +import java.util.OptionalInt; /** * An interface to control the behavior of an {@code Table#updateBy} @@ -13,153 +17,267 @@ @Immutable @BuildableStyle public abstract class UpdateByControl { + + public static final String USE_REDIRECTION_PROPERTY = "UpdateByControl.useRedirection"; + public static final String CHUNK_CAPACITY_PROPERTY = "UpdateByControl.chunkCapacity"; + public static final String MAXIMUM_STATIC_MEMORY_OVERHEAD_PROPERTY = "UpdateByControl.maximumStaticMemoryOverhead"; + public static final String INITIAL_HASH_TABLE_SIZE_PROPERTY = "UpdateByControl.initialHashTableSize"; + public static final String MAXIMUM_LOAD_FACTOR_PROPERTY = "UpdateByControl.maximumLoadFactor"; + public static final String TARGET_LOAD_FACTOR_PROPERTY = "UpdateByControl.targetLoadFactor"; + public static final String MATH_CONTEXT_PROPERTY = "UpdateByControl.mathContext"; + public static Builder builder() { return ImmutableUpdateByControl.builder(); } /** - * Get an instance of UpdateByControl with the defaults from the system properties applied. + * Creates an instance with none of the values explicitly set. Equivalent to {@code builder().build()}. * - * @return default UpdateByControl + * @return the default instance */ public static UpdateByControl defaultInstance() { return builder().build(); } /** - * if redirections should be used for output sources instead of sparse array sources. - * - *

- * Default is `false`. Can be changed with system property {@code UpdateByControl.useRedirection} or by providing a - * value to {@link Builder#useRedirection(boolean)}. - * - * @return true if redirections should be used. + * Default is {@code false}. Can be changed with system property {@value USE_REDIRECTION_PROPERTY}. */ - @Default - public boolean useRedirection() { - return Boolean.getBoolean("UpdateByControl.useRedirectionOutput"); + public static boolean useRedirectionDefault() { + return Boolean.getBoolean(USE_REDIRECTION_PROPERTY); } /** - * Get the default maximum chunk capacity. - * - *

- * Default is `4096`. Can be changed with system property {@code UpdateByControl.chunkCapacity} or by providing a - * value to {@link Builder#chunkCapacity(int)}. - * - * @return the maximum chunk capacity. + * Default is {@code 4096}. Can be changed with system property {@value CHUNK_CAPACITY_PROPERTY}. + */ + public static int chunkCapacityDefault() { + return Integer.getInteger(CHUNK_CAPACITY_PROPERTY, 4096); + } + + /** + * Default is {@code 1.1}. Can be changed with system property {@value MAXIMUM_STATIC_MEMORY_OVERHEAD_PROPERTY}. + */ + public static double maximumStaticMemoryOverheadDefault() { + return Double.parseDouble(System.getProperty(MAXIMUM_STATIC_MEMORY_OVERHEAD_PROPERTY, "1.1")); + } + + /** + * Default is {@code 4096}. Can be changed with system property {@value INITIAL_HASH_TABLE_SIZE_PROPERTY}. + */ + public static int initialHashTableSizeDefault() { + return Integer.getInteger(INITIAL_HASH_TABLE_SIZE_PROPERTY, 4096); + } + + /** + * Default is {@code 0.75}. Can be changed with system property {@value MAXIMUM_LOAD_FACTOR_PROPERTY}. */ - @Default - public int chunkCapacity() { - return Integer.getInteger("UpdateByControl.chunkCapacity", 4096); + public static double maximumLoadFactorDefault() { + return Double.parseDouble(System.getProperty(MAXIMUM_LOAD_FACTOR_PROPERTY, "0.75")); } + /** + * Default is {@code 0.7}. Can be changed with system property {@value TARGET_LOAD_FACTOR_PROPERTY}. + */ + public static double targetLoadFactorDefault() { + return Double.parseDouble(System.getProperty(TARGET_LOAD_FACTOR_PROPERTY, "0.7")); + } + + /** + * Default is {@link MathContext#DECIMAL64 DECIMAL64}. Can be changed with system property + * {@value MATH_CONTEXT_PROPERTY}. + */ + public static MathContext mathContextDefault() { + final String p = System.getProperty(MATH_CONTEXT_PROPERTY, "DECIMAL64"); + switch (p) { + case "UNLIMITED": + return MathContext.UNLIMITED; + case "DECIMAL32": + return MathContext.DECIMAL32; + case "DECIMAL64": + return MathContext.DECIMAL64; + case "DECIMAL128": + return MathContext.DECIMAL128; + default: + throw new IllegalArgumentException(String.format("Unexpected '%s': %s", MATH_CONTEXT_PROPERTY, p)); + } + } + + /** + * If redirections should be used for output sources instead of sparse array sources. + */ + @Nullable + public abstract Boolean useRedirection(); + + /** + * The maximum chunk capacity. + */ + public abstract OptionalInt chunkCapacity(); + /** * The maximum fractional memory overhead allowable for sparse redirections as a fraction (e.g. 1.1 is 10% * overhead). Values less than zero disable overhead checking, and result in always using the sparse structure. A * value of zero results in never using the sparse structure. + */ + public abstract OptionalDouble maxStaticSparseMemoryOverhead(); + + /** + * The initial hash table size. + */ + public abstract OptionalInt initialHashTableSize(); + + /** + * The maximum load factor for the hash table. + */ + public abstract OptionalDouble maximumLoadFactor(); + + /** + * The target load factor for the hash table. + */ + public abstract OptionalDouble targetLoadFactor(); + + /** + * The math context. + */ + public abstract Optional mathContext(); + + /** + * Equivalent to {@code useRedirection() == null ? useRedirectionDefault() : useRedirection()}. * - *

- * Default is `1.1`. Can be changed with system property {@code UpdateByControl.maximumStaticMemoryOverhead} or by - * providing a value to {@link Builder#maxStaticSparseMemoryOverhead(double)}. - * - * @return the maximum fractional memory overhead. + * @see #useRedirectionDefault() */ - @Default - public double maxStaticSparseMemoryOverhead() { - return Double.parseDouble(System.getProperty("UpdateByControl.maximumStaticMemoryOverhead", "1.1")); + @Value.Derived + public boolean useRedirectionOrDefault() { + final Boolean useRedirection = useRedirection(); + return useRedirection == null ? useRedirectionDefault() : useRedirection; } /** - * Get the initial hash table size + * Equivalent to {@code chunkCapacity().orElseGet(UpdateByControl::chunkCapacityDefault)}. * - *

- * Default is `4096`. Can be changed with system property {@code UpdateByControl.initialHashTableSize} or by - * providing a value to {@link Builder#initialHashTableSize(int)}. + * @see #chunkCapacityDefault() + */ + @Value.Derived + public int chunkCapacityOrDefault() { + return chunkCapacity().orElseGet(UpdateByControl::chunkCapacityDefault); + } + + /** + * Equivalent to + * {@code maxStaticSparseMemoryOverhead().orElseGet(UpdateByControl::maximumStaticMemoryOverheadDefault)}. * - * @return the initial hash table size + * @see #maximumStaticMemoryOverheadDefault() */ - @Default - public int initialHashTableSize() { - return Integer.getInteger("UpdateByControl.initialHashTableSize", 4096); + @Value.Derived + public double maxStaticSparseMemoryOverheadOrDefault() { + return maxStaticSparseMemoryOverhead().orElseGet(UpdateByControl::maximumStaticMemoryOverheadDefault); } /** - * Get the maximum load factor for the hash table. + * Equivalent to {@code initialHashTableSize().orElseGet(UpdateByControl::initialHashTableSizeDefault)}. * - *

- * Default is `0.75`. Can be changed with system property {@code UpdateByControl.maximumLoadFactor} or by providing - * a value to {@link Builder#maximumLoadFactor(double)}. + * @see #initialHashTableSizeDefault() + */ + @Value.Derived + public int initialHashTableSizeOrDefault() { + return initialHashTableSize().orElseGet(UpdateByControl::initialHashTableSizeDefault); + } + + /** + * Equivalent to {@code maximumLoadFactor().orElseGet(UpdateByControl::maximumLoadFactorDefault)}. * - * @return the maximum load factor + * @see #maximumLoadFactorDefault() */ - @Default - public double maximumLoadFactor() { - return Double.parseDouble(System.getProperty("UpdateByControl.maximumLoadFactor", "0.75")); + @Value.Derived + public double maximumLoadFactorOrDefault() { + return maximumLoadFactor().orElseGet(UpdateByControl::maximumLoadFactorDefault); } /** - * Get the target load factor for the hash table. + * Equivalent to {@code targetLoadFactor().orElseGet(UpdateByControl::targetLoadFactorDefault)}. * - *

- * Default is `0.7`. Can be changed with system property {@code UpdateByControl.targetLoadFactor} or by providing a - * value to {@link Builder#targetLoadFactor(double)}. + * @see #targetLoadFactorDefault() + */ + @Value.Derived + public double targetLoadFactorOrDefault() { + return targetLoadFactor().orElseGet(UpdateByControl::targetLoadFactorDefault); + } + + /** + * Equivalent to {@code mathContext().orElseGet(UpdateByControl::mathContextDefault)}. * - * @return the target load factor + * @see #mathContextDefault() */ - @Default - public double targetLoadFactor() { - return Double.parseDouble(System.getProperty("UpdateByControl.targetLoadFactor", "0.7")); + @Value.Derived + public MathContext mathContextOrDefault() { + return mathContext().orElseGet(UpdateByControl::mathContextDefault); } - @Default - public MathContext mathContext() { - return MathContext.DECIMAL64; + /** + * Create a new instance with all of the explicit-or-default values from {@code this}. This may be useful from the + * context of a client who wants to use client-side configuration defaults instead of server-side configuration + * defaults. + * + * @return the explicit new instance + */ + public final UpdateByControl materialize() { + return builder() + .useRedirection(useRedirectionOrDefault()) + .chunkCapacity(chunkCapacityOrDefault()) + .maxStaticSparseMemoryOverhead(maxStaticSparseMemoryOverheadOrDefault()) + .initialHashTableSize(initialHashTableSizeOrDefault()) + .maximumLoadFactor(maximumLoadFactorOrDefault()) + .targetLoadFactor(targetLoadFactorOrDefault()) + .mathContext(mathContextOrDefault()) + .build(); } @Check final void checkChunkCapacity() { - if (chunkCapacity() <= 0) { - throw new IllegalArgumentException( - String.format("UpdateByControl.chunkCapacity() must be greater than 0, is %d", chunkCapacity())); + if (chunkCapacityOrDefault() <= 0) { + throw new IllegalArgumentException(String + .format("UpdateByControl.chunkCapacity() must be greater than 0, is %d", chunkCapacityOrDefault())); } } @Check final void checkInitialHashTableSize() { - if (initialHashTableSize() <= 0) { - throw new IllegalArgumentException(String.format( - "UpdateByControl.initialHashTableSize() must be greater than 0, is %d", initialHashTableSize())); + if (initialHashTableSizeOrDefault() <= 0) { + throw new IllegalArgumentException( + String.format("UpdateByControl.initialHashTableSize() must be greater than 0, is %d", + initialHashTableSizeOrDefault())); } } @Check final void checkMaximumLoadFactor() { - if (Double.isNaN(maximumLoadFactor()) || maximumLoadFactor() <= 0.0 || maximumLoadFactor() >= 1.0) { - throw new IllegalArgumentException(String.format( - "UpdateByControl.maximumLoadFactor() must be in the range (0.0, 1.0), is %f", maximumLoadFactor())); + if (Double.isNaN(maximumLoadFactorOrDefault()) || maximumLoadFactorOrDefault() <= 0.0 + || maximumLoadFactorOrDefault() >= 1.0) { + throw new IllegalArgumentException( + String.format("UpdateByControl.maximumLoadFactor() must be in the range (0.0, 1.0), is %f", + maximumLoadFactorOrDefault())); } } @Check final void checkTargetLoadFactor() { - if (Double.isNaN(targetLoadFactor()) || targetLoadFactor() <= 0.0 || targetLoadFactor() >= 1.0) { - throw new IllegalArgumentException(String.format( - "UpdateByControl.targetLoadFactor() must be in the range (0.0, 1.0), is %f", targetLoadFactor())); + if (Double.isNaN(targetLoadFactorOrDefault()) || targetLoadFactorOrDefault() <= 0.0 + || targetLoadFactorOrDefault() >= 1.0) { + throw new IllegalArgumentException( + String.format("UpdateByControl.targetLoadFactor() must be in the range (0.0, 1.0), is %f", + targetLoadFactorOrDefault())); } } @Check final void checkTargetLTEMaximum() { - if (targetLoadFactor() > maximumLoadFactor()) { + if (targetLoadFactorOrDefault() > maximumLoadFactorOrDefault()) { throw new IllegalArgumentException(String.format( "UpdateByControl.targetLoadFactor() must be less than or equal to UpdateByControl.maximumLoadFactor(). targetLoadFactor=%f, maximumLoadFactor=%f", - targetLoadFactor(), maximumLoadFactor())); + targetLoadFactorOrDefault(), maximumLoadFactorOrDefault())); } } public interface Builder { - Builder useRedirection(boolean useRedirection); + Builder useRedirection(Boolean useRedirection); Builder chunkCapacity(int chunkCapacity); diff --git a/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java b/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java index 72e46ccefcd..c2ccf7c086f 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java @@ -3,9 +3,9 @@ import io.deephaven.annotations.BuildableStyle; import io.deephaven.api.updateby.EmaControl; import org.immutables.value.Value.Immutable; -import org.immutables.value.Value.Parameter; import java.time.Duration; +import java.util.Optional; /** * A {@link UpdateBySpec} for performing an Exponential Moving Average across the specified columns @@ -13,58 +13,51 @@ @Immutable @BuildableStyle public abstract class EmaSpec extends UpdateBySpecBase { + + public static EmaSpec of(EmaControl control, TimeScale timeScale) { + return ImmutableEmaSpec.builder().control(control).timeScale(timeScale).build(); + } + + public static EmaSpec of(TimeScale timeScale) { + return ImmutableEmaSpec.builder().timeScale(timeScale).build(); + } + public static EmaSpec ofTime(final EmaControl control, final String timestampCol, long timeScaleNanos) { - return ImmutableEmaSpec.builder() - .control(control) - .timeScale(TimeScale.ofTime(timestampCol, timeScaleNanos)) - .build(); + return of(control, TimeScale.ofTime(timestampCol, timeScaleNanos)); } public static EmaSpec ofTime(final String timestampCol, long timeScaleNanos) { - return ImmutableEmaSpec.builder() - .control(EmaControl.DEFAULT) - .timeScale(TimeScale.ofTime(timestampCol, timeScaleNanos)) - .build(); + return of(TimeScale.ofTime(timestampCol, timeScaleNanos)); } public static EmaSpec ofTime(final EmaControl control, final String timestampCol, Duration emaDuration) { - return ImmutableEmaSpec.builder() - .control(control) - .timeScale(TimeScale.ofTime(timestampCol, emaDuration)) - .build(); + return of(control, TimeScale.ofTime(timestampCol, emaDuration)); } public static EmaSpec ofTime(final String timestampCol, Duration emaDuration) { - return ImmutableEmaSpec.builder() - .control(EmaControl.DEFAULT) - .timeScale(TimeScale.ofTime(timestampCol, emaDuration)) - .build(); + return of(TimeScale.ofTime(timestampCol, emaDuration)); } public static EmaSpec ofTicks(EmaControl control, long tickWindow) { - return ImmutableEmaSpec.builder() - .control(control) - .timeScale(TimeScale.ofTicks(tickWindow)) - .build(); + return of(control, TimeScale.ofTicks(tickWindow)); } public static EmaSpec ofTicks(long tickWindow) { - return ImmutableEmaSpec.builder() - .control(EmaControl.DEFAULT) - .timeScale(TimeScale.ofTicks(tickWindow)) - .build(); + return of(TimeScale.ofTicks(tickWindow)); } - @Parameter - public abstract EmaControl control(); + public abstract Optional control(); - @Parameter public abstract TimeScale timeScale(); + public final EmaControl controlOrDefault() { + return control().orElseGet(EmaControl::defaultInstance); + } + @Override public final boolean applicableTo(Class inputType) { return From 8e6dcb142702bfc2921a0d04bc8868d46f06ec6c Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Mon, 18 Jul 2022 08:33:41 -0600 Subject: [PATCH 011/215] Add support for single string arg for DTW (#2645) --- py/server/deephaven/table_factory.py | 4 +++- py/server/tests/test_table_factory.py | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/py/server/deephaven/table_factory.py b/py/server/deephaven/table_factory.py index cb1ee02e0da..778acaba5bc 100644 --- a/py/server/deephaven/table_factory.py +++ b/py/server/deephaven/table_factory.py @@ -11,6 +11,7 @@ from deephaven._wrapper import JObjectWrapper from deephaven.column import InputColumn from deephaven.dtypes import DType +from deephaven.jcompat import to_sequence from deephaven.table import Table from deephaven.ugp import auto_locking_op @@ -180,6 +181,7 @@ def write_row(self, *values: Any) -> None: DHError """ try: - self._j_table_writer.logRowPermissive(*values) + values = to_sequence(values) + self._j_table_writer.logRowPermissive(values) except Exception as e: raise DHError(e, "failed to write a row.") from e diff --git a/py/server/tests/test_table_factory.py b/py/server/tests/test_table_factory.py index 685e0f68e13..47dcec7464c 100644 --- a/py/server/tests/test_table_factory.py +++ b/py/server/tests/test_table_factory.py @@ -169,16 +169,31 @@ def test_dtw_with_array_types(self): b_array = dtypes.array(dtypes.byte, [1, 1, 1]) s_array = dtypes.array(dtypes.short, [128, 228, 328]) i_array = dtypes.array(dtypes.int32, [32768, 42768, 52768]) - l_array = dtypes.array(dtypes.long, [2**32, 2**33, 2**36]) + l_array = dtypes.array(dtypes.long, [2 ** 32, 2 ** 33, 2 ** 36]) f_array = dtypes.array(dtypes.float32, [1.0, 1.1, 1.2]) - d_array = dtypes.array(dtypes.double, [1.0/2**32, 1.1/2**33, 1.2/2**36]) + d_array = dtypes.array(dtypes.double, [1.0 / 2 ** 32, 1.1 / 2 ** 33, 1.2 / 2 ** 36]) str_array = dtypes.array(dtypes.string, ["some", "not so random", "text"]) - table_writer.write_row(b_array, s_array,i_array,l_array,f_array,d_array,str_array + table_writer.write_row(b_array, s_array, i_array, l_array, f_array, d_array, str_array ) t = table_writer.table self.wait_ticking_table_update(t, row_count=1, timeout=5) self.assertNotIn("null", t.to_string()) + def test_dtw_single_string_arg(self): + col_defs = {"A_String": dtypes.string} + table_writer = DynamicTableWriter(col_defs) + table_writer.write_row("Hello world!") + t = table_writer.table + self.wait_ticking_table_update(t, row_count=1, timeout=5) + self.assertIn("Hello", t.to_string()) + + col_defs = {"A_Long": dtypes.long} + table_writer = DynamicTableWriter(col_defs) + table_writer.write_row(10**10) + t = table_writer.table + self.wait_ticking_table_update(t, row_count=1, timeout=5) + self.assertIn("10000000000", t.to_string()) + if __name__ == '__main__': unittest.main() From 1d668f8f0f3cfcafcae8274dd6dd2229cf439411 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 18 Jul 2022 12:50:51 -0700 Subject: [PATCH 012/215] Skip JpyConfig if python is already initialized (#2640) --- .../io/deephaven/engine/util/jpy/JpyInit.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java index c372c89c199..52a37da9c5d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java @@ -32,7 +32,10 @@ public class JpyInit { * @throws InterruptedException if the current thread is interrupted * @throws TimeoutException if the command times out */ - public static void init() throws IOException, InterruptedException, TimeoutException { + public static synchronized void init() throws IOException, InterruptedException, TimeoutException { + if (PyLibInitializer.isPyLibInitialized()) { + return; + } final JpyConfig explicitConfig = new JpyConfigLoader(Configuration.getInstance()).asJpyConfig(); if (!explicitConfig.isEmpty()) { init(new JpyConfigExt(explicitConfig)); @@ -42,19 +45,11 @@ public static void init() throws IOException, InterruptedException, TimeoutExcep init(new JpyConfigExt(fromSubprocess.asJpyConfig())); } - private static synchronized void init(JpyConfigExt jpyConfig) { - if (PyLibInitializer.isPyLibInitialized()) { - log.warn().append("Skipping initialization of Jpy, already initialized").endl(); - log.warn().append("Using Python Installation ").append(System.getProperty("jpy.pythonLib", "(unknown)")) - .endl(); - return; - } - + private static void init(JpyConfigExt jpyConfig) { log.info().append("Loaded jpy config ").append(jpyConfig).endl(); log.info().append("Starting Python interpreter").endl(); jpyConfig.initPython(); jpyConfig.startPython(); log.info().append("Started Python interpreter").endl(); - log.info().append("Using Python Installation ").append(System.getProperty("jpy.pythonLib", "(unknown)")).endl(); } } From fd31d3c07371dd3824d78382d84301340f4e6b47 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Tue, 19 Jul 2022 09:49:14 -0600 Subject: [PATCH 013/215] Wrap PartitionedTableProxy in Python (#2632) Wrap PartitionedTableProxy --- py/server/deephaven/parquet.py | 3 +- py/server/deephaven/table.py | 879 ++++++++++++++++++++++++++++++- py/server/tests/test_pt_proxy.py | 311 +++++++++++ py/server/tests/test_table.py | 2 +- py/server/tests/test_ugp.py | 14 + 5 files changed, 1198 insertions(+), 11 deletions(-) create mode 100644 py/server/tests/test_pt_proxy.py diff --git a/py/server/deephaven/parquet.py b/py/server/deephaven/parquet.py index 62287368caa..b9d849405fc 100644 --- a/py/server/deephaven/parquet.py +++ b/py/server/deephaven/parquet.py @@ -11,12 +11,13 @@ from deephaven import DHError from deephaven.column import Column -from deephaven.table import Table, _JTableDefinition +from deephaven.table import Table _JParquetTools = jpy.get_type("io.deephaven.parquet.table.ParquetTools") _JFile = jpy.get_type("java.io.File") _JCompressionCodecName = jpy.get_type("org.apache.parquet.hadoop.metadata.CompressionCodecName") _JParquetInstructions = jpy.get_type("io.deephaven.parquet.table.ParquetInstructions") +_JTableDefinition = jpy.get_type("io.deephaven.engine.table.TableDefinition") @dataclass diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index e24cf41de5d..8a40d101b48 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -2,8 +2,8 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # -""" This module implements the Table and PartitionedTable classes which are the main instruments for working with -Deephaven refreshing and static data.""" +""" This module implements the Table, PartitionedTable and PartitionedTableProxy classes which are the main +instruments for working with Deephaven refreshing and static data. """ from __future__ import annotations @@ -20,6 +20,7 @@ from deephaven.jcompat import j_array_list, to_sequence, j_unary_operator, j_binary_operator from deephaven.ugp import auto_locking_op +# Table _JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") _JColumnName = jpy.get_type("io.deephaven.api.ColumnName") _JSortColumn = jpy.get_type("io.deephaven.api.SortColumn") @@ -29,9 +30,17 @@ _JPair = jpy.get_type("io.deephaven.api.agg.Pair") _JMatchPair = jpy.get_type("io.deephaven.engine.table.MatchPair") _JLayoutHintBuilder = jpy.get_type("io.deephaven.engine.util.LayoutHintBuilder") + +# PartitionedTable _JPartitionedTable = jpy.get_type("io.deephaven.engine.table.PartitionedTable") _JPartitionedTableFactory = jpy.get_type("io.deephaven.engine.table.PartitionedTableFactory") _JTableDefinition = jpy.get_type("io.deephaven.engine.table.TableDefinition") +_JPartitionedTableProxy = jpy.get_type("io.deephaven.engine.table.PartitionedTable$Proxy") +_JJoinMatch = jpy.get_type("io.deephaven.api.JoinMatch") +_JJoinAddition = jpy.get_type("io.deephaven.api.JoinAddition") +_JAsOfJoinRule = jpy.get_type("io.deephaven.api.AsOfJoinRule") +_JReverseAsOfJoinRule = jpy.get_type("io.deephaven.api.ReverseAsOfJoinRule") +_JTableOperations = jpy.get_type("io.deephaven.api.TableOperations") class SortDirection(Enum): @@ -915,7 +924,7 @@ def group_by(self, by: Union[str, Sequence[str]] = None) -> Table: else: return Table(j_table=self.j_table.groupBy()) except Exception as e: - raise DHError(e, "table group operation failed.") from e + raise DHError(e, "table group-by operation failed.") from e @auto_locking_op def ungroup(self, cols: Union[str, Sequence[str]] = None) -> Table: @@ -1317,7 +1326,7 @@ def partition_by(self, by: Union[str, Sequence[str]], drop_keys: bool = False) - class PartitionedTable(JObjectWrapper): - """A partitioned table is a table containing tables, known as constituent tables. + """A partitioned table is a table containing tables, known as constituent tables. Each constituent table has the same schema. The partitioned table contains: @@ -1325,7 +1334,7 @@ class PartitionedTable(JObjectWrapper): 2. key columns (optional) 3. non-key columns (optional) - Key values can be used to retrieve constituent tables from the partitioned table and + Key values can be used to retrieve constituent tables from the partitioned table and can be used to perform operations with other like-keyed partitioned tables. """ @@ -1462,7 +1471,6 @@ def keys(self) -> Table: else: return self.table.select_distinct(self.key_columns) - @property def unique_keys(self) -> bool: """Whether the keys in the underlying table must always be unique. If keys must be unique, one can expect @@ -1497,8 +1505,8 @@ def constituent_changes_permitted(self) -> bool: 1. has no adds 2. has no removes 3. has no shifts - 4. has no modifies that include the constituent column - + 4. has no modifies that include the constituent column + Note, it is possible for constituent changes to not be permitted even if constituent tables are refreshing or if the underlying partitioned table is refreshing. Also note that the underlying partitioned table must be refreshing if it contains any refreshing constituents. @@ -1552,7 +1560,7 @@ def sort(self, order_by: Union[str, Sequence[str]], order: Union[SortDirection, Sequence[SortDirection]] = None) -> PartitionedTable: """The sort method creates a new partitioned table where the rows are ordered based on values in a specified set of columns. Sort can not use the constituent column. - + Args: order_by (Union[str, Sequence[str]]): the column(s) to be sorted on. Can't include the constituent column. order (Union[SortDirection, Sequence[SortDirection], optional): the corresponding sort directions for @@ -1656,3 +1664,856 @@ def partitioned_transform(self, other: PartitionedTable, func: Callable[[Table, return PartitionedTable(j_partitioned_table=j_pt) except Exception as e: raise DHError(e, "failed to transform the PartitionedTable with another PartitionedTable.") from e + + def proxy(self, require_matching_keys: bool = True, sanity_check_joins: bool = True) -> PartitionedTableProxy: + """Makes a proxy that allows table operations to be applied to the constituent tables of this + PartitionedTable. + + Args: + require_matching_keys (bool): whether to ensure that both partitioned tables have all the same keys + present when an operation uses this PartitionedTable and another PartitionedTable as inputs for a + :meth:`~PartitionedTable.partitioned_transform`, default is True + sanity_check_joins (bool): whether to check that for proxied join operations, a given join key only occurs + in exactly one constituent table of the underlying partitioned table. If the other table argument is also a + PartitionedTableProxy, its constituents will also be subjected to this constraint. + """ + return PartitionedTableProxy( + j_pt_proxy=self.j_partitioned_table.proxy(require_matching_keys, sanity_check_joins)) + + +class PartitionedTableProxy(JObjectWrapper): + """A PartitionedTableProxy is a table operation proxy for the underlying partitioned table. It provides methods + that apply table operations to the constituent tables of the underlying partitioned table, produce a new + partitioned table from the resulting constituent tables, and return a proxy of it. + + Attributes: + target (PartitionedTable): the underlying partitioned table of the proxy + require_matching_keys (bool): whether to ensure that both partitioned tables have all the same keys + present when an operation uses this PartitionedTable and another PartitionedTable as inputs for a + :meth:`~PartitionedTable.partitioned_transform`, default is True + sanity_check_joins (bool): whether to check that for proxied join operations, a given join key only occurs + in exactly one constituent table of the underlying partitioned table. If the other table argument is also a + PartitionedTableProxy, its constituents will also be subjected to this constraint. + """ + j_object_type = _JPartitionedTableProxy + + @property + def j_object(self) -> jpy.JType: + return self.j_pt_proxy + + @property + def is_refreshing(self) -> bool: + """Whether this proxy represents a refreshing partitioned table.""" + return self.target.is_refreshing + + def __init__(self, j_pt_proxy): + self.j_pt_proxy = jpy.cast(j_pt_proxy, _JPartitionedTableProxy) + self.require_matching_keys = self.j_pt_proxy.requiresMatchingKeys() + self.sanity_check_joins = self.j_pt_proxy.sanityChecksJoins() + self.target = PartitionedTable(j_partitioned_table=self.j_pt_proxy.target()) + + def head(self, num_rows: int) -> PartitionedTableProxy: + """Applies the :meth:`~Table.head` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + num_rows (int): the number of rows at the head of the constituent tables + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.head(num_rows)) + except Exception as e: + raise DHError(e, "head operation on the PartitionedTableProxy failed.") from e + + def tail(self, num_rows: int) -> PartitionedTableProxy: + """Applies the :meth:`~Table.tail` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + num_rows (int): the number of rows at the end of the constituent tables + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.tail(num_rows)) + except Exception as e: + raise DHError(e, "tail operation on the PartitionedTableProxy failed.") from e + + def reverse(self) -> PartitionedTableProxy: + """Applies the :meth:`~Table.reverse` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.reverse()) + except Exception as e: + raise DHError(e, "reverse operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def snapshot(self, source_table: Union[Table, PartitionedTableProxy], do_init: bool = False, + cols: Union[str, List[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.snapshot` table operation to all constituent tables of the underlying + partitioned table with the provided source table or PartitionedTableProxy, and produces a new + PartitionedTableProxy with the result tables as the constituents of its underlying partitioned table. + + In the case of source table being another PartitionedTableProxy, the :meth:`~Table.snapshot` table operation + is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Note, the constituent tables are often time tables that add new rows at a regular, user-defined interval. + + Args: + source_table (Union[Table, PartitionedTableProxy]): the table or PartitionedTableProxy to be snapshot + do_init (bool): whether to snapshot when this method is initially called, default is False + cols (Union[str, List[str]]): names of the columns of the constituent table to be included in the snapshot, + default is None, meaning all the columns + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + table_op = jpy.cast(source_table.j_object, _JTableOperations) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.snapshot(table_op, do_init, *cols)) + except Exception as e: + raise DHError(e, "snapshot operation on the PartitionedTableProxy failed.") from e + + def sort(self, order_by: Union[str, Sequence[str]], + order: Union[SortDirection, Sequence[SortDirection]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.sort` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + order_by (Union[str, Sequence[str]]): the column(s) to be sorted on + order (Union[SortDirection, Sequence[SortDirection], optional): the corresponding sort directions for + each sort column, default is None, meaning ascending order for all the sort columns. + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + order_by = to_sequence(order_by) + if not order: + order = (SortDirection.ASCENDING,) * len(order_by) + order = to_sequence(order) + if len(order_by) != len(order): + raise DHError(message="The number of sort columns must be the same as the number of sort directions.") + + sort_columns = [_sort_column(col, dir_) for col, dir_ in zip(order_by, order)] + j_sc_list = j_array_list(sort_columns) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sort(j_sc_list)) + except Exception as e: + raise DHError(e, "sort operation on the PartitionedTableProxy failed.") from e + + def sort_descending(self, order_by: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.sort_descending` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + order_by (Union[str, Sequence[str]]): the column(s) to be sorted on + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + order_by = to_sequence(order_by) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sortDescending(*order_by)) + except Exception as e: + raise DHError(e, "sort_descending operation on the PartitionedTableProxy failed.") from e + + def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.where` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + filters (Union[str, Filter, Sequence[str], Sequence[Filter]], optional): the filter condition + expression(s) or Filter object(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + filters = to_sequence(filters) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.where(*filters)) + except Exception as e: + raise DHError(e, "where operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def where_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.where_in` table operation to all constituent tables of the underlying + partitioned table with the provided filter table, and produces a new PartitionedTableProxy with the result + tables as the constituents of its underlying partitioned table. + + Args: + filter_table (Table): the table containing the set of values to filter on + cols (Union[str, Sequence[str]]): the column name(s) + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereIn(filter_table.j_table, *cols)) + except Exception as e: + raise DHError(e, "where_in operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.where_not_in` table operation to all constituent tables of the underlying + partitioned table with the provided filter table, and produces a new PartitionedTableProxy with the result + tables as the constituents of its underlying partitioned table. + + Args: + filter_table (Table): the table containing the set of values to filter on + cols (Union[str, Sequence[str]]): the column name(s) + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereNotIn(filter_table.j_table, *cols)) + except Exception as e: + raise DHError(e, "where_not_in operation on the PartitionedTableProxy failed.") from e + + def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.view` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + formulas (Union[str, Sequence[str]]): the column formula(s) + + Returns: + A new PartitionedTableProxy + + Raises: + DHError + """ + try: + formulas = to_sequence(formulas) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.view(*formulas)) + except Exception as e: + raise DHError(e, "view operation on the PartitionedTableProxy failed.") from e + + def update_view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.update_view` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + formulas (Union[str, Sequence[str]]): the column formula(s) + + Returns: + A new PartitionedTableProxy + + Raises: + DHError + """ + try: + formulas = to_sequence(formulas) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateView(*formulas)) + except Exception as e: + raise DHError(e, "update_view operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def update(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: + """Applies the :meth:`~Table.update` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + formulas (Union[str, Sequence[str]]): the column formula(s) + + Returns: + A new PartitionedTableProxy + + Raises: + DHError + """ + try: + formulas = to_sequence(formulas) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.update(*formulas)) + except Exception as e: + raise DHError(e, "update operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def select(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.select` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + formulas (Union[str, Sequence[str]], optional): the column formula(s), default is None + + Returns: + A new PartitionedTableProxy + + Raises: + DHError + """ + try: + formulas = to_sequence(formulas) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.select(*formulas)) + except Exception as e: + raise DHError(e, "select operation on the PartitionedTableProxy failed.") from e + + def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.select_distinct` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + formulas (Union[str, Sequence[str]], optional): the column formula(s), default is None + + Returns: + A new PartitionedTableProxy + + Raises: + DHError + """ + try: + formulas = to_sequence(formulas) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.selectDistinct(*formulas)) + except Exception as e: + raise DHError(e, "select_distinct operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def natural_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], + joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.natural_join` table operation to all constituent tables of the underlying + partitioned table with the provided right table or PartitionedTableProxy, and produces a new + PartitionedTableProxy with the result tables as the constituents of its underlying partitioned table. + + In the case of the right table being another PartitionedTableProxy, the :meth:`~Table.natural_join` table + operation is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Args: + table (Union[Table, PartitionedTableProxy]): the right table or PartitionedTableProxy of the join + on (Union[str, Sequence[str]]): the column(s) to match, can be a common name or an equal expression, + i.e. "col_a = col_b" for different column names + joins (Union[str, Sequence[str]], optional): the column(s) to be added from the right table to the result + table, can be renaming expressions, i.e. "new_col = col"; default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + on = to_sequence(on) + joins = to_sequence(joins) + table_op = jpy.cast(table.j_object, _JTableOperations) + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on))) + except Exception as e: + raise DHError(e, "natural_join operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def exact_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], + joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.exact_join` table operation to all constituent tables of the underlying + partitioned table with the provided right table or PartitionedTableProxy,and produces a new + PartitionedTableProxy with the result tables as the constituents of its underlying partitioned table. + + In the case of the right table being another PartitionedTableProxy, the :meth:`~Table.exact_join` table + operation is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Args: + table (Union[Table, PartitionedTableProxy]): the right table or PartitionedTableProxy of the join + on (Union[str, Sequence[str]]): the column(s) to match, can be a common name or an equal expression, + i.e. "col_a = col_b" for different column names + joins (Union[str, Sequence[str]], optional): the column(s) to be added from the right table to the result + table, can be renaming expressions, i.e. "new_col = col"; default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + on = to_sequence(on) + joins = to_sequence(joins) + table_op = jpy.cast(table.j_object, _JTableOperations) + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on))) + except Exception as e: + raise DHError(e, "exact_join operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]] = None, + joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.join` table operation to all constituent tables of the underlying partitioned + table with the provided right table or PartitionedTableProxy, and produces a new PartitionedTableProxy with + the result tables as the constituents of its underlying partitioned table. + + In the case of the right table being another PartitionedTableProxy, the :meth:`~Table.join` table operation + is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Args: + table (Union[Table, PartitionedTableProxy]): the right table or PartitionedTableProxy of the join + on (Union[str, Sequence[str]]): the column(s) to match, can be a common name or an equal expression, + i.e. "col_a = col_b" for different column names; default is None + joins (Union[str, Sequence[str]], optional): the column(s) to be added from the right table to the result + table, can be renaming expressions, i.e. "new_col = col"; default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + on = to_sequence(on) + joins = to_sequence(joins) + table_op = jpy.cast(table.j_object, _JTableOperations) + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on))) + except Exception as e: + raise DHError(e, "join operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def aj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], + joins: Union[str, Sequence[str]] = None, + match_rule: AsOfMatchRule = AsOfMatchRule.LESS_THAN_EQUAL) -> PartitionedTableProxy: + """Applies the :meth:`~Table.aj` table operation to all constituent tables of the underlying partitioned + table with the provided right table or PartitionedTableProxy, and produces a new PartitionedTableProxy with + the result tables as the constituents of its underlying partitioned table. + + In the case of the right table being another PartitionedTableProxy, the :meth:`~Table.aj` table operation + is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Args: + table (Union[Table, PartitionedTableProxy]): the right table or PartitionedTableProxy of the join + on (Union[str, Sequence[str]]): the column(s) to match, can be a common name or an equal expression, + i.e. "col_a = col_b" for different column names + joins (Union[str, Sequence[str]], optional): the column(s) to be added from the right table to the result + table, can be renaming expressions, i.e. "new_col = col"; default is None + match_rule (AsOfMatchRule): the inexact matching rule on the last column to match specified in 'on', + default is AsOfMatchRule.LESS_THAN_EQUAL. The other valid value is AsOfMatchRule.LESS_THAN. + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + on = to_sequence(on) + joins = to_sequence(joins) + if on: + on = [_JJoinMatch.parse(p) for p in on] + if joins: + joins = [_JJoinAddition.parse(p) for p in joins] + + on = j_array_list(on) + joins = j_array_list(joins) + table_op = jpy.cast(table.j_object, _JTableOperations) + if match_rule is AsOfMatchRule.LESS_THAN_EQUAL: + match_rule = _JAsOfJoinRule.LESS_THAN_EQUAL + elif match_rule is AsOfMatchRule.LESS_THAN: + match_rule = _JAsOfJoinRule.LESS_THAN + else: + raise ValueError("invalid match_rule value") + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aj(table_op, on, joins, match_rule)) + except Exception as e: + raise DHError(e, "as-of join operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def raj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], + joins: Union[str, Sequence[str]] = None, + match_rule: AsOfMatchRule = AsOfMatchRule.GREATER_THAN_EQUAL) -> PartitionedTableProxy: + """Applies the :meth:`~Table.raj` table operation to all constituent tables of the underlying partitioned + table with the provided right table or PartitionedTableProxy, and produces a new PartitionedTableProxy with + the result tables as the constituents of its underlying partitioned table. + + In the case of the right table being another PartitionedTableProxy, the :meth:`~Table.raj` table operation + is applied to the matching pairs of the constituent tables from both underlying partitioned tables. + + Args: + table (Union[Table, PartitionedTableProxy]): the right table or PartitionedTableProxy of the join + on (Union[str, Sequence[str]]): the column(s) to match, can be a common name or an equal expression, + i.e. "col_a = col_b" for different column names + joins (Union[str, Sequence[str]], optional): the column(s) to be added from the right table to the result + table, can be renaming expressions, i.e. "new_col = col"; default is None + match_rule (AsOfMatchRule): the inexact matching rule on the last column to match specified in 'on', + default is AsOfMatchRule.GREATER_THAN_EQUAL. The other valid value is AsOfMatchRule.GREATER_THAN. + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + on = to_sequence(on) + joins = to_sequence(joins) + if on: + on = [_JJoinMatch.parse(p) for p in on] + if joins: + joins = [_JJoinAddition.parse(p) for p in joins] + + on = j_array_list(on) + joins = j_array_list(joins) + table_op = jpy.cast(table.j_object, _JTableOperations) + if match_rule is AsOfMatchRule.GREATER_THAN_EQUAL: + match_rule = _JReverseAsOfJoinRule.GREATER_THAN_EQUAL + elif match_rule is AsOfMatchRule.GREATER_THAN: + match_rule = _JReverseAsOfJoinRule.GREATER_THAN + else: + raise ValueError("invalid match_rule value") + + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.raj(table_op, on, joins, match_rule)) + except Exception as e: + raise DHError(e, "reverse as-of join operation on the PartitionedTableProxy failed.") from e + + def group_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.group_by` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy()) + except Exception as e: + raise DHError(e, "group-by operation on the PartitionedTableProxy failed.") from e + + def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], + by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.agg_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + aggs (Union[Aggregation, Sequence[Aggregation]]): the aggregation(s) + by (Union[str, Sequence[str]]): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + aggs = to_sequence(aggs) + by = to_sequence(by) + j_agg_list = j_array_list([agg.j_aggregation for agg in aggs]) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggBy(j_agg_list, *by)) + except Exception as e: + raise DHError(e, "agg_by operation on the PartitionedTableProxy failed.") from e + + def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.agg_all_by` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Note, because agg_all_by applies the aggregation to all the columns of the table, it will ignore + any column names specified for the aggregation. + + Args: + agg (Aggregation): the aggregation + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggAllBy(agg.j_agg_spec, *by)) + except Exception as e: + raise DHError(e, "agg_all_by operation on the PartitionedTableProxy failed.") from e + + def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.count_by` table operation to all constituent tables of the underlying partitioned + table with the provided source table, and produces a new PartitionedTableProxy with the result tables as the + constituents of its underlying partitioned table. + + Args: + col (str): the name of the column to store the counts + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col)) + except Exception as e: + raise DHError(e, "count_by operation on the PartitionedTableProxy failed.") from e + + def first_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.first_by` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy()) + except Exception as e: + raise DHError(e, "first_by operation on the PartitionedTableProxy failed.") from e + + def last_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.last_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy()) + except Exception as e: + raise DHError(e, "last_by operation on the PartitionedTableProxy failed.") from e + + def min_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.min_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy()) + except Exception as e: + raise DHError(e, "min_by operation on the PartitionedTableProxy failed.") from e + + def max_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.max_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy()) + except Exception as e: + raise DHError(e, "max_by operation on the PartitionedTableProxy failed.") from e + + def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.sum_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy()) + except Exception as e: + raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + + def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.avg_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy()) + except Exception as e: + raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e + + def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.median_by` table operation to all constituent tables of the underlying + partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its + underlying partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy()) + except Exception as e: + raise DHError(e, "median_by operation on the PartitionedTableProxy failed.") from e + + def std_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.std_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy()) + except Exception as e: + raise DHError(e, "std_by operation on the PartitionedTableProxy failed.") from e + + def var_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.var_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy()) + except Exception as e: + raise DHError(e, "var_by operation on the PartitionedTableProxy failed.") from e diff --git a/py/server/tests/test_pt_proxy.py b/py/server/tests/test_pt_proxy.py new file mode 100644 index 00000000000..780af57de98 --- /dev/null +++ b/py/server/tests/test_pt_proxy.py @@ -0,0 +1,311 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# + +import unittest + +from deephaven import read_csv, empty_table, SortDirection, AsOfMatchRule, DHError, time_table, ugp +from deephaven.agg import sum_, avg, pct, weighted_avg, formula, group, first, last, max_, median, min_, std, abs_sum, \ + var +from deephaven.table import PartitionedTableProxy +from tests.testbase import BaseTestCase + + +class PartitionedTableProxyTestCase(BaseTestCase): + def setUp(self): + self.test_table = read_csv("tests/data/test_table.csv") + self.partitioned_table = self.test_table.partition_by(by=["c"]) + self.pt_proxy = self.partitioned_table.proxy() + + def tearDown(self): + self.partitioned_table = None + self.test_table = None + + def test_target(self): + self.assertEqual(self.partitioned_table, self.pt_proxy.target) + + def test_is_refreshing(self): + with ugp.shared_lock(): + test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) + + pt = test_table.partition_by("Y") + proxy = pt.proxy() + self.assertTrue(pt.is_refreshing) + self.assertTrue(proxy.is_refreshing) + self.assertFalse(self.pt_proxy.is_refreshing) + + def test_head_tail(self): + ops = [PartitionedTableProxy.head, PartitionedTableProxy.tail] + for op in ops: + with self.subTest(op): + pt_proxy = op(self.pt_proxy, 5) + constituent_tables = pt_proxy.target.constituent_tables + for ct in constituent_tables: + self.assertGreaterEqual(5, ct.size) + + def test_reverse(self): + pt_proxy = self.pt_proxy.reverse() + for ct, rct in zip(self.pt_proxy.target.constituent_tables, pt_proxy.target.constituent_tables): + self.assertEqual( + ct.to_string(num_rows=1), + rct.tail(num_rows=1).to_string(num_rows=1), + ) + self.assertEqual( + ct.tail(num_rows=1).to_string(num_rows=1), + rct.to_string(num_rows=1), + ) + + def test_snapshot(self): + with self.subTest("snapshot with a Table"): + t = empty_table(10).update( + formulas=["Timestamp=io.deephaven.time.DateTime.now()", "X = i * i", "Y = i + i"] + ) + pt_proxy = self.pt_proxy.snapshot(t, cols="a") + self.assertEqual(4, len(pt_proxy.target.constituent_table_columns)) + self.assertTrue(all(ct.size == 0 for ct in pt_proxy.target.constituent_tables)) + self.assertEqual(len(pt_proxy.target.constituent_tables), len(self.pt_proxy.target.constituent_tables)) + + with self.subTest("snapshot with another Proxy"): + trigger_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy() + snapshot_proxy = trigger_proxy.snapshot(self.pt_proxy, cols=["ja=a", "jb=b", "jc=c"]) + self.assertTrue(all(ct.size == 0 for ct in pt_proxy.target.constituent_tables)) + self.assertEqual(len(snapshot_proxy.target.constituent_tables), + len(self.pt_proxy.target.constituent_tables)) + + trigger_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("a").proxy( + require_matching_keys=False) + snapshot_proxy = trigger_proxy.snapshot(self.pt_proxy, cols=["ja=a", "jb=b", "jc=c"]) + self.assertTrue(all(ct.size == 0 for ct in pt_proxy.target.constituent_tables)) + self.assertLessEqual(len(snapshot_proxy.target.constituent_tables), + len(self.pt_proxy.target.constituent_tables)) + + def test_sort(self): + sorted_pt_proxy = self.pt_proxy.sort(order_by=["a", "b"], + order=[SortDirection.DESCENDING, SortDirection.ASCENDING]) + for ct, sorted_ct in zip(self.pt_proxy.target.constituent_tables, sorted_pt_proxy.target.constituent_tables): + self.assertEqual(ct.size, sorted_ct.size) + + def test_sort_descending(self): + sorted_pt_proxy = self.pt_proxy.sort_descending(order_by=["a", "b"]) + for ct, sorted_ct in zip(self.pt_proxy.target.constituent_tables, sorted_pt_proxy.target.constituent_tables): + self.assertEqual(ct.size, sorted_ct.size) + + def test_where(self): + filtered_pt_proxy = self.pt_proxy.where(filters=["a > 10", "b < 100"]) + for ct, filtered_ct in zip(self.pt_proxy.target.constituent_tables, + filtered_pt_proxy.target.constituent_tables): + self.assertLessEqual(filtered_ct.size, ct.size) + + def test_where_in(self): + unique_table = self.test_table.head(num_rows=50).select_distinct( + formulas=["a", "c"] + ) + + with self.subTest("where-in filter"): + filtered_pt_proxy = self.pt_proxy.where_in(unique_table, cols=["c"]) + for ct, filtered_ct in zip(self.pt_proxy.target.constituent_tables, + filtered_pt_proxy.target.constituent_tables): + self.assertLessEqual(filtered_ct.size, ct.size) + + with self.subTest("where-not-in filter"): + filtered_pt_proxy2 = self.pt_proxy.where_not_in(unique_table, cols=["c"]) + for ct, filtered_ct, filtered_ct2 in zip(self.pt_proxy.target.constituent_tables, + filtered_pt_proxy.target.constituent_tables, + filtered_pt_proxy2.target.constituent_tables): + self.assertEqual(ct.size, filtered_ct.size + filtered_ct2.size) + + def test_USV(self): + ops = [ + PartitionedTableProxy.update, + PartitionedTableProxy.view, + PartitionedTableProxy.update_view, + PartitionedTableProxy.select, + ] + for op in ops: + with self.subTest(op=op): + result_pt_proxy = op( + self.pt_proxy, formulas=["a", "c", "Sum = a + b + c + d"]) + for rct, ct in zip(result_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertTrue(len(rct.columns) >= 3) + self.assertLessEqual(rct.size, ct.size) + + def test_select_distinct(self): + unique_pt_proxy = self.pt_proxy.select_distinct(formulas=["a"]) + for uct, ct in zip(unique_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(uct.size, ct.size) + unique_pt_proxy = self.pt_proxy.select_distinct() + for uct, ct in zip(unique_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(uct.size, ct.size) + + def test_natural_join(self): + with self.subTest("Join with a Table"): + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy() + right_table = self.test_table.drop_columns(["b", "c"]).head(5) + joined_pt_proxy = pt_proxy.natural_join(right_table, on="a", joins=["d", "e"]) + for ct in joined_pt_proxy.target.constituent_tables: + self.assertEqual(len(ct.columns), 5) + + with self.subTest("Join with another Proxy"): + with self.assertRaises(DHError) as cm: + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy() + right_proxy = self.test_table.drop_columns(["b", "d"]).partition_by("c").proxy() + joined_pt_proxy = pt_proxy.natural_join(right_proxy, on="a", joins="e") + self.assertIn("join keys found in multiple constituents", str(cm.exception)) + print(cm.exception) + + with self.assertRaises(DHError) as cm: + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) + right_proxy = self.test_table.drop_columns(["b", "d"]).partition_by("e").proxy() + joined_pt_proxy = pt_proxy.natural_join(right_proxy, on="a", joins="e") + self.assertIn("non-matching keys", str(cm.exception)) + + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) + right_proxy = self.test_table.drop_columns(["b", "d"]).partition_by("c").proxy() + joined_pt_proxy = pt_proxy.natural_join(right_proxy, on="a", joins="e") + for ct in joined_pt_proxy.target.constituent_tables: + self.assertEqual(len(ct.columns), 4) + + def test_exact_join(self): + with self.subTest("Join with a Table"): + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy() + right_table = self.test_table.drop_columns(["b", "c"]).group_by('a') + joined_pt_proxy = pt_proxy.exact_join(right_table, on="a", joins=["d", "e"]) + for ct, jct in zip(pt_proxy.target.constituent_tables, joined_pt_proxy.target.constituent_tables): + self.assertEqual(len(jct.columns), 5) + self.assertEqual(ct.size, jct.size) + self.assertLessEqual(jct.size, right_table.size) + + with self.subTest("Join with another Proxy"): + pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) + right_proxy = self.test_table.drop_columns(["b", "d"]).partition_by("c").proxy() + joined_pt_proxy = pt_proxy.exact_join(right_proxy, on="a", joins="e") + for ct, jct in zip(pt_proxy.target.constituent_tables, joined_pt_proxy.target.constituent_tables): + self.assertEqual(len(jct.columns), 4) + self.assertEqual(ct.size, jct.size) + self.assertLessEqual(jct.size, right_table.size) + + def test_cross_join(self): + with self.subTest("Join with a Table"): + pt_proxy = self.test_table.drop_columns(cols=["d", "e"]).partition_by("c").proxy() + right_table = self.test_table.where(["a % 2 > 0 && b % 3 == 1"]).drop_columns(cols=["b", "c"]).head(5) + with self.subTest("with some join keys"): + joined_pt_proxy = pt_proxy.join(right_table, on="a", joins=["d", "e"]) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size < 5]) + + with self.subTest("with no join keys"): + joined_pt_proxy = pt_proxy.join(right_table, joins="e") + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 5]) + + with self.subTest("Join with another Proxy"): + pt_proxy = self.test_table.drop_columns(cols=["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) + right_proxy = self.test_table.drop_columns(cols="b").partition_by("c").proxy() + joined_pt_proxy = pt_proxy.join(right_proxy, on="a", joins=["d", "e"]) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size < 5]) + + def test_as_of_join(self): + with self.subTest("Join with a Table"): + pt_proxy = self.test_table.drop_columns(cols=["d", "e"]).partition_by("c").proxy() + right_table = self.test_table.where(["a % 2 > 0"]).drop_columns(cols=["b", "c", "d"]) + + with self.subTest("as-of join"): + joined_pt_proxy = pt_proxy.aj(right_table, on=["a"]) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + joined_pt_proxy = pt_proxy.aj(right_table, on=["a"], joins="e", match_rule=AsOfMatchRule.LESS_THAN) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + with self.subTest("reverse as-of join"): + joined_pt_proxy = pt_proxy.raj(right_table, on=["a"]) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + joined_pt_proxy = pt_proxy.raj(right_table, on=["a"], joins="e", match_rule=AsOfMatchRule.GREATER_THAN) + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + with self.subTest("Join with another Proxy"): + pt_proxy = self.test_table.drop_columns(cols=["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) + right_proxy = self.test_table.drop_columns(cols="b").partition_by("c").proxy() + + with self.subTest("as-of join"): + joined_pt_proxy = pt_proxy.aj(right_proxy, on=["a"], joins="ac=c") + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + with self.subTest("reverse as-of join"): + joined_pt_proxy = pt_proxy.raj(right_proxy, on=["a"], joins="ac=c") + self.assertTrue([ct for ct in joined_pt_proxy.target.constituent_tables if ct.size > 0]) + + def test_group_by(self): + with self.subTest("with some columns"): + grouped_pt_proxy = self.pt_proxy.group_by(by=["a", "b"]) + for gct, ct in zip(grouped_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + with self.subTest("with no columns"): + grouped_pt_proxy = self.pt_proxy.group_by() + for gct, ct in zip(grouped_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + + def test_count_by(self): + agg_pt_proxy = self.pt_proxy.count_by(col="cnt", by=["a"]) + for gct, ct in zip(agg_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + self.assertEqual(len(gct.columns), 2) + + def test_dedicated_agg(self): + ops = [ + PartitionedTableProxy.first_by, + PartitionedTableProxy.last_by, + PartitionedTableProxy.sum_by, + PartitionedTableProxy.avg_by, + PartitionedTableProxy.std_by, + PartitionedTableProxy.var_by, + PartitionedTableProxy.median_by, + PartitionedTableProxy.min_by, + PartitionedTableProxy.max_by, + ] + + for op in ops: + with self.subTest(op=op): + agg_pt_proxy = op(self.pt_proxy, by=["a", "b"]) + for gct, ct in zip(agg_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + self.assertEqual(len(gct.columns), len(ct.columns)) + + def test_agg_by(self): + aggs = [ + sum_(cols=["SumC=c"]), + avg(cols=["AvgB = b", "AvgD = d"]), + pct(percentile=0.5, cols=["PctC = e"]), + weighted_avg(wcol="d", cols=["WavGD = d"]), + formula( + formula="min(each)", formula_param="each", cols=["MinA=a", "MinD=d"] + ), + ] + + agg_pt_proxy = self.pt_proxy.agg_by(aggs=aggs, by=["a"]) + for gct, ct in zip(agg_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + self.assertEqual(len(gct.columns), 8) + + def test_agg_all_by(self): + aggs = [ + group(), + avg(), + first(), + last(), + max_(), + median(), + min_(), + pct(0.20), + std(), + sum_(), + abs_sum(), + var(), + weighted_avg("b"), + ] + for agg in aggs: + agg_pt_proxy = self.pt_proxy.agg_all_by(agg=agg, by=["a"]) + for gct in agg_pt_proxy.target.constituent_tables: + self.assertGreaterEqual(gct.size, 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index d6cfc38ed82..e0577744de4 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -108,7 +108,7 @@ def test_update_error(self): self.assertTrue(cm.exception.root_cause) self.assertIn("RuntimeError", cm.exception.compact_traceback) - def test_usv(self): + def test_USV(self): ops = [ Table.update, Table.lazy_update, diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index 0d81b036a8e..ac2bb272aaf 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -250,6 +250,20 @@ def test_auto_locking_table_factory(self): with self.subTest("Merge Sorted"): self.skipTest("mergeSorted does not yet support refreshing tables") + def test_auto_locking_partitioned_table_proxy(self): + with ugp.shared_lock(): + test_table = time_table("00:00:01").update(["X=i", "Y=i%13", "Z=X*Y"]) + proxy = test_table.drop_columns(["Timestamp", "Y"]).partition_by(by="X").proxy() + proxy2 = test_table.drop_columns(["Timestamp", "Z"]).partition_by(by="X").proxy() + + with self.assertRaises(DHError) as cm: + joined_pt_proxy = proxy.natural_join(proxy2, on="X") + self.assertRegex(str(cm.exception), r"IllegalStateException") + + ugp.auto_locking = True + joined_pt_proxy = proxy.natural_join(proxy2, on="X") + del joined_pt_proxy + if __name__ == "__main__": unittest.main() From 232883c5729cba04b6e9abb98491c5457cac6c5b Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Tue, 19 Jul 2022 16:02:29 -0400 Subject: [PATCH 014/215] Update redpanda docker repo (#2651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update redpanda docker repo Was getting an unauthorized error from docker.vectorized.io/redpanda: ``` ➜ main git:(heap-size-api) PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin/:$PATH ./gradlew :Integrations:composeUp > Task :Integrations:composeUp redpanda uses an image, skipping Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/ Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/ Pulling redpanda (docker.vectorized.io/vectorized/redpanda:v21.9.5)... unauthorized: authentication required Removing network 7068f1a4e250e19015aa8e4c8be5964a_integrations__default > Task :Integrations:composeUp FAILED FAILURE: Build failed with an exception. ``` Check to use docker.redpanda.com/vectorized/redpanda instead, and now it works again. --- containers/python-examples-redpanda/docker-compose.yml | 2 +- debezium/docker-compose-debezium-common.yml | 2 +- debezium/perf/redpanda/Dockerfile | 2 +- redpanda-standalone/docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/python-examples-redpanda/docker-compose.yml b/containers/python-examples-redpanda/docker-compose.yml index 3c2fc1e4228..9585008d32d 100644 --- a/containers/python-examples-redpanda/docker-compose.yml +++ b/containers/python-examples-redpanda/docker-compose.yml @@ -59,7 +59,7 @@ services: - PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092 - --advertise-kafka-addr - PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092 - image: docker.vectorized.io/vectorized/redpanda:v21.4.13 + image: docker.redpanda.com/vectorized/redpanda:v21.4.13 ports: - 9092:9092 - 29092:29092 diff --git a/debezium/docker-compose-debezium-common.yml b/debezium/docker-compose-debezium-common.yml index ccb1fbb28c2..e3fd99976c2 100644 --- a/debezium/docker-compose-debezium-common.yml +++ b/debezium/docker-compose-debezium-common.yml @@ -5,7 +5,7 @@ version: '3.4' services: redpanda: - image: docker.vectorized.io/vectorized/redpanda:${REDPANDA_VERSION} + image: docker.redpanda.com/vectorized/redpanda:${REDPANDA_VERSION} command: - redpanda start - --reactor-backend=epoll diff --git a/debezium/perf/redpanda/Dockerfile b/debezium/perf/redpanda/Dockerfile index cba3d94f8ea..286809cef58 100644 --- a/debezium/perf/redpanda/Dockerfile +++ b/debezium/perf/redpanda/Dockerfile @@ -1,5 +1,5 @@ ARG REDPANDA_VERSION -FROM docker.vectorized.io/vectorized/redpanda:${REDPANDA_VERSION} +FROM docker.redpanda.com/vectorized/redpanda:${REDPANDA_VERSION} COPY --chown=redpanda:redpanda redpanda.yaml /etc/redpanda diff --git a/redpanda-standalone/docker-compose.yml b/redpanda-standalone/docker-compose.yml index c5c1feea7ea..3cc82d1ecb5 100644 --- a/redpanda-standalone/docker-compose.yml +++ b/redpanda-standalone/docker-compose.yml @@ -15,7 +15,7 @@ services: - PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092 - --pandaproxy-addr 0.0.0.0:8082 - --advertise-pandaproxy-addr redpanda:8082 - image: docker.vectorized.io/vectorized/redpanda:v21.9.5 + image: docker.redpanda.com/vectorized/redpanda:v21.9.5 ports: - 8081:8081 - 8082:8082 From ed75dfd9c7a5e473000919af84137fad4408a13e Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 21 Jul 2022 08:03:16 -0700 Subject: [PATCH 015/215] Bump base images and python requirements (#2656) --- docker/registry/nginx-base/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- .../registry/python-dev-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/slim-base/gradle.properties | 2 +- .../registry/tensorflow-base/gradle.properties | 2 +- .../src/main/server-nltk/requirements.txt | 6 +++--- .../src/main/server-pytorch/requirements.txt | 18 +++++++++--------- .../src/main/server-sklearn/requirements.txt | 4 ++-- .../main/server-tensorflow/requirements.txt | 18 +++++++++--------- docker/server/src/main/server/requirements.txt | 4 ++-- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docker/registry/nginx-base/gradle.properties b/docker/registry/nginx-base/gradle.properties index f5f630bc2c2..fc19fd3aea1 100644 --- a/docker/registry/nginx-base/gradle.properties +++ b/docker/registry/nginx-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nginx-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nginx-base@sha256:4a230c72e7ad02948debf1e39b52adde07425bb7c4401f4110852decac560297 +deephaven.registry.imageId=ghcr.io/deephaven/nginx-base@sha256:4833e381165ec4fe0f84114db34aa0ca5321663fe0a3aef3d35484dc5a793f18 diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index 6c5e4bafe88..5e687bd621e 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:64c89c290833c1914f05794651c4ff01f7153905e9f8b2d53c3bbee2af613e0b +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:426cb67547a0c6e8ac6dc3f3e7eddcdfa67adbb70a07bfc12f7439f41994f9e1 diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index 73190d5633c..9d16b4dfd03 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:0c571044148fd772bbc03fd42d293939ce3e39d7aa1e095dd87c33ce89796829 +deephaven.registry.imageId=node@sha256:a086a11f7780399837ea0465ac8a8e8f14f2b66fe5a110fe0c24644d53a103c5 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 30299345e6a..50127784010 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:37bbd8e00c12c6e21a78b71c8dee3995aab7305f29f71ed4168ddad066a99dcf +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:820ca8317611a0305976dda2501c4173bf6ad55faaef227323511a0ed91c820b diff --git a/docker/registry/python-dev-base/gradle.properties b/docker/registry/python-dev-base/gradle.properties index 0e879d7baea..65fdf0aa774 100644 --- a/docker/registry/python-dev-base/gradle.properties +++ b/docker/registry/python-dev-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/python-dev-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:b94597d7ad7d39126a072645d461f9ac1f0b9396ef7ea8e3914485f1f139c58e +deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:b4e20062c47609a8cb309b39120c27c8b9e6f57705e703c9a0bffc431dd930e5 diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index b338667e415..f785c789d24 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:a971d05de09c75f874e32487412ee7109cb76adb3297db9d39a5efb1b2eb4ccc +deephaven.registry.imageId=python@sha256:7f9798664c8b1cdaccc19f1b90105a27db736c861c8184198dc7a8c01f82ccec diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index cbb34ab69c1..1140afef1a7 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:cf53af629b2ccb90baa60a7cf9047e5a554354d1ad53d152474024f9e65cfc6a +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:80f9dfca3c1e62a10620e72836bd3b64040227071245a74af28496eb3060a2ea diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index be3c35e309f..240b07056b3 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:670064e7d3f8ba01df481bfc2630e2d8a5dff0f8bfbf04fd32ace464ad199463 +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:3055424dd6202b7866283e1e3e450096fb0f10fc5773f5d42fb514ee377b00ef diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index 5527b4c2acd..bf61bf4f010 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:8c5dac4402471edaab0fef209bcebd7fc61028870970ba39fe2e163f03146113 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:71b49ab3c915f6a8bee860bebbdbda4e195b22f983fabd2a4d4736636600c1c5 diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index e8310383cee..7ab314db9aa 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:ce9f7ca3f108b24eb595b11c7d61cb5a7f9a79d68564f3e86f9abb5822c05aa9 +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:2939e60d674ac0b25d28309973e7ba864effd5a9ac3cfdd40ed16b05f712b1d5 diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index 00350c2ebca..e2fc6ce0320 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:fcc4b8d47efaedc0ca9aab7c6267b4c473626f6ef08d05d82630c6b4acdad54b +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:079891f41c08de846b3572304b372f969a3d20ec5ef0a45d8ee9781a8a7afc58 diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk/requirements.txt index 790da7bf7f9..f12a5d343b6 100644 --- a/docker/server/src/main/server-nltk/requirements.txt +++ b/docker/server/src/main/server-nltk/requirements.txt @@ -10,8 +10,8 @@ numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.1 -regex==2022.6.2 +regex==2022.7.9 six==1.16.0 tqdm==4.64.0 -typing_extensions==4.2.0 -zipp==3.8.0 +typing_extensions==4.3.0 +zipp==3.8.1 diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch/requirements.txt index e176e7b868f..e11eb2c73bf 100644 --- a/docker/server/src/main/server-pytorch/requirements.txt +++ b/docker/server/src/main/server-pytorch/requirements.txt @@ -1,16 +1,16 @@ -absl-py==1.1.0 +absl-py==1.2.0 cachetools==5.2.0 certifi==2022.6.15 -charset-normalizer==2.0.12 +charset-normalizer==2.1.0 deephaven-plugin==0.2.0 -google-auth==2.8.0 +google-auth==2.9.1 google-auth-oauthlib==0.4.6 grpcio==1.47.0 idna==3.3 importlib-metadata==4.12.0 jpy==0.11.0 llvmlite==0.38.1 -Markdown==3.3.7 +Markdown==3.4.1 numba==0.55.2 numpy==1.21.6 oauthlib==3.2.0 @@ -20,15 +20,15 @@ pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 pytz==2022.1 -requests==2.28.0 +requests==2.28.1 requests-oauthlib==1.3.1 -rsa==4.8 +rsa==4.9 six==1.16.0 tensorboard==2.9.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 torch==1.10.2 -typing_extensions==4.2.0 -urllib3==1.26.9 +typing_extensions==4.3.0 +urllib3==1.26.10 Werkzeug==2.1.2 -zipp==3.8.0 +zipp==3.8.1 diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn/requirements.txt index bc1dc6dd4b8..c5627377c9c 100644 --- a/docker/server/src/main/server-sklearn/requirements.txt +++ b/docker/server/src/main/server-sklearn/requirements.txt @@ -12,5 +12,5 @@ scikit-learn==0.24.2 scipy==1.7.3 six==1.16.0 threadpoolctl==3.1.0 -typing_extensions==4.2.0 -zipp==3.8.0 +typing_extensions==4.3.0 +zipp==3.8.1 diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow/requirements.txt index 339b36d2018..1d9c082c5e0 100644 --- a/docker/server/src/main/server-tensorflow/requirements.txt +++ b/docker/server/src/main/server-tensorflow/requirements.txt @@ -1,12 +1,12 @@ -absl-py==1.1.0 +absl-py==1.2.0 astunparse==1.6.3 cachetools==5.2.0 certifi==2022.6.15 -charset-normalizer==2.0.12 +charset-normalizer==2.1.0 deephaven-plugin==0.2.0 flatbuffers==2.0 gast==0.4.0 -google-auth==2.8.0 +google-auth==2.9.1 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 grpcio==1.47.0 @@ -18,7 +18,7 @@ keras==2.7.0 Keras-Preprocessing==1.1.2 libclang==14.0.1 llvmlite==0.38.1 -Markdown==3.3.7 +Markdown==3.4.1 numba==0.55.2 numpy==1.21.6 oauthlib==3.2.0 @@ -29,9 +29,9 @@ pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 pytz==2022.1 -requests==2.28.0 +requests==2.28.1 requests-oauthlib==1.3.1 -rsa==4.8 +rsa==4.9 six==1.16.0 tensorboard==2.9.1 tensorboard-data-server==0.6.1 @@ -40,8 +40,8 @@ tensorflow==2.7.3 tensorflow-estimator==2.7.0 tensorflow-io-gcs-filesystem==0.26.0 termcolor==1.1.0 -typing_extensions==4.2.0 -urllib3==1.26.9 +typing_extensions==4.3.0 +urllib3==1.26.10 Werkzeug==2.1.2 wrapt==1.14.1 -zipp==3.8.0 +zipp==3.8.1 diff --git a/docker/server/src/main/server/requirements.txt b/docker/server/src/main/server/requirements.txt index 95a480b83ef..67263717353 100644 --- a/docker/server/src/main/server/requirements.txt +++ b/docker/server/src/main/server/requirements.txt @@ -8,5 +8,5 @@ pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.1 six==1.16.0 -typing_extensions==4.2.0 -zipp==3.8.0 +typing_extensions==4.3.0 +zipp==3.8.1 From faf38266740d65daf75954ae0066af059a014227 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 21 Jul 2022 08:14:12 -0700 Subject: [PATCH 016/215] Create java client tests for view, update, updateView, select, where, and aggBy (#2652) --- .../io/deephaven/client/AggBySessionTest.java | 97 ++++++++++++ .../client/UpdateOrSelectSessionTest.java | 141 ++++++++++++++++++ .../io/deephaven/client/WhereSessionTest.java | 78 ++++++++++ 3 files changed, 316 insertions(+) create mode 100644 java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java create mode 100644 java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java create mode 100644 java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java new file mode 100644 index 00000000000..601e80a74cd --- /dev/null +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java @@ -0,0 +1,97 @@ +package io.deephaven.client; + +import io.deephaven.api.agg.Aggregation; +import io.deephaven.client.impl.TableHandle; +import io.deephaven.qst.table.TableSpec; +import io.deephaven.qst.table.TimeTable; +import org.junit.Test; + +import java.time.Duration; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; + +public class AggBySessionTest extends DeephavenSessionTestBase { + + public static int myFunction() { + return 42; + } + + @Test + public void allowStaticI() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "Key = i % 2"); + } + + @Test + public void allowStaticII() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "Key = ii % 2"); + } + + @Test + public void allowTimeTableI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "Key = i % 2"); + } + + @Test + public void allowTimeTableII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "Key = ii % 2"); + } + + @Test + public void disallowTickingI() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = i % 2"); + } + + @Test + public void disallowTickingII() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = ii % 2"); + } + + @Test + public void disallowCustomFunctions() throws InterruptedException { + disallow(TableSpec.empty(1), String.format("Key = %s.myFunction()", AggBySessionTest.class.getName())); + } + + @Test + public void disallowNew() throws InterruptedException { + disallow(TableSpec.empty(1), "Key = new Object()"); + } + + @Test + public void allowPreviousColumn() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12", "Y = X + 1"); + } + + @Test + public void disallowFutureColumn() throws InterruptedException { + disallow(TableSpec.empty(1), "Y = X + 1", "X = 12"); + } + + @Test + public void allowReassignmentColumn() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12", "Y = X + 1", "X = 42"); + } + + @Test + public void disallowNonExistentColumn() throws InterruptedException { + disallow(TableSpec.empty(1), "X = 12", "Y = Z + 1"); + } + + private void allow(TableSpec parent, String... groupBys) + throws InterruptedException, TableHandle.TableHandleException { + try (final TableHandle handle = + session.batch().execute(parent.aggBy(Aggregation.AggCount("Count"), groupBys))) { + assertThat(handle.isSuccessful()).isTrue(); + } + } + + private void disallow(TableSpec parent, String... groupBys) throws InterruptedException { + try (final TableHandle handle = + session.batch().execute(parent.aggBy(Aggregation.AggCount("Count"), groupBys))) { + failBecauseExceptionWasNotThrown(TableHandle.TableHandleException.class); + } catch (TableHandle.TableHandleException e) { + // expected + } + } +} + diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java new file mode 100644 index 00000000000..d401cd79a30 --- /dev/null +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java @@ -0,0 +1,141 @@ +package io.deephaven.client; + +import io.deephaven.client.impl.TableHandle; +import io.deephaven.qst.table.TableSpec; +import io.deephaven.qst.table.TimeTable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.time.Duration; +import java.util.Arrays; +import java.util.Objects; +import java.util.function.BiFunction; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; + +@RunWith(Parameterized.class) +public class UpdateOrSelectSessionTest extends DeephavenSessionTestBase { + + public static int myFunction() { + return 42; + } + + @Parameterized.Parameters(name = "{0}") + public static Iterable methods() { + return () -> Arrays.stream(UpdateOrSelect.values()).map(u -> new Object[] {u}).iterator(); + } + + enum UpdateOrSelect implements BiFunction { + VIEW { + @Override + public TableSpec apply(TableSpec spec, String[] formulas) { + return spec.view(formulas); + } + }, + UPDATE_VIEW { + @Override + public TableSpec apply(TableSpec spec, String[] formulas) { + return spec.updateView(formulas); + } + }, + UPDATE { + @Override + public TableSpec apply(TableSpec spec, String[] formulas) { + return spec.update(formulas); + } + }, + SELECT { + @Override + public TableSpec apply(TableSpec spec, String[] formulas) { + return spec.select(formulas); + } + } + // TODO Lazy via TableSpec + } + + private final UpdateOrSelect method; + + + public UpdateOrSelectSessionTest(UpdateOrSelect method) { + this.method = Objects.requireNonNull(method); + } + + + @Test + public void allowStaticI() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "X = i"); + } + + @Test + public void allowStaticII() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "X = ii"); + } + + @Test + public void allowTimeTableI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "X = i"); + } + + @Test + public void allowTimeTableII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "X = ii"); + } + + @Test + public void disallowTickingI() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = i"); + } + + @Test + public void disallowTickingII() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = ii"); + } + + @Test + public void disallowCustomFunctions() throws InterruptedException { + disallow(TableSpec.empty(1), String.format("X = %s.myFunction()", UpdateOrSelectSessionTest.class.getName())); + } + + @Test + public void disallowNew() throws InterruptedException { + disallow(TableSpec.empty(1), "X = new Object()"); + } + + @Test + public void allowPreviousColumn() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12", "Y = X + 1"); + } + + @Test + public void disallowFutureColumn() throws InterruptedException { + disallow(TableSpec.empty(1), "Y = X + 1", "X = 12"); + } + + @Test + public void allowReassignmentColumn() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12", "Y = X + 1", "X = 42"); + } + + @Test + public void disallowNonExistentColumn() throws InterruptedException { + disallow(TableSpec.empty(1), "X = 12", "Y = Z + 1"); + } + + private void allow(TableSpec parent, String... formulas) + throws InterruptedException, TableHandle.TableHandleException { + try (final TableHandle handle = session.batch().execute(method.apply(parent, formulas))) { + assertThat(handle.isSuccessful()).isTrue(); + } + } + + private void disallow(TableSpec parent, String... formulas) throws InterruptedException { + try (final TableHandle handle = session.batch().execute(method.apply(parent, formulas))) { + failBecauseExceptionWasNotThrown(TableHandle.TableHandleException.class); + } catch (TableHandle.TableHandleException e) { + // expected + } + } +} + diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java new file mode 100644 index 00000000000..6341bef63ad --- /dev/null +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java @@ -0,0 +1,78 @@ +package io.deephaven.client; + +import io.deephaven.client.impl.TableHandle; +import io.deephaven.qst.table.TableSpec; +import io.deephaven.qst.table.TimeTable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.time.Duration; +import java.util.Arrays; +import java.util.Objects; +import java.util.function.BiFunction; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; + +public class WhereSessionTest extends DeephavenSessionTestBase { + + public static int myFunction() { + return 42; + } + + @Test + public void allowStaticI() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "i % 2 == 0"); + } + + @Test + public void allowStaticII() throws InterruptedException, TableHandle.TableHandleException { + allow(TableSpec.empty(1), "ii % 2 == 0"); + } + + @Test + public void allowTimeTableI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "i % 2 == 0"); + } + + @Test + public void allowTimeTableII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)), "ii % 2 == 0"); + } + + @Test + public void disallowTickingI() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "i % 2 == 0"); + } + + @Test + public void disallowTickingII() throws InterruptedException { + disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "ii % 2 == 0"); + } + + @Test + public void disallowCustomFunctions() throws InterruptedException { + disallow(TableSpec.empty(1), String.format("%s.myFunction() == 42", WhereSessionTest.class.getName())); + } + + @Test + public void disallowNew() throws InterruptedException { + disallow(TableSpec.empty(1), "new Object() == 42"); + } + + private void allow(TableSpec parent, String filter) throws InterruptedException, TableHandle.TableHandleException { + try (final TableHandle handle = session.batch().execute(parent.where(filter))) { + assertThat(handle.isSuccessful()).isTrue(); + } + } + + private void disallow(TableSpec parent, String filter) throws InterruptedException { + try (final TableHandle handle = session.batch().execute(parent.where(filter))) { + failBecauseExceptionWasNotThrown(TableHandle.TableHandleException.class); + } catch (TableHandle.TableHandleException e) { + // expected + } + } +} + From 05743078eb35de86b62e2291cebdcffd5e6ed525 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 21 Jul 2022 11:27:30 -0400 Subject: [PATCH 017/215] Add port to the Embedded server instance (#2657) That way you can get the port for the currently running server, which may be useful --- py/embedded-server/README.md | 2 +- py/embedded-server/deephaven_server/server.py | 4 ++++ .../main/java/io/deephaven/python/server/EmbeddedServer.java | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/py/embedded-server/README.md b/py/embedded-server/README.md index a6c35ff6c1d..6b06d2c6c08 100644 --- a/py/embedded-server/README.md +++ b/py/embedded-server/README.md @@ -3,7 +3,7 @@ Embeds the Deephaven Core server into a python module, so that it can be started from python, with tables produced directly as part of startup. -## Dev envirnoment setup +## Dev environment setup Java 11 and Docker are required to build this project, as most of the repository is needed to properly build it. Note that jpy or deephaven-jpy (built for your OS and archetecture) and the deephaven server apiwheel is also required. diff --git a/py/embedded-server/deephaven_server/server.py b/py/embedded-server/deephaven_server/server.py index 484a77d82eb..53fb3a53d07 100644 --- a/py/embedded-server/deephaven_server/server.py +++ b/py/embedded-server/deephaven_server/server.py @@ -19,6 +19,10 @@ class Server: def j_object(self): return self.j_server + @property + def port(self): + return self.j_server.getPort() + def __init__(self, host: Optional[str] = None, port: Optional[int] = None, jvm_args: Optional[List[str]] = None, dh_args: Dict[str, str] = {}): """ Creates a Deephaven embedded server. Only one instance can be created at this time. diff --git a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java index 4162b543bec..e86af6297ed 100644 --- a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java +++ b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java @@ -100,4 +100,8 @@ private void checkGlobals(ScriptSession scriptSession, @Nullable ScriptSession.S checkGlobals(scriptSession, s); }); } + + public int getPort() { + return server.server().getPort(); + } } From 46dc46d5fbab420e5575c90ba2d980d4dc13debd Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Thu, 21 Jul 2022 14:14:06 -0700 Subject: [PATCH 018/215] Improve usability and docs for UpdateBy (#2659) * Added default import and updated javadoc (for updateBy) * Removed unneeded of() overload and updated tests Co-authored-by: Ryan Caudy --- .../java/io/deephaven/engine/table/Table.java | 67 ++++++++++--------- .../engine/util/GroovyDeephavenSession.java | 2 + .../table/impl/updateby/TestCumMinMax.java | 5 +- .../table/impl/updateby/TestCumProd.java | 3 +- .../table/impl/updateby/TestCumSum.java | 3 +- .../impl/updateby/TestUpdateByGeneral.java | 7 +- .../api/updateby/UpdateByClause.java | 23 ++----- 7 files changed, 52 insertions(+), 58 deletions(-) diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index 7f9e57a5a39..31bde70cab0 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -1726,77 +1726,80 @@ Table rollup(Collection aggregations, boolean includeCons // ----------------------------------------------------------------------------------------------------------------- /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operation to it. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. * * @param operation the operation to apply to the table. - * @return a table with the same index, with the specified operations applied to the entire table + * @return a table with the same rowset, with the specified operation applied to the entire table */ @ConcurrentMethod Table updateBy(@NotNull final UpdateByClause operation); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are - * capable of processing state between rows. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. * * @param operations the operations to apply to the table. - * @return a table with the same index, with the specified operations applied to the entire table. + * @return a table with the same rowset, with the specified operations applied to the entire table. */ @ConcurrentMethod Table updateBy(@NotNull final Collection operations); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are - * capable of processing state between rows. This operation will group the table by the specified set of keys if - * provided before applying the operation. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. * * @param control the {@link UpdateByControl control} to use when updating the table. * @param operations the operations to apply to the table. - * @return a table with the same index, with the specified operations applied to each group defined by the - * {@code byColumns} + * @return a table with the same rowset, with the specified operations applied to the entire table */ @ConcurrentMethod Table updateBy(@NotNull final UpdateByControl control, @NotNull final Collection operations); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified row based - * operation to it. This operation will group the table by the specified set of keys if provided before applying the - * operation. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). * * @param operation the operation to apply to the table. * @param byColumns the columns to group by before applying. - * @return a table with the same index, with the specified operations applied to each group defined by the + * @return a table with the same rowSet, with the specified operation applied to each group defined by the * {@code byColumns} */ @ConcurrentMethod Table updateBy(@NotNull final UpdateByClause operation, final String... byColumns); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are - * capable of processing state between rows. This operation will group the table by the specified set of keys if - * provided before applying the operation. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). * * @param operations the operations to apply to the table. * @param byColumns the columns to group by before applying. - * @return a table with the same index, with the specified operations applied to each group defined by the + * @return a table with the same rowSet, with the specified operations applied to each group defined by the * {@code byColumns} */ @ConcurrentMethod Table updateBy(@NotNull final Collection operations, final String... byColumns); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are - * capable of processing state between rows. This operation will group the table by the specified set of keys if - * provided before applying the operation. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). * * @param operations the operations to apply to the table. * @param byColumns the columns to group by before applying. - * @return a table with the same index, with the specified operations applied to each group defined by the + * @return a table with the same rowSet, with the specified operations applied to each group defined by the * {@code byColumns} */ @ConcurrentMethod @@ -1804,15 +1807,15 @@ Table updateBy(@NotNull Collection operations, @NotNull Collection byColumns); /** - * Create a table with the same {@link #getRowSet() rowSet} as its parent that will perform the specified set of row - * based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are - * capable of processing state between rows. This operation will group the table by the specified set of keys if - * provided before applying the operation. + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). * * @param control the {@link UpdateByControl control} to use when updating the table. * @param operations the operations to apply to the table. * @param byColumns the columns to group by before applying. - * @return a table with the same index, with the specified operations applied to each group defined by the + * @return a table with the same rowSet, with the specified operations applied to each group defined by the * {@code byColumns} */ @ConcurrentMethod diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java index 7cbc997c76e..3a4f88b60fc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java @@ -541,6 +541,8 @@ private Pair fullCommand(String command) { "import static io.deephaven.time.TimeZone.*;\n" + "import static io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils.*;\n" + "import static io.deephaven.api.agg.Aggregation.*;\n" + + "import static io.deephaven.api.updateby.UpdateByClause.*;\n" + + StringUtils.joinStrings(scriptImports, "\n") + "\n"; return new Pair<>(commandPrefix, commandPrefix + command + "\n\n// this final true prevents Groovy from interpreting a trailing class definition as something to execute\n;\ntrue;\n"); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java index bda733eff18..8afe22afdd8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java @@ -14,6 +14,7 @@ import org.junit.experimental.categories.Category; import java.util.Arrays; +import java.util.List; import java.util.Random; import static io.deephaven.engine.table.impl.GenerateTableUpdates.generateAppends; @@ -28,7 +29,7 @@ public class TestCumMinMax extends BaseUpdateByTest { public void testStaticZeroKey() { final QueryTable t = createTestTable(100000, false, false, false, 0x2134BCFA).t; - final Table result = t.updateBy(UpdateByClause.of( + final Table result = t.updateBy(List.of( UpdateByClause.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", "longColMin=longCol", "floatColMin=floatCol", "doubleColMin=doubleCol", "bigIntColMin=bigIntCol", "bigDecimalColMin=bigDecimalCol"), @@ -61,7 +62,7 @@ public void testStaticGroupedBucketed() { private void doTestStaticBucketed(boolean grouped) { final QueryTable t = createTestTable(100000, true, grouped, false, 0xACDB4321).t; - final Table result = t.updateBy(UpdateByClause.of( + final Table result = t.updateBy(List.of( UpdateByClause.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", "longColMin=longCol", "floatColMin=floatCol", "doubleColMin=doubleCol", "bigIntColMin=bigIntCol", "bigDecimalColMin=bigDecimalCol"), diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java index 6253739316d..a247a9bc0a8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java @@ -16,6 +16,7 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Arrays; +import java.util.List; import java.util.Random; import static io.deephaven.engine.table.impl.GenerateTableUpdates.generateAppends; @@ -62,7 +63,7 @@ public void testNullOnBucketChange() throws IOException { longCol("ShortValProd", 1, 2, NULL_LONG, 3), longCol("IntValProd", 1, 2, NULL_LONG, 3)); - final Table r = t.updateBy(UpdateByClause.of( + final Table r = t.updateBy(List.of( UpdateByClause.CumProd("ByteValProd=ByteVal"), UpdateByClause.CumProd("ShortValProd=ShortVal"), UpdateByClause.CumProd("IntValProd=IntVal")), "Sym"); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java index e54bf746953..d7645099843 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java @@ -16,6 +16,7 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Arrays; +import java.util.List; import java.util.Random; import static io.deephaven.engine.table.impl.GenerateTableUpdates.generateAppends; @@ -62,7 +63,7 @@ public void testNullOnBucketChange() throws IOException { longCol("ShortValSum", 1, 3, NULL_LONG, 3), longCol("IntValSum", 1, 3, NULL_LONG, 3)); - final Table r = t.updateBy(UpdateByClause.of( + final Table r = t.updateBy(List.of( UpdateByClause.CumSum("ByteValSum=ByteVal"), UpdateByClause.CumSum("ShortValSum=ShortVal"), UpdateByClause.CumSum("IntValSum=IntVal")), "Sym"); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java index 97f4d21ce8a..e0b0b3f4f3b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java @@ -14,10 +14,7 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; +import java.util.*; import static io.deephaven.engine.table.impl.GenerateTableUpdates.generateAppends; import static io.deephaven.engine.table.impl.RefreshingTableTestCase.simulateShiftAwareStep; @@ -91,7 +88,7 @@ protected Table e() { } final String[] columnNamesArray = base.getDefinition().getColumnNamesArray(); - final Collection clauses = UpdateByClause.of( + final Collection clauses = List.of( UpdateByClause.Fill(), UpdateByClause.Ema(skipControl, "ts", 10 * MINUTE, makeOpColNames(columnNamesArray, "_ema", "Sym", "ts", "boolCol")), diff --git a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java index b4e0cbfb212..43920c06e8f 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java @@ -35,17 +35,6 @@ static ColumnUpdateClause of(final UpdateBySpec spec, final Pair... columns) { return spec.clause(columns); } - /** - * Simply wrap the input specs as a collection suitable for Table#updateBy(). This is functionally equivalent to - * {@link Arrays#asList(Object[])}. - * - * @param operations the operations to wrap. - * @return a collection for use with Table#updateBy()} - */ - static Collection of(final UpdateByClause... operations) { - return Arrays.asList(operations); - } - /** * Create an {@link CumSumSpec cumulative sum} for the supplied column name pairs. * @@ -108,7 +97,7 @@ static UpdateByClause Fill(String... pairs) { * ema_next = a * ema_last + (1 - a) * value * * - * @param timeScaleTicks the decay rate (tau) in ticks + * @param timeScaleTicks the decay rate in ticks * @param pairs The input/output column name pairs * @return The aggregation */ @@ -130,7 +119,7 @@ static UpdateByClause Ema(long timeScaleTicks, String... pairs) { * * @param control a {@link EmaControl control} object that defines how special cases should behave. See * {@link EmaControl} for further details. - * @param timeScaleTicks the decay rate (tau) in ticks + * @param timeScaleTicks the decay rate in ticks * @param pairs The input/output column name pairs * @return The aggregation */ @@ -151,7 +140,7 @@ static UpdateByClause Ema(final EmaControl control, long timeScaleTicks, String. * * * @param timestampColumn the column in the source table to use for timestamps - * @param timeScaleNanos the decay rate (tau) in nanoseconds + * @param timeScaleNanos the decay rate in nanoseconds * @param pairs The input/output column name pairs * @return The aggregation */ @@ -174,7 +163,7 @@ static UpdateByClause Ema(String timestampColumn, long timeScaleNanos, String... * @param control a {@link EmaControl control} object that defines how special cases should behave. See * {@link EmaControl} for further details. * @param timestampColumn the column in the source table to use for timestamps - * @param timeScaleNanos the decay rate (tau) in nanoseconds + * @param timeScaleNanos the decay rate in nanoseconds * @param pairs The input/output column name pairs * @return The aggregation */ @@ -195,7 +184,7 @@ static UpdateByClause Ema(EmaControl control, String timestampColumn, long timeS * * * @param timestampColumn the column in the source table to use for timestamps - * @param emaDuration the decay rate (tau) as {@Link Duration duration} + * @param emaDuration the decay rate as {@Link Duration duration} * @param pairs The input/output column name pairs * @return The aggregation */ @@ -218,7 +207,7 @@ static UpdateByClause Ema(String timestampColumn, Duration emaDuration, String.. * @param control a {@link EmaControl control} object that defines how special cases should behave. See * {@link EmaControl} for further details. * @param timestampColumn the column in the source table to use for timestamps - * @param emaDuration the decay rate (tau) as {@Link Duration duration} + * @param emaDuration the decay rate as {@Link Duration duration} * @param pairs The input/output column name pairs * @return The aggregation */ From 5673b36e9ffce3c56e8f41e73511a16556eb017d Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Fri, 22 Jul 2022 10:06:23 -0600 Subject: [PATCH 019/215] Keep copyright at top of file when replicating (#2664) --- .../table/iterators/ByteColumnIterator.java | 4 ---- .../table/iterators/DoubleColumnIterator.java | 4 ---- .../table/iterators/FloatColumnIterator.java | 4 ---- .../table/iterators/LongColumnIterator.java | 4 ---- .../table/iterators/ShortColumnIterator.java | 4 ---- .../deephaven/chunk/sized/SizedObjectChunk.java | 3 +++ .../impl/by/ByteChunkedAddOnlyMinMaxOperator.java | 4 ---- .../table/impl/by/ByteChunkedAvgOperator.java | 4 ---- .../table/impl/by/ByteChunkedSumOperator.java | 4 ---- .../table/impl/by/ByteChunkedVarOperator.java | 4 ---- .../by/DoubleChunkedAddOnlyMinMaxOperator.java | 4 ---- .../table/impl/by/DoubleChunkedAvgOperator.java | 4 ---- .../table/impl/by/DoubleChunkedReAvgOperator.java | 4 ---- .../table/impl/by/DoubleChunkedSumOperator.java | 4 ---- .../table/impl/by/DoubleChunkedVarOperator.java | 4 ---- .../by/FloatChunkedAddOnlyMinMaxOperator.java | 4 ---- .../impl/by/IntChunkedAddOnlyMinMaxOperator.java | 4 ---- .../table/impl/by/IntChunkedAvgOperator.java | 4 ---- .../table/impl/by/IntChunkedSumOperator.java | 4 ---- .../table/impl/by/IntChunkedVarOperator.java | 4 ---- .../impl/by/LongChunkedAddOnlyMinMaxOperator.java | 4 ---- .../table/impl/by/LongChunkedAvgOperator.java | 4 ---- .../table/impl/by/LongChunkedSumOperator.java | 4 ---- .../table/impl/by/LongChunkedVarOperator.java | 4 ---- .../by/ObjectChunkedAddOnlyMinMaxOperator.java | 4 ---- .../by/ShortChunkedAddOnlyMinMaxOperator.java | 4 ---- .../table/impl/by/ShortChunkedAvgOperator.java | 4 ---- .../table/impl/by/ShortChunkedSumOperator.java | 4 ---- .../table/impl/by/ShortChunkedVarOperator.java | 4 ---- .../count/ByteChunkedCountDistinctOperator.java | 4 ---- .../count/ByteRollupCountDistinctOperator.java | 4 ---- .../count/DoubleChunkedCountDistinctOperator.java | 4 ---- .../count/DoubleRollupCountDistinctOperator.java | 4 ---- .../count/FloatChunkedCountDistinctOperator.java | 4 ---- .../count/FloatRollupCountDistinctOperator.java | 4 ---- .../count/IntChunkedCountDistinctOperator.java | 4 ---- .../count/IntRollupCountDistinctOperator.java | 4 ---- .../count/LongChunkedCountDistinctOperator.java | 4 ---- .../count/LongRollupCountDistinctOperator.java | 4 ---- .../count/ObjectChunkedCountDistinctOperator.java | 4 ---- .../count/ObjectRollupCountDistinctOperator.java | 4 ---- .../count/ShortChunkedCountDistinctOperator.java | 4 ---- .../count/ShortRollupCountDistinctOperator.java | 4 ---- .../distinct/ByteChunkedDistinctOperator.java | 4 ---- .../distinct/ByteRollupDistinctOperator.java | 4 ---- .../distinct/DoubleChunkedDistinctOperator.java | 4 ---- .../distinct/DoubleRollupDistinctOperator.java | 4 ---- .../distinct/FloatChunkedDistinctOperator.java | 4 ---- .../distinct/FloatRollupDistinctOperator.java | 4 ---- .../distinct/IntChunkedDistinctOperator.java | 4 ---- .../distinct/IntRollupDistinctOperator.java | 4 ---- .../distinct/LongChunkedDistinctOperator.java | 4 ---- .../distinct/LongRollupDistinctOperator.java | 4 ---- .../distinct/ObjectChunkedDistinctOperator.java | 4 ---- .../distinct/ObjectRollupDistinctOperator.java | 4 ---- .../distinct/ShortChunkedDistinctOperator.java | 4 ---- .../distinct/ShortRollupDistinctOperator.java | 4 ---- .../unique/ByteChunkedUniqueOperator.java | 4 ---- .../unique/ByteRollupUniqueOperator.java | 4 ---- .../unique/DoubleChunkedUniqueOperator.java | 4 ---- .../unique/DoubleRollupUniqueOperator.java | 4 ---- .../unique/FloatChunkedUniqueOperator.java | 4 ---- .../unique/FloatRollupUniqueOperator.java | 4 ---- .../unique/IntChunkedUniqueOperator.java | 4 ---- .../unique/IntRollupUniqueOperator.java | 4 ---- .../unique/LongChunkedUniqueOperator.java | 4 ---- .../unique/LongRollupUniqueOperator.java | 4 ---- .../unique/ObjectChunkedUniqueOperator.java | 4 ---- .../unique/ObjectRollupUniqueOperator.java | 4 ---- .../unique/ShortChunkedUniqueOperator.java | 4 ---- .../unique/ShortRollupUniqueOperator.java | 4 ---- .../ByteLongMegaMergeDescendingKernel.java | 2 +- .../DoubleLongMegaMergeDescendingKernel.java | 2 +- .../FloatLongMegaMergeDescendingKernel.java | 2 +- .../IntLongMegaMergeDescendingKernel.java | 2 +- .../LongLongMegaMergeDescendingKernel.java | 2 +- .../ObjectLongMegaMergeDescendingKernel.java | 2 +- .../ShortLongMegaMergeDescendingKernel.java | 2 +- .../timsort/ByteIntTimsortDescendingKernel.java | 2 +- .../timsort/ByteLongTimsortDescendingKernel.java | 2 +- .../timsort/DoubleIntTimsortDescendingKernel.java | 2 +- .../DoubleLongTimsortDescendingKernel.java | 2 +- .../timsort/FloatIntTimsortDescendingKernel.java | 2 +- .../timsort/FloatLongTimsortDescendingKernel.java | 2 +- .../timsort/IntIntTimsortDescendingKernel.java | 2 +- .../timsort/IntLongTimsortDescendingKernel.java | 2 +- .../timsort/LongIntTimsortDescendingKernel.java | 2 +- .../timsort/LongLongTimsortDescendingKernel.java | 2 +- .../NullAwareCharIntTimsortDescendingKernel.java | 2 +- .../NullAwareCharLongTimsortDescendingKernel.java | 2 +- .../timsort/ObjectIntTimsortDescendingKernel.java | 2 +- .../ObjectLongTimsortDescendingKernel.java | 2 +- .../timsort/ShortIntTimsortDescendingKernel.java | 2 +- .../timsort/ShortLongTimsortDescendingKernel.java | 2 +- .../sources/AbstractSparseLongArraySource.java | 4 ---- .../impl/sources/BooleanSparseArraySource.java | 4 ---- .../table/impl/sources/ByteArraySource.java | 4 ---- .../table/impl/sources/ByteSingleValueSource.java | 4 ---- .../table/impl/sources/ByteSparseArraySource.java | 4 ---- .../table/impl/sources/DoubleArraySource.java | 4 ---- .../impl/sources/DoubleSingleValueSource.java | 4 ---- .../impl/sources/DoubleSparseArraySource.java | 4 ---- .../table/impl/sources/FloatArraySource.java | 4 ---- .../impl/sources/FloatSingleValueSource.java | 4 ---- .../impl/sources/FloatSparseArraySource.java | 4 ---- .../table/impl/sources/IntegerArraySource.java | 4 ---- .../impl/sources/IntegerSingleValueSource.java | 4 ---- .../impl/sources/IntegerSparseArraySource.java | 4 ---- .../table/impl/sources/LongSingleValueSource.java | 4 ---- .../impl/sources/ObjectSingleValueSource.java | 4 ---- .../impl/sources/ObjectSparseArraySource.java | 4 ---- .../table/impl/sources/ShortArraySource.java | 4 ---- .../impl/sources/ShortSingleValueSource.java | 4 ---- .../impl/sources/ShortSparseArraySource.java | 4 ---- .../sources/UngroupedByteArrayColumnSource.java | 4 ---- .../sources/UngroupedByteVectorColumnSource.java | 4 ---- .../sources/UngroupedDoubleArrayColumnSource.java | 4 ---- .../UngroupedDoubleVectorColumnSource.java | 4 ---- .../sources/UngroupedFloatArrayColumnSource.java | 4 ---- .../sources/UngroupedFloatVectorColumnSource.java | 4 ---- .../sources/UngroupedIntArrayColumnSource.java | 4 ---- .../sources/UngroupedIntVectorColumnSource.java | 4 ---- .../sources/UngroupedLongArrayColumnSource.java | 4 ---- .../sources/UngroupedLongVectorColumnSource.java | 4 ---- .../sources/UngroupedShortArrayColumnSource.java | 4 ---- .../sources/UngroupedShortVectorColumnSource.java | 4 ---- .../immutable/ImmutableByteArraySource.java | 3 --- .../immutable/ImmutableDoubleArraySource.java | 3 --- .../immutable/ImmutableFloatArraySource.java | 3 --- .../immutable/ImmutableIntArraySource.java | 3 --- .../immutable/ImmutableLongArraySource.java | 3 --- .../immutable/ImmutableObjectArraySource.java | 3 --- .../immutable/ImmutableShortArraySource.java | 3 --- .../impl/util/freezeby/BooleanFreezeByHelper.java | 4 ---- .../impl/util/freezeby/ByteFreezeByHelper.java | 4 ---- .../impl/util/freezeby/DoubleFreezeByHelper.java | 4 ---- .../impl/util/freezeby/FloatFreezeByHelper.java | 4 ---- .../impl/util/freezeby/IntFreezeByHelper.java | 4 ---- .../impl/util/freezeby/LongFreezeByHelper.java | 4 ---- .../impl/util/freezeby/ObjectFreezeByHelper.java | 4 ---- .../impl/util/freezeby/ShortFreezeByHelper.java | 4 ---- .../impl/vector/ByteVectorColumnWrapper.java | 4 ---- .../impl/vector/DoubleVectorColumnWrapper.java | 4 ---- .../impl/vector/FloatVectorColumnWrapper.java | 4 ---- .../table/impl/vector/IntVectorColumnWrapper.java | 4 ---- .../impl/vector/LongVectorColumnWrapper.java | 4 ---- .../impl/vector/PrevByteVectorColumnWrapper.java | 4 ---- .../vector/PrevDoubleVectorColumnWrapper.java | 4 ---- .../impl/vector/PrevFloatVectorColumnWrapper.java | 4 ---- .../impl/vector/PrevIntVectorColumnWrapper.java | 4 ---- .../impl/vector/PrevLongVectorColumnWrapper.java | 4 ---- .../impl/vector/PrevShortVectorColumnWrapper.java | 4 ---- .../impl/vector/ShortVectorColumnWrapper.java | 4 ---- .../sort/timsort/BaseTestObjectTimSortKernel.java | 1 - .../regioned/TestRegionedColumnSourceByte.java | 4 ---- .../regioned/TestRegionedColumnSourceDouble.java | 4 ---- .../regioned/TestRegionedColumnSourceFloat.java | 4 ---- .../regioned/TestRegionedColumnSourceInt.java | 4 ---- .../regioned/TestRegionedColumnSourceLong.java | 4 ---- .../regioned/TestRegionedColumnSourceShort.java | 4 ---- .../sources/regioned/TstColumnRegionDouble.java | 4 ---- .../sources/regioned/TstColumnRegionFloat.java | 4 ---- .../impl/sources/regioned/TstColumnRegionInt.java | 4 ---- .../sources/regioned/TstColumnRegionLong.java | 4 ---- .../sources/regioned/TstColumnRegionShort.java | 4 ---- .../java/io/deephaven/vector/ByteSubVector.java | 4 ---- .../main/java/io/deephaven/vector/ByteVector.java | 4 ---- .../io/deephaven/vector/ByteVectorDirect.java | 4 ---- .../java/io/deephaven/vector/ByteVectorSlice.java | 4 ---- .../java/io/deephaven/vector/DoubleSubVector.java | 4 ---- .../java/io/deephaven/vector/DoubleVector.java | 4 ---- .../io/deephaven/vector/DoubleVectorDirect.java | 4 ---- .../io/deephaven/vector/DoubleVectorSlice.java | 4 ---- .../java/io/deephaven/vector/FloatSubVector.java | 4 ---- .../java/io/deephaven/vector/FloatVector.java | 4 ---- .../io/deephaven/vector/FloatVectorDirect.java | 4 ---- .../io/deephaven/vector/FloatVectorSlice.java | 4 ---- .../java/io/deephaven/vector/IntSubVector.java | 4 ---- .../main/java/io/deephaven/vector/IntVector.java | 4 ---- .../java/io/deephaven/vector/IntVectorDirect.java | 4 ---- .../java/io/deephaven/vector/IntVectorSlice.java | 4 ---- .../java/io/deephaven/vector/LongSubVector.java | 4 ---- .../main/java/io/deephaven/vector/LongVector.java | 4 ---- .../io/deephaven/vector/LongVectorDirect.java | 4 ---- .../java/io/deephaven/vector/LongVectorSlice.java | 4 ---- .../java/io/deephaven/vector/ShortSubVector.java | 4 ---- .../java/io/deephaven/vector/ShortVector.java | 4 ---- .../io/deephaven/vector/ShortVectorDirect.java | 4 ---- .../io/deephaven/vector/ShortVectorSlice.java | 4 ---- .../java/io/deephaven/vector/ByteVectorTest.java | 4 ---- .../io/deephaven/vector/DoubleVectorTest.java | 4 ---- .../java/io/deephaven/vector/FloatVectorTest.java | 4 ---- .../java/io/deephaven/vector/IntVectorTest.java | 4 ---- .../java/io/deephaven/vector/LongVectorTest.java | 4 ---- .../java/io/deephaven/vector/ShortVectorTest.java | 4 ---- .../chunk/ByteChunkInputStreamGenerator.java | 4 ---- .../chunk/DoubleChunkInputStreamGenerator.java | 4 ---- .../chunk/FloatChunkInputStreamGenerator.java | 4 ---- .../chunk/IntChunkInputStreamGenerator.java | 4 ---- .../chunk/LongChunkInputStreamGenerator.java | 4 ---- .../chunk/ShortChunkInputStreamGenerator.java | 4 ---- .../chunk/array/BooleanArrayExpansionKernel.java | 4 ---- .../chunk/array/ByteArrayExpansionKernel.java | 4 ---- .../chunk/array/DoubleArrayExpansionKernel.java | 4 ---- .../chunk/array/FloatArrayExpansionKernel.java | 4 ---- .../chunk/array/IntArrayExpansionKernel.java | 4 ---- .../chunk/array/LongArrayExpansionKernel.java | 4 ---- .../chunk/array/ShortArrayExpansionKernel.java | 4 ---- .../chunk/vector/ByteVectorExpansionKernel.java | 4 ---- .../chunk/vector/DoubleVectorExpansionKernel.java | 4 ---- .../chunk/vector/FloatVectorExpansionKernel.java | 4 ---- .../chunk/vector/IntVectorExpansionKernel.java | 4 ---- .../chunk/vector/LongVectorExpansionKernel.java | 4 ---- .../chunk/vector/ShortVectorExpansionKernel.java | 4 ---- .../replicators/ReplicateDupCompactKernel.java | 14 +++++++++++++- .../replicators/ReplicateSortKernel.java | 14 +++++++++++++- .../replicators/ReplicateSortKernelTests.java | 4 ---- .../replication/ReplicatePrimitiveCode.java | 15 ++++++++++++++- 218 files changed, 66 insertions(+), 780 deletions(-) diff --git a/engine/api/src/main/java/io/deephaven/engine/table/iterators/ByteColumnIterator.java b/engine/api/src/main/java/io/deephaven/engine/table/iterators/ByteColumnIterator.java index 6b11fc46fd5..0a541d4caff 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/iterators/ByteColumnIterator.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/iterators/ByteColumnIterator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterColumnIterator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.iterators; import io.deephaven.base.Procedure; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/iterators/DoubleColumnIterator.java b/engine/api/src/main/java/io/deephaven/engine/table/iterators/DoubleColumnIterator.java index 88d039c0fad..80ca57d71e7 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/iterators/DoubleColumnIterator.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/iterators/DoubleColumnIterator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit IntegerColumnIterator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.iterators; import io.deephaven.chunk.Chunk; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/iterators/FloatColumnIterator.java b/engine/api/src/main/java/io/deephaven/engine/table/iterators/FloatColumnIterator.java index 0c01b500562..5d29ac882bb 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/iterators/FloatColumnIterator.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/iterators/FloatColumnIterator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterColumnIterator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.iterators; import io.deephaven.base.Procedure; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/iterators/LongColumnIterator.java b/engine/api/src/main/java/io/deephaven/engine/table/iterators/LongColumnIterator.java index deafa4899c4..c624662f885 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/iterators/LongColumnIterator.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/iterators/LongColumnIterator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit IntegerColumnIterator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.iterators; import io.deephaven.chunk.Chunk; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/iterators/ShortColumnIterator.java b/engine/api/src/main/java/io/deephaven/engine/table/iterators/ShortColumnIterator.java index e2fe9d9fa20..90928257dee 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/iterators/ShortColumnIterator.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/iterators/ShortColumnIterator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterColumnIterator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.iterators; import io.deephaven.base.Procedure; diff --git a/engine/chunk/src/main/java/io/deephaven/chunk/sized/SizedObjectChunk.java b/engine/chunk/src/main/java/io/deephaven/chunk/sized/SizedObjectChunk.java index 18823342ec6..5db8c445e50 100644 --- a/engine/chunk/src/main/java/io/deephaven/chunk/sized/SizedObjectChunk.java +++ b/engine/chunk/src/main/java/io/deephaven/chunk/sized/SizedObjectChunk.java @@ -1,3 +1,6 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ /* * --------------------------------------------------------------------------------------------------------------------- * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit SizedCharChunk and regenerate diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAddOnlyMinMaxOperator.java index 5c763cf7e63..d6c8f302090 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAvgOperator.java index 9b20a799e67..45c9066c57b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedSumOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedSumOperator.java index 9a26bf47d02..e7387de7f0c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedSumOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedSumOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedSumOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedVarOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedVarOperator.java index 4f9e4d6abac..3050ab2f3be 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedVarOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteChunkedVarOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedVarOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAddOnlyMinMaxOperator.java index 600f4f30796..ce3f6d6da15 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAvgOperator.java index c712b2bc640..9f21e5dc347 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit FloatChunkedAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedReAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedReAvgOperator.java index 681375b0e81..4e0354a47c9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedReAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedReAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit FloatChunkedReAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedSumOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedSumOperator.java index 3980e8e4721..8291684a9fa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedSumOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedSumOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit FloatChunkedSumOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedVarOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedVarOperator.java index ebd67114bde..711ba70ab0a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedVarOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleChunkedVarOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit FloatChunkedVarOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatChunkedAddOnlyMinMaxOperator.java index 3ac0fa0d87d..5b760db6179 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAddOnlyMinMaxOperator.java index 2406dbfb487..805df19cfb8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAvgOperator.java index b238181200e..dd423902863 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedSumOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedSumOperator.java index c6506fe0cc6..736d13c0d0e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedSumOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedSumOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedSumOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedVarOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedVarOperator.java index 174f62123c5..8ec0d086ea7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedVarOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntChunkedVarOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedVarOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAddOnlyMinMaxOperator.java index 1f951d7c755..894191b1931 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.time.DateTime; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAvgOperator.java index afc3e75fe27..4d81f6949c0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedSumOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedSumOperator.java index 946fd50c6b2..51eae4ef4fe 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedSumOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedSumOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedSumOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedVarOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedVarOperator.java index 056b59a0861..436b0409581 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedVarOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongChunkedVarOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedVarOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectChunkedAddOnlyMinMaxOperator.java index cdd71ab7353..e3ee02107b8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAddOnlyMinMaxOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAddOnlyMinMaxOperator.java index 2316343cc1d..0bfd8a06dec 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAddOnlyMinMaxOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAddOnlyMinMaxOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAddOnlyMinMaxOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAvgOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAvgOperator.java index 18bd20eae4f..c45f5e8e9e7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAvgOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedAvgOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedAvgOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedSumOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedSumOperator.java index a5ec547148c..9ddf7704e79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedSumOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedSumOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedSumOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedVarOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedVarOperator.java index 71dd9e9783c..d1ede63b39e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedVarOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortChunkedVarOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedVarOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteChunkedCountDistinctOperator.java index 6d806590033..5ccfced74b2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteRollupCountDistinctOperator.java index 7a21acd1fc6..1e82d51feb6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ByteRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleChunkedCountDistinctOperator.java index 2dca08f9d14..d8f40746860 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleRollupCountDistinctOperator.java index 79d338e4203..9f9e4b808bb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/DoubleRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatChunkedCountDistinctOperator.java index 6ef1642f351..cfe8889a39c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatRollupCountDistinctOperator.java index 711642367d7..029a0dfd8d9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/FloatRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntChunkedCountDistinctOperator.java index 86f07fc8a02..57a30a63ddd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntRollupCountDistinctOperator.java index 3d8c316de5a..5d9061a7e56 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/IntRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongChunkedCountDistinctOperator.java index f848d497a69..f4afe9c634d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongRollupCountDistinctOperator.java index 10edc22fe70..348dfad2845 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/LongRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectChunkedCountDistinctOperator.java index 4db2068b59b..f6f0732e80e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectRollupCountDistinctOperator.java index cd38e2f4eb2..e7e1b9e6a1f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ObjectRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortChunkedCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortChunkedCountDistinctOperator.java index 75ae81f476a..39e66d4af62 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortChunkedCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortChunkedCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortRollupCountDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortRollupCountDistinctOperator.java index 11a5e241365..9090f80ff5b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortRollupCountDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/count/ShortRollupCountDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupCountDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.count; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteChunkedDistinctOperator.java index 26332257795..e3ec5abcd29 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteRollupDistinctOperator.java index 9e0c7ccd73d..c388be5f9aa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ByteRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleChunkedDistinctOperator.java index 7c59a6363cd..6fdbb64119e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleRollupDistinctOperator.java index c18d9ca9a8c..845e5e5627d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/DoubleRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatChunkedDistinctOperator.java index 85f4a1996c8..795c5011cf3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatRollupDistinctOperator.java index 6fc997551fd..237ba7ccc1e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/FloatRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntChunkedDistinctOperator.java index a834d36765b..401b344b2dc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntRollupDistinctOperator.java index b49e7a8944f..629cf48262e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/IntRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java index 2eb89d0c167..2b52e084a1a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.table.impl.sources.BoxedColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java index a6b6c489587..fcd9012cd0e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.table.impl.sources.BoxedColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectChunkedDistinctOperator.java index e41f9f8a0b5..0aa41659cf1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectRollupDistinctOperator.java index 03171ead4aa..f9c8087032c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ObjectRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortChunkedDistinctOperator.java index 421e5210a95..8e10c890a9c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortChunkedDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortRollupDistinctOperator.java index a09ea0ed39f..f678f0612a7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/ShortRollupDistinctOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupDistinctOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteChunkedUniqueOperator.java index a73e8e212a6..5bccb39fd56 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteRollupUniqueOperator.java index e4e7ef60a03..e7f58753af3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ByteRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleChunkedUniqueOperator.java index 6657b4137d6..d913d1c74d8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleRollupUniqueOperator.java index 052928d03a9..de0afe47888 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/DoubleRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatChunkedUniqueOperator.java index 934e7ce7c07..956d8edc574 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatRollupUniqueOperator.java index 35b727e091b..54ca90be7e4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/FloatRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntChunkedUniqueOperator.java index 315aa1c82aa..6436bfd8b8e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntRollupUniqueOperator.java index e2f395c8ae8..f91f3059527 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/IntRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java index de3bbc5ac54..2c73b45fd6b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.table.impl.sources.BoxedColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java index 102942a85d4..a8ad50b5a79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.table.impl.sources.BoxedColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectChunkedUniqueOperator.java index 7bd97625717..f26316b37ab 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectRollupUniqueOperator.java index 2a84434184f..b642795d38d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ObjectRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortChunkedUniqueOperator.java index d60a75ba896..67a3fa32963 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortChunkedUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkedUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortRollupUniqueOperator.java index c8146a32b81..7fc507843e5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/ShortRollupUniqueOperator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharRollupUniqueOperator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.by.ssmcountdistinct.unique; import io.deephaven.engine.rowset.WritableRowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ByteLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ByteLongMegaMergeDescendingKernel.java index cf7d4ec199d..4ad04923f62 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ByteLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ByteLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/DoubleLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/DoubleLongMegaMergeDescendingKernel.java index ded26994a2a..db14a207e96 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/DoubleLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/DoubleLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/FloatLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/FloatLongMegaMergeDescendingKernel.java index e6fbd124a83..67fdaf18917 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/FloatLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/FloatLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/IntLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/IntLongMegaMergeDescendingKernel.java index a6e253aedfd..7d43d4316f0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/IntLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/IntLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/LongLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/LongLongMegaMergeDescendingKernel.java index a0a2ea921d7..ec33be5c0b0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/LongLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/LongLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ObjectLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ObjectLongMegaMergeDescendingKernel.java index bf531077a69..8457db2a8e0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ObjectLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ObjectLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ShortLongMegaMergeDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ShortLongMegaMergeDescendingKernel.java index 7c6e64bd814..ba7aa91cf3e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ShortLongMegaMergeDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/megamerge/ShortLongMegaMergeDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongMegaMergeDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.megamerge; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteIntTimsortDescendingKernel.java index a64109af500..7a5dc98dc17 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteLongTimsortDescendingKernel.java index 530ded75a0a..192019c0e87 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ByteLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleIntTimsortDescendingKernel.java index 8261c5d84bf..7bbcf2fa384 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleLongTimsortDescendingKernel.java index ab1569a3e1f..2aabc025ad7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/DoubleLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatIntTimsortDescendingKernel.java index 109a76e419d..62f9c498611 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatLongTimsortDescendingKernel.java index 642a8437bf7..dd8fffcaff5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/FloatLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntIntTimsortDescendingKernel.java index 28e19870008..93b467cb773 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntLongTimsortDescendingKernel.java index d1b9fc470c3..e5c341b0287 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/IntLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongIntTimsortDescendingKernel.java index c307a359d68..f32342022b9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongLongTimsortDescendingKernel.java index 26815014c17..1e224675bbc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/LongLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharIntTimsortDescendingKernel.java index ea1a9e4df0c..09067ed1b02 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharIntTimsortDescendingKernel.java @@ -2,7 +2,7 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * ------------------------------------------------------------------------------------------------------------------ */ /* * --------------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharLongTimsortDescendingKernel.java index fa4930bc112..fbc3dff5563 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/NullAwareCharLongTimsortDescendingKernel.java @@ -2,7 +2,7 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * ------------------------------------------------------------------------------------------------------------------ */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectIntTimsortDescendingKernel.java index cfa9181cd00..5ce875c6ebd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectLongTimsortDescendingKernel.java index 871ce4c45e5..e1ebed79539 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ObjectLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortIntTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortIntTimsortDescendingKernel.java index c98ddb4c231..bee2e6b95cd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortIntTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortIntTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharIntTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ /* diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortLongTimsortDescendingKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortLongTimsortDescendingKernel.java index 817ec426b73..f99a806b04c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortLongTimsortDescendingKernel.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/timsort/ShortLongTimsortDescendingKernel.java @@ -3,7 +3,7 @@ */ /* * --------------------------------------------------------------------------------------------------------------------- - * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortKernel and regenerate + * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharLongTimsortDescendingKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ package io.deephaven.engine.table.impl.sort.timsort; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java index 2c22e5b53f9..b4494a0964f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java index ba71d2d91f3..3efb3e332c0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.AbstractColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteArraySource.java index d30a79f3030..a0919b438ac 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.base.verify.Assert; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSingleValueSource.java index 259167abfca..83374cb1349 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java index e740b6b7c2c..ab1b2f27db6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleArraySource.java index c1c3c9a0943..46d4f2e1234 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.base.verify.Assert; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSingleValueSource.java index 2991782a383..787aab245c6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java index 7b488d17a91..3a011f64fe6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatArraySource.java index 6bd742e7aa9..b1ab617a253 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.base.verify.Assert; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSingleValueSource.java index 9d9dabb03d0..52fba221c39 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java index 80237485e63..76ef2d9240b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerArraySource.java index b7b75d0fbbe..b62bb540e66 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.base.verify.Assert; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSingleValueSource.java index 60174ec1a80..7b12fec06d7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java index 3b7704484d6..a56cd3b21f4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongSingleValueSource.java index 5c0d96f08a0..9f27bbe45d5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSingleValueSource.java index 3382fbde341..a5f655e338d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java index 7383fda3b1b..3678f6296a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortArraySource.java index 010fddd76bf..2af5d2cd3f6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.base.verify.Assert; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSingleValueSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSingleValueSource.java index c5a9f8c2ef3..ec5b5c6066a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSingleValueSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSingleValueSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSingleValueSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java index 04ebe2f9fb6..f1a58a9115c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharacterSparseArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.impl.DefaultGetContext; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java index 886e98e94c6..dc167c1ba8b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java index cfb1a99a617..e7161002a11 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java index 348a718e06a..c7d9aedc0d8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java index fdc1d5a8f98..03b8e52aadd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java index 1b11e8dd7a8..b5ce1ef674f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java index beaf667dbf0..e114c1293a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java index 8b301c72138..a2d8fb133fc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java index dd1302268df..712beafa8a3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java index 6f3f12ce731..089c5f62c71 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java index 73780b3a835..de7bf315ff9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java index b0ceb91c9ae..275589ad2a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharArrayColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java index ca7e1ec54bd..d4469523b85 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit UngroupedCharVectorColumnSource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java index 4b85cceb8cb..6959889eb73 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java index 186fa87361f..f212e2ceda7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java index 1b386c5ba0d..310a01e8278 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java index 1ca564701ff..1e814f2381e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java index cb4ae14e5ef..e9e66f9c666 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java index 122821465d9..bcd017942bf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java index 34d97415382..4eb1f78c8a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java @@ -6,9 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit ImmutableCharArraySource and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ package io.deephaven.engine.table.impl.sources.immutable; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/BooleanFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/BooleanFreezeByHelper.java index dd8a430e148..8420f569bd9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/BooleanFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/BooleanFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ByteFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ByteFreezeByHelper.java index b4310eed321..6301bcced08 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ByteFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ByteFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/DoubleFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/DoubleFreezeByHelper.java index 81d210f2745..0d43baf64fa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/DoubleFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/DoubleFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/FloatFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/FloatFreezeByHelper.java index 8a2684e78ae..4ece8d45054 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/FloatFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/FloatFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/IntFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/IntFreezeByHelper.java index 76243212edf..3aad16995fc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/IntFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/IntFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/LongFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/LongFreezeByHelper.java index 9ef850ffd59..a4bdbd7fba2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/LongFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/LongFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ObjectFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ObjectFreezeByHelper.java index 7801abec339..736690373c3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ObjectFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ObjectFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ShortFreezeByHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ShortFreezeByHelper.java index 50c861f218a..bb3e9b8df51 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ShortFreezeByHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/freezeby/ShortFreezeByHelper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharFreezeByHelper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2020 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.util.freezeby; import io.deephaven.chunk.attributes.ChunkLengths; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ByteVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ByteVectorColumnWrapper.java index 33021332666..a2fb08c158a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ByteVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ByteVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/DoubleVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/DoubleVectorColumnWrapper.java index 03d950300ec..2cd569d926a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/DoubleVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/DoubleVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/FloatVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/FloatVectorColumnWrapper.java index ce80f1cfb87..24deaa08700 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/FloatVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/FloatVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/IntVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/IntVectorColumnWrapper.java index 1ac1bfe8d6d..236bca18a40 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/IntVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/IntVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/LongVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/LongVectorColumnWrapper.java index 444502d7ce6..b2d5cc1aa06 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/LongVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/LongVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevByteVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevByteVectorColumnWrapper.java index 08c3057f9e2..a2adeccbbbd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevByteVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevByteVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevDoubleVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevDoubleVectorColumnWrapper.java index 3d8cdc781f1..a85b84520e2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevDoubleVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevDoubleVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevFloatVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevFloatVectorColumnWrapper.java index 5446c3577b9..a0c1206950b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevFloatVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevFloatVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevIntVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevIntVectorColumnWrapper.java index 90f49ab70d7..e2edf2cd236 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevIntVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevIntVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevLongVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevLongVectorColumnWrapper.java index cc0634be5b6..fb2f7f0a7a1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevLongVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevLongVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevShortVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevShortVectorColumnWrapper.java index b310b85665d..ef0fab63349 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevShortVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/PrevShortVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit PrevCharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ShortVectorColumnWrapper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ShortVectorColumnWrapper.java index 39950b68a80..0de7426adc0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ShortVectorColumnWrapper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/vector/ShortVectorColumnWrapper.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorColumnWrapper and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.vector; import io.deephaven.base.ClampUtil; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java index 440d3fe297d..7c00ac0d4cc 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java @@ -2,7 +2,6 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* -import java.util.Objects; * --------------------------------------------------------------------------------------------------------------------- * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit BaseTestCharTimSortKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceByte.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceByte.java index 605f85f1569..0d9de1b654f 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceByte.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceByte.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceDouble.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceDouble.java index dd4653d28ea..bb38bfef16e 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceDouble.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceDouble.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceFloat.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceFloat.java index 4c339f16fbd..297503dd3e3 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceFloat.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceFloat.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceInt.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceInt.java index 10dea594c7a..a888d5bdd38 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceInt.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceInt.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceLong.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceLong.java index d9d9e9f58a4..48bd9b41120 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceLong.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceLong.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceShort.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceShort.java index 1a552539040..a1ed4c7a62c 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceShort.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestRegionedColumnSourceShort.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TestRegionedColumnSourceChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionDouble.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionDouble.java index 9686952cf4b..b83629abd41 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionDouble.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionDouble.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TstColumnRegionChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionFloat.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionFloat.java index 5fd86be8204..1fe093de213 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionFloat.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionFloat.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TstColumnRegionChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionInt.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionInt.java index 01956d9aada..e3fb1ada1f1 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionInt.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionInt.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TstColumnRegionChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionLong.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionLong.java index 33e5e0ca439..2521a136d04 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionLong.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionLong.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TstColumnRegionChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionShort.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionShort.java index 2f3a374c02e..3062081ee10 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionShort.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TstColumnRegionShort.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit TstColumnRegionChar and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.engine.table.impl.sources.regioned; import io.deephaven.chunk.attributes.Values; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ByteSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/ByteSubVector.java index ad027cbd312..3f34264e368 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ByteSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ByteSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ByteVector.java b/engine/vector/src/main/java/io/deephaven/vector/ByteVector.java index 0d63db22143..383900d4b70 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ByteVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ByteVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.ByteType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ByteVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/ByteVectorDirect.java index 49caba8cbf2..b1c21aaddff 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ByteVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ByteVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ByteVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/ByteVectorSlice.java index 1036dfc8928..f1fcc7b707d 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ByteVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ByteVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/main/java/io/deephaven/vector/DoubleSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/DoubleSubVector.java index 43574bf22ef..2ff7bc6140c 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/DoubleSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/DoubleSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/DoubleVector.java b/engine/vector/src/main/java/io/deephaven/vector/DoubleVector.java index 0218e286659..67bd2c11172 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/DoubleVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/DoubleVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.DoubleType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorDirect.java index a77d3c3619c..e52abc179a7 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorSlice.java index 0a36562957b..5fd5ab7bfc5 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/DoubleVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/main/java/io/deephaven/vector/FloatSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/FloatSubVector.java index f35d64fcfbf..dc7fca36592 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/FloatSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/FloatSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/FloatVector.java b/engine/vector/src/main/java/io/deephaven/vector/FloatVector.java index 7dc295bb07a..4cdea870d37 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/FloatVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/FloatVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.FloatType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/FloatVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/FloatVectorDirect.java index 76e85435e76..f64d144f767 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/FloatVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/FloatVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/FloatVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/FloatVectorSlice.java index 5e482e59240..ac299654deb 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/FloatVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/FloatVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/main/java/io/deephaven/vector/IntSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/IntSubVector.java index b7bfb9591bd..3b4909e923f 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/IntSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/IntSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/IntVector.java b/engine/vector/src/main/java/io/deephaven/vector/IntVector.java index ff4d59f5ba5..4e281bfd4bd 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/IntVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/IntVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.IntType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/IntVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/IntVectorDirect.java index 37c8f06980e..345909aa7a7 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/IntVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/IntVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/IntVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/IntVectorSlice.java index 06d26e18a9d..4a15dd32779 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/IntVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/IntVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/main/java/io/deephaven/vector/LongSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/LongSubVector.java index 3374efcfbf9..4a1c6cb67bc 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/LongSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/LongSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/LongVector.java b/engine/vector/src/main/java/io/deephaven/vector/LongVector.java index 5a3ed79e5c2..31cf20d54f0 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/LongVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/LongVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.LongType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/LongVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/LongVectorDirect.java index ccaf12106a9..66470a67362 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/LongVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/LongVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/LongVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/LongVectorSlice.java index e2c5a9f83fa..914c6d502b1 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/LongVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/LongVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ShortSubVector.java b/engine/vector/src/main/java/io/deephaven/vector/ShortSubVector.java index 4e49bc97cf3..3b37dfce7d5 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ShortSubVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ShortSubVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharSubVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ShortVector.java b/engine/vector/src/main/java/io/deephaven/vector/ShortVector.java index c739fcd21c0..13a4dc4c75e 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ShortVector.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ShortVector.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVector and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.qst.type.ShortType; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ShortVectorDirect.java b/engine/vector/src/main/java/io/deephaven/vector/ShortVectorDirect.java index ee2048f3c41..d2d38d971d4 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ShortVectorDirect.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ShortVectorDirect.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorDirect and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.util.datastructures.LongSizedDataStructure; diff --git a/engine/vector/src/main/java/io/deephaven/vector/ShortVectorSlice.java b/engine/vector/src/main/java/io/deephaven/vector/ShortVectorSlice.java index 0d61e40786c..d33eba4e9d1 100644 --- a/engine/vector/src/main/java/io/deephaven/vector/ShortVectorSlice.java +++ b/engine/vector/src/main/java/io/deephaven/vector/ShortVectorSlice.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorSlice and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import io.deephaven.base.verify.Assert; diff --git a/engine/vector/src/test/java/io/deephaven/vector/ByteVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/ByteVectorTest.java index 76d1eb069fc..9feeac3f972 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/ByteVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/ByteVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/engine/vector/src/test/java/io/deephaven/vector/DoubleVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/DoubleVectorTest.java index 03bca6162b7..7e1457000b5 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/DoubleVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/DoubleVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/engine/vector/src/test/java/io/deephaven/vector/FloatVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/FloatVectorTest.java index d53b34e8eb5..092ed020fba 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/FloatVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/FloatVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/engine/vector/src/test/java/io/deephaven/vector/IntVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/IntVectorTest.java index 28cb7fbfc69..dad649213c1 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/IntVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/IntVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/engine/vector/src/test/java/io/deephaven/vector/LongVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/LongVectorTest.java index 1735583b6dd..94df3fa5f00 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/LongVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/LongVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/engine/vector/src/test/java/io/deephaven/vector/ShortVectorTest.java b/engine/vector/src/test/java/io/deephaven/vector/ShortVectorTest.java index 3a7b0533ef7..0550a1c8c6a 100644 --- a/engine/vector/src/test/java/io/deephaven/vector/ShortVectorTest.java +++ b/engine/vector/src/test/java/io/deephaven/vector/ShortVectorTest.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorTest and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.vector; import junit.framework.TestCase; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java index 74b7e2a180b..4e441e3a169 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java index 049181f91bc..0885cbcf12a 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java index f9f2973b616..9da01bb472f 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java index 402c5f2c0ef..fc667cdd5a1 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java index 356b84b6ea8..599d30ad425 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java index b523bed83bc..6e2e315648a 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharChunkInputStreamGenerator and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk; import gnu.trove.iterator.TLongIterator; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/BooleanArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/BooleanArrayExpansionKernel.java index 5c8ca4eff22..a69f083fc46 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/BooleanArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/BooleanArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.BooleanChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ByteArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ByteArrayExpansionKernel.java index a96ecfcb6f5..ab897124aa9 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ByteArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ByteArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.ByteChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/DoubleArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/DoubleArrayExpansionKernel.java index 6f33bb2acae..84c2cbc56ff 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/DoubleArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/DoubleArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.DoubleChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/FloatArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/FloatArrayExpansionKernel.java index 415cfc2394a..451124efa5b 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/FloatArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/FloatArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.FloatChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/IntArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/IntArrayExpansionKernel.java index 620159fd5a2..4942ccb24fa 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/IntArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/IntArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.IntChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/LongArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/LongArrayExpansionKernel.java index 319ea2c74ee..3ba213b667c 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/LongArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/LongArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.LongChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ShortArrayExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ShortArrayExpansionKernel.java index c6d8b75ef20..1f877ffe374 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ShortArrayExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ShortArrayExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharArrayExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.array; import io.deephaven.chunk.ShortChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ByteVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ByteVectorExpansionKernel.java index e87c8942c62..655a0d87f00 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ByteVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ByteVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.ByteChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/DoubleVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/DoubleVectorExpansionKernel.java index 22a0560b593..d794028165f 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/DoubleVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/DoubleVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.DoubleChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/FloatVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/FloatVectorExpansionKernel.java index daac99ff9d2..26f9cd66ac7 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/FloatVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/FloatVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.FloatChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/IntVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/IntVectorExpansionKernel.java index abcff4a5185..24fe70cacc7 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/IntVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/IntVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.IntChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/LongVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/LongVectorExpansionKernel.java index 37a3b5a8721..dbb36ec0e03 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/LongVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/LongVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.LongChunk; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ShortVectorExpansionKernel.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ShortVectorExpansionKernel.java index 2c36f7c46a1..d1031b51166 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ShortVectorExpansionKernel.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ShortVectorExpansionKernel.java @@ -6,10 +6,6 @@ * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharVectorExpansionKernel and regenerate * --------------------------------------------------------------------------------------------------------------------- */ -/* - * Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending - */ - package io.deephaven.extensions.barrage.chunk.vector; import io.deephaven.chunk.ShortChunk; diff --git a/replication/static/src/main/java/io/deephaven/replicators/ReplicateDupCompactKernel.java b/replication/static/src/main/java/io/deephaven/replicators/ReplicateDupCompactKernel.java index e3f8cad7b74..40f1abeb981 100644 --- a/replication/static/src/main/java/io/deephaven/replicators/ReplicateDupCompactKernel.java +++ b/replication/static/src/main/java/io/deephaven/replicators/ReplicateDupCompactKernel.java @@ -75,7 +75,19 @@ private static String fixupCharNullComparisons(String path, String newPath, Stri lines = ReplicateSortKernel.invertComparisons(lines); } - lines.addAll(0, Arrays.asList( + // preserve the first comment of the file; typically the copyright + int insertionPoint = 0; + if (lines.size() > 0 && lines.get(0).startsWith("/*")) { + for (int ii = 0; ii < lines.size(); ++ii) { + final int offset = lines.get(ii).indexOf("*/"); + if (offset != -1) { + insertionPoint = ii + 1; + break; + } + } + } + + lines.addAll(insertionPoint, Arrays.asList( "/* ---------------------------------------------------------------------------------------------------------------------", " * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit " + oldName + " and regenerate", diff --git a/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernel.java b/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernel.java index 36898adca32..3e27f4dacfa 100644 --- a/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernel.java +++ b/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernel.java @@ -322,7 +322,19 @@ private static void fixupCharNullComparisons(String sourceClassJavaPath, String lines = globalReplacements(fixupCharNullComparisons(lines, ascending), oldName, newName); - lines.addAll(0, Arrays.asList( + // preserve the first comment of the file; typically the copyright + int insertionPoint = 0; + if (lines.size() > 0 && lines.get(0).startsWith("/*")) { + for (int ii = 0; ii < lines.size(); ++ii) { + final int offset = lines.get(ii).indexOf("*/"); + if (offset != -1) { + insertionPoint = ii + 1; + break; + } + } + } + + lines.addAll(insertionPoint, Arrays.asList( "/* ---------------------------------------------------------------------------------------------------------------------", " * AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit " + oldName + " and regenerate", diff --git a/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernelTests.java b/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernelTests.java index 39413e6dfe5..ff216c794f5 100644 --- a/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernelTests.java +++ b/replication/static/src/main/java/io/deephaven/replicators/ReplicateSortKernelTests.java @@ -53,10 +53,6 @@ private static void fixupObject(String objectPath) throws IOException { final File objectFile = new File(objectPath); List lines = FileUtils.readLines(objectFile, Charset.defaultCharset()); - final int packageIndex = lines.indexOf("package io.deephaven.engine.table.impl.sort;"); - - lines.add(packageIndex + 2, "import java.util.Objects;"); - lines = lines.stream().map(x -> x.replaceAll("ObjectChunk", "ObjectChunk")) .collect(Collectors.toList()); diff --git a/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java b/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java index 15943c2cbd0..d91af7c107c 100644 --- a/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java +++ b/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java @@ -454,6 +454,18 @@ public static String replaceAll(String sourceClassJavaPath, Map se System.out.println("Generating java file " + resultClassJavaPath); PrintWriter out = new PrintWriter(resultClassJavaPath); + + String body = replaceAllInternal(inputText.toString(), serialVersionUID, exemptions, pairs); + + // preserve the first comment of the file; typically the copyright + if (body.startsWith("/*")) { + final int idx = body.indexOf("*/"); + if (idx != -1 && body.length() >= idx + 3) { + out.print(body.substring(0, idx + 3)); + body = body.substring(idx + 3); + } + } + out.println("/*"); out.println( " * ---------------------------------------------------------------------------------------------------------------------"); @@ -463,7 +475,8 @@ public static String replaceAll(String sourceClassJavaPath, Map se " * ---------------------------------------------------------------------------------------------------------------------"); out.println( " */"); - out.print(replaceAllInternal(inputText.toString(), serialVersionUID, exemptions, pairs)); + + out.print(body); out.flush(); out.close(); From 2d2bb2c619640a3362ae190cb6aa2d143d171c5d Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Fri, 22 Jul 2022 10:48:39 -0600 Subject: [PATCH 020/215] Add wavgBy, wsumBy, absSumBy in both Table and PartitionedTableProxy (#2663) * Add wavgBy, wsumBy, absSumBy --- py/server/deephaven/table.py | 136 +++++++++++++++++++++++++++++++ py/server/tests/test_pt_proxy.py | 12 +++ py/server/tests/test_table.py | 13 +++ 3 files changed, 161 insertions(+) diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 8a40d101b48..2240d18e5ca 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -1013,6 +1013,49 @@ def sum_by(self, by: Union[str, Sequence[str]] = None) -> Table: except Exception as e: raise DHError(e, "table sum_by operation failed.") from e + def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> Table: + """The abs_sum_by method creates a new table containing the absolute sum for each group. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new table + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return Table(j_table=self.j_table.absSumBy(*by)) + else: + return Table(j_table=self.j_table.absSumBy()) + except Exception as e: + raise DHError(e, "table asb_sum_by operation failed.") from e + + def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Table: + """The weighted_sum_by method creates a new table containing the weighted sum for each group. + + Args: + wcol (str): the name of the weight column + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new table + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return Table(j_table=self.j_table.wsumBy(wcol, *by)) + else: + return Table(j_table=self.j_table.wsumBy(wcol)) + except Exception as e: + raise DHError(e, "table weighted_sum_by operation failed.") from e + def avg_by(self, by: Union[str, Sequence[str]] = None) -> Table: """The avg_by method creates a new table containing the average for each group. @@ -1034,6 +1077,28 @@ def avg_by(self, by: Union[str, Sequence[str]] = None) -> Table: except Exception as e: raise DHError(e, "table avg_by operation failed.") from e + def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Table: + """The weighted_avg_by method creates a new table containing the weighted average for each group. + + Args: + wcol (str): the name of the weight column + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new table + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return Table(j_table=self.j_table.wavgBy(wcol, *by)) + else: + return Table(j_table=self.j_table.wavgBy(wcol)) + except Exception as e: + raise DHError(e, "table avg_by operation failed.") from e + def std_by(self, by: Union[str, Sequence[str]] = None) -> Table: """The std_by method creates a new table containing the standard deviation for each group. @@ -2426,6 +2491,53 @@ def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.abs_sum_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy()) + except Exception as e: + raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + + def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.weighted_sum_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + wcol (str): the name of the weight column + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol)) + except Exception as e: + raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.avg_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2449,6 +2561,30 @@ def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e + def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.weighted_avg_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + wcol (str): the name of the weight column + by (Union[str, Sequence[str]], optional): the group-by column name(s), default is None + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + by = to_sequence(by) + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wavgBy(wcol, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(wcol)) + except Exception as e: + raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e + def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.median_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its diff --git a/py/server/tests/test_pt_proxy.py b/py/server/tests/test_pt_proxy.py index 780af57de98..6629a714440 100644 --- a/py/server/tests/test_pt_proxy.py +++ b/py/server/tests/test_pt_proxy.py @@ -254,6 +254,7 @@ def test_dedicated_agg(self): PartitionedTableProxy.first_by, PartitionedTableProxy.last_by, PartitionedTableProxy.sum_by, + PartitionedTableProxy.abs_sum_by, PartitionedTableProxy.avg_by, PartitionedTableProxy.std_by, PartitionedTableProxy.var_by, @@ -269,6 +270,17 @@ def test_dedicated_agg(self): self.assertLessEqual(gct.size, ct.size) self.assertEqual(len(gct.columns), len(ct.columns)) + wops = [PartitionedTableProxy.weighted_avg_by, + PartitionedTableProxy.weighted_sum_by, + ] + + for wop in wops: + with self.subTest(wop): + agg_pt_proxy = wop(self.pt_proxy, wcol="e", by=["a", "b"]) + for gct, ct in zip(agg_pt_proxy.target.constituent_tables, self.pt_proxy.target.constituent_tables): + self.assertLessEqual(gct.size, ct.size) + self.assertEqual(len(gct.columns), len(ct.columns) - 1) + def test_agg_by(self): aggs = [ sum_(cols=["SumC=c"]), diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index e0577744de4..6248b402274 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -336,6 +336,7 @@ def test_dedicated_agg(self): Table.first_by, Table.last_by, Table.sum_by, + Table.abs_sum_by, Table.avg_by, Table.std_by, Table.var_by, @@ -360,6 +361,18 @@ def test_dedicated_agg(self): result_table = op(self.test_table, by=[]) self.assertEqual(result_table.size, 1) + wops = [Table.weighted_avg_by, + Table.weighted_sum_by, + ] + + for wop in wops: + with self.subTest(wop): + result_table = wop(self.test_table, wcol='e', by=["a", "b"]) + self.assertEqual(len(result_table.columns), len(self.test_table.columns) - 1) + + result_table = wop(self.test_table, wcol='e') + self.assertEqual(len(result_table.columns), len(self.test_table.columns) - 1) + def test_count_by(self): num_distinct_a = self.test_table.select_distinct(formulas=["a"]).size result_table = self.test_table.count_by(col="b", by=["a"]) From d7f929de22cb647a427a01d62e473c8afb7aae9f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 22 Jul 2022 12:45:52 -0500 Subject: [PATCH 021/215] Don't expect nested protobuf objects to be null (#2665) Fixes #2655 --- .../server/table/ops/filter/FilterVisitor.java | 6 ++++-- .../table/ops/filter/NormalizeFilterUtil.java | 7 +++++++ .../table/ops/filter/FilterPrinterTest.java | 16 ++++++++++++++++ .../server/table/ops/filter/FilterTestUtils.java | 3 +++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/io/deephaven/server/table/ops/filter/FilterVisitor.java b/server/src/main/java/io/deephaven/server/table/ops/filter/FilterVisitor.java index cbba3195039..33bc5999ce3 100644 --- a/server/src/main/java/io/deephaven/server/table/ops/filter/FilterVisitor.java +++ b/server/src/main/java/io/deephaven/server/table/ops/filter/FilterVisitor.java @@ -9,6 +9,7 @@ import io.deephaven.proto.backplane.grpc.MatchType; import io.deephaven.proto.backplane.grpc.Reference; import io.deephaven.proto.backplane.grpc.Value; +import org.jetbrains.annotations.Nullable; import java.util.List; @@ -25,7 +26,7 @@ public interface FilterVisitor { R onIsNull(Reference reference); - R onInvoke(String method, Value target, List argumentsList); + R onInvoke(String method, @Nullable Value target, List argumentsList); R onContains(Reference reference, String searchString, CaseSensitivity caseSensitivity, MatchType matchType); @@ -49,7 +50,8 @@ static R accept(Condition condition, FilterVisitor visitor) { return visitor.onIn(condition.getIn().getTarget(), condition.getIn().getCandidatesList(), condition.getIn().getCaseSensitivity(), condition.getIn().getMatchType()); case INVOKE: - return visitor.onInvoke(condition.getInvoke().getMethod(), condition.getInvoke().getTarget(), + return visitor.onInvoke(condition.getInvoke().getMethod(), + condition.getInvoke().hasTarget() ? condition.getInvoke().getTarget() : null, condition.getInvoke().getArgumentsList()); case IS_NULL: return visitor.onIsNull(condition.getIsNull().getReference()); diff --git a/server/src/main/java/io/deephaven/server/table/ops/filter/NormalizeFilterUtil.java b/server/src/main/java/io/deephaven/server/table/ops/filter/NormalizeFilterUtil.java index 445a934cd17..68ddd1bc776 100644 --- a/server/src/main/java/io/deephaven/server/table/ops/filter/NormalizeFilterUtil.java +++ b/server/src/main/java/io/deephaven/server/table/ops/filter/NormalizeFilterUtil.java @@ -101,6 +101,13 @@ public static Condition doInvoke(String method, Value target, List argume .build()).build(); } + public static Condition doInvoke(String method, List argumentsList) { + return Condition.newBuilder().setInvoke(InvokeCondition.newBuilder() + .setMethod(method) + .addAllArguments(argumentsList) + .build()).build(); + } + public static Condition doContains(Reference reference, String searchString, CaseSensitivity caseSensitivity, MatchType matchType) { return Condition.newBuilder().setContains(ContainsCondition.newBuilder() diff --git a/server/src/test/java/io/deephaven/server/table/ops/filter/FilterPrinterTest.java b/server/src/test/java/io/deephaven/server/table/ops/filter/FilterPrinterTest.java index 39f58b3c26a..efa82dc4070 100644 --- a/server/src/test/java/io/deephaven/server/table/ops/filter/FilterPrinterTest.java +++ b/server/src/test/java/io/deephaven/server/table/ops/filter/FilterPrinterTest.java @@ -3,9 +3,12 @@ */ package io.deephaven.server.table.ops.filter; +import io.deephaven.proto.backplane.grpc.Condition; import io.deephaven.proto.backplane.grpc.Literal; import org.junit.Test; +import static io.deephaven.server.table.ops.filter.FilterPrinter.print; +import static io.deephaven.server.table.ops.filter.FilterTestUtils.reference; import static org.junit.Assert.*; public class FilterPrinterTest { @@ -99,4 +102,17 @@ private static void rotateAndAssert(long longBits) { private static Literal lit(double doubleValue) { return Literal.newBuilder().setDoubleValue(doubleValue).build(); } + + @Test + public void testInvoke() { + Condition hello = FilterTestUtils.invoke("hello", null); + assertEquals("hello()", print(hello)); + hello = FilterTestUtils.invoke("hello", reference("foo")); + assertEquals("foo.hello()", print(hello)); + + Condition helloWorld = FilterTestUtils.invoke("helloWorld", null, reference("someColumn")); + assertEquals("helloWorld(someColumn)", print(helloWorld)); + helloWorld = FilterTestUtils.invoke("helloWorld", reference("foo"), reference("someColumn")); + assertEquals("foo.helloWorld(someColumn)", print(helloWorld)); + } } diff --git a/server/src/test/java/io/deephaven/server/table/ops/filter/FilterTestUtils.java b/server/src/test/java/io/deephaven/server/table/ops/filter/FilterTestUtils.java index 9d2a9fd84eb..0be8c875fc1 100644 --- a/server/src/test/java/io/deephaven/server/table/ops/filter/FilterTestUtils.java +++ b/server/src/test/java/io/deephaven/server/table/ops/filter/FilterTestUtils.java @@ -104,6 +104,9 @@ public static Condition compare(CompareCondition.CompareOperation operation, Cas } public static Condition invoke(String method, Value target, Value... filterDescriptors) { + if (target == null) { + return NormalizeFilterUtil.doInvoke(method, Arrays.asList(filterDescriptors)); + } return NormalizeFilterUtil.doInvoke(method, target, Arrays.asList(filterDescriptors)); } } From a31372549aaa085b3c926b727afdc68d43fd7953 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 22 Jul 2022 15:04:57 -0500 Subject: [PATCH 022/215] Generate py from protos and correctly mangle python modules (#2667) Fixes #1073 --- .../io/deephaven/tools/docker/DiffTask.groovy | 118 + proto/proto-backplane-grpc/build.gradle | 15 + proto/raw-js-openapi/build.gradle | 17 +- py/client/build.gradle | 60 + .../pydeephaven/proto/application_pb2.py | 195 +- py/client/pydeephaven/proto/console_pb2.py | 3163 +------------ py/client/pydeephaven/proto/inputtable_pb2.py | 206 +- py/client/pydeephaven/proto/object_pb2.py | 136 +- .../pydeephaven/proto/partitionedtable_pb2.py | 80 + .../proto/partitionedtable_pb2_grpc.py | 157 + py/client/pydeephaven/proto/session_pb2.py | 692 +-- py/client/pydeephaven/proto/table_pb2.py | 3936 +---------------- py/client/pydeephaven/proto/table_pb2_grpc.py | 35 - py/client/pydeephaven/proto/ticket_pb2.py | 96 +- 14 files changed, 926 insertions(+), 7980 deletions(-) create mode 100644 buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy create mode 100644 py/client/pydeephaven/proto/partitionedtable_pb2.py create mode 100644 py/client/pydeephaven/proto/partitionedtable_pb2_grpc.py diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy new file mode 100644 index 00000000000..8f24387603d --- /dev/null +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy @@ -0,0 +1,118 @@ +package io.deephaven.tools.docker + +import groovy.transform.CompileStatic +import org.gradle.api.Action +import org.gradle.api.DefaultTask +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.FileVisitDetails +import org.gradle.api.internal.file.FileLookup +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.util.PatternFilterable +import org.gradle.api.tasks.util.PatternSet + +import javax.inject.Inject +import java.nio.file.Path + +/** + * Compares the files in two sets of contents, failing if there are differences. Intended as a + * counterpart to the Synx task, to allow failing the build if certain sources don't match their + * expected values. + */ +@CompileStatic +abstract class DiffTask extends DefaultTask { + // This is an Object because Gradle doesn't define an interface for getAsFileTree(), so we + // will resolve it when we execute the task. This allows us to read from various sources, + // such as configurations. + @Input + abstract Property getExpectedContents() + // In contrast, this is assumed to be a source directory, to easily allow some Sync action + // to easily be the "fix this mistake" counterpart to this task + @Input + abstract DirectoryProperty getActualContents() + + private final PatternSet ignoreInActual = new PatternSet(); + + /** + * Marks some contents as not needing to be diff'd, like Sync's "preserve". Counter-intuitively, + * this usually requires an "exclude" to specify only a specific subdirectory should be diff'd. + */ + DiffTask ignore(Action action) { + action.execute(this.ignoreInActual); + return this; + } + + /** + * Human readable name of the task that should be run to correct any errors detected by this task. + */ + @Input + abstract Property getGenerateTask() + + @Inject + protected FileLookup getFileLookup() { + throw new UnsupportedOperationException(); + } + + @TaskAction + void diff() { + def resolver = getFileLookup().getFileResolver(getActualContents().asFile.get()) + // for each file in the generated go output, make sure it exists and matches contents + Set changed = [] + Set missing = [] + // build this list before we traverse, then remove as we go, to represent files that shouldn't exist + Set existingFiles = [] + + def ignoreSpec = ignoreInActual.getAsSpec() + getActualContents().asFileTree.visit { FileVisitDetails details -> + if (ignoreSpec.isSatisfiedBy(details)) { + return; + } + if (details.isDirectory()) { + return; + } + existingFiles.add(details.file.toPath()); + } + + project.files(getExpectedContents().get()).asFileTree.visit { FileVisitDetails details -> + if (details.isDirectory()) { + return; + } + + // note the relative path of each generated file + def pathString = details.relativePath.pathString + + def sourceFile = resolver.resolve(pathString) + // if the file does not exist in our source dir, add an error + if (!sourceFile.exists()) { + missing.add(sourceFile.toPath()) + } else { + // remove this from the "existing" collection so we can detect extra files later + existingFiles.remove(sourceFile.toPath()) + + // verify that the contents match + if (sourceFile.text != details.file.text) { + changed.add(sourceFile.toPath()) + } + } + } + if (!changed.isEmpty() || !missing.isEmpty() || !existingFiles.isEmpty()) { + logger.error("Sources do not match expected files:") + changed.each { + logger.error("File has changes: $it") + } + missing.each { + logger.error("File is missing: $it") + } + existingFiles.each { + logger.error("File should not exist: $it") + } + if (generateTask.isPresent()) { + throw new RuntimeException("Sources do not match expected, re-run ${generateTask.get()}") + } else { + throw new RuntimeException("Sources do not match expected"); + } + + } + } +} diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index 1ec6e6fe2aa..2265429ca14 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -17,6 +17,9 @@ configurations { // automatically pick up the standard junit version testCompile.extendsFrom junit + + js {} + python {} } dependencies { @@ -76,6 +79,18 @@ TaskProvider generateProtobuf = Docker.registerDockerTask(project, 'genera } } +// Provide js, go, python output as distinct artifacts - the java output will be consumed in this project by +// declaring it as a new sourceset, see below. This could definitely be more precisely stated, but given that +// all are generated in the same docker image creation step, we don't need to get too clever here. +artifacts { + js(layout.buildDirectory.dir('generated/source/proto/main/js')) { + builtBy generateProtobuf + } + python(layout.buildDirectory.dir('generated/source/proto/main/python')) { + builtBy generateProtobuf + } +} + compileJava.dependsOn generateProtobuf diff --git a/proto/raw-js-openapi/build.gradle b/proto/raw-js-openapi/build.gradle index 817ab0414c5..a9e9a9bd909 100644 --- a/proto/raw-js-openapi/build.gradle +++ b/proto/raw-js-openapi/build.gradle @@ -3,16 +3,21 @@ plugins { id 'io.deephaven.project.register' } -evaluationDependsOn ':proto' -evaluationDependsOn ':proto:proto-backplane-grpc' evaluationDependsOn Docker.registryProject('node') -def backplaneProject = project(':proto:proto-backplane-grpc') +configurations { + js +} + +dependencies { + js project(path: ':proto:proto-backplane-grpc', configuration: 'js') +} + def webpackSourcesLocation = layout.buildDirectory.dir("${buildDir}/dhapi") Docker.registerDockerTask(project, 'webpackSources') { copyIn { - from(backplaneProject.tasks.findByName('generateProtobuf').outputs.files) { + from(configurations.js) { // note: we are only copying the JS and not TS files. include '**/*.js' into 'raw-js-openapi/build/js-src' @@ -41,10 +46,6 @@ Docker.registerDockerTask(project, 'webpackSources') { } } -configurations { - js -} - artifacts { js(webpackSourcesLocation) { builtBy webpackSources diff --git a/py/client/build.gradle b/py/client/build.gradle index 05f86259bb5..6c0a6d6332c 100644 --- a/py/client/build.gradle +++ b/py/client/build.gradle @@ -4,18 +4,78 @@ import com.bmuschko.gradle.docker.tasks.container.DockerRemoveContainer import com.bmuschko.gradle.docker.tasks.network.DockerCreateNetwork import com.bmuschko.gradle.docker.tasks.network.DockerRemoveNetwork import io.deephaven.tools.docker.WaitForHealthyContainer +import io.deephaven.tools.docker.DiffTask plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.python-wheel' } +evaluationDependsOn Docker.registryProject('python') + wheel { src 'pydeephaven' src 'examples' src 'tests' } +configurations { + python {} +} + +dependencies { + python project(path: ':proto:proto-backplane-grpc', configuration: 'python') +} + +def generatedProtoDir = layout.buildDirectory.dir('generatedProto') + +def updatePyNamespaces = tasks.register('updatePyNamespaces', Sync) { + from(configurations.python) { + // change directory from deephaven to pydeephaven + eachFile { it.path = 'pydeephaven/' + it.path.substring('deephaven/'.length()) } + // rewrite specific imports/namespaces from deephaven to pydeephaven + filter { contents -> + def scanner = new Scanner(contents) + def lines = [] + while (scanner.hasNextLine()) { + def line = scanner.nextLine(); + if (line.trim().startsWith('\'__module__\' :')) { + line = line.replace('\'deephaven.', '\'pydeephaven.') + } else if (line.startsWith('from deephaven.proto')) { + line = line.replace('from deephaven.proto', 'from pydeephaven.proto') + } + lines.add(line) + } + return lines.join(System.lineSeparator()); + } + } + + into generatedProtoDir +} + +def compare = tasks.register('compareProtobuf', DiffTask) { + dependsOn updatePyNamespaces + + expectedContents.set generatedProtoDir.get().dir('pydeephaven/proto') + actualContents.set layout.projectDirectory.dir('pydeephaven/proto') + generateTask.set ':py-client:updateProto' + ignore { + include '__init__.py' + } +} +// fail a "check" build if these are out of date +tasks.getByName('quick').dependsOn(compare) + +def updateProtobuf = tasks.register('updateProtobuf', Sync) { + dependsOn(updatePyNamespaces) + finalizedBy compare + from generatedProtoDir.get().dir('pydeephaven/proto') + into layout.projectDirectory.dir('pydeephaven/proto') + preserve { + include '__init__.py' + } +} + // Start up a docker container for the grpc server, then run pydeephaven test evaluationDependsOn(':docker-server') String randomSuffix = UUID.randomUUID().toString(); diff --git a/py/client/pydeephaven/proto/application_pb2.py b/py/client/pydeephaven/proto/application_pb2.py index 930fd697117..3504f20b7b8 100644 --- a/py/client/pydeephaven/proto/application_pb2.py +++ b/py/client/pydeephaven/proto/application_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/application.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -14,158 +15,13 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/application.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n!deephaven/proto/application.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x13\n\x11ListFieldsRequest\"\xd1\x01\n\x12\x46ieldsChangeUpdate\x12=\n\x07\x63reated\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07updated\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07removed\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\"\xb2\x01\n\tFieldInfo\x12\x44\n\x0ctyped_ticket\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12\x19\n\x11\x66ield_description\x18\x03 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t2\x93\x01\n\x12\x41pplicationService\x12}\n\nListFields\x12\x34.io.deephaven.proto.backplane.grpc.ListFieldsRequest\x1a\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,]) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!deephaven/proto/application.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x13\n\x11ListFieldsRequest\"\xd1\x01\n\x12\x46ieldsChangeUpdate\x12=\n\x07\x63reated\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07updated\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07removed\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\"\xb2\x01\n\tFieldInfo\x12\x44\n\x0ctyped_ticket\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12\x19\n\x11\x66ield_description\x18\x03 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t2\x93\x01\n\x12\x41pplicationService\x12}\n\nListFields\x12\x34.io.deephaven.proto.backplane.grpc.ListFieldsRequest\x1a\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3') - -_LISTFIELDSREQUEST = _descriptor.Descriptor( - name='ListFieldsRequest', - full_name='io.deephaven.proto.backplane.grpc.ListFieldsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=102, - serialized_end=121, -) - - -_FIELDSCHANGEUPDATE = _descriptor.Descriptor( - name='FieldsChangeUpdate', - full_name='io.deephaven.proto.backplane.grpc.FieldsChangeUpdate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='created', full_name='io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.created', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='updated', full_name='io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.updated', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='removed', full_name='io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.removed', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=124, - serialized_end=333, -) - - -_FIELDINFO = _descriptor.Descriptor( - name='FieldInfo', - full_name='io.deephaven.proto.backplane.grpc.FieldInfo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='typed_ticket', full_name='io.deephaven.proto.backplane.grpc.FieldInfo.typed_ticket', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='field_name', full_name='io.deephaven.proto.backplane.grpc.FieldInfo.field_name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='field_description', full_name='io.deephaven.proto.backplane.grpc.FieldInfo.field_description', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='application_name', full_name='io.deephaven.proto.backplane.grpc.FieldInfo.application_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='application_id', full_name='io.deephaven.proto.backplane.grpc.FieldInfo.application_id', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=336, - serialized_end=514, -) - -_FIELDSCHANGEUPDATE.fields_by_name['created'].message_type = _FIELDINFO -_FIELDSCHANGEUPDATE.fields_by_name['updated'].message_type = _FIELDINFO -_FIELDSCHANGEUPDATE.fields_by_name['removed'].message_type = _FIELDINFO -_FIELDINFO.fields_by_name['typed_ticket'].message_type = deephaven_dot_proto_dot_ticket__pb2._TYPEDTICKET -DESCRIPTOR.message_types_by_name['ListFieldsRequest'] = _LISTFIELDSREQUEST -DESCRIPTOR.message_types_by_name['FieldsChangeUpdate'] = _FIELDSCHANGEUPDATE -DESCRIPTOR.message_types_by_name['FieldInfo'] = _FIELDINFO -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_LISTFIELDSREQUEST = DESCRIPTOR.message_types_by_name['ListFieldsRequest'] +_FIELDSCHANGEUPDATE = DESCRIPTOR.message_types_by_name['FieldsChangeUpdate'] +_FIELDINFO = DESCRIPTOR.message_types_by_name['FieldInfo'] ListFieldsRequest = _reflection.GeneratedProtocolMessageType('ListFieldsRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTFIELDSREQUEST, '__module__' : 'pydeephaven.proto.application_pb2' @@ -187,32 +43,17 @@ }) _sym_db.RegisterMessage(FieldInfo) - -DESCRIPTOR._options = None - -_APPLICATIONSERVICE = _descriptor.ServiceDescriptor( - name='ApplicationService', - full_name='io.deephaven.proto.backplane.grpc.ApplicationService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=517, - serialized_end=664, - methods=[ - _descriptor.MethodDescriptor( - name='ListFields', - full_name='io.deephaven.proto.backplane.grpc.ApplicationService.ListFields', - index=0, - containing_service=None, - input_type=_LISTFIELDSREQUEST, - output_type=_FIELDSCHANGEUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_APPLICATIONSERVICE) - -DESCRIPTOR.services_by_name['ApplicationService'] = _APPLICATIONSERVICE - +_APPLICATIONSERVICE = DESCRIPTOR.services_by_name['ApplicationService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _LISTFIELDSREQUEST._serialized_start=102 + _LISTFIELDSREQUEST._serialized_end=121 + _FIELDSCHANGEUPDATE._serialized_start=124 + _FIELDSCHANGEUPDATE._serialized_end=333 + _FIELDINFO._serialized_start=336 + _FIELDINFO._serialized_end=514 + _APPLICATIONSERVICE._serialized_start=517 + _APPLICATIONSERVICE._serialized_end=664 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/console_pb2.py b/py/client/pydeephaven/proto/console_pb2.py index 59d68873e93..5c122c646d2 100644 --- a/py/client/pydeephaven/proto/console_pb2.py +++ b/py/client/pydeephaven/proto/console_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/console.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -16,2893 +17,60 @@ from pydeephaven.proto import application_pb2 as deephaven_dot_proto_dot_application__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/console.proto', - package='io.deephaven.proto.backplane.script.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1b\x64\x65\x65phaven/proto/table.proto\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"I\n\x16LogSubscriptionRequest\x12\x1f\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x12\x0e\n\x06levels\x18\x02 \x03(\t\"O\n\x13LogSubscriptionData\x12\x0e\n\x06micros\x18\x01 \x01(\x03\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xab/\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x17\n\x0fupdate_interval\x18\x07 \x01(\x03\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xa0\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"N\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1aL\n\x14StringMapWithDefault\x12\x16\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\t\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\t\x1aL\n\x14\x44oubleMapWithDefault\x12\x16\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x1aH\n\x12\x42oolMapWithDefault\x12\x14\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xae\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x14\n\x0ctable_map_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xac\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x14\n\x0ctable_map_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\x99\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\"\xac\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\xff\n\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_table__pb2.DESCRIPTOR,deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,deephaven_dot_proto_dot_application__pb2.DESCRIPTOR,]) - - - -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE = _descriptor.EnumDescriptor( - name='ChartType', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='XY', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PIE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='OHLC', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CATEGORY', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='XYZ', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CATEGORY_3D', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4832, - serialized_end=4910, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE) - -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE = _descriptor.EnumDescriptor( - name='AxisFormatType', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CATEGORY', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='NUMBER', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=8021, - serialized_end=8063, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE) - -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE = _descriptor.EnumDescriptor( - name='AxisType', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='X', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Y', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SHAPE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SIZE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LABEL', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='COLOR', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=8065, - serialized_end=8132, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE) - -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION = _descriptor.EnumDescriptor( - name='AxisPosition', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='TOP', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BOTTOM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LEFT', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='RIGHT', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='NONE', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=8134, - serialized_end=8200, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION) - -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK = _descriptor.EnumDescriptor( - name='DayOfWeek', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SUNDAY', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MONDAY', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='TUESDAY', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='WEDNESDAY', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='THURSDAY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='FRIDAY', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SATURDAY', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9027, - serialized_end=9130, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK) - -_FIGUREDESCRIPTOR_SERIESPLOTSTYLE = _descriptor.EnumDescriptor( - name='SeriesPlotStyle', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='BAR', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STACKED_BAR', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LINE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='AREA', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STACKED_AREA', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PIE', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='HISTOGRAM', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='OHLC', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SCATTER', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STEP', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='ERROR_BAR', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9714, - serialized_end=9867, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_SERIESPLOTSTYLE) - -_FIGUREDESCRIPTOR_SOURCETYPE = _descriptor.EnumDescriptor( - name='SourceType', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='X', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Y', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Z', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='X_LOW', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='X_HIGH', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Y_LOW', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Y_HIGH', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='TIME', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='OPEN', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='HIGH', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LOW', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CLOSE', index=11, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SHAPE', index=12, number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SIZE', index=13, number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LABEL', index=14, number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='COLOR', index=15, number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9870, - serialized_end=10042, -) -_sym_db.RegisterEnumDescriptor(_FIGUREDESCRIPTOR_SOURCETYPE) - - -_GETCONSOLETYPESREQUEST = _descriptor.Descriptor( - name='GetConsoleTypesRequest', - full_name='io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=169, - serialized_end=193, -) - - -_GETCONSOLETYPESRESPONSE = _descriptor.Descriptor( - name='GetConsoleTypesResponse', - full_name='io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_types', full_name='io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse.console_types', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=195, - serialized_end=243, -) - - -_STARTCONSOLEREQUEST = _descriptor.Descriptor( - name='StartConsoleRequest', - full_name='io.deephaven.proto.backplane.script.grpc.StartConsoleRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='session_type', full_name='io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=245, - serialized_end=350, -) - - -_STARTCONSOLERESPONSE = _descriptor.Descriptor( - name='StartConsoleResponse', - full_name='io.deephaven.proto.backplane.script.grpc.StartConsoleResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.script.grpc.StartConsoleResponse.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=352, - serialized_end=436, -) - - -_LOGSUBSCRIPTIONREQUEST = _descriptor.Descriptor( - name='LogSubscriptionRequest', - full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='last_seen_log_timestamp', full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.last_seen_log_timestamp', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='levels', full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.levels', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=438, - serialized_end=511, -) - - -_LOGSUBSCRIPTIONDATA = _descriptor.Descriptor( - name='LogSubscriptionData', - full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionData', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='micros', full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.micros', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='log_level', full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='message', full_name='io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=513, - serialized_end=592, -) - - -_EXECUTECOMMANDREQUEST = _descriptor.Descriptor( - name='ExecuteCommandRequest', - full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='code', full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code', index=1, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=594, - serialized_end=700, -) - - -_EXECUTECOMMANDRESPONSE = _descriptor.Descriptor( - name='ExecuteCommandResponse', - full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='error_message', full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='changes', full_name='io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.changes', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=702, - serialized_end=821, -) - - -_BINDTABLETOVARIABLEREQUEST = _descriptor.Descriptor( - name='BindTableToVariableRequest', - full_name='io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='variable_name', full_name='io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name', index=1, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_id', full_name='io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.table_id', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=824, - serialized_end=1005, -) - - -_BINDTABLETOVARIABLERESPONSE = _descriptor.Descriptor( - name='BindTableToVariableResponse', - full_name='io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1007, - serialized_end=1036, -) - - -_CANCELCOMMANDREQUEST = _descriptor.Descriptor( - name='CancelCommandRequest', - full_name='io.deephaven.proto.backplane.script.grpc.CancelCommandRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='command_id', full_name='io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.command_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1039, - serialized_end=1187, -) - - -_CANCELCOMMANDRESPONSE = _descriptor.Descriptor( - name='CancelCommandResponse', - full_name='io.deephaven.proto.backplane.script.grpc.CancelCommandResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1189, - serialized_end=1212, -) - - -_AUTOCOMPLETEREQUEST = _descriptor.Descriptor( - name='AutoCompleteRequest', - full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='open_document', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.open_document', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='change_document', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.change_document', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='get_completion_items', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.get_completion_items', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='close_document', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.close_document', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='request', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.request', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=1215, - serialized_end=1618, -) - - -_AUTOCOMPLETERESPONSE = _descriptor.Descriptor( - name='AutoCompleteResponse', - full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='completion_items', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.completion_items', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='response', full_name='io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.response', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=1621, - serialized_end=1753, -) - - -_BROWSERNEXTRESPONSE = _descriptor.Descriptor( - name='BrowserNextResponse', - full_name='io.deephaven.proto.backplane.script.grpc.BrowserNextResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1755, - serialized_end=1776, -) - - -_OPENDOCUMENTREQUEST = _descriptor.Descriptor( - name='OpenDocumentRequest', - full_name='io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text_document', full_name='io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.text_document', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1779, - serialized_end=1946, -) - - -_TEXTDOCUMENTITEM = _descriptor.Descriptor( - name='TextDocumentItem', - full_name='io.deephaven.proto.backplane.script.grpc.TextDocumentItem', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uri', full_name='io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='language_id', full_name='io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='version', full_name='io.deephaven.proto.backplane.script.grpc.TextDocumentItem.version', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text', full_name='io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1948, - serialized_end=2031, -) - - -_CLOSEDOCUMENTREQUEST = _descriptor.Descriptor( - name='CloseDocumentRequest', - full_name='io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text_document', full_name='io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.text_document', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2034, - serialized_end=2217, -) - - -_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT = _descriptor.Descriptor( - name='TextDocumentContentChangeEvent', - full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='range', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='range_length', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range_length', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2528, - serialized_end=2668, -) - -_CHANGEDOCUMENTREQUEST = _descriptor.Descriptor( - name='ChangeDocumentRequest', - full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text_document', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.text_document', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='content_changes', full_name='io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.content_changes', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2220, - serialized_end=2668, -) - - -_DOCUMENTRANGE = _descriptor.Descriptor( - name='DocumentRange', - full_name='io.deephaven.proto.backplane.script.grpc.DocumentRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='start', full_name='io.deephaven.proto.backplane.script.grpc.DocumentRange.start', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='end', full_name='io.deephaven.proto.backplane.script.grpc.DocumentRange.end', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2671, - serialized_end=2818, -) - - -_VERSIONEDTEXTDOCUMENTIDENTIFIER = _descriptor.Descriptor( - name='VersionedTextDocumentIdentifier', - full_name='io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uri', full_name='io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='version', full_name='io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.version', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2820, - serialized_end=2883, -) - - -_POSITION = _descriptor.Descriptor( - name='Position', - full_name='io.deephaven.proto.backplane.script.grpc.Position', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='line', full_name='io.deephaven.proto.backplane.script.grpc.Position.line', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='character', full_name='io.deephaven.proto.backplane.script.grpc.Position.character', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2885, - serialized_end=2928, -) - - -_GETCOMPLETIONITEMSREQUEST = _descriptor.Descriptor( - name='GetCompletionItemsRequest', - full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='console_id', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.console_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.context', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text_document', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.text_document', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='position', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.position', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='request_id', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.request_id', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2931, - serialized_end=3287, -) - - -_COMPLETIONCONTEXT = _descriptor.Descriptor( - name='CompletionContext', - full_name='io.deephaven.proto.backplane.script.grpc.CompletionContext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='trigger_kind', full_name='io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_kind', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='trigger_character', full_name='io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3289, - serialized_end=3357, -) - - -_GETCOMPLETIONITEMSRESPONSE = _descriptor.Descriptor( - name='GetCompletionItemsResponse', - full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='items', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.items', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='request_id', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.request_id', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='success', full_name='io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.success', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3360, - serialized_end=3498, -) - - -_COMPLETIONITEM = _descriptor.Descriptor( - name='CompletionItem', - full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='start', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.start', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='length', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.length', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='label', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.label', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kind', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.kind', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='detail', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.detail', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='documentation', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='deprecated', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.deprecated', index=6, - number=7, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='preselect', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.preselect', index=7, - number=8, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text_edit', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.text_edit', index=8, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sort_text', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter_text', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='insert_text_format', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.insert_text_format', index=11, - number=12, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='additional_text_edits', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.additional_text_edits', index=12, - number=13, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='commit_characters', full_name='io.deephaven.proto.backplane.script.grpc.CompletionItem.commit_characters', index=13, - number=14, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3501, - serialized_end=3904, -) - - -_TEXTEDIT = _descriptor.Descriptor( - name='TextEdit', - full_name='io.deephaven.proto.backplane.script.grpc.TextEdit', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='range', full_name='io.deephaven.proto.backplane.script.grpc.TextEdit.range', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='text', full_name='io.deephaven.proto.backplane.script.grpc.TextEdit.text', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3906, - serialized_end=4002, -) - - -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR = _descriptor.Descriptor( - name='ChartDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='colspan', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.colspan', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='rowspan', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.rowspan', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='series', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.series', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='multi_series', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.multi_series', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='axes', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.axes', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='chart_type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.chart_type', index=5, - number=6, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='title', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='title_font', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='title_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='show_legend', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.show_legend', index=9, - number=10, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='legend_font', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='legend_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color', index=11, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is3d', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.is3d', index=12, - number=13, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_title', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor._title', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=4248, - serialized_end=4920, -) - -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR = _descriptor.Descriptor( - name='SeriesDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='plot_style', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.plot_style', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='name', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='lines_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.lines_visible', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shapes_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shapes_visible', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gradient_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.gradient_visible', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='line_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_label_format', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format', index=6, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='x_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern', index=7, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='y_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern', index=8, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape_label', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label', index=9, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape_size', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_size', index=10, - number=12, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color', index=11, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape', index=12, - number=14, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data_sources', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.data_sources', index=13, - number=15, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_lines_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._lines_visible', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_shapes_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._shapes_visible', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_point_label_format', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._point_label_format', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_x_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._x_tool_tip_pattern', - index=3, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_y_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._y_tool_tip_pattern', - index=4, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_shape_size', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor._shape_size', - index=5, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=4923, - serialized_end=5561, -) - -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR = _descriptor.Descriptor( - name='MultiSeriesDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='plot_style', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.plot_style', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='name', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='line_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.line_color', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_color', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='lines_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.lines_visible', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='points_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.points_visible', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gradient_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.gradient_visible', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_label_format', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label_format', index=7, - number=8, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='x_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.x_tool_tip_pattern', index=8, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='y_tool_tip_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.y_tool_tip_pattern', index=9, - number=10, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_label', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label', index=10, - number=11, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_size', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_size', index=11, - number=12, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='point_shape', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_shape', index=12, - number=13, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data_sources', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.data_sources', index=13, - number=14, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5564, - serialized_end=6952, -) - -_FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT = _descriptor.Descriptor( - name='StringMapWithDefault', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='default_string', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='keys', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.keys', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.values', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6954, - serialized_end=7030, -) - -_FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT = _descriptor.Descriptor( - name='DoubleMapWithDefault', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='default_double', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault.default_double', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='keys', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault.keys', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault.values', index=2, - number=3, type=1, cpp_type=5, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7032, - serialized_end=7108, -) - -_FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT = _descriptor.Descriptor( - name='BoolMapWithDefault', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='default_bool', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault.default_bool', index=0, - number=1, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='keys', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault.keys', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault.values', index=2, - number=3, type=8, cpp_type=7, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7110, - serialized_end=7182, -) - -_FIGUREDESCRIPTOR_AXISDESCRIPTOR = _descriptor.Descriptor( - name='AxisDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='format_type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.type', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='position', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.position', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='log', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.log', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='label', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='label_font', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ticks_font', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='format_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='min_range', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.min_range', index=10, - number=11, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='max_range', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.max_range', index=11, - number=12, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='minor_ticks_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.minor_ticks_visible', index=12, - number=13, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='major_ticks_visible', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.major_ticks_visible', index=13, - number=14, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='minor_tick_count', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.minor_tick_count', index=14, - number=15, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gap_between_major_ticks', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.gap_between_major_ticks', index=15, - number=16, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='major_tick_locations', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.major_tick_locations', index=16, - number=17, type=1, cpp_type=5, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tick_label_angle', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.tick_label_angle', index=17, - number=18, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='invert', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.invert', index=18, - number=19, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_time_axis', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.is_time_axis', index=19, - number=20, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='business_calendar_descriptor', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.business_calendar_descriptor', index=20, - number=21, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE, - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE, - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_format_pattern', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor._format_pattern', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_gap_between_major_ticks', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor._gap_between_major_ticks', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=7185, - serialized_end=8247, -) - -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD = _descriptor.Descriptor( - name='BusinessPeriod', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='open', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='close', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8674, - serialized_end=8719, -) - -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY = _descriptor.Descriptor( - name='Holiday', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='date', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.date', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='business_periods', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.business_periods', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8722, - serialized_end=8970, -) - -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE = _descriptor.Descriptor( - name='LocalDate', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='year', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.year', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='month', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.month', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='day', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.day', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8972, - serialized_end=9025, -) - -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR = _descriptor.Descriptor( - name='BusinessCalendarDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_zone', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='business_days', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_days', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='business_periods', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_periods', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='holidays', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.holidays', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD, _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY, _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE, ], - enum_types=[ - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8250, - serialized_end=9130, -) - -_FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR = _descriptor.Descriptor( - name='MultiSeriesSourceDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='axis_id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_map_id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.table_map_id', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_name', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9133, - serialized_end=9307, -) - -_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR = _descriptor.Descriptor( - name='SourceDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='axis_id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_id', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_map_id', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_map_id', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_name', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_type', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='one_click', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.one_click', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9310, - serialized_end=9610, -) - -_FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR = _descriptor.Descriptor( - name='OneClickDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='columns', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.columns', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_types', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.column_types', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='require_all_filters_to_display', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.require_all_filters_to_display', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9612, - serialized_end=9711, -) - -_FIGUREDESCRIPTOR = _descriptor.Descriptor( - name='FigureDescriptor', - full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='title', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='title_font', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='title_color', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='update_interval', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.update_interval', index=3, - number=7, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='cols', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.cols', index=4, - number=8, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='rows', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.rows', index=5, - number=9, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='charts', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.charts', index=6, - number=10, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='errors', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor.errors', index=7, - number=13, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_FIGUREDESCRIPTOR_CHARTDESCRIPTOR, _FIGUREDESCRIPTOR_SERIESDESCRIPTOR, _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR, _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT, _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT, _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT, _FIGUREDESCRIPTOR_AXISDESCRIPTOR, _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR, _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR, _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR, _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR, ], - enum_types=[ - _FIGUREDESCRIPTOR_SERIESPLOTSTYLE, - _FIGUREDESCRIPTOR_SOURCETYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_title', full_name='io.deephaven.proto.backplane.script.grpc.FigureDescriptor._title', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=4005, - serialized_end=10064, -) - -_STARTCONSOLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_STARTCONSOLERESPONSE.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXECUTECOMMANDREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXECUTECOMMANDRESPONSE.fields_by_name['changes'].message_type = deephaven_dot_proto_dot_application__pb2._FIELDSCHANGEUPDATE -_BINDTABLETOVARIABLEREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_BINDTABLETOVARIABLEREQUEST.fields_by_name['table_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CANCELCOMMANDREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CANCELCOMMANDREQUEST.fields_by_name['command_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_AUTOCOMPLETEREQUEST.fields_by_name['open_document'].message_type = _OPENDOCUMENTREQUEST -_AUTOCOMPLETEREQUEST.fields_by_name['change_document'].message_type = _CHANGEDOCUMENTREQUEST -_AUTOCOMPLETEREQUEST.fields_by_name['get_completion_items'].message_type = _GETCOMPLETIONITEMSREQUEST -_AUTOCOMPLETEREQUEST.fields_by_name['close_document'].message_type = _CLOSEDOCUMENTREQUEST -_AUTOCOMPLETEREQUEST.oneofs_by_name['request'].fields.append( - _AUTOCOMPLETEREQUEST.fields_by_name['open_document']) -_AUTOCOMPLETEREQUEST.fields_by_name['open_document'].containing_oneof = _AUTOCOMPLETEREQUEST.oneofs_by_name['request'] -_AUTOCOMPLETEREQUEST.oneofs_by_name['request'].fields.append( - _AUTOCOMPLETEREQUEST.fields_by_name['change_document']) -_AUTOCOMPLETEREQUEST.fields_by_name['change_document'].containing_oneof = _AUTOCOMPLETEREQUEST.oneofs_by_name['request'] -_AUTOCOMPLETEREQUEST.oneofs_by_name['request'].fields.append( - _AUTOCOMPLETEREQUEST.fields_by_name['get_completion_items']) -_AUTOCOMPLETEREQUEST.fields_by_name['get_completion_items'].containing_oneof = _AUTOCOMPLETEREQUEST.oneofs_by_name['request'] -_AUTOCOMPLETEREQUEST.oneofs_by_name['request'].fields.append( - _AUTOCOMPLETEREQUEST.fields_by_name['close_document']) -_AUTOCOMPLETEREQUEST.fields_by_name['close_document'].containing_oneof = _AUTOCOMPLETEREQUEST.oneofs_by_name['request'] -_AUTOCOMPLETERESPONSE.fields_by_name['completion_items'].message_type = _GETCOMPLETIONITEMSRESPONSE -_AUTOCOMPLETERESPONSE.oneofs_by_name['response'].fields.append( - _AUTOCOMPLETERESPONSE.fields_by_name['completion_items']) -_AUTOCOMPLETERESPONSE.fields_by_name['completion_items'].containing_oneof = _AUTOCOMPLETERESPONSE.oneofs_by_name['response'] -_OPENDOCUMENTREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_OPENDOCUMENTREQUEST.fields_by_name['text_document'].message_type = _TEXTDOCUMENTITEM -_CLOSEDOCUMENTREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CLOSEDOCUMENTREQUEST.fields_by_name['text_document'].message_type = _VERSIONEDTEXTDOCUMENTIDENTIFIER -_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT.fields_by_name['range'].message_type = _DOCUMENTRANGE -_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT.containing_type = _CHANGEDOCUMENTREQUEST -_CHANGEDOCUMENTREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CHANGEDOCUMENTREQUEST.fields_by_name['text_document'].message_type = _VERSIONEDTEXTDOCUMENTIDENTIFIER -_CHANGEDOCUMENTREQUEST.fields_by_name['content_changes'].message_type = _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT -_DOCUMENTRANGE.fields_by_name['start'].message_type = _POSITION -_DOCUMENTRANGE.fields_by_name['end'].message_type = _POSITION -_GETCOMPLETIONITEMSREQUEST.fields_by_name['console_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_GETCOMPLETIONITEMSREQUEST.fields_by_name['context'].message_type = _COMPLETIONCONTEXT -_GETCOMPLETIONITEMSREQUEST.fields_by_name['text_document'].message_type = _VERSIONEDTEXTDOCUMENTIDENTIFIER -_GETCOMPLETIONITEMSREQUEST.fields_by_name['position'].message_type = _POSITION -_GETCOMPLETIONITEMSRESPONSE.fields_by_name['items'].message_type = _COMPLETIONITEM -_COMPLETIONITEM.fields_by_name['text_edit'].message_type = _TEXTEDIT -_COMPLETIONITEM.fields_by_name['additional_text_edits'].message_type = _TEXTEDIT -_TEXTEDIT.fields_by_name['range'].message_type = _DOCUMENTRANGE -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['series'].message_type = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['multi_series'].message_type = _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['axes'].message_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['chart_type'].enum_type = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE.containing_type = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.oneofs_by_name['_title'].fields.append( - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['title']) -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR.fields_by_name['title'].containing_oneof = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR.oneofs_by_name['_title'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['plot_style'].enum_type = _FIGUREDESCRIPTOR_SERIESPLOTSTYLE -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['data_sources'].message_type = _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_lines_visible'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['lines_visible']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['lines_visible'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_lines_visible'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_shapes_visible'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['shapes_visible']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['shapes_visible'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_shapes_visible'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_point_label_format'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['point_label_format']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['point_label_format'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_point_label_format'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_x_tool_tip_pattern'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['x_tool_tip_pattern']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['x_tool_tip_pattern'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_x_tool_tip_pattern'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_y_tool_tip_pattern'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['y_tool_tip_pattern']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['y_tool_tip_pattern'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_y_tool_tip_pattern'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_shape_size'].fields.append( - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['shape_size']) -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR.fields_by_name['shape_size'].containing_oneof = _FIGUREDESCRIPTOR_SERIESDESCRIPTOR.oneofs_by_name['_shape_size'] -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['plot_style'].enum_type = _FIGUREDESCRIPTOR_SERIESPLOTSTYLE -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['line_color'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['point_color'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['lines_visible'].message_type = _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['points_visible'].message_type = _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['gradient_visible'].message_type = _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['point_label_format'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['x_tool_tip_pattern'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['y_tool_tip_pattern'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['point_label'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['point_size'].message_type = _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['point_shape'].message_type = _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.fields_by_name['data_sources'].message_type = _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['format_type'].enum_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['type'].enum_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['position'].enum_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['business_calendar_descriptor'].message_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE.containing_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE.containing_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION.containing_type = _FIGUREDESCRIPTOR_AXISDESCRIPTOR -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.oneofs_by_name['_format_pattern'].fields.append( - _FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['format_pattern']) -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['format_pattern'].containing_oneof = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.oneofs_by_name['_format_pattern'] -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.oneofs_by_name['_gap_between_major_ticks'].fields.append( - _FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['gap_between_major_ticks']) -_FIGUREDESCRIPTOR_AXISDESCRIPTOR.fields_by_name['gap_between_major_ticks'].containing_oneof = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.oneofs_by_name['_gap_between_major_ticks'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD.containing_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY.fields_by_name['date'].message_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY.fields_by_name['business_periods'].message_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY.containing_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE.containing_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.fields_by_name['business_days'].enum_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.fields_by_name['business_periods'].message_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.fields_by_name['holidays'].message_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK.containing_type = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR -_FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR.fields_by_name['type'].enum_type = _FIGUREDESCRIPTOR_SOURCETYPE -_FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR.fields_by_name['type'].enum_type = _FIGUREDESCRIPTOR_SOURCETYPE -_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR.fields_by_name['one_click'].message_type = _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR -_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR.fields_by_name['charts'].message_type = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR -_FIGUREDESCRIPTOR_SERIESPLOTSTYLE.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR_SOURCETYPE.containing_type = _FIGUREDESCRIPTOR -_FIGUREDESCRIPTOR.oneofs_by_name['_title'].fields.append( - _FIGUREDESCRIPTOR.fields_by_name['title']) -_FIGUREDESCRIPTOR.fields_by_name['title'].containing_oneof = _FIGUREDESCRIPTOR.oneofs_by_name['_title'] -DESCRIPTOR.message_types_by_name['GetConsoleTypesRequest'] = _GETCONSOLETYPESREQUEST -DESCRIPTOR.message_types_by_name['GetConsoleTypesResponse'] = _GETCONSOLETYPESRESPONSE -DESCRIPTOR.message_types_by_name['StartConsoleRequest'] = _STARTCONSOLEREQUEST -DESCRIPTOR.message_types_by_name['StartConsoleResponse'] = _STARTCONSOLERESPONSE -DESCRIPTOR.message_types_by_name['LogSubscriptionRequest'] = _LOGSUBSCRIPTIONREQUEST -DESCRIPTOR.message_types_by_name['LogSubscriptionData'] = _LOGSUBSCRIPTIONDATA -DESCRIPTOR.message_types_by_name['ExecuteCommandRequest'] = _EXECUTECOMMANDREQUEST -DESCRIPTOR.message_types_by_name['ExecuteCommandResponse'] = _EXECUTECOMMANDRESPONSE -DESCRIPTOR.message_types_by_name['BindTableToVariableRequest'] = _BINDTABLETOVARIABLEREQUEST -DESCRIPTOR.message_types_by_name['BindTableToVariableResponse'] = _BINDTABLETOVARIABLERESPONSE -DESCRIPTOR.message_types_by_name['CancelCommandRequest'] = _CANCELCOMMANDREQUEST -DESCRIPTOR.message_types_by_name['CancelCommandResponse'] = _CANCELCOMMANDRESPONSE -DESCRIPTOR.message_types_by_name['AutoCompleteRequest'] = _AUTOCOMPLETEREQUEST -DESCRIPTOR.message_types_by_name['AutoCompleteResponse'] = _AUTOCOMPLETERESPONSE -DESCRIPTOR.message_types_by_name['BrowserNextResponse'] = _BROWSERNEXTRESPONSE -DESCRIPTOR.message_types_by_name['OpenDocumentRequest'] = _OPENDOCUMENTREQUEST -DESCRIPTOR.message_types_by_name['TextDocumentItem'] = _TEXTDOCUMENTITEM -DESCRIPTOR.message_types_by_name['CloseDocumentRequest'] = _CLOSEDOCUMENTREQUEST -DESCRIPTOR.message_types_by_name['ChangeDocumentRequest'] = _CHANGEDOCUMENTREQUEST -DESCRIPTOR.message_types_by_name['DocumentRange'] = _DOCUMENTRANGE -DESCRIPTOR.message_types_by_name['VersionedTextDocumentIdentifier'] = _VERSIONEDTEXTDOCUMENTIDENTIFIER -DESCRIPTOR.message_types_by_name['Position'] = _POSITION -DESCRIPTOR.message_types_by_name['GetCompletionItemsRequest'] = _GETCOMPLETIONITEMSREQUEST -DESCRIPTOR.message_types_by_name['CompletionContext'] = _COMPLETIONCONTEXT -DESCRIPTOR.message_types_by_name['GetCompletionItemsResponse'] = _GETCOMPLETIONITEMSRESPONSE -DESCRIPTOR.message_types_by_name['CompletionItem'] = _COMPLETIONITEM -DESCRIPTOR.message_types_by_name['TextEdit'] = _TEXTEDIT -DESCRIPTOR.message_types_by_name['FigureDescriptor'] = _FIGUREDESCRIPTOR -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1b\x64\x65\x65phaven/proto/table.proto\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\xff\n\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') + + + +_GETCONSOLETYPESREQUEST = DESCRIPTOR.message_types_by_name['GetConsoleTypesRequest'] +_GETCONSOLETYPESRESPONSE = DESCRIPTOR.message_types_by_name['GetConsoleTypesResponse'] +_STARTCONSOLEREQUEST = DESCRIPTOR.message_types_by_name['StartConsoleRequest'] +_STARTCONSOLERESPONSE = DESCRIPTOR.message_types_by_name['StartConsoleResponse'] +_LOGSUBSCRIPTIONREQUEST = DESCRIPTOR.message_types_by_name['LogSubscriptionRequest'] +_LOGSUBSCRIPTIONDATA = DESCRIPTOR.message_types_by_name['LogSubscriptionData'] +_EXECUTECOMMANDREQUEST = DESCRIPTOR.message_types_by_name['ExecuteCommandRequest'] +_EXECUTECOMMANDRESPONSE = DESCRIPTOR.message_types_by_name['ExecuteCommandResponse'] +_BINDTABLETOVARIABLEREQUEST = DESCRIPTOR.message_types_by_name['BindTableToVariableRequest'] +_BINDTABLETOVARIABLERESPONSE = DESCRIPTOR.message_types_by_name['BindTableToVariableResponse'] +_CANCELCOMMANDREQUEST = DESCRIPTOR.message_types_by_name['CancelCommandRequest'] +_CANCELCOMMANDRESPONSE = DESCRIPTOR.message_types_by_name['CancelCommandResponse'] +_AUTOCOMPLETEREQUEST = DESCRIPTOR.message_types_by_name['AutoCompleteRequest'] +_AUTOCOMPLETERESPONSE = DESCRIPTOR.message_types_by_name['AutoCompleteResponse'] +_BROWSERNEXTRESPONSE = DESCRIPTOR.message_types_by_name['BrowserNextResponse'] +_OPENDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['OpenDocumentRequest'] +_TEXTDOCUMENTITEM = DESCRIPTOR.message_types_by_name['TextDocumentItem'] +_CLOSEDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['CloseDocumentRequest'] +_CHANGEDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['ChangeDocumentRequest'] +_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT = _CHANGEDOCUMENTREQUEST.nested_types_by_name['TextDocumentContentChangeEvent'] +_DOCUMENTRANGE = DESCRIPTOR.message_types_by_name['DocumentRange'] +_VERSIONEDTEXTDOCUMENTIDENTIFIER = DESCRIPTOR.message_types_by_name['VersionedTextDocumentIdentifier'] +_POSITION = DESCRIPTOR.message_types_by_name['Position'] +_GETCOMPLETIONITEMSREQUEST = DESCRIPTOR.message_types_by_name['GetCompletionItemsRequest'] +_COMPLETIONCONTEXT = DESCRIPTOR.message_types_by_name['CompletionContext'] +_GETCOMPLETIONITEMSRESPONSE = DESCRIPTOR.message_types_by_name['GetCompletionItemsResponse'] +_COMPLETIONITEM = DESCRIPTOR.message_types_by_name['CompletionItem'] +_TEXTEDIT = DESCRIPTOR.message_types_by_name['TextEdit'] +_FIGUREDESCRIPTOR = DESCRIPTOR.message_types_by_name['FigureDescriptor'] +_FIGUREDESCRIPTOR_CHARTDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['ChartDescriptor'] +_FIGUREDESCRIPTOR_SERIESDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['SeriesDescriptor'] +_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['MultiSeriesDescriptor'] +_FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['StringMapWithDefault'] +_FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['DoubleMapWithDefault'] +_FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['BoolMapWithDefault'] +_FIGUREDESCRIPTOR_AXISDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['AxisDescriptor'] +_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['BusinessCalendarDescriptor'] +_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['BusinessPeriod'] +_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['Holiday'] +_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['LocalDate'] +_FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['MultiSeriesSourceDescriptor'] +_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['SourceDescriptor'] +_FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['OneClickDescriptor'] +_FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR.enum_types_by_name['ChartType'] +_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisFormatType'] +_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisType'] +_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisPosition'] +_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.enum_types_by_name['DayOfWeek'] +_FIGUREDESCRIPTOR_SERIESPLOTSTYLE = _FIGUREDESCRIPTOR.enum_types_by_name['SeriesPlotStyle'] +_FIGUREDESCRIPTOR_SOURCETYPE = _FIGUREDESCRIPTOR.enum_types_by_name['SourceType'] GetConsoleTypesRequest = _reflection.GeneratedProtocolMessageType('GetConsoleTypesRequest', (_message.Message,), { 'DESCRIPTOR' : _GETCONSOLETYPESREQUEST, '__module__' : 'pydeephaven.proto.console_pb2' @@ -3219,112 +387,117 @@ _sym_db.RegisterMessage(FigureDescriptor.SourceDescriptor) _sym_db.RegisterMessage(FigureDescriptor.OneClickDescriptor) - -DESCRIPTOR._options = None - -_CONSOLESERVICE = _descriptor.ServiceDescriptor( - name='ConsoleService', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=10067, - serialized_end=11474, - methods=[ - _descriptor.MethodDescriptor( - name='GetConsoleTypes', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes', - index=0, - containing_service=None, - input_type=_GETCONSOLETYPESREQUEST, - output_type=_GETCONSOLETYPESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='StartConsole', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole', - index=1, - containing_service=None, - input_type=_STARTCONSOLEREQUEST, - output_type=_STARTCONSOLERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SubscribeToLogs', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs', - index=2, - containing_service=None, - input_type=_LOGSUBSCRIPTIONREQUEST, - output_type=_LOGSUBSCRIPTIONDATA, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ExecuteCommand', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand', - index=3, - containing_service=None, - input_type=_EXECUTECOMMANDREQUEST, - output_type=_EXECUTECOMMANDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CancelCommand', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand', - index=4, - containing_service=None, - input_type=_CANCELCOMMANDREQUEST, - output_type=_CANCELCOMMANDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='BindTableToVariable', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable', - index=5, - containing_service=None, - input_type=_BINDTABLETOVARIABLEREQUEST, - output_type=_BINDTABLETOVARIABLERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='AutoCompleteStream', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream', - index=6, - containing_service=None, - input_type=_AUTOCOMPLETEREQUEST, - output_type=_AUTOCOMPLETERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='OpenAutoCompleteStream', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream', - index=7, - containing_service=None, - input_type=_AUTOCOMPLETEREQUEST, - output_type=_AUTOCOMPLETERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NextAutoCompleteStream', - full_name='io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream', - index=8, - containing_service=None, - input_type=_AUTOCOMPLETEREQUEST, - output_type=_BROWSERNEXTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONSOLESERVICE) - -DESCRIPTOR.services_by_name['ConsoleService'] = _CONSOLESERVICE - +_CONSOLESERVICE = DESCRIPTOR.services_by_name['ConsoleService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._options = None + _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._serialized_options = b'0\001' + _LOGSUBSCRIPTIONDATA.fields_by_name['micros']._options = None + _LOGSUBSCRIPTIONDATA.fields_by_name['micros']._serialized_options = b'0\001' + _FIGUREDESCRIPTOR.fields_by_name['update_interval']._options = None + _FIGUREDESCRIPTOR.fields_by_name['update_interval']._serialized_options = b'0\001' + _GETCONSOLETYPESREQUEST._serialized_start=169 + _GETCONSOLETYPESREQUEST._serialized_end=193 + _GETCONSOLETYPESRESPONSE._serialized_start=195 + _GETCONSOLETYPESRESPONSE._serialized_end=243 + _STARTCONSOLEREQUEST._serialized_start=245 + _STARTCONSOLEREQUEST._serialized_end=350 + _STARTCONSOLERESPONSE._serialized_start=352 + _STARTCONSOLERESPONSE._serialized_end=436 + _LOGSUBSCRIPTIONREQUEST._serialized_start=438 + _LOGSUBSCRIPTIONREQUEST._serialized_end=515 + _LOGSUBSCRIPTIONDATA._serialized_start=517 + _LOGSUBSCRIPTIONDATA._serialized_end=600 + _EXECUTECOMMANDREQUEST._serialized_start=602 + _EXECUTECOMMANDREQUEST._serialized_end=708 + _EXECUTECOMMANDRESPONSE._serialized_start=710 + _EXECUTECOMMANDRESPONSE._serialized_end=829 + _BINDTABLETOVARIABLEREQUEST._serialized_start=832 + _BINDTABLETOVARIABLEREQUEST._serialized_end=1013 + _BINDTABLETOVARIABLERESPONSE._serialized_start=1015 + _BINDTABLETOVARIABLERESPONSE._serialized_end=1044 + _CANCELCOMMANDREQUEST._serialized_start=1047 + _CANCELCOMMANDREQUEST._serialized_end=1195 + _CANCELCOMMANDRESPONSE._serialized_start=1197 + _CANCELCOMMANDRESPONSE._serialized_end=1220 + _AUTOCOMPLETEREQUEST._serialized_start=1223 + _AUTOCOMPLETEREQUEST._serialized_end=1626 + _AUTOCOMPLETERESPONSE._serialized_start=1629 + _AUTOCOMPLETERESPONSE._serialized_end=1761 + _BROWSERNEXTRESPONSE._serialized_start=1763 + _BROWSERNEXTRESPONSE._serialized_end=1784 + _OPENDOCUMENTREQUEST._serialized_start=1787 + _OPENDOCUMENTREQUEST._serialized_end=1954 + _TEXTDOCUMENTITEM._serialized_start=1956 + _TEXTDOCUMENTITEM._serialized_end=2039 + _CLOSEDOCUMENTREQUEST._serialized_start=2042 + _CLOSEDOCUMENTREQUEST._serialized_end=2225 + _CHANGEDOCUMENTREQUEST._serialized_start=2228 + _CHANGEDOCUMENTREQUEST._serialized_end=2676 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_start=2536 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_end=2676 + _DOCUMENTRANGE._serialized_start=2679 + _DOCUMENTRANGE._serialized_end=2826 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_start=2828 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_end=2891 + _POSITION._serialized_start=2893 + _POSITION._serialized_end=2936 + _GETCOMPLETIONITEMSREQUEST._serialized_start=2939 + _GETCOMPLETIONITEMSREQUEST._serialized_end=3295 + _COMPLETIONCONTEXT._serialized_start=3297 + _COMPLETIONCONTEXT._serialized_end=3365 + _GETCOMPLETIONITEMSRESPONSE._serialized_start=3368 + _GETCOMPLETIONITEMSRESPONSE._serialized_end=3506 + _COMPLETIONITEM._serialized_start=3509 + _COMPLETIONITEM._serialized_end=3912 + _TEXTEDIT._serialized_start=3914 + _TEXTEDIT._serialized_end=4010 + _FIGUREDESCRIPTOR._serialized_start=4013 + _FIGUREDESCRIPTOR._serialized_end=10226 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_start=4260 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_end=4945 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_start=4844 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_end=4935 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_start=4948 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_end=5586 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_start=5589 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_end=6977 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_start=6979 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_end=7079 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_start=7081 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_end=7181 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_start=7183 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_end=7277 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_start=7280 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_end=8342 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_start=8116 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_end=8158 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_start=8160 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_end=8227 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_start=8229 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_end=8295 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_start=8345 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_end=9225 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_start=8769 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_end=8814 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_start=8817 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_end=9065 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_start=9067 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_end=9120 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_start=9122 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_end=9225 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_start=9228 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_end=9410 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_start=9413 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_end=9721 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_start=9723 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_end=9822 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_start=9825 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_end=9991 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_start=9994 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_end=10204 + _CONSOLESERVICE._serialized_start=10229 + _CONSOLESERVICE._serialized_end=11636 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/inputtable_pb2.py b/py/client/pydeephaven/proto/inputtable_pb2.py index 037d7cb982a..8c36c164356 100644 --- a/py/client/pydeephaven/proto/inputtable_pb2.py +++ b/py/client/pydeephaven/proto/inputtable_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/inputtable.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -14,156 +15,14 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/inputtable.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n deephaven/proto/inputtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x92\x01\n\x0f\x41\x64\x64TableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12?\n\x0ctable_to_add\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x12\n\x10\x41\x64\x64TableResponse\"\x98\x01\n\x12\x44\x65leteTableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x0ftable_to_remove\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x15\n\x13\x44\x65leteTableResponse2\xa6\x02\n\x11InputTableService\x12\x81\x01\n\x14\x41\x64\x64TableToInputTable\x12\x32.io.deephaven.proto.backplane.grpc.AddTableRequest\x1a\x33.io.deephaven.proto.backplane.grpc.AddTableResponse\"\x00\x12\x8c\x01\n\x19\x44\x65leteTableFromInputTable\x12\x35.io.deephaven.proto.backplane.grpc.DeleteTableRequest\x1a\x36.io.deephaven.proto.backplane.grpc.DeleteTableResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,]) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n deephaven/proto/inputtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x92\x01\n\x0f\x41\x64\x64TableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12?\n\x0ctable_to_add\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x12\n\x10\x41\x64\x64TableResponse\"\x98\x01\n\x12\x44\x65leteTableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x0ftable_to_remove\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x15\n\x13\x44\x65leteTableResponse2\xa6\x02\n\x11InputTableService\x12\x81\x01\n\x14\x41\x64\x64TableToInputTable\x12\x32.io.deephaven.proto.backplane.grpc.AddTableRequest\x1a\x33.io.deephaven.proto.backplane.grpc.AddTableResponse\"\x00\x12\x8c\x01\n\x19\x44\x65leteTableFromInputTable\x12\x35.io.deephaven.proto.backplane.grpc.DeleteTableRequest\x1a\x36.io.deephaven.proto.backplane.grpc.DeleteTableResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') - -_ADDTABLEREQUEST = _descriptor.Descriptor( - name='AddTableRequest', - full_name='io.deephaven.proto.backplane.grpc.AddTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='input_table', full_name='io.deephaven.proto.backplane.grpc.AddTableRequest.input_table', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_to_add', full_name='io.deephaven.proto.backplane.grpc.AddTableRequest.table_to_add', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=102, - serialized_end=248, -) - - -_ADDTABLERESPONSE = _descriptor.Descriptor( - name='AddTableResponse', - full_name='io.deephaven.proto.backplane.grpc.AddTableResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=250, - serialized_end=268, -) - - -_DELETETABLEREQUEST = _descriptor.Descriptor( - name='DeleteTableRequest', - full_name='io.deephaven.proto.backplane.grpc.DeleteTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='input_table', full_name='io.deephaven.proto.backplane.grpc.DeleteTableRequest.input_table', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='table_to_remove', full_name='io.deephaven.proto.backplane.grpc.DeleteTableRequest.table_to_remove', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=271, - serialized_end=423, -) - - -_DELETETABLERESPONSE = _descriptor.Descriptor( - name='DeleteTableResponse', - full_name='io.deephaven.proto.backplane.grpc.DeleteTableResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=425, - serialized_end=446, -) - -_ADDTABLEREQUEST.fields_by_name['input_table'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_ADDTABLEREQUEST.fields_by_name['table_to_add'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_DELETETABLEREQUEST.fields_by_name['input_table'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_DELETETABLEREQUEST.fields_by_name['table_to_remove'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -DESCRIPTOR.message_types_by_name['AddTableRequest'] = _ADDTABLEREQUEST -DESCRIPTOR.message_types_by_name['AddTableResponse'] = _ADDTABLERESPONSE -DESCRIPTOR.message_types_by_name['DeleteTableRequest'] = _DELETETABLEREQUEST -DESCRIPTOR.message_types_by_name['DeleteTableResponse'] = _DELETETABLERESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_ADDTABLEREQUEST = DESCRIPTOR.message_types_by_name['AddTableRequest'] +_ADDTABLERESPONSE = DESCRIPTOR.message_types_by_name['AddTableResponse'] +_DELETETABLEREQUEST = DESCRIPTOR.message_types_by_name['DeleteTableRequest'] +_DELETETABLERESPONSE = DESCRIPTOR.message_types_by_name['DeleteTableResponse'] AddTableRequest = _reflection.GeneratedProtocolMessageType('AddTableRequest', (_message.Message,), { 'DESCRIPTOR' : _ADDTABLEREQUEST, '__module__' : 'pydeephaven.proto.inputtable_pb2' @@ -192,42 +51,19 @@ }) _sym_db.RegisterMessage(DeleteTableResponse) - -DESCRIPTOR._options = None - -_INPUTTABLESERVICE = _descriptor.ServiceDescriptor( - name='InputTableService', - full_name='io.deephaven.proto.backplane.grpc.InputTableService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=449, - serialized_end=743, - methods=[ - _descriptor.MethodDescriptor( - name='AddTableToInputTable', - full_name='io.deephaven.proto.backplane.grpc.InputTableService.AddTableToInputTable', - index=0, - containing_service=None, - input_type=_ADDTABLEREQUEST, - output_type=_ADDTABLERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteTableFromInputTable', - full_name='io.deephaven.proto.backplane.grpc.InputTableService.DeleteTableFromInputTable', - index=1, - containing_service=None, - input_type=_DELETETABLEREQUEST, - output_type=_DELETETABLERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_INPUTTABLESERVICE) - -DESCRIPTOR.services_by_name['InputTableService'] = _INPUTTABLESERVICE - +_INPUTTABLESERVICE = DESCRIPTOR.services_by_name['InputTableService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _ADDTABLEREQUEST._serialized_start=102 + _ADDTABLEREQUEST._serialized_end=248 + _ADDTABLERESPONSE._serialized_start=250 + _ADDTABLERESPONSE._serialized_end=268 + _DELETETABLEREQUEST._serialized_start=271 + _DELETETABLEREQUEST._serialized_end=423 + _DELETETABLERESPONSE._serialized_start=425 + _DELETETABLERESPONSE._serialized_end=446 + _INPUTTABLESERVICE._serialized_start=449 + _INPUTTABLESERVICE._serialized_end=743 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/object_pb2.py b/py/client/pydeephaven/proto/object_pb2.py index a1b47474e26..6ccfa855ae2 100644 --- a/py/client/pydeephaven/proto/object_pb2.py +++ b/py/client/pydeephaven/proto/object_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/object.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -14,102 +15,12 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/object.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1c\x64\x65\x65phaven/proto/object.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"W\n\x12\x46\x65tchObjectRequest\x12\x41\n\tsource_id\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\"z\n\x13\x46\x65tchObjectResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12G\n\x0ftyped_export_id\x18\x03 \x03(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket2\x8f\x01\n\rObjectService\x12~\n\x0b\x46\x65tchObject\x12\x35.io.deephaven.proto.backplane.grpc.FetchObjectRequest\x1a\x36.io.deephaven.proto.backplane.grpc.FetchObjectResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,]) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/object.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"W\n\x12\x46\x65tchObjectRequest\x12\x41\n\tsource_id\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\"z\n\x13\x46\x65tchObjectResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12G\n\x0ftyped_export_id\x18\x03 \x03(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket2\x8f\x01\n\rObjectService\x12~\n\x0b\x46\x65tchObject\x12\x35.io.deephaven.proto.backplane.grpc.FetchObjectRequest\x1a\x36.io.deephaven.proto.backplane.grpc.FetchObjectResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') - -_FETCHOBJECTREQUEST = _descriptor.Descriptor( - name='FetchObjectRequest', - full_name='io.deephaven.proto.backplane.grpc.FetchObjectRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FetchObjectRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=97, - serialized_end=184, -) - - -_FETCHOBJECTRESPONSE = _descriptor.Descriptor( - name='FetchObjectResponse', - full_name='io.deephaven.proto.backplane.grpc.FetchObjectResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.grpc.FetchObjectResponse.type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data', full_name='io.deephaven.proto.backplane.grpc.FetchObjectResponse.data', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='typed_export_id', full_name='io.deephaven.proto.backplane.grpc.FetchObjectResponse.typed_export_id', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=186, - serialized_end=308, -) - -_FETCHOBJECTREQUEST.fields_by_name['source_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TYPEDTICKET -_FETCHOBJECTRESPONSE.fields_by_name['typed_export_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TYPEDTICKET -DESCRIPTOR.message_types_by_name['FetchObjectRequest'] = _FETCHOBJECTREQUEST -DESCRIPTOR.message_types_by_name['FetchObjectResponse'] = _FETCHOBJECTRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_FETCHOBJECTREQUEST = DESCRIPTOR.message_types_by_name['FetchObjectRequest'] +_FETCHOBJECTRESPONSE = DESCRIPTOR.message_types_by_name['FetchObjectResponse'] FetchObjectRequest = _reflection.GeneratedProtocolMessageType('FetchObjectRequest', (_message.Message,), { 'DESCRIPTOR' : _FETCHOBJECTREQUEST, '__module__' : 'pydeephaven.proto.object_pb2' @@ -124,32 +35,15 @@ }) _sym_db.RegisterMessage(FetchObjectResponse) - -DESCRIPTOR._options = None - -_OBJECTSERVICE = _descriptor.ServiceDescriptor( - name='ObjectService', - full_name='io.deephaven.proto.backplane.grpc.ObjectService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=311, - serialized_end=454, - methods=[ - _descriptor.MethodDescriptor( - name='FetchObject', - full_name='io.deephaven.proto.backplane.grpc.ObjectService.FetchObject', - index=0, - containing_service=None, - input_type=_FETCHOBJECTREQUEST, - output_type=_FETCHOBJECTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_OBJECTSERVICE) - -DESCRIPTOR.services_by_name['ObjectService'] = _OBJECTSERVICE - +_OBJECTSERVICE = DESCRIPTOR.services_by_name['ObjectService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _FETCHOBJECTREQUEST._serialized_start=97 + _FETCHOBJECTREQUEST._serialized_end=184 + _FETCHOBJECTRESPONSE._serialized_start=186 + _FETCHOBJECTRESPONSE._serialized_end=308 + _OBJECTSERVICE._serialized_start=311 + _OBJECTSERVICE._serialized_end=454 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/partitionedtable_pb2.py b/py/client/pydeephaven/proto/partitionedtable_pb2.py new file mode 100644 index 00000000000..dab2d4943e2 --- /dev/null +++ b/py/client/pydeephaven/proto/partitionedtable_pb2.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: deephaven/proto/partitionedtable.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from pydeephaven.proto import table_pb2 as deephaven_dot_proto_dot_table__pb2 +from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&deephaven/proto/partitionedtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1b\x64\x65\x65phaven/proto/table.proto\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\xbc\x01\n\x12PartitionByRequest\x12;\n\x08table_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x18\n\x10key_column_names\x18\x03 \x03(\t\x12\x11\n\tdrop_keys\x18\x04 \x01(\x08\"\x15\n\x13PartitionByResponse\"\x92\x01\n\x0cMergeRequest\x12\x44\n\x11partitioned_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xda\x01\n\x0fGetTableRequest\x12\x44\n\x11partitioned_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x43\n\x10key_table_ticket\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xba\x01\n\x1aPartitionedTableDescriptor\x12\x18\n\x10key_column_names\x18\x01 \x03(\t\x12\x1f\n\x17\x63onstituent_column_name\x18\x04 \x01(\t\x12\x13\n\x0bunique_keys\x18\x02 \x01(\x08\x12%\n\x1d\x63onstituent_definition_schema\x18\x03 \x01(\x0c\x12%\n\x1d\x63onstituent_changes_permitted\x18\x05 \x01(\x08\x32\x96\x03\n\x17PartitionedTableService\x12|\n\x0bPartitionBy\x12\x35.io.deephaven.proto.backplane.grpc.PartitionByRequest\x1a\x36.io.deephaven.proto.backplane.grpc.PartitionByResponse\x12z\n\x05Merge\x12/.io.deephaven.proto.backplane.grpc.MergeRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\x12\x80\x01\n\x08GetTable\x12\x32.io.deephaven.proto.backplane.grpc.GetTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponseB\x04H\x01P\x01\x62\x06proto3') + + + +_PARTITIONBYREQUEST = DESCRIPTOR.message_types_by_name['PartitionByRequest'] +_PARTITIONBYRESPONSE = DESCRIPTOR.message_types_by_name['PartitionByResponse'] +_MERGEREQUEST = DESCRIPTOR.message_types_by_name['MergeRequest'] +_GETTABLEREQUEST = DESCRIPTOR.message_types_by_name['GetTableRequest'] +_PARTITIONEDTABLEDESCRIPTOR = DESCRIPTOR.message_types_by_name['PartitionedTableDescriptor'] +PartitionByRequest = _reflection.GeneratedProtocolMessageType('PartitionByRequest', (_message.Message,), { + 'DESCRIPTOR' : _PARTITIONBYREQUEST, + '__module__' : 'pydeephaven.proto.partitionedtable_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionByRequest) + }) +_sym_db.RegisterMessage(PartitionByRequest) + +PartitionByResponse = _reflection.GeneratedProtocolMessageType('PartitionByResponse', (_message.Message,), { + 'DESCRIPTOR' : _PARTITIONBYRESPONSE, + '__module__' : 'pydeephaven.proto.partitionedtable_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionByResponse) + }) +_sym_db.RegisterMessage(PartitionByResponse) + +MergeRequest = _reflection.GeneratedProtocolMessageType('MergeRequest', (_message.Message,), { + 'DESCRIPTOR' : _MERGEREQUEST, + '__module__' : 'pydeephaven.proto.partitionedtable_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MergeRequest) + }) +_sym_db.RegisterMessage(MergeRequest) + +GetTableRequest = _reflection.GeneratedProtocolMessageType('GetTableRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETTABLEREQUEST, + '__module__' : 'pydeephaven.proto.partitionedtable_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.GetTableRequest) + }) +_sym_db.RegisterMessage(GetTableRequest) + +PartitionedTableDescriptor = _reflection.GeneratedProtocolMessageType('PartitionedTableDescriptor', (_message.Message,), { + 'DESCRIPTOR' : _PARTITIONEDTABLEDESCRIPTOR, + '__module__' : 'pydeephaven.proto.partitionedtable_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + }) +_sym_db.RegisterMessage(PartitionedTableDescriptor) + +_PARTITIONEDTABLESERVICE = DESCRIPTOR.services_by_name['PartitionedTableService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _PARTITIONBYREQUEST._serialized_start=137 + _PARTITIONBYREQUEST._serialized_end=325 + _PARTITIONBYRESPONSE._serialized_start=327 + _PARTITIONBYRESPONSE._serialized_end=348 + _MERGEREQUEST._serialized_start=351 + _MERGEREQUEST._serialized_end=497 + _GETTABLEREQUEST._serialized_start=500 + _GETTABLEREQUEST._serialized_end=718 + _PARTITIONEDTABLEDESCRIPTOR._serialized_start=721 + _PARTITIONEDTABLEDESCRIPTOR._serialized_end=907 + _PARTITIONEDTABLESERVICE._serialized_start=910 + _PARTITIONEDTABLESERVICE._serialized_end=1316 +# @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/partitionedtable_pb2_grpc.py b/py/client/pydeephaven/proto/partitionedtable_pb2_grpc.py new file mode 100644 index 00000000000..b6b808c6799 --- /dev/null +++ b/py/client/pydeephaven/proto/partitionedtable_pb2_grpc.py @@ -0,0 +1,157 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from pydeephaven.proto import partitionedtable_pb2 as deephaven_dot_proto_dot_partitionedtable__pb2 +from pydeephaven.proto import table_pb2 as deephaven_dot_proto_dot_table__pb2 + + +class PartitionedTableServiceStub(object): + """ + This service provides tools to create and query partitioned tables. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.PartitionBy = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.PartitionedTableService/PartitionBy', + request_serializer=deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByResponse.FromString, + ) + self.Merge = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.PartitionedTableService/Merge', + request_serializer=deephaven_dot_proto_dot_partitionedtable__pb2.MergeRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + ) + self.GetTable = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.PartitionedTableService/GetTable', + request_serializer=deephaven_dot_proto_dot_partitionedtable__pb2.GetTableRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + ) + + +class PartitionedTableServiceServicer(object): + """ + This service provides tools to create and query partitioned tables. + """ + + def PartitionBy(self, request, context): + """ + Transforms a table into a partitioned table, consisting of many separate table, each individually + addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Merge(self, request, context): + """ + Given a partitioned table, returns a table with the contents of all of the constituent tables. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetTable(self, request, context): + """ + Given a partitioned table and a row described by another table's contents, returns a table + that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + more than one is present, FAILED_PRECONDITION will be sent in response. + + If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + sent in response. + + The simplest way to generally use this is to subscribe to the key columns of the underlying + table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + desired keys, and pass that ticket to this service. After that request is sent (note that it + is not required to wait for it to complete), that new table ticket can be used to make this + GetTable request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_PartitionedTableServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'PartitionBy': grpc.unary_unary_rpc_method_handler( + servicer.PartitionBy, + request_deserializer=deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByRequest.FromString, + response_serializer=deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByResponse.SerializeToString, + ), + 'Merge': grpc.unary_unary_rpc_method_handler( + servicer.Merge, + request_deserializer=deephaven_dot_proto_dot_partitionedtable__pb2.MergeRequest.FromString, + response_serializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.SerializeToString, + ), + 'GetTable': grpc.unary_unary_rpc_method_handler( + servicer.GetTable, + request_deserializer=deephaven_dot_proto_dot_partitionedtable__pb2.GetTableRequest.FromString, + response_serializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'io.deephaven.proto.backplane.grpc.PartitionedTableService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class PartitionedTableService(object): + """ + This service provides tools to create and query partitioned tables. + """ + + @staticmethod + def PartitionBy(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.PartitionedTableService/PartitionBy', + deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByRequest.SerializeToString, + deephaven_dot_proto_dot_partitionedtable__pb2.PartitionByResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Merge(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.PartitionedTableService/Merge', + deephaven_dot_proto_dot_partitionedtable__pb2.MergeRequest.SerializeToString, + deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetTable(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.PartitionedTableService/GetTable', + deephaven_dot_proto_dot_partitionedtable__pb2.GetTableRequest.SerializeToString, + deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/py/client/pydeephaven/proto/session_pb2.py b/py/client/pydeephaven/proto/session_pb2.py index b1703803e65..adf6c7c29ad 100644 --- a/py/client/pydeephaven/proto/session_pb2.py +++ b/py/client/pydeephaven/proto/session_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/session.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -14,559 +15,23 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/session.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\":\n\x10HandshakeRequest\x12\x15\n\rauth_protocol\x18\x01 \x01(\x11\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x96\x01\n\x11HandshakeResponse\x12\x17\n\x0fmetadata_header\x18\x01 \x01(\x0c\x12\x15\n\rsession_token\x18\x02 \x01(\x0c\x12&\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x02\x30\x01\x12)\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x02\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xb5\x07\n\x0eSessionService\x12y\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12\x82\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,]) - - - -_EXPORTNOTIFICATION_STATE = _descriptor.EnumDescriptor( - name='State', - full_name='io.deephaven.proto.backplane.grpc.ExportNotification.State', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PENDING', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PUBLISHING', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='QUEUED', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='RUNNING', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EXPORTED', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='RELEASED', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CANCELLED', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='FAILED', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEPENDENCY_FAILED', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEPENDENCY_NEVER_FOUND', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEPENDENCY_CANCELLED', index=11, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEPENDENCY_RELEASED', index=12, number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=825, - serialized_end=1056, -) -_sym_db.RegisterEnumDescriptor(_EXPORTNOTIFICATION_STATE) - - -_HANDSHAKEREQUEST = _descriptor.Descriptor( - name='HandshakeRequest', - full_name='io.deephaven.proto.backplane.grpc.HandshakeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='auth_protocol', full_name='io.deephaven.proto.backplane.grpc.HandshakeRequest.auth_protocol', index=0, - number=1, type=17, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='payload', full_name='io.deephaven.proto.backplane.grpc.HandshakeRequest.payload', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=98, - serialized_end=156, -) - - -_HANDSHAKERESPONSE = _descriptor.Descriptor( - name='HandshakeResponse', - full_name='io.deephaven.proto.backplane.grpc.HandshakeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='metadata_header', full_name='io.deephaven.proto.backplane.grpc.HandshakeResponse.metadata_header', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='session_token', full_name='io.deephaven.proto.backplane.grpc.HandshakeResponse.session_token', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='token_deadline_time_millis', full_name='io.deephaven.proto.backplane.grpc.HandshakeResponse.token_deadline_time_millis', index=2, - number=3, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='token_expiration_delay_millis', full_name='io.deephaven.proto.backplane.grpc.HandshakeResponse.token_expiration_delay_millis', index=3, - number=4, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=159, - serialized_end=309, -) - - -_CLOSESESSIONRESPONSE = _descriptor.Descriptor( - name='CloseSessionResponse', - full_name='io.deephaven.proto.backplane.grpc.CloseSessionResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=311, - serialized_end=333, -) - - -_RELEASEREQUEST = _descriptor.Descriptor( - name='ReleaseRequest', - full_name='io.deephaven.proto.backplane.grpc.ReleaseRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='io.deephaven.proto.backplane.grpc.ReleaseRequest.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=406, -) - - -_RELEASERESPONSE = _descriptor.Descriptor( - name='ReleaseResponse', - full_name='io.deephaven.proto.backplane.grpc.ReleaseResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=408, - serialized_end=425, -) - +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\":\n\x10HandshakeRequest\x12\x15\n\rauth_protocol\x18\x01 \x01(\x11\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x96\x01\n\x11HandshakeResponse\x12\x17\n\x0fmetadata_header\x18\x01 \x01(\x0c\x12\x15\n\rsession_token\x18\x02 \x01(\x0c\x12&\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x02\x30\x01\x12)\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x02\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xb5\x07\n\x0eSessionService\x12y\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12\x82\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') -_EXPORTREQUEST = _descriptor.Descriptor( - name='ExportRequest', - full_name='io.deephaven.proto.backplane.grpc.ExportRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.ExportRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.ExportRequest.result_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=428, - serialized_end=567, -) -_EXPORTRESPONSE = _descriptor.Descriptor( - name='ExportResponse', - full_name='io.deephaven.proto.backplane.grpc.ExportResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=569, - serialized_end=585, -) - - -_EXPORTNOTIFICATIONREQUEST = _descriptor.Descriptor( - name='ExportNotificationRequest', - full_name='io.deephaven.proto.backplane.grpc.ExportNotificationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=587, - serialized_end=614, -) - - -_EXPORTNOTIFICATION = _descriptor.Descriptor( - name='ExportNotification', - full_name='io.deephaven.proto.backplane.grpc.ExportNotification', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ticket', full_name='io.deephaven.proto.backplane.grpc.ExportNotification.ticket', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='export_state', full_name='io.deephaven.proto.backplane.grpc.ExportNotification.export_state', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context', full_name='io.deephaven.proto.backplane.grpc.ExportNotification.context', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='dependent_handle', full_name='io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _EXPORTNOTIFICATION_STATE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=617, - serialized_end=1056, -) - - -_TERMINATIONNOTIFICATIONREQUEST = _descriptor.Descriptor( - name='TerminationNotificationRequest', - full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1058, - serialized_end=1090, -) - - -_TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE = _descriptor.Descriptor( - name='StackTrace', - full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='message', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='elements', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.elements', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1311, - serialized_end=1372, -) - -_TERMINATIONNOTIFICATIONRESPONSE = _descriptor.Descriptor( - name='TerminationNotificationResponse', - full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='abnormal_termination', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.abnormal_termination', index=0, - number=1, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='reason', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_from_uncaught_exception', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.is_from_uncaught_exception', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stack_traces', full_name='io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.stack_traces', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1093, - serialized_end=1372, -) - -_RELEASEREQUEST.fields_by_name['id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXPORTREQUEST.fields_by_name['source_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXPORTREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXPORTNOTIFICATION.fields_by_name['ticket'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXPORTNOTIFICATION.fields_by_name['export_state'].enum_type = _EXPORTNOTIFICATION_STATE -_EXPORTNOTIFICATION_STATE.containing_type = _EXPORTNOTIFICATION -_TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE.containing_type = _TERMINATIONNOTIFICATIONRESPONSE -_TERMINATIONNOTIFICATIONRESPONSE.fields_by_name['stack_traces'].message_type = _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE -DESCRIPTOR.message_types_by_name['HandshakeRequest'] = _HANDSHAKEREQUEST -DESCRIPTOR.message_types_by_name['HandshakeResponse'] = _HANDSHAKERESPONSE -DESCRIPTOR.message_types_by_name['CloseSessionResponse'] = _CLOSESESSIONRESPONSE -DESCRIPTOR.message_types_by_name['ReleaseRequest'] = _RELEASEREQUEST -DESCRIPTOR.message_types_by_name['ReleaseResponse'] = _RELEASERESPONSE -DESCRIPTOR.message_types_by_name['ExportRequest'] = _EXPORTREQUEST -DESCRIPTOR.message_types_by_name['ExportResponse'] = _EXPORTRESPONSE -DESCRIPTOR.message_types_by_name['ExportNotificationRequest'] = _EXPORTNOTIFICATIONREQUEST -DESCRIPTOR.message_types_by_name['ExportNotification'] = _EXPORTNOTIFICATION -DESCRIPTOR.message_types_by_name['TerminationNotificationRequest'] = _TERMINATIONNOTIFICATIONREQUEST -DESCRIPTOR.message_types_by_name['TerminationNotificationResponse'] = _TERMINATIONNOTIFICATIONRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_HANDSHAKEREQUEST = DESCRIPTOR.message_types_by_name['HandshakeRequest'] +_HANDSHAKERESPONSE = DESCRIPTOR.message_types_by_name['HandshakeResponse'] +_CLOSESESSIONRESPONSE = DESCRIPTOR.message_types_by_name['CloseSessionResponse'] +_RELEASEREQUEST = DESCRIPTOR.message_types_by_name['ReleaseRequest'] +_RELEASERESPONSE = DESCRIPTOR.message_types_by_name['ReleaseResponse'] +_EXPORTREQUEST = DESCRIPTOR.message_types_by_name['ExportRequest'] +_EXPORTRESPONSE = DESCRIPTOR.message_types_by_name['ExportResponse'] +_EXPORTNOTIFICATIONREQUEST = DESCRIPTOR.message_types_by_name['ExportNotificationRequest'] +_EXPORTNOTIFICATION = DESCRIPTOR.message_types_by_name['ExportNotification'] +_TERMINATIONNOTIFICATIONREQUEST = DESCRIPTOR.message_types_by_name['TerminationNotificationRequest'] +_TERMINATIONNOTIFICATIONRESPONSE = DESCRIPTOR.message_types_by_name['TerminationNotificationResponse'] +_TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE = _TERMINATIONNOTIFICATIONRESPONSE.nested_types_by_name['StackTrace'] +_EXPORTNOTIFICATION_STATE = _EXPORTNOTIFICATION.enum_types_by_name['State'] HandshakeRequest = _reflection.GeneratedProtocolMessageType('HandshakeRequest', (_message.Message,), { 'DESCRIPTOR' : _HANDSHAKEREQUEST, '__module__' : 'pydeephaven.proto.session_pb2' @@ -652,94 +117,41 @@ _sym_db.RegisterMessage(TerminationNotificationResponse) _sym_db.RegisterMessage(TerminationNotificationResponse.StackTrace) - -DESCRIPTOR._options = None -_HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._options = None -_HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._options = None - -_SESSIONSERVICE = _descriptor.ServiceDescriptor( - name='SessionService', - full_name='io.deephaven.proto.backplane.grpc.SessionService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=1375, - serialized_end=2324, - methods=[ - _descriptor.MethodDescriptor( - name='NewSession', - full_name='io.deephaven.proto.backplane.grpc.SessionService.NewSession', - index=0, - containing_service=None, - input_type=_HANDSHAKEREQUEST, - output_type=_HANDSHAKERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RefreshSessionToken', - full_name='io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken', - index=1, - containing_service=None, - input_type=_HANDSHAKEREQUEST, - output_type=_HANDSHAKERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CloseSession', - full_name='io.deephaven.proto.backplane.grpc.SessionService.CloseSession', - index=2, - containing_service=None, - input_type=_HANDSHAKEREQUEST, - output_type=_CLOSESESSIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Release', - full_name='io.deephaven.proto.backplane.grpc.SessionService.Release', - index=3, - containing_service=None, - input_type=_RELEASEREQUEST, - output_type=_RELEASERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ExportFromTicket', - full_name='io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket', - index=4, - containing_service=None, - input_type=_EXPORTREQUEST, - output_type=_EXPORTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ExportNotifications', - full_name='io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications', - index=5, - containing_service=None, - input_type=_EXPORTNOTIFICATIONREQUEST, - output_type=_EXPORTNOTIFICATION, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='TerminationNotification', - full_name='io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification', - index=6, - containing_service=None, - input_type=_TERMINATIONNOTIFICATIONREQUEST, - output_type=_TERMINATIONNOTIFICATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_SESSIONSERVICE) - -DESCRIPTOR.services_by_name['SessionService'] = _SESSIONSERVICE - +_SESSIONSERVICE = DESCRIPTOR.services_by_name['SessionService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._options = None + _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._serialized_options = b'0\001' + _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._options = None + _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._serialized_options = b'0\001' + _HANDSHAKEREQUEST._serialized_start=98 + _HANDSHAKEREQUEST._serialized_end=156 + _HANDSHAKERESPONSE._serialized_start=159 + _HANDSHAKERESPONSE._serialized_end=309 + _CLOSESESSIONRESPONSE._serialized_start=311 + _CLOSESESSIONRESPONSE._serialized_end=333 + _RELEASEREQUEST._serialized_start=335 + _RELEASEREQUEST._serialized_end=406 + _RELEASERESPONSE._serialized_start=408 + _RELEASERESPONSE._serialized_end=425 + _EXPORTREQUEST._serialized_start=428 + _EXPORTREQUEST._serialized_end=567 + _EXPORTRESPONSE._serialized_start=569 + _EXPORTRESPONSE._serialized_end=585 + _EXPORTNOTIFICATIONREQUEST._serialized_start=587 + _EXPORTNOTIFICATIONREQUEST._serialized_end=614 + _EXPORTNOTIFICATION._serialized_start=617 + _EXPORTNOTIFICATION._serialized_end=1056 + _EXPORTNOTIFICATION_STATE._serialized_start=825 + _EXPORTNOTIFICATION_STATE._serialized_end=1056 + _TERMINATIONNOTIFICATIONREQUEST._serialized_start=1058 + _TERMINATIONNOTIFICATIONREQUEST._serialized_end=1090 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_start=1093 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_end=1372 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_start=1311 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_end=1372 + _SESSIONSERVICE._serialized_start=1375 + _SESSIONSERVICE._serialized_end=2324 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/table_pb2.py b/py/client/pydeephaven/proto/table_pb2.py index eff150d78ec..0a2c288ab58 100644 --- a/py/client/pydeephaven/proto/table_pb2.py +++ b/py/client/pydeephaven/proto/table_pb2.py @@ -4,6 +4,7 @@ """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -15,67 +16,11 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/table.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1b\x64\x65\x65phaven/proto/table.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"l\n\x0eTableReference\x12;\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketH\x00\x12\x16\n\x0c\x62\x61tch_offset\x18\x02 \x01(\x11H\x00\x42\x05\n\x03ref\"\xc6\x01\n\x1d\x45xportedTableCreationResponse\x12\x44\n\tresult_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\nerror_info\x18\x03 \x01(\t\x12\x15\n\rschema_header\x18\x04 \x01(\x0c\x12\x11\n\tis_static\x18\x05 \x01(\x08\x12\x10\n\x04size\x18\x06 \x01(\x12\x42\x02\x30\x01\"\x97\x01\n\x11\x46\x65tchTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xa0\x01\n\x1a\x41pplyPreviewColumnsRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9d\x01\n\x17\x46\x65tchPandasTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9a\x01\n\x14\x46\x65tchTableMapRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x46\x65tchTableMapResponse\"\x1d\n\x1b\x45xportedTableUpdatesRequest\"\x8c\x01\n\x1a\x45xportedTableUpdateMessage\x12<\n\texport_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x1e\n\x16update_failure_message\x18\x03 \x01(\t\"c\n\x11\x45mptyTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\"\x88\x01\n\x10TimeTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x1c\n\x10start_time_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x18\n\x0cperiod_nanos\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xb1\x01\n\x15SelectOrUpdateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_specs\x18\x03 \x03(\t\"\xb1\x01\n\x15SelectDistinctRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xae\x01\n\x12\x44ropColumnsRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xb5\x01\n\x1eUnstructuredFilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07\x66ilters\x18\x03 \x03(\t\"\xad\x01\n\x11HeadOrTailRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xce\x01\n\x13HeadOrTailByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x1d\n\x15group_by_column_specs\x18\x04 \x03(\t\"\xc3\x01\n\x0eUngroupRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x11\n\tnull_fill\x18\x03 \x01(\x08\x12\x1a\n\x12\x63olumns_to_ungroup\x18\x04 \x03(\t\"\xad\x01\n\x12MergeTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x45\n\nsource_ids\x18\x02 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x12\n\nkey_column\x18\x03 \x01(\t\"\x91\x02\n\x14SnapshotTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x1b\n\x13\x64o_initial_snapshot\x18\x04 \x01(\x08\x12\x15\n\rstamp_columns\x18\x05 \x03(\t\"\xa7\x02\n\x16\x43rossJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\x14\n\x0creserve_bits\x18\x06 \x01(\x05\"\x93\x02\n\x18NaturalJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x91\x02\n\x16\x45xactJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x90\x02\n\x15LeftJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\xc9\x03\n\x15\x41sOfJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\\\n\x10\x61s_of_match_rule\x18\x07 \x01(\x0e\x32\x42.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule\"Y\n\tMatchRule\x12\x13\n\x0fLESS_THAN_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12GREATER_THAN_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\"\xfa\x04\n\x15\x43omboAggregateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12V\n\naggregates\x18\x03 \x03(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate\x12\x18\n\x10group_by_columns\x18\x04 \x03(\t\x12\x13\n\x0b\x66orce_combo\x18\x05 \x01(\x08\x1a\xad\x01\n\tAggregate\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x12\x13\n\x0b\x63olumn_name\x18\x03 \x01(\t\x12\x12\n\npercentile\x18\x04 \x01(\x01\x12\x12\n\navg_median\x18\x05 \x01(\x08\"\xa5\x01\n\x07\x41ggType\x12\x07\n\x03SUM\x10\x00\x12\x0b\n\x07\x41\x42S_SUM\x10\x01\x12\t\n\x05GROUP\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\t\n\x05\x43OUNT\x10\x04\x12\t\n\x05\x46IRST\x10\x05\x12\x08\n\x04LAST\x10\x06\x12\x07\n\x03MIN\x10\x07\x12\x07\n\x03MAX\x10\x08\x12\n\n\x06MEDIAN\x10\t\x12\x0e\n\nPERCENTILE\x10\n\x12\x07\n\x03STD\x10\x0b\x12\x07\n\x03VAR\x10\x0c\x12\x10\n\x0cWEIGHTED_AVG\x10\r\"\xe1\x01\n\x0eSortDescriptor\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\x12\x13\n\x0bis_absolute\x18\x02 \x01(\x08\x12R\n\tdirection\x18\x03 \x01(\x0e\x32?.io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection\"Q\n\rSortDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\nDESCENDING\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\r\n\tASCENDING\x10\x01\x12\x0b\n\x07REVERSE\x10\x02\"\xd8\x01\n\x10SortTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12@\n\x05sorts\x18\x03 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.SortDescriptor\"\xd7\x01\n\x12\x46ilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12=\n\x07\x66ilters\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\" \n\tReference\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\"\x91\x01\n\x07Literal\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x18\n\nlong_value\x18\x04 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1d\n\x0fnano_time_value\x18\x05 \x01(\x12\x42\x02\x30\x01H\x00\x42\x07\n\x05value\"\x91\x01\n\x05Value\x12\x41\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.ReferenceH\x00\x12=\n\x07literal\x18\x02 \x01(\x0b\x32*.io.deephaven.proto.backplane.grpc.LiteralH\x00\x42\x06\n\x04\x64\x61ta\"\xbc\x05\n\tCondition\x12>\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\x91\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xae\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x42\x04\n\x02op*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xd5&\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\rFetchTableMap\x12\x37.io.deephaven.proto.backplane.grpc.FetchTableMapRequest\x1a\x38.io.deephaven.proto.backplane.grpc.FetchTableMapResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3' - , - dependencies=[deephaven_dot_proto_dot_ticket__pb2.DESCRIPTOR,]) - -_CASESENSITIVITY = _descriptor.EnumDescriptor( - name='CaseSensitivity', - full_name='io.deephaven.proto.backplane.grpc.CaseSensitivity', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='MATCH_CASE', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='IGNORE_CASE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=12761, - serialized_end=12811, -) -_sym_db.RegisterEnumDescriptor(_CASESENSITIVITY) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x64\x65\x65phaven/proto/table.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"l\n\x0eTableReference\x12;\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketH\x00\x12\x16\n\x0c\x62\x61tch_offset\x18\x02 \x01(\x11H\x00\x42\x05\n\x03ref\"\xc6\x01\n\x1d\x45xportedTableCreationResponse\x12\x44\n\tresult_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\nerror_info\x18\x03 \x01(\t\x12\x15\n\rschema_header\x18\x04 \x01(\x0c\x12\x11\n\tis_static\x18\x05 \x01(\x08\x12\x10\n\x04size\x18\x06 \x01(\x12\x42\x02\x30\x01\"\x97\x01\n\x11\x46\x65tchTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xa0\x01\n\x1a\x41pplyPreviewColumnsRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9d\x01\n\x17\x46\x65tchPandasTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x1d\n\x1b\x45xportedTableUpdatesRequest\"\x8c\x01\n\x1a\x45xportedTableUpdateMessage\x12<\n\texport_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x1e\n\x16update_failure_message\x18\x03 \x01(\t\"c\n\x11\x45mptyTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\"\x88\x01\n\x10TimeTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x1c\n\x10start_time_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x18\n\x0cperiod_nanos\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xb1\x01\n\x15SelectOrUpdateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_specs\x18\x03 \x03(\t\"\xb1\x01\n\x15SelectDistinctRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xae\x01\n\x12\x44ropColumnsRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xb5\x01\n\x1eUnstructuredFilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07\x66ilters\x18\x03 \x03(\t\"\xad\x01\n\x11HeadOrTailRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xce\x01\n\x13HeadOrTailByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x1d\n\x15group_by_column_specs\x18\x04 \x03(\t\"\xc3\x01\n\x0eUngroupRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x11\n\tnull_fill\x18\x03 \x01(\x08\x12\x1a\n\x12\x63olumns_to_ungroup\x18\x04 \x03(\t\"\xad\x01\n\x12MergeTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x45\n\nsource_ids\x18\x02 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x12\n\nkey_column\x18\x03 \x01(\t\"\x91\x02\n\x14SnapshotTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x1b\n\x13\x64o_initial_snapshot\x18\x04 \x01(\x08\x12\x15\n\rstamp_columns\x18\x05 \x03(\t\"\xa7\x02\n\x16\x43rossJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\x14\n\x0creserve_bits\x18\x06 \x01(\x05\"\x93\x02\n\x18NaturalJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x91\x02\n\x16\x45xactJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x90\x02\n\x15LeftJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\xc9\x03\n\x15\x41sOfJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\\\n\x10\x61s_of_match_rule\x18\x07 \x01(\x0e\x32\x42.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule\"Y\n\tMatchRule\x12\x13\n\x0fLESS_THAN_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12GREATER_THAN_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\"\xfa\x04\n\x15\x43omboAggregateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12V\n\naggregates\x18\x03 \x03(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate\x12\x18\n\x10group_by_columns\x18\x04 \x03(\t\x12\x13\n\x0b\x66orce_combo\x18\x05 \x01(\x08\x1a\xad\x01\n\tAggregate\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x12\x13\n\x0b\x63olumn_name\x18\x03 \x01(\t\x12\x12\n\npercentile\x18\x04 \x01(\x01\x12\x12\n\navg_median\x18\x05 \x01(\x08\"\xa5\x01\n\x07\x41ggType\x12\x07\n\x03SUM\x10\x00\x12\x0b\n\x07\x41\x42S_SUM\x10\x01\x12\t\n\x05GROUP\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\t\n\x05\x43OUNT\x10\x04\x12\t\n\x05\x46IRST\x10\x05\x12\x08\n\x04LAST\x10\x06\x12\x07\n\x03MIN\x10\x07\x12\x07\n\x03MAX\x10\x08\x12\n\n\x06MEDIAN\x10\t\x12\x0e\n\nPERCENTILE\x10\n\x12\x07\n\x03STD\x10\x0b\x12\x07\n\x03VAR\x10\x0c\x12\x10\n\x0cWEIGHTED_AVG\x10\r\"\xe1\x01\n\x0eSortDescriptor\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\x12\x13\n\x0bis_absolute\x18\x02 \x01(\x08\x12R\n\tdirection\x18\x03 \x01(\x0e\x32?.io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection\"Q\n\rSortDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\nDESCENDING\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\r\n\tASCENDING\x10\x01\x12\x0b\n\x07REVERSE\x10\x02\"\xd8\x01\n\x10SortTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12@\n\x05sorts\x18\x03 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.SortDescriptor\"\xd7\x01\n\x12\x46ilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12=\n\x07\x66ilters\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\" \n\tReference\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\"\x91\x01\n\x07Literal\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x18\n\nlong_value\x18\x04 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1d\n\x0fnano_time_value\x18\x05 \x01(\x12\x42\x02\x30\x01H\x00\x42\x07\n\x05value\"\x91\x01\n\x05Value\x12\x41\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.ReferenceH\x00\x12=\n\x07literal\x18\x02 \x01(\x0b\x32*.io.deephaven.proto.backplane.grpc.LiteralH\x00\x42\x06\n\x04\x64\x61ta\"\xbc\x05\n\tCondition\x12>\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\x91\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xae\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x42\x04\n\x02op*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xce%\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3') +_CASESENSITIVITY = DESCRIPTOR.enum_types_by_name['CaseSensitivity'] CaseSensitivity = enum_type_wrapper.EnumTypeWrapper(_CASESENSITIVITY) -_MATCHTYPE = _descriptor.EnumDescriptor( - name='MatchType', - full_name='io.deephaven.proto.backplane.grpc.MatchType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='REGULAR', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='INVERTED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=12813, - serialized_end=12851, -) -_sym_db.RegisterEnumDescriptor(_MATCHTYPE) - +_MATCHTYPE = DESCRIPTOR.enum_types_by_name['MatchType'] MatchType = enum_type_wrapper.EnumTypeWrapper(_MATCHTYPE) MATCH_CASE = 0 IGNORE_CASE = 1 @@ -83,3288 +28,61 @@ INVERTED = 1 -_ASOFJOINTABLESREQUEST_MATCHRULE = _descriptor.EnumDescriptor( - name='MatchRule', - full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='LESS_THAN_EQUAL', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LESS_THAN', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GREATER_THAN_EQUAL', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GREATER_THAN', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4732, - serialized_end=4821, -) -_sym_db.RegisterEnumDescriptor(_ASOFJOINTABLESREQUEST_MATCHRULE) - -_COMBOAGGREGATEREQUEST_AGGTYPE = _descriptor.EnumDescriptor( - name='AggType', - full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SUM', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='ABS_SUM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GROUP', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='AVG', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='COUNT', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='FIRST', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LAST', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MIN', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MAX', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MEDIAN', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PERCENTILE', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STD', index=11, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='VAR', index=12, number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='WEIGHTED_AVG', index=13, number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=5293, - serialized_end=5458, -) -_sym_db.RegisterEnumDescriptor(_COMBOAGGREGATEREQUEST_AGGTYPE) - -_SORTDESCRIPTOR_SORTDIRECTION = _descriptor.EnumDescriptor( - name='SortDirection', - full_name='io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DESCENDING', index=1, number=-1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='ASCENDING', index=2, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='REVERSE', index=3, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=5605, - serialized_end=5686, -) -_sym_db.RegisterEnumDescriptor(_SORTDESCRIPTOR_SORTDIRECTION) - -_COMPARECONDITION_COMPAREOPERATION = _descriptor.EnumDescriptor( - name='CompareOperation', - full_name='io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='LESS_THAN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LESS_THAN_OR_EQUAL', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GREATER_THAN', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GREATER_THAN_OR_EQUAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EQUALS', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='NOT_EQUALS', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=7692, - serialized_end=7822, -) -_sym_db.RegisterEnumDescriptor(_COMPARECONDITION_COMPAREOPERATION) - - -_TABLEREFERENCE = _descriptor.Descriptor( - name='TableReference', - full_name='io.deephaven.proto.backplane.grpc.TableReference', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ticket', full_name='io.deephaven.proto.backplane.grpc.TableReference.ticket', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='batch_offset', full_name='io.deephaven.proto.backplane.grpc.TableReference.batch_offset', index=1, - number=2, type=17, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='ref', full_name='io.deephaven.proto.backplane.grpc.TableReference.ref', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=96, - serialized_end=204, -) - - -_EXPORTEDTABLECREATIONRESPONSE = _descriptor.Descriptor( - name='ExportedTableCreationResponse', - full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='success', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.success', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='error_info', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='schema_header', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.schema_header', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_static', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.is_static', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='size', full_name='io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.size', index=5, - number=6, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=207, - serialized_end=405, -) - - -_FETCHTABLEREQUEST = _descriptor.Descriptor( - name='FetchTableRequest', - full_name='io.deephaven.proto.backplane.grpc.FetchTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FetchTableRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.FetchTableRequest.result_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=408, - serialized_end=559, -) - - -_APPLYPREVIEWCOLUMNSREQUEST = _descriptor.Descriptor( - name='ApplyPreviewColumnsRequest', - full_name='io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.result_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=562, - serialized_end=722, -) - - -_FETCHPANDASTABLEREQUEST = _descriptor.Descriptor( - name='FetchPandasTableRequest', - full_name='io.deephaven.proto.backplane.grpc.FetchPandasTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.result_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=725, - serialized_end=882, -) - - -_FETCHTABLEMAPREQUEST = _descriptor.Descriptor( - name='FetchTableMapRequest', - full_name='io.deephaven.proto.backplane.grpc.FetchTableMapRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=885, - serialized_end=1039, -) - - -_FETCHTABLEMAPRESPONSE = _descriptor.Descriptor( - name='FetchTableMapResponse', - full_name='io.deephaven.proto.backplane.grpc.FetchTableMapResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1041, - serialized_end=1064, -) - - -_EXPORTEDTABLEUPDATESREQUEST = _descriptor.Descriptor( - name='ExportedTableUpdatesRequest', - full_name='io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1066, - serialized_end=1095, -) - - -_EXPORTEDTABLEUPDATEMESSAGE = _descriptor.Descriptor( - name='ExportedTableUpdateMessage', - full_name='io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='export_id', full_name='io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.export_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='size', full_name='io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.size', index=1, - number=2, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='update_failure_message', full_name='io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1098, - serialized_end=1238, -) - - -_EMPTYTABLEREQUEST = _descriptor.Descriptor( - name='EmptyTableRequest', - full_name='io.deephaven.proto.backplane.grpc.EmptyTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.EmptyTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='size', full_name='io.deephaven.proto.backplane.grpc.EmptyTableRequest.size', index=1, - number=2, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1240, - serialized_end=1339, -) - - -_TIMETABLEREQUEST = _descriptor.Descriptor( - name='TimeTableRequest', - full_name='io.deephaven.proto.backplane.grpc.TimeTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.TimeTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='start_time_nanos', full_name='io.deephaven.proto.backplane.grpc.TimeTableRequest.start_time_nanos', index=1, - number=2, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='period_nanos', full_name='io.deephaven.proto.backplane.grpc.TimeTableRequest.period_nanos', index=2, - number=3, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1342, - serialized_end=1478, -) - - -_SELECTORUPDATEREQUEST = _descriptor.Descriptor( - name='SelectOrUpdateRequest', - full_name='io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_specs', full_name='io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.column_specs', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1481, - serialized_end=1658, -) - - -_SELECTDISTINCTREQUEST = _descriptor.Descriptor( - name='SelectDistinctRequest', - full_name='io.deephaven.proto.backplane.grpc.SelectDistinctRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.SelectDistinctRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.SelectDistinctRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_names', full_name='io.deephaven.proto.backplane.grpc.SelectDistinctRequest.column_names', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1661, - serialized_end=1838, -) - - -_DROPCOLUMNSREQUEST = _descriptor.Descriptor( - name='DropColumnsRequest', - full_name='io.deephaven.proto.backplane.grpc.DropColumnsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.DropColumnsRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.DropColumnsRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_names', full_name='io.deephaven.proto.backplane.grpc.DropColumnsRequest.column_names', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1841, - serialized_end=2015, -) - - -_UNSTRUCTUREDFILTERTABLEREQUEST = _descriptor.Descriptor( - name='UnstructuredFilterTableRequest', - full_name='io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filters', full_name='io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.filters', index=2, - number=3, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2018, - serialized_end=2199, -) - - -_HEADORTAILREQUEST = _descriptor.Descriptor( - name='HeadOrTailRequest', - full_name='io.deephaven.proto.backplane.grpc.HeadOrTailRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='num_rows', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailRequest.num_rows', index=2, - number=3, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2202, - serialized_end=2375, -) - - -_HEADORTAILBYREQUEST = _descriptor.Descriptor( - name='HeadOrTailByRequest', - full_name='io.deephaven.proto.backplane.grpc.HeadOrTailByRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='num_rows', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.num_rows', index=2, - number=3, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='group_by_column_specs', full_name='io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.group_by_column_specs', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2378, - serialized_end=2584, -) - - -_UNGROUPREQUEST = _descriptor.Descriptor( - name='UngroupRequest', - full_name='io.deephaven.proto.backplane.grpc.UngroupRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.UngroupRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.UngroupRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='null_fill', full_name='io.deephaven.proto.backplane.grpc.UngroupRequest.null_fill', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_ungroup', full_name='io.deephaven.proto.backplane.grpc.UngroupRequest.columns_to_ungroup', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2587, - serialized_end=2782, -) - - -_MERGETABLESREQUEST = _descriptor.Descriptor( - name='MergeTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.MergeTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.MergeTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_ids', full_name='io.deephaven.proto.backplane.grpc.MergeTablesRequest.source_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='key_column', full_name='io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2785, - serialized_end=2958, -) - - -_SNAPSHOTTABLEREQUEST = _descriptor.Descriptor( - name='SnapshotTableRequest', - full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='do_initial_snapshot', full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest.do_initial_snapshot', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stamp_columns', full_name='io.deephaven.proto.backplane.grpc.SnapshotTableRequest.stamp_columns', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2961, - serialized_end=3234, -) - - -_CROSSJOINTABLESREQUEST = _descriptor.Descriptor( - name='CrossJoinTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_match', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_match', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_add', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_add', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='reserve_bits', full_name='io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.reserve_bits', index=5, - number=6, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3237, - serialized_end=3532, -) - - -_NATURALJOINTABLESREQUEST = _descriptor.Descriptor( - name='NaturalJoinTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_match', full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_match', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_add', full_name='io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_add', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3535, - serialized_end=3810, -) - - -_EXACTJOINTABLESREQUEST = _descriptor.Descriptor( - name='ExactJoinTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_match', full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_match', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_add', full_name='io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_add', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3813, - serialized_end=4086, -) - - -_LEFTJOINTABLESREQUEST = _descriptor.Descriptor( - name='LeftJoinTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_match', full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_match', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_add', full_name='io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_add', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4089, - serialized_end=4361, -) - - -_ASOFJOINTABLESREQUEST = _descriptor.Descriptor( - name='AsOfJoinTablesRequest', - full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_id', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.left_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='right_id', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.right_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_match', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_match', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='columns_to_add', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_add', index=4, - number=5, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='as_of_match_rule', full_name='io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.as_of_match_rule', index=5, - number=7, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _ASOFJOINTABLESREQUEST_MATCHRULE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4364, - serialized_end=4821, -) - - -_COMBOAGGREGATEREQUEST_AGGREGATE = _descriptor.Descriptor( - name='Aggregate', - full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='match_pairs', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.match_pairs', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='column_name', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='percentile', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.percentile', index=3, - number=4, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='avg_median', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.avg_median', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5117, - serialized_end=5290, -) - -_COMBOAGGREGATEREQUEST = _descriptor.Descriptor( - name='ComboAggregateRequest', - full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='aggregates', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.aggregates', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='group_by_columns', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.group_by_columns', index=3, - number=4, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='force_combo', full_name='io.deephaven.proto.backplane.grpc.ComboAggregateRequest.force_combo', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_COMBOAGGREGATEREQUEST_AGGREGATE, ], - enum_types=[ - _COMBOAGGREGATEREQUEST_AGGTYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4824, - serialized_end=5458, -) - - -_SORTDESCRIPTOR = _descriptor.Descriptor( - name='SortDescriptor', - full_name='io.deephaven.proto.backplane.grpc.SortDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='column_name', full_name='io.deephaven.proto.backplane.grpc.SortDescriptor.column_name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_absolute', full_name='io.deephaven.proto.backplane.grpc.SortDescriptor.is_absolute', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='direction', full_name='io.deephaven.proto.backplane.grpc.SortDescriptor.direction', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _SORTDESCRIPTOR_SORTDIRECTION, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5461, - serialized_end=5686, -) - - -_SORTTABLEREQUEST = _descriptor.Descriptor( - name='SortTableRequest', - full_name='io.deephaven.proto.backplane.grpc.SortTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.SortTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.SortTableRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sorts', full_name='io.deephaven.proto.backplane.grpc.SortTableRequest.sorts', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5689, - serialized_end=5905, -) - - -_FILTERTABLEREQUEST = _descriptor.Descriptor( - name='FilterTableRequest', - full_name='io.deephaven.proto.backplane.grpc.FilterTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.FilterTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FilterTableRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filters', full_name='io.deephaven.proto.backplane.grpc.FilterTableRequest.filters', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5908, - serialized_end=6123, -) - - -_REFERENCE = _descriptor.Descriptor( - name='Reference', - full_name='io.deephaven.proto.backplane.grpc.Reference', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='column_name', full_name='io.deephaven.proto.backplane.grpc.Reference.column_name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6125, - serialized_end=6157, -) - - -_LITERAL = _descriptor.Descriptor( - name='Literal', - full_name='io.deephaven.proto.backplane.grpc.Literal', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='string_value', full_name='io.deephaven.proto.backplane.grpc.Literal.string_value', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='double_value', full_name='io.deephaven.proto.backplane.grpc.Literal.double_value', index=1, - number=2, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='bool_value', full_name='io.deephaven.proto.backplane.grpc.Literal.bool_value', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='long_value', full_name='io.deephaven.proto.backplane.grpc.Literal.long_value', index=3, - number=4, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='nano_time_value', full_name='io.deephaven.proto.backplane.grpc.Literal.nano_time_value', index=4, - number=5, type=18, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='io.deephaven.proto.backplane.grpc.Literal.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=6160, - serialized_end=6305, -) - - -_VALUE = _descriptor.Descriptor( - name='Value', - full_name='io.deephaven.proto.backplane.grpc.Value', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='reference', full_name='io.deephaven.proto.backplane.grpc.Value.reference', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='literal', full_name='io.deephaven.proto.backplane.grpc.Value.literal', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='data', full_name='io.deephaven.proto.backplane.grpc.Value.data', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=6308, - serialized_end=6453, -) - - -_CONDITION = _descriptor.Descriptor( - name='Condition', - full_name='io.deephaven.proto.backplane.grpc.Condition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='and', full_name='io.deephaven.proto.backplane.grpc.Condition.and', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='or', full_name='io.deephaven.proto.backplane.grpc.Condition.or', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='not', full_name='io.deephaven.proto.backplane.grpc.Condition.not', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='compare', full_name='io.deephaven.proto.backplane.grpc.Condition.compare', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='in', full_name='io.deephaven.proto.backplane.grpc.Condition.in', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='invoke', full_name='io.deephaven.proto.backplane.grpc.Condition.invoke', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_null', full_name='io.deephaven.proto.backplane.grpc.Condition.is_null', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='matches', full_name='io.deephaven.proto.backplane.grpc.Condition.matches', index=7, - number=8, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='contains', full_name='io.deephaven.proto.backplane.grpc.Condition.contains', index=8, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='search', full_name='io.deephaven.proto.backplane.grpc.Condition.search', index=9, - number=10, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='data', full_name='io.deephaven.proto.backplane.grpc.Condition.data', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=6456, - serialized_end=7156, -) - - -_ANDCONDITION = _descriptor.Descriptor( - name='AndCondition', - full_name='io.deephaven.proto.backplane.grpc.AndCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='filters', full_name='io.deephaven.proto.backplane.grpc.AndCondition.filters', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7158, - serialized_end=7235, -) - - -_ORCONDITION = _descriptor.Descriptor( - name='OrCondition', - full_name='io.deephaven.proto.backplane.grpc.OrCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='filters', full_name='io.deephaven.proto.backplane.grpc.OrCondition.filters', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7237, - serialized_end=7313, -) - - -_NOTCONDITION = _descriptor.Descriptor( - name='NotCondition', - full_name='io.deephaven.proto.backplane.grpc.NotCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='filter', full_name='io.deephaven.proto.backplane.grpc.NotCondition.filter', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7315, - serialized_end=7391, -) - - -_COMPARECONDITION = _descriptor.Descriptor( - name='CompareCondition', - full_name='io.deephaven.proto.backplane.grpc.CompareCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='operation', full_name='io.deephaven.proto.backplane.grpc.CompareCondition.operation', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='case_sensitivity', full_name='io.deephaven.proto.backplane.grpc.CompareCondition.case_sensitivity', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='lhs', full_name='io.deephaven.proto.backplane.grpc.CompareCondition.lhs', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='rhs', full_name='io.deephaven.proto.backplane.grpc.CompareCondition.rhs', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _COMPARECONDITION_COMPAREOPERATION, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7394, - serialized_end=7822, -) - - -_INCONDITION = _descriptor.Descriptor( - name='InCondition', - full_name='io.deephaven.proto.backplane.grpc.InCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='target', full_name='io.deephaven.proto.backplane.grpc.InCondition.target', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='candidates', full_name='io.deephaven.proto.backplane.grpc.InCondition.candidates', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='case_sensitivity', full_name='io.deephaven.proto.backplane.grpc.InCondition.case_sensitivity', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='match_type', full_name='io.deephaven.proto.backplane.grpc.InCondition.match_type', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7825, - serialized_end=8102, -) - - -_INVOKECONDITION = _descriptor.Descriptor( - name='InvokeCondition', - full_name='io.deephaven.proto.backplane.grpc.InvokeCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='method', full_name='io.deephaven.proto.backplane.grpc.InvokeCondition.method', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='target', full_name='io.deephaven.proto.backplane.grpc.InvokeCondition.target', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='arguments', full_name='io.deephaven.proto.backplane.grpc.InvokeCondition.arguments', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8105, - serialized_end=8257, -) - - -_ISNULLCONDITION = _descriptor.Descriptor( - name='IsNullCondition', - full_name='io.deephaven.proto.backplane.grpc.IsNullCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='reference', full_name='io.deephaven.proto.backplane.grpc.IsNullCondition.reference', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8259, - serialized_end=8341, -) - - -_MATCHESCONDITION = _descriptor.Descriptor( - name='MatchesCondition', - full_name='io.deephaven.proto.backplane.grpc.MatchesCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='reference', full_name='io.deephaven.proto.backplane.grpc.MatchesCondition.reference', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='regex', full_name='io.deephaven.proto.backplane.grpc.MatchesCondition.regex', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='case_sensitivity', full_name='io.deephaven.proto.backplane.grpc.MatchesCondition.case_sensitivity', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='match_type', full_name='io.deephaven.proto.backplane.grpc.MatchesCondition.match_type', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8344, - serialized_end=8586, -) - - -_CONTAINSCONDITION = _descriptor.Descriptor( - name='ContainsCondition', - full_name='io.deephaven.proto.backplane.grpc.ContainsCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='reference', full_name='io.deephaven.proto.backplane.grpc.ContainsCondition.reference', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='search_string', full_name='io.deephaven.proto.backplane.grpc.ContainsCondition.search_string', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='case_sensitivity', full_name='io.deephaven.proto.backplane.grpc.ContainsCondition.case_sensitivity', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='match_type', full_name='io.deephaven.proto.backplane.grpc.ContainsCondition.match_type', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8589, - serialized_end=8840, -) - - -_SEARCHCONDITION = _descriptor.Descriptor( - name='SearchCondition', - full_name='io.deephaven.proto.backplane.grpc.SearchCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='search_string', full_name='io.deephaven.proto.backplane.grpc.SearchCondition.search_string', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='optional_references', full_name='io.deephaven.proto.backplane.grpc.SearchCondition.optional_references', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8842, - serialized_end=8957, -) - - -_FLATTENREQUEST = _descriptor.Descriptor( - name='FlattenRequest', - full_name='io.deephaven.proto.backplane.grpc.FlattenRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.FlattenRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.FlattenRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8960, - serialized_end=9108, -) - - -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE = _descriptor.Descriptor( - name='ZoomRange', - full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='min_date_nanos', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.min_date_nanos', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='max_date_nanos', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.max_date_nanos', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_min_date_nanos', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange._min_date_nanos', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_max_date_nanos', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange._max_date_nanos', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=9432, - serialized_end=9547, -) - -_RUNCHARTDOWNSAMPLEREQUEST = _descriptor.Descriptor( - name='RunChartDownsampleRequest', - full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_id', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.source_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='pixel_count', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.pixel_count', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='zoom_range', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.zoom_range', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='x_column_name', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='y_column_names', full_name='io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.y_column_names', index=5, - number=6, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9111, - serialized_end=9547, -) - - -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY = _descriptor.Descriptor( - name='InMemoryAppendOnly', - full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10095, - serialized_end=10115, -) - -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED = _descriptor.Descriptor( - name='InMemoryKeyBacked', - full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key_columns', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked.key_columns', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10117, - serialized_end=10157, -) - -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND = _descriptor.Descriptor( - name='InputTableKind', - full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='in_memory_append_only', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_append_only', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='in_memory_key_backed', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_key_backed', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY, _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='kind', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.kind', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=9825, - serialized_end=10165, -) - -_CREATEINPUTTABLEREQUEST = _descriptor.Descriptor( - name='CreateInputTableRequest', - full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='result_id', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.result_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_table_id', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.source_table_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='schema', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.schema', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kind', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.kind', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='definition', full_name='io.deephaven.proto.backplane.grpc.CreateInputTableRequest.definition', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=9550, - serialized_end=10179, -) - - -_BATCHTABLEREQUEST_OPERATION = _descriptor.Descriptor( - name='Operation', - full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='empty_table', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.empty_table', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_table', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.time_table', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='drop_columns', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.drop_columns', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='update', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='lazy_update', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.lazy_update', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='view', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.view', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='update_view', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_view', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='select', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select', index=7, - number=8, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='select_distinct', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select_distinct', index=8, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.filter', index=9, - number=10, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='unstructured_filter', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.unstructured_filter', index=10, - number=11, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sort', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.sort', index=11, - number=12, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='head', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head', index=12, - number=13, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tail', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail', index=13, - number=14, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='head_by', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head_by', index=14, - number=15, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tail_by', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail_by', index=15, - number=16, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ungroup', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.ungroup', index=16, - number=17, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='merge', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.merge', index=17, - number=18, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='combo_aggregate', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.combo_aggregate', index=18, - number=19, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='snapshot', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.snapshot', index=19, - number=20, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flatten', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.flatten', index=20, - number=21, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='run_chart_downsample', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.run_chart_downsample', index=21, - number=22, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='cross_join', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.cross_join', index=22, - number=23, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='natural_join', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.natural_join', index=23, - number=24, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='exact_join', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.exact_join', index=24, - number=25, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='left_join', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.left_join', index=25, - number=26, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='as_of_join', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.as_of_join', index=26, - number=27, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='fetch_table', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_table', index=27, - number=28, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='fetch_pandas_table', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_pandas_table', index=28, - number=29, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='apply_preview_columns', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.apply_preview_columns', index=29, - number=30, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='create_input_table', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.create_input_table', index=30, - number=31, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='op', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.op', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=10281, - serialized_end=12759, -) - -_BATCHTABLEREQUEST = _descriptor.Descriptor( - name='BatchTableRequest', - full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ops', full_name='io.deephaven.proto.backplane.grpc.BatchTableRequest.ops', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_BATCHTABLEREQUEST_OPERATION, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10182, - serialized_end=12759, -) - -_TABLEREFERENCE.fields_by_name['ticket'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_TABLEREFERENCE.oneofs_by_name['ref'].fields.append( - _TABLEREFERENCE.fields_by_name['ticket']) -_TABLEREFERENCE.fields_by_name['ticket'].containing_oneof = _TABLEREFERENCE.oneofs_by_name['ref'] -_TABLEREFERENCE.oneofs_by_name['ref'].fields.append( - _TABLEREFERENCE.fields_by_name['batch_offset']) -_TABLEREFERENCE.fields_by_name['batch_offset'].containing_oneof = _TABLEREFERENCE.oneofs_by_name['ref'] -_EXPORTEDTABLECREATIONRESPONSE.fields_by_name['result_id'].message_type = _TABLEREFERENCE -_FETCHTABLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_FETCHTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_APPLYPREVIEWCOLUMNSREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_APPLYPREVIEWCOLUMNSREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_FETCHPANDASTABLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_FETCHPANDASTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_FETCHTABLEMAPREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_FETCHTABLEMAPREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXPORTEDTABLEUPDATEMESSAGE.fields_by_name['export_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EMPTYTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_TIMETABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_SELECTORUPDATEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_SELECTORUPDATEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_SELECTDISTINCTREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_SELECTDISTINCTREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_DROPCOLUMNSREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_DROPCOLUMNSREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_UNSTRUCTUREDFILTERTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_UNSTRUCTUREDFILTERTABLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_HEADORTAILREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_HEADORTAILREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_HEADORTAILBYREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_HEADORTAILBYREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_UNGROUPREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_UNGROUPREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_MERGETABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_MERGETABLESREQUEST.fields_by_name['source_ids'].message_type = _TABLEREFERENCE -_SNAPSHOTTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_SNAPSHOTTABLEREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_SNAPSHOTTABLEREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_CROSSJOINTABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CROSSJOINTABLESREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_CROSSJOINTABLESREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_NATURALJOINTABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_NATURALJOINTABLESREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_NATURALJOINTABLESREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_EXACTJOINTABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_EXACTJOINTABLESREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_EXACTJOINTABLESREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_LEFTJOINTABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_LEFTJOINTABLESREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_LEFTJOINTABLESREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_ASOFJOINTABLESREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_ASOFJOINTABLESREQUEST.fields_by_name['left_id'].message_type = _TABLEREFERENCE -_ASOFJOINTABLESREQUEST.fields_by_name['right_id'].message_type = _TABLEREFERENCE -_ASOFJOINTABLESREQUEST.fields_by_name['as_of_match_rule'].enum_type = _ASOFJOINTABLESREQUEST_MATCHRULE -_ASOFJOINTABLESREQUEST_MATCHRULE.containing_type = _ASOFJOINTABLESREQUEST -_COMBOAGGREGATEREQUEST_AGGREGATE.fields_by_name['type'].enum_type = _COMBOAGGREGATEREQUEST_AGGTYPE -_COMBOAGGREGATEREQUEST_AGGREGATE.containing_type = _COMBOAGGREGATEREQUEST -_COMBOAGGREGATEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_COMBOAGGREGATEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_COMBOAGGREGATEREQUEST.fields_by_name['aggregates'].message_type = _COMBOAGGREGATEREQUEST_AGGREGATE -_COMBOAGGREGATEREQUEST_AGGTYPE.containing_type = _COMBOAGGREGATEREQUEST -_SORTDESCRIPTOR.fields_by_name['direction'].enum_type = _SORTDESCRIPTOR_SORTDIRECTION -_SORTDESCRIPTOR_SORTDIRECTION.containing_type = _SORTDESCRIPTOR -_SORTTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_SORTTABLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_SORTTABLEREQUEST.fields_by_name['sorts'].message_type = _SORTDESCRIPTOR -_FILTERTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_FILTERTABLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_FILTERTABLEREQUEST.fields_by_name['filters'].message_type = _CONDITION -_LITERAL.oneofs_by_name['value'].fields.append( - _LITERAL.fields_by_name['string_value']) -_LITERAL.fields_by_name['string_value'].containing_oneof = _LITERAL.oneofs_by_name['value'] -_LITERAL.oneofs_by_name['value'].fields.append( - _LITERAL.fields_by_name['double_value']) -_LITERAL.fields_by_name['double_value'].containing_oneof = _LITERAL.oneofs_by_name['value'] -_LITERAL.oneofs_by_name['value'].fields.append( - _LITERAL.fields_by_name['bool_value']) -_LITERAL.fields_by_name['bool_value'].containing_oneof = _LITERAL.oneofs_by_name['value'] -_LITERAL.oneofs_by_name['value'].fields.append( - _LITERAL.fields_by_name['long_value']) -_LITERAL.fields_by_name['long_value'].containing_oneof = _LITERAL.oneofs_by_name['value'] -_LITERAL.oneofs_by_name['value'].fields.append( - _LITERAL.fields_by_name['nano_time_value']) -_LITERAL.fields_by_name['nano_time_value'].containing_oneof = _LITERAL.oneofs_by_name['value'] -_VALUE.fields_by_name['reference'].message_type = _REFERENCE -_VALUE.fields_by_name['literal'].message_type = _LITERAL -_VALUE.oneofs_by_name['data'].fields.append( - _VALUE.fields_by_name['reference']) -_VALUE.fields_by_name['reference'].containing_oneof = _VALUE.oneofs_by_name['data'] -_VALUE.oneofs_by_name['data'].fields.append( - _VALUE.fields_by_name['literal']) -_VALUE.fields_by_name['literal'].containing_oneof = _VALUE.oneofs_by_name['data'] -_CONDITION.fields_by_name['and'].message_type = _ANDCONDITION -_CONDITION.fields_by_name['or'].message_type = _ORCONDITION -_CONDITION.fields_by_name['not'].message_type = _NOTCONDITION -_CONDITION.fields_by_name['compare'].message_type = _COMPARECONDITION -_CONDITION.fields_by_name['in'].message_type = _INCONDITION -_CONDITION.fields_by_name['invoke'].message_type = _INVOKECONDITION -_CONDITION.fields_by_name['is_null'].message_type = _ISNULLCONDITION -_CONDITION.fields_by_name['matches'].message_type = _MATCHESCONDITION -_CONDITION.fields_by_name['contains'].message_type = _CONTAINSCONDITION -_CONDITION.fields_by_name['search'].message_type = _SEARCHCONDITION -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['and']) -_CONDITION.fields_by_name['and'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['or']) -_CONDITION.fields_by_name['or'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['not']) -_CONDITION.fields_by_name['not'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['compare']) -_CONDITION.fields_by_name['compare'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['in']) -_CONDITION.fields_by_name['in'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['invoke']) -_CONDITION.fields_by_name['invoke'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['is_null']) -_CONDITION.fields_by_name['is_null'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['matches']) -_CONDITION.fields_by_name['matches'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['contains']) -_CONDITION.fields_by_name['contains'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_CONDITION.oneofs_by_name['data'].fields.append( - _CONDITION.fields_by_name['search']) -_CONDITION.fields_by_name['search'].containing_oneof = _CONDITION.oneofs_by_name['data'] -_ANDCONDITION.fields_by_name['filters'].message_type = _CONDITION -_ORCONDITION.fields_by_name['filters'].message_type = _CONDITION -_NOTCONDITION.fields_by_name['filter'].message_type = _CONDITION -_COMPARECONDITION.fields_by_name['operation'].enum_type = _COMPARECONDITION_COMPAREOPERATION -_COMPARECONDITION.fields_by_name['case_sensitivity'].enum_type = _CASESENSITIVITY -_COMPARECONDITION.fields_by_name['lhs'].message_type = _VALUE -_COMPARECONDITION.fields_by_name['rhs'].message_type = _VALUE -_COMPARECONDITION_COMPAREOPERATION.containing_type = _COMPARECONDITION -_INCONDITION.fields_by_name['target'].message_type = _VALUE -_INCONDITION.fields_by_name['candidates'].message_type = _VALUE -_INCONDITION.fields_by_name['case_sensitivity'].enum_type = _CASESENSITIVITY -_INCONDITION.fields_by_name['match_type'].enum_type = _MATCHTYPE -_INVOKECONDITION.fields_by_name['target'].message_type = _VALUE -_INVOKECONDITION.fields_by_name['arguments'].message_type = _VALUE -_ISNULLCONDITION.fields_by_name['reference'].message_type = _REFERENCE -_MATCHESCONDITION.fields_by_name['reference'].message_type = _REFERENCE -_MATCHESCONDITION.fields_by_name['case_sensitivity'].enum_type = _CASESENSITIVITY -_MATCHESCONDITION.fields_by_name['match_type'].enum_type = _MATCHTYPE -_CONTAINSCONDITION.fields_by_name['reference'].message_type = _REFERENCE -_CONTAINSCONDITION.fields_by_name['case_sensitivity'].enum_type = _CASESENSITIVITY -_CONTAINSCONDITION.fields_by_name['match_type'].enum_type = _MATCHTYPE -_SEARCHCONDITION.fields_by_name['optional_references'].message_type = _REFERENCE -_FLATTENREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_FLATTENREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.containing_type = _RUNCHARTDOWNSAMPLEREQUEST -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.oneofs_by_name['_min_date_nanos'].fields.append( - _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos']) -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos'].containing_oneof = _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.oneofs_by_name['_min_date_nanos'] -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.oneofs_by_name['_max_date_nanos'].fields.append( - _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']) -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos'].containing_oneof = _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.oneofs_by_name['_max_date_nanos'] -_RUNCHARTDOWNSAMPLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_RUNCHARTDOWNSAMPLEREQUEST.fields_by_name['source_id'].message_type = _TABLEREFERENCE -_RUNCHARTDOWNSAMPLEREQUEST.fields_by_name['zoom_range'].message_type = _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY.containing_type = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED.containing_type = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_append_only'].message_type = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_key_backed'].message_type = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.containing_type = _CREATEINPUTTABLEREQUEST -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.oneofs_by_name['kind'].fields.append( - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_append_only']) -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_append_only'].containing_oneof = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.oneofs_by_name['kind'] -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.oneofs_by_name['kind'].fields.append( - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_key_backed']) -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.fields_by_name['in_memory_key_backed'].containing_oneof = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.oneofs_by_name['kind'] -_CREATEINPUTTABLEREQUEST.fields_by_name['result_id'].message_type = deephaven_dot_proto_dot_ticket__pb2._TICKET -_CREATEINPUTTABLEREQUEST.fields_by_name['source_table_id'].message_type = _TABLEREFERENCE -_CREATEINPUTTABLEREQUEST.fields_by_name['kind'].message_type = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND -_CREATEINPUTTABLEREQUEST.oneofs_by_name['definition'].fields.append( - _CREATEINPUTTABLEREQUEST.fields_by_name['source_table_id']) -_CREATEINPUTTABLEREQUEST.fields_by_name['source_table_id'].containing_oneof = _CREATEINPUTTABLEREQUEST.oneofs_by_name['definition'] -_CREATEINPUTTABLEREQUEST.oneofs_by_name['definition'].fields.append( - _CREATEINPUTTABLEREQUEST.fields_by_name['schema']) -_CREATEINPUTTABLEREQUEST.fields_by_name['schema'].containing_oneof = _CREATEINPUTTABLEREQUEST.oneofs_by_name['definition'] -_BATCHTABLEREQUEST_OPERATION.fields_by_name['empty_table'].message_type = _EMPTYTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['time_table'].message_type = _TIMETABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['drop_columns'].message_type = _DROPCOLUMNSREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['update'].message_type = _SELECTORUPDATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['lazy_update'].message_type = _SELECTORUPDATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['view'].message_type = _SELECTORUPDATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['update_view'].message_type = _SELECTORUPDATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['select'].message_type = _SELECTORUPDATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['select_distinct'].message_type = _SELECTDISTINCTREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['filter'].message_type = _FILTERTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['unstructured_filter'].message_type = _UNSTRUCTUREDFILTERTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['sort'].message_type = _SORTTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['head'].message_type = _HEADORTAILREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['tail'].message_type = _HEADORTAILREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['head_by'].message_type = _HEADORTAILBYREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['tail_by'].message_type = _HEADORTAILBYREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['ungroup'].message_type = _UNGROUPREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['merge'].message_type = _MERGETABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['combo_aggregate'].message_type = _COMBOAGGREGATEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['snapshot'].message_type = _SNAPSHOTTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['flatten'].message_type = _FLATTENREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['run_chart_downsample'].message_type = _RUNCHARTDOWNSAMPLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['cross_join'].message_type = _CROSSJOINTABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['natural_join'].message_type = _NATURALJOINTABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['exact_join'].message_type = _EXACTJOINTABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['left_join'].message_type = _LEFTJOINTABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['as_of_join'].message_type = _ASOFJOINTABLESREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_table'].message_type = _FETCHTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_pandas_table'].message_type = _FETCHPANDASTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['apply_preview_columns'].message_type = _APPLYPREVIEWCOLUMNSREQUEST -_BATCHTABLEREQUEST_OPERATION.fields_by_name['create_input_table'].message_type = _CREATEINPUTTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.containing_type = _BATCHTABLEREQUEST -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['empty_table']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['empty_table'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['time_table']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['time_table'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['drop_columns']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['drop_columns'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['update']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['update'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['lazy_update']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['lazy_update'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['view']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['view'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['update_view']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['update_view'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['select']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['select'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['select_distinct']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['select_distinct'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['filter']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['filter'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['unstructured_filter']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['unstructured_filter'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['sort']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['sort'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['head']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['head'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['tail']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['tail'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['head_by']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['head_by'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['tail_by']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['tail_by'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['ungroup']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['ungroup'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['merge']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['merge'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['combo_aggregate']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['combo_aggregate'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['snapshot']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['snapshot'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['flatten']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['flatten'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['run_chart_downsample']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['run_chart_downsample'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['cross_join']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['cross_join'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['natural_join']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['natural_join'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['exact_join']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['exact_join'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['left_join']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['left_join'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['as_of_join']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['as_of_join'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_table']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_table'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_pandas_table']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['fetch_pandas_table'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['apply_preview_columns']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['apply_preview_columns'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'].fields.append( - _BATCHTABLEREQUEST_OPERATION.fields_by_name['create_input_table']) -_BATCHTABLEREQUEST_OPERATION.fields_by_name['create_input_table'].containing_oneof = _BATCHTABLEREQUEST_OPERATION.oneofs_by_name['op'] -_BATCHTABLEREQUEST.fields_by_name['ops'].message_type = _BATCHTABLEREQUEST_OPERATION -DESCRIPTOR.message_types_by_name['TableReference'] = _TABLEREFERENCE -DESCRIPTOR.message_types_by_name['ExportedTableCreationResponse'] = _EXPORTEDTABLECREATIONRESPONSE -DESCRIPTOR.message_types_by_name['FetchTableRequest'] = _FETCHTABLEREQUEST -DESCRIPTOR.message_types_by_name['ApplyPreviewColumnsRequest'] = _APPLYPREVIEWCOLUMNSREQUEST -DESCRIPTOR.message_types_by_name['FetchPandasTableRequest'] = _FETCHPANDASTABLEREQUEST -DESCRIPTOR.message_types_by_name['FetchTableMapRequest'] = _FETCHTABLEMAPREQUEST -DESCRIPTOR.message_types_by_name['FetchTableMapResponse'] = _FETCHTABLEMAPRESPONSE -DESCRIPTOR.message_types_by_name['ExportedTableUpdatesRequest'] = _EXPORTEDTABLEUPDATESREQUEST -DESCRIPTOR.message_types_by_name['ExportedTableUpdateMessage'] = _EXPORTEDTABLEUPDATEMESSAGE -DESCRIPTOR.message_types_by_name['EmptyTableRequest'] = _EMPTYTABLEREQUEST -DESCRIPTOR.message_types_by_name['TimeTableRequest'] = _TIMETABLEREQUEST -DESCRIPTOR.message_types_by_name['SelectOrUpdateRequest'] = _SELECTORUPDATEREQUEST -DESCRIPTOR.message_types_by_name['SelectDistinctRequest'] = _SELECTDISTINCTREQUEST -DESCRIPTOR.message_types_by_name['DropColumnsRequest'] = _DROPCOLUMNSREQUEST -DESCRIPTOR.message_types_by_name['UnstructuredFilterTableRequest'] = _UNSTRUCTUREDFILTERTABLEREQUEST -DESCRIPTOR.message_types_by_name['HeadOrTailRequest'] = _HEADORTAILREQUEST -DESCRIPTOR.message_types_by_name['HeadOrTailByRequest'] = _HEADORTAILBYREQUEST -DESCRIPTOR.message_types_by_name['UngroupRequest'] = _UNGROUPREQUEST -DESCRIPTOR.message_types_by_name['MergeTablesRequest'] = _MERGETABLESREQUEST -DESCRIPTOR.message_types_by_name['SnapshotTableRequest'] = _SNAPSHOTTABLEREQUEST -DESCRIPTOR.message_types_by_name['CrossJoinTablesRequest'] = _CROSSJOINTABLESREQUEST -DESCRIPTOR.message_types_by_name['NaturalJoinTablesRequest'] = _NATURALJOINTABLESREQUEST -DESCRIPTOR.message_types_by_name['ExactJoinTablesRequest'] = _EXACTJOINTABLESREQUEST -DESCRIPTOR.message_types_by_name['LeftJoinTablesRequest'] = _LEFTJOINTABLESREQUEST -DESCRIPTOR.message_types_by_name['AsOfJoinTablesRequest'] = _ASOFJOINTABLESREQUEST -DESCRIPTOR.message_types_by_name['ComboAggregateRequest'] = _COMBOAGGREGATEREQUEST -DESCRIPTOR.message_types_by_name['SortDescriptor'] = _SORTDESCRIPTOR -DESCRIPTOR.message_types_by_name['SortTableRequest'] = _SORTTABLEREQUEST -DESCRIPTOR.message_types_by_name['FilterTableRequest'] = _FILTERTABLEREQUEST -DESCRIPTOR.message_types_by_name['Reference'] = _REFERENCE -DESCRIPTOR.message_types_by_name['Literal'] = _LITERAL -DESCRIPTOR.message_types_by_name['Value'] = _VALUE -DESCRIPTOR.message_types_by_name['Condition'] = _CONDITION -DESCRIPTOR.message_types_by_name['AndCondition'] = _ANDCONDITION -DESCRIPTOR.message_types_by_name['OrCondition'] = _ORCONDITION -DESCRIPTOR.message_types_by_name['NotCondition'] = _NOTCONDITION -DESCRIPTOR.message_types_by_name['CompareCondition'] = _COMPARECONDITION -DESCRIPTOR.message_types_by_name['InCondition'] = _INCONDITION -DESCRIPTOR.message_types_by_name['InvokeCondition'] = _INVOKECONDITION -DESCRIPTOR.message_types_by_name['IsNullCondition'] = _ISNULLCONDITION -DESCRIPTOR.message_types_by_name['MatchesCondition'] = _MATCHESCONDITION -DESCRIPTOR.message_types_by_name['ContainsCondition'] = _CONTAINSCONDITION -DESCRIPTOR.message_types_by_name['SearchCondition'] = _SEARCHCONDITION -DESCRIPTOR.message_types_by_name['FlattenRequest'] = _FLATTENREQUEST -DESCRIPTOR.message_types_by_name['RunChartDownsampleRequest'] = _RUNCHARTDOWNSAMPLEREQUEST -DESCRIPTOR.message_types_by_name['CreateInputTableRequest'] = _CREATEINPUTTABLEREQUEST -DESCRIPTOR.message_types_by_name['BatchTableRequest'] = _BATCHTABLEREQUEST -DESCRIPTOR.enum_types_by_name['CaseSensitivity'] = _CASESENSITIVITY -DESCRIPTOR.enum_types_by_name['MatchType'] = _MATCHTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_TABLEREFERENCE = DESCRIPTOR.message_types_by_name['TableReference'] +_EXPORTEDTABLECREATIONRESPONSE = DESCRIPTOR.message_types_by_name['ExportedTableCreationResponse'] +_FETCHTABLEREQUEST = DESCRIPTOR.message_types_by_name['FetchTableRequest'] +_APPLYPREVIEWCOLUMNSREQUEST = DESCRIPTOR.message_types_by_name['ApplyPreviewColumnsRequest'] +_FETCHPANDASTABLEREQUEST = DESCRIPTOR.message_types_by_name['FetchPandasTableRequest'] +_EXPORTEDTABLEUPDATESREQUEST = DESCRIPTOR.message_types_by_name['ExportedTableUpdatesRequest'] +_EXPORTEDTABLEUPDATEMESSAGE = DESCRIPTOR.message_types_by_name['ExportedTableUpdateMessage'] +_EMPTYTABLEREQUEST = DESCRIPTOR.message_types_by_name['EmptyTableRequest'] +_TIMETABLEREQUEST = DESCRIPTOR.message_types_by_name['TimeTableRequest'] +_SELECTORUPDATEREQUEST = DESCRIPTOR.message_types_by_name['SelectOrUpdateRequest'] +_SELECTDISTINCTREQUEST = DESCRIPTOR.message_types_by_name['SelectDistinctRequest'] +_DROPCOLUMNSREQUEST = DESCRIPTOR.message_types_by_name['DropColumnsRequest'] +_UNSTRUCTUREDFILTERTABLEREQUEST = DESCRIPTOR.message_types_by_name['UnstructuredFilterTableRequest'] +_HEADORTAILREQUEST = DESCRIPTOR.message_types_by_name['HeadOrTailRequest'] +_HEADORTAILBYREQUEST = DESCRIPTOR.message_types_by_name['HeadOrTailByRequest'] +_UNGROUPREQUEST = DESCRIPTOR.message_types_by_name['UngroupRequest'] +_MERGETABLESREQUEST = DESCRIPTOR.message_types_by_name['MergeTablesRequest'] +_SNAPSHOTTABLEREQUEST = DESCRIPTOR.message_types_by_name['SnapshotTableRequest'] +_CROSSJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['CrossJoinTablesRequest'] +_NATURALJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['NaturalJoinTablesRequest'] +_EXACTJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['ExactJoinTablesRequest'] +_LEFTJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['LeftJoinTablesRequest'] +_ASOFJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['AsOfJoinTablesRequest'] +_COMBOAGGREGATEREQUEST = DESCRIPTOR.message_types_by_name['ComboAggregateRequest'] +_COMBOAGGREGATEREQUEST_AGGREGATE = _COMBOAGGREGATEREQUEST.nested_types_by_name['Aggregate'] +_SORTDESCRIPTOR = DESCRIPTOR.message_types_by_name['SortDescriptor'] +_SORTTABLEREQUEST = DESCRIPTOR.message_types_by_name['SortTableRequest'] +_FILTERTABLEREQUEST = DESCRIPTOR.message_types_by_name['FilterTableRequest'] +_REFERENCE = DESCRIPTOR.message_types_by_name['Reference'] +_LITERAL = DESCRIPTOR.message_types_by_name['Literal'] +_VALUE = DESCRIPTOR.message_types_by_name['Value'] +_CONDITION = DESCRIPTOR.message_types_by_name['Condition'] +_ANDCONDITION = DESCRIPTOR.message_types_by_name['AndCondition'] +_ORCONDITION = DESCRIPTOR.message_types_by_name['OrCondition'] +_NOTCONDITION = DESCRIPTOR.message_types_by_name['NotCondition'] +_COMPARECONDITION = DESCRIPTOR.message_types_by_name['CompareCondition'] +_INCONDITION = DESCRIPTOR.message_types_by_name['InCondition'] +_INVOKECONDITION = DESCRIPTOR.message_types_by_name['InvokeCondition'] +_ISNULLCONDITION = DESCRIPTOR.message_types_by_name['IsNullCondition'] +_MATCHESCONDITION = DESCRIPTOR.message_types_by_name['MatchesCondition'] +_CONTAINSCONDITION = DESCRIPTOR.message_types_by_name['ContainsCondition'] +_SEARCHCONDITION = DESCRIPTOR.message_types_by_name['SearchCondition'] +_FLATTENREQUEST = DESCRIPTOR.message_types_by_name['FlattenRequest'] +_RUNCHARTDOWNSAMPLEREQUEST = DESCRIPTOR.message_types_by_name['RunChartDownsampleRequest'] +_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE = _RUNCHARTDOWNSAMPLEREQUEST.nested_types_by_name['ZoomRange'] +_CREATEINPUTTABLEREQUEST = DESCRIPTOR.message_types_by_name['CreateInputTableRequest'] +_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND = _CREATEINPUTTABLEREQUEST.nested_types_by_name['InputTableKind'] +_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.nested_types_by_name['InMemoryAppendOnly'] +_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.nested_types_by_name['InMemoryKeyBacked'] +_BATCHTABLEREQUEST = DESCRIPTOR.message_types_by_name['BatchTableRequest'] +_BATCHTABLEREQUEST_OPERATION = _BATCHTABLEREQUEST.nested_types_by_name['Operation'] +_ASOFJOINTABLESREQUEST_MATCHRULE = _ASOFJOINTABLESREQUEST.enum_types_by_name['MatchRule'] +_COMBOAGGREGATEREQUEST_AGGTYPE = _COMBOAGGREGATEREQUEST.enum_types_by_name['AggType'] +_SORTDESCRIPTOR_SORTDIRECTION = _SORTDESCRIPTOR.enum_types_by_name['SortDirection'] +_COMPARECONDITION_COMPAREOPERATION = _COMPARECONDITION.enum_types_by_name['CompareOperation'] TableReference = _reflection.GeneratedProtocolMessageType('TableReference', (_message.Message,), { 'DESCRIPTOR' : _TABLEREFERENCE, '__module__' : 'pydeephaven.proto.table_pb2' @@ -3400,20 +118,6 @@ }) _sym_db.RegisterMessage(FetchPandasTableRequest) -FetchTableMapRequest = _reflection.GeneratedProtocolMessageType('FetchTableMapRequest', (_message.Message,), { - 'DESCRIPTOR' : _FETCHTABLEMAPREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - }) -_sym_db.RegisterMessage(FetchTableMapRequest) - -FetchTableMapResponse = _reflection.GeneratedProtocolMessageType('FetchTableMapResponse', (_message.Message,), { - 'DESCRIPTOR' : _FETCHTABLEMAPRESPONSE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchTableMapResponse) - }) -_sym_db.RegisterMessage(FetchTableMapResponse) - ExportedTableUpdatesRequest = _reflection.GeneratedProtocolMessageType('ExportedTableUpdatesRequest', (_message.Message,), { 'DESCRIPTOR' : _EXPORTEDTABLEUPDATESREQUEST, '__module__' : 'pydeephaven.proto.table_pb2' @@ -3742,383 +446,147 @@ _sym_db.RegisterMessage(BatchTableRequest) _sym_db.RegisterMessage(BatchTableRequest.Operation) - -DESCRIPTOR._options = None -_EXPORTEDTABLECREATIONRESPONSE.fields_by_name['size']._options = None -_EXPORTEDTABLEUPDATEMESSAGE.fields_by_name['size']._options = None -_EMPTYTABLEREQUEST.fields_by_name['size']._options = None -_TIMETABLEREQUEST.fields_by_name['start_time_nanos']._options = None -_TIMETABLEREQUEST.fields_by_name['period_nanos']._options = None -_HEADORTAILREQUEST.fields_by_name['num_rows']._options = None -_HEADORTAILBYREQUEST.fields_by_name['num_rows']._options = None -_LITERAL.fields_by_name['long_value']._options = None -_LITERAL.fields_by_name['nano_time_value']._options = None -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos']._options = None -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']._options = None - -_TABLESERVICE = _descriptor.ServiceDescriptor( - name='TableService', - full_name='io.deephaven.proto.backplane.grpc.TableService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=12854, - serialized_end=17803, - methods=[ - _descriptor.MethodDescriptor( - name='GetExportedTableCreationResponse', - full_name='io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse', - index=0, - containing_service=None, - input_type=deephaven_dot_proto_dot_ticket__pb2._TICKET, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='FetchTable', - full_name='io.deephaven.proto.backplane.grpc.TableService.FetchTable', - index=1, - containing_service=None, - input_type=_FETCHTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='FetchPandasTable', - full_name='io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable', - index=2, - containing_service=None, - input_type=_FETCHPANDASTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='FetchTableMap', - full_name='io.deephaven.proto.backplane.grpc.TableService.FetchTableMap', - index=3, - containing_service=None, - input_type=_FETCHTABLEMAPREQUEST, - output_type=_FETCHTABLEMAPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ApplyPreviewColumns', - full_name='io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns', - index=4, - containing_service=None, - input_type=_APPLYPREVIEWCOLUMNSREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='EmptyTable', - full_name='io.deephaven.proto.backplane.grpc.TableService.EmptyTable', - index=5, - containing_service=None, - input_type=_EMPTYTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='TimeTable', - full_name='io.deephaven.proto.backplane.grpc.TableService.TimeTable', - index=6, - containing_service=None, - input_type=_TIMETABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DropColumns', - full_name='io.deephaven.proto.backplane.grpc.TableService.DropColumns', - index=7, - containing_service=None, - input_type=_DROPCOLUMNSREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Update', - full_name='io.deephaven.proto.backplane.grpc.TableService.Update', - index=8, - containing_service=None, - input_type=_SELECTORUPDATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='LazyUpdate', - full_name='io.deephaven.proto.backplane.grpc.TableService.LazyUpdate', - index=9, - containing_service=None, - input_type=_SELECTORUPDATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='View', - full_name='io.deephaven.proto.backplane.grpc.TableService.View', - index=10, - containing_service=None, - input_type=_SELECTORUPDATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UpdateView', - full_name='io.deephaven.proto.backplane.grpc.TableService.UpdateView', - index=11, - containing_service=None, - input_type=_SELECTORUPDATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Select', - full_name='io.deephaven.proto.backplane.grpc.TableService.Select', - index=12, - containing_service=None, - input_type=_SELECTORUPDATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SelectDistinct', - full_name='io.deephaven.proto.backplane.grpc.TableService.SelectDistinct', - index=13, - containing_service=None, - input_type=_SELECTDISTINCTREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Filter', - full_name='io.deephaven.proto.backplane.grpc.TableService.Filter', - index=14, - containing_service=None, - input_type=_FILTERTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UnstructuredFilter', - full_name='io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter', - index=15, - containing_service=None, - input_type=_UNSTRUCTUREDFILTERTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Sort', - full_name='io.deephaven.proto.backplane.grpc.TableService.Sort', - index=16, - containing_service=None, - input_type=_SORTTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Head', - full_name='io.deephaven.proto.backplane.grpc.TableService.Head', - index=17, - containing_service=None, - input_type=_HEADORTAILREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Tail', - full_name='io.deephaven.proto.backplane.grpc.TableService.Tail', - index=18, - containing_service=None, - input_type=_HEADORTAILREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='HeadBy', - full_name='io.deephaven.proto.backplane.grpc.TableService.HeadBy', - index=19, - containing_service=None, - input_type=_HEADORTAILBYREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='TailBy', - full_name='io.deephaven.proto.backplane.grpc.TableService.TailBy', - index=20, - containing_service=None, - input_type=_HEADORTAILBYREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Ungroup', - full_name='io.deephaven.proto.backplane.grpc.TableService.Ungroup', - index=21, - containing_service=None, - input_type=_UNGROUPREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MergeTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.MergeTables', - index=22, - containing_service=None, - input_type=_MERGETABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CrossJoinTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables', - index=23, - containing_service=None, - input_type=_CROSSJOINTABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NaturalJoinTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables', - index=24, - containing_service=None, - input_type=_NATURALJOINTABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ExactJoinTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables', - index=25, - containing_service=None, - input_type=_EXACTJOINTABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='LeftJoinTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables', - index=26, - containing_service=None, - input_type=_LEFTJOINTABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='AsOfJoinTables', - full_name='io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables', - index=27, - containing_service=None, - input_type=_ASOFJOINTABLESREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ComboAggregate', - full_name='io.deephaven.proto.backplane.grpc.TableService.ComboAggregate', - index=28, - containing_service=None, - input_type=_COMBOAGGREGATEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Snapshot', - full_name='io.deephaven.proto.backplane.grpc.TableService.Snapshot', - index=29, - containing_service=None, - input_type=_SNAPSHOTTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Flatten', - full_name='io.deephaven.proto.backplane.grpc.TableService.Flatten', - index=30, - containing_service=None, - input_type=_FLATTENREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RunChartDownsample', - full_name='io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample', - index=31, - containing_service=None, - input_type=_RUNCHARTDOWNSAMPLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CreateInputTable', - full_name='io.deephaven.proto.backplane.grpc.TableService.CreateInputTable', - index=32, - containing_service=None, - input_type=_CREATEINPUTTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Batch', - full_name='io.deephaven.proto.backplane.grpc.TableService.Batch', - index=33, - containing_service=None, - input_type=_BATCHTABLEREQUEST, - output_type=_EXPORTEDTABLECREATIONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ExportedTableUpdates', - full_name='io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates', - index=34, - containing_service=None, - input_type=_EXPORTEDTABLEUPDATESREQUEST, - output_type=_EXPORTEDTABLEUPDATEMESSAGE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_TABLESERVICE) - -DESCRIPTOR.services_by_name['TableService'] = _TABLESERVICE - +_TABLESERVICE = DESCRIPTOR.services_by_name['TableService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _EXPORTEDTABLECREATIONRESPONSE.fields_by_name['size']._options = None + _EXPORTEDTABLECREATIONRESPONSE.fields_by_name['size']._serialized_options = b'0\001' + _EXPORTEDTABLEUPDATEMESSAGE.fields_by_name['size']._options = None + _EXPORTEDTABLEUPDATEMESSAGE.fields_by_name['size']._serialized_options = b'0\001' + _EMPTYTABLEREQUEST.fields_by_name['size']._options = None + _EMPTYTABLEREQUEST.fields_by_name['size']._serialized_options = b'0\001' + _TIMETABLEREQUEST.fields_by_name['start_time_nanos']._options = None + _TIMETABLEREQUEST.fields_by_name['start_time_nanos']._serialized_options = b'0\001' + _TIMETABLEREQUEST.fields_by_name['period_nanos']._options = None + _TIMETABLEREQUEST.fields_by_name['period_nanos']._serialized_options = b'0\001' + _HEADORTAILREQUEST.fields_by_name['num_rows']._options = None + _HEADORTAILREQUEST.fields_by_name['num_rows']._serialized_options = b'0\001' + _HEADORTAILBYREQUEST.fields_by_name['num_rows']._options = None + _HEADORTAILBYREQUEST.fields_by_name['num_rows']._serialized_options = b'0\001' + _LITERAL.fields_by_name['long_value']._options = None + _LITERAL.fields_by_name['long_value']._serialized_options = b'0\001' + _LITERAL.fields_by_name['nano_time_value']._options = None + _LITERAL.fields_by_name['nano_time_value']._serialized_options = b'0\001' + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos']._options = None + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos']._serialized_options = b'0\001' + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']._options = None + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']._serialized_options = b'0\001' + _CASESENSITIVITY._serialized_start=12579 + _CASESENSITIVITY._serialized_end=12629 + _MATCHTYPE._serialized_start=12631 + _MATCHTYPE._serialized_end=12669 + _TABLEREFERENCE._serialized_start=96 + _TABLEREFERENCE._serialized_end=204 + _EXPORTEDTABLECREATIONRESPONSE._serialized_start=207 + _EXPORTEDTABLECREATIONRESPONSE._serialized_end=405 + _FETCHTABLEREQUEST._serialized_start=408 + _FETCHTABLEREQUEST._serialized_end=559 + _APPLYPREVIEWCOLUMNSREQUEST._serialized_start=562 + _APPLYPREVIEWCOLUMNSREQUEST._serialized_end=722 + _FETCHPANDASTABLEREQUEST._serialized_start=725 + _FETCHPANDASTABLEREQUEST._serialized_end=882 + _EXPORTEDTABLEUPDATESREQUEST._serialized_start=884 + _EXPORTEDTABLEUPDATESREQUEST._serialized_end=913 + _EXPORTEDTABLEUPDATEMESSAGE._serialized_start=916 + _EXPORTEDTABLEUPDATEMESSAGE._serialized_end=1056 + _EMPTYTABLEREQUEST._serialized_start=1058 + _EMPTYTABLEREQUEST._serialized_end=1157 + _TIMETABLEREQUEST._serialized_start=1160 + _TIMETABLEREQUEST._serialized_end=1296 + _SELECTORUPDATEREQUEST._serialized_start=1299 + _SELECTORUPDATEREQUEST._serialized_end=1476 + _SELECTDISTINCTREQUEST._serialized_start=1479 + _SELECTDISTINCTREQUEST._serialized_end=1656 + _DROPCOLUMNSREQUEST._serialized_start=1659 + _DROPCOLUMNSREQUEST._serialized_end=1833 + _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_start=1836 + _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_end=2017 + _HEADORTAILREQUEST._serialized_start=2020 + _HEADORTAILREQUEST._serialized_end=2193 + _HEADORTAILBYREQUEST._serialized_start=2196 + _HEADORTAILBYREQUEST._serialized_end=2402 + _UNGROUPREQUEST._serialized_start=2405 + _UNGROUPREQUEST._serialized_end=2600 + _MERGETABLESREQUEST._serialized_start=2603 + _MERGETABLESREQUEST._serialized_end=2776 + _SNAPSHOTTABLEREQUEST._serialized_start=2779 + _SNAPSHOTTABLEREQUEST._serialized_end=3052 + _CROSSJOINTABLESREQUEST._serialized_start=3055 + _CROSSJOINTABLESREQUEST._serialized_end=3350 + _NATURALJOINTABLESREQUEST._serialized_start=3353 + _NATURALJOINTABLESREQUEST._serialized_end=3628 + _EXACTJOINTABLESREQUEST._serialized_start=3631 + _EXACTJOINTABLESREQUEST._serialized_end=3904 + _LEFTJOINTABLESREQUEST._serialized_start=3907 + _LEFTJOINTABLESREQUEST._serialized_end=4179 + _ASOFJOINTABLESREQUEST._serialized_start=4182 + _ASOFJOINTABLESREQUEST._serialized_end=4639 + _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_start=4550 + _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_end=4639 + _COMBOAGGREGATEREQUEST._serialized_start=4642 + _COMBOAGGREGATEREQUEST._serialized_end=5276 + _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_start=4935 + _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_end=5108 + _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_start=5111 + _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_end=5276 + _SORTDESCRIPTOR._serialized_start=5279 + _SORTDESCRIPTOR._serialized_end=5504 + _SORTDESCRIPTOR_SORTDIRECTION._serialized_start=5423 + _SORTDESCRIPTOR_SORTDIRECTION._serialized_end=5504 + _SORTTABLEREQUEST._serialized_start=5507 + _SORTTABLEREQUEST._serialized_end=5723 + _FILTERTABLEREQUEST._serialized_start=5726 + _FILTERTABLEREQUEST._serialized_end=5941 + _REFERENCE._serialized_start=5943 + _REFERENCE._serialized_end=5975 + _LITERAL._serialized_start=5978 + _LITERAL._serialized_end=6123 + _VALUE._serialized_start=6126 + _VALUE._serialized_end=6271 + _CONDITION._serialized_start=6274 + _CONDITION._serialized_end=6974 + _ANDCONDITION._serialized_start=6976 + _ANDCONDITION._serialized_end=7053 + _ORCONDITION._serialized_start=7055 + _ORCONDITION._serialized_end=7131 + _NOTCONDITION._serialized_start=7133 + _NOTCONDITION._serialized_end=7209 + _COMPARECONDITION._serialized_start=7212 + _COMPARECONDITION._serialized_end=7640 + _COMPARECONDITION_COMPAREOPERATION._serialized_start=7510 + _COMPARECONDITION_COMPAREOPERATION._serialized_end=7640 + _INCONDITION._serialized_start=7643 + _INCONDITION._serialized_end=7920 + _INVOKECONDITION._serialized_start=7923 + _INVOKECONDITION._serialized_end=8075 + _ISNULLCONDITION._serialized_start=8077 + _ISNULLCONDITION._serialized_end=8159 + _MATCHESCONDITION._serialized_start=8162 + _MATCHESCONDITION._serialized_end=8404 + _CONTAINSCONDITION._serialized_start=8407 + _CONTAINSCONDITION._serialized_end=8658 + _SEARCHCONDITION._serialized_start=8660 + _SEARCHCONDITION._serialized_end=8775 + _FLATTENREQUEST._serialized_start=8778 + _FLATTENREQUEST._serialized_end=8926 + _RUNCHARTDOWNSAMPLEREQUEST._serialized_start=8929 + _RUNCHARTDOWNSAMPLEREQUEST._serialized_end=9365 + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_start=9250 + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_end=9365 + _CREATEINPUTTABLEREQUEST._serialized_start=9368 + _CREATEINPUTTABLEREQUEST._serialized_end=9997 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_start=9643 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_end=9983 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_start=9913 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_end=9933 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_start=9935 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_end=9975 + _BATCHTABLEREQUEST._serialized_start=10000 + _BATCHTABLEREQUEST._serialized_end=12577 + _BATCHTABLEREQUEST_OPERATION._serialized_start=10099 + _BATCHTABLEREQUEST_OPERATION._serialized_end=12577 + _TABLESERVICE._serialized_start=12672 + _TABLESERVICE._serialized_end=17486 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/table_pb2_grpc.py b/py/client/pydeephaven/proto/table_pb2_grpc.py index 759a45ba1fb..869bcc95947 100644 --- a/py/client/pydeephaven/proto/table_pb2_grpc.py +++ b/py/client/pydeephaven/proto/table_pb2_grpc.py @@ -30,11 +30,6 @@ def __init__(self, channel): request_serializer=deephaven_dot_proto_dot_table__pb2.FetchPandasTableRequest.SerializeToString, response_deserializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, ) - self.FetchTableMap = channel.unary_unary( - '/io.deephaven.proto.backplane.grpc.TableService/FetchTableMap', - request_serializer=deephaven_dot_proto_dot_table__pb2.FetchTableMapRequest.SerializeToString, - response_deserializer=deephaven_dot_proto_dot_table__pb2.FetchTableMapResponse.FromString, - ) self.ApplyPreviewColumns = channel.unary_unary( '/io.deephaven.proto.backplane.grpc.TableService/ApplyPreviewColumns', request_serializer=deephaven_dot_proto_dot_table__pb2.ApplyPreviewColumnsRequest.SerializeToString, @@ -219,14 +214,6 @@ def FetchPandasTable(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def FetchTableMap(self, request, context): - """ - Fetches a TableMap from an existing source ticket and exports it to the local session result ticket. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def ApplyPreviewColumns(self, request, context): """ Create a table that has preview columns applied to an existing source table. @@ -506,11 +493,6 @@ def add_TableServiceServicer_to_server(servicer, server): request_deserializer=deephaven_dot_proto_dot_table__pb2.FetchPandasTableRequest.FromString, response_serializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.SerializeToString, ), - 'FetchTableMap': grpc.unary_unary_rpc_method_handler( - servicer.FetchTableMap, - request_deserializer=deephaven_dot_proto_dot_table__pb2.FetchTableMapRequest.FromString, - response_serializer=deephaven_dot_proto_dot_table__pb2.FetchTableMapResponse.SerializeToString, - ), 'ApplyPreviewColumns': grpc.unary_unary_rpc_method_handler( servicer.ApplyPreviewColumns, request_deserializer=deephaven_dot_proto_dot_table__pb2.ApplyPreviewColumnsRequest.FromString, @@ -727,23 +709,6 @@ def FetchPandasTable(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def FetchTableMap(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.TableService/FetchTableMap', - deephaven_dot_proto_dot_table__pb2.FetchTableMapRequest.SerializeToString, - deephaven_dot_proto_dot_table__pb2.FetchTableMapResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def ApplyPreviewColumns(request, target, diff --git a/py/client/pydeephaven/proto/ticket_pb2.py b/py/client/pydeephaven/proto/ticket_pb2.py index 3be5d1f0fc9..6f5067b38ff 100644 --- a/py/client/pydeephaven/proto/ticket_pb2.py +++ b/py/client/pydeephaven/proto/ticket_pb2.py @@ -3,6 +3,7 @@ # source: deephaven/proto/ticket.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -13,93 +14,12 @@ -DESCRIPTOR = _descriptor.FileDescriptor( - name='deephaven/proto/ticket.proto', - package='io.deephaven.proto.backplane.grpc', - syntax='proto3', - serialized_options=b'H\001P\001', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1c\x64\x65\x65phaven/proto/ticket.proto\x12!io.deephaven.proto.backplane.grpc\"\x18\n\x06Ticket\x12\x0e\n\x06ticket\x18\x01 \x01(\x0c\"V\n\x0bTypedTicket\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04type\x18\x02 \x01(\tB\x04H\x01P\x01\x62\x06proto3' -) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/ticket.proto\x12!io.deephaven.proto.backplane.grpc\"\x18\n\x06Ticket\x12\x0e\n\x06ticket\x18\x01 \x01(\x0c\"V\n\x0bTypedTicket\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04type\x18\x02 \x01(\tB\x04H\x01P\x01\x62\x06proto3') - -_TICKET = _descriptor.Descriptor( - name='Ticket', - full_name='io.deephaven.proto.backplane.grpc.Ticket', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ticket', full_name='io.deephaven.proto.backplane.grpc.Ticket.ticket', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=67, - serialized_end=91, -) - - -_TYPEDTICKET = _descriptor.Descriptor( - name='TypedTicket', - full_name='io.deephaven.proto.backplane.grpc.TypedTicket', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ticket', full_name='io.deephaven.proto.backplane.grpc.TypedTicket.ticket', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='type', full_name='io.deephaven.proto.backplane.grpc.TypedTicket.type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=93, - serialized_end=179, -) - -_TYPEDTICKET.fields_by_name['ticket'].message_type = _TICKET -DESCRIPTOR.message_types_by_name['Ticket'] = _TICKET -DESCRIPTOR.message_types_by_name['TypedTicket'] = _TYPEDTICKET -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +_TICKET = DESCRIPTOR.message_types_by_name['Ticket'] +_TYPEDTICKET = DESCRIPTOR.message_types_by_name['TypedTicket'] Ticket = _reflection.GeneratedProtocolMessageType('Ticket', (_message.Message,), { 'DESCRIPTOR' : _TICKET, '__module__' : 'pydeephaven.proto.ticket_pb2' @@ -114,6 +34,12 @@ }) _sym_db.RegisterMessage(TypedTicket) +if _descriptor._USE_C_DESCRIPTORS == False: -DESCRIPTOR._options = None + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001' + _TICKET._serialized_start=67 + _TICKET._serialized_end=91 + _TYPEDTICKET._serialized_start=93 + _TYPEDTICKET._serialized_end=179 # @@protoc_insertion_point(module_scope) From 6d88ccecebc8b2a44808564a4461adad59df45d0 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 22 Jul 2022 14:40:59 -0700 Subject: [PATCH 023/215] Classpaths for junit (classic) (#2670) Incremental step towards making #2671 possible. --- Base/build.gradle | 5 +---- Configuration/build.gradle | 4 +--- Container/build.gradle | 2 +- buildSrc/src/main/groovy/Classpaths.groovy | 18 ++++++++++++++++++ ...deephaven.java-classpath-conventions.gradle | 5 ++--- codegen/build.gradle | 2 +- engine/api/build.gradle | 2 +- engine/chunk/build.gradle | 2 +- engine/rowset/build.gradle | 2 +- engine/table/build.gradle | 5 +++-- engine/tuple/build.gradle | 2 +- engine/updategraph/build.gradle | 2 +- engine/vector/build.gradle | 2 +- extensions/csv/build.gradle | 5 +++-- extensions/kafka/build.gradle | 4 ++-- extensions/parquet/base/build.gradle | 2 +- extensions/parquet/table/build.gradle | 4 ++-- java-client/session/build.gradle | 2 +- server/test/build.gradle | 2 +- 19 files changed, 43 insertions(+), 29 deletions(-) diff --git a/Base/build.gradle b/Base/build.gradle index 32213dda8f5..939b658c61c 100644 --- a/Base/build.gradle +++ b/Base/build.gradle @@ -10,10 +10,7 @@ dependencies { compile 'io.deephaven:hash:0.1.0' - testCompile 'junit:junit:4.13.2' - testCompile 'org.jmock:jmock-junit4:2.12.0' - testCompile 'org.jmock:jmock-imposters:2.12.0' - + Classpaths.inheritJUnitClassic(project, true, 'testCompile') } sourceSets { diff --git a/Configuration/build.gradle b/Configuration/build.gradle index 449dc9bb24d..c01be382aad 100644 --- a/Configuration/build.gradle +++ b/Configuration/build.gradle @@ -4,9 +4,7 @@ plugins { dependencies { compile project(':Base'), project(':DataStructures'), project(':IO'), project(':log-factory'), depCommonsLang3 - testCompile 'junit:junit:4.13.2' - testCompile 'org.jmock:jmock-junit4:2.12.0' - testCompile 'org.jmock:jmock-imposters:2.12.0' + Classpaths.inheritJUnitClassic(project, true, 'testCompile') Classpaths.inheritAutoService(project) diff --git a/Container/build.gradle b/Container/build.gradle index ac92eab0b7e..e6d301d3f79 100644 --- a/Container/build.gradle +++ b/Container/build.gradle @@ -4,5 +4,5 @@ plugins { } dependencies { - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } \ No newline at end of file diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 7f41b8c0273..042efd5f7a0 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -73,6 +73,15 @@ class Classpaths { static final String JUNIT_NAME = 'junit-bom' static final String JUNIT_VERSION = '5.7.2' + static final String JUNIT_CLASSIC_GROUP = 'junit' + static final String JUNIT_CLASSIC_NAME = 'junit' + static final String JUNIT_CLASSIC_VERSION = '4.13.2' + + static final String JMOCK_GROUP = 'org.jmock' + static final String JMOCK_JUNIT_NAME = 'jmock-junit4' + static final String JMOCK_IMPORSTERS_NAME = 'jmock-imposters' + static final String JMOCK_VERSION = '2.12.0' + static final String ASSERTJ_GROUP = 'org.assertj' static final String ASSERTJ_NAME = 'assertj-core' static final String ASSERTJ_VERSION = '3.19.0' @@ -211,6 +220,15 @@ class Classpaths { p.getDependencies().add('compileOnly', p.project(':util-immutables')) } + static void inheritJUnitClassic(Project p, boolean includeJMock = false, String configName = JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME) { + Configuration config = p.configurations.getByName(configName) + addDependency(config, JUNIT_CLASSIC_GROUP, JUNIT_CLASSIC_NAME, JUNIT_CLASSIC_VERSION) + if (includeJMock) { + addDependency(config, JMOCK_GROUP, JMOCK_JUNIT_NAME, JMOCK_VERSION) + addDependency(config, JMOCK_GROUP, JMOCK_IMPORSTERS_NAME, JMOCK_VERSION) + } + } + static void inheritJUnitPlatform(Project p, String configName = JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME) { Configuration config = p.configurations.getByName(configName) addDependency(config, p.getDependencies().platform(JUNIT_GROUP + ":" + JUNIT_NAME + ":" + JUNIT_VERSION)) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index 96c83692478..1009b42115b 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -61,9 +61,8 @@ dependencies { jama 'gov.nist.math.jama:gov.nist.math.jama:1.1.1' mockrunner 'com.mockrunner:mockrunner-jdbc:1.0.4' commonsCsv 'org.apache.commons:commons-csv:1.4' - junit 'junit:junit:4.13.2' - junit 'org.jmock:jmock-junit4:2.12.0' - junit 'org.jmock:jmock-imposters:2.12.0' + + Classpaths.inheritJUnitClassic(project, true, 'junit') // Now, all the various fish libs we depend on, with inherited dependencies matching // the actual dependencies used in fishlib... if we were strongly coupled, we could skip diff --git a/codegen/build.gradle b/codegen/build.gradle index 5b186edaa0b..34c5867ecd7 100644 --- a/codegen/build.gradle +++ b/codegen/build.gradle @@ -8,5 +8,5 @@ description 'Codegen: Code generation utilities' dependencies { implementation 'org.freemarker:freemarker:2.3.31' - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } diff --git a/engine/api/build.gradle b/engine/api/build.gradle index c89a232be10..4016873ebce 100644 --- a/engine/api/build.gradle +++ b/engine/api/build.gradle @@ -21,7 +21,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } spotless { diff --git a/engine/chunk/build.gradle b/engine/chunk/build.gradle index e8a1541b17f..905369651d3 100644 --- a/engine/chunk/build.gradle +++ b/engine/chunk/build.gradle @@ -8,7 +8,7 @@ description 'Engine Chunks: Array-like data structures for dense, efficient data dependencies { api project(':Util') - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/rowset/build.gradle b/engine/rowset/build.gradle index 495d2bac013..5e11d45cff9 100644 --- a/engine/rowset/build.gradle +++ b/engine/rowset/build.gradle @@ -13,7 +13,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 14e965aeaba..4f70b996b8e 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -61,8 +61,9 @@ dependencies { project(':Base'), project(':BenchmarkSupport'), project(':extensions-csv'), - project(':extensions-parquet-table'), - 'junit:junit:4.13.2' + project(':extensions-parquet-table') + + Classpaths.inheritJUnitClassic(project) Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) diff --git a/engine/tuple/build.gradle b/engine/tuple/build.gradle index ade3a8558ba..867e454a2ec 100644 --- a/engine/tuple/build.gradle +++ b/engine/tuple/build.gradle @@ -10,7 +10,7 @@ dependencies { project(':Util'), project(':engine-time') - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } spotless { diff --git a/engine/updategraph/build.gradle b/engine/updategraph/build.gradle index 74e0515f2ef..ed750ce26e1 100644 --- a/engine/updategraph/build.gradle +++ b/engine/updategraph/build.gradle @@ -13,7 +13,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/vector/build.gradle b/engine/vector/build.gradle index 69e2ed7d352..d6910f71417 100644 --- a/engine/vector/build.gradle +++ b/engine/vector/build.gradle @@ -9,7 +9,7 @@ dependencies { api project(':Util'), project(':qst') - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } spotless { diff --git a/extensions/csv/build.gradle b/extensions/csv/build.gradle index 41bdc5d5295..2b4e650e46f 100644 --- a/extensions/csv/build.gradle +++ b/extensions/csv/build.gradle @@ -19,8 +19,9 @@ dependencies { Classpaths.inheritAssertJ(project) testImplementation TestTools.projectDependency(project, 'engine-table'), - TestTools.projectDependency(project, 'engine-base'), - 'junit:junit:4.13.2' + TestTools.projectDependency(project, 'engine-base') + + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/extensions/kafka/build.gradle b/extensions/kafka/build.gradle index 71dadb79b3b..5c894a6a519 100644 --- a/extensions/kafka/build.gradle +++ b/extensions/kafka/build.gradle @@ -18,8 +18,8 @@ dependencies { Classpaths.inheritImmutables(project) - testImplementation TestTools.projectDependency(project, 'engine-table'), - 'junit:junit:4.13.2' + testImplementation TestTools.projectDependency(project, 'engine-table') + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/extensions/parquet/base/build.gradle b/extensions/parquet/base/build.gradle index a4865ce1385..75734a11a1f 100644 --- a/extensions/parquet/base/build.gradle +++ b/extensions/parquet/base/build.gradle @@ -12,7 +12,7 @@ dependencies { implementation project(':Util') - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) } spotless { diff --git a/extensions/parquet/table/build.gradle b/extensions/parquet/table/build.gradle index 8c8a84294fb..ce8ecb887b9 100644 --- a/extensions/parquet/table/build.gradle +++ b/extensions/parquet/table/build.gradle @@ -31,8 +31,8 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' - testImplementation TestTools.projectDependency(project, 'engine-table'), - 'junit:junit:4.13.2' + testImplementation TestTools.projectDependency(project, 'engine-table') + Classpaths.inheritJUnitClassic(project) testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/java-client/session/build.gradle b/java-client/session/build.gradle index dd7f4dc8373..778c0e5427b 100644 --- a/java-client/session/build.gradle +++ b/java-client/session/build.gradle @@ -30,7 +30,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine' - testImplementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project) testImplementation 'io.grpc:grpc-testing' Classpaths.inheritAssertJ(project) diff --git a/server/test/build.gradle b/server/test/build.gradle index d8030c39a8d..2cc7215e05d 100644 --- a/server/test/build.gradle +++ b/server/test/build.gradle @@ -17,6 +17,6 @@ dependencies { Classpaths.inheritDagger(project) // Classpaths.inheritJUnitPlatform(project, 'api') - implementation 'junit:junit:4.13.2' + Classpaths.inheritJUnitClassic(project, false, 'implementation') } \ No newline at end of file From 2f00160a5147786bfc1407509131c4fd2b29c0cd Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 22 Jul 2022 15:03:55 -0700 Subject: [PATCH 024/215] Simplify ColumnExpressionValidator (#2650) --- .../table/impl/select/SwitchColumn.java | 22 +++--- .../io/deephaven/client/AggBySessionTest.java | 8 +- .../client/UpdateOrSelectSessionTest.java | 8 +- .../io/deephaven/client/WhereSessionTest.java | 8 +- py/client/tests/test_query.py | 9 --- .../validation/ColumnExpressionValidator.java | 75 +++++-------------- 6 files changed, 45 insertions(+), 85 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java index 4f2397d3548..1022bd34c76 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java @@ -73,29 +73,29 @@ public List initDef(Map> columnDefinitionMap @Override public Class getReturnedType() { - return realColumn.getReturnedType(); + return getRealColumn().getReturnedType(); } @Override public List getColumns() { - return realColumn.getColumns(); + return getRealColumn().getColumns(); } @Override public List getColumnArrays() { - return realColumn.getColumnArrays(); + return getRealColumn().getColumnArrays(); } @NotNull @Override public ColumnSource getDataView() { - return realColumn.getDataView(); + return getRealColumn().getDataView(); } @NotNull @Override public ColumnSource getLazyView() { - return realColumn.getLazyView(); + return getRealColumn().getLazyView(); } @Override @@ -110,12 +110,12 @@ public MatchPair getMatchPair() { @Override public WritableColumnSource newDestInstance(long size) { - return realColumn.newDestInstance(size); + return getRealColumn().newDestInstance(size); } @Override public WritableColumnSource newFlatDestInstance(long size) { - return realColumn.newFlatDestInstance(size); + return getRealColumn().newFlatDestInstance(size); } @Override @@ -129,17 +129,21 @@ public String toString() { } public SelectColumn getRealColumn() { + if (realColumn == null) { + throw new IllegalStateException( + "getRealColumn() is not available until this SwitchColumn is initialized; ensure that initInputs or initDef has been called first"); + } return realColumn; } @Override public boolean disallowRefresh() { - return Require.neqNull(realColumn, "realColumn").disallowRefresh(); + return getRealColumn().disallowRefresh(); } @Override public boolean isStateless() { - return Require.neqNull(realColumn, "realColumn").isStateless(); + return getRealColumn().isStateless(); } @Override diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java index 601e80a74cd..fc8e3472b73 100644 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java @@ -38,13 +38,13 @@ public void allowTimeTableII() throws InterruptedException, TableHandle.TableHan } @Test - public void disallowTickingI() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = i % 2"); + public void allowTickingI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = i % 2"); } @Test - public void disallowTickingII() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = ii % 2"); + public void allowTickingII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = ii % 2"); } @Test diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java index d401cd79a30..5a047cd5612 100644 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java @@ -84,13 +84,13 @@ public void allowTimeTableII() throws InterruptedException, TableHandle.TableHan } @Test - public void disallowTickingI() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = i"); + public void allowTickingI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = i"); } @Test - public void disallowTickingII() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = ii"); + public void allowTickingII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = ii"); } @Test diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java index 6341bef63ad..5dfda41708e 100644 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/WhereSessionTest.java @@ -42,13 +42,13 @@ public void allowTimeTableII() throws InterruptedException, TableHandle.TableHan } @Test - public void disallowTickingI() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "i % 2 == 0"); + public void allowTickingI() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "i % 2 == 0"); } @Test - public void disallowTickingII() throws InterruptedException { - disallow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "ii % 2 == 0"); + public void allowTickingII() throws InterruptedException, TableHandle.TableHandleException { + allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "ii % 2 == 0"); } @Test diff --git a/py/client/tests/test_query.py b/py/client/tests/test_query.py index c2d992488a3..f8886895b9e 100644 --- a/py/client/tests/test_query.py +++ b/py/client/tests/test_query.py @@ -21,15 +21,6 @@ def test_tail_update_static(self): result_table2 = query.exec() self.assertEqual(result_table.size, result_table2.size) - def test_tail_update_ticking_fail(self): - table = self.session.time_table(period=100000) - query = self.session.query(table).update(formulas=["Col1 = i + 1"]) \ - .tail(5).update(formulas=["Col2 = i * i"]) - - with self.assertRaises(DHError): - result_table = query.exec() - self.assertFalse(result_table.is_static) - def test_tail_update_join_fail(self): pa_table = csv.read_csv(self.csv_file) test_table = self.session.import_table(pa_table) diff --git a/server/src/main/java/io/deephaven/server/table/validation/ColumnExpressionValidator.java b/server/src/main/java/io/deephaven/server/table/validation/ColumnExpressionValidator.java index 8acc3cfe37d..46bf515ffcc 100644 --- a/server/src/main/java/io/deephaven/server/table/validation/ColumnExpressionValidator.java +++ b/server/src/main/java/io/deephaven/server/table/validation/ColumnExpressionValidator.java @@ -9,17 +9,13 @@ import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.MethodCallExpr; import com.github.javaparser.ast.expr.ObjectCreationExpr; -import com.github.javaparser.ast.visitor.GenericVisitorAdapter; +import com.github.javaparser.ast.visitor.VoidVisitorAdapter; import io.deephaven.base.verify.Assert; import io.deephaven.datastructures.util.CollectionUtil; -import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.BaseTable; import io.deephaven.engine.table.impl.QueryTable; -import io.deephaven.engine.table.impl.SelectValidationResult; import io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils; import io.deephaven.engine.table.impl.lang.QueryLanguageParser; -import io.deephaven.engine.table.impl.lang.QueryLanguageParser.Result; import io.deephaven.engine.table.impl.select.ConditionFilter; import io.deephaven.engine.table.impl.select.FormulaColumn; import io.deephaven.engine.table.impl.select.SelectColumn; @@ -27,8 +23,6 @@ import io.deephaven.engine.table.impl.select.SwitchColumn; import io.deephaven.engine.table.impl.select.WhereFilter; import io.deephaven.engine.table.impl.select.WhereFilterFactory; -import io.deephaven.engine.table.impl.select.analyzers.SelectAndViewAnalyzer; -import io.deephaven.engine.table.impl.select.codegen.FormulaAnalyzer; import io.deephaven.engine.util.ColorUtilImpl; import io.deephaven.libs.GroovyStaticImports; import io.deephaven.time.DateTime; @@ -39,10 +33,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -54,7 +45,7 @@ * This must be an early pass at the AST on the server, as the server's stricter validation will not function without * it. */ -public class ColumnExpressionValidator extends GenericVisitorAdapter { +public class ColumnExpressionValidator extends VoidVisitorAdapter { private static final Set whitelistedStaticMethods; private static final Set whitelistedInstanceMethods; static { @@ -103,36 +94,25 @@ public static WhereFilter[] validateSelectFilters(final String[] conditionalExpr return whereFilters; } - public static void validateColumnExpressions(final SelectColumn[] selectColumns, - final String[] originalExpressions, + public static void validateColumnExpressions(final SelectColumn[] selectColumns, final String[] originalExpressions, final Table table) { - assert (selectColumns.length == originalExpressions.length); - - final SelectValidationResult validationResult = ((QueryTable) table.coalesce()).validateSelect(selectColumns); - SelectAndViewAnalyzer top = validationResult.getAnalyzer(); - // We need the cloned columns because the SelectAndViewAnalyzer has left state behind in them - // (namely the "realColumn" of the SwitchColumn) that we want to look at in validateSelectColumnHelper. - final SelectColumn[] clonedColumns = validationResult.getClonedColumns(); - // Flatten and reverse the analyzer stack - final List analyzers = new ArrayList<>(); - while (top != null) { - analyzers.add(top); - top = top.getInner(); - } - Collections.reverse(analyzers); - assert (analyzers.size() == clonedColumns.length + 1); + // It's unfortunate that we have to validateSelect which does a bunch of analysis, just to get throw-away cloned + // columns back, so we can check here for disallowed methods. (We need to make sure SwitchColumns get + // initialized.) + final SelectColumn[] clonedColumns = + ((QueryTable) table.coalesce()).validateSelect(selectColumns).getClonedColumns(); + validateColumnExpressions(clonedColumns, originalExpressions); + } - final Map> availableColumns = new LinkedHashMap<>(); - for (int ii = 0; ii < clonedColumns.length; ++ii) { - analyzers.get(ii).updateColumnDefinitionsFromTopLayer(availableColumns); - validateSelectColumnHelper(clonedColumns[ii], originalExpressions[ii], availableColumns, table); + private static void validateColumnExpressions(final SelectColumn[] selectColumns, + final String[] originalExpressions) { + assert (selectColumns.length == originalExpressions.length); + for (int ii = 0; ii < selectColumns.length; ++ii) { + validateSelectColumnHelper(selectColumns[ii], originalExpressions[ii]); } } - private static void validateSelectColumnHelper(SelectColumn selectColumn, - final String originalExpression, - final Map> availableColumns, - final Table table) { + private static void validateSelectColumnHelper(SelectColumn selectColumn, final String originalExpression) { while (selectColumn instanceof SwitchColumn) { selectColumn = ((SwitchColumn) selectColumn).getRealColumn(); } @@ -145,28 +125,13 @@ private static void validateSelectColumnHelper(SelectColumn selectColumn, final int indexOfEquals = originalExpression.indexOf('='); Assert.assertion(indexOfEquals != -1, "Expected formula expression"); final String formulaString = originalExpression.substring(indexOfEquals + 1); - - final Result compiledFormula; final DateTimeUtils.Result timeConversionResult; try { timeConversionResult = DateTimeUtils.convertExpression(formulaString); - compiledFormula = FormulaAnalyzer.getCompiledFormula(availableColumns, timeConversionResult, null); } catch (final Exception e) { // in theory not possible, since we already parsed it once throw new IllegalStateException("Error occurred while re-compiling formula for whitelist", e); } - final boolean isAddOnly = table instanceof BaseTable && ((BaseTable) table).isAddOnly(); - if (table.isRefreshing() && !(isAddOnly && table.isFlat())) { - final Set disallowedVariables = new HashSet<>(); - disallowedVariables.add("i"); - disallowedVariables.add("ii"); - // TODO walk QueryScope.getInstance() and remove them too? - - if (compiledFormula.getVariablesUsed().stream().anyMatch(disallowedVariables::contains)) { - throw new IllegalStateException("Formulas involving live tables are not permitted to use i or ii"); - } - } - // we pass the formula itself, since this has undergone the time conversion validateInvocations(timeConversionResult.getConvertedFormula()); } @@ -200,9 +165,9 @@ private static void validateInvocations(String expression) { } @Override - public Void visit(final MethodCallExpr n, final Void arg) { + public void visit(final MethodCallExpr n, final Object arg) { // verify that this is a call on a supported instance, or is one of the supported static methods - if (!n.getScope().isPresent()) { + if (n.getScope().isEmpty()) { if (!whitelistedStaticMethods.contains(n.getNameAsString())) { throw new IllegalStateException( "User expressions are not permitted to use method " + n.getNameAsString()); @@ -215,11 +180,11 @@ public Void visit(final MethodCallExpr n, final Void arg) { "User expressions are not permitted to use method " + n.getNameAsString()); } } - return super.visit(n, arg); + super.visit(n, arg); } @Override - public Void visit(final ObjectCreationExpr n, final Void arg) { + public void visit(final ObjectCreationExpr n, final Object arg) { throw new IllegalStateException("Can't instantiate " + n.getType()); } } From 928aacc08875a4ecb9ffaae11d7d58a4ccac481a Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 22 Jul 2022 15:05:21 -0700 Subject: [PATCH 025/215] Upgrade CI to ubuntu-22.04 (#2669) --- .github/workflows/build-ci.yml | 10 +++++----- .github/workflows/check-ci.yml | 2 +- .github/workflows/cla.yml | 2 +- .github/workflows/docs-ci.yml | 6 +++--- .github/workflows/label-check-ci.yml | 2 +- .github/workflows/nightly-check-ci.yml | 2 +- .github/workflows/nightly-image-check.yml | 2 +- .github/workflows/publish-check-ci.yml | 2 +- .github/workflows/publish-ci.yml | 2 +- .github/workflows/quick-ci.yml | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 07274ffed7b..c2eff49b35a 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -6,7 +6,7 @@ on: jobs: server: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -244,7 +244,7 @@ jobs: ./docker/registry/tensorflow-base/build/crane/retag.sh grpc-proxy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -331,7 +331,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} envoy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -418,7 +418,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} web: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -514,7 +514,7 @@ jobs: ./docker/registry/nginx-base/build/crane/retag.sh web-plugin-packager: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/check-ci.yml b/.github/workflows/check-ci.yml index 495ba81f1f3..ed49037044d 100644 --- a/.github/workflows/check-ci.yml +++ b/.github/workflows/check-ci.yml @@ -8,7 +8,7 @@ on: jobs: checks: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 13623404b78..2a170cd81fc 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -16,7 +16,7 @@ on: jobs: CLAssistant: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: ${{ github.repository_owner == 'deephaven' }} steps: - name: "CLA Assistant" diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index e4a1032c4e1..bdc35ee1e4d 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -8,7 +8,7 @@ on: jobs: javadoc: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -72,7 +72,7 @@ jobs: remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }} pydoc: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -141,7 +141,7 @@ jobs: remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }} cppdoc: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/label-check-ci.yml b/.github/workflows/label-check-ci.yml index 70b443b4198..a6defd6c6dd 100644 --- a/.github/workflows/label-check-ci.yml +++ b/.github/workflows/label-check-ci.yml @@ -14,7 +14,7 @@ on: jobs: doc-labels: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index 93b2c4bffe1..2aece2133f8 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -17,7 +17,7 @@ jobs: gradle-task: ['check', 'testSerial', 'testParallel', 'testOutOfBand'] test-jvm-version: ['11', '17', '18'] if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/nightly-image-check.yml b/.github/workflows/nightly-image-check.yml index 45bba01445e..4564fdf28e7 100644 --- a/.github/workflows/nightly-image-check.yml +++ b/.github/workflows/nightly-image-check.yml @@ -7,7 +7,7 @@ on: jobs: compare: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/publish-check-ci.yml b/.github/workflows/publish-check-ci.yml index 7334475a928..bbd319a5fa3 100644 --- a/.github/workflows/publish-check-ci.yml +++ b/.github/workflows/publish-check-ci.yml @@ -13,7 +13,7 @@ on: jobs: # Job based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ publish-check-ci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: # Unfortunately, the official actions/download-artifact action is very limited in scope. # Can't use it yet in this context, https://github.com/actions/download-artifact/issues/60 diff --git a/.github/workflows/publish-ci.yml b/.github/workflows/publish-ci.yml index 64d41748d60..9ba9cb27dc3 100644 --- a/.github/workflows/publish-ci.yml +++ b/.github/workflows/publish-ci.yml @@ -8,7 +8,7 @@ on: jobs: publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/quick-ci.yml b/.github/workflows/quick-ci.yml index 80b49b7f80f..56dce44d92a 100644 --- a/.github/workflows/quick-ci.yml +++ b/.github/workflows/quick-ci.yml @@ -8,7 +8,7 @@ on: jobs: quick: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 From c926ceec8ffe7c198ffa68a592fd30c0f290b72e Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Sun, 24 Jul 2022 22:22:19 -0400 Subject: [PATCH 026/215] Bring latest C++ client work up to the main branch. (#2674) * Bring C++ library to up to main branch * add missing copyrights, remove flatbuffers references * Delete alt-arrow. It has served its purpose * First cython wrapping for our C++ code; so far only wrapping types.h, intended to be extended with more sources/classes/code from here. * Improved README. Co-authored-by: Cristian Ferretti --- cpp-client/deephaven/client/CMakeLists.txt | 160 +- .../deephaven/client/build-dependencies.sh | 101 +- .../deephaven/flatbuf/Barrage_generated.h | 515 +- .../client/arrowutil/arrow_visitors.h | 105 + .../deephaven/client/highlevel/impl/util.h | 59 - .../client/immerutil/abstract_flex_vector.h | 143 + .../client/immerutil/immer_column_source.h | 142 + .../{highlevel => }/impl/aggregate_impl.h | 18 +- .../impl/boolean_expression_impl.h | 12 +- .../client/{highlevel => }/impl/client_impl.h | 17 +- .../{highlevel => }/impl/columns_impl.h | 27 +- .../impl/datetime_expression_impl.h | 16 +- .../{highlevel => }/impl/escape_utils.h | 10 +- .../{highlevel => }/impl/expression_impl.h | 10 +- .../impl/numeric_expression_impl.h | 15 +- .../impl/string_expression_impl.h | 8 +- .../{highlevel => }/impl/table_handle_impl.h | 90 +- .../impl/table_handle_manager_impl.h | 14 +- .../private/deephaven/client/impl/util.h | 9 + .../client/{lowlevel => server}/server.h | 22 +- .../client/subscription/batch_parser.h | 25 + .../client/subscription/classic_table_state.h | 54 + .../client/subscription/immer_table_state.h | 51 + .../client/subscription/index_decoder.h | 39 + .../client/subscription/shift_processor.h | 19 + .../client/subscription/space_mapper.h | 44 + .../client/subscription/subscribe_thread.h | 21 + .../client/subscription/subscription_handle.h | 12 + .../client/subscription/update_processor.h | 39 + .../deephaven/client/utility/executor.h | 11 +- .../private/deephaven/client/utility/misc.h | 29 + .../public/deephaven/client/chunk/chunk.h | 193 + .../deephaven/client/chunk/chunk_filler.h | 18 + .../deephaven/client/chunk/chunk_maker.h | 20 + .../deephaven/client/{highlevel => }/client.h | 53 +- .../deephaven/client/column/column_source.h | 228 + .../client/{highlevel => }/columns.h | 34 +- .../deephaven/client/container/row_sequence.h | 65 + .../client/{highlevel => }/expressions.h | 19 +- .../client/highlevel/sad/chunk_filler.h | 16 - .../client/highlevel/sad/chunk_maker.h | 17 - .../client/highlevel/sad/sad_chunk.h | 102 - .../client/highlevel/sad/sad_column_source.h | 124 - .../client/highlevel/sad/sad_context.h | 10 - .../client/highlevel/sad/sad_row_sequence.h | 83 - .../client/highlevel/sad/sad_table.h | 29 - .../client/highlevel/sad/sad_ticking_table.h | 61 - .../highlevel/sad/sad_unwrapped_table.h | 34 - .../deephaven/client/highlevel/ticking.h | 29 - .../public/deephaven/client/table/table.h | 28 + .../include/public/deephaven/client/ticking.h | 123 + .../deephaven/client/{highlevel => }/types.h | 18 +- .../deephaven/client/utility/callbacks.h | 20 +- .../deephaven/client/utility/table_maker.h | 9 +- .../public/deephaven/client/utility/utility.h | 138 +- .../deephaven/proto/application.grpc.pb.cc | 5 +- .../deephaven/proto/application.grpc.pb.h | 104 +- .../proto/deephaven/proto/application.pb.cc | 293 +- .../proto/deephaven/proto/application.pb.h | 156 +- .../proto/deephaven/proto/console.grpc.pb.cc | 33 +- .../proto/deephaven/proto/console.grpc.pb.h | 670 +- .../proto/deephaven/proto/console.pb.cc | 5102 ++++++++------- .../client/proto/deephaven/proto/console.pb.h | 2740 ++++---- .../deephaven/proto/inputtable.grpc.pb.cc | 11 +- .../deephaven/proto/inputtable.grpc.pb.h | 184 +- .../proto/deephaven/proto/inputtable.pb.cc | 209 +- .../proto/deephaven/proto/inputtable.pb.h | 116 +- .../proto/deephaven/proto/object.grpc.pb.cc | 7 +- .../proto/deephaven/proto/object.grpc.pb.h | 110 +- .../client/proto/deephaven/proto/object.pb.cc | 208 +- .../client/proto/deephaven/proto/object.pb.h | 103 +- .../proto/partitionedtable.grpc.pb.cc | 178 + .../proto/partitionedtable.grpc.pb.h | 622 ++ .../deephaven/proto/partitionedtable.pb.cc | 1483 +++++ .../deephaven/proto/partitionedtable.pb.h | 1944 ++++++ .../proto/deephaven/proto/session.grpc.pb.cc | 29 +- .../proto/deephaven/proto/session.grpc.pb.h | 540 +- .../proto/deephaven/proto/session.pb.cc | 762 +-- .../client/proto/deephaven/proto/session.pb.h | 479 +- .../proto/deephaven/proto/table.grpc.pb.cc | 299 +- .../proto/deephaven/proto/table.grpc.pb.h | 3053 ++------- .../client/proto/deephaven/proto/table.pb.cc | 5782 ++++++++--------- .../client/proto/deephaven/proto/table.pb.h | 2731 ++++---- .../proto/deephaven/proto/ticket.grpc.pb.cc | 3 - .../proto/deephaven/proto/ticket.grpc.pb.h | 7 +- .../client/proto/deephaven/proto/ticket.pb.cc | 196 +- .../client/proto/deephaven/proto/ticket.pb.h | 102 +- .../deephaven/client/src/chunk/chunk.cc | 44 + .../client/src/chunk/chunk_filler.cc | 71 + .../deephaven/client/src/chunk/chunk_maker.cc | 61 + .../client/src/{highlevel => }/client.cc | 54 +- .../client/src/column/column_source.cc | 9 + .../client/src/{highlevel => }/columns.cc | 24 +- .../client/src/container/row_sequence.cc | 255 + .../client/src/{highlevel => }/expressions.cc | 84 +- .../client/src/highlevel/sad/chunk_filler.cc | 70 - .../client/src/highlevel/sad/chunk_maker.cc | 39 - .../client/src/highlevel/sad/sad_chunk.cc | 28 - .../src/highlevel/sad/sad_column_source.cc | 275 - .../client/src/highlevel/sad/sad_context.cc | 8 - .../src/highlevel/sad/sad_row_sequence.cc | 148 - .../client/src/highlevel/sad/sad_table.cc | 15 - .../src/highlevel/sad/sad_ticking_table.cc | 294 - .../src/highlevel/sad/sad_unwrapped_table.cc | 28 - .../deephaven/client/src/highlevel/ticking.cc | 7 - .../src/immerutil/abstract_flex_vector.cc | 11 + .../src/immerutil/immer_column_source.cc | 11 + .../{highlevel => }/impl/aggregate_impl.cc | 11 +- .../impl/boolean_expression_impl.cc | 47 +- .../src/{highlevel => }/impl/client_impl.cc | 17 +- .../src/{highlevel => }/impl/columns_impl.cc | 21 +- .../impl/datetime_expression_impl.cc | 31 +- .../src/{highlevel => }/impl/escape_utils.cc | 12 +- .../{highlevel => }/impl/expression_impl.cc | 14 +- .../impl/numeric_expression_impl.cc | 14 +- .../impl/string_expression_impl.cc | 16 +- .../{highlevel => }/impl/table_handle_impl.cc | 574 +- .../impl/table_handle_manager_impl.cc | 16 +- .../client/src/{lowlevel => server}/server.cc | 57 +- .../client/src/subscription/batch_parser.cc | 59 + .../src/subscription/classic_table_state.cc | 343 + .../src/subscription/immer_table_state.cc | 242 + .../client/src/subscription/index_decoder.cc | 150 + .../src/subscription/shift_processor.cc | 48 + .../client/src/subscription/space_mapper.cc | 154 + .../src/subscription/subscribe_thread.cc | 163 + .../src/subscription/update_processor.cc | 392 ++ .../deephaven/client/src/table/table.cc | 7 + cpp-client/deephaven/client/src/ticking.cc | 43 + .../client/src/{highlevel => }/types.cc | 14 +- .../deephaven/client/src/utility/misc.cc | 10 + .../client/src/utility/table_maker.cc | 8 +- .../deephaven/client/src/utility/utility.cc | 38 +- .../third_party/flatbuffers/LICENSE.txt | 7 + .../third_party/flatbuffers/allocator.h | 68 + .../client/third_party/flatbuffers/array.h | 243 + .../client/third_party/flatbuffers/base.h | 474 ++ .../client/third_party/flatbuffers/buffer.h | 142 + .../third_party/flatbuffers/buffer_ref.h | 53 + .../flatbuffers/default_allocator.h | 64 + .../third_party/flatbuffers/detached_buffer.h | 114 + .../flatbuffers/flatbuffer_builder.h | 1197 ++++ .../third_party/flatbuffers/flatbuffers.h | 270 + .../third_party/flatbuffers/stl_emulation.h | 509 ++ .../client/third_party/flatbuffers/string.h | 64 + .../client/third_party/flatbuffers/struct.h | 53 + .../client/third_party/flatbuffers/table.h | 168 + .../client/third_party/flatbuffers/util.h | 690 ++ .../client/third_party/flatbuffers/vector.h | 370 ++ .../third_party/flatbuffers/vector_downward.h | 271 + .../client/third_party/flatbuffers/verifier.h | 283 + .../build-all-examples/CMakeLists.txt | 2 + cpp-examples/cleanup/main.cc | 40 +- .../compare_approaches/CMakeLists.txt | 20 + cpp-examples/compare_approaches/main.cc | 671 ++ .../CMakeLists.txt | 6 +- .../create_table_with_arrow_flight/main.cc | 95 +- .../CMakeLists.txt | 6 +- .../create_table_with_table_maker/main.cc | 38 +- cpp-examples/do_exchange/CMakeLists.txt | 2 +- cpp-examples/do_exchange/main.cc | 472 +- cpp-examples/hello_world/main.cc | 5 +- .../CMakeLists.txt | 6 +- .../read_table_with_arrow_flight/main.cc | 53 +- cpp-examples/readcsv/main.cc | 62 +- .../src/main/proto/build-cpp-protos.sh | 9 + py/client2/.gitignore | 1 + py/client2/CMakeLists.txt | 105 + py/client2/README.md | 34 + py/client2/cmake_modules/BuildUtils.cmake | 936 +++ py/client2/cmake_modules/FindPython3Alt.cmake | 96 + py/client2/cmake_modules/UseCython.cmake | 187 + py/client2/pydeephaven2/.gitignore | 1 + py/client2/pydeephaven2/__init__.pxd | 1 + py/client2/pydeephaven2/__init__.py | 30 + py/client2/pydeephaven2/includes/__init__.pxd | 0 .../pydeephaven2/includes/libdeephaven.pxd | 18 + py/client2/pydeephaven2/pydeephaven2.pyx | 3 + py/client2/pydeephaven2/types.pxi | 28 + py/client2/setup.py | 248 + 180 files changed, 27021 insertions(+), 16800 deletions(-) create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h delete mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/util.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/aggregate_impl.h (85%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/boolean_expression_impl.h (77%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/client_impl.h (74%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/columns_impl.h (76%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/datetime_expression_impl.h (63%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/escape_utils.h (61%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/expression_impl.h (76%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/numeric_expression_impl.h (69%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/string_expression_impl.h (83%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/table_handle_impl.h (77%) rename cpp-client/deephaven/client/include/private/deephaven/client/{highlevel => }/impl/table_handle_manager_impl.h (90%) create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/impl/util.h rename cpp-client/deephaven/client/include/private/deephaven/client/{lowlevel => server}/server.h (95%) create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/shift_processor.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscription_handle.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_maker.h rename cpp-client/deephaven/client/include/public/deephaven/client/{highlevel => }/client.h (97%) create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h rename cpp-client/deephaven/client/include/public/deephaven/client/{highlevel => }/columns.h (95%) create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h rename cpp-client/deephaven/client/include/public/deephaven/client/{highlevel => }/expressions.h (98%) delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_filler.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_maker.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_chunk.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_column_source.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_context.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_row_sequence.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_table.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_ticking_table.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_unwrapped_table.h delete mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/highlevel/ticking.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/table/table.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/ticking.h rename cpp-client/deephaven/client/include/public/deephaven/client/{highlevel => }/types.h (94%) create mode 100644 cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.cc create mode 100644 cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.h create mode 100644 cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.cc create mode 100644 cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.h create mode 100644 cpp-client/deephaven/client/src/chunk/chunk.cc create mode 100644 cpp-client/deephaven/client/src/chunk/chunk_filler.cc create mode 100644 cpp-client/deephaven/client/src/chunk/chunk_maker.cc rename cpp-client/deephaven/client/src/{highlevel => }/client.cc (94%) create mode 100644 cpp-client/deephaven/client/src/column/column_source.cc rename cpp-client/deephaven/client/src/{highlevel => }/columns.cc (88%) create mode 100644 cpp-client/deephaven/client/src/container/row_sequence.cc rename cpp-client/deephaven/client/src/{highlevel => }/expressions.cc (91%) delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/chunk_filler.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/chunk_maker.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_chunk.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_column_source.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_context.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_row_sequence.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_table.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_ticking_table.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/sad/sad_unwrapped_table.cc delete mode 100644 cpp-client/deephaven/client/src/highlevel/ticking.cc create mode 100644 cpp-client/deephaven/client/src/immerutil/abstract_flex_vector.cc create mode 100644 cpp-client/deephaven/client/src/immerutil/immer_column_source.cc rename cpp-client/deephaven/client/src/{highlevel => }/impl/aggregate_impl.cc (79%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/boolean_expression_impl.cc (88%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/client_impl.cc (82%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/columns_impl.cc (86%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/datetime_expression_impl.cc (76%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/escape_utils.cc (86%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/expression_impl.cc (81%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/numeric_expression_impl.cc (93%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/string_expression_impl.cc (90%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/table_handle_impl.cc (55%) rename cpp-client/deephaven/client/src/{highlevel => }/impl/table_handle_manager_impl.cc (87%) rename cpp-client/deephaven/client/src/{lowlevel => server}/server.cc (94%) create mode 100644 cpp-client/deephaven/client/src/subscription/batch_parser.cc create mode 100644 cpp-client/deephaven/client/src/subscription/classic_table_state.cc create mode 100644 cpp-client/deephaven/client/src/subscription/immer_table_state.cc create mode 100644 cpp-client/deephaven/client/src/subscription/index_decoder.cc create mode 100644 cpp-client/deephaven/client/src/subscription/shift_processor.cc create mode 100644 cpp-client/deephaven/client/src/subscription/space_mapper.cc create mode 100644 cpp-client/deephaven/client/src/subscription/subscribe_thread.cc create mode 100644 cpp-client/deephaven/client/src/subscription/update_processor.cc create mode 100644 cpp-client/deephaven/client/src/table/table.cc create mode 100644 cpp-client/deephaven/client/src/ticking.cc rename cpp-client/deephaven/client/src/{highlevel => }/types.cc (91%) create mode 100644 cpp-client/deephaven/client/src/utility/misc.cc create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/allocator.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/array.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/base.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/buffer.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/string.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/struct.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/table.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/util.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/vector.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/verifier.h create mode 100644 cpp-examples/compare_approaches/CMakeLists.txt create mode 100644 cpp-examples/compare_approaches/main.cc create mode 100755 proto/proto-backplane-grpc/src/main/proto/build-cpp-protos.sh create mode 100644 py/client2/.gitignore create mode 100644 py/client2/CMakeLists.txt create mode 100644 py/client2/README.md create mode 100644 py/client2/cmake_modules/BuildUtils.cmake create mode 100644 py/client2/cmake_modules/FindPython3Alt.cmake create mode 100644 py/client2/cmake_modules/UseCython.cmake create mode 100644 py/client2/pydeephaven2/.gitignore create mode 100644 py/client2/pydeephaven2/__init__.pxd create mode 100644 py/client2/pydeephaven2/__init__.py create mode 100644 py/client2/pydeephaven2/includes/__init__.pxd create mode 100644 py/client2/pydeephaven2/includes/libdeephaven.pxd create mode 100644 py/client2/pydeephaven2/pydeephaven2.pyx create mode 100644 py/client2/pydeephaven2/types.pxi create mode 100644 py/client2/setup.py diff --git a/cpp-client/deephaven/client/CMakeLists.txt b/cpp-client/deephaven/client/CMakeLists.txt index 91a0f4ba706..f581256e186 100644 --- a/cpp-client/deephaven/client/CMakeLists.txt +++ b/cpp-client/deephaven/client/CMakeLists.txt @@ -8,79 +8,103 @@ include(GNUInstallDirs) find_package(Arrow REQUIRED) find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Flatbuffers REQUIRED) +find_package(Boost REQUIRED) +find_package(Immer REQUIRED) find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) find_package(Threads REQUIRED) set(ALL_FILES - src/lowlevel/server.cc - - include/private/deephaven/client/lowlevel/server.h - - src/highlevel/impl/aggregate_impl.cc - src/highlevel/impl/boolean_expression_impl.cc - src/highlevel/impl/client_impl.cc - src/highlevel/impl/columns_impl.cc - src/highlevel/impl/datetime_expression_impl.cc - src/highlevel/impl/escape_utils.cc - src/highlevel/impl/expression_impl.cc - src/highlevel/impl/numeric_expression_impl.cc - src/highlevel/impl/string_expression_impl.cc - src/highlevel/impl/table_handle_impl.cc - src/highlevel/impl/table_handle_manager_impl.cc - - include/private/deephaven/client/highlevel/impl/aggregate_impl.h - include/private/deephaven/client/highlevel/impl/boolean_expression_impl.h - include/private/deephaven/client/highlevel/impl/client_impl.h - include/private/deephaven/client/highlevel/impl/columns_impl.h - include/private/deephaven/client/highlevel/impl/datetime_expression_impl.h - include/private/deephaven/client/highlevel/impl/escape_utils.h - include/private/deephaven/client/highlevel/impl/expression_impl.h - include/private/deephaven/client/highlevel/impl/numeric_expression_impl.h - include/private/deephaven/client/highlevel/impl/string_expression_impl.h - include/private/deephaven/client/highlevel/impl/table_handle_impl.h - include/private/deephaven/client/highlevel/impl/table_handle_manager_impl.h - include/private/deephaven/client/highlevel/impl/util.h - - src/highlevel/columns.cc - src/highlevel/expressions.cc - src/highlevel/client.cc - src/highlevel/ticking.cc - src/highlevel/types.cc - src/highlevel/sad/chunk_filler.cc - src/highlevel/sad/chunk_maker.cc - src/highlevel/sad/sad_chunk.cc - src/highlevel/sad/sad_column_source.cc - src/highlevel/sad/sad_context.cc - src/highlevel/sad/sad_row_sequence.cc - src/highlevel/sad/sad_table.cc - src/highlevel/sad/sad_ticking_table.cc - src/highlevel/sad/sad_unwrapped_table.cc - - include/public/deephaven/client/highlevel/columns.h - include/public/deephaven/client/highlevel/expressions.h - include/public/deephaven/client/highlevel/client.h - include/public/deephaven/client/highlevel/ticking.h - include/public/deephaven/client/highlevel/types.h - include/public/deephaven/client/highlevel/sad/chunk_filler.h - include/public/deephaven/client/highlevel/sad/chunk_maker.h - include/public/deephaven/client/highlevel/sad/sad_chunk.h - include/public/deephaven/client/highlevel/sad/sad_column_source.h - include/public/deephaven/client/highlevel/sad/sad_context.h - include/public/deephaven/client/highlevel/sad/sad_row_sequence.h - include/public/deephaven/client/highlevel/sad/sad_table.h - include/public/deephaven/client/highlevel/sad/sad_ticking_table.h - include/public/deephaven/client/highlevel/sad/sad_unwrapped_table.h + src/server/server.cc + include/private/deephaven/client/server/server.h + + src/impl/aggregate_impl.cc + src/impl/boolean_expression_impl.cc + src/impl/client_impl.cc + src/impl/columns_impl.cc + src/impl/datetime_expression_impl.cc + src/impl/escape_utils.cc + src/impl/expression_impl.cc + src/impl/numeric_expression_impl.cc + src/impl/string_expression_impl.cc + src/impl/table_handle_impl.cc + src/impl/table_handle_manager_impl.cc + + include/private/deephaven/client/impl/aggregate_impl.h + include/private/deephaven/client/impl/boolean_expression_impl.h + include/private/deephaven/client/impl/client_impl.h + include/private/deephaven/client/impl/columns_impl.h + include/private/deephaven/client/impl/datetime_expression_impl.h + include/private/deephaven/client/impl/escape_utils.h + include/private/deephaven/client/impl/expression_impl.h + include/private/deephaven/client/impl/numeric_expression_impl.h + include/private/deephaven/client/impl/string_expression_impl.h + include/private/deephaven/client/impl/table_handle_impl.h + include/private/deephaven/client/impl/table_handle_manager_impl.h + include/private/deephaven/client/impl/util.h + + include/private/deephaven/client/arrowutil/arrow_visitors.h + + src/columns.cc + src/expressions.cc + src/client.cc + src/ticking.cc + src/types.cc + src/chunk/chunk.cc + src/chunk/chunk_filler.cc + src/chunk/chunk_maker.cc + src/column/column_source.cc + src/container/row_sequence.cc + src/table/table.cc + + include/public/deephaven/client/columns.h + include/public/deephaven/client/expressions.h + include/public/deephaven/client/client.h + include/public/deephaven/client/ticking.h + include/public/deephaven/client/types.h + include/public/deephaven/client/chunk/chunk.h + include/public/deephaven/client/chunk/chunk_filler.h + include/public/deephaven/client/chunk/chunk_maker.h + include/public/deephaven/client/column/column_source.h + include/public/deephaven/client/container/row_sequence.h + include/public/deephaven/client/table/table.h + + include/private/deephaven/client/subscription/batch_parser.h + include/private/deephaven/client/subscription/classic_table_state.h + include/private/deephaven/client/subscription/immer_table_state.h + include/private/deephaven/client/subscription/index_decoder.h + include/private/deephaven/client/subscription/shift_processor.h + include/private/deephaven/client/subscription/space_mapper.h + include/private/deephaven/client/subscription/subscribe_thread.h + include/private/deephaven/client/subscription/subscription_handle.h + include/private/deephaven/client/subscription/update_processor.h + src/subscription/batch_parser.cc + src/subscription/classic_table_state.cc + src/subscription/immer_table_state.cc + src/subscription/index_decoder.cc + src/subscription/shift_processor.cc + src/subscription/space_mapper.cc + src/subscription/subscribe_thread.cc + src/subscription/update_processor.cc + + + src/immerutil/abstract_flex_vector.cc + src/immerutil/immer_column_source.cc + include/private/deephaven/client/immerutil/abstract_flex_vector.h + include/private/deephaven/client/immerutil/immer_column_source.h src/utility/executor.cc + src/utility/misc.cc include/private/deephaven/client/utility/executor.h + include/private/deephaven/client/utility/misc.h src/utility/cbfuture.cc + src/utility/misc.cc src/utility/table_maker.cc src/utility/utility.cc include/public/deephaven/client/utility/callbacks.h include/public/deephaven/client/utility/cbfuture.h + include/private/deephaven/client/utility/misc.h include/public/deephaven/client/utility/table_maker.h include/public/deephaven/client/utility/utility.h @@ -92,6 +116,18 @@ set(ALL_FILES proto/deephaven/proto/console.grpc.pb.h proto/deephaven/proto/console.pb.cc proto/deephaven/proto/console.pb.h + proto/deephaven/proto/inputtable.grpc.pb.cc + proto/deephaven/proto/inputtable.grpc.pb.h + proto/deephaven/proto/inputtable.pb.cc + proto/deephaven/proto/inputtable.pb.h + proto/deephaven/proto/object.grpc.pb.cc + proto/deephaven/proto/object.grpc.pb.h + proto/deephaven/proto/object.pb.cc + proto/deephaven/proto/object.pb.h + proto/deephaven/proto/partitionedtable.grpc.pb.cc + proto/deephaven/proto/partitionedtable.grpc.pb.h + proto/deephaven/proto/partitionedtable.pb.cc + proto/deephaven/proto/partitionedtable.pb.h proto/deephaven/proto/session.grpc.pb.cc proto/deephaven/proto/session.grpc.pb.h proto/deephaven/proto/session.pb.cc @@ -114,7 +150,9 @@ add_library(client ${ALL_FILES}) add_library(deephaven::client ALIAS client) target_compile_options(client PRIVATE -Wall -Werror) +target_include_directories(client PRIVATE ${Boost_INCLUDE_DIR}) target_include_directories(client PRIVATE include/private) +target_include_directories(client PRIVATE third_party) target_include_directories(client PUBLIC $) # Protos and flatbuf are doing their own thing. @@ -123,7 +161,9 @@ target_include_directories(client PRIVATE "./flatbuf") target_link_libraries(client PUBLIC arrow_flight_static) target_link_libraries(client PUBLIC arrow_static) +target_link_libraries(client PUBLIC Boost::boost) +target_link_libraries(client PUBLIC immer) target_link_libraries(client PUBLIC protobuf::libprotobuf) -target_link_libraries(client PUBLIC flatbuffers::flatbuffers) target_link_libraries(client PUBLIC gRPC::grpc++) target_link_libraries(client PUBLIC Threads::Threads) + diff --git a/cpp-client/deephaven/client/build-dependencies.sh b/cpp-client/deephaven/client/build-dependencies.sh index b08ce5d4a4c..e9f9d138821 100755 --- a/cpp-client/deephaven/client/build-dependencies.sh +++ b/cpp-client/deephaven/client/build-dependencies.sh @@ -1,5 +1,9 @@ #!/bin/bash +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# + # # Tested on Ubuntu 20.04 # @@ -29,11 +33,21 @@ set -eux : ${BUILD_RE2:=yes} : ${BUILD_GFLAGS:=yes} : ${BUILD_ABSL:=yes} -: ${BUILD_FLATBUFFERS:=yes} +: ${BUILD_FLATBUFFERS:=no} : ${BUILD_CARES:=yes} : ${BUILD_ZLIB:=yes} : ${BUILD_GRPC:=yes} : ${BUILD_ARROW:=yes} +: ${BUILD_IMMER:=yes} +: ${BUILD_BOOST:=yes} + +: ${BOOST_VERSION:=1_79_0} + +# At the point of this writing, the latest immer release is pretty old. +# We want something a lot more recent, but don't want to track head as is a moving +# target and we can't guarantee things will continue to compile/be consistent. +# So we select a particular SHA. +: ${IMMER_SHA:=e5d79ed80ec74d511cc4f52fb68feeac66507f2c} # # End of user customization section; you should not need to modify the code below @@ -41,18 +55,30 @@ set -eux # # How many CPUs to use in -j arguments to make. -NCPUS=$(getconf _NPROCESSORS_ONLN) +: ${NCPUS:=$(getconf _NPROCESSORS_ONLN)} # Where the checked out sources for dependencies will go -SRC=$DHDEPS_HOME/src +: ${SRC:=$DHDEPS_HOME/src} # Where the install prefix paths will go -PFX=$DHDEPS_HOME/local +: ${PFX:=$DHDEPS_HOME/local} # Let's get make to print out commands as they run export VERBOSE=1 -export CMAKE_PREFIX_PATH=${PFX}/abseil:${PFX}/cares:${PFX}/flatbuffers:${PFX}/gflags:${PFX}/protobuf:${PFX}/re2:${PFX}/zlib:${PFX}/grpc:${PFX}/arrow:${PFX}/deephaven +export CMAKE_PREFIX_PATH=\ +${PFX}/abseil:\ +${PFX}/cares:\ +${PFX}/flatbuffers:\ +${PFX}/gflags:\ +${PFX}/protobuf:\ +${PFX}/re2:\ +${PFX}/zlib:\ +${PFX}/grpc:\ +${PFX}/arrow:\ +${PFX}/boost:\ +${PFX}/immer:\ +${PFX}/deephaven if [ ! -d $SRC ]; then mkdir -p $SRC @@ -67,19 +93,38 @@ fi # there is no guarantee where the CWD is after a prior phase. # +: ${GIT_FLAGS:="--quiet -c advice.detachedHead=false"} + if [ "$CHECKOUT" = "yes" ]; then cd $SRC - git clone -b v3.18.0 --depth 1 https://github.com/protocolbuffers/protobuf.git - git clone -b 2021-09-01 --depth 1 https://github.com/google/re2.git - git clone -b v2.2.2 --depth 1 https://github.com/gflags/gflags.git - git clone -b 20210324.2 --depth 1 https://github.com/abseil/abseil-cpp.git - git clone -b v2.0.0 --depth 1 https://github.com/google/flatbuffers.git - git clone -b cares-1_17_2 --depth 1 https://github.com/c-ares/c-ares.git - git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib - git clone -b v1.38.0 --depth 1 https://github.com/grpc/grpc - wget 'https://www.apache.org/dyn/closer.lua?action=download&filename=arrow/arrow-5.0.0/apache-arrow-5.0.0.tar.gz' -O apache-arrow-5.0.0.tar.gz - tar xfz apache-arrow-5.0.0.tar.gz - rm -f apache-arrow-5.0.0.tar.gz + git clone $GIT_FLAGS -b v3.20.1 --depth 1 https://github.com/protocolbuffers/protobuf.git + git clone $GIT_FLAGS -b 2022-04-01 --depth 1 https://github.com/google/re2.git + git clone $GIT_FLAGS -b v2.2.2 --depth 1 https://github.com/gflags/gflags.git + git clone $GIT_FLAGS -b 20210324.2 --depth 1 https://github.com/abseil/abseil-cpp.git + git clone $GIT_FLAGS -b v2.0.6 --depth 1 https://github.com/google/flatbuffers.git + git clone $GIT_FLAGS -b cares-1_18_1 --depth 1 https://github.com/c-ares/c-ares.git + git clone $GIT_FLAGS -b v1.2.11 --depth 1 https://github.com/madler/zlib + git clone $GIT_FLAGS -b v1.45.2 --depth 1 https://github.com/grpc/grpc + git clone $GIT_FLAGS -b apache-arrow-7.0.0 --depth 1 https://github.com/apache/arrow + git clone $GIT_FLAGS https://github.com/arximboldi/immer.git && (cd immer && git checkout "${IMMER_SHA}") + curl -sL https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_"${BOOST_VERSION}".tar.bz2 | tar jxf - + # Apply apache arrow patch. + (cd arrow && patch -p1 <> LoadRecordBatchSubset( + auto column = std::make_shared(); + RETURN_NOT_OK(loader.Load(&field, column.get())); + if (metadata->length() != column->length) { +- return Status::IOError("Array length did not match record batch length"); ++ // return Status::IOError("Array length did not match record batch length"); + } + columns[i] = std::move(column); + if (inclusion_mask) { +EOF +) fi ### Protobuf @@ -178,13 +223,35 @@ if [ "$BUILD_ARROW" = "yes" ]; then echo "*** Building arrow" export CPATH=${PFX}/abseil/include${CPATH+:$CPATH} export CPATH=${PFX}/protobuf/include${CPATH+:$CPATH} - cd $SRC/apache-arrow-5.0.0/cpp + cd $SRC/arrow/cpp mkdir -p build && cd build cmake -DARROW_BUILD_STATIC=ON -DARROW_FLIGHT=ON -DARROW_CSV=ON -DARROW_FILESYSTEM=ON -DARROW_DATASET=ON -DARROW_PARQUET=ON \ -DARROW_WITH_BZ2=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_ZSTD=ON -DARROW_WITH_BROTLI=ON \ + -DARROW_SIMD_LEVEL=NONE \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${PFX}/arrow .. make -j$NCPUS make install fi +### immer +if [ "$BUILD_IMMER" = "yes" ]; then + echo + echo "*** Building immer" + cd $SRC/immer + mkdir -p build && cd build + cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${PFX}/immer .. + make -j$NCPUS + make install +fi + +### boost +if [ "$BUILD_BOOST" = "yes" ]; then + echo + echo "*** Building boost" + cd $SRC/boost_"${BOOST_VERSION}" + ./bootstrap.sh --prefix=${PFX}/boost + ./b2 install +fi + echo DONE. +echo "Use CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" diff --git a/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h b/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h index d7eee086fe0..847ef655f13 100644 --- a/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h +++ b/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h @@ -97,7 +97,7 @@ inline const char * const *EnumNamesBarrageMessageType() { } inline const char *EnumNameBarrageMessageType(BarrageMessageType e) { - if (flatbuffers::IsOutRange(e, BarrageMessageType_None, BarrageMessageType_BarragePublicationRequest)) return ""; + if (::deephaven::third_party::flatbuffers::IsOutRange(e, BarrageMessageType_None, BarrageMessageType_BarragePublicationRequest)) return ""; const size_t index = static_cast(e); return EnumNamesBarrageMessageType()[index]; } @@ -134,13 +134,13 @@ inline const char * const *EnumNamesColumnConversionMode() { } inline const char *EnumNameColumnConversionMode(ColumnConversionMode e) { - if (flatbuffers::IsOutRange(e, ColumnConversionMode_Stringify, ColumnConversionMode_ThrowError)) return ""; + if (::deephaven::third_party::flatbuffers::IsOutRange(e, ColumnConversionMode_Stringify, ColumnConversionMode_ThrowError)) return ""; const size_t index = static_cast(e) - static_cast(ColumnConversionMode_Stringify); return EnumNamesColumnConversionMode()[index]; } /// The message wrapper used for all barrage app_metadata fields. -struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageMessageWrapperBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MAGIC = 4, @@ -157,13 +157,13 @@ struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl return static_cast(GetField(VT_MSG_TYPE, 0)); } /// The msg payload. - const flatbuffers::Vector *msg_payload() const { - return GetPointer *>(VT_MSG_PAYLOAD); + const ::deephaven::third_party::flatbuffers::Vector *msg_payload() const { + return GetPointer *>(VT_MSG_PAYLOAD); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_MAGIC) && - VerifyField(verifier, VT_MSG_TYPE) && + VerifyField(verifier, VT_MAGIC, 4) && + VerifyField(verifier, VT_MSG_TYPE, 1) && VerifyOffset(verifier, VT_MSG_PAYLOAD) && verifier.VerifyVector(msg_payload()) && verifier.EndTable(); @@ -172,33 +172,33 @@ struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl struct BarrageMessageWrapperBuilder { typedef BarrageMessageWrapper Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_magic(uint32_t magic) { fbb_.AddElement(BarrageMessageWrapper::VT_MAGIC, magic, 0); } void add_msg_type(io::deephaven::barrage::flatbuf::BarrageMessageType msg_type) { fbb_.AddElement(BarrageMessageWrapper::VT_MSG_TYPE, static_cast(msg_type), 0); } - void add_msg_payload(flatbuffers::Offset> msg_payload) { + void add_msg_payload(::deephaven::third_party::flatbuffers::Offset<::deephaven::third_party::flatbuffers::Vector> msg_payload) { fbb_.AddOffset(BarrageMessageWrapper::VT_MSG_PAYLOAD, msg_payload); } - explicit BarrageMessageWrapperBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageMessageWrapperBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageMessageWrapper( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageMessageWrapper( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint32_t magic = 0, io::deephaven::barrage::flatbuf::BarrageMessageType msg_type = io::deephaven::barrage::flatbuf::BarrageMessageType_None, - flatbuffers::Offset> msg_payload = 0) { + ::deephaven::third_party::flatbuffers::Offset<::deephaven::third_party::flatbuffers::Vector> msg_payload = 0) { BarrageMessageWrapperBuilder builder_(_fbb); builder_.add_msg_payload(msg_payload); builder_.add_magic(magic); @@ -206,8 +206,8 @@ inline flatbuffers::Offset CreateBarrageMessageWrapper( return builder_.Finish(); } -inline flatbuffers::Offset CreateBarrageMessageWrapperDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageMessageWrapperDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint32_t magic = 0, io::deephaven::barrage::flatbuf::BarrageMessageType msg_type = io::deephaven::barrage::flatbuf::BarrageMessageType_None, const std::vector *msg_payload = nullptr) { @@ -220,7 +220,7 @@ inline flatbuffers::Offset CreateBarrageMessageWrapperDir } /// Establish a new session. -struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef NewSessionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_PROTOCOL_VERSION = 4, @@ -231,12 +231,12 @@ struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return GetField(VT_PROTOCOL_VERSION, 0); } /// Arbitrary auth/handshake info. - const flatbuffers::Vector *payload() const { - return GetPointer *>(VT_PAYLOAD); + const ::deephaven::third_party::flatbuffers::Vector *payload() const { + return GetPointer *>(VT_PAYLOAD); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_PROTOCOL_VERSION) && + VerifyField(verifier, VT_PROTOCOL_VERSION, 4) && VerifyOffset(verifier, VT_PAYLOAD) && verifier.VerifyVector(payload()) && verifier.EndTable(); @@ -245,37 +245,37 @@ struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct NewSessionRequestBuilder { typedef NewSessionRequest Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_protocol_version(uint32_t protocol_version) { fbb_.AddElement(NewSessionRequest::VT_PROTOCOL_VERSION, protocol_version, 0); } - void add_payload(flatbuffers::Offset> payload) { + void add_payload(::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> payload) { fbb_.AddOffset(NewSessionRequest::VT_PAYLOAD, payload); } - explicit NewSessionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit NewSessionRequestBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateNewSessionRequest( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateNewSessionRequest( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint32_t protocol_version = 0, - flatbuffers::Offset> payload = 0) { + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> payload = 0) { NewSessionRequestBuilder builder_(_fbb); builder_.add_payload(payload); builder_.add_protocol_version(protocol_version); return builder_.Finish(); } -inline flatbuffers::Offset CreateNewSessionRequestDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateNewSessionRequestDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint32_t protocol_version = 0, const std::vector *payload = nullptr) { auto payload__ = payload ? _fbb.CreateVector(*payload) : 0; @@ -286,16 +286,16 @@ inline flatbuffers::Offset CreateNewSessionRequestDirect( } /// Refresh the provided session. -struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef RefreshSessionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SESSION = 4 }; /// this session token is only required if it is the first request of a handshake rpc stream - const flatbuffers::Vector *session() const { - return GetPointer *>(VT_SESSION); + const ::deephaven::third_party::flatbuffers::Vector *session() const { + return GetPointer *>(VT_SESSION); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_SESSION) && verifier.VerifyVector(session()) && @@ -305,32 +305,32 @@ struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl struct RefreshSessionRequestBuilder { typedef RefreshSessionRequest Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_session(flatbuffers::Offset> session) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_session (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session) { fbb_.AddOffset(RefreshSessionRequest::VT_SESSION, session); } - explicit RefreshSessionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit RefreshSessionRequestBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateRefreshSessionRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> session = 0) { +inline ::deephaven::third_party::flatbuffers::Offset CreateRefreshSessionRequest( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session = 0) { RefreshSessionRequestBuilder builder_(_fbb); builder_.add_session(session); return builder_.Finish(); } -inline flatbuffers::Offset CreateRefreshSessionRequestDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateRefreshSessionRequestDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *session = nullptr) { auto session__ = session ? _fbb.CreateVector(*session) : 0; return io::deephaven::barrage::flatbuf::CreateRefreshSessionRequest( @@ -339,7 +339,7 @@ inline flatbuffers::Offset CreateRefreshSessionRequestDir } /// Information about the current session state. -struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef SessionInfoResponseBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_METADATA_HEADER = 4, @@ -347,56 +347,56 @@ struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table VT_TOKEN_REFRESH_DEADLINE_MS = 8 }; /// this is the metadata header to identify this session with future requests; it must be lower-case and remain static for the life of the session - const flatbuffers::Vector *metadata_header() const { - return GetPointer *>(VT_METADATA_HEADER); + const ::deephaven::third_party::flatbuffers::Vector *metadata_header() const { + return GetPointer *>(VT_METADATA_HEADER); } /// this is the session_token; note that it may rotate - const flatbuffers::Vector *session_token() const { - return GetPointer *>(VT_SESSION_TOKEN); + const ::deephaven::third_party::flatbuffers::Vector *session_token() const { + return GetPointer *>(VT_SESSION_TOKEN); } /// a suggested time for the user to refresh the session if they do not do so earlier; value is denoted in milliseconds since epoch int64_t token_refresh_deadline_ms() const { return GetField(VT_TOKEN_REFRESH_DEADLINE_MS, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_METADATA_HEADER) && verifier.VerifyVector(metadata_header()) && VerifyOffset(verifier, VT_SESSION_TOKEN) && verifier.VerifyVector(session_token()) && - VerifyField(verifier, VT_TOKEN_REFRESH_DEADLINE_MS) && + VerifyField(verifier, VT_TOKEN_REFRESH_DEADLINE_MS, 8) && verifier.EndTable(); } }; struct SessionInfoResponseBuilder { typedef SessionInfoResponse Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_metadata_header(flatbuffers::Offset> metadata_header) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_metadata_header (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> metadata_header) { fbb_.AddOffset(SessionInfoResponse::VT_METADATA_HEADER, metadata_header); } - void add_session_token(flatbuffers::Offset> session_token) { + void add_session_token (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session_token) { fbb_.AddOffset(SessionInfoResponse::VT_SESSION_TOKEN, session_token); } void add_token_refresh_deadline_ms(int64_t token_refresh_deadline_ms) { fbb_.AddElement(SessionInfoResponse::VT_TOKEN_REFRESH_DEADLINE_MS, token_refresh_deadline_ms, 0); } - explicit SessionInfoResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit SessionInfoResponseBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateSessionInfoResponse( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> metadata_header = 0, - flatbuffers::Offset> session_token = 0, +inline ::deephaven::third_party::flatbuffers::Offset CreateSessionInfoResponse( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> metadata_header = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session_token = 0, int64_t token_refresh_deadline_ms = 0) { SessionInfoResponseBuilder builder_(_fbb); builder_.add_token_refresh_deadline_ms(token_refresh_deadline_ms); @@ -405,8 +405,8 @@ inline flatbuffers::Offset CreateSessionInfoResponse( return builder_.Finish(); } -inline flatbuffers::Offset CreateSessionInfoResponseDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateSessionInfoResponseDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *metadata_header = nullptr, const std::vector *session_token = nullptr, int64_t token_refresh_deadline_ms = 0) { @@ -419,7 +419,7 @@ inline flatbuffers::Offset CreateSessionInfoResponseDirect( token_refresh_deadline_ms); } -struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageSubscriptionOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_COLUMN_CONVERSION_MODE = 4, @@ -449,20 +449,20 @@ struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers: int32_t batch_size() const { return GetField(VT_BATCH_SIZE, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_COLUMN_CONVERSION_MODE) && - VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS) && - VerifyField(verifier, VT_MIN_UPDATE_INTERVAL_MS) && - VerifyField(verifier, VT_BATCH_SIZE) && + VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && + VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && + VerifyField(verifier, VT_MIN_UPDATE_INTERVAL_MS, 4) && + VerifyField(verifier, VT_BATCH_SIZE, 4) && verifier.EndTable(); } }; struct BarrageSubscriptionOptionsBuilder { typedef BarrageSubscriptionOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_column_conversion_mode(io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode) { fbb_.AddElement(BarrageSubscriptionOptions::VT_COLUMN_CONVERSION_MODE, static_cast(column_conversion_mode), 1); } @@ -475,19 +475,19 @@ struct BarrageSubscriptionOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSubscriptionOptions::VT_BATCH_SIZE, batch_size, 0); } - explicit BarrageSubscriptionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSubscriptionOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageSubscriptionOptions( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionOptions( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, int32_t min_update_interval_ms = 0, @@ -501,7 +501,7 @@ inline flatbuffers::Offset CreateBarrageSubscription } /// Describes the subscription the client would like to acquire. -struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageSubscriptionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, @@ -511,17 +511,16 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers: VT_REVERSE_VIEWPORT = 12 }; /// Ticket for the source data set. - const flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const ::deephaven::third_party::flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// The bitset of columns to subscribe. If not provided then all columns are subscribed. - const flatbuffers::Vector *columns() const { - return GetPointer *>(VT_COLUMNS); + const ::deephaven::third_party::flatbuffers::Vector *columns() const { + return GetPointer *>(VT_COLUMNS); } - /// This is an encoded and compressed RowSet in position-space to subscribe to. If not provided then the entire - /// table is requested. - const flatbuffers::Vector *viewport() const { - return GetPointer *>(VT_VIEWPORT); + /// This is an encoded and compressed RowSet in position-space to subscribe to. + const ::deephaven::third_party::flatbuffers::Vector *viewport() const { + return GetPointer *>(VT_VIEWPORT); } /// Options to configure your subscription. const io::deephaven::barrage::flatbuf::BarrageSubscriptionOptions *subscription_options() const { @@ -532,7 +531,7 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers: bool reverse_viewport() const { return GetField(VT_REVERSE_VIEWPORT, 0) != 0; } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -542,47 +541,47 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers: verifier.VerifyVector(viewport()) && VerifyOffset(verifier, VT_SUBSCRIPTION_OPTIONS) && verifier.VerifyTable(subscription_options()) && - VerifyField(verifier, VT_REVERSE_VIEWPORT) && + VerifyField(verifier, VT_REVERSE_VIEWPORT, 1) && verifier.EndTable(); } }; struct BarrageSubscriptionRequestBuilder { typedef BarrageSubscriptionRequest Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ticket(flatbuffers::Offset> ticket) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_TICKET, ticket); } - void add_columns(flatbuffers::Offset> columns) { + void add_columns (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_COLUMNS, columns); } - void add_viewport(flatbuffers::Offset> viewport) { + void add_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_VIEWPORT, viewport); } - void add_subscription_options(flatbuffers::Offset subscription_options) { + void add_subscription_options (::deephaven::third_party::flatbuffers::Offset subscription_options) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_SUBSCRIPTION_OPTIONS, subscription_options); } void add_reverse_viewport(bool reverse_viewport) { fbb_.AddElement(BarrageSubscriptionRequest::VT_REVERSE_VIEWPORT, static_cast(reverse_viewport), 0); } - explicit BarrageSubscriptionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSubscriptionRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageSubscriptionRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> ticket = 0, - flatbuffers::Offset> columns = 0, - flatbuffers::Offset> viewport = 0, - flatbuffers::Offset subscription_options = 0, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionRequest( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport = 0, + ::deephaven::third_party::flatbuffers::Offset subscription_options = 0, bool reverse_viewport = false) { BarrageSubscriptionRequestBuilder builder_(_fbb); builder_.add_subscription_options(subscription_options); @@ -593,12 +592,12 @@ inline flatbuffers::Offset CreateBarrageSubscription return builder_.Finish(); } -inline flatbuffers::Offset CreateBarrageSubscriptionRequestDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionRequestDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, const std::vector *columns = nullptr, const std::vector *viewport = nullptr, - flatbuffers::Offset subscription_options = 0, + ::deephaven::third_party::flatbuffers::Offset subscription_options = 0, bool reverse_viewport = false) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; auto columns__ = columns ? _fbb.CreateVector(*columns) : 0; @@ -612,7 +611,7 @@ inline flatbuffers::Offset CreateBarrageSubscription reverse_viewport); } -struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageSnapshotOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_COLUMN_CONVERSION_MODE = 4, @@ -634,19 +633,19 @@ struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab int32_t batch_size() const { return GetField(VT_BATCH_SIZE, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_COLUMN_CONVERSION_MODE) && - VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS) && - VerifyField(verifier, VT_BATCH_SIZE) && + VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && + VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && + VerifyField(verifier, VT_BATCH_SIZE, 4) && verifier.EndTable(); } }; struct BarrageSnapshotOptionsBuilder { typedef BarrageSnapshotOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_column_conversion_mode(io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode) { fbb_.AddElement(BarrageSnapshotOptions::VT_COLUMN_CONVERSION_MODE, static_cast(column_conversion_mode), 1); } @@ -656,19 +655,19 @@ struct BarrageSnapshotOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSnapshotOptions::VT_BATCH_SIZE, batch_size, 0); } - explicit BarrageSnapshotOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSnapshotOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageSnapshotOptions( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotOptions( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, int32_t batch_size = 0) { @@ -680,7 +679,7 @@ inline flatbuffers::Offset CreateBarrageSnapshotOptions( } /// Describes the snapshot the client would like to acquire. -struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageSnapshotRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, @@ -690,17 +689,17 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab VT_REVERSE_VIEWPORT = 12 }; /// Ticket for the source data set. - const flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const ::deephaven::third_party::flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// The bitset of columns to request. If not provided then all columns are requested. - const flatbuffers::Vector *columns() const { - return GetPointer *>(VT_COLUMNS); + const ::deephaven::third_party::flatbuffers::Vector *columns() const { + return GetPointer *>(VT_COLUMNS); } /// This is an encoded and compressed RowSet in position-space to subscribe to. If not provided then the entire /// table is requested. - const flatbuffers::Vector *viewport() const { - return GetPointer *>(VT_VIEWPORT); + const ::deephaven::third_party::flatbuffers::Vector *viewport() const { + return GetPointer *>(VT_VIEWPORT); } /// Options to configure your subscription. const io::deephaven::barrage::flatbuf::BarrageSnapshotOptions *snapshot_options() const { @@ -711,7 +710,7 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab bool reverse_viewport() const { return GetField(VT_REVERSE_VIEWPORT, 0) != 0; } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -721,47 +720,47 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab verifier.VerifyVector(viewport()) && VerifyOffset(verifier, VT_SNAPSHOT_OPTIONS) && verifier.VerifyTable(snapshot_options()) && - VerifyField(verifier, VT_REVERSE_VIEWPORT) && + VerifyField(verifier, VT_REVERSE_VIEWPORT, 1) && verifier.EndTable(); } }; struct BarrageSnapshotRequestBuilder { typedef BarrageSnapshotRequest Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ticket(flatbuffers::Offset> ticket) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { fbb_.AddOffset(BarrageSnapshotRequest::VT_TICKET, ticket); } - void add_columns(flatbuffers::Offset> columns) { + void add_columns (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns) { fbb_.AddOffset(BarrageSnapshotRequest::VT_COLUMNS, columns); } - void add_viewport(flatbuffers::Offset> viewport) { + void add_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport) { fbb_.AddOffset(BarrageSnapshotRequest::VT_VIEWPORT, viewport); } - void add_snapshot_options(flatbuffers::Offset snapshot_options) { + void add_snapshot_options (::deephaven::third_party::flatbuffers::Offset snapshot_options) { fbb_.AddOffset(BarrageSnapshotRequest::VT_SNAPSHOT_OPTIONS, snapshot_options); } void add_reverse_viewport(bool reverse_viewport) { fbb_.AddElement(BarrageSnapshotRequest::VT_REVERSE_VIEWPORT, static_cast(reverse_viewport), 0); } - explicit BarrageSnapshotRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSnapshotRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageSnapshotRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> ticket = 0, - flatbuffers::Offset> columns = 0, - flatbuffers::Offset> viewport = 0, - flatbuffers::Offset snapshot_options = 0, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotRequest( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport = 0, + ::deephaven::third_party::flatbuffers::Offset snapshot_options = 0, bool reverse_viewport = false) { BarrageSnapshotRequestBuilder builder_(_fbb); builder_.add_snapshot_options(snapshot_options); @@ -772,12 +771,12 @@ inline flatbuffers::Offset CreateBarrageSnapshotRequest( return builder_.Finish(); } -inline flatbuffers::Offset CreateBarrageSnapshotRequestDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotRequestDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, const std::vector *columns = nullptr, const std::vector *viewport = nullptr, - flatbuffers::Offset snapshot_options = 0, + ::deephaven::third_party::flatbuffers::Offset snapshot_options = 0, bool reverse_viewport = false) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; auto columns__ = columns ? _fbb.CreateVector(*columns) : 0; @@ -791,7 +790,7 @@ inline flatbuffers::Offset CreateBarrageSnapshotRequestD reverse_viewport); } -struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarragePublicationOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_USE_DEEPHAVEN_NULLS = 4 @@ -801,33 +800,33 @@ struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers:: bool use_deephaven_nulls() const { return GetField(VT_USE_DEEPHAVEN_NULLS, 0) != 0; } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS) && + VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && verifier.EndTable(); } }; struct BarragePublicationOptionsBuilder { typedef BarragePublicationOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_use_deephaven_nulls(bool use_deephaven_nulls) { fbb_.AddElement(BarragePublicationOptions::VT_USE_DEEPHAVEN_NULLS, static_cast(use_deephaven_nulls), 0); } - explicit BarragePublicationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarragePublicationOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarragePublicationOptions( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationOptions( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, bool use_deephaven_nulls = false) { BarragePublicationOptionsBuilder builder_(_fbb); builder_.add_use_deephaven_nulls(use_deephaven_nulls); @@ -837,21 +836,21 @@ inline flatbuffers::Offset CreateBarragePublicationOp /// Describes the table update stream the client would like to push to. This is similar to a DoPut but the client /// will send BarrageUpdateMetadata to explicitly describe the row key space. The updates sent adhere to the table /// update model semantics; thus BarragePublication enables the client to upload a ticking table. -struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarragePublicationRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, VT_PUBLISH_OPTIONS = 6 }; /// The destination Ticket. - const flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const ::deephaven::third_party::flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// Options to configure your request. const io::deephaven::barrage::flatbuf::BarragePublicationOptions *publish_options() const { return GetPointer(VT_PUBLISH_OPTIONS); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -863,39 +862,39 @@ struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers:: struct BarragePublicationRequestBuilder { typedef BarragePublicationRequest Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ticket(flatbuffers::Offset> ticket) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { fbb_.AddOffset(BarragePublicationRequest::VT_TICKET, ticket); } - void add_publish_options(flatbuffers::Offset publish_options) { + void add_publish_options (::deephaven::third_party::flatbuffers::Offset publish_options) { fbb_.AddOffset(BarragePublicationRequest::VT_PUBLISH_OPTIONS, publish_options); } - explicit BarragePublicationRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarragePublicationRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarragePublicationRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> ticket = 0, - flatbuffers::Offset publish_options = 0) { +inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationRequest( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, + ::deephaven::third_party::flatbuffers::Offset publish_options = 0) { BarragePublicationRequestBuilder builder_(_fbb); builder_.add_publish_options(publish_options); builder_.add_ticket(ticket); return builder_.Finish(); } -inline flatbuffers::Offset CreateBarragePublicationRequestDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationRequestDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, - flatbuffers::Offset publish_options = 0) { + ::deephaven::third_party::flatbuffers::Offset publish_options = 0) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; return io::deephaven::barrage::flatbuf::CreateBarragePublicationRequest( _fbb, @@ -903,18 +902,18 @@ inline flatbuffers::Offset CreateBarragePublicationRe publish_options); } -/// Holds all of the rowset data structures for the column being modified. -struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +/// Holds all of the index data structures for the column being modified. +struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageModColumnMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MODIFIED_ROWS = 4 }; /// This is an encoded and compressed RowSet for this column (within the viewport) that were modified. /// There is no notification for modifications outside of the viewport. - const flatbuffers::Vector *modified_rows() const { - return GetPointer *>(VT_MODIFIED_ROWS); + const ::deephaven::third_party::flatbuffers::Vector *modified_rows() const { + return GetPointer *>(VT_MODIFIED_ROWS); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MODIFIED_ROWS) && verifier.VerifyVector(modified_rows()) && @@ -924,32 +923,32 @@ struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::T struct BarrageModColumnMetadataBuilder { typedef BarrageModColumnMetadata Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_modified_rows(flatbuffers::Offset> modified_rows) { + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; + void add_modified_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> modified_rows) { fbb_.AddOffset(BarrageModColumnMetadata::VT_MODIFIED_ROWS, modified_rows); } - explicit BarrageModColumnMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageModColumnMetadataBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageModColumnMetadata( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> modified_rows = 0) { +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageModColumnMetadata( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> modified_rows = 0) { BarrageModColumnMetadataBuilder builder_(_fbb); builder_.add_modified_rows(modified_rows); return builder_.Finish(); } -inline flatbuffers::Offset CreateBarrageModColumnMetadataDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageModColumnMetadataDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, const std::vector *modified_rows = nullptr) { auto modified_rows__ = modified_rows ? _fbb.CreateVector(*modified_rows) : 0; return io::deephaven::barrage::flatbuf::CreateBarrageModColumnMetadata( @@ -959,7 +958,7 @@ inline flatbuffers::Offset CreateBarrageModColumnMetad /// A data header describing the shared memory layout of a "record" or "row" /// batch for a ticking barrage table. -struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { typedef BarrageUpdateMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NUM_ADD_BATCHES = 4, @@ -999,47 +998,47 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl } /// If this is a snapshot and the subscription is a viewport, then the effectively subscribed viewport /// will be included in the payload. It is an encoded and compressed RowSet. - const flatbuffers::Vector *effective_viewport() const { - return GetPointer *>(VT_EFFECTIVE_VIEWPORT); + const ::deephaven::third_party::flatbuffers::Vector *effective_viewport() const { + return GetPointer *>(VT_EFFECTIVE_VIEWPORT); } /// If this is a snapshot, then the effectively subscribed column set will be included in the payload. - const flatbuffers::Vector *effective_column_set() const { - return GetPointer *>(VT_EFFECTIVE_COLUMN_SET); + const ::deephaven::third_party::flatbuffers::Vector *effective_column_set() const { + return GetPointer *>(VT_EFFECTIVE_COLUMN_SET); } /// This is an encoded and compressed RowSet that was added in this update. - const flatbuffers::Vector *added_rows() const { - return GetPointer *>(VT_ADDED_ROWS); + const ::deephaven::third_party::flatbuffers::Vector *added_rows() const { + return GetPointer *>(VT_ADDED_ROWS); } /// This is an encoded and compressed RowSet that was removed in this update. - const flatbuffers::Vector *removed_rows() const { - return GetPointer *>(VT_REMOVED_ROWS); + const ::deephaven::third_party::flatbuffers::Vector *removed_rows() const { + return GetPointer *>(VT_REMOVED_ROWS); } - /// This is an encoded and compressed RowSetShiftData describing how the keyspace of unmodified rows changed. - const flatbuffers::Vector *shift_data() const { - return GetPointer *>(VT_SHIFT_DATA); + /// This is an encoded and compressed IndexShiftData describing how the keyspace of unmodified rows changed. + const ::deephaven::third_party::flatbuffers::Vector *shift_data() const { + return GetPointer *>(VT_SHIFT_DATA); } /// This is an encoded and compressed RowSet that was included with this update. /// (the server may include rows not in addedRows if this is a viewport subscription to refresh /// unmodified rows that were scoped into view) - const flatbuffers::Vector *added_rows_included() const { - return GetPointer *>(VT_ADDED_ROWS_INCLUDED); + const ::deephaven::third_party::flatbuffers::Vector *added_rows_included() const { + return GetPointer *>(VT_ADDED_ROWS_INCLUDED); } /// The list of modified column data are in the same order as the field nodes on the schema. - const flatbuffers::Vector> *mod_column_nodes() const { - return GetPointer> *>(VT_MOD_COLUMN_NODES); + const ::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset> *mod_column_nodes() const { + return GetPointer> *>(VT_MOD_COLUMN_NODES); } /// When this is set the viewport RowSet will be inverted against the length of the table. That is to say /// every position value is converted from `i` to `n - i - 1` if the table has `n` rows. bool effective_reverse_viewport() const { return GetField(VT_EFFECTIVE_REVERSE_VIEWPORT, 0) != 0; } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_NUM_ADD_BATCHES) && - VerifyField(verifier, VT_NUM_MOD_BATCHES) && - VerifyField(verifier, VT_FIRST_SEQ) && - VerifyField(verifier, VT_LAST_SEQ) && - VerifyField(verifier, VT_IS_SNAPSHOT) && + VerifyField(verifier, VT_NUM_ADD_BATCHES, 2) && + VerifyField(verifier, VT_NUM_MOD_BATCHES, 2) && + VerifyField(verifier, VT_FIRST_SEQ, 8) && + VerifyField(verifier, VT_LAST_SEQ, 8) && + VerifyField(verifier, VT_IS_SNAPSHOT, 1) && VerifyOffset(verifier, VT_EFFECTIVE_VIEWPORT) && verifier.VerifyVector(effective_viewport()) && VerifyOffset(verifier, VT_EFFECTIVE_COLUMN_SET) && @@ -1055,15 +1054,15 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl VerifyOffset(verifier, VT_MOD_COLUMN_NODES) && verifier.VerifyVector(mod_column_nodes()) && verifier.VerifyVectorOfTables(mod_column_nodes()) && - VerifyField(verifier, VT_EFFECTIVE_REVERSE_VIEWPORT) && + VerifyField(verifier, VT_EFFECTIVE_REVERSE_VIEWPORT, 1) && verifier.EndTable(); } }; struct BarrageUpdateMetadataBuilder { typedef BarrageUpdateMetadata Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; + ::deephaven::third_party::flatbuffers::uoffset_t start_; void add_num_add_batches(uint16_t num_add_batches) { fbb_.AddElement(BarrageUpdateMetadata::VT_NUM_ADD_BATCHES, num_add_batches, 0); } @@ -1079,55 +1078,55 @@ struct BarrageUpdateMetadataBuilder { void add_is_snapshot(bool is_snapshot) { fbb_.AddElement(BarrageUpdateMetadata::VT_IS_SNAPSHOT, static_cast(is_snapshot), 0); } - void add_effective_viewport(flatbuffers::Offset> effective_viewport) { + void add_effective_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_viewport) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_VIEWPORT, effective_viewport); } - void add_effective_column_set(flatbuffers::Offset> effective_column_set) { + void add_effective_column_set (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_column_set) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_COLUMN_SET, effective_column_set); } - void add_added_rows(flatbuffers::Offset> added_rows) { + void add_added_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows) { fbb_.AddOffset(BarrageUpdateMetadata::VT_ADDED_ROWS, added_rows); } - void add_removed_rows(flatbuffers::Offset> removed_rows) { + void add_removed_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> removed_rows) { fbb_.AddOffset(BarrageUpdateMetadata::VT_REMOVED_ROWS, removed_rows); } - void add_shift_data(flatbuffers::Offset> shift_data) { + void add_shift_data (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> shift_data) { fbb_.AddOffset(BarrageUpdateMetadata::VT_SHIFT_DATA, shift_data); } - void add_added_rows_included(flatbuffers::Offset> added_rows_included) { + void add_added_rows_included (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows_included) { fbb_.AddOffset(BarrageUpdateMetadata::VT_ADDED_ROWS_INCLUDED, added_rows_included); } - void add_mod_column_nodes(flatbuffers::Offset>> mod_column_nodes) { + void add_mod_column_nodes (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset>> mod_column_nodes) { fbb_.AddOffset(BarrageUpdateMetadata::VT_MOD_COLUMN_NODES, mod_column_nodes); } void add_effective_reverse_viewport(bool effective_reverse_viewport) { fbb_.AddElement(BarrageUpdateMetadata::VT_EFFECTIVE_REVERSE_VIEWPORT, static_cast(effective_reverse_viewport), 0); } - explicit BarrageUpdateMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageUpdateMetadataBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - flatbuffers::Offset Finish() { + ::deephaven::third_party::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = ::deephaven::third_party::flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateBarrageUpdateMetadata( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageUpdateMetadata( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint16_t num_add_batches = 0, uint16_t num_mod_batches = 0, int64_t first_seq = 0, int64_t last_seq = 0, bool is_snapshot = false, - flatbuffers::Offset> effective_viewport = 0, - flatbuffers::Offset> effective_column_set = 0, - flatbuffers::Offset> added_rows = 0, - flatbuffers::Offset> removed_rows = 0, - flatbuffers::Offset> shift_data = 0, - flatbuffers::Offset> added_rows_included = 0, - flatbuffers::Offset>> mod_column_nodes = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_viewport = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_column_set = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> removed_rows = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> shift_data = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows_included = 0, + ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset>> mod_column_nodes = 0, bool effective_reverse_viewport = false) { BarrageUpdateMetadataBuilder builder_(_fbb); builder_.add_last_seq(last_seq); @@ -1146,8 +1145,8 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadata( return builder_.Finish(); } -inline flatbuffers::Offset CreateBarrageUpdateMetadataDirect( - flatbuffers::FlatBufferBuilder &_fbb, +inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageUpdateMetadataDirect( + ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, uint16_t num_add_batches = 0, uint16_t num_mod_batches = 0, int64_t first_seq = 0, @@ -1159,7 +1158,7 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadataDir const std::vector *removed_rows = nullptr, const std::vector *shift_data = nullptr, const std::vector *added_rows_included = nullptr, - const std::vector> *mod_column_nodes = nullptr, + const std::vector <::deephaven::third_party::flatbuffers::Offset> *mod_column_nodes = nullptr, bool effective_reverse_viewport = false) { auto effective_viewport__ = effective_viewport ? _fbb.CreateVector(*effective_viewport) : 0; auto effective_column_set__ = effective_column_set ? _fbb.CreateVector(*effective_column_set) : 0; @@ -1167,7 +1166,7 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadataDir auto removed_rows__ = removed_rows ? _fbb.CreateVector(*removed_rows) : 0; auto shift_data__ = shift_data ? _fbb.CreateVector(*shift_data) : 0; auto added_rows_included__ = added_rows_included ? _fbb.CreateVector(*added_rows_included) : 0; - auto mod_column_nodes__ = mod_column_nodes ? _fbb.CreateVector>(*mod_column_nodes) : 0; + auto mod_column_nodes__ = mod_column_nodes ? _fbb.CreateVector <::deephaven::third_party::flatbuffers::Offset>(*mod_column_nodes) : 0; return io::deephaven::barrage::flatbuf::CreateBarrageUpdateMetadata( _fbb, num_add_batches, @@ -1185,36 +1184,6 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadataDir effective_reverse_viewport); } -inline const io::deephaven::barrage::flatbuf::BarrageMessageWrapper *GetBarrageMessageWrapper(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const io::deephaven::barrage::flatbuf::BarrageMessageWrapper *GetSizePrefixedBarrageMessageWrapper(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyBarrageMessageWrapperBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedBarrageMessageWrapperBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishBarrageMessageWrapperBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedBarrageMessageWrapperBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - } // namespace flatbuf } // namespace barrage } // namespace deephaven diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h new file mode 100644 index 00000000000..a280cc41727 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include + +namespace deephaven::client::arrowutil { + +template +class ArrowTypeVisitor final : public arrow::TypeVisitor { +public: + ArrowTypeVisitor() = default; + explicit ArrowTypeVisitor(Inner inner) : inner_(std::move(inner)) {} + + arrow::Status Visit(const arrow::Int8Type &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int16Type &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int32Type &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int64Type &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::FloatType &type) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::DoubleType &type) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::StringType &type) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + Inner &inner() { return inner_; } + const Inner &inner() const { return inner_; } + +private: + Inner inner_; +}; + +template +class ArrowArrayTypeVisitor : public arrow::ArrayVisitor { +public: + ArrowArrayTypeVisitor() = default; + explicit ArrowArrayTypeVisitor(Inner inner) : inner_(std::move(inner)) {} + + arrow::Status Visit(const arrow::Int8Array &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int16Array &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int32Array &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int64Array &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::FloatArray &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::DoubleArray &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::StringArray &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + Inner &inner() { return inner_; } + const Inner &inner() const { return inner_; } + +private: + Inner inner_; +}; +} // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/util.h b/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/util.h deleted file mode 100644 index fba750c8624..00000000000 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/util.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include "deephaven/client/utility/utility.h" - -namespace deephaven::client::highlevel::impl { - -#if defined(__clang__) -#define DEEPHAVEN_PRETTY_FUNCTION __PRETTY_FUNCTION__ -#elif defined(__GNUC__) -#define DEEPHAVEN_PRETTY_FUNCTION __PRETTY_FUNCTION__ -#elif defined(__MSC_VER) -#define DEEPHAVEN_PRETTY_FUNCTION __FUNCSIG__ -#else -# error Unsupported compiler -#endif - -// https://stackoverflow.com/questions/281818/unmangling-the-result-of-stdtype-infoname -template -constexpr std::string_view getTypeName() { -#if defined(__clang__) - constexpr auto prefix = std::string_view{"[T = "}; - constexpr auto suffix = "]"; -#elif defined(__GNUC__) - constexpr auto prefix = std::string_view{"with T = "}; - constexpr auto suffix = "; "; -#elif defined(__MSC_VER) - constexpr auto prefix = std::string_view{"get_type_name<"}; - constexpr auto suffix = ">(void)"; -#else -# error Unsupported compiler -#endif - - constexpr auto function = std::string_view{DEEPHAVEN_PRETTY_FUNCTION}; - - const auto start = function.find(prefix) + prefix.size(); - const auto end = function.find(suffix); - const auto size = end - start; - - return function.substr(start, size); -} - -template -DESTP verboseCast(std::string_view caller, SRCP ptr) { - using deephaven::client::utility::stringf; - - auto *typedPtr = dynamic_cast(ptr); - if (typedPtr != nullptr) { - return typedPtr; - } - typedef decltype(*std::declval()) destType_t; - auto message = stringf("%o: Expected type %o. Got type %o", - caller, getTypeName(), typeid(*ptr).name()); - throw std::runtime_error(message); -} -} // namespace deephaven::client::highlevel::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h new file mode 100644 index 00000000000..1c36f17b3b0 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/immerutil/immer_column_source.h" +#include "deephaven/client/utility/utility.h" + +namespace deephaven::client::immerutil { +namespace internal { +template +struct CorrespondingArrowArrayType {}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int8Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int16Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int32Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int64Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::FloatArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::DoubleArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::StringArray type_t; +}; + +struct FlexVectorAppender { + template + static void append(const ARROW_SRC &src, immer::flex_vector *dest) { + auto transient = dest->transient(); + for (auto element : src) { + if (!element.has_value()) { + throw std::runtime_error("TODO(kosak): we are not dealing with null values yet"); + } + transient.push_back(*element); + } + *dest = transient.persistent(); + } + + static void append(const arrow::StringArray &src, immer::flex_vector *dest) { + auto transient = dest->transient(); + for (auto element : src) { + if (!element.has_value()) { + throw std::runtime_error("TODO(kosak): we are not dealing with null values yet"); + } + transient.push_back(std::string(*element)); + } + *dest = transient.persistent(); + } +}; +} // namespace internal +template +class AbstractFlexVector; + +/** + * This class allows us to manipulate an immer::flex_vector without needing to know what type + * it's instantiated on. + */ +class AbstractFlexVectorBase { +protected: + typedef deephaven::client::column::ColumnSource ColumnSource; +public: + template + static std::unique_ptr create(immer::flex_vector vec); + + virtual ~AbstractFlexVectorBase(); + + virtual std::unique_ptr take(size_t n) = 0; + virtual void inPlaceDrop(size_t n) = 0; + virtual void inPlaceAppend(std::unique_ptr other) = 0; + virtual void inPlaceAppendArrow(const arrow::Array &data) = 0; + + virtual std::shared_ptr makeColumnSource() const = 0; +}; + +template +class AbstractFlexVector final : public AbstractFlexVectorBase { +public: + explicit AbstractFlexVector(immer::flex_vector vec) : vec_(std::move(vec)) {} + + std::unique_ptr take(size_t n) final { + return create(vec_.take(n)); + } + + void inPlaceDrop(size_t n) final { + auto temp = std::move(vec_).drop(n); + vec_ = std::move(temp); + } + + void inPlaceAppend(std::unique_ptr other) final { + auto *otherVec = deephaven::client::utility::verboseCast(other.get(), + DEEPHAVEN_PRETTY_FUNCTION); + auto temp = std::move(vec_) + std::move(otherVec->vec_); + vec_ = std::move(temp); + } + + void inPlaceAppendArrow(const arrow::Array &data) final { + typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; + auto *typedArrow = deephaven::client::utility::verboseCast(&data, + DEEPHAVEN_PRETTY_FUNCTION); + internal::FlexVectorAppender::append(*typedArrow, &vec_); + } + + std::shared_ptr makeColumnSource() const final { + return deephaven::client::immerutil::ImmerColumnSource::create(vec_); + } + +private: + immer::flex_vector vec_; +}; + +template +std::unique_ptr AbstractFlexVectorBase::create(immer::flex_vector vec) { + return std::make_unique>(std::move(vec)); +} +} // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h new file mode 100644 index 00000000000..74881645108 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once +#include +#include +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/utility/utility.h" + +namespace deephaven::client::immerutil { +namespace internal { +struct ColumnSourceImpls { + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + + template + static void fillChunk(const immer::flex_vector &src, const RowSequence &rows, Chunk *dest) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + typedef typename TypeToChunk::type_t chunkType_t; + auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); + + assertLessEq(rows.size(), typedDest->size(), DEEPHAVEN_PRETTY_FUNCTION, "rows.size()", + "typedDest->size()"); + auto *destp = typedDest->data(); + + auto copyDataInner = [&destp](const T *dataBegin, const T *dataEnd) { + for (const T *current = dataBegin; current != dataEnd; ++current) { + *destp++ = *current; + } + }; + + auto copyDataOuter = [&src, ©DataInner](uint64_t srcBegin, uint64_t srcEnd) { + auto srcBeginp = src.begin() + srcBegin; + auto srcEndp = src.begin() + srcEnd; + immer::for_each_chunk(srcBeginp, srcEndp, copyDataInner); + }; + rows.forEachChunk(copyDataOuter); + } + + template + static void fillChunkUnordered(const immer::flex_vector &src, const UInt64Chunk &rowKeys, + Chunk *dest) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + + typedef typename TypeToChunk::type_t chunkType_t; + + auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); + assertLessEq(rowKeys.size(), typedDest->size(), DEEPHAVEN_PRETTY_FUNCTION, "rowKeys.size()", + "typedDest->size()"); + auto *destp = typedDest->data(); + + // Note: Uses random access with Immer, which is rather more expensive than iterating + // over contiguous Immer ranges. + for (auto key : rowKeys) { + *destp++ = src[key]; + } + } +}; +} // namespace internal + +class ImmerColumnSource : public virtual deephaven::client::column::ColumnSource { +public: + template + static std::shared_ptr create(immer::flex_vector vec); + + static std::shared_ptr create(immer::flex_vector vec); +}; + +template +class ImmerNumericColumnSource final : public ImmerColumnSource, + public deephaven::client::column::NumericColumnSource, + std::enable_shared_from_this> { + + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::column::ColumnSourceVisitor ColumnSourceVisitor; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + explicit ImmerNumericColumnSource(immer::flex_vector data) : data_(std::move(data)) {} + ~ImmerNumericColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest) const final { + internal::ColumnSourceImpls::fillChunk(data_, rows, dest); + } + + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final { + internal::ColumnSourceImpls::fillChunkUnordered(data_, rowKeys, dest); + } + + void acceptVisitor(ColumnSourceVisitor *visitor) const final { + visitor->visit(*this); + } + + std::any backdoor() const final { + return &data_; + } + +private: + immer::flex_vector data_; +}; + +class ImmerStringColumnSource final : public ImmerColumnSource, + public deephaven::client::column::StringColumnSource, + std::enable_shared_from_this { + typedef deephaven::client::column::ColumnSourceVisitor ColumnSourceVisitor; +public: + explicit ImmerStringColumnSource(immer::flex_vector data) : data_(std::move(data)) {} + ~ImmerStringColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest) const final { + internal::ColumnSourceImpls::fillChunk(data_, rows, dest); + } + + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final { + internal::ColumnSourceImpls::fillChunkUnordered(data_, rowKeys, dest); + } + + void acceptVisitor(ColumnSourceVisitor *visitor) const final { + visitor->visit(*this); + } + +private: + immer::flex_vector data_; +}; + +template +std::shared_ptr ImmerColumnSource::create(immer::flex_vector vec) { + return std::make_shared>(std::move(vec)); +} + +inline std::shared_ptr ImmerColumnSource::create( + immer::flex_vector vec) { + return std::make_shared(std::move(vec)); +} +} // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/aggregate_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/aggregate_impl.h similarity index 85% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/aggregate_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/aggregate_impl.h index 9d00fdf309d..dcb82ac5a2e 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/aggregate_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/aggregate_impl.h @@ -9,14 +9,11 @@ #include "deephaven/proto/table.pb.h" #include "deephaven/proto/table.grpc.pb.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { - +namespace deephaven::client::impl { class AggregateImpl { typedef io::deephaven::proto::backplane::grpc::ComboAggregateRequest ComboAggregateRequest; - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(ComboAggregateRequest::Aggregate descriptor); @@ -36,7 +33,8 @@ class AggregateImpl { class AggregateComboImpl { typedef io::deephaven::proto::backplane::grpc::ComboAggregateRequest ComboAggregateRequest; - struct Private {}; + struct Private { + }; public: static std::shared_ptr create( @@ -50,8 +48,4 @@ class AggregateComboImpl { private: std::vector aggregates_; }; - -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/boolean_expression_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/boolean_expression_impl.h similarity index 77% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/boolean_expression_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/boolean_expression_impl.h index 18bb08e2525..987b72a68cf 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/boolean_expression_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/boolean_expression_impl.h @@ -5,12 +5,9 @@ #include #include -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class BooleanExpressionImpl : public ExpressionImpl { public: static std::shared_ptr createNot(std::shared_ptr item); @@ -24,7 +21,4 @@ class BooleanExpressionImpl : public ExpressionImpl { ~BooleanExpressionImpl() override; }; -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/client_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/client_impl.h similarity index 74% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/client_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/client_impl.h index ce30d4703f2..53813084a6b 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/client_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/client_impl.h @@ -4,20 +4,19 @@ #pragma once #include -#include "deephaven/client/highlevel/client.h" -#include "deephaven/client/lowlevel/server.h" +#include "deephaven/client/client.h" +#include "deephaven/client/server/server.h" #include "deephaven/client/utility/callbacks.h" #include "deephaven/client/utility/executor.h" #include "deephaven/client/utility/utility.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { class ClientImpl { - struct Private {}; - typedef deephaven::client::lowlevel::Server Server; + struct Private { + }; + typedef deephaven::client::server::Server Server; typedef deephaven::client::utility::Executor Executor; template @@ -36,6 +35,4 @@ class ClientImpl { std::shared_ptr managerImpl_; }; } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/columns_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/columns_impl.h similarity index 76% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/columns_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/columns_impl.h index bc08a26b85d..86b104d1cb9 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/columns_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/columns_impl.h @@ -4,18 +4,16 @@ #pragma once #include -#include "deephaven/client/highlevel/impl/datetime_expression_impl.h" -#include "deephaven/client/highlevel/impl/expression_impl.h" -#include "deephaven/client/highlevel/impl/numeric_expression_impl.h" -#include "deephaven/client/highlevel/impl/string_expression_impl.h" - -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +#include "deephaven/client/impl/datetime_expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" +#include "deephaven/client/impl/numeric_expression_impl.h" +#include "deephaven/client/impl/string_expression_impl.h" + +namespace deephaven::client::impl { class ColumnImpl : public ExpressionImpl { protected: - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(std::string name); @@ -56,7 +54,8 @@ class DateTimeColImpl final : public DateTimeExpressionImpl, public ColumnImpl { }; class AssignedColumnImpl final : public IrisRepresentableImpl { - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(std::string name, @@ -70,8 +69,4 @@ class AssignedColumnImpl final : public IrisRepresentableImpl { std::string name_; std::shared_ptr expr_; }; - -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/datetime_expression_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/datetime_expression_impl.h similarity index 63% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/datetime_expression_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/datetime_expression_impl.h index 0de67a6e170..90ba8b0bf80 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/datetime_expression_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/datetime_expression_impl.h @@ -5,16 +5,13 @@ #include #include -#include "deephaven/client/highlevel/columns.h" -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/columns.h" +#include "deephaven/client/impl/expression_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class DateTimeExpressionImpl : public ExpressionImpl { protected: - typedef deephaven::client::highlevel::DateTime DateTime; + typedef deephaven::client::DateTime DateTime; public: static std::shared_ptr createFromLiteral(std::string value); @@ -26,7 +23,4 @@ class DateTimeExpressionImpl : public ExpressionImpl { ~DateTimeExpressionImpl() override; }; -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/escape_utils.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/escape_utils.h similarity index 61% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/escape_utils.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/escape_utils.h index 7b43716a153..8f8870607d4 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/escape_utils.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/escape_utils.h @@ -6,16 +6,10 @@ #include #include -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class EscapeUtils { public: static std::string escapeJava(std::string_view s); static void appendEscapedJava(std::string_view s, std::string *dest); }; -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/expression_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/expression_impl.h similarity index 76% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/expression_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/expression_impl.h index 10b9b123869..d7b7bb0f9f6 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/expression_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/expression_impl.h @@ -6,10 +6,7 @@ #include #include -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class BooleanExpressionImpl; class IrisRepresentableImpl { @@ -25,7 +22,4 @@ class ExpressionImpl : public virtual IrisRepresentableImpl { static std::shared_ptr createIsNull(std::shared_ptr impl); ~ExpressionImpl() override; }; -} // namespace impl { -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/numeric_expression_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/numeric_expression_impl.h similarity index 69% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/numeric_expression_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/numeric_expression_impl.h index 94dd8014a26..c2226e469cd 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/numeric_expression_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/numeric_expression_impl.h @@ -5,18 +5,16 @@ #include #include -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class NumericExpressionImpl : public ExpressionImpl { public: static std::shared_ptr createUnaryOperator(char op, std::shared_ptr child); static std::shared_ptr createBinaryOperator( - std::shared_ptr lhs, char op, std::shared_ptr rhs); + std::shared_ptr lhs, char op, + std::shared_ptr rhs); static std::shared_ptr createComparisonOperator( std::shared_ptr lhs, const char *op, std::shared_ptr rhs); @@ -25,7 +23,4 @@ class NumericExpressionImpl : public ExpressionImpl { ~NumericExpressionImpl() override; }; -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/string_expression_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/string_expression_impl.h similarity index 83% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/string_expression_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/string_expression_impl.h index 7e35b0aa82b..2f2acf24d2c 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/string_expression_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/string_expression_impl.h @@ -7,9 +7,7 @@ #include #include "expression_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { class StringExpressionImpl : public ExpressionImpl { public: @@ -23,6 +21,4 @@ class StringExpressionImpl : public ExpressionImpl { ~StringExpressionImpl() override; }; } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h similarity index 77% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h index f009795aa01..f4c6a208f38 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h @@ -4,56 +4,48 @@ #pragma once #include -#include +#include #include -#include "deephaven/client/lowlevel/server.h" -#include "deephaven/client/highlevel/client.h" -#include "deephaven/client/highlevel/ticking.h" +#include "deephaven/client/client.h" +#include "deephaven/client/ticking.h" +#include "deephaven/client/server/server.h" +#include "deephaven/client/subscription/subscription_handle.h" #include "deephaven/client/utility/callbacks.h" #include "deephaven/client/utility/cbfuture.h" #include "deephaven/client/utility/executor.h" +#include "deephaven/client/utility/misc.h" #include "deephaven/proto/session.pb.h" #include "deephaven/proto/session.grpc.pb.h" #include "deephaven/proto/table.pb.h" #include "deephaven/proto/table.grpc.pb.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { class SortPair; namespace impl { class BooleanExpressionImpl; + class ColumnImpl; + class DateTimeColImpl; + class NumColImpl; + class StrColImpl; + class TableHandleManagerImpl; namespace internal { class GetColumnDefsCallback; -class ColumnDefinitions { -public: - typedef std::map> map_t; - typedef std::vector>> vec_t; - - ColumnDefinitions(vec_t vec, map_t map); - ~ColumnDefinitions(); - - const vec_t &vec() const { return vec_; } - const map_t &map() const { return map_; } - -private: - vec_t vec_; - map_t map_; -}; - -class LazyState final : public deephaven::client::utility::SFCallback { - struct Private {}; +class LazyState final + : public deephaven::client::utility::SFCallback { + struct Private { + }; typedef io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse ExportedTableCreationResponse; typedef io::deephaven::proto::backplane::grpc::Ticket Ticket; - typedef deephaven::client::lowlevel::Server Server; + typedef deephaven::client::server::Server Server; + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; typedef deephaven::client::utility::Executor Executor; template @@ -78,7 +70,8 @@ class LazyState final : public deephaven::client::utility::SFCallback getColumnDefinitions(); - void getColumnDefinitionsAsync(std::shared_ptr>> cb); + void + getColumnDefinitionsAsync(std::shared_ptr>> cb); private: std::shared_ptr server_; @@ -96,13 +89,15 @@ class LazyState final : public deephaven::client::utility::SFCallback createEtcCallback(const TableHandleManagerImpl *thm); // Create a callback that is already satisfied by "ticket". - static std::shared_ptr createSatisfiedCallback(const TableHandleManagerImpl *thm, + static std::shared_ptr + createSatisfiedCallback(const TableHandleManagerImpl *thm, Ticket ticket); static std::shared_ptr create(std::shared_ptr thm, @@ -146,9 +142,12 @@ class TableHandleImpl { std::shared_ptr medianBy(std::vector columnSpecs); std::shared_ptr percentileBy(double percentile, bool avgMedian, std::vector columnSpecs); - std::shared_ptr percentileBy(double percentile, std::vector columnSpecs); - std::shared_ptr countBy(std::string countByColumn, std::vector columnSpecs); - std::shared_ptr wAvgBy(std::string weightColumn, std::vector columnSpecs); + std::shared_ptr + percentileBy(double percentile, std::vector columnSpecs); + std::shared_ptr + countBy(std::string countByColumn, std::vector columnSpecs); + std::shared_ptr + wAvgBy(std::string weightColumn, std::vector columnSpecs); std::shared_ptr tailBy(int64_t n, std::vector columnSpecs); std::shared_ptr headBy(int64_t n, std::vector columnSpecs); @@ -177,13 +176,15 @@ class TableHandleImpl { void bindToVariableAsync(std::string variable, std::shared_ptr> callback); - void subscribe(std::shared_ptr callback); - void unsubscribe(std::shared_ptr callback); + std::shared_ptr subscribe(std::shared_ptr callback, + bool wantImmer); + void unsubscribe(std::shared_ptr handle); // For debugging void observe(); const std::shared_ptr &managerImpl() const { return managerImpl_; } + const Ticket &ticket() const { return ticket_; } private: @@ -192,7 +193,8 @@ class TableHandleImpl { std::shared_ptr defaultAggregateByDescriptor( ComboAggregateRequest::Aggregate descriptor, std::vector groupByColumns); - std::shared_ptr defaultAggregateByType(ComboAggregateRequest::AggType aggregateType, + std::shared_ptr + defaultAggregateByType(ComboAggregateRequest::AggType aggregateType, std::vector groupByColumns); std::shared_ptr headOrTailHelper(bool head, int64_t n); @@ -202,9 +204,7 @@ class TableHandleImpl { std::shared_ptr managerImpl_; Ticket ticket_; std::shared_ptr lazyState_; - std::weak_ptr weakSelf_; + std::set> subscriptions_; }; } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_manager_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_manager_impl.h similarity index 90% rename from cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_manager_impl.h rename to cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_manager_impl.h index 71aaae9834b..b893dc28656 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/highlevel/impl/table_handle_manager_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_manager_impl.h @@ -4,18 +4,15 @@ #pragma once #include -#include "deephaven/client/lowlevel/server.h" +#include "deephaven/client/server/server.h" #include "deephaven/client/utility/executor.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { class TableHandleImpl; class TableHandleManagerImpl { struct Private {}; - typedef deephaven::client::lowlevel::Server Server; + typedef deephaven::client::server::Server Server; typedef deephaven::client::utility::Executor Executor; typedef io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest AsOfJoinTablesRequest; typedef io::deephaven::proto::backplane::grpc::ComboAggregateRequest ComboAggregateRequest; @@ -61,7 +58,4 @@ class TableHandleManagerImpl { std::shared_ptr flightExecutor_; std::weak_ptr self_; }; -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/impl/util.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/util.h new file mode 100644 index 00000000000..061bb0b40e3 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/util.h @@ -0,0 +1,9 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include + +namespace deephaven::client::highlevel::impl { +} // namespace deephaven::client::highlevel::impl diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/lowlevel/server.h b/cpp-client/deephaven/client/include/private/deephaven/client/server/server.h similarity index 95% rename from cpp-client/deephaven/client/include/private/deephaven/client/lowlevel/server.h rename to cpp-client/deephaven/client/include/private/deephaven/client/server/server.h index 38ef050a040..0d348cb92d5 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/lowlevel/server.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/server/server.h @@ -25,9 +25,7 @@ #include "deephaven/proto/table.pb.h" #include "deephaven/proto/table.grpc.pb.h" -namespace deephaven { -namespace client { -namespace lowlevel { +namespace deephaven::client::server { struct CompletionQueueCallback { typedef deephaven::client::utility::FailureCallback FailureCallback; @@ -57,7 +55,7 @@ struct ServerResponseHolder final : public CompletionQueueCallback { void onSuccess() final { // The type is valid because this is how we set it in the constructor. - auto *typedCallback = static_cast*>(failureCallback_.get()); + auto *typedCallback = static_cast *>(failureCallback_.get()); typedCallback->onSuccess(std::move(response_)); } @@ -65,7 +63,8 @@ struct ServerResponseHolder final : public CompletionQueueCallback { }; class Server { - struct Private {}; + struct Private { + }; typedef io::deephaven::proto::backplane::grpc::ApplicationService ApplicationService; typedef io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest AsOfJoinTablesRequest; @@ -100,9 +99,13 @@ class Server { ~Server(); ApplicationService::Stub *applicationStub() const { return applicationStub_.get(); } + ConsoleService::Stub *consoleStub() const { return consoleStub_.get(); } + SessionService::Stub *sessionStub() const { return sessionStub_.get(); } + TableService::Stub *tableStub() const { return tableStub_.get(); } + // TODO(kosak): decide on the multithreaded story here arrow::flight::FlightClient *flightClient() const { return flightClient_.get(); } @@ -199,8 +202,9 @@ class Server { std::pair makeBlessing() const; private: - typedef std::unique_ptr< ::grpc::ClientAsyncResponseReader> - (TableService::Stub:: *selectOrUpdateMethod_t)(::grpc::ClientContext* context, const SelectOrUpdateRequest &request, ::grpc::CompletionQueue* cq); + typedef std::unique_ptr<::grpc::ClientAsyncResponseReader> + (TableService::Stub::*selectOrUpdateMethod_t)(::grpc::ClientContext *context, + const SelectOrUpdateRequest &request, ::grpc::CompletionQueue *cq); Ticket selectOrUpdateHelper(Ticket parentTicket, std::vector columnSpecs, std::shared_ptr etcCallback, selectOrUpdateMethod_t method); @@ -239,6 +243,4 @@ void Server::sendRpc(const TReq &req, std::shared_ptr> respons auto rpc = (stub->*pm)(&response->ctx_, req, &completionQueue_); rpc->Finish(&response->response_, &response->status_, response); } -} // namespace lowlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::server diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h new file mode 100644 index 00000000000..9cbff87760f --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include "deephaven/client/utility/misc.h" + +namespace deephaven::client::subscription { +class BatchParser { + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; +public: + + BatchParser() = delete; + + static void parseBatches( + const ColumnDefinitions &colDefs, + size_t numBatches, + bool allowInconsistentColumnSizes, + arrow::flight::FlightStreamReader *fsr, + arrow::flight::FlightStreamChunk *flightStreamChunk, + const std::function> &)> &callback); +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h new file mode 100644 index 00000000000..d3c42f3f583 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once +#include +#include +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/subscription/space_mapper.h" +#include "deephaven/client/table/table.h" +#include "deephaven/client/utility/misc.h" + +namespace deephaven::client::subscription { +class ClassicTableState final { + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::column::ColumnSource ColumnSource; + typedef deephaven::client::column::MutableColumnSource MutableColumnSource; + typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::table::Table Table; + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; + +public: + explicit ClassicTableState(const ColumnDefinitions &colDefs); + ~ClassicTableState(); + + UInt64Chunk addKeys(const RowSequence &rowsToAddKeySpace); + void addData(const std::vector> &data, + const UInt64Chunk &rowsToAddIndexSpace); + + UInt64Chunk erase(const RowSequence &rowsToRemoveKeySpace); + + std::vector modifyKeys( + const std::vector> &rowsToModifyKeySpace); + void modifyData(const std::vector> &data, + const std::vector &rowsToModifyIndexSpace); + + void applyShifts(const RowSequence &firstIndex, const RowSequence &lastIndex, + const RowSequence &destIndex); + + std::shared_ptr snapshot() const; + std::shared_ptr
snapshotUnwrapped() const; + +private: + UInt64Chunk modifyKeysHelper(const RowSequence &rowsToModifyKeySpace); + + std::vector> columns_; + std::shared_ptr> redirection_; + /** + * These are slots (in the target, aka the redirected space) that we once allocated but + * then subsequently removed, so they're available for reuse. + */ + std::vector slotsToReuse_; +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h new file mode 100644 index 00000000000..83d44429a44 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once +#include +#include +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/immerutil/abstract_flex_vector.h" +#include "deephaven/client/subscription/space_mapper.h" +#include "deephaven/client/table/table.h" +#include "deephaven/client/utility/misc.h" + +namespace deephaven::client::subscription { +class ImmerTableState final { + typedef deephaven::client::column::ColumnSource ColumnSource; + typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::immerutil::AbstractFlexVectorBase AbstractFlexVectorBase; + typedef deephaven::client::table::Table Table; + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; + +public: + explicit ImmerTableState(const ColumnDefinitions &colDefs); + ~ImmerTableState(); + + std::shared_ptr addKeys(const RowSequence &rowsToAddKeySpace); + void addData(const std::vector> &data, + const RowSequence &rowsToAddIndexSpace); + + std::shared_ptr erase(const RowSequence &rowsToRemoveKeySpace); + + std::vector> modifyKeys( + const std::vector> &rowsToModifyKeySpace); + void modifyData(const std::vector> &data, + const std::vector> &rowsToModifyIndexSpace); + + void applyShifts(const RowSequence &startIndex, const RowSequence &endIndex, + const RowSequence &destIndex); + + std::shared_ptr
snapshot() const; + +private: + void modifyColumn(size_t colNum, + std::unique_ptr modifiedData, + const RowSequence &rowsToModifyKeySpace); + + std::vector> flexVectors_; + // Keeps track of keyspace -> index space mapping + SpaceMapper spaceMapper_; +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h new file mode 100644 index 00000000000..b87035dc212 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include "deephaven/client/container/row_sequence.h" + +namespace flatbuffers = deephaven::third_party::flatbuffers; + +namespace deephaven::client::subscription { +constexpr const uint32_t deephavenMagicNumber = 0x6E687064U; + +class DataInput { +public: + explicit DataInput(const flatbuffers::Vector &vec) : DataInput(vec.data(), vec.size()) {} + + DataInput(const void *start, size_t size) : data_(static_cast(start)), + size_(size) {} + + int64_t readValue(int command); + + int64_t readLong(); + int32_t readInt(); + int16_t readShort(); + int8_t readByte(); + +private: + const char *data_ = nullptr; + size_t size_ = 0; +}; + +struct IndexDecoder { + typedef deephaven::client::container::RowSequence RowSequence; + + static std::shared_ptr readExternalCompressedDelta(DataInput *in); +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/shift_processor.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/shift_processor.h new file mode 100644 index 00000000000..c17c4a996f2 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/shift_processor.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include "deephaven/client/container/row_sequence.h" + +namespace deephaven::client::subscription { +class ShiftProcessor { + typedef deephaven::client::container::RowSequence RowSequence; +public: + ShiftProcessor() = delete; // static-only class + + static void applyShiftData(const RowSequence &firstIndex, const RowSequence &lastIndex, + const RowSequence &destIndex, + const std::function &processShift); +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h new file mode 100644 index 00000000000..63615b493d4 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include "deephaven/client/container/row_sequence.h" +#include +#include +#include +#include +#include + +namespace deephaven::client::subscription { +class SpaceMapper { + typedef deephaven::client::container::RowSequence RowSequence; + + typedef boost::multi_index_container< + uint64_t, + boost::multi_index::indexed_by< + boost::multi_index::ranked_unique< + boost::multi_index::identity + > + > + > set_t; + +public: + SpaceMapper(); + ~SpaceMapper(); + + uint64_t addRange(uint64_t beginKey, uint64_t endKey); + uint64_t eraseRange(uint64_t beginKey, uint64_t endKey); + void applyShift(uint64_t beginKey, uint64_t endKey, uint64_t destKey); + + std::shared_ptr addKeys(const RowSequence &keys); + std::shared_ptr convertKeysToIndices(const RowSequence &keys) const; + + size_t size() const { + return set_.size(); + } + +private: + set_t set_; +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h new file mode 100644 index 00000000000..04999199aba --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include "deephaven/client/ticking.h" +#include "deephaven/client/server/server.h" +#include "deephaven/client/subscription/subscription_handle.h" +#include "deephaven/client/utility/misc.h" +#include "deephaven/proto/ticket.pb.h" + +namespace deephaven::client::subscription { +std::shared_ptr startSubscribeThread( + std::shared_ptr server, + deephaven::client::utility::Executor *flightExecutor, + std::shared_ptr columnDefinitions, + const io::deephaven::proto::backplane::grpc::Ticket &ticket, + std::shared_ptr callback, + bool wantImmer); +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscription_handle.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscription_handle.h new file mode 100644 index 00000000000..37c7756e04b --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscription_handle.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +namespace deephaven::client::subscription { +class SubscriptionHandle { +public: + virtual ~SubscriptionHandle() = default; + virtual void cancel() = 0; +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h new file mode 100644 index 00000000000..959b719bd33 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include "deephaven/client/ticking.h" +#include "deephaven/client/utility/misc.h" + +namespace deephaven::client::subscription { +class UpdateProcessor final { + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; + + struct Private {}; +public: + static std::shared_ptr startThread( + std::unique_ptr fsr, + std::shared_ptr colDefs, + std::shared_ptr callback, + bool wantImmer); + + UpdateProcessor(std::unique_ptr fsr, + std::shared_ptr colDefs, std::shared_ptr callback); + ~UpdateProcessor(); + + void cancel(); + +private: + static void runForever(const std::shared_ptr &self, bool wantImmer); + void classicRunForeverHelper(); + void immerRunForeverHelper(); + +public: + std::unique_ptr fsr_; + std::shared_ptr colDefs_; + std::shared_ptr callback_; +}; +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/utility/executor.h b/cpp-client/deephaven/client/include/private/deephaven/client/utility/executor.h index 2c24ceb854d..a78d58b9bae 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/utility/executor.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/utility/executor.h @@ -11,11 +11,10 @@ #include "deephaven/client/utility/callbacks.h" #include "deephaven/client/utility/utility.h" -namespace deephaven { -namespace client { -namespace utility { +namespace deephaven::client::utility { class Executor { - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(); @@ -41,6 +40,4 @@ class Executor { std::condition_variable condvar_; std::deque> todo_; }; -} // namespace utility -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h b/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h new file mode 100644 index 00000000000..ceb16de63df --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include + +namespace deephaven::client::utility { +class ColumnDefinitions { +public: + typedef std::map> map_t; + typedef std::vector>> + vec_t; + + ColumnDefinitions(vec_t vec, map_t map); + ~ColumnDefinitions(); + + const vec_t &vec() const { return vec_; } + + const map_t &map() const { return map_; } + +private: + vec_t vec_; + map_t map_; +}; +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h new file mode 100644 index 00000000000..479e162bc30 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h @@ -0,0 +1,193 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include +#include "deephaven/client/utility/utility.h" + +namespace deephaven::client::chunk { +/** + * Base type for Chunks + */ +class Chunk { +protected: + Chunk() = default; + explicit Chunk(size_t size) : size_(size) {} + Chunk(Chunk &&other) noexcept = default; + Chunk &operator=(Chunk &&other) noexcept = default; + virtual ~Chunk() = default; + +public: + size_t size() const { return size_; } + +protected: + void checkSize(size_t proposedSize, std::string_view what) const; + + size_t size_ = 0; +}; + +template +class GenericChunk final : public Chunk { +public: + static GenericChunk create(size_t size); + + GenericChunk() = default; + GenericChunk(GenericChunk &&other) noexcept = default; + GenericChunk &operator=(GenericChunk &&other) noexcept = default; + ~GenericChunk() final = default; + + GenericChunk take(size_t size) const; + GenericChunk drop(size_t size) const; + + T *data() { return data_.get(); } + const T *data() const { return data_.get(); } + + T *begin() { return data_.get(); } + const T *begin() const { return data_.get(); } + + T *end() { return data_.get() + size_; } + const T *end() const { return data_.get() + size_; } + +private: + GenericChunk(std::shared_ptr data, size_t size); + + friend std::ostream &operator<<(std::ostream &s, const GenericChunk &o) { + using deephaven::client::utility::separatedList; + return s << '[' << separatedList(o.begin(), o.end()) << ']'; + } + + std::shared_ptr data_; +}; + +typedef GenericChunk Int8Chunk; +typedef GenericChunk Int16Chunk; +typedef GenericChunk Int32Chunk; +typedef GenericChunk Int64Chunk; +typedef GenericChunk UInt64Chunk; +typedef GenericChunk FloatChunk; +typedef GenericChunk DoubleChunk; +typedef GenericChunk StringChunk; + +/** + * Typesafe union of all the Chunk types. + */ +class AnyChunk { + typedef std::variant variant_t; + +public: + template + AnyChunk &operator=(T &&chunk) { + variant_ = std::forward(chunk); + return *this; + } + + template + void visit(Visitor &&visitor) const { + std::visit(std::forward(visitor), variant_); + } + + const Chunk &unwrap() const; + Chunk &unwrap(); + + template + const T &get() const { + return std::get(variant_); + } + + template + T &get() { + return std::get(variant_); + } + +private: + variant_t variant_; +}; + +template +GenericChunk GenericChunk::create(size_t size) { + // Note: wanted to use make_shared, but std::make_shared(size) doesn't DTRT until C++20 + auto data = std::shared_ptr(new T[size]); + return GenericChunk(std::move(data), size); +} + +template +GenericChunk::GenericChunk(std::shared_ptr data, size_t size) : Chunk(size), + data_(std::move(data)) {} + +template +GenericChunk GenericChunk::take(size_t size) const { + checkSize(size, DEEPHAVEN_PRETTY_FUNCTION); + // Share ownership of data_. + return GenericChunk(data_, size); +} + +template +GenericChunk GenericChunk::drop(size_t size) const { + checkSize(size, DEEPHAVEN_PRETTY_FUNCTION); + // Share ownership of data_, but the value of the pointer yielded by std::shared_ptr::get() + // is actually data_.get() + size. + std::shared_ptr newBegin(data_, data_.get() + size); + auto newSize = size_ - size; + return GenericChunk(std::move(newBegin), newSize); +} + +class ChunkVisitor { +public: + virtual void visit(const Int8Chunk &) const = 0; + virtual void visit(const Int16Chunk &) const = 0; + virtual void visit(const Int32Chunk &) const = 0; + virtual void visit(const Int64Chunk &) const = 0; + virtual void visit(const UInt64Chunk &) const = 0; + virtual void visit(const FloatChunk &) const = 0; + virtual void visit(const DoubleChunk &) const = 0; + virtual void visit(const StringChunk &) const = 0; +}; + +template +struct TypeToChunk {}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::Int8Chunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::Int16Chunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::Int32Chunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::Int64Chunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::UInt64Chunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::FloatChunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::DoubleChunk type_t; +}; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::StringChunk type_t; +}; +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h new file mode 100644 index 00000000000..9ea7f499c31 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/chunk/chunk.h" + +namespace deephaven::client::chunk { +class ChunkFiller { + typedef deephaven::client::container::RowSequence RowSequence; +public: + static void fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *dest); +}; +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_maker.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_maker.h new file mode 100644 index 00000000000..bacd9bbc8a0 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_maker.h @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include "deephaven/client/chunk/chunk.h" + +namespace deephaven::client::column { +class ColumnSource; +} // namespace deephaven::client::column + +namespace deephaven::client::chunk { +class ChunkMaker { + typedef deephaven::client::column::ColumnSource ColumnSource; +public: + static AnyChunk createChunkFor(const ColumnSource &columnSource, size_t chunkSize); +}; +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/client.h b/cpp-client/deephaven/client/include/public/deephaven/client/client.h similarity index 97% rename from cpp-client/deephaven/client/include/public/deephaven/client/highlevel/client.h rename to cpp-client/deephaven/client/include/public/deephaven/client/client.h index dff1a868256..a88d36231c9 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/client.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/client.h @@ -7,12 +7,12 @@ #include #include #include -#include "deephaven/client/highlevel/columns.h" -#include "deephaven/client/highlevel/expressions.h" -#include "deephaven/client/highlevel/ticking.h" +#include "deephaven/client/columns.h" +#include "deephaven/client/expressions.h" +#include "deephaven/client/ticking.h" #include "deephaven/client/utility/callbacks.h" -namespace deephaven::client::highlevel { +namespace deephaven::client { namespace impl { class AggregateComboImpl; class AggregateImpl; @@ -20,6 +20,11 @@ class ClientImpl; class TableHandleImpl; class TableHandleManagerImpl; } // namespace impl + +namespace subscription { +class SubscriptionHandle; +} // namespace subscription + class Client; class TableHandle; class TableHandleManager; @@ -140,7 +145,8 @@ class TableHandleManager { * This is used when the caller wants to do an Arrow DoPut operation. * @return A TableHandle and Arrow FlightDescriptor referring to the new table. */ - std::tuple newTableHandleAndFlightDescriptor() const; + std::tuple + newTableHandleAndFlightDescriptor() const; /** * Creates a FlightWrapper that is used for Arrow Flight integration. Arrow Flight is the primary * way to push data into or pull data out of the system. @@ -352,7 +358,9 @@ namespace internal { template struct StringHolder { StringHolder(std::string s) : s_(std::move(s)) {} + StringHolder(const char *s) : s_(s) {} + StringHolder(std::string_view s) : s_(s) {} std::string s_; @@ -365,14 +373,15 @@ struct StringHolder { * server resource is destructed, the resource will be released. */ class TableHandle { - typedef deephaven::client::highlevel::BooleanExpression BooleanExpression; - typedef deephaven::client::highlevel::Column Column; - typedef deephaven::client::highlevel::DateTimeCol DateTimeCol; - typedef deephaven::client::highlevel::MatchWithColumn MatchWithColumn; - typedef deephaven::client::highlevel::NumCol NumCol; - typedef deephaven::client::highlevel::SelectColumn SelectColumn; - typedef deephaven::client::highlevel::SortPair SortPair; - typedef deephaven::client::highlevel::StrCol StrCol; + typedef deephaven::client::BooleanExpression BooleanExpression; + typedef deephaven::client::Column Column; + typedef deephaven::client::DateTimeCol DateTimeCol; + typedef deephaven::client::MatchWithColumn MatchWithColumn; + typedef deephaven::client::NumCol NumCol; + typedef deephaven::client::SelectColumn SelectColumn; + typedef deephaven::client::SortPair SortPair; + typedef deephaven::client::StrCol StrCol; + typedef deephaven::client::subscription::SubscriptionHandle SubscriptionHandle; template using Callback = deephaven::client::utility::Callback; @@ -421,7 +430,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle select(Args && ...args) const; + TableHandle select(Args &&...args) const; /** * Select columnSpecs from a table. The columnSpecs can be column names or formulas like * "NewCol = A + 12". See the Deephaven documentation for the difference between "select" and @@ -732,7 +741,8 @@ class TableHandle { * @param columnSpecs Columns to group by. * @return A TableHandle referencing the new table */ - TableHandle percentileBy(double percentile, bool avgMedian, std::vector columnSpecs) const; + TableHandle + percentileBy(double percentile, bool avgMedian, std::vector columnSpecs) const; /** * A variadic form of percentileBy(double, std::vector) const that takes a combination of @@ -874,6 +884,7 @@ class TableHandle { TableHandle ungroup(Args &&... args) const { return ungroup(false, std::forward(args)...); } + /** * Creates a new table from this table with the column array data ungrouped. This is the inverse * of the by(std::vector) const operation. @@ -892,6 +903,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ TableHandle merge(std::string keyColumn, std::vector sources) const; + /** * Creates a new table by merging `sources` together. The tables are essentially stacked on top * of each other. @@ -1073,11 +1085,12 @@ class TableHandle { * append-only tables and will call back with an error if the table changes in a way that is not * append-only. */ - void subscribe(std::shared_ptr callback); + std::shared_ptr subscribe(std::shared_ptr callback, + bool wantImmer); /** * Unsubscribe from the table. */ - void unsubscribe(std::shared_ptr callback); + void unsubscribe(std::shared_ptr callback); /** * Get access to the bytes of the Deephaven "Ticket" type (without having to reference the @@ -1121,7 +1134,7 @@ template std::tuple TableHandle::getCols(internal::StringHolder... names) { return std::make_tuple( internal::ColGetter::getCol(*this, std::move(names.s_))... - ); + ); } namespace internal { @@ -1152,7 +1165,7 @@ struct ConvertToString { return s; } - static std::string toString(const deephaven::client::highlevel::SelectColumn &selectColumn); + static std::string toString(const deephaven::client::SelectColumn &selectColumn); }; } // namespace internal @@ -1458,4 +1471,4 @@ TableHandle TableHandle::ungroup(bool nullFill, Args &&... args) const { }; return ungroup(nullFill, std::move(groupByColumns)); } -} // namespace deephaven::client::highlevel +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h b/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h new file mode 100644 index 00000000000..b1dfa14cc21 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/utility/utility.h" + +namespace deephaven::client::column { +class ColumnSourceVisitor; + +// the column source interfaces +class ColumnSource { +protected: + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + virtual ~ColumnSource(); + + virtual void fillChunk(const RowSequence &rows, Chunk *dest) const = 0; + virtual void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const = 0; + + virtual void acceptVisitor(ColumnSourceVisitor *visitor) const = 0; + + virtual std::any backdoor() const { + return 0; + } +}; + +class MutableColumnSource : public virtual ColumnSource { +public: + ~MutableColumnSource() override; + + virtual void fillFromChunk(const Chunk &src, const RowSequence &rows) = 0; + virtual void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) = 0; +}; + +// the per-type interfaces +template +class NumericColumnSource : public virtual ColumnSource { +}; + +// TODO(kosak): it's not obvious to me that String needs to be handled separately. +class StringColumnSource : public virtual ColumnSource { +}; + +// convenience typedefs +typedef NumericColumnSource Int8ColumnSource; +typedef NumericColumnSource Int16ColumnSource; +typedef NumericColumnSource Int32ColumnSource; +typedef NumericColumnSource Int64ColumnSource; +typedef NumericColumnSource FloatColumnSource; +typedef NumericColumnSource DoubleColumnSource; + +// the mutable per-type interfaces +template +class MutableNumericColumnSource : public NumericColumnSource, public MutableColumnSource { +}; + +class MutableStringColumnSource : public StringColumnSource, public MutableColumnSource { +}; + +template +class NumericArrayColumnSource final : public MutableNumericColumnSource, + std::enable_shared_from_this> { + struct Private {}; + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + static std::shared_ptr create(); + explicit NumericArrayColumnSource(Private) {} + ~NumericArrayColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest) const final; + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final; + void fillFromChunk(const Chunk &src, const RowSequence &rows) final; + void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) final; + + void acceptVisitor(ColumnSourceVisitor *visitor) const final; + +private: + void ensureSize(size_t size); + + std::vector data_; +}; + +class StringArrayColumnSource final : public MutableStringColumnSource, + std::enable_shared_from_this { + struct Private {}; + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + static std::shared_ptr create(); + explicit StringArrayColumnSource(Private) {} + ~StringArrayColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest) const final; + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final; + void fillFromChunk(const Chunk &src, const RowSequence &rows) final; + void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) final; + + void acceptVisitor(ColumnSourceVisitor *visitor) const final; + +private: + void ensureSize(size_t size); + + std::vector data_; +}; + +template +std::shared_ptr> NumericArrayColumnSource::create() { + return std::make_shared>(Private()); +} + +template +void NumericArrayColumnSource::fillChunk(const RowSequence &rows, Chunk *dest) const { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + typedef typename TypeToChunk::type_t chunkType_t; + + auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); + // assert rows.size() <= typedDest->size() + assertLessEq(rows.size(), typedDest->size(), "rows.size()", "typedDest->size()", __PRETTY_FUNCTION__); + + size_t destIndex = 0; + auto applyChunk = [this, typedDest, &destIndex](uint64_t begin, uint64_t end) { + // assert end <= data_.size() + assertLessEq(end, data_.size(), "end", "data_.size()", __PRETTY_FUNCTION__); + for (auto current = begin; current != end; ++current) { + typedDest->data()[destIndex] = data_[current]; + ++destIndex; + } + }; + rows.forEachChunk(applyChunk); +} + +template +void NumericArrayColumnSource::fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + typedef typename TypeToChunk::type_t chunkType_t; + + auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); + // assert size <= dest->capacity() + assertLessEq(rowKeys.size(), typedDest->size(), "rowKeys.size()", "typedDest->size()", __PRETTY_FUNCTION__); + + for (size_t i = 0; i < rowKeys.size(); ++i) { + auto srcIndex = rowKeys.data()[i]; + assertLessEq(srcIndex, data_.size(), "srcIndex", "data_.size()", DEEPHAVEN_PRETTY_FUNCTION); + typedDest->data()[i] = this->data_[srcIndex]; + } +} + +template +void NumericArrayColumnSource::fillFromChunk(const Chunk &src, const RowSequence &rows) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + typedef typename TypeToChunk::type_t chunkType_t; + + const auto *typedSrc = verboseCast(&src, DEEPHAVEN_PRETTY_FUNCTION); + assertLessEq(rows.size(), typedSrc->size(), "rows.size()", "src.size()", __PRETTY_FUNCTION__); + + const auto *srcp = typedSrc->data(); + auto applyChunk = [this, &srcp](uint64_t begin, uint64_t end) { + ensureSize(end); + for (auto current = begin; current != end; ++current) { + data_[current] = *srcp++; + } + }; + rows.forEachChunk(applyChunk); +} + +template +void NumericArrayColumnSource::fillFromChunkUnordered(const Chunk &src, + const UInt64Chunk &rowKeys) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::verboseCast; + typedef typename TypeToChunk::type_t chunkType_t; + + const auto *typedSrc = verboseCast(&src, DEEPHAVEN_PRETTY_FUNCTION); + // assert rowKeys.size() <= src.capacity() + assertLessEq(typedSrc->size(), rowKeys.size(), "src.size()", "rowKeys.size()", __PRETTY_FUNCTION__); + + for (size_t i = 0; i < typedSrc->size(); ++i) { + auto destIndex = rowKeys.data()[i]; + ensureSize(destIndex + 1); + data_[destIndex] = typedSrc->data()[i]; + } +} + +template +void NumericArrayColumnSource::ensureSize(size_t size) { + if (size > data_.size()) { + data_.resize(size); + } +} + +class ColumnSourceVisitor { +public: + virtual void visit(const Int8ColumnSource &) = 0; + virtual void visit(const Int16ColumnSource &) = 0; + virtual void visit(const Int32ColumnSource &) = 0; + virtual void visit(const Int64ColumnSource &) = 0; + virtual void visit(const FloatColumnSource &) = 0; + virtual void visit(const DoubleColumnSource &) = 0; + virtual void visit(const StringColumnSource &) = 0; +}; + +template +void NumericArrayColumnSource::acceptVisitor(ColumnSourceVisitor *visitor) const { + visitor->visit(*this); +} +} // namespace deephaven::client::column diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/columns.h b/cpp-client/deephaven/client/include/public/deephaven/client/columns.h similarity index 95% rename from cpp-client/deephaven/client/include/public/deephaven/client/highlevel/columns.h rename to cpp-client/deephaven/client/include/public/deephaven/client/columns.h index a3f504de073..72670126ee7 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/columns.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/columns.h @@ -5,17 +5,20 @@ #include #include -#include "deephaven/client/highlevel/expressions.h" +#include "deephaven/client/expressions.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { class ColumnImpl; + class StrColImpl; + class NumColImpl; + class DateTimeColImpl; + class IrisRepresentableImpl; + class AssignedColumnImpl; } // namespace impl @@ -24,8 +27,11 @@ class AssignedColumnImpl; */ class IrisRepresentable { public: - explicit IrisRepresentable(std::shared_ptr impl) : impl_(std::move(impl)) {} + explicit IrisRepresentable(std::shared_ptr impl) : impl_( + std::move(impl)) {} + virtual ~IrisRepresentable(); + impl::IrisRepresentableImpl *getIrisRepresentableImpl() const { return impl_.get(); } @@ -41,7 +47,9 @@ class IrisRepresentable { */ class SelectColumn : public virtual IrisRepresentable { public: - explicit SelectColumn(std::shared_ptr impl) : IrisRepresentable(std::move(impl)) {} + explicit SelectColumn(std::shared_ptr impl) : IrisRepresentable( + std::move(impl)) {} + ~SelectColumn() override; }; @@ -51,7 +59,9 @@ class SelectColumn : public virtual IrisRepresentable { */ class MatchWithColumn : public virtual IrisRepresentable { public: - explicit MatchWithColumn(std::shared_ptr impl) : IrisRepresentable(std::move(impl)) {} + explicit MatchWithColumn(std::shared_ptr impl) : IrisRepresentable( + std::move(impl)) {} + ~MatchWithColumn() override; }; @@ -77,7 +87,9 @@ class Column : public SelectColumn, public MatchWithColumn { /** * Describes a sort direction */ -enum class SortDirection { Ascending, Descending }; +enum class SortDirection { + Ascending, Descending +}; /** * A tuple (not really a "pair", despite the name) representing a column to sort, the SortDirection, @@ -128,6 +140,7 @@ class SortPair { * @return The column name */ std::string &column() { return column_; } + /** * Get the column name * @return The column name @@ -139,6 +152,7 @@ class SortPair { * @return The SortDirection */ SortDirection direction() const { return direction_; } + /** * Get the "sort by absolute value" flag * @return @@ -290,6 +304,4 @@ class AssignedColumn final : public SelectColumn { private: std::shared_ptr impl_; }; -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h b/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h new file mode 100644 index 00000000000..3fe3b0cdaf3 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace deephaven::client::container { +class RowSequenceIterator; + +class RowSequence { +public: + static std::shared_ptr createEmpty(); + static std::shared_ptr createSequential(uint64_t begin, uint64_t end); + + virtual ~RowSequence(); + + virtual std::shared_ptr getRowSequenceIterator() const = 0; + + virtual std::shared_ptr take(size_t size) const = 0; + virtual std::shared_ptr drop(size_t size) const = 0; + + virtual void forEachChunk(const std::function &f) const = 0; + + virtual size_t size() const = 0; + + bool empty() const { + return size() == 0; + } + + friend std::ostream &operator<<(std::ostream &s, const RowSequence &o); +}; + +class RowSequenceIterator { +public: + virtual ~RowSequenceIterator(); + virtual bool tryGetNext(uint64_t *result) = 0; +}; + +class RowSequenceBuilder { +public: + RowSequenceBuilder(); + ~RowSequenceBuilder(); + + void addRange(uint64_t begin, uint64_t end); + + void add(uint64_t key) { + addRange(key, key + 1); + } + + std::shared_ptr build(); + +private: + typedef std::map ranges_t; + // maps range.begin to range.end. We ensure that ranges never overlap and that contiguous ranges + // are collapsed. + ranges_t ranges_; + size_t size_ = 0; +}; +} // namespace deephaven::client::container diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/expressions.h b/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h similarity index 98% rename from cpp-client/deephaven/client/include/public/deephaven/client/highlevel/expressions.h rename to cpp-client/deephaven/client/include/public/deephaven/client/expressions.h index 9c20467149d..c8025cb9acf 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/expressions.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h @@ -5,19 +5,22 @@ #include #include -#include "deephaven/client/highlevel/types.h" +#include "deephaven/client/types.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { class AssignedColumn; + class BooleanExpression; namespace impl { class ExpressionImpl; + class BooleanExpressionImpl; + class NumericExpressionImpl; + class StringExpressionImpl; + class DateTimeExpressionImpl; } // namespace impl @@ -98,9 +101,11 @@ class BooleanExpression final : public Expression { friend BooleanExpression operator!(const BooleanExpression &expr); friend BooleanExpression operator&(const BooleanExpression &lhs, const BooleanExpression &rhs); friend BooleanExpression operator|(const BooleanExpression &lhs, const BooleanExpression &rhs); + friend BooleanExpression operator&&(const BooleanExpression &lhs, const BooleanExpression &rhs) { return lhs & rhs; } + friend BooleanExpression operator||(const BooleanExpression &lhs, const BooleanExpression &rhs) { return lhs | rhs; } @@ -382,7 +387,7 @@ class StringExpression : public Expression { }; class DateTimeExpression : public Expression { - typedef deephaven::client::highlevel::DateTime DateTime; + typedef deephaven::client::DateTime DateTime; public: /** @@ -470,6 +475,4 @@ class DateTimeExpression : public Expression { */ friend BooleanExpression operator>(const DateTimeExpression &lhs, const DateTimeExpression &rhs); }; -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_filler.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_filler.h deleted file mode 100644 index f0f434e0189..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_filler.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/sad/sad_chunk.h" - -namespace deephaven::client::highlevel::sad { -class ChunkFiller { -public: - static void fillChunk(const arrow::Array &src, const SadRowSequence &keys, SadChunk *dest); -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_maker.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_maker.h deleted file mode 100644 index e5af6323e8f..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/chunk_maker.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/sad/sad_chunk.h" - -namespace deephaven::client::highlevel::sad { -class ChunkMaker { -public: - static std::shared_ptr createChunkFor(const SadColumnSource &columnSource, - size_t chunkSize); -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_chunk.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_chunk.h deleted file mode 100644 index 0348698cf6f..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_chunk.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include - -namespace deephaven::client::highlevel::sad { -class SadChunkVisitor; -class SadChunk { -public: - explicit SadChunk(size_t capacity) : capacity_(capacity) {} - virtual ~SadChunk(); - - size_t capacity() const { return capacity_; } - - virtual void acceptVisitor(const SadChunkVisitor &v) const = 0; - -protected: - size_t capacity_ = 0; -}; - -template -class SadNumericChunk : public SadChunk { -protected: - explicit SadNumericChunk(size_t capacity); - -public: - T *data() { return data_.get(); } - const T *data() const { return data_.get(); } - -protected: - std::unique_ptr data_; -}; - -class SadIntChunk; -class SadLongChunk; -class SadDoubleChunk; -class SadSizeTChunk; - -class SadChunkVisitor { -public: - - virtual void visit(const SadIntChunk &) const = 0; - virtual void visit(const SadLongChunk &) const = 0; - virtual void visit(const SadDoubleChunk &) const = 0; - virtual void visit(const SadSizeTChunk &) const = 0; -}; - -class SadIntChunk final : public SadNumericChunk { - struct Private {}; -public: - static std::shared_ptr create(size_t capacity); - - SadIntChunk(Private, size_t capacity) : SadNumericChunk(capacity) {} - - void acceptVisitor(const SadChunkVisitor &v) const final { - v.visit(*this); - } -}; - -class SadLongChunk final : public SadNumericChunk { - struct Private {}; -public: - static std::shared_ptr create(size_t capacity); - - SadLongChunk(Private, size_t capacity) : SadNumericChunk(capacity) {} - - void acceptVisitor(const SadChunkVisitor &v) const final { - v.visit(*this); - } -}; - -class SadDoubleChunk final : public SadNumericChunk { - struct Private {}; -public: - static std::shared_ptr create(size_t capacity); - - SadDoubleChunk(Private, size_t capacity) : SadNumericChunk(capacity) {} - - void acceptVisitor(const SadChunkVisitor &v) const final { - v.visit(*this); - } -}; - -class SadSizeTChunk final : public SadNumericChunk { - struct Private {}; -public: - static std::shared_ptr create(size_t capacity); - - SadSizeTChunk(Private, size_t capacity) : SadNumericChunk(capacity) {} - - void acceptVisitor(const SadChunkVisitor &v) const final { - v.visit(*this); - } -}; - -template -SadNumericChunk::SadNumericChunk(size_t capacity) : SadChunk(capacity), - data_(std::make_unique(capacity)) { -} -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_column_source.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_column_source.h deleted file mode 100644 index 6e65d2c5805..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_column_source.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" -#include "deephaven/client/highlevel/sad/sad_chunk.h" -#include "deephaven/client/highlevel/sad/sad_context.h" - -namespace deephaven::client::highlevel::sad { -class SadColumnSourceContext; -class SadLongColumnSource; -class SadColumnSourceVisitor; - -// the column source interfaces - -class SadColumnSource { -public: - virtual ~SadColumnSource(); - virtual std::shared_ptr createContext(size_t chunkSize) const = 0; - virtual void fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const = 0; - virtual void fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, size_t size, SadChunk *dest) const = 0; - - virtual void acceptVisitor(SadColumnSourceVisitor *visitor) const = 0; -}; - -class SadMutableColumnSource : public SadColumnSource { -public: - virtual ~SadMutableColumnSource() override; - virtual void fillFromChunk(SadContext *context, const SadChunk &src, const SadRowSequence &rows) = 0; - virtual void fillFromChunkUnordered(SadContext *context, const SadChunk &src, const SadLongChunk &rowKeys, size_t size) = 0; -}; - -// the per-type interfaces - -class SadIntColumnSource : public SadMutableColumnSource { -public: - ~SadIntColumnSource() override; -}; - -class SadLongColumnSource : public SadMutableColumnSource { -public: - ~SadLongColumnSource() override; -}; - -class SadDoubleColumnSource : public SadMutableColumnSource { -public: - ~SadDoubleColumnSource() override; -}; - -class SadIntArrayColumnSource final : public SadIntColumnSource, std::enable_shared_from_this { - struct Private {}; -public: - static std::shared_ptr create(); - explicit SadIntArrayColumnSource(Private); - ~SadIntArrayColumnSource() final; - - std::shared_ptr createContext(size_t chunkSize) const final; - void fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const final; - void fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, size_t size, SadChunk *dest) const final; - void fillFromChunk(SadContext *context, const SadChunk &src, const SadRowSequence &rows) final; - void fillFromChunkUnordered(SadContext *context, const SadChunk &src, const SadLongChunk &rowKeys, size_t size) final; - - void acceptVisitor(SadColumnSourceVisitor *visitor) const final; - -private: - void ensureSize(size_t size); - std::vector data_; -}; - -class SadLongArrayColumnSource final : public SadLongColumnSource, std::enable_shared_from_this { - struct Private {}; -public: - static std::shared_ptr create(); - explicit SadLongArrayColumnSource(Private); - ~SadLongArrayColumnSource() final; - - std::shared_ptr createContext(size_t chunkSize) const final; - void fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const final; - void fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, size_t size, SadChunk *dest) const final; - void fillFromChunk(SadContext *context, const SadChunk &src, const SadRowSequence &rows) final; - void fillFromChunkUnordered(SadContext *context, const SadChunk &src, const SadLongChunk &rowKeys, size_t size) final; - - void acceptVisitor(SadColumnSourceVisitor *visitor) const final; - -private: - void ensureSize(size_t size); - std::vector data_; -}; - -class SadDoubleArrayColumnSource final : public SadDoubleColumnSource, std::enable_shared_from_this { - struct Private {}; -public: - static std::shared_ptr create(); - explicit SadDoubleArrayColumnSource(Private); - ~SadDoubleArrayColumnSource() final; - - std::shared_ptr createContext(size_t chunkSize) const final; - void fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const final; - void fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, size_t size, SadChunk *dest) const final; - void fillFromChunk(SadContext *context, const SadChunk &src, const SadRowSequence &rows) final; - void fillFromChunkUnordered(SadContext *context, const SadChunk &src, const SadLongChunk &rowKeys, size_t size) final; - - void acceptVisitor(SadColumnSourceVisitor *visitor) const final; - -private: - void ensureSize(size_t size); - std::vector data_; -}; - -class SadColumnSourceContext : public SadContext { -public: - virtual ~SadColumnSourceContext(); -}; - -class SadColumnSourceVisitor { -public: - virtual void visit(const SadIntColumnSource *) = 0; - virtual void visit(const SadLongColumnSource *) = 0; - virtual void visit(const SadDoubleColumnSource *) = 0; -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_context.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_context.h deleted file mode 100644 index 9a7a8d9a905..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_context.h +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once -namespace deephaven::client::highlevel::sad { -class SadContext { -public: - virtual ~SadContext(); -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_row_sequence.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_row_sequence.h deleted file mode 100644 index 39e3ebac618..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_row_sequence.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include -#include - -namespace deephaven::client::highlevel::sad { -class SadRowSequenceIterator; - -class SadRowSequence { -public: - static std::shared_ptr createSequential(int64_t begin, int64_t end); - - virtual ~SadRowSequence(); - - virtual std::shared_ptr getRowSequenceIterator() const = 0; - virtual std::shared_ptr getRowSequenceReverseIterator() const = 0; - - virtual size_t size() const = 0; - - bool empty() const { - return size() == 0; - } - - friend std::ostream &operator<<(std::ostream &s, const SadRowSequence &o); -}; - -class SadRowSequenceIterator { -public: - virtual ~SadRowSequenceIterator(); - - virtual std::shared_ptr getNextRowSequenceWithLength(size_t size) = 0; - virtual bool tryGetNext(int64_t *result) = 0; -}; - -//class SadRowSequenceImplTodo { -// typedef std::set data_t; -//public: -// explicit SadRowSequence(data_t data); -// -// std::shared_ptr getRowSequenceIterator(); -// -// size_t size() const { -// return data_.size(); -// } -// -// auto begin() const { return data_.begin(); } -// auto end() const { return data_.end(); } -// -// bool empty() const { -// return data_.empty(); -// } -// -//private: -// data_t data_; -//}; -// -//class SadRowSequenceIteratorImpl { -//public: -// std::shared_ptr getNextRowSequenceWithLength(size_t size); -//}; - -class SadRowSequenceBuilder { -public: - SadRowSequenceBuilder(); - ~SadRowSequenceBuilder(); - - void addRange(int64_t first, int64_t last); - - void add(int64_t key) { - data_->insert(key); - } - - std::shared_ptr build(); - -private: - std::shared_ptr> data_; -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_table.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_table.h deleted file mode 100644 index f2e1618821b..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_table.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" -#include "deephaven/client/highlevel/sad/sad_unwrapped_table.h" - -namespace deephaven::client::highlevel::sad { -class SadTable { -public: - SadTable(); - virtual ~SadTable(); - - virtual std::shared_ptr getRowSequence() const = 0; - virtual std::shared_ptr getColumn(size_t columnIndex) const = 0; - - virtual std::shared_ptr unwrap(const std::shared_ptr &rows, - const std::vector &cols) const = 0; - - virtual size_t numRows() const = 0; - virtual size_t numColumns() const = 0; -}; - -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_ticking_table.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_ticking_table.h deleted file mode 100644 index df9b00a3edb..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_ticking_table.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once -#include -#include -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" -#include "deephaven/client/highlevel/sad/sad_table.h" -#include "deephaven/client/highlevel/sad/sad_unwrapped_table.h" - -namespace deephaven::client::highlevel::sad { -class SadTickingTable final : public SadTable { - struct Private {}; - -public: - static std::shared_ptr create(std::vector> columns); - - explicit SadTickingTable(Private, std::vector> columns); - ~SadTickingTable() final; - - /** - * Adds the rows (which are assumed not to exist) to the table's index in the table's (source) - * coordinate space and returns the target aka redirected row indices in the redirected - * coordinate space. It is the caller's responsibility - * to actually move the new column data to the right place in the column sources. - */ - std::shared_ptr add(const SadRowSequence &addedRows); - /** - * Erases the rows (which are provided in the source coordinate space). - */ - void erase(const SadRowSequence &removedRows); - void shift(const SadRowSequence &startIndex, const SadRowSequence &endIndex, - const SadRowSequence &destIndex); - - std::shared_ptr getRowSequence() const final; - - std::shared_ptr unwrap(const std::shared_ptr &rows, - const std::vector &cols) const final; - - std::shared_ptr getColumn(size_t columnIndex) const final; - - size_t numRows() const final { - return redirection_->size(); - } - - size_t numColumns() const final { - return columns_.size(); - } - -private: - std::vector> columns_; - std::shared_ptr> redirection_; - /** - * These are slots (in the target, aka the redirected space) that we once allocated but - * then subsequently removed, so they're available for reuse. - */ - std::vector slotsToReuse_; -}; -} // namespace deephaven::client::highlevel::sad - diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_unwrapped_table.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_unwrapped_table.h deleted file mode 100644 index 1b0a97e7a92..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/sad/sad_unwrapped_table.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" - -namespace deephaven::client::highlevel::sad { -class SadUnwrappedTable { - struct Private {}; -public: - static std::shared_ptr create(std::shared_ptr rowKeys, - size_t numRows, std::vector> columns); - - SadUnwrappedTable(Private, std::shared_ptr &&rowKeys, - size_t numRows, std::vector> &&columns); - ~SadUnwrappedTable(); - - std::shared_ptr getUnorderedRowKeys() const; - std::shared_ptr getColumn(size_t columnIndex) const; - - size_t numRows() const { return numRows_; } - size_t numColumns() const { return columns_.size(); } - -private: - std::shared_ptr rowKeys_; - size_t numRows_ = 0; - std::vector> columns_; -}; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/ticking.h b/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/ticking.h deleted file mode 100644 index f02c8e002f4..00000000000 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/ticking.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include -#include -#include "deephaven/client/utility/callbacks.h" -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" -#include "deephaven/client/highlevel/sad/sad_table.h" - -namespace deephaven::client::highlevel { -class TickingCallback : public deephaven::client::utility::FailureCallback { -protected: - typedef deephaven::client::highlevel::sad::SadRowSequence SadRowSequence; - typedef deephaven::client::highlevel::sad::SadTable SadTable; - -public: - /** - * @param tableView A "view" on the updated table, after the changes in this delta have been - * applied. Although this "view" shared underlying data with other TableViews, it is threadsafe - * and can be kept around for an arbitrarily long time. (an aspirational statement that will - * eventually be true, even though it's false at the moment). - */ - virtual void onTick(const std::shared_ptr &tableView) = 0; -}; -} // namespace deephaven::client::highlevel diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h new file mode 100644 index 00000000000..7482c0864ff --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" + +namespace deephaven::client::table { +class Table { +protected: + typedef deephaven::client::column::ColumnSource ColumnSource; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + Table() = default; + virtual ~Table() = default; + + virtual std::shared_ptr getRowSequence() const = 0; + virtual std::shared_ptr getColumn(size_t columnIndex) const = 0; + + virtual size_t numRows() const = 0; + virtual size_t numColumns() const = 0; +}; +} // namespace deephaven::client::highlevel::table diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h b/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h new file mode 100644 index 00000000000..10ff74e4eb9 --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include +#include "deephaven/client/utility/callbacks.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/table/table.h" +#include "immer/flex_vector.hpp" + +namespace deephaven::client { +class ClassicTickingUpdate; +class ImmerTickingUpdate; +class TickingCallback : public deephaven::client::utility::FailureCallback { +public: + /** + * @param update An update message which describes the changes (removes, adds, modifies) that + * transform the previous version of the table to the new version. This class is *shared* with + * the caller and so the receiving code will block the caller while it is using it. + */ + virtual void onTick(const ClassicTickingUpdate &update) = 0; + /** + * @param update An update message which describes the changes (removes, adds, modifies) that + * transform the previous version of the table to the new version. This class is threadsafe and + * can be kept around for an arbitrary amount of time. On the other hand, it probably should be + * processed and discard quickly so that the underlying resources can be reused. + */ + virtual void onTick(ImmerTickingUpdate update) = 0; +}; + +class ClassicTickingUpdate final { +protected: + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::column::ColumnSource ColumnSource; + typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::table::Table Table; + +public: + ClassicTickingUpdate(std::shared_ptr removedRowsKeySpace, + UInt64Chunk removedRowsIndexSpace, + std::shared_ptr addedRowsKeySpace, + UInt64Chunk addedRowsIndexSpace, + std::vector> modifiedRowsKeySpace, + std::vector modifiedRowsIndexSpace, + std::shared_ptr
currentTableKeySpace, + std::shared_ptr
currentTableIndexSpace); + ClassicTickingUpdate(ClassicTickingUpdate &&other) noexcept; + ClassicTickingUpdate &operator=(ClassicTickingUpdate &&other) noexcept; + ~ClassicTickingUpdate(); + + const std::shared_ptr &removedRowsKeySpace() const { return removedRowsKeySpace_; } + const UInt64Chunk &removedRowsIndexSpace() const { return removedRowsIndexSpace_; } + const std::shared_ptr &addedRowsKeySpace() const { return addedRowsKeySpace_; } + const UInt64Chunk &addedRowsIndexSpace() const { return addedRowsIndexSpace_; } + const std::vector> &modifiedRowsKeySpace() const { return modifiedRowsKeySpace_; } + const std::vector &modifiedRowsIndexSpace() const { return modifiedRowsIndexSpace_; } + const std::shared_ptr
¤tTableKeySpace() const { return currentTableKeySpace_; } + const std::shared_ptr
¤tTableIndexSpace() const { return currentTableIndexSpace_; } + +private: + // In the pre-shift key space + std::shared_ptr removedRowsKeySpace_; + // In the pre-shift index space + UInt64Chunk removedRowsIndexSpace_; + // In the post-shift key space + std::shared_ptr addedRowsKeySpace_; + // In the post-shift index space + UInt64Chunk addedRowsIndexSpace_; + // In the post-shift key space + std::vector> modifiedRowsKeySpace_; + // In the post-shift index space + std::vector modifiedRowsIndexSpace_; + + std::shared_ptr
currentTableKeySpace_; + std::shared_ptr
currentTableIndexSpace_; +}; + +class ImmerTickingUpdate final { +protected: + typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::table::Table Table; + +public: + ImmerTickingUpdate(std::shared_ptr
beforeRemoves, + std::shared_ptr
beforeModifies, + std::shared_ptr
current, + std::shared_ptr removed, + std::vector> modified, + std::shared_ptr added); + ImmerTickingUpdate(ImmerTickingUpdate &&other) noexcept; + ImmerTickingUpdate &operator=(ImmerTickingUpdate &&other) noexcept; + ~ImmerTickingUpdate(); + + // Note: the table is flat. + const std::shared_ptr
&beforeRemoves() const { return beforeRemoves_; } + // Note: the table is flat. + const std::shared_ptr
&beforeModifies() const { return beforeModifies_; } + // Note: the table is flat. + const std::shared_ptr
¤t() const { return current_; } + // In the key space of 'prevTable' + const std::shared_ptr &removed() const { return removed_; } + // In the key space of 'current' + const std::vector> &modified() const { return modified_; } + // In the key space of 'current' + const std::shared_ptr &added() const { return added_; } + +private: + std::shared_ptr
beforeRemoves_; + std::shared_ptr
beforeModifies_; + std::shared_ptr
current_; + // In the key space of 'beforeRemoves_' + std::shared_ptr removed_; + // In the key space of beforeModifies_ and current_, which have the same key space. + // Old values are in beforeModifies_; new values are in current_. + std::vector> modified_; + // In the key space of current_. + std::shared_ptr added_; +}; +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/types.h b/cpp-client/deephaven/client/include/public/deephaven/client/types.h similarity index 94% rename from cpp-client/deephaven/client/include/public/deephaven/client/highlevel/types.h rename to cpp-client/deephaven/client/include/public/deephaven/client/types.h index a728ddf0162..0228ffcbb5b 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/highlevel/types.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/types.h @@ -8,9 +8,7 @@ #include #include -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { class DeephavenConstants { public: static constexpr const char16_t NULL_CHAR = std::numeric_limits::max(); @@ -23,7 +21,8 @@ class DeephavenConstants { static constexpr const float POS_INFINITY_FLOAT = std::numeric_limits::infinity(); static constexpr const float MIN_FLOAT = -std::numeric_limits::infinity(); static constexpr const float MAX_FLOAT = std::numeric_limits::infinity(); - static constexpr const float MIN_FINITE_FLOAT = std::nextafter(-std::numeric_limits::max(), 0.0f); + static constexpr const float MIN_FINITE_FLOAT = std::nextafter(-std::numeric_limits::max(), + 0.0f); static constexpr const float MAX_FINITE_FLOAT = std::numeric_limits::max(); static constexpr const float MIN_POS_FLOAT = std::numeric_limits::min(); @@ -33,7 +32,8 @@ class DeephavenConstants { static constexpr const double POS_INFINITY_DOUBLE = std::numeric_limits::infinity(); static constexpr const double MIN_DOUBLE = -std::numeric_limits::infinity(); static constexpr const double MAX_DOUBLE = std::numeric_limits::infinity(); - static constexpr const double MIN_FINITE_DOUBLE = std::nextafter(-std::numeric_limits::max(), 0.0f); + static constexpr const double MIN_FINITE_DOUBLE = std::nextafter( + -std::numeric_limits::max(), 0.0f); static constexpr const double MAX_FINITE_DOUBLE = std::numeric_limits::max(); static constexpr const double MIN_POS_DOUBLE = std::numeric_limits::min(); @@ -61,7 +61,7 @@ class DeephavenConstants { class DateTime { public: /** - * Converts nanosseconds-since-UTC-epoch to DateTime. The Deephaven null value sentinel is + * Converts nanoseconds-since-UTC-epoch to DateTime. The Deephaven null value sentinel is * turned into DateTime(0). * @param nanos Nanoseconds since the epoch (January 1, 1970 UTC). * @return The corresponding DateTime. @@ -77,11 +77,13 @@ class DateTime { * Default constructor. Sets the DateTime equal to the epoch. */ DateTime() = default; + /** * Sets the DateTime to the specified number of nanoseconds relative to the epoch. * @param nanos Nanoseconds since the epoch (January 1, 1970 UTC). */ explicit DateTime(int64_t nanos) : nanos_(nanos) {} + /** * Sets the DateTime to the specified date, with a time component of zero. * @param year Year. @@ -127,6 +129,4 @@ class DateTime { return s; } }; -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h index 05bc68edd43..945b8433f01 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h @@ -7,9 +7,7 @@ #include #include -namespace deephaven { -namespace client { -namespace utility { +namespace deephaven::client::utility { // For simple callbacks. template class Callback { @@ -36,7 +34,8 @@ class SFCallback : public FailureCallback { template static std::shared_ptr createFromCallable(Callable &&callable); - static std::pair>, std::future>> createForFuture(); + static std::pair>, std::future>> + createForFuture(); ~SFCallback() override = default; virtual void onSuccess(Args... item) = 0; @@ -105,23 +104,24 @@ class SFCallbackFutureable final : public SFCallback { template template std::shared_ptr> Callback::createFromCallable(Callable &&callable) { - return std::make_shared>(std::forward(callable)); + return std::make_shared>( + std::forward(callable)); } template template std::shared_ptr> SFCallback::createFromCallable(Callable &&callable) { - return std::make_shared>(std::forward(callable)); + return std::make_shared>( + std::forward(callable)); } // Returns a pair whose first item is a SFCallback which satisfies a promise, and whose second // item is a std::future which is the future corresponding to that promise. template -std::pair>, std::future>> SFCallback::createForFuture() { +std::pair>, std::future>> +SFCallback::createForFuture() { auto cb = std::make_shared>(); auto fut = cb->makeFuture(); return std::make_pair(std::move(cb), std::move(fut)); } -} // namespace utility -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h index 3f610065649..5050c020915 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h @@ -2,9 +2,6 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #pragma once -/* - * Copyright (c) 2016-2020 Deephaven Data Labs and Patent Pending - */ #include @@ -20,7 +17,7 @@ #include #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/utility.h" namespace deephaven::client::utility { @@ -79,8 +76,8 @@ class TypeConverter { * @endcode */ class TableMaker { - typedef deephaven::client::highlevel::TableHandleManager TableHandleManager; - typedef deephaven::client::highlevel::TableHandle TableHandle; + typedef deephaven::client::TableHandleManager TableHandleManager; + typedef deephaven::client::TableHandle TableHandle; public: /** * Constructor diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h index e7dd5f3a2d2..14ec0496b20 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h @@ -9,17 +9,25 @@ #include #include -namespace deephaven { -namespace client { -namespace utility { +namespace deephaven::client::utility { template inline Dest bit_cast(const Src &item) { static_assert(sizeof(Src) == sizeof(Dest), "Src and Dest are not the same size"); Dest dest; - memcpy(static_cast(&dest), static_cast(&item), sizeof(Dest)); + memcpy(static_cast(&dest), static_cast(&item), sizeof(Dest)); return dest; } +template +std::vector makeReservedVector(size_t n) { + std::vector v; + v.reserve(n); + return v; +} + +void assertLessEq(size_t lhs, size_t rhs, std::string_view context, std::string_view lhsName, + std::string_view rhsName); + // A more efficient ostringstream that also allows you to grab the internal buffer if you want it. // Or, if you don't want to use the internal buffer, it allows you to provide your own. class SimpleOstringstream final : private std::basic_streambuf, public std::ostream { @@ -130,9 +138,9 @@ void defaultCallback(std::ostream &s, const T &item) { } // namespace internal template -internal::SeparatedListAdaptor()) &)> separatedList(Iterator begin, Iterator end, - const char *separator = ", ") { - return internal::SeparatedListAdaptor()) &)>( +auto separatedList(Iterator begin, Iterator end, const char *separator = ", ") { + return internal::SeparatedListAdaptor())> &)>( begin, end, separator, &internal::defaultCallback); } @@ -142,22 +150,112 @@ internal::SeparatedListAdaptor separatedList(Iterator begin, return internal::SeparatedListAdaptor(begin, end, separator, std::move(cb)); } -#define DEEPHAVEN_STRINGIFY_HELPER(X) #X -#define DEEPHAVEN_STRINGIFY(X) DEEPHAVEN_STRINGIFY_HELPER(X) +#if defined(__clang__) +#define DEEPHAVEN_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#elif defined(__GNUC__) +#define DEEPHAVEN_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#elif defined(__MSC_VER) +#define DEEPHAVEN_PRETTY_FUNCTION __FUNCSIG__ +#else +# error Unsupported compiler +#endif + +class DebugInfo { +public: + DebugInfo(const char *func, const char *file, size_t line, const char *args); + +private: + const char *func_ = nullptr; + const char *file_ = nullptr; + size_t line_ = 0; + const char *args_ = nullptr; + + friend std::ostream &operator<<(std::ostream &s, const DebugInfo &o); +}; + +std::string formatDebugString(const char *func, const char *file, size_t line, + const std::string &message); + +/** + * Given a list of arguments, expands to that list of arguments prepended with a DebugInfo struct + * containing with __PRETTY_FUNCTION__, __FILE__, __LINE__ and the stringified arguments. This is + * useful for functions who want to throw an exception with caller information. + */ +#define DEEPHAVEN_EXPR_MSG(ARGS...) \ + ::deephaven::client::utility::DebugInfo(DEEPHAVEN_PRETTY_FUNCTION, __FILE__, __LINE__, #ARGS),ARGS + +#define DEEPHAVEN_DEBUG_MSG(MESSAGE) \ + ::deephaven::client::utility::formatDebugString( \ + DEEPHAVEN_PRETTY_FUNCTION, __FILE__, __LINE__, MESSAGE) + +// https://stackoverflow.com/questions/281818/unmangling-the-result-of-stdtype-infoname +template +constexpr std::string_view getTypeName() { +#if defined(__clang__) + constexpr auto prefix = std::string_view{"[T = "}; + constexpr auto suffix = "]"; +#elif defined(__GNUC__) + constexpr auto prefix = std::string_view{"with T = "}; + constexpr auto suffix = "; "; +#elif defined(__MSC_VER) + constexpr auto prefix = std::string_view{"get_type_name<"}; + constexpr auto suffix = ">(void)"; +#else +# error Unsupported compiler +#endif + + constexpr auto function = std::string_view{DEEPHAVEN_PRETTY_FUNCTION}; + + const auto start = function.find(prefix) + prefix.size(); + const auto end = function.find(suffix); + const auto size = end - start; + + return function.substr(start, size); +} + +template +DESTP verboseCast(SRCP ptr, std::string_view caller) { + using deephaven::client::utility::stringf; + + auto *typedPtr = dynamic_cast(ptr); + if (typedPtr != nullptr) { + return typedPtr; + } + typedef decltype(*std::declval()) destType_t; + auto message = stringf("%o: Expected type %o. Got type %o", + caller, getTypeName(), typeid(*ptr).name()); + throw std::runtime_error(message); +} + +/** + * TODO(kosak): Do something else here. Maybe. + */ +template +void assertLessEq(const T &lhs, const T &rhs, std::string_view lhsText, std::string_view rhsText, + std::string_view func) { + if (lhs <= rhs) { + return; + } + throw std::runtime_error(stringf("assertion failed: %o: %o <= %o (%o <= %o)", func, lhs, rhs, + lhsText, rhsText)); +} /** - * Expands an expression into that expression followed by a stringified version of that expression - * with file and line, suitable for a method like okOrThrow that takes an expression and an optional - * message. + * If result's status is OK, do nothing. Otherwise throw a runtime error with an informative message. + * @param debugInfo A DebugInfo object, typically as provided by DEEPHAVEN_EXPR_MESSAGE. + * @param result an arrow::Result */ -#define DEEPHAVEN_EXPR_MSG(EXPR) (EXPR), #EXPR "@" __FILE__ ":" DEEPHAVEN_STRINGIFY(__LINE__) +template +void okOrThrow(const DebugInfo &debugInfo, const arrow::Result &result) { + okOrThrow(debugInfo, result.status()); +} /** * If status is OK, do nothing. Otherwise throw a runtime error with an informative message. + * @param debugInfo A DebugInfo object, typically as provided by DEEPHAVEN_EXPR_MESSAGE. * @param status the arrow::Status - * @param optionalMessage An optional message to be included in the exception message. */ -void okOrThrow(const arrow::Status &status, const char *optionalMessage = nullptr); +void okOrThrow(const DebugInfo &debugInfo, const arrow::Status &status); /** * If result's internal status is OK, return result's contained value. @@ -166,10 +264,10 @@ void okOrThrow(const arrow::Status &status, const char *optionalMessage = nullpt * @param message An optional message to be included in the exception message. */ template -T valueOrThrow(arrow::Result result, const char *optionalMessage = nullptr) { - okOrThrow(result.status(), optionalMessage); +T valueOrThrow(const DebugInfo &debugInfo, arrow::Result result) { + okOrThrow(debugInfo, result.status()); return result.ValueUnsafe(); } -} // namespace utility -} // namespace client -} // namespace deephaven + + +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.cc index 20bb4e3c428..4316703c838 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/application.proto @@ -46,7 +43,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdat return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>::Create(channel_.get(), rpcmethod_ListFields_, context, request); } -void ApplicationService::Stub::experimental_async::ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) { +void ApplicationService::Stub::async::ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>::Create(stub_->channel_.get(), stub_->rpcmethod_ListFields_, context, request, reactor); } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.h index 6b570484372..d67972ef299 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/application.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/application.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2fapplication_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2fapplication_2eproto__INCLUDED #include "deephaven/proto/application.pb.h" #include -#include #include #include #include @@ -65,9 +60,9 @@ class ApplicationService final { std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>> PrepareAsyncListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>>(PrepareAsyncListFieldsRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} // // Request the list of the fields exposed via the worker. // @@ -75,20 +70,12 @@ class ApplicationService final { // on the worker. None of these fields will be RemovedFields. // - Subsequent messages modify the existing state. Fields are identified by // their ticket and may be replaced or removed. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) = 0; - #else - virtual void ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientReaderInterface< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* ListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* AsyncListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* PrepareAsyncListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -105,25 +92,21 @@ class ApplicationService final { std::unique_ptr< ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>> PrepareAsyncListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>>(PrepareAsyncListFieldsRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) override; - #else - void ListFields(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* ListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request) override; ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* AsyncListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* PrepareAsyncListFieldsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest& request, ::grpc::CompletionQueue* cq) override; @@ -166,27 +149,17 @@ class ApplicationService final { }; typedef WithAsyncMethod_ListFields AsyncService; template - class ExperimentalWithCallbackMethod_ListFields : public BaseClass { + class WithCallbackMethod_ListFields : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ListFields() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_ListFields() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::ListFieldsRequest, ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request) { return this->ListFields(context, request); })); + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* request) { return this->ListFields(context, request); })); } - ~ExperimentalWithCallbackMethod_ListFields() override { + ~WithCallbackMethod_ListFields() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -194,20 +167,11 @@ class ApplicationService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* ListFields( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate>* ListFields( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* /*request*/) { return nullptr; } }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_ListFields CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_ListFields ExperimentalCallbackService; + typedef WithCallbackMethod_ListFields CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_ListFields : public BaseClass { private: @@ -246,27 +210,17 @@ class ApplicationService final { } }; template - class ExperimentalWithRawCallbackMethod_ListFields : public BaseClass { + class WithRawCallbackMethod_ListFields : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ListFields() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_ListFields() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->ListFields(context, request); })); + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->ListFields(context, request); })); } - ~ExperimentalWithRawCallbackMethod_ListFields() override { + ~WithRawCallbackMethod_ListFields() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -274,14 +228,8 @@ class ApplicationService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* ListFields( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* ListFields( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; typedef Service StreamedUnaryService; template diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.cc index 6b2806b6844..c639f79a482 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/application.proto @@ -19,62 +16,66 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr ListFieldsRequest::ListFieldsRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_CONSTEXPR ListFieldsRequest::ListFieldsRequest( + ::_pbi::ConstantInitialized){} struct ListFieldsRequestDefaultTypeInternal { - constexpr ListFieldsRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ListFieldsRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ListFieldsRequestDefaultTypeInternal() {} union { ListFieldsRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ListFieldsRequestDefaultTypeInternal _ListFieldsRequest_default_instance_; -constexpr FieldsChangeUpdate::FieldsChangeUpdate( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListFieldsRequestDefaultTypeInternal _ListFieldsRequest_default_instance_; +PROTOBUF_CONSTEXPR FieldsChangeUpdate::FieldsChangeUpdate( + ::_pbi::ConstantInitialized) : created_() , updated_() , removed_(){} struct FieldsChangeUpdateDefaultTypeInternal { - constexpr FieldsChangeUpdateDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FieldsChangeUpdateDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FieldsChangeUpdateDefaultTypeInternal() {} union { FieldsChangeUpdate _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FieldsChangeUpdateDefaultTypeInternal _FieldsChangeUpdate_default_instance_; -constexpr FieldInfo::FieldInfo( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : field_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , field_description_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , application_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , application_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldsChangeUpdateDefaultTypeInternal _FieldsChangeUpdate_default_instance_; +PROTOBUF_CONSTEXPR FieldInfo::FieldInfo( + ::_pbi::ConstantInitialized) + : field_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , field_description_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , application_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , application_id_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , typed_ticket_(nullptr){} struct FieldInfoDefaultTypeInternal { - constexpr FieldInfoDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FieldInfoDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FieldInfoDefaultTypeInternal() {} union { FieldInfo _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FieldInfoDefaultTypeInternal _FieldInfo_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldInfoDefaultTypeInternal _FieldInfo_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2fapplication_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fapplication_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fapplication_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fapplication_2eproto[3]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fapplication_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fapplication_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fapplication_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2fapplication_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::ListFieldsRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -102,16 +103,16 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fapplicatio PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FieldInfo, application_name_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FieldInfo, application_id_), }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ListFieldsRequest)}, { 6, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate)}, { 15, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FieldInfo)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ListFieldsRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FieldsChangeUpdate_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FieldInfo_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_ListFieldsRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FieldsChangeUpdate_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FieldInfo_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2fapplication_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -133,22 +134,24 @@ const char descriptor_table_protodef_deephaven_2fproto_2fapplication_2eproto[] P "quest\0325.io.deephaven.proto.backplane.grp" "c.FieldsChangeUpdate\"\0000\001B\004H\001P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2fapplication_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2fapplication_2eproto_deps[1] = { &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2fapplication_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fapplication_2eproto = { - false, false, 678, descriptor_table_protodef_deephaven_2fproto_2fapplication_2eproto, "deephaven/proto/application.proto", - &descriptor_table_deephaven_2fproto_2fapplication_2eproto_once, descriptor_table_deephaven_2fproto_2fapplication_2eproto_deps, 1, 3, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2fapplication_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2fapplication_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fapplication_2eproto, file_level_service_descriptors_deephaven_2fproto_2fapplication_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fapplication_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fapplication_2eproto = { + false, false, 678, descriptor_table_protodef_deephaven_2fproto_2fapplication_2eproto, + "deephaven/proto/application.proto", + &descriptor_table_deephaven_2fproto_2fapplication_2eproto_once, descriptor_table_deephaven_2fproto_2fapplication_2eproto_deps, 1, 3, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fapplication_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fapplication_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fapplication_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fapplication_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2fapplication_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fapplication_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2fapplication_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fapplication_2eproto(&descriptor_table_deephaven_2fproto_2fapplication_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fapplication_2eproto(&descriptor_table_deephaven_2fproto_2fapplication_2eproto); namespace io { namespace deephaven { namespace proto { @@ -189,7 +192,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ListFieldsRequest::GetClassDat ::PROTOBUF_NAMESPACE_ID::Metadata ListFieldsRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fapplication_2eproto_getter, &descriptor_table_deephaven_2fproto_2fapplication_2eproto_once, file_level_metadata_deephaven_2fproto_2fapplication_2eproto[0]); } @@ -207,9 +210,6 @@ FieldsChangeUpdate::FieldsChangeUpdate(::PROTOBUF_NAMESPACE_ID::Arena* arena, updated_(arena), removed_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) } FieldsChangeUpdate::FieldsChangeUpdate(const FieldsChangeUpdate& from) @@ -221,33 +221,29 @@ FieldsChangeUpdate::FieldsChangeUpdate(const FieldsChangeUpdate& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) } -void FieldsChangeUpdate::SharedCtor() { +inline void FieldsChangeUpdate::SharedCtor() { } FieldsChangeUpdate::~FieldsChangeUpdate() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FieldsChangeUpdate::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void FieldsChangeUpdate::ArenaDtor(void* object) { - FieldsChangeUpdate* _this = reinterpret_cast< FieldsChangeUpdate* >(object); - (void)_this; -} -void FieldsChangeUpdate::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FieldsChangeUpdate::SetCachedSize(int size) const { _cached_size_.Set(size); } void FieldsChangeUpdate::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -257,15 +253,15 @@ void FieldsChangeUpdate::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FieldsChangeUpdate::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FieldsChangeUpdate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated .io.deephaven.proto.backplane.grpc.FieldInfo created = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; @@ -278,7 +274,7 @@ const char* FieldsChangeUpdate::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // repeated .io.deephaven.proto.backplane.grpc.FieldInfo updated = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -291,7 +287,7 @@ const char* FieldsChangeUpdate::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // repeated .io.deephaven.proto.backplane.grpc.FieldInfo removed = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -325,38 +321,38 @@ const char* FieldsChangeUpdate::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FieldsChangeUpdate::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FieldsChangeUpdate::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated .io.deephaven.proto.backplane.grpc.FieldInfo created = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_created_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_created_size()); i < n; i++) { + const auto& repfield = this->_internal_created(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_created(i), target, stream); + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.FieldInfo updated = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_updated_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_updated_size()); i < n; i++) { + const auto& repfield = this->_internal_updated(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_updated(i), target, stream); + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.FieldInfo removed = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_removed_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_removed_size()); i < n; i++) { + const auto& repfield = this->_internal_removed(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_removed(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) @@ -367,7 +363,7 @@ size_t FieldsChangeUpdate::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -411,7 +407,7 @@ void FieldsChangeUpdate::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FieldsChangeUpdate::MergeFrom(const FieldsChangeUpdate& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; created_.MergeFrom(from.created_); @@ -440,7 +436,7 @@ void FieldsChangeUpdate::InternalSwap(FieldsChangeUpdate* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FieldsChangeUpdate::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fapplication_2eproto_getter, &descriptor_table_deephaven_2fproto_2fapplication_2eproto_once, file_level_metadata_deephaven_2fproto_2fapplication_2eproto[1]); } @@ -466,32 +462,41 @@ FieldInfo::FieldInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FieldInfo) } FieldInfo::FieldInfo(const FieldInfo& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + field_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + field_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_field_name().empty()) { - field_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_field_name(), + field_name_.Set(from._internal_field_name(), GetArenaForAllocation()); } - field_description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + field_description_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + field_description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_field_description().empty()) { - field_description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_field_description(), + field_description_.Set(from._internal_field_description(), GetArenaForAllocation()); } - application_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + application_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + application_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_application_name().empty()) { - application_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_application_name(), + application_name_.Set(from._internal_application_name(), GetArenaForAllocation()); } - application_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + application_id_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + application_id_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_application_id().empty()) { - application_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_application_id(), + application_id_.Set(from._internal_application_id(), GetArenaForAllocation()); } if (from._internal_has_typed_ticket()) { @@ -502,43 +507,51 @@ FieldInfo::FieldInfo(const FieldInfo& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FieldInfo) } -void FieldInfo::SharedCtor() { -field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -field_description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -application_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -application_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FieldInfo::SharedCtor() { +field_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + field_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +field_description_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + field_description_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +application_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + application_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +application_id_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + application_id_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING typed_ticket_ = nullptr; } FieldInfo::~FieldInfo() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FieldInfo) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FieldInfo::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_description_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - application_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - application_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + field_name_.Destroy(); + field_description_.Destroy(); + application_name_.Destroy(); + application_id_.Destroy(); if (this != internal_default_instance()) delete typed_ticket_; } -void FieldInfo::ArenaDtor(void* object) { - FieldInfo* _this = reinterpret_cast< FieldInfo* >(object); - (void)_this; -} -void FieldInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FieldInfo::SetCachedSize(int size) const { _cached_size_.Set(size); } void FieldInfo::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FieldInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -553,15 +566,15 @@ void FieldInfo::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FieldInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FieldInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TypedTicket typed_ticket = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_typed_ticket(), ptr); CHK_(ptr); } else @@ -569,41 +582,41 @@ const char* FieldInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // string field_name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_field_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.field_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.field_name")); } else goto handle_unusual; continue; // string field_description = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_field_description(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.field_description")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.field_description")); } else goto handle_unusual; continue; // string application_name = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { auto str = _internal_mutable_application_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.application_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.application_name")); } else goto handle_unusual; continue; // string application_id = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { auto str = _internal_mutable_application_id(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.application_id")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FieldInfo.application_id")); } else goto handle_unusual; continue; @@ -630,18 +643,17 @@ const char* FieldInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FieldInfo::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FieldInfo::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FieldInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TypedTicket typed_ticket = 1; if (this->_internal_has_typed_ticket()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::typed_ticket(this), target, stream); + InternalWriteMessage(1, _Internal::typed_ticket(this), + _Internal::typed_ticket(this).GetCachedSize(), target, stream); } // string field_name = 2; @@ -685,7 +697,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FieldInfo::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FieldInfo) @@ -696,7 +708,7 @@ size_t FieldInfo::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FieldInfo) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -754,7 +766,7 @@ void FieldInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FieldInfo::MergeFrom(const FieldInfo& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FieldInfo) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_field_name().empty()) { @@ -792,22 +804,18 @@ void FieldInfo::InternalSwap(FieldInfo* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &field_name_, lhs_arena, &other->field_name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &field_description_, lhs_arena, &other->field_description_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &application_name_, lhs_arena, &other->application_name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &application_id_, lhs_arena, &other->application_id_, rhs_arena ); @@ -815,7 +823,7 @@ void FieldInfo::InternalSwap(FieldInfo* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FieldInfo::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fapplication_2eproto_getter, &descriptor_table_deephaven_2fproto_2fapplication_2eproto_once, file_level_metadata_deephaven_2fproto_2fapplication_2eproto[2]); } @@ -827,13 +835,16 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FieldInfo::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ListFieldsRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ListFieldsRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ListFieldsRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ListFieldsRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FieldInfo* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FieldInfo >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FieldInfo* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FieldInfo >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FieldInfo >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.h index 9b2294e7c65..3009ebc9dda 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/application.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/application.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -27,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -47,15 +43,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2fapplication_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fapplication_2eproto; namespace io { @@ -94,7 +82,7 @@ class ListFieldsRequest final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.ListFieldsRequest) */ { public: inline ListFieldsRequest() : ListFieldsRequest(nullptr) {} - explicit constexpr ListFieldsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ListFieldsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ListFieldsRequest(const ListFieldsRequest& from); ListFieldsRequest(ListFieldsRequest&& from) noexcept @@ -144,7 +132,12 @@ class ListFieldsRequest final : } inline void Swap(ListFieldsRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -158,11 +151,7 @@ class ListFieldsRequest final : // implements Message ---------------------------------------------- - inline ListFieldsRequest* New() const final { - return new ListFieldsRequest(); - } - - ListFieldsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ListFieldsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -174,6 +163,8 @@ class ListFieldsRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ListFieldsRequest"; @@ -181,7 +172,6 @@ class ListFieldsRequest final : protected: explicit ListFieldsRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -200,7 +190,6 @@ class ListFieldsRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fapplication_2eproto; }; // ------------------------------------------------------------------- @@ -210,7 +199,7 @@ class FieldsChangeUpdate final : public: inline FieldsChangeUpdate() : FieldsChangeUpdate(nullptr) {} ~FieldsChangeUpdate() override; - explicit constexpr FieldsChangeUpdate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FieldsChangeUpdate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FieldsChangeUpdate(const FieldsChangeUpdate& from); FieldsChangeUpdate(FieldsChangeUpdate&& from) noexcept @@ -260,7 +249,12 @@ class FieldsChangeUpdate final : } inline void Swap(FieldsChangeUpdate* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -274,11 +268,7 @@ class FieldsChangeUpdate final : // implements Message ---------------------------------------------- - inline FieldsChangeUpdate* New() const final { - return new FieldsChangeUpdate(); - } - - FieldsChangeUpdate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FieldsChangeUpdate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -293,8 +283,8 @@ class FieldsChangeUpdate final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -302,6 +292,8 @@ class FieldsChangeUpdate final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FieldsChangeUpdate* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FieldsChangeUpdate"; @@ -309,9 +301,6 @@ class FieldsChangeUpdate final : protected: explicit FieldsChangeUpdate(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -402,7 +391,7 @@ class FieldInfo final : public: inline FieldInfo() : FieldInfo(nullptr) {} ~FieldInfo() override; - explicit constexpr FieldInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FieldInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FieldInfo(const FieldInfo& from); FieldInfo(FieldInfo&& from) noexcept @@ -452,7 +441,12 @@ class FieldInfo final : } inline void Swap(FieldInfo* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -466,11 +460,7 @@ class FieldInfo final : // implements Message ---------------------------------------------- - inline FieldInfo* New() const final { - return new FieldInfo(); - } - - FieldInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FieldInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -485,8 +475,8 @@ class FieldInfo final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -494,6 +484,8 @@ class FieldInfo final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FieldInfo* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FieldInfo"; @@ -501,9 +493,6 @@ class FieldInfo final : protected: explicit FieldInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -528,7 +517,7 @@ class FieldInfo final : template void set_field_name(ArgT0&& arg0, ArgT... args); std::string* mutable_field_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_field_name(); + PROTOBUF_NODISCARD std::string* release_field_name(); void set_allocated_field_name(std::string* field_name); private: const std::string& _internal_field_name() const; @@ -542,7 +531,7 @@ class FieldInfo final : template void set_field_description(ArgT0&& arg0, ArgT... args); std::string* mutable_field_description(); - PROTOBUF_MUST_USE_RESULT std::string* release_field_description(); + PROTOBUF_NODISCARD std::string* release_field_description(); void set_allocated_field_description(std::string* field_description); private: const std::string& _internal_field_description() const; @@ -556,7 +545,7 @@ class FieldInfo final : template void set_application_name(ArgT0&& arg0, ArgT... args); std::string* mutable_application_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_application_name(); + PROTOBUF_NODISCARD std::string* release_application_name(); void set_allocated_application_name(std::string* application_name); private: const std::string& _internal_application_name() const; @@ -570,7 +559,7 @@ class FieldInfo final : template void set_application_id(ArgT0&& arg0, ArgT... args); std::string* mutable_application_id(); - PROTOBUF_MUST_USE_RESULT std::string* release_application_id(); + PROTOBUF_NODISCARD std::string* release_application_id(); void set_allocated_application_id(std::string* application_id); private: const std::string& _internal_application_id() const; @@ -585,7 +574,7 @@ class FieldInfo final : public: void clear_typed_ticket(); const ::io::deephaven::proto::backplane::grpc::TypedTicket& typed_ticket() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TypedTicket* release_typed_ticket(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TypedTicket* release_typed_ticket(); ::io::deephaven::proto::backplane::grpc::TypedTicket* mutable_typed_ticket(); void set_allocated_typed_ticket(::io::deephaven::proto::backplane::grpc::TypedTicket* typed_ticket); private: @@ -821,8 +810,7 @@ inline void FieldInfo::set_allocated_typed_ticket(::io::deephaven::proto::backpl } if (typed_ticket) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(typed_ticket)); if (message_arena != submessage_arena) { typed_ticket = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -848,7 +836,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FieldInfo::set_field_name(ArgT0&& arg0, ArgT... args) { - field_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + field_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FieldInfo.field_name) } inline std::string* FieldInfo::mutable_field_name() { @@ -861,15 +849,15 @@ inline const std::string& FieldInfo::_internal_field_name() const { } inline void FieldInfo::_internal_set_field_name(const std::string& value) { - field_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + field_name_.Set(value, GetArenaForAllocation()); } inline std::string* FieldInfo::_internal_mutable_field_name() { - return field_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return field_name_.Mutable(GetArenaForAllocation()); } inline std::string* FieldInfo::release_field_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FieldInfo.field_name) - return field_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return field_name_.Release(); } inline void FieldInfo::set_allocated_field_name(std::string* field_name) { if (field_name != nullptr) { @@ -877,8 +865,12 @@ inline void FieldInfo::set_allocated_field_name(std::string* field_name) { } else { } - field_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name, - GetArenaForAllocation()); + field_name_.SetAllocated(field_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (field_name_.IsDefault()) { + field_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FieldInfo.field_name) } @@ -894,7 +886,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FieldInfo::set_field_description(ArgT0&& arg0, ArgT... args) { - field_description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + field_description_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FieldInfo.field_description) } inline std::string* FieldInfo::mutable_field_description() { @@ -907,15 +899,15 @@ inline const std::string& FieldInfo::_internal_field_description() const { } inline void FieldInfo::_internal_set_field_description(const std::string& value) { - field_description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + field_description_.Set(value, GetArenaForAllocation()); } inline std::string* FieldInfo::_internal_mutable_field_description() { - return field_description_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return field_description_.Mutable(GetArenaForAllocation()); } inline std::string* FieldInfo::release_field_description() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FieldInfo.field_description) - return field_description_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return field_description_.Release(); } inline void FieldInfo::set_allocated_field_description(std::string* field_description) { if (field_description != nullptr) { @@ -923,8 +915,12 @@ inline void FieldInfo::set_allocated_field_description(std::string* field_descri } else { } - field_description_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_description, - GetArenaForAllocation()); + field_description_.SetAllocated(field_description, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (field_description_.IsDefault()) { + field_description_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FieldInfo.field_description) } @@ -940,7 +936,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FieldInfo::set_application_name(ArgT0&& arg0, ArgT... args) { - application_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + application_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FieldInfo.application_name) } inline std::string* FieldInfo::mutable_application_name() { @@ -953,15 +949,15 @@ inline const std::string& FieldInfo::_internal_application_name() const { } inline void FieldInfo::_internal_set_application_name(const std::string& value) { - application_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + application_name_.Set(value, GetArenaForAllocation()); } inline std::string* FieldInfo::_internal_mutable_application_name() { - return application_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return application_name_.Mutable(GetArenaForAllocation()); } inline std::string* FieldInfo::release_application_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FieldInfo.application_name) - return application_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return application_name_.Release(); } inline void FieldInfo::set_allocated_application_name(std::string* application_name) { if (application_name != nullptr) { @@ -969,8 +965,12 @@ inline void FieldInfo::set_allocated_application_name(std::string* application_n } else { } - application_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), application_name, - GetArenaForAllocation()); + application_name_.SetAllocated(application_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (application_name_.IsDefault()) { + application_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FieldInfo.application_name) } @@ -986,7 +986,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FieldInfo::set_application_id(ArgT0&& arg0, ArgT... args) { - application_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + application_id_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FieldInfo.application_id) } inline std::string* FieldInfo::mutable_application_id() { @@ -999,15 +999,15 @@ inline const std::string& FieldInfo::_internal_application_id() const { } inline void FieldInfo::_internal_set_application_id(const std::string& value) { - application_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + application_id_.Set(value, GetArenaForAllocation()); } inline std::string* FieldInfo::_internal_mutable_application_id() { - return application_id_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return application_id_.Mutable(GetArenaForAllocation()); } inline std::string* FieldInfo::release_application_id() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FieldInfo.application_id) - return application_id_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return application_id_.Release(); } inline void FieldInfo::set_allocated_application_id(std::string* application_id) { if (application_id != nullptr) { @@ -1015,8 +1015,12 @@ inline void FieldInfo::set_allocated_application_id(std::string* application_id) } else { } - application_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), application_id, - GetArenaForAllocation()); + application_id_.SetAllocated(application_id, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (application_id_.IsDefault()) { + application_id_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FieldInfo.application_id) } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.cc index ebcee80e412..e05a9a806b9 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/console.proto @@ -63,11 +60,11 @@ ::grpc::Status ConsoleService::Stub::GetConsoleTypes(::grpc::ClientContext* cont return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetConsoleTypes_, context, request, response); } -void ConsoleService::Stub::experimental_async::GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, std::function f) { +void ConsoleService::Stub::async::GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetConsoleTypes_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetConsoleTypes_, context, request, response, reactor); } @@ -86,11 +83,11 @@ ::grpc::Status ConsoleService::Stub::StartConsole(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_StartConsole_, context, request, response); } -void ConsoleService::Stub::experimental_async::StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, std::function f) { +void ConsoleService::Stub::async::StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_StartConsole_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_StartConsole_, context, request, response, reactor); } @@ -109,7 +106,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::script::grpc::LogSubscr return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>::Create(channel_.get(), rpcmethod_SubscribeToLogs_, context, request); } -void ConsoleService::Stub::experimental_async::SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) { +void ConsoleService::Stub::async::SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>::Create(stub_->channel_.get(), stub_->rpcmethod_SubscribeToLogs_, context, request, reactor); } @@ -125,11 +122,11 @@ ::grpc::Status ConsoleService::Stub::ExecuteCommand(::grpc::ClientContext* conte return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ExecuteCommand_, context, request, response); } -void ConsoleService::Stub::experimental_async::ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, std::function f) { +void ConsoleService::Stub::async::ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExecuteCommand_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExecuteCommand_, context, request, response, reactor); } @@ -148,11 +145,11 @@ ::grpc::Status ConsoleService::Stub::CancelCommand(::grpc::ClientContext* contex return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_CancelCommand_, context, request, response); } -void ConsoleService::Stub::experimental_async::CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, std::function f) { +void ConsoleService::Stub::async::CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CancelCommand_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CancelCommand_, context, request, response, reactor); } @@ -171,11 +168,11 @@ ::grpc::Status ConsoleService::Stub::BindTableToVariable(::grpc::ClientContext* return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_BindTableToVariable_, context, request, response); } -void ConsoleService::Stub::experimental_async::BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, std::function f) { +void ConsoleService::Stub::async::BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BindTableToVariable_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BindTableToVariable_, context, request, response, reactor); } @@ -194,7 +191,7 @@ ::grpc::ClientReaderWriter< ::io::deephaven::proto::backplane::script::grpc::Aut return ::grpc::internal::ClientReaderWriterFactory< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>::Create(channel_.get(), rpcmethod_AutoCompleteStream_, context); } -void ConsoleService::Stub::experimental_async::AutoCompleteStream(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) { +void ConsoleService::Stub::async::AutoCompleteStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) { ::grpc::internal::ClientCallbackReaderWriterFactory< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_AutoCompleteStream_, context, reactor); } @@ -210,7 +207,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::script::grpc::AutoCompl return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>::Create(channel_.get(), rpcmethod_OpenAutoCompleteStream_, context, request); } -void ConsoleService::Stub::experimental_async::OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) { +void ConsoleService::Stub::async::OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_OpenAutoCompleteStream_, context, request, reactor); } @@ -226,11 +223,11 @@ ::grpc::Status ConsoleService::Stub::NextAutoCompleteStream(::grpc::ClientContex return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_NextAutoCompleteStream_, context, request, response); } -void ConsoleService::Stub::experimental_async::NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, std::function f) { +void ConsoleService::Stub::async::NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NextAutoCompleteStream_, context, request, response, std::move(f)); } -void ConsoleService::Stub::experimental_async::NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ConsoleService::Stub::async::NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NextAutoCompleteStream_, context, request, response, reactor); } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.h index c4c3cfb60ce..73fb35b1d00 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/console.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/console.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2fconsole_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2fconsole_2eproto__INCLUDED #include "deephaven/proto/console.pb.h" #include -#include #include #include #include @@ -129,79 +124,39 @@ class ConsoleService final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>> PrepareAsyncNextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>>(PrepareAsyncNextAutoCompleteStreamRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} virtual void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif virtual void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) = 0; - #else - virtual void SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) = 0; - #endif virtual void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif virtual void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif virtual void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Starts a stream for autocomplete on the current session. More than one console, // more than one document can be edited at a time using this, and they can separately // be closed as well. A given document should only be edited within one stream at a // time. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void AutoCompleteStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) = 0; - #else - virtual void AutoCompleteStream(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) = 0; - #endif // // Half of the browser-based (browser's can't do bidirectional streams without websockets) // implementation for AutoCompleteStream. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) = 0; - #else - virtual void OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) = 0; - #endif // // Other half of the browser-based implementation for AutoCompleteStream. virtual void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* AsyncGetConsoleTypesRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* PrepareAsyncGetConsoleTypesRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>* AsyncStartConsoleRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -296,71 +251,35 @@ class ConsoleService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>> PrepareAsyncNextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>>(PrepareAsyncNextAutoCompleteStreamRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void GetConsoleTypes(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void StartConsole(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) override; - #else - void SubscribeToLogs(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* reactor) override; - #endif void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void ExecuteCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void CancelCommand(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void BindTableToVariable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void AutoCompleteStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) override; - #else - void AutoCompleteStream(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest,::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) override; - #else - void OpenAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* reactor) override; - #endif void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void NextAutoCompleteStream(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* AsyncGetConsoleTypesRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* PrepareAsyncGetConsoleTypesRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>* AsyncStartConsoleRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest& request, ::grpc::CompletionQueue* cq) override; @@ -600,36 +519,22 @@ class ConsoleService final { }; typedef WithAsyncMethod_GetConsoleTypes > > > > > > > > AsyncService; template - class ExperimentalWithCallbackMethod_GetConsoleTypes : public BaseClass { + class WithCallbackMethod_GetConsoleTypes : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_GetConsoleTypes() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_GetConsoleTypes() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response) { return this->GetConsoleTypes(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* request, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* response) { return this->GetConsoleTypes(context, request, response); }));} void SetMessageAllocatorFor_GetConsoleTypes( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_GetConsoleTypes() override { + ~WithCallbackMethod_GetConsoleTypes() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -637,46 +542,26 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* GetConsoleTypes( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* GetConsoleTypes( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_StartConsole : public BaseClass { + class WithCallbackMethod_StartConsole : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_StartConsole() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(1, + WithCallbackMethod_StartConsole() { + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response) { return this->StartConsole(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* request, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* response) { return this->StartConsole(context, request, response); }));} void SetMessageAllocatorFor_StartConsole( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(1); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_StartConsole() override { + ~WithCallbackMethod_StartConsole() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -684,37 +569,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* StartConsole( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* StartConsole( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_SubscribeToLogs : public BaseClass { + class WithCallbackMethod_SubscribeToLogs : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_SubscribeToLogs() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(2, + WithCallbackMethod_SubscribeToLogs() { + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest, ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request) { return this->SubscribeToLogs(context, request); })); - } - ~ExperimentalWithCallbackMethod_SubscribeToLogs() override { + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* request) { return this->SubscribeToLogs(context, request); })); + } + ~WithCallbackMethod_SubscribeToLogs() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -722,46 +591,26 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* SubscribeToLogs( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData>* SubscribeToLogs( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* /*request*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ExecuteCommand : public BaseClass { + class WithCallbackMethod_ExecuteCommand : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ExecuteCommand() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(3, + WithCallbackMethod_ExecuteCommand() { + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response) { return this->ExecuteCommand(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* response) { return this->ExecuteCommand(context, request, response); }));} void SetMessageAllocatorFor_ExecuteCommand( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(3); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_ExecuteCommand() override { + ~WithCallbackMethod_ExecuteCommand() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -769,46 +618,26 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExecuteCommand( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExecuteCommand( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_CancelCommand : public BaseClass { + class WithCallbackMethod_CancelCommand : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_CancelCommand() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(4, + WithCallbackMethod_CancelCommand() { + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response) { return this->CancelCommand(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* request, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* response) { return this->CancelCommand(context, request, response); }));} void SetMessageAllocatorFor_CancelCommand( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(4); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_CancelCommand() override { + ~WithCallbackMethod_CancelCommand() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -816,46 +645,26 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CancelCommand( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CancelCommand( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_BindTableToVariable : public BaseClass { + class WithCallbackMethod_BindTableToVariable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_BindTableToVariable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(5, + WithCallbackMethod_BindTableToVariable() { + ::grpc::Service::MarkMethodCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response) { return this->BindTableToVariable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* request, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* response) { return this->BindTableToVariable(context, request, response); }));} void SetMessageAllocatorFor_BindTableToVariable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(5); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_BindTableToVariable() override { + ~WithCallbackMethod_BindTableToVariable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -863,37 +672,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* BindTableToVariable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* BindTableToVariable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_AutoCompleteStream : public BaseClass { + class WithCallbackMethod_AutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_AutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(6, + WithCallbackMethod_AutoCompleteStream() { + ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackBidiHandler< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context) { return this->AutoCompleteStream(context); })); - } - ~ExperimentalWithCallbackMethod_AutoCompleteStream() override { + ::grpc::CallbackServerContext* context) { return this->AutoCompleteStream(context); })); + } + ~WithCallbackMethod_AutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -901,37 +694,22 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* AutoCompleteStream( ::grpc::CallbackServerContext* /*context*/) - #else - virtual ::grpc::experimental::ServerBidiReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* AutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/) - #endif { return nullptr; } }; template - class ExperimentalWithCallbackMethod_OpenAutoCompleteStream : public BaseClass { + class WithCallbackMethod_OpenAutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_OpenAutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(7, + WithCallbackMethod_OpenAutoCompleteStream() { + ::grpc::Service::MarkMethodCallback(7, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request) { return this->OpenAutoCompleteStream(context, request); })); - } - ~ExperimentalWithCallbackMethod_OpenAutoCompleteStream() override { + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request) { return this->OpenAutoCompleteStream(context, request); })); + } + ~WithCallbackMethod_OpenAutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -939,46 +717,26 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* OpenAutoCompleteStream( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse>* OpenAutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_NextAutoCompleteStream : public BaseClass { + class WithCallbackMethod_NextAutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_NextAutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(8, + WithCallbackMethod_NextAutoCompleteStream() { + ::grpc::Service::MarkMethodCallback(8, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response) { return this->NextAutoCompleteStream(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* request, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* response) { return this->NextAutoCompleteStream(context, request, response); }));} void SetMessageAllocatorFor_NextAutoCompleteStream( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(8); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(8); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_NextAutoCompleteStream() override { + ~WithCallbackMethod_NextAutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -986,20 +744,11 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NextAutoCompleteStream( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NextAutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* /*request*/, ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* /*response*/) { return nullptr; } }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_GetConsoleTypes > > > > > > > > CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_GetConsoleTypes > > > > > > > > ExperimentalCallbackService; + typedef WithCallbackMethod_GetConsoleTypes > > > > > > > > CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_GetConsoleTypes : public BaseClass { private: @@ -1334,27 +1083,17 @@ class ConsoleService final { } }; template - class ExperimentalWithRawCallbackMethod_GetConsoleTypes : public BaseClass { + class WithRawCallbackMethod_GetConsoleTypes : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_GetConsoleTypes() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_GetConsoleTypes() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetConsoleTypes(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_GetConsoleTypes() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetConsoleTypes(context, request, response); })); + } + ~WithRawCallbackMethod_GetConsoleTypes() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1362,37 +1101,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* GetConsoleTypes( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* GetConsoleTypes( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_StartConsole : public BaseClass { + class WithRawCallbackMethod_StartConsole : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_StartConsole() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(1, + WithRawCallbackMethod_StartConsole() { + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->StartConsole(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_StartConsole() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->StartConsole(context, request, response); })); + } + ~WithRawCallbackMethod_StartConsole() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1400,37 +1123,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* StartConsole( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* StartConsole( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_SubscribeToLogs : public BaseClass { + class WithRawCallbackMethod_SubscribeToLogs : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_SubscribeToLogs() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(2, + WithRawCallbackMethod_SubscribeToLogs() { + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->SubscribeToLogs(context, request); })); - } - ~ExperimentalWithRawCallbackMethod_SubscribeToLogs() override { + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->SubscribeToLogs(context, request); })); + } + ~WithRawCallbackMethod_SubscribeToLogs() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1438,37 +1145,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* SubscribeToLogs( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* SubscribeToLogs( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ExecuteCommand : public BaseClass { + class WithRawCallbackMethod_ExecuteCommand : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ExecuteCommand() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(3, + WithRawCallbackMethod_ExecuteCommand() { + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExecuteCommand(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_ExecuteCommand() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExecuteCommand(context, request, response); })); + } + ~WithRawCallbackMethod_ExecuteCommand() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1476,37 +1167,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExecuteCommand( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExecuteCommand( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_CancelCommand : public BaseClass { + class WithRawCallbackMethod_CancelCommand : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_CancelCommand() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(4, + WithRawCallbackMethod_CancelCommand() { + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CancelCommand(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_CancelCommand() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CancelCommand(context, request, response); })); + } + ~WithRawCallbackMethod_CancelCommand() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1514,37 +1189,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CancelCommand( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CancelCommand( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_BindTableToVariable : public BaseClass { + class WithRawCallbackMethod_BindTableToVariable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_BindTableToVariable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(5, + WithRawCallbackMethod_BindTableToVariable() { + ::grpc::Service::MarkMethodRawCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->BindTableToVariable(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_BindTableToVariable() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->BindTableToVariable(context, request, response); })); + } + ~WithRawCallbackMethod_BindTableToVariable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1552,37 +1211,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* BindTableToVariable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* BindTableToVariable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_AutoCompleteStream : public BaseClass { + class WithRawCallbackMethod_AutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_AutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(6, + WithRawCallbackMethod_AutoCompleteStream() { + ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context) { return this->AutoCompleteStream(context); })); - } - ~ExperimentalWithRawCallbackMethod_AutoCompleteStream() override { + ::grpc::CallbackServerContext* context) { return this->AutoCompleteStream(context); })); + } + ~WithRawCallbackMethod_AutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1590,37 +1233,22 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* AutoCompleteStream( ::grpc::CallbackServerContext* /*context*/) - #else - virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* AutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/) - #endif { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_OpenAutoCompleteStream : public BaseClass { + class WithRawCallbackMethod_OpenAutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_OpenAutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(7, + WithRawCallbackMethod_OpenAutoCompleteStream() { + ::grpc::Service::MarkMethodRawCallback(7, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->OpenAutoCompleteStream(context, request); })); - } - ~ExperimentalWithRawCallbackMethod_OpenAutoCompleteStream() override { + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->OpenAutoCompleteStream(context, request); })); + } + ~WithRawCallbackMethod_OpenAutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1628,37 +1256,21 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* OpenAutoCompleteStream( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* OpenAutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_NextAutoCompleteStream : public BaseClass { + class WithRawCallbackMethod_NextAutoCompleteStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_NextAutoCompleteStream() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(8, + WithRawCallbackMethod_NextAutoCompleteStream() { + ::grpc::Service::MarkMethodRawCallback(8, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NextAutoCompleteStream(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_NextAutoCompleteStream() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NextAutoCompleteStream(context, request, response); })); + } + ~WithRawCallbackMethod_NextAutoCompleteStream() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1666,14 +1278,8 @@ class ConsoleService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NextAutoCompleteStream( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NextAutoCompleteStream( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithStreamedUnaryMethod_GetConsoleTypes : public BaseClass { diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.cc index ad062479141..26338756ee5 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/console.proto @@ -19,357 +16,361 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace script { namespace grpc { -constexpr GetConsoleTypesRequest::GetConsoleTypesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_CONSTEXPR GetConsoleTypesRequest::GetConsoleTypesRequest( + ::_pbi::ConstantInitialized){} struct GetConsoleTypesRequestDefaultTypeInternal { - constexpr GetConsoleTypesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR GetConsoleTypesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~GetConsoleTypesRequestDefaultTypeInternal() {} union { GetConsoleTypesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetConsoleTypesRequestDefaultTypeInternal _GetConsoleTypesRequest_default_instance_; -constexpr GetConsoleTypesResponse::GetConsoleTypesResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetConsoleTypesRequestDefaultTypeInternal _GetConsoleTypesRequest_default_instance_; +PROTOBUF_CONSTEXPR GetConsoleTypesResponse::GetConsoleTypesResponse( + ::_pbi::ConstantInitialized) : console_types_(){} struct GetConsoleTypesResponseDefaultTypeInternal { - constexpr GetConsoleTypesResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR GetConsoleTypesResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~GetConsoleTypesResponseDefaultTypeInternal() {} union { GetConsoleTypesResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetConsoleTypesResponseDefaultTypeInternal _GetConsoleTypesResponse_default_instance_; -constexpr StartConsoleRequest::StartConsoleRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : session_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetConsoleTypesResponseDefaultTypeInternal _GetConsoleTypesResponse_default_instance_; +PROTOBUF_CONSTEXPR StartConsoleRequest::StartConsoleRequest( + ::_pbi::ConstantInitialized) + : session_type_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , result_id_(nullptr){} struct StartConsoleRequestDefaultTypeInternal { - constexpr StartConsoleRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR StartConsoleRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~StartConsoleRequestDefaultTypeInternal() {} union { StartConsoleRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT StartConsoleRequestDefaultTypeInternal _StartConsoleRequest_default_instance_; -constexpr StartConsoleResponse::StartConsoleResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StartConsoleRequestDefaultTypeInternal _StartConsoleRequest_default_instance_; +PROTOBUF_CONSTEXPR StartConsoleResponse::StartConsoleResponse( + ::_pbi::ConstantInitialized) : result_id_(nullptr){} struct StartConsoleResponseDefaultTypeInternal { - constexpr StartConsoleResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR StartConsoleResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~StartConsoleResponseDefaultTypeInternal() {} union { StartConsoleResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT StartConsoleResponseDefaultTypeInternal _StartConsoleResponse_default_instance_; -constexpr LogSubscriptionRequest::LogSubscriptionRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StartConsoleResponseDefaultTypeInternal _StartConsoleResponse_default_instance_; +PROTOBUF_CONSTEXPR LogSubscriptionRequest::LogSubscriptionRequest( + ::_pbi::ConstantInitialized) : levels_() , last_seen_log_timestamp_(int64_t{0}){} struct LogSubscriptionRequestDefaultTypeInternal { - constexpr LogSubscriptionRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR LogSubscriptionRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~LogSubscriptionRequestDefaultTypeInternal() {} union { LogSubscriptionRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LogSubscriptionRequestDefaultTypeInternal _LogSubscriptionRequest_default_instance_; -constexpr LogSubscriptionData::LogSubscriptionData( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : log_level_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , message_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LogSubscriptionRequestDefaultTypeInternal _LogSubscriptionRequest_default_instance_; +PROTOBUF_CONSTEXPR LogSubscriptionData::LogSubscriptionData( + ::_pbi::ConstantInitialized) + : log_level_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , message_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , micros_(int64_t{0}){} struct LogSubscriptionDataDefaultTypeInternal { - constexpr LogSubscriptionDataDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR LogSubscriptionDataDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~LogSubscriptionDataDefaultTypeInternal() {} union { LogSubscriptionData _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LogSubscriptionDataDefaultTypeInternal _LogSubscriptionData_default_instance_; -constexpr ExecuteCommandRequest::ExecuteCommandRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : code_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LogSubscriptionDataDefaultTypeInternal _LogSubscriptionData_default_instance_; +PROTOBUF_CONSTEXPR ExecuteCommandRequest::ExecuteCommandRequest( + ::_pbi::ConstantInitialized) + : code_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , console_id_(nullptr){} struct ExecuteCommandRequestDefaultTypeInternal { - constexpr ExecuteCommandRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExecuteCommandRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExecuteCommandRequestDefaultTypeInternal() {} union { ExecuteCommandRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExecuteCommandRequestDefaultTypeInternal _ExecuteCommandRequest_default_instance_; -constexpr ExecuteCommandResponse::ExecuteCommandResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : error_message_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExecuteCommandRequestDefaultTypeInternal _ExecuteCommandRequest_default_instance_; +PROTOBUF_CONSTEXPR ExecuteCommandResponse::ExecuteCommandResponse( + ::_pbi::ConstantInitialized) + : error_message_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , changes_(nullptr){} struct ExecuteCommandResponseDefaultTypeInternal { - constexpr ExecuteCommandResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExecuteCommandResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExecuteCommandResponseDefaultTypeInternal() {} union { ExecuteCommandResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExecuteCommandResponseDefaultTypeInternal _ExecuteCommandResponse_default_instance_; -constexpr BindTableToVariableRequest::BindTableToVariableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : variable_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExecuteCommandResponseDefaultTypeInternal _ExecuteCommandResponse_default_instance_; +PROTOBUF_CONSTEXPR BindTableToVariableRequest::BindTableToVariableRequest( + ::_pbi::ConstantInitialized) + : variable_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , console_id_(nullptr) , table_id_(nullptr){} struct BindTableToVariableRequestDefaultTypeInternal { - constexpr BindTableToVariableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR BindTableToVariableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~BindTableToVariableRequestDefaultTypeInternal() {} union { BindTableToVariableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BindTableToVariableRequestDefaultTypeInternal _BindTableToVariableRequest_default_instance_; -constexpr BindTableToVariableResponse::BindTableToVariableResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BindTableToVariableRequestDefaultTypeInternal _BindTableToVariableRequest_default_instance_; +PROTOBUF_CONSTEXPR BindTableToVariableResponse::BindTableToVariableResponse( + ::_pbi::ConstantInitialized){} struct BindTableToVariableResponseDefaultTypeInternal { - constexpr BindTableToVariableResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR BindTableToVariableResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~BindTableToVariableResponseDefaultTypeInternal() {} union { BindTableToVariableResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BindTableToVariableResponseDefaultTypeInternal _BindTableToVariableResponse_default_instance_; -constexpr CancelCommandRequest::CancelCommandRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BindTableToVariableResponseDefaultTypeInternal _BindTableToVariableResponse_default_instance_; +PROTOBUF_CONSTEXPR CancelCommandRequest::CancelCommandRequest( + ::_pbi::ConstantInitialized) : console_id_(nullptr) , command_id_(nullptr){} struct CancelCommandRequestDefaultTypeInternal { - constexpr CancelCommandRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CancelCommandRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CancelCommandRequestDefaultTypeInternal() {} union { CancelCommandRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CancelCommandRequestDefaultTypeInternal _CancelCommandRequest_default_instance_; -constexpr CancelCommandResponse::CancelCommandResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CancelCommandRequestDefaultTypeInternal _CancelCommandRequest_default_instance_; +PROTOBUF_CONSTEXPR CancelCommandResponse::CancelCommandResponse( + ::_pbi::ConstantInitialized){} struct CancelCommandResponseDefaultTypeInternal { - constexpr CancelCommandResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CancelCommandResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CancelCommandResponseDefaultTypeInternal() {} union { CancelCommandResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CancelCommandResponseDefaultTypeInternal _CancelCommandResponse_default_instance_; -constexpr AutoCompleteRequest::AutoCompleteRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CancelCommandResponseDefaultTypeInternal _CancelCommandResponse_default_instance_; +PROTOBUF_CONSTEXPR AutoCompleteRequest::AutoCompleteRequest( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct AutoCompleteRequestDefaultTypeInternal { - constexpr AutoCompleteRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AutoCompleteRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AutoCompleteRequestDefaultTypeInternal() {} union { AutoCompleteRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AutoCompleteRequestDefaultTypeInternal _AutoCompleteRequest_default_instance_; -constexpr AutoCompleteResponse::AutoCompleteResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AutoCompleteRequestDefaultTypeInternal _AutoCompleteRequest_default_instance_; +PROTOBUF_CONSTEXPR AutoCompleteResponse::AutoCompleteResponse( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct AutoCompleteResponseDefaultTypeInternal { - constexpr AutoCompleteResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AutoCompleteResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AutoCompleteResponseDefaultTypeInternal() {} union { AutoCompleteResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AutoCompleteResponseDefaultTypeInternal _AutoCompleteResponse_default_instance_; -constexpr BrowserNextResponse::BrowserNextResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AutoCompleteResponseDefaultTypeInternal _AutoCompleteResponse_default_instance_; +PROTOBUF_CONSTEXPR BrowserNextResponse::BrowserNextResponse( + ::_pbi::ConstantInitialized){} struct BrowserNextResponseDefaultTypeInternal { - constexpr BrowserNextResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR BrowserNextResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~BrowserNextResponseDefaultTypeInternal() {} union { BrowserNextResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BrowserNextResponseDefaultTypeInternal _BrowserNextResponse_default_instance_; -constexpr OpenDocumentRequest::OpenDocumentRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BrowserNextResponseDefaultTypeInternal _BrowserNextResponse_default_instance_; +PROTOBUF_CONSTEXPR OpenDocumentRequest::OpenDocumentRequest( + ::_pbi::ConstantInitialized) : console_id_(nullptr) , text_document_(nullptr){} struct OpenDocumentRequestDefaultTypeInternal { - constexpr OpenDocumentRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR OpenDocumentRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~OpenDocumentRequestDefaultTypeInternal() {} union { OpenDocumentRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpenDocumentRequestDefaultTypeInternal _OpenDocumentRequest_default_instance_; -constexpr TextDocumentItem::TextDocumentItem( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : uri_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , language_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , text_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OpenDocumentRequestDefaultTypeInternal _OpenDocumentRequest_default_instance_; +PROTOBUF_CONSTEXPR TextDocumentItem::TextDocumentItem( + ::_pbi::ConstantInitialized) + : uri_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , language_id_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , version_(0){} struct TextDocumentItemDefaultTypeInternal { - constexpr TextDocumentItemDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TextDocumentItemDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TextDocumentItemDefaultTypeInternal() {} union { TextDocumentItem _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TextDocumentItemDefaultTypeInternal _TextDocumentItem_default_instance_; -constexpr CloseDocumentRequest::CloseDocumentRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TextDocumentItemDefaultTypeInternal _TextDocumentItem_default_instance_; +PROTOBUF_CONSTEXPR CloseDocumentRequest::CloseDocumentRequest( + ::_pbi::ConstantInitialized) : console_id_(nullptr) , text_document_(nullptr){} struct CloseDocumentRequestDefaultTypeInternal { - constexpr CloseDocumentRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CloseDocumentRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CloseDocumentRequestDefaultTypeInternal() {} union { CloseDocumentRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CloseDocumentRequestDefaultTypeInternal _CloseDocumentRequest_default_instance_; -constexpr ChangeDocumentRequest_TextDocumentContentChangeEvent::ChangeDocumentRequest_TextDocumentContentChangeEvent( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : text_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CloseDocumentRequestDefaultTypeInternal _CloseDocumentRequest_default_instance_; +PROTOBUF_CONSTEXPR ChangeDocumentRequest_TextDocumentContentChangeEvent::ChangeDocumentRequest_TextDocumentContentChangeEvent( + ::_pbi::ConstantInitialized) + : text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , range_(nullptr) , range_length_(0){} struct ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal { - constexpr ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal() {} union { ChangeDocumentRequest_TextDocumentContentChangeEvent _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal _ChangeDocumentRequest_TextDocumentContentChangeEvent_default_instance_; -constexpr ChangeDocumentRequest::ChangeDocumentRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChangeDocumentRequest_TextDocumentContentChangeEventDefaultTypeInternal _ChangeDocumentRequest_TextDocumentContentChangeEvent_default_instance_; +PROTOBUF_CONSTEXPR ChangeDocumentRequest::ChangeDocumentRequest( + ::_pbi::ConstantInitialized) : content_changes_() , console_id_(nullptr) , text_document_(nullptr){} struct ChangeDocumentRequestDefaultTypeInternal { - constexpr ChangeDocumentRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ChangeDocumentRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ChangeDocumentRequestDefaultTypeInternal() {} union { ChangeDocumentRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ChangeDocumentRequestDefaultTypeInternal _ChangeDocumentRequest_default_instance_; -constexpr DocumentRange::DocumentRange( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChangeDocumentRequestDefaultTypeInternal _ChangeDocumentRequest_default_instance_; +PROTOBUF_CONSTEXPR DocumentRange::DocumentRange( + ::_pbi::ConstantInitialized) : start_(nullptr) , end_(nullptr){} struct DocumentRangeDefaultTypeInternal { - constexpr DocumentRangeDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR DocumentRangeDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~DocumentRangeDefaultTypeInternal() {} union { DocumentRange _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DocumentRangeDefaultTypeInternal _DocumentRange_default_instance_; -constexpr VersionedTextDocumentIdentifier::VersionedTextDocumentIdentifier( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : uri_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DocumentRangeDefaultTypeInternal _DocumentRange_default_instance_; +PROTOBUF_CONSTEXPR VersionedTextDocumentIdentifier::VersionedTextDocumentIdentifier( + ::_pbi::ConstantInitialized) + : uri_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , version_(0){} struct VersionedTextDocumentIdentifierDefaultTypeInternal { - constexpr VersionedTextDocumentIdentifierDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR VersionedTextDocumentIdentifierDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~VersionedTextDocumentIdentifierDefaultTypeInternal() {} union { VersionedTextDocumentIdentifier _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT VersionedTextDocumentIdentifierDefaultTypeInternal _VersionedTextDocumentIdentifier_default_instance_; -constexpr Position::Position( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VersionedTextDocumentIdentifierDefaultTypeInternal _VersionedTextDocumentIdentifier_default_instance_; +PROTOBUF_CONSTEXPR Position::Position( + ::_pbi::ConstantInitialized) : line_(0) , character_(0){} struct PositionDefaultTypeInternal { - constexpr PositionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR PositionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~PositionDefaultTypeInternal() {} union { Position _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PositionDefaultTypeInternal _Position_default_instance_; -constexpr GetCompletionItemsRequest::GetCompletionItemsRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PositionDefaultTypeInternal _Position_default_instance_; +PROTOBUF_CONSTEXPR GetCompletionItemsRequest::GetCompletionItemsRequest( + ::_pbi::ConstantInitialized) : console_id_(nullptr) , context_(nullptr) , text_document_(nullptr) , position_(nullptr) , request_id_(0){} struct GetCompletionItemsRequestDefaultTypeInternal { - constexpr GetCompletionItemsRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR GetCompletionItemsRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~GetCompletionItemsRequestDefaultTypeInternal() {} union { GetCompletionItemsRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetCompletionItemsRequestDefaultTypeInternal _GetCompletionItemsRequest_default_instance_; -constexpr CompletionContext::CompletionContext( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : trigger_character_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetCompletionItemsRequestDefaultTypeInternal _GetCompletionItemsRequest_default_instance_; +PROTOBUF_CONSTEXPR CompletionContext::CompletionContext( + ::_pbi::ConstantInitialized) + : trigger_character_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , trigger_kind_(0){} struct CompletionContextDefaultTypeInternal { - constexpr CompletionContextDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CompletionContextDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CompletionContextDefaultTypeInternal() {} union { CompletionContext _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CompletionContextDefaultTypeInternal _CompletionContext_default_instance_; -constexpr GetCompletionItemsResponse::GetCompletionItemsResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompletionContextDefaultTypeInternal _CompletionContext_default_instance_; +PROTOBUF_CONSTEXPR GetCompletionItemsResponse::GetCompletionItemsResponse( + ::_pbi::ConstantInitialized) : items_() , request_id_(0) , success_(false){} struct GetCompletionItemsResponseDefaultTypeInternal { - constexpr GetCompletionItemsResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR GetCompletionItemsResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~GetCompletionItemsResponseDefaultTypeInternal() {} union { GetCompletionItemsResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetCompletionItemsResponseDefaultTypeInternal _GetCompletionItemsResponse_default_instance_; -constexpr CompletionItem::CompletionItem( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetCompletionItemsResponseDefaultTypeInternal _GetCompletionItemsResponse_default_instance_; +PROTOBUF_CONSTEXPR CompletionItem::CompletionItem( + ::_pbi::ConstantInitialized) : additional_text_edits_() , commit_characters_() - , label_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , detail_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , documentation_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , sort_text_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , filter_text_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , label_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , detail_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , documentation_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , sort_text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , filter_text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , text_edit_(nullptr) , start_(0) , length_(0) @@ -378,37 +379,37 @@ constexpr CompletionItem::CompletionItem( , preselect_(false) , insert_text_format_(0){} struct CompletionItemDefaultTypeInternal { - constexpr CompletionItemDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CompletionItemDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CompletionItemDefaultTypeInternal() {} union { CompletionItem _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CompletionItemDefaultTypeInternal _CompletionItem_default_instance_; -constexpr TextEdit::TextEdit( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : text_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompletionItemDefaultTypeInternal _CompletionItem_default_instance_; +PROTOBUF_CONSTEXPR TextEdit::TextEdit( + ::_pbi::ConstantInitialized) + : text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , range_(nullptr){} struct TextEditDefaultTypeInternal { - constexpr TextEditDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TextEditDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TextEditDefaultTypeInternal() {} union { TextEdit _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TextEditDefaultTypeInternal _TextEdit_default_instance_; -constexpr FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TextEditDefaultTypeInternal _TextEdit_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor( + ::_pbi::ConstantInitialized) : series_() , multi_series_() , axes_() - , title_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , title_font_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , title_color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , legend_font_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , legend_color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , title_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , title_font_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , title_color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , legend_font_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , legend_color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , colspan_(0) , rowspan_(0) , chart_type_(0) @@ -416,25 +417,25 @@ constexpr FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor( , show_legend_(false) , is3d_(false){} struct FigureDescriptor_ChartDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_ChartDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_ChartDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_ChartDescriptorDefaultTypeInternal() {} union { FigureDescriptor_ChartDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_ChartDescriptorDefaultTypeInternal _FigureDescriptor_ChartDescriptor_default_instance_; -constexpr FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_ChartDescriptorDefaultTypeInternal _FigureDescriptor_ChartDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor( + ::_pbi::ConstantInitialized) : data_sources_() - , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , line_color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , point_label_format_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , x_tool_tip_pattern_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , y_tool_tip_pattern_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , shape_label_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , shape_color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , shape_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , line_color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , point_label_format_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , x_tool_tip_pattern_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , y_tool_tip_pattern_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , shape_label_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , shape_color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , shape_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , plot_style_(0) , lines_visible_(false) @@ -442,18 +443,18 @@ constexpr FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor( , gradient_visible_(false) , shape_size_(0){} struct FigureDescriptor_SeriesDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_SeriesDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_SeriesDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_SeriesDescriptorDefaultTypeInternal() {} union { FigureDescriptor_SeriesDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_SeriesDescriptorDefaultTypeInternal _FigureDescriptor_SeriesDescriptor_default_instance_; -constexpr FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_SeriesDescriptorDefaultTypeInternal _FigureDescriptor_SeriesDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDescriptor( + ::_pbi::ConstantInitialized) : data_sources_() - , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , line_color_(nullptr) , point_color_(nullptr) , lines_visible_(nullptr) @@ -468,65 +469,65 @@ constexpr FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDe , plot_style_(0) {} struct FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal() {} union { FigureDescriptor_MultiSeriesDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal _FigureDescriptor_MultiSeriesDescriptor_default_instance_; -constexpr FigureDescriptor_StringMapWithDefault::FigureDescriptor_StringMapWithDefault( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_MultiSeriesDescriptorDefaultTypeInternal _FigureDescriptor_MultiSeriesDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_StringMapWithDefault::FigureDescriptor_StringMapWithDefault( + ::_pbi::ConstantInitialized) : keys_() , values_() - , default_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} + , default_string_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct FigureDescriptor_StringMapWithDefaultDefaultTypeInternal { - constexpr FigureDescriptor_StringMapWithDefaultDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_StringMapWithDefaultDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_StringMapWithDefaultDefaultTypeInternal() {} union { FigureDescriptor_StringMapWithDefault _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_StringMapWithDefaultDefaultTypeInternal _FigureDescriptor_StringMapWithDefault_default_instance_; -constexpr FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_StringMapWithDefaultDefaultTypeInternal _FigureDescriptor_StringMapWithDefault_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault( + ::_pbi::ConstantInitialized) : keys_() , values_() , default_double_(0){} struct FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal { - constexpr FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal() {} union { FigureDescriptor_DoubleMapWithDefault _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal _FigureDescriptor_DoubleMapWithDefault_default_instance_; -constexpr FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_DoubleMapWithDefaultDefaultTypeInternal _FigureDescriptor_DoubleMapWithDefault_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault( + ::_pbi::ConstantInitialized) : keys_() , values_() , default_bool_(false){} struct FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal { - constexpr FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal() {} union { FigureDescriptor_BoolMapWithDefault _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal _FigureDescriptor_BoolMapWithDefault_default_instance_; -constexpr FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_BoolMapWithDefaultDefaultTypeInternal _FigureDescriptor_BoolMapWithDefault_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor( + ::_pbi::ConstantInitialized) : major_tick_locations_() - , id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , label_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , label_font_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , ticks_font_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , format_pattern_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , id_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , label_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , label_font_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , ticks_font_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , format_pattern_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , business_calendar_descriptor_(nullptr) , format_type_(0) @@ -545,150 +546,150 @@ constexpr FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor( , is_time_axis_(false) , tick_label_angle_(0){} struct FigureDescriptor_AxisDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_AxisDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_AxisDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_AxisDescriptorDefaultTypeInternal() {} union { FigureDescriptor_AxisDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_AxisDescriptorDefaultTypeInternal _FigureDescriptor_AxisDescriptor_default_instance_; -constexpr FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : open_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , close_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_AxisDescriptorDefaultTypeInternal _FigureDescriptor_AxisDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod( + ::_pbi::ConstantInitialized) + : open_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , close_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal { - constexpr FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal() {} union { FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod_default_instance_; -constexpr FigureDescriptor_BusinessCalendarDescriptor_Holiday::FigureDescriptor_BusinessCalendarDescriptor_Holiday( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriodDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_Holiday::FigureDescriptor_BusinessCalendarDescriptor_Holiday( + ::_pbi::ConstantInitialized) : business_periods_() , date_(nullptr){} struct FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal { - constexpr FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal() {} union { FigureDescriptor_BusinessCalendarDescriptor_Holiday _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_Holiday_default_instance_; -constexpr FigureDescriptor_BusinessCalendarDescriptor_LocalDate::FigureDescriptor_BusinessCalendarDescriptor_LocalDate( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_BusinessCalendarDescriptor_HolidayDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_Holiday_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_LocalDate::FigureDescriptor_BusinessCalendarDescriptor_LocalDate( + ::_pbi::ConstantInitialized) : year_(0) , month_(0) , day_(0){} struct FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal { - constexpr FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal() {} union { FigureDescriptor_BusinessCalendarDescriptor_LocalDate _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_LocalDate_default_instance_; -constexpr FigureDescriptor_BusinessCalendarDescriptor::FigureDescriptor_BusinessCalendarDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_BusinessCalendarDescriptor_LocalDateDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_LocalDate_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor::FigureDescriptor_BusinessCalendarDescriptor( + ::_pbi::ConstantInitialized) : business_days_() , _business_days_cached_byte_size_(0) , business_periods_() , holidays_() - , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , time_zone_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} + , name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , time_zone_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal() {} union { FigureDescriptor_BusinessCalendarDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_default_instance_; -constexpr FigureDescriptor_MultiSeriesSourceDescriptor::FigureDescriptor_MultiSeriesSourceDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : axis_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_BusinessCalendarDescriptorDefaultTypeInternal _FigureDescriptor_BusinessCalendarDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesSourceDescriptor::FigureDescriptor_MultiSeriesSourceDescriptor( + ::_pbi::ConstantInitialized) + : axis_id_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , type_(0) - , table_map_id_(0){} + , partitioned_table_id_(0){} struct FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal() {} union { FigureDescriptor_MultiSeriesSourceDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal _FigureDescriptor_MultiSeriesSourceDescriptor_default_instance_; -constexpr FigureDescriptor_SourceDescriptor::FigureDescriptor_SourceDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : axis_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , column_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_MultiSeriesSourceDescriptorDefaultTypeInternal _FigureDescriptor_MultiSeriesSourceDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_SourceDescriptor::FigureDescriptor_SourceDescriptor( + ::_pbi::ConstantInitialized) + : axis_id_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , column_type_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , one_click_(nullptr) , type_(0) , table_id_(0) - , table_map_id_(0){} + , partitioned_table_id_(0){} struct FigureDescriptor_SourceDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_SourceDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_SourceDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_SourceDescriptorDefaultTypeInternal() {} union { FigureDescriptor_SourceDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_SourceDescriptorDefaultTypeInternal _FigureDescriptor_SourceDescriptor_default_instance_; -constexpr FigureDescriptor_OneClickDescriptor::FigureDescriptor_OneClickDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_SourceDescriptorDefaultTypeInternal _FigureDescriptor_SourceDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor_OneClickDescriptor::FigureDescriptor_OneClickDescriptor( + ::_pbi::ConstantInitialized) : columns_() , column_types_() , require_all_filters_to_display_(false){} struct FigureDescriptor_OneClickDescriptorDefaultTypeInternal { - constexpr FigureDescriptor_OneClickDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptor_OneClickDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptor_OneClickDescriptorDefaultTypeInternal() {} union { FigureDescriptor_OneClickDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptor_OneClickDescriptorDefaultTypeInternal _FigureDescriptor_OneClickDescriptor_default_instance_; -constexpr FigureDescriptor::FigureDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptor_OneClickDescriptorDefaultTypeInternal _FigureDescriptor_OneClickDescriptor_default_instance_; +PROTOBUF_CONSTEXPR FigureDescriptor::FigureDescriptor( + ::_pbi::ConstantInitialized) : charts_() , errors_() - , title_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , title_font_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , title_color_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , title_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , title_font_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , title_color_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , update_interval_(int64_t{0}) , cols_(0) , rows_(0){} struct FigureDescriptorDefaultTypeInternal { - constexpr FigureDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FigureDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FigureDescriptorDefaultTypeInternal() {} union { FigureDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FigureDescriptorDefaultTypeInternal _FigureDescriptor_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FigureDescriptorDefaultTypeInternal _FigureDescriptor_default_instance_; } // namespace grpc } // namespace script } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2fconsole_2eproto[43]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[7]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fconsole_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fconsole_2eproto[43]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[7]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fconsole_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2fconsole_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -785,10 +786,10 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest, request_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse, _internal_metadata_), @@ -796,7 +797,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse, response_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse, _internal_metadata_), @@ -1014,7 +1015,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor, point_size_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor, point_shape_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor, data_sources_), - ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault, _has_bits_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -1023,7 +1024,10 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault, default_string_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault, keys_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault, values_), - ~0u, // no _has_bits_ + 0, + ~0u, + ~0u, + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault, _has_bits_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -1032,7 +1036,10 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault, default_double_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault, keys_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault, values_), - ~0u, // no _has_bits_ + 0, + ~0u, + ~0u, + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault, _has_bits_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -1041,6 +1048,9 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault, default_bool_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault, keys_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault, values_), + 0, + ~0u, + ~0u, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor, _has_bits_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor, _internal_metadata_), ~0u, // no _extensions_ @@ -1133,7 +1143,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor, axis_id_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor, type_), - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor, table_map_id_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor, partitioned_table_id_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor, column_name_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, _internal_metadata_), @@ -1144,7 +1154,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, axis_id_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, type_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, table_id_), - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, table_map_id_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, partitioned_table_id_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, column_name_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, column_type_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor, one_click_), @@ -1180,7 +1190,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fconsole_2e ~0u, ~0u, }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest)}, { 6, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse)}, { 13, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest)}, @@ -1212,64 +1222,64 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 239, 258, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor)}, { 271, 291, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor)}, { 305, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor)}, - { 325, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault)}, - { 334, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault)}, - { 343, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault)}, - { 352, 379, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor)}, - { 400, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod)}, - { 408, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday)}, - { 416, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate)}, - { 425, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor)}, - { 436, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor)}, - { 446, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor)}, - { 459, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor)}, - { 468, 482, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_GetConsoleTypesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_GetConsoleTypesResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_StartConsoleRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_StartConsoleResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_LogSubscriptionRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_LogSubscriptionData_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_ExecuteCommandRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_ExecuteCommandResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_BindTableToVariableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_BindTableToVariableResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_CancelCommandRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_CancelCommandResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_AutoCompleteRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_AutoCompleteResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_BrowserNextResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_OpenDocumentRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_TextDocumentItem_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_CloseDocumentRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_ChangeDocumentRequest_TextDocumentContentChangeEvent_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_ChangeDocumentRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_DocumentRange_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_VersionedTextDocumentIdentifier_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_Position_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_GetCompletionItemsRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_CompletionContext_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_GetCompletionItemsResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_CompletionItem_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_TextEdit_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_ChartDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_SeriesDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_MultiSeriesDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_StringMapWithDefault_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_DoubleMapWithDefault_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BoolMapWithDefault_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_AxisDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_Holiday_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_LocalDate_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_MultiSeriesSourceDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_SourceDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_OneClickDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_default_instance_), + { 325, 334, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault)}, + { 337, 346, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault)}, + { 349, 358, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault)}, + { 361, 388, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor)}, + { 409, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod)}, + { 417, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday)}, + { 425, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate)}, + { 434, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor)}, + { 445, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor)}, + { 455, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor)}, + { 468, -1, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor)}, + { 477, 491, -1, sizeof(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::script::grpc::_GetConsoleTypesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_GetConsoleTypesResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_StartConsoleRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_StartConsoleResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_LogSubscriptionRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_LogSubscriptionData_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_ExecuteCommandRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_ExecuteCommandResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_BindTableToVariableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_BindTableToVariableResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_CancelCommandRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_CancelCommandResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_AutoCompleteRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_AutoCompleteResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_BrowserNextResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_OpenDocumentRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_TextDocumentItem_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_CloseDocumentRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_ChangeDocumentRequest_TextDocumentContentChangeEvent_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_ChangeDocumentRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_DocumentRange_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_VersionedTextDocumentIdentifier_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_Position_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_GetCompletionItemsRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_CompletionContext_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_GetCompletionItemsResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_CompletionItem_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_TextEdit_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_ChartDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_SeriesDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_MultiSeriesDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_StringMapWithDefault_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_DoubleMapWithDefault_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BoolMapWithDefault_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_AxisDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_Holiday_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_LocalDate_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_BusinessCalendarDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_MultiSeriesSourceDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_SourceDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_OneClickDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::script::grpc::_FigureDescriptor_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2fconsole_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -1283,303 +1293,309 @@ const char descriptor_table_protodef_deephaven_2fproto_2fconsole_2eproto[] PROTO "\001 \001(\0132).io.deephaven.proto.backplane.grp" "c.Ticket\022\024\n\014session_type\030\002 \001(\t\"T\n\024StartC" "onsoleResponse\022<\n\tresult_id\030\001 \001(\0132).io.d" - "eephaven.proto.backplane.grpc.Ticket\"I\n\026" - "LogSubscriptionRequest\022\037\n\027last_seen_log_" - "timestamp\030\001 \001(\003\022\016\n\006levels\030\002 \003(\t\"O\n\023LogSu" - "bscriptionData\022\016\n\006micros\030\001 \001(\003\022\021\n\tlog_le" - "vel\030\002 \001(\t\022\017\n\007message\030\003 \001(\tJ\004\010\004\020\005\"j\n\025Exec" - "uteCommandRequest\022=\n\nconsole_id\030\001 \001(\0132)." - "io.deephaven.proto.backplane.grpc.Ticket" - "\022\014\n\004code\030\003 \001(\tJ\004\010\002\020\003\"w\n\026ExecuteCommandRe" - "sponse\022\025\n\rerror_message\030\001 \001(\t\022F\n\007changes" - "\030\002 \001(\01325.io.deephaven.proto.backplane.gr" - "pc.FieldsChangeUpdate\"\265\001\n\032BindTableToVar" - "iableRequest\022=\n\nconsole_id\030\001 \001(\0132).io.de" - "ephaven.proto.backplane.grpc.Ticket\022\025\n\rv" - "ariable_name\030\003 \001(\t\022;\n\010table_id\030\004 \001(\0132).i" - "o.deephaven.proto.backplane.grpc.TicketJ" - "\004\010\002\020\003\"\035\n\033BindTableToVariableResponse\"\224\001\n" - "\024CancelCommandRequest\022=\n\nconsole_id\030\001 \001(" - "\0132).io.deephaven.proto.backplane.grpc.Ti" - "cket\022=\n\ncommand_id\030\002 \001(\0132).io.deephaven." - "proto.backplane.grpc.Ticket\"\027\n\025CancelCom" - "mandResponse\"\223\003\n\023AutoCompleteRequest\022V\n\r" - "open_document\030\001 \001(\0132=.io.deephaven.proto" - ".backplane.script.grpc.OpenDocumentReque" - "stH\000\022Z\n\017change_document\030\002 \001(\0132\?.io.deeph" - "aven.proto.backplane.script.grpc.ChangeD" - "ocumentRequestH\000\022c\n\024get_completion_items" - "\030\003 \001(\0132C.io.deephaven.proto.backplane.sc" - "ript.grpc.GetCompletionItemsRequestH\000\022X\n" - "\016close_document\030\004 \001(\0132>.io.deephaven.pro" - "to.backplane.script.grpc.CloseDocumentRe" - "questH\000B\t\n\007request\"\204\001\n\024AutoCompleteRespo" - "nse\022`\n\020completion_items\030\001 \001(\0132D.io.deeph" - "aven.proto.backplane.script.grpc.GetComp" - "letionItemsResponseH\000B\n\n\010response\"\025\n\023Bro" - "wserNextResponse\"\247\001\n\023OpenDocumentRequest" - "\022=\n\nconsole_id\030\001 \001(\0132).io.deephaven.prot" - "o.backplane.grpc.Ticket\022Q\n\rtext_document" - "\030\002 \001(\0132:.io.deephaven.proto.backplane.sc" - "ript.grpc.TextDocumentItem\"S\n\020TextDocume" - "ntItem\022\013\n\003uri\030\001 \001(\t\022\023\n\013language_id\030\002 \001(\t" - "\022\017\n\007version\030\003 \001(\005\022\014\n\004text\030\004 \001(\t\"\267\001\n\024Clos" - "eDocumentRequest\022=\n\nconsole_id\030\001 \001(\0132).i" - "o.deephaven.proto.backplane.grpc.Ticket\022" - "`\n\rtext_document\030\002 \001(\0132I.io.deephaven.pr" - "oto.backplane.script.grpc.VersionedTextD" - "ocumentIdentifier\"\300\003\n\025ChangeDocumentRequ" - "est\022=\n\nconsole_id\030\001 \001(\0132).io.deephaven.p" - "roto.backplane.grpc.Ticket\022`\n\rtext_docum" - "ent\030\002 \001(\0132I.io.deephaven.proto.backplane" - ".script.grpc.VersionedTextDocumentIdenti" - "fier\022w\n\017content_changes\030\003 \003(\0132^.io.deeph" - "aven.proto.backplane.script.grpc.ChangeD" - "ocumentRequest.TextDocumentContentChange" - "Event\032\214\001\n\036TextDocumentContentChangeEvent" - "\022F\n\005range\030\001 \001(\01327.io.deephaven.proto.bac" - "kplane.script.grpc.DocumentRange\022\024\n\014rang" - "e_length\030\002 \001(\005\022\014\n\004text\030\003 \001(\t\"\223\001\n\rDocumen" - "tRange\022A\n\005start\030\001 \001(\01322.io.deephaven.pro" - "to.backplane.script.grpc.Position\022\?\n\003end" - "\030\002 \001(\01322.io.deephaven.proto.backplane.sc" - "ript.grpc.Position\"\?\n\037VersionedTextDocum" - "entIdentifier\022\013\n\003uri\030\001 \001(\t\022\017\n\007version\030\002 " - "\001(\005\"+\n\010Position\022\014\n\004line\030\001 \001(\005\022\021\n\tcharact" - "er\030\002 \001(\005\"\344\002\n\031GetCompletionItemsRequest\022=" - "\n\nconsole_id\030\001 \001(\0132).io.deephaven.proto." - "backplane.grpc.Ticket\022L\n\007context\030\002 \001(\0132;" - ".io.deephaven.proto.backplane.script.grp" - "c.CompletionContext\022`\n\rtext_document\030\003 \001" - "(\0132I.io.deephaven.proto.backplane.script" - ".grpc.VersionedTextDocumentIdentifier\022D\n" - "\010position\030\004 \001(\01322.io.deephaven.proto.bac" - "kplane.script.grpc.Position\022\022\n\nrequest_i" - "d\030\005 \001(\005\"D\n\021CompletionContext\022\024\n\014trigger_" - "kind\030\001 \001(\005\022\031\n\021trigger_character\030\002 \001(\t\"\212\001" - "\n\032GetCompletionItemsResponse\022G\n\005items\030\001 " - "\003(\01328.io.deephaven.proto.backplane.scrip" - "t.grpc.CompletionItem\022\022\n\nrequest_id\030\002 \001(" - "\005\022\017\n\007success\030\003 \001(\010\"\223\003\n\016CompletionItem\022\r\n" - "\005start\030\001 \001(\005\022\016\n\006length\030\002 \001(\005\022\r\n\005label\030\003 " - "\001(\t\022\014\n\004kind\030\004 \001(\005\022\016\n\006detail\030\005 \001(\t\022\025\n\rdoc" - "umentation\030\006 \001(\t\022\022\n\ndeprecated\030\007 \001(\010\022\021\n\t" - "preselect\030\010 \001(\010\022E\n\ttext_edit\030\t \001(\01322.io." - "deephaven.proto.backplane.script.grpc.Te" - "xtEdit\022\021\n\tsort_text\030\n \001(\t\022\023\n\013filter_text" - "\030\013 \001(\t\022\032\n\022insert_text_format\030\014 \001(\005\022Q\n\025ad" - "ditional_text_edits\030\r \003(\01322.io.deephaven" - ".proto.backplane.script.grpc.TextEdit\022\031\n" - "\021commit_characters\030\016 \003(\t\"`\n\010TextEdit\022F\n\005" - "range\030\001 \001(\01327.io.deephaven.proto.backpla" - "ne.script.grpc.DocumentRange\022\014\n\004text\030\002 \001" - "(\t\"\253/\n\020FigureDescriptor\022\022\n\005title\030\001 \001(\tH\000" - "\210\001\001\022\022\n\ntitle_font\030\002 \001(\t\022\023\n\013title_color\030\003" - " \001(\t\022\027\n\017update_interval\030\007 \001(\003\022\014\n\004cols\030\010 " - "\001(\005\022\014\n\004rows\030\t \001(\005\022Z\n\006charts\030\n \003(\0132J.io.d" - "eephaven.proto.backplane.script.grpc.Fig" - "ureDescriptor.ChartDescriptor\022\016\n\006errors\030" - "\r \003(\t\032\240\005\n\017ChartDescriptor\022\017\n\007colspan\030\001 \001" - "(\005\022\017\n\007rowspan\030\002 \001(\005\022[\n\006series\030\003 \003(\0132K.io" - ".deephaven.proto.backplane.script.grpc.F" - "igureDescriptor.SeriesDescriptor\022f\n\014mult" - "i_series\030\004 \003(\0132P.io.deephaven.proto.back" - "plane.script.grpc.FigureDescriptor.Multi" - "SeriesDescriptor\022W\n\004axes\030\005 \003(\0132I.io.deep" - "haven.proto.backplane.script.grpc.Figure" - "Descriptor.AxisDescriptor\022h\n\nchart_type\030" - "\006 \001(\0162T.io.deephaven.proto.backplane.scr" - "ipt.grpc.FigureDescriptor.ChartDescripto" - "r.ChartType\022\022\n\005title\030\007 \001(\tH\000\210\001\001\022\022\n\ntitle" - "_font\030\010 \001(\t\022\023\n\013title_color\030\t \001(\t\022\023\n\013show" - "_legend\030\n \001(\010\022\023\n\013legend_font\030\013 \001(\t\022\024\n\014le" - "gend_color\030\014 \001(\t\022\014\n\004is3d\030\r \001(\010\"N\n\tChartT" - "ype\022\006\n\002XY\020\000\022\007\n\003PIE\020\001\022\010\n\004OHLC\020\002\022\014\n\010CATEGO" - "RY\020\003\022\007\n\003XYZ\020\004\022\017\n\013CATEGORY_3D\020\005B\010\n\006_title" - "\032\376\004\n\020SeriesDescriptor\022^\n\nplot_style\030\001 \001(" - "\0162J.io.deephaven.proto.backplane.script." - "grpc.FigureDescriptor.SeriesPlotStyle\022\014\n" - "\004name\030\002 \001(\t\022\032\n\rlines_visible\030\003 \001(\010H\000\210\001\001\022" - "\033\n\016shapes_visible\030\004 \001(\010H\001\210\001\001\022\030\n\020gradient" - "_visible\030\005 \001(\010\022\022\n\nline_color\030\006 \001(\t\022\037\n\022po" - "int_label_format\030\010 \001(\tH\002\210\001\001\022\037\n\022x_tool_ti" - "p_pattern\030\t \001(\tH\003\210\001\001\022\037\n\022y_tool_tip_patte" - "rn\030\n \001(\tH\004\210\001\001\022\023\n\013shape_label\030\013 \001(\t\022\027\n\nsh" - "ape_size\030\014 \001(\001H\005\210\001\001\022\023\n\013shape_color\030\r \001(\t" - "\022\r\n\005shape\030\016 \001(\t\022a\n\014data_sources\030\017 \003(\0132K." + "eephaven.proto.backplane.grpc.Ticket\"M\n\026" + "LogSubscriptionRequest\022#\n\027last_seen_log_" + "timestamp\030\001 \001(\003B\0020\001\022\016\n\006levels\030\002 \003(\t\"S\n\023L" + "ogSubscriptionData\022\022\n\006micros\030\001 \001(\003B\0020\001\022\021" + "\n\tlog_level\030\002 \001(\t\022\017\n\007message\030\003 \001(\tJ\004\010\004\020\005" + "\"j\n\025ExecuteCommandRequest\022=\n\nconsole_id\030" + "\001 \001(\0132).io.deephaven.proto.backplane.grp" + "c.Ticket\022\014\n\004code\030\003 \001(\tJ\004\010\002\020\003\"w\n\026ExecuteC" + "ommandResponse\022\025\n\rerror_message\030\001 \001(\t\022F\n" + "\007changes\030\002 \001(\01325.io.deephaven.proto.back" + "plane.grpc.FieldsChangeUpdate\"\265\001\n\032BindTa" + "bleToVariableRequest\022=\n\nconsole_id\030\001 \001(\013" + "2).io.deephaven.proto.backplane.grpc.Tic" + "ket\022\025\n\rvariable_name\030\003 \001(\t\022;\n\010table_id\030\004" + " \001(\0132).io.deephaven.proto.backplane.grpc" + ".TicketJ\004\010\002\020\003\"\035\n\033BindTableToVariableResp" + "onse\"\224\001\n\024CancelCommandRequest\022=\n\nconsole" + "_id\030\001 \001(\0132).io.deephaven.proto.backplane" + ".grpc.Ticket\022=\n\ncommand_id\030\002 \001(\0132).io.de" + "ephaven.proto.backplane.grpc.Ticket\"\027\n\025C" + "ancelCommandResponse\"\223\003\n\023AutoCompleteReq" + "uest\022V\n\ropen_document\030\001 \001(\0132=.io.deephav" + "en.proto.backplane.script.grpc.OpenDocum" + "entRequestH\000\022Z\n\017change_document\030\002 \001(\0132\?." + "io.deephaven.proto.backplane.script.grpc" + ".ChangeDocumentRequestH\000\022c\n\024get_completi" + "on_items\030\003 \001(\0132C.io.deephaven.proto.back" + "plane.script.grpc.GetCompletionItemsRequ" + "estH\000\022X\n\016close_document\030\004 \001(\0132>.io.deeph" + "aven.proto.backplane.script.grpc.CloseDo" + "cumentRequestH\000B\t\n\007request\"\204\001\n\024AutoCompl" + "eteResponse\022`\n\020completion_items\030\001 \001(\0132D." "io.deephaven.proto.backplane.script.grpc" - ".FigureDescriptor.SourceDescriptorB\020\n\016_l" - "ines_visibleB\021\n\017_shapes_visibleB\025\n\023_poin" - "t_label_formatB\025\n\023_x_tool_tip_patternB\025\n" - "\023_y_tool_tip_patternB\r\n\013_shape_sizeJ\004\010\007\020" - "\010\032\354\n\n\025MultiSeriesDescriptor\022^\n\nplot_styl" - "e\030\001 \001(\0162J.io.deephaven.proto.backplane.s" - "cript.grpc.FigureDescriptor.SeriesPlotSt" - "yle\022\014\n\004name\030\002 \001(\t\022c\n\nline_color\030\003 \001(\0132O." + ".GetCompletionItemsResponseH\000B\n\n\010respons" + "e\"\025\n\023BrowserNextResponse\"\247\001\n\023OpenDocumen" + "tRequest\022=\n\nconsole_id\030\001 \001(\0132).io.deepha" + "ven.proto.backplane.grpc.Ticket\022Q\n\rtext_" + "document\030\002 \001(\0132:.io.deephaven.proto.back" + "plane.script.grpc.TextDocumentItem\"S\n\020Te" + "xtDocumentItem\022\013\n\003uri\030\001 \001(\t\022\023\n\013language_" + "id\030\002 \001(\t\022\017\n\007version\030\003 \001(\005\022\014\n\004text\030\004 \001(\t\"" + "\267\001\n\024CloseDocumentRequest\022=\n\nconsole_id\030\001" + " \001(\0132).io.deephaven.proto.backplane.grpc" + ".Ticket\022`\n\rtext_document\030\002 \001(\0132I.io.deep" + "haven.proto.backplane.script.grpc.Versio" + "nedTextDocumentIdentifier\"\300\003\n\025ChangeDocu" + "mentRequest\022=\n\nconsole_id\030\001 \001(\0132).io.dee" + "phaven.proto.backplane.grpc.Ticket\022`\n\rte" + "xt_document\030\002 \001(\0132I.io.deephaven.proto.b" + "ackplane.script.grpc.VersionedTextDocume" + "ntIdentifier\022w\n\017content_changes\030\003 \003(\0132^." "io.deephaven.proto.backplane.script.grpc" - ".FigureDescriptor.StringMapWithDefault\022d" - "\n\013point_color\030\004 \001(\0132O.io.deephaven.proto" - ".backplane.script.grpc.FigureDescriptor." - "StringMapWithDefault\022d\n\rlines_visible\030\005 " - "\001(\0132M.io.deephaven.proto.backplane.scrip" - "t.grpc.FigureDescriptor.BoolMapWithDefau" - "lt\022e\n\016points_visible\030\006 \001(\0132M.io.deephave" + ".ChangeDocumentRequest.TextDocumentConte" + "ntChangeEvent\032\214\001\n\036TextDocumentContentCha" + "ngeEvent\022F\n\005range\030\001 \001(\01327.io.deephaven.p" + "roto.backplane.script.grpc.DocumentRange" + "\022\024\n\014range_length\030\002 \001(\005\022\014\n\004text\030\003 \001(\t\"\223\001\n" + "\rDocumentRange\022A\n\005start\030\001 \001(\01322.io.deeph" + "aven.proto.backplane.script.grpc.Positio" + "n\022\?\n\003end\030\002 \001(\01322.io.deephaven.proto.back" + "plane.script.grpc.Position\"\?\n\037VersionedT" + "extDocumentIdentifier\022\013\n\003uri\030\001 \001(\t\022\017\n\007ve" + "rsion\030\002 \001(\005\"+\n\010Position\022\014\n\004line\030\001 \001(\005\022\021\n" + "\tcharacter\030\002 \001(\005\"\344\002\n\031GetCompletionItemsR" + "equest\022=\n\nconsole_id\030\001 \001(\0132).io.deephave" + "n.proto.backplane.grpc.Ticket\022L\n\007context" + "\030\002 \001(\0132;.io.deephaven.proto.backplane.sc" + "ript.grpc.CompletionContext\022`\n\rtext_docu" + "ment\030\003 \001(\0132I.io.deephaven.proto.backplan" + "e.script.grpc.VersionedTextDocumentIdent" + "ifier\022D\n\010position\030\004 \001(\01322.io.deephaven.p" + "roto.backplane.script.grpc.Position\022\022\n\nr" + "equest_id\030\005 \001(\005\"D\n\021CompletionContext\022\024\n\014" + "trigger_kind\030\001 \001(\005\022\031\n\021trigger_character\030" + "\002 \001(\t\"\212\001\n\032GetCompletionItemsResponse\022G\n\005" + "items\030\001 \003(\01328.io.deephaven.proto.backpla" + "ne.script.grpc.CompletionItem\022\022\n\nrequest" + "_id\030\002 \001(\005\022\017\n\007success\030\003 \001(\010\"\223\003\n\016Completio" + "nItem\022\r\n\005start\030\001 \001(\005\022\016\n\006length\030\002 \001(\005\022\r\n\005" + "label\030\003 \001(\t\022\014\n\004kind\030\004 \001(\005\022\016\n\006detail\030\005 \001(" + "\t\022\025\n\rdocumentation\030\006 \001(\t\022\022\n\ndeprecated\030\007" + " \001(\010\022\021\n\tpreselect\030\010 \001(\010\022E\n\ttext_edit\030\t \001" + "(\01322.io.deephaven.proto.backplane.script" + ".grpc.TextEdit\022\021\n\tsort_text\030\n \001(\t\022\023\n\013fil" + "ter_text\030\013 \001(\t\022\032\n\022insert_text_format\030\014 \001" + "(\005\022Q\n\025additional_text_edits\030\r \003(\01322.io.d" + "eephaven.proto.backplane.script.grpc.Tex" + "tEdit\022\031\n\021commit_characters\030\016 \003(\t\"`\n\010Text" + "Edit\022F\n\005range\030\001 \001(\01327.io.deephaven.proto" + ".backplane.script.grpc.DocumentRange\022\014\n\004" + "text\030\002 \001(\t\"\3050\n\020FigureDescriptor\022\022\n\005title" + "\030\001 \001(\tH\000\210\001\001\022\022\n\ntitle_font\030\002 \001(\t\022\023\n\013title" + "_color\030\003 \001(\t\022\033\n\017update_interval\030\007 \001(\003B\0020" + "\001\022\014\n\004cols\030\010 \001(\005\022\014\n\004rows\030\t \001(\005\022Z\n\006charts\030" + "\n \003(\0132J.io.deephaven.proto.backplane.scr" + "ipt.grpc.FigureDescriptor.ChartDescripto" + "r\022\016\n\006errors\030\r \003(\t\032\255\005\n\017ChartDescriptor\022\017\n" + "\007colspan\030\001 \001(\005\022\017\n\007rowspan\030\002 \001(\005\022[\n\006serie" + "s\030\003 \003(\0132K.io.deephaven.proto.backplane.s" + "cript.grpc.FigureDescriptor.SeriesDescri" + "ptor\022f\n\014multi_series\030\004 \003(\0132P.io.deephave" + "n.proto.backplane.script.grpc.FigureDesc" + "riptor.MultiSeriesDescriptor\022W\n\004axes\030\005 \003" + "(\0132I.io.deephaven.proto.backplane.script" + ".grpc.FigureDescriptor.AxisDescriptor\022h\n" + "\nchart_type\030\006 \001(\0162T.io.deephaven.proto.b" + "ackplane.script.grpc.FigureDescriptor.Ch" + "artDescriptor.ChartType\022\022\n\005title\030\007 \001(\tH\000" + "\210\001\001\022\022\n\ntitle_font\030\010 \001(\t\022\023\n\013title_color\030\t" + " \001(\t\022\023\n\013show_legend\030\n \001(\010\022\023\n\013legend_font" + "\030\013 \001(\t\022\024\n\014legend_color\030\014 \001(\t\022\014\n\004is3d\030\r \001" + "(\010\"[\n\tChartType\022\006\n\002XY\020\000\022\007\n\003PIE\020\001\022\010\n\004OHLC" + "\020\002\022\014\n\010CATEGORY\020\003\022\007\n\003XYZ\020\004\022\017\n\013CATEGORY_3D" + "\020\005\022\013\n\007TREEMAP\020\006B\010\n\006_title\032\376\004\n\020SeriesDesc" + "riptor\022^\n\nplot_style\030\001 \001(\0162J.io.deephave" "n.proto.backplane.script.grpc.FigureDesc" - "riptor.BoolMapWithDefault\022g\n\020gradient_vi" - "sible\030\007 \001(\0132M.io.deephaven.proto.backpla" + "riptor.SeriesPlotStyle\022\014\n\004name\030\002 \001(\t\022\032\n\r" + "lines_visible\030\003 \001(\010H\000\210\001\001\022\033\n\016shapes_visib" + "le\030\004 \001(\010H\001\210\001\001\022\030\n\020gradient_visible\030\005 \001(\010\022" + "\022\n\nline_color\030\006 \001(\t\022\037\n\022point_label_forma" + "t\030\010 \001(\tH\002\210\001\001\022\037\n\022x_tool_tip_pattern\030\t \001(\t" + "H\003\210\001\001\022\037\n\022y_tool_tip_pattern\030\n \001(\tH\004\210\001\001\022\023" + "\n\013shape_label\030\013 \001(\t\022\027\n\nshape_size\030\014 \001(\001H" + "\005\210\001\001\022\023\n\013shape_color\030\r \001(\t\022\r\n\005shape\030\016 \001(\t" + "\022a\n\014data_sources\030\017 \003(\0132K.io.deephaven.pr" + "oto.backplane.script.grpc.FigureDescript" + "or.SourceDescriptorB\020\n\016_lines_visibleB\021\n" + "\017_shapes_visibleB\025\n\023_point_label_formatB" + "\025\n\023_x_tool_tip_patternB\025\n\023_y_tool_tip_pa" + "tternB\r\n\013_shape_sizeJ\004\010\007\020\010\032\354\n\n\025MultiSeri" + "esDescriptor\022^\n\nplot_style\030\001 \001(\0162J.io.de" + "ephaven.proto.backplane.script.grpc.Figu" + "reDescriptor.SeriesPlotStyle\022\014\n\004name\030\002 \001" + "(\t\022c\n\nline_color\030\003 \001(\0132O.io.deephaven.pr" + "oto.backplane.script.grpc.FigureDescript" + "or.StringMapWithDefault\022d\n\013point_color\030\004" + " \001(\0132O.io.deephaven.proto.backplane.scri" + "pt.grpc.FigureDescriptor.StringMapWithDe" + "fault\022d\n\rlines_visible\030\005 \001(\0132M.io.deepha" + "ven.proto.backplane.script.grpc.FigureDe" + "scriptor.BoolMapWithDefault\022e\n\016points_vi" + "sible\030\006 \001(\0132M.io.deephaven.proto.backpla" "ne.script.grpc.FigureDescriptor.BoolMapW" - "ithDefault\022k\n\022point_label_format\030\010 \001(\0132O" - ".io.deephaven.proto.backplane.script.grp" - "c.FigureDescriptor.StringMapWithDefault\022" - "k\n\022x_tool_tip_pattern\030\t \001(\0132O.io.deephav" - "en.proto.backplane.script.grpc.FigureDes" - "criptor.StringMapWithDefault\022k\n\022y_tool_t" - "ip_pattern\030\n \001(\0132O.io.deephaven.proto.ba" - "ckplane.script.grpc.FigureDescriptor.Str" - "ingMapWithDefault\022d\n\013point_label\030\013 \001(\0132O" - ".io.deephaven.proto.backplane.script.grp" - "c.FigureDescriptor.StringMapWithDefault\022" - "c\n\npoint_size\030\014 \001(\0132O.io.deephaven.proto" - ".backplane.script.grpc.FigureDescriptor." - "DoubleMapWithDefault\022d\n\013point_shape\030\r \001(" + "ithDefault\022g\n\020gradient_visible\030\007 \001(\0132M.i" + "o.deephaven.proto.backplane.script.grpc." + "FigureDescriptor.BoolMapWithDefault\022k\n\022p" + "oint_label_format\030\010 \001(\0132O.io.deephaven.p" + "roto.backplane.script.grpc.FigureDescrip" + "tor.StringMapWithDefault\022k\n\022x_tool_tip_p" + "attern\030\t \001(\0132O.io.deephaven.proto.backpl" + "ane.script.grpc.FigureDescriptor.StringM" + "apWithDefault\022k\n\022y_tool_tip_pattern\030\n \001(" "\0132O.io.deephaven.proto.backplane.script." "grpc.FigureDescriptor.StringMapWithDefau" - "lt\022l\n\014data_sources\030\016 \003(\0132V.io.deephaven." - "proto.backplane.script.grpc.FigureDescri" - "ptor.MultiSeriesSourceDescriptor\032L\n\024Stri" - "ngMapWithDefault\022\026\n\016default_string\030\001 \001(\t" - "\022\014\n\004keys\030\002 \003(\t\022\016\n\006values\030\003 \003(\t\032L\n\024Double" - "MapWithDefault\022\026\n\016default_double\030\001 \001(\001\022\014" - "\n\004keys\030\002 \003(\t\022\016\n\006values\030\003 \003(\001\032H\n\022BoolMapW" - "ithDefault\022\024\n\014default_bool\030\001 \001(\010\022\014\n\004keys" - "\030\002 \003(\t\022\016\n\006values\030\003 \003(\010\032\246\010\n\016AxisDescripto" - "r\022\n\n\002id\030\001 \001(\t\022m\n\013format_type\030\002 \001(\0162X.io." - "deephaven.proto.backplane.script.grpc.Fi" - "gureDescriptor.AxisDescriptor.AxisFormat" - "Type\022`\n\004type\030\003 \001(\0162R.io.deephaven.proto." - "backplane.script.grpc.FigureDescriptor.A" - "xisDescriptor.AxisType\022h\n\010position\030\004 \001(\016" - "2V.io.deephaven.proto.backplane.script.g" - "rpc.FigureDescriptor.AxisDescriptor.Axis" - "Position\022\013\n\003log\030\005 \001(\010\022\r\n\005label\030\006 \001(\t\022\022\n\n" - "label_font\030\007 \001(\t\022\022\n\nticks_font\030\010 \001(\t\022\033\n\016" - "format_pattern\030\t \001(\tH\000\210\001\001\022\r\n\005color\030\n \001(\t" - "\022\021\n\tmin_range\030\013 \001(\001\022\021\n\tmax_range\030\014 \001(\001\022\033" - "\n\023minor_ticks_visible\030\r \001(\010\022\033\n\023major_tic" - "ks_visible\030\016 \001(\010\022\030\n\020minor_tick_count\030\017 \001" - "(\005\022$\n\027gap_between_major_ticks\030\020 \001(\001H\001\210\001\001" - "\022\034\n\024major_tick_locations\030\021 \003(\001\022\030\n\020tick_l" - "abel_angle\030\022 \001(\001\022\016\n\006invert\030\023 \001(\010\022\024\n\014is_t" - "ime_axis\030\024 \001(\010\022{\n\034business_calendar_desc" - "riptor\030\025 \001(\0132U.io.deephaven.proto.backpl" - "ane.script.grpc.FigureDescriptor.Busines" - "sCalendarDescriptor\"*\n\016AxisFormatType\022\014\n" - "\010CATEGORY\020\000\022\n\n\006NUMBER\020\001\"C\n\010AxisType\022\005\n\001X" - "\020\000\022\005\n\001Y\020\001\022\t\n\005SHAPE\020\002\022\010\n\004SIZE\020\003\022\t\n\005LABEL\020" - "\004\022\t\n\005COLOR\020\005\"B\n\014AxisPosition\022\007\n\003TOP\020\000\022\n\n" - "\006BOTTOM\020\001\022\010\n\004LEFT\020\002\022\t\n\005RIGHT\020\003\022\010\n\004NONE\020\004" - "B\021\n\017_format_patternB\032\n\030_gap_between_majo" - "r_ticks\032\360\006\n\032BusinessCalendarDescriptor\022\014" - "\n\004name\030\001 \001(\t\022\021\n\ttime_zone\030\002 \001(\t\022v\n\rbusin" - "ess_days\030\003 \003(\0162_.io.deephaven.proto.back" - "plane.script.grpc.FigureDescriptor.Busin" - "essCalendarDescriptor.DayOfWeek\022~\n\020busin" - "ess_periods\030\004 \003(\0132d.io.deephaven.proto.b" - "ackplane.script.grpc.FigureDescriptor.Bu" - "sinessCalendarDescriptor.BusinessPeriod\022" - "o\n\010holidays\030\005 \003(\0132].io.deephaven.proto.b" - "ackplane.script.grpc.FigureDescriptor.Bu" - "sinessCalendarDescriptor.Holiday\032-\n\016Busi" - "nessPeriod\022\014\n\004open\030\001 \001(\t\022\r\n\005close\030\002 \001(\t\032" - "\370\001\n\007Holiday\022m\n\004date\030\001 \001(\0132_.io.deephaven" - ".proto.backplane.script.grpc.FigureDescr" - "iptor.BusinessCalendarDescriptor.LocalDa" - "te\022~\n\020business_periods\030\002 \003(\0132d.io.deepha" - "ven.proto.backplane.script.grpc.FigureDe" - "scriptor.BusinessCalendarDescriptor.Busi" - "nessPeriod\0325\n\tLocalDate\022\014\n\004year\030\001 \001(\005\022\r\n" - "\005month\030\002 \001(\005\022\013\n\003day\030\003 \001(\005\"g\n\tDayOfWeek\022\n" - "\n\006SUNDAY\020\000\022\n\n\006MONDAY\020\001\022\013\n\007TUESDAY\020\002\022\r\n\tW" - "EDNESDAY\020\003\022\014\n\010THURSDAY\020\004\022\n\n\006FRIDAY\020\005\022\014\n\010" - "SATURDAY\020\006\032\256\001\n\033MultiSeriesSourceDescript" - "or\022\017\n\007axis_id\030\001 \001(\t\022S\n\004type\030\002 \001(\0162E.io.d" + "lt\022d\n\013point_label\030\013 \001(\0132O.io.deephaven.p" + "roto.backplane.script.grpc.FigureDescrip" + "tor.StringMapWithDefault\022c\n\npoint_size\030\014" + " \001(\0132O.io.deephaven.proto.backplane.scri" + "pt.grpc.FigureDescriptor.DoubleMapWithDe" + "fault\022d\n\013point_shape\030\r \001(\0132O.io.deephave" + "n.proto.backplane.script.grpc.FigureDesc" + "riptor.StringMapWithDefault\022l\n\014data_sour" + "ces\030\016 \003(\0132V.io.deephaven.proto.backplane" + ".script.grpc.FigureDescriptor.MultiSerie" + "sSourceDescriptor\032d\n\024StringMapWithDefaul" + "t\022\033\n\016default_string\030\001 \001(\tH\000\210\001\001\022\014\n\004keys\030\002" + " \003(\t\022\016\n\006values\030\003 \003(\tB\021\n\017_default_string\032" + "d\n\024DoubleMapWithDefault\022\033\n\016default_doubl" + "e\030\001 \001(\001H\000\210\001\001\022\014\n\004keys\030\002 \003(\t\022\016\n\006values\030\003 \003" + "(\001B\021\n\017_default_double\032^\n\022BoolMapWithDefa" + "ult\022\031\n\014default_bool\030\001 \001(\010H\000\210\001\001\022\014\n\004keys\030\002" + " \003(\t\022\016\n\006values\030\003 \003(\010B\017\n\r_default_bool\032\246\010" + "\n\016AxisDescriptor\022\n\n\002id\030\001 \001(\t\022m\n\013format_t" + "ype\030\002 \001(\0162X.io.deephaven.proto.backplane" + ".script.grpc.FigureDescriptor.AxisDescri" + "ptor.AxisFormatType\022`\n\004type\030\003 \001(\0162R.io.d" "eephaven.proto.backplane.script.grpc.Fig" - "ureDescriptor.SourceType\022\024\n\014table_map_id" - "\030\003 \001(\005\022\023\n\013column_name\030\004 \001(\t\032\254\002\n\020SourceDe" - "scriptor\022\017\n\007axis_id\030\001 \001(\t\022S\n\004type\030\002 \001(\0162" - "E.io.deephaven.proto.backplane.script.gr" - "pc.FigureDescriptor.SourceType\022\020\n\010table_" - "id\030\003 \001(\005\022\024\n\014table_map_id\030\004 \001(\005\022\023\n\013column" - "_name\030\005 \001(\t\022\023\n\013column_type\030\006 \001(\t\022`\n\tone_" - "click\030\007 \001(\0132M.io.deephaven.proto.backpla" - "ne.script.grpc.FigureDescriptor.OneClick" - "Descriptor\032c\n\022OneClickDescriptor\022\017\n\007colu" - "mns\030\001 \003(\t\022\024\n\014column_types\030\002 \003(\t\022&\n\036requi" - "re_all_filters_to_display\030\003 \001(\010\"\231\001\n\017Seri" - "esPlotStyle\022\007\n\003BAR\020\000\022\017\n\013STACKED_BAR\020\001\022\010\n" - "\004LINE\020\002\022\010\n\004AREA\020\003\022\020\n\014STACKED_AREA\020\004\022\007\n\003P" - "IE\020\005\022\r\n\tHISTOGRAM\020\006\022\010\n\004OHLC\020\007\022\013\n\007SCATTER" - "\020\010\022\010\n\004STEP\020\t\022\r\n\tERROR_BAR\020\n\"\254\001\n\nSourceTy" - "pe\022\005\n\001X\020\000\022\005\n\001Y\020\001\022\005\n\001Z\020\002\022\t\n\005X_LOW\020\003\022\n\n\006X_" - "HIGH\020\004\022\t\n\005Y_LOW\020\005\022\n\n\006Y_HIGH\020\006\022\010\n\004TIME\020\007\022" - "\010\n\004OPEN\020\010\022\010\n\004HIGH\020\t\022\007\n\003LOW\020\n\022\t\n\005CLOSE\020\013\022" - "\t\n\005SHAPE\020\014\022\010\n\004SIZE\020\r\022\t\n\005LABEL\020\016\022\t\n\005COLOR" - "\020\017B\010\n\006_titleJ\004\010\013\020\014J\004\010\014\020\r2\377\n\n\016ConsoleServ" - "ice\022\230\001\n\017GetConsoleTypes\022@.io.deephaven.p" - "roto.backplane.script.grpc.GetConsoleTyp" - "esRequest\032A.io.deephaven.proto.backplane" - ".script.grpc.GetConsoleTypesResponse\"\000\022\217" - "\001\n\014StartConsole\022=.io.deephaven.proto.bac" - "kplane.script.grpc.StartConsoleRequest\032>" + "ureDescriptor.AxisDescriptor.AxisType\022h\n" + "\010position\030\004 \001(\0162V.io.deephaven.proto.bac" + "kplane.script.grpc.FigureDescriptor.Axis" + "Descriptor.AxisPosition\022\013\n\003log\030\005 \001(\010\022\r\n\005" + "label\030\006 \001(\t\022\022\n\nlabel_font\030\007 \001(\t\022\022\n\nticks" + "_font\030\010 \001(\t\022\033\n\016format_pattern\030\t \001(\tH\000\210\001\001" + "\022\r\n\005color\030\n \001(\t\022\021\n\tmin_range\030\013 \001(\001\022\021\n\tma" + "x_range\030\014 \001(\001\022\033\n\023minor_ticks_visible\030\r \001" + "(\010\022\033\n\023major_ticks_visible\030\016 \001(\010\022\030\n\020minor" + "_tick_count\030\017 \001(\005\022$\n\027gap_between_major_t" + "icks\030\020 \001(\001H\001\210\001\001\022\034\n\024major_tick_locations\030" + "\021 \003(\001\022\030\n\020tick_label_angle\030\022 \001(\001\022\016\n\006inver" + "t\030\023 \001(\010\022\024\n\014is_time_axis\030\024 \001(\010\022{\n\034busines" + "s_calendar_descriptor\030\025 \001(\0132U.io.deephav" + "en.proto.backplane.script.grpc.FigureDes" + "criptor.BusinessCalendarDescriptor\"*\n\016Ax" + "isFormatType\022\014\n\010CATEGORY\020\000\022\n\n\006NUMBER\020\001\"C" + "\n\010AxisType\022\005\n\001X\020\000\022\005\n\001Y\020\001\022\t\n\005SHAPE\020\002\022\010\n\004S" + "IZE\020\003\022\t\n\005LABEL\020\004\022\t\n\005COLOR\020\005\"B\n\014AxisPosit" + "ion\022\007\n\003TOP\020\000\022\n\n\006BOTTOM\020\001\022\010\n\004LEFT\020\002\022\t\n\005RI" + "GHT\020\003\022\010\n\004NONE\020\004B\021\n\017_format_patternB\032\n\030_g" + "ap_between_major_ticks\032\360\006\n\032BusinessCalen" + "darDescriptor\022\014\n\004name\030\001 \001(\t\022\021\n\ttime_zone" + "\030\002 \001(\t\022v\n\rbusiness_days\030\003 \003(\0162_.io.deeph" + "aven.proto.backplane.script.grpc.FigureD" + "escriptor.BusinessCalendarDescriptor.Day" + "OfWeek\022~\n\020business_periods\030\004 \003(\0132d.io.de" + "ephaven.proto.backplane.script.grpc.Figu" + "reDescriptor.BusinessCalendarDescriptor." + "BusinessPeriod\022o\n\010holidays\030\005 \003(\0132].io.de" + "ephaven.proto.backplane.script.grpc.Figu" + "reDescriptor.BusinessCalendarDescriptor." + "Holiday\032-\n\016BusinessPeriod\022\014\n\004open\030\001 \001(\t\022" + "\r\n\005close\030\002 \001(\t\032\370\001\n\007Holiday\022m\n\004date\030\001 \001(\013" + "2_.io.deephaven.proto.backplane.script.g" + "rpc.FigureDescriptor.BusinessCalendarDes" + "criptor.LocalDate\022~\n\020business_periods\030\002 " + "\003(\0132d.io.deephaven.proto.backplane.scrip" + "t.grpc.FigureDescriptor.BusinessCalendar" + "Descriptor.BusinessPeriod\0325\n\tLocalDate\022\014" + "\n\004year\030\001 \001(\005\022\r\n\005month\030\002 \001(\005\022\013\n\003day\030\003 \001(\005" + "\"g\n\tDayOfWeek\022\n\n\006SUNDAY\020\000\022\n\n\006MONDAY\020\001\022\013\n" + "\007TUESDAY\020\002\022\r\n\tWEDNESDAY\020\003\022\014\n\010THURSDAY\020\004\022" + "\n\n\006FRIDAY\020\005\022\014\n\010SATURDAY\020\006\032\266\001\n\033MultiSerie" + "sSourceDescriptor\022\017\n\007axis_id\030\001 \001(\t\022S\n\004ty" + "pe\030\002 \001(\0162E.io.deephaven.proto.backplane." + "script.grpc.FigureDescriptor.SourceType\022" + "\034\n\024partitioned_table_id\030\003 \001(\005\022\023\n\013column_" + "name\030\004 \001(\t\032\264\002\n\020SourceDescriptor\022\017\n\007axis_" + "id\030\001 \001(\t\022S\n\004type\030\002 \001(\0162E.io.deephaven.pr" + "oto.backplane.script.grpc.FigureDescript" + "or.SourceType\022\020\n\010table_id\030\003 \001(\005\022\034\n\024parti" + "tioned_table_id\030\004 \001(\005\022\023\n\013column_name\030\005 \001" + "(\t\022\023\n\013column_type\030\006 \001(\t\022`\n\tone_click\030\007 \001" + "(\0132M.io.deephaven.proto.backplane.script" + ".grpc.FigureDescriptor.OneClickDescripto" + "r\032c\n\022OneClickDescriptor\022\017\n\007columns\030\001 \003(\t" + "\022\024\n\014column_types\030\002 \003(\t\022&\n\036require_all_fi" + "lters_to_display\030\003 \001(\010\"\246\001\n\017SeriesPlotSty" + "le\022\007\n\003BAR\020\000\022\017\n\013STACKED_BAR\020\001\022\010\n\004LINE\020\002\022\010" + "\n\004AREA\020\003\022\020\n\014STACKED_AREA\020\004\022\007\n\003PIE\020\005\022\r\n\tH" + "ISTOGRAM\020\006\022\010\n\004OHLC\020\007\022\013\n\007SCATTER\020\010\022\010\n\004STE" + "P\020\t\022\r\n\tERROR_BAR\020\n\022\013\n\007TREEMAP\020\013\"\322\001\n\nSour" + "ceType\022\005\n\001X\020\000\022\005\n\001Y\020\001\022\005\n\001Z\020\002\022\t\n\005X_LOW\020\003\022\n" + "\n\006X_HIGH\020\004\022\t\n\005Y_LOW\020\005\022\n\n\006Y_HIGH\020\006\022\010\n\004TIM" + "E\020\007\022\010\n\004OPEN\020\010\022\010\n\004HIGH\020\t\022\007\n\003LOW\020\n\022\t\n\005CLOS" + "E\020\013\022\t\n\005SHAPE\020\014\022\010\n\004SIZE\020\r\022\t\n\005LABEL\020\016\022\t\n\005C" + "OLOR\020\017\022\n\n\006PARENT\020\020\022\016\n\nHOVER_TEXT\020\021\022\010\n\004TE" + "XT\020\022B\010\n\006_titleJ\004\010\013\020\014J\004\010\014\020\r2\377\n\n\016ConsoleSe" + "rvice\022\230\001\n\017GetConsoleTypes\022@.io.deephaven" + ".proto.backplane.script.grpc.GetConsoleT" + "ypesRequest\032A.io.deephaven.proto.backpla" + "ne.script.grpc.GetConsoleTypesResponse\"\000" + "\022\217\001\n\014StartConsole\022=.io.deephaven.proto.b" + "ackplane.script.grpc.StartConsoleRequest" + "\032>.io.deephaven.proto.backplane.script.g" + "rpc.StartConsoleResponse\"\000\022\226\001\n\017Subscribe" + "ToLogs\022@.io.deephaven.proto.backplane.sc" + "ript.grpc.LogSubscriptionRequest\032=.io.de" + "ephaven.proto.backplane.script.grpc.LogS" + "ubscriptionData\"\0000\001\022\225\001\n\016ExecuteCommand\022\?" ".io.deephaven.proto.backplane.script.grp" - "c.StartConsoleResponse\"\000\022\226\001\n\017SubscribeTo" - "Logs\022@.io.deephaven.proto.backplane.scri" - "pt.grpc.LogSubscriptionRequest\032=.io.deep" - "haven.proto.backplane.script.grpc.LogSub" - "scriptionData\"\0000\001\022\225\001\n\016ExecuteCommand\022\?.i" - "o.deephaven.proto.backplane.script.grpc." - "ExecuteCommandRequest\032@.io.deephaven.pro" - "to.backplane.script.grpc.ExecuteCommandR" - "esponse\"\000\022\222\001\n\rCancelCommand\022>.io.deephav" - "en.proto.backplane.script.grpc.CancelCom" - "mandRequest\032\?.io.deephaven.proto.backpla" - "ne.script.grpc.CancelCommandResponse\"\000\022\244" - "\001\n\023BindTableToVariable\022D.io.deephaven.pr" - "oto.backplane.script.grpc.BindTableToVar" - "iableRequest\032E.io.deephaven.proto.backpl" - "ane.script.grpc.BindTableToVariableRespo" - "nse\"\000\022\231\001\n\022AutoCompleteStream\022=.io.deepha" - "ven.proto.backplane.script.grpc.AutoComp" - "leteRequest\032>.io.deephaven.proto.backpla" - "ne.script.grpc.AutoCompleteResponse\"\000(\0010" - "\001\022\233\001\n\026OpenAutoCompleteStream\022=.io.deepha" + "c.ExecuteCommandRequest\032@.io.deephaven.p" + "roto.backplane.script.grpc.ExecuteComman" + "dResponse\"\000\022\222\001\n\rCancelCommand\022>.io.deeph" + "aven.proto.backplane.script.grpc.CancelC" + "ommandRequest\032\?.io.deephaven.proto.backp" + "lane.script.grpc.CancelCommandResponse\"\000" + "\022\244\001\n\023BindTableToVariable\022D.io.deephaven." + "proto.backplane.script.grpc.BindTableToV" + "ariableRequest\032E.io.deephaven.proto.back" + "plane.script.grpc.BindTableToVariableRes" + "ponse\"\000\022\231\001\n\022AutoCompleteStream\022=.io.deep" + "haven.proto.backplane.script.grpc.AutoCo" + "mpleteRequest\032>.io.deephaven.proto.backp" + "lane.script.grpc.AutoCompleteResponse\"\000(" + "\0010\001\022\233\001\n\026OpenAutoCompleteStream\022=.io.deep" + "haven.proto.backplane.script.grpc.AutoCo" + "mpleteRequest\032>.io.deephaven.proto.backp" + "lane.script.grpc.AutoCompleteResponse\"\0000" + "\001\022\230\001\n\026NextAutoCompleteStream\022=.io.deepha" "ven.proto.backplane.script.grpc.AutoComp" - "leteRequest\032>.io.deephaven.proto.backpla" - "ne.script.grpc.AutoCompleteResponse\"\0000\001\022" - "\230\001\n\026NextAutoCompleteStream\022=.io.deephave" - "n.proto.backplane.script.grpc.AutoComple" - "teRequest\032=.io.deephaven.proto.backplane" - ".script.grpc.BrowserNextResponse\"\000B\004H\001P\001" - "b\006proto3" + "leteRequest\032=.io.deephaven.proto.backpla" + "ne.script.grpc.BrowserNextResponse\"\000B\004H\001" + "P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2fconsole_2eproto_deps[3] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2fconsole_2eproto_deps[3] = { &::descriptor_table_deephaven_2fproto_2fapplication_2eproto, &::descriptor_table_deephaven_2fproto_2ftable_2eproto, &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2fconsole_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fconsole_2eproto = { - false, false, 11488, descriptor_table_protodef_deephaven_2fproto_2fconsole_2eproto, "deephaven/proto/console.proto", - &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, descriptor_table_deephaven_2fproto_2fconsole_2eproto_deps, 3, 43, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2fconsole_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2fconsole_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto, file_level_service_descriptors_deephaven_2fproto_2fconsole_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fconsole_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fconsole_2eproto = { + false, false, 11650, descriptor_table_protodef_deephaven_2fproto_2fconsole_2eproto, + "deephaven/proto/console.proto", + &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, descriptor_table_deephaven_2fproto_2fconsole_2eproto_deps, 3, 43, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fconsole_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fconsole_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fconsole_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2fconsole_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fconsole_2eproto(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fconsole_2eproto(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); namespace io { namespace deephaven { namespace proto { @@ -1598,23 +1614,25 @@ bool FigureDescriptor_ChartDescriptor_ChartType_IsValid(int value) { case 3: case 4: case 5: + case 6: return true; default: return false; } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::XY; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::PIE; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::OHLC; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::CATEGORY; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::XYZ; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::CATEGORY_3D; +constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::TREEMAP; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::ChartType_MIN; constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor::ChartType_MAX; constexpr int FigureDescriptor_ChartDescriptor::ChartType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_AxisDescriptor_AxisFormatType_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[1]; @@ -1629,13 +1647,13 @@ bool FigureDescriptor_AxisDescriptor_AxisFormatType_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_AxisDescriptor_AxisFormatType FigureDescriptor_AxisDescriptor::CATEGORY; constexpr FigureDescriptor_AxisDescriptor_AxisFormatType FigureDescriptor_AxisDescriptor::NUMBER; constexpr FigureDescriptor_AxisDescriptor_AxisFormatType FigureDescriptor_AxisDescriptor::AxisFormatType_MIN; constexpr FigureDescriptor_AxisDescriptor_AxisFormatType FigureDescriptor_AxisDescriptor::AxisFormatType_MAX; constexpr int FigureDescriptor_AxisDescriptor::AxisFormatType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_AxisDescriptor_AxisType_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[2]; @@ -1654,7 +1672,7 @@ bool FigureDescriptor_AxisDescriptor_AxisType_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor::X; constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor::Y; constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor::SHAPE; @@ -1664,7 +1682,7 @@ constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescript constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor::AxisType_MIN; constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor::AxisType_MAX; constexpr int FigureDescriptor_AxisDescriptor::AxisType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_AxisDescriptor_AxisPosition_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[3]; @@ -1682,7 +1700,7 @@ bool FigureDescriptor_AxisDescriptor_AxisPosition_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor::TOP; constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor::BOTTOM; constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor::LEFT; @@ -1691,7 +1709,7 @@ constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDesc constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor::AxisPosition_MIN; constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor::AxisPosition_MAX; constexpr int FigureDescriptor_AxisDescriptor::AxisPosition_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[4]; @@ -1711,7 +1729,7 @@ bool FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor::SUNDAY; constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor::MONDAY; constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor::TUESDAY; @@ -1722,7 +1740,7 @@ constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor::DayOfWeek_MIN; constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor::DayOfWeek_MAX; constexpr int FigureDescriptor_BusinessCalendarDescriptor::DayOfWeek_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_SeriesPlotStyle_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[5]; @@ -1740,13 +1758,14 @@ bool FigureDescriptor_SeriesPlotStyle_IsValid(int value) { case 8: case 9: case 10: + case 11: return true; default: return false; } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::BAR; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::STACKED_BAR; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::LINE; @@ -1758,10 +1777,11 @@ constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::OHLC; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::SCATTER; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::STEP; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::ERROR_BAR; +constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::TREEMAP; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::SeriesPlotStyle_MIN; constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor::SeriesPlotStyle_MAX; constexpr int FigureDescriptor::SeriesPlotStyle_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_SourceType_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2fconsole_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2fconsole_2eproto[6]; @@ -1784,13 +1804,16 @@ bool FigureDescriptor_SourceType_IsValid(int value) { case 13: case 14: case 15: + case 16: + case 17: + case 18: return true; default: return false; } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FigureDescriptor_SourceType FigureDescriptor::X; constexpr FigureDescriptor_SourceType FigureDescriptor::Y; constexpr FigureDescriptor_SourceType FigureDescriptor::Z; @@ -1807,10 +1830,13 @@ constexpr FigureDescriptor_SourceType FigureDescriptor::SHAPE; constexpr FigureDescriptor_SourceType FigureDescriptor::SIZE; constexpr FigureDescriptor_SourceType FigureDescriptor::LABEL; constexpr FigureDescriptor_SourceType FigureDescriptor::COLOR; +constexpr FigureDescriptor_SourceType FigureDescriptor::PARENT; +constexpr FigureDescriptor_SourceType FigureDescriptor::HOVER_TEXT; +constexpr FigureDescriptor_SourceType FigureDescriptor::TEXT; constexpr FigureDescriptor_SourceType FigureDescriptor::SourceType_MIN; constexpr FigureDescriptor_SourceType FigureDescriptor::SourceType_MAX; constexpr int FigureDescriptor::SourceType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) // =================================================================== @@ -1846,7 +1872,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetConsoleTypesRequest::GetCla ::PROTOBUF_NAMESPACE_ID::Metadata GetConsoleTypesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[0]); } @@ -1862,9 +1888,6 @@ GetConsoleTypesResponse::GetConsoleTypesResponse(::PROTOBUF_NAMESPACE_ID::Arena* : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), console_types_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) } GetConsoleTypesResponse::GetConsoleTypesResponse(const GetConsoleTypesResponse& from) @@ -1874,33 +1897,29 @@ GetConsoleTypesResponse::GetConsoleTypesResponse(const GetConsoleTypesResponse& // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) } -void GetConsoleTypesResponse::SharedCtor() { +inline void GetConsoleTypesResponse::SharedCtor() { } GetConsoleTypesResponse::~GetConsoleTypesResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void GetConsoleTypesResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void GetConsoleTypesResponse::ArenaDtor(void* object) { - GetConsoleTypesResponse* _this = reinterpret_cast< GetConsoleTypesResponse* >(object); - (void)_this; -} -void GetConsoleTypesResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void GetConsoleTypesResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void GetConsoleTypesResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1908,22 +1927,22 @@ void GetConsoleTypesResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GetConsoleTypesResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* GetConsoleTypesResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated string console_types = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_console_types(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse.console_types")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse.console_types")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else @@ -1952,10 +1971,10 @@ const char* GetConsoleTypesResponse::_InternalParse(const char* ptr, ::PROTOBUF_ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* GetConsoleTypesResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* GetConsoleTypesResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated string console_types = 1; @@ -1969,7 +1988,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* GetConsoleTypesResponse::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) @@ -1980,7 +1999,7 @@ size_t GetConsoleTypesResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2011,7 +2030,7 @@ void GetConsoleTypesResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void GetConsoleTypesResponse::MergeFrom(const GetConsoleTypesResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; console_types_.MergeFrom(from.console_types_); @@ -2036,7 +2055,7 @@ void GetConsoleTypesResponse::InternalSwap(GetConsoleTypesResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata GetConsoleTypesResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[1]); } @@ -2062,17 +2081,17 @@ StartConsoleRequest::StartConsoleRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) } StartConsoleRequest::StartConsoleRequest(const StartConsoleRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - session_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + session_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + session_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_session_type().empty()) { - session_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_session_type(), + session_type_.Set(from._internal_session_type(), GetArenaForAllocation()); } if (from._internal_has_result_id()) { @@ -2083,37 +2102,36 @@ StartConsoleRequest::StartConsoleRequest(const StartConsoleRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) } -void StartConsoleRequest::SharedCtor() { -session_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void StartConsoleRequest::SharedCtor() { +session_type_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + session_type_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING result_id_ = nullptr; } StartConsoleRequest::~StartConsoleRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void StartConsoleRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - session_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + session_type_.Destroy(); if (this != internal_default_instance()) delete result_id_; } -void StartConsoleRequest::ArenaDtor(void* object) { - StartConsoleRequest* _this = reinterpret_cast< StartConsoleRequest* >(object); - (void)_this; -} -void StartConsoleRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void StartConsoleRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void StartConsoleRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2125,15 +2143,15 @@ void StartConsoleRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* StartConsoleRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* StartConsoleRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -2141,11 +2159,11 @@ const char* StartConsoleRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // string session_type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_session_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type")); } else goto handle_unusual; continue; @@ -2172,18 +2190,17 @@ const char* StartConsoleRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* StartConsoleRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* StartConsoleRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // string session_type = 2; @@ -2197,7 +2214,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* StartConsoleRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) @@ -2208,7 +2225,7 @@ size_t StartConsoleRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2245,7 +2262,7 @@ void StartConsoleRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void StartConsoleRequest::MergeFrom(const StartConsoleRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_session_type().empty()) { @@ -2274,7 +2291,6 @@ void StartConsoleRequest::InternalSwap(StartConsoleRequest* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &session_type_, lhs_arena, &other->session_type_, rhs_arena ); @@ -2282,7 +2298,7 @@ void StartConsoleRequest::InternalSwap(StartConsoleRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata StartConsoleRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[2]); } @@ -2308,9 +2324,6 @@ StartConsoleResponse::StartConsoleResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) } StartConsoleResponse::StartConsoleResponse(const StartConsoleResponse& from) @@ -2324,15 +2337,17 @@ StartConsoleResponse::StartConsoleResponse(const StartConsoleResponse& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) } -void StartConsoleResponse::SharedCtor() { +inline void StartConsoleResponse::SharedCtor() { result_id_ = nullptr; } StartConsoleResponse::~StartConsoleResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void StartConsoleResponse::SharedDtor() { @@ -2340,19 +2355,13 @@ inline void StartConsoleResponse::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void StartConsoleResponse::ArenaDtor(void* object) { - StartConsoleResponse* _this = reinterpret_cast< StartConsoleResponse* >(object); - (void)_this; -} -void StartConsoleResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void StartConsoleResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void StartConsoleResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2363,15 +2372,15 @@ void StartConsoleResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* StartConsoleResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* StartConsoleResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -2400,22 +2409,21 @@ const char* StartConsoleResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAM #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* StartConsoleResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* StartConsoleResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) @@ -2426,7 +2434,7 @@ size_t StartConsoleResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2456,7 +2464,7 @@ void StartConsoleResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void StartConsoleResponse::MergeFrom(const StartConsoleResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -2483,7 +2491,7 @@ void StartConsoleResponse::InternalSwap(StartConsoleResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata StartConsoleResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[3]); } @@ -2499,9 +2507,6 @@ LogSubscriptionRequest::LogSubscriptionRequest(::PROTOBUF_NAMESPACE_ID::Arena* a : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), levels_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) } LogSubscriptionRequest::LogSubscriptionRequest(const LogSubscriptionRequest& from) @@ -2512,34 +2517,30 @@ LogSubscriptionRequest::LogSubscriptionRequest(const LogSubscriptionRequest& fro // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) } -void LogSubscriptionRequest::SharedCtor() { +inline void LogSubscriptionRequest::SharedCtor() { last_seen_log_timestamp_ = int64_t{0}; } LogSubscriptionRequest::~LogSubscriptionRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void LogSubscriptionRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void LogSubscriptionRequest::ArenaDtor(void* object) { - LogSubscriptionRequest* _this = reinterpret_cast< LogSubscriptionRequest* >(object); - (void)_this; -} -void LogSubscriptionRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void LogSubscriptionRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void LogSubscriptionRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2548,15 +2549,15 @@ void LogSubscriptionRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* LogSubscriptionRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* LogSubscriptionRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // int64 last_seen_log_timestamp = 1; + // int64 last_seen_log_timestamp = 1 [jstype = JS_STRING]; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { last_seen_log_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2564,14 +2565,14 @@ const char* LogSubscriptionRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // repeated string levels = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_levels(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.levels")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.levels")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -2600,16 +2601,16 @@ const char* LogSubscriptionRequest::_InternalParse(const char* ptr, ::PROTOBUF_N #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* LogSubscriptionRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* LogSubscriptionRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; - // int64 last_seen_log_timestamp = 1; + // int64 last_seen_log_timestamp = 1 [jstype = JS_STRING]; if (this->_internal_last_seen_log_timestamp() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_last_seen_log_timestamp(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_last_seen_log_timestamp(), target); } // repeated string levels = 2; @@ -2623,7 +2624,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* LogSubscriptionRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) @@ -2634,7 +2635,7 @@ size_t LogSubscriptionRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2646,9 +2647,9 @@ size_t LogSubscriptionRequest::ByteSizeLong() const { levels_.Get(i)); } - // int64 last_seen_log_timestamp = 1; + // int64 last_seen_log_timestamp = 1 [jstype = JS_STRING]; if (this->_internal_last_seen_log_timestamp() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_last_seen_log_timestamp()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_last_seen_log_timestamp()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -2670,7 +2671,7 @@ void LogSubscriptionRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void LogSubscriptionRequest::MergeFrom(const LogSubscriptionRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; levels_.MergeFrom(from.levels_); @@ -2699,7 +2700,7 @@ void LogSubscriptionRequest::InternalSwap(LogSubscriptionRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata LogSubscriptionRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[4]); } @@ -2714,60 +2715,65 @@ LogSubscriptionData::LogSubscriptionData(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) } LogSubscriptionData::LogSubscriptionData(const LogSubscriptionData& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - log_level_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + log_level_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + log_level_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_log_level().empty()) { - log_level_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_log_level(), + log_level_.Set(from._internal_log_level(), GetArenaForAllocation()); } - message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + message_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + message_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_message().empty()) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_message(), + message_.Set(from._internal_message(), GetArenaForAllocation()); } micros_ = from.micros_; // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) } -void LogSubscriptionData::SharedCtor() { -log_level_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void LogSubscriptionData::SharedCtor() { +log_level_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + log_level_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +message_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + message_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING micros_ = int64_t{0}; } LogSubscriptionData::~LogSubscriptionData() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void LogSubscriptionData::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - log_level_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + log_level_.Destroy(); + message_.Destroy(); } -void LogSubscriptionData::ArenaDtor(void* object) { - LogSubscriptionData* _this = reinterpret_cast< LogSubscriptionData* >(object); - (void)_this; -} -void LogSubscriptionData::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void LogSubscriptionData::SetCachedSize(int size) const { _cached_size_.Set(size); } void LogSubscriptionData::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2777,15 +2783,15 @@ void LogSubscriptionData::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* LogSubscriptionData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* LogSubscriptionData::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // int64 micros = 1; + // int64 micros = 1 [jstype = JS_STRING]; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { micros_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2793,21 +2799,21 @@ const char* LogSubscriptionData::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // string log_level = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_log_level(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level")); } else goto handle_unusual; continue; // string message = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_message(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message")); } else goto handle_unusual; continue; @@ -2834,16 +2840,16 @@ const char* LogSubscriptionData::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* LogSubscriptionData::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* LogSubscriptionData::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; - // int64 micros = 1; + // int64 micros = 1 [jstype = JS_STRING]; if (this->_internal_micros() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_micros(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_micros(), target); } // string log_level = 2; @@ -2867,7 +2873,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* LogSubscriptionData::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) @@ -2878,7 +2884,7 @@ size_t LogSubscriptionData::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2896,9 +2902,9 @@ size_t LogSubscriptionData::ByteSizeLong() const { this->_internal_message()); } - // int64 micros = 1; + // int64 micros = 1 [jstype = JS_STRING]; if (this->_internal_micros() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_micros()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_micros()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -2920,7 +2926,7 @@ void LogSubscriptionData::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void LogSubscriptionData::MergeFrom(const LogSubscriptionData& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_log_level().empty()) { @@ -2952,12 +2958,10 @@ void LogSubscriptionData::InternalSwap(LogSubscriptionData* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &log_level_, lhs_arena, &other->log_level_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &message_, lhs_arena, &other->message_, rhs_arena ); @@ -2965,7 +2969,7 @@ void LogSubscriptionData::InternalSwap(LogSubscriptionData* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata LogSubscriptionData::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[5]); } @@ -2991,17 +2995,17 @@ ExecuteCommandRequest::ExecuteCommandRequest(::PROTOBUF_NAMESPACE_ID::Arena* are bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) } ExecuteCommandRequest::ExecuteCommandRequest(const ExecuteCommandRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + code_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + code_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_code().empty()) { - code_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_code(), + code_.Set(from._internal_code(), GetArenaForAllocation()); } if (from._internal_has_console_id()) { @@ -3012,37 +3016,36 @@ ExecuteCommandRequest::ExecuteCommandRequest(const ExecuteCommandRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) } -void ExecuteCommandRequest::SharedCtor() { -code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ExecuteCommandRequest::SharedCtor() { +code_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + code_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING console_id_ = nullptr; } ExecuteCommandRequest::~ExecuteCommandRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExecuteCommandRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - code_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + code_.Destroy(); if (this != internal_default_instance()) delete console_id_; } -void ExecuteCommandRequest::ArenaDtor(void* object) { - ExecuteCommandRequest* _this = reinterpret_cast< ExecuteCommandRequest* >(object); - (void)_this; -} -void ExecuteCommandRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExecuteCommandRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExecuteCommandRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3054,15 +3057,15 @@ void ExecuteCommandRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExecuteCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExecuteCommandRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -3070,11 +3073,11 @@ const char* ExecuteCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // string code = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_code(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code")); } else goto handle_unusual; continue; @@ -3101,18 +3104,17 @@ const char* ExecuteCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExecuteCommandRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExecuteCommandRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // string code = 3; @@ -3126,7 +3128,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExecuteCommandRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) @@ -3137,7 +3139,7 @@ size_t ExecuteCommandRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3174,7 +3176,7 @@ void ExecuteCommandRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExecuteCommandRequest::MergeFrom(const ExecuteCommandRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_code().empty()) { @@ -3203,7 +3205,6 @@ void ExecuteCommandRequest::InternalSwap(ExecuteCommandRequest* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &code_, lhs_arena, &other->code_, rhs_arena ); @@ -3211,7 +3212,7 @@ void ExecuteCommandRequest::InternalSwap(ExecuteCommandRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExecuteCommandRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[6]); } @@ -3237,17 +3238,17 @@ ExecuteCommandResponse::ExecuteCommandResponse(::PROTOBUF_NAMESPACE_ID::Arena* a bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) } ExecuteCommandResponse::ExecuteCommandResponse(const ExecuteCommandResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + error_message_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + error_message_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_error_message().empty()) { - error_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_error_message(), + error_message_.Set(from._internal_error_message(), GetArenaForAllocation()); } if (from._internal_has_changes()) { @@ -3258,37 +3259,36 @@ ExecuteCommandResponse::ExecuteCommandResponse(const ExecuteCommandResponse& fro // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) } -void ExecuteCommandResponse::SharedCtor() { -error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ExecuteCommandResponse::SharedCtor() { +error_message_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + error_message_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING changes_ = nullptr; } ExecuteCommandResponse::~ExecuteCommandResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExecuteCommandResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - error_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + error_message_.Destroy(); if (this != internal_default_instance()) delete changes_; } -void ExecuteCommandResponse::ArenaDtor(void* object) { - ExecuteCommandResponse* _this = reinterpret_cast< ExecuteCommandResponse* >(object); - (void)_this; -} -void ExecuteCommandResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExecuteCommandResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExecuteCommandResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3300,25 +3300,25 @@ void ExecuteCommandResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExecuteCommandResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExecuteCommandResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string error_message = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_error_message(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.FieldsChangeUpdate changes = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_changes(), ptr); CHK_(ptr); } else @@ -3347,10 +3347,10 @@ const char* ExecuteCommandResponse::_InternalParse(const char* ptr, ::PROTOBUF_N #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExecuteCommandResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExecuteCommandResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string error_message = 1; @@ -3365,14 +3365,13 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExecuteCommandResponse::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.FieldsChangeUpdate changes = 2; if (this->_internal_has_changes()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::changes(this), target, stream); + InternalWriteMessage(2, _Internal::changes(this), + _Internal::changes(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) @@ -3383,7 +3382,7 @@ size_t ExecuteCommandResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3420,7 +3419,7 @@ void ExecuteCommandResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExecuteCommandResponse::MergeFrom(const ExecuteCommandResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_error_message().empty()) { @@ -3449,7 +3448,6 @@ void ExecuteCommandResponse::InternalSwap(ExecuteCommandResponse* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &error_message_, lhs_arena, &other->error_message_, rhs_arena ); @@ -3457,7 +3455,7 @@ void ExecuteCommandResponse::InternalSwap(ExecuteCommandResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExecuteCommandResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[7]); } @@ -3494,17 +3492,17 @@ BindTableToVariableRequest::BindTableToVariableRequest(::PROTOBUF_NAMESPACE_ID:: bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) } BindTableToVariableRequest::BindTableToVariableRequest(const BindTableToVariableRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - variable_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + variable_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + variable_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_variable_name().empty()) { - variable_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_variable_name(), + variable_name_.Set(from._internal_variable_name(), GetArenaForAllocation()); } if (from._internal_has_console_id()) { @@ -3520,8 +3518,11 @@ BindTableToVariableRequest::BindTableToVariableRequest(const BindTableToVariable // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) } -void BindTableToVariableRequest::SharedCtor() { -variable_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void BindTableToVariableRequest::SharedCtor() { +variable_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + variable_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&table_id_) - @@ -3530,31 +3531,27 @@ ::memset(reinterpret_cast(this) + static_cast( BindTableToVariableRequest::~BindTableToVariableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void BindTableToVariableRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - variable_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + variable_name_.Destroy(); if (this != internal_default_instance()) delete console_id_; if (this != internal_default_instance()) delete table_id_; } -void BindTableToVariableRequest::ArenaDtor(void* object) { - BindTableToVariableRequest* _this = reinterpret_cast< BindTableToVariableRequest* >(object); - (void)_this; -} -void BindTableToVariableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void BindTableToVariableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void BindTableToVariableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3570,15 +3567,15 @@ void BindTableToVariableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* BindTableToVariableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* BindTableToVariableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -3586,17 +3583,17 @@ const char* BindTableToVariableRequest::_InternalParse(const char* ptr, ::PROTOB continue; // string variable_name = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_variable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.Ticket table_id = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_table_id(), ptr); CHK_(ptr); } else @@ -3625,18 +3622,17 @@ const char* BindTableToVariableRequest::_InternalParse(const char* ptr, ::PROTOB #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* BindTableToVariableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* BindTableToVariableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // string variable_name = 3; @@ -3651,14 +3647,13 @@ ::PROTOBUF_NAMESPACE_ID::uint8* BindTableToVariableRequest::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.Ticket table_id = 4; if (this->_internal_has_table_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::table_id(this), target, stream); + InternalWriteMessage(4, _Internal::table_id(this), + _Internal::table_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) @@ -3669,7 +3664,7 @@ size_t BindTableToVariableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3713,7 +3708,7 @@ void BindTableToVariableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void BindTableToVariableRequest::MergeFrom(const BindTableToVariableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_variable_name().empty()) { @@ -3745,7 +3740,6 @@ void BindTableToVariableRequest::InternalSwap(BindTableToVariableRequest* other) auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &variable_name_, lhs_arena, &other->variable_name_, rhs_arena ); @@ -3758,7 +3752,7 @@ void BindTableToVariableRequest::InternalSwap(BindTableToVariableRequest* other) } ::PROTOBUF_NAMESPACE_ID::Metadata BindTableToVariableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[8]); } @@ -3797,7 +3791,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BindTableToVariableResponse::G ::PROTOBUF_NAMESPACE_ID::Metadata BindTableToVariableResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[9]); } @@ -3834,9 +3828,6 @@ CancelCommandRequest::CancelCommandRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) } CancelCommandRequest::CancelCommandRequest(const CancelCommandRequest& from) @@ -3855,7 +3846,7 @@ CancelCommandRequest::CancelCommandRequest(const CancelCommandRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) } -void CancelCommandRequest::SharedCtor() { +inline void CancelCommandRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&command_id_) - @@ -3864,9 +3855,11 @@ ::memset(reinterpret_cast(this) + static_cast( CancelCommandRequest::~CancelCommandRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CancelCommandRequest::SharedDtor() { @@ -3875,19 +3868,13 @@ inline void CancelCommandRequest::SharedDtor() { if (this != internal_default_instance()) delete command_id_; } -void CancelCommandRequest::ArenaDtor(void* object) { - CancelCommandRequest* _this = reinterpret_cast< CancelCommandRequest* >(object); - (void)_this; -} -void CancelCommandRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CancelCommandRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void CancelCommandRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3902,15 +3889,15 @@ void CancelCommandRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CancelCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CancelCommandRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -3918,7 +3905,7 @@ const char* CancelCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // .io.deephaven.proto.backplane.grpc.Ticket command_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_command_id(), ptr); CHK_(ptr); } else @@ -3947,30 +3934,28 @@ const char* CancelCommandRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CancelCommandRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CancelCommandRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket command_id = 2; if (this->_internal_has_command_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::command_id(this), target, stream); + InternalWriteMessage(2, _Internal::command_id(this), + _Internal::command_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) @@ -3981,7 +3966,7 @@ size_t CancelCommandRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4018,7 +4003,7 @@ void CancelCommandRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CancelCommandRequest::MergeFrom(const CancelCommandRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_console_id()) { @@ -4053,7 +4038,7 @@ void CancelCommandRequest::InternalSwap(CancelCommandRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CancelCommandRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[10]); } @@ -4092,7 +4077,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CancelCommandResponse::GetClas ::PROTOBUF_NAMESPACE_ID::Metadata CancelCommandResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[11]); } @@ -4128,7 +4113,7 @@ void AutoCompleteRequest::set_allocated_open_document(::io::deephaven::proto::ba clear_request(); if (open_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest>::GetOwningArena(open_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(open_document); if (message_arena != submessage_arena) { open_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, open_document, submessage_arena); @@ -4143,7 +4128,7 @@ void AutoCompleteRequest::set_allocated_change_document(::io::deephaven::proto:: clear_request(); if (change_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest>::GetOwningArena(change_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(change_document); if (message_arena != submessage_arena) { change_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, change_document, submessage_arena); @@ -4158,7 +4143,7 @@ void AutoCompleteRequest::set_allocated_get_completion_items(::io::deephaven::pr clear_request(); if (get_completion_items) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest>::GetOwningArena(get_completion_items); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(get_completion_items); if (message_arena != submessage_arena) { get_completion_items = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, get_completion_items, submessage_arena); @@ -4173,7 +4158,7 @@ void AutoCompleteRequest::set_allocated_close_document(::io::deephaven::proto::b clear_request(); if (close_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest>::GetOwningArena(close_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(close_document); if (message_arena != submessage_arena) { close_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, close_document, submessage_arena); @@ -4187,9 +4172,6 @@ AutoCompleteRequest::AutoCompleteRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) } AutoCompleteRequest::AutoCompleteRequest(const AutoCompleteRequest& from) @@ -4220,15 +4202,17 @@ AutoCompleteRequest::AutoCompleteRequest(const AutoCompleteRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) } -void AutoCompleteRequest::SharedCtor() { +inline void AutoCompleteRequest::SharedCtor() { clear_has_request(); } AutoCompleteRequest::~AutoCompleteRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void AutoCompleteRequest::SharedDtor() { @@ -4238,12 +4222,6 @@ inline void AutoCompleteRequest::SharedDtor() { } } -void AutoCompleteRequest::ArenaDtor(void* object) { - AutoCompleteRequest* _this = reinterpret_cast< AutoCompleteRequest* >(object); - (void)_this; -} -void AutoCompleteRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void AutoCompleteRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -4285,7 +4263,7 @@ void AutoCompleteRequest::clear_request() { void AutoCompleteRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4293,15 +4271,15 @@ void AutoCompleteRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest open_document = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_open_document(), ptr); CHK_(ptr); } else @@ -4309,7 +4287,7 @@ const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // .io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest change_document = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_change_document(), ptr); CHK_(ptr); } else @@ -4317,7 +4295,7 @@ const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // .io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest get_completion_items = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_get_completion_items(), ptr); CHK_(ptr); } else @@ -4325,7 +4303,7 @@ const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // .io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest close_document = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_close_document(), ptr); CHK_(ptr); } else @@ -4354,46 +4332,42 @@ const char* AutoCompleteRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* AutoCompleteRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* AutoCompleteRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest open_document = 1; if (_internal_has_open_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::open_document(this), target, stream); + InternalWriteMessage(1, _Internal::open_document(this), + _Internal::open_document(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest change_document = 2; if (_internal_has_change_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::change_document(this), target, stream); + InternalWriteMessage(2, _Internal::change_document(this), + _Internal::change_document(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest get_completion_items = 3; if (_internal_has_get_completion_items()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::get_completion_items(this), target, stream); + InternalWriteMessage(3, _Internal::get_completion_items(this), + _Internal::get_completion_items(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest close_document = 4; if (_internal_has_close_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::close_document(this), target, stream); + InternalWriteMessage(4, _Internal::close_document(this), + _Internal::close_document(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) @@ -4404,7 +4378,7 @@ size_t AutoCompleteRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4460,7 +4434,7 @@ void AutoCompleteRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void AutoCompleteRequest::MergeFrom(const AutoCompleteRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.request_case()) { @@ -4506,7 +4480,7 @@ void AutoCompleteRequest::InternalSwap(AutoCompleteRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata AutoCompleteRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[12]); } @@ -4527,7 +4501,7 @@ void AutoCompleteResponse::set_allocated_completion_items(::io::deephaven::proto clear_response(); if (completion_items) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse>::GetOwningArena(completion_items); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(completion_items); if (message_arena != submessage_arena) { completion_items = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, completion_items, submessage_arena); @@ -4541,9 +4515,6 @@ AutoCompleteResponse::AutoCompleteResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) } AutoCompleteResponse::AutoCompleteResponse(const AutoCompleteResponse& from) @@ -4562,15 +4533,17 @@ AutoCompleteResponse::AutoCompleteResponse(const AutoCompleteResponse& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) } -void AutoCompleteResponse::SharedCtor() { +inline void AutoCompleteResponse::SharedCtor() { clear_has_response(); } AutoCompleteResponse::~AutoCompleteResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void AutoCompleteResponse::SharedDtor() { @@ -4580,12 +4553,6 @@ inline void AutoCompleteResponse::SharedDtor() { } } -void AutoCompleteResponse::ArenaDtor(void* object) { - AutoCompleteResponse* _this = reinterpret_cast< AutoCompleteResponse* >(object); - (void)_this; -} -void AutoCompleteResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void AutoCompleteResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -4609,7 +4576,7 @@ void AutoCompleteResponse::clear_response() { void AutoCompleteResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4617,15 +4584,15 @@ void AutoCompleteResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* AutoCompleteResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* AutoCompleteResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse completion_items = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_completion_items(), ptr); CHK_(ptr); } else @@ -4654,22 +4621,21 @@ const char* AutoCompleteResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAM #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* AutoCompleteResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* AutoCompleteResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse completion_items = 1; if (_internal_has_completion_items()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::completion_items(this), target, stream); + InternalWriteMessage(1, _Internal::completion_items(this), + _Internal::completion_items(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) @@ -4680,7 +4646,7 @@ size_t AutoCompleteResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4715,7 +4681,7 @@ void AutoCompleteResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void AutoCompleteResponse::MergeFrom(const AutoCompleteResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.response_case()) { @@ -4749,7 +4715,7 @@ void AutoCompleteResponse::InternalSwap(AutoCompleteResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata AutoCompleteResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[13]); } @@ -4788,7 +4754,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BrowserNextResponse::GetClassD ::PROTOBUF_NAMESPACE_ID::Metadata BrowserNextResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[14]); } @@ -4819,9 +4785,6 @@ OpenDocumentRequest::OpenDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) } OpenDocumentRequest::OpenDocumentRequest(const OpenDocumentRequest& from) @@ -4840,7 +4803,7 @@ OpenDocumentRequest::OpenDocumentRequest(const OpenDocumentRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) } -void OpenDocumentRequest::SharedCtor() { +inline void OpenDocumentRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&text_document_) - @@ -4849,9 +4812,11 @@ ::memset(reinterpret_cast(this) + static_cast( OpenDocumentRequest::~OpenDocumentRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void OpenDocumentRequest::SharedDtor() { @@ -4860,19 +4825,13 @@ inline void OpenDocumentRequest::SharedDtor() { if (this != internal_default_instance()) delete text_document_; } -void OpenDocumentRequest::ArenaDtor(void* object) { - OpenDocumentRequest* _this = reinterpret_cast< OpenDocumentRequest* >(object); - (void)_this; -} -void OpenDocumentRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void OpenDocumentRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void OpenDocumentRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4887,15 +4846,15 @@ void OpenDocumentRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* OpenDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* OpenDocumentRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -4903,7 +4862,7 @@ const char* OpenDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // .io.deephaven.proto.backplane.script.grpc.TextDocumentItem text_document = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_text_document(), ptr); CHK_(ptr); } else @@ -4932,30 +4891,28 @@ const char* OpenDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* OpenDocumentRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* OpenDocumentRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.TextDocumentItem text_document = 2; if (this->_internal_has_text_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::text_document(this), target, stream); + InternalWriteMessage(2, _Internal::text_document(this), + _Internal::text_document(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) @@ -4966,7 +4923,7 @@ size_t OpenDocumentRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5003,7 +4960,7 @@ void OpenDocumentRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void OpenDocumentRequest::MergeFrom(const OpenDocumentRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_console_id()) { @@ -5038,7 +4995,7 @@ void OpenDocumentRequest::InternalSwap(OpenDocumentRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata OpenDocumentRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[15]); } @@ -5053,67 +5010,78 @@ TextDocumentItem::TextDocumentItem(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) } TextDocumentItem::TextDocumentItem(const TextDocumentItem& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + uri_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_uri().empty()) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_uri(), + uri_.Set(from._internal_uri(), GetArenaForAllocation()); } - language_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + language_id_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + language_id_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_language_id().empty()) { - language_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_language_id(), + language_id_.Set(from._internal_language_id(), GetArenaForAllocation()); } - text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_text().empty()) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_text(), + text_.Set(from._internal_text(), GetArenaForAllocation()); } version_ = from.version_; // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) } -void TextDocumentItem::SharedCtor() { -uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -language_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void TextDocumentItem::SharedCtor() { +uri_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +language_id_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + language_id_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +text_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING version_ = 0; } TextDocumentItem::~TextDocumentItem() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TextDocumentItem::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - uri_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - language_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + uri_.Destroy(); + language_id_.Destroy(); + text_.Destroy(); } -void TextDocumentItem::ArenaDtor(void* object) { - TextDocumentItem* _this = reinterpret_cast< TextDocumentItem* >(object); - (void)_this; -} -void TextDocumentItem::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TextDocumentItem::SetCachedSize(int size) const { _cached_size_.Set(size); } void TextDocumentItem::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5124,47 +5092,47 @@ void TextDocumentItem::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TextDocumentItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TextDocumentItem::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string uri = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_uri(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri")); } else goto handle_unusual; continue; // string language_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_language_id(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id")); } else goto handle_unusual; continue; // int32 version = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string text = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { auto str = _internal_mutable_text(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text")); } else goto handle_unusual; continue; @@ -5191,10 +5159,10 @@ const char* TextDocumentItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TextDocumentItem::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TextDocumentItem::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string uri = 1; @@ -5220,7 +5188,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TextDocumentItem::_InternalSerialize( // int32 version = 3; if (this->_internal_version() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_version(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_version(), target); } // string text = 4; @@ -5234,7 +5202,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TextDocumentItem::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) @@ -5245,7 +5213,7 @@ size_t TextDocumentItem::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5272,7 +5240,7 @@ size_t TextDocumentItem::ByteSizeLong() const { // int32 version = 3; if (this->_internal_version() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_version()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -5294,7 +5262,7 @@ void TextDocumentItem::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void TextDocumentItem::MergeFrom(const TextDocumentItem& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_uri().empty()) { @@ -5329,17 +5297,14 @@ void TextDocumentItem::InternalSwap(TextDocumentItem* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &uri_, lhs_arena, &other->uri_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &language_id_, lhs_arena, &other->language_id_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &text_, lhs_arena, &other->text_, rhs_arena ); @@ -5347,7 +5312,7 @@ void TextDocumentItem::InternalSwap(TextDocumentItem* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata TextDocumentItem::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[16]); } @@ -5378,9 +5343,6 @@ CloseDocumentRequest::CloseDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) } CloseDocumentRequest::CloseDocumentRequest(const CloseDocumentRequest& from) @@ -5399,7 +5361,7 @@ CloseDocumentRequest::CloseDocumentRequest(const CloseDocumentRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) } -void CloseDocumentRequest::SharedCtor() { +inline void CloseDocumentRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&text_document_) - @@ -5408,9 +5370,11 @@ ::memset(reinterpret_cast(this) + static_cast( CloseDocumentRequest::~CloseDocumentRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CloseDocumentRequest::SharedDtor() { @@ -5419,19 +5383,13 @@ inline void CloseDocumentRequest::SharedDtor() { if (this != internal_default_instance()) delete text_document_; } -void CloseDocumentRequest::ArenaDtor(void* object) { - CloseDocumentRequest* _this = reinterpret_cast< CloseDocumentRequest* >(object); - (void)_this; -} -void CloseDocumentRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CloseDocumentRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void CloseDocumentRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5446,15 +5404,15 @@ void CloseDocumentRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CloseDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CloseDocumentRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -5462,7 +5420,7 @@ const char* CloseDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_text_document(), ptr); CHK_(ptr); } else @@ -5491,30 +5449,28 @@ const char* CloseDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CloseDocumentRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CloseDocumentRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 2; if (this->_internal_has_text_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::text_document(this), target, stream); + InternalWriteMessage(2, _Internal::text_document(this), + _Internal::text_document(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) @@ -5525,7 +5481,7 @@ size_t CloseDocumentRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5562,7 +5518,7 @@ void CloseDocumentRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CloseDocumentRequest::MergeFrom(const CloseDocumentRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_console_id()) { @@ -5597,7 +5553,7 @@ void CloseDocumentRequest::InternalSwap(CloseDocumentRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CloseDocumentRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[17]); } @@ -5617,17 +5573,17 @@ ChangeDocumentRequest_TextDocumentContentChangeEvent::ChangeDocumentRequest_Text bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) } ChangeDocumentRequest_TextDocumentContentChangeEvent::ChangeDocumentRequest_TextDocumentContentChangeEvent(const ChangeDocumentRequest_TextDocumentContentChangeEvent& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_text().empty()) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_text(), + text_.Set(from._internal_text(), GetArenaForAllocation()); } if (from._internal_has_range()) { @@ -5639,8 +5595,11 @@ ChangeDocumentRequest_TextDocumentContentChangeEvent::ChangeDocumentRequest_Text // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) } -void ChangeDocumentRequest_TextDocumentContentChangeEvent::SharedCtor() { -text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::SharedCtor() { +text_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&range_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&range_length_) - @@ -5649,30 +5608,26 @@ ::memset(reinterpret_cast(this) + static_cast( ChangeDocumentRequest_TextDocumentContentChangeEvent::~ChangeDocumentRequest_TextDocumentContentChangeEvent() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + text_.Destroy(); if (this != internal_default_instance()) delete range_; } -void ChangeDocumentRequest_TextDocumentContentChangeEvent::ArenaDtor(void* object) { - ChangeDocumentRequest_TextDocumentContentChangeEvent* _this = reinterpret_cast< ChangeDocumentRequest_TextDocumentContentChangeEvent* >(object); - (void)_this; -} -void ChangeDocumentRequest_TextDocumentContentChangeEvent::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ChangeDocumentRequest_TextDocumentContentChangeEvent::SetCachedSize(int size) const { _cached_size_.Set(size); } void ChangeDocumentRequest_TextDocumentContentChangeEvent::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5685,15 +5640,15 @@ void ChangeDocumentRequest_TextDocumentContentChangeEvent::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.DocumentRange range = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_range(), ptr); CHK_(ptr); } else @@ -5701,19 +5656,19 @@ const char* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalParse continue; // int32 range_length = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - range_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + range_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string text = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_text(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text")); } else goto handle_unusual; continue; @@ -5740,24 +5695,23 @@ const char* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalParse #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ChangeDocumentRequest_TextDocumentContentChangeEvent::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.DocumentRange range = 1; if (this->_internal_has_range()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::range(this), target, stream); + InternalWriteMessage(1, _Internal::range(this), + _Internal::range(this).GetCachedSize(), target, stream); } // int32 range_length = 2; if (this->_internal_range_length() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_range_length(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_range_length(), target); } // string text = 3; @@ -5771,7 +5725,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ChangeDocumentRequest_TextDocumentContentChangeE } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) @@ -5782,7 +5736,7 @@ size_t ChangeDocumentRequest_TextDocumentContentChangeEvent::ByteSizeLong() cons // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5802,7 +5756,7 @@ size_t ChangeDocumentRequest_TextDocumentContentChangeEvent::ByteSizeLong() cons // int32 range_length = 2; if (this->_internal_range_length() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_range_length()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_range_length()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -5824,7 +5778,7 @@ void ChangeDocumentRequest_TextDocumentContentChangeEvent::MergeImpl(::PROTOBUF_ void ChangeDocumentRequest_TextDocumentContentChangeEvent::MergeFrom(const ChangeDocumentRequest_TextDocumentContentChangeEvent& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_text().empty()) { @@ -5856,7 +5810,6 @@ void ChangeDocumentRequest_TextDocumentContentChangeEvent::InternalSwap(ChangeDo auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &text_, lhs_arena, &other->text_, rhs_arena ); @@ -5869,7 +5822,7 @@ void ChangeDocumentRequest_TextDocumentContentChangeEvent::InternalSwap(ChangeDo } ::PROTOBUF_NAMESPACE_ID::Metadata ChangeDocumentRequest_TextDocumentContentChangeEvent::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[18]); } @@ -5901,9 +5854,6 @@ ChangeDocumentRequest::ChangeDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* are : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), content_changes_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) } ChangeDocumentRequest::ChangeDocumentRequest(const ChangeDocumentRequest& from) @@ -5923,7 +5873,7 @@ ChangeDocumentRequest::ChangeDocumentRequest(const ChangeDocumentRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) } -void ChangeDocumentRequest::SharedCtor() { +inline void ChangeDocumentRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&text_document_) - @@ -5932,9 +5882,11 @@ ::memset(reinterpret_cast(this) + static_cast( ChangeDocumentRequest::~ChangeDocumentRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ChangeDocumentRequest::SharedDtor() { @@ -5943,19 +5895,13 @@ inline void ChangeDocumentRequest::SharedDtor() { if (this != internal_default_instance()) delete text_document_; } -void ChangeDocumentRequest::ArenaDtor(void* object) { - ChangeDocumentRequest* _this = reinterpret_cast< ChangeDocumentRequest* >(object); - (void)_this; -} -void ChangeDocumentRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ChangeDocumentRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ChangeDocumentRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5971,15 +5917,15 @@ void ChangeDocumentRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ChangeDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ChangeDocumentRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -5987,7 +5933,7 @@ const char* ChangeDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_text_document(), ptr); CHK_(ptr); } else @@ -5995,7 +5941,7 @@ const char* ChangeDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated .io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent content_changes = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -6029,38 +5975,36 @@ const char* ChangeDocumentRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ChangeDocumentRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ChangeDocumentRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 2; if (this->_internal_has_text_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::text_document(this), target, stream); + InternalWriteMessage(2, _Internal::text_document(this), + _Internal::text_document(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent content_changes = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_content_changes_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_content_changes_size()); i < n; i++) { + const auto& repfield = this->_internal_content_changes(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_content_changes(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) @@ -6071,7 +6015,7 @@ size_t ChangeDocumentRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6115,7 +6059,7 @@ void ChangeDocumentRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ChangeDocumentRequest::MergeFrom(const ChangeDocumentRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; content_changes_.MergeFrom(from.content_changes_); @@ -6152,7 +6096,7 @@ void ChangeDocumentRequest::InternalSwap(ChangeDocumentRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ChangeDocumentRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[19]); } @@ -6177,9 +6121,6 @@ DocumentRange::DocumentRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.DocumentRange) } DocumentRange::DocumentRange(const DocumentRange& from) @@ -6198,7 +6139,7 @@ DocumentRange::DocumentRange(const DocumentRange& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.DocumentRange) } -void DocumentRange::SharedCtor() { +inline void DocumentRange::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&start_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&end_) - @@ -6207,9 +6148,11 @@ ::memset(reinterpret_cast(this) + static_cast( DocumentRange::~DocumentRange() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.DocumentRange) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void DocumentRange::SharedDtor() { @@ -6218,19 +6161,13 @@ inline void DocumentRange::SharedDtor() { if (this != internal_default_instance()) delete end_; } -void DocumentRange::ArenaDtor(void* object) { - DocumentRange* _this = reinterpret_cast< DocumentRange* >(object); - (void)_this; -} -void DocumentRange::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void DocumentRange::SetCachedSize(int size) const { _cached_size_.Set(size); } void DocumentRange::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.DocumentRange) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6245,15 +6182,15 @@ void DocumentRange::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DocumentRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* DocumentRange::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.Position start = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_start(), ptr); CHK_(ptr); } else @@ -6261,7 +6198,7 @@ const char* DocumentRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ continue; // .io.deephaven.proto.backplane.script.grpc.Position end = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_end(), ptr); CHK_(ptr); } else @@ -6290,30 +6227,28 @@ const char* DocumentRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* DocumentRange::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* DocumentRange::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.DocumentRange) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.Position start = 1; if (this->_internal_has_start()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::start(this), target, stream); + InternalWriteMessage(1, _Internal::start(this), + _Internal::start(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.Position end = 2; if (this->_internal_has_end()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::end(this), target, stream); + InternalWriteMessage(2, _Internal::end(this), + _Internal::end(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.DocumentRange) @@ -6324,7 +6259,7 @@ size_t DocumentRange::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.DocumentRange) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6361,7 +6296,7 @@ void DocumentRange::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void DocumentRange::MergeFrom(const DocumentRange& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.DocumentRange) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_start()) { @@ -6396,7 +6331,7 @@ void DocumentRange::InternalSwap(DocumentRange* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata DocumentRange::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[20]); } @@ -6411,53 +6346,52 @@ VersionedTextDocumentIdentifier::VersionedTextDocumentIdentifier(::PROTOBUF_NAME bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) } VersionedTextDocumentIdentifier::VersionedTextDocumentIdentifier(const VersionedTextDocumentIdentifier& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + uri_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_uri().empty()) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_uri(), + uri_.Set(from._internal_uri(), GetArenaForAllocation()); } version_ = from.version_; // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) } -void VersionedTextDocumentIdentifier::SharedCtor() { -uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void VersionedTextDocumentIdentifier::SharedCtor() { +uri_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING version_ = 0; } VersionedTextDocumentIdentifier::~VersionedTextDocumentIdentifier() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void VersionedTextDocumentIdentifier::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - uri_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + uri_.Destroy(); } -void VersionedTextDocumentIdentifier::ArenaDtor(void* object) { - VersionedTextDocumentIdentifier* _this = reinterpret_cast< VersionedTextDocumentIdentifier* >(object); - (void)_this; -} -void VersionedTextDocumentIdentifier::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void VersionedTextDocumentIdentifier::SetCachedSize(int size) const { _cached_size_.Set(size); } void VersionedTextDocumentIdentifier::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6466,26 +6400,26 @@ void VersionedTextDocumentIdentifier::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* VersionedTextDocumentIdentifier::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* VersionedTextDocumentIdentifier::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string uri = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_uri(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri")); } else goto handle_unusual; continue; // int32 version = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -6513,10 +6447,10 @@ const char* VersionedTextDocumentIdentifier::_InternalParse(const char* ptr, ::P #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* VersionedTextDocumentIdentifier::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* VersionedTextDocumentIdentifier::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string uri = 1; @@ -6532,11 +6466,11 @@ ::PROTOBUF_NAMESPACE_ID::uint8* VersionedTextDocumentIdentifier::_InternalSerial // int32 version = 2; if (this->_internal_version() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_version(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_version(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) @@ -6547,7 +6481,7 @@ size_t VersionedTextDocumentIdentifier::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6560,7 +6494,7 @@ size_t VersionedTextDocumentIdentifier::ByteSizeLong() const { // int32 version = 2; if (this->_internal_version() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_version()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -6582,7 +6516,7 @@ void VersionedTextDocumentIdentifier::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message void VersionedTextDocumentIdentifier::MergeFrom(const VersionedTextDocumentIdentifier& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_uri().empty()) { @@ -6611,7 +6545,6 @@ void VersionedTextDocumentIdentifier::InternalSwap(VersionedTextDocumentIdentifi auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &uri_, lhs_arena, &other->uri_, rhs_arena ); @@ -6619,7 +6552,7 @@ void VersionedTextDocumentIdentifier::InternalSwap(VersionedTextDocumentIdentifi } ::PROTOBUF_NAMESPACE_ID::Metadata VersionedTextDocumentIdentifier::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[21]); } @@ -6634,9 +6567,6 @@ Position::Position(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.Position) } Position::Position(const Position& from) @@ -6648,7 +6578,7 @@ Position::Position(const Position& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.Position) } -void Position::SharedCtor() { +inline void Position::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&line_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&character_) - @@ -6657,28 +6587,24 @@ ::memset(reinterpret_cast(this) + static_cast( Position::~Position() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.Position) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Position::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void Position::ArenaDtor(void* object) { - Position* _this = reinterpret_cast< Position* >(object); - (void)_this; -} -void Position::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Position::SetCachedSize(int size) const { _cached_size_.Set(size); } void Position::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.Position) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6688,24 +6614,24 @@ void Position::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Position::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Position::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 line = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - line_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + line_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 character = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - character_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + character_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -6733,26 +6659,26 @@ const char* Position::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::i #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Position::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Position::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.Position) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 line = 1; if (this->_internal_line() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_line(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_line(), target); } // int32 character = 2; if (this->_internal_character() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_character(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_character(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.Position) @@ -6763,18 +6689,18 @@ size_t Position::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.Position) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // int32 line = 1; if (this->_internal_line() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_line()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_line()); } // int32 character = 2; if (this->_internal_character() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_character()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_character()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -6796,7 +6722,7 @@ void Position::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Position::MergeFrom(const Position& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.Position) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_line() != 0) { @@ -6831,7 +6757,7 @@ void Position::InternalSwap(Position* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Position::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[22]); } @@ -6872,9 +6798,6 @@ GetCompletionItemsRequest::GetCompletionItemsRequest(::PROTOBUF_NAMESPACE_ID::Ar bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) } GetCompletionItemsRequest::GetCompletionItemsRequest(const GetCompletionItemsRequest& from) @@ -6904,7 +6827,7 @@ GetCompletionItemsRequest::GetCompletionItemsRequest(const GetCompletionItemsReq // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) } -void GetCompletionItemsRequest::SharedCtor() { +inline void GetCompletionItemsRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&console_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&request_id_) - @@ -6913,9 +6836,11 @@ ::memset(reinterpret_cast(this) + static_cast( GetCompletionItemsRequest::~GetCompletionItemsRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void GetCompletionItemsRequest::SharedDtor() { @@ -6926,19 +6851,13 @@ inline void GetCompletionItemsRequest::SharedDtor() { if (this != internal_default_instance()) delete position_; } -void GetCompletionItemsRequest::ArenaDtor(void* object) { - GetCompletionItemsRequest* _this = reinterpret_cast< GetCompletionItemsRequest* >(object); - (void)_this; -} -void GetCompletionItemsRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void GetCompletionItemsRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void GetCompletionItemsRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6962,15 +6881,15 @@ void GetCompletionItemsRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_console_id(), ptr); CHK_(ptr); } else @@ -6978,7 +6897,7 @@ const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // .io.deephaven.proto.backplane.script.grpc.CompletionContext context = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_context(), ptr); CHK_(ptr); } else @@ -6986,7 +6905,7 @@ const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_text_document(), ptr); CHK_(ptr); } else @@ -6994,7 +6913,7 @@ const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // .io.deephaven.proto.backplane.script.grpc.Position position = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_position(), ptr); CHK_(ptr); } else @@ -7002,8 +6921,8 @@ const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // int32 request_id = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -7031,52 +6950,48 @@ const char* GetCompletionItemsRequest::_InternalParse(const char* ptr, ::PROTOBU #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* GetCompletionItemsRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* GetCompletionItemsRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket console_id = 1; if (this->_internal_has_console_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::console_id(this), target, stream); + InternalWriteMessage(1, _Internal::console_id(this), + _Internal::console_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.CompletionContext context = 2; if (this->_internal_has_context()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::context(this), target, stream); + InternalWriteMessage(2, _Internal::context(this), + _Internal::context(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier text_document = 3; if (this->_internal_has_text_document()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::text_document(this), target, stream); + InternalWriteMessage(3, _Internal::text_document(this), + _Internal::text_document(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.Position position = 4; if (this->_internal_has_position()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::position(this), target, stream); + InternalWriteMessage(4, _Internal::position(this), + _Internal::position(this).GetCachedSize(), target, stream); } // int32 request_id = 5; if (this->_internal_request_id() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_request_id(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_request_id(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) @@ -7087,7 +7002,7 @@ size_t GetCompletionItemsRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7121,7 +7036,7 @@ size_t GetCompletionItemsRequest::ByteSizeLong() const { // int32 request_id = 5; if (this->_internal_request_id() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_request_id()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_request_id()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -7143,7 +7058,7 @@ void GetCompletionItemsRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void GetCompletionItemsRequest::MergeFrom(const GetCompletionItemsRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_console_id()) { @@ -7187,7 +7102,7 @@ void GetCompletionItemsRequest::InternalSwap(GetCompletionItemsRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata GetCompletionItemsRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[23]); } @@ -7202,53 +7117,52 @@ CompletionContext::CompletionContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.CompletionContext) } CompletionContext::CompletionContext(const CompletionContext& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - trigger_character_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + trigger_character_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + trigger_character_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_trigger_character().empty()) { - trigger_character_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_trigger_character(), + trigger_character_.Set(from._internal_trigger_character(), GetArenaForAllocation()); } trigger_kind_ = from.trigger_kind_; // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.CompletionContext) } -void CompletionContext::SharedCtor() { -trigger_character_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void CompletionContext::SharedCtor() { +trigger_character_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + trigger_character_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING trigger_kind_ = 0; } CompletionContext::~CompletionContext() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.CompletionContext) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CompletionContext::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - trigger_character_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + trigger_character_.Destroy(); } -void CompletionContext::ArenaDtor(void* object) { - CompletionContext* _this = reinterpret_cast< CompletionContext* >(object); - (void)_this; -} -void CompletionContext::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CompletionContext::SetCachedSize(int size) const { _cached_size_.Set(size); } void CompletionContext::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.CompletionContext) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7257,27 +7171,27 @@ void CompletionContext::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CompletionContext::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CompletionContext::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 trigger_kind = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - trigger_kind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + trigger_kind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string trigger_character = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_trigger_character(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character")); } else goto handle_unusual; continue; @@ -7304,16 +7218,16 @@ const char* CompletionContext::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CompletionContext::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CompletionContext::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.CompletionContext) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 trigger_kind = 1; if (this->_internal_trigger_kind() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_trigger_kind(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_trigger_kind(), target); } // string trigger_character = 2; @@ -7327,7 +7241,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CompletionContext::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.CompletionContext) @@ -7338,7 +7252,7 @@ size_t CompletionContext::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.CompletionContext) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7351,7 +7265,7 @@ size_t CompletionContext::ByteSizeLong() const { // int32 trigger_kind = 1; if (this->_internal_trigger_kind() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_trigger_kind()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_trigger_kind()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -7373,7 +7287,7 @@ void CompletionContext::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CompletionContext::MergeFrom(const CompletionContext& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.CompletionContext) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_trigger_character().empty()) { @@ -7402,7 +7316,6 @@ void CompletionContext::InternalSwap(CompletionContext* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &trigger_character_, lhs_arena, &other->trigger_character_, rhs_arena ); @@ -7410,7 +7323,7 @@ void CompletionContext::InternalSwap(CompletionContext* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CompletionContext::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[24]); } @@ -7426,9 +7339,6 @@ GetCompletionItemsResponse::GetCompletionItemsResponse(::PROTOBUF_NAMESPACE_ID:: : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), items_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) } GetCompletionItemsResponse::GetCompletionItemsResponse(const GetCompletionItemsResponse& from) @@ -7441,7 +7351,7 @@ GetCompletionItemsResponse::GetCompletionItemsResponse(const GetCompletionItemsR // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) } -void GetCompletionItemsResponse::SharedCtor() { +inline void GetCompletionItemsResponse::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&request_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&success_) - @@ -7450,28 +7360,24 @@ ::memset(reinterpret_cast(this) + static_cast( GetCompletionItemsResponse::~GetCompletionItemsResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void GetCompletionItemsResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void GetCompletionItemsResponse::ArenaDtor(void* object) { - GetCompletionItemsResponse* _this = reinterpret_cast< GetCompletionItemsResponse* >(object); - (void)_this; -} -void GetCompletionItemsResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void GetCompletionItemsResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void GetCompletionItemsResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7482,15 +7388,15 @@ void GetCompletionItemsResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GetCompletionItemsResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* GetCompletionItemsResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated .io.deephaven.proto.backplane.script.grpc.CompletionItem items = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; @@ -7503,15 +7409,15 @@ const char* GetCompletionItemsResponse::_InternalParse(const char* ptr, ::PROTOB continue; // int32 request_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // bool success = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { success_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -7540,34 +7446,34 @@ const char* GetCompletionItemsResponse::_InternalParse(const char* ptr, ::PROTOB #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* GetCompletionItemsResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* GetCompletionItemsResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated .io.deephaven.proto.backplane.script.grpc.CompletionItem items = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_items_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_items_size()); i < n; i++) { + const auto& repfield = this->_internal_items(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_items(i), target, stream); + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } // int32 request_id = 2; if (this->_internal_request_id() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_request_id(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_request_id(), target); } // bool success = 3; if (this->_internal_success() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_success(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_success(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) @@ -7578,7 +7484,7 @@ size_t GetCompletionItemsResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7591,7 +7497,7 @@ size_t GetCompletionItemsResponse::ByteSizeLong() const { // int32 request_id = 2; if (this->_internal_request_id() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_request_id()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_request_id()); } // bool success = 3; @@ -7618,7 +7524,7 @@ void GetCompletionItemsResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void GetCompletionItemsResponse::MergeFrom(const GetCompletionItemsResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; items_.MergeFrom(from.items_); @@ -7655,7 +7561,7 @@ void GetCompletionItemsResponse::InternalSwap(GetCompletionItemsResponse* other) } ::PROTOBUF_NAMESPACE_ID::Metadata GetCompletionItemsResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[25]); } @@ -7677,9 +7583,6 @@ CompletionItem::CompletionItem(::PROTOBUF_NAMESPACE_ID::Arena* arena, additional_text_edits_(arena), commit_characters_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.CompletionItem) } CompletionItem::CompletionItem(const CompletionItem& from) @@ -7687,29 +7590,44 @@ CompletionItem::CompletionItem(const CompletionItem& from) additional_text_edits_(from.additional_text_edits_), commit_characters_(from.commit_characters_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + label_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_label().empty()) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label(), + label_.Set(from._internal_label(), GetArenaForAllocation()); } - detail_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + detail_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + detail_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_detail().empty()) { - detail_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_detail(), + detail_.Set(from._internal_detail(), GetArenaForAllocation()); } - documentation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + documentation_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + documentation_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_documentation().empty()) { - documentation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_documentation(), + documentation_.Set(from._internal_documentation(), GetArenaForAllocation()); } - sort_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + sort_text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + sort_text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_sort_text().empty()) { - sort_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_sort_text(), + sort_text_.Set(from._internal_sort_text(), GetArenaForAllocation()); } - filter_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + filter_text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + filter_text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_filter_text().empty()) { - filter_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_filter_text(), + filter_text_.Set(from._internal_filter_text(), GetArenaForAllocation()); } if (from._internal_has_text_edit()) { @@ -7723,12 +7641,27 @@ CompletionItem::CompletionItem(const CompletionItem& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.CompletionItem) } -void CompletionItem::SharedCtor() { -label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -detail_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -documentation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -sort_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -filter_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void CompletionItem::SharedCtor() { +label_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +detail_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + detail_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +documentation_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + documentation_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +sort_text_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + sort_text_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +filter_text_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + filter_text_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&text_edit_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&insert_text_format_) - @@ -7737,34 +7670,30 @@ ::memset(reinterpret_cast(this) + static_cast( CompletionItem::~CompletionItem() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.CompletionItem) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CompletionItem::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - label_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - detail_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - documentation_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - sort_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - filter_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + label_.Destroy(); + detail_.Destroy(); + documentation_.Destroy(); + sort_text_.Destroy(); + filter_text_.Destroy(); if (this != internal_default_instance()) delete text_edit_; } -void CompletionItem::ArenaDtor(void* object) { - CompletionItem* _this = reinterpret_cast< CompletionItem* >(object); - (void)_this; -} -void CompletionItem::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CompletionItem::SetCachedSize(int size) const { _cached_size_.Set(size); } void CompletionItem::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.CompletionItem) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7785,69 +7714,69 @@ void CompletionItem::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CompletionItem::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 start = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 length = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string label = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_label(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.label")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.label")); } else goto handle_unusual; continue; // int32 kind = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - kind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + kind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string detail = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { auto str = _internal_mutable_detail(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.detail")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.detail")); } else goto handle_unusual; continue; // string documentation = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { auto str = _internal_mutable_documentation(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation")); } else goto handle_unusual; continue; // bool deprecated = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -7855,7 +7784,7 @@ const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // bool preselect = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { preselect_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -7863,7 +7792,7 @@ const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // .io.deephaven.proto.backplane.script.grpc.TextEdit text_edit = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { ptr = ctx->ParseMessage(_internal_mutable_text_edit(), ptr); CHK_(ptr); } else @@ -7871,35 +7800,35 @@ const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // string sort_text = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { auto str = _internal_mutable_sort_text(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text")); } else goto handle_unusual; continue; // string filter_text = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { auto str = _internal_mutable_filter_text(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text")); } else goto handle_unusual; continue; // int32 insert_text_format = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { - insert_text_format_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { + insert_text_format_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.script.grpc.TextEdit additional_text_edits = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { ptr -= 1; do { ptr += 1; @@ -7912,14 +7841,14 @@ const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // repeated string commit_characters = 14; case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 114)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_commit_characters(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.commit_characters")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.CompletionItem.commit_characters")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<114>(ptr)); } else @@ -7948,22 +7877,22 @@ const char* CompletionItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CompletionItem::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CompletionItem::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.CompletionItem) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 start = 1; if (this->_internal_start() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_start(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_start(), target); } // int32 length = 2; if (this->_internal_length() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_length(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_length(), target); } // string label = 3; @@ -7979,7 +7908,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CompletionItem::_InternalSerialize( // int32 kind = 4; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_kind(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_kind(), target); } // string detail = 5; @@ -8005,21 +7934,20 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CompletionItem::_InternalSerialize( // bool deprecated = 7; if (this->_internal_deprecated() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_deprecated(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_deprecated(), target); } // bool preselect = 8; if (this->_internal_preselect() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_preselect(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_preselect(), target); } // .io.deephaven.proto.backplane.script.grpc.TextEdit text_edit = 9; if (this->_internal_has_text_edit()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 9, _Internal::text_edit(this), target, stream); + InternalWriteMessage(9, _Internal::text_edit(this), + _Internal::text_edit(this).GetCachedSize(), target, stream); } // string sort_text = 10; @@ -8045,15 +7973,15 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CompletionItem::_InternalSerialize( // int32 insert_text_format = 12; if (this->_internal_insert_text_format() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(12, this->_internal_insert_text_format(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_insert_text_format(), target); } // repeated .io.deephaven.proto.backplane.script.grpc.TextEdit additional_text_edits = 13; - for (unsigned int i = 0, - n = static_cast(this->_internal_additional_text_edits_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_additional_text_edits_size()); i < n; i++) { + const auto& repfield = this->_internal_additional_text_edits(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(13, this->_internal_additional_text_edits(i), target, stream); + InternalWriteMessage(13, repfield, repfield.GetCachedSize(), target, stream); } // repeated string commit_characters = 14; @@ -8067,7 +7995,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CompletionItem::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.CompletionItem) @@ -8078,7 +8006,7 @@ size_t CompletionItem::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.CompletionItem) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8141,17 +8069,17 @@ size_t CompletionItem::ByteSizeLong() const { // int32 start = 1; if (this->_internal_start() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_start()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_start()); } // int32 length = 2; if (this->_internal_length() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_length()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_length()); } // int32 kind = 4; if (this->_internal_kind() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_kind()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_kind()); } // bool deprecated = 7; @@ -8166,7 +8094,7 @@ size_t CompletionItem::ByteSizeLong() const { // int32 insert_text_format = 12; if (this->_internal_insert_text_format() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_insert_text_format()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_insert_text_format()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -8188,7 +8116,7 @@ void CompletionItem::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CompletionItem::MergeFrom(const CompletionItem& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.CompletionItem) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; additional_text_edits_.MergeFrom(from.additional_text_edits_); @@ -8251,27 +8179,22 @@ void CompletionItem::InternalSwap(CompletionItem* other) { additional_text_edits_.InternalSwap(&other->additional_text_edits_); commit_characters_.InternalSwap(&other->commit_characters_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &label_, lhs_arena, &other->label_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &detail_, lhs_arena, &other->detail_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &documentation_, lhs_arena, &other->documentation_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &sort_text_, lhs_arena, &other->sort_text_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &filter_text_, lhs_arena, &other->filter_text_, rhs_arena ); @@ -8284,7 +8207,7 @@ void CompletionItem::InternalSwap(CompletionItem* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CompletionItem::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[26]); } @@ -8304,17 +8227,17 @@ TextEdit::TextEdit(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.TextEdit) } TextEdit::TextEdit(const TextEdit& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_text().empty()) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_text(), + text_.Set(from._internal_text(), GetArenaForAllocation()); } if (from._internal_has_range()) { @@ -8325,37 +8248,36 @@ TextEdit::TextEdit(const TextEdit& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.TextEdit) } -void TextEdit::SharedCtor() { -text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void TextEdit::SharedCtor() { +text_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + text_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING range_ = nullptr; } TextEdit::~TextEdit() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.TextEdit) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TextEdit::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + text_.Destroy(); if (this != internal_default_instance()) delete range_; } -void TextEdit::ArenaDtor(void* object) { - TextEdit* _this = reinterpret_cast< TextEdit* >(object); - (void)_this; -} -void TextEdit::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TextEdit::SetCachedSize(int size) const { _cached_size_.Set(size); } void TextEdit::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.TextEdit) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8367,15 +8289,15 @@ void TextEdit::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TextEdit::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TextEdit::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.DocumentRange range = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_range(), ptr); CHK_(ptr); } else @@ -8383,11 +8305,11 @@ const char* TextEdit::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::i continue; // string text = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_text(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextEdit.text")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.TextEdit.text")); } else goto handle_unusual; continue; @@ -8414,18 +8336,17 @@ const char* TextEdit::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::i #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TextEdit::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TextEdit::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.TextEdit) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.DocumentRange range = 1; if (this->_internal_has_range()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::range(this), target, stream); + InternalWriteMessage(1, _Internal::range(this), + _Internal::range(this).GetCachedSize(), target, stream); } // string text = 2; @@ -8439,7 +8360,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TextEdit::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.TextEdit) @@ -8450,7 +8371,7 @@ size_t TextEdit::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.TextEdit) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8487,7 +8408,7 @@ void TextEdit::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void TextEdit::MergeFrom(const TextEdit& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.TextEdit) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_text().empty()) { @@ -8516,7 +8437,6 @@ void TextEdit::InternalSwap(TextEdit* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &text_, lhs_arena, &other->text_, rhs_arena ); @@ -8524,7 +8444,7 @@ void TextEdit::InternalSwap(TextEdit* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata TextEdit::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[27]); } @@ -8546,9 +8466,6 @@ FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor(::PROTOBUF_NA multi_series_(arena), axes_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) } FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor(const FigureDescriptor_ChartDescriptor& from) @@ -8558,29 +8475,44 @@ FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor(const FigureD multi_series_(from.multi_series_), axes_(from.axes_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - title_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_title()) { - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title(), + title_.Set(from._internal_title(), GetArenaForAllocation()); } - title_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_font_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_font_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_title_font().empty()) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title_font(), + title_font_.Set(from._internal_title_font(), GetArenaForAllocation()); } - title_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_title_color().empty()) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title_color(), + title_color_.Set(from._internal_title_color(), GetArenaForAllocation()); } - legend_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + legend_font_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + legend_font_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_legend_font().empty()) { - legend_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_legend_font(), + legend_font_.Set(from._internal_legend_font(), GetArenaForAllocation()); } - legend_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + legend_color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + legend_color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_legend_color().empty()) { - legend_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_legend_color(), + legend_color_.Set(from._internal_legend_color(), GetArenaForAllocation()); } ::memcpy(&colspan_, &from.colspan_, @@ -8589,12 +8521,27 @@ FigureDescriptor_ChartDescriptor::FigureDescriptor_ChartDescriptor(const FigureD // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) } -void FigureDescriptor_ChartDescriptor::SharedCtor() { -title_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -title_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -title_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -legend_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -legend_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_ChartDescriptor::SharedCtor() { +title_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +title_font_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_font_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +title_color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +legend_font_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + legend_font_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +legend_color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + legend_color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&colspan_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&is3d_) - @@ -8603,33 +8550,29 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor_ChartDescriptor::~FigureDescriptor_ChartDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_ChartDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - title_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - title_font_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - title_color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - legend_font_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - legend_color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_.Destroy(); + title_font_.Destroy(); + title_color_.Destroy(); + legend_font_.Destroy(); + legend_color_.Destroy(); } -void FigureDescriptor_ChartDescriptor::ArenaDtor(void* object) { - FigureDescriptor_ChartDescriptor* _this = reinterpret_cast< FigureDescriptor_ChartDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_ChartDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_ChartDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_ChartDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8651,32 +8594,32 @@ void FigureDescriptor_ChartDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 colspan = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - colspan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + colspan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 rowspan = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - rowspan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + rowspan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor series = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -8689,7 +8632,7 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor multi_series = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; @@ -8702,7 +8645,7 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor axes = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; @@ -8715,8 +8658,8 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType chart_type = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_chart_type(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor_ChartType>(val)); } else @@ -8724,37 +8667,37 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: continue; // optional string title = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { auto str = _internal_mutable_title(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title")); } else goto handle_unusual; continue; // string title_font = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { auto str = _internal_mutable_title_font(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font")); } else goto handle_unusual; continue; // string title_color = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { auto str = _internal_mutable_title_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color")); } else goto handle_unusual; continue; // bool show_legend = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { show_legend_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -8762,27 +8705,27 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: continue; // string legend_font = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { auto str = _internal_mutable_legend_font(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font")); } else goto handle_unusual; continue; // string legend_color = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { auto str = _internal_mutable_legend_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color")); } else goto handle_unusual; continue; // bool is3d = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 104)) { is3d_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -8812,52 +8755,52 @@ const char* FigureDescriptor_ChartDescriptor::_InternalParse(const char* ptr, :: #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_ChartDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_ChartDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 colspan = 1; if (this->_internal_colspan() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_colspan(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_colspan(), target); } // int32 rowspan = 2; if (this->_internal_rowspan() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_rowspan(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_rowspan(), target); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor series = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_series_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_series_size()); i < n; i++) { + const auto& repfield = this->_internal_series(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_series(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor multi_series = 4; - for (unsigned int i = 0, - n = static_cast(this->_internal_multi_series_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_multi_series_size()); i < n; i++) { + const auto& repfield = this->_internal_multi_series(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, this->_internal_multi_series(i), target, stream); + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor axes = 5; - for (unsigned int i = 0, - n = static_cast(this->_internal_axes_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_axes_size()); i < n; i++) { + const auto& repfield = this->_internal_axes(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, this->_internal_axes(i), target, stream); + InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType chart_type = 6; if (this->_internal_chart_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 6, this->_internal_chart_type(), target); } @@ -8894,7 +8837,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_ChartDescriptor::_InternalSeria // bool show_legend = 10; if (this->_internal_show_legend() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_show_legend(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_show_legend(), target); } // string legend_font = 11; @@ -8920,11 +8863,11 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_ChartDescriptor::_InternalSeria // bool is3d = 13; if (this->_internal_is3d() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_is3d(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_is3d(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) @@ -8935,7 +8878,7 @@ size_t FigureDescriptor_ChartDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8998,18 +8941,18 @@ size_t FigureDescriptor_ChartDescriptor::ByteSizeLong() const { // int32 colspan = 1; if (this->_internal_colspan() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_colspan()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_colspan()); } // int32 rowspan = 2; if (this->_internal_rowspan() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_rowspan()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_rowspan()); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType chart_type = 6; if (this->_internal_chart_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_chart_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_chart_type()); } // bool show_legend = 10; @@ -9041,7 +8984,7 @@ void FigureDescriptor_ChartDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Messag void FigureDescriptor_ChartDescriptor::MergeFrom(const FigureDescriptor_ChartDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; series_.MergeFrom(from.series_); @@ -9101,27 +9044,22 @@ void FigureDescriptor_ChartDescriptor::InternalSwap(FigureDescriptor_ChartDescri multi_series_.InternalSwap(&other->multi_series_); axes_.InternalSwap(&other->axes_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_, lhs_arena, &other->title_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_font_, lhs_arena, &other->title_font_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_color_, lhs_arena, &other->title_color_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &legend_font_, lhs_arena, &other->legend_font_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &legend_color_, lhs_arena, &other->legend_color_, rhs_arena ); @@ -9134,7 +9072,7 @@ void FigureDescriptor_ChartDescriptor::InternalSwap(FigureDescriptor_ChartDescri } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_ChartDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[28]); } @@ -9169,9 +9107,6 @@ FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor(::PROTOBUF_ : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), data_sources_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) } FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor(const FigureDescriptor_SeriesDescriptor& from) @@ -9179,44 +9114,68 @@ FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor(const Figur _has_bits_(from._has_bits_), data_sources_(from.data_sources_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), + name_.Set(from._internal_name(), GetArenaForAllocation()); } - line_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + line_color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + line_color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_line_color().empty()) { - line_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_line_color(), + line_color_.Set(from._internal_line_color(), GetArenaForAllocation()); } - point_label_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + point_label_format_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + point_label_format_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_point_label_format()) { - point_label_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_point_label_format(), + point_label_format_.Set(from._internal_point_label_format(), GetArenaForAllocation()); } - x_tool_tip_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + x_tool_tip_pattern_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + x_tool_tip_pattern_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_x_tool_tip_pattern()) { - x_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_x_tool_tip_pattern(), + x_tool_tip_pattern_.Set(from._internal_x_tool_tip_pattern(), GetArenaForAllocation()); } - y_tool_tip_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + y_tool_tip_pattern_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + y_tool_tip_pattern_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_y_tool_tip_pattern()) { - y_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_y_tool_tip_pattern(), + y_tool_tip_pattern_.Set(from._internal_y_tool_tip_pattern(), GetArenaForAllocation()); } - shape_label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + shape_label_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_label_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_shape_label().empty()) { - shape_label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_shape_label(), + shape_label_.Set(from._internal_shape_label(), GetArenaForAllocation()); } - shape_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + shape_color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_shape_color().empty()) { - shape_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_shape_color(), + shape_color_.Set(from._internal_shape_color(), GetArenaForAllocation()); } - shape_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + shape_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_shape().empty()) { - shape_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_shape(), + shape_.Set(from._internal_shape(), GetArenaForAllocation()); } ::memcpy(&plot_style_, &from.plot_style_, @@ -9225,15 +9184,39 @@ FigureDescriptor_SeriesDescriptor::FigureDescriptor_SeriesDescriptor(const Figur // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) } -void FigureDescriptor_SeriesDescriptor::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -line_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -point_label_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -x_tool_tip_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -y_tool_tip_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -shape_label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -shape_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -shape_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_SeriesDescriptor::SharedCtor() { +name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +line_color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + line_color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +point_label_format_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + point_label_format_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +x_tool_tip_pattern_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + x_tool_tip_pattern_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +y_tool_tip_pattern_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + y_tool_tip_pattern_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +shape_label_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_label_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +shape_color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +shape_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + shape_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&plot_style_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&shape_size_) - @@ -9242,36 +9225,32 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor_SeriesDescriptor::~FigureDescriptor_SeriesDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_SeriesDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - line_color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - point_label_format_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - x_tool_tip_pattern_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - y_tool_tip_pattern_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - shape_label_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - shape_color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - shape_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.Destroy(); + line_color_.Destroy(); + point_label_format_.Destroy(); + x_tool_tip_pattern_.Destroy(); + y_tool_tip_pattern_.Destroy(); + shape_label_.Destroy(); + shape_color_.Destroy(); + shape_.Destroy(); } -void FigureDescriptor_SeriesDescriptor::ArenaDtor(void* object) { - FigureDescriptor_SeriesDescriptor* _this = reinterpret_cast< FigureDescriptor_SeriesDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_SeriesDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_SeriesDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_SeriesDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9305,17 +9284,17 @@ void FigureDescriptor_SeriesDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_plot_style(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesPlotStyle>(val)); } else @@ -9323,17 +9302,17 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : continue; // string name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name")); } else goto handle_unusual; continue; // optional bool lines_visible = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { _Internal::set_has_lines_visible(&has_bits); lines_visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); @@ -9342,7 +9321,7 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : continue; // optional bool shapes_visible = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { _Internal::set_has_shapes_visible(&has_bits); shapes_visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); @@ -9351,7 +9330,7 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : continue; // bool gradient_visible = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { gradient_visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -9359,57 +9338,57 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : continue; // string line_color = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { auto str = _internal_mutable_line_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color")); } else goto handle_unusual; continue; // optional string point_label_format = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { auto str = _internal_mutable_point_label_format(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format")); } else goto handle_unusual; continue; // optional string x_tool_tip_pattern = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { auto str = _internal_mutable_x_tool_tip_pattern(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern")); } else goto handle_unusual; continue; // optional string y_tool_tip_pattern = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { auto str = _internal_mutable_y_tool_tip_pattern(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern")); } else goto handle_unusual; continue; // string shape_label = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { auto str = _internal_mutable_shape_label(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label")); } else goto handle_unusual; continue; // optional double shape_size = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 97)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 97)) { _Internal::set_has_shape_size(&has_bits); shape_size_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); @@ -9418,27 +9397,27 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : continue; // string shape_color = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { auto str = _internal_mutable_shape_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color")); } else goto handle_unusual; continue; // string shape = 14; case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 114)) { auto str = _internal_mutable_shape(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape")); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor data_sources = 15; case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 122)) { ptr -= 1; do { ptr += 1; @@ -9473,16 +9452,16 @@ const char* FigureDescriptor_SeriesDescriptor::_InternalParse(const char* ptr, : #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SeriesDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_SeriesDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; if (this->_internal_plot_style() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_plot_style(), target); } @@ -9499,19 +9478,19 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SeriesDescriptor::_InternalSeri // optional bool lines_visible = 3; if (_internal_has_lines_visible()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_lines_visible(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_lines_visible(), target); } // optional bool shapes_visible = 4; if (_internal_has_shapes_visible()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_shapes_visible(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_shapes_visible(), target); } // bool gradient_visible = 5; if (this->_internal_gradient_visible() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_gradient_visible(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_gradient_visible(), target); } // string line_color = 6; @@ -9567,7 +9546,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SeriesDescriptor::_InternalSeri // optional double shape_size = 12; if (_internal_has_shape_size()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(12, this->_internal_shape_size(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(12, this->_internal_shape_size(), target); } // string shape_color = 13; @@ -9591,15 +9570,15 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SeriesDescriptor::_InternalSeri } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor data_sources = 15; - for (unsigned int i = 0, - n = static_cast(this->_internal_data_sources_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_data_sources_size()); i < n; i++) { + const auto& repfield = this->_internal_data_sources(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(15, this->_internal_data_sources(i), target, stream); + InternalWriteMessage(15, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) @@ -9610,7 +9589,7 @@ size_t FigureDescriptor_SeriesDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9683,7 +9662,7 @@ size_t FigureDescriptor_SeriesDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; if (this->_internal_plot_style() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_plot_style()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_plot_style()); } if (cached_has_bits & 0x00000018u) { @@ -9727,7 +9706,7 @@ void FigureDescriptor_SeriesDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Messa void FigureDescriptor_SeriesDescriptor::MergeFrom(const FigureDescriptor_SeriesDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; data_sources_.MergeFrom(from.data_sources_); @@ -9798,42 +9777,34 @@ void FigureDescriptor_SeriesDescriptor::InternalSwap(FigureDescriptor_SeriesDesc swap(_has_bits_[0], other->_has_bits_[0]); data_sources_.InternalSwap(&other->data_sources_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &name_, lhs_arena, &other->name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &line_color_, lhs_arena, &other->line_color_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &point_label_format_, lhs_arena, &other->point_label_format_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &x_tool_tip_pattern_, lhs_arena, &other->x_tool_tip_pattern_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &y_tool_tip_pattern_, lhs_arena, &other->y_tool_tip_pattern_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &shape_label_, lhs_arena, &other->shape_label_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &shape_color_, lhs_arena, &other->shape_color_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &shape_, lhs_arena, &other->shape_, rhs_arena ); @@ -9846,7 +9817,7 @@ void FigureDescriptor_SeriesDescriptor::InternalSwap(FigureDescriptor_SeriesDesc } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_SeriesDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[29]); } @@ -9917,18 +9888,18 @@ FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDescriptor(: : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), data_sources_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) } FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDescriptor(const FigureDescriptor_MultiSeriesDescriptor& from) : ::PROTOBUF_NAMESPACE_ID::Message(), data_sources_(from.data_sources_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), + name_.Set(from._internal_name(), GetArenaForAllocation()); } if (from._internal_has_line_color()) { @@ -9990,8 +9961,11 @@ FigureDescriptor_MultiSeriesDescriptor::FigureDescriptor_MultiSeriesDescriptor(c // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) } -void FigureDescriptor_MultiSeriesDescriptor::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_MultiSeriesDescriptor::SharedCtor() { +name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&line_color_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&plot_style_) - @@ -10000,14 +9974,16 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor_MultiSeriesDescriptor::~FigureDescriptor_MultiSeriesDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_MultiSeriesDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.Destroy(); if (this != internal_default_instance()) delete line_color_; if (this != internal_default_instance()) delete point_color_; if (this != internal_default_instance()) delete lines_visible_; @@ -10021,19 +9997,13 @@ inline void FigureDescriptor_MultiSeriesDescriptor::SharedDtor() { if (this != internal_default_instance()) delete point_shape_; } -void FigureDescriptor_MultiSeriesDescriptor::ArenaDtor(void* object) { - FigureDescriptor_MultiSeriesDescriptor* _this = reinterpret_cast< FigureDescriptor_MultiSeriesDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_MultiSeriesDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_MultiSeriesDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_MultiSeriesDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10087,16 +10057,16 @@ void FigureDescriptor_MultiSeriesDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_plot_style(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesPlotStyle>(val)); } else @@ -10104,17 +10074,17 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // string name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault line_color = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_line_color(), ptr); CHK_(ptr); } else @@ -10122,7 +10092,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_color = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_point_color(), ptr); CHK_(ptr); } else @@ -10130,7 +10100,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault lines_visible = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr = ctx->ParseMessage(_internal_mutable_lines_visible(), ptr); CHK_(ptr); } else @@ -10138,7 +10108,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault points_visible = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { ptr = ctx->ParseMessage(_internal_mutable_points_visible(), ptr); CHK_(ptr); } else @@ -10146,7 +10116,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault gradient_visible = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { ptr = ctx->ParseMessage(_internal_mutable_gradient_visible(), ptr); CHK_(ptr); } else @@ -10154,7 +10124,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_label_format = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { ptr = ctx->ParseMessage(_internal_mutable_point_label_format(), ptr); CHK_(ptr); } else @@ -10162,7 +10132,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault x_tool_tip_pattern = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { ptr = ctx->ParseMessage(_internal_mutable_x_tool_tip_pattern(), ptr); CHK_(ptr); } else @@ -10170,7 +10140,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault y_tool_tip_pattern = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { ptr = ctx->ParseMessage(_internal_mutable_y_tool_tip_pattern(), ptr); CHK_(ptr); } else @@ -10178,7 +10148,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_label = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { ptr = ctx->ParseMessage(_internal_mutable_point_label(), ptr); CHK_(ptr); } else @@ -10186,7 +10156,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault point_size = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { ptr = ctx->ParseMessage(_internal_mutable_point_size(), ptr); CHK_(ptr); } else @@ -10194,7 +10164,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_shape = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { ptr = ctx->ParseMessage(_internal_mutable_point_shape(), ptr); CHK_(ptr); } else @@ -10202,7 +10172,7 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor data_sources = 14; case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 114)) { ptr -= 1; do { ptr += 1; @@ -10236,16 +10206,16 @@ const char* FigureDescriptor_MultiSeriesDescriptor::_InternalParse(const char* p #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_MultiSeriesDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_MultiSeriesDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; if (this->_internal_plot_style() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_plot_style(), target); } @@ -10261,102 +10231,91 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_MultiSeriesDescriptor::_Interna // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault line_color = 3; if (this->_internal_has_line_color()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::line_color(this), target, stream); + InternalWriteMessage(3, _Internal::line_color(this), + _Internal::line_color(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_color = 4; if (this->_internal_has_point_color()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::point_color(this), target, stream); + InternalWriteMessage(4, _Internal::point_color(this), + _Internal::point_color(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault lines_visible = 5; if (this->_internal_has_lines_visible()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 5, _Internal::lines_visible(this), target, stream); + InternalWriteMessage(5, _Internal::lines_visible(this), + _Internal::lines_visible(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault points_visible = 6; if (this->_internal_has_points_visible()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 6, _Internal::points_visible(this), target, stream); + InternalWriteMessage(6, _Internal::points_visible(this), + _Internal::points_visible(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault gradient_visible = 7; if (this->_internal_has_gradient_visible()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 7, _Internal::gradient_visible(this), target, stream); + InternalWriteMessage(7, _Internal::gradient_visible(this), + _Internal::gradient_visible(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_label_format = 8; if (this->_internal_has_point_label_format()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 8, _Internal::point_label_format(this), target, stream); + InternalWriteMessage(8, _Internal::point_label_format(this), + _Internal::point_label_format(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault x_tool_tip_pattern = 9; if (this->_internal_has_x_tool_tip_pattern()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 9, _Internal::x_tool_tip_pattern(this), target, stream); + InternalWriteMessage(9, _Internal::x_tool_tip_pattern(this), + _Internal::x_tool_tip_pattern(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault y_tool_tip_pattern = 10; if (this->_internal_has_y_tool_tip_pattern()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 10, _Internal::y_tool_tip_pattern(this), target, stream); + InternalWriteMessage(10, _Internal::y_tool_tip_pattern(this), + _Internal::y_tool_tip_pattern(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_label = 11; if (this->_internal_has_point_label()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 11, _Internal::point_label(this), target, stream); + InternalWriteMessage(11, _Internal::point_label(this), + _Internal::point_label(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault point_size = 12; if (this->_internal_has_point_size()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 12, _Internal::point_size(this), target, stream); + InternalWriteMessage(12, _Internal::point_size(this), + _Internal::point_size(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault point_shape = 13; if (this->_internal_has_point_shape()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 13, _Internal::point_shape(this), target, stream); + InternalWriteMessage(13, _Internal::point_shape(this), + _Internal::point_shape(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor data_sources = 14; - for (unsigned int i = 0, - n = static_cast(this->_internal_data_sources_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_data_sources_size()); i < n; i++) { + const auto& repfield = this->_internal_data_sources(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(14, this->_internal_data_sources(i), target, stream); + InternalWriteMessage(14, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) @@ -10367,7 +10326,7 @@ size_t FigureDescriptor_MultiSeriesDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10465,7 +10424,7 @@ size_t FigureDescriptor_MultiSeriesDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle plot_style = 1; if (this->_internal_plot_style() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_plot_style()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_plot_style()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -10487,7 +10446,7 @@ void FigureDescriptor_MultiSeriesDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID:: void FigureDescriptor_MultiSeriesDescriptor::MergeFrom(const FigureDescriptor_MultiSeriesDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; data_sources_.MergeFrom(from.data_sources_); @@ -10551,7 +10510,6 @@ void FigureDescriptor_MultiSeriesDescriptor::InternalSwap(FigureDescriptor_Multi _internal_metadata_.InternalSwap(&other->_internal_metadata_); data_sources_.InternalSwap(&other->data_sources_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &name_, lhs_arena, &other->name_, rhs_arena ); @@ -10564,7 +10522,7 @@ void FigureDescriptor_MultiSeriesDescriptor::InternalSwap(FigureDescriptor_Multi } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_MultiSeriesDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[30]); } @@ -10573,6 +10531,10 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_MultiSeriesDescriptor::GetMet class FigureDescriptor_StringMapWithDefault::_Internal { public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_default_string(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; FigureDescriptor_StringMapWithDefault::FigureDescriptor_StringMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, @@ -10581,88 +10543,93 @@ FigureDescriptor_StringMapWithDefault::FigureDescriptor_StringMapWithDefault(::P keys_(arena), values_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) } FigureDescriptor_StringMapWithDefault::FigureDescriptor_StringMapWithDefault(const FigureDescriptor_StringMapWithDefault& from) : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_), keys_(from.keys_), values_(from.values_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - default_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_default_string().empty()) { - default_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_default_string(), + default_string_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + default_string_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_default_string()) { + default_string_.Set(from._internal_default_string(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) } -void FigureDescriptor_StringMapWithDefault::SharedCtor() { -default_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_StringMapWithDefault::SharedCtor() { +default_string_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + default_string_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } FigureDescriptor_StringMapWithDefault::~FigureDescriptor_StringMapWithDefault() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_StringMapWithDefault::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - default_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + default_string_.Destroy(); } -void FigureDescriptor_StringMapWithDefault::ArenaDtor(void* object) { - FigureDescriptor_StringMapWithDefault* _this = reinterpret_cast< FigureDescriptor_StringMapWithDefault* >(object); - (void)_this; -} -void FigureDescriptor_StringMapWithDefault::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_StringMapWithDefault::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_StringMapWithDefault::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; keys_.Clear(); values_.Clear(); - default_string_.ClearToEmpty(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + default_string_.ClearNonDefaultToEmpty(); + } + _has_bits_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_StringMapWithDefault::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_StringMapWithDefault::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // string default_string = 1; + // optional string default_string = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_default_string(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string")); } else goto handle_unusual; continue; // repeated string keys = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_keys(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.keys")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.keys")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -10670,14 +10637,14 @@ const char* FigureDescriptor_StringMapWithDefault::_InternalParse(const char* pt continue; // repeated string values = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_values(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.values")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.values")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -10699,6 +10666,7 @@ const char* FigureDescriptor_StringMapWithDefault::_InternalParse(const char* pt CHK_(ptr != nullptr); } // while message_done: + _has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -10706,14 +10674,14 @@ const char* FigureDescriptor_StringMapWithDefault::_InternalParse(const char* pt #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_StringMapWithDefault::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_StringMapWithDefault::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; - // string default_string = 1; - if (!this->_internal_default_string().empty()) { + // optional string default_string = 1; + if (_internal_has_default_string()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_default_string().data(), static_cast(this->_internal_default_string().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -10743,7 +10711,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_StringMapWithDefault::_Internal } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) @@ -10754,7 +10722,7 @@ size_t FigureDescriptor_StringMapWithDefault::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10774,8 +10742,9 @@ size_t FigureDescriptor_StringMapWithDefault::ByteSizeLong() const { values_.Get(i)); } - // string default_string = 1; - if (!this->_internal_default_string().empty()) { + // optional string default_string = 1; + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_default_string()); @@ -10800,12 +10769,12 @@ void FigureDescriptor_StringMapWithDefault::MergeImpl(::PROTOBUF_NAMESPACE_ID::M void FigureDescriptor_StringMapWithDefault::MergeFrom(const FigureDescriptor_StringMapWithDefault& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; keys_.MergeFrom(from.keys_); values_.MergeFrom(from.values_); - if (!from._internal_default_string().empty()) { + if (from._internal_has_default_string()) { _internal_set_default_string(from._internal_default_string()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -10827,17 +10796,17 @@ void FigureDescriptor_StringMapWithDefault::InternalSwap(FigureDescriptor_String auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); keys_.InternalSwap(&other->keys_); values_.InternalSwap(&other->values_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &default_string_, lhs_arena, &other->default_string_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_StringMapWithDefault::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[31]); } @@ -10846,6 +10815,10 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_StringMapWithDefault::GetMeta class FigureDescriptor_DoubleMapWithDefault::_Internal { public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_default_double(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, @@ -10854,13 +10827,11 @@ FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault(::P keys_(arena), values_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) } FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault(const FigureDescriptor_DoubleMapWithDefault& from) : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_), keys_(from.keys_), values_(from.values_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -10868,52 +10839,51 @@ FigureDescriptor_DoubleMapWithDefault::FigureDescriptor_DoubleMapWithDefault(con // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) } -void FigureDescriptor_DoubleMapWithDefault::SharedCtor() { +inline void FigureDescriptor_DoubleMapWithDefault::SharedCtor() { default_double_ = 0; } FigureDescriptor_DoubleMapWithDefault::~FigureDescriptor_DoubleMapWithDefault() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_DoubleMapWithDefault::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void FigureDescriptor_DoubleMapWithDefault::ArenaDtor(void* object) { - FigureDescriptor_DoubleMapWithDefault* _this = reinterpret_cast< FigureDescriptor_DoubleMapWithDefault* >(object); - (void)_this; -} -void FigureDescriptor_DoubleMapWithDefault::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_DoubleMapWithDefault::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_DoubleMapWithDefault::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; keys_.Clear(); values_.Clear(); default_double_ = 0; + _has_bits_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // double default_double = 1; + // optional double default_double = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 9)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 9)) { + _Internal::set_has_default_double(&has_bits); default_double_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); } else @@ -10921,14 +10891,14 @@ const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* pt continue; // repeated string keys = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_keys(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault.keys")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault.keys")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -10936,10 +10906,10 @@ const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* pt continue; // repeated double values = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_values(), ptr, ctx); CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25) { + } else if (static_cast(tag) == 25) { _internal_add_values(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); ptr += sizeof(double); } else @@ -10961,6 +10931,7 @@ const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* pt CHK_(ptr != nullptr); } // while message_done: + _has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -10968,16 +10939,16 @@ const char* FigureDescriptor_DoubleMapWithDefault::_InternalParse(const char* pt #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_DoubleMapWithDefault::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_DoubleMapWithDefault::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; - // double default_double = 1; - if (!(this->_internal_default_double() <= 0 && this->_internal_default_double() >= 0)) { + // optional double default_double = 1; + if (_internal_has_default_double()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(1, this->_internal_default_double(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(1, this->_internal_default_double(), target); } // repeated string keys = 2; @@ -10996,7 +10967,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_DoubleMapWithDefault::_Internal } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) @@ -11007,7 +10978,7 @@ size_t FigureDescriptor_DoubleMapWithDefault::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11025,14 +10996,14 @@ size_t FigureDescriptor_DoubleMapWithDefault::ByteSizeLong() const { size_t data_size = 8UL * count; if (data_size > 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); } total_size += data_size; } - // double default_double = 1; - if (!(this->_internal_default_double() <= 0 && this->_internal_default_double() >= 0)) { + // optional double default_double = 1; + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + 8; } @@ -11055,12 +11026,12 @@ void FigureDescriptor_DoubleMapWithDefault::MergeImpl(::PROTOBUF_NAMESPACE_ID::M void FigureDescriptor_DoubleMapWithDefault::MergeFrom(const FigureDescriptor_DoubleMapWithDefault& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; keys_.MergeFrom(from.keys_); values_.MergeFrom(from.values_); - if (!(from._internal_default_double() <= 0 && from._internal_default_double() >= 0)) { + if (from._internal_has_default_double()) { _internal_set_default_double(from._internal_default_double()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -11080,13 +11051,14 @@ bool FigureDescriptor_DoubleMapWithDefault::IsInitialized() const { void FigureDescriptor_DoubleMapWithDefault::InternalSwap(FigureDescriptor_DoubleMapWithDefault* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); keys_.InternalSwap(&other->keys_); values_.InternalSwap(&other->values_); swap(default_double_, other->default_double_); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_DoubleMapWithDefault::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[32]); } @@ -11095,6 +11067,10 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_DoubleMapWithDefault::GetMeta class FigureDescriptor_BoolMapWithDefault::_Internal { public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_default_bool(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, @@ -11103,13 +11079,11 @@ FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault(::PROTO keys_(arena), values_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) } FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault(const FigureDescriptor_BoolMapWithDefault& from) : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_), keys_(from.keys_), values_(from.values_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -11117,52 +11091,51 @@ FigureDescriptor_BoolMapWithDefault::FigureDescriptor_BoolMapWithDefault(const F // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) } -void FigureDescriptor_BoolMapWithDefault::SharedCtor() { +inline void FigureDescriptor_BoolMapWithDefault::SharedCtor() { default_bool_ = false; } FigureDescriptor_BoolMapWithDefault::~FigureDescriptor_BoolMapWithDefault() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_BoolMapWithDefault::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void FigureDescriptor_BoolMapWithDefault::ArenaDtor(void* object) { - FigureDescriptor_BoolMapWithDefault* _this = reinterpret_cast< FigureDescriptor_BoolMapWithDefault* >(object); - (void)_this; -} -void FigureDescriptor_BoolMapWithDefault::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_BoolMapWithDefault::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_BoolMapWithDefault::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; keys_.Clear(); values_.Clear(); default_bool_ = false; + _has_bits_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // bool default_bool = 1; + // optional bool default_bool = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_default_bool(&has_bits); default_bool_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11170,14 +11143,14 @@ const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, continue; // repeated string keys = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_keys(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault.keys")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault.keys")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -11185,10 +11158,10 @@ const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, continue; // repeated bool values = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_values(), ptr, ctx); CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { + } else if (static_cast(tag) == 24) { _internal_add_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); CHK_(ptr); } else @@ -11210,6 +11183,7 @@ const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, CHK_(ptr != nullptr); } // while message_done: + _has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -11217,16 +11191,16 @@ const char* FigureDescriptor_BoolMapWithDefault::_InternalParse(const char* ptr, #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BoolMapWithDefault::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_BoolMapWithDefault::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; - // bool default_bool = 1; - if (this->_internal_default_bool() != 0) { + // optional bool default_bool = 1; + if (_internal_has_default_bool()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_default_bool(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_default_bool(), target); } // repeated string keys = 2; @@ -11245,7 +11219,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BoolMapWithDefault::_InternalSe } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) @@ -11256,7 +11230,7 @@ size_t FigureDescriptor_BoolMapWithDefault::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11274,14 +11248,14 @@ size_t FigureDescriptor_BoolMapWithDefault::ByteSizeLong() const { size_t data_size = 1UL * count; if (data_size > 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); } total_size += data_size; } - // bool default_bool = 1; - if (this->_internal_default_bool() != 0) { + // optional bool default_bool = 1; + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + 1; } @@ -11304,12 +11278,12 @@ void FigureDescriptor_BoolMapWithDefault::MergeImpl(::PROTOBUF_NAMESPACE_ID::Mes void FigureDescriptor_BoolMapWithDefault::MergeFrom(const FigureDescriptor_BoolMapWithDefault& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; keys_.MergeFrom(from.keys_); values_.MergeFrom(from.values_); - if (from._internal_default_bool() != 0) { + if (from._internal_has_default_bool()) { _internal_set_default_bool(from._internal_default_bool()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -11329,13 +11303,14 @@ bool FigureDescriptor_BoolMapWithDefault::IsInitialized() const { void FigureDescriptor_BoolMapWithDefault::InternalSwap(FigureDescriptor_BoolMapWithDefault* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); keys_.InternalSwap(&other->keys_); values_.InternalSwap(&other->values_); swap(default_bool_, other->default_bool_); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_BoolMapWithDefault::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[33]); } @@ -11363,9 +11338,6 @@ FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor(::PROTOBUF_NAME : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), major_tick_locations_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) } FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor(const FigureDescriptor_AxisDescriptor& from) @@ -11373,34 +11345,52 @@ FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor(const FigureDes _has_bits_(from._has_bits_), major_tick_locations_(from.major_tick_locations_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + id_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + id_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_id().empty()) { - id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_id(), + id_.Set(from._internal_id(), GetArenaForAllocation()); } - label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + label_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_label().empty()) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label(), + label_.Set(from._internal_label(), GetArenaForAllocation()); } - label_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + label_font_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_font_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_label_font().empty()) { - label_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label_font(), + label_font_.Set(from._internal_label_font(), GetArenaForAllocation()); } - ticks_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ticks_font_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + ticks_font_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_ticks_font().empty()) { - ticks_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ticks_font(), + ticks_font_.Set(from._internal_ticks_font(), GetArenaForAllocation()); } - format_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + format_pattern_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + format_pattern_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_format_pattern()) { - format_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_format_pattern(), + format_pattern_.Set(from._internal_format_pattern(), GetArenaForAllocation()); } - color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_color().empty()) { - color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_color(), + color_.Set(from._internal_color(), GetArenaForAllocation()); } if (from._internal_has_business_calendar_descriptor()) { @@ -11414,13 +11404,31 @@ FigureDescriptor_AxisDescriptor::FigureDescriptor_AxisDescriptor(const FigureDes // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) } -void FigureDescriptor_AxisDescriptor::SharedCtor() { -id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -label_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -ticks_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -format_pattern_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_AxisDescriptor::SharedCtor() { +id_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + id_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +label_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +label_font_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + label_font_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +ticks_font_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + ticks_font_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +format_pattern_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + format_pattern_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&business_calendar_descriptor_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&tick_label_angle_) - @@ -11429,35 +11437,31 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor_AxisDescriptor::~FigureDescriptor_AxisDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_AxisDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - label_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - label_font_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ticks_font_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - format_pattern_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + id_.Destroy(); + label_.Destroy(); + label_font_.Destroy(); + ticks_font_.Destroy(); + format_pattern_.Destroy(); + color_.Destroy(); if (this != internal_default_instance()) delete business_calendar_descriptor_; } -void FigureDescriptor_AxisDescriptor::ArenaDtor(void* object) { - FigureDescriptor_AxisDescriptor* _this = reinterpret_cast< FigureDescriptor_AxisDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_AxisDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_AxisDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_AxisDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11486,27 +11490,27 @@ void FigureDescriptor_AxisDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_id(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType format_type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_format_type(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor_AxisFormatType>(val)); } else @@ -11514,8 +11518,8 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType type = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_type(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor_AxisType>(val)); } else @@ -11523,8 +11527,8 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition position = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_position(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor_AxisPosition>(val)); } else @@ -11532,7 +11536,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // bool log = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { log_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11540,57 +11544,57 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // string label = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { auto str = _internal_mutable_label(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label")); } else goto handle_unusual; continue; // string label_font = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { auto str = _internal_mutable_label_font(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font")); } else goto handle_unusual; continue; // string ticks_font = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { auto str = _internal_mutable_ticks_font(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font")); } else goto handle_unusual; continue; // optional string format_pattern = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { auto str = _internal_mutable_format_pattern(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern")); } else goto handle_unusual; continue; // string color = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { auto str = _internal_mutable_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color")); } else goto handle_unusual; continue; // double min_range = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 89)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 89)) { min_range_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); } else @@ -11598,7 +11602,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // double max_range = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 97)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 97)) { max_range_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); } else @@ -11606,7 +11610,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // bool minor_ticks_visible = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 104)) { minor_ticks_visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11614,7 +11618,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // bool major_ticks_visible = 14; case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 112)) { major_ticks_visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11622,15 +11626,15 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // int32 minor_tick_count = 15; case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) { - minor_tick_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 120)) { + minor_tick_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // optional double gap_between_major_ticks = 16; case 16: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 129)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 129)) { _Internal::set_has_gap_between_major_ticks(&has_bits); gap_between_major_ticks_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); @@ -11639,10 +11643,10 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // repeated double major_tick_locations = 17; case 17: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 138)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_major_tick_locations(), ptr, ctx); CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 137) { + } else if (static_cast(tag) == 137) { _internal_add_major_tick_locations(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); ptr += sizeof(double); } else @@ -11650,7 +11654,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // double tick_label_angle = 18; case 18: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 145)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 145)) { tick_label_angle_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); } else @@ -11658,7 +11662,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // bool invert = 19; case 19: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 152)) { invert_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11666,7 +11670,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // bool is_time_axis = 20; case 20: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 160)) { is_time_axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -11674,7 +11678,7 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor business_calendar_descriptor = 21; case 21: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 170)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 170)) { ptr = ctx->ParseMessage(_internal_mutable_business_calendar_descriptor(), ptr); CHK_(ptr); } else @@ -11704,10 +11708,10 @@ const char* FigureDescriptor_AxisDescriptor::_InternalParse(const char* ptr, ::P #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_AxisDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_AxisDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string id = 1; @@ -11723,28 +11727,28 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_AxisDescriptor::_InternalSerial // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType format_type = 2; if (this->_internal_format_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 2, this->_internal_format_type(), target); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType type = 3; if (this->_internal_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_type(), target); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition position = 4; if (this->_internal_position() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 4, this->_internal_position(), target); } // bool log = 5; if (this->_internal_log() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_log(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_log(), target); } // string label = 6; @@ -11798,39 +11802,47 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_AxisDescriptor::_InternalSerial } // double min_range = 11; - if (!(this->_internal_min_range() <= 0 && this->_internal_min_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_min_range = this->_internal_min_range(); + uint64_t raw_min_range; + memcpy(&raw_min_range, &tmp_min_range, sizeof(tmp_min_range)); + if (raw_min_range != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(11, this->_internal_min_range(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(11, this->_internal_min_range(), target); } // double max_range = 12; - if (!(this->_internal_max_range() <= 0 && this->_internal_max_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_max_range = this->_internal_max_range(); + uint64_t raw_max_range; + memcpy(&raw_max_range, &tmp_max_range, sizeof(tmp_max_range)); + if (raw_max_range != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(12, this->_internal_max_range(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(12, this->_internal_max_range(), target); } // bool minor_ticks_visible = 13; if (this->_internal_minor_ticks_visible() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_minor_ticks_visible(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_minor_ticks_visible(), target); } // bool major_ticks_visible = 14; if (this->_internal_major_ticks_visible() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(14, this->_internal_major_ticks_visible(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(14, this->_internal_major_ticks_visible(), target); } // int32 minor_tick_count = 15; if (this->_internal_minor_tick_count() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(15, this->_internal_minor_tick_count(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(15, this->_internal_minor_tick_count(), target); } // optional double gap_between_major_ticks = 16; if (_internal_has_gap_between_major_ticks()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(16, this->_internal_gap_between_major_ticks(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(16, this->_internal_gap_between_major_ticks(), target); } // repeated double major_tick_locations = 17; @@ -11839,33 +11851,36 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_AxisDescriptor::_InternalSerial } // double tick_label_angle = 18; - if (!(this->_internal_tick_label_angle() <= 0 && this->_internal_tick_label_angle() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_tick_label_angle = this->_internal_tick_label_angle(); + uint64_t raw_tick_label_angle; + memcpy(&raw_tick_label_angle, &tmp_tick_label_angle, sizeof(tmp_tick_label_angle)); + if (raw_tick_label_angle != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(18, this->_internal_tick_label_angle(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(18, this->_internal_tick_label_angle(), target); } // bool invert = 19; if (this->_internal_invert() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->_internal_invert(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(19, this->_internal_invert(), target); } // bool is_time_axis = 20; if (this->_internal_is_time_axis() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(20, this->_internal_is_time_axis(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(20, this->_internal_is_time_axis(), target); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor business_calendar_descriptor = 21; if (this->_internal_has_business_calendar_descriptor()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 21, _Internal::business_calendar_descriptor(this), target, stream); + InternalWriteMessage(21, _Internal::business_calendar_descriptor(this), + _Internal::business_calendar_descriptor(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) @@ -11876,7 +11891,7 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11886,8 +11901,7 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { size_t data_size = 8UL * count; if (data_size > 0) { total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); } total_size += data_size; } @@ -11945,24 +11959,28 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType format_type = 2; if (this->_internal_format_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_format_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_format_type()); } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType type = 3; if (this->_internal_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } // double min_range = 11; - if (!(this->_internal_min_range() <= 0 && this->_internal_min_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_min_range = this->_internal_min_range(); + uint64_t raw_min_range; + memcpy(&raw_min_range, &tmp_min_range, sizeof(tmp_min_range)); + if (raw_min_range != 0) { total_size += 1 + 8; } // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition position = 4; if (this->_internal_position() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_position()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_position()); } // bool log = 5; @@ -11986,7 +12004,11 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { } // double max_range = 12; - if (!(this->_internal_max_range() <= 0 && this->_internal_max_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_max_range = this->_internal_max_range(); + uint64_t raw_max_range; + memcpy(&raw_max_range, &tmp_max_range, sizeof(tmp_max_range)); + if (raw_max_range != 0) { total_size += 1 + 8; } @@ -11997,7 +12019,7 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { // int32 minor_tick_count = 15; if (this->_internal_minor_tick_count() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_minor_tick_count()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_minor_tick_count()); } // bool is_time_axis = 20; @@ -12006,7 +12028,11 @@ size_t FigureDescriptor_AxisDescriptor::ByteSizeLong() const { } // double tick_label_angle = 18; - if (!(this->_internal_tick_label_angle() <= 0 && this->_internal_tick_label_angle() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_tick_label_angle = this->_internal_tick_label_angle(); + uint64_t raw_tick_label_angle; + memcpy(&raw_tick_label_angle, &tmp_tick_label_angle, sizeof(tmp_tick_label_angle)); + if (raw_tick_label_angle != 0) { total_size += 2 + 8; } @@ -12029,7 +12055,7 @@ void FigureDescriptor_AxisDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message void FigureDescriptor_AxisDescriptor::MergeFrom(const FigureDescriptor_AxisDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; major_tick_locations_.MergeFrom(from.major_tick_locations_); @@ -12060,7 +12086,11 @@ void FigureDescriptor_AxisDescriptor::MergeFrom(const FigureDescriptor_AxisDescr if (from._internal_type() != 0) { _internal_set_type(from._internal_type()); } - if (!(from._internal_min_range() <= 0 && from._internal_min_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_min_range = from._internal_min_range(); + uint64_t raw_min_range; + memcpy(&raw_min_range, &tmp_min_range, sizeof(tmp_min_range)); + if (raw_min_range != 0) { _internal_set_min_range(from._internal_min_range()); } if (from._internal_position() != 0) { @@ -12078,7 +12108,11 @@ void FigureDescriptor_AxisDescriptor::MergeFrom(const FigureDescriptor_AxisDescr if (from._internal_invert() != 0) { _internal_set_invert(from._internal_invert()); } - if (!(from._internal_max_range() <= 0 && from._internal_max_range() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_max_range = from._internal_max_range(); + uint64_t raw_max_range; + memcpy(&raw_max_range, &tmp_max_range, sizeof(tmp_max_range)); + if (raw_max_range != 0) { _internal_set_max_range(from._internal_max_range()); } if (from._internal_has_gap_between_major_ticks()) { @@ -12090,7 +12124,11 @@ void FigureDescriptor_AxisDescriptor::MergeFrom(const FigureDescriptor_AxisDescr if (from._internal_is_time_axis() != 0) { _internal_set_is_time_axis(from._internal_is_time_axis()); } - if (!(from._internal_tick_label_angle() <= 0 && from._internal_tick_label_angle() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_tick_label_angle = from._internal_tick_label_angle(); + uint64_t raw_tick_label_angle; + memcpy(&raw_tick_label_angle, &tmp_tick_label_angle, sizeof(tmp_tick_label_angle)); + if (raw_tick_label_angle != 0) { _internal_set_tick_label_angle(from._internal_tick_label_angle()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -12115,32 +12153,26 @@ void FigureDescriptor_AxisDescriptor::InternalSwap(FigureDescriptor_AxisDescript swap(_has_bits_[0], other->_has_bits_[0]); major_tick_locations_.InternalSwap(&other->major_tick_locations_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &id_, lhs_arena, &other->id_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &label_, lhs_arena, &other->label_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &label_font_, lhs_arena, &other->label_font_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &ticks_font_, lhs_arena, &other->ticks_font_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &format_pattern_, lhs_arena, &other->format_pattern_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &color_, lhs_arena, &other->color_, rhs_arena ); @@ -12153,7 +12185,7 @@ void FigureDescriptor_AxisDescriptor::InternalSwap(FigureDescriptor_AxisDescript } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_AxisDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[34]); } @@ -12168,58 +12200,63 @@ FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::FigureDescriptor_Bus bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) } FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(const FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - open_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + open_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + open_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_open().empty()) { - open_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_open(), + open_.Set(from._internal_open(), GetArenaForAllocation()); } - close_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + close_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + close_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_close().empty()) { - close_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_close(), + close_.Set(from._internal_close(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) } -void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::SharedCtor() { -open_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -close_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::SharedCtor() { +open_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + open_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +close_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + close_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::~FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - open_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - close_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + open_.Destroy(); + close_.Destroy(); } -void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::ArenaDtor(void* object) { - FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* _this = reinterpret_cast< FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* >(object); - (void)_this; -} -void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12228,29 +12265,29 @@ void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string open = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_open(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open")); } else goto handle_unusual; continue; // string close = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_close(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close")); } else goto handle_unusual; continue; @@ -12277,10 +12314,10 @@ const char* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_Interna #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string open = 1; @@ -12304,7 +12341,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor_Busi } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) @@ -12315,7 +12352,7 @@ size_t FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::ByteSizeLong( // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12352,7 +12389,7 @@ void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::MergeImpl(::PRO void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::MergeFrom(const FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_open().empty()) { @@ -12381,19 +12418,17 @@ void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::InternalSwap(Fi auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &open_, lhs_arena, &other->open_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &close_, lhs_arena, &other->close_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[35]); } @@ -12414,9 +12449,6 @@ FigureDescriptor_BusinessCalendarDescriptor_Holiday::FigureDescriptor_BusinessCa : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), business_periods_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) } FigureDescriptor_BusinessCalendarDescriptor_Holiday::FigureDescriptor_BusinessCalendarDescriptor_Holiday(const FigureDescriptor_BusinessCalendarDescriptor_Holiday& from) @@ -12431,15 +12463,17 @@ FigureDescriptor_BusinessCalendarDescriptor_Holiday::FigureDescriptor_BusinessCa // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) } -void FigureDescriptor_BusinessCalendarDescriptor_Holiday::SharedCtor() { +inline void FigureDescriptor_BusinessCalendarDescriptor_Holiday::SharedCtor() { date_ = nullptr; } FigureDescriptor_BusinessCalendarDescriptor_Holiday::~FigureDescriptor_BusinessCalendarDescriptor_Holiday() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_BusinessCalendarDescriptor_Holiday::SharedDtor() { @@ -12447,19 +12481,13 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_Holiday::SharedDtor() { if (this != internal_default_instance()) delete date_; } -void FigureDescriptor_BusinessCalendarDescriptor_Holiday::ArenaDtor(void* object) { - FigureDescriptor_BusinessCalendarDescriptor_Holiday* _this = reinterpret_cast< FigureDescriptor_BusinessCalendarDescriptor_Holiday* >(object); - (void)_this; -} -void FigureDescriptor_BusinessCalendarDescriptor_Holiday::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_BusinessCalendarDescriptor_Holiday::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_BusinessCalendarDescriptor_Holiday::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12471,15 +12499,15 @@ void FigureDescriptor_BusinessCalendarDescriptor_Holiday::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate date = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_date(), ptr); CHK_(ptr); } else @@ -12487,7 +12515,7 @@ const char* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalParse( continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod business_periods = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -12521,30 +12549,29 @@ const char* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalParse( #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_BusinessCalendarDescriptor_Holiday::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate date = 1; if (this->_internal_has_date()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::date(this), target, stream); + InternalWriteMessage(1, _Internal::date(this), + _Internal::date(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod business_periods = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_business_periods_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_business_periods_size()); i < n; i++) { + const auto& repfield = this->_internal_business_periods(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_business_periods(i), target, stream); + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) @@ -12555,7 +12582,7 @@ size_t FigureDescriptor_BusinessCalendarDescriptor_Holiday::ByteSizeLong() const // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12592,7 +12619,7 @@ void FigureDescriptor_BusinessCalendarDescriptor_Holiday::MergeImpl(::PROTOBUF_N void FigureDescriptor_BusinessCalendarDescriptor_Holiday::MergeFrom(const FigureDescriptor_BusinessCalendarDescriptor_Holiday& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; business_periods_.MergeFrom(from.business_periods_); @@ -12621,7 +12648,7 @@ void FigureDescriptor_BusinessCalendarDescriptor_Holiday::InternalSwap(FigureDes } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_BusinessCalendarDescriptor_Holiday::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[36]); } @@ -12636,9 +12663,6 @@ FigureDescriptor_BusinessCalendarDescriptor_LocalDate::FigureDescriptor_Business bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) } FigureDescriptor_BusinessCalendarDescriptor_LocalDate::FigureDescriptor_BusinessCalendarDescriptor_LocalDate(const FigureDescriptor_BusinessCalendarDescriptor_LocalDate& from) @@ -12650,7 +12674,7 @@ FigureDescriptor_BusinessCalendarDescriptor_LocalDate::FigureDescriptor_Business // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) } -void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::SharedCtor() { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&year_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&day_) - @@ -12659,28 +12683,24 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor_BusinessCalendarDescriptor_LocalDate::~FigureDescriptor_BusinessCalendarDescriptor_LocalDate() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::ArenaDtor(void* object) { - FigureDescriptor_BusinessCalendarDescriptor_LocalDate* _this = reinterpret_cast< FigureDescriptor_BusinessCalendarDescriptor_LocalDate* >(object); - (void)_this; -} -void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12690,32 +12710,32 @@ void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 year = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - year_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + year_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 month = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - month_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + month_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 day = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - day_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + day_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -12743,32 +12763,32 @@ const char* FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_InternalPars #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 year = 1; if (this->_internal_year() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_year(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_year(), target); } // int32 month = 2; if (this->_internal_month() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_month(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_month(), target); } // int32 day = 3; if (this->_internal_day() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_day(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_day(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) @@ -12779,23 +12799,23 @@ size_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::ByteSizeLong() con // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // int32 year = 1; if (this->_internal_year() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_year()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_year()); } // int32 month = 2; if (this->_internal_month() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_month()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_month()); } // int32 day = 3; if (this->_internal_day() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_day()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_day()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -12817,7 +12837,7 @@ void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::MergeImpl(::PROTOBUF void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::MergeFrom(const FigureDescriptor_BusinessCalendarDescriptor_LocalDate& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_year() != 0) { @@ -12855,7 +12875,7 @@ void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::InternalSwap(FigureD } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_BusinessCalendarDescriptor_LocalDate::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[37]); } @@ -12873,9 +12893,6 @@ FigureDescriptor_BusinessCalendarDescriptor::FigureDescriptor_BusinessCalendarDe business_periods_(arena), holidays_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) } FigureDescriptor_BusinessCalendarDescriptor::FigureDescriptor_BusinessCalendarDescriptor(const FigureDescriptor_BusinessCalendarDescriptor& from) @@ -12884,50 +12901,58 @@ FigureDescriptor_BusinessCalendarDescriptor::FigureDescriptor_BusinessCalendarDe business_periods_(from.business_periods_), holidays_(from.holidays_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), + name_.Set(from._internal_name(), GetArenaForAllocation()); } - time_zone_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + time_zone_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + time_zone_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_time_zone().empty()) { - time_zone_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_time_zone(), + time_zone_.Set(from._internal_time_zone(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) } -void FigureDescriptor_BusinessCalendarDescriptor::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -time_zone_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_BusinessCalendarDescriptor::SharedCtor() { +name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +time_zone_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + time_zone_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } FigureDescriptor_BusinessCalendarDescriptor::~FigureDescriptor_BusinessCalendarDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_BusinessCalendarDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - time_zone_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + name_.Destroy(); + time_zone_.Destroy(); } -void FigureDescriptor_BusinessCalendarDescriptor::ArenaDtor(void* object) { - FigureDescriptor_BusinessCalendarDescriptor* _this = reinterpret_cast< FigureDescriptor_BusinessCalendarDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_BusinessCalendarDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_BusinessCalendarDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_BusinessCalendarDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12939,39 +12964,39 @@ void FigureDescriptor_BusinessCalendarDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_BusinessCalendarDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_BusinessCalendarDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string name = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name")); } else goto handle_unusual; continue; // string time_zone = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_time_zone(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone")); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek business_days = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_business_days(), ptr, ctx); CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + } else if (static_cast(tag) == 24) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_add_business_days(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek>(val)); } else @@ -12979,7 +13004,7 @@ const char* FigureDescriptor_BusinessCalendarDescriptor::_InternalParse(const ch continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod business_periods = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; @@ -12992,7 +13017,7 @@ const char* FigureDescriptor_BusinessCalendarDescriptor::_InternalParse(const ch continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday holidays = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; @@ -13026,10 +13051,10 @@ const char* FigureDescriptor_BusinessCalendarDescriptor::_InternalParse(const ch #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_BusinessCalendarDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string name = 1; @@ -13062,23 +13087,23 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_BusinessCalendarDescriptor::_In } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod business_periods = 4; - for (unsigned int i = 0, - n = static_cast(this->_internal_business_periods_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_business_periods_size()); i < n; i++) { + const auto& repfield = this->_internal_business_periods(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, this->_internal_business_periods(i), target, stream); + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday holidays = 5; - for (unsigned int i = 0, - n = static_cast(this->_internal_holidays_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_holidays_size()); i < n; i++) { + const auto& repfield = this->_internal_holidays(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, this->_internal_holidays(i), target, stream); + InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) @@ -13089,7 +13114,7 @@ size_t FigureDescriptor_BusinessCalendarDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13097,15 +13122,14 @@ size_t FigureDescriptor_BusinessCalendarDescriptor::ByteSizeLong() const { { size_t data_size = 0; unsigned int count = static_cast(this->_internal_business_days_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( + data_size += ::_pbi::WireFormatLite::EnumSize( this->_internal_business_days(static_cast(i))); } if (data_size > 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + int cached_size = ::_pbi::ToCachedSize(data_size); _business_days_cached_byte_size_.store(cached_size, std::memory_order_relaxed); total_size += data_size; @@ -13158,7 +13182,7 @@ void FigureDescriptor_BusinessCalendarDescriptor::MergeImpl(::PROTOBUF_NAMESPACE void FigureDescriptor_BusinessCalendarDescriptor::MergeFrom(const FigureDescriptor_BusinessCalendarDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; business_days_.MergeFrom(from.business_days_); @@ -13193,19 +13217,17 @@ void FigureDescriptor_BusinessCalendarDescriptor::InternalSwap(FigureDescriptor_ business_periods_.InternalSwap(&other->business_periods_); holidays_.InternalSwap(&other->holidays_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &name_, lhs_arena, &other->name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &time_zone_, lhs_arena, &other->time_zone_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_BusinessCalendarDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[38]); } @@ -13220,116 +13242,121 @@ FigureDescriptor_MultiSeriesSourceDescriptor::FigureDescriptor_MultiSeriesSource bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) } FigureDescriptor_MultiSeriesSourceDescriptor::FigureDescriptor_MultiSeriesSourceDescriptor(const FigureDescriptor_MultiSeriesSourceDescriptor& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - axis_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + axis_id_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + axis_id_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_axis_id().empty()) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_axis_id(), + axis_id_.Set(from._internal_axis_id(), GetArenaForAllocation()); } - column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_name().empty()) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_name(), + column_name_.Set(from._internal_column_name(), GetArenaForAllocation()); } ::memcpy(&type_, &from.type_, - static_cast(reinterpret_cast(&table_map_id_) - - reinterpret_cast(&type_)) + sizeof(table_map_id_)); + static_cast(reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&type_)) + sizeof(partitioned_table_id_)); // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) } -void FigureDescriptor_MultiSeriesSourceDescriptor::SharedCtor() { -axis_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_MultiSeriesSourceDescriptor::SharedCtor() { +axis_id_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + axis_id_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&type_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&table_map_id_) - - reinterpret_cast(&type_)) + sizeof(table_map_id_)); + 0, static_cast(reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&type_)) + sizeof(partitioned_table_id_)); } FigureDescriptor_MultiSeriesSourceDescriptor::~FigureDescriptor_MultiSeriesSourceDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_MultiSeriesSourceDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - axis_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + axis_id_.Destroy(); + column_name_.Destroy(); } -void FigureDescriptor_MultiSeriesSourceDescriptor::ArenaDtor(void* object) { - FigureDescriptor_MultiSeriesSourceDescriptor* _this = reinterpret_cast< FigureDescriptor_MultiSeriesSourceDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_MultiSeriesSourceDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_MultiSeriesSourceDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_MultiSeriesSourceDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; axis_id_.ClearToEmpty(); column_name_.ClearToEmpty(); ::memset(&type_, 0, static_cast( - reinterpret_cast(&table_map_id_) - - reinterpret_cast(&type_)) + sizeof(table_map_id_)); + reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&type_)) + sizeof(partitioned_table_id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_MultiSeriesSourceDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_MultiSeriesSourceDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string axis_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_axis_id(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_type(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceType>(val)); } else goto handle_unusual; continue; - // int32 table_map_id = 3; + // int32 partitioned_table_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - table_map_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + partitioned_table_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string column_name = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { auto str = _internal_mutable_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name")); } else goto handle_unusual; continue; @@ -13356,10 +13383,10 @@ const char* FigureDescriptor_MultiSeriesSourceDescriptor::_InternalParse(const c #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_MultiSeriesSourceDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_MultiSeriesSourceDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string axis_id = 1; @@ -13375,14 +13402,14 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_MultiSeriesSourceDescriptor::_I // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; if (this->_internal_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 2, this->_internal_type(), target); } - // int32 table_map_id = 3; - if (this->_internal_table_map_id() != 0) { + // int32 partitioned_table_id = 3; + if (this->_internal_partitioned_table_id() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_table_map_id(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_partitioned_table_id(), target); } // string column_name = 4; @@ -13396,7 +13423,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_MultiSeriesSourceDescriptor::_I } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) @@ -13407,7 +13434,7 @@ size_t FigureDescriptor_MultiSeriesSourceDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13428,12 +13455,12 @@ size_t FigureDescriptor_MultiSeriesSourceDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; if (this->_internal_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } - // int32 table_map_id = 3; - if (this->_internal_table_map_id() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_table_map_id()); + // int32 partitioned_table_id = 3; + if (this->_internal_partitioned_table_id() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_partitioned_table_id()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -13455,7 +13482,7 @@ void FigureDescriptor_MultiSeriesSourceDescriptor::MergeImpl(::PROTOBUF_NAMESPAC void FigureDescriptor_MultiSeriesSourceDescriptor::MergeFrom(const FigureDescriptor_MultiSeriesSourceDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_axis_id().empty()) { @@ -13467,8 +13494,8 @@ void FigureDescriptor_MultiSeriesSourceDescriptor::MergeFrom(const FigureDescrip if (from._internal_type() != 0) { _internal_set_type(from._internal_type()); } - if (from._internal_table_map_id() != 0) { - _internal_set_table_map_id(from._internal_table_map_id()); + if (from._internal_partitioned_table_id() != 0) { + _internal_set_partitioned_table_id(from._internal_partitioned_table_id()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -13490,25 +13517,23 @@ void FigureDescriptor_MultiSeriesSourceDescriptor::InternalSwap(FigureDescriptor auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &axis_id_, lhs_arena, &other->axis_id_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_name_, lhs_arena, &other->column_name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(FigureDescriptor_MultiSeriesSourceDescriptor, table_map_id_) - + sizeof(FigureDescriptor_MultiSeriesSourceDescriptor::table_map_id_) + PROTOBUF_FIELD_OFFSET(FigureDescriptor_MultiSeriesSourceDescriptor, partitioned_table_id_) + + sizeof(FigureDescriptor_MultiSeriesSourceDescriptor::partitioned_table_id_) - PROTOBUF_FIELD_OFFSET(FigureDescriptor_MultiSeriesSourceDescriptor, type_)>( reinterpret_cast(&type_), reinterpret_cast(&other->type_)); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_MultiSeriesSourceDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[39]); } @@ -13528,27 +13553,33 @@ FigureDescriptor_SourceDescriptor::FigureDescriptor_SourceDescriptor(::PROTOBUF_ bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) } FigureDescriptor_SourceDescriptor::FigureDescriptor_SourceDescriptor(const FigureDescriptor_SourceDescriptor& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - axis_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + axis_id_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + axis_id_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_axis_id().empty()) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_axis_id(), + axis_id_.Set(from._internal_axis_id(), GetArenaForAllocation()); } - column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_name().empty()) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_name(), + column_name_.Set(from._internal_column_name(), GetArenaForAllocation()); } - column_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_type().empty()) { - column_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_type(), + column_type_.Set(from._internal_column_type(), GetArenaForAllocation()); } if (from._internal_has_one_click()) { @@ -13557,49 +13588,54 @@ FigureDescriptor_SourceDescriptor::FigureDescriptor_SourceDescriptor(const Figur one_click_ = nullptr; } ::memcpy(&type_, &from.type_, - static_cast(reinterpret_cast(&table_map_id_) - - reinterpret_cast(&type_)) + sizeof(table_map_id_)); + static_cast(reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&type_)) + sizeof(partitioned_table_id_)); // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) } -void FigureDescriptor_SourceDescriptor::SharedCtor() { -axis_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -column_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor_SourceDescriptor::SharedCtor() { +axis_id_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + axis_id_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +column_type_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_type_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&one_click_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&table_map_id_) - - reinterpret_cast(&one_click_)) + sizeof(table_map_id_)); + 0, static_cast(reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&one_click_)) + sizeof(partitioned_table_id_)); } FigureDescriptor_SourceDescriptor::~FigureDescriptor_SourceDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_SourceDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - axis_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - column_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + axis_id_.Destroy(); + column_name_.Destroy(); + column_type_.Destroy(); if (this != internal_default_instance()) delete one_click_; } -void FigureDescriptor_SourceDescriptor::ArenaDtor(void* object) { - FigureDescriptor_SourceDescriptor* _this = reinterpret_cast< FigureDescriptor_SourceDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_SourceDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_SourceDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_SourceDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13611,31 +13647,31 @@ void FigureDescriptor_SourceDescriptor::Clear() { } one_click_ = nullptr; ::memset(&type_, 0, static_cast( - reinterpret_cast(&table_map_id_) - - reinterpret_cast(&type_)) + sizeof(table_map_id_)); + reinterpret_cast(&partitioned_table_id_) - + reinterpret_cast(&type_)) + sizeof(partitioned_table_id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_SourceDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_SourceDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string axis_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_axis_id(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_type(static_cast<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceType>(val)); } else @@ -13643,43 +13679,43 @@ const char* FigureDescriptor_SourceDescriptor::_InternalParse(const char* ptr, : continue; // int32 table_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - table_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + table_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // int32 table_map_id = 4; + // int32 partitioned_table_id = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - table_map_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + partitioned_table_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string column_name = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { auto str = _internal_mutable_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name")); } else goto handle_unusual; continue; // string column_type = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { auto str = _internal_mutable_column_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor one_click = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { ptr = ctx->ParseMessage(_internal_mutable_one_click(), ptr); CHK_(ptr); } else @@ -13708,10 +13744,10 @@ const char* FigureDescriptor_SourceDescriptor::_InternalParse(const char* ptr, : #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SourceDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_SourceDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string axis_id = 1; @@ -13727,20 +13763,20 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SourceDescriptor::_InternalSeri // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; if (this->_internal_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 2, this->_internal_type(), target); } // int32 table_id = 3; if (this->_internal_table_id() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_table_id(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_table_id(), target); } - // int32 table_map_id = 4; - if (this->_internal_table_map_id() != 0) { + // int32 partitioned_table_id = 4; + if (this->_internal_partitioned_table_id() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_table_map_id(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_partitioned_table_id(), target); } // string column_name = 5; @@ -13765,14 +13801,13 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_SourceDescriptor::_InternalSeri // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor one_click = 7; if (this->_internal_has_one_click()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 7, _Internal::one_click(this), target, stream); + InternalWriteMessage(7, _Internal::one_click(this), + _Internal::one_click(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) @@ -13783,7 +13818,7 @@ size_t FigureDescriptor_SourceDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13818,17 +13853,17 @@ size_t FigureDescriptor_SourceDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType type = 2; if (this->_internal_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } // int32 table_id = 3; if (this->_internal_table_id() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_table_id()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_table_id()); } - // int32 table_map_id = 4; - if (this->_internal_table_map_id() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_table_map_id()); + // int32 partitioned_table_id = 4; + if (this->_internal_partitioned_table_id() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_partitioned_table_id()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -13850,7 +13885,7 @@ void FigureDescriptor_SourceDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Messa void FigureDescriptor_SourceDescriptor::MergeFrom(const FigureDescriptor_SourceDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_axis_id().empty()) { @@ -13871,8 +13906,8 @@ void FigureDescriptor_SourceDescriptor::MergeFrom(const FigureDescriptor_SourceD if (from._internal_table_id() != 0) { _internal_set_table_id(from._internal_table_id()); } - if (from._internal_table_map_id() != 0) { - _internal_set_table_map_id(from._internal_table_map_id()); + if (from._internal_partitioned_table_id() != 0) { + _internal_set_partitioned_table_id(from._internal_partitioned_table_id()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -13894,30 +13929,27 @@ void FigureDescriptor_SourceDescriptor::InternalSwap(FigureDescriptor_SourceDesc auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &axis_id_, lhs_arena, &other->axis_id_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_name_, lhs_arena, &other->column_name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_type_, lhs_arena, &other->column_type_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(FigureDescriptor_SourceDescriptor, table_map_id_) - + sizeof(FigureDescriptor_SourceDescriptor::table_map_id_) + PROTOBUF_FIELD_OFFSET(FigureDescriptor_SourceDescriptor, partitioned_table_id_) + + sizeof(FigureDescriptor_SourceDescriptor::partitioned_table_id_) - PROTOBUF_FIELD_OFFSET(FigureDescriptor_SourceDescriptor, one_click_)>( reinterpret_cast(&one_click_), reinterpret_cast(&other->one_click_)); } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_SourceDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[40]); } @@ -13934,9 +13966,6 @@ FigureDescriptor_OneClickDescriptor::FigureDescriptor_OneClickDescriptor(::PROTO columns_(arena), column_types_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) } FigureDescriptor_OneClickDescriptor::FigureDescriptor_OneClickDescriptor(const FigureDescriptor_OneClickDescriptor& from) @@ -13948,34 +13977,30 @@ FigureDescriptor_OneClickDescriptor::FigureDescriptor_OneClickDescriptor(const F // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) } -void FigureDescriptor_OneClickDescriptor::SharedCtor() { +inline void FigureDescriptor_OneClickDescriptor::SharedCtor() { require_all_filters_to_display_ = false; } FigureDescriptor_OneClickDescriptor::~FigureDescriptor_OneClickDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor_OneClickDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void FigureDescriptor_OneClickDescriptor::ArenaDtor(void* object) { - FigureDescriptor_OneClickDescriptor* _this = reinterpret_cast< FigureDescriptor_OneClickDescriptor* >(object); - (void)_this; -} -void FigureDescriptor_OneClickDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor_OneClickDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor_OneClickDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13985,22 +14010,22 @@ void FigureDescriptor_OneClickDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor_OneClickDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor_OneClickDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated string columns = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.columns")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.columns")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else @@ -14008,14 +14033,14 @@ const char* FigureDescriptor_OneClickDescriptor::_InternalParse(const char* ptr, continue; // repeated string column_types = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_column_types(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.column_types")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor.column_types")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -14023,7 +14048,7 @@ const char* FigureDescriptor_OneClickDescriptor::_InternalParse(const char* ptr, continue; // bool require_all_filters_to_display = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { require_all_filters_to_display_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -14052,10 +14077,10 @@ const char* FigureDescriptor_OneClickDescriptor::_InternalParse(const char* ptr, #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_OneClickDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor_OneClickDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated string columns = 1; @@ -14081,11 +14106,11 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor_OneClickDescriptor::_InternalSe // bool require_all_filters_to_display = 3; if (this->_internal_require_all_filters_to_display() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_require_all_filters_to_display(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_require_all_filters_to_display(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) @@ -14096,7 +14121,7 @@ size_t FigureDescriptor_OneClickDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14140,7 +14165,7 @@ void FigureDescriptor_OneClickDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Mes void FigureDescriptor_OneClickDescriptor::MergeFrom(const FigureDescriptor_OneClickDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_.MergeFrom(from.columns_); @@ -14171,7 +14196,7 @@ void FigureDescriptor_OneClickDescriptor::InternalSwap(FigureDescriptor_OneClick } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor_OneClickDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[41]); } @@ -14192,9 +14217,6 @@ FigureDescriptor::FigureDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, charts_(arena), errors_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) } FigureDescriptor::FigureDescriptor(const FigureDescriptor& from) @@ -14203,19 +14225,28 @@ FigureDescriptor::FigureDescriptor(const FigureDescriptor& from) charts_(from.charts_), errors_(from.errors_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - title_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (from._internal_has_title()) { - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title(), + title_.Set(from._internal_title(), GetArenaForAllocation()); } - title_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_font_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_font_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_title_font().empty()) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title_font(), + title_font_.Set(from._internal_title_font(), GetArenaForAllocation()); } - title_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_color_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_color_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_title_color().empty()) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_title_color(), + title_color_.Set(from._internal_title_color(), GetArenaForAllocation()); } ::memcpy(&update_interval_, &from.update_interval_, @@ -14224,10 +14255,19 @@ FigureDescriptor::FigureDescriptor(const FigureDescriptor& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) } -void FigureDescriptor::SharedCtor() { -title_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -title_font_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -title_color_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FigureDescriptor::SharedCtor() { +title_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +title_font_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_font_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +title_color_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + title_color_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&update_interval_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&rows_) - @@ -14236,31 +14276,27 @@ ::memset(reinterpret_cast(this) + static_cast( FigureDescriptor::~FigureDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FigureDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - title_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - title_font_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - title_color_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + title_.Destroy(); + title_font_.Destroy(); + title_color_.Destroy(); } -void FigureDescriptor::ArenaDtor(void* object) { - FigureDescriptor* _this = reinterpret_cast< FigureDescriptor* >(object); - (void)_this; -} -void FigureDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FigureDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void FigureDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14279,46 +14315,46 @@ void FigureDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FigureDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FigureDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // optional string title = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_title(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title")); } else goto handle_unusual; continue; // string title_font = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_title_font(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font")); } else goto handle_unusual; continue; // string title_color = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_title_color(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color")); } else goto handle_unusual; continue; - // int64 update_interval = 7; + // int64 update_interval = 7 [jstype = JS_STRING]; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { update_interval_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -14326,23 +14362,23 @@ const char* FigureDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // int32 cols = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - cols_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + cols_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // int32 rows = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { + rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor charts = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { ptr -= 1; do { ptr += 1; @@ -14355,14 +14391,14 @@ const char* FigureDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // repeated string errors = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_errors(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.errors")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.errors")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<106>(ptr)); } else @@ -14392,10 +14428,10 @@ const char* FigureDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FigureDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // optional string title = 1; @@ -14428,30 +14464,30 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor::_InternalSerialize( 3, this->_internal_title_color(), target); } - // int64 update_interval = 7; + // int64 update_interval = 7 [jstype = JS_STRING]; if (this->_internal_update_interval() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->_internal_update_interval(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_update_interval(), target); } // int32 cols = 8; if (this->_internal_cols() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_cols(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(8, this->_internal_cols(), target); } // int32 rows = 9; if (this->_internal_rows() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_rows(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(9, this->_internal_rows(), target); } // repeated .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor charts = 10; - for (unsigned int i = 0, - n = static_cast(this->_internal_charts_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_charts_size()); i < n; i++) { + const auto& repfield = this->_internal_charts(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(10, this->_internal_charts(i), target, stream); + InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); } // repeated string errors = 13; @@ -14465,7 +14501,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FigureDescriptor::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) @@ -14476,7 +14512,7 @@ size_t FigureDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14517,19 +14553,19 @@ size_t FigureDescriptor::ByteSizeLong() const { this->_internal_title_color()); } - // int64 update_interval = 7; + // int64 update_interval = 7 [jstype = JS_STRING]; if (this->_internal_update_interval() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_update_interval()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_update_interval()); } // int32 cols = 8; if (this->_internal_cols() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_cols()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_cols()); } // int32 rows = 9; if (this->_internal_rows() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_rows()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_rows()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -14551,7 +14587,7 @@ void FigureDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FigureDescriptor::MergeFrom(const FigureDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; charts_.MergeFrom(from.charts_); @@ -14597,17 +14633,14 @@ void FigureDescriptor::InternalSwap(FigureDescriptor* other) { charts_.InternalSwap(&other->charts_); errors_.InternalSwap(&other->errors_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_, lhs_arena, &other->title_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_font_, lhs_arena, &other->title_font_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &title_color_, lhs_arena, &other->title_color_, rhs_arena ); @@ -14620,7 +14653,7 @@ void FigureDescriptor::InternalSwap(FigureDescriptor* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fconsole_2eproto_getter, &descriptor_table_deephaven_2fproto_2fconsole_2eproto_once, file_level_metadata_deephaven_2fproto_2fconsole_2eproto[42]); } @@ -14633,133 +14666,176 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FigureDescriptor::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::GetConsoleTypesResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::StartConsoleRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::StartConsoleResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::LogSubscriptionData >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::ExecuteCommandResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::CancelCommandRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::CancelCommandResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::AutoCompleteResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::BrowserNextResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest_TextDocumentContentChangeEvent* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest_TextDocumentContentChangeEvent >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest_TextDocumentContentChangeEvent* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest_TextDocumentContentChangeEvent >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest_TextDocumentContentChangeEvent >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::DocumentRange* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::DocumentRange >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::DocumentRange* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::DocumentRange >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::DocumentRange >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::Position* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::Position >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::Position* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::Position >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::Position >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CompletionContext* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CompletionContext >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CompletionContext* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CompletionContext >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::CompletionContext >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CompletionItem* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CompletionItem >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::CompletionItem* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::CompletionItem >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::CompletionItem >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::TextEdit* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::TextEdit >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::TextEdit* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::TextEdit >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::TextEdit >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_ChartDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SeriesDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_AxisDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_Holiday >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_MultiSeriesSourceDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.h index 309d5fd04ec..f8325070538 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/console.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/console.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -27,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -50,15 +46,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2fconsole_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[43] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fconsole_2eproto; namespace io { @@ -261,12 +249,13 @@ enum FigureDescriptor_ChartDescriptor_ChartType : int { FigureDescriptor_ChartDescriptor_ChartType_CATEGORY = 3, FigureDescriptor_ChartDescriptor_ChartType_XYZ = 4, FigureDescriptor_ChartDescriptor_ChartType_CATEGORY_3D = 5, - FigureDescriptor_ChartDescriptor_ChartType_FigureDescriptor_ChartDescriptor_ChartType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_ChartDescriptor_ChartType_FigureDescriptor_ChartDescriptor_ChartType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_ChartDescriptor_ChartType_TREEMAP = 6, + FigureDescriptor_ChartDescriptor_ChartType_FigureDescriptor_ChartDescriptor_ChartType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_ChartDescriptor_ChartType_FigureDescriptor_ChartDescriptor_ChartType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_ChartDescriptor_ChartType_IsValid(int value); constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor_ChartType_ChartType_MIN = FigureDescriptor_ChartDescriptor_ChartType_XY; -constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor_ChartType_ChartType_MAX = FigureDescriptor_ChartDescriptor_ChartType_CATEGORY_3D; +constexpr FigureDescriptor_ChartDescriptor_ChartType FigureDescriptor_ChartDescriptor_ChartType_ChartType_MAX = FigureDescriptor_ChartDescriptor_ChartType_TREEMAP; constexpr int FigureDescriptor_ChartDescriptor_ChartType_ChartType_ARRAYSIZE = FigureDescriptor_ChartDescriptor_ChartType_ChartType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_ChartDescriptor_ChartType_descriptor(); @@ -286,8 +275,8 @@ inline bool FigureDescriptor_ChartDescriptor_ChartType_Parse( enum FigureDescriptor_AxisDescriptor_AxisFormatType : int { FigureDescriptor_AxisDescriptor_AxisFormatType_CATEGORY = 0, FigureDescriptor_AxisDescriptor_AxisFormatType_NUMBER = 1, - FigureDescriptor_AxisDescriptor_AxisFormatType_FigureDescriptor_AxisDescriptor_AxisFormatType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_AxisDescriptor_AxisFormatType_FigureDescriptor_AxisDescriptor_AxisFormatType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_AxisDescriptor_AxisFormatType_FigureDescriptor_AxisDescriptor_AxisFormatType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_AxisDescriptor_AxisFormatType_FigureDescriptor_AxisDescriptor_AxisFormatType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_AxisDescriptor_AxisFormatType_IsValid(int value); constexpr FigureDescriptor_AxisDescriptor_AxisFormatType FigureDescriptor_AxisDescriptor_AxisFormatType_AxisFormatType_MIN = FigureDescriptor_AxisDescriptor_AxisFormatType_CATEGORY; @@ -315,8 +304,8 @@ enum FigureDescriptor_AxisDescriptor_AxisType : int { FigureDescriptor_AxisDescriptor_AxisType_SIZE = 3, FigureDescriptor_AxisDescriptor_AxisType_LABEL = 4, FigureDescriptor_AxisDescriptor_AxisType_COLOR = 5, - FigureDescriptor_AxisDescriptor_AxisType_FigureDescriptor_AxisDescriptor_AxisType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_AxisDescriptor_AxisType_FigureDescriptor_AxisDescriptor_AxisType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_AxisDescriptor_AxisType_FigureDescriptor_AxisDescriptor_AxisType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_AxisDescriptor_AxisType_FigureDescriptor_AxisDescriptor_AxisType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_AxisDescriptor_AxisType_IsValid(int value); constexpr FigureDescriptor_AxisDescriptor_AxisType FigureDescriptor_AxisDescriptor_AxisType_AxisType_MIN = FigureDescriptor_AxisDescriptor_AxisType_X; @@ -343,8 +332,8 @@ enum FigureDescriptor_AxisDescriptor_AxisPosition : int { FigureDescriptor_AxisDescriptor_AxisPosition_LEFT = 2, FigureDescriptor_AxisDescriptor_AxisPosition_RIGHT = 3, FigureDescriptor_AxisDescriptor_AxisPosition_NONE = 4, - FigureDescriptor_AxisDescriptor_AxisPosition_FigureDescriptor_AxisDescriptor_AxisPosition_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_AxisDescriptor_AxisPosition_FigureDescriptor_AxisDescriptor_AxisPosition_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_AxisDescriptor_AxisPosition_FigureDescriptor_AxisDescriptor_AxisPosition_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_AxisDescriptor_AxisPosition_FigureDescriptor_AxisDescriptor_AxisPosition_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_AxisDescriptor_AxisPosition_IsValid(int value); constexpr FigureDescriptor_AxisDescriptor_AxisPosition FigureDescriptor_AxisDescriptor_AxisPosition_AxisPosition_MIN = FigureDescriptor_AxisDescriptor_AxisPosition_TOP; @@ -373,8 +362,8 @@ enum FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek : int { FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_THURSDAY = 4, FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_FRIDAY = 5, FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_SATURDAY = 6, - FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_IsValid(int value); constexpr FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_DayOfWeek_MIN = FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_SUNDAY; @@ -407,12 +396,13 @@ enum FigureDescriptor_SeriesPlotStyle : int { FigureDescriptor_SeriesPlotStyle_SCATTER = 8, FigureDescriptor_SeriesPlotStyle_STEP = 9, FigureDescriptor_SeriesPlotStyle_ERROR_BAR = 10, - FigureDescriptor_SeriesPlotStyle_FigureDescriptor_SeriesPlotStyle_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_SeriesPlotStyle_FigureDescriptor_SeriesPlotStyle_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_SeriesPlotStyle_TREEMAP = 11, + FigureDescriptor_SeriesPlotStyle_FigureDescriptor_SeriesPlotStyle_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_SeriesPlotStyle_FigureDescriptor_SeriesPlotStyle_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_SeriesPlotStyle_IsValid(int value); constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor_SeriesPlotStyle_SeriesPlotStyle_MIN = FigureDescriptor_SeriesPlotStyle_BAR; -constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor_SeriesPlotStyle_SeriesPlotStyle_MAX = FigureDescriptor_SeriesPlotStyle_ERROR_BAR; +constexpr FigureDescriptor_SeriesPlotStyle FigureDescriptor_SeriesPlotStyle_SeriesPlotStyle_MAX = FigureDescriptor_SeriesPlotStyle_TREEMAP; constexpr int FigureDescriptor_SeriesPlotStyle_SeriesPlotStyle_ARRAYSIZE = FigureDescriptor_SeriesPlotStyle_SeriesPlotStyle_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_SeriesPlotStyle_descriptor(); @@ -446,12 +436,15 @@ enum FigureDescriptor_SourceType : int { FigureDescriptor_SourceType_SIZE = 13, FigureDescriptor_SourceType_LABEL = 14, FigureDescriptor_SourceType_COLOR = 15, - FigureDescriptor_SourceType_FigureDescriptor_SourceType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - FigureDescriptor_SourceType_FigureDescriptor_SourceType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + FigureDescriptor_SourceType_PARENT = 16, + FigureDescriptor_SourceType_HOVER_TEXT = 17, + FigureDescriptor_SourceType_TEXT = 18, + FigureDescriptor_SourceType_FigureDescriptor_SourceType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + FigureDescriptor_SourceType_FigureDescriptor_SourceType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool FigureDescriptor_SourceType_IsValid(int value); constexpr FigureDescriptor_SourceType FigureDescriptor_SourceType_SourceType_MIN = FigureDescriptor_SourceType_X; -constexpr FigureDescriptor_SourceType FigureDescriptor_SourceType_SourceType_MAX = FigureDescriptor_SourceType_COLOR; +constexpr FigureDescriptor_SourceType FigureDescriptor_SourceType_SourceType_MAX = FigureDescriptor_SourceType_TEXT; constexpr int FigureDescriptor_SourceType_SourceType_ARRAYSIZE = FigureDescriptor_SourceType_SourceType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FigureDescriptor_SourceType_descriptor(); @@ -474,7 +467,7 @@ class GetConsoleTypesRequest final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest) */ { public: inline GetConsoleTypesRequest() : GetConsoleTypesRequest(nullptr) {} - explicit constexpr GetConsoleTypesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GetConsoleTypesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GetConsoleTypesRequest(const GetConsoleTypesRequest& from); GetConsoleTypesRequest(GetConsoleTypesRequest&& from) noexcept @@ -524,7 +517,12 @@ class GetConsoleTypesRequest final : } inline void Swap(GetConsoleTypesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -538,11 +536,7 @@ class GetConsoleTypesRequest final : // implements Message ---------------------------------------------- - inline GetConsoleTypesRequest* New() const final { - return new GetConsoleTypesRequest(); - } - - GetConsoleTypesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + GetConsoleTypesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -554,6 +548,8 @@ class GetConsoleTypesRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest"; @@ -561,7 +557,6 @@ class GetConsoleTypesRequest final : protected: explicit GetConsoleTypesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -580,7 +575,6 @@ class GetConsoleTypesRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -590,7 +584,7 @@ class GetConsoleTypesResponse final : public: inline GetConsoleTypesResponse() : GetConsoleTypesResponse(nullptr) {} ~GetConsoleTypesResponse() override; - explicit constexpr GetConsoleTypesResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GetConsoleTypesResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GetConsoleTypesResponse(const GetConsoleTypesResponse& from); GetConsoleTypesResponse(GetConsoleTypesResponse&& from) noexcept @@ -640,7 +634,12 @@ class GetConsoleTypesResponse final : } inline void Swap(GetConsoleTypesResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -654,11 +653,7 @@ class GetConsoleTypesResponse final : // implements Message ---------------------------------------------- - inline GetConsoleTypesResponse* New() const final { - return new GetConsoleTypesResponse(); - } - - GetConsoleTypesResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + GetConsoleTypesResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -673,8 +668,8 @@ class GetConsoleTypesResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -682,6 +677,8 @@ class GetConsoleTypesResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GetConsoleTypesResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse"; @@ -689,9 +686,6 @@ class GetConsoleTypesResponse final : protected: explicit GetConsoleTypesResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -748,7 +742,7 @@ class StartConsoleRequest final : public: inline StartConsoleRequest() : StartConsoleRequest(nullptr) {} ~StartConsoleRequest() override; - explicit constexpr StartConsoleRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR StartConsoleRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); StartConsoleRequest(const StartConsoleRequest& from); StartConsoleRequest(StartConsoleRequest&& from) noexcept @@ -798,7 +792,12 @@ class StartConsoleRequest final : } inline void Swap(StartConsoleRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -812,11 +811,7 @@ class StartConsoleRequest final : // implements Message ---------------------------------------------- - inline StartConsoleRequest* New() const final { - return new StartConsoleRequest(); - } - - StartConsoleRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + StartConsoleRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -831,8 +826,8 @@ class StartConsoleRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -840,6 +835,8 @@ class StartConsoleRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(StartConsoleRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.StartConsoleRequest"; @@ -847,9 +844,6 @@ class StartConsoleRequest final : protected: explicit StartConsoleRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -871,7 +865,7 @@ class StartConsoleRequest final : template void set_session_type(ArgT0&& arg0, ArgT... args); std::string* mutable_session_type(); - PROTOBUF_MUST_USE_RESULT std::string* release_session_type(); + PROTOBUF_NODISCARD std::string* release_session_type(); void set_allocated_session_type(std::string* session_type); private: const std::string& _internal_session_type() const; @@ -886,7 +880,7 @@ class StartConsoleRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -916,7 +910,7 @@ class StartConsoleResponse final : public: inline StartConsoleResponse() : StartConsoleResponse(nullptr) {} ~StartConsoleResponse() override; - explicit constexpr StartConsoleResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR StartConsoleResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); StartConsoleResponse(const StartConsoleResponse& from); StartConsoleResponse(StartConsoleResponse&& from) noexcept @@ -966,7 +960,12 @@ class StartConsoleResponse final : } inline void Swap(StartConsoleResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -980,11 +979,7 @@ class StartConsoleResponse final : // implements Message ---------------------------------------------- - inline StartConsoleResponse* New() const final { - return new StartConsoleResponse(); - } - - StartConsoleResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + StartConsoleResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -999,8 +994,8 @@ class StartConsoleResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1008,6 +1003,8 @@ class StartConsoleResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(StartConsoleResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.StartConsoleResponse"; @@ -1015,9 +1012,6 @@ class StartConsoleResponse final : protected: explicit StartConsoleResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1039,7 +1033,7 @@ class StartConsoleResponse final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -1068,7 +1062,7 @@ class LogSubscriptionRequest final : public: inline LogSubscriptionRequest() : LogSubscriptionRequest(nullptr) {} ~LogSubscriptionRequest() override; - explicit constexpr LogSubscriptionRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR LogSubscriptionRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); LogSubscriptionRequest(const LogSubscriptionRequest& from); LogSubscriptionRequest(LogSubscriptionRequest&& from) noexcept @@ -1118,7 +1112,12 @@ class LogSubscriptionRequest final : } inline void Swap(LogSubscriptionRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1132,11 +1131,7 @@ class LogSubscriptionRequest final : // implements Message ---------------------------------------------- - inline LogSubscriptionRequest* New() const final { - return new LogSubscriptionRequest(); - } - - LogSubscriptionRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + LogSubscriptionRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1151,8 +1146,8 @@ class LogSubscriptionRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1160,6 +1155,8 @@ class LogSubscriptionRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(LogSubscriptionRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest"; @@ -1167,9 +1164,6 @@ class LogSubscriptionRequest final : protected: explicit LogSubscriptionRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1209,13 +1203,13 @@ class LogSubscriptionRequest final : std::string* _internal_add_levels(); public: - // int64 last_seen_log_timestamp = 1; + // int64 last_seen_log_timestamp = 1 [jstype = JS_STRING]; void clear_last_seen_log_timestamp(); - ::PROTOBUF_NAMESPACE_ID::int64 last_seen_log_timestamp() const; - void set_last_seen_log_timestamp(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t last_seen_log_timestamp() const; + void set_last_seen_log_timestamp(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_last_seen_log_timestamp() const; - void _internal_set_last_seen_log_timestamp(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_last_seen_log_timestamp() const; + void _internal_set_last_seen_log_timestamp(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) @@ -1226,7 +1220,7 @@ class LogSubscriptionRequest final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField levels_; - ::PROTOBUF_NAMESPACE_ID::int64 last_seen_log_timestamp_; + int64_t last_seen_log_timestamp_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -1237,7 +1231,7 @@ class LogSubscriptionData final : public: inline LogSubscriptionData() : LogSubscriptionData(nullptr) {} ~LogSubscriptionData() override; - explicit constexpr LogSubscriptionData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR LogSubscriptionData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); LogSubscriptionData(const LogSubscriptionData& from); LogSubscriptionData(LogSubscriptionData&& from) noexcept @@ -1287,7 +1281,12 @@ class LogSubscriptionData final : } inline void Swap(LogSubscriptionData* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1301,11 +1300,7 @@ class LogSubscriptionData final : // implements Message ---------------------------------------------- - inline LogSubscriptionData* New() const final { - return new LogSubscriptionData(); - } - - LogSubscriptionData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + LogSubscriptionData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1320,8 +1315,8 @@ class LogSubscriptionData final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1329,6 +1324,8 @@ class LogSubscriptionData final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(LogSubscriptionData* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.LogSubscriptionData"; @@ -1336,9 +1333,6 @@ class LogSubscriptionData final : protected: explicit LogSubscriptionData(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1361,7 +1355,7 @@ class LogSubscriptionData final : template void set_log_level(ArgT0&& arg0, ArgT... args); std::string* mutable_log_level(); - PROTOBUF_MUST_USE_RESULT std::string* release_log_level(); + PROTOBUF_NODISCARD std::string* release_log_level(); void set_allocated_log_level(std::string* log_level); private: const std::string& _internal_log_level() const; @@ -1375,7 +1369,7 @@ class LogSubscriptionData final : template void set_message(ArgT0&& arg0, ArgT... args); std::string* mutable_message(); - PROTOBUF_MUST_USE_RESULT std::string* release_message(); + PROTOBUF_NODISCARD std::string* release_message(); void set_allocated_message(std::string* message); private: const std::string& _internal_message() const; @@ -1383,13 +1377,13 @@ class LogSubscriptionData final : std::string* _internal_mutable_message(); public: - // int64 micros = 1; + // int64 micros = 1 [jstype = JS_STRING]; void clear_micros(); - ::PROTOBUF_NAMESPACE_ID::int64 micros() const; - void set_micros(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t micros() const; + void set_micros(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_micros() const; - void _internal_set_micros(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_micros() const; + void _internal_set_micros(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) @@ -1401,7 +1395,7 @@ class LogSubscriptionData final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr log_level_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_; - ::PROTOBUF_NAMESPACE_ID::int64 micros_; + int64_t micros_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -1412,7 +1406,7 @@ class ExecuteCommandRequest final : public: inline ExecuteCommandRequest() : ExecuteCommandRequest(nullptr) {} ~ExecuteCommandRequest() override; - explicit constexpr ExecuteCommandRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExecuteCommandRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExecuteCommandRequest(const ExecuteCommandRequest& from); ExecuteCommandRequest(ExecuteCommandRequest&& from) noexcept @@ -1462,7 +1456,12 @@ class ExecuteCommandRequest final : } inline void Swap(ExecuteCommandRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1476,11 +1475,7 @@ class ExecuteCommandRequest final : // implements Message ---------------------------------------------- - inline ExecuteCommandRequest* New() const final { - return new ExecuteCommandRequest(); - } - - ExecuteCommandRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExecuteCommandRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1495,8 +1490,8 @@ class ExecuteCommandRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1504,6 +1499,8 @@ class ExecuteCommandRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExecuteCommandRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest"; @@ -1511,9 +1508,6 @@ class ExecuteCommandRequest final : protected: explicit ExecuteCommandRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1535,7 +1529,7 @@ class ExecuteCommandRequest final : template void set_code(ArgT0&& arg0, ArgT... args); std::string* mutable_code(); - PROTOBUF_MUST_USE_RESULT std::string* release_code(); + PROTOBUF_NODISCARD std::string* release_code(); void set_allocated_code(std::string* code); private: const std::string& _internal_code() const; @@ -1550,7 +1544,7 @@ class ExecuteCommandRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -1580,7 +1574,7 @@ class ExecuteCommandResponse final : public: inline ExecuteCommandResponse() : ExecuteCommandResponse(nullptr) {} ~ExecuteCommandResponse() override; - explicit constexpr ExecuteCommandResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExecuteCommandResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExecuteCommandResponse(const ExecuteCommandResponse& from); ExecuteCommandResponse(ExecuteCommandResponse&& from) noexcept @@ -1630,7 +1624,12 @@ class ExecuteCommandResponse final : } inline void Swap(ExecuteCommandResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1644,11 +1643,7 @@ class ExecuteCommandResponse final : // implements Message ---------------------------------------------- - inline ExecuteCommandResponse* New() const final { - return new ExecuteCommandResponse(); - } - - ExecuteCommandResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExecuteCommandResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1663,8 +1658,8 @@ class ExecuteCommandResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1672,6 +1667,8 @@ class ExecuteCommandResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExecuteCommandResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse"; @@ -1679,9 +1676,6 @@ class ExecuteCommandResponse final : protected: explicit ExecuteCommandResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1703,7 +1697,7 @@ class ExecuteCommandResponse final : template void set_error_message(ArgT0&& arg0, ArgT... args); std::string* mutable_error_message(); - PROTOBUF_MUST_USE_RESULT std::string* release_error_message(); + PROTOBUF_NODISCARD std::string* release_error_message(); void set_allocated_error_message(std::string* error_message); private: const std::string& _internal_error_message() const; @@ -1718,7 +1712,7 @@ class ExecuteCommandResponse final : public: void clear_changes(); const ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate& changes() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* release_changes(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* release_changes(); ::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* mutable_changes(); void set_allocated_changes(::io::deephaven::proto::backplane::grpc::FieldsChangeUpdate* changes); private: @@ -1748,7 +1742,7 @@ class BindTableToVariableRequest final : public: inline BindTableToVariableRequest() : BindTableToVariableRequest(nullptr) {} ~BindTableToVariableRequest() override; - explicit constexpr BindTableToVariableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BindTableToVariableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BindTableToVariableRequest(const BindTableToVariableRequest& from); BindTableToVariableRequest(BindTableToVariableRequest&& from) noexcept @@ -1798,7 +1792,12 @@ class BindTableToVariableRequest final : } inline void Swap(BindTableToVariableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1812,11 +1811,7 @@ class BindTableToVariableRequest final : // implements Message ---------------------------------------------- - inline BindTableToVariableRequest* New() const final { - return new BindTableToVariableRequest(); - } - - BindTableToVariableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + BindTableToVariableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1831,8 +1826,8 @@ class BindTableToVariableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1840,6 +1835,8 @@ class BindTableToVariableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(BindTableToVariableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest"; @@ -1847,9 +1844,6 @@ class BindTableToVariableRequest final : protected: explicit BindTableToVariableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1872,7 +1866,7 @@ class BindTableToVariableRequest final : template void set_variable_name(ArgT0&& arg0, ArgT... args); std::string* mutable_variable_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_variable_name(); + PROTOBUF_NODISCARD std::string* release_variable_name(); void set_allocated_variable_name(std::string* variable_name); private: const std::string& _internal_variable_name() const; @@ -1887,7 +1881,7 @@ class BindTableToVariableRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -1905,7 +1899,7 @@ class BindTableToVariableRequest final : public: void clear_table_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& table_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_table_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_table_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_table_id(); void set_allocated_table_id(::io::deephaven::proto::backplane::grpc::Ticket* table_id); private: @@ -1935,7 +1929,7 @@ class BindTableToVariableResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse) */ { public: inline BindTableToVariableResponse() : BindTableToVariableResponse(nullptr) {} - explicit constexpr BindTableToVariableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BindTableToVariableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BindTableToVariableResponse(const BindTableToVariableResponse& from); BindTableToVariableResponse(BindTableToVariableResponse&& from) noexcept @@ -1985,7 +1979,12 @@ class BindTableToVariableResponse final : } inline void Swap(BindTableToVariableResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1999,11 +1998,7 @@ class BindTableToVariableResponse final : // implements Message ---------------------------------------------- - inline BindTableToVariableResponse* New() const final { - return new BindTableToVariableResponse(); - } - - BindTableToVariableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + BindTableToVariableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -2015,6 +2010,8 @@ class BindTableToVariableResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse"; @@ -2022,7 +2019,6 @@ class BindTableToVariableResponse final : protected: explicit BindTableToVariableResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -2041,7 +2037,6 @@ class BindTableToVariableResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -2051,7 +2046,7 @@ class CancelCommandRequest final : public: inline CancelCommandRequest() : CancelCommandRequest(nullptr) {} ~CancelCommandRequest() override; - explicit constexpr CancelCommandRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CancelCommandRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CancelCommandRequest(const CancelCommandRequest& from); CancelCommandRequest(CancelCommandRequest&& from) noexcept @@ -2101,7 +2096,12 @@ class CancelCommandRequest final : } inline void Swap(CancelCommandRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2115,11 +2115,7 @@ class CancelCommandRequest final : // implements Message ---------------------------------------------- - inline CancelCommandRequest* New() const final { - return new CancelCommandRequest(); - } - - CancelCommandRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CancelCommandRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2134,8 +2130,8 @@ class CancelCommandRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2143,6 +2139,8 @@ class CancelCommandRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CancelCommandRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.CancelCommandRequest"; @@ -2150,9 +2148,6 @@ class CancelCommandRequest final : protected: explicit CancelCommandRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2175,7 +2170,7 @@ class CancelCommandRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -2193,7 +2188,7 @@ class CancelCommandRequest final : public: void clear_command_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& command_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_command_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_command_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_command_id(); void set_allocated_command_id(::io::deephaven::proto::backplane::grpc::Ticket* command_id); private: @@ -2222,7 +2217,7 @@ class CancelCommandResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.script.grpc.CancelCommandResponse) */ { public: inline CancelCommandResponse() : CancelCommandResponse(nullptr) {} - explicit constexpr CancelCommandResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CancelCommandResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CancelCommandResponse(const CancelCommandResponse& from); CancelCommandResponse(CancelCommandResponse&& from) noexcept @@ -2272,7 +2267,12 @@ class CancelCommandResponse final : } inline void Swap(CancelCommandResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2286,11 +2286,7 @@ class CancelCommandResponse final : // implements Message ---------------------------------------------- - inline CancelCommandResponse* New() const final { - return new CancelCommandResponse(); - } - - CancelCommandResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CancelCommandResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -2302,6 +2298,8 @@ class CancelCommandResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.CancelCommandResponse"; @@ -2309,7 +2307,6 @@ class CancelCommandResponse final : protected: explicit CancelCommandResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -2328,7 +2325,6 @@ class CancelCommandResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -2338,7 +2334,7 @@ class AutoCompleteRequest final : public: inline AutoCompleteRequest() : AutoCompleteRequest(nullptr) {} ~AutoCompleteRequest() override; - explicit constexpr AutoCompleteRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AutoCompleteRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AutoCompleteRequest(const AutoCompleteRequest& from); AutoCompleteRequest(AutoCompleteRequest&& from) noexcept @@ -2396,7 +2392,12 @@ class AutoCompleteRequest final : } inline void Swap(AutoCompleteRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2410,11 +2411,7 @@ class AutoCompleteRequest final : // implements Message ---------------------------------------------- - inline AutoCompleteRequest* New() const final { - return new AutoCompleteRequest(); - } - - AutoCompleteRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AutoCompleteRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2429,8 +2426,8 @@ class AutoCompleteRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2438,6 +2435,8 @@ class AutoCompleteRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(AutoCompleteRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest"; @@ -2445,9 +2444,6 @@ class AutoCompleteRequest final : protected: explicit AutoCompleteRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2472,7 +2468,7 @@ class AutoCompleteRequest final : public: void clear_open_document(); const ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest& open_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* release_open_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* release_open_document(); ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* mutable_open_document(); void set_allocated_open_document(::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* open_document); private: @@ -2490,7 +2486,7 @@ class AutoCompleteRequest final : public: void clear_change_document(); const ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest& change_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* release_change_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* release_change_document(); ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* mutable_change_document(); void set_allocated_change_document(::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* change_document); private: @@ -2508,7 +2504,7 @@ class AutoCompleteRequest final : public: void clear_get_completion_items(); const ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest& get_completion_items() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* release_get_completion_items(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* release_get_completion_items(); ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* mutable_get_completion_items(); void set_allocated_get_completion_items(::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* get_completion_items); private: @@ -2526,7 +2522,7 @@ class AutoCompleteRequest final : public: void clear_close_document(); const ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest& close_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* release_close_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* release_close_document(); ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* mutable_close_document(); void set_allocated_close_document(::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* close_document); private: @@ -2562,7 +2558,7 @@ class AutoCompleteRequest final : ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* close_document_; } request_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -2573,7 +2569,7 @@ class AutoCompleteResponse final : public: inline AutoCompleteResponse() : AutoCompleteResponse(nullptr) {} ~AutoCompleteResponse() override; - explicit constexpr AutoCompleteResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AutoCompleteResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AutoCompleteResponse(const AutoCompleteResponse& from); AutoCompleteResponse(AutoCompleteResponse&& from) noexcept @@ -2628,7 +2624,12 @@ class AutoCompleteResponse final : } inline void Swap(AutoCompleteResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2642,11 +2643,7 @@ class AutoCompleteResponse final : // implements Message ---------------------------------------------- - inline AutoCompleteResponse* New() const final { - return new AutoCompleteResponse(); - } - - AutoCompleteResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AutoCompleteResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2661,8 +2658,8 @@ class AutoCompleteResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2670,6 +2667,8 @@ class AutoCompleteResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(AutoCompleteResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse"; @@ -2677,9 +2676,6 @@ class AutoCompleteResponse final : protected: explicit AutoCompleteResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2701,7 +2697,7 @@ class AutoCompleteResponse final : public: void clear_completion_items(); const ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse& completion_items() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* release_completion_items(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* release_completion_items(); ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* mutable_completion_items(); void set_allocated_completion_items(::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* completion_items); private: @@ -2731,7 +2727,7 @@ class AutoCompleteResponse final : ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* completion_items_; } response_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -2741,7 +2737,7 @@ class BrowserNextResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.script.grpc.BrowserNextResponse) */ { public: inline BrowserNextResponse() : BrowserNextResponse(nullptr) {} - explicit constexpr BrowserNextResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BrowserNextResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BrowserNextResponse(const BrowserNextResponse& from); BrowserNextResponse(BrowserNextResponse&& from) noexcept @@ -2791,7 +2787,12 @@ class BrowserNextResponse final : } inline void Swap(BrowserNextResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2805,11 +2806,7 @@ class BrowserNextResponse final : // implements Message ---------------------------------------------- - inline BrowserNextResponse* New() const final { - return new BrowserNextResponse(); - } - - BrowserNextResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + BrowserNextResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -2821,6 +2818,8 @@ class BrowserNextResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.BrowserNextResponse"; @@ -2828,7 +2827,6 @@ class BrowserNextResponse final : protected: explicit BrowserNextResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -2847,7 +2845,6 @@ class BrowserNextResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -2857,7 +2854,7 @@ class OpenDocumentRequest final : public: inline OpenDocumentRequest() : OpenDocumentRequest(nullptr) {} ~OpenDocumentRequest() override; - explicit constexpr OpenDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR OpenDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); OpenDocumentRequest(const OpenDocumentRequest& from); OpenDocumentRequest(OpenDocumentRequest&& from) noexcept @@ -2907,7 +2904,12 @@ class OpenDocumentRequest final : } inline void Swap(OpenDocumentRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2921,11 +2923,7 @@ class OpenDocumentRequest final : // implements Message ---------------------------------------------- - inline OpenDocumentRequest* New() const final { - return new OpenDocumentRequest(); - } - - OpenDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + OpenDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2940,8 +2938,8 @@ class OpenDocumentRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2949,6 +2947,8 @@ class OpenDocumentRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(OpenDocumentRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest"; @@ -2956,9 +2956,6 @@ class OpenDocumentRequest final : protected: explicit OpenDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2981,7 +2978,7 @@ class OpenDocumentRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -2999,7 +2996,7 @@ class OpenDocumentRequest final : public: void clear_text_document(); const ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem& text_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* release_text_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* release_text_document(); ::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* mutable_text_document(); void set_allocated_text_document(::io::deephaven::proto::backplane::script::grpc::TextDocumentItem* text_document); private: @@ -3029,7 +3026,7 @@ class TextDocumentItem final : public: inline TextDocumentItem() : TextDocumentItem(nullptr) {} ~TextDocumentItem() override; - explicit constexpr TextDocumentItem(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TextDocumentItem(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TextDocumentItem(const TextDocumentItem& from); TextDocumentItem(TextDocumentItem&& from) noexcept @@ -3079,7 +3076,12 @@ class TextDocumentItem final : } inline void Swap(TextDocumentItem* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3093,11 +3095,7 @@ class TextDocumentItem final : // implements Message ---------------------------------------------- - inline TextDocumentItem* New() const final { - return new TextDocumentItem(); - } - - TextDocumentItem* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TextDocumentItem* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3112,8 +3110,8 @@ class TextDocumentItem final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3121,6 +3119,8 @@ class TextDocumentItem final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TextDocumentItem* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.TextDocumentItem"; @@ -3128,9 +3128,6 @@ class TextDocumentItem final : protected: explicit TextDocumentItem(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3154,7 +3151,7 @@ class TextDocumentItem final : template void set_uri(ArgT0&& arg0, ArgT... args); std::string* mutable_uri(); - PROTOBUF_MUST_USE_RESULT std::string* release_uri(); + PROTOBUF_NODISCARD std::string* release_uri(); void set_allocated_uri(std::string* uri); private: const std::string& _internal_uri() const; @@ -3168,7 +3165,7 @@ class TextDocumentItem final : template void set_language_id(ArgT0&& arg0, ArgT... args); std::string* mutable_language_id(); - PROTOBUF_MUST_USE_RESULT std::string* release_language_id(); + PROTOBUF_NODISCARD std::string* release_language_id(); void set_allocated_language_id(std::string* language_id); private: const std::string& _internal_language_id() const; @@ -3182,7 +3179,7 @@ class TextDocumentItem final : template void set_text(ArgT0&& arg0, ArgT... args); std::string* mutable_text(); - PROTOBUF_MUST_USE_RESULT std::string* release_text(); + PROTOBUF_NODISCARD std::string* release_text(); void set_allocated_text(std::string* text); private: const std::string& _internal_text() const; @@ -3192,11 +3189,11 @@ class TextDocumentItem final : // int32 version = 3; void clear_version(); - ::PROTOBUF_NAMESPACE_ID::int32 version() const; - void set_version(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t version() const; + void set_version(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_version() const; - void _internal_set_version(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_version() const; + void _internal_set_version(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) @@ -3209,7 +3206,7 @@ class TextDocumentItem final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr language_id_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; - ::PROTOBUF_NAMESPACE_ID::int32 version_; + int32_t version_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -3220,7 +3217,7 @@ class CloseDocumentRequest final : public: inline CloseDocumentRequest() : CloseDocumentRequest(nullptr) {} ~CloseDocumentRequest() override; - explicit constexpr CloseDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CloseDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CloseDocumentRequest(const CloseDocumentRequest& from); CloseDocumentRequest(CloseDocumentRequest&& from) noexcept @@ -3270,7 +3267,12 @@ class CloseDocumentRequest final : } inline void Swap(CloseDocumentRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3284,11 +3286,7 @@ class CloseDocumentRequest final : // implements Message ---------------------------------------------- - inline CloseDocumentRequest* New() const final { - return new CloseDocumentRequest(); - } - - CloseDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CloseDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3303,8 +3301,8 @@ class CloseDocumentRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3312,6 +3310,8 @@ class CloseDocumentRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CloseDocumentRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest"; @@ -3319,9 +3319,6 @@ class CloseDocumentRequest final : protected: explicit CloseDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3344,7 +3341,7 @@ class CloseDocumentRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -3362,7 +3359,7 @@ class CloseDocumentRequest final : public: void clear_text_document(); const ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier& text_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* mutable_text_document(); void set_allocated_text_document(::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* text_document); private: @@ -3392,7 +3389,7 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : public: inline ChangeDocumentRequest_TextDocumentContentChangeEvent() : ChangeDocumentRequest_TextDocumentContentChangeEvent(nullptr) {} ~ChangeDocumentRequest_TextDocumentContentChangeEvent() override; - explicit constexpr ChangeDocumentRequest_TextDocumentContentChangeEvent(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ChangeDocumentRequest_TextDocumentContentChangeEvent(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ChangeDocumentRequest_TextDocumentContentChangeEvent(const ChangeDocumentRequest_TextDocumentContentChangeEvent& from); ChangeDocumentRequest_TextDocumentContentChangeEvent(ChangeDocumentRequest_TextDocumentContentChangeEvent&& from) noexcept @@ -3442,7 +3439,12 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : } inline void Swap(ChangeDocumentRequest_TextDocumentContentChangeEvent* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3456,11 +3458,7 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : // implements Message ---------------------------------------------- - inline ChangeDocumentRequest_TextDocumentContentChangeEvent* New() const final { - return new ChangeDocumentRequest_TextDocumentContentChangeEvent(); - } - - ChangeDocumentRequest_TextDocumentContentChangeEvent* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ChangeDocumentRequest_TextDocumentContentChangeEvent* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3475,8 +3473,8 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3484,6 +3482,8 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ChangeDocumentRequest_TextDocumentContentChangeEvent* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent"; @@ -3491,9 +3491,6 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : protected: explicit ChangeDocumentRequest_TextDocumentContentChangeEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3516,7 +3513,7 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : template void set_text(ArgT0&& arg0, ArgT... args); std::string* mutable_text(); - PROTOBUF_MUST_USE_RESULT std::string* release_text(); + PROTOBUF_NODISCARD std::string* release_text(); void set_allocated_text(std::string* text); private: const std::string& _internal_text() const; @@ -3531,7 +3528,7 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : public: void clear_range(); const ::io::deephaven::proto::backplane::script::grpc::DocumentRange& range() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::DocumentRange* release_range(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::DocumentRange* release_range(); ::io::deephaven::proto::backplane::script::grpc::DocumentRange* mutable_range(); void set_allocated_range(::io::deephaven::proto::backplane::script::grpc::DocumentRange* range); private: @@ -3544,11 +3541,11 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : // int32 range_length = 2; void clear_range_length(); - ::PROTOBUF_NAMESPACE_ID::int32 range_length() const; - void set_range_length(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t range_length() const; + void set_range_length(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_range_length() const; - void _internal_set_range_length(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_range_length() const; + void _internal_set_range_length(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) @@ -3560,7 +3557,7 @@ class ChangeDocumentRequest_TextDocumentContentChangeEvent final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; ::io::deephaven::proto::backplane::script::grpc::DocumentRange* range_; - ::PROTOBUF_NAMESPACE_ID::int32 range_length_; + int32_t range_length_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -3571,7 +3568,7 @@ class ChangeDocumentRequest final : public: inline ChangeDocumentRequest() : ChangeDocumentRequest(nullptr) {} ~ChangeDocumentRequest() override; - explicit constexpr ChangeDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ChangeDocumentRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ChangeDocumentRequest(const ChangeDocumentRequest& from); ChangeDocumentRequest(ChangeDocumentRequest&& from) noexcept @@ -3621,7 +3618,12 @@ class ChangeDocumentRequest final : } inline void Swap(ChangeDocumentRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3635,11 +3637,7 @@ class ChangeDocumentRequest final : // implements Message ---------------------------------------------- - inline ChangeDocumentRequest* New() const final { - return new ChangeDocumentRequest(); - } - - ChangeDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ChangeDocumentRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3654,8 +3652,8 @@ class ChangeDocumentRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3663,6 +3661,8 @@ class ChangeDocumentRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ChangeDocumentRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest"; @@ -3670,9 +3670,6 @@ class ChangeDocumentRequest final : protected: explicit ChangeDocumentRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3716,7 +3713,7 @@ class ChangeDocumentRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -3734,7 +3731,7 @@ class ChangeDocumentRequest final : public: void clear_text_document(); const ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier& text_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* mutable_text_document(); void set_allocated_text_document(::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* text_document); private: @@ -3765,7 +3762,7 @@ class DocumentRange final : public: inline DocumentRange() : DocumentRange(nullptr) {} ~DocumentRange() override; - explicit constexpr DocumentRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DocumentRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DocumentRange(const DocumentRange& from); DocumentRange(DocumentRange&& from) noexcept @@ -3815,7 +3812,12 @@ class DocumentRange final : } inline void Swap(DocumentRange* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3829,11 +3831,7 @@ class DocumentRange final : // implements Message ---------------------------------------------- - inline DocumentRange* New() const final { - return new DocumentRange(); - } - - DocumentRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + DocumentRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3848,8 +3846,8 @@ class DocumentRange final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3857,6 +3855,8 @@ class DocumentRange final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DocumentRange* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.DocumentRange"; @@ -3864,9 +3864,6 @@ class DocumentRange final : protected: explicit DocumentRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3889,7 +3886,7 @@ class DocumentRange final : public: void clear_start(); const ::io::deephaven::proto::backplane::script::grpc::Position& start() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::Position* release_start(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::Position* release_start(); ::io::deephaven::proto::backplane::script::grpc::Position* mutable_start(); void set_allocated_start(::io::deephaven::proto::backplane::script::grpc::Position* start); private: @@ -3907,7 +3904,7 @@ class DocumentRange final : public: void clear_end(); const ::io::deephaven::proto::backplane::script::grpc::Position& end() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::Position* release_end(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::Position* release_end(); ::io::deephaven::proto::backplane::script::grpc::Position* mutable_end(); void set_allocated_end(::io::deephaven::proto::backplane::script::grpc::Position* end); private: @@ -3937,7 +3934,7 @@ class VersionedTextDocumentIdentifier final : public: inline VersionedTextDocumentIdentifier() : VersionedTextDocumentIdentifier(nullptr) {} ~VersionedTextDocumentIdentifier() override; - explicit constexpr VersionedTextDocumentIdentifier(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR VersionedTextDocumentIdentifier(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); VersionedTextDocumentIdentifier(const VersionedTextDocumentIdentifier& from); VersionedTextDocumentIdentifier(VersionedTextDocumentIdentifier&& from) noexcept @@ -3987,7 +3984,12 @@ class VersionedTextDocumentIdentifier final : } inline void Swap(VersionedTextDocumentIdentifier* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4001,11 +4003,7 @@ class VersionedTextDocumentIdentifier final : // implements Message ---------------------------------------------- - inline VersionedTextDocumentIdentifier* New() const final { - return new VersionedTextDocumentIdentifier(); - } - - VersionedTextDocumentIdentifier* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + VersionedTextDocumentIdentifier* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4020,8 +4018,8 @@ class VersionedTextDocumentIdentifier final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4029,6 +4027,8 @@ class VersionedTextDocumentIdentifier final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(VersionedTextDocumentIdentifier* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier"; @@ -4036,9 +4036,6 @@ class VersionedTextDocumentIdentifier final : protected: explicit VersionedTextDocumentIdentifier(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4060,7 +4057,7 @@ class VersionedTextDocumentIdentifier final : template void set_uri(ArgT0&& arg0, ArgT... args); std::string* mutable_uri(); - PROTOBUF_MUST_USE_RESULT std::string* release_uri(); + PROTOBUF_NODISCARD std::string* release_uri(); void set_allocated_uri(std::string* uri); private: const std::string& _internal_uri() const; @@ -4070,11 +4067,11 @@ class VersionedTextDocumentIdentifier final : // int32 version = 2; void clear_version(); - ::PROTOBUF_NAMESPACE_ID::int32 version() const; - void set_version(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t version() const; + void set_version(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_version() const; - void _internal_set_version(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_version() const; + void _internal_set_version(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) @@ -4085,7 +4082,7 @@ class VersionedTextDocumentIdentifier final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; - ::PROTOBUF_NAMESPACE_ID::int32 version_; + int32_t version_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -4096,7 +4093,7 @@ class Position final : public: inline Position() : Position(nullptr) {} ~Position() override; - explicit constexpr Position(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Position(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Position(const Position& from); Position(Position&& from) noexcept @@ -4146,7 +4143,12 @@ class Position final : } inline void Swap(Position* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4160,11 +4162,7 @@ class Position final : // implements Message ---------------------------------------------- - inline Position* New() const final { - return new Position(); - } - - Position* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Position* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4179,8 +4177,8 @@ class Position final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4188,6 +4186,8 @@ class Position final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Position* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.Position"; @@ -4195,9 +4195,6 @@ class Position final : protected: explicit Position(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4215,20 +4212,20 @@ class Position final : }; // int32 line = 1; void clear_line(); - ::PROTOBUF_NAMESPACE_ID::int32 line() const; - void set_line(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t line() const; + void set_line(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_line() const; - void _internal_set_line(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_line() const; + void _internal_set_line(int32_t value); public: // int32 character = 2; void clear_character(); - ::PROTOBUF_NAMESPACE_ID::int32 character() const; - void set_character(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t character() const; + void set_character(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_character() const; - void _internal_set_character(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_character() const; + void _internal_set_character(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.Position) @@ -4238,8 +4235,8 @@ class Position final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::int32 line_; - ::PROTOBUF_NAMESPACE_ID::int32 character_; + int32_t line_; + int32_t character_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -4250,7 +4247,7 @@ class GetCompletionItemsRequest final : public: inline GetCompletionItemsRequest() : GetCompletionItemsRequest(nullptr) {} ~GetCompletionItemsRequest() override; - explicit constexpr GetCompletionItemsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GetCompletionItemsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GetCompletionItemsRequest(const GetCompletionItemsRequest& from); GetCompletionItemsRequest(GetCompletionItemsRequest&& from) noexcept @@ -4300,7 +4297,12 @@ class GetCompletionItemsRequest final : } inline void Swap(GetCompletionItemsRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4314,11 +4316,7 @@ class GetCompletionItemsRequest final : // implements Message ---------------------------------------------- - inline GetCompletionItemsRequest* New() const final { - return new GetCompletionItemsRequest(); - } - - GetCompletionItemsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + GetCompletionItemsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4333,8 +4331,8 @@ class GetCompletionItemsRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4342,6 +4340,8 @@ class GetCompletionItemsRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GetCompletionItemsRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest"; @@ -4349,9 +4349,6 @@ class GetCompletionItemsRequest final : protected: explicit GetCompletionItemsRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4377,7 +4374,7 @@ class GetCompletionItemsRequest final : public: void clear_console_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& console_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_console_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_console_id(); void set_allocated_console_id(::io::deephaven::proto::backplane::grpc::Ticket* console_id); private: @@ -4395,7 +4392,7 @@ class GetCompletionItemsRequest final : public: void clear_context(); const ::io::deephaven::proto::backplane::script::grpc::CompletionContext& context() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::CompletionContext* release_context(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::CompletionContext* release_context(); ::io::deephaven::proto::backplane::script::grpc::CompletionContext* mutable_context(); void set_allocated_context(::io::deephaven::proto::backplane::script::grpc::CompletionContext* context); private: @@ -4413,7 +4410,7 @@ class GetCompletionItemsRequest final : public: void clear_text_document(); const ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier& text_document() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* release_text_document(); ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* mutable_text_document(); void set_allocated_text_document(::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* text_document); private: @@ -4431,7 +4428,7 @@ class GetCompletionItemsRequest final : public: void clear_position(); const ::io::deephaven::proto::backplane::script::grpc::Position& position() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::Position* release_position(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::Position* release_position(); ::io::deephaven::proto::backplane::script::grpc::Position* mutable_position(); void set_allocated_position(::io::deephaven::proto::backplane::script::grpc::Position* position); private: @@ -4444,11 +4441,11 @@ class GetCompletionItemsRequest final : // int32 request_id = 5; void clear_request_id(); - ::PROTOBUF_NAMESPACE_ID::int32 request_id() const; - void set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t request_id() const; + void set_request_id(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_request_id() const; - void _internal_set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_request_id() const; + void _internal_set_request_id(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) @@ -4462,7 +4459,7 @@ class GetCompletionItemsRequest final : ::io::deephaven::proto::backplane::script::grpc::CompletionContext* context_; ::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier* text_document_; ::io::deephaven::proto::backplane::script::grpc::Position* position_; - ::PROTOBUF_NAMESPACE_ID::int32 request_id_; + int32_t request_id_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -4473,7 +4470,7 @@ class CompletionContext final : public: inline CompletionContext() : CompletionContext(nullptr) {} ~CompletionContext() override; - explicit constexpr CompletionContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CompletionContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CompletionContext(const CompletionContext& from); CompletionContext(CompletionContext&& from) noexcept @@ -4523,7 +4520,12 @@ class CompletionContext final : } inline void Swap(CompletionContext* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4537,11 +4539,7 @@ class CompletionContext final : // implements Message ---------------------------------------------- - inline CompletionContext* New() const final { - return new CompletionContext(); - } - - CompletionContext* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CompletionContext* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4556,8 +4554,8 @@ class CompletionContext final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4565,6 +4563,8 @@ class CompletionContext final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CompletionContext* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.CompletionContext"; @@ -4572,9 +4572,6 @@ class CompletionContext final : protected: explicit CompletionContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4596,7 +4593,7 @@ class CompletionContext final : template void set_trigger_character(ArgT0&& arg0, ArgT... args); std::string* mutable_trigger_character(); - PROTOBUF_MUST_USE_RESULT std::string* release_trigger_character(); + PROTOBUF_NODISCARD std::string* release_trigger_character(); void set_allocated_trigger_character(std::string* trigger_character); private: const std::string& _internal_trigger_character() const; @@ -4606,11 +4603,11 @@ class CompletionContext final : // int32 trigger_kind = 1; void clear_trigger_kind(); - ::PROTOBUF_NAMESPACE_ID::int32 trigger_kind() const; - void set_trigger_kind(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t trigger_kind() const; + void set_trigger_kind(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_trigger_kind() const; - void _internal_set_trigger_kind(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_trigger_kind() const; + void _internal_set_trigger_kind(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CompletionContext) @@ -4621,7 +4618,7 @@ class CompletionContext final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr trigger_character_; - ::PROTOBUF_NAMESPACE_ID::int32 trigger_kind_; + int32_t trigger_kind_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -4632,7 +4629,7 @@ class GetCompletionItemsResponse final : public: inline GetCompletionItemsResponse() : GetCompletionItemsResponse(nullptr) {} ~GetCompletionItemsResponse() override; - explicit constexpr GetCompletionItemsResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GetCompletionItemsResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GetCompletionItemsResponse(const GetCompletionItemsResponse& from); GetCompletionItemsResponse(GetCompletionItemsResponse&& from) noexcept @@ -4682,7 +4679,12 @@ class GetCompletionItemsResponse final : } inline void Swap(GetCompletionItemsResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4696,11 +4698,7 @@ class GetCompletionItemsResponse final : // implements Message ---------------------------------------------- - inline GetCompletionItemsResponse* New() const final { - return new GetCompletionItemsResponse(); - } - - GetCompletionItemsResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + GetCompletionItemsResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4715,8 +4713,8 @@ class GetCompletionItemsResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4724,6 +4722,8 @@ class GetCompletionItemsResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GetCompletionItemsResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse"; @@ -4731,9 +4731,6 @@ class GetCompletionItemsResponse final : protected: explicit GetCompletionItemsResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4770,11 +4767,11 @@ class GetCompletionItemsResponse final : // int32 request_id = 2; void clear_request_id(); - ::PROTOBUF_NAMESPACE_ID::int32 request_id() const; - void set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t request_id() const; + void set_request_id(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_request_id() const; - void _internal_set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_request_id() const; + void _internal_set_request_id(int32_t value); public: // bool success = 3; @@ -4794,7 +4791,7 @@ class GetCompletionItemsResponse final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::io::deephaven::proto::backplane::script::grpc::CompletionItem > items_; - ::PROTOBUF_NAMESPACE_ID::int32 request_id_; + int32_t request_id_; bool success_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; @@ -4806,7 +4803,7 @@ class CompletionItem final : public: inline CompletionItem() : CompletionItem(nullptr) {} ~CompletionItem() override; - explicit constexpr CompletionItem(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CompletionItem(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CompletionItem(const CompletionItem& from); CompletionItem(CompletionItem&& from) noexcept @@ -4856,7 +4853,12 @@ class CompletionItem final : } inline void Swap(CompletionItem* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4870,11 +4872,7 @@ class CompletionItem final : // implements Message ---------------------------------------------- - inline CompletionItem* New() const final { - return new CompletionItem(); - } - - CompletionItem* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CompletionItem* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4889,8 +4887,8 @@ class CompletionItem final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4898,6 +4896,8 @@ class CompletionItem final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CompletionItem* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.CompletionItem"; @@ -4905,9 +4905,6 @@ class CompletionItem final : protected: explicit CompletionItem(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4983,7 +4980,7 @@ class CompletionItem final : template void set_label(ArgT0&& arg0, ArgT... args); std::string* mutable_label(); - PROTOBUF_MUST_USE_RESULT std::string* release_label(); + PROTOBUF_NODISCARD std::string* release_label(); void set_allocated_label(std::string* label); private: const std::string& _internal_label() const; @@ -4997,7 +4994,7 @@ class CompletionItem final : template void set_detail(ArgT0&& arg0, ArgT... args); std::string* mutable_detail(); - PROTOBUF_MUST_USE_RESULT std::string* release_detail(); + PROTOBUF_NODISCARD std::string* release_detail(); void set_allocated_detail(std::string* detail); private: const std::string& _internal_detail() const; @@ -5011,7 +5008,7 @@ class CompletionItem final : template void set_documentation(ArgT0&& arg0, ArgT... args); std::string* mutable_documentation(); - PROTOBUF_MUST_USE_RESULT std::string* release_documentation(); + PROTOBUF_NODISCARD std::string* release_documentation(); void set_allocated_documentation(std::string* documentation); private: const std::string& _internal_documentation() const; @@ -5025,7 +5022,7 @@ class CompletionItem final : template void set_sort_text(ArgT0&& arg0, ArgT... args); std::string* mutable_sort_text(); - PROTOBUF_MUST_USE_RESULT std::string* release_sort_text(); + PROTOBUF_NODISCARD std::string* release_sort_text(); void set_allocated_sort_text(std::string* sort_text); private: const std::string& _internal_sort_text() const; @@ -5039,7 +5036,7 @@ class CompletionItem final : template void set_filter_text(ArgT0&& arg0, ArgT... args); std::string* mutable_filter_text(); - PROTOBUF_MUST_USE_RESULT std::string* release_filter_text(); + PROTOBUF_NODISCARD std::string* release_filter_text(); void set_allocated_filter_text(std::string* filter_text); private: const std::string& _internal_filter_text() const; @@ -5054,7 +5051,7 @@ class CompletionItem final : public: void clear_text_edit(); const ::io::deephaven::proto::backplane::script::grpc::TextEdit& text_edit() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::TextEdit* release_text_edit(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::TextEdit* release_text_edit(); ::io::deephaven::proto::backplane::script::grpc::TextEdit* mutable_text_edit(); void set_allocated_text_edit(::io::deephaven::proto::backplane::script::grpc::TextEdit* text_edit); private: @@ -5067,29 +5064,29 @@ class CompletionItem final : // int32 start = 1; void clear_start(); - ::PROTOBUF_NAMESPACE_ID::int32 start() const; - void set_start(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t start() const; + void set_start(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_start() const; - void _internal_set_start(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_start() const; + void _internal_set_start(int32_t value); public: // int32 length = 2; void clear_length(); - ::PROTOBUF_NAMESPACE_ID::int32 length() const; - void set_length(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t length() const; + void set_length(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_length() const; - void _internal_set_length(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_length() const; + void _internal_set_length(int32_t value); public: // int32 kind = 4; void clear_kind(); - ::PROTOBUF_NAMESPACE_ID::int32 kind() const; - void set_kind(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t kind() const; + void set_kind(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_kind() const; - void _internal_set_kind(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_kind() const; + void _internal_set_kind(int32_t value); public: // bool deprecated = 7; @@ -5112,11 +5109,11 @@ class CompletionItem final : // int32 insert_text_format = 12; void clear_insert_text_format(); - ::PROTOBUF_NAMESPACE_ID::int32 insert_text_format() const; - void set_insert_text_format(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t insert_text_format() const; + void set_insert_text_format(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_insert_text_format() const; - void _internal_set_insert_text_format(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_insert_text_format() const; + void _internal_set_insert_text_format(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CompletionItem) @@ -5134,12 +5131,12 @@ class CompletionItem final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sort_text_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filter_text_; ::io::deephaven::proto::backplane::script::grpc::TextEdit* text_edit_; - ::PROTOBUF_NAMESPACE_ID::int32 start_; - ::PROTOBUF_NAMESPACE_ID::int32 length_; - ::PROTOBUF_NAMESPACE_ID::int32 kind_; + int32_t start_; + int32_t length_; + int32_t kind_; bool deprecated_; bool preselect_; - ::PROTOBUF_NAMESPACE_ID::int32 insert_text_format_; + int32_t insert_text_format_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -5150,7 +5147,7 @@ class TextEdit final : public: inline TextEdit() : TextEdit(nullptr) {} ~TextEdit() override; - explicit constexpr TextEdit(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TextEdit(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TextEdit(const TextEdit& from); TextEdit(TextEdit&& from) noexcept @@ -5200,7 +5197,12 @@ class TextEdit final : } inline void Swap(TextEdit* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5214,11 +5216,7 @@ class TextEdit final : // implements Message ---------------------------------------------- - inline TextEdit* New() const final { - return new TextEdit(); - } - - TextEdit* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TextEdit* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5233,8 +5231,8 @@ class TextEdit final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5242,6 +5240,8 @@ class TextEdit final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TextEdit* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.TextEdit"; @@ -5249,9 +5249,6 @@ class TextEdit final : protected: explicit TextEdit(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5273,7 +5270,7 @@ class TextEdit final : template void set_text(ArgT0&& arg0, ArgT... args); std::string* mutable_text(); - PROTOBUF_MUST_USE_RESULT std::string* release_text(); + PROTOBUF_NODISCARD std::string* release_text(); void set_allocated_text(std::string* text); private: const std::string& _internal_text() const; @@ -5288,7 +5285,7 @@ class TextEdit final : public: void clear_range(); const ::io::deephaven::proto::backplane::script::grpc::DocumentRange& range() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::DocumentRange* release_range(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::DocumentRange* release_range(); ::io::deephaven::proto::backplane::script::grpc::DocumentRange* mutable_range(); void set_allocated_range(::io::deephaven::proto::backplane::script::grpc::DocumentRange* range); private: @@ -5318,7 +5315,7 @@ class FigureDescriptor_ChartDescriptor final : public: inline FigureDescriptor_ChartDescriptor() : FigureDescriptor_ChartDescriptor(nullptr) {} ~FigureDescriptor_ChartDescriptor() override; - explicit constexpr FigureDescriptor_ChartDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_ChartDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_ChartDescriptor(const FigureDescriptor_ChartDescriptor& from); FigureDescriptor_ChartDescriptor(FigureDescriptor_ChartDescriptor&& from) noexcept @@ -5368,7 +5365,12 @@ class FigureDescriptor_ChartDescriptor final : } inline void Swap(FigureDescriptor_ChartDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5382,11 +5384,7 @@ class FigureDescriptor_ChartDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_ChartDescriptor* New() const final { - return new FigureDescriptor_ChartDescriptor(); - } - - FigureDescriptor_ChartDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_ChartDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5401,8 +5399,8 @@ class FigureDescriptor_ChartDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5410,6 +5408,8 @@ class FigureDescriptor_ChartDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_ChartDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor"; @@ -5417,9 +5417,6 @@ class FigureDescriptor_ChartDescriptor final : protected: explicit FigureDescriptor_ChartDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5442,6 +5439,8 @@ class FigureDescriptor_ChartDescriptor final : FigureDescriptor_ChartDescriptor_ChartType_XYZ; static constexpr ChartType CATEGORY_3D = FigureDescriptor_ChartDescriptor_ChartType_CATEGORY_3D; + static constexpr ChartType TREEMAP = + FigureDescriptor_ChartDescriptor_ChartType_TREEMAP; static inline bool ChartType_IsValid(int value) { return FigureDescriptor_ChartDescriptor_ChartType_IsValid(value); } @@ -5548,7 +5547,7 @@ class FigureDescriptor_ChartDescriptor final : template void set_title(ArgT0&& arg0, ArgT... args); std::string* mutable_title(); - PROTOBUF_MUST_USE_RESULT std::string* release_title(); + PROTOBUF_NODISCARD std::string* release_title(); void set_allocated_title(std::string* title); private: const std::string& _internal_title() const; @@ -5562,7 +5561,7 @@ class FigureDescriptor_ChartDescriptor final : template void set_title_font(ArgT0&& arg0, ArgT... args); std::string* mutable_title_font(); - PROTOBUF_MUST_USE_RESULT std::string* release_title_font(); + PROTOBUF_NODISCARD std::string* release_title_font(); void set_allocated_title_font(std::string* title_font); private: const std::string& _internal_title_font() const; @@ -5576,7 +5575,7 @@ class FigureDescriptor_ChartDescriptor final : template void set_title_color(ArgT0&& arg0, ArgT... args); std::string* mutable_title_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_title_color(); + PROTOBUF_NODISCARD std::string* release_title_color(); void set_allocated_title_color(std::string* title_color); private: const std::string& _internal_title_color() const; @@ -5590,7 +5589,7 @@ class FigureDescriptor_ChartDescriptor final : template void set_legend_font(ArgT0&& arg0, ArgT... args); std::string* mutable_legend_font(); - PROTOBUF_MUST_USE_RESULT std::string* release_legend_font(); + PROTOBUF_NODISCARD std::string* release_legend_font(); void set_allocated_legend_font(std::string* legend_font); private: const std::string& _internal_legend_font() const; @@ -5604,7 +5603,7 @@ class FigureDescriptor_ChartDescriptor final : template void set_legend_color(ArgT0&& arg0, ArgT... args); std::string* mutable_legend_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_legend_color(); + PROTOBUF_NODISCARD std::string* release_legend_color(); void set_allocated_legend_color(std::string* legend_color); private: const std::string& _internal_legend_color() const; @@ -5614,20 +5613,20 @@ class FigureDescriptor_ChartDescriptor final : // int32 colspan = 1; void clear_colspan(); - ::PROTOBUF_NAMESPACE_ID::int32 colspan() const; - void set_colspan(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t colspan() const; + void set_colspan(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_colspan() const; - void _internal_set_colspan(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_colspan() const; + void _internal_set_colspan(int32_t value); public: // int32 rowspan = 2; void clear_rowspan(); - ::PROTOBUF_NAMESPACE_ID::int32 rowspan() const; - void set_rowspan(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t rowspan() const; + void set_rowspan(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_rowspan() const; - void _internal_set_rowspan(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_rowspan() const; + void _internal_set_rowspan(int32_t value); public: // .io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType chart_type = 6; @@ -5674,8 +5673,8 @@ class FigureDescriptor_ChartDescriptor final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_color_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr legend_font_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr legend_color_; - ::PROTOBUF_NAMESPACE_ID::int32 colspan_; - ::PROTOBUF_NAMESPACE_ID::int32 rowspan_; + int32_t colspan_; + int32_t rowspan_; int chart_type_; bool show_legend_; bool is3d_; @@ -5688,7 +5687,7 @@ class FigureDescriptor_SeriesDescriptor final : public: inline FigureDescriptor_SeriesDescriptor() : FigureDescriptor_SeriesDescriptor(nullptr) {} ~FigureDescriptor_SeriesDescriptor() override; - explicit constexpr FigureDescriptor_SeriesDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_SeriesDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_SeriesDescriptor(const FigureDescriptor_SeriesDescriptor& from); FigureDescriptor_SeriesDescriptor(FigureDescriptor_SeriesDescriptor&& from) noexcept @@ -5738,7 +5737,12 @@ class FigureDescriptor_SeriesDescriptor final : } inline void Swap(FigureDescriptor_SeriesDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5752,11 +5756,7 @@ class FigureDescriptor_SeriesDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_SeriesDescriptor* New() const final { - return new FigureDescriptor_SeriesDescriptor(); - } - - FigureDescriptor_SeriesDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_SeriesDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5771,8 +5771,8 @@ class FigureDescriptor_SeriesDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5780,6 +5780,8 @@ class FigureDescriptor_SeriesDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_SeriesDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor"; @@ -5787,9 +5789,6 @@ class FigureDescriptor_SeriesDescriptor final : protected: explicit FigureDescriptor_SeriesDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5841,7 +5840,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_name(ArgT0&& arg0, ArgT... args); std::string* mutable_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_name(); + PROTOBUF_NODISCARD std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; @@ -5855,7 +5854,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_line_color(ArgT0&& arg0, ArgT... args); std::string* mutable_line_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_line_color(); + PROTOBUF_NODISCARD std::string* release_line_color(); void set_allocated_line_color(std::string* line_color); private: const std::string& _internal_line_color() const; @@ -5873,7 +5872,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_point_label_format(ArgT0&& arg0, ArgT... args); std::string* mutable_point_label_format(); - PROTOBUF_MUST_USE_RESULT std::string* release_point_label_format(); + PROTOBUF_NODISCARD std::string* release_point_label_format(); void set_allocated_point_label_format(std::string* point_label_format); private: const std::string& _internal_point_label_format() const; @@ -5891,7 +5890,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_x_tool_tip_pattern(ArgT0&& arg0, ArgT... args); std::string* mutable_x_tool_tip_pattern(); - PROTOBUF_MUST_USE_RESULT std::string* release_x_tool_tip_pattern(); + PROTOBUF_NODISCARD std::string* release_x_tool_tip_pattern(); void set_allocated_x_tool_tip_pattern(std::string* x_tool_tip_pattern); private: const std::string& _internal_x_tool_tip_pattern() const; @@ -5909,7 +5908,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_y_tool_tip_pattern(ArgT0&& arg0, ArgT... args); std::string* mutable_y_tool_tip_pattern(); - PROTOBUF_MUST_USE_RESULT std::string* release_y_tool_tip_pattern(); + PROTOBUF_NODISCARD std::string* release_y_tool_tip_pattern(); void set_allocated_y_tool_tip_pattern(std::string* y_tool_tip_pattern); private: const std::string& _internal_y_tool_tip_pattern() const; @@ -5923,7 +5922,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_shape_label(ArgT0&& arg0, ArgT... args); std::string* mutable_shape_label(); - PROTOBUF_MUST_USE_RESULT std::string* release_shape_label(); + PROTOBUF_NODISCARD std::string* release_shape_label(); void set_allocated_shape_label(std::string* shape_label); private: const std::string& _internal_shape_label() const; @@ -5937,7 +5936,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_shape_color(ArgT0&& arg0, ArgT... args); std::string* mutable_shape_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_shape_color(); + PROTOBUF_NODISCARD std::string* release_shape_color(); void set_allocated_shape_color(std::string* shape_color); private: const std::string& _internal_shape_color() const; @@ -5951,7 +5950,7 @@ class FigureDescriptor_SeriesDescriptor final : template void set_shape(ArgT0&& arg0, ArgT... args); std::string* mutable_shape(); - PROTOBUF_MUST_USE_RESULT std::string* release_shape(); + PROTOBUF_NODISCARD std::string* release_shape(); void set_allocated_shape(std::string* shape); private: const std::string& _internal_shape() const; @@ -6048,7 +6047,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: inline FigureDescriptor_MultiSeriesDescriptor() : FigureDescriptor_MultiSeriesDescriptor(nullptr) {} ~FigureDescriptor_MultiSeriesDescriptor() override; - explicit constexpr FigureDescriptor_MultiSeriesDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_MultiSeriesDescriptor(const FigureDescriptor_MultiSeriesDescriptor& from); FigureDescriptor_MultiSeriesDescriptor(FigureDescriptor_MultiSeriesDescriptor&& from) noexcept @@ -6098,7 +6097,12 @@ class FigureDescriptor_MultiSeriesDescriptor final : } inline void Swap(FigureDescriptor_MultiSeriesDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6112,11 +6116,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_MultiSeriesDescriptor* New() const final { - return new FigureDescriptor_MultiSeriesDescriptor(); - } - - FigureDescriptor_MultiSeriesDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_MultiSeriesDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6131,8 +6131,8 @@ class FigureDescriptor_MultiSeriesDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6140,6 +6140,8 @@ class FigureDescriptor_MultiSeriesDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_MultiSeriesDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor"; @@ -6147,9 +6149,6 @@ class FigureDescriptor_MultiSeriesDescriptor final : protected: explicit FigureDescriptor_MultiSeriesDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6201,7 +6200,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : template void set_name(ArgT0&& arg0, ArgT... args); std::string* mutable_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_name(); + PROTOBUF_NODISCARD std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; @@ -6216,7 +6215,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_line_color(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& line_color() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_line_color(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_line_color(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_line_color(); void set_allocated_line_color(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* line_color); private: @@ -6234,7 +6233,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_point_color(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& point_color() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_color(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_color(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_point_color(); void set_allocated_point_color(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* point_color); private: @@ -6252,7 +6251,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_lines_visible(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault& lines_visible() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_lines_visible(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_lines_visible(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* mutable_lines_visible(); void set_allocated_lines_visible(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* lines_visible); private: @@ -6270,7 +6269,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_points_visible(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault& points_visible() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_points_visible(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_points_visible(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* mutable_points_visible(); void set_allocated_points_visible(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* points_visible); private: @@ -6288,7 +6287,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_gradient_visible(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault& gradient_visible() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_gradient_visible(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* release_gradient_visible(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* mutable_gradient_visible(); void set_allocated_gradient_visible(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault* gradient_visible); private: @@ -6306,7 +6305,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_point_label_format(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& point_label_format() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_label_format(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_label_format(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_point_label_format(); void set_allocated_point_label_format(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* point_label_format); private: @@ -6324,7 +6323,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_x_tool_tip_pattern(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& x_tool_tip_pattern() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_x_tool_tip_pattern(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_x_tool_tip_pattern(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_x_tool_tip_pattern(); void set_allocated_x_tool_tip_pattern(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* x_tool_tip_pattern); private: @@ -6342,7 +6341,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_y_tool_tip_pattern(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& y_tool_tip_pattern() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_y_tool_tip_pattern(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_y_tool_tip_pattern(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_y_tool_tip_pattern(); void set_allocated_y_tool_tip_pattern(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* y_tool_tip_pattern); private: @@ -6360,7 +6359,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_point_label(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& point_label() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_label(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_label(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_point_label(); void set_allocated_point_label(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* point_label); private: @@ -6378,7 +6377,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_point_size(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault& point_size() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* release_point_size(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* release_point_size(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* mutable_point_size(); void set_allocated_point_size(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault* point_size); private: @@ -6396,7 +6395,7 @@ class FigureDescriptor_MultiSeriesDescriptor final : public: void clear_point_shape(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault& point_shape() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_shape(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* release_point_shape(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* mutable_point_shape(); void set_allocated_point_shape(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault* point_shape); private: @@ -6447,7 +6446,7 @@ class FigureDescriptor_StringMapWithDefault final : public: inline FigureDescriptor_StringMapWithDefault() : FigureDescriptor_StringMapWithDefault(nullptr) {} ~FigureDescriptor_StringMapWithDefault() override; - explicit constexpr FigureDescriptor_StringMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_StringMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_StringMapWithDefault(const FigureDescriptor_StringMapWithDefault& from); FigureDescriptor_StringMapWithDefault(FigureDescriptor_StringMapWithDefault&& from) noexcept @@ -6497,7 +6496,12 @@ class FigureDescriptor_StringMapWithDefault final : } inline void Swap(FigureDescriptor_StringMapWithDefault* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6511,11 +6515,7 @@ class FigureDescriptor_StringMapWithDefault final : // implements Message ---------------------------------------------- - inline FigureDescriptor_StringMapWithDefault* New() const final { - return new FigureDescriptor_StringMapWithDefault(); - } - - FigureDescriptor_StringMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_StringMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6530,8 +6530,8 @@ class FigureDescriptor_StringMapWithDefault final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6539,6 +6539,8 @@ class FigureDescriptor_StringMapWithDefault final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_StringMapWithDefault* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault"; @@ -6546,9 +6548,6 @@ class FigureDescriptor_StringMapWithDefault final : protected: explicit FigureDescriptor_StringMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6613,13 +6612,17 @@ class FigureDescriptor_StringMapWithDefault final : std::string* _internal_add_values(); public: - // string default_string = 1; + // optional string default_string = 1; + bool has_default_string() const; + private: + bool _internal_has_default_string() const; + public: void clear_default_string(); const std::string& default_string() const; template void set_default_string(ArgT0&& arg0, ArgT... args); std::string* mutable_default_string(); - PROTOBUF_MUST_USE_RESULT std::string* release_default_string(); + PROTOBUF_NODISCARD std::string* release_default_string(); void set_allocated_default_string(std::string* default_string); private: const std::string& _internal_default_string() const; @@ -6634,10 +6637,11 @@ class FigureDescriptor_StringMapWithDefault final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField keys_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField values_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_string_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -6647,7 +6651,7 @@ class FigureDescriptor_DoubleMapWithDefault final : public: inline FigureDescriptor_DoubleMapWithDefault() : FigureDescriptor_DoubleMapWithDefault(nullptr) {} ~FigureDescriptor_DoubleMapWithDefault() override; - explicit constexpr FigureDescriptor_DoubleMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_DoubleMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_DoubleMapWithDefault(const FigureDescriptor_DoubleMapWithDefault& from); FigureDescriptor_DoubleMapWithDefault(FigureDescriptor_DoubleMapWithDefault&& from) noexcept @@ -6697,7 +6701,12 @@ class FigureDescriptor_DoubleMapWithDefault final : } inline void Swap(FigureDescriptor_DoubleMapWithDefault* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6711,11 +6720,7 @@ class FigureDescriptor_DoubleMapWithDefault final : // implements Message ---------------------------------------------- - inline FigureDescriptor_DoubleMapWithDefault* New() const final { - return new FigureDescriptor_DoubleMapWithDefault(); - } - - FigureDescriptor_DoubleMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_DoubleMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6730,8 +6735,8 @@ class FigureDescriptor_DoubleMapWithDefault final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6739,6 +6744,8 @@ class FigureDescriptor_DoubleMapWithDefault final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_DoubleMapWithDefault* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault"; @@ -6746,9 +6753,6 @@ class FigureDescriptor_DoubleMapWithDefault final : protected: explicit FigureDescriptor_DoubleMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6811,7 +6815,11 @@ class FigureDescriptor_DoubleMapWithDefault final : ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* mutable_values(); - // double default_double = 1; + // optional double default_double = 1; + bool has_default_double() const; + private: + bool _internal_has_default_double() const; + public: void clear_default_double(); double default_double() const; void set_default_double(double value); @@ -6827,10 +6835,11 @@ class FigureDescriptor_DoubleMapWithDefault final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField keys_; ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > values_; double default_double_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -6840,7 +6849,7 @@ class FigureDescriptor_BoolMapWithDefault final : public: inline FigureDescriptor_BoolMapWithDefault() : FigureDescriptor_BoolMapWithDefault(nullptr) {} ~FigureDescriptor_BoolMapWithDefault() override; - explicit constexpr FigureDescriptor_BoolMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_BoolMapWithDefault(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_BoolMapWithDefault(const FigureDescriptor_BoolMapWithDefault& from); FigureDescriptor_BoolMapWithDefault(FigureDescriptor_BoolMapWithDefault&& from) noexcept @@ -6890,7 +6899,12 @@ class FigureDescriptor_BoolMapWithDefault final : } inline void Swap(FigureDescriptor_BoolMapWithDefault* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6904,11 +6918,7 @@ class FigureDescriptor_BoolMapWithDefault final : // implements Message ---------------------------------------------- - inline FigureDescriptor_BoolMapWithDefault* New() const final { - return new FigureDescriptor_BoolMapWithDefault(); - } - - FigureDescriptor_BoolMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_BoolMapWithDefault* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6923,8 +6933,8 @@ class FigureDescriptor_BoolMapWithDefault final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6932,6 +6942,8 @@ class FigureDescriptor_BoolMapWithDefault final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_BoolMapWithDefault* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault"; @@ -6939,9 +6951,6 @@ class FigureDescriptor_BoolMapWithDefault final : protected: explicit FigureDescriptor_BoolMapWithDefault(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7004,7 +7013,11 @@ class FigureDescriptor_BoolMapWithDefault final : ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >* mutable_values(); - // bool default_bool = 1; + // optional bool default_bool = 1; + bool has_default_bool() const; + private: + bool _internal_has_default_bool() const; + public: void clear_default_bool(); bool default_bool() const; void set_default_bool(bool value); @@ -7020,10 +7033,11 @@ class FigureDescriptor_BoolMapWithDefault final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField keys_; ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool > values_; bool default_bool_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // ------------------------------------------------------------------- @@ -7033,7 +7047,7 @@ class FigureDescriptor_AxisDescriptor final : public: inline FigureDescriptor_AxisDescriptor() : FigureDescriptor_AxisDescriptor(nullptr) {} ~FigureDescriptor_AxisDescriptor() override; - explicit constexpr FigureDescriptor_AxisDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_AxisDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_AxisDescriptor(const FigureDescriptor_AxisDescriptor& from); FigureDescriptor_AxisDescriptor(FigureDescriptor_AxisDescriptor&& from) noexcept @@ -7083,7 +7097,12 @@ class FigureDescriptor_AxisDescriptor final : } inline void Swap(FigureDescriptor_AxisDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7097,11 +7116,7 @@ class FigureDescriptor_AxisDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_AxisDescriptor* New() const final { - return new FigureDescriptor_AxisDescriptor(); - } - - FigureDescriptor_AxisDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_AxisDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7116,8 +7131,8 @@ class FigureDescriptor_AxisDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7125,6 +7140,8 @@ class FigureDescriptor_AxisDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_AxisDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor"; @@ -7132,9 +7149,6 @@ class FigureDescriptor_AxisDescriptor final : protected: explicit FigureDescriptor_AxisDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7301,7 +7315,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_id(ArgT0&& arg0, ArgT... args); std::string* mutable_id(); - PROTOBUF_MUST_USE_RESULT std::string* release_id(); + PROTOBUF_NODISCARD std::string* release_id(); void set_allocated_id(std::string* id); private: const std::string& _internal_id() const; @@ -7315,7 +7329,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_label(ArgT0&& arg0, ArgT... args); std::string* mutable_label(); - PROTOBUF_MUST_USE_RESULT std::string* release_label(); + PROTOBUF_NODISCARD std::string* release_label(); void set_allocated_label(std::string* label); private: const std::string& _internal_label() const; @@ -7329,7 +7343,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_label_font(ArgT0&& arg0, ArgT... args); std::string* mutable_label_font(); - PROTOBUF_MUST_USE_RESULT std::string* release_label_font(); + PROTOBUF_NODISCARD std::string* release_label_font(); void set_allocated_label_font(std::string* label_font); private: const std::string& _internal_label_font() const; @@ -7343,7 +7357,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_ticks_font(ArgT0&& arg0, ArgT... args); std::string* mutable_ticks_font(); - PROTOBUF_MUST_USE_RESULT std::string* release_ticks_font(); + PROTOBUF_NODISCARD std::string* release_ticks_font(); void set_allocated_ticks_font(std::string* ticks_font); private: const std::string& _internal_ticks_font() const; @@ -7361,7 +7375,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_format_pattern(ArgT0&& arg0, ArgT... args); std::string* mutable_format_pattern(); - PROTOBUF_MUST_USE_RESULT std::string* release_format_pattern(); + PROTOBUF_NODISCARD std::string* release_format_pattern(); void set_allocated_format_pattern(std::string* format_pattern); private: const std::string& _internal_format_pattern() const; @@ -7375,7 +7389,7 @@ class FigureDescriptor_AxisDescriptor final : template void set_color(ArgT0&& arg0, ArgT... args); std::string* mutable_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_color(); + PROTOBUF_NODISCARD std::string* release_color(); void set_allocated_color(std::string* color); private: const std::string& _internal_color() const; @@ -7390,7 +7404,7 @@ class FigureDescriptor_AxisDescriptor final : public: void clear_business_calendar_descriptor(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor& business_calendar_descriptor() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* release_business_calendar_descriptor(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* release_business_calendar_descriptor(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* mutable_business_calendar_descriptor(); void set_allocated_business_calendar_descriptor(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor* business_calendar_descriptor); private: @@ -7497,11 +7511,11 @@ class FigureDescriptor_AxisDescriptor final : // int32 minor_tick_count = 15; void clear_minor_tick_count(); - ::PROTOBUF_NAMESPACE_ID::int32 minor_tick_count() const; - void set_minor_tick_count(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t minor_tick_count() const; + void set_minor_tick_count(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_minor_tick_count() const; - void _internal_set_minor_tick_count(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_minor_tick_count() const; + void _internal_set_minor_tick_count(int32_t value); public: // bool is_time_axis = 20; @@ -7549,7 +7563,7 @@ class FigureDescriptor_AxisDescriptor final : bool invert_; double max_range_; double gap_between_major_ticks_; - ::PROTOBUF_NAMESPACE_ID::int32 minor_tick_count_; + int32_t minor_tick_count_; bool is_time_axis_; double tick_label_angle_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; @@ -7561,7 +7575,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : public: inline FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod() : FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(nullptr) {} ~FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod() override; - explicit constexpr FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(const FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod& from); FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod&& from) noexcept @@ -7611,7 +7625,12 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : } inline void Swap(FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7625,11 +7644,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : // implements Message ---------------------------------------------- - inline FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* New() const final { - return new FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(); - } - - FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7644,8 +7659,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7653,6 +7668,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod"; @@ -7660,9 +7677,6 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : protected: explicit FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7684,7 +7698,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : template void set_open(ArgT0&& arg0, ArgT... args); std::string* mutable_open(); - PROTOBUF_MUST_USE_RESULT std::string* release_open(); + PROTOBUF_NODISCARD std::string* release_open(); void set_allocated_open(std::string* open); private: const std::string& _internal_open() const; @@ -7698,7 +7712,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod final : template void set_close(ArgT0&& arg0, ArgT... args); std::string* mutable_close(); - PROTOBUF_MUST_USE_RESULT std::string* release_close(); + PROTOBUF_NODISCARD std::string* release_close(); void set_allocated_close(std::string* close); private: const std::string& _internal_close() const; @@ -7725,7 +7739,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : public: inline FigureDescriptor_BusinessCalendarDescriptor_Holiday() : FigureDescriptor_BusinessCalendarDescriptor_Holiday(nullptr) {} ~FigureDescriptor_BusinessCalendarDescriptor_Holiday() override; - explicit constexpr FigureDescriptor_BusinessCalendarDescriptor_Holiday(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_Holiday(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_BusinessCalendarDescriptor_Holiday(const FigureDescriptor_BusinessCalendarDescriptor_Holiday& from); FigureDescriptor_BusinessCalendarDescriptor_Holiday(FigureDescriptor_BusinessCalendarDescriptor_Holiday&& from) noexcept @@ -7775,7 +7789,12 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : } inline void Swap(FigureDescriptor_BusinessCalendarDescriptor_Holiday* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7789,11 +7808,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : // implements Message ---------------------------------------------- - inline FigureDescriptor_BusinessCalendarDescriptor_Holiday* New() const final { - return new FigureDescriptor_BusinessCalendarDescriptor_Holiday(); - } - - FigureDescriptor_BusinessCalendarDescriptor_Holiday* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_BusinessCalendarDescriptor_Holiday* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7808,8 +7823,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7817,6 +7832,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_BusinessCalendarDescriptor_Holiday* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday"; @@ -7824,9 +7841,6 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : protected: explicit FigureDescriptor_BusinessCalendarDescriptor_Holiday(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7867,7 +7881,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_Holiday final : public: void clear_date(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate& date() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* release_date(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* release_date(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* mutable_date(); void set_allocated_date(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate* date); private: @@ -7897,7 +7911,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : public: inline FigureDescriptor_BusinessCalendarDescriptor_LocalDate() : FigureDescriptor_BusinessCalendarDescriptor_LocalDate(nullptr) {} ~FigureDescriptor_BusinessCalendarDescriptor_LocalDate() override; - explicit constexpr FigureDescriptor_BusinessCalendarDescriptor_LocalDate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor_LocalDate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_BusinessCalendarDescriptor_LocalDate(const FigureDescriptor_BusinessCalendarDescriptor_LocalDate& from); FigureDescriptor_BusinessCalendarDescriptor_LocalDate(FigureDescriptor_BusinessCalendarDescriptor_LocalDate&& from) noexcept @@ -7947,7 +7961,12 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : } inline void Swap(FigureDescriptor_BusinessCalendarDescriptor_LocalDate* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7961,11 +7980,7 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : // implements Message ---------------------------------------------- - inline FigureDescriptor_BusinessCalendarDescriptor_LocalDate* New() const final { - return new FigureDescriptor_BusinessCalendarDescriptor_LocalDate(); - } - - FigureDescriptor_BusinessCalendarDescriptor_LocalDate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_BusinessCalendarDescriptor_LocalDate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7980,8 +7995,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7989,6 +8004,8 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_BusinessCalendarDescriptor_LocalDate* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate"; @@ -7996,9 +8013,6 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : protected: explicit FigureDescriptor_BusinessCalendarDescriptor_LocalDate(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8017,29 +8031,29 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : }; // int32 year = 1; void clear_year(); - ::PROTOBUF_NAMESPACE_ID::int32 year() const; - void set_year(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t year() const; + void set_year(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_year() const; - void _internal_set_year(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_year() const; + void _internal_set_year(int32_t value); public: // int32 month = 2; void clear_month(); - ::PROTOBUF_NAMESPACE_ID::int32 month() const; - void set_month(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t month() const; + void set_month(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_month() const; - void _internal_set_month(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_month() const; + void _internal_set_month(int32_t value); public: // int32 day = 3; void clear_day(); - ::PROTOBUF_NAMESPACE_ID::int32 day() const; - void set_day(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t day() const; + void set_day(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_day() const; - void _internal_set_day(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_day() const; + void _internal_set_day(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) @@ -8049,9 +8063,9 @@ class FigureDescriptor_BusinessCalendarDescriptor_LocalDate final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::int32 year_; - ::PROTOBUF_NAMESPACE_ID::int32 month_; - ::PROTOBUF_NAMESPACE_ID::int32 day_; + int32_t year_; + int32_t month_; + int32_t day_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -8062,7 +8076,7 @@ class FigureDescriptor_BusinessCalendarDescriptor final : public: inline FigureDescriptor_BusinessCalendarDescriptor() : FigureDescriptor_BusinessCalendarDescriptor(nullptr) {} ~FigureDescriptor_BusinessCalendarDescriptor() override; - explicit constexpr FigureDescriptor_BusinessCalendarDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_BusinessCalendarDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_BusinessCalendarDescriptor(const FigureDescriptor_BusinessCalendarDescriptor& from); FigureDescriptor_BusinessCalendarDescriptor(FigureDescriptor_BusinessCalendarDescriptor&& from) noexcept @@ -8112,7 +8126,12 @@ class FigureDescriptor_BusinessCalendarDescriptor final : } inline void Swap(FigureDescriptor_BusinessCalendarDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8126,11 +8145,7 @@ class FigureDescriptor_BusinessCalendarDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_BusinessCalendarDescriptor* New() const final { - return new FigureDescriptor_BusinessCalendarDescriptor(); - } - - FigureDescriptor_BusinessCalendarDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_BusinessCalendarDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8145,8 +8160,8 @@ class FigureDescriptor_BusinessCalendarDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8154,6 +8169,8 @@ class FigureDescriptor_BusinessCalendarDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_BusinessCalendarDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor"; @@ -8161,9 +8178,6 @@ class FigureDescriptor_BusinessCalendarDescriptor final : protected: explicit FigureDescriptor_BusinessCalendarDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8285,7 +8299,7 @@ class FigureDescriptor_BusinessCalendarDescriptor final : template void set_name(ArgT0&& arg0, ArgT... args); std::string* mutable_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_name(); + PROTOBUF_NODISCARD std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; @@ -8299,7 +8313,7 @@ class FigureDescriptor_BusinessCalendarDescriptor final : template void set_time_zone(ArgT0&& arg0, ArgT... args); std::string* mutable_time_zone(); - PROTOBUF_MUST_USE_RESULT std::string* release_time_zone(); + PROTOBUF_NODISCARD std::string* release_time_zone(); void set_allocated_time_zone(std::string* time_zone); private: const std::string& _internal_time_zone() const; @@ -8330,7 +8344,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : public: inline FigureDescriptor_MultiSeriesSourceDescriptor() : FigureDescriptor_MultiSeriesSourceDescriptor(nullptr) {} ~FigureDescriptor_MultiSeriesSourceDescriptor() override; - explicit constexpr FigureDescriptor_MultiSeriesSourceDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_MultiSeriesSourceDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_MultiSeriesSourceDescriptor(const FigureDescriptor_MultiSeriesSourceDescriptor& from); FigureDescriptor_MultiSeriesSourceDescriptor(FigureDescriptor_MultiSeriesSourceDescriptor&& from) noexcept @@ -8380,7 +8394,12 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : } inline void Swap(FigureDescriptor_MultiSeriesSourceDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8394,11 +8413,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_MultiSeriesSourceDescriptor* New() const final { - return new FigureDescriptor_MultiSeriesSourceDescriptor(); - } - - FigureDescriptor_MultiSeriesSourceDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_MultiSeriesSourceDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8413,8 +8428,8 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8422,6 +8437,8 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_MultiSeriesSourceDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor"; @@ -8429,9 +8446,6 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : protected: explicit FigureDescriptor_MultiSeriesSourceDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8447,7 +8461,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : kAxisIdFieldNumber = 1, kColumnNameFieldNumber = 4, kTypeFieldNumber = 2, - kTableMapIdFieldNumber = 3, + kPartitionedTableIdFieldNumber = 3, }; // string axis_id = 1; void clear_axis_id(); @@ -8455,7 +8469,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : template void set_axis_id(ArgT0&& arg0, ArgT... args); std::string* mutable_axis_id(); - PROTOBUF_MUST_USE_RESULT std::string* release_axis_id(); + PROTOBUF_NODISCARD std::string* release_axis_id(); void set_allocated_axis_id(std::string* axis_id); private: const std::string& _internal_axis_id() const; @@ -8469,7 +8483,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : template void set_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_name(); + PROTOBUF_NODISCARD std::string* release_column_name(); void set_allocated_column_name(std::string* column_name); private: const std::string& _internal_column_name() const; @@ -8486,13 +8500,13 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : void _internal_set_type(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_SourceType value); public: - // int32 table_map_id = 3; - void clear_table_map_id(); - ::PROTOBUF_NAMESPACE_ID::int32 table_map_id() const; - void set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value); + // int32 partitioned_table_id = 3; + void clear_partitioned_table_id(); + int32_t partitioned_table_id() const; + void set_partitioned_table_id(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_table_map_id() const; - void _internal_set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_partitioned_table_id() const; + void _internal_set_partitioned_table_id(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) @@ -8505,7 +8519,7 @@ class FigureDescriptor_MultiSeriesSourceDescriptor final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr axis_id_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr column_name_; int type_; - ::PROTOBUF_NAMESPACE_ID::int32 table_map_id_; + int32_t partitioned_table_id_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -8516,7 +8530,7 @@ class FigureDescriptor_SourceDescriptor final : public: inline FigureDescriptor_SourceDescriptor() : FigureDescriptor_SourceDescriptor(nullptr) {} ~FigureDescriptor_SourceDescriptor() override; - explicit constexpr FigureDescriptor_SourceDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_SourceDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_SourceDescriptor(const FigureDescriptor_SourceDescriptor& from); FigureDescriptor_SourceDescriptor(FigureDescriptor_SourceDescriptor&& from) noexcept @@ -8566,7 +8580,12 @@ class FigureDescriptor_SourceDescriptor final : } inline void Swap(FigureDescriptor_SourceDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8580,11 +8599,7 @@ class FigureDescriptor_SourceDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_SourceDescriptor* New() const final { - return new FigureDescriptor_SourceDescriptor(); - } - - FigureDescriptor_SourceDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_SourceDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8599,8 +8614,8 @@ class FigureDescriptor_SourceDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8608,6 +8623,8 @@ class FigureDescriptor_SourceDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_SourceDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor"; @@ -8615,9 +8632,6 @@ class FigureDescriptor_SourceDescriptor final : protected: explicit FigureDescriptor_SourceDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8636,7 +8650,7 @@ class FigureDescriptor_SourceDescriptor final : kOneClickFieldNumber = 7, kTypeFieldNumber = 2, kTableIdFieldNumber = 3, - kTableMapIdFieldNumber = 4, + kPartitionedTableIdFieldNumber = 4, }; // string axis_id = 1; void clear_axis_id(); @@ -8644,7 +8658,7 @@ class FigureDescriptor_SourceDescriptor final : template void set_axis_id(ArgT0&& arg0, ArgT... args); std::string* mutable_axis_id(); - PROTOBUF_MUST_USE_RESULT std::string* release_axis_id(); + PROTOBUF_NODISCARD std::string* release_axis_id(); void set_allocated_axis_id(std::string* axis_id); private: const std::string& _internal_axis_id() const; @@ -8658,7 +8672,7 @@ class FigureDescriptor_SourceDescriptor final : template void set_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_name(); + PROTOBUF_NODISCARD std::string* release_column_name(); void set_allocated_column_name(std::string* column_name); private: const std::string& _internal_column_name() const; @@ -8672,7 +8686,7 @@ class FigureDescriptor_SourceDescriptor final : template void set_column_type(ArgT0&& arg0, ArgT... args); std::string* mutable_column_type(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_type(); + PROTOBUF_NODISCARD std::string* release_column_type(); void set_allocated_column_type(std::string* column_type); private: const std::string& _internal_column_type() const; @@ -8687,7 +8701,7 @@ class FigureDescriptor_SourceDescriptor final : public: void clear_one_click(); const ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor& one_click() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* release_one_click(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* release_one_click(); ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* mutable_one_click(); void set_allocated_one_click(::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* one_click); private: @@ -8709,20 +8723,20 @@ class FigureDescriptor_SourceDescriptor final : // int32 table_id = 3; void clear_table_id(); - ::PROTOBUF_NAMESPACE_ID::int32 table_id() const; - void set_table_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t table_id() const; + void set_table_id(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_table_id() const; - void _internal_set_table_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_table_id() const; + void _internal_set_table_id(int32_t value); public: - // int32 table_map_id = 4; - void clear_table_map_id(); - ::PROTOBUF_NAMESPACE_ID::int32 table_map_id() const; - void set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value); + // int32 partitioned_table_id = 4; + void clear_partitioned_table_id(); + int32_t partitioned_table_id() const; + void set_partitioned_table_id(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_table_map_id() const; - void _internal_set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_partitioned_table_id() const; + void _internal_set_partitioned_table_id(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) @@ -8737,8 +8751,8 @@ class FigureDescriptor_SourceDescriptor final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr column_type_; ::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor* one_click_; int type_; - ::PROTOBUF_NAMESPACE_ID::int32 table_id_; - ::PROTOBUF_NAMESPACE_ID::int32 table_map_id_; + int32_t table_id_; + int32_t partitioned_table_id_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; @@ -8749,7 +8763,7 @@ class FigureDescriptor_OneClickDescriptor final : public: inline FigureDescriptor_OneClickDescriptor() : FigureDescriptor_OneClickDescriptor(nullptr) {} ~FigureDescriptor_OneClickDescriptor() override; - explicit constexpr FigureDescriptor_OneClickDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor_OneClickDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor_OneClickDescriptor(const FigureDescriptor_OneClickDescriptor& from); FigureDescriptor_OneClickDescriptor(FigureDescriptor_OneClickDescriptor&& from) noexcept @@ -8799,7 +8813,12 @@ class FigureDescriptor_OneClickDescriptor final : } inline void Swap(FigureDescriptor_OneClickDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8813,11 +8832,7 @@ class FigureDescriptor_OneClickDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor_OneClickDescriptor* New() const final { - return new FigureDescriptor_OneClickDescriptor(); - } - - FigureDescriptor_OneClickDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor_OneClickDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8832,8 +8847,8 @@ class FigureDescriptor_OneClickDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8841,6 +8856,8 @@ class FigureDescriptor_OneClickDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor_OneClickDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor"; @@ -8848,9 +8865,6 @@ class FigureDescriptor_OneClickDescriptor final : protected: explicit FigureDescriptor_OneClickDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8944,7 +8958,7 @@ class FigureDescriptor final : public: inline FigureDescriptor() : FigureDescriptor(nullptr) {} ~FigureDescriptor() override; - explicit constexpr FigureDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FigureDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FigureDescriptor(const FigureDescriptor& from); FigureDescriptor(FigureDescriptor&& from) noexcept @@ -8994,7 +9008,12 @@ class FigureDescriptor final : } inline void Swap(FigureDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9008,11 +9027,7 @@ class FigureDescriptor final : // implements Message ---------------------------------------------- - inline FigureDescriptor* New() const final { - return new FigureDescriptor(); - } - - FigureDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FigureDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9027,8 +9042,8 @@ class FigureDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9036,6 +9051,8 @@ class FigureDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FigureDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.script.grpc.FigureDescriptor"; @@ -9043,9 +9060,6 @@ class FigureDescriptor final : protected: explicit FigureDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -9090,6 +9104,8 @@ class FigureDescriptor final : FigureDescriptor_SeriesPlotStyle_STEP; static constexpr SeriesPlotStyle ERROR_BAR = FigureDescriptor_SeriesPlotStyle_ERROR_BAR; + static constexpr SeriesPlotStyle TREEMAP = + FigureDescriptor_SeriesPlotStyle_TREEMAP; static inline bool SeriesPlotStyle_IsValid(int value) { return FigureDescriptor_SeriesPlotStyle_IsValid(value); } @@ -9148,6 +9164,12 @@ class FigureDescriptor final : FigureDescriptor_SourceType_LABEL; static constexpr SourceType COLOR = FigureDescriptor_SourceType_COLOR; + static constexpr SourceType PARENT = + FigureDescriptor_SourceType_PARENT; + static constexpr SourceType HOVER_TEXT = + FigureDescriptor_SourceType_HOVER_TEXT; + static constexpr SourceType TEXT = + FigureDescriptor_SourceType_TEXT; static inline bool SourceType_IsValid(int value) { return FigureDescriptor_SourceType_IsValid(value); } @@ -9237,7 +9259,7 @@ class FigureDescriptor final : template void set_title(ArgT0&& arg0, ArgT... args); std::string* mutable_title(); - PROTOBUF_MUST_USE_RESULT std::string* release_title(); + PROTOBUF_NODISCARD std::string* release_title(); void set_allocated_title(std::string* title); private: const std::string& _internal_title() const; @@ -9251,7 +9273,7 @@ class FigureDescriptor final : template void set_title_font(ArgT0&& arg0, ArgT... args); std::string* mutable_title_font(); - PROTOBUF_MUST_USE_RESULT std::string* release_title_font(); + PROTOBUF_NODISCARD std::string* release_title_font(); void set_allocated_title_font(std::string* title_font); private: const std::string& _internal_title_font() const; @@ -9265,7 +9287,7 @@ class FigureDescriptor final : template void set_title_color(ArgT0&& arg0, ArgT... args); std::string* mutable_title_color(); - PROTOBUF_MUST_USE_RESULT std::string* release_title_color(); + PROTOBUF_NODISCARD std::string* release_title_color(); void set_allocated_title_color(std::string* title_color); private: const std::string& _internal_title_color() const; @@ -9273,31 +9295,31 @@ class FigureDescriptor final : std::string* _internal_mutable_title_color(); public: - // int64 update_interval = 7; + // int64 update_interval = 7 [jstype = JS_STRING]; void clear_update_interval(); - ::PROTOBUF_NAMESPACE_ID::int64 update_interval() const; - void set_update_interval(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t update_interval() const; + void set_update_interval(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_update_interval() const; - void _internal_set_update_interval(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_update_interval() const; + void _internal_set_update_interval(int64_t value); public: // int32 cols = 8; void clear_cols(); - ::PROTOBUF_NAMESPACE_ID::int32 cols() const; - void set_cols(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t cols() const; + void set_cols(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_cols() const; - void _internal_set_cols(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_cols() const; + void _internal_set_cols(int32_t value); public: // int32 rows = 9; void clear_rows(); - ::PROTOBUF_NAMESPACE_ID::int32 rows() const; - void set_rows(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t rows() const; + void set_rows(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_rows() const; - void _internal_set_rows(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_rows() const; + void _internal_set_rows(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) @@ -9314,9 +9336,9 @@ class FigureDescriptor final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_font_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_color_; - ::PROTOBUF_NAMESPACE_ID::int64 update_interval_; - ::PROTOBUF_NAMESPACE_ID::int32 cols_; - ::PROTOBUF_NAMESPACE_ID::int32 rows_; + int64_t update_interval_; + int32_t cols_; + int32_t rows_; friend struct ::TableStruct_deephaven_2fproto_2fconsole_2eproto; }; // =================================================================== @@ -9484,8 +9506,7 @@ inline void StartConsoleRequest::set_allocated_result_id(::io::deephaven::proto: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -9511,7 +9532,7 @@ template inline PROTOBUF_ALWAYS_INLINE void StartConsoleRequest::set_session_type(ArgT0&& arg0, ArgT... args) { - session_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + session_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type) } inline std::string* StartConsoleRequest::mutable_session_type() { @@ -9524,15 +9545,15 @@ inline const std::string& StartConsoleRequest::_internal_session_type() const { } inline void StartConsoleRequest::_internal_set_session_type(const std::string& value) { - session_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + session_type_.Set(value, GetArenaForAllocation()); } inline std::string* StartConsoleRequest::_internal_mutable_session_type() { - return session_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return session_type_.Mutable(GetArenaForAllocation()); } inline std::string* StartConsoleRequest::release_session_type() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type) - return session_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return session_type_.Release(); } inline void StartConsoleRequest::set_allocated_session_type(std::string* session_type) { if (session_type != nullptr) { @@ -9540,8 +9561,12 @@ inline void StartConsoleRequest::set_allocated_session_type(std::string* session } else { } - session_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), session_type, - GetArenaForAllocation()); + session_type_.SetAllocated(session_type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (session_type_.IsDefault()) { + session_type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.session_type) } @@ -9620,8 +9645,7 @@ inline void StartConsoleResponse::set_allocated_result_id(::io::deephaven::proto } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -9639,22 +9663,22 @@ inline void StartConsoleResponse::set_allocated_result_id(::io::deephaven::proto // LogSubscriptionRequest -// int64 last_seen_log_timestamp = 1; +// int64 last_seen_log_timestamp = 1 [jstype = JS_STRING]; inline void LogSubscriptionRequest::clear_last_seen_log_timestamp() { last_seen_log_timestamp_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 LogSubscriptionRequest::_internal_last_seen_log_timestamp() const { +inline int64_t LogSubscriptionRequest::_internal_last_seen_log_timestamp() const { return last_seen_log_timestamp_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 LogSubscriptionRequest::last_seen_log_timestamp() const { +inline int64_t LogSubscriptionRequest::last_seen_log_timestamp() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.last_seen_log_timestamp) return _internal_last_seen_log_timestamp(); } -inline void LogSubscriptionRequest::_internal_set_last_seen_log_timestamp(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void LogSubscriptionRequest::_internal_set_last_seen_log_timestamp(int64_t value) { last_seen_log_timestamp_ = value; } -inline void LogSubscriptionRequest::set_last_seen_log_timestamp(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void LogSubscriptionRequest::set_last_seen_log_timestamp(int64_t value) { _internal_set_last_seen_log_timestamp(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest.last_seen_log_timestamp) } @@ -9738,22 +9762,22 @@ LogSubscriptionRequest::mutable_levels() { // LogSubscriptionData -// int64 micros = 1; +// int64 micros = 1 [jstype = JS_STRING]; inline void LogSubscriptionData::clear_micros() { micros_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 LogSubscriptionData::_internal_micros() const { +inline int64_t LogSubscriptionData::_internal_micros() const { return micros_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 LogSubscriptionData::micros() const { +inline int64_t LogSubscriptionData::micros() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.micros) return _internal_micros(); } -inline void LogSubscriptionData::_internal_set_micros(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void LogSubscriptionData::_internal_set_micros(int64_t value) { micros_ = value; } -inline void LogSubscriptionData::set_micros(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void LogSubscriptionData::set_micros(int64_t value) { _internal_set_micros(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.micros) } @@ -9770,7 +9794,7 @@ template inline PROTOBUF_ALWAYS_INLINE void LogSubscriptionData::set_log_level(ArgT0&& arg0, ArgT... args) { - log_level_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + log_level_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level) } inline std::string* LogSubscriptionData::mutable_log_level() { @@ -9783,15 +9807,15 @@ inline const std::string& LogSubscriptionData::_internal_log_level() const { } inline void LogSubscriptionData::_internal_set_log_level(const std::string& value) { - log_level_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + log_level_.Set(value, GetArenaForAllocation()); } inline std::string* LogSubscriptionData::_internal_mutable_log_level() { - return log_level_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return log_level_.Mutable(GetArenaForAllocation()); } inline std::string* LogSubscriptionData::release_log_level() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level) - return log_level_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return log_level_.Release(); } inline void LogSubscriptionData::set_allocated_log_level(std::string* log_level) { if (log_level != nullptr) { @@ -9799,8 +9823,12 @@ inline void LogSubscriptionData::set_allocated_log_level(std::string* log_level) } else { } - log_level_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), log_level, - GetArenaForAllocation()); + log_level_.SetAllocated(log_level, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (log_level_.IsDefault()) { + log_level_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.log_level) } @@ -9816,7 +9844,7 @@ template inline PROTOBUF_ALWAYS_INLINE void LogSubscriptionData::set_message(ArgT0&& arg0, ArgT... args) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message) } inline std::string* LogSubscriptionData::mutable_message() { @@ -9829,15 +9857,15 @@ inline const std::string& LogSubscriptionData::_internal_message() const { } inline void LogSubscriptionData::_internal_set_message(const std::string& value) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + message_.Set(value, GetArenaForAllocation()); } inline std::string* LogSubscriptionData::_internal_mutable_message() { - return message_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return message_.Mutable(GetArenaForAllocation()); } inline std::string* LogSubscriptionData::release_message() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message) - return message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return message_.Release(); } inline void LogSubscriptionData::set_allocated_message(std::string* message) { if (message != nullptr) { @@ -9845,8 +9873,12 @@ inline void LogSubscriptionData::set_allocated_message(std::string* message) { } else { } - message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), message, - GetArenaForAllocation()); + message_.SetAllocated(message, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (message_.IsDefault()) { + message_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData.message) } @@ -9925,8 +9957,7 @@ inline void ExecuteCommandRequest::set_allocated_console_id(::io::deephaven::pro } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -9952,7 +9983,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExecuteCommandRequest::set_code(ArgT0&& arg0, ArgT... args) { - code_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + code_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code) } inline std::string* ExecuteCommandRequest::mutable_code() { @@ -9965,15 +9996,15 @@ inline const std::string& ExecuteCommandRequest::_internal_code() const { } inline void ExecuteCommandRequest::_internal_set_code(const std::string& value) { - code_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + code_.Set(value, GetArenaForAllocation()); } inline std::string* ExecuteCommandRequest::_internal_mutable_code() { - return code_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return code_.Mutable(GetArenaForAllocation()); } inline std::string* ExecuteCommandRequest::release_code() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code) - return code_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return code_.Release(); } inline void ExecuteCommandRequest::set_allocated_code(std::string* code) { if (code != nullptr) { @@ -9981,8 +10012,12 @@ inline void ExecuteCommandRequest::set_allocated_code(std::string* code) { } else { } - code_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), code, - GetArenaForAllocation()); + code_.SetAllocated(code, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (code_.IsDefault()) { + code_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.code) } @@ -10002,7 +10037,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExecuteCommandResponse::set_error_message(ArgT0&& arg0, ArgT... args) { - error_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + error_message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message) } inline std::string* ExecuteCommandResponse::mutable_error_message() { @@ -10015,15 +10050,15 @@ inline const std::string& ExecuteCommandResponse::_internal_error_message() cons } inline void ExecuteCommandResponse::_internal_set_error_message(const std::string& value) { - error_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + error_message_.Set(value, GetArenaForAllocation()); } inline std::string* ExecuteCommandResponse::_internal_mutable_error_message() { - return error_message_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return error_message_.Mutable(GetArenaForAllocation()); } inline std::string* ExecuteCommandResponse::release_error_message() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message) - return error_message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return error_message_.Release(); } inline void ExecuteCommandResponse::set_allocated_error_message(std::string* error_message) { if (error_message != nullptr) { @@ -10031,8 +10066,12 @@ inline void ExecuteCommandResponse::set_allocated_error_message(std::string* err } else { } - error_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_message, - GetArenaForAllocation()); + error_message_.SetAllocated(error_message, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (error_message_.IsDefault()) { + error_message_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.error_message) } @@ -10107,8 +10146,7 @@ inline void ExecuteCommandResponse::set_allocated_changes(::io::deephaven::proto } if (changes) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(changes)); if (message_arena != submessage_arena) { changes = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -10197,8 +10235,7 @@ inline void BindTableToVariableRequest::set_allocated_console_id(::io::deephaven } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -10224,7 +10261,7 @@ template inline PROTOBUF_ALWAYS_INLINE void BindTableToVariableRequest::set_variable_name(ArgT0&& arg0, ArgT... args) { - variable_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + variable_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name) } inline std::string* BindTableToVariableRequest::mutable_variable_name() { @@ -10237,15 +10274,15 @@ inline const std::string& BindTableToVariableRequest::_internal_variable_name() } inline void BindTableToVariableRequest::_internal_set_variable_name(const std::string& value) { - variable_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + variable_name_.Set(value, GetArenaForAllocation()); } inline std::string* BindTableToVariableRequest::_internal_mutable_variable_name() { - return variable_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return variable_name_.Mutable(GetArenaForAllocation()); } inline std::string* BindTableToVariableRequest::release_variable_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name) - return variable_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return variable_name_.Release(); } inline void BindTableToVariableRequest::set_allocated_variable_name(std::string* variable_name) { if (variable_name != nullptr) { @@ -10253,8 +10290,12 @@ inline void BindTableToVariableRequest::set_allocated_variable_name(std::string* } else { } - variable_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), variable_name, - GetArenaForAllocation()); + variable_name_.SetAllocated(variable_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (variable_name_.IsDefault()) { + variable_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.variable_name) } @@ -10329,8 +10370,7 @@ inline void BindTableToVariableRequest::set_allocated_table_id(::io::deephaven:: } if (table_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_id)); if (message_arena != submessage_arena) { table_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -10423,8 +10463,7 @@ inline void CancelCommandRequest::set_allocated_console_id(::io::deephaven::prot } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -10509,8 +10548,7 @@ inline void CancelCommandRequest::set_allocated_command_id(::io::deephaven::prot } if (command_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(command_id)); if (message_arena != submessage_arena) { command_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -10554,7 +10592,7 @@ inline ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* Aut // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.open_document) if (_internal_has_open_document()) { clear_has_request(); - ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* temp = request_.open_document_; + ::io::deephaven::proto::backplane::script::grpc::OpenDocumentRequest* temp = request_.open_document_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -10628,7 +10666,7 @@ inline ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* A // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.change_document) if (_internal_has_change_document()) { clear_has_request(); - ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* temp = request_.change_document_; + ::io::deephaven::proto::backplane::script::grpc::ChangeDocumentRequest* temp = request_.change_document_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -10702,7 +10740,7 @@ inline ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsReques // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.get_completion_items) if (_internal_has_get_completion_items()) { clear_has_request(); - ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* temp = request_.get_completion_items_; + ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRequest* temp = request_.get_completion_items_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -10776,7 +10814,7 @@ inline ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* Au // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.close_document) if (_internal_has_close_document()) { clear_has_request(); - ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* temp = request_.close_document_; + ::io::deephaven::proto::backplane::script::grpc::CloseDocumentRequest* temp = request_.close_document_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -10863,7 +10901,7 @@ inline ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsRespon // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.completion_items) if (_internal_has_completion_items()) { clear_has_response(); - ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* temp = response_.completion_items_; + ::io::deephaven::proto::backplane::script::grpc::GetCompletionItemsResponse* temp = response_.completion_items_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -11003,8 +11041,7 @@ inline void OpenDocumentRequest::set_allocated_console_id(::io::deephaven::proto } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -11095,7 +11132,7 @@ inline void OpenDocumentRequest::set_allocated_text_document(::io::deephaven::pr } if (text_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::TextDocumentItem>::GetOwningArena(text_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(text_document); if (message_arena != submessage_arena) { text_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, text_document, submessage_arena); @@ -11124,7 +11161,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TextDocumentItem::set_uri(ArgT0&& arg0, ArgT... args) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + uri_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri) } inline std::string* TextDocumentItem::mutable_uri() { @@ -11137,15 +11174,15 @@ inline const std::string& TextDocumentItem::_internal_uri() const { } inline void TextDocumentItem::_internal_set_uri(const std::string& value) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + uri_.Set(value, GetArenaForAllocation()); } inline std::string* TextDocumentItem::_internal_mutable_uri() { - return uri_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return uri_.Mutable(GetArenaForAllocation()); } inline std::string* TextDocumentItem::release_uri() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri) - return uri_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return uri_.Release(); } inline void TextDocumentItem::set_allocated_uri(std::string* uri) { if (uri != nullptr) { @@ -11153,8 +11190,12 @@ inline void TextDocumentItem::set_allocated_uri(std::string* uri) { } else { } - uri_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), uri, - GetArenaForAllocation()); + uri_.SetAllocated(uri, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (uri_.IsDefault()) { + uri_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.uri) } @@ -11170,7 +11211,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TextDocumentItem::set_language_id(ArgT0&& arg0, ArgT... args) { - language_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + language_id_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id) } inline std::string* TextDocumentItem::mutable_language_id() { @@ -11183,15 +11224,15 @@ inline const std::string& TextDocumentItem::_internal_language_id() const { } inline void TextDocumentItem::_internal_set_language_id(const std::string& value) { - language_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + language_id_.Set(value, GetArenaForAllocation()); } inline std::string* TextDocumentItem::_internal_mutable_language_id() { - return language_id_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return language_id_.Mutable(GetArenaForAllocation()); } inline std::string* TextDocumentItem::release_language_id() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id) - return language_id_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return language_id_.Release(); } inline void TextDocumentItem::set_allocated_language_id(std::string* language_id) { if (language_id != nullptr) { @@ -11199,8 +11240,12 @@ inline void TextDocumentItem::set_allocated_language_id(std::string* language_id } else { } - language_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), language_id, - GetArenaForAllocation()); + language_id_.SetAllocated(language_id, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (language_id_.IsDefault()) { + language_id_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.language_id) } @@ -11208,18 +11253,18 @@ inline void TextDocumentItem::set_allocated_language_id(std::string* language_id inline void TextDocumentItem::clear_version() { version_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 TextDocumentItem::_internal_version() const { +inline int32_t TextDocumentItem::_internal_version() const { return version_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 TextDocumentItem::version() const { +inline int32_t TextDocumentItem::version() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.version) return _internal_version(); } -inline void TextDocumentItem::_internal_set_version(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void TextDocumentItem::_internal_set_version(int32_t value) { version_ = value; } -inline void TextDocumentItem::set_version(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void TextDocumentItem::set_version(int32_t value) { _internal_set_version(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.version) } @@ -11236,7 +11281,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TextDocumentItem::set_text(ArgT0&& arg0, ArgT... args) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text) } inline std::string* TextDocumentItem::mutable_text() { @@ -11249,15 +11294,15 @@ inline const std::string& TextDocumentItem::_internal_text() const { } inline void TextDocumentItem::_internal_set_text(const std::string& value) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + text_.Set(value, GetArenaForAllocation()); } inline std::string* TextDocumentItem::_internal_mutable_text() { - return text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return text_.Mutable(GetArenaForAllocation()); } inline std::string* TextDocumentItem::release_text() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text) - return text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return text_.Release(); } inline void TextDocumentItem::set_allocated_text(std::string* text) { if (text != nullptr) { @@ -11265,8 +11310,12 @@ inline void TextDocumentItem::set_allocated_text(std::string* text) { } else { } - text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text, - GetArenaForAllocation()); + text_.SetAllocated(text, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (text_.IsDefault()) { + text_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.TextDocumentItem.text) } @@ -11345,8 +11394,7 @@ inline void CloseDocumentRequest::set_allocated_console_id(::io::deephaven::prot } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -11437,7 +11485,7 @@ inline void CloseDocumentRequest::set_allocated_text_document(::io::deephaven::p } if (text_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier>::GetOwningArena(text_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(text_document); if (message_arena != submessage_arena) { text_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, text_document, submessage_arena); @@ -11531,7 +11579,7 @@ inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_allocated_ } if (range) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::DocumentRange>::GetOwningArena(range); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(range); if (message_arena != submessage_arena) { range = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, range, submessage_arena); @@ -11548,18 +11596,18 @@ inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_allocated_ inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::clear_range_length() { range_length_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_range_length() const { +inline int32_t ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_range_length() const { return range_length_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 ChangeDocumentRequest_TextDocumentContentChangeEvent::range_length() const { +inline int32_t ChangeDocumentRequest_TextDocumentContentChangeEvent::range_length() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range_length) return _internal_range_length(); } -inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_set_range_length(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_set_range_length(int32_t value) { range_length_ = value; } -inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_range_length(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_range_length(int32_t value) { _internal_set_range_length(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range_length) } @@ -11576,7 +11624,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_text(ArgT0&& arg0, ArgT... args) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text) } inline std::string* ChangeDocumentRequest_TextDocumentContentChangeEvent::mutable_text() { @@ -11589,15 +11637,15 @@ inline const std::string& ChangeDocumentRequest_TextDocumentContentChangeEvent:: } inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_set_text(const std::string& value) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + text_.Set(value, GetArenaForAllocation()); } inline std::string* ChangeDocumentRequest_TextDocumentContentChangeEvent::_internal_mutable_text() { - return text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return text_.Mutable(GetArenaForAllocation()); } inline std::string* ChangeDocumentRequest_TextDocumentContentChangeEvent::release_text() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text) - return text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return text_.Release(); } inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_allocated_text(std::string* text) { if (text != nullptr) { @@ -11605,8 +11653,12 @@ inline void ChangeDocumentRequest_TextDocumentContentChangeEvent::set_allocated_ } else { } - text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text, - GetArenaForAllocation()); + text_.SetAllocated(text, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (text_.IsDefault()) { + text_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.text) } @@ -11685,8 +11737,7 @@ inline void ChangeDocumentRequest::set_allocated_console_id(::io::deephaven::pro } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -11777,7 +11828,7 @@ inline void ChangeDocumentRequest::set_allocated_text_document(::io::deephaven:: } if (text_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier>::GetOwningArena(text_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(text_document); if (message_arena != submessage_arena) { text_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, text_document, submessage_arena); @@ -11911,7 +11962,7 @@ inline void DocumentRange::set_allocated_start(::io::deephaven::proto::backplane } if (start) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::Position>::GetOwningArena(start); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(start); if (message_arena != submessage_arena) { start = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, start, submessage_arena); @@ -12001,7 +12052,7 @@ inline void DocumentRange::set_allocated_end(::io::deephaven::proto::backplane:: } if (end) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::Position>::GetOwningArena(end); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(end); if (message_arena != submessage_arena) { end = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, end, submessage_arena); @@ -12030,7 +12081,7 @@ template inline PROTOBUF_ALWAYS_INLINE void VersionedTextDocumentIdentifier::set_uri(ArgT0&& arg0, ArgT... args) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + uri_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri) } inline std::string* VersionedTextDocumentIdentifier::mutable_uri() { @@ -12043,15 +12094,15 @@ inline const std::string& VersionedTextDocumentIdentifier::_internal_uri() const } inline void VersionedTextDocumentIdentifier::_internal_set_uri(const std::string& value) { - uri_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + uri_.Set(value, GetArenaForAllocation()); } inline std::string* VersionedTextDocumentIdentifier::_internal_mutable_uri() { - return uri_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return uri_.Mutable(GetArenaForAllocation()); } inline std::string* VersionedTextDocumentIdentifier::release_uri() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri) - return uri_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return uri_.Release(); } inline void VersionedTextDocumentIdentifier::set_allocated_uri(std::string* uri) { if (uri != nullptr) { @@ -12059,8 +12110,12 @@ inline void VersionedTextDocumentIdentifier::set_allocated_uri(std::string* uri) } else { } - uri_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), uri, - GetArenaForAllocation()); + uri_.SetAllocated(uri, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (uri_.IsDefault()) { + uri_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.uri) } @@ -12068,18 +12123,18 @@ inline void VersionedTextDocumentIdentifier::set_allocated_uri(std::string* uri) inline void VersionedTextDocumentIdentifier::clear_version() { version_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 VersionedTextDocumentIdentifier::_internal_version() const { +inline int32_t VersionedTextDocumentIdentifier::_internal_version() const { return version_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 VersionedTextDocumentIdentifier::version() const { +inline int32_t VersionedTextDocumentIdentifier::version() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.version) return _internal_version(); } -inline void VersionedTextDocumentIdentifier::_internal_set_version(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void VersionedTextDocumentIdentifier::_internal_set_version(int32_t value) { version_ = value; } -inline void VersionedTextDocumentIdentifier::set_version(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void VersionedTextDocumentIdentifier::set_version(int32_t value) { _internal_set_version(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier.version) } @@ -12092,18 +12147,18 @@ inline void VersionedTextDocumentIdentifier::set_version(::PROTOBUF_NAMESPACE_ID inline void Position::clear_line() { line_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 Position::_internal_line() const { +inline int32_t Position::_internal_line() const { return line_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 Position::line() const { +inline int32_t Position::line() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.Position.line) return _internal_line(); } -inline void Position::_internal_set_line(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void Position::_internal_set_line(int32_t value) { line_ = value; } -inline void Position::set_line(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void Position::set_line(int32_t value) { _internal_set_line(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.Position.line) } @@ -12112,18 +12167,18 @@ inline void Position::set_line(::PROTOBUF_NAMESPACE_ID::int32 value) { inline void Position::clear_character() { character_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 Position::_internal_character() const { +inline int32_t Position::_internal_character() const { return character_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 Position::character() const { +inline int32_t Position::character() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.Position.character) return _internal_character(); } -inline void Position::_internal_set_character(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void Position::_internal_set_character(int32_t value) { character_ = value; } -inline void Position::set_character(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void Position::set_character(int32_t value) { _internal_set_character(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.Position.character) } @@ -12203,8 +12258,7 @@ inline void GetCompletionItemsRequest::set_allocated_console_id(::io::deephaven: } if (console_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(console_id)); if (message_arena != submessage_arena) { console_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12295,7 +12349,7 @@ inline void GetCompletionItemsRequest::set_allocated_context(::io::deephaven::pr } if (context) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::CompletionContext>::GetOwningArena(context); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(context); if (message_arena != submessage_arena) { context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, context, submessage_arena); @@ -12385,7 +12439,7 @@ inline void GetCompletionItemsRequest::set_allocated_text_document(::io::deephav } if (text_document) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::VersionedTextDocumentIdentifier>::GetOwningArena(text_document); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(text_document); if (message_arena != submessage_arena) { text_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, text_document, submessage_arena); @@ -12475,7 +12529,7 @@ inline void GetCompletionItemsRequest::set_allocated_position(::io::deephaven::p } if (position) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::Position>::GetOwningArena(position); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(position); if (message_arena != submessage_arena) { position = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, position, submessage_arena); @@ -12492,18 +12546,18 @@ inline void GetCompletionItemsRequest::set_allocated_position(::io::deephaven::p inline void GetCompletionItemsRequest::clear_request_id() { request_id_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 GetCompletionItemsRequest::_internal_request_id() const { +inline int32_t GetCompletionItemsRequest::_internal_request_id() const { return request_id_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 GetCompletionItemsRequest::request_id() const { +inline int32_t GetCompletionItemsRequest::request_id() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.request_id) return _internal_request_id(); } -inline void GetCompletionItemsRequest::_internal_set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void GetCompletionItemsRequest::_internal_set_request_id(int32_t value) { request_id_ = value; } -inline void GetCompletionItemsRequest::set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void GetCompletionItemsRequest::set_request_id(int32_t value) { _internal_set_request_id(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.request_id) } @@ -12516,18 +12570,18 @@ inline void GetCompletionItemsRequest::set_request_id(::PROTOBUF_NAMESPACE_ID::i inline void CompletionContext::clear_trigger_kind() { trigger_kind_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionContext::_internal_trigger_kind() const { +inline int32_t CompletionContext::_internal_trigger_kind() const { return trigger_kind_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionContext::trigger_kind() const { +inline int32_t CompletionContext::trigger_kind() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_kind) return _internal_trigger_kind(); } -inline void CompletionContext::_internal_set_trigger_kind(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionContext::_internal_set_trigger_kind(int32_t value) { trigger_kind_ = value; } -inline void CompletionContext::set_trigger_kind(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionContext::set_trigger_kind(int32_t value) { _internal_set_trigger_kind(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_kind) } @@ -12544,7 +12598,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionContext::set_trigger_character(ArgT0&& arg0, ArgT... args) { - trigger_character_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + trigger_character_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character) } inline std::string* CompletionContext::mutable_trigger_character() { @@ -12557,15 +12611,15 @@ inline const std::string& CompletionContext::_internal_trigger_character() const } inline void CompletionContext::_internal_set_trigger_character(const std::string& value) { - trigger_character_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + trigger_character_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionContext::_internal_mutable_trigger_character() { - return trigger_character_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return trigger_character_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionContext::release_trigger_character() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character) - return trigger_character_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return trigger_character_.Release(); } inline void CompletionContext::set_allocated_trigger_character(std::string* trigger_character) { if (trigger_character != nullptr) { @@ -12573,8 +12627,12 @@ inline void CompletionContext::set_allocated_trigger_character(std::string* trig } else { } - trigger_character_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), trigger_character, - GetArenaForAllocation()); + trigger_character_.SetAllocated(trigger_character, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (trigger_character_.IsDefault()) { + trigger_character_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionContext.trigger_character) } @@ -12626,18 +12684,18 @@ GetCompletionItemsResponse::items() const { inline void GetCompletionItemsResponse::clear_request_id() { request_id_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 GetCompletionItemsResponse::_internal_request_id() const { +inline int32_t GetCompletionItemsResponse::_internal_request_id() const { return request_id_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 GetCompletionItemsResponse::request_id() const { +inline int32_t GetCompletionItemsResponse::request_id() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.request_id) return _internal_request_id(); } -inline void GetCompletionItemsResponse::_internal_set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void GetCompletionItemsResponse::_internal_set_request_id(int32_t value) { request_id_ = value; } -inline void GetCompletionItemsResponse::set_request_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void GetCompletionItemsResponse::set_request_id(int32_t value) { _internal_set_request_id(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.request_id) } @@ -12670,18 +12728,18 @@ inline void GetCompletionItemsResponse::set_success(bool value) { inline void CompletionItem::clear_start() { start_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::_internal_start() const { +inline int32_t CompletionItem::_internal_start() const { return start_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::start() const { +inline int32_t CompletionItem::start() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.CompletionItem.start) return _internal_start(); } -inline void CompletionItem::_internal_set_start(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::_internal_set_start(int32_t value) { start_ = value; } -inline void CompletionItem::set_start(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::set_start(int32_t value) { _internal_set_start(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.start) } @@ -12690,18 +12748,18 @@ inline void CompletionItem::set_start(::PROTOBUF_NAMESPACE_ID::int32 value) { inline void CompletionItem::clear_length() { length_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::_internal_length() const { +inline int32_t CompletionItem::_internal_length() const { return length_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::length() const { +inline int32_t CompletionItem::length() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.CompletionItem.length) return _internal_length(); } -inline void CompletionItem::_internal_set_length(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::_internal_set_length(int32_t value) { length_ = value; } -inline void CompletionItem::set_length(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::set_length(int32_t value) { _internal_set_length(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.length) } @@ -12718,7 +12776,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionItem::set_label(ArgT0&& arg0, ArgT... args) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + label_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.label) } inline std::string* CompletionItem::mutable_label() { @@ -12731,15 +12789,15 @@ inline const std::string& CompletionItem::_internal_label() const { } inline void CompletionItem::_internal_set_label(const std::string& value) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + label_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionItem::_internal_mutable_label() { - return label_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return label_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionItem::release_label() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionItem.label) - return label_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return label_.Release(); } inline void CompletionItem::set_allocated_label(std::string* label) { if (label != nullptr) { @@ -12747,8 +12805,12 @@ inline void CompletionItem::set_allocated_label(std::string* label) { } else { } - label_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), label, - GetArenaForAllocation()); + label_.SetAllocated(label, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (label_.IsDefault()) { + label_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionItem.label) } @@ -12756,18 +12818,18 @@ inline void CompletionItem::set_allocated_label(std::string* label) { inline void CompletionItem::clear_kind() { kind_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::_internal_kind() const { +inline int32_t CompletionItem::_internal_kind() const { return kind_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::kind() const { +inline int32_t CompletionItem::kind() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.CompletionItem.kind) return _internal_kind(); } -inline void CompletionItem::_internal_set_kind(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::_internal_set_kind(int32_t value) { kind_ = value; } -inline void CompletionItem::set_kind(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::set_kind(int32_t value) { _internal_set_kind(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.kind) } @@ -12784,7 +12846,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionItem::set_detail(ArgT0&& arg0, ArgT... args) { - detail_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + detail_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.detail) } inline std::string* CompletionItem::mutable_detail() { @@ -12797,15 +12859,15 @@ inline const std::string& CompletionItem::_internal_detail() const { } inline void CompletionItem::_internal_set_detail(const std::string& value) { - detail_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + detail_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionItem::_internal_mutable_detail() { - return detail_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return detail_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionItem::release_detail() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionItem.detail) - return detail_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return detail_.Release(); } inline void CompletionItem::set_allocated_detail(std::string* detail) { if (detail != nullptr) { @@ -12813,8 +12875,12 @@ inline void CompletionItem::set_allocated_detail(std::string* detail) { } else { } - detail_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), detail, - GetArenaForAllocation()); + detail_.SetAllocated(detail, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (detail_.IsDefault()) { + detail_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionItem.detail) } @@ -12830,7 +12896,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionItem::set_documentation(ArgT0&& arg0, ArgT... args) { - documentation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + documentation_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation) } inline std::string* CompletionItem::mutable_documentation() { @@ -12843,15 +12909,15 @@ inline const std::string& CompletionItem::_internal_documentation() const { } inline void CompletionItem::_internal_set_documentation(const std::string& value) { - documentation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + documentation_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionItem::_internal_mutable_documentation() { - return documentation_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return documentation_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionItem::release_documentation() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation) - return documentation_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return documentation_.Release(); } inline void CompletionItem::set_allocated_documentation(std::string* documentation) { if (documentation != nullptr) { @@ -12859,8 +12925,12 @@ inline void CompletionItem::set_allocated_documentation(std::string* documentati } else { } - documentation_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), documentation, - GetArenaForAllocation()); + documentation_.SetAllocated(documentation, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (documentation_.IsDefault()) { + documentation_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionItem.documentation) } @@ -12981,7 +13051,7 @@ inline void CompletionItem::set_allocated_text_edit(::io::deephaven::proto::back } if (text_edit) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::TextEdit>::GetOwningArena(text_edit); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(text_edit); if (message_arena != submessage_arena) { text_edit = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, text_edit, submessage_arena); @@ -13006,7 +13076,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionItem::set_sort_text(ArgT0&& arg0, ArgT... args) { - sort_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + sort_text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text) } inline std::string* CompletionItem::mutable_sort_text() { @@ -13019,15 +13089,15 @@ inline const std::string& CompletionItem::_internal_sort_text() const { } inline void CompletionItem::_internal_set_sort_text(const std::string& value) { - sort_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + sort_text_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionItem::_internal_mutable_sort_text() { - return sort_text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return sort_text_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionItem::release_sort_text() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text) - return sort_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return sort_text_.Release(); } inline void CompletionItem::set_allocated_sort_text(std::string* sort_text) { if (sort_text != nullptr) { @@ -13035,8 +13105,12 @@ inline void CompletionItem::set_allocated_sort_text(std::string* sort_text) { } else { } - sort_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), sort_text, - GetArenaForAllocation()); + sort_text_.SetAllocated(sort_text, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (sort_text_.IsDefault()) { + sort_text_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionItem.sort_text) } @@ -13052,7 +13126,7 @@ template inline PROTOBUF_ALWAYS_INLINE void CompletionItem::set_filter_text(ArgT0&& arg0, ArgT... args) { - filter_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + filter_text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text) } inline std::string* CompletionItem::mutable_filter_text() { @@ -13065,15 +13139,15 @@ inline const std::string& CompletionItem::_internal_filter_text() const { } inline void CompletionItem::_internal_set_filter_text(const std::string& value) { - filter_text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + filter_text_.Set(value, GetArenaForAllocation()); } inline std::string* CompletionItem::_internal_mutable_filter_text() { - return filter_text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return filter_text_.Mutable(GetArenaForAllocation()); } inline std::string* CompletionItem::release_filter_text() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text) - return filter_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return filter_text_.Release(); } inline void CompletionItem::set_allocated_filter_text(std::string* filter_text) { if (filter_text != nullptr) { @@ -13081,8 +13155,12 @@ inline void CompletionItem::set_allocated_filter_text(std::string* filter_text) } else { } - filter_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), filter_text, - GetArenaForAllocation()); + filter_text_.SetAllocated(filter_text, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (filter_text_.IsDefault()) { + filter_text_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.CompletionItem.filter_text) } @@ -13090,18 +13168,18 @@ inline void CompletionItem::set_allocated_filter_text(std::string* filter_text) inline void CompletionItem::clear_insert_text_format() { insert_text_format_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::_internal_insert_text_format() const { +inline int32_t CompletionItem::_internal_insert_text_format() const { return insert_text_format_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CompletionItem::insert_text_format() const { +inline int32_t CompletionItem::insert_text_format() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.CompletionItem.insert_text_format) return _internal_insert_text_format(); } -inline void CompletionItem::_internal_set_insert_text_format(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::_internal_set_insert_text_format(int32_t value) { insert_text_format_ = value; } -inline void CompletionItem::set_insert_text_format(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CompletionItem::set_insert_text_format(int32_t value) { _internal_set_insert_text_format(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.CompletionItem.insert_text_format) } @@ -13302,7 +13380,7 @@ inline void TextEdit::set_allocated_range(::io::deephaven::proto::backplane::scr } if (range) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::DocumentRange>::GetOwningArena(range); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(range); if (message_arena != submessage_arena) { range = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, range, submessage_arena); @@ -13327,7 +13405,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TextEdit::set_text(ArgT0&& arg0, ArgT... args) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.TextEdit.text) } inline std::string* TextEdit::mutable_text() { @@ -13340,15 +13418,15 @@ inline const std::string& TextEdit::_internal_text() const { } inline void TextEdit::_internal_set_text(const std::string& value) { - text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + text_.Set(value, GetArenaForAllocation()); } inline std::string* TextEdit::_internal_mutable_text() { - return text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return text_.Mutable(GetArenaForAllocation()); } inline std::string* TextEdit::release_text() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.TextEdit.text) - return text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return text_.Release(); } inline void TextEdit::set_allocated_text(std::string* text) { if (text != nullptr) { @@ -13356,8 +13434,12 @@ inline void TextEdit::set_allocated_text(std::string* text) { } else { } - text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text, - GetArenaForAllocation()); + text_.SetAllocated(text, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (text_.IsDefault()) { + text_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.TextEdit.text) } @@ -13369,18 +13451,18 @@ inline void TextEdit::set_allocated_text(std::string* text) { inline void FigureDescriptor_ChartDescriptor::clear_colspan() { colspan_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_ChartDescriptor::_internal_colspan() const { +inline int32_t FigureDescriptor_ChartDescriptor::_internal_colspan() const { return colspan_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_ChartDescriptor::colspan() const { +inline int32_t FigureDescriptor_ChartDescriptor::colspan() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.colspan) return _internal_colspan(); } -inline void FigureDescriptor_ChartDescriptor::_internal_set_colspan(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_ChartDescriptor::_internal_set_colspan(int32_t value) { colspan_ = value; } -inline void FigureDescriptor_ChartDescriptor::set_colspan(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_ChartDescriptor::set_colspan(int32_t value) { _internal_set_colspan(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.colspan) } @@ -13389,18 +13471,18 @@ inline void FigureDescriptor_ChartDescriptor::set_colspan(::PROTOBUF_NAMESPACE_I inline void FigureDescriptor_ChartDescriptor::clear_rowspan() { rowspan_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_ChartDescriptor::_internal_rowspan() const { +inline int32_t FigureDescriptor_ChartDescriptor::_internal_rowspan() const { return rowspan_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_ChartDescriptor::rowspan() const { +inline int32_t FigureDescriptor_ChartDescriptor::rowspan() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.rowspan) return _internal_rowspan(); } -inline void FigureDescriptor_ChartDescriptor::_internal_set_rowspan(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_ChartDescriptor::_internal_set_rowspan(int32_t value) { rowspan_ = value; } -inline void FigureDescriptor_ChartDescriptor::set_rowspan(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_ChartDescriptor::set_rowspan(int32_t value) { _internal_set_rowspan(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.rowspan) } @@ -13565,7 +13647,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_ChartDescriptor::set_title(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000001u; - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title) } inline std::string* FigureDescriptor_ChartDescriptor::mutable_title() { @@ -13578,11 +13660,11 @@ inline const std::string& FigureDescriptor_ChartDescriptor::_internal_title() co } inline void FigureDescriptor_ChartDescriptor::_internal_set_title(const std::string& value) { _has_bits_[0] |= 0x00000001u; - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::_internal_mutable_title() { _has_bits_[0] |= 0x00000001u; - return title_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::release_title() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title) @@ -13590,7 +13672,13 @@ inline std::string* FigureDescriptor_ChartDescriptor::release_title() { return nullptr; } _has_bits_[0] &= ~0x00000001u; - return title_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = title_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_.IsDefault()) { + title_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_ChartDescriptor::set_allocated_title(std::string* title) { if (title != nullptr) { @@ -13598,8 +13686,12 @@ inline void FigureDescriptor_ChartDescriptor::set_allocated_title(std::string* t } else { _has_bits_[0] &= ~0x00000001u; } - title_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title, - GetArenaForAllocation()); + title_.SetAllocated(title, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_.IsDefault()) { + title_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title) } @@ -13615,7 +13707,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_ChartDescriptor::set_title_font(ArgT0&& arg0, ArgT... args) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_font_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font) } inline std::string* FigureDescriptor_ChartDescriptor::mutable_title_font() { @@ -13628,15 +13720,15 @@ inline const std::string& FigureDescriptor_ChartDescriptor::_internal_title_font } inline void FigureDescriptor_ChartDescriptor::_internal_set_title_font(const std::string& value) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_font_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::_internal_mutable_title_font() { - return title_font_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_font_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::release_title_font() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font) - return title_font_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return title_font_.Release(); } inline void FigureDescriptor_ChartDescriptor::set_allocated_title_font(std::string* title_font) { if (title_font != nullptr) { @@ -13644,8 +13736,12 @@ inline void FigureDescriptor_ChartDescriptor::set_allocated_title_font(std::stri } else { } - title_font_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title_font, - GetArenaForAllocation()); + title_font_.SetAllocated(title_font, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_font_.IsDefault()) { + title_font_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_font) } @@ -13661,7 +13757,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_ChartDescriptor::set_title_color(ArgT0&& arg0, ArgT... args) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color) } inline std::string* FigureDescriptor_ChartDescriptor::mutable_title_color() { @@ -13674,15 +13770,15 @@ inline const std::string& FigureDescriptor_ChartDescriptor::_internal_title_colo } inline void FigureDescriptor_ChartDescriptor::_internal_set_title_color(const std::string& value) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::_internal_mutable_title_color() { - return title_color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::release_title_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color) - return title_color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return title_color_.Release(); } inline void FigureDescriptor_ChartDescriptor::set_allocated_title_color(std::string* title_color) { if (title_color != nullptr) { @@ -13690,8 +13786,12 @@ inline void FigureDescriptor_ChartDescriptor::set_allocated_title_color(std::str } else { } - title_color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title_color, - GetArenaForAllocation()); + title_color_.SetAllocated(title_color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_color_.IsDefault()) { + title_color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.title_color) } @@ -13727,7 +13827,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_ChartDescriptor::set_legend_font(ArgT0&& arg0, ArgT... args) { - legend_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + legend_font_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font) } inline std::string* FigureDescriptor_ChartDescriptor::mutable_legend_font() { @@ -13740,15 +13840,15 @@ inline const std::string& FigureDescriptor_ChartDescriptor::_internal_legend_fon } inline void FigureDescriptor_ChartDescriptor::_internal_set_legend_font(const std::string& value) { - legend_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + legend_font_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::_internal_mutable_legend_font() { - return legend_font_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return legend_font_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::release_legend_font() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font) - return legend_font_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return legend_font_.Release(); } inline void FigureDescriptor_ChartDescriptor::set_allocated_legend_font(std::string* legend_font) { if (legend_font != nullptr) { @@ -13756,8 +13856,12 @@ inline void FigureDescriptor_ChartDescriptor::set_allocated_legend_font(std::str } else { } - legend_font_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), legend_font, - GetArenaForAllocation()); + legend_font_.SetAllocated(legend_font, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (legend_font_.IsDefault()) { + legend_font_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_font) } @@ -13773,7 +13877,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_ChartDescriptor::set_legend_color(ArgT0&& arg0, ArgT... args) { - legend_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + legend_color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color) } inline std::string* FigureDescriptor_ChartDescriptor::mutable_legend_color() { @@ -13786,15 +13890,15 @@ inline const std::string& FigureDescriptor_ChartDescriptor::_internal_legend_col } inline void FigureDescriptor_ChartDescriptor::_internal_set_legend_color(const std::string& value) { - legend_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + legend_color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::_internal_mutable_legend_color() { - return legend_color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return legend_color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_ChartDescriptor::release_legend_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color) - return legend_color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return legend_color_.Release(); } inline void FigureDescriptor_ChartDescriptor::set_allocated_legend_color(std::string* legend_color) { if (legend_color != nullptr) { @@ -13802,8 +13906,12 @@ inline void FigureDescriptor_ChartDescriptor::set_allocated_legend_color(std::st } else { } - legend_color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), legend_color, - GetArenaForAllocation()); + legend_color_.SetAllocated(legend_color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (legend_color_.IsDefault()) { + legend_color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.legend_color) } @@ -13863,7 +13971,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_name() { @@ -13876,15 +13984,15 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_name() co } inline void FigureDescriptor_SeriesDescriptor::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + name_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return name_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return name_.Release(); } inline void FigureDescriptor_SeriesDescriptor::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -13892,8 +14000,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_name(std::string* n } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (name_.IsDefault()) { + name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.name) } @@ -13985,7 +14097,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_line_color(ArgT0&& arg0, ArgT... args) { - line_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + line_color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_line_color() { @@ -13998,15 +14110,15 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_line_colo } inline void FigureDescriptor_SeriesDescriptor::_internal_set_line_color(const std::string& value) { - line_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + line_color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_line_color() { - return line_color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return line_color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_line_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color) - return line_color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return line_color_.Release(); } inline void FigureDescriptor_SeriesDescriptor::set_allocated_line_color(std::string* line_color) { if (line_color != nullptr) { @@ -14014,8 +14126,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_line_color(std::str } else { } - line_color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), line_color, - GetArenaForAllocation()); + line_color_.SetAllocated(line_color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (line_color_.IsDefault()) { + line_color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.line_color) } @@ -14039,7 +14155,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_point_label_format(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000001u; - point_label_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + point_label_format_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_point_label_format() { @@ -14052,11 +14168,11 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_point_lab } inline void FigureDescriptor_SeriesDescriptor::_internal_set_point_label_format(const std::string& value) { _has_bits_[0] |= 0x00000001u; - point_label_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + point_label_format_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_point_label_format() { _has_bits_[0] |= 0x00000001u; - return point_label_format_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return point_label_format_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_point_label_format() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format) @@ -14064,7 +14180,13 @@ inline std::string* FigureDescriptor_SeriesDescriptor::release_point_label_forma return nullptr; } _has_bits_[0] &= ~0x00000001u; - return point_label_format_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = point_label_format_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (point_label_format_.IsDefault()) { + point_label_format_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_SeriesDescriptor::set_allocated_point_label_format(std::string* point_label_format) { if (point_label_format != nullptr) { @@ -14072,8 +14194,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_point_label_format( } else { _has_bits_[0] &= ~0x00000001u; } - point_label_format_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), point_label_format, - GetArenaForAllocation()); + point_label_format_.SetAllocated(point_label_format, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (point_label_format_.IsDefault()) { + point_label_format_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.point_label_format) } @@ -14097,7 +14223,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_x_tool_tip_pattern(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000002u; - x_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + x_tool_tip_pattern_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_x_tool_tip_pattern() { @@ -14110,11 +14236,11 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_x_tool_ti } inline void FigureDescriptor_SeriesDescriptor::_internal_set_x_tool_tip_pattern(const std::string& value) { _has_bits_[0] |= 0x00000002u; - x_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + x_tool_tip_pattern_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_x_tool_tip_pattern() { _has_bits_[0] |= 0x00000002u; - return x_tool_tip_pattern_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return x_tool_tip_pattern_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_x_tool_tip_pattern() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern) @@ -14122,7 +14248,13 @@ inline std::string* FigureDescriptor_SeriesDescriptor::release_x_tool_tip_patter return nullptr; } _has_bits_[0] &= ~0x00000002u; - return x_tool_tip_pattern_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = x_tool_tip_pattern_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (x_tool_tip_pattern_.IsDefault()) { + x_tool_tip_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_SeriesDescriptor::set_allocated_x_tool_tip_pattern(std::string* x_tool_tip_pattern) { if (x_tool_tip_pattern != nullptr) { @@ -14130,8 +14262,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_x_tool_tip_pattern( } else { _has_bits_[0] &= ~0x00000002u; } - x_tool_tip_pattern_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), x_tool_tip_pattern, - GetArenaForAllocation()); + x_tool_tip_pattern_.SetAllocated(x_tool_tip_pattern, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (x_tool_tip_pattern_.IsDefault()) { + x_tool_tip_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.x_tool_tip_pattern) } @@ -14155,7 +14291,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_y_tool_tip_pattern(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000004u; - y_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + y_tool_tip_pattern_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_y_tool_tip_pattern() { @@ -14168,11 +14304,11 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_y_tool_ti } inline void FigureDescriptor_SeriesDescriptor::_internal_set_y_tool_tip_pattern(const std::string& value) { _has_bits_[0] |= 0x00000004u; - y_tool_tip_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + y_tool_tip_pattern_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_y_tool_tip_pattern() { _has_bits_[0] |= 0x00000004u; - return y_tool_tip_pattern_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return y_tool_tip_pattern_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_y_tool_tip_pattern() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern) @@ -14180,7 +14316,13 @@ inline std::string* FigureDescriptor_SeriesDescriptor::release_y_tool_tip_patter return nullptr; } _has_bits_[0] &= ~0x00000004u; - return y_tool_tip_pattern_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = y_tool_tip_pattern_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (y_tool_tip_pattern_.IsDefault()) { + y_tool_tip_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_SeriesDescriptor::set_allocated_y_tool_tip_pattern(std::string* y_tool_tip_pattern) { if (y_tool_tip_pattern != nullptr) { @@ -14188,8 +14330,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_y_tool_tip_pattern( } else { _has_bits_[0] &= ~0x00000004u; } - y_tool_tip_pattern_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), y_tool_tip_pattern, - GetArenaForAllocation()); + y_tool_tip_pattern_.SetAllocated(y_tool_tip_pattern, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (y_tool_tip_pattern_.IsDefault()) { + y_tool_tip_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.y_tool_tip_pattern) } @@ -14205,7 +14351,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_shape_label(ArgT0&& arg0, ArgT... args) { - shape_label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + shape_label_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_shape_label() { @@ -14218,15 +14364,15 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_shape_lab } inline void FigureDescriptor_SeriesDescriptor::_internal_set_shape_label(const std::string& value) { - shape_label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + shape_label_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_shape_label() { - return shape_label_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return shape_label_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_shape_label() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label) - return shape_label_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return shape_label_.Release(); } inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape_label(std::string* shape_label) { if (shape_label != nullptr) { @@ -14234,8 +14380,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape_label(std::st } else { } - shape_label_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), shape_label, - GetArenaForAllocation()); + shape_label_.SetAllocated(shape_label, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (shape_label_.IsDefault()) { + shape_label_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_label) } @@ -14279,7 +14429,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_shape_color(ArgT0&& arg0, ArgT... args) { - shape_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + shape_color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_shape_color() { @@ -14292,15 +14442,15 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_shape_col } inline void FigureDescriptor_SeriesDescriptor::_internal_set_shape_color(const std::string& value) { - shape_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + shape_color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_shape_color() { - return shape_color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return shape_color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_shape_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color) - return shape_color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return shape_color_.Release(); } inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape_color(std::string* shape_color) { if (shape_color != nullptr) { @@ -14308,8 +14458,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape_color(std::st } else { } - shape_color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), shape_color, - GetArenaForAllocation()); + shape_color_.SetAllocated(shape_color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (shape_color_.IsDefault()) { + shape_color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape_color) } @@ -14325,7 +14479,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SeriesDescriptor::set_shape(ArgT0&& arg0, ArgT... args) { - shape_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + shape_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape) } inline std::string* FigureDescriptor_SeriesDescriptor::mutable_shape() { @@ -14338,15 +14492,15 @@ inline const std::string& FigureDescriptor_SeriesDescriptor::_internal_shape() c } inline void FigureDescriptor_SeriesDescriptor::_internal_set_shape(const std::string& value) { - shape_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + shape_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::_internal_mutable_shape() { - return shape_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return shape_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SeriesDescriptor::release_shape() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape) - return shape_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return shape_.Release(); } inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape(std::string* shape) { if (shape != nullptr) { @@ -14354,8 +14508,12 @@ inline void FigureDescriptor_SeriesDescriptor::set_allocated_shape(std::string* } else { } - shape_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), shape, - GetArenaForAllocation()); + shape_.SetAllocated(shape, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (shape_.IsDefault()) { + shape_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.shape) } @@ -14435,7 +14593,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_MultiSeriesDescriptor::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name) } inline std::string* FigureDescriptor_MultiSeriesDescriptor::mutable_name() { @@ -14448,15 +14606,15 @@ inline const std::string& FigureDescriptor_MultiSeriesDescriptor::_internal_name } inline void FigureDescriptor_MultiSeriesDescriptor::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + name_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesDescriptor::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return name_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesDescriptor::release_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return name_.Release(); } inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -14464,8 +14622,12 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_name(std::stri } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (name_.IsDefault()) { + name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.name) } @@ -14546,7 +14708,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_line_color(::i } if (line_color) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(line_color); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(line_color); if (message_arena != submessage_arena) { line_color = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, line_color, submessage_arena); @@ -14636,7 +14798,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_point_color(:: } if (point_color) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(point_color); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(point_color); if (message_arena != submessage_arena) { point_color = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, point_color, submessage_arena); @@ -14726,7 +14888,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_lines_visible( } if (lines_visible) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault>::GetOwningArena(lines_visible); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(lines_visible); if (message_arena != submessage_arena) { lines_visible = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, lines_visible, submessage_arena); @@ -14816,7 +14978,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_points_visible } if (points_visible) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault>::GetOwningArena(points_visible); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(points_visible); if (message_arena != submessage_arena) { points_visible = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, points_visible, submessage_arena); @@ -14906,7 +15068,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_gradient_visib } if (gradient_visible) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BoolMapWithDefault>::GetOwningArena(gradient_visible); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(gradient_visible); if (message_arena != submessage_arena) { gradient_visible = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, gradient_visible, submessage_arena); @@ -14996,7 +15158,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_point_label_fo } if (point_label_format) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(point_label_format); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(point_label_format); if (message_arena != submessage_arena) { point_label_format = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, point_label_format, submessage_arena); @@ -15086,7 +15248,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_x_tool_tip_pat } if (x_tool_tip_pattern) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(x_tool_tip_pattern); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(x_tool_tip_pattern); if (message_arena != submessage_arena) { x_tool_tip_pattern = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, x_tool_tip_pattern, submessage_arena); @@ -15176,7 +15338,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_y_tool_tip_pat } if (y_tool_tip_pattern) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(y_tool_tip_pattern); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(y_tool_tip_pattern); if (message_arena != submessage_arena) { y_tool_tip_pattern = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, y_tool_tip_pattern, submessage_arena); @@ -15266,7 +15428,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_point_label(:: } if (point_label) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(point_label); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(point_label); if (message_arena != submessage_arena) { point_label = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, point_label, submessage_arena); @@ -15356,7 +15518,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_point_size(::i } if (point_size) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_DoubleMapWithDefault>::GetOwningArena(point_size); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(point_size); if (message_arena != submessage_arena) { point_size = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, point_size, submessage_arena); @@ -15446,7 +15608,7 @@ inline void FigureDescriptor_MultiSeriesDescriptor::set_allocated_point_shape(:: } if (point_shape) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_StringMapWithDefault>::GetOwningArena(point_shape); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(point_shape); if (message_arena != submessage_arena) { point_shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, point_shape, submessage_arena); @@ -15503,9 +15665,17 @@ FigureDescriptor_MultiSeriesDescriptor::data_sources() const { // FigureDescriptor_StringMapWithDefault -// string default_string = 1; +// optional string default_string = 1; +inline bool FigureDescriptor_StringMapWithDefault::_internal_has_default_string() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool FigureDescriptor_StringMapWithDefault::has_default_string() const { + return _internal_has_default_string(); +} inline void FigureDescriptor_StringMapWithDefault::clear_default_string() { default_string_.ClearToEmpty(); + _has_bits_[0] &= ~0x00000001u; } inline const std::string& FigureDescriptor_StringMapWithDefault::default_string() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string) @@ -15514,8 +15684,8 @@ inline const std::string& FigureDescriptor_StringMapWithDefault::default_string( template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_StringMapWithDefault::set_default_string(ArgT0&& arg0, ArgT... args) { - - default_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _has_bits_[0] |= 0x00000001u; + default_string_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string) } inline std::string* FigureDescriptor_StringMapWithDefault::mutable_default_string() { @@ -15527,25 +15697,39 @@ inline const std::string& FigureDescriptor_StringMapWithDefault::_internal_defau return default_string_.Get(); } inline void FigureDescriptor_StringMapWithDefault::_internal_set_default_string(const std::string& value) { - - default_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _has_bits_[0] |= 0x00000001u; + default_string_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_StringMapWithDefault::_internal_mutable_default_string() { - - return default_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _has_bits_[0] |= 0x00000001u; + return default_string_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_StringMapWithDefault::release_default_string() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string) - return default_string_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + if (!_internal_has_default_string()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + auto* p = default_string_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (default_string_.IsDefault()) { + default_string_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_StringMapWithDefault::set_allocated_default_string(std::string* default_string) { if (default_string != nullptr) { - + _has_bits_[0] |= 0x00000001u; } else { - + _has_bits_[0] &= ~0x00000001u; } - default_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), default_string, - GetArenaForAllocation()); + default_string_.SetAllocated(default_string, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (default_string_.IsDefault()) { + default_string_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault.default_string) } @@ -15703,9 +15887,17 @@ FigureDescriptor_StringMapWithDefault::mutable_values() { // FigureDescriptor_DoubleMapWithDefault -// double default_double = 1; +// optional double default_double = 1; +inline bool FigureDescriptor_DoubleMapWithDefault::_internal_has_default_double() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool FigureDescriptor_DoubleMapWithDefault::has_default_double() const { + return _internal_has_default_double(); +} inline void FigureDescriptor_DoubleMapWithDefault::clear_default_double() { default_double_ = 0; + _has_bits_[0] &= ~0x00000001u; } inline double FigureDescriptor_DoubleMapWithDefault::_internal_default_double() const { return default_double_; @@ -15715,7 +15907,7 @@ inline double FigureDescriptor_DoubleMapWithDefault::default_double() const { return _internal_default_double(); } inline void FigureDescriptor_DoubleMapWithDefault::_internal_set_default_double(double value) { - + _has_bits_[0] |= 0x00000001u; default_double_ = value; } inline void FigureDescriptor_DoubleMapWithDefault::set_default_double(double value) { @@ -15849,9 +16041,17 @@ FigureDescriptor_DoubleMapWithDefault::mutable_values() { // FigureDescriptor_BoolMapWithDefault -// bool default_bool = 1; +// optional bool default_bool = 1; +inline bool FigureDescriptor_BoolMapWithDefault::_internal_has_default_bool() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool FigureDescriptor_BoolMapWithDefault::has_default_bool() const { + return _internal_has_default_bool(); +} inline void FigureDescriptor_BoolMapWithDefault::clear_default_bool() { default_bool_ = false; + _has_bits_[0] &= ~0x00000001u; } inline bool FigureDescriptor_BoolMapWithDefault::_internal_default_bool() const { return default_bool_; @@ -15861,7 +16061,7 @@ inline bool FigureDescriptor_BoolMapWithDefault::default_bool() const { return _internal_default_bool(); } inline void FigureDescriptor_BoolMapWithDefault::_internal_set_default_bool(bool value) { - + _has_bits_[0] |= 0x00000001u; default_bool_ = value; } inline void FigureDescriptor_BoolMapWithDefault::set_default_bool(bool value) { @@ -16007,7 +16207,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_id(ArgT0&& arg0, ArgT... args) { - id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + id_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_id() { @@ -16020,15 +16220,15 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_id() const } inline void FigureDescriptor_AxisDescriptor::_internal_set_id(const std::string& value) { - id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + id_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_id() { - return id_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return id_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_id() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id) - return id_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return id_.Release(); } inline void FigureDescriptor_AxisDescriptor::set_allocated_id(std::string* id) { if (id != nullptr) { @@ -16036,8 +16236,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_id(std::string* id) { } else { } - id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), id, - GetArenaForAllocation()); + id_.SetAllocated(id, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (id_.IsDefault()) { + id_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.id) } @@ -16133,7 +16337,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_label(ArgT0&& arg0, ArgT... args) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + label_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_label() { @@ -16146,15 +16350,15 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_label() con } inline void FigureDescriptor_AxisDescriptor::_internal_set_label(const std::string& value) { - label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + label_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_label() { - return label_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return label_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_label() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label) - return label_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return label_.Release(); } inline void FigureDescriptor_AxisDescriptor::set_allocated_label(std::string* label) { if (label != nullptr) { @@ -16162,8 +16366,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_label(std::string* la } else { } - label_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), label, - GetArenaForAllocation()); + label_.SetAllocated(label, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (label_.IsDefault()) { + label_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label) } @@ -16179,7 +16387,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_label_font(ArgT0&& arg0, ArgT... args) { - label_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + label_font_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_label_font() { @@ -16192,15 +16400,15 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_label_font( } inline void FigureDescriptor_AxisDescriptor::_internal_set_label_font(const std::string& value) { - label_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + label_font_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_label_font() { - return label_font_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return label_font_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_label_font() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font) - return label_font_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return label_font_.Release(); } inline void FigureDescriptor_AxisDescriptor::set_allocated_label_font(std::string* label_font) { if (label_font != nullptr) { @@ -16208,8 +16416,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_label_font(std::strin } else { } - label_font_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), label_font, - GetArenaForAllocation()); + label_font_.SetAllocated(label_font, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (label_font_.IsDefault()) { + label_font_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.label_font) } @@ -16225,7 +16437,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_ticks_font(ArgT0&& arg0, ArgT... args) { - ticks_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + ticks_font_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_ticks_font() { @@ -16238,15 +16450,15 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_ticks_font( } inline void FigureDescriptor_AxisDescriptor::_internal_set_ticks_font(const std::string& value) { - ticks_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + ticks_font_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_ticks_font() { - return ticks_font_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return ticks_font_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_ticks_font() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font) - return ticks_font_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return ticks_font_.Release(); } inline void FigureDescriptor_AxisDescriptor::set_allocated_ticks_font(std::string* ticks_font) { if (ticks_font != nullptr) { @@ -16254,8 +16466,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_ticks_font(std::strin } else { } - ticks_font_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ticks_font, - GetArenaForAllocation()); + ticks_font_.SetAllocated(ticks_font, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (ticks_font_.IsDefault()) { + ticks_font_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.ticks_font) } @@ -16279,7 +16495,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_format_pattern(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000001u; - format_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + format_pattern_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_format_pattern() { @@ -16292,11 +16508,11 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_format_patt } inline void FigureDescriptor_AxisDescriptor::_internal_set_format_pattern(const std::string& value) { _has_bits_[0] |= 0x00000001u; - format_pattern_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + format_pattern_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_format_pattern() { _has_bits_[0] |= 0x00000001u; - return format_pattern_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return format_pattern_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_format_pattern() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern) @@ -16304,7 +16520,13 @@ inline std::string* FigureDescriptor_AxisDescriptor::release_format_pattern() { return nullptr; } _has_bits_[0] &= ~0x00000001u; - return format_pattern_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = format_pattern_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (format_pattern_.IsDefault()) { + format_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor_AxisDescriptor::set_allocated_format_pattern(std::string* format_pattern) { if (format_pattern != nullptr) { @@ -16312,8 +16534,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_format_pattern(std::s } else { _has_bits_[0] &= ~0x00000001u; } - format_pattern_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), format_pattern, - GetArenaForAllocation()); + format_pattern_.SetAllocated(format_pattern, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (format_pattern_.IsDefault()) { + format_pattern_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_pattern) } @@ -16329,7 +16555,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_AxisDescriptor::set_color(ArgT0&& arg0, ArgT... args) { - color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color) } inline std::string* FigureDescriptor_AxisDescriptor::mutable_color() { @@ -16342,15 +16568,15 @@ inline const std::string& FigureDescriptor_AxisDescriptor::_internal_color() con } inline void FigureDescriptor_AxisDescriptor::_internal_set_color(const std::string& value) { - color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::_internal_mutable_color() { - return color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_AxisDescriptor::release_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color) - return color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return color_.Release(); } inline void FigureDescriptor_AxisDescriptor::set_allocated_color(std::string* color) { if (color != nullptr) { @@ -16358,8 +16584,12 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_color(std::string* co } else { } - color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), color, - GetArenaForAllocation()); + color_.SetAllocated(color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (color_.IsDefault()) { + color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.color) } @@ -16447,18 +16677,18 @@ inline void FigureDescriptor_AxisDescriptor::set_major_ticks_visible(bool value) inline void FigureDescriptor_AxisDescriptor::clear_minor_tick_count() { minor_tick_count_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_AxisDescriptor::_internal_minor_tick_count() const { +inline int32_t FigureDescriptor_AxisDescriptor::_internal_minor_tick_count() const { return minor_tick_count_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_AxisDescriptor::minor_tick_count() const { +inline int32_t FigureDescriptor_AxisDescriptor::minor_tick_count() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.minor_tick_count) return _internal_minor_tick_count(); } -inline void FigureDescriptor_AxisDescriptor::_internal_set_minor_tick_count(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_AxisDescriptor::_internal_set_minor_tick_count(int32_t value) { minor_tick_count_ = value; } -inline void FigureDescriptor_AxisDescriptor::set_minor_tick_count(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_AxisDescriptor::set_minor_tick_count(int32_t value) { _internal_set_minor_tick_count(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.minor_tick_count) } @@ -16675,7 +16905,7 @@ inline void FigureDescriptor_AxisDescriptor::set_allocated_business_calendar_des } if (business_calendar_descriptor) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor>::GetOwningArena(business_calendar_descriptor); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(business_calendar_descriptor); if (message_arena != submessage_arena) { business_calendar_descriptor = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, business_calendar_descriptor, submessage_arena); @@ -16704,7 +16934,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_open(ArgT0&& arg0, ArgT... args) { - open_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + open_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open) } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::mutable_open() { @@ -16717,15 +16947,15 @@ inline const std::string& FigureDescriptor_BusinessCalendarDescriptor_BusinessPe } inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_internal_set_open(const std::string& value) { - open_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + open_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_internal_mutable_open() { - return open_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return open_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::release_open() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open) - return open_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return open_.Release(); } inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_allocated_open(std::string* open) { if (open != nullptr) { @@ -16733,8 +16963,12 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_allo } else { } - open_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), open, - GetArenaForAllocation()); + open_.SetAllocated(open, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (open_.IsDefault()) { + open_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.open) } @@ -16750,7 +16984,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_close(ArgT0&& arg0, ArgT... args) { - close_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + close_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close) } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::mutable_close() { @@ -16763,15 +16997,15 @@ inline const std::string& FigureDescriptor_BusinessCalendarDescriptor_BusinessPe } inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_internal_set_close(const std::string& value) { - close_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + close_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::_internal_mutable_close() { - return close_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return close_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::release_close() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close) - return close_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return close_.Release(); } inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_allocated_close(std::string* close) { if (close != nullptr) { @@ -16779,8 +17013,12 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod::set_allo } else { } - close_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), close, - GetArenaForAllocation()); + close_.SetAllocated(close, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (close_.IsDefault()) { + close_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod.close) } @@ -16865,7 +17103,7 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_Holiday::set_allocated_d } if (date) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_BusinessCalendarDescriptor_LocalDate>::GetOwningArena(date); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(date); if (message_arena != submessage_arena) { date = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, date, submessage_arena); @@ -16926,18 +17164,18 @@ FigureDescriptor_BusinessCalendarDescriptor_Holiday::business_periods() const { inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::clear_year() { year_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_year() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_year() const { return year_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::year() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::year() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.year) return _internal_year(); } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_year(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_year(int32_t value) { year_ = value; } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_year(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_year(int32_t value) { _internal_set_year(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.year) } @@ -16946,18 +17184,18 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_year(::PR inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::clear_month() { month_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_month() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_month() const { return month_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::month() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::month() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.month) return _internal_month(); } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_month(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_month(int32_t value) { month_ = value; } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_month(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_month(int32_t value) { _internal_set_month(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.month) } @@ -16966,18 +17204,18 @@ inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_month(::P inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::clear_day() { day_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_day() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_day() const { return day_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_BusinessCalendarDescriptor_LocalDate::day() const { +inline int32_t FigureDescriptor_BusinessCalendarDescriptor_LocalDate::day() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.day) return _internal_day(); } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_day(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::_internal_set_day(int32_t value) { day_ = value; } -inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_day(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_BusinessCalendarDescriptor_LocalDate::set_day(int32_t value) { _internal_set_day(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate.day) } @@ -16998,7 +17236,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_BusinessCalendarDescriptor::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name) } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::mutable_name() { @@ -17011,15 +17249,15 @@ inline const std::string& FigureDescriptor_BusinessCalendarDescriptor::_internal } inline void FigureDescriptor_BusinessCalendarDescriptor::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + name_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return name_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::release_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return name_.Release(); } inline void FigureDescriptor_BusinessCalendarDescriptor::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -17027,8 +17265,12 @@ inline void FigureDescriptor_BusinessCalendarDescriptor::set_allocated_name(std: } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (name_.IsDefault()) { + name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.name) } @@ -17044,7 +17286,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_BusinessCalendarDescriptor::set_time_zone(ArgT0&& arg0, ArgT... args) { - time_zone_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + time_zone_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone) } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::mutable_time_zone() { @@ -17057,15 +17299,15 @@ inline const std::string& FigureDescriptor_BusinessCalendarDescriptor::_internal } inline void FigureDescriptor_BusinessCalendarDescriptor::_internal_set_time_zone(const std::string& value) { - time_zone_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + time_zone_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::_internal_mutable_time_zone() { - return time_zone_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return time_zone_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_BusinessCalendarDescriptor::release_time_zone() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone) - return time_zone_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return time_zone_.Release(); } inline void FigureDescriptor_BusinessCalendarDescriptor::set_allocated_time_zone(std::string* time_zone) { if (time_zone != nullptr) { @@ -17073,8 +17315,12 @@ inline void FigureDescriptor_BusinessCalendarDescriptor::set_allocated_time_zone } else { } - time_zone_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), time_zone, - GetArenaForAllocation()); + time_zone_.SetAllocated(time_zone, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (time_zone_.IsDefault()) { + time_zone_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.time_zone) } @@ -17217,7 +17463,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_MultiSeriesSourceDescriptor::set_axis_id(ArgT0&& arg0, ArgT... args) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + axis_id_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id) } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::mutable_axis_id() { @@ -17230,15 +17476,15 @@ inline const std::string& FigureDescriptor_MultiSeriesSourceDescriptor::_interna } inline void FigureDescriptor_MultiSeriesSourceDescriptor::_internal_set_axis_id(const std::string& value) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + axis_id_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::_internal_mutable_axis_id() { - return axis_id_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return axis_id_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::release_axis_id() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id) - return axis_id_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return axis_id_.Release(); } inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_allocated_axis_id(std::string* axis_id) { if (axis_id != nullptr) { @@ -17246,8 +17492,12 @@ inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_allocated_axis_id( } else { } - axis_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), axis_id, - GetArenaForAllocation()); + axis_id_.SetAllocated(axis_id, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (axis_id_.IsDefault()) { + axis_id_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.axis_id) } @@ -17271,24 +17521,24 @@ inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_type(::io::deephav // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.type) } -// int32 table_map_id = 3; -inline void FigureDescriptor_MultiSeriesSourceDescriptor::clear_table_map_id() { - table_map_id_ = 0; +// int32 partitioned_table_id = 3; +inline void FigureDescriptor_MultiSeriesSourceDescriptor::clear_partitioned_table_id() { + partitioned_table_id_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_MultiSeriesSourceDescriptor::_internal_table_map_id() const { - return table_map_id_; +inline int32_t FigureDescriptor_MultiSeriesSourceDescriptor::_internal_partitioned_table_id() const { + return partitioned_table_id_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_MultiSeriesSourceDescriptor::table_map_id() const { - // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.table_map_id) - return _internal_table_map_id(); +inline int32_t FigureDescriptor_MultiSeriesSourceDescriptor::partitioned_table_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.partitioned_table_id) + return _internal_partitioned_table_id(); } -inline void FigureDescriptor_MultiSeriesSourceDescriptor::_internal_set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_MultiSeriesSourceDescriptor::_internal_set_partitioned_table_id(int32_t value) { - table_map_id_ = value; + partitioned_table_id_ = value; } -inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_table_map_id(value); - // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.table_map_id) +inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_partitioned_table_id(int32_t value) { + _internal_set_partitioned_table_id(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.partitioned_table_id) } // string column_name = 4; @@ -17303,7 +17553,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_MultiSeriesSourceDescriptor::set_column_name(ArgT0&& arg0, ArgT... args) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name) } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::mutable_column_name() { @@ -17316,15 +17566,15 @@ inline const std::string& FigureDescriptor_MultiSeriesSourceDescriptor::_interna } inline void FigureDescriptor_MultiSeriesSourceDescriptor::_internal_set_column_name(const std::string& value) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_name_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::_internal_mutable_column_name() { - return column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_name_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_MultiSeriesSourceDescriptor::release_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name) - return column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_name_.Release(); } inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_allocated_column_name(std::string* column_name) { if (column_name != nullptr) { @@ -17332,8 +17582,12 @@ inline void FigureDescriptor_MultiSeriesSourceDescriptor::set_allocated_column_n } else { } - column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_name, - GetArenaForAllocation()); + column_name_.SetAllocated(column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_name_.IsDefault()) { + column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.column_name) } @@ -17353,7 +17607,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SourceDescriptor::set_axis_id(ArgT0&& arg0, ArgT... args) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + axis_id_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id) } inline std::string* FigureDescriptor_SourceDescriptor::mutable_axis_id() { @@ -17366,15 +17620,15 @@ inline const std::string& FigureDescriptor_SourceDescriptor::_internal_axis_id() } inline void FigureDescriptor_SourceDescriptor::_internal_set_axis_id(const std::string& value) { - axis_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + axis_id_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::_internal_mutable_axis_id() { - return axis_id_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return axis_id_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::release_axis_id() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id) - return axis_id_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return axis_id_.Release(); } inline void FigureDescriptor_SourceDescriptor::set_allocated_axis_id(std::string* axis_id) { if (axis_id != nullptr) { @@ -17382,8 +17636,12 @@ inline void FigureDescriptor_SourceDescriptor::set_allocated_axis_id(std::string } else { } - axis_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), axis_id, - GetArenaForAllocation()); + axis_id_.SetAllocated(axis_id, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (axis_id_.IsDefault()) { + axis_id_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.axis_id) } @@ -17411,40 +17669,40 @@ inline void FigureDescriptor_SourceDescriptor::set_type(::io::deephaven::proto:: inline void FigureDescriptor_SourceDescriptor::clear_table_id() { table_id_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_SourceDescriptor::_internal_table_id() const { +inline int32_t FigureDescriptor_SourceDescriptor::_internal_table_id() const { return table_id_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_SourceDescriptor::table_id() const { +inline int32_t FigureDescriptor_SourceDescriptor::table_id() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_id) return _internal_table_id(); } -inline void FigureDescriptor_SourceDescriptor::_internal_set_table_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_SourceDescriptor::_internal_set_table_id(int32_t value) { table_id_ = value; } -inline void FigureDescriptor_SourceDescriptor::set_table_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_SourceDescriptor::set_table_id(int32_t value) { _internal_set_table_id(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_id) } -// int32 table_map_id = 4; -inline void FigureDescriptor_SourceDescriptor::clear_table_map_id() { - table_map_id_ = 0; +// int32 partitioned_table_id = 4; +inline void FigureDescriptor_SourceDescriptor::clear_partitioned_table_id() { + partitioned_table_id_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_SourceDescriptor::_internal_table_map_id() const { - return table_map_id_; +inline int32_t FigureDescriptor_SourceDescriptor::_internal_partitioned_table_id() const { + return partitioned_table_id_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor_SourceDescriptor::table_map_id() const { - // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_map_id) - return _internal_table_map_id(); +inline int32_t FigureDescriptor_SourceDescriptor::partitioned_table_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.partitioned_table_id) + return _internal_partitioned_table_id(); } -inline void FigureDescriptor_SourceDescriptor::_internal_set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor_SourceDescriptor::_internal_set_partitioned_table_id(int32_t value) { - table_map_id_ = value; + partitioned_table_id_ = value; } -inline void FigureDescriptor_SourceDescriptor::set_table_map_id(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_table_map_id(value); - // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.table_map_id) +inline void FigureDescriptor_SourceDescriptor::set_partitioned_table_id(int32_t value) { + _internal_set_partitioned_table_id(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.partitioned_table_id) } // string column_name = 5; @@ -17459,7 +17717,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SourceDescriptor::set_column_name(ArgT0&& arg0, ArgT... args) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name) } inline std::string* FigureDescriptor_SourceDescriptor::mutable_column_name() { @@ -17472,15 +17730,15 @@ inline const std::string& FigureDescriptor_SourceDescriptor::_internal_column_na } inline void FigureDescriptor_SourceDescriptor::_internal_set_column_name(const std::string& value) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_name_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::_internal_mutable_column_name() { - return column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_name_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::release_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name) - return column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_name_.Release(); } inline void FigureDescriptor_SourceDescriptor::set_allocated_column_name(std::string* column_name) { if (column_name != nullptr) { @@ -17488,8 +17746,12 @@ inline void FigureDescriptor_SourceDescriptor::set_allocated_column_name(std::st } else { } - column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_name, - GetArenaForAllocation()); + column_name_.SetAllocated(column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_name_.IsDefault()) { + column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_name) } @@ -17505,7 +17767,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor_SourceDescriptor::set_column_type(ArgT0&& arg0, ArgT... args) { - column_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type) } inline std::string* FigureDescriptor_SourceDescriptor::mutable_column_type() { @@ -17518,15 +17780,15 @@ inline const std::string& FigureDescriptor_SourceDescriptor::_internal_column_ty } inline void FigureDescriptor_SourceDescriptor::_internal_set_column_type(const std::string& value) { - column_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_type_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::_internal_mutable_column_type() { - return column_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_type_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor_SourceDescriptor::release_column_type() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type) - return column_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_type_.Release(); } inline void FigureDescriptor_SourceDescriptor::set_allocated_column_type(std::string* column_type) { if (column_type != nullptr) { @@ -17534,8 +17796,12 @@ inline void FigureDescriptor_SourceDescriptor::set_allocated_column_type(std::st } else { } - column_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_type, - GetArenaForAllocation()); + column_type_.SetAllocated(column_type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_type_.IsDefault()) { + column_type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.column_type) } @@ -17616,7 +17882,7 @@ inline void FigureDescriptor_SourceDescriptor::set_allocated_one_click(::io::dee } if (one_click) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::script::grpc::FigureDescriptor_OneClickDescriptor>::GetOwningArena(one_click); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(one_click); if (message_arena != submessage_arena) { one_click = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, one_click, submessage_arena); @@ -17827,7 +18093,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor::set_title(ArgT0&& arg0, ArgT... args) { _has_bits_[0] |= 0x00000001u; - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title) } inline std::string* FigureDescriptor::mutable_title() { @@ -17840,11 +18106,11 @@ inline const std::string& FigureDescriptor::_internal_title() const { } inline void FigureDescriptor::_internal_set_title(const std::string& value) { _has_bits_[0] |= 0x00000001u; - title_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor::_internal_mutable_title() { _has_bits_[0] |= 0x00000001u; - return title_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor::release_title() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title) @@ -17852,7 +18118,13 @@ inline std::string* FigureDescriptor::release_title() { return nullptr; } _has_bits_[0] &= ~0x00000001u; - return title_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + auto* p = title_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_.IsDefault()) { + title_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } inline void FigureDescriptor::set_allocated_title(std::string* title) { if (title != nullptr) { @@ -17860,8 +18132,12 @@ inline void FigureDescriptor::set_allocated_title(std::string* title) { } else { _has_bits_[0] &= ~0x00000001u; } - title_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title, - GetArenaForAllocation()); + title_.SetAllocated(title, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_.IsDefault()) { + title_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title) } @@ -17877,7 +18153,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor::set_title_font(ArgT0&& arg0, ArgT... args) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_font_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font) } inline std::string* FigureDescriptor::mutable_title_font() { @@ -17890,15 +18166,15 @@ inline const std::string& FigureDescriptor::_internal_title_font() const { } inline void FigureDescriptor::_internal_set_title_font(const std::string& value) { - title_font_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_font_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor::_internal_mutable_title_font() { - return title_font_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_font_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor::release_title_font() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font) - return title_font_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return title_font_.Release(); } inline void FigureDescriptor::set_allocated_title_font(std::string* title_font) { if (title_font != nullptr) { @@ -17906,8 +18182,12 @@ inline void FigureDescriptor::set_allocated_title_font(std::string* title_font) } else { } - title_font_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title_font, - GetArenaForAllocation()); + title_font_.SetAllocated(title_font, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_font_.IsDefault()) { + title_font_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_font) } @@ -17923,7 +18203,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FigureDescriptor::set_title_color(ArgT0&& arg0, ArgT... args) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + title_color_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color) } inline std::string* FigureDescriptor::mutable_title_color() { @@ -17936,15 +18216,15 @@ inline const std::string& FigureDescriptor::_internal_title_color() const { } inline void FigureDescriptor::_internal_set_title_color(const std::string& value) { - title_color_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + title_color_.Set(value, GetArenaForAllocation()); } inline std::string* FigureDescriptor::_internal_mutable_title_color() { - return title_color_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return title_color_.Mutable(GetArenaForAllocation()); } inline std::string* FigureDescriptor::release_title_color() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color) - return title_color_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return title_color_.Release(); } inline void FigureDescriptor::set_allocated_title_color(std::string* title_color) { if (title_color != nullptr) { @@ -17952,27 +18232,31 @@ inline void FigureDescriptor::set_allocated_title_color(std::string* title_color } else { } - title_color_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), title_color, - GetArenaForAllocation()); + title_color_.SetAllocated(title_color, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (title_color_.IsDefault()) { + title_color_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.title_color) } -// int64 update_interval = 7; +// int64 update_interval = 7 [jstype = JS_STRING]; inline void FigureDescriptor::clear_update_interval() { update_interval_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 FigureDescriptor::_internal_update_interval() const { +inline int64_t FigureDescriptor::_internal_update_interval() const { return update_interval_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 FigureDescriptor::update_interval() const { +inline int64_t FigureDescriptor::update_interval() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.update_interval) return _internal_update_interval(); } -inline void FigureDescriptor::_internal_set_update_interval(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void FigureDescriptor::_internal_set_update_interval(int64_t value) { update_interval_ = value; } -inline void FigureDescriptor::set_update_interval(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void FigureDescriptor::set_update_interval(int64_t value) { _internal_set_update_interval(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.update_interval) } @@ -17981,18 +18265,18 @@ inline void FigureDescriptor::set_update_interval(::PROTOBUF_NAMESPACE_ID::int64 inline void FigureDescriptor::clear_cols() { cols_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor::_internal_cols() const { +inline int32_t FigureDescriptor::_internal_cols() const { return cols_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor::cols() const { +inline int32_t FigureDescriptor::cols() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.cols) return _internal_cols(); } -inline void FigureDescriptor::_internal_set_cols(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor::_internal_set_cols(int32_t value) { cols_ = value; } -inline void FigureDescriptor::set_cols(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor::set_cols(int32_t value) { _internal_set_cols(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.cols) } @@ -18001,18 +18285,18 @@ inline void FigureDescriptor::set_cols(::PROTOBUF_NAMESPACE_ID::int32 value) { inline void FigureDescriptor::clear_rows() { rows_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor::_internal_rows() const { +inline int32_t FigureDescriptor::_internal_rows() const { return rows_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 FigureDescriptor::rows() const { +inline int32_t FigureDescriptor::rows() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.rows) return _internal_rows(); } -inline void FigureDescriptor::_internal_set_rows(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor::_internal_set_rows(int32_t value) { rows_ = value; } -inline void FigureDescriptor::set_rows(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void FigureDescriptor::set_rows(int32_t value) { _internal_set_rows(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.rows) } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.cc index 898ce7bd552..f80bfc5039f 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/inputtable.proto @@ -48,11 +45,11 @@ ::grpc::Status InputTableService::Stub::AddTableToInputTable(::grpc::ClientConte return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_AddTableToInputTable_, context, request, response); } -void InputTableService::Stub::experimental_async::AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, std::function f) { +void InputTableService::Stub::async::AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AddTableToInputTable_, context, request, response, std::move(f)); } -void InputTableService::Stub::experimental_async::AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void InputTableService::Stub::async::AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AddTableToInputTable_, context, request, response, reactor); } @@ -71,11 +68,11 @@ ::grpc::Status InputTableService::Stub::DeleteTableFromInputTable(::grpc::Client return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_DeleteTableFromInputTable_, context, request, response); } -void InputTableService::Stub::experimental_async::DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, std::function f) { +void InputTableService::Stub::async::DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DeleteTableFromInputTable_, context, request, response, std::move(f)); } -void InputTableService::Stub::experimental_async::DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void InputTableService::Stub::async::DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DeleteTableFromInputTable_, context, request, response, reactor); } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.h index 05817f682e6..5e63968635c 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/inputtable.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2finputtable_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2finputtable_2eproto__INCLUDED #include "deephaven/proto/inputtable.pb.h" #include -#include #include #include #include @@ -69,36 +64,24 @@ class InputTableService final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>> PrepareAsyncDeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>>(PrepareAsyncDeleteTableFromInputTableRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} // // Adds the provided table to the specified input table. The new data to add must only have // columns (name, types, and order) which match the given input table's columns. virtual void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Removes the provided table from the specified input tables. The tables indicating which rows // to remove are expected to only have columns that match the key columns of the input table. virtual void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::AddTableResponse>* AsyncAddTableToInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::AddTableResponse>* PrepareAsyncAddTableToInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>* AsyncDeleteTableFromInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -121,32 +104,24 @@ class InputTableService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>> PrepareAsyncDeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>>(PrepareAsyncDeleteTableFromInputTableRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void AddTableToInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void DeleteTableFromInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::AddTableResponse>* AsyncAddTableToInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::AddTableResponse>* PrepareAsyncAddTableToInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>* AsyncDeleteTableFromInputTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest& request, ::grpc::CompletionQueue* cq) override; @@ -211,36 +186,22 @@ class InputTableService final { }; typedef WithAsyncMethod_AddTableToInputTable > AsyncService; template - class ExperimentalWithCallbackMethod_AddTableToInputTable : public BaseClass { + class WithCallbackMethod_AddTableToInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_AddTableToInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_AddTableToInputTable() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response) { return this->AddTableToInputTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* request, ::io::deephaven::proto::backplane::grpc::AddTableResponse* response) { return this->AddTableToInputTable(context, request, response); }));} void SetMessageAllocatorFor_AddTableToInputTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::AddTableRequest, ::io::deephaven::proto::backplane::grpc::AddTableResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_AddTableToInputTable() override { + ~WithCallbackMethod_AddTableToInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -248,46 +209,26 @@ class InputTableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* AddTableToInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::AddTableResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* AddTableToInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::AddTableResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AddTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::AddTableResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_DeleteTableFromInputTable : public BaseClass { + class WithCallbackMethod_DeleteTableFromInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_DeleteTableFromInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(1, + WithCallbackMethod_DeleteTableFromInputTable() { + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response) { return this->DeleteTableFromInputTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* request, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* response) { return this->DeleteTableFromInputTable(context, request, response); }));} void SetMessageAllocatorFor_DeleteTableFromInputTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(1); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_DeleteTableFromInputTable() override { + ~WithCallbackMethod_DeleteTableFromInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -295,20 +236,11 @@ class InputTableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* DeleteTableFromInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* DeleteTableFromInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* /*response*/) { return nullptr; } }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_AddTableToInputTable > CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_AddTableToInputTable > ExperimentalCallbackService; + typedef WithCallbackMethod_AddTableToInputTable > CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_AddTableToInputTable : public BaseClass { private: @@ -384,27 +316,17 @@ class InputTableService final { } }; template - class ExperimentalWithRawCallbackMethod_AddTableToInputTable : public BaseClass { + class WithRawCallbackMethod_AddTableToInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_AddTableToInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_AddTableToInputTable() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->AddTableToInputTable(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_AddTableToInputTable() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->AddTableToInputTable(context, request, response); })); + } + ~WithRawCallbackMethod_AddTableToInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -412,37 +334,21 @@ class InputTableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* AddTableToInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* AddTableToInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_DeleteTableFromInputTable : public BaseClass { + class WithRawCallbackMethod_DeleteTableFromInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_DeleteTableFromInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(1, + WithRawCallbackMethod_DeleteTableFromInputTable() { + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->DeleteTableFromInputTable(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_DeleteTableFromInputTable() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->DeleteTableFromInputTable(context, request, response); })); + } + ~WithRawCallbackMethod_DeleteTableFromInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -450,14 +356,8 @@ class InputTableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* DeleteTableFromInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* DeleteTableFromInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithStreamedUnaryMethod_AddTableToInputTable : public BaseClass { diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.cc index 03c7e2c6c83..b527d1a9ed5 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/inputtable.proto @@ -19,69 +16,73 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr AddTableRequest::AddTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_CONSTEXPR AddTableRequest::AddTableRequest( + ::_pbi::ConstantInitialized) : input_table_(nullptr) , table_to_add_(nullptr){} struct AddTableRequestDefaultTypeInternal { - constexpr AddTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AddTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AddTableRequestDefaultTypeInternal() {} union { AddTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AddTableRequestDefaultTypeInternal _AddTableRequest_default_instance_; -constexpr AddTableResponse::AddTableResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AddTableRequestDefaultTypeInternal _AddTableRequest_default_instance_; +PROTOBUF_CONSTEXPR AddTableResponse::AddTableResponse( + ::_pbi::ConstantInitialized){} struct AddTableResponseDefaultTypeInternal { - constexpr AddTableResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AddTableResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AddTableResponseDefaultTypeInternal() {} union { AddTableResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AddTableResponseDefaultTypeInternal _AddTableResponse_default_instance_; -constexpr DeleteTableRequest::DeleteTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AddTableResponseDefaultTypeInternal _AddTableResponse_default_instance_; +PROTOBUF_CONSTEXPR DeleteTableRequest::DeleteTableRequest( + ::_pbi::ConstantInitialized) : input_table_(nullptr) , table_to_remove_(nullptr){} struct DeleteTableRequestDefaultTypeInternal { - constexpr DeleteTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR DeleteTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~DeleteTableRequestDefaultTypeInternal() {} union { DeleteTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DeleteTableRequestDefaultTypeInternal _DeleteTableRequest_default_instance_; -constexpr DeleteTableResponse::DeleteTableResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeleteTableRequestDefaultTypeInternal _DeleteTableRequest_default_instance_; +PROTOBUF_CONSTEXPR DeleteTableResponse::DeleteTableResponse( + ::_pbi::ConstantInitialized){} struct DeleteTableResponseDefaultTypeInternal { - constexpr DeleteTableResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR DeleteTableResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~DeleteTableResponseDefaultTypeInternal() {} union { DeleteTableResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DeleteTableResponseDefaultTypeInternal _DeleteTableResponse_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeleteTableResponseDefaultTypeInternal _DeleteTableResponse_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2finputtable_2eproto[4]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2finputtable_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2finputtable_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2finputtable_2eproto[4]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2finputtable_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2finputtable_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2finputtable_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2finputtable_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::AddTableRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -111,18 +112,18 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2finputtable ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AddTableRequest)}, { 8, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AddTableResponse)}, { 14, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::DeleteTableRequest)}, { 22, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::DeleteTableResponse)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_AddTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_AddTableResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_DeleteTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_DeleteTableResponse_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_AddTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_AddTableResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_DeleteTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_DeleteTableResponse_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2finputtable_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -146,22 +147,24 @@ const char descriptor_table_protodef_deephaven_2fproto_2finputtable_2eproto[] PR "quest\0326.io.deephaven.proto.backplane.grp" "c.DeleteTableResponse\"\000B\004H\001P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2finputtable_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2finputtable_2eproto_deps[1] = { &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2finputtable_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2finputtable_2eproto = { - false, false, 757, descriptor_table_protodef_deephaven_2fproto_2finputtable_2eproto, "deephaven/proto/inputtable.proto", - &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, descriptor_table_deephaven_2fproto_2finputtable_2eproto_deps, 1, 4, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2finputtable_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2finputtable_2eproto, file_level_enum_descriptors_deephaven_2fproto_2finputtable_2eproto, file_level_service_descriptors_deephaven_2fproto_2finputtable_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2finputtable_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2finputtable_2eproto = { + false, false, 757, descriptor_table_protodef_deephaven_2fproto_2finputtable_2eproto, + "deephaven/proto/inputtable.proto", + &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, descriptor_table_deephaven_2fproto_2finputtable_2eproto_deps, 1, 4, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2finputtable_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2finputtable_2eproto, file_level_enum_descriptors_deephaven_2fproto_2finputtable_2eproto, + file_level_service_descriptors_deephaven_2fproto_2finputtable_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2finputtable_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2finputtable_2eproto(&descriptor_table_deephaven_2fproto_2finputtable_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2finputtable_2eproto(&descriptor_table_deephaven_2fproto_2finputtable_2eproto); namespace io { namespace deephaven { namespace proto { @@ -200,9 +203,6 @@ AddTableRequest::AddTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.AddTableRequest) } AddTableRequest::AddTableRequest(const AddTableRequest& from) @@ -221,7 +221,7 @@ AddTableRequest::AddTableRequest(const AddTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.AddTableRequest) } -void AddTableRequest::SharedCtor() { +inline void AddTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&input_table_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&table_to_add_) - @@ -230,9 +230,11 @@ ::memset(reinterpret_cast(this) + static_cast( AddTableRequest::~AddTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.AddTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void AddTableRequest::SharedDtor() { @@ -241,19 +243,13 @@ inline void AddTableRequest::SharedDtor() { if (this != internal_default_instance()) delete table_to_add_; } -void AddTableRequest::ArenaDtor(void* object) { - AddTableRequest* _this = reinterpret_cast< AddTableRequest* >(object); - (void)_this; -} -void AddTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void AddTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void AddTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.AddTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -268,15 +264,15 @@ void AddTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* AddTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* AddTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket input_table = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_input_table(), ptr); CHK_(ptr); } else @@ -284,7 +280,7 @@ const char* AddTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC continue; // .io.deephaven.proto.backplane.grpc.Ticket table_to_add = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_table_to_add(), ptr); CHK_(ptr); } else @@ -313,30 +309,28 @@ const char* AddTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* AddTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* AddTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.AddTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket input_table = 1; if (this->_internal_has_input_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::input_table(this), target, stream); + InternalWriteMessage(1, _Internal::input_table(this), + _Internal::input_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket table_to_add = 2; if (this->_internal_has_table_to_add()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::table_to_add(this), target, stream); + InternalWriteMessage(2, _Internal::table_to_add(this), + _Internal::table_to_add(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.AddTableRequest) @@ -347,7 +341,7 @@ size_t AddTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.AddTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -384,7 +378,7 @@ void AddTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void AddTableRequest::MergeFrom(const AddTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.AddTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_input_table()) { @@ -419,7 +413,7 @@ void AddTableRequest::InternalSwap(AddTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata AddTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, file_level_metadata_deephaven_2fproto_2finputtable_2eproto[0]); } @@ -458,7 +452,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AddTableResponse::GetClassData ::PROTOBUF_NAMESPACE_ID::Metadata AddTableResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, file_level_metadata_deephaven_2fproto_2finputtable_2eproto[1]); } @@ -495,9 +489,6 @@ DeleteTableRequest::DeleteTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.DeleteTableRequest) } DeleteTableRequest::DeleteTableRequest(const DeleteTableRequest& from) @@ -516,7 +507,7 @@ DeleteTableRequest::DeleteTableRequest(const DeleteTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.DeleteTableRequest) } -void DeleteTableRequest::SharedCtor() { +inline void DeleteTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&input_table_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&table_to_remove_) - @@ -525,9 +516,11 @@ ::memset(reinterpret_cast(this) + static_cast( DeleteTableRequest::~DeleteTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.DeleteTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void DeleteTableRequest::SharedDtor() { @@ -536,19 +529,13 @@ inline void DeleteTableRequest::SharedDtor() { if (this != internal_default_instance()) delete table_to_remove_; } -void DeleteTableRequest::ArenaDtor(void* object) { - DeleteTableRequest* _this = reinterpret_cast< DeleteTableRequest* >(object); - (void)_this; -} -void DeleteTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void DeleteTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void DeleteTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.DeleteTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -563,15 +550,15 @@ void DeleteTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DeleteTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* DeleteTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket input_table = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_input_table(), ptr); CHK_(ptr); } else @@ -579,7 +566,7 @@ const char* DeleteTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // .io.deephaven.proto.backplane.grpc.Ticket table_to_remove = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_table_to_remove(), ptr); CHK_(ptr); } else @@ -608,30 +595,28 @@ const char* DeleteTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* DeleteTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* DeleteTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.DeleteTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket input_table = 1; if (this->_internal_has_input_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::input_table(this), target, stream); + InternalWriteMessage(1, _Internal::input_table(this), + _Internal::input_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket table_to_remove = 2; if (this->_internal_has_table_to_remove()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::table_to_remove(this), target, stream); + InternalWriteMessage(2, _Internal::table_to_remove(this), + _Internal::table_to_remove(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.DeleteTableRequest) @@ -642,7 +627,7 @@ size_t DeleteTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.DeleteTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -679,7 +664,7 @@ void DeleteTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void DeleteTableRequest::MergeFrom(const DeleteTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.DeleteTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_input_table()) { @@ -714,7 +699,7 @@ void DeleteTableRequest::InternalSwap(DeleteTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata DeleteTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, file_level_metadata_deephaven_2fproto_2finputtable_2eproto[2]); } @@ -753,7 +738,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DeleteTableResponse::GetClassD ::PROTOBUF_NAMESPACE_ID::Metadata DeleteTableResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2finputtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2finputtable_2eproto_once, file_level_metadata_deephaven_2fproto_2finputtable_2eproto[3]); } @@ -765,16 +750,20 @@ ::PROTOBUF_NAMESPACE_ID::Metadata DeleteTableResponse::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AddTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AddTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AddTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AddTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::AddTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AddTableResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AddTableResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AddTableResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AddTableResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::AddTableResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DeleteTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::DeleteTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DeleteTableResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::DeleteTableResponse >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.h index 4bb89060e37..daf61a2d244 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/inputtable.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/inputtable.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -27,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -47,15 +43,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2finputtable_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2finputtable_2eproto; namespace io { @@ -99,7 +87,7 @@ class AddTableRequest final : public: inline AddTableRequest() : AddTableRequest(nullptr) {} ~AddTableRequest() override; - explicit constexpr AddTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AddTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AddTableRequest(const AddTableRequest& from); AddTableRequest(AddTableRequest&& from) noexcept @@ -149,7 +137,12 @@ class AddTableRequest final : } inline void Swap(AddTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -163,11 +156,7 @@ class AddTableRequest final : // implements Message ---------------------------------------------- - inline AddTableRequest* New() const final { - return new AddTableRequest(); - } - - AddTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AddTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -182,8 +171,8 @@ class AddTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -191,6 +180,8 @@ class AddTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(AddTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.AddTableRequest"; @@ -198,9 +189,6 @@ class AddTableRequest final : protected: explicit AddTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -223,7 +211,7 @@ class AddTableRequest final : public: void clear_input_table(); const ::io::deephaven::proto::backplane::grpc::Ticket& input_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_input_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_input_table(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_input_table(); void set_allocated_input_table(::io::deephaven::proto::backplane::grpc::Ticket* input_table); private: @@ -241,7 +229,7 @@ class AddTableRequest final : public: void clear_table_to_add(); const ::io::deephaven::proto::backplane::grpc::Ticket& table_to_add() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_table_to_add(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_table_to_add(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_table_to_add(); void set_allocated_table_to_add(::io::deephaven::proto::backplane::grpc::Ticket* table_to_add); private: @@ -270,7 +258,7 @@ class AddTableResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.AddTableResponse) */ { public: inline AddTableResponse() : AddTableResponse(nullptr) {} - explicit constexpr AddTableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AddTableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AddTableResponse(const AddTableResponse& from); AddTableResponse(AddTableResponse&& from) noexcept @@ -320,7 +308,12 @@ class AddTableResponse final : } inline void Swap(AddTableResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -334,11 +327,7 @@ class AddTableResponse final : // implements Message ---------------------------------------------- - inline AddTableResponse* New() const final { - return new AddTableResponse(); - } - - AddTableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AddTableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -350,6 +339,8 @@ class AddTableResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.AddTableResponse"; @@ -357,7 +348,6 @@ class AddTableResponse final : protected: explicit AddTableResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -376,7 +366,6 @@ class AddTableResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2finputtable_2eproto; }; // ------------------------------------------------------------------- @@ -386,7 +375,7 @@ class DeleteTableRequest final : public: inline DeleteTableRequest() : DeleteTableRequest(nullptr) {} ~DeleteTableRequest() override; - explicit constexpr DeleteTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DeleteTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DeleteTableRequest(const DeleteTableRequest& from); DeleteTableRequest(DeleteTableRequest&& from) noexcept @@ -436,7 +425,12 @@ class DeleteTableRequest final : } inline void Swap(DeleteTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -450,11 +444,7 @@ class DeleteTableRequest final : // implements Message ---------------------------------------------- - inline DeleteTableRequest* New() const final { - return new DeleteTableRequest(); - } - - DeleteTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + DeleteTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -469,8 +459,8 @@ class DeleteTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -478,6 +468,8 @@ class DeleteTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DeleteTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.DeleteTableRequest"; @@ -485,9 +477,6 @@ class DeleteTableRequest final : protected: explicit DeleteTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -510,7 +499,7 @@ class DeleteTableRequest final : public: void clear_input_table(); const ::io::deephaven::proto::backplane::grpc::Ticket& input_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_input_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_input_table(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_input_table(); void set_allocated_input_table(::io::deephaven::proto::backplane::grpc::Ticket* input_table); private: @@ -528,7 +517,7 @@ class DeleteTableRequest final : public: void clear_table_to_remove(); const ::io::deephaven::proto::backplane::grpc::Ticket& table_to_remove() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_table_to_remove(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_table_to_remove(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_table_to_remove(); void set_allocated_table_to_remove(::io::deephaven::proto::backplane::grpc::Ticket* table_to_remove); private: @@ -557,7 +546,7 @@ class DeleteTableResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.DeleteTableResponse) */ { public: inline DeleteTableResponse() : DeleteTableResponse(nullptr) {} - explicit constexpr DeleteTableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DeleteTableResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DeleteTableResponse(const DeleteTableResponse& from); DeleteTableResponse(DeleteTableResponse&& from) noexcept @@ -607,7 +596,12 @@ class DeleteTableResponse final : } inline void Swap(DeleteTableResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -621,11 +615,7 @@ class DeleteTableResponse final : // implements Message ---------------------------------------------- - inline DeleteTableResponse* New() const final { - return new DeleteTableResponse(); - } - - DeleteTableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + DeleteTableResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -637,6 +627,8 @@ class DeleteTableResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.DeleteTableResponse"; @@ -644,7 +636,6 @@ class DeleteTableResponse final : protected: explicit DeleteTableResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -663,7 +654,6 @@ class DeleteTableResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2finputtable_2eproto; }; // =================================================================== @@ -748,8 +738,7 @@ inline void AddTableRequest::set_allocated_input_table(::io::deephaven::proto::b } if (input_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(input_table)); if (message_arena != submessage_arena) { input_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -834,8 +823,7 @@ inline void AddTableRequest::set_allocated_table_to_add(::io::deephaven::proto:: } if (table_to_add) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_to_add)); if (message_arena != submessage_arena) { table_to_add = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -928,8 +916,7 @@ inline void DeleteTableRequest::set_allocated_input_table(::io::deephaven::proto } if (input_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(input_table)); if (message_arena != submessage_arena) { input_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -1014,8 +1001,7 @@ inline void DeleteTableRequest::set_allocated_table_to_remove(::io::deephaven::p } if (table_to_remove) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_to_remove)); if (message_arena != submessage_arena) { table_to_remove = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.cc index eef22a4414c..a639e4dd108 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/object.proto @@ -46,11 +43,11 @@ ::grpc::Status ObjectService::Stub::FetchObject(::grpc::ClientContext* context, return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_FetchObject_, context, request, response); } -void ObjectService::Stub::experimental_async::FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, std::function f) { +void ObjectService::Stub::async::FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchObject_, context, request, response, std::move(f)); } -void ObjectService::Stub::experimental_async::FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void ObjectService::Stub::async::FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchObject_, context, request, response, reactor); } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.h index 3e85a362aad..817132f2ffb 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/object.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/object.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2fobject_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2fobject_2eproto__INCLUDED #include "deephaven/proto/object.pb.h" #include -#include #include #include #include @@ -54,24 +49,16 @@ class ObjectService final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>> PrepareAsyncFetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>>(PrepareAsyncFetchObjectRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} virtual void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* AsyncFetchObjectRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* PrepareAsyncFetchObjectRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) = 0; }; @@ -85,26 +72,22 @@ class ObjectService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>> PrepareAsyncFetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>>(PrepareAsyncFetchObjectRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void FetchObject(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* AsyncFetchObjectRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* PrepareAsyncFetchObjectRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_FetchObject_; @@ -139,36 +122,22 @@ class ObjectService final { }; typedef WithAsyncMethod_FetchObject AsyncService; template - class ExperimentalWithCallbackMethod_FetchObject : public BaseClass { + class WithCallbackMethod_FetchObject : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_FetchObject() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_FetchObject() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response) { return this->FetchObject(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* request, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* response) { return this->FetchObject(context, request, response); }));} void SetMessageAllocatorFor_FetchObject( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_FetchObject() override { + ~WithCallbackMethod_FetchObject() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -176,20 +145,11 @@ class ObjectService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchObject( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchObject( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* /*response*/) { return nullptr; } }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_FetchObject CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_FetchObject ExperimentalCallbackService; + typedef WithCallbackMethod_FetchObject CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_FetchObject : public BaseClass { private: @@ -228,27 +188,17 @@ class ObjectService final { } }; template - class ExperimentalWithRawCallbackMethod_FetchObject : public BaseClass { + class WithRawCallbackMethod_FetchObject : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_FetchObject() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_FetchObject() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchObject(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchObject(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_FetchObject() override { + ~WithRawCallbackMethod_FetchObject() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -256,14 +206,8 @@ class ObjectService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchObject( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchObject( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithStreamedUnaryMethod_FetchObject : public BaseClass { diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.cc index 096483a6a9c..30a36bd21ab 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/object.proto @@ -19,47 +16,51 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr FetchObjectRequest::FetchObjectRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_CONSTEXPR FetchObjectRequest::FetchObjectRequest( + ::_pbi::ConstantInitialized) : source_id_(nullptr){} struct FetchObjectRequestDefaultTypeInternal { - constexpr FetchObjectRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FetchObjectRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FetchObjectRequestDefaultTypeInternal() {} union { FetchObjectRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchObjectRequestDefaultTypeInternal _FetchObjectRequest_default_instance_; -constexpr FetchObjectResponse::FetchObjectResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FetchObjectRequestDefaultTypeInternal _FetchObjectRequest_default_instance_; +PROTOBUF_CONSTEXPR FetchObjectResponse::FetchObjectResponse( + ::_pbi::ConstantInitialized) : typed_export_id_() - , type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , data_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} + , type_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , data_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct FetchObjectResponseDefaultTypeInternal { - constexpr FetchObjectResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FetchObjectResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FetchObjectResponseDefaultTypeInternal() {} union { FetchObjectResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchObjectResponseDefaultTypeInternal _FetchObjectResponse_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FetchObjectResponseDefaultTypeInternal _FetchObjectResponse_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2fobject_2eproto[2]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fobject_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fobject_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fobject_2eproto[2]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fobject_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fobject_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fobject_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2fobject_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchObjectRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -77,14 +78,14 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fobject_2ep PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchObjectResponse, data_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchObjectResponse, typed_export_id_), }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchObjectRequest)}, { 7, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchObjectResponse)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchObjectRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchObjectResponse_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_FetchObjectRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FetchObjectResponse_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2fobject_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -101,22 +102,24 @@ const char descriptor_table_protodef_deephaven_2fproto_2fobject_2eproto[] PROTOB "o.deephaven.proto.backplane.grpc.FetchOb" "jectResponse\"\000B\004H\001P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2fobject_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2fobject_2eproto_deps[1] = { &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2fobject_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fobject_2eproto = { - false, false, 468, descriptor_table_protodef_deephaven_2fproto_2fobject_2eproto, "deephaven/proto/object.proto", - &descriptor_table_deephaven_2fproto_2fobject_2eproto_once, descriptor_table_deephaven_2fproto_2fobject_2eproto_deps, 1, 2, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2fobject_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2fobject_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fobject_2eproto, file_level_service_descriptors_deephaven_2fproto_2fobject_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fobject_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fobject_2eproto = { + false, false, 468, descriptor_table_protodef_deephaven_2fproto_2fobject_2eproto, + "deephaven/proto/object.proto", + &descriptor_table_deephaven_2fproto_2fobject_2eproto_once, descriptor_table_deephaven_2fproto_2fobject_2eproto_deps, 1, 2, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fobject_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fobject_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fobject_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fobject_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2fobject_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fobject_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2fobject_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fobject_2eproto(&descriptor_table_deephaven_2fproto_2fobject_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fobject_2eproto(&descriptor_table_deephaven_2fproto_2fobject_2eproto); namespace io { namespace deephaven { namespace proto { @@ -144,9 +147,6 @@ FetchObjectRequest::FetchObjectRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchObjectRequest) } FetchObjectRequest::FetchObjectRequest(const FetchObjectRequest& from) @@ -160,15 +160,17 @@ FetchObjectRequest::FetchObjectRequest(const FetchObjectRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchObjectRequest) } -void FetchObjectRequest::SharedCtor() { +inline void FetchObjectRequest::SharedCtor() { source_id_ = nullptr; } FetchObjectRequest::~FetchObjectRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FetchObjectRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FetchObjectRequest::SharedDtor() { @@ -176,19 +178,13 @@ inline void FetchObjectRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void FetchObjectRequest::ArenaDtor(void* object) { - FetchObjectRequest* _this = reinterpret_cast< FetchObjectRequest* >(object); - (void)_this; -} -void FetchObjectRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FetchObjectRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void FetchObjectRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FetchObjectRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -199,15 +195,15 @@ void FetchObjectRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FetchObjectRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FetchObjectRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TypedTicket source_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -236,22 +232,21 @@ const char* FetchObjectRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FetchObjectRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FetchObjectRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FetchObjectRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TypedTicket source_id = 1; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); + InternalWriteMessage(1, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FetchObjectRequest) @@ -262,7 +257,7 @@ size_t FetchObjectRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FetchObjectRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -292,7 +287,7 @@ void FetchObjectRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FetchObjectRequest::MergeFrom(const FetchObjectRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FetchObjectRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_source_id()) { @@ -319,7 +314,7 @@ void FetchObjectRequest::InternalSwap(FetchObjectRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FetchObjectRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fobject_2eproto_getter, &descriptor_table_deephaven_2fproto_2fobject_2eproto_once, file_level_metadata_deephaven_2fproto_2fobject_2eproto[0]); } @@ -338,59 +333,64 @@ FetchObjectResponse::FetchObjectResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), typed_export_id_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchObjectResponse) } FetchObjectResponse::FetchObjectResponse(const FetchObjectResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message(), typed_export_id_(from.typed_export_id_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_type().empty()) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(), + type_.Set(from._internal_type(), GetArenaForAllocation()); } - data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + data_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + data_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_data().empty()) { - data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_data(), + data_.Set(from._internal_data(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchObjectResponse) } -void FetchObjectResponse::SharedCtor() { -type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void FetchObjectResponse::SharedCtor() { +type_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +data_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + data_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } FetchObjectResponse::~FetchObjectResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FetchObjectResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FetchObjectResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.Destroy(); + data_.Destroy(); } -void FetchObjectResponse::ArenaDtor(void* object) { - FetchObjectResponse* _this = reinterpret_cast< FetchObjectResponse* >(object); - (void)_this; -} -void FetchObjectResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FetchObjectResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void FetchObjectResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FetchObjectResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -400,34 +400,34 @@ void FetchObjectResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FetchObjectResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FetchObjectResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FetchObjectResponse.type")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.FetchObjectResponse.type")); } else goto handle_unusual; continue; // bytes data = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_data(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.grpc.TypedTicket typed_export_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -461,10 +461,10 @@ const char* FetchObjectResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FetchObjectResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FetchObjectResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FetchObjectResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string type = 1; @@ -484,15 +484,15 @@ ::PROTOBUF_NAMESPACE_ID::uint8* FetchObjectResponse::_InternalSerialize( } // repeated .io.deephaven.proto.backplane.grpc.TypedTicket typed_export_id = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_typed_export_id_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_typed_export_id_size()); i < n; i++) { + const auto& repfield = this->_internal_typed_export_id(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_typed_export_id(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FetchObjectResponse) @@ -503,7 +503,7 @@ size_t FetchObjectResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FetchObjectResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -547,7 +547,7 @@ void FetchObjectResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FetchObjectResponse::MergeFrom(const FetchObjectResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FetchObjectResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; typed_export_id_.MergeFrom(from.typed_export_id_); @@ -578,19 +578,17 @@ void FetchObjectResponse::InternalSwap(FetchObjectResponse* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); typed_export_id_.InternalSwap(&other->typed_export_id_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &type_, lhs_arena, &other->type_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &data_, lhs_arena, &other->data_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata FetchObjectResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fobject_2eproto_getter, &descriptor_table_deephaven_2fproto_2fobject_2eproto_once, file_level_metadata_deephaven_2fproto_2fobject_2eproto[1]); } @@ -602,10 +600,12 @@ ::PROTOBUF_NAMESPACE_ID::Metadata FetchObjectResponse::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchObjectRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchObjectRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchObjectResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchObjectResponse >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.h index 8d560f875a5..98feeec4c3c 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/object.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/object.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -26,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -46,15 +42,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2fobject_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fobject_2eproto; namespace io { @@ -90,7 +78,7 @@ class FetchObjectRequest final : public: inline FetchObjectRequest() : FetchObjectRequest(nullptr) {} ~FetchObjectRequest() override; - explicit constexpr FetchObjectRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FetchObjectRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FetchObjectRequest(const FetchObjectRequest& from); FetchObjectRequest(FetchObjectRequest&& from) noexcept @@ -140,7 +128,12 @@ class FetchObjectRequest final : } inline void Swap(FetchObjectRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -154,11 +147,7 @@ class FetchObjectRequest final : // implements Message ---------------------------------------------- - inline FetchObjectRequest* New() const final { - return new FetchObjectRequest(); - } - - FetchObjectRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FetchObjectRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -173,8 +162,8 @@ class FetchObjectRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -182,6 +171,8 @@ class FetchObjectRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FetchObjectRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FetchObjectRequest"; @@ -189,9 +180,6 @@ class FetchObjectRequest final : protected: explicit FetchObjectRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -213,7 +201,7 @@ class FetchObjectRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TypedTicket& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TypedTicket* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TypedTicket* release_source_id(); ::io::deephaven::proto::backplane::grpc::TypedTicket* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TypedTicket* source_id); private: @@ -242,7 +230,7 @@ class FetchObjectResponse final : public: inline FetchObjectResponse() : FetchObjectResponse(nullptr) {} ~FetchObjectResponse() override; - explicit constexpr FetchObjectResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FetchObjectResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FetchObjectResponse(const FetchObjectResponse& from); FetchObjectResponse(FetchObjectResponse&& from) noexcept @@ -292,7 +280,12 @@ class FetchObjectResponse final : } inline void Swap(FetchObjectResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -306,11 +299,7 @@ class FetchObjectResponse final : // implements Message ---------------------------------------------- - inline FetchObjectResponse* New() const final { - return new FetchObjectResponse(); - } - - FetchObjectResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FetchObjectResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -325,8 +314,8 @@ class FetchObjectResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -334,6 +323,8 @@ class FetchObjectResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FetchObjectResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FetchObjectResponse"; @@ -341,9 +332,6 @@ class FetchObjectResponse final : protected: explicit FetchObjectResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -384,7 +372,7 @@ class FetchObjectResponse final : template void set_type(ArgT0&& arg0, ArgT... args); std::string* mutable_type(); - PROTOBUF_MUST_USE_RESULT std::string* release_type(); + PROTOBUF_NODISCARD std::string* release_type(); void set_allocated_type(std::string* type); private: const std::string& _internal_type() const; @@ -398,7 +386,7 @@ class FetchObjectResponse final : template void set_data(ArgT0&& arg0, ArgT... args); std::string* mutable_data(); - PROTOBUF_MUST_USE_RESULT std::string* release_data(); + PROTOBUF_NODISCARD std::string* release_data(); void set_allocated_data(std::string* data); private: const std::string& _internal_data() const; @@ -501,8 +489,7 @@ inline void FetchObjectRequest::set_allocated_source_id(::io::deephaven::proto:: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_id)); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -532,7 +519,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FetchObjectResponse::set_type(ArgT0&& arg0, ArgT... args) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FetchObjectResponse.type) } inline std::string* FetchObjectResponse::mutable_type() { @@ -545,15 +532,15 @@ inline const std::string& FetchObjectResponse::_internal_type() const { } inline void FetchObjectResponse::_internal_set_type(const std::string& value) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + type_.Set(value, GetArenaForAllocation()); } inline std::string* FetchObjectResponse::_internal_mutable_type() { - return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return type_.Mutable(GetArenaForAllocation()); } inline std::string* FetchObjectResponse::release_type() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FetchObjectResponse.type) - return type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return type_.Release(); } inline void FetchObjectResponse::set_allocated_type(std::string* type) { if (type != nullptr) { @@ -561,8 +548,12 @@ inline void FetchObjectResponse::set_allocated_type(std::string* type) { } else { } - type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type, - GetArenaForAllocation()); + type_.SetAllocated(type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (type_.IsDefault()) { + type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FetchObjectResponse.type) } @@ -578,7 +569,7 @@ template inline PROTOBUF_ALWAYS_INLINE void FetchObjectResponse::set_data(ArgT0&& arg0, ArgT... args) { - data_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + data_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.FetchObjectResponse.data) } inline std::string* FetchObjectResponse::mutable_data() { @@ -591,15 +582,15 @@ inline const std::string& FetchObjectResponse::_internal_data() const { } inline void FetchObjectResponse::_internal_set_data(const std::string& value) { - data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + data_.Set(value, GetArenaForAllocation()); } inline std::string* FetchObjectResponse::_internal_mutable_data() { - return data_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return data_.Mutable(GetArenaForAllocation()); } inline std::string* FetchObjectResponse::release_data() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FetchObjectResponse.data) - return data_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return data_.Release(); } inline void FetchObjectResponse::set_allocated_data(std::string* data) { if (data != nullptr) { @@ -607,8 +598,12 @@ inline void FetchObjectResponse::set_allocated_data(std::string* data) { } else { } - data_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), data, - GetArenaForAllocation()); + data_.SetAllocated(data, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (data_.IsDefault()) { + data_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FetchObjectResponse.data) } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.cc new file mode 100644 index 00000000000..69681914b00 --- /dev/null +++ b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.cc @@ -0,0 +1,178 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: deephaven/proto/partitionedtable.proto + +#include "deephaven/proto/partitionedtable.pb.h" +#include "deephaven/proto/partitionedtable.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { + +static const char* PartitionedTableService_method_names[] = { + "/io.deephaven.proto.backplane.grpc.PartitionedTableService/PartitionBy", + "/io.deephaven.proto.backplane.grpc.PartitionedTableService/Merge", + "/io.deephaven.proto.backplane.grpc.PartitionedTableService/GetTable", +}; + +std::unique_ptr< PartitionedTableService::Stub> PartitionedTableService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< PartitionedTableService::Stub> stub(new PartitionedTableService::Stub(channel, options)); + return stub; +} + +PartitionedTableService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) + : channel_(channel), rpcmethod_PartitionBy_(PartitionedTableService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Merge_(PartitionedTableService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetTable_(PartitionedTableService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status PartitionedTableService::Stub::PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_PartitionBy_, context, request, response); +} + +void PartitionedTableService::Stub::async::PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_PartitionBy_, context, request, response, std::move(f)); +} + +void PartitionedTableService::Stub::async::PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_PartitionBy_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* PartitionedTableService::Stub::PrepareAsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::io::deephaven::proto::backplane::grpc::PartitionByResponse, ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_PartitionBy_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* PartitionedTableService::Stub::AsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncPartitionByRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status PartitionedTableService::Stub::Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Merge_, context, request, response); +} + +void PartitionedTableService::Stub::async::Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Merge_, context, request, response, std::move(f)); +} + +void PartitionedTableService::Stub::async::Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Merge_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PartitionedTableService::Stub::PrepareAsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::io::deephaven::proto::backplane::grpc::MergeRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Merge_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PartitionedTableService::Stub::AsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncMergeRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status PartitionedTableService::Stub::GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetTable_, context, request, response); +} + +void PartitionedTableService::Stub::async::GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetTable_, context, request, response, std::move(f)); +} + +void PartitionedTableService::Stub::async::GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetTable_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PartitionedTableService::Stub::PrepareAsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetTable_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PartitionedTableService::Stub::AsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetTableRaw(context, request, cq); + result->StartCall(); + return result; +} + +PartitionedTableService::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + PartitionedTableService_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< PartitionedTableService::Service, ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](PartitionedTableService::Service* service, + ::grpc::ServerContext* ctx, + const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* req, + ::io::deephaven::proto::backplane::grpc::PartitionByResponse* resp) { + return service->PartitionBy(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + PartitionedTableService_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< PartitionedTableService::Service, ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](PartitionedTableService::Service* service, + ::grpc::ServerContext* ctx, + const ::io::deephaven::proto::backplane::grpc::MergeRequest* req, + ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* resp) { + return service->Merge(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + PartitionedTableService_method_names[2], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< PartitionedTableService::Service, ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](PartitionedTableService::Service* service, + ::grpc::ServerContext* ctx, + const ::io::deephaven::proto::backplane::grpc::GetTableRequest* req, + ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* resp) { + return service->GetTable(ctx, req, resp); + }, this))); +} + +PartitionedTableService::Service::~Service() { +} + +::grpc::Status PartitionedTableService::Service::PartitionBy(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status PartitionedTableService::Service::Merge(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status PartitionedTableService::Service::GetTable(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace io +} // namespace deephaven +} // namespace proto +} // namespace backplane +} // namespace grpc + diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.h new file mode 100644 index 00000000000..52eb80fc1b1 --- /dev/null +++ b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.grpc.pb.h @@ -0,0 +1,622 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: deephaven/proto/partitionedtable.proto +// Original file comments: +// +// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending +// +#ifndef GRPC_deephaven_2fproto_2fpartitionedtable_2eproto__INCLUDED +#define GRPC_deephaven_2fproto_2fpartitionedtable_2eproto__INCLUDED + +#include "deephaven/proto/partitionedtable.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { + +// +// This service provides tools to create and query partitioned tables. +class PartitionedTableService final { + public: + static constexpr char const* service_full_name() { + return "io.deephaven.proto.backplane.grpc.PartitionedTableService"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + // + // Transforms a table into a partitioned table, consisting of many separate table, each individually + // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + virtual ::grpc::Status PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>> AsyncPartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>>(AsyncPartitionByRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>> PrepareAsyncPartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>>(PrepareAsyncPartitionByRaw(context, request, cq)); + } + // + // Given a partitioned table, returns a table with the contents of all of the constituent tables. + virtual ::grpc::Status Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncMerge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(AsyncMergeRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> PrepareAsyncMerge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncMergeRaw(context, request, cq)); + } + // + // Given a partitioned table and a row described by another table's contents, returns a table + // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + // more than one is present, FAILED_PRECONDITION will be sent in response. + // + // If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + // sent in response. + // + // The simplest way to generally use this is to subscribe to the key columns of the underlying + // table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + // desired keys, and pass that ticket to this service. After that request is sent (note that it + // is not required to wait for it to complete), that new table ticket can be used to make this + // GetTable request. + virtual ::grpc::Status GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncGetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(AsyncGetTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> PrepareAsyncGetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncGetTableRaw(context, request, cq)); + } + class async_interface { + public: + virtual ~async_interface() {} + // + // Transforms a table into a partitioned table, consisting of many separate table, each individually + // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + virtual void PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, std::function) = 0; + virtual void PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + // + // Given a partitioned table, returns a table with the contents of all of the constituent tables. + virtual void Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; + virtual void Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + // + // Given a partitioned table and a row described by another table's contents, returns a table + // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + // more than one is present, FAILED_PRECONDITION will be sent in response. + // + // If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + // sent in response. + // + // The simplest way to generally use this is to subscribe to the key columns of the underlying + // table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + // desired keys, and pass that ticket to this service. After that request is sent (note that it + // is not required to wait for it to complete), that new table ticket can be used to make this + // GetTable request. + virtual void GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; + virtual void GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + }; + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* AsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* PrepareAsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + ::grpc::Status PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>> AsyncPartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>>(AsyncPartitionByRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>> PrepareAsyncPartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>>(PrepareAsyncPartitionByRaw(context, request, cq)); + } + ::grpc::Status Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncMerge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(AsyncMergeRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> PrepareAsyncMerge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncMergeRaw(context, request, cq)); + } + ::grpc::Status GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncGetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(AsyncGetTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> PrepareAsyncGetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncGetTableRaw(context, request, cq)); + } + class async final : + public StubInterface::async_interface { + public: + void PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, std::function) override; + void PartitionBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + void Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; + void Merge(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + void GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; + void GetTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + private: + friend class Stub; + explicit async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class async* async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* AsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* PrepareAsyncPartitionByRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncMergeRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncGetTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_PartitionBy_; + const ::grpc::internal::RpcMethod rpcmethod_Merge_; + const ::grpc::internal::RpcMethod rpcmethod_GetTable_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + // + // Transforms a table into a partitioned table, consisting of many separate table, each individually + // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + virtual ::grpc::Status PartitionBy(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response); + // + // Given a partitioned table, returns a table with the contents of all of the constituent tables. + virtual ::grpc::Status Merge(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response); + // + // Given a partitioned table and a row described by another table's contents, returns a table + // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + // more than one is present, FAILED_PRECONDITION will be sent in response. + // + // If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + // sent in response. + // + // The simplest way to generally use this is to subscribe to the key columns of the underlying + // table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + // desired keys, and pass that ticket to this service. After that request is sent (note that it + // is not required to wait for it to complete), that new table ticket can be used to make this + // GetTable request. + virtual ::grpc::Status GetTable(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response); + }; + template + class WithAsyncMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_PartitionBy() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPartitionBy(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_Merge() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestMerge(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetTable() { + ::grpc::Service::MarkMethodAsync(2); + } + ~WithAsyncMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTable(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_PartitionBy > > AsyncService; + template + class WithCallbackMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_PartitionBy() { + ::grpc::Service::MarkMethodCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* request, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* response) { return this->PartitionBy(context, request, response); }));} + void SetMessageAllocatorFor_PartitionBy( + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); + static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* PartitionBy( + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_Merge() { + ::grpc::Service::MarkMethodCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::MergeRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Merge(context, request, response); }));} + void SetMessageAllocatorFor_Merge( + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); + static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Merge( + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetTable() { + ::grpc::Service::MarkMethodCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->GetTable(context, request, response); }));} + void SetMessageAllocatorFor_GetTable( + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); + static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetTable( + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } + }; + typedef WithCallbackMethod_PartitionBy > > CallbackService; + typedef CallbackService ExperimentalCallbackService; + template + class WithGenericMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_PartitionBy() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_Merge() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetTable() { + ::grpc::Service::MarkMethodGeneric(2); + } + ~WithGenericMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_PartitionBy() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPartitionBy(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_Merge() { + ::grpc::Service::MarkMethodRaw(1); + } + ~WithRawMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestMerge(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetTable() { + ::grpc::Service::MarkMethodRaw(2); + } + ~WithRawMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawCallbackMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_PartitionBy() { + ::grpc::Service::MarkMethodRawCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->PartitionBy(context, request, response); })); + } + ~WithRawCallbackMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* PartitionBy( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_Merge() { + ::grpc::Service::MarkMethodRawCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Merge(context, request, response); })); + } + ~WithRawCallbackMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Merge( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetTable() { + ::grpc::Service::MarkMethodRawCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetTable(context, request, response); })); + } + ~WithRawCallbackMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetTable( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithStreamedUnaryMethod_PartitionBy : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_PartitionBy() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< + ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::io::deephaven::proto::backplane::grpc::PartitionByRequest, ::io::deephaven::proto::backplane::grpc::PartitionByResponse>* streamer) { + return this->StreamedPartitionBy(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_PartitionBy() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status PartitionBy(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::PartitionByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::PartitionByResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedPartitionBy(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::PartitionByRequest,::io::deephaven::proto::backplane::grpc::PartitionByResponse>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_Merge : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_Merge() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::StreamedUnaryHandler< + ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::io::deephaven::proto::backplane::grpc::MergeRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* streamer) { + return this->StreamedMerge(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_Merge() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status Merge(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedMerge(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::MergeRequest,::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetTable() { + ::grpc::Service::MarkMethodStreamed(2, + new ::grpc::internal::StreamedUnaryHandler< + ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::io::deephaven::proto::backplane::grpc::GetTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* streamer) { + return this->StreamedGetTable(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetTable(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::GetTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::GetTableRequest,::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_PartitionBy > > StreamedUnaryService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_PartitionBy > > StreamedService; +}; + +} // namespace grpc +} // namespace backplane +} // namespace proto +} // namespace deephaven +} // namespace io + + +#endif // GRPC_deephaven_2fproto_2fpartitionedtable_2eproto__INCLUDED diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.cc new file mode 100644 index 00000000000..2c70be02812 --- /dev/null +++ b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.cc @@ -0,0 +1,1483 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: deephaven/proto/partitionedtable.proto + +#include "deephaven/proto/partitionedtable.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { +PROTOBUF_CONSTEXPR PartitionByRequest::PartitionByRequest( + ::_pbi::ConstantInitialized) + : key_column_names_() + , table_id_(nullptr) + , result_id_(nullptr) + , drop_keys_(false){} +struct PartitionByRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartitionByRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PartitionByRequestDefaultTypeInternal() {} + union { + PartitionByRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionByRequestDefaultTypeInternal _PartitionByRequest_default_instance_; +PROTOBUF_CONSTEXPR PartitionByResponse::PartitionByResponse( + ::_pbi::ConstantInitialized){} +struct PartitionByResponseDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartitionByResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PartitionByResponseDefaultTypeInternal() {} + union { + PartitionByResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionByResponseDefaultTypeInternal _PartitionByResponse_default_instance_; +PROTOBUF_CONSTEXPR MergeRequest::MergeRequest( + ::_pbi::ConstantInitialized) + : partitioned_table_(nullptr) + , result_id_(nullptr){} +struct MergeRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR MergeRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~MergeRequestDefaultTypeInternal() {} + union { + MergeRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MergeRequestDefaultTypeInternal _MergeRequest_default_instance_; +PROTOBUF_CONSTEXPR GetTableRequest::GetTableRequest( + ::_pbi::ConstantInitialized) + : partitioned_table_(nullptr) + , key_table_ticket_(nullptr) + , result_id_(nullptr){} +struct GetTableRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR GetTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GetTableRequestDefaultTypeInternal() {} + union { + GetTableRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetTableRequestDefaultTypeInternal _GetTableRequest_default_instance_; +PROTOBUF_CONSTEXPR PartitionedTableDescriptor::PartitionedTableDescriptor( + ::_pbi::ConstantInitialized) + : key_column_names_() + , constituent_definition_schema_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , constituent_column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , unique_keys_(false) + , constituent_changes_permitted_(false){} +struct PartitionedTableDescriptorDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartitionedTableDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PartitionedTableDescriptorDefaultTypeInternal() {} + union { + PartitionedTableDescriptor _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionedTableDescriptorDefaultTypeInternal _PartitionedTableDescriptor_default_instance_; +} // namespace grpc +} // namespace backplane +} // namespace proto +} // namespace deephaven +} // namespace io +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[5]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fpartitionedtable_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fpartitionedtable_2eproto = nullptr; + +const uint32_t TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByRequest, table_id_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByRequest, result_id_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByRequest, key_column_names_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByRequest, drop_keys_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionByResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::MergeRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::MergeRequest, partitioned_table_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::MergeRequest, result_id_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::GetTableRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::GetTableRequest, partitioned_table_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::GetTableRequest, key_table_ticket_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::GetTableRequest, result_id_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, key_column_names_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, constituent_column_name_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, unique_keys_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, constituent_definition_schema_), + PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor, constituent_changes_permitted_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::PartitionByRequest)}, + { 10, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::PartitionByResponse)}, + { 16, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::MergeRequest)}, + { 24, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::GetTableRequest)}, + { 33, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_PartitionByRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_PartitionByResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_MergeRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_GetTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_PartitionedTableDescriptor_default_instance_._instance, +}; + +const char descriptor_table_protodef_deephaven_2fproto_2fpartitionedtable_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n&deephaven/proto/partitionedtable.proto" + "\022!io.deephaven.proto.backplane.grpc\032\033dee" + "phaven/proto/table.proto\032\034deephaven/prot" + "o/ticket.proto\"\274\001\n\022PartitionByRequest\022;\n" + "\010table_id\030\001 \001(\0132).io.deephaven.proto.bac" + "kplane.grpc.Ticket\022<\n\tresult_id\030\002 \001(\0132)." + "io.deephaven.proto.backplane.grpc.Ticket" + "\022\030\n\020key_column_names\030\003 \003(\t\022\021\n\tdrop_keys\030" + "\004 \001(\010\"\025\n\023PartitionByResponse\"\222\001\n\014MergeRe" + "quest\022D\n\021partitioned_table\030\001 \001(\0132).io.de" + "ephaven.proto.backplane.grpc.Ticket\022<\n\tr" + "esult_id\030\002 \001(\0132).io.deephaven.proto.back" + "plane.grpc.Ticket\"\332\001\n\017GetTableRequest\022D\n" + "\021partitioned_table\030\001 \001(\0132).io.deephaven." + "proto.backplane.grpc.Ticket\022C\n\020key_table" + "_ticket\030\002 \001(\0132).io.deephaven.proto.backp" + "lane.grpc.Ticket\022<\n\tresult_id\030\004 \001(\0132).io" + ".deephaven.proto.backplane.grpc.Ticket\"\272" + "\001\n\032PartitionedTableDescriptor\022\030\n\020key_col" + "umn_names\030\001 \003(\t\022\037\n\027constituent_column_na" + "me\030\004 \001(\t\022\023\n\013unique_keys\030\002 \001(\010\022%\n\035constit" + "uent_definition_schema\030\003 \001(\014\022%\n\035constitu" + "ent_changes_permitted\030\005 \001(\0102\226\003\n\027Partitio" + "nedTableService\022|\n\013PartitionBy\0225.io.deep" + "haven.proto.backplane.grpc.PartitionByRe" + "quest\0326.io.deephaven.proto.backplane.grp" + "c.PartitionByResponse\022z\n\005Merge\022/.io.deep" + "haven.proto.backplane.grpc.MergeRequest\032" + "@.io.deephaven.proto.backplane.grpc.Expo" + "rtedTableCreationResponse\022\200\001\n\010GetTable\0222" + ".io.deephaven.proto.backplane.grpc.GetTa" + "bleRequest\032@.io.deephaven.proto.backplan" + "e.grpc.ExportedTableCreationResponseB\004H\001" + "P\001b\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_deps[2] = { + &::descriptor_table_deephaven_2fproto_2ftable_2eproto, + &::descriptor_table_deephaven_2fproto_2fticket_2eproto, +}; +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto = { + false, false, 1330, descriptor_table_protodef_deephaven_2fproto_2fpartitionedtable_2eproto, + "deephaven/proto/partitionedtable.proto", + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_deps, 2, 5, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fpartitionedtable_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fpartitionedtable_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter() { + return &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fpartitionedtable_2eproto(&descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto); +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { + +// =================================================================== + +class PartitionByRequest::_Internal { + public: + static const ::io::deephaven::proto::backplane::grpc::Ticket& table_id(const PartitionByRequest* msg); + static const ::io::deephaven::proto::backplane::grpc::Ticket& result_id(const PartitionByRequest* msg); +}; + +const ::io::deephaven::proto::backplane::grpc::Ticket& +PartitionByRequest::_Internal::table_id(const PartitionByRequest* msg) { + return *msg->table_id_; +} +const ::io::deephaven::proto::backplane::grpc::Ticket& +PartitionByRequest::_Internal::result_id(const PartitionByRequest* msg) { + return *msg->result_id_; +} +void PartitionByRequest::clear_table_id() { + if (GetArenaForAllocation() == nullptr && table_id_ != nullptr) { + delete table_id_; + } + table_id_ = nullptr; +} +void PartitionByRequest::clear_result_id() { + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; +} +PartitionByRequest::PartitionByRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), + key_column_names_(arena) { + SharedCtor(); + // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.PartitionByRequest) +} +PartitionByRequest::PartitionByRequest(const PartitionByRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + key_column_names_(from.key_column_names_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_table_id()) { + table_id_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.table_id_); + } else { + table_id_ = nullptr; + } + if (from._internal_has_result_id()) { + result_id_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.result_id_); + } else { + result_id_ = nullptr; + } + drop_keys_ = from.drop_keys_; + // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.PartitionByRequest) +} + +inline void PartitionByRequest::SharedCtor() { +::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&table_id_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&drop_keys_) - + reinterpret_cast(&table_id_)) + sizeof(drop_keys_)); +} + +PartitionByRequest::~PartitionByRequest() { + // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.PartitionByRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PartitionByRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete table_id_; + if (this != internal_default_instance()) delete result_id_; +} + +void PartitionByRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void PartitionByRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.PartitionByRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_column_names_.Clear(); + if (GetArenaForAllocation() == nullptr && table_id_ != nullptr) { + delete table_id_; + } + table_id_ = nullptr; + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; + drop_keys_ = false; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PartitionByRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .io.deephaven.proto.backplane.grpc.Ticket table_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_table_id(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated string key_column_names = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_key_column_names(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names")); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // bool drop_keys = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + drop_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PartitionByRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.PartitionByRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .io.deephaven.proto.backplane.grpc.Ticket table_id = 1; + if (this->_internal_has_table_id()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::table_id(this), + _Internal::table_id(this).GetCachedSize(), target, stream); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + if (this->_internal_has_result_id()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); + } + + // repeated string key_column_names = 3; + for (int i = 0, n = this->_internal_key_column_names_size(); i < n; i++) { + const auto& s = this->_internal_key_column_names(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names"); + target = stream->WriteString(3, s, target); + } + + // bool drop_keys = 4; + if (this->_internal_drop_keys() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_drop_keys(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.PartitionByRequest) + return target; +} + +size_t PartitionByRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.PartitionByRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string key_column_names = 3; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(key_column_names_.size()); + for (int i = 0, n = key_column_names_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + key_column_names_.Get(i)); + } + + // .io.deephaven.proto.backplane.grpc.Ticket table_id = 1; + if (this->_internal_has_table_id()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *table_id_); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + if (this->_internal_has_result_id()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *result_id_); + } + + // bool drop_keys = 4; + if (this->_internal_drop_keys() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionByRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + PartitionByRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionByRequest::GetClassData() const { return &_class_data_; } + +void PartitionByRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void PartitionByRequest::MergeFrom(const PartitionByRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.PartitionByRequest) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + key_column_names_.MergeFrom(from.key_column_names_); + if (from._internal_has_table_id()) { + _internal_mutable_table_id()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_table_id()); + } + if (from._internal_has_result_id()) { + _internal_mutable_result_id()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_result_id()); + } + if (from._internal_drop_keys() != 0) { + _internal_set_drop_keys(from._internal_drop_keys()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PartitionByRequest::CopyFrom(const PartitionByRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:io.deephaven.proto.backplane.grpc.PartitionByRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PartitionByRequest::IsInitialized() const { + return true; +} + +void PartitionByRequest::InternalSwap(PartitionByRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + key_column_names_.InternalSwap(&other->key_column_names_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PartitionByRequest, drop_keys_) + + sizeof(PartitionByRequest::drop_keys_) + - PROTOBUF_FIELD_OFFSET(PartitionByRequest, table_id_)>( + reinterpret_cast(&table_id_), + reinterpret_cast(&other->table_id_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PartitionByRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[0]); +} + +// =================================================================== + +class PartitionByResponse::_Internal { + public: +}; + +PartitionByResponse::PartitionByResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.PartitionByResponse) +} +PartitionByResponse::PartitionByResponse(const PartitionByResponse& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.PartitionByResponse) +} + + + + + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionByResponse::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionByResponse::GetClassData() const { return &_class_data_; } + + + + + + + +::PROTOBUF_NAMESPACE_ID::Metadata PartitionByResponse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[1]); +} + +// =================================================================== + +class MergeRequest::_Internal { + public: + static const ::io::deephaven::proto::backplane::grpc::Ticket& partitioned_table(const MergeRequest* msg); + static const ::io::deephaven::proto::backplane::grpc::Ticket& result_id(const MergeRequest* msg); +}; + +const ::io::deephaven::proto::backplane::grpc::Ticket& +MergeRequest::_Internal::partitioned_table(const MergeRequest* msg) { + return *msg->partitioned_table_; +} +const ::io::deephaven::proto::backplane::grpc::Ticket& +MergeRequest::_Internal::result_id(const MergeRequest* msg) { + return *msg->result_id_; +} +void MergeRequest::clear_partitioned_table() { + if (GetArenaForAllocation() == nullptr && partitioned_table_ != nullptr) { + delete partitioned_table_; + } + partitioned_table_ = nullptr; +} +void MergeRequest::clear_result_id() { + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; +} +MergeRequest::MergeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(); + // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.MergeRequest) +} +MergeRequest::MergeRequest(const MergeRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_partitioned_table()) { + partitioned_table_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.partitioned_table_); + } else { + partitioned_table_ = nullptr; + } + if (from._internal_has_result_id()) { + result_id_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.result_id_); + } else { + result_id_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.MergeRequest) +} + +inline void MergeRequest::SharedCtor() { +::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&partitioned_table_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&result_id_) - + reinterpret_cast(&partitioned_table_)) + sizeof(result_id_)); +} + +MergeRequest::~MergeRequest() { + // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.MergeRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void MergeRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete partitioned_table_; + if (this != internal_default_instance()) delete result_id_; +} + +void MergeRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void MergeRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.MergeRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && partitioned_table_ != nullptr) { + delete partitioned_table_; + } + partitioned_table_ = nullptr; + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MergeRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_partitioned_table(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* MergeRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.MergeRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + if (this->_internal_has_partitioned_table()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::partitioned_table(this), + _Internal::partitioned_table(this).GetCachedSize(), target, stream); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + if (this->_internal_has_result_id()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.MergeRequest) + return target; +} + +size_t MergeRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.MergeRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + if (this->_internal_has_partitioned_table()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *partitioned_table_); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + if (this->_internal_has_result_id()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *result_id_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MergeRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + MergeRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MergeRequest::GetClassData() const { return &_class_data_; } + +void MergeRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void MergeRequest::MergeFrom(const MergeRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.MergeRequest) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_partitioned_table()) { + _internal_mutable_partitioned_table()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_partitioned_table()); + } + if (from._internal_has_result_id()) { + _internal_mutable_result_id()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_result_id()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void MergeRequest::CopyFrom(const MergeRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:io.deephaven.proto.backplane.grpc.MergeRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MergeRequest::IsInitialized() const { + return true; +} + +void MergeRequest::InternalSwap(MergeRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MergeRequest, result_id_) + + sizeof(MergeRequest::result_id_) + - PROTOBUF_FIELD_OFFSET(MergeRequest, partitioned_table_)>( + reinterpret_cast(&partitioned_table_), + reinterpret_cast(&other->partitioned_table_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MergeRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[2]); +} + +// =================================================================== + +class GetTableRequest::_Internal { + public: + static const ::io::deephaven::proto::backplane::grpc::Ticket& partitioned_table(const GetTableRequest* msg); + static const ::io::deephaven::proto::backplane::grpc::Ticket& key_table_ticket(const GetTableRequest* msg); + static const ::io::deephaven::proto::backplane::grpc::Ticket& result_id(const GetTableRequest* msg); +}; + +const ::io::deephaven::proto::backplane::grpc::Ticket& +GetTableRequest::_Internal::partitioned_table(const GetTableRequest* msg) { + return *msg->partitioned_table_; +} +const ::io::deephaven::proto::backplane::grpc::Ticket& +GetTableRequest::_Internal::key_table_ticket(const GetTableRequest* msg) { + return *msg->key_table_ticket_; +} +const ::io::deephaven::proto::backplane::grpc::Ticket& +GetTableRequest::_Internal::result_id(const GetTableRequest* msg) { + return *msg->result_id_; +} +void GetTableRequest::clear_partitioned_table() { + if (GetArenaForAllocation() == nullptr && partitioned_table_ != nullptr) { + delete partitioned_table_; + } + partitioned_table_ = nullptr; +} +void GetTableRequest::clear_key_table_ticket() { + if (GetArenaForAllocation() == nullptr && key_table_ticket_ != nullptr) { + delete key_table_ticket_; + } + key_table_ticket_ = nullptr; +} +void GetTableRequest::clear_result_id() { + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; +} +GetTableRequest::GetTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(); + // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.GetTableRequest) +} +GetTableRequest::GetTableRequest(const GetTableRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_partitioned_table()) { + partitioned_table_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.partitioned_table_); + } else { + partitioned_table_ = nullptr; + } + if (from._internal_has_key_table_ticket()) { + key_table_ticket_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.key_table_ticket_); + } else { + key_table_ticket_ = nullptr; + } + if (from._internal_has_result_id()) { + result_id_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.result_id_); + } else { + result_id_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.GetTableRequest) +} + +inline void GetTableRequest::SharedCtor() { +::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&partitioned_table_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&result_id_) - + reinterpret_cast(&partitioned_table_)) + sizeof(result_id_)); +} + +GetTableRequest::~GetTableRequest() { + // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.GetTableRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GetTableRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete partitioned_table_; + if (this != internal_default_instance()) delete key_table_ticket_; + if (this != internal_default_instance()) delete result_id_; +} + +void GetTableRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void GetTableRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.GetTableRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && partitioned_table_ != nullptr) { + delete partitioned_table_; + } + partitioned_table_ = nullptr; + if (GetArenaForAllocation() == nullptr && key_table_ticket_ != nullptr) { + delete key_table_ticket_; + } + key_table_ticket_ = nullptr; + if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { + delete result_id_; + } + result_id_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GetTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_partitioned_table(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .io.deephaven.proto.backplane.grpc.Ticket key_table_ticket = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_key_table_ticket(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* GetTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.GetTableRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + if (this->_internal_has_partitioned_table()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::partitioned_table(this), + _Internal::partitioned_table(this).GetCachedSize(), target, stream); + } + + // .io.deephaven.proto.backplane.grpc.Ticket key_table_ticket = 2; + if (this->_internal_has_key_table_ticket()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::key_table_ticket(this), + _Internal::key_table_ticket(this).GetCachedSize(), target, stream); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 4; + if (this->_internal_has_result_id()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.GetTableRequest) + return target; +} + +size_t GetTableRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.GetTableRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + if (this->_internal_has_partitioned_table()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *partitioned_table_); + } + + // .io.deephaven.proto.backplane.grpc.Ticket key_table_ticket = 2; + if (this->_internal_has_key_table_ticket()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *key_table_ticket_); + } + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 4; + if (this->_internal_has_result_id()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *result_id_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GetTableRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + GetTableRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetTableRequest::GetClassData() const { return &_class_data_; } + +void GetTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void GetTableRequest::MergeFrom(const GetTableRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.GetTableRequest) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_partitioned_table()) { + _internal_mutable_partitioned_table()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_partitioned_table()); + } + if (from._internal_has_key_table_ticket()) { + _internal_mutable_key_table_ticket()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_key_table_ticket()); + } + if (from._internal_has_result_id()) { + _internal_mutable_result_id()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_result_id()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GetTableRequest::CopyFrom(const GetTableRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:io.deephaven.proto.backplane.grpc.GetTableRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetTableRequest::IsInitialized() const { + return true; +} + +void GetTableRequest::InternalSwap(GetTableRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(GetTableRequest, result_id_) + + sizeof(GetTableRequest::result_id_) + - PROTOBUF_FIELD_OFFSET(GetTableRequest, partitioned_table_)>( + reinterpret_cast(&partitioned_table_), + reinterpret_cast(&other->partitioned_table_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GetTableRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[3]); +} + +// =================================================================== + +class PartitionedTableDescriptor::_Internal { + public: +}; + +PartitionedTableDescriptor::PartitionedTableDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), + key_column_names_(arena) { + SharedCtor(); + // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) +} +PartitionedTableDescriptor::PartitionedTableDescriptor(const PartitionedTableDescriptor& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + key_column_names_(from.key_column_names_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + constituent_definition_schema_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + constituent_definition_schema_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_constituent_definition_schema().empty()) { + constituent_definition_schema_.Set(from._internal_constituent_definition_schema(), + GetArenaForAllocation()); + } + constituent_column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + constituent_column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_constituent_column_name().empty()) { + constituent_column_name_.Set(from._internal_constituent_column_name(), + GetArenaForAllocation()); + } + ::memcpy(&unique_keys_, &from.unique_keys_, + static_cast(reinterpret_cast(&constituent_changes_permitted_) - + reinterpret_cast(&unique_keys_)) + sizeof(constituent_changes_permitted_)); + // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) +} + +inline void PartitionedTableDescriptor::SharedCtor() { +constituent_definition_schema_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + constituent_definition_schema_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +constituent_column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + constituent_column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&unique_keys_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&constituent_changes_permitted_) - + reinterpret_cast(&unique_keys_)) + sizeof(constituent_changes_permitted_)); +} + +PartitionedTableDescriptor::~PartitionedTableDescriptor() { + // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PartitionedTableDescriptor::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + constituent_definition_schema_.Destroy(); + constituent_column_name_.Destroy(); +} + +void PartitionedTableDescriptor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void PartitionedTableDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_column_names_.Clear(); + constituent_definition_schema_.ClearToEmpty(); + constituent_column_name_.ClearToEmpty(); + ::memset(&unique_keys_, 0, static_cast( + reinterpret_cast(&constituent_changes_permitted_) - + reinterpret_cast(&unique_keys_)) + sizeof(constituent_changes_permitted_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PartitionedTableDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // repeated string key_column_names = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_key_column_names(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names")); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else + goto handle_unusual; + continue; + // bool unique_keys = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + unique_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bytes constituent_definition_schema = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_constituent_definition_schema(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string constituent_column_name = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_constituent_column_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name")); + } else + goto handle_unusual; + continue; + // bool constituent_changes_permitted = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + constituent_changes_permitted_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PartitionedTableDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string key_column_names = 1; + for (int i = 0, n = this->_internal_key_column_names_size(); i < n; i++) { + const auto& s = this->_internal_key_column_names(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names"); + target = stream->WriteString(1, s, target); + } + + // bool unique_keys = 2; + if (this->_internal_unique_keys() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_unique_keys(), target); + } + + // bytes constituent_definition_schema = 3; + if (!this->_internal_constituent_definition_schema().empty()) { + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_constituent_definition_schema(), target); + } + + // string constituent_column_name = 4; + if (!this->_internal_constituent_column_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_constituent_column_name().data(), static_cast(this->_internal_constituent_column_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name"); + target = stream->WriteStringMaybeAliased( + 4, this->_internal_constituent_column_name(), target); + } + + // bool constituent_changes_permitted = 5; + if (this->_internal_constituent_changes_permitted() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_constituent_changes_permitted(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + return target; +} + +size_t PartitionedTableDescriptor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string key_column_names = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(key_column_names_.size()); + for (int i = 0, n = key_column_names_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + key_column_names_.Get(i)); + } + + // bytes constituent_definition_schema = 3; + if (!this->_internal_constituent_definition_schema().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_constituent_definition_schema()); + } + + // string constituent_column_name = 4; + if (!this->_internal_constituent_column_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_constituent_column_name()); + } + + // bool unique_keys = 2; + if (this->_internal_unique_keys() != 0) { + total_size += 1 + 1; + } + + // bool constituent_changes_permitted = 5; + if (this->_internal_constituent_changes_permitted() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionedTableDescriptor::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + PartitionedTableDescriptor::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionedTableDescriptor::GetClassData() const { return &_class_data_; } + +void PartitionedTableDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void PartitionedTableDescriptor::MergeFrom(const PartitionedTableDescriptor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + key_column_names_.MergeFrom(from.key_column_names_); + if (!from._internal_constituent_definition_schema().empty()) { + _internal_set_constituent_definition_schema(from._internal_constituent_definition_schema()); + } + if (!from._internal_constituent_column_name().empty()) { + _internal_set_constituent_column_name(from._internal_constituent_column_name()); + } + if (from._internal_unique_keys() != 0) { + _internal_set_unique_keys(from._internal_unique_keys()); + } + if (from._internal_constituent_changes_permitted() != 0) { + _internal_set_constituent_changes_permitted(from._internal_constituent_changes_permitted()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PartitionedTableDescriptor::CopyFrom(const PartitionedTableDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PartitionedTableDescriptor::IsInitialized() const { + return true; +} + +void PartitionedTableDescriptor::InternalSwap(PartitionedTableDescriptor* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + key_column_names_.InternalSwap(&other->key_column_names_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &constituent_definition_schema_, lhs_arena, + &other->constituent_definition_schema_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &constituent_column_name_, lhs_arena, + &other->constituent_column_name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PartitionedTableDescriptor, constituent_changes_permitted_) + + sizeof(PartitionedTableDescriptor::constituent_changes_permitted_) + - PROTOBUF_FIELD_OFFSET(PartitionedTableDescriptor, unique_keys_)>( + reinterpret_cast(&unique_keys_), + reinterpret_cast(&other->unique_keys_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PartitionedTableDescriptor::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_getter, &descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto_once, + file_level_metadata_deephaven_2fproto_2fpartitionedtable_2eproto[4]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace grpc +} // namespace backplane +} // namespace proto +} // namespace deephaven +} // namespace io +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::PartitionByRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::PartitionByRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::PartitionByRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::PartitionByResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::PartitionByResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::PartitionByResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::MergeRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::MergeRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::MergeRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::GetTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::GetTableRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::GetTableRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor >(Arena* arena) { + return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.h new file mode 100644 index 00000000000..947d3631b58 --- /dev/null +++ b/cpp-client/deephaven/client/proto/deephaven/proto/partitionedtable.pb.h @@ -0,0 +1,1944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: deephaven/proto/partitionedtable.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_deephaven_2fproto_2fpartitionedtable_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_deephaven_2fproto_2fpartitionedtable_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3020000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "deephaven/proto/table.pb.h" +#include "deephaven/proto/ticket.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_deephaven_2fproto_2fpartitionedtable_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fpartitionedtable_2eproto; +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { +class GetTableRequest; +struct GetTableRequestDefaultTypeInternal; +extern GetTableRequestDefaultTypeInternal _GetTableRequest_default_instance_; +class MergeRequest; +struct MergeRequestDefaultTypeInternal; +extern MergeRequestDefaultTypeInternal _MergeRequest_default_instance_; +class PartitionByRequest; +struct PartitionByRequestDefaultTypeInternal; +extern PartitionByRequestDefaultTypeInternal _PartitionByRequest_default_instance_; +class PartitionByResponse; +struct PartitionByResponseDefaultTypeInternal; +extern PartitionByResponseDefaultTypeInternal _PartitionByResponse_default_instance_; +class PartitionedTableDescriptor; +struct PartitionedTableDescriptorDefaultTypeInternal; +extern PartitionedTableDescriptorDefaultTypeInternal _PartitionedTableDescriptor_default_instance_; +} // namespace grpc +} // namespace backplane +} // namespace proto +} // namespace deephaven +} // namespace io +PROTOBUF_NAMESPACE_OPEN +template<> ::io::deephaven::proto::backplane::grpc::GetTableRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::GetTableRequest>(Arena*); +template<> ::io::deephaven::proto::backplane::grpc::MergeRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::MergeRequest>(Arena*); +template<> ::io::deephaven::proto::backplane::grpc::PartitionByRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::PartitionByRequest>(Arena*); +template<> ::io::deephaven::proto::backplane::grpc::PartitionByResponse* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::PartitionByResponse>(Arena*); +template<> ::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::PartitionedTableDescriptor>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace io { +namespace deephaven { +namespace proto { +namespace backplane { +namespace grpc { + +// =================================================================== + +class PartitionByRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.PartitionByRequest) */ { + public: + inline PartitionByRequest() : PartitionByRequest(nullptr) {} + ~PartitionByRequest() override; + explicit PROTOBUF_CONSTEXPR PartitionByRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PartitionByRequest(const PartitionByRequest& from); + PartitionByRequest(PartitionByRequest&& from) noexcept + : PartitionByRequest() { + *this = ::std::move(from); + } + + inline PartitionByRequest& operator=(const PartitionByRequest& from) { + CopyFrom(from); + return *this; + } + inline PartitionByRequest& operator=(PartitionByRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PartitionByRequest& default_instance() { + return *internal_default_instance(); + } + static inline const PartitionByRequest* internal_default_instance() { + return reinterpret_cast( + &_PartitionByRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(PartitionByRequest& a, PartitionByRequest& b) { + a.Swap(&b); + } + inline void Swap(PartitionByRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PartitionByRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PartitionByRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PartitionByRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const PartitionByRequest& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PartitionByRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "io.deephaven.proto.backplane.grpc.PartitionByRequest"; + } + protected: + explicit PartitionByRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kKeyColumnNamesFieldNumber = 3, + kTableIdFieldNumber = 1, + kResultIdFieldNumber = 2, + kDropKeysFieldNumber = 4, + }; + // repeated string key_column_names = 3; + int key_column_names_size() const; + private: + int _internal_key_column_names_size() const; + public: + void clear_key_column_names(); + const std::string& key_column_names(int index) const; + std::string* mutable_key_column_names(int index); + void set_key_column_names(int index, const std::string& value); + void set_key_column_names(int index, std::string&& value); + void set_key_column_names(int index, const char* value); + void set_key_column_names(int index, const char* value, size_t size); + std::string* add_key_column_names(); + void add_key_column_names(const std::string& value); + void add_key_column_names(std::string&& value); + void add_key_column_names(const char* value); + void add_key_column_names(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& key_column_names() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_key_column_names(); + private: + const std::string& _internal_key_column_names(int index) const; + std::string* _internal_add_key_column_names(); + public: + + // .io.deephaven.proto.backplane.grpc.Ticket table_id = 1; + bool has_table_id() const; + private: + bool _internal_has_table_id() const; + public: + void clear_table_id(); + const ::io::deephaven::proto::backplane::grpc::Ticket& table_id() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_table_id(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_table_id(); + void set_allocated_table_id(::io::deephaven::proto::backplane::grpc::Ticket* table_id); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_table_id() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_table_id(); + public: + void unsafe_arena_set_allocated_table_id( + ::io::deephaven::proto::backplane::grpc::Ticket* table_id); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_table_id(); + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + bool has_result_id() const; + private: + bool _internal_has_result_id() const; + public: + void clear_result_id(); + const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); + void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_result_id() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_result_id(); + public: + void unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_result_id(); + + // bool drop_keys = 4; + void clear_drop_keys(); + bool drop_keys() const; + void set_drop_keys(bool value); + private: + bool _internal_drop_keys() const; + void _internal_set_drop_keys(bool value); + public: + + // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionByRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField key_column_names_; + ::io::deephaven::proto::backplane::grpc::Ticket* table_id_; + ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; + bool drop_keys_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto; +}; +// ------------------------------------------------------------------- + +class PartitionByResponse final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.PartitionByResponse) */ { + public: + inline PartitionByResponse() : PartitionByResponse(nullptr) {} + explicit PROTOBUF_CONSTEXPR PartitionByResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PartitionByResponse(const PartitionByResponse& from); + PartitionByResponse(PartitionByResponse&& from) noexcept + : PartitionByResponse() { + *this = ::std::move(from); + } + + inline PartitionByResponse& operator=(const PartitionByResponse& from) { + CopyFrom(from); + return *this; + } + inline PartitionByResponse& operator=(PartitionByResponse&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PartitionByResponse& default_instance() { + return *internal_default_instance(); + } + static inline const PartitionByResponse* internal_default_instance() { + return reinterpret_cast( + &_PartitionByResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(PartitionByResponse& a, PartitionByResponse& b) { + a.Swap(&b); + } + inline void Swap(PartitionByResponse* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PartitionByResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PartitionByResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const PartitionByResponse& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const PartitionByResponse& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); + } + public: + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "io.deephaven.proto.backplane.grpc.PartitionByResponse"; + } + protected: + explicit PartitionByResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionByResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + friend struct ::TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto; +}; +// ------------------------------------------------------------------- + +class MergeRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.MergeRequest) */ { + public: + inline MergeRequest() : MergeRequest(nullptr) {} + ~MergeRequest() override; + explicit PROTOBUF_CONSTEXPR MergeRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + MergeRequest(const MergeRequest& from); + MergeRequest(MergeRequest&& from) noexcept + : MergeRequest() { + *this = ::std::move(from); + } + + inline MergeRequest& operator=(const MergeRequest& from) { + CopyFrom(from); + return *this; + } + inline MergeRequest& operator=(MergeRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const MergeRequest& default_instance() { + return *internal_default_instance(); + } + static inline const MergeRequest* internal_default_instance() { + return reinterpret_cast( + &_MergeRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(MergeRequest& a, MergeRequest& b) { + a.Swap(&b); + } + inline void Swap(MergeRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MergeRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MergeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const MergeRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const MergeRequest& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MergeRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "io.deephaven.proto.backplane.grpc.MergeRequest"; + } + protected: + explicit MergeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPartitionedTableFieldNumber = 1, + kResultIdFieldNumber = 2, + }; + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + bool has_partitioned_table() const; + private: + bool _internal_has_partitioned_table() const; + public: + void clear_partitioned_table(); + const ::io::deephaven::proto::backplane::grpc::Ticket& partitioned_table() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_partitioned_table(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_partitioned_table(); + void set_allocated_partitioned_table(::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_partitioned_table() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_partitioned_table(); + public: + void unsafe_arena_set_allocated_partitioned_table( + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_partitioned_table(); + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; + bool has_result_id() const; + private: + bool _internal_has_result_id() const; + public: + void clear_result_id(); + const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); + void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_result_id() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_result_id(); + public: + void unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_result_id(); + + // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MergeRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table_; + ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto; +}; +// ------------------------------------------------------------------- + +class GetTableRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.GetTableRequest) */ { + public: + inline GetTableRequest() : GetTableRequest(nullptr) {} + ~GetTableRequest() override; + explicit PROTOBUF_CONSTEXPR GetTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GetTableRequest(const GetTableRequest& from); + GetTableRequest(GetTableRequest&& from) noexcept + : GetTableRequest() { + *this = ::std::move(from); + } + + inline GetTableRequest& operator=(const GetTableRequest& from) { + CopyFrom(from); + return *this; + } + inline GetTableRequest& operator=(GetTableRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GetTableRequest& default_instance() { + return *internal_default_instance(); + } + static inline const GetTableRequest* internal_default_instance() { + return reinterpret_cast( + &_GetTableRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(GetTableRequest& a, GetTableRequest& b) { + a.Swap(&b); + } + inline void Swap(GetTableRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetTableRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GetTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GetTableRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const GetTableRequest& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetTableRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "io.deephaven.proto.backplane.grpc.GetTableRequest"; + } + protected: + explicit GetTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPartitionedTableFieldNumber = 1, + kKeyTableTicketFieldNumber = 2, + kResultIdFieldNumber = 4, + }; + // .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; + bool has_partitioned_table() const; + private: + bool _internal_has_partitioned_table() const; + public: + void clear_partitioned_table(); + const ::io::deephaven::proto::backplane::grpc::Ticket& partitioned_table() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_partitioned_table(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_partitioned_table(); + void set_allocated_partitioned_table(::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_partitioned_table() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_partitioned_table(); + public: + void unsafe_arena_set_allocated_partitioned_table( + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_partitioned_table(); + + // .io.deephaven.proto.backplane.grpc.Ticket key_table_ticket = 2; + bool has_key_table_ticket() const; + private: + bool _internal_has_key_table_ticket() const; + public: + void clear_key_table_ticket(); + const ::io::deephaven::proto::backplane::grpc::Ticket& key_table_ticket() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_key_table_ticket(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_key_table_ticket(); + void set_allocated_key_table_ticket(::io::deephaven::proto::backplane::grpc::Ticket* key_table_ticket); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_key_table_ticket() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_key_table_ticket(); + public: + void unsafe_arena_set_allocated_key_table_ticket( + ::io::deephaven::proto::backplane::grpc::Ticket* key_table_ticket); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_key_table_ticket(); + + // .io.deephaven.proto.backplane.grpc.Ticket result_id = 4; + bool has_result_id() const; + private: + bool _internal_has_result_id() const; + public: + void clear_result_id(); + const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); + void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); + private: + const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_result_id() const; + ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_result_id(); + public: + void unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id); + ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_result_id(); + + // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.GetTableRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table_; + ::io::deephaven::proto::backplane::grpc::Ticket* key_table_ticket_; + ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto; +}; +// ------------------------------------------------------------------- + +class PartitionedTableDescriptor final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) */ { + public: + inline PartitionedTableDescriptor() : PartitionedTableDescriptor(nullptr) {} + ~PartitionedTableDescriptor() override; + explicit PROTOBUF_CONSTEXPR PartitionedTableDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PartitionedTableDescriptor(const PartitionedTableDescriptor& from); + PartitionedTableDescriptor(PartitionedTableDescriptor&& from) noexcept + : PartitionedTableDescriptor() { + *this = ::std::move(from); + } + + inline PartitionedTableDescriptor& operator=(const PartitionedTableDescriptor& from) { + CopyFrom(from); + return *this; + } + inline PartitionedTableDescriptor& operator=(PartitionedTableDescriptor&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PartitionedTableDescriptor& default_instance() { + return *internal_default_instance(); + } + static inline const PartitionedTableDescriptor* internal_default_instance() { + return reinterpret_cast( + &_PartitionedTableDescriptor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(PartitionedTableDescriptor& a, PartitionedTableDescriptor& b) { + a.Swap(&b); + } + inline void Swap(PartitionedTableDescriptor* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PartitionedTableDescriptor* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PartitionedTableDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PartitionedTableDescriptor& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const PartitionedTableDescriptor& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PartitionedTableDescriptor* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor"; + } + protected: + explicit PartitionedTableDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kKeyColumnNamesFieldNumber = 1, + kConstituentDefinitionSchemaFieldNumber = 3, + kConstituentColumnNameFieldNumber = 4, + kUniqueKeysFieldNumber = 2, + kConstituentChangesPermittedFieldNumber = 5, + }; + // repeated string key_column_names = 1; + int key_column_names_size() const; + private: + int _internal_key_column_names_size() const; + public: + void clear_key_column_names(); + const std::string& key_column_names(int index) const; + std::string* mutable_key_column_names(int index); + void set_key_column_names(int index, const std::string& value); + void set_key_column_names(int index, std::string&& value); + void set_key_column_names(int index, const char* value); + void set_key_column_names(int index, const char* value, size_t size); + std::string* add_key_column_names(); + void add_key_column_names(const std::string& value); + void add_key_column_names(std::string&& value); + void add_key_column_names(const char* value); + void add_key_column_names(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& key_column_names() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_key_column_names(); + private: + const std::string& _internal_key_column_names(int index) const; + std::string* _internal_add_key_column_names(); + public: + + // bytes constituent_definition_schema = 3; + void clear_constituent_definition_schema(); + const std::string& constituent_definition_schema() const; + template + void set_constituent_definition_schema(ArgT0&& arg0, ArgT... args); + std::string* mutable_constituent_definition_schema(); + PROTOBUF_NODISCARD std::string* release_constituent_definition_schema(); + void set_allocated_constituent_definition_schema(std::string* constituent_definition_schema); + private: + const std::string& _internal_constituent_definition_schema() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_constituent_definition_schema(const std::string& value); + std::string* _internal_mutable_constituent_definition_schema(); + public: + + // string constituent_column_name = 4; + void clear_constituent_column_name(); + const std::string& constituent_column_name() const; + template + void set_constituent_column_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_constituent_column_name(); + PROTOBUF_NODISCARD std::string* release_constituent_column_name(); + void set_allocated_constituent_column_name(std::string* constituent_column_name); + private: + const std::string& _internal_constituent_column_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_constituent_column_name(const std::string& value); + std::string* _internal_mutable_constituent_column_name(); + public: + + // bool unique_keys = 2; + void clear_unique_keys(); + bool unique_keys() const; + void set_unique_keys(bool value); + private: + bool _internal_unique_keys() const; + void _internal_set_unique_keys(bool value); + public: + + // bool constituent_changes_permitted = 5; + void clear_constituent_changes_permitted(); + bool constituent_changes_permitted() const; + void set_constituent_changes_permitted(bool value); + private: + bool _internal_constituent_changes_permitted() const; + void _internal_set_constituent_changes_permitted(bool value); + public: + + // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField key_column_names_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr constituent_definition_schema_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr constituent_column_name_; + bool unique_keys_; + bool constituent_changes_permitted_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_deephaven_2fproto_2fpartitionedtable_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// PartitionByRequest + +// .io.deephaven.proto.backplane.grpc.Ticket table_id = 1; +inline bool PartitionByRequest::_internal_has_table_id() const { + return this != internal_default_instance() && table_id_ != nullptr; +} +inline bool PartitionByRequest::has_table_id() const { + return _internal_has_table_id(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& PartitionByRequest::_internal_table_id() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = table_id_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& PartitionByRequest::table_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id) + return _internal_table_id(); +} +inline void PartitionByRequest::unsafe_arena_set_allocated_table_id( + ::io::deephaven::proto::backplane::grpc::Ticket* table_id) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_id_); + } + table_id_ = table_id; + if (table_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::release_table_id() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = table_id_; + table_id_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::unsafe_arena_release_table_id() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = table_id_; + table_id_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::_internal_mutable_table_id() { + + if (table_id_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + table_id_ = p; + } + return table_id_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::mutable_table_id() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_table_id(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id) + return _msg; +} +inline void PartitionByRequest::set_allocated_table_id(::io::deephaven::proto::backplane::grpc::Ticket* table_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_id_); + } + if (table_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(table_id)); + if (message_arena != submessage_arena) { + table_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, table_id, submessage_arena); + } + + } else { + + } + table_id_ = table_id; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id) +} + +// .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; +inline bool PartitionByRequest::_internal_has_result_id() const { + return this != internal_default_instance() && result_id_ != nullptr; +} +inline bool PartitionByRequest::has_result_id() const { + return _internal_has_result_id(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& PartitionByRequest::_internal_result_id() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = result_id_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& PartitionByRequest::result_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id) + return _internal_result_id(); +} +inline void PartitionByRequest::unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + result_id_ = result_id; + if (result_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::release_result_id() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::unsafe_arena_release_result_id() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::_internal_mutable_result_id() { + + if (result_id_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + result_id_ = p; + } + return result_id_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* PartitionByRequest::mutable_result_id() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_result_id(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id) + return _msg; +} +inline void PartitionByRequest::set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + if (result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); + if (message_arena != submessage_arena) { + result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, result_id, submessage_arena); + } + + } else { + + } + result_id_ = result_id; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id) +} + +// repeated string key_column_names = 3; +inline int PartitionByRequest::_internal_key_column_names_size() const { + return key_column_names_.size(); +} +inline int PartitionByRequest::key_column_names_size() const { + return _internal_key_column_names_size(); +} +inline void PartitionByRequest::clear_key_column_names() { + key_column_names_.Clear(); +} +inline std::string* PartitionByRequest::add_key_column_names() { + std::string* _s = _internal_add_key_column_names(); + // @@protoc_insertion_point(field_add_mutable:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) + return _s; +} +inline const std::string& PartitionByRequest::_internal_key_column_names(int index) const { + return key_column_names_.Get(index); +} +inline const std::string& PartitionByRequest::key_column_names(int index) const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) + return _internal_key_column_names(index); +} +inline std::string* PartitionByRequest::mutable_key_column_names(int index) { + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) + return key_column_names_.Mutable(index); +} +inline void PartitionByRequest::set_key_column_names(int index, const std::string& value) { + key_column_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::set_key_column_names(int index, std::string&& value) { + key_column_names_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::set_key_column_names(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + key_column_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::set_key_column_names(int index, const char* value, size_t size) { + key_column_names_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline std::string* PartitionByRequest::_internal_add_key_column_names() { + return key_column_names_.Add(); +} +inline void PartitionByRequest::add_key_column_names(const std::string& value) { + key_column_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::add_key_column_names(std::string&& value) { + key_column_names_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::add_key_column_names(const char* value) { + GOOGLE_DCHECK(value != nullptr); + key_column_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline void PartitionByRequest::add_key_column_names(const char* value, size_t size) { + key_column_names_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +PartitionByRequest::key_column_names() const { + // @@protoc_insertion_point(field_list:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) + return key_column_names_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +PartitionByRequest::mutable_key_column_names() { + // @@protoc_insertion_point(field_mutable_list:io.deephaven.proto.backplane.grpc.PartitionByRequest.key_column_names) + return &key_column_names_; +} + +// bool drop_keys = 4; +inline void PartitionByRequest::clear_drop_keys() { + drop_keys_ = false; +} +inline bool PartitionByRequest::_internal_drop_keys() const { + return drop_keys_; +} +inline bool PartitionByRequest::drop_keys() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionByRequest.drop_keys) + return _internal_drop_keys(); +} +inline void PartitionByRequest::_internal_set_drop_keys(bool value) { + + drop_keys_ = value; +} +inline void PartitionByRequest::set_drop_keys(bool value) { + _internal_set_drop_keys(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionByRequest.drop_keys) +} + +// ------------------------------------------------------------------- + +// PartitionByResponse + +// ------------------------------------------------------------------- + +// MergeRequest + +// .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; +inline bool MergeRequest::_internal_has_partitioned_table() const { + return this != internal_default_instance() && partitioned_table_ != nullptr; +} +inline bool MergeRequest::has_partitioned_table() const { + return _internal_has_partitioned_table(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& MergeRequest::_internal_partitioned_table() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = partitioned_table_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& MergeRequest::partitioned_table() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table) + return _internal_partitioned_table(); +} +inline void MergeRequest::unsafe_arena_set_allocated_partitioned_table( + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table_); + } + partitioned_table_ = partitioned_table; + if (partitioned_table) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::release_partitioned_table() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = partitioned_table_; + partitioned_table_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::unsafe_arena_release_partitioned_table() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = partitioned_table_; + partitioned_table_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::_internal_mutable_partitioned_table() { + + if (partitioned_table_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + partitioned_table_ = p; + } + return partitioned_table_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::mutable_partitioned_table() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_partitioned_table(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table) + return _msg; +} +inline void MergeRequest::set_allocated_partitioned_table(::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table_); + } + if (partitioned_table) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table)); + if (message_arena != submessage_arena) { + partitioned_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, partitioned_table, submessage_arena); + } + + } else { + + } + partitioned_table_ = partitioned_table; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table) +} + +// .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; +inline bool MergeRequest::_internal_has_result_id() const { + return this != internal_default_instance() && result_id_ != nullptr; +} +inline bool MergeRequest::has_result_id() const { + return _internal_has_result_id(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& MergeRequest::_internal_result_id() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = result_id_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& MergeRequest::result_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.MergeRequest.result_id) + return _internal_result_id(); +} +inline void MergeRequest::unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + result_id_ = result_id; + if (result_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.MergeRequest.result_id) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::release_result_id() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::unsafe_arena_release_result_id() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.MergeRequest.result_id) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::_internal_mutable_result_id() { + + if (result_id_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + result_id_ = p; + } + return result_id_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* MergeRequest::mutable_result_id() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_result_id(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.MergeRequest.result_id) + return _msg; +} +inline void MergeRequest::set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + if (result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); + if (message_arena != submessage_arena) { + result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, result_id, submessage_arena); + } + + } else { + + } + result_id_ = result_id; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.MergeRequest.result_id) +} + +// ------------------------------------------------------------------- + +// GetTableRequest + +// .io.deephaven.proto.backplane.grpc.Ticket partitioned_table = 1; +inline bool GetTableRequest::_internal_has_partitioned_table() const { + return this != internal_default_instance() && partitioned_table_ != nullptr; +} +inline bool GetTableRequest::has_partitioned_table() const { + return _internal_has_partitioned_table(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::_internal_partitioned_table() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = partitioned_table_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::partitioned_table() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table) + return _internal_partitioned_table(); +} +inline void GetTableRequest::unsafe_arena_set_allocated_partitioned_table( + ::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table_); + } + partitioned_table_ = partitioned_table; + if (partitioned_table) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::release_partitioned_table() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = partitioned_table_; + partitioned_table_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::unsafe_arena_release_partitioned_table() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = partitioned_table_; + partitioned_table_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::_internal_mutable_partitioned_table() { + + if (partitioned_table_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + partitioned_table_ = p; + } + return partitioned_table_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::mutable_partitioned_table() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_partitioned_table(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table) + return _msg; +} +inline void GetTableRequest::set_allocated_partitioned_table(::io::deephaven::proto::backplane::grpc::Ticket* partitioned_table) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table_); + } + if (partitioned_table) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partitioned_table)); + if (message_arena != submessage_arena) { + partitioned_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, partitioned_table, submessage_arena); + } + + } else { + + } + partitioned_table_ = partitioned_table; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table) +} + +// .io.deephaven.proto.backplane.grpc.Ticket key_table_ticket = 2; +inline bool GetTableRequest::_internal_has_key_table_ticket() const { + return this != internal_default_instance() && key_table_ticket_ != nullptr; +} +inline bool GetTableRequest::has_key_table_ticket() const { + return _internal_has_key_table_ticket(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::_internal_key_table_ticket() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = key_table_ticket_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::key_table_ticket() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket) + return _internal_key_table_ticket(); +} +inline void GetTableRequest::unsafe_arena_set_allocated_key_table_ticket( + ::io::deephaven::proto::backplane::grpc::Ticket* key_table_ticket) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(key_table_ticket_); + } + key_table_ticket_ = key_table_ticket; + if (key_table_ticket) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::release_key_table_ticket() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = key_table_ticket_; + key_table_ticket_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::unsafe_arena_release_key_table_ticket() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = key_table_ticket_; + key_table_ticket_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::_internal_mutable_key_table_ticket() { + + if (key_table_ticket_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + key_table_ticket_ = p; + } + return key_table_ticket_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::mutable_key_table_ticket() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_key_table_ticket(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket) + return _msg; +} +inline void GetTableRequest::set_allocated_key_table_ticket(::io::deephaven::proto::backplane::grpc::Ticket* key_table_ticket) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(key_table_ticket_); + } + if (key_table_ticket) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(key_table_ticket)); + if (message_arena != submessage_arena) { + key_table_ticket = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, key_table_ticket, submessage_arena); + } + + } else { + + } + key_table_ticket_ = key_table_ticket; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket) +} + +// .io.deephaven.proto.backplane.grpc.Ticket result_id = 4; +inline bool GetTableRequest::_internal_has_result_id() const { + return this != internal_default_instance() && result_id_ != nullptr; +} +inline bool GetTableRequest::has_result_id() const { + return _internal_has_result_id(); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::_internal_result_id() const { + const ::io::deephaven::proto::backplane::grpc::Ticket* p = result_id_; + return p != nullptr ? *p : reinterpret_cast( + ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); +} +inline const ::io::deephaven::proto::backplane::grpc::Ticket& GetTableRequest::result_id() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.GetTableRequest.result_id) + return _internal_result_id(); +} +inline void GetTableRequest::unsafe_arena_set_allocated_result_id( + ::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + result_id_ = result_id; + if (result_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.result_id) +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::release_result_id() { + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::unsafe_arena_release_result_id() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.GetTableRequest.result_id) + + ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; + result_id_ = nullptr; + return temp; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::_internal_mutable_result_id() { + + if (result_id_ == nullptr) { + auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); + result_id_ = p; + } + return result_id_; +} +inline ::io::deephaven::proto::backplane::grpc::Ticket* GetTableRequest::mutable_result_id() { + ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_result_id(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.GetTableRequest.result_id) + return _msg; +} +inline void GetTableRequest::set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); + } + if (result_id) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); + if (message_arena != submessage_arena) { + result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, result_id, submessage_arena); + } + + } else { + + } + result_id_ = result_id; + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.GetTableRequest.result_id) +} + +// ------------------------------------------------------------------- + +// PartitionedTableDescriptor + +// repeated string key_column_names = 1; +inline int PartitionedTableDescriptor::_internal_key_column_names_size() const { + return key_column_names_.size(); +} +inline int PartitionedTableDescriptor::key_column_names_size() const { + return _internal_key_column_names_size(); +} +inline void PartitionedTableDescriptor::clear_key_column_names() { + key_column_names_.Clear(); +} +inline std::string* PartitionedTableDescriptor::add_key_column_names() { + std::string* _s = _internal_add_key_column_names(); + // @@protoc_insertion_point(field_add_mutable:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) + return _s; +} +inline const std::string& PartitionedTableDescriptor::_internal_key_column_names(int index) const { + return key_column_names_.Get(index); +} +inline const std::string& PartitionedTableDescriptor::key_column_names(int index) const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) + return _internal_key_column_names(index); +} +inline std::string* PartitionedTableDescriptor::mutable_key_column_names(int index) { + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) + return key_column_names_.Mutable(index); +} +inline void PartitionedTableDescriptor::set_key_column_names(int index, const std::string& value) { + key_column_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::set_key_column_names(int index, std::string&& value) { + key_column_names_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::set_key_column_names(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + key_column_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::set_key_column_names(int index, const char* value, size_t size) { + key_column_names_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline std::string* PartitionedTableDescriptor::_internal_add_key_column_names() { + return key_column_names_.Add(); +} +inline void PartitionedTableDescriptor::add_key_column_names(const std::string& value) { + key_column_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::add_key_column_names(std::string&& value) { + key_column_names_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::add_key_column_names(const char* value) { + GOOGLE_DCHECK(value != nullptr); + key_column_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline void PartitionedTableDescriptor::add_key_column_names(const char* value, size_t size) { + key_column_names_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +PartitionedTableDescriptor::key_column_names() const { + // @@protoc_insertion_point(field_list:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) + return key_column_names_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +PartitionedTableDescriptor::mutable_key_column_names() { + // @@protoc_insertion_point(field_mutable_list:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.key_column_names) + return &key_column_names_; +} + +// string constituent_column_name = 4; +inline void PartitionedTableDescriptor::clear_constituent_column_name() { + constituent_column_name_.ClearToEmpty(); +} +inline const std::string& PartitionedTableDescriptor::constituent_column_name() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name) + return _internal_constituent_column_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void PartitionedTableDescriptor::set_constituent_column_name(ArgT0&& arg0, ArgT... args) { + + constituent_column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name) +} +inline std::string* PartitionedTableDescriptor::mutable_constituent_column_name() { + std::string* _s = _internal_mutable_constituent_column_name(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name) + return _s; +} +inline const std::string& PartitionedTableDescriptor::_internal_constituent_column_name() const { + return constituent_column_name_.Get(); +} +inline void PartitionedTableDescriptor::_internal_set_constituent_column_name(const std::string& value) { + + constituent_column_name_.Set(value, GetArenaForAllocation()); +} +inline std::string* PartitionedTableDescriptor::_internal_mutable_constituent_column_name() { + + return constituent_column_name_.Mutable(GetArenaForAllocation()); +} +inline std::string* PartitionedTableDescriptor::release_constituent_column_name() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name) + return constituent_column_name_.Release(); +} +inline void PartitionedTableDescriptor::set_allocated_constituent_column_name(std::string* constituent_column_name) { + if (constituent_column_name != nullptr) { + + } else { + + } + constituent_column_name_.SetAllocated(constituent_column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (constituent_column_name_.IsDefault()) { + constituent_column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_column_name) +} + +// bool unique_keys = 2; +inline void PartitionedTableDescriptor::clear_unique_keys() { + unique_keys_ = false; +} +inline bool PartitionedTableDescriptor::_internal_unique_keys() const { + return unique_keys_; +} +inline bool PartitionedTableDescriptor::unique_keys() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.unique_keys) + return _internal_unique_keys(); +} +inline void PartitionedTableDescriptor::_internal_set_unique_keys(bool value) { + + unique_keys_ = value; +} +inline void PartitionedTableDescriptor::set_unique_keys(bool value) { + _internal_set_unique_keys(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.unique_keys) +} + +// bytes constituent_definition_schema = 3; +inline void PartitionedTableDescriptor::clear_constituent_definition_schema() { + constituent_definition_schema_.ClearToEmpty(); +} +inline const std::string& PartitionedTableDescriptor::constituent_definition_schema() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_definition_schema) + return _internal_constituent_definition_schema(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void PartitionedTableDescriptor::set_constituent_definition_schema(ArgT0&& arg0, ArgT... args) { + + constituent_definition_schema_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_definition_schema) +} +inline std::string* PartitionedTableDescriptor::mutable_constituent_definition_schema() { + std::string* _s = _internal_mutable_constituent_definition_schema(); + // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_definition_schema) + return _s; +} +inline const std::string& PartitionedTableDescriptor::_internal_constituent_definition_schema() const { + return constituent_definition_schema_.Get(); +} +inline void PartitionedTableDescriptor::_internal_set_constituent_definition_schema(const std::string& value) { + + constituent_definition_schema_.Set(value, GetArenaForAllocation()); +} +inline std::string* PartitionedTableDescriptor::_internal_mutable_constituent_definition_schema() { + + return constituent_definition_schema_.Mutable(GetArenaForAllocation()); +} +inline std::string* PartitionedTableDescriptor::release_constituent_definition_schema() { + // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_definition_schema) + return constituent_definition_schema_.Release(); +} +inline void PartitionedTableDescriptor::set_allocated_constituent_definition_schema(std::string* constituent_definition_schema) { + if (constituent_definition_schema != nullptr) { + + } else { + + } + constituent_definition_schema_.SetAllocated(constituent_definition_schema, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (constituent_definition_schema_.IsDefault()) { + constituent_definition_schema_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_definition_schema) +} + +// bool constituent_changes_permitted = 5; +inline void PartitionedTableDescriptor::clear_constituent_changes_permitted() { + constituent_changes_permitted_ = false; +} +inline bool PartitionedTableDescriptor::_internal_constituent_changes_permitted() const { + return constituent_changes_permitted_; +} +inline bool PartitionedTableDescriptor::constituent_changes_permitted() const { + // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_changes_permitted) + return _internal_constituent_changes_permitted(); +} +inline void PartitionedTableDescriptor::_internal_set_constituent_changes_permitted(bool value) { + + constituent_changes_permitted_ = value; +} +inline void PartitionedTableDescriptor::set_constituent_changes_permitted(bool value) { + _internal_set_constituent_changes_permitted(value); + // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor.constituent_changes_permitted) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace grpc +} // namespace backplane +} // namespace proto +} // namespace deephaven +} // namespace io + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_deephaven_2fproto_2fpartitionedtable_2eproto diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.cc index c9c8b909557..752e55ede75 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/session.proto @@ -58,11 +55,11 @@ ::grpc::Status SessionService::Stub::NewSession(::grpc::ClientContext* context, return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_NewSession_, context, request, response); } -void SessionService::Stub::experimental_async::NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function f) { +void SessionService::Stub::async::NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NewSession_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NewSession_, context, request, response, reactor); } @@ -81,11 +78,11 @@ ::grpc::Status SessionService::Stub::RefreshSessionToken(::grpc::ClientContext* return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RefreshSessionToken_, context, request, response); } -void SessionService::Stub::experimental_async::RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function f) { +void SessionService::Stub::async::RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RefreshSessionToken_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RefreshSessionToken_, context, request, response, reactor); } @@ -104,11 +101,11 @@ ::grpc::Status SessionService::Stub::CloseSession(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_CloseSession_, context, request, response); } -void SessionService::Stub::experimental_async::CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, std::function f) { +void SessionService::Stub::async::CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CloseSession_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CloseSession_, context, request, response, reactor); } @@ -127,11 +124,11 @@ ::grpc::Status SessionService::Stub::Release(::grpc::ClientContext* context, con return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Release_, context, request, response); } -void SessionService::Stub::experimental_async::Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, std::function f) { +void SessionService::Stub::async::Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Release_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Release_, context, request, response, reactor); } @@ -150,11 +147,11 @@ ::grpc::Status SessionService::Stub::ExportFromTicket(::grpc::ClientContext* con return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ExportFromTicket_, context, request, response); } -void SessionService::Stub::experimental_async::ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, std::function f) { +void SessionService::Stub::async::ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExportFromTicket_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExportFromTicket_, context, request, response, reactor); } @@ -173,7 +170,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::grpc::ExportNotificatio return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportNotification>::Create(channel_.get(), rpcmethod_ExportNotifications_, context, request); } -void SessionService::Stub::experimental_async::ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) { +void SessionService::Stub::async::ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportNotification>::Create(stub_->channel_.get(), stub_->rpcmethod_ExportNotifications_, context, request, reactor); } @@ -189,11 +186,11 @@ ::grpc::Status SessionService::Stub::TerminationNotification(::grpc::ClientConte return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_TerminationNotification_, context, request, response); } -void SessionService::Stub::experimental_async::TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, std::function f) { +void SessionService::Stub::async::TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TerminationNotification_, context, request, response, std::move(f)); } -void SessionService::Stub::experimental_async::TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void SessionService::Stub::async::TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TerminationNotification_, context, request, response, reactor); } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.h index 82fb4ad7f60..72529af8914 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/session.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/session.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2fsession_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2fsession_2eproto__INCLUDED #include "deephaven/proto/session.pb.h" #include -#include #include #include #include @@ -138,85 +133,53 @@ class SessionService final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>> PrepareAsyncTerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>>(PrepareAsyncTerminationNotificationRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} // // Handshake between client and server to create a new session. The response includes a metadata header name and the // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. virtual void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated // token that should replace the existing token for subsequent requests. virtual void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all // unreleased exports will be automatically released. virtual void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Attempts to release an export by its ticket. Returns true if an existing export was found. It is the client's // responsibility to release all resources they no longer want the server to hold on to. Proactively cancels work; do // not release a ticket that is needed by dependent work that has not yet finished // (i.e. the dependencies that are staying around should first be in EXPORTED state). virtual void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Makes a copy from a source ticket to a client managed result ticket. The source ticket does not need to be // a client managed ticket. virtual void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Establish a stream to manage all session exports, including those lost due to partially complete rpc calls. // // New streams will flush notifications for all un-released exports, prior to seeing any new or updated exports // for all live exports. After the refresh of existing state, subscribers will receive notifications of new and // updated exports. An export id of zero will be sent to indicate all pre-existing exports have been sent. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) = 0; - #else - virtual void ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) = 0; - #endif // // Receive a best-effort message on-exit indicating why this server is exiting. Reception of this message cannot be // guaranteed. virtual void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* AsyncNewSessionRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* PrepareAsyncNewSessionRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* AsyncRefreshSessionTokenRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -287,61 +250,33 @@ class SessionService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>> PrepareAsyncTerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>>(PrepareAsyncTerminationNotificationRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void NewSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void RefreshSessionToken(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void CloseSession(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Release(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void ExportFromTicket(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) override; - #else - void ExportNotifications(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* reactor) override; - #endif void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void TerminationNotification(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* AsyncNewSessionRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* PrepareAsyncNewSessionRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* AsyncRefreshSessionTokenRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest& request, ::grpc::CompletionQueue* cq) override; @@ -547,36 +482,22 @@ class SessionService final { }; typedef WithAsyncMethod_NewSession > > > > > > AsyncService; template - class ExperimentalWithCallbackMethod_NewSession : public BaseClass { + class WithCallbackMethod_NewSession : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_NewSession() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_NewSession() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response) { return this->NewSession(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response) { return this->NewSession(context, request, response); }));} void SetMessageAllocatorFor_NewSession( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_NewSession() override { + ~WithCallbackMethod_NewSession() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -584,46 +505,26 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NewSession( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NewSession( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_RefreshSessionToken : public BaseClass { + class WithCallbackMethod_RefreshSessionToken : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_RefreshSessionToken() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(1, + WithCallbackMethod_RefreshSessionToken() { + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response) { return this->RefreshSessionToken(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* response) { return this->RefreshSessionToken(context, request, response); }));} void SetMessageAllocatorFor_RefreshSessionToken( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(1); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::HandshakeResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_RefreshSessionToken() override { + ~WithCallbackMethod_RefreshSessionToken() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -631,46 +532,26 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* RefreshSessionToken( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* RefreshSessionToken( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::HandshakeResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_CloseSession : public BaseClass { + class WithCallbackMethod_CloseSession : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_CloseSession() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(2, + WithCallbackMethod_CloseSession() { + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response) { return this->CloseSession(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* request, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* response) { return this->CloseSession(context, request, response); }));} void SetMessageAllocatorFor_CloseSession( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(2); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HandshakeRequest, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_CloseSession() override { + ~WithCallbackMethod_CloseSession() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -678,46 +559,26 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CloseSession( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CloseSession( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HandshakeRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Release : public BaseClass { + class WithCallbackMethod_Release : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Release() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(3, + WithCallbackMethod_Release() { + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response) { return this->Release(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* request, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* response) { return this->Release(context, request, response); }));} void SetMessageAllocatorFor_Release( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(3); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ReleaseRequest, ::io::deephaven::proto::backplane::grpc::ReleaseResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Release() override { + ~WithCallbackMethod_Release() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -725,46 +586,26 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Release( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Release( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ReleaseRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ReleaseResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ExportFromTicket : public BaseClass { + class WithCallbackMethod_ExportFromTicket : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ExportFromTicket() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(4, + WithCallbackMethod_ExportFromTicket() { + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response) { return this->ExportFromTicket(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ExportRequest* request, ::io::deephaven::proto::backplane::grpc::ExportResponse* response) { return this->ExportFromTicket(context, request, response); }));} void SetMessageAllocatorFor_ExportFromTicket( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(4); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ExportRequest, ::io::deephaven::proto::backplane::grpc::ExportResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_ExportFromTicket() override { + ~WithCallbackMethod_ExportFromTicket() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -772,37 +613,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExportFromTicket( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExportFromTicket( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ExportNotifications : public BaseClass { + class WithCallbackMethod_ExportNotifications : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ExportNotifications() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(5, + WithCallbackMethod_ExportNotifications() { + ::grpc::Service::MarkMethodCallback(5, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest, ::io::deephaven::proto::backplane::grpc::ExportNotification>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request) { return this->ExportNotifications(context, request); })); - } - ~ExperimentalWithCallbackMethod_ExportNotifications() override { + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* request) { return this->ExportNotifications(context, request); })); + } + ~WithCallbackMethod_ExportNotifications() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -810,46 +635,26 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* ExportNotifications( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportNotification>* ExportNotifications( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* /*request*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_TerminationNotification : public BaseClass { + class WithCallbackMethod_TerminationNotification : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_TerminationNotification() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(6, + WithCallbackMethod_TerminationNotification() { + ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response) { return this->TerminationNotification(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* request, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* response) { return this->TerminationNotification(context, request, response); }));} void SetMessageAllocatorFor_TerminationNotification( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(6); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_TerminationNotification() override { + ~WithCallbackMethod_TerminationNotification() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -857,20 +662,11 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TerminationNotification( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TerminationNotification( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* /*response*/) { return nullptr; } }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_NewSession > > > > > > CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_NewSession > > > > > > ExperimentalCallbackService; + typedef WithCallbackMethod_NewSession > > > > > > CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_NewSession : public BaseClass { private: @@ -1131,27 +927,17 @@ class SessionService final { } }; template - class ExperimentalWithRawCallbackMethod_NewSession : public BaseClass { + class WithRawCallbackMethod_NewSession : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_NewSession() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_NewSession() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NewSession(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_NewSession() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NewSession(context, request, response); })); + } + ~WithRawCallbackMethod_NewSession() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1159,37 +945,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NewSession( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NewSession( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_RefreshSessionToken : public BaseClass { + class WithRawCallbackMethod_RefreshSessionToken : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_RefreshSessionToken() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(1, + WithRawCallbackMethod_RefreshSessionToken() { + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RefreshSessionToken(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_RefreshSessionToken() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RefreshSessionToken(context, request, response); })); + } + ~WithRawCallbackMethod_RefreshSessionToken() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1197,37 +967,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* RefreshSessionToken( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* RefreshSessionToken( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_CloseSession : public BaseClass { + class WithRawCallbackMethod_CloseSession : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_CloseSession() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(2, + WithRawCallbackMethod_CloseSession() { + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CloseSession(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_CloseSession() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CloseSession(context, request, response); })); + } + ~WithRawCallbackMethod_CloseSession() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1235,37 +989,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CloseSession( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CloseSession( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Release : public BaseClass { + class WithRawCallbackMethod_Release : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Release() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(3, + WithRawCallbackMethod_Release() { + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Release(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_Release() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Release(context, request, response); })); + } + ~WithRawCallbackMethod_Release() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1273,37 +1011,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Release( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Release( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ExportFromTicket : public BaseClass { + class WithRawCallbackMethod_ExportFromTicket : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ExportFromTicket() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(4, + WithRawCallbackMethod_ExportFromTicket() { + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExportFromTicket(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_ExportFromTicket() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExportFromTicket(context, request, response); })); + } + ~WithRawCallbackMethod_ExportFromTicket() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1311,37 +1033,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExportFromTicket( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExportFromTicket( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ExportNotifications : public BaseClass { + class WithRawCallbackMethod_ExportNotifications : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ExportNotifications() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(5, + WithRawCallbackMethod_ExportNotifications() { + ::grpc::Service::MarkMethodRawCallback(5, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->ExportNotifications(context, request); })); - } - ~ExperimentalWithRawCallbackMethod_ExportNotifications() override { + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->ExportNotifications(context, request); })); + } + ~WithRawCallbackMethod_ExportNotifications() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1349,37 +1055,21 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* ExportNotifications( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* ExportNotifications( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_TerminationNotification : public BaseClass { + class WithRawCallbackMethod_TerminationNotification : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_TerminationNotification() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(6, + WithRawCallbackMethod_TerminationNotification() { + ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TerminationNotification(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_TerminationNotification() override { + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TerminationNotification(context, request, response); })); + } + ~WithRawCallbackMethod_TerminationNotification() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -1387,14 +1077,8 @@ class SessionService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TerminationNotification( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TerminationNotification( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithStreamedUnaryMethod_NewSession : public BaseClass { diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.cc index 29c343a6ffa..79398b92d15 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/session.proto @@ -19,174 +16,178 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr HandshakeRequest::HandshakeRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : payload_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_CONSTEXPR HandshakeRequest::HandshakeRequest( + ::_pbi::ConstantInitialized) + : payload_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , auth_protocol_(0){} struct HandshakeRequestDefaultTypeInternal { - constexpr HandshakeRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR HandshakeRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~HandshakeRequestDefaultTypeInternal() {} union { HandshakeRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HandshakeRequestDefaultTypeInternal _HandshakeRequest_default_instance_; -constexpr HandshakeResponse::HandshakeResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : metadata_header_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , session_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HandshakeRequestDefaultTypeInternal _HandshakeRequest_default_instance_; +PROTOBUF_CONSTEXPR HandshakeResponse::HandshakeResponse( + ::_pbi::ConstantInitialized) + : metadata_header_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , session_token_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , token_deadline_time_millis_(int64_t{0}) , token_expiration_delay_millis_(int64_t{0}){} struct HandshakeResponseDefaultTypeInternal { - constexpr HandshakeResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR HandshakeResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~HandshakeResponseDefaultTypeInternal() {} union { HandshakeResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HandshakeResponseDefaultTypeInternal _HandshakeResponse_default_instance_; -constexpr CloseSessionResponse::CloseSessionResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HandshakeResponseDefaultTypeInternal _HandshakeResponse_default_instance_; +PROTOBUF_CONSTEXPR CloseSessionResponse::CloseSessionResponse( + ::_pbi::ConstantInitialized){} struct CloseSessionResponseDefaultTypeInternal { - constexpr CloseSessionResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CloseSessionResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CloseSessionResponseDefaultTypeInternal() {} union { CloseSessionResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CloseSessionResponseDefaultTypeInternal _CloseSessionResponse_default_instance_; -constexpr ReleaseRequest::ReleaseRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CloseSessionResponseDefaultTypeInternal _CloseSessionResponse_default_instance_; +PROTOBUF_CONSTEXPR ReleaseRequest::ReleaseRequest( + ::_pbi::ConstantInitialized) : id_(nullptr){} struct ReleaseRequestDefaultTypeInternal { - constexpr ReleaseRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ReleaseRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ReleaseRequestDefaultTypeInternal() {} union { ReleaseRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReleaseRequestDefaultTypeInternal _ReleaseRequest_default_instance_; -constexpr ReleaseResponse::ReleaseResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReleaseRequestDefaultTypeInternal _ReleaseRequest_default_instance_; +PROTOBUF_CONSTEXPR ReleaseResponse::ReleaseResponse( + ::_pbi::ConstantInitialized){} struct ReleaseResponseDefaultTypeInternal { - constexpr ReleaseResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ReleaseResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ReleaseResponseDefaultTypeInternal() {} union { ReleaseResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReleaseResponseDefaultTypeInternal _ReleaseResponse_default_instance_; -constexpr ExportRequest::ExportRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReleaseResponseDefaultTypeInternal _ReleaseResponse_default_instance_; +PROTOBUF_CONSTEXPR ExportRequest::ExportRequest( + ::_pbi::ConstantInitialized) : source_id_(nullptr) , result_id_(nullptr){} struct ExportRequestDefaultTypeInternal { - constexpr ExportRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportRequestDefaultTypeInternal() {} union { ExportRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportRequestDefaultTypeInternal _ExportRequest_default_instance_; -constexpr ExportResponse::ExportResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportRequestDefaultTypeInternal _ExportRequest_default_instance_; +PROTOBUF_CONSTEXPR ExportResponse::ExportResponse( + ::_pbi::ConstantInitialized){} struct ExportResponseDefaultTypeInternal { - constexpr ExportResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportResponseDefaultTypeInternal() {} union { ExportResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportResponseDefaultTypeInternal _ExportResponse_default_instance_; -constexpr ExportNotificationRequest::ExportNotificationRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportResponseDefaultTypeInternal _ExportResponse_default_instance_; +PROTOBUF_CONSTEXPR ExportNotificationRequest::ExportNotificationRequest( + ::_pbi::ConstantInitialized){} struct ExportNotificationRequestDefaultTypeInternal { - constexpr ExportNotificationRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportNotificationRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportNotificationRequestDefaultTypeInternal() {} union { ExportNotificationRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportNotificationRequestDefaultTypeInternal _ExportNotificationRequest_default_instance_; -constexpr ExportNotification::ExportNotification( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : context_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , dependent_handle_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportNotificationRequestDefaultTypeInternal _ExportNotificationRequest_default_instance_; +PROTOBUF_CONSTEXPR ExportNotification::ExportNotification( + ::_pbi::ConstantInitialized) + : context_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , dependent_handle_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , ticket_(nullptr) , export_state_(0) {} struct ExportNotificationDefaultTypeInternal { - constexpr ExportNotificationDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportNotificationDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportNotificationDefaultTypeInternal() {} union { ExportNotification _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportNotificationDefaultTypeInternal _ExportNotification_default_instance_; -constexpr TerminationNotificationRequest::TerminationNotificationRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportNotificationDefaultTypeInternal _ExportNotification_default_instance_; +PROTOBUF_CONSTEXPR TerminationNotificationRequest::TerminationNotificationRequest( + ::_pbi::ConstantInitialized){} struct TerminationNotificationRequestDefaultTypeInternal { - constexpr TerminationNotificationRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TerminationNotificationRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TerminationNotificationRequestDefaultTypeInternal() {} union { TerminationNotificationRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TerminationNotificationRequestDefaultTypeInternal _TerminationNotificationRequest_default_instance_; -constexpr TerminationNotificationResponse_StackTrace::TerminationNotificationResponse_StackTrace( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TerminationNotificationRequestDefaultTypeInternal _TerminationNotificationRequest_default_instance_; +PROTOBUF_CONSTEXPR TerminationNotificationResponse_StackTrace::TerminationNotificationResponse_StackTrace( + ::_pbi::ConstantInitialized) : elements_() - , type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , message_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} + , type_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , message_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct TerminationNotificationResponse_StackTraceDefaultTypeInternal { - constexpr TerminationNotificationResponse_StackTraceDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TerminationNotificationResponse_StackTraceDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TerminationNotificationResponse_StackTraceDefaultTypeInternal() {} union { TerminationNotificationResponse_StackTrace _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TerminationNotificationResponse_StackTraceDefaultTypeInternal _TerminationNotificationResponse_StackTrace_default_instance_; -constexpr TerminationNotificationResponse::TerminationNotificationResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TerminationNotificationResponse_StackTraceDefaultTypeInternal _TerminationNotificationResponse_StackTrace_default_instance_; +PROTOBUF_CONSTEXPR TerminationNotificationResponse::TerminationNotificationResponse( + ::_pbi::ConstantInitialized) : stack_traces_() - , reason_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , reason_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , abnormal_termination_(false) , is_from_uncaught_exception_(false){} struct TerminationNotificationResponseDefaultTypeInternal { - constexpr TerminationNotificationResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TerminationNotificationResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TerminationNotificationResponseDefaultTypeInternal() {} union { TerminationNotificationResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TerminationNotificationResponseDefaultTypeInternal _TerminationNotificationResponse_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TerminationNotificationResponseDefaultTypeInternal _TerminationNotificationResponse_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2fsession_2eproto[12]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2fsession_2eproto[1]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fsession_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fsession_2eproto[12]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2fsession_2eproto[1]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fsession_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fsession_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2fsession_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::HandshakeRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -280,7 +281,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fsession_2e PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse, is_from_uncaught_exception_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse, stack_traces_), }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HandshakeRequest)}, { 8, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HandshakeResponse)}, { 18, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CloseSessionResponse)}, @@ -295,19 +296,19 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 82, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_HandshakeRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_HandshakeResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CloseSessionResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ReleaseRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ReleaseResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportNotificationRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportNotification_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TerminationNotificationRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TerminationNotificationResponse_StackTrace_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TerminationNotificationResponse_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_HandshakeRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_HandshakeResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CloseSessionResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ReleaseRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ReleaseResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportNotificationRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportNotification_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_TerminationNotificationRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_TerminationNotificationResponse_StackTrace_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_TerminationNotificationResponse_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2fsession_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -371,22 +372,24 @@ const char descriptor_table_protodef_deephaven_2fproto_2fsession_2eproto[] PROTO "plane.grpc.TerminationNotificationRespon" "se\"\000B\004H\001P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2fsession_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2fsession_2eproto_deps[1] = { &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2fsession_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fsession_2eproto = { - false, false, 2338, descriptor_table_protodef_deephaven_2fproto_2fsession_2eproto, "deephaven/proto/session.proto", - &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, descriptor_table_deephaven_2fproto_2fsession_2eproto_deps, 1, 12, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2fsession_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2fsession_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fsession_2eproto, file_level_service_descriptors_deephaven_2fproto_2fsession_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fsession_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fsession_2eproto = { + false, false, 2338, descriptor_table_protodef_deephaven_2fproto_2fsession_2eproto, + "deephaven/proto/session.proto", + &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, descriptor_table_deephaven_2fproto_2fsession_2eproto_deps, 1, 12, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fsession_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fsession_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fsession_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fsession_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2fsession_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fsession_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2fsession_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fsession_2eproto(&descriptor_table_deephaven_2fproto_2fsession_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fsession_2eproto(&descriptor_table_deephaven_2fproto_2fsession_2eproto); namespace io { namespace deephaven { namespace proto { @@ -417,7 +420,7 @@ bool ExportNotification_State_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr ExportNotification_State ExportNotification::UNKNOWN; constexpr ExportNotification_State ExportNotification::PENDING; constexpr ExportNotification_State ExportNotification::PUBLISHING; @@ -434,7 +437,7 @@ constexpr ExportNotification_State ExportNotification::DEPENDENCY_RELEASED; constexpr ExportNotification_State ExportNotification::State_MIN; constexpr ExportNotification_State ExportNotification::State_MAX; constexpr int ExportNotification::State_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) // =================================================================== @@ -446,53 +449,52 @@ HandshakeRequest::HandshakeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.HandshakeRequest) } HandshakeRequest::HandshakeRequest(const HandshakeRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - payload_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + payload_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + payload_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_payload().empty()) { - payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_payload(), + payload_.Set(from._internal_payload(), GetArenaForAllocation()); } auth_protocol_ = from.auth_protocol_; // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.HandshakeRequest) } -void HandshakeRequest::SharedCtor() { -payload_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void HandshakeRequest::SharedCtor() { +payload_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + payload_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING auth_protocol_ = 0; } HandshakeRequest::~HandshakeRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.HandshakeRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void HandshakeRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - payload_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + payload_.Destroy(); } -void HandshakeRequest::ArenaDtor(void* object) { - HandshakeRequest* _this = reinterpret_cast< HandshakeRequest* >(object); - (void)_this; -} -void HandshakeRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void HandshakeRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void HandshakeRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.HandshakeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -501,15 +503,15 @@ void HandshakeRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* HandshakeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* HandshakeRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // sint32 auth_protocol = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { auth_protocol_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr); CHK_(ptr); } else @@ -517,9 +519,9 @@ const char* HandshakeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // bytes payload = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_payload(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -547,16 +549,16 @@ const char* HandshakeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* HandshakeRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* HandshakeRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.HandshakeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // sint32 auth_protocol = 1; if (this->_internal_auth_protocol() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt32ToArray(1, this->_internal_auth_protocol(), target); + target = ::_pbi::WireFormatLite::WriteSInt32ToArray(1, this->_internal_auth_protocol(), target); } // bytes payload = 2; @@ -566,7 +568,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* HandshakeRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.HandshakeRequest) @@ -577,7 +579,7 @@ size_t HandshakeRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.HandshakeRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -590,7 +592,7 @@ size_t HandshakeRequest::ByteSizeLong() const { // sint32 auth_protocol = 1; if (this->_internal_auth_protocol() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt32SizePlusOne(this->_internal_auth_protocol()); + total_size += ::_pbi::WireFormatLite::SInt32SizePlusOne(this->_internal_auth_protocol()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -612,7 +614,7 @@ void HandshakeRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void HandshakeRequest::MergeFrom(const HandshakeRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.HandshakeRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_payload().empty()) { @@ -641,7 +643,6 @@ void HandshakeRequest::InternalSwap(HandshakeRequest* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &payload_, lhs_arena, &other->payload_, rhs_arena ); @@ -649,7 +650,7 @@ void HandshakeRequest::InternalSwap(HandshakeRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata HandshakeRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[0]); } @@ -664,22 +665,25 @@ HandshakeResponse::HandshakeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.HandshakeResponse) } HandshakeResponse::HandshakeResponse(const HandshakeResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - metadata_header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + metadata_header_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + metadata_header_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_metadata_header().empty()) { - metadata_header_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_metadata_header(), + metadata_header_.Set(from._internal_metadata_header(), GetArenaForAllocation()); } - session_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + session_token_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + session_token_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_session_token().empty()) { - session_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_session_token(), + session_token_.Set(from._internal_session_token(), GetArenaForAllocation()); } ::memcpy(&token_deadline_time_millis_, &from.token_deadline_time_millis_, @@ -688,9 +692,15 @@ HandshakeResponse::HandshakeResponse(const HandshakeResponse& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.HandshakeResponse) } -void HandshakeResponse::SharedCtor() { -metadata_header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -session_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void HandshakeResponse::SharedCtor() { +metadata_header_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + metadata_header_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +session_token_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + session_token_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&token_deadline_time_millis_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&token_expiration_delay_millis_) - @@ -699,30 +709,26 @@ ::memset(reinterpret_cast(this) + static_cast( HandshakeResponse::~HandshakeResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.HandshakeResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void HandshakeResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - metadata_header_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - session_token_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + metadata_header_.Destroy(); + session_token_.Destroy(); } -void HandshakeResponse::ArenaDtor(void* object) { - HandshakeResponse* _this = reinterpret_cast< HandshakeResponse* >(object); - (void)_this; -} -void HandshakeResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void HandshakeResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void HandshakeResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.HandshakeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -734,33 +740,33 @@ void HandshakeResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* HandshakeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* HandshakeResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // bytes metadata_header = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_metadata_header(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; // bytes session_token = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_session_token(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; // sint64 token_deadline_time_millis = 3 [jstype = JS_STRING]; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { token_deadline_time_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -768,7 +774,7 @@ const char* HandshakeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // sint64 token_expiration_delay_millis = 4 [jstype = JS_STRING]; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { token_expiration_delay_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -797,10 +803,10 @@ const char* HandshakeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* HandshakeResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* HandshakeResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.HandshakeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // bytes metadata_header = 1; @@ -818,17 +824,17 @@ ::PROTOBUF_NAMESPACE_ID::uint8* HandshakeResponse::_InternalSerialize( // sint64 token_deadline_time_millis = 3 [jstype = JS_STRING]; if (this->_internal_token_deadline_time_millis() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(3, this->_internal_token_deadline_time_millis(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(3, this->_internal_token_deadline_time_millis(), target); } // sint64 token_expiration_delay_millis = 4 [jstype = JS_STRING]; if (this->_internal_token_expiration_delay_millis() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(4, this->_internal_token_expiration_delay_millis(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(4, this->_internal_token_expiration_delay_millis(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.HandshakeResponse) @@ -839,7 +845,7 @@ size_t HandshakeResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.HandshakeResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -859,12 +865,12 @@ size_t HandshakeResponse::ByteSizeLong() const { // sint64 token_deadline_time_millis = 3 [jstype = JS_STRING]; if (this->_internal_token_deadline_time_millis() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_token_deadline_time_millis()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_token_deadline_time_millis()); } // sint64 token_expiration_delay_millis = 4 [jstype = JS_STRING]; if (this->_internal_token_expiration_delay_millis() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_token_expiration_delay_millis()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_token_expiration_delay_millis()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -886,7 +892,7 @@ void HandshakeResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void HandshakeResponse::MergeFrom(const HandshakeResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.HandshakeResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_metadata_header().empty()) { @@ -921,12 +927,10 @@ void HandshakeResponse::InternalSwap(HandshakeResponse* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &metadata_header_, lhs_arena, &other->metadata_header_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &session_token_, lhs_arena, &other->session_token_, rhs_arena ); @@ -939,7 +943,7 @@ void HandshakeResponse::InternalSwap(HandshakeResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata HandshakeResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[1]); } @@ -978,7 +982,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CloseSessionResponse::GetClass ::PROTOBUF_NAMESPACE_ID::Metadata CloseSessionResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[2]); } @@ -1004,9 +1008,6 @@ ReleaseRequest::ReleaseRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ReleaseRequest) } ReleaseRequest::ReleaseRequest(const ReleaseRequest& from) @@ -1020,15 +1021,17 @@ ReleaseRequest::ReleaseRequest(const ReleaseRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ReleaseRequest) } -void ReleaseRequest::SharedCtor() { +inline void ReleaseRequest::SharedCtor() { id_ = nullptr; } ReleaseRequest::~ReleaseRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ReleaseRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ReleaseRequest::SharedDtor() { @@ -1036,19 +1039,13 @@ inline void ReleaseRequest::SharedDtor() { if (this != internal_default_instance()) delete id_; } -void ReleaseRequest::ArenaDtor(void* object) { - ReleaseRequest* _this = reinterpret_cast< ReleaseRequest* >(object); - (void)_this; -} -void ReleaseRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ReleaseRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ReleaseRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ReleaseRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1059,15 +1056,15 @@ void ReleaseRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ReleaseRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ReleaseRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_id(), ptr); CHK_(ptr); } else @@ -1096,22 +1093,21 @@ const char* ReleaseRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ReleaseRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ReleaseRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ReleaseRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket id = 1; if (this->_internal_has_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::id(this), target, stream); + InternalWriteMessage(1, _Internal::id(this), + _Internal::id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ReleaseRequest) @@ -1122,7 +1118,7 @@ size_t ReleaseRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ReleaseRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1152,7 +1148,7 @@ void ReleaseRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ReleaseRequest::MergeFrom(const ReleaseRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ReleaseRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_id()) { @@ -1179,7 +1175,7 @@ void ReleaseRequest::InternalSwap(ReleaseRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ReleaseRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[3]); } @@ -1218,7 +1214,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReleaseResponse::GetClassData( ::PROTOBUF_NAMESPACE_ID::Metadata ReleaseResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[4]); } @@ -1255,9 +1251,6 @@ ExportRequest::ExportRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ExportRequest) } ExportRequest::ExportRequest(const ExportRequest& from) @@ -1276,7 +1269,7 @@ ExportRequest::ExportRequest(const ExportRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ExportRequest) } -void ExportRequest::SharedCtor() { +inline void ExportRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&source_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&result_id_) - @@ -1285,9 +1278,11 @@ ::memset(reinterpret_cast(this) + static_cast( ExportRequest::~ExportRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ExportRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExportRequest::SharedDtor() { @@ -1296,19 +1291,13 @@ inline void ExportRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void ExportRequest::ArenaDtor(void* object) { - ExportRequest* _this = reinterpret_cast< ExportRequest* >(object); - (void)_this; -} -void ExportRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExportRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExportRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ExportRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1323,15 +1312,15 @@ void ExportRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExportRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExportRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket source_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -1339,7 +1328,7 @@ const char* ExportRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ continue; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -1368,30 +1357,28 @@ const char* ExportRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExportRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExportRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ExportRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket source_id = 1; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); + InternalWriteMessage(1, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::result_id(this), target, stream); + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ExportRequest) @@ -1402,7 +1389,7 @@ size_t ExportRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ExportRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1439,7 +1426,7 @@ void ExportRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExportRequest::MergeFrom(const ExportRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ExportRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_source_id()) { @@ -1474,7 +1461,7 @@ void ExportRequest::InternalSwap(ExportRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExportRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[5]); } @@ -1513,7 +1500,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ExportResponse::GetClassData() ::PROTOBUF_NAMESPACE_ID::Metadata ExportResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[6]); } @@ -1552,7 +1539,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ExportNotificationRequest::Get ::PROTOBUF_NAMESPACE_ID::Metadata ExportNotificationRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[7]); } @@ -1578,22 +1565,25 @@ ExportNotification::ExportNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ExportNotification) } ExportNotification::ExportNotification(const ExportNotification& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - context_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + context_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + context_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_context().empty()) { - context_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_context(), + context_.Set(from._internal_context(), GetArenaForAllocation()); } - dependent_handle_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + dependent_handle_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + dependent_handle_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_dependent_handle().empty()) { - dependent_handle_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_dependent_handle(), + dependent_handle_.Set(from._internal_dependent_handle(), GetArenaForAllocation()); } if (from._internal_has_ticket()) { @@ -1605,9 +1595,15 @@ ExportNotification::ExportNotification(const ExportNotification& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ExportNotification) } -void ExportNotification::SharedCtor() { -context_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -dependent_handle_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ExportNotification::SharedCtor() { +context_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + context_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +dependent_handle_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + dependent_handle_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&ticket_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&export_state_) - @@ -1616,31 +1612,27 @@ ::memset(reinterpret_cast(this) + static_cast( ExportNotification::~ExportNotification() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ExportNotification) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExportNotification::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - context_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dependent_handle_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + context_.Destroy(); + dependent_handle_.Destroy(); if (this != internal_default_instance()) delete ticket_; } -void ExportNotification::ArenaDtor(void* object) { - ExportNotification* _this = reinterpret_cast< ExportNotification* >(object); - (void)_this; -} -void ExportNotification::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExportNotification::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExportNotification::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ExportNotification) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1654,15 +1646,15 @@ void ExportNotification::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExportNotification::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExportNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_ticket(), ptr); CHK_(ptr); } else @@ -1670,8 +1662,8 @@ const char* ExportNotification::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // .io.deephaven.proto.backplane.grpc.ExportNotification.State export_state = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_export_state(static_cast<::io::deephaven::proto::backplane::grpc::ExportNotification_State>(val)); } else @@ -1679,21 +1671,21 @@ const char* ExportNotification::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // string context = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_context(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportNotification.context")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportNotification.context")); } else goto handle_unusual; continue; // string dependent_handle = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { auto str = _internal_mutable_dependent_handle(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle")); } else goto handle_unusual; continue; @@ -1720,24 +1712,23 @@ const char* ExportNotification::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExportNotification::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExportNotification::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ExportNotification) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; if (this->_internal_has_ticket()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::ticket(this), target, stream); + InternalWriteMessage(1, _Internal::ticket(this), + _Internal::ticket(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.ExportNotification.State export_state = 2; if (this->_internal_export_state() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 2, this->_internal_export_state(), target); } @@ -1762,7 +1753,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExportNotification::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ExportNotification) @@ -1773,7 +1764,7 @@ size_t ExportNotification::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ExportNotification) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1801,7 +1792,7 @@ size_t ExportNotification::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.ExportNotification.State export_state = 2; if (this->_internal_export_state() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_export_state()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_export_state()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -1823,7 +1814,7 @@ void ExportNotification::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExportNotification::MergeFrom(const ExportNotification& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ExportNotification) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_context().empty()) { @@ -1858,12 +1849,10 @@ void ExportNotification::InternalSwap(ExportNotification* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &context_, lhs_arena, &other->context_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &dependent_handle_, lhs_arena, &other->dependent_handle_, rhs_arena ); @@ -1876,7 +1865,7 @@ void ExportNotification::InternalSwap(ExportNotification* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExportNotification::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[8]); } @@ -1915,7 +1904,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TerminationNotificationRequest ::PROTOBUF_NAMESPACE_ID::Metadata TerminationNotificationRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[9]); } @@ -1931,59 +1920,64 @@ TerminationNotificationResponse_StackTrace::TerminationNotificationResponse_Stac : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), elements_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) } TerminationNotificationResponse_StackTrace::TerminationNotificationResponse_StackTrace(const TerminationNotificationResponse_StackTrace& from) : ::PROTOBUF_NAMESPACE_ID::Message(), elements_(from.elements_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_type().empty()) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(), + type_.Set(from._internal_type(), GetArenaForAllocation()); } - message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + message_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + message_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_message().empty()) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_message(), + message_.Set(from._internal_message(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) } -void TerminationNotificationResponse_StackTrace::SharedCtor() { -type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void TerminationNotificationResponse_StackTrace::SharedCtor() { +type_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +message_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + message_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } TerminationNotificationResponse_StackTrace::~TerminationNotificationResponse_StackTrace() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TerminationNotificationResponse_StackTrace::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.Destroy(); + message_.Destroy(); } -void TerminationNotificationResponse_StackTrace::ArenaDtor(void* object) { - TerminationNotificationResponse_StackTrace* _this = reinterpret_cast< TerminationNotificationResponse_StackTrace* >(object); - (void)_this; -} -void TerminationNotificationResponse_StackTrace::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TerminationNotificationResponse_StackTrace::SetCachedSize(int size) const { _cached_size_.Set(size); } void TerminationNotificationResponse_StackTrace::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1993,42 +1987,42 @@ void TerminationNotificationResponse_StackTrace::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TerminationNotificationResponse_StackTrace::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TerminationNotificationResponse_StackTrace::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type")); } else goto handle_unusual; continue; // string message = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_message(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message")); } else goto handle_unusual; continue; // repeated string elements = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_elements(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.elements")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.elements")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -2057,10 +2051,10 @@ const char* TerminationNotificationResponse_StackTrace::_InternalParse(const cha #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TerminationNotificationResponse_StackTrace::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TerminationNotificationResponse_StackTrace::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string type = 1; @@ -2094,7 +2088,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TerminationNotificationResponse_StackTrace::_Int } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) @@ -2105,7 +2099,7 @@ size_t TerminationNotificationResponse_StackTrace::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2150,7 +2144,7 @@ void TerminationNotificationResponse_StackTrace::MergeImpl(::PROTOBUF_NAMESPACE_ void TerminationNotificationResponse_StackTrace::MergeFrom(const TerminationNotificationResponse_StackTrace& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; elements_.MergeFrom(from.elements_); @@ -2181,19 +2175,17 @@ void TerminationNotificationResponse_StackTrace::InternalSwap(TerminationNotific _internal_metadata_.InternalSwap(&other->_internal_metadata_); elements_.InternalSwap(&other->elements_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &type_, lhs_arena, &other->type_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &message_, lhs_arena, &other->message_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata TerminationNotificationResponse_StackTrace::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[10]); } @@ -2209,18 +2201,18 @@ TerminationNotificationResponse::TerminationNotificationResponse(::PROTOBUF_NAME : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), stack_traces_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) } TerminationNotificationResponse::TerminationNotificationResponse(const TerminationNotificationResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message(), stack_traces_(from.stack_traces_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + reason_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + reason_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_reason().empty()) { - reason_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_reason(), + reason_.Set(from._internal_reason(), GetArenaForAllocation()); } ::memcpy(&abnormal_termination_, &from.abnormal_termination_, @@ -2229,8 +2221,11 @@ TerminationNotificationResponse::TerminationNotificationResponse(const Terminati // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) } -void TerminationNotificationResponse::SharedCtor() { -reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void TerminationNotificationResponse::SharedCtor() { +reason_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + reason_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&abnormal_termination_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&is_from_uncaught_exception_) - @@ -2239,29 +2234,25 @@ ::memset(reinterpret_cast(this) + static_cast( TerminationNotificationResponse::~TerminationNotificationResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TerminationNotificationResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - reason_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + reason_.Destroy(); } -void TerminationNotificationResponse::ArenaDtor(void* object) { - TerminationNotificationResponse* _this = reinterpret_cast< TerminationNotificationResponse* >(object); - (void)_this; -} -void TerminationNotificationResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TerminationNotificationResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void TerminationNotificationResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2273,15 +2264,15 @@ void TerminationNotificationResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TerminationNotificationResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TerminationNotificationResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // bool abnormal_termination = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { abnormal_termination_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2289,17 +2280,17 @@ const char* TerminationNotificationResponse::_InternalParse(const char* ptr, ::P continue; // string reason = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_reason(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason")); } else goto handle_unusual; continue; // bool is_from_uncaught_exception = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { is_from_uncaught_exception_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2307,7 +2298,7 @@ const char* TerminationNotificationResponse::_InternalParse(const char* ptr, ::P continue; // repeated .io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace stack_traces = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; @@ -2341,16 +2332,16 @@ const char* TerminationNotificationResponse::_InternalParse(const char* ptr, ::P #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TerminationNotificationResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TerminationNotificationResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // bool abnormal_termination = 1; if (this->_internal_abnormal_termination() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_abnormal_termination(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_abnormal_termination(), target); } // string reason = 2; @@ -2366,19 +2357,19 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TerminationNotificationResponse::_InternalSerial // bool is_from_uncaught_exception = 3; if (this->_internal_is_from_uncaught_exception() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_is_from_uncaught_exception(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_is_from_uncaught_exception(), target); } // repeated .io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace stack_traces = 4; - for (unsigned int i = 0, - n = static_cast(this->_internal_stack_traces_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_stack_traces_size()); i < n; i++) { + const auto& repfield = this->_internal_stack_traces(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, this->_internal_stack_traces(i), target, stream); + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) @@ -2389,7 +2380,7 @@ size_t TerminationNotificationResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2436,7 +2427,7 @@ void TerminationNotificationResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message void TerminationNotificationResponse::MergeFrom(const TerminationNotificationResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; stack_traces_.MergeFrom(from.stack_traces_); @@ -2470,7 +2461,6 @@ void TerminationNotificationResponse::InternalSwap(TerminationNotificationRespon _internal_metadata_.InternalSwap(&other->_internal_metadata_); stack_traces_.InternalSwap(&other->stack_traces_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &reason_, lhs_arena, &other->reason_, rhs_arena ); @@ -2483,7 +2473,7 @@ void TerminationNotificationResponse::InternalSwap(TerminationNotificationRespon } ::PROTOBUF_NAMESPACE_ID::Metadata TerminationNotificationResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fsession_2eproto_getter, &descriptor_table_deephaven_2fproto_2fsession_2eproto_once, file_level_metadata_deephaven_2fproto_2fsession_2eproto[11]); } @@ -2495,40 +2485,52 @@ ::PROTOBUF_NAMESPACE_ID::Metadata TerminationNotificationResponse::GetMetadata() } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HandshakeRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HandshakeRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HandshakeRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HandshakeRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::HandshakeRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HandshakeResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HandshakeResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HandshakeResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HandshakeResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::HandshakeResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CloseSessionResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CloseSessionResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CloseSessionResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CloseSessionResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ReleaseRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ReleaseRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ReleaseRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ReleaseRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ReleaseRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ReleaseResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ReleaseResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ReleaseResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ReleaseResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ReleaseResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportNotificationRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportNotification* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportNotification >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportNotification* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportNotification >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportNotification >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TerminationNotificationRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse_StackTrace* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse_StackTrace >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse_StackTrace* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse_StackTrace >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse_StackTrace >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TerminationNotificationResponse >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.h index f9a3abb43a4..3c3acdf3eaa 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/session.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/session.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -27,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -48,15 +44,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2fsession_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[12] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fsession_2eproto; namespace io { @@ -139,8 +127,8 @@ enum ExportNotification_State : int { ExportNotification_State_DEPENDENCY_NEVER_FOUND = 10, ExportNotification_State_DEPENDENCY_CANCELLED = 11, ExportNotification_State_DEPENDENCY_RELEASED = 12, - ExportNotification_State_ExportNotification_State_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - ExportNotification_State_ExportNotification_State_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + ExportNotification_State_ExportNotification_State_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + ExportNotification_State_ExportNotification_State_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool ExportNotification_State_IsValid(int value); constexpr ExportNotification_State ExportNotification_State_State_MIN = ExportNotification_State_UNKNOWN; @@ -168,7 +156,7 @@ class HandshakeRequest final : public: inline HandshakeRequest() : HandshakeRequest(nullptr) {} ~HandshakeRequest() override; - explicit constexpr HandshakeRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR HandshakeRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); HandshakeRequest(const HandshakeRequest& from); HandshakeRequest(HandshakeRequest&& from) noexcept @@ -218,7 +206,12 @@ class HandshakeRequest final : } inline void Swap(HandshakeRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -232,11 +225,7 @@ class HandshakeRequest final : // implements Message ---------------------------------------------- - inline HandshakeRequest* New() const final { - return new HandshakeRequest(); - } - - HandshakeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + HandshakeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -251,8 +240,8 @@ class HandshakeRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -260,6 +249,8 @@ class HandshakeRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(HandshakeRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.HandshakeRequest"; @@ -267,9 +258,6 @@ class HandshakeRequest final : protected: explicit HandshakeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -291,7 +279,7 @@ class HandshakeRequest final : template void set_payload(ArgT0&& arg0, ArgT... args); std::string* mutable_payload(); - PROTOBUF_MUST_USE_RESULT std::string* release_payload(); + PROTOBUF_NODISCARD std::string* release_payload(); void set_allocated_payload(std::string* payload); private: const std::string& _internal_payload() const; @@ -301,11 +289,11 @@ class HandshakeRequest final : // sint32 auth_protocol = 1; void clear_auth_protocol(); - ::PROTOBUF_NAMESPACE_ID::int32 auth_protocol() const; - void set_auth_protocol(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t auth_protocol() const; + void set_auth_protocol(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_auth_protocol() const; - void _internal_set_auth_protocol(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_auth_protocol() const; + void _internal_set_auth_protocol(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HandshakeRequest) @@ -316,7 +304,7 @@ class HandshakeRequest final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr payload_; - ::PROTOBUF_NAMESPACE_ID::int32 auth_protocol_; + int32_t auth_protocol_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; @@ -327,7 +315,7 @@ class HandshakeResponse final : public: inline HandshakeResponse() : HandshakeResponse(nullptr) {} ~HandshakeResponse() override; - explicit constexpr HandshakeResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR HandshakeResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); HandshakeResponse(const HandshakeResponse& from); HandshakeResponse(HandshakeResponse&& from) noexcept @@ -377,7 +365,12 @@ class HandshakeResponse final : } inline void Swap(HandshakeResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -391,11 +384,7 @@ class HandshakeResponse final : // implements Message ---------------------------------------------- - inline HandshakeResponse* New() const final { - return new HandshakeResponse(); - } - - HandshakeResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + HandshakeResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -410,8 +399,8 @@ class HandshakeResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -419,6 +408,8 @@ class HandshakeResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(HandshakeResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.HandshakeResponse"; @@ -426,9 +417,6 @@ class HandshakeResponse final : protected: explicit HandshakeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -452,7 +440,7 @@ class HandshakeResponse final : template void set_metadata_header(ArgT0&& arg0, ArgT... args); std::string* mutable_metadata_header(); - PROTOBUF_MUST_USE_RESULT std::string* release_metadata_header(); + PROTOBUF_NODISCARD std::string* release_metadata_header(); void set_allocated_metadata_header(std::string* metadata_header); private: const std::string& _internal_metadata_header() const; @@ -466,7 +454,7 @@ class HandshakeResponse final : template void set_session_token(ArgT0&& arg0, ArgT... args); std::string* mutable_session_token(); - PROTOBUF_MUST_USE_RESULT std::string* release_session_token(); + PROTOBUF_NODISCARD std::string* release_session_token(); void set_allocated_session_token(std::string* session_token); private: const std::string& _internal_session_token() const; @@ -476,20 +464,20 @@ class HandshakeResponse final : // sint64 token_deadline_time_millis = 3 [jstype = JS_STRING]; void clear_token_deadline_time_millis(); - ::PROTOBUF_NAMESPACE_ID::int64 token_deadline_time_millis() const; - void set_token_deadline_time_millis(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t token_deadline_time_millis() const; + void set_token_deadline_time_millis(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_token_deadline_time_millis() const; - void _internal_set_token_deadline_time_millis(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_token_deadline_time_millis() const; + void _internal_set_token_deadline_time_millis(int64_t value); public: // sint64 token_expiration_delay_millis = 4 [jstype = JS_STRING]; void clear_token_expiration_delay_millis(); - ::PROTOBUF_NAMESPACE_ID::int64 token_expiration_delay_millis() const; - void set_token_expiration_delay_millis(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t token_expiration_delay_millis() const; + void set_token_expiration_delay_millis(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_token_expiration_delay_millis() const; - void _internal_set_token_expiration_delay_millis(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_token_expiration_delay_millis() const; + void _internal_set_token_expiration_delay_millis(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HandshakeResponse) @@ -501,8 +489,8 @@ class HandshakeResponse final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr metadata_header_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr session_token_; - ::PROTOBUF_NAMESPACE_ID::int64 token_deadline_time_millis_; - ::PROTOBUF_NAMESPACE_ID::int64 token_expiration_delay_millis_; + int64_t token_deadline_time_millis_; + int64_t token_expiration_delay_millis_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; @@ -512,7 +500,7 @@ class CloseSessionResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.CloseSessionResponse) */ { public: inline CloseSessionResponse() : CloseSessionResponse(nullptr) {} - explicit constexpr CloseSessionResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CloseSessionResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CloseSessionResponse(const CloseSessionResponse& from); CloseSessionResponse(CloseSessionResponse&& from) noexcept @@ -562,7 +550,12 @@ class CloseSessionResponse final : } inline void Swap(CloseSessionResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -576,11 +569,7 @@ class CloseSessionResponse final : // implements Message ---------------------------------------------- - inline CloseSessionResponse* New() const final { - return new CloseSessionResponse(); - } - - CloseSessionResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CloseSessionResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -592,6 +581,8 @@ class CloseSessionResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CloseSessionResponse"; @@ -599,7 +590,6 @@ class CloseSessionResponse final : protected: explicit CloseSessionResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -618,7 +608,6 @@ class CloseSessionResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; // ------------------------------------------------------------------- @@ -628,7 +617,7 @@ class ReleaseRequest final : public: inline ReleaseRequest() : ReleaseRequest(nullptr) {} ~ReleaseRequest() override; - explicit constexpr ReleaseRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ReleaseRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ReleaseRequest(const ReleaseRequest& from); ReleaseRequest(ReleaseRequest&& from) noexcept @@ -678,7 +667,12 @@ class ReleaseRequest final : } inline void Swap(ReleaseRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -692,11 +686,7 @@ class ReleaseRequest final : // implements Message ---------------------------------------------- - inline ReleaseRequest* New() const final { - return new ReleaseRequest(); - } - - ReleaseRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ReleaseRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -711,8 +701,8 @@ class ReleaseRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -720,6 +710,8 @@ class ReleaseRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ReleaseRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ReleaseRequest"; @@ -727,9 +719,6 @@ class ReleaseRequest final : protected: explicit ReleaseRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -751,7 +740,7 @@ class ReleaseRequest final : public: void clear_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_id(); void set_allocated_id(::io::deephaven::proto::backplane::grpc::Ticket* id); private: @@ -779,7 +768,7 @@ class ReleaseResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.ReleaseResponse) */ { public: inline ReleaseResponse() : ReleaseResponse(nullptr) {} - explicit constexpr ReleaseResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ReleaseResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ReleaseResponse(const ReleaseResponse& from); ReleaseResponse(ReleaseResponse&& from) noexcept @@ -829,7 +818,12 @@ class ReleaseResponse final : } inline void Swap(ReleaseResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -843,11 +837,7 @@ class ReleaseResponse final : // implements Message ---------------------------------------------- - inline ReleaseResponse* New() const final { - return new ReleaseResponse(); - } - - ReleaseResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ReleaseResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -859,6 +849,8 @@ class ReleaseResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ReleaseResponse"; @@ -866,7 +858,6 @@ class ReleaseResponse final : protected: explicit ReleaseResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -885,7 +876,6 @@ class ReleaseResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; // ------------------------------------------------------------------- @@ -895,7 +885,7 @@ class ExportRequest final : public: inline ExportRequest() : ExportRequest(nullptr) {} ~ExportRequest() override; - explicit constexpr ExportRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportRequest(const ExportRequest& from); ExportRequest(ExportRequest&& from) noexcept @@ -945,7 +935,12 @@ class ExportRequest final : } inline void Swap(ExportRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -959,11 +954,7 @@ class ExportRequest final : // implements Message ---------------------------------------------- - inline ExportRequest* New() const final { - return new ExportRequest(); - } - - ExportRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -978,8 +969,8 @@ class ExportRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -987,6 +978,8 @@ class ExportRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExportRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportRequest"; @@ -994,9 +987,6 @@ class ExportRequest final : protected: explicit ExportRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1019,7 +1009,7 @@ class ExportRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_source_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::Ticket* source_id); private: @@ -1037,7 +1027,7 @@ class ExportRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -1066,7 +1056,7 @@ class ExportResponse final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.ExportResponse) */ { public: inline ExportResponse() : ExportResponse(nullptr) {} - explicit constexpr ExportResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportResponse(const ExportResponse& from); ExportResponse(ExportResponse&& from) noexcept @@ -1116,7 +1106,12 @@ class ExportResponse final : } inline void Swap(ExportResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1130,11 +1125,7 @@ class ExportResponse final : // implements Message ---------------------------------------------- - inline ExportResponse* New() const final { - return new ExportResponse(); - } - - ExportResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -1146,6 +1137,8 @@ class ExportResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportResponse"; @@ -1153,7 +1146,6 @@ class ExportResponse final : protected: explicit ExportResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -1172,7 +1164,6 @@ class ExportResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; // ------------------------------------------------------------------- @@ -1181,7 +1172,7 @@ class ExportNotificationRequest final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.ExportNotificationRequest) */ { public: inline ExportNotificationRequest() : ExportNotificationRequest(nullptr) {} - explicit constexpr ExportNotificationRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportNotificationRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportNotificationRequest(const ExportNotificationRequest& from); ExportNotificationRequest(ExportNotificationRequest&& from) noexcept @@ -1231,7 +1222,12 @@ class ExportNotificationRequest final : } inline void Swap(ExportNotificationRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1245,11 +1241,7 @@ class ExportNotificationRequest final : // implements Message ---------------------------------------------- - inline ExportNotificationRequest* New() const final { - return new ExportNotificationRequest(); - } - - ExportNotificationRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportNotificationRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -1261,6 +1253,8 @@ class ExportNotificationRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportNotificationRequest"; @@ -1268,7 +1262,6 @@ class ExportNotificationRequest final : protected: explicit ExportNotificationRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -1287,7 +1280,6 @@ class ExportNotificationRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; // ------------------------------------------------------------------- @@ -1297,7 +1289,7 @@ class ExportNotification final : public: inline ExportNotification() : ExportNotification(nullptr) {} ~ExportNotification() override; - explicit constexpr ExportNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportNotification(const ExportNotification& from); ExportNotification(ExportNotification&& from) noexcept @@ -1347,7 +1339,12 @@ class ExportNotification final : } inline void Swap(ExportNotification* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1361,11 +1358,7 @@ class ExportNotification final : // implements Message ---------------------------------------------- - inline ExportNotification* New() const final { - return new ExportNotification(); - } - - ExportNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1380,8 +1373,8 @@ class ExportNotification final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1389,6 +1382,8 @@ class ExportNotification final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExportNotification* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportNotification"; @@ -1396,9 +1391,6 @@ class ExportNotification final : protected: explicit ExportNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1474,7 +1466,7 @@ class ExportNotification final : template void set_context(ArgT0&& arg0, ArgT... args); std::string* mutable_context(); - PROTOBUF_MUST_USE_RESULT std::string* release_context(); + PROTOBUF_NODISCARD std::string* release_context(); void set_allocated_context(std::string* context); private: const std::string& _internal_context() const; @@ -1488,7 +1480,7 @@ class ExportNotification final : template void set_dependent_handle(ArgT0&& arg0, ArgT... args); std::string* mutable_dependent_handle(); - PROTOBUF_MUST_USE_RESULT std::string* release_dependent_handle(); + PROTOBUF_NODISCARD std::string* release_dependent_handle(); void set_allocated_dependent_handle(std::string* dependent_handle); private: const std::string& _internal_dependent_handle() const; @@ -1503,7 +1495,7 @@ class ExportNotification final : public: void clear_ticket(); const ::io::deephaven::proto::backplane::grpc::Ticket& ticket() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_ticket(); void set_allocated_ticket(::io::deephaven::proto::backplane::grpc::Ticket* ticket); private: @@ -1543,7 +1535,7 @@ class TerminationNotificationRequest final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.TerminationNotificationRequest) */ { public: inline TerminationNotificationRequest() : TerminationNotificationRequest(nullptr) {} - explicit constexpr TerminationNotificationRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TerminationNotificationRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TerminationNotificationRequest(const TerminationNotificationRequest& from); TerminationNotificationRequest(TerminationNotificationRequest&& from) noexcept @@ -1593,7 +1585,12 @@ class TerminationNotificationRequest final : } inline void Swap(TerminationNotificationRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1607,11 +1604,7 @@ class TerminationNotificationRequest final : // implements Message ---------------------------------------------- - inline TerminationNotificationRequest* New() const final { - return new TerminationNotificationRequest(); - } - - TerminationNotificationRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TerminationNotificationRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -1623,6 +1616,8 @@ class TerminationNotificationRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TerminationNotificationRequest"; @@ -1630,7 +1625,6 @@ class TerminationNotificationRequest final : protected: explicit TerminationNotificationRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -1649,7 +1643,6 @@ class TerminationNotificationRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2fsession_2eproto; }; // ------------------------------------------------------------------- @@ -1659,7 +1652,7 @@ class TerminationNotificationResponse_StackTrace final : public: inline TerminationNotificationResponse_StackTrace() : TerminationNotificationResponse_StackTrace(nullptr) {} ~TerminationNotificationResponse_StackTrace() override; - explicit constexpr TerminationNotificationResponse_StackTrace(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TerminationNotificationResponse_StackTrace(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TerminationNotificationResponse_StackTrace(const TerminationNotificationResponse_StackTrace& from); TerminationNotificationResponse_StackTrace(TerminationNotificationResponse_StackTrace&& from) noexcept @@ -1709,7 +1702,12 @@ class TerminationNotificationResponse_StackTrace final : } inline void Swap(TerminationNotificationResponse_StackTrace* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1723,11 +1721,7 @@ class TerminationNotificationResponse_StackTrace final : // implements Message ---------------------------------------------- - inline TerminationNotificationResponse_StackTrace* New() const final { - return new TerminationNotificationResponse_StackTrace(); - } - - TerminationNotificationResponse_StackTrace* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TerminationNotificationResponse_StackTrace* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1742,8 +1736,8 @@ class TerminationNotificationResponse_StackTrace final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1751,6 +1745,8 @@ class TerminationNotificationResponse_StackTrace final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TerminationNotificationResponse_StackTrace* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace"; @@ -1758,9 +1754,6 @@ class TerminationNotificationResponse_StackTrace final : protected: explicit TerminationNotificationResponse_StackTrace(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1807,7 +1800,7 @@ class TerminationNotificationResponse_StackTrace final : template void set_type(ArgT0&& arg0, ArgT... args); std::string* mutable_type(); - PROTOBUF_MUST_USE_RESULT std::string* release_type(); + PROTOBUF_NODISCARD std::string* release_type(); void set_allocated_type(std::string* type); private: const std::string& _internal_type() const; @@ -1821,7 +1814,7 @@ class TerminationNotificationResponse_StackTrace final : template void set_message(ArgT0&& arg0, ArgT... args); std::string* mutable_message(); - PROTOBUF_MUST_USE_RESULT std::string* release_message(); + PROTOBUF_NODISCARD std::string* release_message(); void set_allocated_message(std::string* message); private: const std::string& _internal_message() const; @@ -1849,7 +1842,7 @@ class TerminationNotificationResponse final : public: inline TerminationNotificationResponse() : TerminationNotificationResponse(nullptr) {} ~TerminationNotificationResponse() override; - explicit constexpr TerminationNotificationResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TerminationNotificationResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TerminationNotificationResponse(const TerminationNotificationResponse& from); TerminationNotificationResponse(TerminationNotificationResponse&& from) noexcept @@ -1899,7 +1892,12 @@ class TerminationNotificationResponse final : } inline void Swap(TerminationNotificationResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1913,11 +1911,7 @@ class TerminationNotificationResponse final : // implements Message ---------------------------------------------- - inline TerminationNotificationResponse* New() const final { - return new TerminationNotificationResponse(); - } - - TerminationNotificationResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TerminationNotificationResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1932,8 +1926,8 @@ class TerminationNotificationResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1941,6 +1935,8 @@ class TerminationNotificationResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TerminationNotificationResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TerminationNotificationResponse"; @@ -1948,9 +1944,6 @@ class TerminationNotificationResponse final : protected: explicit TerminationNotificationResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1994,7 +1987,7 @@ class TerminationNotificationResponse final : template void set_reason(ArgT0&& arg0, ArgT... args); std::string* mutable_reason(); - PROTOBUF_MUST_USE_RESULT std::string* release_reason(); + PROTOBUF_NODISCARD std::string* release_reason(); void set_allocated_reason(std::string* reason); private: const std::string& _internal_reason() const; @@ -2049,18 +2042,18 @@ class TerminationNotificationResponse final : inline void HandshakeRequest::clear_auth_protocol() { auth_protocol_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 HandshakeRequest::_internal_auth_protocol() const { +inline int32_t HandshakeRequest::_internal_auth_protocol() const { return auth_protocol_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 HandshakeRequest::auth_protocol() const { +inline int32_t HandshakeRequest::auth_protocol() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.HandshakeRequest.auth_protocol) return _internal_auth_protocol(); } -inline void HandshakeRequest::_internal_set_auth_protocol(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void HandshakeRequest::_internal_set_auth_protocol(int32_t value) { auth_protocol_ = value; } -inline void HandshakeRequest::set_auth_protocol(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void HandshakeRequest::set_auth_protocol(int32_t value) { _internal_set_auth_protocol(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeRequest.auth_protocol) } @@ -2077,7 +2070,7 @@ template inline PROTOBUF_ALWAYS_INLINE void HandshakeRequest::set_payload(ArgT0&& arg0, ArgT... args) { - payload_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + payload_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeRequest.payload) } inline std::string* HandshakeRequest::mutable_payload() { @@ -2090,15 +2083,15 @@ inline const std::string& HandshakeRequest::_internal_payload() const { } inline void HandshakeRequest::_internal_set_payload(const std::string& value) { - payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + payload_.Set(value, GetArenaForAllocation()); } inline std::string* HandshakeRequest::_internal_mutable_payload() { - return payload_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return payload_.Mutable(GetArenaForAllocation()); } inline std::string* HandshakeRequest::release_payload() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.HandshakeRequest.payload) - return payload_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return payload_.Release(); } inline void HandshakeRequest::set_allocated_payload(std::string* payload) { if (payload != nullptr) { @@ -2106,8 +2099,12 @@ inline void HandshakeRequest::set_allocated_payload(std::string* payload) { } else { } - payload_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), payload, - GetArenaForAllocation()); + payload_.SetAllocated(payload, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (payload_.IsDefault()) { + payload_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.HandshakeRequest.payload) } @@ -2127,7 +2124,7 @@ template inline PROTOBUF_ALWAYS_INLINE void HandshakeResponse::set_metadata_header(ArgT0&& arg0, ArgT... args) { - metadata_header_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + metadata_header_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeResponse.metadata_header) } inline std::string* HandshakeResponse::mutable_metadata_header() { @@ -2140,15 +2137,15 @@ inline const std::string& HandshakeResponse::_internal_metadata_header() const { } inline void HandshakeResponse::_internal_set_metadata_header(const std::string& value) { - metadata_header_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + metadata_header_.Set(value, GetArenaForAllocation()); } inline std::string* HandshakeResponse::_internal_mutable_metadata_header() { - return metadata_header_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return metadata_header_.Mutable(GetArenaForAllocation()); } inline std::string* HandshakeResponse::release_metadata_header() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.HandshakeResponse.metadata_header) - return metadata_header_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return metadata_header_.Release(); } inline void HandshakeResponse::set_allocated_metadata_header(std::string* metadata_header) { if (metadata_header != nullptr) { @@ -2156,8 +2153,12 @@ inline void HandshakeResponse::set_allocated_metadata_header(std::string* metada } else { } - metadata_header_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), metadata_header, - GetArenaForAllocation()); + metadata_header_.SetAllocated(metadata_header, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (metadata_header_.IsDefault()) { + metadata_header_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.HandshakeResponse.metadata_header) } @@ -2173,7 +2174,7 @@ template inline PROTOBUF_ALWAYS_INLINE void HandshakeResponse::set_session_token(ArgT0&& arg0, ArgT... args) { - session_token_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + session_token_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeResponse.session_token) } inline std::string* HandshakeResponse::mutable_session_token() { @@ -2186,15 +2187,15 @@ inline const std::string& HandshakeResponse::_internal_session_token() const { } inline void HandshakeResponse::_internal_set_session_token(const std::string& value) { - session_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + session_token_.Set(value, GetArenaForAllocation()); } inline std::string* HandshakeResponse::_internal_mutable_session_token() { - return session_token_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return session_token_.Mutable(GetArenaForAllocation()); } inline std::string* HandshakeResponse::release_session_token() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.HandshakeResponse.session_token) - return session_token_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return session_token_.Release(); } inline void HandshakeResponse::set_allocated_session_token(std::string* session_token) { if (session_token != nullptr) { @@ -2202,8 +2203,12 @@ inline void HandshakeResponse::set_allocated_session_token(std::string* session_ } else { } - session_token_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), session_token, - GetArenaForAllocation()); + session_token_.SetAllocated(session_token, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (session_token_.IsDefault()) { + session_token_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.HandshakeResponse.session_token) } @@ -2211,18 +2216,18 @@ inline void HandshakeResponse::set_allocated_session_token(std::string* session_ inline void HandshakeResponse::clear_token_deadline_time_millis() { token_deadline_time_millis_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HandshakeResponse::_internal_token_deadline_time_millis() const { +inline int64_t HandshakeResponse::_internal_token_deadline_time_millis() const { return token_deadline_time_millis_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HandshakeResponse::token_deadline_time_millis() const { +inline int64_t HandshakeResponse::token_deadline_time_millis() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.HandshakeResponse.token_deadline_time_millis) return _internal_token_deadline_time_millis(); } -inline void HandshakeResponse::_internal_set_token_deadline_time_millis(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HandshakeResponse::_internal_set_token_deadline_time_millis(int64_t value) { token_deadline_time_millis_ = value; } -inline void HandshakeResponse::set_token_deadline_time_millis(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HandshakeResponse::set_token_deadline_time_millis(int64_t value) { _internal_set_token_deadline_time_millis(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeResponse.token_deadline_time_millis) } @@ -2231,18 +2236,18 @@ inline void HandshakeResponse::set_token_deadline_time_millis(::PROTOBUF_NAMESPA inline void HandshakeResponse::clear_token_expiration_delay_millis() { token_expiration_delay_millis_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HandshakeResponse::_internal_token_expiration_delay_millis() const { +inline int64_t HandshakeResponse::_internal_token_expiration_delay_millis() const { return token_expiration_delay_millis_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HandshakeResponse::token_expiration_delay_millis() const { +inline int64_t HandshakeResponse::token_expiration_delay_millis() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.HandshakeResponse.token_expiration_delay_millis) return _internal_token_expiration_delay_millis(); } -inline void HandshakeResponse::_internal_set_token_expiration_delay_millis(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HandshakeResponse::_internal_set_token_expiration_delay_millis(int64_t value) { token_expiration_delay_millis_ = value; } -inline void HandshakeResponse::set_token_expiration_delay_millis(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HandshakeResponse::set_token_expiration_delay_millis(int64_t value) { _internal_set_token_expiration_delay_millis(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HandshakeResponse.token_expiration_delay_millis) } @@ -2326,8 +2331,7 @@ inline void ReleaseRequest::set_allocated_id(::io::deephaven::proto::backplane:: } if (id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(id)); if (message_arena != submessage_arena) { id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2420,8 +2424,7 @@ inline void ExportRequest::set_allocated_source_id(::io::deephaven::proto::backp } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_id)); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2506,8 +2509,7 @@ inline void ExportRequest::set_allocated_result_id(::io::deephaven::proto::backp } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2604,8 +2606,7 @@ inline void ExportNotification::set_allocated_ticket(::io::deephaven::proto::bac } if (ticket) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(ticket)); if (message_arena != submessage_arena) { ticket = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2651,7 +2652,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExportNotification::set_context(ArgT0&& arg0, ArgT... args) { - context_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + context_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportNotification.context) } inline std::string* ExportNotification::mutable_context() { @@ -2664,15 +2665,15 @@ inline const std::string& ExportNotification::_internal_context() const { } inline void ExportNotification::_internal_set_context(const std::string& value) { - context_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + context_.Set(value, GetArenaForAllocation()); } inline std::string* ExportNotification::_internal_mutable_context() { - return context_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return context_.Mutable(GetArenaForAllocation()); } inline std::string* ExportNotification::release_context() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ExportNotification.context) - return context_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return context_.Release(); } inline void ExportNotification::set_allocated_context(std::string* context) { if (context != nullptr) { @@ -2680,8 +2681,12 @@ inline void ExportNotification::set_allocated_context(std::string* context) { } else { } - context_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), context, - GetArenaForAllocation()); + context_.SetAllocated(context, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (context_.IsDefault()) { + context_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ExportNotification.context) } @@ -2697,7 +2702,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExportNotification::set_dependent_handle(ArgT0&& arg0, ArgT... args) { - dependent_handle_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + dependent_handle_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle) } inline std::string* ExportNotification::mutable_dependent_handle() { @@ -2710,15 +2715,15 @@ inline const std::string& ExportNotification::_internal_dependent_handle() const } inline void ExportNotification::_internal_set_dependent_handle(const std::string& value) { - dependent_handle_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + dependent_handle_.Set(value, GetArenaForAllocation()); } inline std::string* ExportNotification::_internal_mutable_dependent_handle() { - return dependent_handle_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return dependent_handle_.Mutable(GetArenaForAllocation()); } inline std::string* ExportNotification::release_dependent_handle() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle) - return dependent_handle_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return dependent_handle_.Release(); } inline void ExportNotification::set_allocated_dependent_handle(std::string* dependent_handle) { if (dependent_handle != nullptr) { @@ -2726,8 +2731,12 @@ inline void ExportNotification::set_allocated_dependent_handle(std::string* depe } else { } - dependent_handle_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dependent_handle, - GetArenaForAllocation()); + dependent_handle_.SetAllocated(dependent_handle, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (dependent_handle_.IsDefault()) { + dependent_handle_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ExportNotification.dependent_handle) } @@ -2751,7 +2760,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TerminationNotificationResponse_StackTrace::set_type(ArgT0&& arg0, ArgT... args) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type) } inline std::string* TerminationNotificationResponse_StackTrace::mutable_type() { @@ -2764,15 +2773,15 @@ inline const std::string& TerminationNotificationResponse_StackTrace::_internal_ } inline void TerminationNotificationResponse_StackTrace::_internal_set_type(const std::string& value) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + type_.Set(value, GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse_StackTrace::_internal_mutable_type() { - return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return type_.Mutable(GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse_StackTrace::release_type() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type) - return type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return type_.Release(); } inline void TerminationNotificationResponse_StackTrace::set_allocated_type(std::string* type) { if (type != nullptr) { @@ -2780,8 +2789,12 @@ inline void TerminationNotificationResponse_StackTrace::set_allocated_type(std:: } else { } - type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type, - GetArenaForAllocation()); + type_.SetAllocated(type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (type_.IsDefault()) { + type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.type) } @@ -2797,7 +2810,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TerminationNotificationResponse_StackTrace::set_message(ArgT0&& arg0, ArgT... args) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message) } inline std::string* TerminationNotificationResponse_StackTrace::mutable_message() { @@ -2810,15 +2823,15 @@ inline const std::string& TerminationNotificationResponse_StackTrace::_internal_ } inline void TerminationNotificationResponse_StackTrace::_internal_set_message(const std::string& value) { - message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + message_.Set(value, GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse_StackTrace::_internal_mutable_message() { - return message_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return message_.Mutable(GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse_StackTrace::release_message() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message) - return message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return message_.Release(); } inline void TerminationNotificationResponse_StackTrace::set_allocated_message(std::string* message) { if (message != nullptr) { @@ -2826,8 +2839,12 @@ inline void TerminationNotificationResponse_StackTrace::set_allocated_message(st } else { } - message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), message, - GetArenaForAllocation()); + message_.SetAllocated(message, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (message_.IsDefault()) { + message_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace.message) } @@ -2942,7 +2959,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TerminationNotificationResponse::set_reason(ArgT0&& arg0, ArgT... args) { - reason_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + reason_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason) } inline std::string* TerminationNotificationResponse::mutable_reason() { @@ -2955,15 +2972,15 @@ inline const std::string& TerminationNotificationResponse::_internal_reason() co } inline void TerminationNotificationResponse::_internal_set_reason(const std::string& value) { - reason_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + reason_.Set(value, GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse::_internal_mutable_reason() { - return reason_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return reason_.Mutable(GetArenaForAllocation()); } inline std::string* TerminationNotificationResponse::release_reason() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason) - return reason_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return reason_.Release(); } inline void TerminationNotificationResponse::set_allocated_reason(std::string* reason) { if (reason != nullptr) { @@ -2971,8 +2988,12 @@ inline void TerminationNotificationResponse::set_allocated_reason(std::string* r } else { } - reason_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), reason, - GetArenaForAllocation()); + reason_.SetAllocated(reason, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (reason_.IsDefault()) { + reason_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.reason) } diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.cc index e217996471a..9bad29f519b 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/table.proto @@ -32,7 +29,6 @@ static const char* TableService_method_names[] = { "/io.deephaven.proto.backplane.grpc.TableService/GetExportedTableCreationResponse", "/io.deephaven.proto.backplane.grpc.TableService/FetchTable", "/io.deephaven.proto.backplane.grpc.TableService/FetchPandasTable", - "/io.deephaven.proto.backplane.grpc.TableService/FetchTableMap", "/io.deephaven.proto.backplane.grpc.TableService/ApplyPreviewColumns", "/io.deephaven.proto.backplane.grpc.TableService/EmptyTable", "/io.deephaven.proto.backplane.grpc.TableService/TimeTable", @@ -76,49 +72,48 @@ TableService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& chann : channel_(channel), rpcmethod_GetExportedTableCreationResponse_(TableService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_FetchTable_(TableService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_FetchPandasTable_(TableService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_FetchTableMap_(TableService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ApplyPreviewColumns_(TableService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_EmptyTable_(TableService_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_TimeTable_(TableService_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DropColumns_(TableService_method_names[7], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Update_(TableService_method_names[8], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_LazyUpdate_(TableService_method_names[9], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_View_(TableService_method_names[10], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_UpdateView_(TableService_method_names[11], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Select_(TableService_method_names[12], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SelectDistinct_(TableService_method_names[13], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Filter_(TableService_method_names[14], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_UnstructuredFilter_(TableService_method_names[15], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Sort_(TableService_method_names[16], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Head_(TableService_method_names[17], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Tail_(TableService_method_names[18], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_HeadBy_(TableService_method_names[19], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_TailBy_(TableService_method_names[20], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Ungroup_(TableService_method_names[21], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_MergeTables_(TableService_method_names[22], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CrossJoinTables_(TableService_method_names[23], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_NaturalJoinTables_(TableService_method_names[24], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ExactJoinTables_(TableService_method_names[25], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_LeftJoinTables_(TableService_method_names[26], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_AsOfJoinTables_(TableService_method_names[27], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ComboAggregate_(TableService_method_names[28], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Snapshot_(TableService_method_names[29], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Flatten_(TableService_method_names[30], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RunChartDownsample_(TableService_method_names[31], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CreateInputTable_(TableService_method_names[32], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Batch_(TableService_method_names[33], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_ExportedTableUpdates_(TableService_method_names[34], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_ApplyPreviewColumns_(TableService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_EmptyTable_(TableService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_TimeTable_(TableService_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_DropColumns_(TableService_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Update_(TableService_method_names[7], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_LazyUpdate_(TableService_method_names[8], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_View_(TableService_method_names[9], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_UpdateView_(TableService_method_names[10], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Select_(TableService_method_names[11], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SelectDistinct_(TableService_method_names[12], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Filter_(TableService_method_names[13], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_UnstructuredFilter_(TableService_method_names[14], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Sort_(TableService_method_names[15], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Head_(TableService_method_names[16], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Tail_(TableService_method_names[17], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_HeadBy_(TableService_method_names[18], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_TailBy_(TableService_method_names[19], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Ungroup_(TableService_method_names[20], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_MergeTables_(TableService_method_names[21], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_CrossJoinTables_(TableService_method_names[22], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_NaturalJoinTables_(TableService_method_names[23], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_ExactJoinTables_(TableService_method_names[24], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_LeftJoinTables_(TableService_method_names[25], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_AsOfJoinTables_(TableService_method_names[26], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_ComboAggregate_(TableService_method_names[27], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Snapshot_(TableService_method_names[28], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Flatten_(TableService_method_names[29], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_RunChartDownsample_(TableService_method_names[30], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_CreateInputTable_(TableService_method_names[31], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Batch_(TableService_method_names[32], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_ExportedTableUpdates_(TableService_method_names[33], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) {} ::grpc::Status TableService::Stub::GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetExportedTableCreationResponse_, context, request, response); } -void TableService::Stub::experimental_async::GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetExportedTableCreationResponse_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetExportedTableCreationResponse_, context, request, response, reactor); } @@ -137,11 +132,11 @@ ::grpc::Status TableService::Stub::FetchTable(::grpc::ClientContext* context, co return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_FetchTable_, context, request, response); } -void TableService::Stub::experimental_async::FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchTable_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchTable_, context, request, response, reactor); } @@ -160,11 +155,11 @@ ::grpc::Status TableService::Stub::FetchPandasTable(::grpc::ClientContext* conte return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_FetchPandasTable_, context, request, response); } -void TableService::Stub::experimental_async::FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchPandasTable_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchPandasTable_, context, request, response, reactor); } @@ -179,38 +174,15 @@ ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::Expo return result; } -::grpc::Status TableService::Stub::FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_FetchTableMap_, context, request, response); -} - -void TableService::Stub::experimental_async::FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchTableMap_, context, request, response, std::move(f)); -} - -void TableService::Stub::experimental_async::FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_FetchTableMap_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* TableService::Stub::PrepareAsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse, ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_FetchTableMap_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* TableService::Stub::AsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncFetchTableMapRaw(context, request, cq); - result->StartCall(); - return result; -} - ::grpc::Status TableService::Stub::ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ApplyPreviewColumns_, context, request, response); } -void TableService::Stub::experimental_async::ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ApplyPreviewColumns_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ApplyPreviewColumns_, context, request, response, reactor); } @@ -229,11 +201,11 @@ ::grpc::Status TableService::Stub::EmptyTable(::grpc::ClientContext* context, co return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_EmptyTable_, context, request, response); } -void TableService::Stub::experimental_async::EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_EmptyTable_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_EmptyTable_, context, request, response, reactor); } @@ -252,11 +224,11 @@ ::grpc::Status TableService::Stub::TimeTable(::grpc::ClientContext* context, con return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_TimeTable_, context, request, response); } -void TableService::Stub::experimental_async::TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TimeTable_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TimeTable_, context, request, response, reactor); } @@ -275,11 +247,11 @@ ::grpc::Status TableService::Stub::DropColumns(::grpc::ClientContext* context, c return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_DropColumns_, context, request, response); } -void TableService::Stub::experimental_async::DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DropColumns_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DropColumns_, context, request, response, reactor); } @@ -298,11 +270,11 @@ ::grpc::Status TableService::Stub::Update(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Update_, context, request, response); } -void TableService::Stub::experimental_async::Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Update_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Update_, context, request, response, reactor); } @@ -321,11 +293,11 @@ ::grpc::Status TableService::Stub::LazyUpdate(::grpc::ClientContext* context, co return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_LazyUpdate_, context, request, response); } -void TableService::Stub::experimental_async::LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_LazyUpdate_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_LazyUpdate_, context, request, response, reactor); } @@ -344,11 +316,11 @@ ::grpc::Status TableService::Stub::View(::grpc::ClientContext* context, const :: return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_View_, context, request, response); } -void TableService::Stub::experimental_async::View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_View_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_View_, context, request, response, reactor); } @@ -367,11 +339,11 @@ ::grpc::Status TableService::Stub::UpdateView(::grpc::ClientContext* context, co return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_UpdateView_, context, request, response); } -void TableService::Stub::experimental_async::UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UpdateView_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UpdateView_, context, request, response, reactor); } @@ -390,11 +362,11 @@ ::grpc::Status TableService::Stub::Select(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Select_, context, request, response); } -void TableService::Stub::experimental_async::Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Select_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Select_, context, request, response, reactor); } @@ -413,11 +385,11 @@ ::grpc::Status TableService::Stub::SelectDistinct(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SelectDistinct_, context, request, response); } -void TableService::Stub::experimental_async::SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SelectDistinct_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SelectDistinct_, context, request, response, reactor); } @@ -436,11 +408,11 @@ ::grpc::Status TableService::Stub::Filter(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Filter_, context, request, response); } -void TableService::Stub::experimental_async::Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Filter_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Filter_, context, request, response, reactor); } @@ -459,11 +431,11 @@ ::grpc::Status TableService::Stub::UnstructuredFilter(::grpc::ClientContext* con return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_UnstructuredFilter_, context, request, response); } -void TableService::Stub::experimental_async::UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UnstructuredFilter_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_UnstructuredFilter_, context, request, response, reactor); } @@ -482,11 +454,11 @@ ::grpc::Status TableService::Stub::Sort(::grpc::ClientContext* context, const :: return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Sort_, context, request, response); } -void TableService::Stub::experimental_async::Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Sort_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Sort_, context, request, response, reactor); } @@ -505,11 +477,11 @@ ::grpc::Status TableService::Stub::Head(::grpc::ClientContext* context, const :: return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Head_, context, request, response); } -void TableService::Stub::experimental_async::Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Head_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Head_, context, request, response, reactor); } @@ -528,11 +500,11 @@ ::grpc::Status TableService::Stub::Tail(::grpc::ClientContext* context, const :: return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Tail_, context, request, response); } -void TableService::Stub::experimental_async::Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Tail_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Tail_, context, request, response, reactor); } @@ -551,11 +523,11 @@ ::grpc::Status TableService::Stub::HeadBy(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_HeadBy_, context, request, response); } -void TableService::Stub::experimental_async::HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HeadBy_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HeadBy_, context, request, response, reactor); } @@ -574,11 +546,11 @@ ::grpc::Status TableService::Stub::TailBy(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_TailBy_, context, request, response); } -void TableService::Stub::experimental_async::TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TailBy_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TailBy_, context, request, response, reactor); } @@ -597,11 +569,11 @@ ::grpc::Status TableService::Stub::Ungroup(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Ungroup_, context, request, response); } -void TableService::Stub::experimental_async::Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Ungroup_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Ungroup_, context, request, response, reactor); } @@ -620,11 +592,11 @@ ::grpc::Status TableService::Stub::MergeTables(::grpc::ClientContext* context, c return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_MergeTables_, context, request, response); } -void TableService::Stub::experimental_async::MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_MergeTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_MergeTables_, context, request, response, reactor); } @@ -643,11 +615,11 @@ ::grpc::Status TableService::Stub::CrossJoinTables(::grpc::ClientContext* contex return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_CrossJoinTables_, context, request, response); } -void TableService::Stub::experimental_async::CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CrossJoinTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CrossJoinTables_, context, request, response, reactor); } @@ -666,11 +638,11 @@ ::grpc::Status TableService::Stub::NaturalJoinTables(::grpc::ClientContext* cont return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_NaturalJoinTables_, context, request, response); } -void TableService::Stub::experimental_async::NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NaturalJoinTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_NaturalJoinTables_, context, request, response, reactor); } @@ -689,11 +661,11 @@ ::grpc::Status TableService::Stub::ExactJoinTables(::grpc::ClientContext* contex return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ExactJoinTables_, context, request, response); } -void TableService::Stub::experimental_async::ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExactJoinTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ExactJoinTables_, context, request, response, reactor); } @@ -712,11 +684,11 @@ ::grpc::Status TableService::Stub::LeftJoinTables(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_LeftJoinTables_, context, request, response); } -void TableService::Stub::experimental_async::LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_LeftJoinTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_LeftJoinTables_, context, request, response, reactor); } @@ -735,11 +707,11 @@ ::grpc::Status TableService::Stub::AsOfJoinTables(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_AsOfJoinTables_, context, request, response); } -void TableService::Stub::experimental_async::AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AsOfJoinTables_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AsOfJoinTables_, context, request, response, reactor); } @@ -758,11 +730,11 @@ ::grpc::Status TableService::Stub::ComboAggregate(::grpc::ClientContext* context return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ComboAggregate_, context, request, response); } -void TableService::Stub::experimental_async::ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ComboAggregate_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ComboAggregate_, context, request, response, reactor); } @@ -781,11 +753,11 @@ ::grpc::Status TableService::Stub::Snapshot(::grpc::ClientContext* context, cons return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Snapshot_, context, request, response); } -void TableService::Stub::experimental_async::Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Snapshot_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Snapshot_, context, request, response, reactor); } @@ -804,11 +776,11 @@ ::grpc::Status TableService::Stub::Flatten(::grpc::ClientContext* context, const return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Flatten_, context, request, response); } -void TableService::Stub::experimental_async::Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Flatten_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Flatten_, context, request, response, reactor); } @@ -827,11 +799,11 @@ ::grpc::Status TableService::Stub::RunChartDownsample(::grpc::ClientContext* con return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RunChartDownsample_, context, request, response); } -void TableService::Stub::experimental_async::RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RunChartDownsample_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RunChartDownsample_, context, request, response, reactor); } @@ -850,11 +822,11 @@ ::grpc::Status TableService::Stub::CreateInputTable(::grpc::ClientContext* conte return ::grpc::internal::BlockingUnaryCall< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_CreateInputTable_, context, request, response); } -void TableService::Stub::experimental_async::CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { +void TableService::Stub::async::CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function f) { ::grpc::internal::CallbackUnaryCall< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CreateInputTable_, context, request, response, std::move(f)); } -void TableService::Stub::experimental_async::CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void TableService::Stub::async::CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) { ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CreateInputTable_, context, request, response, reactor); } @@ -873,7 +845,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCrea return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>::Create(channel_.get(), rpcmethod_Batch_, context, request); } -void TableService::Stub::experimental_async::Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) { +void TableService::Stub::async::Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_Batch_, context, request, reactor); } @@ -889,7 +861,7 @@ ::grpc::ClientReader< ::io::deephaven::proto::backplane::grpc::ExportedTableUpda return ::grpc::internal::ClientReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>::Create(channel_.get(), rpcmethod_ExportedTableUpdates_, context, request); } -void TableService::Stub::experimental_async::ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) { +void TableService::Stub::async::ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) { ::grpc::internal::ClientCallbackReaderFactory< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>::Create(stub_->channel_.get(), stub_->rpcmethod_ExportedTableUpdates_, context, request, reactor); } @@ -935,16 +907,6 @@ TableService::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( TableService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](TableService::Service* service, - ::grpc::ServerContext* ctx, - const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* req, - ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* resp) { - return service->FetchTableMap(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[4], - ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, ::grpc::ServerContext* ctx, @@ -953,7 +915,7 @@ TableService::Service::Service() { return service->ApplyPreviewColumns(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[5], + TableService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -963,7 +925,7 @@ TableService::Service::Service() { return service->EmptyTable(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[6], + TableService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -973,7 +935,7 @@ TableService::Service::Service() { return service->TimeTable(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[7], + TableService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -983,7 +945,7 @@ TableService::Service::Service() { return service->DropColumns(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[8], + TableService_method_names[7], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -993,7 +955,7 @@ TableService::Service::Service() { return service->Update(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[9], + TableService_method_names[8], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1003,7 +965,7 @@ TableService::Service::Service() { return service->LazyUpdate(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[10], + TableService_method_names[9], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1013,7 +975,7 @@ TableService::Service::Service() { return service->View(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[11], + TableService_method_names[10], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1023,7 +985,7 @@ TableService::Service::Service() { return service->UpdateView(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[12], + TableService_method_names[11], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1033,7 +995,7 @@ TableService::Service::Service() { return service->Select(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[13], + TableService_method_names[12], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1043,7 +1005,7 @@ TableService::Service::Service() { return service->SelectDistinct(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[14], + TableService_method_names[13], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1053,7 +1015,7 @@ TableService::Service::Service() { return service->Filter(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[15], + TableService_method_names[14], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1063,7 +1025,7 @@ TableService::Service::Service() { return service->UnstructuredFilter(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[16], + TableService_method_names[15], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1073,7 +1035,7 @@ TableService::Service::Service() { return service->Sort(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[17], + TableService_method_names[16], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1083,7 +1045,7 @@ TableService::Service::Service() { return service->Head(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[18], + TableService_method_names[17], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1093,7 +1055,7 @@ TableService::Service::Service() { return service->Tail(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[19], + TableService_method_names[18], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1103,7 +1065,7 @@ TableService::Service::Service() { return service->HeadBy(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[20], + TableService_method_names[19], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1113,7 +1075,7 @@ TableService::Service::Service() { return service->TailBy(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[21], + TableService_method_names[20], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1123,7 +1085,7 @@ TableService::Service::Service() { return service->Ungroup(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[22], + TableService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1133,7 +1095,7 @@ TableService::Service::Service() { return service->MergeTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[23], + TableService_method_names[22], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1143,7 +1105,7 @@ TableService::Service::Service() { return service->CrossJoinTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[24], + TableService_method_names[23], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1153,7 +1115,7 @@ TableService::Service::Service() { return service->NaturalJoinTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[25], + TableService_method_names[24], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1163,7 +1125,7 @@ TableService::Service::Service() { return service->ExactJoinTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[26], + TableService_method_names[25], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1173,7 +1135,7 @@ TableService::Service::Service() { return service->LeftJoinTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[27], + TableService_method_names[26], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1183,7 +1145,7 @@ TableService::Service::Service() { return service->AsOfJoinTables(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[28], + TableService_method_names[27], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1193,7 +1155,7 @@ TableService::Service::Service() { return service->ComboAggregate(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[29], + TableService_method_names[28], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1203,7 +1165,7 @@ TableService::Service::Service() { return service->Snapshot(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[30], + TableService_method_names[29], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1213,7 +1175,7 @@ TableService::Service::Service() { return service->Flatten(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[31], + TableService_method_names[30], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1223,7 +1185,7 @@ TableService::Service::Service() { return service->RunChartDownsample(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[32], + TableService_method_names[31], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TableService::Service* service, @@ -1233,7 +1195,7 @@ TableService::Service::Service() { return service->CreateInputTable(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[33], + TableService_method_names[32], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::BatchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [](TableService::Service* service, @@ -1243,7 +1205,7 @@ TableService::Service::Service() { return service->Batch(ctx, req, writer); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TableService_method_names[34], + TableService_method_names[33], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< TableService::Service, ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>( [](TableService::Service* service, @@ -1278,13 +1240,6 @@ ::grpc::Status TableService::Service::FetchPandasTable(::grpc::ServerContext* co return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } -::grpc::Status TableService::Service::FetchTableMap(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - ::grpc::Status TableService::Service::ApplyPreviewColumns(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { (void) context; (void) request; diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.h index bf9d54a165e..2eca35ad1b0 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/table.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/table.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2ftable_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2ftable_2eproto__INCLUDED #include "deephaven/proto/table.pb.h" #include -#include #include #include #include @@ -75,15 +70,6 @@ class TableService final { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncFetchPandasTableRaw(context, request, cq)); } // - // Fetches a TableMap from an existing source ticket and exports it to the local session result ticket. - virtual ::grpc::Status FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>> AsyncFetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>>(AsyncFetchTableMapRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>> PrepareAsyncFetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>>(PrepareAsyncFetchTableMapRaw(context, request, cq)); - } - // // Create a table that has preview columns applied to an existing source table. virtual ::grpc::Status ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) = 0; std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) { @@ -379,317 +365,167 @@ class TableService final { std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>> PrepareAsyncExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>>(PrepareAsyncExportedTableUpdatesRaw(context, request, cq)); } - class experimental_async_interface { + class async_interface { public: - virtual ~experimental_async_interface() {} + virtual ~async_interface() {} // // Request an ETCR for this ticket. Ticket must reference a Table. virtual void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Fetches a Table from an existing source ticket and exports it to the local session result ticket. virtual void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. virtual void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif - // - // Fetches a TableMap from an existing source ticket and exports it to the local session result ticket. - virtual void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - virtual void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Create a table that has preview columns applied to an existing source table. virtual void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Create an empty table with the given column names and types. virtual void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Create a time table with the given start time and period. virtual void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Drop columns from the parent table. virtual void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Add columns to the given table using the given column specifications and the update table operation. virtual void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Add columns to the given table using the given column specifications and the lazyUpdate table operation. virtual void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Add columns to the given table using the given column specifications and the view table operation. virtual void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Add columns to the given table using the given column specifications and the updateView table operation. virtual void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Select the given columns from the given table. virtual void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns a new table definition with the unique tuples of the specified columns virtual void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Filter parent table with structured filters. virtual void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Filter parent table with unstructured filters. virtual void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Sort parent table via the provide sort descriptors. virtual void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Extract rows from the head of the parent table. virtual void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Extract rows from the tail of the parent table. virtual void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Run the headBy table operation for the given group by columns on the given table. virtual void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Run the tailBy operation for the given group by columns on the given table. virtual void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Ungroup the given columns (all columns will be ungrouped if columnsToUngroup is empty or unspecified). virtual void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Create a merged table from the given input tables. If a key column is provided (not null), a sorted // merged will be performed using that column. virtual void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of a cross join operation. Also known as the cartesian product. virtual void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of a natural join operation. virtual void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of an exact join operation. virtual void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of a left join operation. virtual void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of an as of join operation. virtual void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns the result of an aggregate table operation. virtual void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Snapshot rightId, triggered by leftId, and export the resulting new Table. // The left table's change events cause a new snapshot to be taken. The result table includes a // "snapshot key" which is a subset (possibly all) of the left table's columns. The // remaining columns in the result table come from right table, the table being snapshotted. virtual void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Returns a new table with a flattened row set. virtual void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // * // Downsamples a table assume its contents will be rendered in a run chart, with each subsequent row holding a later // X value (i.e., sorted on that column). Multiple Y columns can be specified, as can a range of values for the X // column to support zooming in. virtual void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // * // Creates a new Table based on the provided configuration. This can be used as a regular table from the other methods // in this interface, or can be interacted with via the InputTableService to modify its contents. virtual void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) = 0; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - #else - virtual void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - #endif // // Batch a series of requests and send them all at once. This enables the user to create intermediate tables without // requiring them to be exported and managed by the client. The server will automatically release any tables when they // are no longer depended upon. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) = 0; - #else - virtual void Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) = 0; - #endif // // Establish a stream of table updates for cheap notifications of table size updates. // // New streams will flush updates for all existing table exports. An export id of zero will be sent to indicate all // exports have sent their refresh update. Table updates may be intermingled with initial refresh updates after their // initial update had been sent. - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual void ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) = 0; - #else - virtual void ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) = 0; - #endif }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef class experimental_async_interface async_interface; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - async_interface* async() { return experimental_async(); } - #endif - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncGetExportedTableCreationResponseRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncGetExportedTableCreationResponseRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncFetchTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncFetchTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncFetchPandasTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncFetchPandasTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* AsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* PrepareAsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncApplyPreviewColumnsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncApplyPreviewColumnsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncEmptyTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -779,13 +615,6 @@ class TableService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> PrepareAsyncFetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(PrepareAsyncFetchPandasTableRaw(context, request, cq)); } - ::grpc::Status FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>> AsyncFetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>>(AsyncFetchTableMapRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>> PrepareAsyncFetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>>(PrepareAsyncFetchTableMapRaw(context, request, cq)); - } ::grpc::Status ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) override; std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>> AsyncApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>>(AsyncApplyPreviewColumnsRaw(context, request, cq)); @@ -1007,236 +836,92 @@ class TableService final { std::unique_ptr< ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>> PrepareAsyncExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReader< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>>(PrepareAsyncExportedTableUpdatesRaw(context, request, cq)); } - class experimental_async final : - public StubInterface::experimental_async_interface { + class async final : + public StubInterface::async_interface { public: void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void GetExportedTableCreationResponse(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void FetchTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void FetchPandasTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif - void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void FetchTableMap(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void ApplyPreviewColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void EmptyTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void TimeTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void DropColumns(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Update(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void LazyUpdate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void View(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void UpdateView(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Select(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void SelectDistinct(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Filter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void UnstructuredFilter(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Sort(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Head(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Tail(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void HeadBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void TailBy(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Ungroup(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void MergeTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void CrossJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void NaturalJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void ExactJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void LeftJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void AsOfJoinTables(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void ComboAggregate(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Snapshot(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void Flatten(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void RunChartDownsample(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, std::function) override; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - #else - void CreateInputTable(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) override; - #else - void Batch(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* reactor) override; - #endif - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL void ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) override; - #else - void ExportedTableUpdates(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::experimental::ClientReadReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* reactor) override; - #endif private: friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } + explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } + class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; + class async async_stub_{this}; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncGetExportedTableCreationResponseRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncGetExportedTableCreationResponseRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncFetchTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncFetchTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncFetchPandasTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncFetchPandasTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* AsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* PrepareAsyncFetchTableMapRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncApplyPreviewColumnsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* PrepareAsyncApplyPreviewColumnsRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* AsyncEmptyTableRaw(::grpc::ClientContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest& request, ::grpc::CompletionQueue* cq) override; @@ -1304,7 +989,6 @@ class TableService final { const ::grpc::internal::RpcMethod rpcmethod_GetExportedTableCreationResponse_; const ::grpc::internal::RpcMethod rpcmethod_FetchTable_; const ::grpc::internal::RpcMethod rpcmethod_FetchPandasTable_; - const ::grpc::internal::RpcMethod rpcmethod_FetchTableMap_; const ::grpc::internal::RpcMethod rpcmethod_ApplyPreviewColumns_; const ::grpc::internal::RpcMethod rpcmethod_EmptyTable_; const ::grpc::internal::RpcMethod rpcmethod_TimeTable_; @@ -1353,9 +1037,6 @@ class TableService final { // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. virtual ::grpc::Status FetchPandasTable(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response); // - // Fetches a TableMap from an existing source ticket and exports it to the local session result ticket. - virtual ::grpc::Status FetchTableMap(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response); - // // Create a table that has preview columns applied to an existing source table. virtual ::grpc::Status ApplyPreviewColumns(::grpc::ServerContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response); // @@ -1523,32 +1204,12 @@ class TableService final { } }; template - class WithAsyncMethod_FetchTableMap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_FetchTableMap() { - ::grpc::Service::MarkMethodAsync(3); - } - ~WithAsyncMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestFetchTableMap(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template class WithAsyncMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_ApplyPreviewColumns() { - ::grpc::Service::MarkMethodAsync(4); + ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_ApplyPreviewColumns() override { BaseClassMustBeDerivedFromService(this); @@ -1559,7 +1220,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestApplyPreviewColumns(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1568,7 +1229,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_EmptyTable() { - ::grpc::Service::MarkMethodAsync(5); + ::grpc::Service::MarkMethodAsync(4); } ~WithAsyncMethod_EmptyTable() override { BaseClassMustBeDerivedFromService(this); @@ -1579,7 +1240,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestEmptyTable(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1588,7 +1249,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_TimeTable() { - ::grpc::Service::MarkMethodAsync(6); + ::grpc::Service::MarkMethodAsync(5); } ~WithAsyncMethod_TimeTable() override { BaseClassMustBeDerivedFromService(this); @@ -1599,7 +1260,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTimeTable(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1608,7 +1269,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_DropColumns() { - ::grpc::Service::MarkMethodAsync(7); + ::grpc::Service::MarkMethodAsync(6); } ~WithAsyncMethod_DropColumns() override { BaseClassMustBeDerivedFromService(this); @@ -1619,7 +1280,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestDropColumns(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1628,7 +1289,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Update() { - ::grpc::Service::MarkMethodAsync(8); + ::grpc::Service::MarkMethodAsync(7); } ~WithAsyncMethod_Update() override { BaseClassMustBeDerivedFromService(this); @@ -1639,7 +1300,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUpdate(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1648,7 +1309,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_LazyUpdate() { - ::grpc::Service::MarkMethodAsync(9); + ::grpc::Service::MarkMethodAsync(8); } ~WithAsyncMethod_LazyUpdate() override { BaseClassMustBeDerivedFromService(this); @@ -1659,7 +1320,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestLazyUpdate(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1668,7 +1329,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_View() { - ::grpc::Service::MarkMethodAsync(10); + ::grpc::Service::MarkMethodAsync(9); } ~WithAsyncMethod_View() override { BaseClassMustBeDerivedFromService(this); @@ -1679,7 +1340,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestView(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1688,7 +1349,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_UpdateView() { - ::grpc::Service::MarkMethodAsync(11); + ::grpc::Service::MarkMethodAsync(10); } ~WithAsyncMethod_UpdateView() override { BaseClassMustBeDerivedFromService(this); @@ -1699,7 +1360,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUpdateView(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1708,7 +1369,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Select() { - ::grpc::Service::MarkMethodAsync(12); + ::grpc::Service::MarkMethodAsync(11); } ~WithAsyncMethod_Select() override { BaseClassMustBeDerivedFromService(this); @@ -1719,7 +1380,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSelect(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1728,7 +1389,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SelectDistinct() { - ::grpc::Service::MarkMethodAsync(13); + ::grpc::Service::MarkMethodAsync(12); } ~WithAsyncMethod_SelectDistinct() override { BaseClassMustBeDerivedFromService(this); @@ -1739,7 +1400,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSelectDistinct(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1748,7 +1409,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Filter() { - ::grpc::Service::MarkMethodAsync(14); + ::grpc::Service::MarkMethodAsync(13); } ~WithAsyncMethod_Filter() override { BaseClassMustBeDerivedFromService(this); @@ -1759,7 +1420,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestFilter(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1768,7 +1429,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_UnstructuredFilter() { - ::grpc::Service::MarkMethodAsync(15); + ::grpc::Service::MarkMethodAsync(14); } ~WithAsyncMethod_UnstructuredFilter() override { BaseClassMustBeDerivedFromService(this); @@ -1779,7 +1440,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUnstructuredFilter(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(15, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1788,7 +1449,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Sort() { - ::grpc::Service::MarkMethodAsync(16); + ::grpc::Service::MarkMethodAsync(15); } ~WithAsyncMethod_Sort() override { BaseClassMustBeDerivedFromService(this); @@ -1799,7 +1460,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSort(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(16, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(15, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1808,7 +1469,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Head() { - ::grpc::Service::MarkMethodAsync(17); + ::grpc::Service::MarkMethodAsync(16); } ~WithAsyncMethod_Head() override { BaseClassMustBeDerivedFromService(this); @@ -1819,7 +1480,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestHead(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(17, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(16, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1828,7 +1489,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Tail() { - ::grpc::Service::MarkMethodAsync(18); + ::grpc::Service::MarkMethodAsync(17); } ~WithAsyncMethod_Tail() override { BaseClassMustBeDerivedFromService(this); @@ -1839,7 +1500,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTail(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(18, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(17, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1848,7 +1509,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_HeadBy() { - ::grpc::Service::MarkMethodAsync(19); + ::grpc::Service::MarkMethodAsync(18); } ~WithAsyncMethod_HeadBy() override { BaseClassMustBeDerivedFromService(this); @@ -1859,7 +1520,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestHeadBy(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(19, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(18, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1868,7 +1529,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_TailBy() { - ::grpc::Service::MarkMethodAsync(20); + ::grpc::Service::MarkMethodAsync(19); } ~WithAsyncMethod_TailBy() override { BaseClassMustBeDerivedFromService(this); @@ -1879,7 +1540,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTailBy(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(20, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(19, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1888,7 +1549,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Ungroup() { - ::grpc::Service::MarkMethodAsync(21); + ::grpc::Service::MarkMethodAsync(20); } ~WithAsyncMethod_Ungroup() override { BaseClassMustBeDerivedFromService(this); @@ -1899,7 +1560,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUngroup(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(21, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(20, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1908,7 +1569,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_MergeTables() { - ::grpc::Service::MarkMethodAsync(22); + ::grpc::Service::MarkMethodAsync(21); } ~WithAsyncMethod_MergeTables() override { BaseClassMustBeDerivedFromService(this); @@ -1919,7 +1580,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestMergeTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(22, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(21, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1928,7 +1589,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_CrossJoinTables() { - ::grpc::Service::MarkMethodAsync(23); + ::grpc::Service::MarkMethodAsync(22); } ~WithAsyncMethod_CrossJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -1939,7 +1600,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCrossJoinTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(23, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(22, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1948,7 +1609,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_NaturalJoinTables() { - ::grpc::Service::MarkMethodAsync(24); + ::grpc::Service::MarkMethodAsync(23); } ~WithAsyncMethod_NaturalJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -1959,7 +1620,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestNaturalJoinTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(24, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(23, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1968,7 +1629,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_ExactJoinTables() { - ::grpc::Service::MarkMethodAsync(25); + ::grpc::Service::MarkMethodAsync(24); } ~WithAsyncMethod_ExactJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -1979,7 +1640,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestExactJoinTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(25, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(24, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -1988,7 +1649,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_LeftJoinTables() { - ::grpc::Service::MarkMethodAsync(26); + ::grpc::Service::MarkMethodAsync(25); } ~WithAsyncMethod_LeftJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -1999,7 +1660,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestLeftJoinTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(26, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(25, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2008,7 +1669,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_AsOfJoinTables() { - ::grpc::Service::MarkMethodAsync(27); + ::grpc::Service::MarkMethodAsync(26); } ~WithAsyncMethod_AsOfJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -2019,7 +1680,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestAsOfJoinTables(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(27, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(26, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2028,7 +1689,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_ComboAggregate() { - ::grpc::Service::MarkMethodAsync(28); + ::grpc::Service::MarkMethodAsync(27); } ~WithAsyncMethod_ComboAggregate() override { BaseClassMustBeDerivedFromService(this); @@ -2039,7 +1700,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestComboAggregate(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(28, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(27, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2048,7 +1709,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Snapshot() { - ::grpc::Service::MarkMethodAsync(29); + ::grpc::Service::MarkMethodAsync(28); } ~WithAsyncMethod_Snapshot() override { BaseClassMustBeDerivedFromService(this); @@ -2059,7 +1720,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSnapshot(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(29, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(28, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2068,7 +1729,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Flatten() { - ::grpc::Service::MarkMethodAsync(30); + ::grpc::Service::MarkMethodAsync(29); } ~WithAsyncMethod_Flatten() override { BaseClassMustBeDerivedFromService(this); @@ -2079,7 +1740,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestFlatten(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(30, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(29, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2088,7 +1749,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_RunChartDownsample() { - ::grpc::Service::MarkMethodAsync(31); + ::grpc::Service::MarkMethodAsync(30); } ~WithAsyncMethod_RunChartDownsample() override { BaseClassMustBeDerivedFromService(this); @@ -2099,7 +1760,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRunChartDownsample(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(31, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(30, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2108,7 +1769,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_CreateInputTable() { - ::grpc::Service::MarkMethodAsync(32); + ::grpc::Service::MarkMethodAsync(31); } ~WithAsyncMethod_CreateInputTable() override { BaseClassMustBeDerivedFromService(this); @@ -2119,7 +1780,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCreateInputTable(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::grpc::ServerAsyncResponseWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(32, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(31, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -2128,7 +1789,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Batch() { - ::grpc::Service::MarkMethodAsync(33); + ::grpc::Service::MarkMethodAsync(32); } ~WithAsyncMethod_Batch() override { BaseClassMustBeDerivedFromService(this); @@ -2139,7 +1800,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestBatch(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request, ::grpc::ServerAsyncWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(33, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(32, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -2148,7 +1809,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_ExportedTableUpdates() { - ::grpc::Service::MarkMethodAsync(34); + ::grpc::Service::MarkMethodAsync(33); } ~WithAsyncMethod_ExportedTableUpdates() override { BaseClassMustBeDerivedFromService(this); @@ -2159,41 +1820,27 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestExportedTableUpdates(::grpc::ServerContext* context, ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request, ::grpc::ServerAsyncWriter< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(34, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(33, context, request, writer, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > AsyncService; + typedef WithAsyncMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > AsyncService; template - class ExperimentalWithCallbackMethod_GetExportedTableCreationResponse : public BaseClass { + class WithCallbackMethod_GetExportedTableCreationResponse : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_GetExportedTableCreationResponse() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(0, + WithCallbackMethod_GetExportedTableCreationResponse() { + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->GetExportedTableCreationResponse(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::Ticket* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->GetExportedTableCreationResponse(context, request, response); }));} void SetMessageAllocatorFor_GetExportedTableCreationResponse( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::Ticket, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_GetExportedTableCreationResponse() override { + ~WithCallbackMethod_GetExportedTableCreationResponse() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2201,46 +1848,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* GetExportedTableCreationResponse( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::Ticket* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* GetExportedTableCreationResponse( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::Ticket* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::Ticket* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_FetchTable : public BaseClass { + class WithCallbackMethod_FetchTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_FetchTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(1, + WithCallbackMethod_FetchTable() { + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->FetchTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->FetchTable(context, request, response); }));} void SetMessageAllocatorFor_FetchTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(1); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_FetchTable() override { + ~WithCallbackMethod_FetchTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2248,46 +1875,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_FetchPandasTable : public BaseClass { + class WithCallbackMethod_FetchPandasTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_FetchPandasTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(2, + WithCallbackMethod_FetchPandasTable() { + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->FetchPandasTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->FetchPandasTable(context, request, response); }));} void SetMessageAllocatorFor_FetchPandasTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(2); - #endif static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_FetchPandasTable() override { + ~WithCallbackMethod_FetchPandasTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2295,93 +1902,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchPandasTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchPandasTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_FetchTableMap : public BaseClass { + class WithCallbackMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_FetchTableMap() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(3, - new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>( - [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* request, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* response) { return this->FetchTableMap(context, request, response); }));} - void SetMessageAllocatorFor_FetchTableMap( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(3); - #endif - static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - virtual ::grpc::ServerUnaryReactor* FetchTableMap( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchTableMap( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) - #endif - { return nullptr; } - }; - template - class ExperimentalWithCallbackMethod_ApplyPreviewColumns : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_ApplyPreviewColumns() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(4, + WithCallbackMethod_ApplyPreviewColumns() { + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ApplyPreviewColumns(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ApplyPreviewColumns(context, request, response); }));} void SetMessageAllocatorFor_ApplyPreviewColumns( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(4); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_ApplyPreviewColumns() override { + ~WithCallbackMethod_ApplyPreviewColumns() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2389,46 +1929,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ApplyPreviewColumns( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ApplyPreviewColumns( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_EmptyTable : public BaseClass { + class WithCallbackMethod_EmptyTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_EmptyTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(5, + WithCallbackMethod_EmptyTable() { + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->EmptyTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->EmptyTable(context, request, response); }));} void SetMessageAllocatorFor_EmptyTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(5); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_EmptyTable() override { + ~WithCallbackMethod_EmptyTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2436,46 +1956,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* EmptyTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* EmptyTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_TimeTable : public BaseClass { + class WithCallbackMethod_TimeTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_TimeTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(6, + WithCallbackMethod_TimeTable() { + ::grpc::Service::MarkMethodCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->TimeTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->TimeTable(context, request, response); }));} void SetMessageAllocatorFor_TimeTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(6); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_TimeTable() override { + ~WithCallbackMethod_TimeTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2483,46 +1983,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TimeTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TimeTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::TimeTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_DropColumns : public BaseClass { + class WithCallbackMethod_DropColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_DropColumns() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(7, + WithCallbackMethod_DropColumns() { + ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->DropColumns(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->DropColumns(context, request, response); }));} void SetMessageAllocatorFor_DropColumns( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(7); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(7); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_DropColumns() override { + ~WithCallbackMethod_DropColumns() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2530,46 +2010,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* DropColumns( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* DropColumns( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Update : public BaseClass { + class WithCallbackMethod_Update : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Update() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(8, + WithCallbackMethod_Update() { + ::grpc::Service::MarkMethodCallback(7, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Update(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Update(context, request, response); }));} void SetMessageAllocatorFor_Update( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(8); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(8); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(7); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Update() override { + ~WithCallbackMethod_Update() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2577,46 +2037,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Update( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Update( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_LazyUpdate : public BaseClass { + class WithCallbackMethod_LazyUpdate : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_LazyUpdate() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(9, + WithCallbackMethod_LazyUpdate() { + ::grpc::Service::MarkMethodCallback(8, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->LazyUpdate(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->LazyUpdate(context, request, response); }));} void SetMessageAllocatorFor_LazyUpdate( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(9); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(9); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(8); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_LazyUpdate() override { + ~WithCallbackMethod_LazyUpdate() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2624,46 +2064,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* LazyUpdate( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* LazyUpdate( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_View : public BaseClass { + class WithCallbackMethod_View : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_View() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(10, + WithCallbackMethod_View() { + ::grpc::Service::MarkMethodCallback(9, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->View(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->View(context, request, response); }));} void SetMessageAllocatorFor_View( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(10); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(10); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(9); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_View() override { + ~WithCallbackMethod_View() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2671,46 +2091,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* View( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* View( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_UpdateView : public BaseClass { + class WithCallbackMethod_UpdateView : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_UpdateView() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(11, + WithCallbackMethod_UpdateView() { + ::grpc::Service::MarkMethodCallback(10, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->UpdateView(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->UpdateView(context, request, response); }));} void SetMessageAllocatorFor_UpdateView( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(11); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(11); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(10); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_UpdateView() override { + ~WithCallbackMethod_UpdateView() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2718,46 +2118,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* UpdateView( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* UpdateView( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Select : public BaseClass { + class WithCallbackMethod_Select : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Select() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(12, + WithCallbackMethod_Select() { + ::grpc::Service::MarkMethodCallback(11, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Select(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Select(context, request, response); }));} void SetMessageAllocatorFor_Select( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(12); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(12); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(11); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Select() override { + ~WithCallbackMethod_Select() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2765,46 +2145,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Select( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Select( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_SelectDistinct : public BaseClass { + class WithCallbackMethod_SelectDistinct : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_SelectDistinct() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(13, + WithCallbackMethod_SelectDistinct() { + ::grpc::Service::MarkMethodCallback(12, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->SelectDistinct(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->SelectDistinct(context, request, response); }));} void SetMessageAllocatorFor_SelectDistinct( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(13); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(13); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(12); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_SelectDistinct() override { + ~WithCallbackMethod_SelectDistinct() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2812,46 +2172,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* SelectDistinct( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* SelectDistinct( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Filter : public BaseClass { + class WithCallbackMethod_Filter : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Filter() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(14, + WithCallbackMethod_Filter() { + ::grpc::Service::MarkMethodCallback(13, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Filter(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Filter(context, request, response); }));} void SetMessageAllocatorFor_Filter( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(14); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(14); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(13); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Filter() override { + ~WithCallbackMethod_Filter() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2859,46 +2199,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Filter( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Filter( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_UnstructuredFilter : public BaseClass { + class WithCallbackMethod_UnstructuredFilter : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_UnstructuredFilter() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(15, + WithCallbackMethod_UnstructuredFilter() { + ::grpc::Service::MarkMethodCallback(14, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->UnstructuredFilter(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->UnstructuredFilter(context, request, response); }));} void SetMessageAllocatorFor_UnstructuredFilter( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(15); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(15); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(14); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_UnstructuredFilter() override { + ~WithCallbackMethod_UnstructuredFilter() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2906,46 +2226,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* UnstructuredFilter( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* UnstructuredFilter( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Sort : public BaseClass { + class WithCallbackMethod_Sort : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Sort() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(16, + WithCallbackMethod_Sort() { + ::grpc::Service::MarkMethodCallback(15, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Sort(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Sort(context, request, response); }));} void SetMessageAllocatorFor_Sort( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(16); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(16); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(15); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Sort() override { + ~WithCallbackMethod_Sort() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -2953,46 +2253,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Sort( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Sort( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SortTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Head : public BaseClass { + class WithCallbackMethod_Head : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Head() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(17, + WithCallbackMethod_Head() { + ::grpc::Service::MarkMethodCallback(16, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Head(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Head(context, request, response); }));} void SetMessageAllocatorFor_Head( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(17); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(17); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(16); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Head() override { + ~WithCallbackMethod_Head() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3000,46 +2280,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Head( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Head( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Tail : public BaseClass { + class WithCallbackMethod_Tail : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Tail() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(18, + WithCallbackMethod_Tail() { + ::grpc::Service::MarkMethodCallback(17, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Tail(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Tail(context, request, response); }));} void SetMessageAllocatorFor_Tail( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(18); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(18); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(17); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Tail() override { + ~WithCallbackMethod_Tail() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3047,46 +2307,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Tail( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Tail( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_HeadBy : public BaseClass { + class WithCallbackMethod_HeadBy : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_HeadBy() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(19, + WithCallbackMethod_HeadBy() { + ::grpc::Service::MarkMethodCallback(18, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->HeadBy(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->HeadBy(context, request, response); }));} void SetMessageAllocatorFor_HeadBy( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(19); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(19); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(18); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_HeadBy() override { + ~WithCallbackMethod_HeadBy() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3094,46 +2334,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* HeadBy( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* HeadBy( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_TailBy : public BaseClass { + class WithCallbackMethod_TailBy : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_TailBy() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(20, + WithCallbackMethod_TailBy() { + ::grpc::Service::MarkMethodCallback(19, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->TailBy(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->TailBy(context, request, response); }));} void SetMessageAllocatorFor_TailBy( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(20); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(20); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(19); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_TailBy() override { + ~WithCallbackMethod_TailBy() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3141,46 +2361,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TailBy( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TailBy( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Ungroup : public BaseClass { + class WithCallbackMethod_Ungroup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Ungroup() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(21, + WithCallbackMethod_Ungroup() { + ::grpc::Service::MarkMethodCallback(20, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Ungroup(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Ungroup(context, request, response); }));} void SetMessageAllocatorFor_Ungroup( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(21); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(21); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(20); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Ungroup() override { + ~WithCallbackMethod_Ungroup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3188,46 +2388,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Ungroup( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Ungroup( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::UngroupRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_MergeTables : public BaseClass { + class WithCallbackMethod_MergeTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_MergeTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(22, + WithCallbackMethod_MergeTables() { + ::grpc::Service::MarkMethodCallback(21, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->MergeTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->MergeTables(context, request, response); }));} void SetMessageAllocatorFor_MergeTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(22); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(22); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(21); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_MergeTables() override { + ~WithCallbackMethod_MergeTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3235,46 +2415,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* MergeTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* MergeTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_CrossJoinTables : public BaseClass { + class WithCallbackMethod_CrossJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_CrossJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(23, + WithCallbackMethod_CrossJoinTables() { + ::grpc::Service::MarkMethodCallback(22, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->CrossJoinTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->CrossJoinTables(context, request, response); }));} void SetMessageAllocatorFor_CrossJoinTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(23); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(23); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(22); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_CrossJoinTables() override { + ~WithCallbackMethod_CrossJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3282,46 +2442,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CrossJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CrossJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_NaturalJoinTables : public BaseClass { + class WithCallbackMethod_NaturalJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_NaturalJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(24, + WithCallbackMethod_NaturalJoinTables() { + ::grpc::Service::MarkMethodCallback(23, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->NaturalJoinTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->NaturalJoinTables(context, request, response); }));} void SetMessageAllocatorFor_NaturalJoinTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(24); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(24); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(23); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_NaturalJoinTables() override { + ~WithCallbackMethod_NaturalJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3329,46 +2469,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NaturalJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NaturalJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ExactJoinTables : public BaseClass { + class WithCallbackMethod_ExactJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ExactJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(25, + WithCallbackMethod_ExactJoinTables() { + ::grpc::Service::MarkMethodCallback(24, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ExactJoinTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ExactJoinTables(context, request, response); }));} void SetMessageAllocatorFor_ExactJoinTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(25); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(25); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(24); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_ExactJoinTables() override { + ~WithCallbackMethod_ExactJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3376,46 +2496,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExactJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExactJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_LeftJoinTables : public BaseClass { + class WithCallbackMethod_LeftJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_LeftJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(26, + WithCallbackMethod_LeftJoinTables() { + ::grpc::Service::MarkMethodCallback(25, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->LeftJoinTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->LeftJoinTables(context, request, response); }));} void SetMessageAllocatorFor_LeftJoinTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(26); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(26); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(25); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_LeftJoinTables() override { + ~WithCallbackMethod_LeftJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3423,46 +2523,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* LeftJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* LeftJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_AsOfJoinTables : public BaseClass { + class WithCallbackMethod_AsOfJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_AsOfJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(27, + WithCallbackMethod_AsOfJoinTables() { + ::grpc::Service::MarkMethodCallback(26, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->AsOfJoinTables(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->AsOfJoinTables(context, request, response); }));} void SetMessageAllocatorFor_AsOfJoinTables( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(27); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(27); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(26); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_AsOfJoinTables() override { + ~WithCallbackMethod_AsOfJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3470,46 +2550,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* AsOfJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* AsOfJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ComboAggregate : public BaseClass { + class WithCallbackMethod_ComboAggregate : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ComboAggregate() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(28, + WithCallbackMethod_ComboAggregate() { + ::grpc::Service::MarkMethodCallback(27, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ComboAggregate(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->ComboAggregate(context, request, response); }));} void SetMessageAllocatorFor_ComboAggregate( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(28); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(28); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(27); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_ComboAggregate() override { + ~WithCallbackMethod_ComboAggregate() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3517,46 +2577,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ComboAggregate( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ComboAggregate( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Snapshot : public BaseClass { + class WithCallbackMethod_Snapshot : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Snapshot() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(29, + WithCallbackMethod_Snapshot() { + ::grpc::Service::MarkMethodCallback(28, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Snapshot(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Snapshot(context, request, response); }));} void SetMessageAllocatorFor_Snapshot( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(29); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(29); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(28); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Snapshot() override { + ~WithCallbackMethod_Snapshot() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3564,46 +2604,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Snapshot( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Snapshot( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Flatten : public BaseClass { + class WithCallbackMethod_Flatten : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Flatten() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(30, + WithCallbackMethod_Flatten() { + ::grpc::Service::MarkMethodCallback(29, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Flatten(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->Flatten(context, request, response); }));} void SetMessageAllocatorFor_Flatten( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(30); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(30); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(29); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_Flatten() override { + ~WithCallbackMethod_Flatten() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3611,46 +2631,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Flatten( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Flatten( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FlattenRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_RunChartDownsample : public BaseClass { + class WithCallbackMethod_RunChartDownsample : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_RunChartDownsample() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(31, + WithCallbackMethod_RunChartDownsample() { + ::grpc::Service::MarkMethodCallback(30, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->RunChartDownsample(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->RunChartDownsample(context, request, response); }));} void SetMessageAllocatorFor_RunChartDownsample( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(31); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(31); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(30); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_RunChartDownsample() override { + ~WithCallbackMethod_RunChartDownsample() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3658,46 +2658,26 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* RunChartDownsample( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* RunChartDownsample( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_CreateInputTable : public BaseClass { + class WithCallbackMethod_CreateInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_CreateInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(32, + WithCallbackMethod_CreateInputTable() { + ::grpc::Service::MarkMethodCallback(31, new ::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->CreateInputTable(context, request, response); }));} + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* request, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* response) { return this->CreateInputTable(context, request, response); }));} void SetMessageAllocatorFor_CreateInputTable( - ::grpc::experimental::MessageAllocator< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(32); - #else - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(32); - #endif + ::grpc::MessageAllocator< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(31); static_cast<::grpc::internal::CallbackUnaryHandler< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>*>(handler) ->SetMessageAllocator(allocator); } - ~ExperimentalWithCallbackMethod_CreateInputTable() override { + ~WithCallbackMethod_CreateInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3705,37 +2685,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CreateInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CreateInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* /*response*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_Batch : public BaseClass { + class WithCallbackMethod_Batch : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_Batch() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(33, + WithCallbackMethod_Batch() { + ::grpc::Service::MarkMethodCallback(32, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::BatchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request) { return this->Batch(context, request); })); + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* request) { return this->Batch(context, request); })); } - ~ExperimentalWithCallbackMethod_Batch() override { + ~WithCallbackMethod_Batch() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3743,37 +2707,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* Batch( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* Batch( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::BatchTableRequest* /*request*/) { return nullptr; } }; template - class ExperimentalWithCallbackMethod_ExportedTableUpdates : public BaseClass { + class WithCallbackMethod_ExportedTableUpdates : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithCallbackMethod_ExportedTableUpdates() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodCallback(34, + WithCallbackMethod_ExportedTableUpdates() { + ::grpc::Service::MarkMethodCallback(33, new ::grpc::internal::CallbackServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request) { return this->ExportedTableUpdates(context, request); })); + ::grpc::CallbackServerContext* context, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* request) { return this->ExportedTableUpdates(context, request); })); } - ~ExperimentalWithCallbackMethod_ExportedTableUpdates() override { + ~WithCallbackMethod_ExportedTableUpdates() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -3781,20 +2729,11 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* ExportedTableUpdates( - ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* ExportedTableUpdates( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* /*request*/) - #endif - { return nullptr; } - }; - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - typedef ExperimentalWithCallbackMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > CallbackService; - #endif - - typedef ExperimentalWithCallbackMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ExperimentalCallbackService; + ::grpc::CallbackServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* /*request*/) { return nullptr; } + }; + typedef WithCallbackMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > CallbackService; + typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_GetExportedTableCreationResponse : public BaseClass { private: @@ -3847,29 +2786,12 @@ class TableService final { } }; template - class WithGenericMethod_FetchTableMap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_FetchTableMap() { - ::grpc::Service::MarkMethodGeneric(3); - } - ~WithGenericMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template class WithGenericMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_ApplyPreviewColumns() { - ::grpc::Service::MarkMethodGeneric(4); + ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_ApplyPreviewColumns() override { BaseClassMustBeDerivedFromService(this); @@ -3886,7 +2808,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_EmptyTable() { - ::grpc::Service::MarkMethodGeneric(5); + ::grpc::Service::MarkMethodGeneric(4); } ~WithGenericMethod_EmptyTable() override { BaseClassMustBeDerivedFromService(this); @@ -3903,7 +2825,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_TimeTable() { - ::grpc::Service::MarkMethodGeneric(6); + ::grpc::Service::MarkMethodGeneric(5); } ~WithGenericMethod_TimeTable() override { BaseClassMustBeDerivedFromService(this); @@ -3920,7 +2842,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_DropColumns() { - ::grpc::Service::MarkMethodGeneric(7); + ::grpc::Service::MarkMethodGeneric(6); } ~WithGenericMethod_DropColumns() override { BaseClassMustBeDerivedFromService(this); @@ -3937,7 +2859,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Update() { - ::grpc::Service::MarkMethodGeneric(8); + ::grpc::Service::MarkMethodGeneric(7); } ~WithGenericMethod_Update() override { BaseClassMustBeDerivedFromService(this); @@ -3954,7 +2876,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_LazyUpdate() { - ::grpc::Service::MarkMethodGeneric(9); + ::grpc::Service::MarkMethodGeneric(8); } ~WithGenericMethod_LazyUpdate() override { BaseClassMustBeDerivedFromService(this); @@ -3971,7 +2893,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_View() { - ::grpc::Service::MarkMethodGeneric(10); + ::grpc::Service::MarkMethodGeneric(9); } ~WithGenericMethod_View() override { BaseClassMustBeDerivedFromService(this); @@ -3988,7 +2910,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_UpdateView() { - ::grpc::Service::MarkMethodGeneric(11); + ::grpc::Service::MarkMethodGeneric(10); } ~WithGenericMethod_UpdateView() override { BaseClassMustBeDerivedFromService(this); @@ -4005,7 +2927,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Select() { - ::grpc::Service::MarkMethodGeneric(12); + ::grpc::Service::MarkMethodGeneric(11); } ~WithGenericMethod_Select() override { BaseClassMustBeDerivedFromService(this); @@ -4022,7 +2944,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SelectDistinct() { - ::grpc::Service::MarkMethodGeneric(13); + ::grpc::Service::MarkMethodGeneric(12); } ~WithGenericMethod_SelectDistinct() override { BaseClassMustBeDerivedFromService(this); @@ -4039,7 +2961,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Filter() { - ::grpc::Service::MarkMethodGeneric(14); + ::grpc::Service::MarkMethodGeneric(13); } ~WithGenericMethod_Filter() override { BaseClassMustBeDerivedFromService(this); @@ -4056,7 +2978,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_UnstructuredFilter() { - ::grpc::Service::MarkMethodGeneric(15); + ::grpc::Service::MarkMethodGeneric(14); } ~WithGenericMethod_UnstructuredFilter() override { BaseClassMustBeDerivedFromService(this); @@ -4073,7 +2995,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Sort() { - ::grpc::Service::MarkMethodGeneric(16); + ::grpc::Service::MarkMethodGeneric(15); } ~WithGenericMethod_Sort() override { BaseClassMustBeDerivedFromService(this); @@ -4090,7 +3012,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Head() { - ::grpc::Service::MarkMethodGeneric(17); + ::grpc::Service::MarkMethodGeneric(16); } ~WithGenericMethod_Head() override { BaseClassMustBeDerivedFromService(this); @@ -4107,7 +3029,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Tail() { - ::grpc::Service::MarkMethodGeneric(18); + ::grpc::Service::MarkMethodGeneric(17); } ~WithGenericMethod_Tail() override { BaseClassMustBeDerivedFromService(this); @@ -4124,7 +3046,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_HeadBy() { - ::grpc::Service::MarkMethodGeneric(19); + ::grpc::Service::MarkMethodGeneric(18); } ~WithGenericMethod_HeadBy() override { BaseClassMustBeDerivedFromService(this); @@ -4141,7 +3063,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_TailBy() { - ::grpc::Service::MarkMethodGeneric(20); + ::grpc::Service::MarkMethodGeneric(19); } ~WithGenericMethod_TailBy() override { BaseClassMustBeDerivedFromService(this); @@ -4158,7 +3080,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Ungroup() { - ::grpc::Service::MarkMethodGeneric(21); + ::grpc::Service::MarkMethodGeneric(20); } ~WithGenericMethod_Ungroup() override { BaseClassMustBeDerivedFromService(this); @@ -4175,7 +3097,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_MergeTables() { - ::grpc::Service::MarkMethodGeneric(22); + ::grpc::Service::MarkMethodGeneric(21); } ~WithGenericMethod_MergeTables() override { BaseClassMustBeDerivedFromService(this); @@ -4192,7 +3114,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_CrossJoinTables() { - ::grpc::Service::MarkMethodGeneric(23); + ::grpc::Service::MarkMethodGeneric(22); } ~WithGenericMethod_CrossJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4209,7 +3131,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_NaturalJoinTables() { - ::grpc::Service::MarkMethodGeneric(24); + ::grpc::Service::MarkMethodGeneric(23); } ~WithGenericMethod_NaturalJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4226,7 +3148,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_ExactJoinTables() { - ::grpc::Service::MarkMethodGeneric(25); + ::grpc::Service::MarkMethodGeneric(24); } ~WithGenericMethod_ExactJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4243,7 +3165,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_LeftJoinTables() { - ::grpc::Service::MarkMethodGeneric(26); + ::grpc::Service::MarkMethodGeneric(25); } ~WithGenericMethod_LeftJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4260,7 +3182,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_AsOfJoinTables() { - ::grpc::Service::MarkMethodGeneric(27); + ::grpc::Service::MarkMethodGeneric(26); } ~WithGenericMethod_AsOfJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4277,7 +3199,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_ComboAggregate() { - ::grpc::Service::MarkMethodGeneric(28); + ::grpc::Service::MarkMethodGeneric(27); } ~WithGenericMethod_ComboAggregate() override { BaseClassMustBeDerivedFromService(this); @@ -4294,7 +3216,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Snapshot() { - ::grpc::Service::MarkMethodGeneric(29); + ::grpc::Service::MarkMethodGeneric(28); } ~WithGenericMethod_Snapshot() override { BaseClassMustBeDerivedFromService(this); @@ -4311,7 +3233,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Flatten() { - ::grpc::Service::MarkMethodGeneric(30); + ::grpc::Service::MarkMethodGeneric(29); } ~WithGenericMethod_Flatten() override { BaseClassMustBeDerivedFromService(this); @@ -4328,7 +3250,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_RunChartDownsample() { - ::grpc::Service::MarkMethodGeneric(31); + ::grpc::Service::MarkMethodGeneric(30); } ~WithGenericMethod_RunChartDownsample() override { BaseClassMustBeDerivedFromService(this); @@ -4345,7 +3267,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_CreateInputTable() { - ::grpc::Service::MarkMethodGeneric(32); + ::grpc::Service::MarkMethodGeneric(31); } ~WithGenericMethod_CreateInputTable() override { BaseClassMustBeDerivedFromService(this); @@ -4362,7 +3284,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Batch() { - ::grpc::Service::MarkMethodGeneric(33); + ::grpc::Service::MarkMethodGeneric(32); } ~WithGenericMethod_Batch() override { BaseClassMustBeDerivedFromService(this); @@ -4379,7 +3301,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_ExportedTableUpdates() { - ::grpc::Service::MarkMethodGeneric(34); + ::grpc::Service::MarkMethodGeneric(33); } ~WithGenericMethod_ExportedTableUpdates() override { BaseClassMustBeDerivedFromService(this); @@ -4451,32 +3373,12 @@ class TableService final { } }; template - class WithRawMethod_FetchTableMap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_FetchTableMap() { - ::grpc::Service::MarkMethodRaw(3); - } - ~WithRawMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestFetchTableMap(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template class WithRawMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_ApplyPreviewColumns() { - ::grpc::Service::MarkMethodRaw(4); + ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_ApplyPreviewColumns() override { BaseClassMustBeDerivedFromService(this); @@ -4487,7 +3389,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestApplyPreviewColumns(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4496,7 +3398,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_EmptyTable() { - ::grpc::Service::MarkMethodRaw(5); + ::grpc::Service::MarkMethodRaw(4); } ~WithRawMethod_EmptyTable() override { BaseClassMustBeDerivedFromService(this); @@ -4507,7 +3409,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestEmptyTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4516,7 +3418,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_TimeTable() { - ::grpc::Service::MarkMethodRaw(6); + ::grpc::Service::MarkMethodRaw(5); } ~WithRawMethod_TimeTable() override { BaseClassMustBeDerivedFromService(this); @@ -4527,7 +3429,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTimeTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4536,7 +3438,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_DropColumns() { - ::grpc::Service::MarkMethodRaw(7); + ::grpc::Service::MarkMethodRaw(6); } ~WithRawMethod_DropColumns() override { BaseClassMustBeDerivedFromService(this); @@ -4547,7 +3449,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestDropColumns(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4556,7 +3458,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Update() { - ::grpc::Service::MarkMethodRaw(8); + ::grpc::Service::MarkMethodRaw(7); } ~WithRawMethod_Update() override { BaseClassMustBeDerivedFromService(this); @@ -4567,7 +3469,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUpdate(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4576,7 +3478,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_LazyUpdate() { - ::grpc::Service::MarkMethodRaw(9); + ::grpc::Service::MarkMethodRaw(8); } ~WithRawMethod_LazyUpdate() override { BaseClassMustBeDerivedFromService(this); @@ -4587,7 +3489,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestLazyUpdate(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4596,7 +3498,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_View() { - ::grpc::Service::MarkMethodRaw(10); + ::grpc::Service::MarkMethodRaw(9); } ~WithRawMethod_View() override { BaseClassMustBeDerivedFromService(this); @@ -4607,7 +3509,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestView(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4616,7 +3518,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_UpdateView() { - ::grpc::Service::MarkMethodRaw(11); + ::grpc::Service::MarkMethodRaw(10); } ~WithRawMethod_UpdateView() override { BaseClassMustBeDerivedFromService(this); @@ -4627,7 +3529,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUpdateView(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4636,7 +3538,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Select() { - ::grpc::Service::MarkMethodRaw(12); + ::grpc::Service::MarkMethodRaw(11); } ~WithRawMethod_Select() override { BaseClassMustBeDerivedFromService(this); @@ -4647,7 +3549,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSelect(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4656,7 +3558,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SelectDistinct() { - ::grpc::Service::MarkMethodRaw(13); + ::grpc::Service::MarkMethodRaw(12); } ~WithRawMethod_SelectDistinct() override { BaseClassMustBeDerivedFromService(this); @@ -4667,7 +3569,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSelectDistinct(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4676,7 +3578,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Filter() { - ::grpc::Service::MarkMethodRaw(14); + ::grpc::Service::MarkMethodRaw(13); } ~WithRawMethod_Filter() override { BaseClassMustBeDerivedFromService(this); @@ -4687,7 +3589,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestFilter(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4696,7 +3598,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_UnstructuredFilter() { - ::grpc::Service::MarkMethodRaw(15); + ::grpc::Service::MarkMethodRaw(14); } ~WithRawMethod_UnstructuredFilter() override { BaseClassMustBeDerivedFromService(this); @@ -4707,7 +3609,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUnstructuredFilter(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(15, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4716,7 +3618,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Sort() { - ::grpc::Service::MarkMethodRaw(16); + ::grpc::Service::MarkMethodRaw(15); } ~WithRawMethod_Sort() override { BaseClassMustBeDerivedFromService(this); @@ -4727,7 +3629,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSort(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(16, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(15, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4736,7 +3638,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Head() { - ::grpc::Service::MarkMethodRaw(17); + ::grpc::Service::MarkMethodRaw(16); } ~WithRawMethod_Head() override { BaseClassMustBeDerivedFromService(this); @@ -4747,7 +3649,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestHead(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(17, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(16, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4756,7 +3658,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Tail() { - ::grpc::Service::MarkMethodRaw(18); + ::grpc::Service::MarkMethodRaw(17); } ~WithRawMethod_Tail() override { BaseClassMustBeDerivedFromService(this); @@ -4767,7 +3669,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTail(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(18, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(17, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4776,7 +3678,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_HeadBy() { - ::grpc::Service::MarkMethodRaw(19); + ::grpc::Service::MarkMethodRaw(18); } ~WithRawMethod_HeadBy() override { BaseClassMustBeDerivedFromService(this); @@ -4787,7 +3689,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestHeadBy(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(19, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(18, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4796,7 +3698,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_TailBy() { - ::grpc::Service::MarkMethodRaw(20); + ::grpc::Service::MarkMethodRaw(19); } ~WithRawMethod_TailBy() override { BaseClassMustBeDerivedFromService(this); @@ -4807,7 +3709,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTailBy(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(20, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(19, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4816,7 +3718,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Ungroup() { - ::grpc::Service::MarkMethodRaw(21); + ::grpc::Service::MarkMethodRaw(20); } ~WithRawMethod_Ungroup() override { BaseClassMustBeDerivedFromService(this); @@ -4827,7 +3729,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestUngroup(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(21, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(20, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4836,7 +3738,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_MergeTables() { - ::grpc::Service::MarkMethodRaw(22); + ::grpc::Service::MarkMethodRaw(21); } ~WithRawMethod_MergeTables() override { BaseClassMustBeDerivedFromService(this); @@ -4847,7 +3749,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestMergeTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(22, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(21, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4856,7 +3758,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_CrossJoinTables() { - ::grpc::Service::MarkMethodRaw(23); + ::grpc::Service::MarkMethodRaw(22); } ~WithRawMethod_CrossJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4867,7 +3769,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCrossJoinTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(23, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(22, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4876,7 +3778,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_NaturalJoinTables() { - ::grpc::Service::MarkMethodRaw(24); + ::grpc::Service::MarkMethodRaw(23); } ~WithRawMethod_NaturalJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4887,7 +3789,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestNaturalJoinTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(24, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(23, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4896,7 +3798,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_ExactJoinTables() { - ::grpc::Service::MarkMethodRaw(25); + ::grpc::Service::MarkMethodRaw(24); } ~WithRawMethod_ExactJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4907,7 +3809,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestExactJoinTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(25, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(24, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4916,7 +3818,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_LeftJoinTables() { - ::grpc::Service::MarkMethodRaw(26); + ::grpc::Service::MarkMethodRaw(25); } ~WithRawMethod_LeftJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4927,7 +3829,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestLeftJoinTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(26, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(25, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4936,7 +3838,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_AsOfJoinTables() { - ::grpc::Service::MarkMethodRaw(27); + ::grpc::Service::MarkMethodRaw(26); } ~WithRawMethod_AsOfJoinTables() override { BaseClassMustBeDerivedFromService(this); @@ -4947,7 +3849,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestAsOfJoinTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(27, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(26, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4956,7 +3858,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_ComboAggregate() { - ::grpc::Service::MarkMethodRaw(28); + ::grpc::Service::MarkMethodRaw(27); } ~WithRawMethod_ComboAggregate() override { BaseClassMustBeDerivedFromService(this); @@ -4967,7 +3869,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestComboAggregate(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(28, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(27, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4976,7 +3878,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Snapshot() { - ::grpc::Service::MarkMethodRaw(29); + ::grpc::Service::MarkMethodRaw(28); } ~WithRawMethod_Snapshot() override { BaseClassMustBeDerivedFromService(this); @@ -4987,7 +3889,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSnapshot(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(29, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(28, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -4996,7 +3898,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Flatten() { - ::grpc::Service::MarkMethodRaw(30); + ::grpc::Service::MarkMethodRaw(29); } ~WithRawMethod_Flatten() override { BaseClassMustBeDerivedFromService(this); @@ -5007,7 +3909,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestFlatten(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(30, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(29, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -5016,7 +3918,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_RunChartDownsample() { - ::grpc::Service::MarkMethodRaw(31); + ::grpc::Service::MarkMethodRaw(30); } ~WithRawMethod_RunChartDownsample() override { BaseClassMustBeDerivedFromService(this); @@ -5027,7 +3929,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRunChartDownsample(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(31, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(30, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -5036,7 +3938,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_CreateInputTable() { - ::grpc::Service::MarkMethodRaw(32); + ::grpc::Service::MarkMethodRaw(31); } ~WithRawMethod_CreateInputTable() override { BaseClassMustBeDerivedFromService(this); @@ -5047,7 +3949,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCreateInputTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(32, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(31, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -5056,7 +3958,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Batch() { - ::grpc::Service::MarkMethodRaw(33); + ::grpc::Service::MarkMethodRaw(32); } ~WithRawMethod_Batch() override { BaseClassMustBeDerivedFromService(this); @@ -5067,7 +3969,7 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestBatch(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(33, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(32, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -5076,7 +3978,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_ExportedTableUpdates() { - ::grpc::Service::MarkMethodRaw(34); + ::grpc::Service::MarkMethodRaw(33); } ~WithRawMethod_ExportedTableUpdates() override { BaseClassMustBeDerivedFromService(this); @@ -5087,31 +3989,21 @@ class TableService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestExportedTableUpdates(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(34, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(33, context, request, writer, new_call_cq, notification_cq, tag); } }; template - class ExperimentalWithRawCallbackMethod_GetExportedTableCreationResponse : public BaseClass { + class WithRawCallbackMethod_GetExportedTableCreationResponse : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_GetExportedTableCreationResponse() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(0, + WithRawCallbackMethod_GetExportedTableCreationResponse() { + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetExportedTableCreationResponse(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetExportedTableCreationResponse(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_GetExportedTableCreationResponse() override { + ~WithRawCallbackMethod_GetExportedTableCreationResponse() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5119,37 +4011,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* GetExportedTableCreationResponse( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* GetExportedTableCreationResponse( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_FetchTable : public BaseClass { + class WithRawCallbackMethod_FetchTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_FetchTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(1, + WithRawCallbackMethod_FetchTable() { + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchTable(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchTable(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_FetchTable() override { + ~WithRawCallbackMethod_FetchTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5157,37 +4033,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_FetchPandasTable : public BaseClass { + class WithRawCallbackMethod_FetchPandasTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_FetchPandasTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(2, + WithRawCallbackMethod_FetchPandasTable() { + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchPandasTable(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchPandasTable(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_FetchPandasTable() override { + ~WithRawCallbackMethod_FetchPandasTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5195,75 +4055,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* FetchPandasTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchPandasTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_FetchTableMap : public BaseClass { + class WithRawCallbackMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_FetchTableMap() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(3, + WithRawCallbackMethod_ApplyPreviewColumns() { + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->FetchTableMap(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ApplyPreviewColumns(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - virtual ::grpc::ServerUnaryReactor* FetchTableMap( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* FetchTableMap( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } - }; - template - class ExperimentalWithRawCallbackMethod_ApplyPreviewColumns : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_ApplyPreviewColumns() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(4, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ApplyPreviewColumns(context, request, response); })); - } - ~ExperimentalWithRawCallbackMethod_ApplyPreviewColumns() override { + ~WithRawCallbackMethod_ApplyPreviewColumns() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5271,37 +4077,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ApplyPreviewColumns( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ApplyPreviewColumns( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_EmptyTable : public BaseClass { + class WithRawCallbackMethod_EmptyTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_EmptyTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(5, + WithRawCallbackMethod_EmptyTable() { + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->EmptyTable(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->EmptyTable(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_EmptyTable() override { + ~WithRawCallbackMethod_EmptyTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5309,37 +4099,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* EmptyTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* EmptyTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_TimeTable : public BaseClass { + class WithRawCallbackMethod_TimeTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_TimeTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(6, + WithRawCallbackMethod_TimeTable() { + ::grpc::Service::MarkMethodRawCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TimeTable(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TimeTable(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_TimeTable() override { + ~WithRawCallbackMethod_TimeTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5347,37 +4121,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TimeTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TimeTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_DropColumns : public BaseClass { + class WithRawCallbackMethod_DropColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_DropColumns() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(7, + WithRawCallbackMethod_DropColumns() { + ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->DropColumns(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->DropColumns(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_DropColumns() override { + ~WithRawCallbackMethod_DropColumns() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5385,37 +4143,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* DropColumns( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* DropColumns( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Update : public BaseClass { + class WithRawCallbackMethod_Update : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Update() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(8, + WithRawCallbackMethod_Update() { + ::grpc::Service::MarkMethodRawCallback(7, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Update(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Update(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Update() override { + ~WithRawCallbackMethod_Update() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5423,37 +4165,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Update( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Update( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_LazyUpdate : public BaseClass { + class WithRawCallbackMethod_LazyUpdate : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_LazyUpdate() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(9, + WithRawCallbackMethod_LazyUpdate() { + ::grpc::Service::MarkMethodRawCallback(8, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->LazyUpdate(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->LazyUpdate(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_LazyUpdate() override { + ~WithRawCallbackMethod_LazyUpdate() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5461,37 +4187,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* LazyUpdate( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* LazyUpdate( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_View : public BaseClass { + class WithRawCallbackMethod_View : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_View() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(10, + WithRawCallbackMethod_View() { + ::grpc::Service::MarkMethodRawCallback(9, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->View(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->View(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_View() override { + ~WithRawCallbackMethod_View() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5499,37 +4209,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* View( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* View( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_UpdateView : public BaseClass { + class WithRawCallbackMethod_UpdateView : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_UpdateView() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(11, + WithRawCallbackMethod_UpdateView() { + ::grpc::Service::MarkMethodRawCallback(10, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->UpdateView(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->UpdateView(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_UpdateView() override { + ~WithRawCallbackMethod_UpdateView() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5537,37 +4231,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* UpdateView( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* UpdateView( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Select : public BaseClass { + class WithRawCallbackMethod_Select : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Select() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(12, + WithRawCallbackMethod_Select() { + ::grpc::Service::MarkMethodRawCallback(11, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Select(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Select(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Select() override { + ~WithRawCallbackMethod_Select() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5575,37 +4253,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Select( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Select( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_SelectDistinct : public BaseClass { + class WithRawCallbackMethod_SelectDistinct : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_SelectDistinct() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(13, + WithRawCallbackMethod_SelectDistinct() { + ::grpc::Service::MarkMethodRawCallback(12, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SelectDistinct(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SelectDistinct(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_SelectDistinct() override { + ~WithRawCallbackMethod_SelectDistinct() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5613,37 +4275,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* SelectDistinct( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* SelectDistinct( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Filter : public BaseClass { + class WithRawCallbackMethod_Filter : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Filter() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(14, + WithRawCallbackMethod_Filter() { + ::grpc::Service::MarkMethodRawCallback(13, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Filter(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Filter(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Filter() override { + ~WithRawCallbackMethod_Filter() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5651,37 +4297,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Filter( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Filter( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_UnstructuredFilter : public BaseClass { + class WithRawCallbackMethod_UnstructuredFilter : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_UnstructuredFilter() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(15, + WithRawCallbackMethod_UnstructuredFilter() { + ::grpc::Service::MarkMethodRawCallback(14, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->UnstructuredFilter(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->UnstructuredFilter(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_UnstructuredFilter() override { + ~WithRawCallbackMethod_UnstructuredFilter() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5689,37 +4319,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* UnstructuredFilter( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* UnstructuredFilter( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Sort : public BaseClass { + class WithRawCallbackMethod_Sort : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Sort() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(16, + WithRawCallbackMethod_Sort() { + ::grpc::Service::MarkMethodRawCallback(15, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Sort(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Sort(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Sort() override { + ~WithRawCallbackMethod_Sort() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5727,37 +4341,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Sort( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Sort( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Head : public BaseClass { + class WithRawCallbackMethod_Head : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Head() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(17, + WithRawCallbackMethod_Head() { + ::grpc::Service::MarkMethodRawCallback(16, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Head(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Head(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Head() override { + ~WithRawCallbackMethod_Head() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5765,37 +4363,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Head( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Head( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Tail : public BaseClass { + class WithRawCallbackMethod_Tail : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Tail() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(18, + WithRawCallbackMethod_Tail() { + ::grpc::Service::MarkMethodRawCallback(17, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Tail(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Tail(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Tail() override { + ~WithRawCallbackMethod_Tail() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5803,37 +4385,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Tail( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Tail( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_HeadBy : public BaseClass { + class WithRawCallbackMethod_HeadBy : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_HeadBy() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(19, + WithRawCallbackMethod_HeadBy() { + ::grpc::Service::MarkMethodRawCallback(18, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->HeadBy(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->HeadBy(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_HeadBy() override { + ~WithRawCallbackMethod_HeadBy() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5841,37 +4407,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* HeadBy( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* HeadBy( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_TailBy : public BaseClass { + class WithRawCallbackMethod_TailBy : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_TailBy() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(20, + WithRawCallbackMethod_TailBy() { + ::grpc::Service::MarkMethodRawCallback(19, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TailBy(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TailBy(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_TailBy() override { + ~WithRawCallbackMethod_TailBy() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5879,37 +4429,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* TailBy( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* TailBy( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Ungroup : public BaseClass { + class WithRawCallbackMethod_Ungroup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Ungroup() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(21, + WithRawCallbackMethod_Ungroup() { + ::grpc::Service::MarkMethodRawCallback(20, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Ungroup(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Ungroup(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Ungroup() override { + ~WithRawCallbackMethod_Ungroup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5917,37 +4451,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Ungroup( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Ungroup( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_MergeTables : public BaseClass { + class WithRawCallbackMethod_MergeTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_MergeTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(22, + WithRawCallbackMethod_MergeTables() { + ::grpc::Service::MarkMethodRawCallback(21, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MergeTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MergeTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_MergeTables() override { + ~WithRawCallbackMethod_MergeTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5955,37 +4473,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* MergeTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* MergeTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_CrossJoinTables : public BaseClass { + class WithRawCallbackMethod_CrossJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_CrossJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(23, + WithRawCallbackMethod_CrossJoinTables() { + ::grpc::Service::MarkMethodRawCallback(22, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CrossJoinTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CrossJoinTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_CrossJoinTables() override { + ~WithRawCallbackMethod_CrossJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -5993,37 +4495,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CrossJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CrossJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_NaturalJoinTables : public BaseClass { + class WithRawCallbackMethod_NaturalJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_NaturalJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(24, + WithRawCallbackMethod_NaturalJoinTables() { + ::grpc::Service::MarkMethodRawCallback(23, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NaturalJoinTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NaturalJoinTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_NaturalJoinTables() override { + ~WithRawCallbackMethod_NaturalJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6031,37 +4517,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* NaturalJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* NaturalJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ExactJoinTables : public BaseClass { + class WithRawCallbackMethod_ExactJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ExactJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(25, + WithRawCallbackMethod_ExactJoinTables() { + ::grpc::Service::MarkMethodRawCallback(24, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExactJoinTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ExactJoinTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_ExactJoinTables() override { + ~WithRawCallbackMethod_ExactJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6069,37 +4539,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ExactJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ExactJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_LeftJoinTables : public BaseClass { + class WithRawCallbackMethod_LeftJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_LeftJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(26, + WithRawCallbackMethod_LeftJoinTables() { + ::grpc::Service::MarkMethodRawCallback(25, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->LeftJoinTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->LeftJoinTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_LeftJoinTables() override { + ~WithRawCallbackMethod_LeftJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6107,37 +4561,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* LeftJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* LeftJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_AsOfJoinTables : public BaseClass { + class WithRawCallbackMethod_AsOfJoinTables : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_AsOfJoinTables() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(27, + WithRawCallbackMethod_AsOfJoinTables() { + ::grpc::Service::MarkMethodRawCallback(26, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->AsOfJoinTables(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->AsOfJoinTables(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_AsOfJoinTables() override { + ~WithRawCallbackMethod_AsOfJoinTables() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6145,37 +4583,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* AsOfJoinTables( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* AsOfJoinTables( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ComboAggregate : public BaseClass { + class WithRawCallbackMethod_ComboAggregate : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ComboAggregate() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(28, + WithRawCallbackMethod_ComboAggregate() { + ::grpc::Service::MarkMethodRawCallback(27, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ComboAggregate(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ComboAggregate(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_ComboAggregate() override { + ~WithRawCallbackMethod_ComboAggregate() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6183,37 +4605,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* ComboAggregate( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* ComboAggregate( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Snapshot : public BaseClass { + class WithRawCallbackMethod_Snapshot : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Snapshot() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(29, + WithRawCallbackMethod_Snapshot() { + ::grpc::Service::MarkMethodRawCallback(28, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Snapshot(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Snapshot(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Snapshot() override { + ~WithRawCallbackMethod_Snapshot() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6221,37 +4627,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Snapshot( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Snapshot( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Flatten : public BaseClass { + class WithRawCallbackMethod_Flatten : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Flatten() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(30, + WithRawCallbackMethod_Flatten() { + ::grpc::Service::MarkMethodRawCallback(29, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Flatten(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Flatten(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_Flatten() override { + ~WithRawCallbackMethod_Flatten() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6259,37 +4649,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* Flatten( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* Flatten( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_RunChartDownsample : public BaseClass { + class WithRawCallbackMethod_RunChartDownsample : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_RunChartDownsample() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(31, + WithRawCallbackMethod_RunChartDownsample() { + ::grpc::Service::MarkMethodRawCallback(30, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RunChartDownsample(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RunChartDownsample(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_RunChartDownsample() override { + ~WithRawCallbackMethod_RunChartDownsample() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6297,37 +4671,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* RunChartDownsample( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* RunChartDownsample( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_CreateInputTable : public BaseClass { + class WithRawCallbackMethod_CreateInputTable : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_CreateInputTable() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(32, + WithRawCallbackMethod_CreateInputTable() { + ::grpc::Service::MarkMethodRawCallback(31, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CreateInputTable(context, request, response); })); + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CreateInputTable(context, request, response); })); } - ~ExperimentalWithRawCallbackMethod_CreateInputTable() override { + ~WithRawCallbackMethod_CreateInputTable() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6335,37 +4693,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerUnaryReactor* CreateInputTable( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #else - virtual ::grpc::experimental::ServerUnaryReactor* CreateInputTable( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_Batch : public BaseClass { + class WithRawCallbackMethod_Batch : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_Batch() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(33, + WithRawCallbackMethod_Batch() { + ::grpc::Service::MarkMethodRawCallback(32, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->Batch(context, request); })); + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->Batch(context, request); })); } - ~ExperimentalWithRawCallbackMethod_Batch() override { + ~WithRawCallbackMethod_Batch() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6373,37 +4715,21 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* Batch( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* Batch( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template - class ExperimentalWithRawCallbackMethod_ExportedTableUpdates : public BaseClass { + class WithRawCallbackMethod_ExportedTableUpdates : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: - ExperimentalWithRawCallbackMethod_ExportedTableUpdates() { - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::Service:: - #else - ::grpc::Service::experimental(). - #endif - MarkMethodRawCallback(34, + WithRawCallbackMethod_ExportedTableUpdates() { + ::grpc::Service::MarkMethodRawCallback(33, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL - ::grpc::CallbackServerContext* - #else - ::grpc::experimental::CallbackServerContext* - #endif - context, const::grpc::ByteBuffer* request) { return this->ExportedTableUpdates(context, request); })); + ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->ExportedTableUpdates(context, request); })); } - ~ExperimentalWithRawCallbackMethod_ExportedTableUpdates() override { + ~WithRawCallbackMethod_ExportedTableUpdates() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method @@ -6411,14 +4737,8 @@ class TableService final { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* ExportedTableUpdates( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #else - virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* ExportedTableUpdates( - ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) - #endif - { return nullptr; } + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template class WithStreamedUnaryMethod_GetExportedTableCreationResponse : public BaseClass { @@ -6502,39 +4822,12 @@ class TableService final { virtual ::grpc::Status StreamedFetchPandasTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest,::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* server_unary_streamer) = 0; }; template - class WithStreamedUnaryMethod_FetchTableMap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_FetchTableMap() { - ::grpc::Service::MarkMethodStreamed(3, - new ::grpc::internal::StreamedUnaryHandler< - ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* streamer) { - return this->StreamedFetchTableMap(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_FetchTableMap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status FetchTableMap(::grpc::ServerContext* /*context*/, const ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* /*request*/, ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedFetchTableMap(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest,::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>* server_unary_streamer) = 0; - }; - template class WithStreamedUnaryMethod_ApplyPreviewColumns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_ApplyPreviewColumns() { - ::grpc::Service::MarkMethodStreamed(4, + ::grpc::Service::MarkMethodStreamed(3, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6561,7 +4854,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_EmptyTable() { - ::grpc::Service::MarkMethodStreamed(5, + ::grpc::Service::MarkMethodStreamed(4, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6588,7 +4881,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_TimeTable() { - ::grpc::Service::MarkMethodStreamed(6, + ::grpc::Service::MarkMethodStreamed(5, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::TimeTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6615,7 +4908,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_DropColumns() { - ::grpc::Service::MarkMethodStreamed(7, + ::grpc::Service::MarkMethodStreamed(6, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6642,7 +4935,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Update() { - ::grpc::Service::MarkMethodStreamed(8, + ::grpc::Service::MarkMethodStreamed(7, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6669,7 +4962,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_LazyUpdate() { - ::grpc::Service::MarkMethodStreamed(9, + ::grpc::Service::MarkMethodStreamed(8, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6696,7 +4989,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_View() { - ::grpc::Service::MarkMethodStreamed(10, + ::grpc::Service::MarkMethodStreamed(9, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6723,7 +5016,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_UpdateView() { - ::grpc::Service::MarkMethodStreamed(11, + ::grpc::Service::MarkMethodStreamed(10, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6750,7 +5043,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Select() { - ::grpc::Service::MarkMethodStreamed(12, + ::grpc::Service::MarkMethodStreamed(11, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6777,7 +5070,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SelectDistinct() { - ::grpc::Service::MarkMethodStreamed(13, + ::grpc::Service::MarkMethodStreamed(12, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6804,7 +5097,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Filter() { - ::grpc::Service::MarkMethodStreamed(14, + ::grpc::Service::MarkMethodStreamed(13, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::FilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6831,7 +5124,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_UnstructuredFilter() { - ::grpc::Service::MarkMethodStreamed(15, + ::grpc::Service::MarkMethodStreamed(14, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6858,7 +5151,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Sort() { - ::grpc::Service::MarkMethodStreamed(16, + ::grpc::Service::MarkMethodStreamed(15, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SortTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6885,7 +5178,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Head() { - ::grpc::Service::MarkMethodStreamed(17, + ::grpc::Service::MarkMethodStreamed(16, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6912,7 +5205,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Tail() { - ::grpc::Service::MarkMethodStreamed(18, + ::grpc::Service::MarkMethodStreamed(17, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6939,7 +5232,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_HeadBy() { - ::grpc::Service::MarkMethodStreamed(19, + ::grpc::Service::MarkMethodStreamed(18, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6966,7 +5259,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_TailBy() { - ::grpc::Service::MarkMethodStreamed(20, + ::grpc::Service::MarkMethodStreamed(19, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -6993,7 +5286,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Ungroup() { - ::grpc::Service::MarkMethodStreamed(21, + ::grpc::Service::MarkMethodStreamed(20, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::UngroupRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7020,7 +5313,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_MergeTables() { - ::grpc::Service::MarkMethodStreamed(22, + ::grpc::Service::MarkMethodStreamed(21, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7047,7 +5340,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_CrossJoinTables() { - ::grpc::Service::MarkMethodStreamed(23, + ::grpc::Service::MarkMethodStreamed(22, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7074,7 +5367,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_NaturalJoinTables() { - ::grpc::Service::MarkMethodStreamed(24, + ::grpc::Service::MarkMethodStreamed(23, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7101,7 +5394,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_ExactJoinTables() { - ::grpc::Service::MarkMethodStreamed(25, + ::grpc::Service::MarkMethodStreamed(24, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7128,7 +5421,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_LeftJoinTables() { - ::grpc::Service::MarkMethodStreamed(26, + ::grpc::Service::MarkMethodStreamed(25, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7155,7 +5448,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_AsOfJoinTables() { - ::grpc::Service::MarkMethodStreamed(27, + ::grpc::Service::MarkMethodStreamed(26, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7182,7 +5475,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_ComboAggregate() { - ::grpc::Service::MarkMethodStreamed(28, + ::grpc::Service::MarkMethodStreamed(27, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7209,7 +5502,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Snapshot() { - ::grpc::Service::MarkMethodStreamed(29, + ::grpc::Service::MarkMethodStreamed(28, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7236,7 +5529,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Flatten() { - ::grpc::Service::MarkMethodStreamed(30, + ::grpc::Service::MarkMethodStreamed(29, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::FlattenRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7263,7 +5556,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_RunChartDownsample() { - ::grpc::Service::MarkMethodStreamed(31, + ::grpc::Service::MarkMethodStreamed(30, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7290,7 +5583,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_CreateInputTable() { - ::grpc::Service::MarkMethodStreamed(32, + ::grpc::Service::MarkMethodStreamed(31, new ::grpc::internal::StreamedUnaryHandler< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7311,14 +5604,14 @@ class TableService final { // replace default version of method with streamed unary virtual ::grpc::Status StreamedCreateInputTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest,::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedUnaryService; + typedef WithStreamedUnaryMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedUnaryService; template class WithSplitStreamingMethod_Batch : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_Batch() { - ::grpc::Service::MarkMethodStreamed(33, + ::grpc::Service::MarkMethodStreamed(32, new ::grpc::internal::SplitServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::BatchTableRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse>( [this](::grpc::ServerContext* context, @@ -7345,7 +5638,7 @@ class TableService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_ExportedTableUpdates() { - ::grpc::Service::MarkMethodStreamed(34, + ::grpc::Service::MarkMethodStreamed(33, new ::grpc::internal::SplitServerStreamingHandler< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest, ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>( [this](::grpc::ServerContext* context, @@ -7367,7 +5660,7 @@ class TableService final { virtual ::grpc::Status StreamedExportedTableUpdates(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest,::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_Batch > SplitStreamedService; - typedef WithStreamedUnaryMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedService; + typedef WithStreamedUnaryMethod_GetExportedTableCreationResponse > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedService; }; } // namespace grpc diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.cc index 5513a3ee70c..37c0dab1da1 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/table.proto @@ -19,287 +16,267 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr TableReference::TableReference( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_CONSTEXPR TableReference::TableReference( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct TableReferenceDefaultTypeInternal { - constexpr TableReferenceDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TableReferenceDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TableReferenceDefaultTypeInternal() {} union { TableReference _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TableReferenceDefaultTypeInternal _TableReference_default_instance_; -constexpr ExportedTableCreationResponse::ExportedTableCreationResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : error_info_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , schema_header_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TableReferenceDefaultTypeInternal _TableReference_default_instance_; +PROTOBUF_CONSTEXPR ExportedTableCreationResponse::ExportedTableCreationResponse( + ::_pbi::ConstantInitialized) + : error_info_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) + , schema_header_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , result_id_(nullptr) , size_(int64_t{0}) , success_(false) , is_static_(false){} struct ExportedTableCreationResponseDefaultTypeInternal { - constexpr ExportedTableCreationResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportedTableCreationResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportedTableCreationResponseDefaultTypeInternal() {} union { ExportedTableCreationResponse _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportedTableCreationResponseDefaultTypeInternal _ExportedTableCreationResponse_default_instance_; -constexpr FetchTableRequest::FetchTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportedTableCreationResponseDefaultTypeInternal _ExportedTableCreationResponse_default_instance_; +PROTOBUF_CONSTEXPR FetchTableRequest::FetchTableRequest( + ::_pbi::ConstantInitialized) : source_id_(nullptr) , result_id_(nullptr){} struct FetchTableRequestDefaultTypeInternal { - constexpr FetchTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FetchTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FetchTableRequestDefaultTypeInternal() {} union { FetchTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchTableRequestDefaultTypeInternal _FetchTableRequest_default_instance_; -constexpr ApplyPreviewColumnsRequest::ApplyPreviewColumnsRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FetchTableRequestDefaultTypeInternal _FetchTableRequest_default_instance_; +PROTOBUF_CONSTEXPR ApplyPreviewColumnsRequest::ApplyPreviewColumnsRequest( + ::_pbi::ConstantInitialized) : source_id_(nullptr) , result_id_(nullptr){} struct ApplyPreviewColumnsRequestDefaultTypeInternal { - constexpr ApplyPreviewColumnsRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ApplyPreviewColumnsRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ApplyPreviewColumnsRequestDefaultTypeInternal() {} union { ApplyPreviewColumnsRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ApplyPreviewColumnsRequestDefaultTypeInternal _ApplyPreviewColumnsRequest_default_instance_; -constexpr FetchPandasTableRequest::FetchPandasTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ApplyPreviewColumnsRequestDefaultTypeInternal _ApplyPreviewColumnsRequest_default_instance_; +PROTOBUF_CONSTEXPR FetchPandasTableRequest::FetchPandasTableRequest( + ::_pbi::ConstantInitialized) : source_id_(nullptr) , result_id_(nullptr){} struct FetchPandasTableRequestDefaultTypeInternal { - constexpr FetchPandasTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FetchPandasTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FetchPandasTableRequestDefaultTypeInternal() {} union { FetchPandasTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchPandasTableRequestDefaultTypeInternal _FetchPandasTableRequest_default_instance_; -constexpr FetchTableMapRequest::FetchTableMapRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : source_id_(nullptr) - , result_id_(nullptr){} -struct FetchTableMapRequestDefaultTypeInternal { - constexpr FetchTableMapRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~FetchTableMapRequestDefaultTypeInternal() {} - union { - FetchTableMapRequest _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchTableMapRequestDefaultTypeInternal _FetchTableMapRequest_default_instance_; -constexpr FetchTableMapResponse::FetchTableMapResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} -struct FetchTableMapResponseDefaultTypeInternal { - constexpr FetchTableMapResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~FetchTableMapResponseDefaultTypeInternal() {} - union { - FetchTableMapResponse _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FetchTableMapResponseDefaultTypeInternal _FetchTableMapResponse_default_instance_; -constexpr ExportedTableUpdatesRequest::ExportedTableUpdatesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FetchPandasTableRequestDefaultTypeInternal _FetchPandasTableRequest_default_instance_; +PROTOBUF_CONSTEXPR ExportedTableUpdatesRequest::ExportedTableUpdatesRequest( + ::_pbi::ConstantInitialized){} struct ExportedTableUpdatesRequestDefaultTypeInternal { - constexpr ExportedTableUpdatesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportedTableUpdatesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportedTableUpdatesRequestDefaultTypeInternal() {} union { ExportedTableUpdatesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportedTableUpdatesRequestDefaultTypeInternal _ExportedTableUpdatesRequest_default_instance_; -constexpr ExportedTableUpdateMessage::ExportedTableUpdateMessage( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : update_failure_message_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportedTableUpdatesRequestDefaultTypeInternal _ExportedTableUpdatesRequest_default_instance_; +PROTOBUF_CONSTEXPR ExportedTableUpdateMessage::ExportedTableUpdateMessage( + ::_pbi::ConstantInitialized) + : update_failure_message_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , export_id_(nullptr) , size_(int64_t{0}){} struct ExportedTableUpdateMessageDefaultTypeInternal { - constexpr ExportedTableUpdateMessageDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExportedTableUpdateMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExportedTableUpdateMessageDefaultTypeInternal() {} union { ExportedTableUpdateMessage _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExportedTableUpdateMessageDefaultTypeInternal _ExportedTableUpdateMessage_default_instance_; -constexpr EmptyTableRequest::EmptyTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExportedTableUpdateMessageDefaultTypeInternal _ExportedTableUpdateMessage_default_instance_; +PROTOBUF_CONSTEXPR EmptyTableRequest::EmptyTableRequest( + ::_pbi::ConstantInitialized) : result_id_(nullptr) , size_(int64_t{0}){} struct EmptyTableRequestDefaultTypeInternal { - constexpr EmptyTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR EmptyTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~EmptyTableRequestDefaultTypeInternal() {} union { EmptyTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EmptyTableRequestDefaultTypeInternal _EmptyTableRequest_default_instance_; -constexpr TimeTableRequest::TimeTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EmptyTableRequestDefaultTypeInternal _EmptyTableRequest_default_instance_; +PROTOBUF_CONSTEXPR TimeTableRequest::TimeTableRequest( + ::_pbi::ConstantInitialized) : result_id_(nullptr) , start_time_nanos_(int64_t{0}) , period_nanos_(int64_t{0}){} struct TimeTableRequestDefaultTypeInternal { - constexpr TimeTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TimeTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TimeTableRequestDefaultTypeInternal() {} union { TimeTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TimeTableRequestDefaultTypeInternal _TimeTableRequest_default_instance_; -constexpr SelectOrUpdateRequest::SelectOrUpdateRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TimeTableRequestDefaultTypeInternal _TimeTableRequest_default_instance_; +PROTOBUF_CONSTEXPR SelectOrUpdateRequest::SelectOrUpdateRequest( + ::_pbi::ConstantInitialized) : column_specs_() , result_id_(nullptr) , source_id_(nullptr){} struct SelectOrUpdateRequestDefaultTypeInternal { - constexpr SelectOrUpdateRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SelectOrUpdateRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SelectOrUpdateRequestDefaultTypeInternal() {} union { SelectOrUpdateRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SelectOrUpdateRequestDefaultTypeInternal _SelectOrUpdateRequest_default_instance_; -constexpr SelectDistinctRequest::SelectDistinctRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelectOrUpdateRequestDefaultTypeInternal _SelectOrUpdateRequest_default_instance_; +PROTOBUF_CONSTEXPR SelectDistinctRequest::SelectDistinctRequest( + ::_pbi::ConstantInitialized) : column_names_() , result_id_(nullptr) , source_id_(nullptr){} struct SelectDistinctRequestDefaultTypeInternal { - constexpr SelectDistinctRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SelectDistinctRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SelectDistinctRequestDefaultTypeInternal() {} union { SelectDistinctRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SelectDistinctRequestDefaultTypeInternal _SelectDistinctRequest_default_instance_; -constexpr DropColumnsRequest::DropColumnsRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelectDistinctRequestDefaultTypeInternal _SelectDistinctRequest_default_instance_; +PROTOBUF_CONSTEXPR DropColumnsRequest::DropColumnsRequest( + ::_pbi::ConstantInitialized) : column_names_() , result_id_(nullptr) , source_id_(nullptr){} struct DropColumnsRequestDefaultTypeInternal { - constexpr DropColumnsRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR DropColumnsRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~DropColumnsRequestDefaultTypeInternal() {} union { DropColumnsRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DropColumnsRequestDefaultTypeInternal _DropColumnsRequest_default_instance_; -constexpr UnstructuredFilterTableRequest::UnstructuredFilterTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DropColumnsRequestDefaultTypeInternal _DropColumnsRequest_default_instance_; +PROTOBUF_CONSTEXPR UnstructuredFilterTableRequest::UnstructuredFilterTableRequest( + ::_pbi::ConstantInitialized) : filters_() , result_id_(nullptr) , source_id_(nullptr){} struct UnstructuredFilterTableRequestDefaultTypeInternal { - constexpr UnstructuredFilterTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR UnstructuredFilterTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~UnstructuredFilterTableRequestDefaultTypeInternal() {} union { UnstructuredFilterTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UnstructuredFilterTableRequestDefaultTypeInternal _UnstructuredFilterTableRequest_default_instance_; -constexpr HeadOrTailRequest::HeadOrTailRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UnstructuredFilterTableRequestDefaultTypeInternal _UnstructuredFilterTableRequest_default_instance_; +PROTOBUF_CONSTEXPR HeadOrTailRequest::HeadOrTailRequest( + ::_pbi::ConstantInitialized) : result_id_(nullptr) , source_id_(nullptr) , num_rows_(int64_t{0}){} struct HeadOrTailRequestDefaultTypeInternal { - constexpr HeadOrTailRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR HeadOrTailRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~HeadOrTailRequestDefaultTypeInternal() {} union { HeadOrTailRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HeadOrTailRequestDefaultTypeInternal _HeadOrTailRequest_default_instance_; -constexpr HeadOrTailByRequest::HeadOrTailByRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeadOrTailRequestDefaultTypeInternal _HeadOrTailRequest_default_instance_; +PROTOBUF_CONSTEXPR HeadOrTailByRequest::HeadOrTailByRequest( + ::_pbi::ConstantInitialized) : group_by_column_specs_() , result_id_(nullptr) , source_id_(nullptr) , num_rows_(int64_t{0}){} struct HeadOrTailByRequestDefaultTypeInternal { - constexpr HeadOrTailByRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR HeadOrTailByRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~HeadOrTailByRequestDefaultTypeInternal() {} union { HeadOrTailByRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HeadOrTailByRequestDefaultTypeInternal _HeadOrTailByRequest_default_instance_; -constexpr UngroupRequest::UngroupRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeadOrTailByRequestDefaultTypeInternal _HeadOrTailByRequest_default_instance_; +PROTOBUF_CONSTEXPR UngroupRequest::UngroupRequest( + ::_pbi::ConstantInitialized) : columns_to_ungroup_() , result_id_(nullptr) , source_id_(nullptr) , null_fill_(false){} struct UngroupRequestDefaultTypeInternal { - constexpr UngroupRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR UngroupRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~UngroupRequestDefaultTypeInternal() {} union { UngroupRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UngroupRequestDefaultTypeInternal _UngroupRequest_default_instance_; -constexpr MergeTablesRequest::MergeTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UngroupRequestDefaultTypeInternal _UngroupRequest_default_instance_; +PROTOBUF_CONSTEXPR MergeTablesRequest::MergeTablesRequest( + ::_pbi::ConstantInitialized) : source_ids_() - , key_column_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , key_column_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , result_id_(nullptr){} struct MergeTablesRequestDefaultTypeInternal { - constexpr MergeTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR MergeTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~MergeTablesRequestDefaultTypeInternal() {} union { MergeTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MergeTablesRequestDefaultTypeInternal _MergeTablesRequest_default_instance_; -constexpr SnapshotTableRequest::SnapshotTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MergeTablesRequestDefaultTypeInternal _MergeTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR SnapshotTableRequest::SnapshotTableRequest( + ::_pbi::ConstantInitialized) : stamp_columns_() , result_id_(nullptr) , left_id_(nullptr) , right_id_(nullptr) , do_initial_snapshot_(false){} struct SnapshotTableRequestDefaultTypeInternal { - constexpr SnapshotTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SnapshotTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SnapshotTableRequestDefaultTypeInternal() {} union { SnapshotTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SnapshotTableRequestDefaultTypeInternal _SnapshotTableRequest_default_instance_; -constexpr CrossJoinTablesRequest::CrossJoinTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SnapshotTableRequestDefaultTypeInternal _SnapshotTableRequest_default_instance_; +PROTOBUF_CONSTEXPR CrossJoinTablesRequest::CrossJoinTablesRequest( + ::_pbi::ConstantInitialized) : columns_to_match_() , columns_to_add_() , result_id_(nullptr) @@ -307,64 +284,64 @@ constexpr CrossJoinTablesRequest::CrossJoinTablesRequest( , right_id_(nullptr) , reserve_bits_(0){} struct CrossJoinTablesRequestDefaultTypeInternal { - constexpr CrossJoinTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CrossJoinTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CrossJoinTablesRequestDefaultTypeInternal() {} union { CrossJoinTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CrossJoinTablesRequestDefaultTypeInternal _CrossJoinTablesRequest_default_instance_; -constexpr NaturalJoinTablesRequest::NaturalJoinTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CrossJoinTablesRequestDefaultTypeInternal _CrossJoinTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR NaturalJoinTablesRequest::NaturalJoinTablesRequest( + ::_pbi::ConstantInitialized) : columns_to_match_() , columns_to_add_() , result_id_(nullptr) , left_id_(nullptr) , right_id_(nullptr){} struct NaturalJoinTablesRequestDefaultTypeInternal { - constexpr NaturalJoinTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR NaturalJoinTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~NaturalJoinTablesRequestDefaultTypeInternal() {} union { NaturalJoinTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NaturalJoinTablesRequestDefaultTypeInternal _NaturalJoinTablesRequest_default_instance_; -constexpr ExactJoinTablesRequest::ExactJoinTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NaturalJoinTablesRequestDefaultTypeInternal _NaturalJoinTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR ExactJoinTablesRequest::ExactJoinTablesRequest( + ::_pbi::ConstantInitialized) : columns_to_match_() , columns_to_add_() , result_id_(nullptr) , left_id_(nullptr) , right_id_(nullptr){} struct ExactJoinTablesRequestDefaultTypeInternal { - constexpr ExactJoinTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ExactJoinTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ExactJoinTablesRequestDefaultTypeInternal() {} union { ExactJoinTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExactJoinTablesRequestDefaultTypeInternal _ExactJoinTablesRequest_default_instance_; -constexpr LeftJoinTablesRequest::LeftJoinTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExactJoinTablesRequestDefaultTypeInternal _ExactJoinTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR LeftJoinTablesRequest::LeftJoinTablesRequest( + ::_pbi::ConstantInitialized) : columns_to_match_() , columns_to_add_() , result_id_(nullptr) , left_id_(nullptr) , right_id_(nullptr){} struct LeftJoinTablesRequestDefaultTypeInternal { - constexpr LeftJoinTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR LeftJoinTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~LeftJoinTablesRequestDefaultTypeInternal() {} union { LeftJoinTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LeftJoinTablesRequestDefaultTypeInternal _LeftJoinTablesRequest_default_instance_; -constexpr AsOfJoinTablesRequest::AsOfJoinTablesRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LeftJoinTablesRequestDefaultTypeInternal _LeftJoinTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR AsOfJoinTablesRequest::AsOfJoinTablesRequest( + ::_pbi::ConstantInitialized) : columns_to_match_() , columns_to_add_() , result_id_(nullptr) @@ -373,176 +350,176 @@ constexpr AsOfJoinTablesRequest::AsOfJoinTablesRequest( , as_of_match_rule_(0) {} struct AsOfJoinTablesRequestDefaultTypeInternal { - constexpr AsOfJoinTablesRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AsOfJoinTablesRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AsOfJoinTablesRequestDefaultTypeInternal() {} union { AsOfJoinTablesRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AsOfJoinTablesRequestDefaultTypeInternal _AsOfJoinTablesRequest_default_instance_; -constexpr ComboAggregateRequest_Aggregate::ComboAggregateRequest_Aggregate( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AsOfJoinTablesRequestDefaultTypeInternal _AsOfJoinTablesRequest_default_instance_; +PROTOBUF_CONSTEXPR ComboAggregateRequest_Aggregate::ComboAggregateRequest_Aggregate( + ::_pbi::ConstantInitialized) : match_pairs_() - , column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , type_(0) , avg_median_(false) , percentile_(0){} struct ComboAggregateRequest_AggregateDefaultTypeInternal { - constexpr ComboAggregateRequest_AggregateDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ComboAggregateRequest_AggregateDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ComboAggregateRequest_AggregateDefaultTypeInternal() {} union { ComboAggregateRequest_Aggregate _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ComboAggregateRequest_AggregateDefaultTypeInternal _ComboAggregateRequest_Aggregate_default_instance_; -constexpr ComboAggregateRequest::ComboAggregateRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ComboAggregateRequest_AggregateDefaultTypeInternal _ComboAggregateRequest_Aggregate_default_instance_; +PROTOBUF_CONSTEXPR ComboAggregateRequest::ComboAggregateRequest( + ::_pbi::ConstantInitialized) : aggregates_() , group_by_columns_() , result_id_(nullptr) , source_id_(nullptr) , force_combo_(false){} struct ComboAggregateRequestDefaultTypeInternal { - constexpr ComboAggregateRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ComboAggregateRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ComboAggregateRequestDefaultTypeInternal() {} union { ComboAggregateRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ComboAggregateRequestDefaultTypeInternal _ComboAggregateRequest_default_instance_; -constexpr SortDescriptor::SortDescriptor( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ComboAggregateRequestDefaultTypeInternal _ComboAggregateRequest_default_instance_; +PROTOBUF_CONSTEXPR SortDescriptor::SortDescriptor( + ::_pbi::ConstantInitialized) + : column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , is_absolute_(false) , direction_(0) {} struct SortDescriptorDefaultTypeInternal { - constexpr SortDescriptorDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SortDescriptorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SortDescriptorDefaultTypeInternal() {} union { SortDescriptor _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SortDescriptorDefaultTypeInternal _SortDescriptor_default_instance_; -constexpr SortTableRequest::SortTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SortDescriptorDefaultTypeInternal _SortDescriptor_default_instance_; +PROTOBUF_CONSTEXPR SortTableRequest::SortTableRequest( + ::_pbi::ConstantInitialized) : sorts_() , result_id_(nullptr) , source_id_(nullptr){} struct SortTableRequestDefaultTypeInternal { - constexpr SortTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SortTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SortTableRequestDefaultTypeInternal() {} union { SortTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SortTableRequestDefaultTypeInternal _SortTableRequest_default_instance_; -constexpr FilterTableRequest::FilterTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SortTableRequestDefaultTypeInternal _SortTableRequest_default_instance_; +PROTOBUF_CONSTEXPR FilterTableRequest::FilterTableRequest( + ::_pbi::ConstantInitialized) : filters_() , result_id_(nullptr) , source_id_(nullptr){} struct FilterTableRequestDefaultTypeInternal { - constexpr FilterTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FilterTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FilterTableRequestDefaultTypeInternal() {} union { FilterTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FilterTableRequestDefaultTypeInternal _FilterTableRequest_default_instance_; -constexpr Reference::Reference( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FilterTableRequestDefaultTypeInternal _FilterTableRequest_default_instance_; +PROTOBUF_CONSTEXPR Reference::Reference( + ::_pbi::ConstantInitialized) + : column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct ReferenceDefaultTypeInternal { - constexpr ReferenceDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ReferenceDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ReferenceDefaultTypeInternal() {} union { Reference _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReferenceDefaultTypeInternal _Reference_default_instance_; -constexpr Literal::Literal( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReferenceDefaultTypeInternal _Reference_default_instance_; +PROTOBUF_CONSTEXPR Literal::Literal( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct LiteralDefaultTypeInternal { - constexpr LiteralDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR LiteralDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~LiteralDefaultTypeInternal() {} union { Literal _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LiteralDefaultTypeInternal _Literal_default_instance_; -constexpr Value::Value( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LiteralDefaultTypeInternal _Literal_default_instance_; +PROTOBUF_CONSTEXPR Value::Value( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct ValueDefaultTypeInternal { - constexpr ValueDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ValueDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ValueDefaultTypeInternal() {} union { Value _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ValueDefaultTypeInternal _Value_default_instance_; -constexpr Condition::Condition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueDefaultTypeInternal _Value_default_instance_; +PROTOBUF_CONSTEXPR Condition::Condition( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct ConditionDefaultTypeInternal { - constexpr ConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ConditionDefaultTypeInternal() {} union { Condition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConditionDefaultTypeInternal _Condition_default_instance_; -constexpr AndCondition::AndCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConditionDefaultTypeInternal _Condition_default_instance_; +PROTOBUF_CONSTEXPR AndCondition::AndCondition( + ::_pbi::ConstantInitialized) : filters_(){} struct AndConditionDefaultTypeInternal { - constexpr AndConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR AndConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~AndConditionDefaultTypeInternal() {} union { AndCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AndConditionDefaultTypeInternal _AndCondition_default_instance_; -constexpr OrCondition::OrCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AndConditionDefaultTypeInternal _AndCondition_default_instance_; +PROTOBUF_CONSTEXPR OrCondition::OrCondition( + ::_pbi::ConstantInitialized) : filters_(){} struct OrConditionDefaultTypeInternal { - constexpr OrConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR OrConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~OrConditionDefaultTypeInternal() {} union { OrCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OrConditionDefaultTypeInternal _OrCondition_default_instance_; -constexpr NotCondition::NotCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OrConditionDefaultTypeInternal _OrCondition_default_instance_; +PROTOBUF_CONSTEXPR NotCondition::NotCondition( + ::_pbi::ConstantInitialized) : filter_(nullptr){} struct NotConditionDefaultTypeInternal { - constexpr NotConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR NotConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~NotConditionDefaultTypeInternal() {} union { NotCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NotConditionDefaultTypeInternal _NotCondition_default_instance_; -constexpr CompareCondition::CompareCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NotConditionDefaultTypeInternal _NotCondition_default_instance_; +PROTOBUF_CONSTEXPR CompareCondition::CompareCondition( + ::_pbi::ConstantInitialized) : lhs_(nullptr) , rhs_(nullptr) , operation_(0) @@ -550,16 +527,16 @@ constexpr CompareCondition::CompareCondition( , case_sensitivity_(0) {} struct CompareConditionDefaultTypeInternal { - constexpr CompareConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CompareConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CompareConditionDefaultTypeInternal() {} union { CompareCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CompareConditionDefaultTypeInternal _CompareCondition_default_instance_; -constexpr InCondition::InCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompareConditionDefaultTypeInternal _CompareCondition_default_instance_; +PROTOBUF_CONSTEXPR InCondition::InCondition( + ::_pbi::ConstantInitialized) : candidates_() , target_(nullptr) , case_sensitivity_(0) @@ -567,221 +544,221 @@ constexpr InCondition::InCondition( , match_type_(0) {} struct InConditionDefaultTypeInternal { - constexpr InConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR InConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~InConditionDefaultTypeInternal() {} union { InCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT InConditionDefaultTypeInternal _InCondition_default_instance_; -constexpr InvokeCondition::InvokeCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InConditionDefaultTypeInternal _InCondition_default_instance_; +PROTOBUF_CONSTEXPR InvokeCondition::InvokeCondition( + ::_pbi::ConstantInitialized) : arguments_() - , method_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , method_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , target_(nullptr){} struct InvokeConditionDefaultTypeInternal { - constexpr InvokeConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR InvokeConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~InvokeConditionDefaultTypeInternal() {} union { InvokeCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT InvokeConditionDefaultTypeInternal _InvokeCondition_default_instance_; -constexpr IsNullCondition::IsNullCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvokeConditionDefaultTypeInternal _InvokeCondition_default_instance_; +PROTOBUF_CONSTEXPR IsNullCondition::IsNullCondition( + ::_pbi::ConstantInitialized) : reference_(nullptr){} struct IsNullConditionDefaultTypeInternal { - constexpr IsNullConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR IsNullConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~IsNullConditionDefaultTypeInternal() {} union { IsNullCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT IsNullConditionDefaultTypeInternal _IsNullCondition_default_instance_; -constexpr MatchesCondition::MatchesCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : regex_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IsNullConditionDefaultTypeInternal _IsNullCondition_default_instance_; +PROTOBUF_CONSTEXPR MatchesCondition::MatchesCondition( + ::_pbi::ConstantInitialized) + : regex_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , reference_(nullptr) , case_sensitivity_(0) , match_type_(0) {} struct MatchesConditionDefaultTypeInternal { - constexpr MatchesConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR MatchesConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~MatchesConditionDefaultTypeInternal() {} union { MatchesCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MatchesConditionDefaultTypeInternal _MatchesCondition_default_instance_; -constexpr ContainsCondition::ContainsCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : search_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MatchesConditionDefaultTypeInternal _MatchesCondition_default_instance_; +PROTOBUF_CONSTEXPR ContainsCondition::ContainsCondition( + ::_pbi::ConstantInitialized) + : search_string_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , reference_(nullptr) , case_sensitivity_(0) , match_type_(0) {} struct ContainsConditionDefaultTypeInternal { - constexpr ContainsConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR ContainsConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~ContainsConditionDefaultTypeInternal() {} union { ContainsCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ContainsConditionDefaultTypeInternal _ContainsCondition_default_instance_; -constexpr SearchCondition::SearchCondition( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ContainsConditionDefaultTypeInternal _ContainsCondition_default_instance_; +PROTOBUF_CONSTEXPR SearchCondition::SearchCondition( + ::_pbi::ConstantInitialized) : optional_references_() - , search_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} + , search_string_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct SearchConditionDefaultTypeInternal { - constexpr SearchConditionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR SearchConditionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~SearchConditionDefaultTypeInternal() {} union { SearchCondition _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SearchConditionDefaultTypeInternal _SearchCondition_default_instance_; -constexpr FlattenRequest::FlattenRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SearchConditionDefaultTypeInternal _SearchCondition_default_instance_; +PROTOBUF_CONSTEXPR FlattenRequest::FlattenRequest( + ::_pbi::ConstantInitialized) : result_id_(nullptr) , source_id_(nullptr){} struct FlattenRequestDefaultTypeInternal { - constexpr FlattenRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR FlattenRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~FlattenRequestDefaultTypeInternal() {} union { FlattenRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FlattenRequestDefaultTypeInternal _FlattenRequest_default_instance_; -constexpr RunChartDownsampleRequest_ZoomRange::RunChartDownsampleRequest_ZoomRange( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlattenRequestDefaultTypeInternal _FlattenRequest_default_instance_; +PROTOBUF_CONSTEXPR RunChartDownsampleRequest_ZoomRange::RunChartDownsampleRequest_ZoomRange( + ::_pbi::ConstantInitialized) : min_date_nanos_(int64_t{0}) , max_date_nanos_(int64_t{0}){} struct RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal { - constexpr RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal() {} union { RunChartDownsampleRequest_ZoomRange _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal _RunChartDownsampleRequest_ZoomRange_default_instance_; -constexpr RunChartDownsampleRequest::RunChartDownsampleRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RunChartDownsampleRequest_ZoomRangeDefaultTypeInternal _RunChartDownsampleRequest_ZoomRange_default_instance_; +PROTOBUF_CONSTEXPR RunChartDownsampleRequest::RunChartDownsampleRequest( + ::_pbi::ConstantInitialized) : y_column_names_() - , x_column_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , x_column_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , result_id_(nullptr) , source_id_(nullptr) , zoom_range_(nullptr) , pixel_count_(0){} struct RunChartDownsampleRequestDefaultTypeInternal { - constexpr RunChartDownsampleRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR RunChartDownsampleRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~RunChartDownsampleRequestDefaultTypeInternal() {} union { RunChartDownsampleRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RunChartDownsampleRequestDefaultTypeInternal _RunChartDownsampleRequest_default_instance_; -constexpr CreateInputTableRequest_InputTableKind_InMemoryAppendOnly::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){} +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RunChartDownsampleRequestDefaultTypeInternal _RunChartDownsampleRequest_default_instance_; +PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryAppendOnly::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly( + ::_pbi::ConstantInitialized){} struct CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal { - constexpr CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal() {} union { CreateInputTableRequest_InputTableKind_InMemoryAppendOnly _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal _CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_default_instance_; -constexpr CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInputTableRequest_InputTableKind_InMemoryAppendOnlyDefaultTypeInternal _CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_default_instance_; +PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked( + ::_pbi::ConstantInitialized) : key_columns_(){} struct CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal { - constexpr CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal() {} union { CreateInputTableRequest_InputTableKind_InMemoryKeyBacked _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal _CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_default_instance_; -constexpr CreateInputTableRequest_InputTableKind::CreateInputTableRequest_InputTableKind( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInputTableRequest_InputTableKind_InMemoryKeyBackedDefaultTypeInternal _CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_default_instance_; +PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind::CreateInputTableRequest_InputTableKind( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct CreateInputTableRequest_InputTableKindDefaultTypeInternal { - constexpr CreateInputTableRequest_InputTableKindDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKindDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CreateInputTableRequest_InputTableKindDefaultTypeInternal() {} union { CreateInputTableRequest_InputTableKind _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CreateInputTableRequest_InputTableKindDefaultTypeInternal _CreateInputTableRequest_InputTableKind_default_instance_; -constexpr CreateInputTableRequest::CreateInputTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInputTableRequest_InputTableKindDefaultTypeInternal _CreateInputTableRequest_InputTableKind_default_instance_; +PROTOBUF_CONSTEXPR CreateInputTableRequest::CreateInputTableRequest( + ::_pbi::ConstantInitialized) : result_id_(nullptr) , kind_(nullptr) , _oneof_case_{}{} struct CreateInputTableRequestDefaultTypeInternal { - constexpr CreateInputTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR CreateInputTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~CreateInputTableRequestDefaultTypeInternal() {} union { CreateInputTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CreateInputTableRequestDefaultTypeInternal _CreateInputTableRequest_default_instance_; -constexpr BatchTableRequest_Operation::BatchTableRequest_Operation( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInputTableRequestDefaultTypeInternal _CreateInputTableRequest_default_instance_; +PROTOBUF_CONSTEXPR BatchTableRequest_Operation::BatchTableRequest_Operation( + ::_pbi::ConstantInitialized) : _oneof_case_{}{} struct BatchTableRequest_OperationDefaultTypeInternal { - constexpr BatchTableRequest_OperationDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR BatchTableRequest_OperationDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~BatchTableRequest_OperationDefaultTypeInternal() {} union { BatchTableRequest_Operation _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BatchTableRequest_OperationDefaultTypeInternal _BatchTableRequest_Operation_default_instance_; -constexpr BatchTableRequest::BatchTableRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BatchTableRequest_OperationDefaultTypeInternal _BatchTableRequest_Operation_default_instance_; +PROTOBUF_CONSTEXPR BatchTableRequest::BatchTableRequest( + ::_pbi::ConstantInitialized) : ops_(){} struct BatchTableRequestDefaultTypeInternal { - constexpr BatchTableRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR BatchTableRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~BatchTableRequestDefaultTypeInternal() {} union { BatchTableRequest _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BatchTableRequestDefaultTypeInternal _BatchTableRequest_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BatchTableRequestDefaultTypeInternal _BatchTableRequest_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2ftable_2eproto[53]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[6]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2ftable_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2ftable_2eproto[51]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[6]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2ftable_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2ftable_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TableReference, _internal_metadata_), ~0u, // no _extensions_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TableReference, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TableReference, ref_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse, _internal_metadata_), @@ -820,20 +797,6 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, source_id_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest, result_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, source_id_), - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchTableMapRequest, result_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::FetchTableMapResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -1069,11 +1032,11 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Literal, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Literal, value_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Value, _internal_metadata_), @@ -1081,8 +1044,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Value, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Value, data_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Condition, _internal_metadata_), @@ -1090,16 +1053,16 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Condition, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Condition, data_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::AndCondition, _internal_metadata_), @@ -1235,8 +1198,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind, kind_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, _internal_metadata_), @@ -1245,8 +1208,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, result_id_), - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, kind_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest, definition_), ~0u, // no _has_bits_ @@ -1255,37 +1218,37 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation, _oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation, op_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::BatchTableRequest, _internal_metadata_), @@ -1295,116 +1258,112 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2ftable_2epr ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::BatchTableRequest, ops_), }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::TableReference)}, { 9, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse)}, { 21, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchTableRequest)}, { 29, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest)}, { 37, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest)}, - { 45, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchTableMapRequest)}, - { 53, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FetchTableMapResponse)}, - { 59, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest)}, - { 65, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage)}, - { 74, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::EmptyTableRequest)}, - { 82, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::TimeTableRequest)}, - { 91, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest)}, - { 100, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SelectDistinctRequest)}, - { 109, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::DropColumnsRequest)}, - { 118, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest)}, - { 127, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HeadOrTailRequest)}, - { 136, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest)}, - { 146, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::UngroupRequest)}, - { 156, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::MergeTablesRequest)}, - { 165, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SnapshotTableRequest)}, - { 176, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest)}, - { 188, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest)}, - { 199, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest)}, - { 210, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest)}, - { 221, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest)}, - { 233, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate)}, - { 244, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ComboAggregateRequest)}, - { 255, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SortDescriptor)}, - { 264, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SortTableRequest)}, - { 273, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FilterTableRequest)}, - { 282, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Reference)}, - { 289, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Literal)}, - { 301, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Value)}, - { 310, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Condition)}, - { 327, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AndCondition)}, - { 334, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::OrCondition)}, - { 341, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::NotCondition)}, - { 348, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CompareCondition)}, - { 358, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::InCondition)}, - { 368, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::InvokeCondition)}, - { 377, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::IsNullCondition)}, - { 384, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::MatchesCondition)}, - { 394, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ContainsCondition)}, - { 404, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SearchCondition)}, - { 412, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FlattenRequest)}, - { 420, 428, -1, sizeof(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange)}, - { 430, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest)}, - { 442, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly)}, - { 448, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked)}, - { 455, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind)}, - { 464, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest)}, - { 475, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation)}, - { 513, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::BatchTableRequest)}, + { 45, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest)}, + { 51, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage)}, + { 60, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::EmptyTableRequest)}, + { 68, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::TimeTableRequest)}, + { 77, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest)}, + { 86, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SelectDistinctRequest)}, + { 95, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::DropColumnsRequest)}, + { 104, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest)}, + { 113, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HeadOrTailRequest)}, + { 122, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest)}, + { 132, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::UngroupRequest)}, + { 142, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::MergeTablesRequest)}, + { 151, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SnapshotTableRequest)}, + { 162, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest)}, + { 174, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest)}, + { 185, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest)}, + { 196, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest)}, + { 207, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest)}, + { 219, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate)}, + { 230, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ComboAggregateRequest)}, + { 241, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SortDescriptor)}, + { 250, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SortTableRequest)}, + { 259, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FilterTableRequest)}, + { 268, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Reference)}, + { 275, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Literal)}, + { 287, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Value)}, + { 296, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Condition)}, + { 313, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::AndCondition)}, + { 320, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::OrCondition)}, + { 327, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::NotCondition)}, + { 334, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CompareCondition)}, + { 344, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::InCondition)}, + { 354, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::InvokeCondition)}, + { 363, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::IsNullCondition)}, + { 370, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::MatchesCondition)}, + { 380, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::ContainsCondition)}, + { 390, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::SearchCondition)}, + { 398, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::FlattenRequest)}, + { 406, 414, -1, sizeof(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange)}, + { 416, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest)}, + { 428, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly)}, + { 434, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked)}, + { 441, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind)}, + { 450, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest)}, + { 461, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation)}, + { 499, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::BatchTableRequest)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TableReference_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportedTableCreationResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ApplyPreviewColumnsRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchPandasTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchTableMapRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FetchTableMapResponse_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportedTableUpdatesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExportedTableUpdateMessage_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_EmptyTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TimeTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SelectOrUpdateRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SelectDistinctRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_DropColumnsRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_UnstructuredFilterTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_HeadOrTailRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_HeadOrTailByRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_UngroupRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_MergeTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SnapshotTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CrossJoinTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_NaturalJoinTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ExactJoinTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_LeftJoinTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_AsOfJoinTablesRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ComboAggregateRequest_Aggregate_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ComboAggregateRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SortDescriptor_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SortTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FilterTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_Reference_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_Literal_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_Value_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_Condition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_AndCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_OrCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_NotCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CompareCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_InCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_InvokeCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_IsNullCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_MatchesCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_ContainsCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_SearchCondition_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_FlattenRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_RunChartDownsampleRequest_ZoomRange_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_RunChartDownsampleRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_BatchTableRequest_Operation_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_BatchTableRequest_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_TableReference_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportedTableCreationResponse_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FetchTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ApplyPreviewColumnsRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FetchPandasTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportedTableUpdatesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExportedTableUpdateMessage_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_EmptyTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_TimeTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SelectOrUpdateRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SelectDistinctRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_DropColumnsRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_UnstructuredFilterTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_HeadOrTailRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_HeadOrTailByRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_UngroupRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_MergeTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SnapshotTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CrossJoinTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_NaturalJoinTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ExactJoinTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_LeftJoinTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_AsOfJoinTablesRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ComboAggregateRequest_Aggregate_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ComboAggregateRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SortDescriptor_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SortTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FilterTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_Reference_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_Literal_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_Value_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_Condition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_AndCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_OrCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_NotCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CompareCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_InCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_InvokeCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_IsNullCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_MatchesCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_ContainsCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_SearchCondition_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_FlattenRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_RunChartDownsampleRequest_ZoomRange_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_RunChartDownsampleRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_InputTableKind_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_CreateInputTableRequest_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_BatchTableRequest_Operation_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_BatchTableRequest_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2ftable_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -1430,447 +1389,441 @@ const char descriptor_table_protodef_deephaven_2fproto_2ftable_2eproto[] PROTOBU "_id\030\001 \001(\01321.io.deephaven.proto.backplane" ".grpc.TableReference\022<\n\tresult_id\030\002 \001(\0132" ").io.deephaven.proto.backplane.grpc.Tick" - "et\"\232\001\n\024FetchTableMapRequest\022D\n\tsource_id" - "\030\001 \001(\01321.io.deephaven.proto.backplane.gr" - "pc.TableReference\022<\n\tresult_id\030\002 \001(\0132).i" - "o.deephaven.proto.backplane.grpc.Ticket\"" - "\027\n\025FetchTableMapResponse\"\035\n\033ExportedTabl" - "eUpdatesRequest\"\214\001\n\032ExportedTableUpdateM" - "essage\022<\n\texport_id\030\001 \001(\0132).io.deephaven" - ".proto.backplane.grpc.Ticket\022\020\n\004size\030\002 \001" - "(\022B\0020\001\022\036\n\026update_failure_message\030\003 \001(\t\"c" - "\n\021EmptyTableRequest\022<\n\tresult_id\030\001 \001(\0132)" - ".io.deephaven.proto.backplane.grpc.Ticke" - "t\022\020\n\004size\030\002 \001(\022B\0020\001\"\210\001\n\020TimeTableRequest" - "\022<\n\tresult_id\030\001 \001(\0132).io.deephaven.proto" - ".backplane.grpc.Ticket\022\034\n\020start_time_nan" - "os\030\002 \001(\022B\0020\001\022\030\n\014period_nanos\030\003 \001(\022B\0020\001\"\261" - "\001\n\025SelectOrUpdateRequest\022<\n\tresult_id\030\001 " + "et\"\035\n\033ExportedTableUpdatesRequest\"\214\001\n\032Ex" + "portedTableUpdateMessage\022<\n\texport_id\030\001 " "\001(\0132).io.deephaven.proto.backplane.grpc." - "Ticket\022D\n\tsource_id\030\002 \001(\01321.io.deephaven" - ".proto.backplane.grpc.TableReference\022\024\n\014" - "column_specs\030\003 \003(\t\"\261\001\n\025SelectDistinctReq" - "uest\022<\n\tresult_id\030\001 \001(\0132).io.deephaven.p" - "roto.backplane.grpc.Ticket\022D\n\tsource_id\030" - "\002 \001(\01321.io.deephaven.proto.backplane.grp" - "c.TableReference\022\024\n\014column_names\030\003 \003(\t\"\256" - "\001\n\022DropColumnsRequest\022<\n\tresult_id\030\001 \001(\013" - "2).io.deephaven.proto.backplane.grpc.Tic" - "ket\022D\n\tsource_id\030\002 \001(\01321.io.deephaven.pr" - "oto.backplane.grpc.TableReference\022\024\n\014col" - "umn_names\030\003 \003(\t\"\265\001\n\036UnstructuredFilterTa" - "bleRequest\022<\n\tresult_id\030\001 \001(\0132).io.deeph" - "aven.proto.backplane.grpc.Ticket\022D\n\tsour" - "ce_id\030\002 \001(\01321.io.deephaven.proto.backpla" - "ne.grpc.TableReference\022\017\n\007filters\030\003 \003(\t\"" - "\255\001\n\021HeadOrTailRequest\022<\n\tresult_id\030\001 \001(\013" - "2).io.deephaven.proto.backplane.grpc.Tic" - "ket\022D\n\tsource_id\030\002 \001(\01321.io.deephaven.pr" - "oto.backplane.grpc.TableReference\022\024\n\010num" - "_rows\030\003 \001(\022B\0020\001\"\316\001\n\023HeadOrTailByRequest\022" + "Ticket\022\020\n\004size\030\002 \001(\022B\0020\001\022\036\n\026update_failu" + "re_message\030\003 \001(\t\"c\n\021EmptyTableRequest\022<\n" + "\tresult_id\030\001 \001(\0132).io.deephaven.proto.ba" + "ckplane.grpc.Ticket\022\020\n\004size\030\002 \001(\022B\0020\001\"\210\001" + "\n\020TimeTableRequest\022<\n\tresult_id\030\001 \001(\0132)." + "io.deephaven.proto.backplane.grpc.Ticket" + "\022\034\n\020start_time_nanos\030\002 \001(\022B\0020\001\022\030\n\014period" + "_nanos\030\003 \001(\022B\0020\001\"\261\001\n\025SelectOrUpdateReque" + "st\022<\n\tresult_id\030\001 \001(\0132).io.deephaven.pro" + "to.backplane.grpc.Ticket\022D\n\tsource_id\030\002 " + "\001(\01321.io.deephaven.proto.backplane.grpc." + "TableReference\022\024\n\014column_specs\030\003 \003(\t\"\261\001\n" + "\025SelectDistinctRequest\022<\n\tresult_id\030\001 \001(" + "\0132).io.deephaven.proto.backplane.grpc.Ti" + "cket\022D\n\tsource_id\030\002 \001(\01321.io.deephaven.p" + "roto.backplane.grpc.TableReference\022\024\n\014co" + "lumn_names\030\003 \003(\t\"\256\001\n\022DropColumnsRequest\022" "<\n\tresult_id\030\001 \001(\0132).io.deephaven.proto." "backplane.grpc.Ticket\022D\n\tsource_id\030\002 \001(\013" "21.io.deephaven.proto.backplane.grpc.Tab" - "leReference\022\024\n\010num_rows\030\003 \001(\022B\0020\001\022\035\n\025gro" - "up_by_column_specs\030\004 \003(\t\"\303\001\n\016UngroupRequ" - "est\022<\n\tresult_id\030\001 \001(\0132).io.deephaven.pr" - "oto.backplane.grpc.Ticket\022D\n\tsource_id\030\002" - " \001(\01321.io.deephaven.proto.backplane.grpc" - ".TableReference\022\021\n\tnull_fill\030\003 \001(\010\022\032\n\022co" - "lumns_to_ungroup\030\004 \003(\t\"\255\001\n\022MergeTablesRe" - "quest\022<\n\tresult_id\030\001 \001(\0132).io.deephaven." - "proto.backplane.grpc.Ticket\022E\n\nsource_id" - "s\030\002 \003(\01321.io.deephaven.proto.backplane.g" - "rpc.TableReference\022\022\n\nkey_column\030\003 \001(\t\"\221" - "\002\n\024SnapshotTableRequest\022<\n\tresult_id\030\001 \001" - "(\0132).io.deephaven.proto.backplane.grpc.T" - "icket\022B\n\007left_id\030\002 \001(\01321.io.deephaven.pr" - "oto.backplane.grpc.TableReference\022C\n\010rig" - "ht_id\030\003 \001(\01321.io.deephaven.proto.backpla" - "ne.grpc.TableReference\022\033\n\023do_initial_sna" - "pshot\030\004 \001(\010\022\025\n\rstamp_columns\030\005 \003(\t\"\247\002\n\026C" - "rossJoinTablesRequest\022<\n\tresult_id\030\001 \001(\013" + "leReference\022\024\n\014column_names\030\003 \003(\t\"\265\001\n\036Un" + "structuredFilterTableRequest\022<\n\tresult_i" + "d\030\001 \001(\0132).io.deephaven.proto.backplane.g" + "rpc.Ticket\022D\n\tsource_id\030\002 \001(\01321.io.deeph" + "aven.proto.backplane.grpc.TableReference" + "\022\017\n\007filters\030\003 \003(\t\"\255\001\n\021HeadOrTailRequest\022" + "<\n\tresult_id\030\001 \001(\0132).io.deephaven.proto." + "backplane.grpc.Ticket\022D\n\tsource_id\030\002 \001(\013" + "21.io.deephaven.proto.backplane.grpc.Tab" + "leReference\022\024\n\010num_rows\030\003 \001(\022B\0020\001\"\316\001\n\023He" + "adOrTailByRequest\022<\n\tresult_id\030\001 \001(\0132).i" + "o.deephaven.proto.backplane.grpc.Ticket\022" + "D\n\tsource_id\030\002 \001(\01321.io.deephaven.proto." + "backplane.grpc.TableReference\022\024\n\010num_row" + "s\030\003 \001(\022B\0020\001\022\035\n\025group_by_column_specs\030\004 \003" + "(\t\"\303\001\n\016UngroupRequest\022<\n\tresult_id\030\001 \001(\013" "2).io.deephaven.proto.backplane.grpc.Tic" - "ket\022B\n\007left_id\030\002 \001(\01321.io.deephaven.prot" - "o.backplane.grpc.TableReference\022C\n\010right" - "_id\030\003 \001(\01321.io.deephaven.proto.backplane" - ".grpc.TableReference\022\030\n\020columns_to_match" - "\030\004 \003(\t\022\026\n\016columns_to_add\030\005 \003(\t\022\024\n\014reserv" - "e_bits\030\006 \001(\005\"\223\002\n\030NaturalJoinTablesReques" + "ket\022D\n\tsource_id\030\002 \001(\01321.io.deephaven.pr" + "oto.backplane.grpc.TableReference\022\021\n\tnul" + "l_fill\030\003 \001(\010\022\032\n\022columns_to_ungroup\030\004 \003(\t" + "\"\255\001\n\022MergeTablesRequest\022<\n\tresult_id\030\001 \001" + "(\0132).io.deephaven.proto.backplane.grpc.T" + "icket\022E\n\nsource_ids\030\002 \003(\01321.io.deephaven" + ".proto.backplane.grpc.TableReference\022\022\n\n" + "key_column\030\003 \001(\t\"\221\002\n\024SnapshotTableReques" "t\022<\n\tresult_id\030\001 \001(\0132).io.deephaven.prot" "o.backplane.grpc.Ticket\022B\n\007left_id\030\002 \001(\013" "21.io.deephaven.proto.backplane.grpc.Tab" "leReference\022C\n\010right_id\030\003 \001(\01321.io.deeph" "aven.proto.backplane.grpc.TableReference" - "\022\030\n\020columns_to_match\030\004 \003(\t\022\026\n\016columns_to" - "_add\030\005 \003(\t\"\221\002\n\026ExactJoinTablesRequest\022<\n" - "\tresult_id\030\001 \001(\0132).io.deephaven.proto.ba" - "ckplane.grpc.Ticket\022B\n\007left_id\030\002 \001(\01321.i" - "o.deephaven.proto.backplane.grpc.TableRe" - "ference\022C\n\010right_id\030\003 \001(\01321.io.deephaven" - ".proto.backplane.grpc.TableReference\022\030\n\020" - "columns_to_match\030\004 \003(\t\022\026\n\016columns_to_add" - "\030\005 \003(\t\"\220\002\n\025LeftJoinTablesRequest\022<\n\tresu" - "lt_id\030\001 \001(\0132).io.deephaven.proto.backpla" - "ne.grpc.Ticket\022B\n\007left_id\030\002 \001(\01321.io.dee" - "phaven.proto.backplane.grpc.TableReferen" - "ce\022C\n\010right_id\030\003 \001(\01321.io.deephaven.prot" - "o.backplane.grpc.TableReference\022\030\n\020colum" - "ns_to_match\030\004 \003(\t\022\026\n\016columns_to_add\030\005 \003(" - "\t\"\311\003\n\025AsOfJoinTablesRequest\022<\n\tresult_id" - "\030\001 \001(\0132).io.deephaven.proto.backplane.gr" - "pc.Ticket\022B\n\007left_id\030\002 \001(\01321.io.deephave" - "n.proto.backplane.grpc.TableReference\022C\n" - "\010right_id\030\003 \001(\01321.io.deephaven.proto.bac" - "kplane.grpc.TableReference\022\030\n\020columns_to" - "_match\030\004 \003(\t\022\026\n\016columns_to_add\030\005 \003(\t\022\\\n\020" - "as_of_match_rule\030\007 \001(\0162B.io.deephaven.pr" - "oto.backplane.grpc.AsOfJoinTablesRequest" - ".MatchRule\"Y\n\tMatchRule\022\023\n\017LESS_THAN_EQU" - "AL\020\000\022\r\n\tLESS_THAN\020\001\022\026\n\022GREATER_THAN_EQUA" - "L\020\002\022\020\n\014GREATER_THAN\020\003\"\372\004\n\025ComboAggregate" - "Request\022<\n\tresult_id\030\001 \001(\0132).io.deephave" - "n.proto.backplane.grpc.Ticket\022D\n\tsource_" - "id\030\002 \001(\01321.io.deephaven.proto.backplane." - "grpc.TableReference\022V\n\naggregates\030\003 \003(\0132" - "B.io.deephaven.proto.backplane.grpc.Comb" - "oAggregateRequest.Aggregate\022\030\n\020group_by_" - "columns\030\004 \003(\t\022\023\n\013force_combo\030\005 \001(\010\032\255\001\n\tA" - "ggregate\022N\n\004type\030\001 \001(\0162@.io.deephaven.pr" - "oto.backplane.grpc.ComboAggregateRequest" - ".AggType\022\023\n\013match_pairs\030\002 \003(\t\022\023\n\013column_" - "name\030\003 \001(\t\022\022\n\npercentile\030\004 \001(\001\022\022\n\navg_me" - "dian\030\005 \001(\010\"\245\001\n\007AggType\022\007\n\003SUM\020\000\022\013\n\007ABS_S" - "UM\020\001\022\t\n\005GROUP\020\002\022\007\n\003AVG\020\003\022\t\n\005COUNT\020\004\022\t\n\005F" - "IRST\020\005\022\010\n\004LAST\020\006\022\007\n\003MIN\020\007\022\007\n\003MAX\020\010\022\n\n\006ME" - "DIAN\020\t\022\016\n\nPERCENTILE\020\n\022\007\n\003STD\020\013\022\007\n\003VAR\020\014" - "\022\020\n\014WEIGHTED_AVG\020\r\"\341\001\n\016SortDescriptor\022\023\n" - "\013column_name\030\001 \001(\t\022\023\n\013is_absolute\030\002 \001(\010\022" - "R\n\tdirection\030\003 \001(\0162\?.io.deephaven.proto." - "backplane.grpc.SortDescriptor.SortDirect" - "ion\"Q\n\rSortDirection\022\013\n\007UNKNOWN\020\000\022\027\n\nDES" - "CENDING\020\377\377\377\377\377\377\377\377\377\001\022\r\n\tASCENDING\020\001\022\013\n\007REV" - "ERSE\020\002\"\330\001\n\020SortTableRequest\022<\n\tresult_id" - "\030\001 \001(\0132).io.deephaven.proto.backplane.gr" - "pc.Ticket\022D\n\tsource_id\030\002 \001(\01321.io.deepha" - "ven.proto.backplane.grpc.TableReference\022" - "@\n\005sorts\030\003 \003(\01321.io.deephaven.proto.back" - "plane.grpc.SortDescriptor\"\327\001\n\022FilterTabl" - "eRequest\022<\n\tresult_id\030\001 \001(\0132).io.deephav" - "en.proto.backplane.grpc.Ticket\022D\n\tsource" + "\022\033\n\023do_initial_snapshot\030\004 \001(\010\022\025\n\rstamp_c" + "olumns\030\005 \003(\t\"\247\002\n\026CrossJoinTablesRequest\022" + "<\n\tresult_id\030\001 \001(\0132).io.deephaven.proto." + "backplane.grpc.Ticket\022B\n\007left_id\030\002 \001(\01321" + ".io.deephaven.proto.backplane.grpc.Table" + "Reference\022C\n\010right_id\030\003 \001(\01321.io.deephav" + "en.proto.backplane.grpc.TableReference\022\030" + "\n\020columns_to_match\030\004 \003(\t\022\026\n\016columns_to_a" + "dd\030\005 \003(\t\022\024\n\014reserve_bits\030\006 \001(\005\"\223\002\n\030Natur" + "alJoinTablesRequest\022<\n\tresult_id\030\001 \001(\0132)" + ".io.deephaven.proto.backplane.grpc.Ticke" + "t\022B\n\007left_id\030\002 \001(\01321.io.deephaven.proto." + "backplane.grpc.TableReference\022C\n\010right_i" + "d\030\003 \001(\01321.io.deephaven.proto.backplane.g" + "rpc.TableReference\022\030\n\020columns_to_match\030\004" + " \003(\t\022\026\n\016columns_to_add\030\005 \003(\t\"\221\002\n\026ExactJo" + "inTablesRequest\022<\n\tresult_id\030\001 \001(\0132).io." + "deephaven.proto.backplane.grpc.Ticket\022B\n" + "\007left_id\030\002 \001(\01321.io.deephaven.proto.back" + "plane.grpc.TableReference\022C\n\010right_id\030\003 " + "\001(\01321.io.deephaven.proto.backplane.grpc." + "TableReference\022\030\n\020columns_to_match\030\004 \003(\t" + "\022\026\n\016columns_to_add\030\005 \003(\t\"\220\002\n\025LeftJoinTab" + "lesRequest\022<\n\tresult_id\030\001 \001(\0132).io.deeph" + "aven.proto.backplane.grpc.Ticket\022B\n\007left" "_id\030\002 \001(\01321.io.deephaven.proto.backplane" - ".grpc.TableReference\022=\n\007filters\030\003 \003(\0132,." - "io.deephaven.proto.backplane.grpc.Condit" - "ion\" \n\tReference\022\023\n\013column_name\030\001 \001(\t\"\221\001" - "\n\007Literal\022\026\n\014string_value\030\001 \001(\tH\000\022\026\n\014dou" - "ble_value\030\002 \001(\001H\000\022\024\n\nbool_value\030\003 \001(\010H\000\022" - "\030\n\nlong_value\030\004 \001(\022B\0020\001H\000\022\035\n\017nano_time_v" - "alue\030\005 \001(\022B\0020\001H\000B\007\n\005value\"\221\001\n\005Value\022A\n\tr" - "eference\030\001 \001(\0132,.io.deephaven.proto.back" - "plane.grpc.ReferenceH\000\022=\n\007literal\030\002 \001(\0132" - "*.io.deephaven.proto.backplane.grpc.Lite" - "ralH\000B\006\n\004data\"\274\005\n\tCondition\022>\n\003and\030\001 \001(\013" - "2/.io.deephaven.proto.backplane.grpc.And" - "ConditionH\000\022<\n\002or\030\002 \001(\0132..io.deephaven.p" - "roto.backplane.grpc.OrConditionH\000\022>\n\003not" - "\030\003 \001(\0132/.io.deephaven.proto.backplane.gr" - "pc.NotConditionH\000\022F\n\007compare\030\004 \001(\01323.io." - "deephaven.proto.backplane.grpc.CompareCo" - "nditionH\000\022<\n\002in\030\005 \001(\0132..io.deephaven.pro" - "to.backplane.grpc.InConditionH\000\022D\n\006invok" - "e\030\006 \001(\01322.io.deephaven.proto.backplane.g" - "rpc.InvokeConditionH\000\022E\n\007is_null\030\007 \001(\01322" - ".io.deephaven.proto.backplane.grpc.IsNul" - "lConditionH\000\022F\n\007matches\030\010 \001(\01323.io.deeph" - "aven.proto.backplane.grpc.MatchesConditi" - "onH\000\022H\n\010contains\030\t \001(\01324.io.deephaven.pr" - "oto.backplane.grpc.ContainsConditionH\000\022D" - "\n\006search\030\n \001(\01322.io.deephaven.proto.back" - "plane.grpc.SearchConditionH\000B\006\n\004data\"M\n\014" - "AndCondition\022=\n\007filters\030\001 \003(\0132,.io.deeph" - "aven.proto.backplane.grpc.Condition\"L\n\013O" - "rCondition\022=\n\007filters\030\001 \003(\0132,.io.deephav" - "en.proto.backplane.grpc.Condition\"L\n\014Not" - "Condition\022<\n\006filter\030\001 \001(\0132,.io.deephaven" - ".proto.backplane.grpc.Condition\"\254\003\n\020Comp" - "areCondition\022W\n\toperation\030\001 \001(\0162D.io.dee" - "phaven.proto.backplane.grpc.CompareCondi" - "tion.CompareOperation\022L\n\020case_sensitivit" - "y\030\002 \001(\01622.io.deephaven.proto.backplane.g" - "rpc.CaseSensitivity\0225\n\003lhs\030\003 \001(\0132(.io.de" - "ephaven.proto.backplane.grpc.Value\0225\n\003rh" - "s\030\004 \001(\0132(.io.deephaven.proto.backplane.g" - "rpc.Value\"\202\001\n\020CompareOperation\022\r\n\tLESS_T" - "HAN\020\000\022\026\n\022LESS_THAN_OR_EQUAL\020\001\022\020\n\014GREATER" - "_THAN\020\002\022\031\n\025GREATER_THAN_OR_EQUAL\020\003\022\n\n\006EQ" - "UALS\020\004\022\016\n\nNOT_EQUALS\020\005\"\225\002\n\013InCondition\0228" - "\n\006target\030\001 \001(\0132(.io.deephaven.proto.back" - "plane.grpc.Value\022<\n\ncandidates\030\002 \003(\0132(.i" - "o.deephaven.proto.backplane.grpc.Value\022L" - "\n\020case_sensitivity\030\003 \001(\01622.io.deephaven." - "proto.backplane.grpc.CaseSensitivity\022@\n\n" - "match_type\030\004 \001(\0162,.io.deephaven.proto.ba" - "ckplane.grpc.MatchType\"\230\001\n\017InvokeConditi" - "on\022\016\n\006method\030\001 \001(\t\0228\n\006target\030\002 \001(\0132(.io." - "deephaven.proto.backplane.grpc.Value\022;\n\t" - "arguments\030\003 \003(\0132(.io.deephaven.proto.bac" - "kplane.grpc.Value\"R\n\017IsNullCondition\022\?\n\t" - "reference\030\001 \001(\0132,.io.deephaven.proto.bac" - "kplane.grpc.Reference\"\362\001\n\020MatchesConditi" - "on\022\?\n\treference\030\001 \001(\0132,.io.deephaven.pro" - "to.backplane.grpc.Reference\022\r\n\005regex\030\002 \001" - "(\t\022L\n\020case_sensitivity\030\003 \001(\01622.io.deepha" - "ven.proto.backplane.grpc.CaseSensitivity" - "\022@\n\nmatch_type\030\004 \001(\0162,.io.deephaven.prot" - "o.backplane.grpc.MatchType\"\373\001\n\021ContainsC" - "ondition\022\?\n\treference\030\001 \001(\0132,.io.deephav" - "en.proto.backplane.grpc.Reference\022\025\n\rsea" - "rch_string\030\002 \001(\t\022L\n\020case_sensitivity\030\003 \001" + ".grpc.TableReference\022C\n\010right_id\030\003 \001(\01321" + ".io.deephaven.proto.backplane.grpc.Table" + "Reference\022\030\n\020columns_to_match\030\004 \003(\t\022\026\n\016c" + "olumns_to_add\030\005 \003(\t\"\311\003\n\025AsOfJoinTablesRe" + "quest\022<\n\tresult_id\030\001 \001(\0132).io.deephaven." + "proto.backplane.grpc.Ticket\022B\n\007left_id\030\002" + " \001(\01321.io.deephaven.proto.backplane.grpc" + ".TableReference\022C\n\010right_id\030\003 \001(\01321.io.d" + "eephaven.proto.backplane.grpc.TableRefer" + "ence\022\030\n\020columns_to_match\030\004 \003(\t\022\026\n\016column" + "s_to_add\030\005 \003(\t\022\\\n\020as_of_match_rule\030\007 \001(\016" + "2B.io.deephaven.proto.backplane.grpc.AsO" + "fJoinTablesRequest.MatchRule\"Y\n\tMatchRul" + "e\022\023\n\017LESS_THAN_EQUAL\020\000\022\r\n\tLESS_THAN\020\001\022\026\n" + "\022GREATER_THAN_EQUAL\020\002\022\020\n\014GREATER_THAN\020\003\"" + "\372\004\n\025ComboAggregateRequest\022<\n\tresult_id\030\001" + " \001(\0132).io.deephaven.proto.backplane.grpc" + ".Ticket\022D\n\tsource_id\030\002 \001(\01321.io.deephave" + "n.proto.backplane.grpc.TableReference\022V\n" + "\naggregates\030\003 \003(\0132B.io.deephaven.proto.b" + "ackplane.grpc.ComboAggregateRequest.Aggr" + "egate\022\030\n\020group_by_columns\030\004 \003(\t\022\023\n\013force" + "_combo\030\005 \001(\010\032\255\001\n\tAggregate\022N\n\004type\030\001 \001(\016" + "2@.io.deephaven.proto.backplane.grpc.Com" + "boAggregateRequest.AggType\022\023\n\013match_pair" + "s\030\002 \003(\t\022\023\n\013column_name\030\003 \001(\t\022\022\n\npercenti" + "le\030\004 \001(\001\022\022\n\navg_median\030\005 \001(\010\"\245\001\n\007AggType" + "\022\007\n\003SUM\020\000\022\013\n\007ABS_SUM\020\001\022\t\n\005GROUP\020\002\022\007\n\003AVG" + "\020\003\022\t\n\005COUNT\020\004\022\t\n\005FIRST\020\005\022\010\n\004LAST\020\006\022\007\n\003MI" + "N\020\007\022\007\n\003MAX\020\010\022\n\n\006MEDIAN\020\t\022\016\n\nPERCENTILE\020\n" + "\022\007\n\003STD\020\013\022\007\n\003VAR\020\014\022\020\n\014WEIGHTED_AVG\020\r\"\341\001\n" + "\016SortDescriptor\022\023\n\013column_name\030\001 \001(\t\022\023\n\013" + "is_absolute\030\002 \001(\010\022R\n\tdirection\030\003 \001(\0162\?.i" + "o.deephaven.proto.backplane.grpc.SortDes" + "criptor.SortDirection\"Q\n\rSortDirection\022\013" + "\n\007UNKNOWN\020\000\022\027\n\nDESCENDING\020\377\377\377\377\377\377\377\377\377\001\022\r\n\t" + "ASCENDING\020\001\022\013\n\007REVERSE\020\002\"\330\001\n\020SortTableRe" + "quest\022<\n\tresult_id\030\001 \001(\0132).io.deephaven." + "proto.backplane.grpc.Ticket\022D\n\tsource_id" + "\030\002 \001(\01321.io.deephaven.proto.backplane.gr" + "pc.TableReference\022@\n\005sorts\030\003 \003(\01321.io.de" + "ephaven.proto.backplane.grpc.SortDescrip" + "tor\"\327\001\n\022FilterTableRequest\022<\n\tresult_id\030" + "\001 \001(\0132).io.deephaven.proto.backplane.grp" + "c.Ticket\022D\n\tsource_id\030\002 \001(\01321.io.deephav" + "en.proto.backplane.grpc.TableReference\022=" + "\n\007filters\030\003 \003(\0132,.io.deephaven.proto.bac" + "kplane.grpc.Condition\" \n\tReference\022\023\n\013co" + "lumn_name\030\001 \001(\t\"\221\001\n\007Literal\022\026\n\014string_va" + "lue\030\001 \001(\tH\000\022\026\n\014double_value\030\002 \001(\001H\000\022\024\n\nb" + "ool_value\030\003 \001(\010H\000\022\030\n\nlong_value\030\004 \001(\022B\0020" + "\001H\000\022\035\n\017nano_time_value\030\005 \001(\022B\0020\001H\000B\007\n\005va" + "lue\"\221\001\n\005Value\022A\n\treference\030\001 \001(\0132,.io.de" + "ephaven.proto.backplane.grpc.ReferenceH\000" + "\022=\n\007literal\030\002 \001(\0132*.io.deephaven.proto.b" + "ackplane.grpc.LiteralH\000B\006\n\004data\"\274\005\n\tCond" + "ition\022>\n\003and\030\001 \001(\0132/.io.deephaven.proto." + "backplane.grpc.AndConditionH\000\022<\n\002or\030\002 \001(" + "\0132..io.deephaven.proto.backplane.grpc.Or" + "ConditionH\000\022>\n\003not\030\003 \001(\0132/.io.deephaven." + "proto.backplane.grpc.NotConditionH\000\022F\n\007c" + "ompare\030\004 \001(\01323.io.deephaven.proto.backpl" + "ane.grpc.CompareConditionH\000\022<\n\002in\030\005 \001(\0132" + "..io.deephaven.proto.backplane.grpc.InCo" + "nditionH\000\022D\n\006invoke\030\006 \001(\01322.io.deephaven" + ".proto.backplane.grpc.InvokeConditionH\000\022" + "E\n\007is_null\030\007 \001(\01322.io.deephaven.proto.ba" + "ckplane.grpc.IsNullConditionH\000\022F\n\007matche" + "s\030\010 \001(\01323.io.deephaven.proto.backplane.g" + "rpc.MatchesConditionH\000\022H\n\010contains\030\t \001(\013" + "24.io.deephaven.proto.backplane.grpc.Con" + "tainsConditionH\000\022D\n\006search\030\n \001(\01322.io.de" + "ephaven.proto.backplane.grpc.SearchCondi" + "tionH\000B\006\n\004data\"M\n\014AndCondition\022=\n\007filter" + "s\030\001 \003(\0132,.io.deephaven.proto.backplane.g" + "rpc.Condition\"L\n\013OrCondition\022=\n\007filters\030" + "\001 \003(\0132,.io.deephaven.proto.backplane.grp" + "c.Condition\"L\n\014NotCondition\022<\n\006filter\030\001 " + "\001(\0132,.io.deephaven.proto.backplane.grpc." + "Condition\"\254\003\n\020CompareCondition\022W\n\toperat" + "ion\030\001 \001(\0162D.io.deephaven.proto.backplane" + ".grpc.CompareCondition.CompareOperation\022" + "L\n\020case_sensitivity\030\002 \001(\01622.io.deephaven" + ".proto.backplane.grpc.CaseSensitivity\0225\n" + "\003lhs\030\003 \001(\0132(.io.deephaven.proto.backplan" + "e.grpc.Value\0225\n\003rhs\030\004 \001(\0132(.io.deephaven" + ".proto.backplane.grpc.Value\"\202\001\n\020CompareO" + "peration\022\r\n\tLESS_THAN\020\000\022\026\n\022LESS_THAN_OR_" + "EQUAL\020\001\022\020\n\014GREATER_THAN\020\002\022\031\n\025GREATER_THA" + "N_OR_EQUAL\020\003\022\n\n\006EQUALS\020\004\022\016\n\nNOT_EQUALS\020\005" + "\"\225\002\n\013InCondition\0228\n\006target\030\001 \001(\0132(.io.de" + "ephaven.proto.backplane.grpc.Value\022<\n\nca" + "ndidates\030\002 \003(\0132(.io.deephaven.proto.back" + "plane.grpc.Value\022L\n\020case_sensitivity\030\003 \001" "(\01622.io.deephaven.proto.backplane.grpc.C" "aseSensitivity\022@\n\nmatch_type\030\004 \001(\0162,.io." "deephaven.proto.backplane.grpc.MatchType" - "\"s\n\017SearchCondition\022\025\n\rsearch_string\030\001 \001" - "(\t\022I\n\023optional_references\030\002 \003(\0132,.io.dee" - "phaven.proto.backplane.grpc.Reference\"\224\001" - "\n\016FlattenRequest\022<\n\tresult_id\030\001 \001(\0132).io" - ".deephaven.proto.backplane.grpc.Ticket\022D" - "\n\tsource_id\030\002 \001(\01321.io.deephaven.proto.b" - "ackplane.grpc.TableReference\"\264\003\n\031RunChar" - "tDownsampleRequest\022<\n\tresult_id\030\001 \001(\0132)." - "io.deephaven.proto.backplane.grpc.Ticket" - "\022D\n\tsource_id\030\002 \001(\01321.io.deephaven.proto" - ".backplane.grpc.TableReference\022\023\n\013pixel_" - "count\030\003 \001(\005\022Z\n\nzoom_range\030\004 \001(\0132F.io.dee" - "phaven.proto.backplane.grpc.RunChartDown" - "sampleRequest.ZoomRange\022\025\n\rx_column_name" - "\030\005 \001(\t\022\026\n\016y_column_names\030\006 \003(\t\032s\n\tZoomRa" - "nge\022\037\n\016min_date_nanos\030\001 \001(\003B\0020\001H\000\210\001\001\022\037\n\016" - "max_date_nanos\030\002 \001(\003B\0020\001H\001\210\001\001B\021\n\017_min_da" - "te_nanosB\021\n\017_max_date_nanos\"\365\004\n\027CreateIn" - "putTableRequest\022<\n\tresult_id\030\001 \001(\0132).io." - "deephaven.proto.backplane.grpc.Ticket\022L\n" - "\017source_table_id\030\002 \001(\01321.io.deephaven.pr" - "oto.backplane.grpc.TableReferenceH\000\022\020\n\006s" - "chema\030\003 \001(\014H\000\022W\n\004kind\030\004 \001(\0132I.io.deephav" - "en.proto.backplane.grpc.CreateInputTable" - "Request.InputTableKind\032\324\002\n\016InputTableKin" - "d\022}\n\025in_memory_append_only\030\001 \001(\0132\\.io.de" - "ephaven.proto.backplane.grpc.CreateInput" - "TableRequest.InputTableKind.InMemoryAppe" - "ndOnlyH\000\022{\n\024in_memory_key_backed\030\002 \001(\0132[" - ".io.deephaven.proto.backplane.grpc.Creat" - "eInputTableRequest.InputTableKind.InMemo" - "ryKeyBackedH\000\032\024\n\022InMemoryAppendOnly\032(\n\021I" - "nMemoryKeyBacked\022\023\n\013key_columns\030\001 \003(\tB\006\n" - "\004kindB\014\n\ndefinition\"\221\024\n\021BatchTableReques" - "t\022K\n\003ops\030\001 \003(\0132>.io.deephaven.proto.back" - "plane.grpc.BatchTableRequest.Operation\032\256" - "\023\n\tOperation\022K\n\013empty_table\030\001 \001(\01324.io.d" - "eephaven.proto.backplane.grpc.EmptyTable" - "RequestH\000\022I\n\ntime_table\030\002 \001(\01323.io.deeph" - "aven.proto.backplane.grpc.TimeTableReque" - "stH\000\022M\n\014drop_columns\030\003 \001(\01325.io.deephave" - "n.proto.backplane.grpc.DropColumnsReques" - "tH\000\022J\n\006update\030\004 \001(\01328.io.deephaven.proto" - ".backplane.grpc.SelectOrUpdateRequestH\000\022" - "O\n\013lazy_update\030\005 \001(\01328.io.deephaven.prot" - "o.backplane.grpc.SelectOrUpdateRequestH\000" - "\022H\n\004view\030\006 \001(\01328.io.deephaven.proto.back" - "plane.grpc.SelectOrUpdateRequestH\000\022O\n\013up" - "date_view\030\007 \001(\01328.io.deephaven.proto.bac" - "kplane.grpc.SelectOrUpdateRequestH\000\022J\n\006s" - "elect\030\010 \001(\01328.io.deephaven.proto.backpla" - "ne.grpc.SelectOrUpdateRequestH\000\022S\n\017selec" - "t_distinct\030\t \001(\01328.io.deephaven.proto.ba" - "ckplane.grpc.SelectDistinctRequestH\000\022G\n\006" - "filter\030\n \001(\01325.io.deephaven.proto.backpl" - "ane.grpc.FilterTableRequestH\000\022`\n\023unstruc" - "tured_filter\030\013 \001(\0132A.io.deephaven.proto." - "backplane.grpc.UnstructuredFilterTableRe" - "questH\000\022C\n\004sort\030\014 \001(\01323.io.deephaven.pro" - "to.backplane.grpc.SortTableRequestH\000\022D\n\004" - "head\030\r \001(\01324.io.deephaven.proto.backplan" - "e.grpc.HeadOrTailRequestH\000\022D\n\004tail\030\016 \001(\013" - "24.io.deephaven.proto.backplane.grpc.Hea" - "dOrTailRequestH\000\022I\n\007head_by\030\017 \001(\01326.io.d" - "eephaven.proto.backplane.grpc.HeadOrTail" - "ByRequestH\000\022I\n\007tail_by\030\020 \001(\01326.io.deepha" - "ven.proto.backplane.grpc.HeadOrTailByReq" - "uestH\000\022D\n\007ungroup\030\021 \001(\01321.io.deephaven.p" - "roto.backplane.grpc.UngroupRequestH\000\022F\n\005" - "merge\030\022 \001(\01325.io.deephaven.proto.backpla" - "ne.grpc.MergeTablesRequestH\000\022S\n\017combo_ag" - "gregate\030\023 \001(\01328.io.deephaven.proto.backp" - "lane.grpc.ComboAggregateRequestH\000\022K\n\010sna" - "pshot\030\024 \001(\01327.io.deephaven.proto.backpla" - "ne.grpc.SnapshotTableRequestH\000\022D\n\007flatte" - "n\030\025 \001(\01321.io.deephaven.proto.backplane.g" - "rpc.FlattenRequestH\000\022\\\n\024run_chart_downsa" - "mple\030\026 \001(\0132<.io.deephaven.proto.backplan" - "e.grpc.RunChartDownsampleRequestH\000\022O\n\ncr" - "oss_join\030\027 \001(\01329.io.deephaven.proto.back" - "plane.grpc.CrossJoinTablesRequestH\000\022S\n\014n" - "atural_join\030\030 \001(\0132;.io.deephaven.proto.b" - "ackplane.grpc.NaturalJoinTablesRequestH\000" - "\022O\n\nexact_join\030\031 \001(\01329.io.deephaven.prot" - "o.backplane.grpc.ExactJoinTablesRequestH" - "\000\022M\n\tleft_join\030\032 \001(\01328.io.deephaven.prot" - "o.backplane.grpc.LeftJoinTablesRequestH\000" - "\022N\n\nas_of_join\030\033 \001(\01328.io.deephaven.prot" - "o.backplane.grpc.AsOfJoinTablesRequestH\000" - "\022K\n\013fetch_table\030\034 \001(\01324.io.deephaven.pro" - "to.backplane.grpc.FetchTableRequestH\000\022X\n" - "\022fetch_pandas_table\030\035 \001(\0132:.io.deephaven" - ".proto.backplane.grpc.FetchPandasTableRe" - "questH\000\022^\n\025apply_preview_columns\030\036 \001(\0132=" - ".io.deephaven.proto.backplane.grpc.Apply" - "PreviewColumnsRequestH\000\022X\n\022create_input_" - "table\030\037 \001(\0132:.io.deephaven.proto.backpla" - "ne.grpc.CreateInputTableRequestH\000B\004\n\002op*" - "2\n\017CaseSensitivity\022\016\n\nMATCH_CASE\020\000\022\017\n\013IG" - "NORE_CASE\020\001*&\n\tMatchType\022\013\n\007REGULAR\020\000\022\014\n" - "\010INVERTED\020\0012\325&\n\014TableService\022\221\001\n GetExpo" - "rtedTableCreationResponse\022).io.deephaven" - ".proto.backplane.grpc.Ticket\032@.io.deepha" - "ven.proto.backplane.grpc.ExportedTableCr" - "eationResponse\"\000\022\206\001\n\nFetchTable\0224.io.dee" - "phaven.proto.backplane.grpc.FetchTableRe" - "quest\032@.io.deephaven.proto.backplane.grp" - "c.ExportedTableCreationResponse\"\000\022\222\001\n\020Fe" - "tchPandasTable\022:.io.deephaven.proto.back" - "plane.grpc.FetchPandasTableRequest\032@.io." - "deephaven.proto.backplane.grpc.ExportedT" - "ableCreationResponse\"\000\022\204\001\n\rFetchTableMap" - "\0227.io.deephaven.proto.backplane.grpc.Fet" - "chTableMapRequest\0328.io.deephaven.proto.b" - "ackplane.grpc.FetchTableMapResponse\"\000\022\230\001" - "\n\023ApplyPreviewColumns\022=.io.deephaven.pro" - "to.backplane.grpc.ApplyPreviewColumnsReq" - "uest\032@.io.deephaven.proto.backplane.grpc" - ".ExportedTableCreationResponse\"\000\022\206\001\n\nEmp" - "tyTable\0224.io.deephaven.proto.backplane.g" - "rpc.EmptyTableRequest\032@.io.deephaven.pro" - "to.backplane.grpc.ExportedTableCreationR" - "esponse\"\000\022\204\001\n\tTimeTable\0223.io.deephaven.p" - "roto.backplane.grpc.TimeTableRequest\032@.i" - "o.deephaven.proto.backplane.grpc.Exporte" - "dTableCreationResponse\"\000\022\210\001\n\013DropColumns" - "\0225.io.deephaven.proto.backplane.grpc.Dro" - "pColumnsRequest\032@.io.deephaven.proto.bac" - "kplane.grpc.ExportedTableCreationRespons" - "e\"\000\022\206\001\n\006Update\0228.io.deephaven.proto.back" - "plane.grpc.SelectOrUpdateRequest\032@.io.de" - "ephaven.proto.backplane.grpc.ExportedTab" - "leCreationResponse\"\000\022\212\001\n\nLazyUpdate\0228.io" - ".deephaven.proto.backplane.grpc.SelectOr" - "UpdateRequest\032@.io.deephaven.proto.backp" - "lane.grpc.ExportedTableCreationResponse\"" - "\000\022\204\001\n\004View\0228.io.deephaven.proto.backplan" - "e.grpc.SelectOrUpdateRequest\032@.io.deepha" - "ven.proto.backplane.grpc.ExportedTableCr" - "eationResponse\"\000\022\212\001\n\nUpdateView\0228.io.dee" - "phaven.proto.backplane.grpc.SelectOrUpda" - "teRequest\032@.io.deephaven.proto.backplane" - ".grpc.ExportedTableCreationResponse\"\000\022\206\001" - "\n\006Select\0228.io.deephaven.proto.backplane." - "grpc.SelectOrUpdateRequest\032@.io.deephave" - "n.proto.backplane.grpc.ExportedTableCrea" - "tionResponse\"\000\022\216\001\n\016SelectDistinct\0228.io.d" - "eephaven.proto.backplane.grpc.SelectDist" - "inctRequest\032@.io.deephaven.proto.backpla" - "ne.grpc.ExportedTableCreationResponse\"\000\022" - "\203\001\n\006Filter\0225.io.deephaven.proto.backplan" - "e.grpc.FilterTableRequest\032@.io.deephaven" - ".proto.backplane.grpc.ExportedTableCreat" - "ionResponse\"\000\022\233\001\n\022UnstructuredFilter\022A.i" + "\"\230\001\n\017InvokeCondition\022\016\n\006method\030\001 \001(\t\0228\n\006" + "target\030\002 \001(\0132(.io.deephaven.proto.backpl" + "ane.grpc.Value\022;\n\targuments\030\003 \003(\0132(.io.d" + "eephaven.proto.backplane.grpc.Value\"R\n\017I" + "sNullCondition\022\?\n\treference\030\001 \001(\0132,.io.d" + "eephaven.proto.backplane.grpc.Reference\"" + "\362\001\n\020MatchesCondition\022\?\n\treference\030\001 \001(\0132" + ",.io.deephaven.proto.backplane.grpc.Refe" + "rence\022\r\n\005regex\030\002 \001(\t\022L\n\020case_sensitivity" + "\030\003 \001(\01622.io.deephaven.proto.backplane.gr" + "pc.CaseSensitivity\022@\n\nmatch_type\030\004 \001(\0162," + ".io.deephaven.proto.backplane.grpc.Match" + "Type\"\373\001\n\021ContainsCondition\022\?\n\treference\030" + "\001 \001(\0132,.io.deephaven.proto.backplane.grp" + "c.Reference\022\025\n\rsearch_string\030\002 \001(\t\022L\n\020ca" + "se_sensitivity\030\003 \001(\01622.io.deephaven.prot" + "o.backplane.grpc.CaseSensitivity\022@\n\nmatc" + "h_type\030\004 \001(\0162,.io.deephaven.proto.backpl" + "ane.grpc.MatchType\"s\n\017SearchCondition\022\025\n" + "\rsearch_string\030\001 \001(\t\022I\n\023optional_referen" + "ces\030\002 \003(\0132,.io.deephaven.proto.backplane" + ".grpc.Reference\"\224\001\n\016FlattenRequest\022<\n\tre" + "sult_id\030\001 \001(\0132).io.deephaven.proto.backp" + "lane.grpc.Ticket\022D\n\tsource_id\030\002 \001(\01321.io" + ".deephaven.proto.backplane.grpc.TableRef" + "erence\"\264\003\n\031RunChartDownsampleRequest\022<\n\t" + "result_id\030\001 \001(\0132).io.deephaven.proto.bac" + "kplane.grpc.Ticket\022D\n\tsource_id\030\002 \001(\01321." + "io.deephaven.proto.backplane.grpc.TableR" + "eference\022\023\n\013pixel_count\030\003 \001(\005\022Z\n\nzoom_ra" + "nge\030\004 \001(\0132F.io.deephaven.proto.backplane" + ".grpc.RunChartDownsampleRequest.ZoomRang" + "e\022\025\n\rx_column_name\030\005 \001(\t\022\026\n\016y_column_nam" + "es\030\006 \003(\t\032s\n\tZoomRange\022\037\n\016min_date_nanos\030" + "\001 \001(\003B\0020\001H\000\210\001\001\022\037\n\016max_date_nanos\030\002 \001(\003B\002" + "0\001H\001\210\001\001B\021\n\017_min_date_nanosB\021\n\017_max_date_" + "nanos\"\365\004\n\027CreateInputTableRequest\022<\n\tres" + "ult_id\030\001 \001(\0132).io.deephaven.proto.backpl" + "ane.grpc.Ticket\022L\n\017source_table_id\030\002 \001(\013" + "21.io.deephaven.proto.backplane.grpc.Tab" + "leReferenceH\000\022\020\n\006schema\030\003 \001(\014H\000\022W\n\004kind\030" + "\004 \001(\0132I.io.deephaven.proto.backplane.grp" + "c.CreateInputTableRequest.InputTableKind" + "\032\324\002\n\016InputTableKind\022}\n\025in_memory_append_" + "only\030\001 \001(\0132\\.io.deephaven.proto.backplan" + "e.grpc.CreateInputTableRequest.InputTabl" + "eKind.InMemoryAppendOnlyH\000\022{\n\024in_memory_" + "key_backed\030\002 \001(\0132[.io.deephaven.proto.ba" + "ckplane.grpc.CreateInputTableRequest.Inp" + "utTableKind.InMemoryKeyBackedH\000\032\024\n\022InMem" + "oryAppendOnly\032(\n\021InMemoryKeyBacked\022\023\n\013ke" + "y_columns\030\001 \003(\tB\006\n\004kindB\014\n\ndefinition\"\221\024" + "\n\021BatchTableRequest\022K\n\003ops\030\001 \003(\0132>.io.de" + "ephaven.proto.backplane.grpc.BatchTableR" + "equest.Operation\032\256\023\n\tOperation\022K\n\013empty_" + "table\030\001 \001(\01324.io.deephaven.proto.backpla" + "ne.grpc.EmptyTableRequestH\000\022I\n\ntime_tabl" + "e\030\002 \001(\01323.io.deephaven.proto.backplane.g" + "rpc.TimeTableRequestH\000\022M\n\014drop_columns\030\003" + " \001(\01325.io.deephaven.proto.backplane.grpc" + ".DropColumnsRequestH\000\022J\n\006update\030\004 \001(\01328." + "io.deephaven.proto.backplane.grpc.Select" + "OrUpdateRequestH\000\022O\n\013lazy_update\030\005 \001(\01328" + ".io.deephaven.proto.backplane.grpc.Selec" + "tOrUpdateRequestH\000\022H\n\004view\030\006 \001(\01328.io.de" + "ephaven.proto.backplane.grpc.SelectOrUpd" + "ateRequestH\000\022O\n\013update_view\030\007 \001(\01328.io.d" + "eephaven.proto.backplane.grpc.SelectOrUp" + "dateRequestH\000\022J\n\006select\030\010 \001(\01328.io.deeph" + "aven.proto.backplane.grpc.SelectOrUpdate" + "RequestH\000\022S\n\017select_distinct\030\t \001(\01328.io." + "deephaven.proto.backplane.grpc.SelectDis" + "tinctRequestH\000\022G\n\006filter\030\n \001(\01325.io.deep" + "haven.proto.backplane.grpc.FilterTableRe" + "questH\000\022`\n\023unstructured_filter\030\013 \001(\0132A.i" "o.deephaven.proto.backplane.grpc.Unstruc" - "turedFilterTableRequest\032@.io.deephaven.p" + "turedFilterTableRequestH\000\022C\n\004sort\030\014 \001(\0132" + "3.io.deephaven.proto.backplane.grpc.Sort" + "TableRequestH\000\022D\n\004head\030\r \001(\01324.io.deepha" + "ven.proto.backplane.grpc.HeadOrTailReque" + "stH\000\022D\n\004tail\030\016 \001(\01324.io.deephaven.proto." + "backplane.grpc.HeadOrTailRequestH\000\022I\n\007he" + "ad_by\030\017 \001(\01326.io.deephaven.proto.backpla" + "ne.grpc.HeadOrTailByRequestH\000\022I\n\007tail_by" + "\030\020 \001(\01326.io.deephaven.proto.backplane.gr" + "pc.HeadOrTailByRequestH\000\022D\n\007ungroup\030\021 \001(" + "\01321.io.deephaven.proto.backplane.grpc.Un" + "groupRequestH\000\022F\n\005merge\030\022 \001(\01325.io.deeph" + "aven.proto.backplane.grpc.MergeTablesReq" + "uestH\000\022S\n\017combo_aggregate\030\023 \001(\01328.io.dee" + "phaven.proto.backplane.grpc.ComboAggrega" + "teRequestH\000\022K\n\010snapshot\030\024 \001(\01327.io.deeph" + "aven.proto.backplane.grpc.SnapshotTableR" + "equestH\000\022D\n\007flatten\030\025 \001(\01321.io.deephaven" + ".proto.backplane.grpc.FlattenRequestH\000\022\\" + "\n\024run_chart_downsample\030\026 \001(\0132<.io.deepha" + "ven.proto.backplane.grpc.RunChartDownsam" + "pleRequestH\000\022O\n\ncross_join\030\027 \001(\01329.io.de" + "ephaven.proto.backplane.grpc.CrossJoinTa" + "blesRequestH\000\022S\n\014natural_join\030\030 \001(\0132;.io" + ".deephaven.proto.backplane.grpc.NaturalJ" + "oinTablesRequestH\000\022O\n\nexact_join\030\031 \001(\01329" + ".io.deephaven.proto.backplane.grpc.Exact" + "JoinTablesRequestH\000\022M\n\tleft_join\030\032 \001(\01328" + ".io.deephaven.proto.backplane.grpc.LeftJ" + "oinTablesRequestH\000\022N\n\nas_of_join\030\033 \001(\01328" + ".io.deephaven.proto.backplane.grpc.AsOfJ" + "oinTablesRequestH\000\022K\n\013fetch_table\030\034 \001(\0132" + "4.io.deephaven.proto.backplane.grpc.Fetc" + "hTableRequestH\000\022X\n\022fetch_pandas_table\030\035 " + "\001(\0132:.io.deephaven.proto.backplane.grpc." + "FetchPandasTableRequestH\000\022^\n\025apply_previ" + "ew_columns\030\036 \001(\0132=.io.deephaven.proto.ba" + "ckplane.grpc.ApplyPreviewColumnsRequestH" + "\000\022X\n\022create_input_table\030\037 \001(\0132:.io.deeph" + "aven.proto.backplane.grpc.CreateInputTab" + "leRequestH\000B\004\n\002op*2\n\017CaseSensitivity\022\016\n\n" + "MATCH_CASE\020\000\022\017\n\013IGNORE_CASE\020\001*&\n\tMatchTy" + "pe\022\013\n\007REGULAR\020\000\022\014\n\010INVERTED\020\0012\316%\n\014TableS" + "ervice\022\221\001\n GetExportedTableCreationRespo" + "nse\022).io.deephaven.proto.backplane.grpc." + "Ticket\032@.io.deephaven.proto.backplane.gr" + "pc.ExportedTableCreationResponse\"\000\022\206\001\n\nF" + "etchTable\0224.io.deephaven.proto.backplane" + ".grpc.FetchTableRequest\032@.io.deephaven.p" "roto.backplane.grpc.ExportedTableCreatio" - "nResponse\"\000\022\177\n\004Sort\0223.io.deephaven.proto" - ".backplane.grpc.SortTableRequest\032@.io.de" - "ephaven.proto.backplane.grpc.ExportedTab" - "leCreationResponse\"\000\022\200\001\n\004Head\0224.io.deeph" - "aven.proto.backplane.grpc.HeadOrTailRequ" - "est\032@.io.deephaven.proto.backplane.grpc." - "ExportedTableCreationResponse\"\000\022\200\001\n\004Tail" - "\0224.io.deephaven.proto.backplane.grpc.Hea" - "dOrTailRequest\032@.io.deephaven.proto.back" - "plane.grpc.ExportedTableCreationResponse" - "\"\000\022\204\001\n\006HeadBy\0226.io.deephaven.proto.backp" - "lane.grpc.HeadOrTailByRequest\032@.io.deeph" - "aven.proto.backplane.grpc.ExportedTableC" - "reationResponse\"\000\022\204\001\n\006TailBy\0226.io.deepha" - "ven.proto.backplane.grpc.HeadOrTailByReq" - "uest\032@.io.deephaven.proto.backplane.grpc" - ".ExportedTableCreationResponse\"\000\022\200\001\n\007Ung" - "roup\0221.io.deephaven.proto.backplane.grpc" - ".UngroupRequest\032@.io.deephaven.proto.bac" - "kplane.grpc.ExportedTableCreationRespons" - "e\"\000\022\210\001\n\013MergeTables\0225.io.deephaven.proto" - ".backplane.grpc.MergeTablesRequest\032@.io." - "deephaven.proto.backplane.grpc.ExportedT" - "ableCreationResponse\"\000\022\220\001\n\017CrossJoinTabl" - "es\0229.io.deephaven.proto.backplane.grpc.C" - "rossJoinTablesRequest\032@.io.deephaven.pro" - "to.backplane.grpc.ExportedTableCreationR" - "esponse\"\000\022\224\001\n\021NaturalJoinTables\022;.io.dee" - "phaven.proto.backplane.grpc.NaturalJoinT" - "ablesRequest\032@.io.deephaven.proto.backpl" - "ane.grpc.ExportedTableCreationResponse\"\000" - "\022\220\001\n\017ExactJoinTables\0229.io.deephaven.prot" - "o.backplane.grpc.ExactJoinTablesRequest\032" - "@.io.deephaven.proto.backplane.grpc.Expo" - "rtedTableCreationResponse\"\000\022\216\001\n\016LeftJoin" - "Tables\0228.io.deephaven.proto.backplane.gr" - "pc.LeftJoinTablesRequest\032@.io.deephaven." - "proto.backplane.grpc.ExportedTableCreati" - "onResponse\"\000\022\216\001\n\016AsOfJoinTables\0228.io.dee" - "phaven.proto.backplane.grpc.AsOfJoinTabl" - "esRequest\032@.io.deephaven.proto.backplane" - ".grpc.ExportedTableCreationResponse\"\000\022\216\001" - "\n\016ComboAggregate\0228.io.deephaven.proto.ba" - "ckplane.grpc.ComboAggregateRequest\032@.io." - "deephaven.proto.backplane.grpc.ExportedT" - "ableCreationResponse\"\000\022\207\001\n\010Snapshot\0227.io" - ".deephaven.proto.backplane.grpc.Snapshot" + "nResponse\"\000\022\222\001\n\020FetchPandasTable\022:.io.de" + "ephaven.proto.backplane.grpc.FetchPandas" "TableRequest\032@.io.deephaven.proto.backpl" "ane.grpc.ExportedTableCreationResponse\"\000" - "\022\200\001\n\007Flatten\0221.io.deephaven.proto.backpl" - "ane.grpc.FlattenRequest\032@.io.deephaven.p" - "roto.backplane.grpc.ExportedTableCreatio" - "nResponse\"\000\022\226\001\n\022RunChartDownsample\022<.io." - "deephaven.proto.backplane.grpc.RunChartD" - "ownsampleRequest\032@.io.deephaven.proto.ba" + "\022\230\001\n\023ApplyPreviewColumns\022=.io.deephaven." + "proto.backplane.grpc.ApplyPreviewColumns" + "Request\032@.io.deephaven.proto.backplane.g" + "rpc.ExportedTableCreationResponse\"\000\022\206\001\n\n" + "EmptyTable\0224.io.deephaven.proto.backplan" + "e.grpc.EmptyTableRequest\032@.io.deephaven." + "proto.backplane.grpc.ExportedTableCreati" + "onResponse\"\000\022\204\001\n\tTimeTable\0223.io.deephave" + "n.proto.backplane.grpc.TimeTableRequest\032" + "@.io.deephaven.proto.backplane.grpc.Expo" + "rtedTableCreationResponse\"\000\022\210\001\n\013DropColu" + "mns\0225.io.deephaven.proto.backplane.grpc." + "DropColumnsRequest\032@.io.deephaven.proto." + "backplane.grpc.ExportedTableCreationResp" + "onse\"\000\022\206\001\n\006Update\0228.io.deephaven.proto.b" + "ackplane.grpc.SelectOrUpdateRequest\032@.io" + ".deephaven.proto.backplane.grpc.Exported" + "TableCreationResponse\"\000\022\212\001\n\nLazyUpdate\0228" + ".io.deephaven.proto.backplane.grpc.Selec" + "tOrUpdateRequest\032@.io.deephaven.proto.ba" "ckplane.grpc.ExportedTableCreationRespon" - "se\"\000\022\222\001\n\020CreateInputTable\022:.io.deephaven" - ".proto.backplane.grpc.CreateInputTableRe" - "quest\032@.io.deephaven.proto.backplane.grp" - "c.ExportedTableCreationResponse\"\000\022\203\001\n\005Ba" - "tch\0224.io.deephaven.proto.backplane.grpc." - "BatchTableRequest\032@.io.deephaven.proto.b" + "se\"\000\022\204\001\n\004View\0228.io.deephaven.proto.backp" + "lane.grpc.SelectOrUpdateRequest\032@.io.dee" + "phaven.proto.backplane.grpc.ExportedTabl" + "eCreationResponse\"\000\022\212\001\n\nUpdateView\0228.io." + "deephaven.proto.backplane.grpc.SelectOrU" + "pdateRequest\032@.io.deephaven.proto.backpl" + "ane.grpc.ExportedTableCreationResponse\"\000" + "\022\206\001\n\006Select\0228.io.deephaven.proto.backpla" + "ne.grpc.SelectOrUpdateRequest\032@.io.deeph" + "aven.proto.backplane.grpc.ExportedTableC" + "reationResponse\"\000\022\216\001\n\016SelectDistinct\0228.i" + "o.deephaven.proto.backplane.grpc.SelectD" + "istinctRequest\032@.io.deephaven.proto.back" + "plane.grpc.ExportedTableCreationResponse" + "\"\000\022\203\001\n\006Filter\0225.io.deephaven.proto.backp" + "lane.grpc.FilterTableRequest\032@.io.deepha" + "ven.proto.backplane.grpc.ExportedTableCr" + "eationResponse\"\000\022\233\001\n\022UnstructuredFilter\022" + "A.io.deephaven.proto.backplane.grpc.Unst" + "ructuredFilterTableRequest\032@.io.deephave" + "n.proto.backplane.grpc.ExportedTableCrea" + "tionResponse\"\000\022\177\n\004Sort\0223.io.deephaven.pr" + "oto.backplane.grpc.SortTableRequest\032@.io" + ".deephaven.proto.backplane.grpc.Exported" + "TableCreationResponse\"\000\022\200\001\n\004Head\0224.io.de" + "ephaven.proto.backplane.grpc.HeadOrTailR" + "equest\032@.io.deephaven.proto.backplane.gr" + "pc.ExportedTableCreationResponse\"\000\022\200\001\n\004T" + "ail\0224.io.deephaven.proto.backplane.grpc." + "HeadOrTailRequest\032@.io.deephaven.proto.b" "ackplane.grpc.ExportedTableCreationRespo" - "nse\"\0000\001\022\231\001\n\024ExportedTableUpdates\022>.io.de" + "nse\"\000\022\204\001\n\006HeadBy\0226.io.deephaven.proto.ba" + "ckplane.grpc.HeadOrTailByRequest\032@.io.de" "ephaven.proto.backplane.grpc.ExportedTab" - "leUpdatesRequest\032=.io.deephaven.proto.ba" - "ckplane.grpc.ExportedTableUpdateMessage\"" - "\0000\001B\004H\001P\001b\006proto3" + "leCreationResponse\"\000\022\204\001\n\006TailBy\0226.io.dee" + "phaven.proto.backplane.grpc.HeadOrTailBy" + "Request\032@.io.deephaven.proto.backplane.g" + "rpc.ExportedTableCreationResponse\"\000\022\200\001\n\007" + "Ungroup\0221.io.deephaven.proto.backplane.g" + "rpc.UngroupRequest\032@.io.deephaven.proto." + "backplane.grpc.ExportedTableCreationResp" + "onse\"\000\022\210\001\n\013MergeTables\0225.io.deephaven.pr" + "oto.backplane.grpc.MergeTablesRequest\032@." + "io.deephaven.proto.backplane.grpc.Export" + "edTableCreationResponse\"\000\022\220\001\n\017CrossJoinT" + "ables\0229.io.deephaven.proto.backplane.grp" + "c.CrossJoinTablesRequest\032@.io.deephaven." + "proto.backplane.grpc.ExportedTableCreati" + "onResponse\"\000\022\224\001\n\021NaturalJoinTables\022;.io." + "deephaven.proto.backplane.grpc.NaturalJo" + "inTablesRequest\032@.io.deephaven.proto.bac" + "kplane.grpc.ExportedTableCreationRespons" + "e\"\000\022\220\001\n\017ExactJoinTables\0229.io.deephaven.p" + "roto.backplane.grpc.ExactJoinTablesReque" + "st\032@.io.deephaven.proto.backplane.grpc.E" + "xportedTableCreationResponse\"\000\022\216\001\n\016LeftJ" + "oinTables\0228.io.deephaven.proto.backplane" + ".grpc.LeftJoinTablesRequest\032@.io.deephav" + "en.proto.backplane.grpc.ExportedTableCre" + "ationResponse\"\000\022\216\001\n\016AsOfJoinTables\0228.io." + "deephaven.proto.backplane.grpc.AsOfJoinT" + "ablesRequest\032@.io.deephaven.proto.backpl" + "ane.grpc.ExportedTableCreationResponse\"\000" + "\022\216\001\n\016ComboAggregate\0228.io.deephaven.proto" + ".backplane.grpc.ComboAggregateRequest\032@." + "io.deephaven.proto.backplane.grpc.Export" + "edTableCreationResponse\"\000\022\207\001\n\010Snapshot\0227" + ".io.deephaven.proto.backplane.grpc.Snaps" + "hotTableRequest\032@.io.deephaven.proto.bac" + "kplane.grpc.ExportedTableCreationRespons" + "e\"\000\022\200\001\n\007Flatten\0221.io.deephaven.proto.bac" + "kplane.grpc.FlattenRequest\032@.io.deephave" + "n.proto.backplane.grpc.ExportedTableCrea" + "tionResponse\"\000\022\226\001\n\022RunChartDownsample\022<." + "io.deephaven.proto.backplane.grpc.RunCha" + "rtDownsampleRequest\032@.io.deephaven.proto" + ".backplane.grpc.ExportedTableCreationRes" + "ponse\"\000\022\222\001\n\020CreateInputTable\022:.io.deepha" + "ven.proto.backplane.grpc.CreateInputTabl" + "eRequest\032@.io.deephaven.proto.backplane." + "grpc.ExportedTableCreationResponse\"\000\022\203\001\n" + "\005Batch\0224.io.deephaven.proto.backplane.gr" + "pc.BatchTableRequest\032@.io.deephaven.prot" + "o.backplane.grpc.ExportedTableCreationRe" + "sponse\"\0000\001\022\231\001\n\024ExportedTableUpdates\022>.io" + ".deephaven.proto.backplane.grpc.Exported" + "TableUpdatesRequest\032=.io.deephaven.proto" + ".backplane.grpc.ExportedTableUpdateMessa" + "ge\"\0000\001B\004H\001P\001b\006proto3" ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_deephaven_2fproto_2ftable_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_deephaven_2fproto_2ftable_2eproto_deps[1] = { &::descriptor_table_deephaven_2fproto_2fticket_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2ftable_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2ftable_2eproto = { - false, false, 17817, descriptor_table_protodef_deephaven_2fproto_2ftable_2eproto, "deephaven/proto/table.proto", - &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, descriptor_table_deephaven_2fproto_2ftable_2eproto_deps, 1, 53, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2ftable_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2ftable_2eproto, file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto, file_level_service_descriptors_deephaven_2fproto_2ftable_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2ftable_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2ftable_2eproto = { + false, false, 17500, descriptor_table_protodef_deephaven_2fproto_2ftable_2eproto, + "deephaven/proto/table.proto", + &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, descriptor_table_deephaven_2fproto_2ftable_2eproto_deps, 1, 51, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2ftable_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2ftable_2eproto, file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto, + file_level_service_descriptors_deephaven_2fproto_2ftable_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2ftable_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2ftable_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2ftable_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2ftable_2eproto(&descriptor_table_deephaven_2fproto_2ftable_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2ftable_2eproto(&descriptor_table_deephaven_2fproto_2ftable_2eproto); namespace io { namespace deephaven { namespace proto { @@ -1892,7 +1845,7 @@ bool AsOfJoinTablesRequest_MatchRule_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::LESS_THAN_EQUAL; constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::LESS_THAN; constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::GREATER_THAN_EQUAL; @@ -1900,7 +1853,7 @@ constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::GREATER_THAN; constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::MatchRule_MIN; constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest::MatchRule_MAX; constexpr int AsOfJoinTablesRequest::MatchRule_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ComboAggregateRequest_AggType_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2ftable_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[1]; @@ -1927,7 +1880,7 @@ bool ComboAggregateRequest_AggType_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr ComboAggregateRequest_AggType ComboAggregateRequest::SUM; constexpr ComboAggregateRequest_AggType ComboAggregateRequest::ABS_SUM; constexpr ComboAggregateRequest_AggType ComboAggregateRequest::GROUP; @@ -1945,7 +1898,7 @@ constexpr ComboAggregateRequest_AggType ComboAggregateRequest::WEIGHTED_AVG; constexpr ComboAggregateRequest_AggType ComboAggregateRequest::AggType_MIN; constexpr ComboAggregateRequest_AggType ComboAggregateRequest::AggType_MAX; constexpr int ComboAggregateRequest::AggType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SortDescriptor_SortDirection_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2ftable_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[2]; @@ -1962,7 +1915,7 @@ bool SortDescriptor_SortDirection_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr SortDescriptor_SortDirection SortDescriptor::UNKNOWN; constexpr SortDescriptor_SortDirection SortDescriptor::DESCENDING; constexpr SortDescriptor_SortDirection SortDescriptor::ASCENDING; @@ -1970,7 +1923,7 @@ constexpr SortDescriptor_SortDirection SortDescriptor::REVERSE; constexpr SortDescriptor_SortDirection SortDescriptor::SortDirection_MIN; constexpr SortDescriptor_SortDirection SortDescriptor::SortDirection_MAX; constexpr int SortDescriptor::SortDirection_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CompareCondition_CompareOperation_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2ftable_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[3]; @@ -1989,7 +1942,7 @@ bool CompareCondition_CompareOperation_IsValid(int value) { } } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr CompareCondition_CompareOperation CompareCondition::LESS_THAN; constexpr CompareCondition_CompareOperation CompareCondition::LESS_THAN_OR_EQUAL; constexpr CompareCondition_CompareOperation CompareCondition::GREATER_THAN; @@ -1999,7 +1952,7 @@ constexpr CompareCondition_CompareOperation CompareCondition::NOT_EQUALS; constexpr CompareCondition_CompareOperation CompareCondition::CompareOperation_MIN; constexpr CompareCondition_CompareOperation CompareCondition::CompareOperation_MAX; constexpr int CompareCondition::CompareOperation_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CaseSensitivity_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_deephaven_2fproto_2ftable_2eproto); return file_level_enum_descriptors_deephaven_2fproto_2ftable_2eproto[4]; @@ -2045,8 +1998,7 @@ void TableReference::set_allocated_ticket(::io::deephaven::proto::backplane::grp clear_ref(); if (ticket) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(ticket)); if (message_arena != submessage_arena) { ticket = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2069,9 +2021,6 @@ TableReference::TableReference(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.TableReference) } TableReference::TableReference(const TableReference& from) @@ -2094,15 +2043,17 @@ TableReference::TableReference(const TableReference& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.TableReference) } -void TableReference::SharedCtor() { +inline void TableReference::SharedCtor() { clear_has_ref(); } TableReference::~TableReference() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.TableReference) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TableReference::SharedDtor() { @@ -2112,12 +2063,6 @@ inline void TableReference::SharedDtor() { } } -void TableReference::ArenaDtor(void* object) { - TableReference* _this = reinterpret_cast< TableReference* >(object); - (void)_this; -} -void TableReference::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TableReference::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -2145,7 +2090,7 @@ void TableReference::clear_ref() { void TableReference::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.TableReference) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2153,15 +2098,15 @@ void TableReference::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TableReference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TableReference::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_ticket(), ptr); CHK_(ptr); } else @@ -2169,7 +2114,7 @@ const char* TableReference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // sint32 batch_offset = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { _internal_set_batch_offset(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr)); CHK_(ptr); } else @@ -2198,28 +2143,27 @@ const char* TableReference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TableReference::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TableReference::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.TableReference) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; if (_internal_has_ticket()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::ticket(this), target, stream); + InternalWriteMessage(1, _Internal::ticket(this), + _Internal::ticket(this).GetCachedSize(), target, stream); } // sint32 batch_offset = 2; if (_internal_has_batch_offset()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt32ToArray(2, this->_internal_batch_offset(), target); + target = ::_pbi::WireFormatLite::WriteSInt32ToArray(2, this->_internal_batch_offset(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.TableReference) @@ -2230,7 +2174,7 @@ size_t TableReference::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.TableReference) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2244,7 +2188,7 @@ size_t TableReference::ByteSizeLong() const { } // sint32 batch_offset = 2; case kBatchOffset: { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt32SizePlusOne(this->_internal_batch_offset()); + total_size += ::_pbi::WireFormatLite::SInt32SizePlusOne(this->_internal_batch_offset()); break; } case REF_NOT_SET: { @@ -2270,7 +2214,7 @@ void TableReference::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void TableReference::MergeFrom(const TableReference& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.TableReference) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.ref_case()) { @@ -2308,7 +2252,7 @@ void TableReference::InternalSwap(TableReference* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata TableReference::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, file_level_metadata_deephaven_2fproto_2ftable_2eproto[0]); } @@ -2328,22 +2272,25 @@ ExportedTableCreationResponse::ExportedTableCreationResponse(::PROTOBUF_NAMESPAC bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) } ExportedTableCreationResponse::ExportedTableCreationResponse(const ExportedTableCreationResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - error_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + error_info_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + error_info_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_error_info().empty()) { - error_info_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_error_info(), + error_info_.Set(from._internal_error_info(), GetArenaForAllocation()); } - schema_header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + schema_header_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + schema_header_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_schema_header().empty()) { - schema_header_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_schema_header(), + schema_header_.Set(from._internal_schema_header(), GetArenaForAllocation()); } if (from._internal_has_result_id()) { @@ -2357,9 +2304,15 @@ ExportedTableCreationResponse::ExportedTableCreationResponse(const ExportedTable // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) } -void ExportedTableCreationResponse::SharedCtor() { -error_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -schema_header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ExportedTableCreationResponse::SharedCtor() { +error_info_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + error_info_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +schema_header_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + schema_header_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&is_static_) - @@ -2368,31 +2321,27 @@ ::memset(reinterpret_cast(this) + static_cast( ExportedTableCreationResponse::~ExportedTableCreationResponse() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExportedTableCreationResponse::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - error_info_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - schema_header_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + error_info_.Destroy(); + schema_header_.Destroy(); if (this != internal_default_instance()) delete result_id_; } -void ExportedTableCreationResponse::ArenaDtor(void* object) { - ExportedTableCreationResponse* _this = reinterpret_cast< ExportedTableCreationResponse* >(object); - (void)_this; -} -void ExportedTableCreationResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExportedTableCreationResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExportedTableCreationResponse::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2408,15 +2357,15 @@ void ExportedTableCreationResponse::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TableReference result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -2424,7 +2373,7 @@ const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::PRO continue; // bool success = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { success_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2432,26 +2381,26 @@ const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::PRO continue; // string error_info = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_error_info(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info")); } else goto handle_unusual; continue; // bytes schema_header = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { auto str = _internal_mutable_schema_header(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; // bool is_static = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { is_static_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -2459,7 +2408,7 @@ const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::PRO continue; // sint64 size = 6 [jstype = JS_STRING]; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -2488,24 +2437,23 @@ const char* ExportedTableCreationResponse::_InternalParse(const char* ptr, ::PRO #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExportedTableCreationResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExportedTableCreationResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TableReference result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // bool success = 2; if (this->_internal_success() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_success(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_success(), target); } // string error_info = 3; @@ -2527,17 +2475,17 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExportedTableCreationResponse::_InternalSerializ // bool is_static = 5; if (this->_internal_is_static() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_is_static(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_is_static(), target); } // sint64 size = 6 [jstype = JS_STRING]; if (this->_internal_size() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(6, this->_internal_size(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(6, this->_internal_size(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) @@ -2548,7 +2496,7 @@ size_t ExportedTableCreationResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2575,7 +2523,7 @@ size_t ExportedTableCreationResponse::ByteSizeLong() const { // sint64 size = 6 [jstype = JS_STRING]; if (this->_internal_size() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); } // bool success = 2; @@ -2607,7 +2555,7 @@ void ExportedTableCreationResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* void ExportedTableCreationResponse::MergeFrom(const ExportedTableCreationResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_error_info().empty()) { @@ -2648,12 +2596,10 @@ void ExportedTableCreationResponse::InternalSwap(ExportedTableCreationResponse* auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &error_info_, lhs_arena, &other->error_info_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &schema_header_, lhs_arena, &other->schema_header_, rhs_arena ); @@ -2666,7 +2612,7 @@ void ExportedTableCreationResponse::InternalSwap(ExportedTableCreationResponse* } ::PROTOBUF_NAMESPACE_ID::Metadata ExportedTableCreationResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, file_level_metadata_deephaven_2fproto_2ftable_2eproto[1]); } @@ -2697,9 +2643,6 @@ FetchTableRequest::FetchTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchTableRequest) } FetchTableRequest::FetchTableRequest(const FetchTableRequest& from) @@ -2718,7 +2661,7 @@ FetchTableRequest::FetchTableRequest(const FetchTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchTableRequest) } -void FetchTableRequest::SharedCtor() { +inline void FetchTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&source_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&result_id_) - @@ -2727,9 +2670,11 @@ ::memset(reinterpret_cast(this) + static_cast( FetchTableRequest::~FetchTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FetchTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FetchTableRequest::SharedDtor() { @@ -2738,19 +2683,13 @@ inline void FetchTableRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void FetchTableRequest::ArenaDtor(void* object) { - FetchTableRequest* _this = reinterpret_cast< FetchTableRequest* >(object); - (void)_this; -} -void FetchTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FetchTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void FetchTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FetchTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2765,15 +2704,15 @@ void FetchTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FetchTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FetchTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -2781,7 +2720,7 @@ const char* FetchTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -2810,30 +2749,28 @@ const char* FetchTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FetchTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FetchTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FetchTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); + InternalWriteMessage(1, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::result_id(this), target, stream); + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FetchTableRequest) @@ -2844,7 +2781,7 @@ size_t FetchTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FetchTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2881,7 +2818,7 @@ void FetchTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FetchTableRequest::MergeFrom(const FetchTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FetchTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_source_id()) { @@ -2916,7 +2853,7 @@ void FetchTableRequest::InternalSwap(FetchTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FetchTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, file_level_metadata_deephaven_2fproto_2ftable_2eproto[2]); } @@ -2947,9 +2884,6 @@ ApplyPreviewColumnsRequest::ApplyPreviewColumnsRequest(::PROTOBUF_NAMESPACE_ID:: bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) } ApplyPreviewColumnsRequest::ApplyPreviewColumnsRequest(const ApplyPreviewColumnsRequest& from) @@ -2968,7 +2902,7 @@ ApplyPreviewColumnsRequest::ApplyPreviewColumnsRequest(const ApplyPreviewColumns // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) } -void ApplyPreviewColumnsRequest::SharedCtor() { +inline void ApplyPreviewColumnsRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&source_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&result_id_) - @@ -2977,9 +2911,11 @@ ::memset(reinterpret_cast(this) + static_cast( ApplyPreviewColumnsRequest::~ApplyPreviewColumnsRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ApplyPreviewColumnsRequest::SharedDtor() { @@ -2988,19 +2924,13 @@ inline void ApplyPreviewColumnsRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void ApplyPreviewColumnsRequest::ArenaDtor(void* object) { - ApplyPreviewColumnsRequest* _this = reinterpret_cast< ApplyPreviewColumnsRequest* >(object); - (void)_this; -} -void ApplyPreviewColumnsRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ApplyPreviewColumnsRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ApplyPreviewColumnsRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3015,15 +2945,15 @@ void ApplyPreviewColumnsRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ApplyPreviewColumnsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ApplyPreviewColumnsRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -3031,7 +2961,7 @@ const char* ApplyPreviewColumnsRequest::_InternalParse(const char* ptr, ::PROTOB continue; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -3060,30 +2990,28 @@ const char* ApplyPreviewColumnsRequest::_InternalParse(const char* ptr, ::PROTOB #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ApplyPreviewColumnsRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ApplyPreviewColumnsRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); + InternalWriteMessage(1, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::result_id(this), target, stream); + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) @@ -3094,7 +3022,7 @@ size_t ApplyPreviewColumnsRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3131,7 +3059,7 @@ void ApplyPreviewColumnsRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ApplyPreviewColumnsRequest::MergeFrom(const ApplyPreviewColumnsRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_source_id()) { @@ -3166,7 +3094,7 @@ void ApplyPreviewColumnsRequest::InternalSwap(ApplyPreviewColumnsRequest* other) } ::PROTOBUF_NAMESPACE_ID::Metadata ApplyPreviewColumnsRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, file_level_metadata_deephaven_2fproto_2ftable_2eproto[3]); } @@ -3197,9 +3125,6 @@ FetchPandasTableRequest::FetchPandasTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) } FetchPandasTableRequest::FetchPandasTableRequest(const FetchPandasTableRequest& from) @@ -3218,7 +3143,7 @@ FetchPandasTableRequest::FetchPandasTableRequest(const FetchPandasTableRequest& // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) } -void FetchPandasTableRequest::SharedCtor() { +inline void FetchPandasTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&source_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&result_id_) - @@ -3227,9 +3152,11 @@ ::memset(reinterpret_cast(this) + static_cast( FetchPandasTableRequest::~FetchPandasTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FetchPandasTableRequest::SharedDtor() { @@ -3238,19 +3165,13 @@ inline void FetchPandasTableRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void FetchPandasTableRequest::ArenaDtor(void* object) { - FetchPandasTableRequest* _this = reinterpret_cast< FetchPandasTableRequest* >(object); - (void)_this; -} -void FetchPandasTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FetchPandasTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void FetchPandasTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3265,15 +3186,15 @@ void FetchPandasTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FetchPandasTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FetchPandasTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -3281,7 +3202,7 @@ const char* FetchPandasTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_ continue; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -3310,30 +3231,28 @@ const char* FetchPandasTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FetchPandasTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FetchPandasTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); + InternalWriteMessage(1, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::result_id(this), target, stream); + InternalWriteMessage(2, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) @@ -3344,7 +3263,7 @@ size_t FetchPandasTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3381,7 +3300,7 @@ void FetchPandasTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FetchPandasTableRequest::MergeFrom(const FetchPandasTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_source_id()) { @@ -3416,302 +3335,13 @@ void FetchPandasTableRequest::InternalSwap(FetchPandasTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FetchPandasTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, file_level_metadata_deephaven_2fproto_2ftable_2eproto[4]); } // =================================================================== -class FetchTableMapRequest::_Internal { - public: - static const ::io::deephaven::proto::backplane::grpc::TableReference& source_id(const FetchTableMapRequest* msg); - static const ::io::deephaven::proto::backplane::grpc::Ticket& result_id(const FetchTableMapRequest* msg); -}; - -const ::io::deephaven::proto::backplane::grpc::TableReference& -FetchTableMapRequest::_Internal::source_id(const FetchTableMapRequest* msg) { - return *msg->source_id_; -} -const ::io::deephaven::proto::backplane::grpc::Ticket& -FetchTableMapRequest::_Internal::result_id(const FetchTableMapRequest* msg) { - return *msg->result_id_; -} -void FetchTableMapRequest::clear_result_id() { - if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { - delete result_id_; - } - result_id_ = nullptr; -} -FetchTableMapRequest::FetchTableMapRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) -} -FetchTableMapRequest::FetchTableMapRequest(const FetchTableMapRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_source_id()) { - source_id_ = new ::io::deephaven::proto::backplane::grpc::TableReference(*from.source_id_); - } else { - source_id_ = nullptr; - } - if (from._internal_has_result_id()) { - result_id_ = new ::io::deephaven::proto::backplane::grpc::Ticket(*from.result_id_); - } else { - result_id_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) -} - -void FetchTableMapRequest::SharedCtor() { -::memset(reinterpret_cast(this) + static_cast( - reinterpret_cast(&source_id_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&result_id_) - - reinterpret_cast(&source_id_)) + sizeof(result_id_)); -} - -FetchTableMapRequest::~FetchTableMapRequest() { - // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void FetchTableMapRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete source_id_; - if (this != internal_default_instance()) delete result_id_; -} - -void FetchTableMapRequest::ArenaDtor(void* object) { - FetchTableMapRequest* _this = reinterpret_cast< FetchTableMapRequest* >(object); - (void)_this; -} -void FetchTableMapRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void FetchTableMapRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void FetchTableMapRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaForAllocation() == nullptr && source_id_ != nullptr) { - delete source_id_; - } - source_id_ = nullptr; - if (GetArenaForAllocation() == nullptr && result_id_ != nullptr) { - delete result_id_; - } - result_id_ = nullptr; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* FetchTableMapRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* FetchTableMapRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; - if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::source_id(this), target, stream); - } - - // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; - if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::result_id(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - return target; -} - -size_t FetchTableMapRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; - if (this->_internal_has_source_id()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *source_id_); - } - - // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; - if (this->_internal_has_result_id()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *result_id_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FetchTableMapRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - FetchTableMapRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FetchTableMapRequest::GetClassData() const { return &_class_data_; } - -void FetchTableMapRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void FetchTableMapRequest::MergeFrom(const FetchTableMapRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_has_source_id()) { - _internal_mutable_source_id()->::io::deephaven::proto::backplane::grpc::TableReference::MergeFrom(from._internal_source_id()); - } - if (from._internal_has_result_id()) { - _internal_mutable_result_id()->::io::deephaven::proto::backplane::grpc::Ticket::MergeFrom(from._internal_result_id()); - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void FetchTableMapRequest::CopyFrom(const FetchTableMapRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FetchTableMapRequest::IsInitialized() const { - return true; -} - -void FetchTableMapRequest::InternalSwap(FetchTableMapRequest* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(FetchTableMapRequest, result_id_) - + sizeof(FetchTableMapRequest::result_id_) - - PROTOBUF_FIELD_OFFSET(FetchTableMapRequest, source_id_)>( - reinterpret_cast(&source_id_), - reinterpret_cast(&other->source_id_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FetchTableMapRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[5]); -} - -// =================================================================== - -class FetchTableMapResponse::_Internal { - public: -}; - -FetchTableMapResponse::FetchTableMapResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { - // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FetchTableMapResponse) -} -FetchTableMapResponse::FetchTableMapResponse(const FetchTableMapResponse& from) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FetchTableMapResponse) -} - - - - - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FetchTableMapResponse::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FetchTableMapResponse::GetClassData() const { return &_class_data_; } - - - - - - - -::PROTOBUF_NAMESPACE_ID::Metadata FetchTableMapResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[6]); -} - -// =================================================================== - class ExportedTableUpdatesRequest::_Internal { public: }; @@ -3744,9 +3374,9 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ExportedTableUpdatesRequest::G ::PROTOBUF_NAMESPACE_ID::Metadata ExportedTableUpdatesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[7]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[5]); } // =================================================================== @@ -3770,17 +3400,17 @@ ExportedTableUpdateMessage::ExportedTableUpdateMessage(::PROTOBUF_NAMESPACE_ID:: bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) } ExportedTableUpdateMessage::ExportedTableUpdateMessage(const ExportedTableUpdateMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - update_failure_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + update_failure_message_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + update_failure_message_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_update_failure_message().empty()) { - update_failure_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_update_failure_message(), + update_failure_message_.Set(from._internal_update_failure_message(), GetArenaForAllocation()); } if (from._internal_has_export_id()) { @@ -3792,8 +3422,11 @@ ExportedTableUpdateMessage::ExportedTableUpdateMessage(const ExportedTableUpdate // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) } -void ExportedTableUpdateMessage::SharedCtor() { -update_failure_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ExportedTableUpdateMessage::SharedCtor() { +update_failure_message_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + update_failure_message_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&export_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&size_) - @@ -3802,30 +3435,26 @@ ::memset(reinterpret_cast(this) + static_cast( ExportedTableUpdateMessage::~ExportedTableUpdateMessage() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExportedTableUpdateMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - update_failure_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + update_failure_message_.Destroy(); if (this != internal_default_instance()) delete export_id_; } -void ExportedTableUpdateMessage::ArenaDtor(void* object) { - ExportedTableUpdateMessage* _this = reinterpret_cast< ExportedTableUpdateMessage* >(object); - (void)_this; -} -void ExportedTableUpdateMessage::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExportedTableUpdateMessage::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExportedTableUpdateMessage::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3838,15 +3467,15 @@ void ExportedTableUpdateMessage::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExportedTableUpdateMessage::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExportedTableUpdateMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket export_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_export_id(), ptr); CHK_(ptr); } else @@ -3854,7 +3483,7 @@ const char* ExportedTableUpdateMessage::_InternalParse(const char* ptr, ::PROTOB continue; // sint64 size = 2 [jstype = JS_STRING]; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -3862,11 +3491,11 @@ const char* ExportedTableUpdateMessage::_InternalParse(const char* ptr, ::PROTOB continue; // string update_failure_message = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_update_failure_message(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message")); } else goto handle_unusual; continue; @@ -3893,24 +3522,23 @@ const char* ExportedTableUpdateMessage::_InternalParse(const char* ptr, ::PROTOB #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExportedTableUpdateMessage::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExportedTableUpdateMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket export_id = 1; if (this->_internal_has_export_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::export_id(this), target, stream); + InternalWriteMessage(1, _Internal::export_id(this), + _Internal::export_id(this).GetCachedSize(), target, stream); } // sint64 size = 2 [jstype = JS_STRING]; if (this->_internal_size() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(2, this->_internal_size(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(2, this->_internal_size(), target); } // string update_failure_message = 3; @@ -3924,7 +3552,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExportedTableUpdateMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) @@ -3935,7 +3563,7 @@ size_t ExportedTableUpdateMessage::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3955,7 +3583,7 @@ size_t ExportedTableUpdateMessage::ByteSizeLong() const { // sint64 size = 2 [jstype = JS_STRING]; if (this->_internal_size() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -3977,7 +3605,7 @@ void ExportedTableUpdateMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExportedTableUpdateMessage::MergeFrom(const ExportedTableUpdateMessage& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_update_failure_message().empty()) { @@ -4009,7 +3637,6 @@ void ExportedTableUpdateMessage::InternalSwap(ExportedTableUpdateMessage* other) auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &update_failure_message_, lhs_arena, &other->update_failure_message_, rhs_arena ); @@ -4022,9 +3649,9 @@ void ExportedTableUpdateMessage::InternalSwap(ExportedTableUpdateMessage* other) } ::PROTOBUF_NAMESPACE_ID::Metadata ExportedTableUpdateMessage::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[8]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[6]); } // =================================================================== @@ -4048,9 +3675,6 @@ EmptyTableRequest::EmptyTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.EmptyTableRequest) } EmptyTableRequest::EmptyTableRequest(const EmptyTableRequest& from) @@ -4065,7 +3689,7 @@ EmptyTableRequest::EmptyTableRequest(const EmptyTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.EmptyTableRequest) } -void EmptyTableRequest::SharedCtor() { +inline void EmptyTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&size_) - @@ -4074,9 +3698,11 @@ ::memset(reinterpret_cast(this) + static_cast( EmptyTableRequest::~EmptyTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.EmptyTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void EmptyTableRequest::SharedDtor() { @@ -4084,19 +3710,13 @@ inline void EmptyTableRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void EmptyTableRequest::ArenaDtor(void* object) { - EmptyTableRequest* _this = reinterpret_cast< EmptyTableRequest* >(object); - (void)_this; -} -void EmptyTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void EmptyTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void EmptyTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.EmptyTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4108,15 +3728,15 @@ void EmptyTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* EmptyTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* EmptyTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -4124,7 +3744,7 @@ const char* EmptyTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // sint64 size = 2 [jstype = JS_STRING]; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -4153,28 +3773,27 @@ const char* EmptyTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* EmptyTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* EmptyTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.EmptyTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // sint64 size = 2 [jstype = JS_STRING]; if (this->_internal_size() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(2, this->_internal_size(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(2, this->_internal_size(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.EmptyTableRequest) @@ -4185,7 +3804,7 @@ size_t EmptyTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.EmptyTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4198,7 +3817,7 @@ size_t EmptyTableRequest::ByteSizeLong() const { // sint64 size = 2 [jstype = JS_STRING]; if (this->_internal_size() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_size()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -4220,7 +3839,7 @@ void EmptyTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void EmptyTableRequest::MergeFrom(const EmptyTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.EmptyTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -4255,9 +3874,9 @@ void EmptyTableRequest::InternalSwap(EmptyTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EmptyTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[9]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[7]); } // =================================================================== @@ -4281,9 +3900,6 @@ TimeTableRequest::TimeTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.TimeTableRequest) } TimeTableRequest::TimeTableRequest(const TimeTableRequest& from) @@ -4300,7 +3916,7 @@ TimeTableRequest::TimeTableRequest(const TimeTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.TimeTableRequest) } -void TimeTableRequest::SharedCtor() { +inline void TimeTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&period_nanos_) - @@ -4309,9 +3925,11 @@ ::memset(reinterpret_cast(this) + static_cast( TimeTableRequest::~TimeTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.TimeTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TimeTableRequest::SharedDtor() { @@ -4319,19 +3937,13 @@ inline void TimeTableRequest::SharedDtor() { if (this != internal_default_instance()) delete result_id_; } -void TimeTableRequest::ArenaDtor(void* object) { - TimeTableRequest* _this = reinterpret_cast< TimeTableRequest* >(object); - (void)_this; -} -void TimeTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TimeTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void TimeTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.TimeTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4345,15 +3957,15 @@ void TimeTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TimeTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TimeTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -4361,7 +3973,7 @@ const char* TimeTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // sint64 start_time_nanos = 2 [jstype = JS_STRING]; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { start_time_nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -4369,7 +3981,7 @@ const char* TimeTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // sint64 period_nanos = 3 [jstype = JS_STRING]; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { period_nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -4398,34 +4010,33 @@ const char* TimeTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TimeTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TimeTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.TimeTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // sint64 start_time_nanos = 2 [jstype = JS_STRING]; if (this->_internal_start_time_nanos() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(2, this->_internal_start_time_nanos(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(2, this->_internal_start_time_nanos(), target); } // sint64 period_nanos = 3 [jstype = JS_STRING]; if (this->_internal_period_nanos() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(3, this->_internal_period_nanos(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(3, this->_internal_period_nanos(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.TimeTableRequest) @@ -4436,7 +4047,7 @@ size_t TimeTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.TimeTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4449,12 +4060,12 @@ size_t TimeTableRequest::ByteSizeLong() const { // sint64 start_time_nanos = 2 [jstype = JS_STRING]; if (this->_internal_start_time_nanos() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_start_time_nanos()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_start_time_nanos()); } // sint64 period_nanos = 3 [jstype = JS_STRING]; if (this->_internal_period_nanos() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_period_nanos()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_period_nanos()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -4476,7 +4087,7 @@ void TimeTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void TimeTableRequest::MergeFrom(const TimeTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.TimeTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -4514,9 +4125,9 @@ void TimeTableRequest::InternalSwap(TimeTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata TimeTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[10]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[8]); } // =================================================================== @@ -4546,9 +4157,6 @@ SelectOrUpdateRequest::SelectOrUpdateRequest(::PROTOBUF_NAMESPACE_ID::Arena* are : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), column_specs_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) } SelectOrUpdateRequest::SelectOrUpdateRequest(const SelectOrUpdateRequest& from) @@ -4568,7 +4176,7 @@ SelectOrUpdateRequest::SelectOrUpdateRequest(const SelectOrUpdateRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) } -void SelectOrUpdateRequest::SharedCtor() { +inline void SelectOrUpdateRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -4577,9 +4185,11 @@ ::memset(reinterpret_cast(this) + static_cast( SelectOrUpdateRequest::~SelectOrUpdateRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SelectOrUpdateRequest::SharedDtor() { @@ -4588,19 +4198,13 @@ inline void SelectOrUpdateRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void SelectOrUpdateRequest::ArenaDtor(void* object) { - SelectOrUpdateRequest* _this = reinterpret_cast< SelectOrUpdateRequest* >(object); - (void)_this; -} -void SelectOrUpdateRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SelectOrUpdateRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void SelectOrUpdateRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4616,15 +4220,15 @@ void SelectOrUpdateRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SelectOrUpdateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SelectOrUpdateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -4632,7 +4236,7 @@ const char* SelectOrUpdateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -4640,14 +4244,14 @@ const char* SelectOrUpdateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string column_specs = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_column_specs(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.column_specs")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.column_specs")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -4676,26 +4280,24 @@ const char* SelectOrUpdateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SelectOrUpdateRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SelectOrUpdateRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated string column_specs = 3; @@ -4709,7 +4311,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* SelectOrUpdateRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) @@ -4720,7 +4322,7 @@ size_t SelectOrUpdateRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4765,7 +4367,7 @@ void SelectOrUpdateRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SelectOrUpdateRequest::MergeFrom(const SelectOrUpdateRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; column_specs_.MergeFrom(from.column_specs_); @@ -4802,9 +4404,9 @@ void SelectOrUpdateRequest::InternalSwap(SelectOrUpdateRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SelectOrUpdateRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[11]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[9]); } // =================================================================== @@ -4834,9 +4436,6 @@ SelectDistinctRequest::SelectDistinctRequest(::PROTOBUF_NAMESPACE_ID::Arena* are : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), column_names_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) } SelectDistinctRequest::SelectDistinctRequest(const SelectDistinctRequest& from) @@ -4856,7 +4455,7 @@ SelectDistinctRequest::SelectDistinctRequest(const SelectDistinctRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) } -void SelectDistinctRequest::SharedCtor() { +inline void SelectDistinctRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -4865,9 +4464,11 @@ ::memset(reinterpret_cast(this) + static_cast( SelectDistinctRequest::~SelectDistinctRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SelectDistinctRequest::SharedDtor() { @@ -4876,19 +4477,13 @@ inline void SelectDistinctRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void SelectDistinctRequest::ArenaDtor(void* object) { - SelectDistinctRequest* _this = reinterpret_cast< SelectDistinctRequest* >(object); - (void)_this; -} -void SelectDistinctRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SelectDistinctRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void SelectDistinctRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -4904,15 +4499,15 @@ void SelectDistinctRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SelectDistinctRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SelectDistinctRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -4920,7 +4515,7 @@ const char* SelectDistinctRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -4928,14 +4523,14 @@ const char* SelectDistinctRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string column_names = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_column_names(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SelectDistinctRequest.column_names")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SelectDistinctRequest.column_names")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -4964,26 +4559,24 @@ const char* SelectDistinctRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SelectDistinctRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SelectDistinctRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated string column_names = 3; @@ -4997,7 +4590,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* SelectDistinctRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) @@ -5008,7 +4601,7 @@ size_t SelectDistinctRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5053,7 +4646,7 @@ void SelectDistinctRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SelectDistinctRequest::MergeFrom(const SelectDistinctRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; column_names_.MergeFrom(from.column_names_); @@ -5090,9 +4683,9 @@ void SelectDistinctRequest::InternalSwap(SelectDistinctRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SelectDistinctRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[12]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[10]); } // =================================================================== @@ -5122,9 +4715,6 @@ DropColumnsRequest::DropColumnsRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), column_names_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.DropColumnsRequest) } DropColumnsRequest::DropColumnsRequest(const DropColumnsRequest& from) @@ -5144,7 +4734,7 @@ DropColumnsRequest::DropColumnsRequest(const DropColumnsRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.DropColumnsRequest) } -void DropColumnsRequest::SharedCtor() { +inline void DropColumnsRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -5153,9 +4743,11 @@ ::memset(reinterpret_cast(this) + static_cast( DropColumnsRequest::~DropColumnsRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.DropColumnsRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void DropColumnsRequest::SharedDtor() { @@ -5164,19 +4756,13 @@ inline void DropColumnsRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void DropColumnsRequest::ArenaDtor(void* object) { - DropColumnsRequest* _this = reinterpret_cast< DropColumnsRequest* >(object); - (void)_this; -} -void DropColumnsRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void DropColumnsRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void DropColumnsRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.DropColumnsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5192,15 +4778,15 @@ void DropColumnsRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DropColumnsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* DropColumnsRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -5208,7 +4794,7 @@ const char* DropColumnsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -5216,14 +4802,14 @@ const char* DropColumnsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // repeated string column_names = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_column_names(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.DropColumnsRequest.column_names")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.DropColumnsRequest.column_names")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -5252,26 +4838,24 @@ const char* DropColumnsRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* DropColumnsRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* DropColumnsRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.DropColumnsRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated string column_names = 3; @@ -5285,7 +4869,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* DropColumnsRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.DropColumnsRequest) @@ -5296,7 +4880,7 @@ size_t DropColumnsRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.DropColumnsRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5341,7 +4925,7 @@ void DropColumnsRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void DropColumnsRequest::MergeFrom(const DropColumnsRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.DropColumnsRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; column_names_.MergeFrom(from.column_names_); @@ -5378,9 +4962,9 @@ void DropColumnsRequest::InternalSwap(DropColumnsRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata DropColumnsRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[13]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[11]); } // =================================================================== @@ -5410,9 +4994,6 @@ UnstructuredFilterTableRequest::UnstructuredFilterTableRequest(::PROTOBUF_NAMESP : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), filters_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) } UnstructuredFilterTableRequest::UnstructuredFilterTableRequest(const UnstructuredFilterTableRequest& from) @@ -5432,7 +5013,7 @@ UnstructuredFilterTableRequest::UnstructuredFilterTableRequest(const Unstructure // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) } -void UnstructuredFilterTableRequest::SharedCtor() { +inline void UnstructuredFilterTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -5441,9 +5022,11 @@ ::memset(reinterpret_cast(this) + static_cast( UnstructuredFilterTableRequest::~UnstructuredFilterTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void UnstructuredFilterTableRequest::SharedDtor() { @@ -5452,19 +5035,13 @@ inline void UnstructuredFilterTableRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void UnstructuredFilterTableRequest::ArenaDtor(void* object) { - UnstructuredFilterTableRequest* _this = reinterpret_cast< UnstructuredFilterTableRequest* >(object); - (void)_this; -} -void UnstructuredFilterTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void UnstructuredFilterTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void UnstructuredFilterTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5480,15 +5057,15 @@ void UnstructuredFilterTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* UnstructuredFilterTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* UnstructuredFilterTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -5496,7 +5073,7 @@ const char* UnstructuredFilterTableRequest::_InternalParse(const char* ptr, ::PR continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -5504,14 +5081,14 @@ const char* UnstructuredFilterTableRequest::_InternalParse(const char* ptr, ::PR continue; // repeated string filters = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_filters(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.filters")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.filters")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); } else @@ -5540,26 +5117,24 @@ const char* UnstructuredFilterTableRequest::_InternalParse(const char* ptr, ::PR #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* UnstructuredFilterTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* UnstructuredFilterTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated string filters = 3; @@ -5573,7 +5148,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* UnstructuredFilterTableRequest::_InternalSeriali } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) @@ -5584,7 +5159,7 @@ size_t UnstructuredFilterTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5629,7 +5204,7 @@ void UnstructuredFilterTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* void UnstructuredFilterTableRequest::MergeFrom(const UnstructuredFilterTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; filters_.MergeFrom(from.filters_); @@ -5666,9 +5241,9 @@ void UnstructuredFilterTableRequest::InternalSwap(UnstructuredFilterTableRequest } ::PROTOBUF_NAMESPACE_ID::Metadata UnstructuredFilterTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[14]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[12]); } // =================================================================== @@ -5697,9 +5272,6 @@ HeadOrTailRequest::HeadOrTailRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) } HeadOrTailRequest::HeadOrTailRequest(const HeadOrTailRequest& from) @@ -5719,7 +5291,7 @@ HeadOrTailRequest::HeadOrTailRequest(const HeadOrTailRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) } -void HeadOrTailRequest::SharedCtor() { +inline void HeadOrTailRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&num_rows_) - @@ -5728,9 +5300,11 @@ ::memset(reinterpret_cast(this) + static_cast( HeadOrTailRequest::~HeadOrTailRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void HeadOrTailRequest::SharedDtor() { @@ -5739,19 +5313,13 @@ inline void HeadOrTailRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void HeadOrTailRequest::ArenaDtor(void* object) { - HeadOrTailRequest* _this = reinterpret_cast< HeadOrTailRequest* >(object); - (void)_this; -} -void HeadOrTailRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void HeadOrTailRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void HeadOrTailRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5767,15 +5335,15 @@ void HeadOrTailRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* HeadOrTailRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* HeadOrTailRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -5783,7 +5351,7 @@ const char* HeadOrTailRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -5791,7 +5359,7 @@ const char* HeadOrTailRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // sint64 num_rows = 3 [jstype = JS_STRING]; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { num_rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -5820,36 +5388,34 @@ const char* HeadOrTailRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* HeadOrTailRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* HeadOrTailRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // sint64 num_rows = 3 [jstype = JS_STRING]; if (this->_internal_num_rows() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(3, this->_internal_num_rows(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(3, this->_internal_num_rows(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) @@ -5860,7 +5426,7 @@ size_t HeadOrTailRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -5880,7 +5446,7 @@ size_t HeadOrTailRequest::ByteSizeLong() const { // sint64 num_rows = 3 [jstype = JS_STRING]; if (this->_internal_num_rows() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_num_rows()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_num_rows()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -5902,7 +5468,7 @@ void HeadOrTailRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void HeadOrTailRequest::MergeFrom(const HeadOrTailRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -5940,9 +5506,9 @@ void HeadOrTailRequest::InternalSwap(HeadOrTailRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata HeadOrTailRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[15]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[13]); } // =================================================================== @@ -5972,9 +5538,6 @@ HeadOrTailByRequest::HeadOrTailByRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), group_by_column_specs_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) } HeadOrTailByRequest::HeadOrTailByRequest(const HeadOrTailByRequest& from) @@ -5995,7 +5558,7 @@ HeadOrTailByRequest::HeadOrTailByRequest(const HeadOrTailByRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) } -void HeadOrTailByRequest::SharedCtor() { +inline void HeadOrTailByRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&num_rows_) - @@ -6004,9 +5567,11 @@ ::memset(reinterpret_cast(this) + static_cast( HeadOrTailByRequest::~HeadOrTailByRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void HeadOrTailByRequest::SharedDtor() { @@ -6015,19 +5580,13 @@ inline void HeadOrTailByRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void HeadOrTailByRequest::ArenaDtor(void* object) { - HeadOrTailByRequest* _this = reinterpret_cast< HeadOrTailByRequest* >(object); - (void)_this; -} -void HeadOrTailByRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void HeadOrTailByRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void HeadOrTailByRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6044,15 +5603,15 @@ void HeadOrTailByRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -6060,7 +5619,7 @@ const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -6068,7 +5627,7 @@ const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // sint64 num_rows = 3 [jstype = JS_STRING]; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { num_rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr); CHK_(ptr); } else @@ -6076,14 +5635,14 @@ const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME continue; // repeated string group_by_column_specs = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_group_by_column_specs(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.group_by_column_specs")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.group_by_column_specs")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -6112,32 +5671,30 @@ const char* HeadOrTailByRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAME #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* HeadOrTailByRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* HeadOrTailByRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // sint64 num_rows = 3 [jstype = JS_STRING]; if (this->_internal_num_rows() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(3, this->_internal_num_rows(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(3, this->_internal_num_rows(), target); } // repeated string group_by_column_specs = 4; @@ -6151,7 +5708,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* HeadOrTailByRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) @@ -6162,7 +5719,7 @@ size_t HeadOrTailByRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6190,7 +5747,7 @@ size_t HeadOrTailByRequest::ByteSizeLong() const { // sint64 num_rows = 3 [jstype = JS_STRING]; if (this->_internal_num_rows() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_num_rows()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_num_rows()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -6212,7 +5769,7 @@ void HeadOrTailByRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void HeadOrTailByRequest::MergeFrom(const HeadOrTailByRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; group_by_column_specs_.MergeFrom(from.group_by_column_specs_); @@ -6252,9 +5809,9 @@ void HeadOrTailByRequest::InternalSwap(HeadOrTailByRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata HeadOrTailByRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[16]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[14]); } // =================================================================== @@ -6284,9 +5841,6 @@ UngroupRequest::UngroupRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), columns_to_ungroup_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.UngroupRequest) } UngroupRequest::UngroupRequest(const UngroupRequest& from) @@ -6307,7 +5861,7 @@ UngroupRequest::UngroupRequest(const UngroupRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.UngroupRequest) } -void UngroupRequest::SharedCtor() { +inline void UngroupRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&null_fill_) - @@ -6316,9 +5870,11 @@ ::memset(reinterpret_cast(this) + static_cast( UngroupRequest::~UngroupRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.UngroupRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void UngroupRequest::SharedDtor() { @@ -6327,19 +5883,13 @@ inline void UngroupRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void UngroupRequest::ArenaDtor(void* object) { - UngroupRequest* _this = reinterpret_cast< UngroupRequest* >(object); - (void)_this; -} -void UngroupRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void UngroupRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void UngroupRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.UngroupRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6356,15 +5906,15 @@ void UngroupRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* UngroupRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* UngroupRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -6372,7 +5922,7 @@ const char* UngroupRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -6380,7 +5930,7 @@ const char* UngroupRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // bool null_fill = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { null_fill_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -6388,14 +5938,14 @@ const char* UngroupRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // repeated string columns_to_ungroup = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_ungroup(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.UngroupRequest.columns_to_ungroup")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.UngroupRequest.columns_to_ungroup")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -6424,32 +5974,30 @@ const char* UngroupRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* UngroupRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* UngroupRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.UngroupRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // bool null_fill = 3; if (this->_internal_null_fill() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_null_fill(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_null_fill(), target); } // repeated string columns_to_ungroup = 4; @@ -6463,7 +6011,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* UngroupRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.UngroupRequest) @@ -6474,7 +6022,7 @@ size_t UngroupRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.UngroupRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6524,7 +6072,7 @@ void UngroupRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void UngroupRequest::MergeFrom(const UngroupRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.UngroupRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_ungroup_.MergeFrom(from.columns_to_ungroup_); @@ -6564,9 +6112,9 @@ void UngroupRequest::InternalSwap(UngroupRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata UngroupRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[17]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[15]); } // =================================================================== @@ -6591,18 +6139,18 @@ MergeTablesRequest::MergeTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), source_ids_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.MergeTablesRequest) } MergeTablesRequest::MergeTablesRequest(const MergeTablesRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message(), source_ids_(from.source_ids_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - key_column_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + key_column_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + key_column_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_key_column().empty()) { - key_column_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key_column(), + key_column_.Set(from._internal_key_column(), GetArenaForAllocation()); } if (from._internal_has_result_id()) { @@ -6613,37 +6161,36 @@ MergeTablesRequest::MergeTablesRequest(const MergeTablesRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.MergeTablesRequest) } -void MergeTablesRequest::SharedCtor() { -key_column_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void MergeTablesRequest::SharedCtor() { +key_column_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + key_column_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING result_id_ = nullptr; } MergeTablesRequest::~MergeTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.MergeTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void MergeTablesRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - key_column_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + key_column_.Destroy(); if (this != internal_default_instance()) delete result_id_; } -void MergeTablesRequest::ArenaDtor(void* object) { - MergeTablesRequest* _this = reinterpret_cast< MergeTablesRequest* >(object); - (void)_this; -} -void MergeTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void MergeTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void MergeTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.MergeTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6656,15 +6203,15 @@ void MergeTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* MergeTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* MergeTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -6672,7 +6219,7 @@ const char* MergeTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // repeated .io.deephaven.proto.backplane.grpc.TableReference source_ids = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -6685,11 +6232,11 @@ const char* MergeTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // string key_column = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_key_column(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column")); } else goto handle_unusual; continue; @@ -6716,26 +6263,25 @@ const char* MergeTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* MergeTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* MergeTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.MergeTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.TableReference source_ids = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_source_ids_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_source_ids_size()); i < n; i++) { + const auto& repfield = this->_internal_source_ids(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_source_ids(i), target, stream); + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } // string key_column = 3; @@ -6749,7 +6295,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* MergeTablesRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.MergeTablesRequest) @@ -6760,7 +6306,7 @@ size_t MergeTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.MergeTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6804,7 +6350,7 @@ void MergeTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void MergeTablesRequest::MergeFrom(const MergeTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.MergeTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; source_ids_.MergeFrom(from.source_ids_); @@ -6835,7 +6381,6 @@ void MergeTablesRequest::InternalSwap(MergeTablesRequest* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); source_ids_.InternalSwap(&other->source_ids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &key_column_, lhs_arena, &other->key_column_, rhs_arena ); @@ -6843,9 +6388,9 @@ void MergeTablesRequest::InternalSwap(MergeTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata MergeTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[18]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[16]); } // =================================================================== @@ -6880,9 +6425,6 @@ SnapshotTableRequest::SnapshotTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), stamp_columns_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) } SnapshotTableRequest::SnapshotTableRequest(const SnapshotTableRequest& from) @@ -6908,7 +6450,7 @@ SnapshotTableRequest::SnapshotTableRequest(const SnapshotTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) } -void SnapshotTableRequest::SharedCtor() { +inline void SnapshotTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&do_initial_snapshot_) - @@ -6917,9 +6459,11 @@ ::memset(reinterpret_cast(this) + static_cast( SnapshotTableRequest::~SnapshotTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SnapshotTableRequest::SharedDtor() { @@ -6929,19 +6473,13 @@ inline void SnapshotTableRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void SnapshotTableRequest::ArenaDtor(void* object) { - SnapshotTableRequest* _this = reinterpret_cast< SnapshotTableRequest* >(object); - (void)_this; -} -void SnapshotTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SnapshotTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void SnapshotTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -6962,15 +6500,15 @@ void SnapshotTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -6978,7 +6516,7 @@ const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -6986,7 +6524,7 @@ const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -6994,7 +6532,7 @@ const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // bool do_initial_snapshot = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { do_initial_snapshot_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -7002,14 +6540,14 @@ const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM continue; // repeated string stamp_columns = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_stamp_columns(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SnapshotTableRequest.stamp_columns")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SnapshotTableRequest.stamp_columns")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -7038,40 +6576,37 @@ const char* SnapshotTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAM #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SnapshotTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SnapshotTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // bool do_initial_snapshot = 4; if (this->_internal_do_initial_snapshot() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_do_initial_snapshot(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_do_initial_snapshot(), target); } // repeated string stamp_columns = 5; @@ -7085,7 +6620,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* SnapshotTableRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) @@ -7096,7 +6631,7 @@ size_t SnapshotTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7153,7 +6688,7 @@ void SnapshotTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SnapshotTableRequest::MergeFrom(const SnapshotTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; stamp_columns_.MergeFrom(from.stamp_columns_); @@ -7196,9 +6731,9 @@ void SnapshotTableRequest::InternalSwap(SnapshotTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SnapshotTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[19]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[17]); } // =================================================================== @@ -7234,9 +6769,6 @@ CrossJoinTablesRequest::CrossJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* a columns_to_match_(arena), columns_to_add_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) } CrossJoinTablesRequest::CrossJoinTablesRequest(const CrossJoinTablesRequest& from) @@ -7263,7 +6795,7 @@ CrossJoinTablesRequest::CrossJoinTablesRequest(const CrossJoinTablesRequest& fro // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) } -void CrossJoinTablesRequest::SharedCtor() { +inline void CrossJoinTablesRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&reserve_bits_) - @@ -7272,9 +6804,11 @@ ::memset(reinterpret_cast(this) + static_cast( CrossJoinTablesRequest::~CrossJoinTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CrossJoinTablesRequest::SharedDtor() { @@ -7284,19 +6818,13 @@ inline void CrossJoinTablesRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void CrossJoinTablesRequest::ArenaDtor(void* object) { - CrossJoinTablesRequest* _this = reinterpret_cast< CrossJoinTablesRequest* >(object); - (void)_this; -} -void CrossJoinTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CrossJoinTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void CrossJoinTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7318,15 +6846,15 @@ void CrossJoinTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -7334,7 +6862,7 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -7342,7 +6870,7 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -7350,14 +6878,14 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // repeated string columns_to_match = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_match(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_match")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_match")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -7365,14 +6893,14 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // repeated string columns_to_add = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_add(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_add")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.columns_to_add")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -7380,8 +6908,8 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // int32 reserve_bits = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - reserve_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + reserve_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -7409,34 +6937,31 @@ const char* CrossJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CrossJoinTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CrossJoinTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // repeated string columns_to_match = 4; @@ -7462,11 +6987,11 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CrossJoinTablesRequest::_InternalSerialize( // int32 reserve_bits = 6; if (this->_internal_reserve_bits() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_reserve_bits(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_reserve_bits(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) @@ -7477,7 +7002,7 @@ size_t CrossJoinTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7520,7 +7045,7 @@ size_t CrossJoinTablesRequest::ByteSizeLong() const { // int32 reserve_bits = 6; if (this->_internal_reserve_bits() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_reserve_bits()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_reserve_bits()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -7542,7 +7067,7 @@ void CrossJoinTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CrossJoinTablesRequest::MergeFrom(const CrossJoinTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_match_.MergeFrom(from.columns_to_match_); @@ -7587,9 +7112,9 @@ void CrossJoinTablesRequest::InternalSwap(CrossJoinTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CrossJoinTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[20]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[18]); } // =================================================================== @@ -7625,9 +7150,6 @@ NaturalJoinTablesRequest::NaturalJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Aren columns_to_match_(arena), columns_to_add_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) } NaturalJoinTablesRequest::NaturalJoinTablesRequest(const NaturalJoinTablesRequest& from) @@ -7653,7 +7175,7 @@ NaturalJoinTablesRequest::NaturalJoinTablesRequest(const NaturalJoinTablesReques // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) } -void NaturalJoinTablesRequest::SharedCtor() { +inline void NaturalJoinTablesRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&right_id_) - @@ -7662,9 +7184,11 @@ ::memset(reinterpret_cast(this) + static_cast( NaturalJoinTablesRequest::~NaturalJoinTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void NaturalJoinTablesRequest::SharedDtor() { @@ -7674,19 +7198,13 @@ inline void NaturalJoinTablesRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void NaturalJoinTablesRequest::ArenaDtor(void* object) { - NaturalJoinTablesRequest* _this = reinterpret_cast< NaturalJoinTablesRequest* >(object); - (void)_this; -} -void NaturalJoinTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void NaturalJoinTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void NaturalJoinTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7707,15 +7225,15 @@ void NaturalJoinTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -7723,7 +7241,7 @@ const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -7731,7 +7249,7 @@ const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -7739,14 +7257,14 @@ const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF continue; // repeated string columns_to_match = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_match(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_match")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_match")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -7754,14 +7272,14 @@ const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF continue; // repeated string columns_to_add = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_add(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_add")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.columns_to_add")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -7790,34 +7308,31 @@ const char* NaturalJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* NaturalJoinTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* NaturalJoinTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // repeated string columns_to_match = 4; @@ -7841,7 +7356,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* NaturalJoinTablesRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) @@ -7852,7 +7367,7 @@ size_t NaturalJoinTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -7912,7 +7427,7 @@ void NaturalJoinTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void NaturalJoinTablesRequest::MergeFrom(const NaturalJoinTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_match_.MergeFrom(from.columns_to_match_); @@ -7954,9 +7469,9 @@ void NaturalJoinTablesRequest::InternalSwap(NaturalJoinTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata NaturalJoinTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[21]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[19]); } // =================================================================== @@ -7992,9 +7507,6 @@ ExactJoinTablesRequest::ExactJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* a columns_to_match_(arena), columns_to_add_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) } ExactJoinTablesRequest::ExactJoinTablesRequest(const ExactJoinTablesRequest& from) @@ -8020,7 +7532,7 @@ ExactJoinTablesRequest::ExactJoinTablesRequest(const ExactJoinTablesRequest& fro // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) } -void ExactJoinTablesRequest::SharedCtor() { +inline void ExactJoinTablesRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&right_id_) - @@ -8029,9 +7541,11 @@ ::memset(reinterpret_cast(this) + static_cast( ExactJoinTablesRequest::~ExactJoinTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ExactJoinTablesRequest::SharedDtor() { @@ -8041,19 +7555,13 @@ inline void ExactJoinTablesRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void ExactJoinTablesRequest::ArenaDtor(void* object) { - ExactJoinTablesRequest* _this = reinterpret_cast< ExactJoinTablesRequest* >(object); - (void)_this; -} -void ExactJoinTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ExactJoinTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ExactJoinTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8074,15 +7582,15 @@ void ExactJoinTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -8090,7 +7598,7 @@ const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -8098,7 +7606,7 @@ const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -8106,14 +7614,14 @@ const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // repeated string columns_to_match = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_match(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_match")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_match")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -8121,14 +7629,14 @@ const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N continue; // repeated string columns_to_add = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_add(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_add")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.columns_to_add")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -8157,34 +7665,31 @@ const char* ExactJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_N #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ExactJoinTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ExactJoinTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // repeated string columns_to_match = 4; @@ -8208,7 +7713,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExactJoinTablesRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) @@ -8219,7 +7724,7 @@ size_t ExactJoinTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8279,7 +7784,7 @@ void ExactJoinTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ExactJoinTablesRequest::MergeFrom(const ExactJoinTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_match_.MergeFrom(from.columns_to_match_); @@ -8321,9 +7826,9 @@ void ExactJoinTablesRequest::InternalSwap(ExactJoinTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExactJoinTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[22]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[20]); } // =================================================================== @@ -8359,9 +7864,6 @@ LeftJoinTablesRequest::LeftJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* are columns_to_match_(arena), columns_to_add_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) } LeftJoinTablesRequest::LeftJoinTablesRequest(const LeftJoinTablesRequest& from) @@ -8387,7 +7889,7 @@ LeftJoinTablesRequest::LeftJoinTablesRequest(const LeftJoinTablesRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) } -void LeftJoinTablesRequest::SharedCtor() { +inline void LeftJoinTablesRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&right_id_) - @@ -8396,9 +7898,11 @@ ::memset(reinterpret_cast(this) + static_cast( LeftJoinTablesRequest::~LeftJoinTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void LeftJoinTablesRequest::SharedDtor() { @@ -8408,19 +7912,13 @@ inline void LeftJoinTablesRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void LeftJoinTablesRequest::ArenaDtor(void* object) { - LeftJoinTablesRequest* _this = reinterpret_cast< LeftJoinTablesRequest* >(object); - (void)_this; -} -void LeftJoinTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void LeftJoinTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void LeftJoinTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8441,15 +7939,15 @@ void LeftJoinTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -8457,7 +7955,7 @@ const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -8465,7 +7963,7 @@ const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -8473,14 +7971,14 @@ const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string columns_to_match = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_match(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_match")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_match")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -8488,14 +7986,14 @@ const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string columns_to_add = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_add(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_add")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.columns_to_add")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -8524,34 +8022,31 @@ const char* LeftJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* LeftJoinTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* LeftJoinTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // repeated string columns_to_match = 4; @@ -8575,7 +8070,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* LeftJoinTablesRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) @@ -8586,7 +8081,7 @@ size_t LeftJoinTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8646,7 +8141,7 @@ void LeftJoinTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void LeftJoinTablesRequest::MergeFrom(const LeftJoinTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_match_.MergeFrom(from.columns_to_match_); @@ -8688,9 +8183,9 @@ void LeftJoinTablesRequest::InternalSwap(LeftJoinTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata LeftJoinTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[23]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[21]); } // =================================================================== @@ -8726,9 +8221,6 @@ AsOfJoinTablesRequest::AsOfJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* are columns_to_match_(arena), columns_to_add_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) } AsOfJoinTablesRequest::AsOfJoinTablesRequest(const AsOfJoinTablesRequest& from) @@ -8755,7 +8247,7 @@ AsOfJoinTablesRequest::AsOfJoinTablesRequest(const AsOfJoinTablesRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) } -void AsOfJoinTablesRequest::SharedCtor() { +inline void AsOfJoinTablesRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&as_of_match_rule_) - @@ -8764,9 +8256,11 @@ ::memset(reinterpret_cast(this) + static_cast( AsOfJoinTablesRequest::~AsOfJoinTablesRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void AsOfJoinTablesRequest::SharedDtor() { @@ -8776,19 +8270,13 @@ inline void AsOfJoinTablesRequest::SharedDtor() { if (this != internal_default_instance()) delete right_id_; } -void AsOfJoinTablesRequest::ArenaDtor(void* object) { - AsOfJoinTablesRequest* _this = reinterpret_cast< AsOfJoinTablesRequest* >(object); - (void)_this; -} -void AsOfJoinTablesRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void AsOfJoinTablesRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void AsOfJoinTablesRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -8810,15 +8298,15 @@ void AsOfJoinTablesRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -8826,7 +8314,7 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_left_id(), ptr); CHK_(ptr); } else @@ -8834,7 +8322,7 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_right_id(), ptr); CHK_(ptr); } else @@ -8842,14 +8330,14 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string columns_to_match = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_match(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_match")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_match")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -8857,14 +8345,14 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string columns_to_add = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_columns_to_add(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_add")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.columns_to_add")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else @@ -8872,8 +8360,8 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule as_of_match_rule = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_as_of_match_rule(static_cast<::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest_MatchRule>(val)); } else @@ -8902,34 +8390,31 @@ const char* AsOfJoinTablesRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* AsOfJoinTablesRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* AsOfJoinTablesRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference left_id = 2; if (this->_internal_has_left_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::left_id(this), target, stream); + InternalWriteMessage(2, _Internal::left_id(this), + _Internal::left_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference right_id = 3; if (this->_internal_has_right_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::right_id(this), target, stream); + InternalWriteMessage(3, _Internal::right_id(this), + _Internal::right_id(this).GetCachedSize(), target, stream); } // repeated string columns_to_match = 4; @@ -8955,12 +8440,12 @@ ::PROTOBUF_NAMESPACE_ID::uint8* AsOfJoinTablesRequest::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule as_of_match_rule = 7; if (this->_internal_as_of_match_rule() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 7, this->_internal_as_of_match_rule(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) @@ -8971,7 +8456,7 @@ size_t AsOfJoinTablesRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9015,7 +8500,7 @@ size_t AsOfJoinTablesRequest::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule as_of_match_rule = 7; if (this->_internal_as_of_match_rule() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_as_of_match_rule()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_as_of_match_rule()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -9037,7 +8522,7 @@ void AsOfJoinTablesRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void AsOfJoinTablesRequest::MergeFrom(const AsOfJoinTablesRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; columns_to_match_.MergeFrom(from.columns_to_match_); @@ -9082,9 +8567,9 @@ void AsOfJoinTablesRequest::InternalSwap(AsOfJoinTablesRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata AsOfJoinTablesRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[24]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[22]); } // =================================================================== @@ -9098,18 +8583,18 @@ ComboAggregateRequest_Aggregate::ComboAggregateRequest_Aggregate(::PROTOBUF_NAME : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), match_pairs_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) } ComboAggregateRequest_Aggregate::ComboAggregateRequest_Aggregate(const ComboAggregateRequest_Aggregate& from) : ::PROTOBUF_NAMESPACE_ID::Message(), match_pairs_(from.match_pairs_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_name().empty()) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_name(), + column_name_.Set(from._internal_column_name(), GetArenaForAllocation()); } ::memcpy(&type_, &from.type_, @@ -9118,8 +8603,11 @@ ComboAggregateRequest_Aggregate::ComboAggregateRequest_Aggregate(const ComboAggr // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) } -void ComboAggregateRequest_Aggregate::SharedCtor() { -column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ComboAggregateRequest_Aggregate::SharedCtor() { +column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&type_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&percentile_) - @@ -9128,29 +8616,25 @@ ::memset(reinterpret_cast(this) + static_cast( ComboAggregateRequest_Aggregate::~ComboAggregateRequest_Aggregate() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ComboAggregateRequest_Aggregate::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.Destroy(); } -void ComboAggregateRequest_Aggregate::ArenaDtor(void* object) { - ComboAggregateRequest_Aggregate* _this = reinterpret_cast< ComboAggregateRequest_Aggregate* >(object); - (void)_this; -} -void ComboAggregateRequest_Aggregate::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ComboAggregateRequest_Aggregate::SetCachedSize(int size) const { _cached_size_.Set(size); } void ComboAggregateRequest_Aggregate::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9162,16 +8646,16 @@ void ComboAggregateRequest_Aggregate::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_type(static_cast<::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_AggType>(val)); } else @@ -9179,14 +8663,14 @@ const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::P continue; // repeated string match_pairs = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_match_pairs(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.match_pairs")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.match_pairs")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -9194,17 +8678,17 @@ const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::P continue; // string column_name = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name")); } else goto handle_unusual; continue; // double percentile = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 33)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 33)) { percentile_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); ptr += sizeof(double); } else @@ -9212,7 +8696,7 @@ const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::P continue; // bool avg_median = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { avg_median_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -9241,16 +8725,16 @@ const char* ComboAggregateRequest_Aggregate::_InternalParse(const char* ptr, ::P #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ComboAggregateRequest_Aggregate::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ComboAggregateRequest_Aggregate::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType type = 1; if (this->_internal_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_type(), target); } @@ -9275,19 +8759,23 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ComboAggregateRequest_Aggregate::_InternalSerial } // double percentile = 4; - if (!(this->_internal_percentile() <= 0 && this->_internal_percentile() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_percentile = this->_internal_percentile(); + uint64_t raw_percentile; + memcpy(&raw_percentile, &tmp_percentile, sizeof(tmp_percentile)); + if (raw_percentile != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(4, this->_internal_percentile(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(4, this->_internal_percentile(), target); } // bool avg_median = 5; if (this->_internal_avg_median() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_avg_median(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_avg_median(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) @@ -9298,7 +8786,7 @@ size_t ComboAggregateRequest_Aggregate::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9320,7 +8808,7 @@ size_t ComboAggregateRequest_Aggregate::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType type = 1; if (this->_internal_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } // bool avg_median = 5; @@ -9329,7 +8817,11 @@ size_t ComboAggregateRequest_Aggregate::ByteSizeLong() const { } // double percentile = 4; - if (!(this->_internal_percentile() <= 0 && this->_internal_percentile() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_percentile = this->_internal_percentile(); + uint64_t raw_percentile; + memcpy(&raw_percentile, &tmp_percentile, sizeof(tmp_percentile)); + if (raw_percentile != 0) { total_size += 1 + 8; } @@ -9352,7 +8844,7 @@ void ComboAggregateRequest_Aggregate::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message void ComboAggregateRequest_Aggregate::MergeFrom(const ComboAggregateRequest_Aggregate& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; match_pairs_.MergeFrom(from.match_pairs_); @@ -9365,7 +8857,11 @@ void ComboAggregateRequest_Aggregate::MergeFrom(const ComboAggregateRequest_Aggr if (from._internal_avg_median() != 0) { _internal_set_avg_median(from._internal_avg_median()); } - if (!(from._internal_percentile() <= 0 && from._internal_percentile() >= 0)) { + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_percentile = from._internal_percentile(); + uint64_t raw_percentile; + memcpy(&raw_percentile, &tmp_percentile, sizeof(tmp_percentile)); + if (raw_percentile != 0) { _internal_set_percentile(from._internal_percentile()); } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -9389,7 +8885,6 @@ void ComboAggregateRequest_Aggregate::InternalSwap(ComboAggregateRequest_Aggrega _internal_metadata_.InternalSwap(&other->_internal_metadata_); match_pairs_.InternalSwap(&other->match_pairs_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_name_, lhs_arena, &other->column_name_, rhs_arena ); @@ -9402,9 +8897,9 @@ void ComboAggregateRequest_Aggregate::InternalSwap(ComboAggregateRequest_Aggrega } ::PROTOBUF_NAMESPACE_ID::Metadata ComboAggregateRequest_Aggregate::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[25]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[23]); } // =================================================================== @@ -9435,9 +8930,6 @@ ComboAggregateRequest::ComboAggregateRequest(::PROTOBUF_NAMESPACE_ID::Arena* are aggregates_(arena), group_by_columns_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) } ComboAggregateRequest::ComboAggregateRequest(const ComboAggregateRequest& from) @@ -9459,7 +8951,7 @@ ComboAggregateRequest::ComboAggregateRequest(const ComboAggregateRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) } -void ComboAggregateRequest::SharedCtor() { +inline void ComboAggregateRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&force_combo_) - @@ -9468,9 +8960,11 @@ ::memset(reinterpret_cast(this) + static_cast( ComboAggregateRequest::~ComboAggregateRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ComboAggregateRequest::SharedDtor() { @@ -9479,19 +8973,13 @@ inline void ComboAggregateRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void ComboAggregateRequest::ArenaDtor(void* object) { - ComboAggregateRequest* _this = reinterpret_cast< ComboAggregateRequest* >(object); - (void)_this; -} -void ComboAggregateRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ComboAggregateRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void ComboAggregateRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9509,15 +8997,15 @@ void ComboAggregateRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -9525,7 +9013,7 @@ const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -9533,7 +9021,7 @@ const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated .io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate aggregates = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -9546,14 +9034,14 @@ const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // repeated string group_by_columns = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_group_by_columns(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.group_by_columns")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.group_by_columns")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -9561,7 +9049,7 @@ const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA continue; // bool force_combo = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { force_combo_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -9590,34 +9078,32 @@ const char* ComboAggregateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ComboAggregateRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ComboAggregateRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate aggregates = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_aggregates_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_aggregates_size()); i < n; i++) { + const auto& repfield = this->_internal_aggregates(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_aggregates(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } // repeated string group_by_columns = 4; @@ -9633,11 +9119,11 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ComboAggregateRequest::_InternalSerialize( // bool force_combo = 5; if (this->_internal_force_combo() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_force_combo(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_force_combo(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) @@ -9648,7 +9134,7 @@ size_t ComboAggregateRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9705,7 +9191,7 @@ void ComboAggregateRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ComboAggregateRequest::MergeFrom(const ComboAggregateRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; aggregates_.MergeFrom(from.aggregates_); @@ -9747,9 +9233,9 @@ void ComboAggregateRequest::InternalSwap(ComboAggregateRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ComboAggregateRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[26]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[24]); } // =================================================================== @@ -9762,17 +9248,17 @@ SortDescriptor::SortDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SortDescriptor) } SortDescriptor::SortDescriptor(const SortDescriptor& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_name().empty()) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_name(), + column_name_.Set(from._internal_column_name(), GetArenaForAllocation()); } ::memcpy(&is_absolute_, &from.is_absolute_, @@ -9781,8 +9267,11 @@ SortDescriptor::SortDescriptor(const SortDescriptor& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SortDescriptor) } -void SortDescriptor::SharedCtor() { -column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void SortDescriptor::SharedCtor() { +column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&is_absolute_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&direction_) - @@ -9791,29 +9280,25 @@ ::memset(reinterpret_cast(this) + static_cast( SortDescriptor::~SortDescriptor() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SortDescriptor) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SortDescriptor::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.Destroy(); } -void SortDescriptor::ArenaDtor(void* object) { - SortDescriptor* _this = reinterpret_cast< SortDescriptor* >(object); - (void)_this; -} -void SortDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SortDescriptor::SetCachedSize(int size) const { _cached_size_.Set(size); } void SortDescriptor::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SortDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9824,25 +9309,25 @@ void SortDescriptor::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SortDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SortDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string column_name = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SortDescriptor.column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SortDescriptor.column_name")); } else goto handle_unusual; continue; // bool is_absolute = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { is_absolute_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else @@ -9850,8 +9335,8 @@ const char* SortDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // .io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection direction = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_direction(static_cast<::io::deephaven::proto::backplane::grpc::SortDescriptor_SortDirection>(val)); } else @@ -9880,10 +9365,10 @@ const char* SortDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SortDescriptor::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SortDescriptor::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SortDescriptor) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string column_name = 1; @@ -9899,18 +9384,18 @@ ::PROTOBUF_NAMESPACE_ID::uint8* SortDescriptor::_InternalSerialize( // bool is_absolute = 2; if (this->_internal_is_absolute() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_is_absolute(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_is_absolute(), target); } // .io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection direction = 3; if (this->_internal_direction() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_direction(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SortDescriptor) @@ -9921,7 +9406,7 @@ size_t SortDescriptor::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SortDescriptor) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -9940,7 +9425,7 @@ size_t SortDescriptor::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection direction = 3; if (this->_internal_direction() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_direction()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_direction()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -9962,7 +9447,7 @@ void SortDescriptor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SortDescriptor::MergeFrom(const SortDescriptor& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SortDescriptor) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_column_name().empty()) { @@ -9994,7 +9479,6 @@ void SortDescriptor::InternalSwap(SortDescriptor* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_name_, lhs_arena, &other->column_name_, rhs_arena ); @@ -10007,9 +9491,9 @@ void SortDescriptor::InternalSwap(SortDescriptor* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SortDescriptor::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[27]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[25]); } // =================================================================== @@ -10039,9 +9523,6 @@ SortTableRequest::SortTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), sorts_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SortTableRequest) } SortTableRequest::SortTableRequest(const SortTableRequest& from) @@ -10061,7 +9542,7 @@ SortTableRequest::SortTableRequest(const SortTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SortTableRequest) } -void SortTableRequest::SharedCtor() { +inline void SortTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -10070,9 +9551,11 @@ ::memset(reinterpret_cast(this) + static_cast( SortTableRequest::~SortTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SortTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SortTableRequest::SharedDtor() { @@ -10081,19 +9564,13 @@ inline void SortTableRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void SortTableRequest::ArenaDtor(void* object) { - SortTableRequest* _this = reinterpret_cast< SortTableRequest* >(object); - (void)_this; -} -void SortTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SortTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void SortTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SortTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10109,15 +9586,15 @@ void SortTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SortTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SortTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -10125,7 +9602,7 @@ const char* SortTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -10133,7 +9610,7 @@ const char* SortTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // repeated .io.deephaven.proto.backplane.grpc.SortDescriptor sorts = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -10167,38 +9644,36 @@ const char* SortTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SortTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SortTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SortTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.SortDescriptor sorts = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_sorts_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_sorts_size()); i < n; i++) { + const auto& repfield = this->_internal_sorts(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_sorts(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SortTableRequest) @@ -10209,7 +9684,7 @@ size_t SortTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SortTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10253,7 +9728,7 @@ void SortTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SortTableRequest::MergeFrom(const SortTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SortTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; sorts_.MergeFrom(from.sorts_); @@ -10290,9 +9765,9 @@ void SortTableRequest::InternalSwap(SortTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SortTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[28]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[26]); } // =================================================================== @@ -10322,9 +9797,6 @@ FilterTableRequest::FilterTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), filters_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FilterTableRequest) } FilterTableRequest::FilterTableRequest(const FilterTableRequest& from) @@ -10344,7 +9816,7 @@ FilterTableRequest::FilterTableRequest(const FilterTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FilterTableRequest) } -void FilterTableRequest::SharedCtor() { +inline void FilterTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -10353,9 +9825,11 @@ ::memset(reinterpret_cast(this) + static_cast( FilterTableRequest::~FilterTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FilterTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FilterTableRequest::SharedDtor() { @@ -10364,19 +9838,13 @@ inline void FilterTableRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void FilterTableRequest::ArenaDtor(void* object) { - FilterTableRequest* _this = reinterpret_cast< FilterTableRequest* >(object); - (void)_this; -} -void FilterTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FilterTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void FilterTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FilterTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10392,15 +9860,15 @@ void FilterTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FilterTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FilterTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -10408,7 +9876,7 @@ const char* FilterTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -10416,7 +9884,7 @@ const char* FilterTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES continue; // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -10450,38 +9918,36 @@ const char* FilterTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMES #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FilterTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FilterTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FilterTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_filters_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_filters_size()); i < n; i++) { + const auto& repfield = this->_internal_filters(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_filters(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FilterTableRequest) @@ -10492,7 +9958,7 @@ size_t FilterTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FilterTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10536,7 +10002,7 @@ void FilterTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FilterTableRequest::MergeFrom(const FilterTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FilterTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; filters_.MergeFrom(from.filters_); @@ -10573,9 +10039,9 @@ void FilterTableRequest::InternalSwap(FilterTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FilterTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[29]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[27]); } // =================================================================== @@ -10588,51 +10054,50 @@ Reference::Reference(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.Reference) } Reference::Reference(const Reference& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_column_name().empty()) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_column_name(), + column_name_.Set(from._internal_column_name(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.Reference) } -void Reference::SharedCtor() { -column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void Reference::SharedCtor() { +column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } Reference::~Reference() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.Reference) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Reference::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + column_name_.Destroy(); } -void Reference::ArenaDtor(void* object) { - Reference* _this = reinterpret_cast< Reference* >(object); - (void)_this; -} -void Reference::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Reference::SetCachedSize(int size) const { _cached_size_.Set(size); } void Reference::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.Reference) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10640,19 +10105,19 @@ void Reference::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Reference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Reference::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string column_name = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.Reference.column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.Reference.column_name")); } else goto handle_unusual; continue; @@ -10679,10 +10144,10 @@ const char* Reference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Reference::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Reference::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.Reference) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string column_name = 1; @@ -10696,7 +10161,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Reference::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.Reference) @@ -10707,7 +10172,7 @@ size_t Reference::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.Reference) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10737,7 +10202,7 @@ void Reference::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Reference::MergeFrom(const Reference& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.Reference) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_column_name().empty()) { @@ -10763,16 +10228,15 @@ void Reference::InternalSwap(Reference* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &column_name_, lhs_arena, &other->column_name_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata Reference::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[30]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[28]); } // =================================================================== @@ -10785,9 +10249,6 @@ Literal::Literal(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.Literal) } Literal::Literal(const Literal& from) @@ -10822,15 +10283,17 @@ Literal::Literal(const Literal& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.Literal) } -void Literal::SharedCtor() { +inline void Literal::SharedCtor() { clear_has_value(); } Literal::~Literal() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.Literal) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Literal::SharedDtor() { @@ -10840,12 +10303,6 @@ inline void Literal::SharedDtor() { } } -void Literal::ArenaDtor(void* object) { - Literal* _this = reinterpret_cast< Literal* >(object); - (void)_this; -} -void Literal::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Literal::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -10854,7 +10311,7 @@ void Literal::clear_value() { // @@protoc_insertion_point(one_of_clear_start:io.deephaven.proto.backplane.grpc.Literal) switch (value_case()) { case kStringValue: { - value_.string_value_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + value_.string_value_.Destroy(); break; } case kDoubleValue: { @@ -10883,7 +10340,7 @@ void Literal::clear_value() { void Literal::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.Literal) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -10891,25 +10348,25 @@ void Literal::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Literal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Literal::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string string_value = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_string_value(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.Literal.string_value")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.Literal.string_value")); } else goto handle_unusual; continue; // double double_value = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 17)) { _internal_set_double_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); ptr += sizeof(double); } else @@ -10917,7 +10374,7 @@ const char* Literal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in continue; // bool bool_value = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { _internal_set_bool_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); CHK_(ptr); } else @@ -10925,7 +10382,7 @@ const char* Literal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in continue; // sint64 long_value = 4 [jstype = JS_STRING]; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { _internal_set_long_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr)); CHK_(ptr); } else @@ -10933,7 +10390,7 @@ const char* Literal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in continue; // sint64 nano_time_value = 5 [jstype = JS_STRING]; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { _internal_set_nano_time_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr)); CHK_(ptr); } else @@ -10962,10 +10419,10 @@ const char* Literal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Literal::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Literal::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.Literal) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string string_value = 1; @@ -10981,29 +10438,29 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Literal::_InternalSerialize( // double double_value = 2; if (_internal_has_double_value()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_double_value(), target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_double_value(), target); } // bool bool_value = 3; if (_internal_has_bool_value()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_bool_value(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_bool_value(), target); } // sint64 long_value = 4 [jstype = JS_STRING]; if (_internal_has_long_value()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(4, this->_internal_long_value(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(4, this->_internal_long_value(), target); } // sint64 nano_time_value = 5 [jstype = JS_STRING]; if (_internal_has_nano_time_value()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(5, this->_internal_nano_time_value(), target); + target = ::_pbi::WireFormatLite::WriteSInt64ToArray(5, this->_internal_nano_time_value(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.Literal) @@ -11014,7 +10471,7 @@ size_t Literal::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.Literal) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11038,12 +10495,12 @@ size_t Literal::ByteSizeLong() const { } // sint64 long_value = 4 [jstype = JS_STRING]; case kLongValue: { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_long_value()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_long_value()); break; } // sint64 nano_time_value = 5 [jstype = JS_STRING]; case kNanoTimeValue: { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64SizePlusOne(this->_internal_nano_time_value()); + total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_nano_time_value()); break; } case VALUE_NOT_SET: { @@ -11069,7 +10526,7 @@ void Literal::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Literal::MergeFrom(const Literal& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.Literal) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.value_case()) { @@ -11119,9 +10576,9 @@ void Literal::InternalSwap(Literal* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Literal::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[31]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[29]); } // =================================================================== @@ -11145,7 +10602,7 @@ void Value::set_allocated_reference(::io::deephaven::proto::backplane::grpc::Ref clear_data(); if (reference) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Reference>::GetOwningArena(reference); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reference); if (message_arena != submessage_arena) { reference = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, reference, submessage_arena); @@ -11160,7 +10617,7 @@ void Value::set_allocated_literal(::io::deephaven::proto::backplane::grpc::Liter clear_data(); if (literal) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Literal>::GetOwningArena(literal); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(literal); if (message_arena != submessage_arena) { literal = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, literal, submessage_arena); @@ -11174,9 +10631,6 @@ Value::Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.Value) } Value::Value(const Value& from) @@ -11199,15 +10653,17 @@ Value::Value(const Value& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.Value) } -void Value::SharedCtor() { +inline void Value::SharedCtor() { clear_has_data(); } Value::~Value() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.Value) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Value::SharedDtor() { @@ -11217,12 +10673,6 @@ inline void Value::SharedDtor() { } } -void Value::ArenaDtor(void* object) { - Value* _this = reinterpret_cast< Value* >(object); - (void)_this; -} -void Value::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Value::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -11252,7 +10702,7 @@ void Value::clear_data() { void Value::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.Value) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11260,15 +10710,15 @@ void Value::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Value::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Value::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Reference reference = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_reference(), ptr); CHK_(ptr); } else @@ -11276,7 +10726,7 @@ const char* Value::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inte continue; // .io.deephaven.proto.backplane.grpc.Literal literal = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_literal(), ptr); CHK_(ptr); } else @@ -11305,30 +10755,28 @@ const char* Value::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inte #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Value::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Value::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.Value) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Reference reference = 1; if (_internal_has_reference()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::reference(this), target, stream); + InternalWriteMessage(1, _Internal::reference(this), + _Internal::reference(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Literal literal = 2; if (_internal_has_literal()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::literal(this), target, stream); + InternalWriteMessage(2, _Internal::literal(this), + _Internal::literal(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.Value) @@ -11339,7 +10787,7 @@ size_t Value::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.Value) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11381,7 +10829,7 @@ void Value::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Value::MergeFrom(const Value& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.Value) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.data_case()) { @@ -11419,9 +10867,9 @@ void Value::InternalSwap(Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Value::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[32]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[30]); } // =================================================================== @@ -11485,7 +10933,7 @@ void Condition::set_allocated_and_(::io::deephaven::proto::backplane::grpc::AndC clear_data(); if (and_) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::AndCondition>::GetOwningArena(and_); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(and_); if (message_arena != submessage_arena) { and_ = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, and_, submessage_arena); @@ -11500,7 +10948,7 @@ void Condition::set_allocated_or_(::io::deephaven::proto::backplane::grpc::OrCon clear_data(); if (or_) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::OrCondition>::GetOwningArena(or_); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(or_); if (message_arena != submessage_arena) { or_ = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, or_, submessage_arena); @@ -11515,7 +10963,7 @@ void Condition::set_allocated_not_(::io::deephaven::proto::backplane::grpc::NotC clear_data(); if (not_) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::NotCondition>::GetOwningArena(not_); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(not_); if (message_arena != submessage_arena) { not_ = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, not_, submessage_arena); @@ -11530,7 +10978,7 @@ void Condition::set_allocated_compare(::io::deephaven::proto::backplane::grpc::C clear_data(); if (compare) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CompareCondition>::GetOwningArena(compare); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(compare); if (message_arena != submessage_arena) { compare = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, compare, submessage_arena); @@ -11545,7 +10993,7 @@ void Condition::set_allocated_in(::io::deephaven::proto::backplane::grpc::InCond clear_data(); if (in) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::InCondition>::GetOwningArena(in); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(in); if (message_arena != submessage_arena) { in = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, in, submessage_arena); @@ -11560,7 +11008,7 @@ void Condition::set_allocated_invoke(::io::deephaven::proto::backplane::grpc::In clear_data(); if (invoke) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::InvokeCondition>::GetOwningArena(invoke); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(invoke); if (message_arena != submessage_arena) { invoke = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, invoke, submessage_arena); @@ -11575,7 +11023,7 @@ void Condition::set_allocated_is_null(::io::deephaven::proto::backplane::grpc::I clear_data(); if (is_null) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::IsNullCondition>::GetOwningArena(is_null); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(is_null); if (message_arena != submessage_arena) { is_null = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, is_null, submessage_arena); @@ -11590,7 +11038,7 @@ void Condition::set_allocated_matches(::io::deephaven::proto::backplane::grpc::M clear_data(); if (matches) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::MatchesCondition>::GetOwningArena(matches); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(matches); if (message_arena != submessage_arena) { matches = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, matches, submessage_arena); @@ -11605,7 +11053,7 @@ void Condition::set_allocated_contains(::io::deephaven::proto::backplane::grpc:: clear_data(); if (contains) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::ContainsCondition>::GetOwningArena(contains); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(contains); if (message_arena != submessage_arena) { contains = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, contains, submessage_arena); @@ -11620,7 +11068,7 @@ void Condition::set_allocated_search(::io::deephaven::proto::backplane::grpc::Se clear_data(); if (search) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SearchCondition>::GetOwningArena(search); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(search); if (message_arena != submessage_arena) { search = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, search, submessage_arena); @@ -11634,9 +11082,6 @@ Condition::Condition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.Condition) } Condition::Condition(const Condition& from) @@ -11691,15 +11136,17 @@ Condition::Condition(const Condition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.Condition) } -void Condition::SharedCtor() { +inline void Condition::SharedCtor() { clear_has_data(); } Condition::~Condition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.Condition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Condition::SharedDtor() { @@ -11709,12 +11156,6 @@ inline void Condition::SharedDtor() { } } -void Condition::ArenaDtor(void* object) { - Condition* _this = reinterpret_cast< Condition* >(object); - (void)_this; -} -void Condition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Condition::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -11792,7 +11233,7 @@ void Condition::clear_data() { void Condition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.Condition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -11800,15 +11241,15 @@ void Condition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Condition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.AndCondition and = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_and_(), ptr); CHK_(ptr); } else @@ -11816,7 +11257,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.OrCondition or = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_or_(), ptr); CHK_(ptr); } else @@ -11824,7 +11265,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.NotCondition not = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_not_(), ptr); CHK_(ptr); } else @@ -11832,7 +11273,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.CompareCondition compare = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_compare(), ptr); CHK_(ptr); } else @@ -11840,7 +11281,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.InCondition in = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr = ctx->ParseMessage(_internal_mutable_in(), ptr); CHK_(ptr); } else @@ -11848,7 +11289,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.InvokeCondition invoke = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { ptr = ctx->ParseMessage(_internal_mutable_invoke(), ptr); CHK_(ptr); } else @@ -11856,7 +11297,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.IsNullCondition is_null = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { ptr = ctx->ParseMessage(_internal_mutable_is_null(), ptr); CHK_(ptr); } else @@ -11864,7 +11305,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.MatchesCondition matches = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { ptr = ctx->ParseMessage(_internal_mutable_matches(), ptr); CHK_(ptr); } else @@ -11872,7 +11313,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.ContainsCondition contains = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { ptr = ctx->ParseMessage(_internal_mutable_contains(), ptr); CHK_(ptr); } else @@ -11880,7 +11321,7 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: continue; // .io.deephaven.proto.backplane.grpc.SearchCondition search = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { ptr = ctx->ParseMessage(_internal_mutable_search(), ptr); CHK_(ptr); } else @@ -11909,94 +11350,84 @@ const char* Condition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Condition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Condition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.Condition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.AndCondition and = 1; if (_internal_has_and_()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::and_(this), target, stream); + InternalWriteMessage(1, _Internal::and_(this), + _Internal::and_(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.OrCondition or = 2; if (_internal_has_or_()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::or_(this), target, stream); + InternalWriteMessage(2, _Internal::or_(this), + _Internal::or_(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.NotCondition not = 3; if (_internal_has_not_()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::not_(this), target, stream); + InternalWriteMessage(3, _Internal::not_(this), + _Internal::not_(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.CompareCondition compare = 4; if (_internal_has_compare()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::compare(this), target, stream); + InternalWriteMessage(4, _Internal::compare(this), + _Internal::compare(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.InCondition in = 5; if (_internal_has_in()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 5, _Internal::in(this), target, stream); + InternalWriteMessage(5, _Internal::in(this), + _Internal::in(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.InvokeCondition invoke = 6; if (_internal_has_invoke()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 6, _Internal::invoke(this), target, stream); + InternalWriteMessage(6, _Internal::invoke(this), + _Internal::invoke(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.IsNullCondition is_null = 7; if (_internal_has_is_null()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 7, _Internal::is_null(this), target, stream); + InternalWriteMessage(7, _Internal::is_null(this), + _Internal::is_null(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.MatchesCondition matches = 8; if (_internal_has_matches()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 8, _Internal::matches(this), target, stream); + InternalWriteMessage(8, _Internal::matches(this), + _Internal::matches(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.ContainsCondition contains = 9; if (_internal_has_contains()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 9, _Internal::contains(this), target, stream); + InternalWriteMessage(9, _Internal::contains(this), + _Internal::contains(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SearchCondition search = 10; if (_internal_has_search()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 10, _Internal::search(this), target, stream); + InternalWriteMessage(10, _Internal::search(this), + _Internal::search(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.Condition) @@ -12007,7 +11438,7 @@ size_t Condition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.Condition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12105,7 +11536,7 @@ void Condition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Condition::MergeFrom(const Condition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.Condition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.data_case()) { @@ -12175,9 +11606,9 @@ void Condition::InternalSwap(Condition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Condition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[33]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[31]); } // =================================================================== @@ -12191,9 +11622,6 @@ AndCondition::AndCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), filters_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.AndCondition) } AndCondition::AndCondition(const AndCondition& from) @@ -12203,33 +11631,29 @@ AndCondition::AndCondition(const AndCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.AndCondition) } -void AndCondition::SharedCtor() { +inline void AndCondition::SharedCtor() { } AndCondition::~AndCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.AndCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void AndCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void AndCondition::ArenaDtor(void* object) { - AndCondition* _this = reinterpret_cast< AndCondition* >(object); - (void)_this; -} -void AndCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void AndCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void AndCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.AndCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12237,15 +11661,15 @@ void AndCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* AndCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* AndCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; @@ -12279,22 +11703,22 @@ const char* AndCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* AndCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* AndCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.AndCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_filters_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_filters_size()); i < n; i++) { + const auto& repfield = this->_internal_filters(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_filters(i), target, stream); + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.AndCondition) @@ -12305,7 +11729,7 @@ size_t AndCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.AndCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12335,7 +11759,7 @@ void AndCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void AndCondition::MergeFrom(const AndCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.AndCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; filters_.MergeFrom(from.filters_); @@ -12360,9 +11784,9 @@ void AndCondition::InternalSwap(AndCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata AndCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[34]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[32]); } // =================================================================== @@ -12376,9 +11800,6 @@ OrCondition::OrCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), filters_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.OrCondition) } OrCondition::OrCondition(const OrCondition& from) @@ -12388,33 +11809,29 @@ OrCondition::OrCondition(const OrCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.OrCondition) } -void OrCondition::SharedCtor() { +inline void OrCondition::SharedCtor() { } OrCondition::~OrCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.OrCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void OrCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void OrCondition::ArenaDtor(void* object) { - OrCondition* _this = reinterpret_cast< OrCondition* >(object); - (void)_this; -} -void OrCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void OrCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void OrCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.OrCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12422,15 +11839,15 @@ void OrCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* OrCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* OrCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; @@ -12464,22 +11881,22 @@ const char* OrCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* OrCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* OrCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.OrCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated .io.deephaven.proto.backplane.grpc.Condition filters = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_filters_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_filters_size()); i < n; i++) { + const auto& repfield = this->_internal_filters(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_filters(i), target, stream); + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.OrCondition) @@ -12490,7 +11907,7 @@ size_t OrCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.OrCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12520,7 +11937,7 @@ void OrCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void OrCondition::MergeFrom(const OrCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.OrCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; filters_.MergeFrom(from.filters_); @@ -12545,9 +11962,9 @@ void OrCondition::InternalSwap(OrCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata OrCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[35]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[33]); } // =================================================================== @@ -12565,9 +11982,6 @@ NotCondition::NotCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.NotCondition) } NotCondition::NotCondition(const NotCondition& from) @@ -12581,15 +11995,17 @@ NotCondition::NotCondition(const NotCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.NotCondition) } -void NotCondition::SharedCtor() { +inline void NotCondition::SharedCtor() { filter_ = nullptr; } NotCondition::~NotCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.NotCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void NotCondition::SharedDtor() { @@ -12597,19 +12013,13 @@ inline void NotCondition::SharedDtor() { if (this != internal_default_instance()) delete filter_; } -void NotCondition::ArenaDtor(void* object) { - NotCondition* _this = reinterpret_cast< NotCondition* >(object); - (void)_this; -} -void NotCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void NotCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void NotCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.NotCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12620,15 +12030,15 @@ void NotCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* NotCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* NotCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Condition filter = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_filter(), ptr); CHK_(ptr); } else @@ -12657,22 +12067,21 @@ const char* NotCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* NotCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* NotCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.NotCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Condition filter = 1; if (this->_internal_has_filter()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::filter(this), target, stream); + InternalWriteMessage(1, _Internal::filter(this), + _Internal::filter(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.NotCondition) @@ -12683,7 +12092,7 @@ size_t NotCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.NotCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12713,7 +12122,7 @@ void NotCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void NotCondition::MergeFrom(const NotCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.NotCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_filter()) { @@ -12740,9 +12149,9 @@ void NotCondition::InternalSwap(NotCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata NotCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[36]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[34]); } // =================================================================== @@ -12765,9 +12174,6 @@ CompareCondition::CompareCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.CompareCondition) } CompareCondition::CompareCondition(const CompareCondition& from) @@ -12789,7 +12195,7 @@ CompareCondition::CompareCondition(const CompareCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.CompareCondition) } -void CompareCondition::SharedCtor() { +inline void CompareCondition::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&lhs_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&case_sensitivity_) - @@ -12798,9 +12204,11 @@ ::memset(reinterpret_cast(this) + static_cast( CompareCondition::~CompareCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.CompareCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CompareCondition::SharedDtor() { @@ -12809,19 +12217,13 @@ inline void CompareCondition::SharedDtor() { if (this != internal_default_instance()) delete rhs_; } -void CompareCondition::ArenaDtor(void* object) { - CompareCondition* _this = reinterpret_cast< CompareCondition* >(object); - (void)_this; -} -void CompareCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CompareCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void CompareCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.CompareCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12839,16 +12241,16 @@ void CompareCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CompareCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CompareCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation operation = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_operation(static_cast<::io::deephaven::proto::backplane::grpc::CompareCondition_CompareOperation>(val)); } else @@ -12856,8 +12258,8 @@ const char* CompareCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_case_sensitivity(static_cast<::io::deephaven::proto::backplane::grpc::CaseSensitivity>(val)); } else @@ -12865,7 +12267,7 @@ const char* CompareCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // .io.deephaven.proto.backplane.grpc.Value lhs = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_lhs(), ptr); CHK_(ptr); } else @@ -12873,7 +12275,7 @@ const char* CompareCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // .io.deephaven.proto.backplane.grpc.Value rhs = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_rhs(), ptr); CHK_(ptr); } else @@ -12902,44 +12304,42 @@ const char* CompareCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CompareCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CompareCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.CompareCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation operation = 1; if (this->_internal_operation() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_operation(), target); } // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 2; if (this->_internal_case_sensitivity() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 2, this->_internal_case_sensitivity(), target); } // .io.deephaven.proto.backplane.grpc.Value lhs = 3; if (this->_internal_has_lhs()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::lhs(this), target, stream); + InternalWriteMessage(3, _Internal::lhs(this), + _Internal::lhs(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.Value rhs = 4; if (this->_internal_has_rhs()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::rhs(this), target, stream); + InternalWriteMessage(4, _Internal::rhs(this), + _Internal::rhs(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.CompareCondition) @@ -12950,7 +12350,7 @@ size_t CompareCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.CompareCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -12971,13 +12371,13 @@ size_t CompareCondition::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation operation = 1; if (this->_internal_operation() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_operation()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_operation()); } // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 2; if (this->_internal_case_sensitivity() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -12999,7 +12399,7 @@ void CompareCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CompareCondition::MergeFrom(const CompareCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.CompareCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_lhs()) { @@ -13040,9 +12440,9 @@ void CompareCondition::InternalSwap(CompareCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CompareCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[37]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[35]); } // =================================================================== @@ -13061,9 +12461,6 @@ InCondition::InCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), candidates_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.InCondition) } InCondition::InCondition(const InCondition& from) @@ -13081,7 +12478,7 @@ InCondition::InCondition(const InCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.InCondition) } -void InCondition::SharedCtor() { +inline void InCondition::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&target_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&match_type_) - @@ -13090,9 +12487,11 @@ ::memset(reinterpret_cast(this) + static_cast( InCondition::~InCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.InCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void InCondition::SharedDtor() { @@ -13100,19 +12499,13 @@ inline void InCondition::SharedDtor() { if (this != internal_default_instance()) delete target_; } -void InCondition::ArenaDtor(void* object) { - InCondition* _this = reinterpret_cast< InCondition* >(object); - (void)_this; -} -void InCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void InCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void InCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.InCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13127,15 +12520,15 @@ void InCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* InCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* InCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Value target = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_target(), ptr); CHK_(ptr); } else @@ -13143,7 +12536,7 @@ const char* InCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID continue; // repeated .io.deephaven.proto.backplane.grpc.Value candidates = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -13156,8 +12549,8 @@ const char* InCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID continue; // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_case_sensitivity(static_cast<::io::deephaven::proto::backplane::grpc::CaseSensitivity>(val)); } else @@ -13165,8 +12558,8 @@ const char* InCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID continue; // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_match_type(static_cast<::io::deephaven::proto::backplane::grpc::MatchType>(val)); } else @@ -13195,44 +12588,43 @@ const char* InCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* InCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* InCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.InCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Value target = 1; if (this->_internal_has_target()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::target(this), target, stream); + InternalWriteMessage(1, _Internal::target(this), + _Internal::target(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.Value candidates = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_candidates_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_candidates_size()); i < n; i++) { + const auto& repfield = this->_internal_candidates(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_candidates(i), target, stream); + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_case_sensitivity(), target); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 4, this->_internal_match_type(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.InCondition) @@ -13243,7 +12635,7 @@ size_t InCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.InCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13264,13 +12656,13 @@ size_t InCondition::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_match_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_match_type()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -13292,7 +12684,7 @@ void InCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void InCondition::MergeFrom(const InCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.InCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; candidates_.MergeFrom(from.candidates_); @@ -13332,9 +12724,9 @@ void InCondition::InternalSwap(InCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata InCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[38]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[36]); } // =================================================================== @@ -13353,18 +12745,18 @@ InvokeCondition::InvokeCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), arguments_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.InvokeCondition) } InvokeCondition::InvokeCondition(const InvokeCondition& from) : ::PROTOBUF_NAMESPACE_ID::Message(), arguments_(from.arguments_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - method_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + method_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + method_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_method().empty()) { - method_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_method(), + method_.Set(from._internal_method(), GetArenaForAllocation()); } if (from._internal_has_target()) { @@ -13375,37 +12767,36 @@ InvokeCondition::InvokeCondition(const InvokeCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.InvokeCondition) } -void InvokeCondition::SharedCtor() { -method_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void InvokeCondition::SharedCtor() { +method_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + method_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING target_ = nullptr; } InvokeCondition::~InvokeCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.InvokeCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void InvokeCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - method_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + method_.Destroy(); if (this != internal_default_instance()) delete target_; } -void InvokeCondition::ArenaDtor(void* object) { - InvokeCondition* _this = reinterpret_cast< InvokeCondition* >(object); - (void)_this; -} -void InvokeCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void InvokeCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void InvokeCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.InvokeCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13418,25 +12809,25 @@ void InvokeCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* InvokeCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* InvokeCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string method = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_method(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.InvokeCondition.method")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.InvokeCondition.method")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.Value target = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_target(), ptr); CHK_(ptr); } else @@ -13444,7 +12835,7 @@ const char* InvokeCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC continue; // repeated .io.deephaven.proto.backplane.grpc.Value arguments = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -13478,10 +12869,10 @@ const char* InvokeCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* InvokeCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* InvokeCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.InvokeCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string method = 1; @@ -13496,22 +12887,21 @@ ::PROTOBUF_NAMESPACE_ID::uint8* InvokeCondition::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.Value target = 2; if (this->_internal_has_target()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::target(this), target, stream); + InternalWriteMessage(2, _Internal::target(this), + _Internal::target(this).GetCachedSize(), target, stream); } // repeated .io.deephaven.proto.backplane.grpc.Value arguments = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_arguments_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_arguments_size()); i < n; i++) { + const auto& repfield = this->_internal_arguments(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_arguments(i), target, stream); + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.InvokeCondition) @@ -13522,7 +12912,7 @@ size_t InvokeCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.InvokeCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13566,7 +12956,7 @@ void InvokeCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void InvokeCondition::MergeFrom(const InvokeCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.InvokeCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; arguments_.MergeFrom(from.arguments_); @@ -13597,7 +12987,6 @@ void InvokeCondition::InternalSwap(InvokeCondition* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); arguments_.InternalSwap(&other->arguments_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &method_, lhs_arena, &other->method_, rhs_arena ); @@ -13605,9 +12994,9 @@ void InvokeCondition::InternalSwap(InvokeCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata InvokeCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[39]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[37]); } // =================================================================== @@ -13625,9 +13014,6 @@ IsNullCondition::IsNullCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.IsNullCondition) } IsNullCondition::IsNullCondition(const IsNullCondition& from) @@ -13641,15 +13027,17 @@ IsNullCondition::IsNullCondition(const IsNullCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.IsNullCondition) } -void IsNullCondition::SharedCtor() { +inline void IsNullCondition::SharedCtor() { reference_ = nullptr; } IsNullCondition::~IsNullCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.IsNullCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void IsNullCondition::SharedDtor() { @@ -13657,19 +13045,13 @@ inline void IsNullCondition::SharedDtor() { if (this != internal_default_instance()) delete reference_; } -void IsNullCondition::ArenaDtor(void* object) { - IsNullCondition* _this = reinterpret_cast< IsNullCondition* >(object); - (void)_this; -} -void IsNullCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void IsNullCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void IsNullCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.IsNullCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13680,15 +13062,15 @@ void IsNullCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* IsNullCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* IsNullCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Reference reference = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_reference(), ptr); CHK_(ptr); } else @@ -13717,22 +13099,21 @@ const char* IsNullCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* IsNullCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* IsNullCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.IsNullCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Reference reference = 1; if (this->_internal_has_reference()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::reference(this), target, stream); + InternalWriteMessage(1, _Internal::reference(this), + _Internal::reference(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.IsNullCondition) @@ -13743,7 +13124,7 @@ size_t IsNullCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.IsNullCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13773,7 +13154,7 @@ void IsNullCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void IsNullCondition::MergeFrom(const IsNullCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.IsNullCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_reference()) { @@ -13800,9 +13181,9 @@ void IsNullCondition::InternalSwap(IsNullCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata IsNullCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[40]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[38]); } // =================================================================== @@ -13820,17 +13201,17 @@ MatchesCondition::MatchesCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.MatchesCondition) } MatchesCondition::MatchesCondition(const MatchesCondition& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - regex_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + regex_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + regex_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_regex().empty()) { - regex_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_regex(), + regex_.Set(from._internal_regex(), GetArenaForAllocation()); } if (from._internal_has_reference()) { @@ -13844,8 +13225,11 @@ MatchesCondition::MatchesCondition(const MatchesCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.MatchesCondition) } -void MatchesCondition::SharedCtor() { -regex_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void MatchesCondition::SharedCtor() { +regex_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + regex_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&reference_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&match_type_) - @@ -13854,30 +13238,26 @@ ::memset(reinterpret_cast(this) + static_cast( MatchesCondition::~MatchesCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.MatchesCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void MatchesCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - regex_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + regex_.Destroy(); if (this != internal_default_instance()) delete reference_; } -void MatchesCondition::ArenaDtor(void* object) { - MatchesCondition* _this = reinterpret_cast< MatchesCondition* >(object); - (void)_this; -} -void MatchesCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void MatchesCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void MatchesCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.MatchesCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -13892,15 +13272,15 @@ void MatchesCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* MatchesCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* MatchesCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Reference reference = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_reference(), ptr); CHK_(ptr); } else @@ -13908,18 +13288,18 @@ const char* MatchesCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // string regex = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_regex(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.MatchesCondition.regex")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.MatchesCondition.regex")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_case_sensitivity(static_cast<::io::deephaven::proto::backplane::grpc::CaseSensitivity>(val)); } else @@ -13927,8 +13307,8 @@ const char* MatchesCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA continue; // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_match_type(static_cast<::io::deephaven::proto::backplane::grpc::MatchType>(val)); } else @@ -13957,18 +13337,17 @@ const char* MatchesCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* MatchesCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* MatchesCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.MatchesCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Reference reference = 1; if (this->_internal_has_reference()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::reference(this), target, stream); + InternalWriteMessage(1, _Internal::reference(this), + _Internal::reference(this).GetCachedSize(), target, stream); } // string regex = 2; @@ -13984,19 +13363,19 @@ ::PROTOBUF_NAMESPACE_ID::uint8* MatchesCondition::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_case_sensitivity(), target); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 4, this->_internal_match_type(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.MatchesCondition) @@ -14007,7 +13386,7 @@ size_t MatchesCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.MatchesCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14028,13 +13407,13 @@ size_t MatchesCondition::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_match_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_match_type()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -14056,7 +13435,7 @@ void MatchesCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void MatchesCondition::MergeFrom(const MatchesCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.MatchesCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_regex().empty()) { @@ -14091,7 +13470,6 @@ void MatchesCondition::InternalSwap(MatchesCondition* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ®ex_, lhs_arena, &other->regex_, rhs_arena ); @@ -14104,9 +13482,9 @@ void MatchesCondition::InternalSwap(MatchesCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata MatchesCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[41]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[39]); } // =================================================================== @@ -14124,17 +13502,17 @@ ContainsCondition::ContainsCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.ContainsCondition) } ContainsCondition::ContainsCondition(const ContainsCondition& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - search_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + search_string_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + search_string_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_search_string().empty()) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_search_string(), + search_string_.Set(from._internal_search_string(), GetArenaForAllocation()); } if (from._internal_has_reference()) { @@ -14148,8 +13526,11 @@ ContainsCondition::ContainsCondition(const ContainsCondition& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.ContainsCondition) } -void ContainsCondition::SharedCtor() { -search_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void ContainsCondition::SharedCtor() { +search_string_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + search_string_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&reference_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&match_type_) - @@ -14158,30 +13539,26 @@ ::memset(reinterpret_cast(this) + static_cast( ContainsCondition::~ContainsCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.ContainsCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void ContainsCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - search_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + search_string_.Destroy(); if (this != internal_default_instance()) delete reference_; } -void ContainsCondition::ArenaDtor(void* object) { - ContainsCondition* _this = reinterpret_cast< ContainsCondition* >(object); - (void)_this; -} -void ContainsCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void ContainsCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void ContainsCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.ContainsCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14196,15 +13573,15 @@ void ContainsCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ContainsCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* ContainsCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Reference reference = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_reference(), ptr); CHK_(ptr); } else @@ -14212,18 +13589,18 @@ const char* ContainsCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // string search_string = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_search_string(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ContainsCondition.search_string")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.ContainsCondition.search_string")); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_case_sensitivity(static_cast<::io::deephaven::proto::backplane::grpc::CaseSensitivity>(val)); } else @@ -14231,8 +13608,8 @@ const char* ContainsCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP continue; // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_match_type(static_cast<::io::deephaven::proto::backplane::grpc::MatchType>(val)); } else @@ -14261,18 +13638,17 @@ const char* ContainsCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* ContainsCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* ContainsCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.ContainsCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Reference reference = 1; if (this->_internal_has_reference()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::reference(this), target, stream); + InternalWriteMessage(1, _Internal::reference(this), + _Internal::reference(this).GetCachedSize(), target, stream); } // string search_string = 2; @@ -14288,19 +13664,19 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ContainsCondition::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_case_sensitivity(), target); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + target = ::_pbi::WireFormatLite::WriteEnumToArray( 4, this->_internal_match_type(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.ContainsCondition) @@ -14311,7 +13687,7 @@ size_t ContainsCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.ContainsCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14332,13 +13708,13 @@ size_t ContainsCondition::ByteSizeLong() const { // .io.deephaven.proto.backplane.grpc.CaseSensitivity case_sensitivity = 3; if (this->_internal_case_sensitivity() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_case_sensitivity()); } // .io.deephaven.proto.backplane.grpc.MatchType match_type = 4; if (this->_internal_match_type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_match_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_match_type()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -14360,7 +13736,7 @@ void ContainsCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void ContainsCondition::MergeFrom(const ContainsCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.ContainsCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_search_string().empty()) { @@ -14395,7 +13771,6 @@ void ContainsCondition::InternalSwap(ContainsCondition* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &search_string_, lhs_arena, &other->search_string_, rhs_arena ); @@ -14408,9 +13783,9 @@ void ContainsCondition::InternalSwap(ContainsCondition* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ContainsCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[42]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[40]); } // =================================================================== @@ -14424,52 +13799,51 @@ SearchCondition::SearchCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), optional_references_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.SearchCondition) } SearchCondition::SearchCondition(const SearchCondition& from) : ::PROTOBUF_NAMESPACE_ID::Message(), optional_references_(from.optional_references_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - search_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + search_string_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + search_string_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_search_string().empty()) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_search_string(), + search_string_.Set(from._internal_search_string(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.SearchCondition) } -void SearchCondition::SharedCtor() { -search_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void SearchCondition::SharedCtor() { +search_string_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + search_string_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } SearchCondition::~SearchCondition() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.SearchCondition) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void SearchCondition::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - search_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + search_string_.Destroy(); } -void SearchCondition::ArenaDtor(void* object) { - SearchCondition* _this = reinterpret_cast< SearchCondition* >(object); - (void)_this; -} -void SearchCondition::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void SearchCondition::SetCachedSize(int size) const { _cached_size_.Set(size); } void SearchCondition::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.SearchCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14478,25 +13852,25 @@ void SearchCondition::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SearchCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* SearchCondition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // string search_string = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_search_string(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SearchCondition.search_string")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.SearchCondition.search_string")); } else goto handle_unusual; continue; // repeated .io.deephaven.proto.backplane.grpc.Reference optional_references = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -14530,10 +13904,10 @@ const char* SearchCondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* SearchCondition::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* SearchCondition::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.SearchCondition) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // string search_string = 1; @@ -14547,15 +13921,15 @@ ::PROTOBUF_NAMESPACE_ID::uint8* SearchCondition::_InternalSerialize( } // repeated .io.deephaven.proto.backplane.grpc.Reference optional_references = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_optional_references_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_optional_references_size()); i < n; i++) { + const auto& repfield = this->_internal_optional_references(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_optional_references(i), target, stream); + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.SearchCondition) @@ -14566,7 +13940,7 @@ size_t SearchCondition::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.SearchCondition) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14603,7 +13977,7 @@ void SearchCondition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void SearchCondition::MergeFrom(const SearchCondition& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.SearchCondition) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; optional_references_.MergeFrom(from.optional_references_); @@ -14631,16 +14005,15 @@ void SearchCondition::InternalSwap(SearchCondition* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); optional_references_.InternalSwap(&other->optional_references_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &search_string_, lhs_arena, &other->search_string_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata SearchCondition::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[43]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[41]); } // =================================================================== @@ -14669,9 +14042,6 @@ FlattenRequest::FlattenRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.FlattenRequest) } FlattenRequest::FlattenRequest(const FlattenRequest& from) @@ -14690,7 +14060,7 @@ FlattenRequest::FlattenRequest(const FlattenRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.FlattenRequest) } -void FlattenRequest::SharedCtor() { +inline void FlattenRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&source_id_) - @@ -14699,9 +14069,11 @@ ::memset(reinterpret_cast(this) + static_cast( FlattenRequest::~FlattenRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.FlattenRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void FlattenRequest::SharedDtor() { @@ -14710,19 +14082,13 @@ inline void FlattenRequest::SharedDtor() { if (this != internal_default_instance()) delete source_id_; } -void FlattenRequest::ArenaDtor(void* object) { - FlattenRequest* _this = reinterpret_cast< FlattenRequest* >(object); - (void)_this; -} -void FlattenRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void FlattenRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void FlattenRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.FlattenRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14737,15 +14103,15 @@ void FlattenRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* FlattenRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* FlattenRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -14753,7 +14119,7 @@ const char* FlattenRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -14782,30 +14148,28 @@ const char* FlattenRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* FlattenRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* FlattenRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.FlattenRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.FlattenRequest) @@ -14816,7 +14180,7 @@ size_t FlattenRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.FlattenRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14853,7 +14217,7 @@ void FlattenRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void FlattenRequest::MergeFrom(const FlattenRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.FlattenRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -14888,9 +14252,9 @@ void FlattenRequest::InternalSwap(FlattenRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FlattenRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[44]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[42]); } // =================================================================== @@ -14910,9 +14274,6 @@ RunChartDownsampleRequest_ZoomRange::RunChartDownsampleRequest_ZoomRange(::PROTO bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) } RunChartDownsampleRequest_ZoomRange::RunChartDownsampleRequest_ZoomRange(const RunChartDownsampleRequest_ZoomRange& from) @@ -14925,7 +14286,7 @@ RunChartDownsampleRequest_ZoomRange::RunChartDownsampleRequest_ZoomRange(const R // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) } -void RunChartDownsampleRequest_ZoomRange::SharedCtor() { +inline void RunChartDownsampleRequest_ZoomRange::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&min_date_nanos_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&max_date_nanos_) - @@ -14934,28 +14295,24 @@ ::memset(reinterpret_cast(this) + static_cast( RunChartDownsampleRequest_ZoomRange::~RunChartDownsampleRequest_ZoomRange() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void RunChartDownsampleRequest_ZoomRange::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void RunChartDownsampleRequest_ZoomRange::ArenaDtor(void* object) { - RunChartDownsampleRequest_ZoomRange* _this = reinterpret_cast< RunChartDownsampleRequest_ZoomRange* >(object); - (void)_this; -} -void RunChartDownsampleRequest_ZoomRange::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void RunChartDownsampleRequest_ZoomRange::SetCachedSize(int size) const { _cached_size_.Set(size); } void RunChartDownsampleRequest_ZoomRange::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -14969,16 +14326,16 @@ void RunChartDownsampleRequest_ZoomRange::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* RunChartDownsampleRequest_ZoomRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* RunChartDownsampleRequest_ZoomRange::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // optional int64 min_date_nanos = 1 [jstype = JS_STRING]; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { _Internal::set_has_min_date_nanos(&has_bits); min_date_nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); @@ -14987,7 +14344,7 @@ const char* RunChartDownsampleRequest_ZoomRange::_InternalParse(const char* ptr, continue; // optional int64 max_date_nanos = 2 [jstype = JS_STRING]; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { _Internal::set_has_max_date_nanos(&has_bits); max_date_nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); @@ -15018,26 +14375,26 @@ const char* RunChartDownsampleRequest_ZoomRange::_InternalParse(const char* ptr, #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* RunChartDownsampleRequest_ZoomRange::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* RunChartDownsampleRequest_ZoomRange::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // optional int64 min_date_nanos = 1 [jstype = JS_STRING]; if (_internal_has_min_date_nanos()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_min_date_nanos(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_min_date_nanos(), target); } // optional int64 max_date_nanos = 2 [jstype = JS_STRING]; if (_internal_has_max_date_nanos()) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_max_date_nanos(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_max_date_nanos(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) @@ -15048,7 +14405,7 @@ size_t RunChartDownsampleRequest_ZoomRange::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15056,12 +14413,12 @@ size_t RunChartDownsampleRequest_ZoomRange::ByteSizeLong() const { if (cached_has_bits & 0x00000003u) { // optional int64 min_date_nanos = 1 [jstype = JS_STRING]; if (cached_has_bits & 0x00000001u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_min_date_nanos()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_min_date_nanos()); } // optional int64 max_date_nanos = 2 [jstype = JS_STRING]; if (cached_has_bits & 0x00000002u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_max_date_nanos()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_max_date_nanos()); } } @@ -15084,7 +14441,7 @@ void RunChartDownsampleRequest_ZoomRange::MergeImpl(::PROTOBUF_NAMESPACE_ID::Mes void RunChartDownsampleRequest_ZoomRange::MergeFrom(const RunChartDownsampleRequest_ZoomRange& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._has_bits_[0]; @@ -15124,9 +14481,9 @@ void RunChartDownsampleRequest_ZoomRange::InternalSwap(RunChartDownsampleRequest } ::PROTOBUF_NAMESPACE_ID::Metadata RunChartDownsampleRequest_ZoomRange::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[45]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[43]); } // =================================================================== @@ -15161,18 +14518,18 @@ RunChartDownsampleRequest::RunChartDownsampleRequest(::PROTOBUF_NAMESPACE_ID::Ar : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), y_column_names_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) } RunChartDownsampleRequest::RunChartDownsampleRequest(const RunChartDownsampleRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message(), y_column_names_(from.y_column_names_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - x_column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + x_column_name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + x_column_name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_x_column_name().empty()) { - x_column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_x_column_name(), + x_column_name_.Set(from._internal_x_column_name(), GetArenaForAllocation()); } if (from._internal_has_result_id()) { @@ -15194,8 +14551,11 @@ RunChartDownsampleRequest::RunChartDownsampleRequest(const RunChartDownsampleReq // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) } -void RunChartDownsampleRequest::SharedCtor() { -x_column_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void RunChartDownsampleRequest::SharedCtor() { +x_column_name_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + x_column_name_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&pixel_count_) - @@ -15204,32 +14564,28 @@ ::memset(reinterpret_cast(this) + static_cast( RunChartDownsampleRequest::~RunChartDownsampleRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void RunChartDownsampleRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - x_column_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + x_column_name_.Destroy(); if (this != internal_default_instance()) delete result_id_; if (this != internal_default_instance()) delete source_id_; if (this != internal_default_instance()) delete zoom_range_; } -void RunChartDownsampleRequest::ArenaDtor(void* object) { - RunChartDownsampleRequest* _this = reinterpret_cast< RunChartDownsampleRequest* >(object); - (void)_this; -} -void RunChartDownsampleRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void RunChartDownsampleRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void RunChartDownsampleRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15251,15 +14607,15 @@ void RunChartDownsampleRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -15267,7 +14623,7 @@ const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_id(), ptr); CHK_(ptr); } else @@ -15275,15 +14631,15 @@ const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // int32 pixel_count = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - pixel_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + pixel_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange zoom_range = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_zoom_range(), ptr); CHK_(ptr); } else @@ -15291,24 +14647,24 @@ const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::PROTOBU continue; // string x_column_name = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { auto str = _internal_mutable_x_column_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name")); } else goto handle_unusual; continue; // repeated string y_column_names = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_y_column_names(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.y_column_names")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.y_column_names")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); } else @@ -15337,40 +14693,37 @@ const char* RunChartDownsampleRequest::_InternalParse(const char* ptr, ::PROTOBU #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* RunChartDownsampleRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* RunChartDownsampleRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_id = 2; if (this->_internal_has_source_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_id(this), + _Internal::source_id(this).GetCachedSize(), target, stream); } // int32 pixel_count = 3; if (this->_internal_pixel_count() != 0) { target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_pixel_count(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_pixel_count(), target); } // .io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange zoom_range = 4; if (this->_internal_has_zoom_range()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::zoom_range(this), target, stream); + InternalWriteMessage(4, _Internal::zoom_range(this), + _Internal::zoom_range(this).GetCachedSize(), target, stream); } // string x_column_name = 5; @@ -15394,7 +14747,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* RunChartDownsampleRequest::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) @@ -15405,7 +14758,7 @@ size_t RunChartDownsampleRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15447,7 +14800,7 @@ size_t RunChartDownsampleRequest::ByteSizeLong() const { // int32 pixel_count = 3; if (this->_internal_pixel_count() != 0) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_pixel_count()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pixel_count()); } return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); @@ -15469,7 +14822,7 @@ void RunChartDownsampleRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void RunChartDownsampleRequest::MergeFrom(const RunChartDownsampleRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; y_column_names_.MergeFrom(from.y_column_names_); @@ -15509,7 +14862,6 @@ void RunChartDownsampleRequest::InternalSwap(RunChartDownsampleRequest* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); y_column_names_.InternalSwap(&other->y_column_names_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &x_column_name_, lhs_arena, &other->x_column_name_, rhs_arena ); @@ -15522,9 +14874,9 @@ void RunChartDownsampleRequest::InternalSwap(RunChartDownsampleRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata RunChartDownsampleRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[46]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[44]); } // =================================================================== @@ -15561,9 +14913,9 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CreateInputTableRequest_InputT ::PROTOBUF_NAMESPACE_ID::Metadata CreateInputTableRequest_InputTableKind_InMemoryAppendOnly::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[47]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[45]); } // =================================================================== @@ -15577,9 +14929,6 @@ CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::CreateInputTableReques : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), key_columns_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) } CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(const CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& from) @@ -15589,33 +14938,29 @@ CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::CreateInputTableReques // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) } -void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::SharedCtor() { +inline void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::SharedCtor() { } CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::~CreateInputTableRequest_InputTableKind_InMemoryKeyBacked() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::ArenaDtor(void* object) { - CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* _this = reinterpret_cast< CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* >(object); - (void)_this; -} -void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::SetCachedSize(int size) const { _cached_size_.Set(size); } void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15623,22 +14968,22 @@ void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated string key_columns = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_key_columns(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked.key_columns")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked.key_columns")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else @@ -15667,10 +15012,10 @@ const char* CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::_InternalP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated string key_columns = 1; @@ -15684,7 +15029,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CreateInputTableRequest_InputTableKind_InMemoryK } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) @@ -15695,7 +15040,7 @@ size_t CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::ByteSizeLong() // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15726,7 +15071,7 @@ void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::MergeImpl(::PROTO void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::MergeFrom(const CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; key_columns_.MergeFrom(from.key_columns_); @@ -15751,9 +15096,9 @@ void CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::InternalSwap(Crea } ::PROTOBUF_NAMESPACE_ID::Metadata CreateInputTableRequest_InputTableKind_InMemoryKeyBacked::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[48]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[46]); } // =================================================================== @@ -15777,7 +15122,7 @@ void CreateInputTableRequest_InputTableKind::set_allocated_in_memory_append_only clear_kind(); if (in_memory_append_only) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly>::GetOwningArena(in_memory_append_only); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(in_memory_append_only); if (message_arena != submessage_arena) { in_memory_append_only = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, in_memory_append_only, submessage_arena); @@ -15792,7 +15137,7 @@ void CreateInputTableRequest_InputTableKind::set_allocated_in_memory_key_backed( clear_kind(); if (in_memory_key_backed) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked>::GetOwningArena(in_memory_key_backed); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(in_memory_key_backed); if (message_arena != submessage_arena) { in_memory_key_backed = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, in_memory_key_backed, submessage_arena); @@ -15806,9 +15151,6 @@ CreateInputTableRequest_InputTableKind::CreateInputTableRequest_InputTableKind(: bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) } CreateInputTableRequest_InputTableKind::CreateInputTableRequest_InputTableKind(const CreateInputTableRequest_InputTableKind& from) @@ -15831,15 +15173,17 @@ CreateInputTableRequest_InputTableKind::CreateInputTableRequest_InputTableKind(c // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) } -void CreateInputTableRequest_InputTableKind::SharedCtor() { +inline void CreateInputTableRequest_InputTableKind::SharedCtor() { clear_has_kind(); } CreateInputTableRequest_InputTableKind::~CreateInputTableRequest_InputTableKind() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CreateInputTableRequest_InputTableKind::SharedDtor() { @@ -15849,12 +15193,6 @@ inline void CreateInputTableRequest_InputTableKind::SharedDtor() { } } -void CreateInputTableRequest_InputTableKind::ArenaDtor(void* object) { - CreateInputTableRequest_InputTableKind* _this = reinterpret_cast< CreateInputTableRequest_InputTableKind* >(object); - (void)_this; -} -void CreateInputTableRequest_InputTableKind::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CreateInputTableRequest_InputTableKind::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -15884,7 +15222,7 @@ void CreateInputTableRequest_InputTableKind::clear_kind() { void CreateInputTableRequest_InputTableKind::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -15892,15 +15230,15 @@ void CreateInputTableRequest_InputTableKind::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CreateInputTableRequest_InputTableKind::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CreateInputTableRequest_InputTableKind::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly in_memory_append_only = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_in_memory_append_only(), ptr); CHK_(ptr); } else @@ -15908,7 +15246,7 @@ const char* CreateInputTableRequest_InputTableKind::_InternalParse(const char* p continue; // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked in_memory_key_backed = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_in_memory_key_backed(), ptr); CHK_(ptr); } else @@ -15937,30 +15275,28 @@ const char* CreateInputTableRequest_InputTableKind::_InternalParse(const char* p #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CreateInputTableRequest_InputTableKind::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CreateInputTableRequest_InputTableKind::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly in_memory_append_only = 1; if (_internal_has_in_memory_append_only()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::in_memory_append_only(this), target, stream); + InternalWriteMessage(1, _Internal::in_memory_append_only(this), + _Internal::in_memory_append_only(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked in_memory_key_backed = 2; if (_internal_has_in_memory_key_backed()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::in_memory_key_backed(this), target, stream); + InternalWriteMessage(2, _Internal::in_memory_key_backed(this), + _Internal::in_memory_key_backed(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) @@ -15971,7 +15307,7 @@ size_t CreateInputTableRequest_InputTableKind::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -16013,7 +15349,7 @@ void CreateInputTableRequest_InputTableKind::MergeImpl(::PROTOBUF_NAMESPACE_ID:: void CreateInputTableRequest_InputTableKind::MergeFrom(const CreateInputTableRequest_InputTableKind& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.kind_case()) { @@ -16051,9 +15387,9 @@ void CreateInputTableRequest_InputTableKind::InternalSwap(CreateInputTableReques } ::PROTOBUF_NAMESPACE_ID::Metadata CreateInputTableRequest_InputTableKind::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[49]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[47]); } // =================================================================== @@ -16088,7 +15424,7 @@ void CreateInputTableRequest::set_allocated_source_table_id(::io::deephaven::pro clear_definition(); if (source_table_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_table_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_table_id); if (message_arena != submessage_arena) { source_table_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_table_id, submessage_arena); @@ -16102,9 +15438,6 @@ CreateInputTableRequest::CreateInputTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) } CreateInputTableRequest::CreateInputTableRequest(const CreateInputTableRequest& from) @@ -16137,7 +15470,7 @@ CreateInputTableRequest::CreateInputTableRequest(const CreateInputTableRequest& // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) } -void CreateInputTableRequest::SharedCtor() { +inline void CreateInputTableRequest::SharedCtor() { ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&result_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&kind_) - @@ -16147,9 +15480,11 @@ clear_has_definition(); CreateInputTableRequest::~CreateInputTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void CreateInputTableRequest::SharedDtor() { @@ -16161,12 +15496,6 @@ inline void CreateInputTableRequest::SharedDtor() { } } -void CreateInputTableRequest::ArenaDtor(void* object) { - CreateInputTableRequest* _this = reinterpret_cast< CreateInputTableRequest* >(object); - (void)_this; -} -void CreateInputTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void CreateInputTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -16181,7 +15510,7 @@ void CreateInputTableRequest::clear_definition() { break; } case kSchema: { - definition_.schema_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + definition_.schema_.Destroy(); break; } case DEFINITION_NOT_SET: { @@ -16194,7 +15523,7 @@ void CreateInputTableRequest::clear_definition() { void CreateInputTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -16210,15 +15539,15 @@ void CreateInputTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CreateInputTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* CreateInputTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_result_id(), ptr); CHK_(ptr); } else @@ -16226,7 +15555,7 @@ const char* CreateInputTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_ continue; // .io.deephaven.proto.backplane.grpc.TableReference source_table_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_source_table_id(), ptr); CHK_(ptr); } else @@ -16234,16 +15563,16 @@ const char* CreateInputTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_ continue; // bytes schema = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_schema(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind kind = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_kind(), ptr); CHK_(ptr); } else @@ -16272,26 +15601,24 @@ const char* CreateInputTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* CreateInputTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* CreateInputTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket result_id = 1; if (this->_internal_has_result_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::result_id(this), target, stream); + InternalWriteMessage(1, _Internal::result_id(this), + _Internal::result_id(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TableReference source_table_id = 2; if (_internal_has_source_table_id()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::source_table_id(this), target, stream); + InternalWriteMessage(2, _Internal::source_table_id(this), + _Internal::source_table_id(this).GetCachedSize(), target, stream); } // bytes schema = 3; @@ -16302,14 +15629,13 @@ ::PROTOBUF_NAMESPACE_ID::uint8* CreateInputTableRequest::_InternalSerialize( // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind kind = 4; if (this->_internal_has_kind()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::kind(this), target, stream); + InternalWriteMessage(4, _Internal::kind(this), + _Internal::kind(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) @@ -16320,7 +15646,7 @@ size_t CreateInputTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -16376,7 +15702,7 @@ void CreateInputTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void CreateInputTableRequest::MergeFrom(const CreateInputTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (from._internal_has_result_id()) { @@ -16426,9 +15752,9 @@ void CreateInputTableRequest::InternalSwap(CreateInputTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CreateInputTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[50]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[48]); } // =================================================================== @@ -16597,7 +15923,7 @@ void BatchTableRequest_Operation::set_allocated_empty_table(::io::deephaven::pro clear_op(); if (empty_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::EmptyTableRequest>::GetOwningArena(empty_table); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(empty_table); if (message_arena != submessage_arena) { empty_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, empty_table, submessage_arena); @@ -16612,7 +15938,7 @@ void BatchTableRequest_Operation::set_allocated_time_table(::io::deephaven::prot clear_op(); if (time_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TimeTableRequest>::GetOwningArena(time_table); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(time_table); if (message_arena != submessage_arena) { time_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, time_table, submessage_arena); @@ -16627,7 +15953,7 @@ void BatchTableRequest_Operation::set_allocated_drop_columns(::io::deephaven::pr clear_op(); if (drop_columns) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::DropColumnsRequest>::GetOwningArena(drop_columns); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(drop_columns); if (message_arena != submessage_arena) { drop_columns = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, drop_columns, submessage_arena); @@ -16642,7 +15968,7 @@ void BatchTableRequest_Operation::set_allocated_update(::io::deephaven::proto::b clear_op(); if (update) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest>::GetOwningArena(update); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(update); if (message_arena != submessage_arena) { update = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, update, submessage_arena); @@ -16657,7 +15983,7 @@ void BatchTableRequest_Operation::set_allocated_lazy_update(::io::deephaven::pro clear_op(); if (lazy_update) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest>::GetOwningArena(lazy_update); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(lazy_update); if (message_arena != submessage_arena) { lazy_update = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, lazy_update, submessage_arena); @@ -16672,7 +15998,7 @@ void BatchTableRequest_Operation::set_allocated_view(::io::deephaven::proto::bac clear_op(); if (view) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest>::GetOwningArena(view); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(view); if (message_arena != submessage_arena) { view = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, view, submessage_arena); @@ -16687,7 +16013,7 @@ void BatchTableRequest_Operation::set_allocated_update_view(::io::deephaven::pro clear_op(); if (update_view) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest>::GetOwningArena(update_view); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(update_view); if (message_arena != submessage_arena) { update_view = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, update_view, submessage_arena); @@ -16702,7 +16028,7 @@ void BatchTableRequest_Operation::set_allocated_select(::io::deephaven::proto::b clear_op(); if (select) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest>::GetOwningArena(select); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(select); if (message_arena != submessage_arena) { select = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, select, submessage_arena); @@ -16717,7 +16043,7 @@ void BatchTableRequest_Operation::set_allocated_select_distinct(::io::deephaven: clear_op(); if (select_distinct) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SelectDistinctRequest>::GetOwningArena(select_distinct); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(select_distinct); if (message_arena != submessage_arena) { select_distinct = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, select_distinct, submessage_arena); @@ -16732,7 +16058,7 @@ void BatchTableRequest_Operation::set_allocated_filter(::io::deephaven::proto::b clear_op(); if (filter) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::FilterTableRequest>::GetOwningArena(filter); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(filter); if (message_arena != submessage_arena) { filter = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, filter, submessage_arena); @@ -16747,7 +16073,7 @@ void BatchTableRequest_Operation::set_allocated_unstructured_filter(::io::deepha clear_op(); if (unstructured_filter) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest>::GetOwningArena(unstructured_filter); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(unstructured_filter); if (message_arena != submessage_arena) { unstructured_filter = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, unstructured_filter, submessage_arena); @@ -16762,7 +16088,7 @@ void BatchTableRequest_Operation::set_allocated_sort(::io::deephaven::proto::bac clear_op(); if (sort) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SortTableRequest>::GetOwningArena(sort); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(sort); if (message_arena != submessage_arena) { sort = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, sort, submessage_arena); @@ -16777,7 +16103,7 @@ void BatchTableRequest_Operation::set_allocated_head(::io::deephaven::proto::bac clear_op(); if (head) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::HeadOrTailRequest>::GetOwningArena(head); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(head); if (message_arena != submessage_arena) { head = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, head, submessage_arena); @@ -16792,7 +16118,7 @@ void BatchTableRequest_Operation::set_allocated_tail(::io::deephaven::proto::bac clear_op(); if (tail) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::HeadOrTailRequest>::GetOwningArena(tail); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(tail); if (message_arena != submessage_arena) { tail = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, tail, submessage_arena); @@ -16807,7 +16133,7 @@ void BatchTableRequest_Operation::set_allocated_head_by(::io::deephaven::proto:: clear_op(); if (head_by) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest>::GetOwningArena(head_by); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(head_by); if (message_arena != submessage_arena) { head_by = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, head_by, submessage_arena); @@ -16822,7 +16148,7 @@ void BatchTableRequest_Operation::set_allocated_tail_by(::io::deephaven::proto:: clear_op(); if (tail_by) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest>::GetOwningArena(tail_by); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(tail_by); if (message_arena != submessage_arena) { tail_by = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, tail_by, submessage_arena); @@ -16837,7 +16163,7 @@ void BatchTableRequest_Operation::set_allocated_ungroup(::io::deephaven::proto:: clear_op(); if (ungroup) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::UngroupRequest>::GetOwningArena(ungroup); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(ungroup); if (message_arena != submessage_arena) { ungroup = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, ungroup, submessage_arena); @@ -16852,7 +16178,7 @@ void BatchTableRequest_Operation::set_allocated_merge(::io::deephaven::proto::ba clear_op(); if (merge) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::MergeTablesRequest>::GetOwningArena(merge); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(merge); if (message_arena != submessage_arena) { merge = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, merge, submessage_arena); @@ -16867,7 +16193,7 @@ void BatchTableRequest_Operation::set_allocated_combo_aggregate(::io::deephaven: clear_op(); if (combo_aggregate) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::ComboAggregateRequest>::GetOwningArena(combo_aggregate); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(combo_aggregate); if (message_arena != submessage_arena) { combo_aggregate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, combo_aggregate, submessage_arena); @@ -16882,7 +16208,7 @@ void BatchTableRequest_Operation::set_allocated_snapshot(::io::deephaven::proto: clear_op(); if (snapshot) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::SnapshotTableRequest>::GetOwningArena(snapshot); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(snapshot); if (message_arena != submessage_arena) { snapshot = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, snapshot, submessage_arena); @@ -16897,7 +16223,7 @@ void BatchTableRequest_Operation::set_allocated_flatten(::io::deephaven::proto:: clear_op(); if (flatten) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::FlattenRequest>::GetOwningArena(flatten); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(flatten); if (message_arena != submessage_arena) { flatten = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, flatten, submessage_arena); @@ -16912,7 +16238,7 @@ void BatchTableRequest_Operation::set_allocated_run_chart_downsample(::io::deeph clear_op(); if (run_chart_downsample) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest>::GetOwningArena(run_chart_downsample); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(run_chart_downsample); if (message_arena != submessage_arena) { run_chart_downsample = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, run_chart_downsample, submessage_arena); @@ -16927,7 +16253,7 @@ void BatchTableRequest_Operation::set_allocated_cross_join(::io::deephaven::prot clear_op(); if (cross_join) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest>::GetOwningArena(cross_join); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(cross_join); if (message_arena != submessage_arena) { cross_join = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, cross_join, submessage_arena); @@ -16942,7 +16268,7 @@ void BatchTableRequest_Operation::set_allocated_natural_join(::io::deephaven::pr clear_op(); if (natural_join) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest>::GetOwningArena(natural_join); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(natural_join); if (message_arena != submessage_arena) { natural_join = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, natural_join, submessage_arena); @@ -16957,7 +16283,7 @@ void BatchTableRequest_Operation::set_allocated_exact_join(::io::deephaven::prot clear_op(); if (exact_join) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest>::GetOwningArena(exact_join); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(exact_join); if (message_arena != submessage_arena) { exact_join = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, exact_join, submessage_arena); @@ -16972,7 +16298,7 @@ void BatchTableRequest_Operation::set_allocated_left_join(::io::deephaven::proto clear_op(); if (left_join) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest>::GetOwningArena(left_join); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_join); if (message_arena != submessage_arena) { left_join = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_join, submessage_arena); @@ -16987,7 +16313,7 @@ void BatchTableRequest_Operation::set_allocated_as_of_join(::io::deephaven::prot clear_op(); if (as_of_join) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest>::GetOwningArena(as_of_join); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(as_of_join); if (message_arena != submessage_arena) { as_of_join = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, as_of_join, submessage_arena); @@ -17002,7 +16328,7 @@ void BatchTableRequest_Operation::set_allocated_fetch_table(::io::deephaven::pro clear_op(); if (fetch_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::FetchTableRequest>::GetOwningArena(fetch_table); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(fetch_table); if (message_arena != submessage_arena) { fetch_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, fetch_table, submessage_arena); @@ -17017,7 +16343,7 @@ void BatchTableRequest_Operation::set_allocated_fetch_pandas_table(::io::deephav clear_op(); if (fetch_pandas_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest>::GetOwningArena(fetch_pandas_table); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(fetch_pandas_table); if (message_arena != submessage_arena) { fetch_pandas_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, fetch_pandas_table, submessage_arena); @@ -17032,7 +16358,7 @@ void BatchTableRequest_Operation::set_allocated_apply_preview_columns(::io::deep clear_op(); if (apply_preview_columns) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest>::GetOwningArena(apply_preview_columns); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(apply_preview_columns); if (message_arena != submessage_arena) { apply_preview_columns = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, apply_preview_columns, submessage_arena); @@ -17047,7 +16373,7 @@ void BatchTableRequest_Operation::set_allocated_create_input_table(::io::deephav clear_op(); if (create_input_table) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CreateInputTableRequest>::GetOwningArena(create_input_table); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(create_input_table); if (message_arena != submessage_arena) { create_input_table = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, create_input_table, submessage_arena); @@ -17061,9 +16387,6 @@ BatchTableRequest_Operation::BatchTableRequest_Operation(::PROTOBUF_NAMESPACE_ID bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) } BatchTableRequest_Operation::BatchTableRequest_Operation(const BatchTableRequest_Operation& from) @@ -17202,15 +16525,17 @@ BatchTableRequest_Operation::BatchTableRequest_Operation(const BatchTableRequest // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) } -void BatchTableRequest_Operation::SharedCtor() { +inline void BatchTableRequest_Operation::SharedCtor() { clear_has_op(); } BatchTableRequest_Operation::~BatchTableRequest_Operation() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void BatchTableRequest_Operation::SharedDtor() { @@ -17220,12 +16545,6 @@ inline void BatchTableRequest_Operation::SharedDtor() { } } -void BatchTableRequest_Operation::ArenaDtor(void* object) { - BatchTableRequest_Operation* _this = reinterpret_cast< BatchTableRequest_Operation* >(object); - (void)_this; -} -void BatchTableRequest_Operation::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void BatchTableRequest_Operation::SetCachedSize(int size) const { _cached_size_.Set(size); } @@ -17429,7 +16748,7 @@ void BatchTableRequest_Operation::clear_op() { void BatchTableRequest_Operation::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -17437,15 +16756,15 @@ void BatchTableRequest_Operation::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.EmptyTableRequest empty_table = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_empty_table(), ptr); CHK_(ptr); } else @@ -17453,7 +16772,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.TimeTableRequest time_table = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_time_table(), ptr); CHK_(ptr); } else @@ -17461,7 +16780,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.DropColumnsRequest drop_columns = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_drop_columns(), ptr); CHK_(ptr); } else @@ -17469,7 +16788,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest update = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_update(), ptr); CHK_(ptr); } else @@ -17477,7 +16796,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest lazy_update = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr = ctx->ParseMessage(_internal_mutable_lazy_update(), ptr); CHK_(ptr); } else @@ -17485,7 +16804,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest view = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { ptr = ctx->ParseMessage(_internal_mutable_view(), ptr); CHK_(ptr); } else @@ -17493,7 +16812,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest update_view = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { ptr = ctx->ParseMessage(_internal_mutable_update_view(), ptr); CHK_(ptr); } else @@ -17501,7 +16820,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest select = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { ptr = ctx->ParseMessage(_internal_mutable_select(), ptr); CHK_(ptr); } else @@ -17509,7 +16828,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SelectDistinctRequest select_distinct = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { ptr = ctx->ParseMessage(_internal_mutable_select_distinct(), ptr); CHK_(ptr); } else @@ -17517,7 +16836,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.FilterTableRequest filter = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { ptr = ctx->ParseMessage(_internal_mutable_filter(), ptr); CHK_(ptr); } else @@ -17525,7 +16844,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest unstructured_filter = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { ptr = ctx->ParseMessage(_internal_mutable_unstructured_filter(), ptr); CHK_(ptr); } else @@ -17533,7 +16852,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SortTableRequest sort = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { ptr = ctx->ParseMessage(_internal_mutable_sort(), ptr); CHK_(ptr); } else @@ -17541,7 +16860,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.HeadOrTailRequest head = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { ptr = ctx->ParseMessage(_internal_mutable_head(), ptr); CHK_(ptr); } else @@ -17549,7 +16868,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.HeadOrTailRequest tail = 14; case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 114)) { ptr = ctx->ParseMessage(_internal_mutable_tail(), ptr); CHK_(ptr); } else @@ -17557,7 +16876,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.HeadOrTailByRequest head_by = 15; case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 122)) { ptr = ctx->ParseMessage(_internal_mutable_head_by(), ptr); CHK_(ptr); } else @@ -17565,7 +16884,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.HeadOrTailByRequest tail_by = 16; case 16: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 130)) { ptr = ctx->ParseMessage(_internal_mutable_tail_by(), ptr); CHK_(ptr); } else @@ -17573,7 +16892,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.UngroupRequest ungroup = 17; case 17: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 138)) { ptr = ctx->ParseMessage(_internal_mutable_ungroup(), ptr); CHK_(ptr); } else @@ -17581,7 +16900,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.MergeTablesRequest merge = 18; case 18: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 146)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 146)) { ptr = ctx->ParseMessage(_internal_mutable_merge(), ptr); CHK_(ptr); } else @@ -17589,7 +16908,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.ComboAggregateRequest combo_aggregate = 19; case 19: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 154)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 154)) { ptr = ctx->ParseMessage(_internal_mutable_combo_aggregate(), ptr); CHK_(ptr); } else @@ -17597,7 +16916,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.SnapshotTableRequest snapshot = 20; case 20: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 162)) { ptr = ctx->ParseMessage(_internal_mutable_snapshot(), ptr); CHK_(ptr); } else @@ -17605,7 +16924,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.FlattenRequest flatten = 21; case 21: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 170)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 170)) { ptr = ctx->ParseMessage(_internal_mutable_flatten(), ptr); CHK_(ptr); } else @@ -17613,7 +16932,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest run_chart_downsample = 22; case 22: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 178)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 178)) { ptr = ctx->ParseMessage(_internal_mutable_run_chart_downsample(), ptr); CHK_(ptr); } else @@ -17621,7 +16940,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest cross_join = 23; case 23: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 186)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 186)) { ptr = ctx->ParseMessage(_internal_mutable_cross_join(), ptr); CHK_(ptr); } else @@ -17629,7 +16948,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest natural_join = 24; case 24: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 194)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 194)) { ptr = ctx->ParseMessage(_internal_mutable_natural_join(), ptr); CHK_(ptr); } else @@ -17637,7 +16956,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest exact_join = 25; case 25: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 202)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 202)) { ptr = ctx->ParseMessage(_internal_mutable_exact_join(), ptr); CHK_(ptr); } else @@ -17645,7 +16964,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest left_join = 26; case 26: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 210)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 210)) { ptr = ctx->ParseMessage(_internal_mutable_left_join(), ptr); CHK_(ptr); } else @@ -17653,7 +16972,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest as_of_join = 27; case 27: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 218)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 218)) { ptr = ctx->ParseMessage(_internal_mutable_as_of_join(), ptr); CHK_(ptr); } else @@ -17661,7 +16980,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.FetchTableRequest fetch_table = 28; case 28: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 226)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 226)) { ptr = ctx->ParseMessage(_internal_mutable_fetch_table(), ptr); CHK_(ptr); } else @@ -17669,7 +16988,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.FetchPandasTableRequest fetch_pandas_table = 29; case 29: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 234)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 234)) { ptr = ctx->ParseMessage(_internal_mutable_fetch_pandas_table(), ptr); CHK_(ptr); } else @@ -17677,7 +16996,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest apply_preview_columns = 30; case 30: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 242)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 242)) { ptr = ctx->ParseMessage(_internal_mutable_apply_preview_columns(), ptr); CHK_(ptr); } else @@ -17685,7 +17004,7 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO continue; // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest create_input_table = 31; case 31: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 250)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 250)) { ptr = ctx->ParseMessage(_internal_mutable_create_input_table(), ptr); CHK_(ptr); } else @@ -17714,262 +17033,231 @@ const char* BatchTableRequest_Operation::_InternalParse(const char* ptr, ::PROTO #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* BatchTableRequest_Operation::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* BatchTableRequest_Operation::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.EmptyTableRequest empty_table = 1; if (_internal_has_empty_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::empty_table(this), target, stream); + InternalWriteMessage(1, _Internal::empty_table(this), + _Internal::empty_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.TimeTableRequest time_table = 2; if (_internal_has_time_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::time_table(this), target, stream); + InternalWriteMessage(2, _Internal::time_table(this), + _Internal::time_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.DropColumnsRequest drop_columns = 3; if (_internal_has_drop_columns()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::drop_columns(this), target, stream); + InternalWriteMessage(3, _Internal::drop_columns(this), + _Internal::drop_columns(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest update = 4; if (_internal_has_update()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::update(this), target, stream); + InternalWriteMessage(4, _Internal::update(this), + _Internal::update(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest lazy_update = 5; if (_internal_has_lazy_update()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 5, _Internal::lazy_update(this), target, stream); + InternalWriteMessage(5, _Internal::lazy_update(this), + _Internal::lazy_update(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest view = 6; if (_internal_has_view()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 6, _Internal::view(this), target, stream); + InternalWriteMessage(6, _Internal::view(this), + _Internal::view(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest update_view = 7; if (_internal_has_update_view()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 7, _Internal::update_view(this), target, stream); + InternalWriteMessage(7, _Internal::update_view(this), + _Internal::update_view(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest select = 8; if (_internal_has_select()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 8, _Internal::select(this), target, stream); + InternalWriteMessage(8, _Internal::select(this), + _Internal::select(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SelectDistinctRequest select_distinct = 9; if (_internal_has_select_distinct()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 9, _Internal::select_distinct(this), target, stream); + InternalWriteMessage(9, _Internal::select_distinct(this), + _Internal::select_distinct(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.FilterTableRequest filter = 10; if (_internal_has_filter()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 10, _Internal::filter(this), target, stream); + InternalWriteMessage(10, _Internal::filter(this), + _Internal::filter(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest unstructured_filter = 11; if (_internal_has_unstructured_filter()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 11, _Internal::unstructured_filter(this), target, stream); + InternalWriteMessage(11, _Internal::unstructured_filter(this), + _Internal::unstructured_filter(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SortTableRequest sort = 12; if (_internal_has_sort()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 12, _Internal::sort(this), target, stream); + InternalWriteMessage(12, _Internal::sort(this), + _Internal::sort(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.HeadOrTailRequest head = 13; if (_internal_has_head()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 13, _Internal::head(this), target, stream); + InternalWriteMessage(13, _Internal::head(this), + _Internal::head(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.HeadOrTailRequest tail = 14; if (_internal_has_tail()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 14, _Internal::tail(this), target, stream); + InternalWriteMessage(14, _Internal::tail(this), + _Internal::tail(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.HeadOrTailByRequest head_by = 15; if (_internal_has_head_by()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 15, _Internal::head_by(this), target, stream); + InternalWriteMessage(15, _Internal::head_by(this), + _Internal::head_by(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.HeadOrTailByRequest tail_by = 16; if (_internal_has_tail_by()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 16, _Internal::tail_by(this), target, stream); + InternalWriteMessage(16, _Internal::tail_by(this), + _Internal::tail_by(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.UngroupRequest ungroup = 17; if (_internal_has_ungroup()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 17, _Internal::ungroup(this), target, stream); + InternalWriteMessage(17, _Internal::ungroup(this), + _Internal::ungroup(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.MergeTablesRequest merge = 18; if (_internal_has_merge()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 18, _Internal::merge(this), target, stream); + InternalWriteMessage(18, _Internal::merge(this), + _Internal::merge(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.ComboAggregateRequest combo_aggregate = 19; if (_internal_has_combo_aggregate()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 19, _Internal::combo_aggregate(this), target, stream); + InternalWriteMessage(19, _Internal::combo_aggregate(this), + _Internal::combo_aggregate(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.SnapshotTableRequest snapshot = 20; if (_internal_has_snapshot()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 20, _Internal::snapshot(this), target, stream); + InternalWriteMessage(20, _Internal::snapshot(this), + _Internal::snapshot(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.FlattenRequest flatten = 21; if (_internal_has_flatten()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 21, _Internal::flatten(this), target, stream); + InternalWriteMessage(21, _Internal::flatten(this), + _Internal::flatten(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest run_chart_downsample = 22; if (_internal_has_run_chart_downsample()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 22, _Internal::run_chart_downsample(this), target, stream); + InternalWriteMessage(22, _Internal::run_chart_downsample(this), + _Internal::run_chart_downsample(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest cross_join = 23; if (_internal_has_cross_join()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 23, _Internal::cross_join(this), target, stream); + InternalWriteMessage(23, _Internal::cross_join(this), + _Internal::cross_join(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest natural_join = 24; if (_internal_has_natural_join()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 24, _Internal::natural_join(this), target, stream); + InternalWriteMessage(24, _Internal::natural_join(this), + _Internal::natural_join(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest exact_join = 25; if (_internal_has_exact_join()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 25, _Internal::exact_join(this), target, stream); + InternalWriteMessage(25, _Internal::exact_join(this), + _Internal::exact_join(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest left_join = 26; if (_internal_has_left_join()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 26, _Internal::left_join(this), target, stream); + InternalWriteMessage(26, _Internal::left_join(this), + _Internal::left_join(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest as_of_join = 27; if (_internal_has_as_of_join()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 27, _Internal::as_of_join(this), target, stream); + InternalWriteMessage(27, _Internal::as_of_join(this), + _Internal::as_of_join(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.FetchTableRequest fetch_table = 28; if (_internal_has_fetch_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 28, _Internal::fetch_table(this), target, stream); + InternalWriteMessage(28, _Internal::fetch_table(this), + _Internal::fetch_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.FetchPandasTableRequest fetch_pandas_table = 29; if (_internal_has_fetch_pandas_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 29, _Internal::fetch_pandas_table(this), target, stream); + InternalWriteMessage(29, _Internal::fetch_pandas_table(this), + _Internal::fetch_pandas_table(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest apply_preview_columns = 30; if (_internal_has_apply_preview_columns()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 30, _Internal::apply_preview_columns(this), target, stream); + InternalWriteMessage(30, _Internal::apply_preview_columns(this), + _Internal::apply_preview_columns(this).GetCachedSize(), target, stream); } // .io.deephaven.proto.backplane.grpc.CreateInputTableRequest create_input_table = 31; if (_internal_has_create_input_table()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 31, _Internal::create_input_table(this), target, stream); + InternalWriteMessage(31, _Internal::create_input_table(this), + _Internal::create_input_table(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) @@ -17980,7 +17268,7 @@ size_t BatchTableRequest_Operation::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -18225,7 +17513,7 @@ void BatchTableRequest_Operation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to void BatchTableRequest_Operation::MergeFrom(const BatchTableRequest_Operation& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; switch (from.op_case()) { @@ -18379,9 +17667,9 @@ void BatchTableRequest_Operation::InternalSwap(BatchTableRequest_Operation* othe } ::PROTOBUF_NAMESPACE_ID::Metadata BatchTableRequest_Operation::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[51]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[49]); } // =================================================================== @@ -18395,9 +17683,6 @@ BatchTableRequest::BatchTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), ops_(arena) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.BatchTableRequest) } BatchTableRequest::BatchTableRequest(const BatchTableRequest& from) @@ -18407,33 +17692,29 @@ BatchTableRequest::BatchTableRequest(const BatchTableRequest& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.BatchTableRequest) } -void BatchTableRequest::SharedCtor() { +inline void BatchTableRequest::SharedCtor() { } BatchTableRequest::~BatchTableRequest() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.BatchTableRequest) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void BatchTableRequest::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void BatchTableRequest::ArenaDtor(void* object) { - BatchTableRequest* _this = reinterpret_cast< BatchTableRequest* >(object); - (void)_this; -} -void BatchTableRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void BatchTableRequest::SetCachedSize(int size) const { _cached_size_.Set(size); } void BatchTableRequest::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.BatchTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -18441,15 +17722,15 @@ void BatchTableRequest::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* BatchTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* BatchTableRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // repeated .io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation ops = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr -= 1; do { ptr += 1; @@ -18483,22 +17764,22 @@ const char* BatchTableRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* BatchTableRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* BatchTableRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.BatchTableRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // repeated .io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation ops = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_ops_size()); i < n; i++) { - target = stream->EnsureSpace(target); + for (unsigned i = 0, + n = static_cast(this->_internal_ops_size()); i < n; i++) { + const auto& repfield = this->_internal_ops(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_ops(i), target, stream); + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.BatchTableRequest) @@ -18509,7 +17790,7 @@ size_t BatchTableRequest::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.BatchTableRequest) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -18539,7 +17820,7 @@ void BatchTableRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void BatchTableRequest::MergeFrom(const BatchTableRequest& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.BatchTableRequest) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; ops_.MergeFrom(from.ops_); @@ -18564,9 +17845,9 @@ void BatchTableRequest::InternalSwap(BatchTableRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata BatchTableRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2ftable_2eproto_getter, &descriptor_table_deephaven_2fproto_2ftable_2eproto_once, - file_level_metadata_deephaven_2fproto_2ftable_2eproto[52]); + file_level_metadata_deephaven_2fproto_2ftable_2eproto[50]); } // @@protoc_insertion_point(namespace_scope) @@ -18576,163 +17857,208 @@ ::PROTOBUF_NAMESPACE_ID::Metadata BatchTableRequest::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TableReference* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TableReference >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TableReference* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TableReference >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TableReference >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse >(arena); -} -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::EmptyTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TimeTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TimeTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TimeTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TimeTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TimeTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::DropColumnsRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::UngroupRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::UngroupRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::UngroupRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::UngroupRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::UngroupRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::MergeTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest_Aggregate >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SortDescriptor* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SortDescriptor >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SortDescriptor* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SortDescriptor >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SortDescriptor >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SortTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SortTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SortTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SortTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SortTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FilterTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FilterTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FilterTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FilterTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FilterTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Reference* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Reference >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Reference* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Reference >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::Reference >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Literal* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Literal >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Literal* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Literal >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::Literal >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Value* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Value >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Value* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Value >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::Value >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Condition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Condition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Condition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Condition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::Condition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AndCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AndCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::AndCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::AndCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::AndCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::OrCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::OrCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::OrCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::OrCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::OrCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::NotCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::NotCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::NotCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::NotCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::NotCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CompareCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CompareCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CompareCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CompareCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CompareCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::InCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::InCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::InCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::InCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::InCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::InvokeCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::InvokeCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::InvokeCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::InvokeCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::InvokeCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::IsNullCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::IsNullCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::IsNullCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::IsNullCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::IsNullCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::MatchesCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::MatchesCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::MatchesCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::MatchesCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::MatchesCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ContainsCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ContainsCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::ContainsCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::ContainsCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::ContainsCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SearchCondition* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SearchCondition >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::SearchCondition* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::SearchCondition >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::SearchCondition >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FlattenRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FlattenRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::FlattenRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::FlattenRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::FlattenRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::BatchTableRequest_Operation >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::BatchTableRequest* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::BatchTableRequest >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::BatchTableRequest* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::BatchTableRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::BatchTableRequest >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.h index 56a34da2dd7..884c4afb6de 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/table.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/table.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -27,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -48,15 +44,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2ftable_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[53] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2ftable_2eproto; namespace io { @@ -130,12 +118,6 @@ extern ExportedTableUpdatesRequestDefaultTypeInternal _ExportedTableUpdatesReque class FetchPandasTableRequest; struct FetchPandasTableRequestDefaultTypeInternal; extern FetchPandasTableRequestDefaultTypeInternal _FetchPandasTableRequest_default_instance_; -class FetchTableMapRequest; -struct FetchTableMapRequestDefaultTypeInternal; -extern FetchTableMapRequestDefaultTypeInternal _FetchTableMapRequest_default_instance_; -class FetchTableMapResponse; -struct FetchTableMapResponseDefaultTypeInternal; -extern FetchTableMapResponseDefaultTypeInternal _FetchTableMapResponse_default_instance_; class FetchTableRequest; struct FetchTableRequestDefaultTypeInternal; extern FetchTableRequestDefaultTypeInternal _FetchTableRequest_default_instance_; @@ -251,8 +233,6 @@ template<> ::io::deephaven::proto::backplane::grpc::ExportedTableCreationRespons template<> ::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::ExportedTableUpdateMessage>(Arena*); template<> ::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::ExportedTableUpdatesRequest>(Arena*); template<> ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest>(Arena*); -template<> ::io::deephaven::proto::backplane::grpc::FetchTableMapRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FetchTableMapRequest>(Arena*); -template<> ::io::deephaven::proto::backplane::grpc::FetchTableMapResponse* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FetchTableMapResponse>(Arena*); template<> ::io::deephaven::proto::backplane::grpc::FetchTableRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FetchTableRequest>(Arena*); template<> ::io::deephaven::proto::backplane::grpc::FilterTableRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FilterTableRequest>(Arena*); template<> ::io::deephaven::proto::backplane::grpc::FlattenRequest* Arena::CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::FlattenRequest>(Arena*); @@ -294,8 +274,8 @@ enum AsOfJoinTablesRequest_MatchRule : int { AsOfJoinTablesRequest_MatchRule_LESS_THAN = 1, AsOfJoinTablesRequest_MatchRule_GREATER_THAN_EQUAL = 2, AsOfJoinTablesRequest_MatchRule_GREATER_THAN = 3, - AsOfJoinTablesRequest_MatchRule_AsOfJoinTablesRequest_MatchRule_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - AsOfJoinTablesRequest_MatchRule_AsOfJoinTablesRequest_MatchRule_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + AsOfJoinTablesRequest_MatchRule_AsOfJoinTablesRequest_MatchRule_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + AsOfJoinTablesRequest_MatchRule_AsOfJoinTablesRequest_MatchRule_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool AsOfJoinTablesRequest_MatchRule_IsValid(int value); constexpr AsOfJoinTablesRequest_MatchRule AsOfJoinTablesRequest_MatchRule_MatchRule_MIN = AsOfJoinTablesRequest_MatchRule_LESS_THAN_EQUAL; @@ -331,8 +311,8 @@ enum ComboAggregateRequest_AggType : int { ComboAggregateRequest_AggType_STD = 11, ComboAggregateRequest_AggType_VAR = 12, ComboAggregateRequest_AggType_WEIGHTED_AVG = 13, - ComboAggregateRequest_AggType_ComboAggregateRequest_AggType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - ComboAggregateRequest_AggType_ComboAggregateRequest_AggType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + ComboAggregateRequest_AggType_ComboAggregateRequest_AggType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + ComboAggregateRequest_AggType_ComboAggregateRequest_AggType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool ComboAggregateRequest_AggType_IsValid(int value); constexpr ComboAggregateRequest_AggType ComboAggregateRequest_AggType_AggType_MIN = ComboAggregateRequest_AggType_SUM; @@ -358,8 +338,8 @@ enum SortDescriptor_SortDirection : int { SortDescriptor_SortDirection_DESCENDING = -1, SortDescriptor_SortDirection_ASCENDING = 1, SortDescriptor_SortDirection_REVERSE = 2, - SortDescriptor_SortDirection_SortDescriptor_SortDirection_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - SortDescriptor_SortDirection_SortDescriptor_SortDirection_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + SortDescriptor_SortDirection_SortDescriptor_SortDirection_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + SortDescriptor_SortDirection_SortDescriptor_SortDirection_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool SortDescriptor_SortDirection_IsValid(int value); constexpr SortDescriptor_SortDirection SortDescriptor_SortDirection_SortDirection_MIN = SortDescriptor_SortDirection_DESCENDING; @@ -387,8 +367,8 @@ enum CompareCondition_CompareOperation : int { CompareCondition_CompareOperation_GREATER_THAN_OR_EQUAL = 3, CompareCondition_CompareOperation_EQUALS = 4, CompareCondition_CompareOperation_NOT_EQUALS = 5, - CompareCondition_CompareOperation_CompareCondition_CompareOperation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - CompareCondition_CompareOperation_CompareCondition_CompareOperation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + CompareCondition_CompareOperation_CompareCondition_CompareOperation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + CompareCondition_CompareOperation_CompareCondition_CompareOperation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool CompareCondition_CompareOperation_IsValid(int value); constexpr CompareCondition_CompareOperation CompareCondition_CompareOperation_CompareOperation_MIN = CompareCondition_CompareOperation_LESS_THAN; @@ -412,8 +392,8 @@ inline bool CompareCondition_CompareOperation_Parse( enum CaseSensitivity : int { MATCH_CASE = 0, IGNORE_CASE = 1, - CaseSensitivity_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - CaseSensitivity_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + CaseSensitivity_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + CaseSensitivity_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool CaseSensitivity_IsValid(int value); constexpr CaseSensitivity CaseSensitivity_MIN = MATCH_CASE; @@ -437,8 +417,8 @@ inline bool CaseSensitivity_Parse( enum MatchType : int { REGULAR = 0, INVERTED = 1, - MatchType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - MatchType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() + MatchType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + MatchType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool MatchType_IsValid(int value); constexpr MatchType MatchType_MIN = REGULAR; @@ -466,7 +446,7 @@ class TableReference final : public: inline TableReference() : TableReference(nullptr) {} ~TableReference() override; - explicit constexpr TableReference(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TableReference(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TableReference(const TableReference& from); TableReference(TableReference&& from) noexcept @@ -522,7 +502,12 @@ class TableReference final : } inline void Swap(TableReference* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -536,11 +521,7 @@ class TableReference final : // implements Message ---------------------------------------------- - inline TableReference* New() const final { - return new TableReference(); - } - - TableReference* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TableReference* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -555,8 +536,8 @@ class TableReference final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -564,6 +545,8 @@ class TableReference final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TableReference* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TableReference"; @@ -571,9 +554,6 @@ class TableReference final : protected: explicit TableReference(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -596,7 +576,7 @@ class TableReference final : public: void clear_ticket(); const ::io::deephaven::proto::backplane::grpc::Ticket& ticket() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_ticket(); void set_allocated_ticket(::io::deephaven::proto::backplane::grpc::Ticket* ticket); private: @@ -613,11 +593,11 @@ class TableReference final : bool _internal_has_batch_offset() const; public: void clear_batch_offset(); - ::PROTOBUF_NAMESPACE_ID::int32 batch_offset() const; - void set_batch_offset(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t batch_offset() const; + void set_batch_offset(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_batch_offset() const; - void _internal_set_batch_offset(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_batch_offset() const; + void _internal_set_batch_offset(int32_t value); public: void clear_ref(); @@ -638,10 +618,10 @@ class TableReference final : constexpr RefUnion() : _constinit_{} {} ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; ::io::deephaven::proto::backplane::grpc::Ticket* ticket_; - ::PROTOBUF_NAMESPACE_ID::int32 batch_offset_; + int32_t batch_offset_; } ref_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -652,7 +632,7 @@ class ExportedTableCreationResponse final : public: inline ExportedTableCreationResponse() : ExportedTableCreationResponse(nullptr) {} ~ExportedTableCreationResponse() override; - explicit constexpr ExportedTableCreationResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportedTableCreationResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportedTableCreationResponse(const ExportedTableCreationResponse& from); ExportedTableCreationResponse(ExportedTableCreationResponse&& from) noexcept @@ -702,7 +682,12 @@ class ExportedTableCreationResponse final : } inline void Swap(ExportedTableCreationResponse* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -716,11 +701,7 @@ class ExportedTableCreationResponse final : // implements Message ---------------------------------------------- - inline ExportedTableCreationResponse* New() const final { - return new ExportedTableCreationResponse(); - } - - ExportedTableCreationResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportedTableCreationResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -735,8 +716,8 @@ class ExportedTableCreationResponse final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -744,6 +725,8 @@ class ExportedTableCreationResponse final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExportedTableCreationResponse* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse"; @@ -751,9 +734,6 @@ class ExportedTableCreationResponse final : protected: explicit ExportedTableCreationResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -779,7 +759,7 @@ class ExportedTableCreationResponse final : template void set_error_info(ArgT0&& arg0, ArgT... args); std::string* mutable_error_info(); - PROTOBUF_MUST_USE_RESULT std::string* release_error_info(); + PROTOBUF_NODISCARD std::string* release_error_info(); void set_allocated_error_info(std::string* error_info); private: const std::string& _internal_error_info() const; @@ -793,7 +773,7 @@ class ExportedTableCreationResponse final : template void set_schema_header(ArgT0&& arg0, ArgT... args); std::string* mutable_schema_header(); - PROTOBUF_MUST_USE_RESULT std::string* release_schema_header(); + PROTOBUF_NODISCARD std::string* release_schema_header(); void set_allocated_schema_header(std::string* schema_header); private: const std::string& _internal_schema_header() const; @@ -808,7 +788,7 @@ class ExportedTableCreationResponse final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_result_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::TableReference* result_id); private: @@ -821,11 +801,11 @@ class ExportedTableCreationResponse final : // sint64 size = 6 [jstype = JS_STRING]; void clear_size(); - ::PROTOBUF_NAMESPACE_ID::int64 size() const; - void set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t size() const; + void set_size(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_size() const; - void _internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_size() const; + void _internal_set_size(int64_t value); public: // bool success = 2; @@ -856,7 +836,7 @@ class ExportedTableCreationResponse final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_info_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_header_; ::io::deephaven::proto::backplane::grpc::TableReference* result_id_; - ::PROTOBUF_NAMESPACE_ID::int64 size_; + int64_t size_; bool success_; bool is_static_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -869,7 +849,7 @@ class FetchTableRequest final : public: inline FetchTableRequest() : FetchTableRequest(nullptr) {} ~FetchTableRequest() override; - explicit constexpr FetchTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FetchTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FetchTableRequest(const FetchTableRequest& from); FetchTableRequest(FetchTableRequest&& from) noexcept @@ -919,7 +899,12 @@ class FetchTableRequest final : } inline void Swap(FetchTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -933,11 +918,7 @@ class FetchTableRequest final : // implements Message ---------------------------------------------- - inline FetchTableRequest* New() const final { - return new FetchTableRequest(); - } - - FetchTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FetchTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -952,8 +933,8 @@ class FetchTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -961,6 +942,8 @@ class FetchTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FetchTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FetchTableRequest"; @@ -968,9 +951,6 @@ class FetchTableRequest final : protected: explicit FetchTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -993,7 +973,7 @@ class FetchTableRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -1011,7 +991,7 @@ class FetchTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -1041,7 +1021,7 @@ class ApplyPreviewColumnsRequest final : public: inline ApplyPreviewColumnsRequest() : ApplyPreviewColumnsRequest(nullptr) {} ~ApplyPreviewColumnsRequest() override; - explicit constexpr ApplyPreviewColumnsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ApplyPreviewColumnsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ApplyPreviewColumnsRequest(const ApplyPreviewColumnsRequest& from); ApplyPreviewColumnsRequest(ApplyPreviewColumnsRequest&& from) noexcept @@ -1091,7 +1071,12 @@ class ApplyPreviewColumnsRequest final : } inline void Swap(ApplyPreviewColumnsRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1105,11 +1090,7 @@ class ApplyPreviewColumnsRequest final : // implements Message ---------------------------------------------- - inline ApplyPreviewColumnsRequest* New() const final { - return new ApplyPreviewColumnsRequest(); - } - - ApplyPreviewColumnsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ApplyPreviewColumnsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1124,8 +1105,8 @@ class ApplyPreviewColumnsRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1133,6 +1114,8 @@ class ApplyPreviewColumnsRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ApplyPreviewColumnsRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest"; @@ -1140,9 +1123,6 @@ class ApplyPreviewColumnsRequest final : protected: explicit ApplyPreviewColumnsRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1165,7 +1145,7 @@ class ApplyPreviewColumnsRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -1183,7 +1163,7 @@ class ApplyPreviewColumnsRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -1213,7 +1193,7 @@ class FetchPandasTableRequest final : public: inline FetchPandasTableRequest() : FetchPandasTableRequest(nullptr) {} ~FetchPandasTableRequest() override; - explicit constexpr FetchPandasTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FetchPandasTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FetchPandasTableRequest(const FetchPandasTableRequest& from); FetchPandasTableRequest(FetchPandasTableRequest&& from) noexcept @@ -1263,7 +1243,12 @@ class FetchPandasTableRequest final : } inline void Swap(FetchPandasTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1277,11 +1262,7 @@ class FetchPandasTableRequest final : // implements Message ---------------------------------------------- - inline FetchPandasTableRequest* New() const final { - return new FetchPandasTableRequest(); - } - - FetchPandasTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FetchPandasTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1296,8 +1277,8 @@ class FetchPandasTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1305,6 +1286,8 @@ class FetchPandasTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FetchPandasTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FetchPandasTableRequest"; @@ -1312,9 +1295,6 @@ class FetchPandasTableRequest final : protected: explicit FetchPandasTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1337,7 +1317,7 @@ class FetchPandasTableRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -1355,7 +1335,7 @@ class FetchPandasTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -1380,298 +1360,11 @@ class FetchPandasTableRequest final : }; // ------------------------------------------------------------------- -class FetchTableMapRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) */ { - public: - inline FetchTableMapRequest() : FetchTableMapRequest(nullptr) {} - ~FetchTableMapRequest() override; - explicit constexpr FetchTableMapRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - FetchTableMapRequest(const FetchTableMapRequest& from); - FetchTableMapRequest(FetchTableMapRequest&& from) noexcept - : FetchTableMapRequest() { - *this = ::std::move(from); - } - - inline FetchTableMapRequest& operator=(const FetchTableMapRequest& from) { - CopyFrom(from); - return *this; - } - inline FetchTableMapRequest& operator=(FetchTableMapRequest&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const FetchTableMapRequest& default_instance() { - return *internal_default_instance(); - } - static inline const FetchTableMapRequest* internal_default_instance() { - return reinterpret_cast( - &_FetchTableMapRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(FetchTableMapRequest& a, FetchTableMapRequest& b) { - a.Swap(&b); - } - inline void Swap(FetchTableMapRequest* other) { - if (other == this) return; - if (GetOwningArena() == other->GetOwningArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(FetchTableMapRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FetchTableMapRequest* New() const final { - return new FetchTableMapRequest(); - } - - FetchTableMapRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const FetchTableMapRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FetchTableMapRequest& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FetchTableMapRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "io.deephaven.proto.backplane.grpc.FetchTableMapRequest"; - } - protected: - explicit FetchTableMapRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSourceIdFieldNumber = 1, - kResultIdFieldNumber = 2, - }; - // .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; - bool has_source_id() const; - private: - bool _internal_has_source_id() const; - public: - void clear_source_id(); - const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); - ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); - void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); - private: - const ::io::deephaven::proto::backplane::grpc::TableReference& _internal_source_id() const; - ::io::deephaven::proto::backplane::grpc::TableReference* _internal_mutable_source_id(); - public: - void unsafe_arena_set_allocated_source_id( - ::io::deephaven::proto::backplane::grpc::TableReference* source_id); - ::io::deephaven::proto::backplane::grpc::TableReference* unsafe_arena_release_source_id(); - - // .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; - bool has_result_id() const; - private: - bool _internal_has_result_id() const; - public: - void clear_result_id(); - const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); - ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); - void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); - private: - const ::io::deephaven::proto::backplane::grpc::Ticket& _internal_result_id() const; - ::io::deephaven::proto::backplane::grpc::Ticket* _internal_mutable_result_id(); - public: - void unsafe_arena_set_allocated_result_id( - ::io::deephaven::proto::backplane::grpc::Ticket* result_id); - ::io::deephaven::proto::backplane::grpc::Ticket* unsafe_arena_release_result_id(); - - // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchTableMapRequest) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::io::deephaven::proto::backplane::grpc::TableReference* source_id_; - ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; -}; -// ------------------------------------------------------------------- - -class FetchTableMapResponse final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.FetchTableMapResponse) */ { - public: - inline FetchTableMapResponse() : FetchTableMapResponse(nullptr) {} - explicit constexpr FetchTableMapResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - FetchTableMapResponse(const FetchTableMapResponse& from); - FetchTableMapResponse(FetchTableMapResponse&& from) noexcept - : FetchTableMapResponse() { - *this = ::std::move(from); - } - - inline FetchTableMapResponse& operator=(const FetchTableMapResponse& from) { - CopyFrom(from); - return *this; - } - inline FetchTableMapResponse& operator=(FetchTableMapResponse&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const FetchTableMapResponse& default_instance() { - return *internal_default_instance(); - } - static inline const FetchTableMapResponse* internal_default_instance() { - return reinterpret_cast( - &_FetchTableMapResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(FetchTableMapResponse& a, FetchTableMapResponse& b) { - a.Swap(&b); - } - inline void Swap(FetchTableMapResponse* other) { - if (other == this) return; - if (GetOwningArena() == other->GetOwningArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(FetchTableMapResponse* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FetchTableMapResponse* New() const final { - return new FetchTableMapResponse(); - } - - FetchTableMapResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const FetchTableMapResponse& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(this, from); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const FetchTableMapResponse& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); - } - public: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "io.deephaven.proto.backplane.grpc.FetchTableMapResponse"; - } - protected: - explicit FetchTableMapResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchTableMapResponse) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; -}; -// ------------------------------------------------------------------- - class ExportedTableUpdatesRequest final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest) */ { public: inline ExportedTableUpdatesRequest() : ExportedTableUpdatesRequest(nullptr) {} - explicit constexpr ExportedTableUpdatesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportedTableUpdatesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportedTableUpdatesRequest(const ExportedTableUpdatesRequest& from); ExportedTableUpdatesRequest(ExportedTableUpdatesRequest&& from) noexcept @@ -1714,14 +1407,19 @@ class ExportedTableUpdatesRequest final : &_ExportedTableUpdatesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 5; friend void swap(ExportedTableUpdatesRequest& a, ExportedTableUpdatesRequest& b) { a.Swap(&b); } inline void Swap(ExportedTableUpdatesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1735,11 +1433,7 @@ class ExportedTableUpdatesRequest final : // implements Message ---------------------------------------------- - inline ExportedTableUpdatesRequest* New() const final { - return new ExportedTableUpdatesRequest(); - } - - ExportedTableUpdatesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportedTableUpdatesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -1751,6 +1445,8 @@ class ExportedTableUpdatesRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest"; @@ -1758,7 +1454,6 @@ class ExportedTableUpdatesRequest final : protected: explicit ExportedTableUpdatesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -1777,7 +1472,6 @@ class ExportedTableUpdatesRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; // ------------------------------------------------------------------- @@ -1787,7 +1481,7 @@ class ExportedTableUpdateMessage final : public: inline ExportedTableUpdateMessage() : ExportedTableUpdateMessage(nullptr) {} ~ExportedTableUpdateMessage() override; - explicit constexpr ExportedTableUpdateMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExportedTableUpdateMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExportedTableUpdateMessage(const ExportedTableUpdateMessage& from); ExportedTableUpdateMessage(ExportedTableUpdateMessage&& from) noexcept @@ -1830,14 +1524,19 @@ class ExportedTableUpdateMessage final : &_ExportedTableUpdateMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 6; friend void swap(ExportedTableUpdateMessage& a, ExportedTableUpdateMessage& b) { a.Swap(&b); } inline void Swap(ExportedTableUpdateMessage* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1851,11 +1550,7 @@ class ExportedTableUpdateMessage final : // implements Message ---------------------------------------------- - inline ExportedTableUpdateMessage* New() const final { - return new ExportedTableUpdateMessage(); - } - - ExportedTableUpdateMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExportedTableUpdateMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -1870,8 +1565,8 @@ class ExportedTableUpdateMessage final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -1879,6 +1574,8 @@ class ExportedTableUpdateMessage final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExportedTableUpdateMessage* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage"; @@ -1886,9 +1583,6 @@ class ExportedTableUpdateMessage final : protected: explicit ExportedTableUpdateMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1911,7 +1605,7 @@ class ExportedTableUpdateMessage final : template void set_update_failure_message(ArgT0&& arg0, ArgT... args); std::string* mutable_update_failure_message(); - PROTOBUF_MUST_USE_RESULT std::string* release_update_failure_message(); + PROTOBUF_NODISCARD std::string* release_update_failure_message(); void set_allocated_update_failure_message(std::string* update_failure_message); private: const std::string& _internal_update_failure_message() const; @@ -1926,7 +1620,7 @@ class ExportedTableUpdateMessage final : public: void clear_export_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& export_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_export_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_export_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_export_id(); void set_allocated_export_id(::io::deephaven::proto::backplane::grpc::Ticket* export_id); private: @@ -1939,11 +1633,11 @@ class ExportedTableUpdateMessage final : // sint64 size = 2 [jstype = JS_STRING]; void clear_size(); - ::PROTOBUF_NAMESPACE_ID::int64 size() const; - void set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t size() const; + void set_size(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_size() const; - void _internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_size() const; + void _internal_set_size(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) @@ -1955,7 +1649,7 @@ class ExportedTableUpdateMessage final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr update_failure_message_; ::io::deephaven::proto::backplane::grpc::Ticket* export_id_; - ::PROTOBUF_NAMESPACE_ID::int64 size_; + int64_t size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -1966,7 +1660,7 @@ class EmptyTableRequest final : public: inline EmptyTableRequest() : EmptyTableRequest(nullptr) {} ~EmptyTableRequest() override; - explicit constexpr EmptyTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EmptyTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EmptyTableRequest(const EmptyTableRequest& from); EmptyTableRequest(EmptyTableRequest&& from) noexcept @@ -2009,14 +1703,19 @@ class EmptyTableRequest final : &_EmptyTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 7; friend void swap(EmptyTableRequest& a, EmptyTableRequest& b) { a.Swap(&b); } inline void Swap(EmptyTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2030,11 +1729,7 @@ class EmptyTableRequest final : // implements Message ---------------------------------------------- - inline EmptyTableRequest* New() const final { - return new EmptyTableRequest(); - } - - EmptyTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + EmptyTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2049,8 +1744,8 @@ class EmptyTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2058,6 +1753,8 @@ class EmptyTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EmptyTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.EmptyTableRequest"; @@ -2065,9 +1762,6 @@ class EmptyTableRequest final : protected: explicit EmptyTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2090,7 +1784,7 @@ class EmptyTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -2103,11 +1797,11 @@ class EmptyTableRequest final : // sint64 size = 2 [jstype = JS_STRING]; void clear_size(); - ::PROTOBUF_NAMESPACE_ID::int64 size() const; - void set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t size() const; + void set_size(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_size() const; - void _internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_size() const; + void _internal_set_size(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.EmptyTableRequest) @@ -2118,7 +1812,7 @@ class EmptyTableRequest final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; - ::PROTOBUF_NAMESPACE_ID::int64 size_; + int64_t size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -2129,7 +1823,7 @@ class TimeTableRequest final : public: inline TimeTableRequest() : TimeTableRequest(nullptr) {} ~TimeTableRequest() override; - explicit constexpr TimeTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TimeTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TimeTableRequest(const TimeTableRequest& from); TimeTableRequest(TimeTableRequest&& from) noexcept @@ -2172,14 +1866,19 @@ class TimeTableRequest final : &_TimeTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 8; friend void swap(TimeTableRequest& a, TimeTableRequest& b) { a.Swap(&b); } inline void Swap(TimeTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2193,11 +1892,7 @@ class TimeTableRequest final : // implements Message ---------------------------------------------- - inline TimeTableRequest* New() const final { - return new TimeTableRequest(); - } - - TimeTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TimeTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2212,8 +1907,8 @@ class TimeTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2221,6 +1916,8 @@ class TimeTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TimeTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TimeTableRequest"; @@ -2228,9 +1925,6 @@ class TimeTableRequest final : protected: explicit TimeTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2254,7 +1948,7 @@ class TimeTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -2267,20 +1961,20 @@ class TimeTableRequest final : // sint64 start_time_nanos = 2 [jstype = JS_STRING]; void clear_start_time_nanos(); - ::PROTOBUF_NAMESPACE_ID::int64 start_time_nanos() const; - void set_start_time_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t start_time_nanos() const; + void set_start_time_nanos(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_start_time_nanos() const; - void _internal_set_start_time_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_start_time_nanos() const; + void _internal_set_start_time_nanos(int64_t value); public: // sint64 period_nanos = 3 [jstype = JS_STRING]; void clear_period_nanos(); - ::PROTOBUF_NAMESPACE_ID::int64 period_nanos() const; - void set_period_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t period_nanos() const; + void set_period_nanos(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_period_nanos() const; - void _internal_set_period_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_period_nanos() const; + void _internal_set_period_nanos(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.TimeTableRequest) @@ -2291,8 +1985,8 @@ class TimeTableRequest final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; - ::PROTOBUF_NAMESPACE_ID::int64 start_time_nanos_; - ::PROTOBUF_NAMESPACE_ID::int64 period_nanos_; + int64_t start_time_nanos_; + int64_t period_nanos_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -2303,7 +1997,7 @@ class SelectOrUpdateRequest final : public: inline SelectOrUpdateRequest() : SelectOrUpdateRequest(nullptr) {} ~SelectOrUpdateRequest() override; - explicit constexpr SelectOrUpdateRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SelectOrUpdateRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SelectOrUpdateRequest(const SelectOrUpdateRequest& from); SelectOrUpdateRequest(SelectOrUpdateRequest&& from) noexcept @@ -2346,14 +2040,19 @@ class SelectOrUpdateRequest final : &_SelectOrUpdateRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 9; friend void swap(SelectOrUpdateRequest& a, SelectOrUpdateRequest& b) { a.Swap(&b); } inline void Swap(SelectOrUpdateRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2367,11 +2066,7 @@ class SelectOrUpdateRequest final : // implements Message ---------------------------------------------- - inline SelectOrUpdateRequest* New() const final { - return new SelectOrUpdateRequest(); - } - - SelectOrUpdateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SelectOrUpdateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2386,8 +2081,8 @@ class SelectOrUpdateRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2395,6 +2090,8 @@ class SelectOrUpdateRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SelectOrUpdateRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest"; @@ -2402,9 +2099,6 @@ class SelectOrUpdateRequest final : protected: explicit SelectOrUpdateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2452,7 +2146,7 @@ class SelectOrUpdateRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -2470,7 +2164,7 @@ class SelectOrUpdateRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -2501,7 +2195,7 @@ class SelectDistinctRequest final : public: inline SelectDistinctRequest() : SelectDistinctRequest(nullptr) {} ~SelectDistinctRequest() override; - explicit constexpr SelectDistinctRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SelectDistinctRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SelectDistinctRequest(const SelectDistinctRequest& from); SelectDistinctRequest(SelectDistinctRequest&& from) noexcept @@ -2544,14 +2238,19 @@ class SelectDistinctRequest final : &_SelectDistinctRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 10; friend void swap(SelectDistinctRequest& a, SelectDistinctRequest& b) { a.Swap(&b); } inline void Swap(SelectDistinctRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2565,11 +2264,7 @@ class SelectDistinctRequest final : // implements Message ---------------------------------------------- - inline SelectDistinctRequest* New() const final { - return new SelectDistinctRequest(); - } - - SelectDistinctRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SelectDistinctRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2584,8 +2279,8 @@ class SelectDistinctRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2593,6 +2288,8 @@ class SelectDistinctRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SelectDistinctRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SelectDistinctRequest"; @@ -2600,9 +2297,6 @@ class SelectDistinctRequest final : protected: explicit SelectDistinctRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2650,7 +2344,7 @@ class SelectDistinctRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -2668,7 +2362,7 @@ class SelectDistinctRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -2699,7 +2393,7 @@ class DropColumnsRequest final : public: inline DropColumnsRequest() : DropColumnsRequest(nullptr) {} ~DropColumnsRequest() override; - explicit constexpr DropColumnsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DropColumnsRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DropColumnsRequest(const DropColumnsRequest& from); DropColumnsRequest(DropColumnsRequest&& from) noexcept @@ -2742,14 +2436,19 @@ class DropColumnsRequest final : &_DropColumnsRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 11; friend void swap(DropColumnsRequest& a, DropColumnsRequest& b) { a.Swap(&b); } inline void Swap(DropColumnsRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2763,11 +2462,7 @@ class DropColumnsRequest final : // implements Message ---------------------------------------------- - inline DropColumnsRequest* New() const final { - return new DropColumnsRequest(); - } - - DropColumnsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + DropColumnsRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2782,8 +2477,8 @@ class DropColumnsRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2791,6 +2486,8 @@ class DropColumnsRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DropColumnsRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.DropColumnsRequest"; @@ -2798,9 +2495,6 @@ class DropColumnsRequest final : protected: explicit DropColumnsRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2848,7 +2542,7 @@ class DropColumnsRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -2866,7 +2560,7 @@ class DropColumnsRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -2897,7 +2591,7 @@ class UnstructuredFilterTableRequest final : public: inline UnstructuredFilterTableRequest() : UnstructuredFilterTableRequest(nullptr) {} ~UnstructuredFilterTableRequest() override; - explicit constexpr UnstructuredFilterTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UnstructuredFilterTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UnstructuredFilterTableRequest(const UnstructuredFilterTableRequest& from); UnstructuredFilterTableRequest(UnstructuredFilterTableRequest&& from) noexcept @@ -2940,14 +2634,19 @@ class UnstructuredFilterTableRequest final : &_UnstructuredFilterTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 12; friend void swap(UnstructuredFilterTableRequest& a, UnstructuredFilterTableRequest& b) { a.Swap(&b); } inline void Swap(UnstructuredFilterTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2961,11 +2660,7 @@ class UnstructuredFilterTableRequest final : // implements Message ---------------------------------------------- - inline UnstructuredFilterTableRequest* New() const final { - return new UnstructuredFilterTableRequest(); - } - - UnstructuredFilterTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + UnstructuredFilterTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -2980,8 +2675,8 @@ class UnstructuredFilterTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -2989,6 +2684,8 @@ class UnstructuredFilterTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UnstructuredFilterTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest"; @@ -2996,9 +2693,6 @@ class UnstructuredFilterTableRequest final : protected: explicit UnstructuredFilterTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3046,7 +2740,7 @@ class UnstructuredFilterTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -3064,7 +2758,7 @@ class UnstructuredFilterTableRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -3095,7 +2789,7 @@ class HeadOrTailRequest final : public: inline HeadOrTailRequest() : HeadOrTailRequest(nullptr) {} ~HeadOrTailRequest() override; - explicit constexpr HeadOrTailRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR HeadOrTailRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); HeadOrTailRequest(const HeadOrTailRequest& from); HeadOrTailRequest(HeadOrTailRequest&& from) noexcept @@ -3138,14 +2832,19 @@ class HeadOrTailRequest final : &_HeadOrTailRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 13; friend void swap(HeadOrTailRequest& a, HeadOrTailRequest& b) { a.Swap(&b); } inline void Swap(HeadOrTailRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3159,11 +2858,7 @@ class HeadOrTailRequest final : // implements Message ---------------------------------------------- - inline HeadOrTailRequest* New() const final { - return new HeadOrTailRequest(); - } - - HeadOrTailRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + HeadOrTailRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3178,8 +2873,8 @@ class HeadOrTailRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3187,6 +2882,8 @@ class HeadOrTailRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(HeadOrTailRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.HeadOrTailRequest"; @@ -3194,9 +2891,6 @@ class HeadOrTailRequest final : protected: explicit HeadOrTailRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3220,7 +2914,7 @@ class HeadOrTailRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -3238,7 +2932,7 @@ class HeadOrTailRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -3251,11 +2945,11 @@ class HeadOrTailRequest final : // sint64 num_rows = 3 [jstype = JS_STRING]; void clear_num_rows(); - ::PROTOBUF_NAMESPACE_ID::int64 num_rows() const; - void set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t num_rows() const; + void set_num_rows(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_num_rows() const; - void _internal_set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_num_rows() const; + void _internal_set_num_rows(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) @@ -3267,7 +2961,7 @@ class HeadOrTailRequest final : typedef void DestructorSkippable_; ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; ::io::deephaven::proto::backplane::grpc::TableReference* source_id_; - ::PROTOBUF_NAMESPACE_ID::int64 num_rows_; + int64_t num_rows_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -3278,7 +2972,7 @@ class HeadOrTailByRequest final : public: inline HeadOrTailByRequest() : HeadOrTailByRequest(nullptr) {} ~HeadOrTailByRequest() override; - explicit constexpr HeadOrTailByRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR HeadOrTailByRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); HeadOrTailByRequest(const HeadOrTailByRequest& from); HeadOrTailByRequest(HeadOrTailByRequest&& from) noexcept @@ -3321,14 +3015,19 @@ class HeadOrTailByRequest final : &_HeadOrTailByRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 14; friend void swap(HeadOrTailByRequest& a, HeadOrTailByRequest& b) { a.Swap(&b); } inline void Swap(HeadOrTailByRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3342,11 +3041,7 @@ class HeadOrTailByRequest final : // implements Message ---------------------------------------------- - inline HeadOrTailByRequest* New() const final { - return new HeadOrTailByRequest(); - } - - HeadOrTailByRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + HeadOrTailByRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3361,8 +3056,8 @@ class HeadOrTailByRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3370,6 +3065,8 @@ class HeadOrTailByRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(HeadOrTailByRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.HeadOrTailByRequest"; @@ -3377,9 +3074,6 @@ class HeadOrTailByRequest final : protected: explicit HeadOrTailByRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3428,7 +3122,7 @@ class HeadOrTailByRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -3446,7 +3140,7 @@ class HeadOrTailByRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -3459,11 +3153,11 @@ class HeadOrTailByRequest final : // sint64 num_rows = 3 [jstype = JS_STRING]; void clear_num_rows(); - ::PROTOBUF_NAMESPACE_ID::int64 num_rows() const; - void set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t num_rows() const; + void set_num_rows(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_num_rows() const; - void _internal_set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_num_rows() const; + void _internal_set_num_rows(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) @@ -3476,7 +3170,7 @@ class HeadOrTailByRequest final : ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField group_by_column_specs_; ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; ::io::deephaven::proto::backplane::grpc::TableReference* source_id_; - ::PROTOBUF_NAMESPACE_ID::int64 num_rows_; + int64_t num_rows_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -3487,7 +3181,7 @@ class UngroupRequest final : public: inline UngroupRequest() : UngroupRequest(nullptr) {} ~UngroupRequest() override; - explicit constexpr UngroupRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UngroupRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UngroupRequest(const UngroupRequest& from); UngroupRequest(UngroupRequest&& from) noexcept @@ -3530,14 +3224,19 @@ class UngroupRequest final : &_UngroupRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 15; friend void swap(UngroupRequest& a, UngroupRequest& b) { a.Swap(&b); } inline void Swap(UngroupRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3551,11 +3250,7 @@ class UngroupRequest final : // implements Message ---------------------------------------------- - inline UngroupRequest* New() const final { - return new UngroupRequest(); - } - - UngroupRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + UngroupRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3570,8 +3265,8 @@ class UngroupRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3579,6 +3274,8 @@ class UngroupRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UngroupRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.UngroupRequest"; @@ -3586,9 +3283,6 @@ class UngroupRequest final : protected: explicit UngroupRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3637,7 +3331,7 @@ class UngroupRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -3655,7 +3349,7 @@ class UngroupRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -3696,7 +3390,7 @@ class MergeTablesRequest final : public: inline MergeTablesRequest() : MergeTablesRequest(nullptr) {} ~MergeTablesRequest() override; - explicit constexpr MergeTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR MergeTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); MergeTablesRequest(const MergeTablesRequest& from); MergeTablesRequest(MergeTablesRequest&& from) noexcept @@ -3739,14 +3433,19 @@ class MergeTablesRequest final : &_MergeTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 16; friend void swap(MergeTablesRequest& a, MergeTablesRequest& b) { a.Swap(&b); } inline void Swap(MergeTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3760,11 +3459,7 @@ class MergeTablesRequest final : // implements Message ---------------------------------------------- - inline MergeTablesRequest* New() const final { - return new MergeTablesRequest(); - } - - MergeTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + MergeTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3779,8 +3474,8 @@ class MergeTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3788,6 +3483,8 @@ class MergeTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MergeTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.MergeTablesRequest"; @@ -3795,9 +3492,6 @@ class MergeTablesRequest final : protected: explicit MergeTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3838,7 +3532,7 @@ class MergeTablesRequest final : template void set_key_column(ArgT0&& arg0, ArgT... args); std::string* mutable_key_column(); - PROTOBUF_MUST_USE_RESULT std::string* release_key_column(); + PROTOBUF_NODISCARD std::string* release_key_column(); void set_allocated_key_column(std::string* key_column); private: const std::string& _internal_key_column() const; @@ -3853,7 +3547,7 @@ class MergeTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -3884,7 +3578,7 @@ class SnapshotTableRequest final : public: inline SnapshotTableRequest() : SnapshotTableRequest(nullptr) {} ~SnapshotTableRequest() override; - explicit constexpr SnapshotTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SnapshotTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SnapshotTableRequest(const SnapshotTableRequest& from); SnapshotTableRequest(SnapshotTableRequest&& from) noexcept @@ -3927,14 +3621,19 @@ class SnapshotTableRequest final : &_SnapshotTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 17; friend void swap(SnapshotTableRequest& a, SnapshotTableRequest& b) { a.Swap(&b); } inline void Swap(SnapshotTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -3948,11 +3647,7 @@ class SnapshotTableRequest final : // implements Message ---------------------------------------------- - inline SnapshotTableRequest* New() const final { - return new SnapshotTableRequest(); - } - - SnapshotTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SnapshotTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -3967,8 +3662,8 @@ class SnapshotTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -3976,6 +3671,8 @@ class SnapshotTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SnapshotTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SnapshotTableRequest"; @@ -3983,9 +3680,6 @@ class SnapshotTableRequest final : protected: explicit SnapshotTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4035,7 +3729,7 @@ class SnapshotTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -4053,7 +3747,7 @@ class SnapshotTableRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -4071,7 +3765,7 @@ class SnapshotTableRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -4113,7 +3807,7 @@ class CrossJoinTablesRequest final : public: inline CrossJoinTablesRequest() : CrossJoinTablesRequest(nullptr) {} ~CrossJoinTablesRequest() override; - explicit constexpr CrossJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CrossJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CrossJoinTablesRequest(const CrossJoinTablesRequest& from); CrossJoinTablesRequest(CrossJoinTablesRequest&& from) noexcept @@ -4156,14 +3850,19 @@ class CrossJoinTablesRequest final : &_CrossJoinTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 18; friend void swap(CrossJoinTablesRequest& a, CrossJoinTablesRequest& b) { a.Swap(&b); } inline void Swap(CrossJoinTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4177,11 +3876,7 @@ class CrossJoinTablesRequest final : // implements Message ---------------------------------------------- - inline CrossJoinTablesRequest* New() const final { - return new CrossJoinTablesRequest(); - } - - CrossJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CrossJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4196,8 +3891,8 @@ class CrossJoinTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4205,6 +3900,8 @@ class CrossJoinTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CrossJoinTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest"; @@ -4212,9 +3909,6 @@ class CrossJoinTablesRequest final : protected: explicit CrossJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4289,7 +3983,7 @@ class CrossJoinTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -4307,7 +4001,7 @@ class CrossJoinTablesRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -4325,7 +4019,7 @@ class CrossJoinTablesRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -4338,11 +4032,11 @@ class CrossJoinTablesRequest final : // int32 reserve_bits = 6; void clear_reserve_bits(); - ::PROTOBUF_NAMESPACE_ID::int32 reserve_bits() const; - void set_reserve_bits(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t reserve_bits() const; + void set_reserve_bits(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_reserve_bits() const; - void _internal_set_reserve_bits(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_reserve_bits() const; + void _internal_set_reserve_bits(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) @@ -4357,7 +4051,7 @@ class CrossJoinTablesRequest final : ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; ::io::deephaven::proto::backplane::grpc::TableReference* left_id_; ::io::deephaven::proto::backplane::grpc::TableReference* right_id_; - ::PROTOBUF_NAMESPACE_ID::int32 reserve_bits_; + int32_t reserve_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -4368,7 +4062,7 @@ class NaturalJoinTablesRequest final : public: inline NaturalJoinTablesRequest() : NaturalJoinTablesRequest(nullptr) {} ~NaturalJoinTablesRequest() override; - explicit constexpr NaturalJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR NaturalJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); NaturalJoinTablesRequest(const NaturalJoinTablesRequest& from); NaturalJoinTablesRequest(NaturalJoinTablesRequest&& from) noexcept @@ -4411,14 +4105,19 @@ class NaturalJoinTablesRequest final : &_NaturalJoinTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 19; friend void swap(NaturalJoinTablesRequest& a, NaturalJoinTablesRequest& b) { a.Swap(&b); } inline void Swap(NaturalJoinTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4432,11 +4131,7 @@ class NaturalJoinTablesRequest final : // implements Message ---------------------------------------------- - inline NaturalJoinTablesRequest* New() const final { - return new NaturalJoinTablesRequest(); - } - - NaturalJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + NaturalJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4451,8 +4146,8 @@ class NaturalJoinTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4460,6 +4155,8 @@ class NaturalJoinTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(NaturalJoinTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest"; @@ -4467,9 +4164,6 @@ class NaturalJoinTablesRequest final : protected: explicit NaturalJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4543,7 +4237,7 @@ class NaturalJoinTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -4561,7 +4255,7 @@ class NaturalJoinTablesRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -4579,7 +4273,7 @@ class NaturalJoinTablesRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -4612,7 +4306,7 @@ class ExactJoinTablesRequest final : public: inline ExactJoinTablesRequest() : ExactJoinTablesRequest(nullptr) {} ~ExactJoinTablesRequest() override; - explicit constexpr ExactJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExactJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExactJoinTablesRequest(const ExactJoinTablesRequest& from); ExactJoinTablesRequest(ExactJoinTablesRequest&& from) noexcept @@ -4655,14 +4349,19 @@ class ExactJoinTablesRequest final : &_ExactJoinTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 20; friend void swap(ExactJoinTablesRequest& a, ExactJoinTablesRequest& b) { a.Swap(&b); } inline void Swap(ExactJoinTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4676,11 +4375,7 @@ class ExactJoinTablesRequest final : // implements Message ---------------------------------------------- - inline ExactJoinTablesRequest* New() const final { - return new ExactJoinTablesRequest(); - } - - ExactJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ExactJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4695,8 +4390,8 @@ class ExactJoinTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4704,6 +4399,8 @@ class ExactJoinTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExactJoinTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest"; @@ -4711,9 +4408,6 @@ class ExactJoinTablesRequest final : protected: explicit ExactJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4787,7 +4481,7 @@ class ExactJoinTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -4805,7 +4499,7 @@ class ExactJoinTablesRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -4823,7 +4517,7 @@ class ExactJoinTablesRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -4856,7 +4550,7 @@ class LeftJoinTablesRequest final : public: inline LeftJoinTablesRequest() : LeftJoinTablesRequest(nullptr) {} ~LeftJoinTablesRequest() override; - explicit constexpr LeftJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR LeftJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); LeftJoinTablesRequest(const LeftJoinTablesRequest& from); LeftJoinTablesRequest(LeftJoinTablesRequest&& from) noexcept @@ -4899,14 +4593,19 @@ class LeftJoinTablesRequest final : &_LeftJoinTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 23; + 21; friend void swap(LeftJoinTablesRequest& a, LeftJoinTablesRequest& b) { a.Swap(&b); } inline void Swap(LeftJoinTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -4920,11 +4619,7 @@ class LeftJoinTablesRequest final : // implements Message ---------------------------------------------- - inline LeftJoinTablesRequest* New() const final { - return new LeftJoinTablesRequest(); - } - - LeftJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + LeftJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -4939,8 +4634,8 @@ class LeftJoinTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -4948,6 +4643,8 @@ class LeftJoinTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(LeftJoinTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest"; @@ -4955,9 +4652,6 @@ class LeftJoinTablesRequest final : protected: explicit LeftJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5031,7 +4725,7 @@ class LeftJoinTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -5049,7 +4743,7 @@ class LeftJoinTablesRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -5067,7 +4761,7 @@ class LeftJoinTablesRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -5100,7 +4794,7 @@ class AsOfJoinTablesRequest final : public: inline AsOfJoinTablesRequest() : AsOfJoinTablesRequest(nullptr) {} ~AsOfJoinTablesRequest() override; - explicit constexpr AsOfJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AsOfJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AsOfJoinTablesRequest(const AsOfJoinTablesRequest& from); AsOfJoinTablesRequest(AsOfJoinTablesRequest&& from) noexcept @@ -5143,14 +4837,19 @@ class AsOfJoinTablesRequest final : &_AsOfJoinTablesRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 24; + 22; friend void swap(AsOfJoinTablesRequest& a, AsOfJoinTablesRequest& b) { a.Swap(&b); } inline void Swap(AsOfJoinTablesRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5164,11 +4863,7 @@ class AsOfJoinTablesRequest final : // implements Message ---------------------------------------------- - inline AsOfJoinTablesRequest* New() const final { - return new AsOfJoinTablesRequest(); - } - - AsOfJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AsOfJoinTablesRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5183,8 +4878,8 @@ class AsOfJoinTablesRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5192,6 +4887,8 @@ class AsOfJoinTablesRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(AsOfJoinTablesRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest"; @@ -5199,9 +4896,6 @@ class AsOfJoinTablesRequest final : protected: explicit AsOfJoinTablesRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5310,7 +5004,7 @@ class AsOfJoinTablesRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -5328,7 +5022,7 @@ class AsOfJoinTablesRequest final : public: void clear_left_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& left_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_left_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_left_id(); void set_allocated_left_id(::io::deephaven::proto::backplane::grpc::TableReference* left_id); private: @@ -5346,7 +5040,7 @@ class AsOfJoinTablesRequest final : public: void clear_right_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& right_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_right_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_right_id(); void set_allocated_right_id(::io::deephaven::proto::backplane::grpc::TableReference* right_id); private: @@ -5389,7 +5083,7 @@ class ComboAggregateRequest_Aggregate final : public: inline ComboAggregateRequest_Aggregate() : ComboAggregateRequest_Aggregate(nullptr) {} ~ComboAggregateRequest_Aggregate() override; - explicit constexpr ComboAggregateRequest_Aggregate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ComboAggregateRequest_Aggregate(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ComboAggregateRequest_Aggregate(const ComboAggregateRequest_Aggregate& from); ComboAggregateRequest_Aggregate(ComboAggregateRequest_Aggregate&& from) noexcept @@ -5432,14 +5126,19 @@ class ComboAggregateRequest_Aggregate final : &_ComboAggregateRequest_Aggregate_default_instance_); } static constexpr int kIndexInFileMessages = - 25; + 23; friend void swap(ComboAggregateRequest_Aggregate& a, ComboAggregateRequest_Aggregate& b) { a.Swap(&b); } inline void Swap(ComboAggregateRequest_Aggregate* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5453,11 +5152,7 @@ class ComboAggregateRequest_Aggregate final : // implements Message ---------------------------------------------- - inline ComboAggregateRequest_Aggregate* New() const final { - return new ComboAggregateRequest_Aggregate(); - } - - ComboAggregateRequest_Aggregate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ComboAggregateRequest_Aggregate* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5472,8 +5167,8 @@ class ComboAggregateRequest_Aggregate final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5481,6 +5176,8 @@ class ComboAggregateRequest_Aggregate final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ComboAggregateRequest_Aggregate* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate"; @@ -5488,9 +5185,6 @@ class ComboAggregateRequest_Aggregate final : protected: explicit ComboAggregateRequest_Aggregate(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5539,7 +5233,7 @@ class ComboAggregateRequest_Aggregate final : template void set_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_name(); + PROTOBUF_NODISCARD std::string* release_column_name(); void set_allocated_column_name(std::string* column_name); private: const std::string& _internal_column_name() const; @@ -5596,7 +5290,7 @@ class ComboAggregateRequest final : public: inline ComboAggregateRequest() : ComboAggregateRequest(nullptr) {} ~ComboAggregateRequest() override; - explicit constexpr ComboAggregateRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ComboAggregateRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ComboAggregateRequest(const ComboAggregateRequest& from); ComboAggregateRequest(ComboAggregateRequest&& from) noexcept @@ -5639,14 +5333,19 @@ class ComboAggregateRequest final : &_ComboAggregateRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 26; + 24; friend void swap(ComboAggregateRequest& a, ComboAggregateRequest& b) { a.Swap(&b); } inline void Swap(ComboAggregateRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5660,11 +5359,7 @@ class ComboAggregateRequest final : // implements Message ---------------------------------------------- - inline ComboAggregateRequest* New() const final { - return new ComboAggregateRequest(); - } - - ComboAggregateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ComboAggregateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5679,8 +5374,8 @@ class ComboAggregateRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5688,6 +5383,8 @@ class ComboAggregateRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ComboAggregateRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ComboAggregateRequest"; @@ -5695,9 +5392,6 @@ class ComboAggregateRequest final : protected: explicit ComboAggregateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5821,7 +5515,7 @@ class ComboAggregateRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -5839,7 +5533,7 @@ class ComboAggregateRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -5881,7 +5575,7 @@ class SortDescriptor final : public: inline SortDescriptor() : SortDescriptor(nullptr) {} ~SortDescriptor() override; - explicit constexpr SortDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SortDescriptor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SortDescriptor(const SortDescriptor& from); SortDescriptor(SortDescriptor&& from) noexcept @@ -5924,14 +5618,19 @@ class SortDescriptor final : &_SortDescriptor_default_instance_); } static constexpr int kIndexInFileMessages = - 27; + 25; friend void swap(SortDescriptor& a, SortDescriptor& b) { a.Swap(&b); } inline void Swap(SortDescriptor* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -5945,11 +5644,7 @@ class SortDescriptor final : // implements Message ---------------------------------------------- - inline SortDescriptor* New() const final { - return new SortDescriptor(); - } - - SortDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SortDescriptor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -5964,8 +5659,8 @@ class SortDescriptor final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -5973,6 +5668,8 @@ class SortDescriptor final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SortDescriptor* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SortDescriptor"; @@ -5980,9 +5677,6 @@ class SortDescriptor final : protected: explicit SortDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6039,7 +5733,7 @@ class SortDescriptor final : template void set_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_name(); + PROTOBUF_NODISCARD std::string* release_column_name(); void set_allocated_column_name(std::string* column_name); private: const std::string& _internal_column_name() const; @@ -6085,7 +5779,7 @@ class SortTableRequest final : public: inline SortTableRequest() : SortTableRequest(nullptr) {} ~SortTableRequest() override; - explicit constexpr SortTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SortTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SortTableRequest(const SortTableRequest& from); SortTableRequest(SortTableRequest&& from) noexcept @@ -6128,14 +5822,19 @@ class SortTableRequest final : &_SortTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 28; + 26; friend void swap(SortTableRequest& a, SortTableRequest& b) { a.Swap(&b); } inline void Swap(SortTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6149,11 +5848,7 @@ class SortTableRequest final : // implements Message ---------------------------------------------- - inline SortTableRequest* New() const final { - return new SortTableRequest(); - } - - SortTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SortTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6168,8 +5863,8 @@ class SortTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6177,6 +5872,8 @@ class SortTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SortTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SortTableRequest"; @@ -6184,9 +5881,6 @@ class SortTableRequest final : protected: explicit SortTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6228,7 +5922,7 @@ class SortTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -6246,7 +5940,7 @@ class SortTableRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -6277,7 +5971,7 @@ class FilterTableRequest final : public: inline FilterTableRequest() : FilterTableRequest(nullptr) {} ~FilterTableRequest() override; - explicit constexpr FilterTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FilterTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FilterTableRequest(const FilterTableRequest& from); FilterTableRequest(FilterTableRequest&& from) noexcept @@ -6320,14 +6014,19 @@ class FilterTableRequest final : &_FilterTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 29; + 27; friend void swap(FilterTableRequest& a, FilterTableRequest& b) { a.Swap(&b); } inline void Swap(FilterTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6341,11 +6040,7 @@ class FilterTableRequest final : // implements Message ---------------------------------------------- - inline FilterTableRequest* New() const final { - return new FilterTableRequest(); - } - - FilterTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FilterTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6360,8 +6055,8 @@ class FilterTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6369,6 +6064,8 @@ class FilterTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FilterTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FilterTableRequest"; @@ -6376,9 +6073,6 @@ class FilterTableRequest final : protected: explicit FilterTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6420,7 +6114,7 @@ class FilterTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -6438,7 +6132,7 @@ class FilterTableRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -6469,7 +6163,7 @@ class Reference final : public: inline Reference() : Reference(nullptr) {} ~Reference() override; - explicit constexpr Reference(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Reference(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Reference(const Reference& from); Reference(Reference&& from) noexcept @@ -6512,14 +6206,19 @@ class Reference final : &_Reference_default_instance_); } static constexpr int kIndexInFileMessages = - 30; + 28; friend void swap(Reference& a, Reference& b) { a.Swap(&b); } inline void Swap(Reference* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6533,11 +6232,7 @@ class Reference final : // implements Message ---------------------------------------------- - inline Reference* New() const final { - return new Reference(); - } - - Reference* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Reference* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6552,8 +6247,8 @@ class Reference final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6561,6 +6256,8 @@ class Reference final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Reference* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.Reference"; @@ -6568,9 +6265,6 @@ class Reference final : protected: explicit Reference(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6591,7 +6285,7 @@ class Reference final : template void set_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_column_name(); + PROTOBUF_NODISCARD std::string* release_column_name(); void set_allocated_column_name(std::string* column_name); private: const std::string& _internal_column_name() const; @@ -6617,7 +6311,7 @@ class Literal final : public: inline Literal() : Literal(nullptr) {} ~Literal() override; - explicit constexpr Literal(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Literal(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Literal(const Literal& from); Literal(Literal&& from) noexcept @@ -6669,14 +6363,19 @@ class Literal final : &_Literal_default_instance_); } static constexpr int kIndexInFileMessages = - 31; + 29; friend void swap(Literal& a, Literal& b) { a.Swap(&b); } inline void Swap(Literal* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6690,11 +6389,7 @@ class Literal final : // implements Message ---------------------------------------------- - inline Literal* New() const final { - return new Literal(); - } - - Literal* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Literal* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6709,8 +6404,8 @@ class Literal final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6718,6 +6413,8 @@ class Literal final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Literal* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.Literal"; @@ -6725,9 +6422,6 @@ class Literal final : protected: explicit Literal(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6756,7 +6450,7 @@ class Literal final : template void set_string_value(ArgT0&& arg0, ArgT... args); std::string* mutable_string_value(); - PROTOBUF_MUST_USE_RESULT std::string* release_string_value(); + PROTOBUF_NODISCARD std::string* release_string_value(); void set_allocated_string_value(std::string* string_value); private: const std::string& _internal_string_value() const; @@ -6796,11 +6490,11 @@ class Literal final : bool _internal_has_long_value() const; public: void clear_long_value(); - ::PROTOBUF_NAMESPACE_ID::int64 long_value() const; - void set_long_value(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t long_value() const; + void set_long_value(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_long_value() const; - void _internal_set_long_value(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_long_value() const; + void _internal_set_long_value(int64_t value); public: // sint64 nano_time_value = 5 [jstype = JS_STRING]; @@ -6809,11 +6503,11 @@ class Literal final : bool _internal_has_nano_time_value() const; public: void clear_nano_time_value(); - ::PROTOBUF_NAMESPACE_ID::int64 nano_time_value() const; - void set_nano_time_value(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t nano_time_value() const; + void set_nano_time_value(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_nano_time_value() const; - void _internal_set_nano_time_value(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_nano_time_value() const; + void _internal_set_nano_time_value(int64_t value); public: void clear_value(); @@ -6839,11 +6533,11 @@ class Literal final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_; double double_value_; bool bool_value_; - ::PROTOBUF_NAMESPACE_ID::int64 long_value_; - ::PROTOBUF_NAMESPACE_ID::int64 nano_time_value_; + int64_t long_value_; + int64_t nano_time_value_; } value_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -6854,7 +6548,7 @@ class Value final : public: inline Value() : Value(nullptr) {} ~Value() override; - explicit constexpr Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Value(const Value& from); Value(Value&& from) noexcept @@ -6903,14 +6597,19 @@ class Value final : &_Value_default_instance_); } static constexpr int kIndexInFileMessages = - 32; + 30; friend void swap(Value& a, Value& b) { a.Swap(&b); } inline void Swap(Value* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -6924,11 +6623,7 @@ class Value final : // implements Message ---------------------------------------------- - inline Value* New() const final { - return new Value(); - } - - Value* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Value* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -6943,8 +6638,8 @@ class Value final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -6952,6 +6647,8 @@ class Value final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Value* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.Value"; @@ -6959,9 +6656,6 @@ class Value final : protected: explicit Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6984,7 +6678,7 @@ class Value final : public: void clear_reference(); const ::io::deephaven::proto::backplane::grpc::Reference& reference() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); ::io::deephaven::proto::backplane::grpc::Reference* mutable_reference(); void set_allocated_reference(::io::deephaven::proto::backplane::grpc::Reference* reference); private: @@ -7002,7 +6696,7 @@ class Value final : public: void clear_literal(); const ::io::deephaven::proto::backplane::grpc::Literal& literal() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Literal* release_literal(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Literal* release_literal(); ::io::deephaven::proto::backplane::grpc::Literal* mutable_literal(); void set_allocated_literal(::io::deephaven::proto::backplane::grpc::Literal* literal); private: @@ -7034,7 +6728,7 @@ class Value final : ::io::deephaven::proto::backplane::grpc::Literal* literal_; } data_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -7045,7 +6739,7 @@ class Condition final : public: inline Condition() : Condition(nullptr) {} ~Condition() override; - explicit constexpr Condition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Condition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Condition(const Condition& from); Condition(Condition&& from) noexcept @@ -7102,14 +6796,19 @@ class Condition final : &_Condition_default_instance_); } static constexpr int kIndexInFileMessages = - 33; + 31; friend void swap(Condition& a, Condition& b) { a.Swap(&b); } inline void Swap(Condition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7123,11 +6822,7 @@ class Condition final : // implements Message ---------------------------------------------- - inline Condition* New() const final { - return new Condition(); - } - - Condition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Condition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7142,8 +6837,8 @@ class Condition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7151,6 +6846,8 @@ class Condition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Condition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.Condition"; @@ -7158,9 +6855,6 @@ class Condition final : protected: explicit Condition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7191,7 +6885,7 @@ class Condition final : public: void clear_and_(); const ::io::deephaven::proto::backplane::grpc::AndCondition& and_() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::AndCondition* release_and_(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::AndCondition* release_and_(); ::io::deephaven::proto::backplane::grpc::AndCondition* mutable_and_(); void set_allocated_and_(::io::deephaven::proto::backplane::grpc::AndCondition* and_); private: @@ -7209,7 +6903,7 @@ class Condition final : public: void clear_or_(); const ::io::deephaven::proto::backplane::grpc::OrCondition& or_() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::OrCondition* release_or_(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::OrCondition* release_or_(); ::io::deephaven::proto::backplane::grpc::OrCondition* mutable_or_(); void set_allocated_or_(::io::deephaven::proto::backplane::grpc::OrCondition* or_); private: @@ -7227,7 +6921,7 @@ class Condition final : public: void clear_not_(); const ::io::deephaven::proto::backplane::grpc::NotCondition& not_() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::NotCondition* release_not_(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::NotCondition* release_not_(); ::io::deephaven::proto::backplane::grpc::NotCondition* mutable_not_(); void set_allocated_not_(::io::deephaven::proto::backplane::grpc::NotCondition* not_); private: @@ -7245,7 +6939,7 @@ class Condition final : public: void clear_compare(); const ::io::deephaven::proto::backplane::grpc::CompareCondition& compare() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CompareCondition* release_compare(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CompareCondition* release_compare(); ::io::deephaven::proto::backplane::grpc::CompareCondition* mutable_compare(); void set_allocated_compare(::io::deephaven::proto::backplane::grpc::CompareCondition* compare); private: @@ -7263,7 +6957,7 @@ class Condition final : public: void clear_in(); const ::io::deephaven::proto::backplane::grpc::InCondition& in() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::InCondition* release_in(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::InCondition* release_in(); ::io::deephaven::proto::backplane::grpc::InCondition* mutable_in(); void set_allocated_in(::io::deephaven::proto::backplane::grpc::InCondition* in); private: @@ -7281,7 +6975,7 @@ class Condition final : public: void clear_invoke(); const ::io::deephaven::proto::backplane::grpc::InvokeCondition& invoke() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::InvokeCondition* release_invoke(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::InvokeCondition* release_invoke(); ::io::deephaven::proto::backplane::grpc::InvokeCondition* mutable_invoke(); void set_allocated_invoke(::io::deephaven::proto::backplane::grpc::InvokeCondition* invoke); private: @@ -7299,7 +6993,7 @@ class Condition final : public: void clear_is_null(); const ::io::deephaven::proto::backplane::grpc::IsNullCondition& is_null() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::IsNullCondition* release_is_null(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::IsNullCondition* release_is_null(); ::io::deephaven::proto::backplane::grpc::IsNullCondition* mutable_is_null(); void set_allocated_is_null(::io::deephaven::proto::backplane::grpc::IsNullCondition* is_null); private: @@ -7317,7 +7011,7 @@ class Condition final : public: void clear_matches(); const ::io::deephaven::proto::backplane::grpc::MatchesCondition& matches() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::MatchesCondition* release_matches(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::MatchesCondition* release_matches(); ::io::deephaven::proto::backplane::grpc::MatchesCondition* mutable_matches(); void set_allocated_matches(::io::deephaven::proto::backplane::grpc::MatchesCondition* matches); private: @@ -7335,7 +7029,7 @@ class Condition final : public: void clear_contains(); const ::io::deephaven::proto::backplane::grpc::ContainsCondition& contains() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::ContainsCondition* release_contains(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::ContainsCondition* release_contains(); ::io::deephaven::proto::backplane::grpc::ContainsCondition* mutable_contains(); void set_allocated_contains(::io::deephaven::proto::backplane::grpc::ContainsCondition* contains); private: @@ -7353,7 +7047,7 @@ class Condition final : public: void clear_search(); const ::io::deephaven::proto::backplane::grpc::SearchCondition& search() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SearchCondition* release_search(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SearchCondition* release_search(); ::io::deephaven::proto::backplane::grpc::SearchCondition* mutable_search(); void set_allocated_search(::io::deephaven::proto::backplane::grpc::SearchCondition* search); private: @@ -7401,7 +7095,7 @@ class Condition final : ::io::deephaven::proto::backplane::grpc::SearchCondition* search_; } data_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -7412,7 +7106,7 @@ class AndCondition final : public: inline AndCondition() : AndCondition(nullptr) {} ~AndCondition() override; - explicit constexpr AndCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR AndCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); AndCondition(const AndCondition& from); AndCondition(AndCondition&& from) noexcept @@ -7455,14 +7149,19 @@ class AndCondition final : &_AndCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 34; + 32; friend void swap(AndCondition& a, AndCondition& b) { a.Swap(&b); } inline void Swap(AndCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7476,11 +7175,7 @@ class AndCondition final : // implements Message ---------------------------------------------- - inline AndCondition* New() const final { - return new AndCondition(); - } - - AndCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + AndCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7495,8 +7190,8 @@ class AndCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7504,6 +7199,8 @@ class AndCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(AndCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.AndCondition"; @@ -7511,9 +7208,6 @@ class AndCondition final : protected: explicit AndCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7564,7 +7258,7 @@ class OrCondition final : public: inline OrCondition() : OrCondition(nullptr) {} ~OrCondition() override; - explicit constexpr OrCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR OrCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); OrCondition(const OrCondition& from); OrCondition(OrCondition&& from) noexcept @@ -7607,14 +7301,19 @@ class OrCondition final : &_OrCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 35; + 33; friend void swap(OrCondition& a, OrCondition& b) { a.Swap(&b); } inline void Swap(OrCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7628,11 +7327,7 @@ class OrCondition final : // implements Message ---------------------------------------------- - inline OrCondition* New() const final { - return new OrCondition(); - } - - OrCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + OrCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7647,8 +7342,8 @@ class OrCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7656,6 +7351,8 @@ class OrCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(OrCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.OrCondition"; @@ -7663,9 +7360,6 @@ class OrCondition final : protected: explicit OrCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7716,7 +7410,7 @@ class NotCondition final : public: inline NotCondition() : NotCondition(nullptr) {} ~NotCondition() override; - explicit constexpr NotCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR NotCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); NotCondition(const NotCondition& from); NotCondition(NotCondition&& from) noexcept @@ -7759,14 +7453,19 @@ class NotCondition final : &_NotCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 36; + 34; friend void swap(NotCondition& a, NotCondition& b) { a.Swap(&b); } inline void Swap(NotCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7780,11 +7479,7 @@ class NotCondition final : // implements Message ---------------------------------------------- - inline NotCondition* New() const final { - return new NotCondition(); - } - - NotCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + NotCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7799,8 +7494,8 @@ class NotCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7808,6 +7503,8 @@ class NotCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(NotCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.NotCondition"; @@ -7815,9 +7512,6 @@ class NotCondition final : protected: explicit NotCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7839,7 +7533,7 @@ class NotCondition final : public: void clear_filter(); const ::io::deephaven::proto::backplane::grpc::Condition& filter() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Condition* release_filter(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Condition* release_filter(); ::io::deephaven::proto::backplane::grpc::Condition* mutable_filter(); void set_allocated_filter(::io::deephaven::proto::backplane::grpc::Condition* filter); private: @@ -7868,7 +7562,7 @@ class CompareCondition final : public: inline CompareCondition() : CompareCondition(nullptr) {} ~CompareCondition() override; - explicit constexpr CompareCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CompareCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CompareCondition(const CompareCondition& from); CompareCondition(CompareCondition&& from) noexcept @@ -7911,14 +7605,19 @@ class CompareCondition final : &_CompareCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 37; + 35; friend void swap(CompareCondition& a, CompareCondition& b) { a.Swap(&b); } inline void Swap(CompareCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -7932,11 +7631,7 @@ class CompareCondition final : // implements Message ---------------------------------------------- - inline CompareCondition* New() const final { - return new CompareCondition(); - } - - CompareCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CompareCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -7951,8 +7646,8 @@ class CompareCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -7960,6 +7655,8 @@ class CompareCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CompareCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CompareCondition"; @@ -7967,9 +7664,6 @@ class CompareCondition final : protected: explicit CompareCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8032,7 +7726,7 @@ class CompareCondition final : public: void clear_lhs(); const ::io::deephaven::proto::backplane::grpc::Value& lhs() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Value* release_lhs(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Value* release_lhs(); ::io::deephaven::proto::backplane::grpc::Value* mutable_lhs(); void set_allocated_lhs(::io::deephaven::proto::backplane::grpc::Value* lhs); private: @@ -8050,7 +7744,7 @@ class CompareCondition final : public: void clear_rhs(); const ::io::deephaven::proto::backplane::grpc::Value& rhs() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Value* release_rhs(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Value* release_rhs(); ::io::deephaven::proto::backplane::grpc::Value* mutable_rhs(); void set_allocated_rhs(::io::deephaven::proto::backplane::grpc::Value* rhs); private: @@ -8100,7 +7794,7 @@ class InCondition final : public: inline InCondition() : InCondition(nullptr) {} ~InCondition() override; - explicit constexpr InCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR InCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); InCondition(const InCondition& from); InCondition(InCondition&& from) noexcept @@ -8143,14 +7837,19 @@ class InCondition final : &_InCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 38; + 36; friend void swap(InCondition& a, InCondition& b) { a.Swap(&b); } inline void Swap(InCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8164,11 +7863,7 @@ class InCondition final : // implements Message ---------------------------------------------- - inline InCondition* New() const final { - return new InCondition(); - } - - InCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + InCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8183,8 +7878,8 @@ class InCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8192,6 +7887,8 @@ class InCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(InCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.InCondition"; @@ -8199,9 +7896,6 @@ class InCondition final : protected: explicit InCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8244,7 +7938,7 @@ class InCondition final : public: void clear_target(); const ::io::deephaven::proto::backplane::grpc::Value& target() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Value* release_target(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Value* release_target(); ::io::deephaven::proto::backplane::grpc::Value* mutable_target(); void set_allocated_target(::io::deephaven::proto::backplane::grpc::Value* target); private: @@ -8294,7 +7988,7 @@ class InvokeCondition final : public: inline InvokeCondition() : InvokeCondition(nullptr) {} ~InvokeCondition() override; - explicit constexpr InvokeCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR InvokeCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); InvokeCondition(const InvokeCondition& from); InvokeCondition(InvokeCondition&& from) noexcept @@ -8337,14 +8031,19 @@ class InvokeCondition final : &_InvokeCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 39; + 37; friend void swap(InvokeCondition& a, InvokeCondition& b) { a.Swap(&b); } inline void Swap(InvokeCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8358,11 +8057,7 @@ class InvokeCondition final : // implements Message ---------------------------------------------- - inline InvokeCondition* New() const final { - return new InvokeCondition(); - } - - InvokeCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + InvokeCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8377,8 +8072,8 @@ class InvokeCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8386,6 +8081,8 @@ class InvokeCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(InvokeCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.InvokeCondition"; @@ -8393,9 +8090,6 @@ class InvokeCondition final : protected: explicit InvokeCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8436,7 +8130,7 @@ class InvokeCondition final : template void set_method(ArgT0&& arg0, ArgT... args); std::string* mutable_method(); - PROTOBUF_MUST_USE_RESULT std::string* release_method(); + PROTOBUF_NODISCARD std::string* release_method(); void set_allocated_method(std::string* method); private: const std::string& _internal_method() const; @@ -8451,7 +8145,7 @@ class InvokeCondition final : public: void clear_target(); const ::io::deephaven::proto::backplane::grpc::Value& target() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Value* release_target(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Value* release_target(); ::io::deephaven::proto::backplane::grpc::Value* mutable_target(); void set_allocated_target(::io::deephaven::proto::backplane::grpc::Value* target); private: @@ -8482,7 +8176,7 @@ class IsNullCondition final : public: inline IsNullCondition() : IsNullCondition(nullptr) {} ~IsNullCondition() override; - explicit constexpr IsNullCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR IsNullCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); IsNullCondition(const IsNullCondition& from); IsNullCondition(IsNullCondition&& from) noexcept @@ -8525,14 +8219,19 @@ class IsNullCondition final : &_IsNullCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 40; + 38; friend void swap(IsNullCondition& a, IsNullCondition& b) { a.Swap(&b); } inline void Swap(IsNullCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8546,11 +8245,7 @@ class IsNullCondition final : // implements Message ---------------------------------------------- - inline IsNullCondition* New() const final { - return new IsNullCondition(); - } - - IsNullCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + IsNullCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8565,8 +8260,8 @@ class IsNullCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8574,6 +8269,8 @@ class IsNullCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(IsNullCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.IsNullCondition"; @@ -8581,9 +8278,6 @@ class IsNullCondition final : protected: explicit IsNullCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8605,7 +8299,7 @@ class IsNullCondition final : public: void clear_reference(); const ::io::deephaven::proto::backplane::grpc::Reference& reference() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); ::io::deephaven::proto::backplane::grpc::Reference* mutable_reference(); void set_allocated_reference(::io::deephaven::proto::backplane::grpc::Reference* reference); private: @@ -8634,7 +8328,7 @@ class MatchesCondition final : public: inline MatchesCondition() : MatchesCondition(nullptr) {} ~MatchesCondition() override; - explicit constexpr MatchesCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR MatchesCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); MatchesCondition(const MatchesCondition& from); MatchesCondition(MatchesCondition&& from) noexcept @@ -8677,14 +8371,19 @@ class MatchesCondition final : &_MatchesCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 41; + 39; friend void swap(MatchesCondition& a, MatchesCondition& b) { a.Swap(&b); } inline void Swap(MatchesCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8698,11 +8397,7 @@ class MatchesCondition final : // implements Message ---------------------------------------------- - inline MatchesCondition* New() const final { - return new MatchesCondition(); - } - - MatchesCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + MatchesCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8717,8 +8412,8 @@ class MatchesCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8726,6 +8421,8 @@ class MatchesCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MatchesCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.MatchesCondition"; @@ -8733,9 +8430,6 @@ class MatchesCondition final : protected: explicit MatchesCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8759,7 +8453,7 @@ class MatchesCondition final : template void set_regex(ArgT0&& arg0, ArgT... args); std::string* mutable_regex(); - PROTOBUF_MUST_USE_RESULT std::string* release_regex(); + PROTOBUF_NODISCARD std::string* release_regex(); void set_allocated_regex(std::string* regex); private: const std::string& _internal_regex() const; @@ -8774,7 +8468,7 @@ class MatchesCondition final : public: void clear_reference(); const ::io::deephaven::proto::backplane::grpc::Reference& reference() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); ::io::deephaven::proto::backplane::grpc::Reference* mutable_reference(); void set_allocated_reference(::io::deephaven::proto::backplane::grpc::Reference* reference); private: @@ -8824,7 +8518,7 @@ class ContainsCondition final : public: inline ContainsCondition() : ContainsCondition(nullptr) {} ~ContainsCondition() override; - explicit constexpr ContainsCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ContainsCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ContainsCondition(const ContainsCondition& from); ContainsCondition(ContainsCondition&& from) noexcept @@ -8867,14 +8561,19 @@ class ContainsCondition final : &_ContainsCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 42; + 40; friend void swap(ContainsCondition& a, ContainsCondition& b) { a.Swap(&b); } inline void Swap(ContainsCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -8888,11 +8587,7 @@ class ContainsCondition final : // implements Message ---------------------------------------------- - inline ContainsCondition* New() const final { - return new ContainsCondition(); - } - - ContainsCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + ContainsCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -8907,8 +8602,8 @@ class ContainsCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -8916,6 +8611,8 @@ class ContainsCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ContainsCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.ContainsCondition"; @@ -8923,9 +8620,6 @@ class ContainsCondition final : protected: explicit ContainsCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8949,7 +8643,7 @@ class ContainsCondition final : template void set_search_string(ArgT0&& arg0, ArgT... args); std::string* mutable_search_string(); - PROTOBUF_MUST_USE_RESULT std::string* release_search_string(); + PROTOBUF_NODISCARD std::string* release_search_string(); void set_allocated_search_string(std::string* search_string); private: const std::string& _internal_search_string() const; @@ -8964,7 +8658,7 @@ class ContainsCondition final : public: void clear_reference(); const ::io::deephaven::proto::backplane::grpc::Reference& reference() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Reference* release_reference(); ::io::deephaven::proto::backplane::grpc::Reference* mutable_reference(); void set_allocated_reference(::io::deephaven::proto::backplane::grpc::Reference* reference); private: @@ -9014,7 +8708,7 @@ class SearchCondition final : public: inline SearchCondition() : SearchCondition(nullptr) {} ~SearchCondition() override; - explicit constexpr SearchCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SearchCondition(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SearchCondition(const SearchCondition& from); SearchCondition(SearchCondition&& from) noexcept @@ -9057,14 +8751,19 @@ class SearchCondition final : &_SearchCondition_default_instance_); } static constexpr int kIndexInFileMessages = - 43; + 41; friend void swap(SearchCondition& a, SearchCondition& b) { a.Swap(&b); } inline void Swap(SearchCondition* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9078,11 +8777,7 @@ class SearchCondition final : // implements Message ---------------------------------------------- - inline SearchCondition* New() const final { - return new SearchCondition(); - } - - SearchCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + SearchCondition* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9097,8 +8792,8 @@ class SearchCondition final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9106,6 +8801,8 @@ class SearchCondition final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SearchCondition* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.SearchCondition"; @@ -9113,9 +8810,6 @@ class SearchCondition final : protected: explicit SearchCondition(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -9155,7 +8849,7 @@ class SearchCondition final : template void set_search_string(ArgT0&& arg0, ArgT... args); std::string* mutable_search_string(); - PROTOBUF_MUST_USE_RESULT std::string* release_search_string(); + PROTOBUF_NODISCARD std::string* release_search_string(); void set_allocated_search_string(std::string* search_string); private: const std::string& _internal_search_string() const; @@ -9182,7 +8876,7 @@ class FlattenRequest final : public: inline FlattenRequest() : FlattenRequest(nullptr) {} ~FlattenRequest() override; - explicit constexpr FlattenRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FlattenRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FlattenRequest(const FlattenRequest& from); FlattenRequest(FlattenRequest&& from) noexcept @@ -9225,14 +8919,19 @@ class FlattenRequest final : &_FlattenRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 44; + 42; friend void swap(FlattenRequest& a, FlattenRequest& b) { a.Swap(&b); } inline void Swap(FlattenRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9246,11 +8945,7 @@ class FlattenRequest final : // implements Message ---------------------------------------------- - inline FlattenRequest* New() const final { - return new FlattenRequest(); - } - - FlattenRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + FlattenRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9265,8 +8960,8 @@ class FlattenRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9274,6 +8969,8 @@ class FlattenRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FlattenRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.FlattenRequest"; @@ -9281,9 +8978,6 @@ class FlattenRequest final : protected: explicit FlattenRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -9306,7 +9000,7 @@ class FlattenRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -9324,7 +9018,7 @@ class FlattenRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -9354,7 +9048,7 @@ class RunChartDownsampleRequest_ZoomRange final : public: inline RunChartDownsampleRequest_ZoomRange() : RunChartDownsampleRequest_ZoomRange(nullptr) {} ~RunChartDownsampleRequest_ZoomRange() override; - explicit constexpr RunChartDownsampleRequest_ZoomRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR RunChartDownsampleRequest_ZoomRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); RunChartDownsampleRequest_ZoomRange(const RunChartDownsampleRequest_ZoomRange& from); RunChartDownsampleRequest_ZoomRange(RunChartDownsampleRequest_ZoomRange&& from) noexcept @@ -9397,14 +9091,19 @@ class RunChartDownsampleRequest_ZoomRange final : &_RunChartDownsampleRequest_ZoomRange_default_instance_); } static constexpr int kIndexInFileMessages = - 45; + 43; friend void swap(RunChartDownsampleRequest_ZoomRange& a, RunChartDownsampleRequest_ZoomRange& b) { a.Swap(&b); } inline void Swap(RunChartDownsampleRequest_ZoomRange* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9418,11 +9117,7 @@ class RunChartDownsampleRequest_ZoomRange final : // implements Message ---------------------------------------------- - inline RunChartDownsampleRequest_ZoomRange* New() const final { - return new RunChartDownsampleRequest_ZoomRange(); - } - - RunChartDownsampleRequest_ZoomRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + RunChartDownsampleRequest_ZoomRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9437,8 +9132,8 @@ class RunChartDownsampleRequest_ZoomRange final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9446,6 +9141,8 @@ class RunChartDownsampleRequest_ZoomRange final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(RunChartDownsampleRequest_ZoomRange* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange"; @@ -9453,9 +9150,6 @@ class RunChartDownsampleRequest_ZoomRange final : protected: explicit RunChartDownsampleRequest_ZoomRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -9477,11 +9171,11 @@ class RunChartDownsampleRequest_ZoomRange final : bool _internal_has_min_date_nanos() const; public: void clear_min_date_nanos(); - ::PROTOBUF_NAMESPACE_ID::int64 min_date_nanos() const; - void set_min_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t min_date_nanos() const; + void set_min_date_nanos(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_min_date_nanos() const; - void _internal_set_min_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_min_date_nanos() const; + void _internal_set_min_date_nanos(int64_t value); public: // optional int64 max_date_nanos = 2 [jstype = JS_STRING]; @@ -9490,11 +9184,11 @@ class RunChartDownsampleRequest_ZoomRange final : bool _internal_has_max_date_nanos() const; public: void clear_max_date_nanos(); - ::PROTOBUF_NAMESPACE_ID::int64 max_date_nanos() const; - void set_max_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t max_date_nanos() const; + void set_max_date_nanos(int64_t value); private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_max_date_nanos() const; - void _internal_set_max_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value); + int64_t _internal_max_date_nanos() const; + void _internal_set_max_date_nanos(int64_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) @@ -9506,8 +9200,8 @@ class RunChartDownsampleRequest_ZoomRange final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::int64 min_date_nanos_; - ::PROTOBUF_NAMESPACE_ID::int64 max_date_nanos_; + int64_t min_date_nanos_; + int64_t max_date_nanos_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; // ------------------------------------------------------------------- @@ -9517,7 +9211,7 @@ class RunChartDownsampleRequest final : public: inline RunChartDownsampleRequest() : RunChartDownsampleRequest(nullptr) {} ~RunChartDownsampleRequest() override; - explicit constexpr RunChartDownsampleRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR RunChartDownsampleRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); RunChartDownsampleRequest(const RunChartDownsampleRequest& from); RunChartDownsampleRequest(RunChartDownsampleRequest&& from) noexcept @@ -9560,14 +9254,19 @@ class RunChartDownsampleRequest final : &_RunChartDownsampleRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 46; + 44; friend void swap(RunChartDownsampleRequest& a, RunChartDownsampleRequest& b) { a.Swap(&b); } inline void Swap(RunChartDownsampleRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9581,11 +9280,7 @@ class RunChartDownsampleRequest final : // implements Message ---------------------------------------------- - inline RunChartDownsampleRequest* New() const final { - return new RunChartDownsampleRequest(); - } - - RunChartDownsampleRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + RunChartDownsampleRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9600,8 +9295,8 @@ class RunChartDownsampleRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9609,6 +9304,8 @@ class RunChartDownsampleRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(RunChartDownsampleRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest"; @@ -9616,9 +9313,6 @@ class RunChartDownsampleRequest final : protected: explicit RunChartDownsampleRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -9670,7 +9364,7 @@ class RunChartDownsampleRequest final : template void set_x_column_name(ArgT0&& arg0, ArgT... args); std::string* mutable_x_column_name(); - PROTOBUF_MUST_USE_RESULT std::string* release_x_column_name(); + PROTOBUF_NODISCARD std::string* release_x_column_name(); void set_allocated_x_column_name(std::string* x_column_name); private: const std::string& _internal_x_column_name() const; @@ -9685,7 +9379,7 @@ class RunChartDownsampleRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -9703,7 +9397,7 @@ class RunChartDownsampleRequest final : public: void clear_source_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_id(); void set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id); private: @@ -9721,7 +9415,7 @@ class RunChartDownsampleRequest final : public: void clear_zoom_range(); const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange& zoom_range() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* release_zoom_range(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* release_zoom_range(); ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* mutable_zoom_range(); void set_allocated_zoom_range(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* zoom_range); private: @@ -9734,11 +9428,11 @@ class RunChartDownsampleRequest final : // int32 pixel_count = 3; void clear_pixel_count(); - ::PROTOBUF_NAMESPACE_ID::int32 pixel_count() const; - void set_pixel_count(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t pixel_count() const; + void set_pixel_count(int32_t value); private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_pixel_count() const; - void _internal_set_pixel_count(::PROTOBUF_NAMESPACE_ID::int32 value); + int32_t _internal_pixel_count() const; + void _internal_set_pixel_count(int32_t value); public: // @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) @@ -9753,7 +9447,7 @@ class RunChartDownsampleRequest final : ::io::deephaven::proto::backplane::grpc::Ticket* result_id_; ::io::deephaven::proto::backplane::grpc::TableReference* source_id_; ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange* zoom_range_; - ::PROTOBUF_NAMESPACE_ID::int32 pixel_count_; + int32_t pixel_count_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -9763,7 +9457,7 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly) */ { public: inline CreateInputTableRequest_InputTableKind_InMemoryAppendOnly() : CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(nullptr) {} - explicit constexpr CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(const CreateInputTableRequest_InputTableKind_InMemoryAppendOnly& from); CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(CreateInputTableRequest_InputTableKind_InMemoryAppendOnly&& from) noexcept @@ -9806,14 +9500,19 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : &_CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_default_instance_); } static constexpr int kIndexInFileMessages = - 47; + 45; friend void swap(CreateInputTableRequest_InputTableKind_InMemoryAppendOnly& a, CreateInputTableRequest_InputTableKind_InMemoryAppendOnly& b) { a.Swap(&b); } inline void Swap(CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9827,11 +9526,7 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : // implements Message ---------------------------------------------- - inline CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* New() const final { - return new CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(); - } - - CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; @@ -9843,6 +9538,8 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); } public: + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly"; @@ -9850,7 +9547,6 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : protected: explicit CreateInputTableRequest_InputTableKind_InMemoryAppendOnly(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -9869,7 +9565,6 @@ class CreateInputTableRequest_InputTableKind_InMemoryAppendOnly final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; // ------------------------------------------------------------------- @@ -9879,7 +9574,7 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : public: inline CreateInputTableRequest_InputTableKind_InMemoryKeyBacked() : CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(nullptr) {} ~CreateInputTableRequest_InputTableKind_InMemoryKeyBacked() override; - explicit constexpr CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(const CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& from); CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(CreateInputTableRequest_InputTableKind_InMemoryKeyBacked&& from) noexcept @@ -9922,14 +9617,19 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : &_CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_default_instance_); } static constexpr int kIndexInFileMessages = - 48; + 46; friend void swap(CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& a, CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& b) { a.Swap(&b); } inline void Swap(CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -9943,11 +9643,7 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : // implements Message ---------------------------------------------- - inline CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* New() const final { - return new CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(); - } - - CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -9962,8 +9658,8 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -9971,6 +9667,8 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked"; @@ -9978,9 +9676,6 @@ class CreateInputTableRequest_InputTableKind_InMemoryKeyBacked final : protected: explicit CreateInputTableRequest_InputTableKind_InMemoryKeyBacked(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -10037,7 +9732,7 @@ class CreateInputTableRequest_InputTableKind final : public: inline CreateInputTableRequest_InputTableKind() : CreateInputTableRequest_InputTableKind(nullptr) {} ~CreateInputTableRequest_InputTableKind() override; - explicit constexpr CreateInputTableRequest_InputTableKind(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CreateInputTableRequest_InputTableKind(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CreateInputTableRequest_InputTableKind(const CreateInputTableRequest_InputTableKind& from); CreateInputTableRequest_InputTableKind(CreateInputTableRequest_InputTableKind&& from) noexcept @@ -10086,14 +9781,19 @@ class CreateInputTableRequest_InputTableKind final : &_CreateInputTableRequest_InputTableKind_default_instance_); } static constexpr int kIndexInFileMessages = - 49; + 47; friend void swap(CreateInputTableRequest_InputTableKind& a, CreateInputTableRequest_InputTableKind& b) { a.Swap(&b); } inline void Swap(CreateInputTableRequest_InputTableKind* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -10107,11 +9807,7 @@ class CreateInputTableRequest_InputTableKind final : // implements Message ---------------------------------------------- - inline CreateInputTableRequest_InputTableKind* New() const final { - return new CreateInputTableRequest_InputTableKind(); - } - - CreateInputTableRequest_InputTableKind* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CreateInputTableRequest_InputTableKind* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -10126,8 +9822,8 @@ class CreateInputTableRequest_InputTableKind final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -10135,6 +9831,8 @@ class CreateInputTableRequest_InputTableKind final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CreateInputTableRequest_InputTableKind* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind"; @@ -10142,9 +9840,6 @@ class CreateInputTableRequest_InputTableKind final : protected: explicit CreateInputTableRequest_InputTableKind(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -10170,7 +9865,7 @@ class CreateInputTableRequest_InputTableKind final : public: void clear_in_memory_append_only(); const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly& in_memory_append_only() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* release_in_memory_append_only(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* release_in_memory_append_only(); ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* mutable_in_memory_append_only(); void set_allocated_in_memory_append_only(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* in_memory_append_only); private: @@ -10188,7 +9883,7 @@ class CreateInputTableRequest_InputTableKind final : public: void clear_in_memory_key_backed(); const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked& in_memory_key_backed() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* release_in_memory_key_backed(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* release_in_memory_key_backed(); ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* mutable_in_memory_key_backed(); void set_allocated_in_memory_key_backed(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* in_memory_key_backed); private: @@ -10220,7 +9915,7 @@ class CreateInputTableRequest_InputTableKind final : ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* in_memory_key_backed_; } kind_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -10231,7 +9926,7 @@ class CreateInputTableRequest final : public: inline CreateInputTableRequest() : CreateInputTableRequest(nullptr) {} ~CreateInputTableRequest() override; - explicit constexpr CreateInputTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CreateInputTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CreateInputTableRequest(const CreateInputTableRequest& from); CreateInputTableRequest(CreateInputTableRequest&& from) noexcept @@ -10280,14 +9975,19 @@ class CreateInputTableRequest final : &_CreateInputTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 50; + 48; friend void swap(CreateInputTableRequest& a, CreateInputTableRequest& b) { a.Swap(&b); } inline void Swap(CreateInputTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -10301,11 +10001,7 @@ class CreateInputTableRequest final : // implements Message ---------------------------------------------- - inline CreateInputTableRequest* New() const final { - return new CreateInputTableRequest(); - } - - CreateInputTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + CreateInputTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -10320,8 +10016,8 @@ class CreateInputTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -10329,6 +10025,8 @@ class CreateInputTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CreateInputTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.CreateInputTableRequest"; @@ -10336,9 +10034,6 @@ class CreateInputTableRequest final : protected: explicit CreateInputTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -10365,7 +10060,7 @@ class CreateInputTableRequest final : public: void clear_result_id(); const ::io::deephaven::proto::backplane::grpc::Ticket& result_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_result_id(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_result_id(); void set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id); private: @@ -10383,7 +10078,7 @@ class CreateInputTableRequest final : public: void clear_kind(); const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind& kind() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* release_kind(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* release_kind(); ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* mutable_kind(); void set_allocated_kind(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind* kind); private: @@ -10401,7 +10096,7 @@ class CreateInputTableRequest final : public: void clear_source_table_id(); const ::io::deephaven::proto::backplane::grpc::TableReference& source_table_id() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TableReference* release_source_table_id(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TableReference* release_source_table_id(); ::io::deephaven::proto::backplane::grpc::TableReference* mutable_source_table_id(); void set_allocated_source_table_id(::io::deephaven::proto::backplane::grpc::TableReference* source_table_id); private: @@ -10422,7 +10117,7 @@ class CreateInputTableRequest final : template void set_schema(ArgT0&& arg0, ArgT... args); std::string* mutable_schema(); - PROTOBUF_MUST_USE_RESULT std::string* release_schema(); + PROTOBUF_NODISCARD std::string* release_schema(); void set_allocated_schema(std::string* schema); private: const std::string& _internal_schema() const; @@ -10453,7 +10148,7 @@ class CreateInputTableRequest final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_; } definition_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -10464,7 +10159,7 @@ class BatchTableRequest_Operation final : public: inline BatchTableRequest_Operation() : BatchTableRequest_Operation(nullptr) {} ~BatchTableRequest_Operation() override; - explicit constexpr BatchTableRequest_Operation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BatchTableRequest_Operation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BatchTableRequest_Operation(const BatchTableRequest_Operation& from); BatchTableRequest_Operation(BatchTableRequest_Operation&& from) noexcept @@ -10542,14 +10237,19 @@ class BatchTableRequest_Operation final : &_BatchTableRequest_Operation_default_instance_); } static constexpr int kIndexInFileMessages = - 51; + 49; friend void swap(BatchTableRequest_Operation& a, BatchTableRequest_Operation& b) { a.Swap(&b); } inline void Swap(BatchTableRequest_Operation* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -10563,11 +10263,7 @@ class BatchTableRequest_Operation final : // implements Message ---------------------------------------------- - inline BatchTableRequest_Operation* New() const final { - return new BatchTableRequest_Operation(); - } - - BatchTableRequest_Operation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + BatchTableRequest_Operation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -10582,8 +10278,8 @@ class BatchTableRequest_Operation final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -10591,6 +10287,8 @@ class BatchTableRequest_Operation final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(BatchTableRequest_Operation* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation"; @@ -10598,9 +10296,6 @@ class BatchTableRequest_Operation final : protected: explicit BatchTableRequest_Operation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -10652,7 +10347,7 @@ class BatchTableRequest_Operation final : public: void clear_empty_table(); const ::io::deephaven::proto::backplane::grpc::EmptyTableRequest& empty_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* release_empty_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* release_empty_table(); ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* mutable_empty_table(); void set_allocated_empty_table(::io::deephaven::proto::backplane::grpc::EmptyTableRequest* empty_table); private: @@ -10670,7 +10365,7 @@ class BatchTableRequest_Operation final : public: void clear_time_table(); const ::io::deephaven::proto::backplane::grpc::TimeTableRequest& time_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::TimeTableRequest* release_time_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::TimeTableRequest* release_time_table(); ::io::deephaven::proto::backplane::grpc::TimeTableRequest* mutable_time_table(); void set_allocated_time_table(::io::deephaven::proto::backplane::grpc::TimeTableRequest* time_table); private: @@ -10688,7 +10383,7 @@ class BatchTableRequest_Operation final : public: void clear_drop_columns(); const ::io::deephaven::proto::backplane::grpc::DropColumnsRequest& drop_columns() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* release_drop_columns(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* release_drop_columns(); ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* mutable_drop_columns(); void set_allocated_drop_columns(::io::deephaven::proto::backplane::grpc::DropColumnsRequest* drop_columns); private: @@ -10706,7 +10401,7 @@ class BatchTableRequest_Operation final : public: void clear_update(); const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest& update() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_update(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_update(); ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* mutable_update(); void set_allocated_update(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* update); private: @@ -10724,7 +10419,7 @@ class BatchTableRequest_Operation final : public: void clear_lazy_update(); const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest& lazy_update() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_lazy_update(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_lazy_update(); ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* mutable_lazy_update(); void set_allocated_lazy_update(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* lazy_update); private: @@ -10742,7 +10437,7 @@ class BatchTableRequest_Operation final : public: void clear_view(); const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest& view() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_view(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_view(); ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* mutable_view(); void set_allocated_view(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* view); private: @@ -10760,7 +10455,7 @@ class BatchTableRequest_Operation final : public: void clear_update_view(); const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest& update_view() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_update_view(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_update_view(); ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* mutable_update_view(); void set_allocated_update_view(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* update_view); private: @@ -10778,7 +10473,7 @@ class BatchTableRequest_Operation final : public: void clear_select(); const ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest& select() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_select(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* release_select(); ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* mutable_select(); void set_allocated_select(::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* select); private: @@ -10796,7 +10491,7 @@ class BatchTableRequest_Operation final : public: void clear_select_distinct(); const ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest& select_distinct() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* release_select_distinct(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* release_select_distinct(); ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* mutable_select_distinct(); void set_allocated_select_distinct(::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* select_distinct); private: @@ -10814,7 +10509,7 @@ class BatchTableRequest_Operation final : public: void clear_filter(); const ::io::deephaven::proto::backplane::grpc::FilterTableRequest& filter() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::FilterTableRequest* release_filter(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::FilterTableRequest* release_filter(); ::io::deephaven::proto::backplane::grpc::FilterTableRequest* mutable_filter(); void set_allocated_filter(::io::deephaven::proto::backplane::grpc::FilterTableRequest* filter); private: @@ -10832,7 +10527,7 @@ class BatchTableRequest_Operation final : public: void clear_unstructured_filter(); const ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest& unstructured_filter() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* release_unstructured_filter(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* release_unstructured_filter(); ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* mutable_unstructured_filter(); void set_allocated_unstructured_filter(::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* unstructured_filter); private: @@ -10850,7 +10545,7 @@ class BatchTableRequest_Operation final : public: void clear_sort(); const ::io::deephaven::proto::backplane::grpc::SortTableRequest& sort() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SortTableRequest* release_sort(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SortTableRequest* release_sort(); ::io::deephaven::proto::backplane::grpc::SortTableRequest* mutable_sort(); void set_allocated_sort(::io::deephaven::proto::backplane::grpc::SortTableRequest* sort); private: @@ -10868,7 +10563,7 @@ class BatchTableRequest_Operation final : public: void clear_head(); const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest& head() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* release_head(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* release_head(); ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* mutable_head(); void set_allocated_head(::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* head); private: @@ -10886,7 +10581,7 @@ class BatchTableRequest_Operation final : public: void clear_tail(); const ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest& tail() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* release_tail(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* release_tail(); ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* mutable_tail(); void set_allocated_tail(::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* tail); private: @@ -10904,7 +10599,7 @@ class BatchTableRequest_Operation final : public: void clear_head_by(); const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest& head_by() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* release_head_by(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* release_head_by(); ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* mutable_head_by(); void set_allocated_head_by(::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* head_by); private: @@ -10922,7 +10617,7 @@ class BatchTableRequest_Operation final : public: void clear_tail_by(); const ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest& tail_by() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* release_tail_by(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* release_tail_by(); ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* mutable_tail_by(); void set_allocated_tail_by(::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* tail_by); private: @@ -10940,7 +10635,7 @@ class BatchTableRequest_Operation final : public: void clear_ungroup(); const ::io::deephaven::proto::backplane::grpc::UngroupRequest& ungroup() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::UngroupRequest* release_ungroup(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::UngroupRequest* release_ungroup(); ::io::deephaven::proto::backplane::grpc::UngroupRequest* mutable_ungroup(); void set_allocated_ungroup(::io::deephaven::proto::backplane::grpc::UngroupRequest* ungroup); private: @@ -10958,7 +10653,7 @@ class BatchTableRequest_Operation final : public: void clear_merge(); const ::io::deephaven::proto::backplane::grpc::MergeTablesRequest& merge() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* release_merge(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* release_merge(); ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* mutable_merge(); void set_allocated_merge(::io::deephaven::proto::backplane::grpc::MergeTablesRequest* merge); private: @@ -10976,7 +10671,7 @@ class BatchTableRequest_Operation final : public: void clear_combo_aggregate(); const ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest& combo_aggregate() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* release_combo_aggregate(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* release_combo_aggregate(); ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* mutable_combo_aggregate(); void set_allocated_combo_aggregate(::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* combo_aggregate); private: @@ -10994,7 +10689,7 @@ class BatchTableRequest_Operation final : public: void clear_snapshot(); const ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest& snapshot() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* release_snapshot(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* release_snapshot(); ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* mutable_snapshot(); void set_allocated_snapshot(::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* snapshot); private: @@ -11012,7 +10707,7 @@ class BatchTableRequest_Operation final : public: void clear_flatten(); const ::io::deephaven::proto::backplane::grpc::FlattenRequest& flatten() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::FlattenRequest* release_flatten(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::FlattenRequest* release_flatten(); ::io::deephaven::proto::backplane::grpc::FlattenRequest* mutable_flatten(); void set_allocated_flatten(::io::deephaven::proto::backplane::grpc::FlattenRequest* flatten); private: @@ -11030,7 +10725,7 @@ class BatchTableRequest_Operation final : public: void clear_run_chart_downsample(); const ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest& run_chart_downsample() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* release_run_chart_downsample(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* release_run_chart_downsample(); ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* mutable_run_chart_downsample(); void set_allocated_run_chart_downsample(::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* run_chart_downsample); private: @@ -11048,7 +10743,7 @@ class BatchTableRequest_Operation final : public: void clear_cross_join(); const ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest& cross_join() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* release_cross_join(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* release_cross_join(); ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* mutable_cross_join(); void set_allocated_cross_join(::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* cross_join); private: @@ -11066,7 +10761,7 @@ class BatchTableRequest_Operation final : public: void clear_natural_join(); const ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest& natural_join() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* release_natural_join(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* release_natural_join(); ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* mutable_natural_join(); void set_allocated_natural_join(::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* natural_join); private: @@ -11084,7 +10779,7 @@ class BatchTableRequest_Operation final : public: void clear_exact_join(); const ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest& exact_join() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* release_exact_join(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* release_exact_join(); ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* mutable_exact_join(); void set_allocated_exact_join(::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* exact_join); private: @@ -11102,7 +10797,7 @@ class BatchTableRequest_Operation final : public: void clear_left_join(); const ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest& left_join() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* release_left_join(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* release_left_join(); ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* mutable_left_join(); void set_allocated_left_join(::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* left_join); private: @@ -11120,7 +10815,7 @@ class BatchTableRequest_Operation final : public: void clear_as_of_join(); const ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest& as_of_join() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* release_as_of_join(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* release_as_of_join(); ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* mutable_as_of_join(); void set_allocated_as_of_join(::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* as_of_join); private: @@ -11138,7 +10833,7 @@ class BatchTableRequest_Operation final : public: void clear_fetch_table(); const ::io::deephaven::proto::backplane::grpc::FetchTableRequest& fetch_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::FetchTableRequest* release_fetch_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::FetchTableRequest* release_fetch_table(); ::io::deephaven::proto::backplane::grpc::FetchTableRequest* mutable_fetch_table(); void set_allocated_fetch_table(::io::deephaven::proto::backplane::grpc::FetchTableRequest* fetch_table); private: @@ -11156,7 +10851,7 @@ class BatchTableRequest_Operation final : public: void clear_fetch_pandas_table(); const ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest& fetch_pandas_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* release_fetch_pandas_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* release_fetch_pandas_table(); ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* mutable_fetch_pandas_table(); void set_allocated_fetch_pandas_table(::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* fetch_pandas_table); private: @@ -11174,7 +10869,7 @@ class BatchTableRequest_Operation final : public: void clear_apply_preview_columns(); const ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest& apply_preview_columns() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* release_apply_preview_columns(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* release_apply_preview_columns(); ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* mutable_apply_preview_columns(); void set_allocated_apply_preview_columns(::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* apply_preview_columns); private: @@ -11192,7 +10887,7 @@ class BatchTableRequest_Operation final : public: void clear_create_input_table(); const ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest& create_input_table() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* release_create_input_table(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* release_create_input_table(); ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* mutable_create_input_table(); void set_allocated_create_input_table(::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* create_input_table); private: @@ -11282,7 +10977,7 @@ class BatchTableRequest_Operation final : ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* create_input_table_; } op_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + uint32_t _oneof_case_[1]; friend struct ::TableStruct_deephaven_2fproto_2ftable_2eproto; }; @@ -11293,7 +10988,7 @@ class BatchTableRequest final : public: inline BatchTableRequest() : BatchTableRequest(nullptr) {} ~BatchTableRequest() override; - explicit constexpr BatchTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BatchTableRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BatchTableRequest(const BatchTableRequest& from); BatchTableRequest(BatchTableRequest&& from) noexcept @@ -11336,14 +11031,19 @@ class BatchTableRequest final : &_BatchTableRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 52; + 50; friend void swap(BatchTableRequest& a, BatchTableRequest& b) { a.Swap(&b); } inline void Swap(BatchTableRequest* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -11357,11 +11057,7 @@ class BatchTableRequest final : // implements Message ---------------------------------------------- - inline BatchTableRequest* New() const final { - return new BatchTableRequest(); - } - - BatchTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + BatchTableRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -11376,8 +11072,8 @@ class BatchTableRequest final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -11385,6 +11081,8 @@ class BatchTableRequest final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(BatchTableRequest* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.BatchTableRequest"; @@ -11392,9 +11090,6 @@ class BatchTableRequest final : protected: explicit BatchTableRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -11465,7 +11160,7 @@ inline ::io::deephaven::proto::backplane::grpc::Ticket* TableReference::release_ // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.TableReference.ticket) if (_internal_has_ticket()) { clear_has_ref(); - ::io::deephaven::proto::backplane::grpc::Ticket* temp = ref_.ticket_; + ::io::deephaven::proto::backplane::grpc::Ticket* temp = ref_.ticket_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -11533,24 +11228,24 @@ inline void TableReference::clear_batch_offset() { clear_has_ref(); } } -inline ::PROTOBUF_NAMESPACE_ID::int32 TableReference::_internal_batch_offset() const { +inline int32_t TableReference::_internal_batch_offset() const { if (_internal_has_batch_offset()) { return ref_.batch_offset_; } return 0; } -inline void TableReference::_internal_set_batch_offset(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void TableReference::_internal_set_batch_offset(int32_t value) { if (!_internal_has_batch_offset()) { clear_ref(); set_has_batch_offset(); } ref_.batch_offset_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::int32 TableReference::batch_offset() const { +inline int32_t TableReference::batch_offset() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.TableReference.batch_offset) return _internal_batch_offset(); } -inline void TableReference::set_batch_offset(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void TableReference::set_batch_offset(int32_t value) { _internal_set_batch_offset(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TableReference.batch_offset) } @@ -11645,7 +11340,7 @@ inline void ExportedTableCreationResponse::set_allocated_result_id(::io::deephav } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(result_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(result_id); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, result_id, submessage_arena); @@ -11690,7 +11385,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExportedTableCreationResponse::set_error_info(ArgT0&& arg0, ArgT... args) { - error_info_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + error_info_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info) } inline std::string* ExportedTableCreationResponse::mutable_error_info() { @@ -11703,15 +11398,15 @@ inline const std::string& ExportedTableCreationResponse::_internal_error_info() } inline void ExportedTableCreationResponse::_internal_set_error_info(const std::string& value) { - error_info_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + error_info_.Set(value, GetArenaForAllocation()); } inline std::string* ExportedTableCreationResponse::_internal_mutable_error_info() { - return error_info_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return error_info_.Mutable(GetArenaForAllocation()); } inline std::string* ExportedTableCreationResponse::release_error_info() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info) - return error_info_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return error_info_.Release(); } inline void ExportedTableCreationResponse::set_allocated_error_info(std::string* error_info) { if (error_info != nullptr) { @@ -11719,8 +11414,12 @@ inline void ExportedTableCreationResponse::set_allocated_error_info(std::string* } else { } - error_info_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_info, - GetArenaForAllocation()); + error_info_.SetAllocated(error_info, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (error_info_.IsDefault()) { + error_info_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.error_info) } @@ -11736,7 +11435,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExportedTableCreationResponse::set_schema_header(ArgT0&& arg0, ArgT... args) { - schema_header_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + schema_header_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.schema_header) } inline std::string* ExportedTableCreationResponse::mutable_schema_header() { @@ -11749,15 +11448,15 @@ inline const std::string& ExportedTableCreationResponse::_internal_schema_header } inline void ExportedTableCreationResponse::_internal_set_schema_header(const std::string& value) { - schema_header_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + schema_header_.Set(value, GetArenaForAllocation()); } inline std::string* ExportedTableCreationResponse::_internal_mutable_schema_header() { - return schema_header_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return schema_header_.Mutable(GetArenaForAllocation()); } inline std::string* ExportedTableCreationResponse::release_schema_header() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.schema_header) - return schema_header_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return schema_header_.Release(); } inline void ExportedTableCreationResponse::set_allocated_schema_header(std::string* schema_header) { if (schema_header != nullptr) { @@ -11765,8 +11464,12 @@ inline void ExportedTableCreationResponse::set_allocated_schema_header(std::stri } else { } - schema_header_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), schema_header, - GetArenaForAllocation()); + schema_header_.SetAllocated(schema_header, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (schema_header_.IsDefault()) { + schema_header_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.schema_header) } @@ -11794,18 +11497,18 @@ inline void ExportedTableCreationResponse::set_is_static(bool value) { inline void ExportedTableCreationResponse::clear_size() { size_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 ExportedTableCreationResponse::_internal_size() const { +inline int64_t ExportedTableCreationResponse::_internal_size() const { return size_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 ExportedTableCreationResponse::size() const { +inline int64_t ExportedTableCreationResponse::size() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.size) return _internal_size(); } -inline void ExportedTableCreationResponse::_internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void ExportedTableCreationResponse::_internal_set_size(int64_t value) { size_ = value; } -inline void ExportedTableCreationResponse::set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void ExportedTableCreationResponse::set_size(int64_t value) { _internal_set_size(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.size) } @@ -11891,7 +11594,7 @@ inline void FetchTableRequest::set_allocated_source_id(::io::deephaven::proto::b } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -11975,8 +11678,7 @@ inline void FetchTableRequest::set_allocated_result_id(::io::deephaven::proto::b } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12071,7 +11773,7 @@ inline void ApplyPreviewColumnsRequest::set_allocated_source_id(::io::deephaven: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -12155,8 +11857,7 @@ inline void ApplyPreviewColumnsRequest::set_allocated_result_id(::io::deephaven: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12251,7 +11952,7 @@ inline void FetchPandasTableRequest::set_allocated_source_id(::io::deephaven::pr } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -12335,8 +12036,7 @@ inline void FetchPandasTableRequest::set_allocated_result_id(::io::deephaven::pr } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12352,190 +12052,6 @@ inline void FetchPandasTableRequest::set_allocated_result_id(::io::deephaven::pr // ------------------------------------------------------------------- -// FetchTableMapRequest - -// .io.deephaven.proto.backplane.grpc.TableReference source_id = 1; -inline bool FetchTableMapRequest::_internal_has_source_id() const { - return this != internal_default_instance() && source_id_ != nullptr; -} -inline bool FetchTableMapRequest::has_source_id() const { - return _internal_has_source_id(); -} -inline void FetchTableMapRequest::clear_source_id() { - if (GetArenaForAllocation() == nullptr && source_id_ != nullptr) { - delete source_id_; - } - source_id_ = nullptr; -} -inline const ::io::deephaven::proto::backplane::grpc::TableReference& FetchTableMapRequest::_internal_source_id() const { - const ::io::deephaven::proto::backplane::grpc::TableReference* p = source_id_; - return p != nullptr ? *p : reinterpret_cast( - ::io::deephaven::proto::backplane::grpc::_TableReference_default_instance_); -} -inline const ::io::deephaven::proto::backplane::grpc::TableReference& FetchTableMapRequest::source_id() const { - // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id) - return _internal_source_id(); -} -inline void FetchTableMapRequest::unsafe_arena_set_allocated_source_id( - ::io::deephaven::proto::backplane::grpc::TableReference* source_id) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_id_); - } - source_id_ = source_id; - if (source_id) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id) -} -inline ::io::deephaven::proto::backplane::grpc::TableReference* FetchTableMapRequest::release_source_id() { - - ::io::deephaven::proto::backplane::grpc::TableReference* temp = source_id_; - source_id_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::io::deephaven::proto::backplane::grpc::TableReference* FetchTableMapRequest::unsafe_arena_release_source_id() { - // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id) - - ::io::deephaven::proto::backplane::grpc::TableReference* temp = source_id_; - source_id_ = nullptr; - return temp; -} -inline ::io::deephaven::proto::backplane::grpc::TableReference* FetchTableMapRequest::_internal_mutable_source_id() { - - if (source_id_ == nullptr) { - auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::TableReference>(GetArenaForAllocation()); - source_id_ = p; - } - return source_id_; -} -inline ::io::deephaven::proto::backplane::grpc::TableReference* FetchTableMapRequest::mutable_source_id() { - ::io::deephaven::proto::backplane::grpc::TableReference* _msg = _internal_mutable_source_id(); - // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id) - return _msg; -} -inline void FetchTableMapRequest::set_allocated_source_id(::io::deephaven::proto::backplane::grpc::TableReference* source_id) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete source_id_; - } - if (source_id) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); - if (message_arena != submessage_arena) { - source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, source_id, submessage_arena); - } - - } else { - - } - source_id_ = source_id; - // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.source_id) -} - -// .io.deephaven.proto.backplane.grpc.Ticket result_id = 2; -inline bool FetchTableMapRequest::_internal_has_result_id() const { - return this != internal_default_instance() && result_id_ != nullptr; -} -inline bool FetchTableMapRequest::has_result_id() const { - return _internal_has_result_id(); -} -inline const ::io::deephaven::proto::backplane::grpc::Ticket& FetchTableMapRequest::_internal_result_id() const { - const ::io::deephaven::proto::backplane::grpc::Ticket* p = result_id_; - return p != nullptr ? *p : reinterpret_cast( - ::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_); -} -inline const ::io::deephaven::proto::backplane::grpc::Ticket& FetchTableMapRequest::result_id() const { - // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id) - return _internal_result_id(); -} -inline void FetchTableMapRequest::unsafe_arena_set_allocated_result_id( - ::io::deephaven::proto::backplane::grpc::Ticket* result_id) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); - } - result_id_ = result_id; - if (result_id) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id) -} -inline ::io::deephaven::proto::backplane::grpc::Ticket* FetchTableMapRequest::release_result_id() { - - ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; - result_id_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::io::deephaven::proto::backplane::grpc::Ticket* FetchTableMapRequest::unsafe_arena_release_result_id() { - // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id) - - ::io::deephaven::proto::backplane::grpc::Ticket* temp = result_id_; - result_id_ = nullptr; - return temp; -} -inline ::io::deephaven::proto::backplane::grpc::Ticket* FetchTableMapRequest::_internal_mutable_result_id() { - - if (result_id_ == nullptr) { - auto* p = CreateMaybeMessage<::io::deephaven::proto::backplane::grpc::Ticket>(GetArenaForAllocation()); - result_id_ = p; - } - return result_id_; -} -inline ::io::deephaven::proto::backplane::grpc::Ticket* FetchTableMapRequest::mutable_result_id() { - ::io::deephaven::proto::backplane::grpc::Ticket* _msg = _internal_mutable_result_id(); - // @@protoc_insertion_point(field_mutable:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id) - return _msg; -} -inline void FetchTableMapRequest::set_allocated_result_id(::io::deephaven::proto::backplane::grpc::Ticket* result_id) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id_); - } - if (result_id) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); - if (message_arena != submessage_arena) { - result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, result_id, submessage_arena); - } - - } else { - - } - result_id_ = result_id; - // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.FetchTableMapRequest.result_id) -} - -// ------------------------------------------------------------------- - -// FetchTableMapResponse - -// ------------------------------------------------------------------- - // ExportedTableUpdatesRequest // ------------------------------------------------------------------- @@ -12613,8 +12129,7 @@ inline void ExportedTableUpdateMessage::set_allocated_export_id(::io::deephaven: } if (export_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(export_id)); if (message_arena != submessage_arena) { export_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12632,18 +12147,18 @@ inline void ExportedTableUpdateMessage::set_allocated_export_id(::io::deephaven: inline void ExportedTableUpdateMessage::clear_size() { size_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 ExportedTableUpdateMessage::_internal_size() const { +inline int64_t ExportedTableUpdateMessage::_internal_size() const { return size_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 ExportedTableUpdateMessage::size() const { +inline int64_t ExportedTableUpdateMessage::size() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.size) return _internal_size(); } -inline void ExportedTableUpdateMessage::_internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void ExportedTableUpdateMessage::_internal_set_size(int64_t value) { size_ = value; } -inline void ExportedTableUpdateMessage::set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void ExportedTableUpdateMessage::set_size(int64_t value) { _internal_set_size(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.size) } @@ -12660,7 +12175,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ExportedTableUpdateMessage::set_update_failure_message(ArgT0&& arg0, ArgT... args) { - update_failure_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + update_failure_message_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message) } inline std::string* ExportedTableUpdateMessage::mutable_update_failure_message() { @@ -12673,15 +12188,15 @@ inline const std::string& ExportedTableUpdateMessage::_internal_update_failure_m } inline void ExportedTableUpdateMessage::_internal_set_update_failure_message(const std::string& value) { - update_failure_message_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + update_failure_message_.Set(value, GetArenaForAllocation()); } inline std::string* ExportedTableUpdateMessage::_internal_mutable_update_failure_message() { - return update_failure_message_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return update_failure_message_.Mutable(GetArenaForAllocation()); } inline std::string* ExportedTableUpdateMessage::release_update_failure_message() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message) - return update_failure_message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return update_failure_message_.Release(); } inline void ExportedTableUpdateMessage::set_allocated_update_failure_message(std::string* update_failure_message) { if (update_failure_message != nullptr) { @@ -12689,8 +12204,12 @@ inline void ExportedTableUpdateMessage::set_allocated_update_failure_message(std } else { } - update_failure_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), update_failure_message, - GetArenaForAllocation()); + update_failure_message_.SetAllocated(update_failure_message, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (update_failure_message_.IsDefault()) { + update_failure_message_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.update_failure_message) } @@ -12769,8 +12288,7 @@ inline void EmptyTableRequest::set_allocated_result_id(::io::deephaven::proto::b } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12788,18 +12306,18 @@ inline void EmptyTableRequest::set_allocated_result_id(::io::deephaven::proto::b inline void EmptyTableRequest::clear_size() { size_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 EmptyTableRequest::_internal_size() const { +inline int64_t EmptyTableRequest::_internal_size() const { return size_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 EmptyTableRequest::size() const { +inline int64_t EmptyTableRequest::size() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.EmptyTableRequest.size) return _internal_size(); } -inline void EmptyTableRequest::_internal_set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void EmptyTableRequest::_internal_set_size(int64_t value) { size_ = value; } -inline void EmptyTableRequest::set_size(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void EmptyTableRequest::set_size(int64_t value) { _internal_set_size(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.EmptyTableRequest.size) } @@ -12879,8 +12397,7 @@ inline void TimeTableRequest::set_allocated_result_id(::io::deephaven::proto::ba } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -12898,18 +12415,18 @@ inline void TimeTableRequest::set_allocated_result_id(::io::deephaven::proto::ba inline void TimeTableRequest::clear_start_time_nanos() { start_time_nanos_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 TimeTableRequest::_internal_start_time_nanos() const { +inline int64_t TimeTableRequest::_internal_start_time_nanos() const { return start_time_nanos_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 TimeTableRequest::start_time_nanos() const { +inline int64_t TimeTableRequest::start_time_nanos() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.TimeTableRequest.start_time_nanos) return _internal_start_time_nanos(); } -inline void TimeTableRequest::_internal_set_start_time_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void TimeTableRequest::_internal_set_start_time_nanos(int64_t value) { start_time_nanos_ = value; } -inline void TimeTableRequest::set_start_time_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void TimeTableRequest::set_start_time_nanos(int64_t value) { _internal_set_start_time_nanos(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TimeTableRequest.start_time_nanos) } @@ -12918,18 +12435,18 @@ inline void TimeTableRequest::set_start_time_nanos(::PROTOBUF_NAMESPACE_ID::int6 inline void TimeTableRequest::clear_period_nanos() { period_nanos_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 TimeTableRequest::_internal_period_nanos() const { +inline int64_t TimeTableRequest::_internal_period_nanos() const { return period_nanos_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 TimeTableRequest::period_nanos() const { +inline int64_t TimeTableRequest::period_nanos() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.TimeTableRequest.period_nanos) return _internal_period_nanos(); } -inline void TimeTableRequest::_internal_set_period_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void TimeTableRequest::_internal_set_period_nanos(int64_t value) { period_nanos_ = value; } -inline void TimeTableRequest::set_period_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void TimeTableRequest::set_period_nanos(int64_t value) { _internal_set_period_nanos(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TimeTableRequest.period_nanos) } @@ -13009,8 +12526,7 @@ inline void SelectOrUpdateRequest::set_allocated_result_id(::io::deephaven::prot } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -13101,7 +12617,7 @@ inline void SelectOrUpdateRequest::set_allocated_source_id(::io::deephaven::prot } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -13264,8 +12780,7 @@ inline void SelectDistinctRequest::set_allocated_result_id(::io::deephaven::prot } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -13356,7 +12871,7 @@ inline void SelectDistinctRequest::set_allocated_source_id(::io::deephaven::prot } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -13519,8 +13034,7 @@ inline void DropColumnsRequest::set_allocated_result_id(::io::deephaven::proto:: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -13611,7 +13125,7 @@ inline void DropColumnsRequest::set_allocated_source_id(::io::deephaven::proto:: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -13774,8 +13288,7 @@ inline void UnstructuredFilterTableRequest::set_allocated_result_id(::io::deepha } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -13866,7 +13379,7 @@ inline void UnstructuredFilterTableRequest::set_allocated_source_id(::io::deepha } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -14029,8 +13542,7 @@ inline void HeadOrTailRequest::set_allocated_result_id(::io::deephaven::proto::b } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -14121,7 +13633,7 @@ inline void HeadOrTailRequest::set_allocated_source_id(::io::deephaven::proto::b } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -14138,18 +13650,18 @@ inline void HeadOrTailRequest::set_allocated_source_id(::io::deephaven::proto::b inline void HeadOrTailRequest::clear_num_rows() { num_rows_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HeadOrTailRequest::_internal_num_rows() const { +inline int64_t HeadOrTailRequest::_internal_num_rows() const { return num_rows_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HeadOrTailRequest::num_rows() const { +inline int64_t HeadOrTailRequest::num_rows() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.HeadOrTailRequest.num_rows) return _internal_num_rows(); } -inline void HeadOrTailRequest::_internal_set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HeadOrTailRequest::_internal_set_num_rows(int64_t value) { num_rows_ = value; } -inline void HeadOrTailRequest::set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HeadOrTailRequest::set_num_rows(int64_t value) { _internal_set_num_rows(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HeadOrTailRequest.num_rows) } @@ -14229,8 +13741,7 @@ inline void HeadOrTailByRequest::set_allocated_result_id(::io::deephaven::proto: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -14321,7 +13832,7 @@ inline void HeadOrTailByRequest::set_allocated_source_id(::io::deephaven::proto: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -14338,18 +13849,18 @@ inline void HeadOrTailByRequest::set_allocated_source_id(::io::deephaven::proto: inline void HeadOrTailByRequest::clear_num_rows() { num_rows_ = int64_t{0}; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HeadOrTailByRequest::_internal_num_rows() const { +inline int64_t HeadOrTailByRequest::_internal_num_rows() const { return num_rows_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 HeadOrTailByRequest::num_rows() const { +inline int64_t HeadOrTailByRequest::num_rows() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.num_rows) return _internal_num_rows(); } -inline void HeadOrTailByRequest::_internal_set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HeadOrTailByRequest::_internal_set_num_rows(int64_t value) { num_rows_ = value; } -inline void HeadOrTailByRequest::set_num_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void HeadOrTailByRequest::set_num_rows(int64_t value) { _internal_set_num_rows(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.num_rows) } @@ -14504,8 +14015,7 @@ inline void UngroupRequest::set_allocated_result_id(::io::deephaven::proto::back } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -14596,7 +14106,7 @@ inline void UngroupRequest::set_allocated_source_id(::io::deephaven::proto::back } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -14779,8 +14289,7 @@ inline void MergeTablesRequest::set_allocated_result_id(::io::deephaven::proto:: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -14846,7 +14355,7 @@ template inline PROTOBUF_ALWAYS_INLINE void MergeTablesRequest::set_key_column(ArgT0&& arg0, ArgT... args) { - key_column_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + key_column_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column) } inline std::string* MergeTablesRequest::mutable_key_column() { @@ -14859,15 +14368,15 @@ inline const std::string& MergeTablesRequest::_internal_key_column() const { } inline void MergeTablesRequest::_internal_set_key_column(const std::string& value) { - key_column_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + key_column_.Set(value, GetArenaForAllocation()); } inline std::string* MergeTablesRequest::_internal_mutable_key_column() { - return key_column_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return key_column_.Mutable(GetArenaForAllocation()); } inline std::string* MergeTablesRequest::release_key_column() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column) - return key_column_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return key_column_.Release(); } inline void MergeTablesRequest::set_allocated_key_column(std::string* key_column) { if (key_column != nullptr) { @@ -14875,8 +14384,12 @@ inline void MergeTablesRequest::set_allocated_key_column(std::string* key_column } else { } - key_column_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key_column, - GetArenaForAllocation()); + key_column_.SetAllocated(key_column, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (key_column_.IsDefault()) { + key_column_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.MergeTablesRequest.key_column) } @@ -14955,8 +14468,7 @@ inline void SnapshotTableRequest::set_allocated_result_id(::io::deephaven::proto } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -15047,7 +14559,7 @@ inline void SnapshotTableRequest::set_allocated_left_id(::io::deephaven::proto:: } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -15137,7 +14649,7 @@ inline void SnapshotTableRequest::set_allocated_right_id(::io::deephaven::proto: } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -15320,8 +14832,7 @@ inline void CrossJoinTablesRequest::set_allocated_result_id(::io::deephaven::pro } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -15412,7 +14923,7 @@ inline void CrossJoinTablesRequest::set_allocated_left_id(::io::deephaven::proto } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -15502,7 +15013,7 @@ inline void CrossJoinTablesRequest::set_allocated_right_id(::io::deephaven::prot } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -15669,18 +15180,18 @@ CrossJoinTablesRequest::mutable_columns_to_add() { inline void CrossJoinTablesRequest::clear_reserve_bits() { reserve_bits_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CrossJoinTablesRequest::_internal_reserve_bits() const { +inline int32_t CrossJoinTablesRequest::_internal_reserve_bits() const { return reserve_bits_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 CrossJoinTablesRequest::reserve_bits() const { +inline int32_t CrossJoinTablesRequest::reserve_bits() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.reserve_bits) return _internal_reserve_bits(); } -inline void CrossJoinTablesRequest::_internal_set_reserve_bits(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CrossJoinTablesRequest::_internal_set_reserve_bits(int32_t value) { reserve_bits_ = value; } -inline void CrossJoinTablesRequest::set_reserve_bits(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void CrossJoinTablesRequest::set_reserve_bits(int32_t value) { _internal_set_reserve_bits(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.reserve_bits) } @@ -15760,8 +15271,7 @@ inline void NaturalJoinTablesRequest::set_allocated_result_id(::io::deephaven::p } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -15852,7 +15362,7 @@ inline void NaturalJoinTablesRequest::set_allocated_left_id(::io::deephaven::pro } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -15942,7 +15452,7 @@ inline void NaturalJoinTablesRequest::set_allocated_right_id(::io::deephaven::pr } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -16180,8 +15690,7 @@ inline void ExactJoinTablesRequest::set_allocated_result_id(::io::deephaven::pro } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -16272,7 +15781,7 @@ inline void ExactJoinTablesRequest::set_allocated_left_id(::io::deephaven::proto } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -16362,7 +15871,7 @@ inline void ExactJoinTablesRequest::set_allocated_right_id(::io::deephaven::prot } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -16600,8 +16109,7 @@ inline void LeftJoinTablesRequest::set_allocated_result_id(::io::deephaven::prot } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -16692,7 +16200,7 @@ inline void LeftJoinTablesRequest::set_allocated_left_id(::io::deephaven::proto: } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -16782,7 +16290,7 @@ inline void LeftJoinTablesRequest::set_allocated_right_id(::io::deephaven::proto } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -17020,8 +16528,7 @@ inline void AsOfJoinTablesRequest::set_allocated_result_id(::io::deephaven::prot } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -17112,7 +16619,7 @@ inline void AsOfJoinTablesRequest::set_allocated_left_id(::io::deephaven::proto: } if (left_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(left_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(left_id); if (message_arena != submessage_arena) { left_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, left_id, submessage_arena); @@ -17202,7 +16709,7 @@ inline void AsOfJoinTablesRequest::set_allocated_right_id(::io::deephaven::proto } if (right_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(right_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(right_id); if (message_arena != submessage_arena) { right_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, right_id, submessage_arena); @@ -17496,7 +17003,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ComboAggregateRequest_Aggregate::set_column_name(ArgT0&& arg0, ArgT... args) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name) } inline std::string* ComboAggregateRequest_Aggregate::mutable_column_name() { @@ -17509,15 +17016,15 @@ inline const std::string& ComboAggregateRequest_Aggregate::_internal_column_name } inline void ComboAggregateRequest_Aggregate::_internal_set_column_name(const std::string& value) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_name_.Set(value, GetArenaForAllocation()); } inline std::string* ComboAggregateRequest_Aggregate::_internal_mutable_column_name() { - return column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_name_.Mutable(GetArenaForAllocation()); } inline std::string* ComboAggregateRequest_Aggregate::release_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name) - return column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_name_.Release(); } inline void ComboAggregateRequest_Aggregate::set_allocated_column_name(std::string* column_name) { if (column_name != nullptr) { @@ -17525,8 +17032,12 @@ inline void ComboAggregateRequest_Aggregate::set_allocated_column_name(std::stri } else { } - column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_name, - GetArenaForAllocation()); + column_name_.SetAllocated(column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_name_.IsDefault()) { + column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.column_name) } @@ -17645,8 +17156,7 @@ inline void ComboAggregateRequest::set_allocated_result_id(::io::deephaven::prot } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -17737,7 +17247,7 @@ inline void ComboAggregateRequest::set_allocated_source_id(::io::deephaven::prot } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -17901,7 +17411,7 @@ template inline PROTOBUF_ALWAYS_INLINE void SortDescriptor::set_column_name(ArgT0&& arg0, ArgT... args) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.SortDescriptor.column_name) } inline std::string* SortDescriptor::mutable_column_name() { @@ -17914,15 +17424,15 @@ inline const std::string& SortDescriptor::_internal_column_name() const { } inline void SortDescriptor::_internal_set_column_name(const std::string& value) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_name_.Set(value, GetArenaForAllocation()); } inline std::string* SortDescriptor::_internal_mutable_column_name() { - return column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_name_.Mutable(GetArenaForAllocation()); } inline std::string* SortDescriptor::release_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.SortDescriptor.column_name) - return column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_name_.Release(); } inline void SortDescriptor::set_allocated_column_name(std::string* column_name) { if (column_name != nullptr) { @@ -17930,8 +17440,12 @@ inline void SortDescriptor::set_allocated_column_name(std::string* column_name) } else { } - column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_name, - GetArenaForAllocation()); + column_name_.SetAllocated(column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_name_.IsDefault()) { + column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.SortDescriptor.column_name) } @@ -18050,8 +17564,7 @@ inline void SortTableRequest::set_allocated_result_id(::io::deephaven::proto::ba } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -18142,7 +17655,7 @@ inline void SortTableRequest::set_allocated_source_id(::io::deephaven::proto::ba } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -18270,8 +17783,7 @@ inline void FilterTableRequest::set_allocated_result_id(::io::deephaven::proto:: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -18362,7 +17874,7 @@ inline void FilterTableRequest::set_allocated_source_id(::io::deephaven::proto:: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -18431,7 +17943,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Reference::set_column_name(ArgT0&& arg0, ArgT... args) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.Reference.column_name) } inline std::string* Reference::mutable_column_name() { @@ -18444,15 +17956,15 @@ inline const std::string& Reference::_internal_column_name() const { } inline void Reference::_internal_set_column_name(const std::string& value) { - column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + column_name_.Set(value, GetArenaForAllocation()); } inline std::string* Reference::_internal_mutable_column_name() { - return column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return column_name_.Mutable(GetArenaForAllocation()); } inline std::string* Reference::release_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Reference.column_name) - return column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return column_name_.Release(); } inline void Reference::set_allocated_column_name(std::string* column_name) { if (column_name != nullptr) { @@ -18460,8 +17972,12 @@ inline void Reference::set_allocated_column_name(std::string* column_name) { } else { } - column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), column_name, - GetArenaForAllocation()); + column_name_.SetAllocated(column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (column_name_.IsDefault()) { + column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.Reference.column_name) } @@ -18481,7 +17997,7 @@ inline void Literal::set_has_string_value() { } inline void Literal::clear_string_value() { if (_internal_has_string_value()) { - value_.string_value_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + value_.string_value_.Destroy(); clear_has_value(); } } @@ -18494,9 +18010,9 @@ inline void Literal::set_string_value(ArgT0&& arg0, ArgT... args) { if (!_internal_has_string_value()) { clear_value(); set_has_string_value(); - value_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.string_value_.InitDefault(); } - value_.string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + value_.string_value_.Set( static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.Literal.string_value) } inline std::string* Literal::mutable_string_value() { @@ -18514,24 +18030,23 @@ inline void Literal::_internal_set_string_value(const std::string& value) { if (!_internal_has_string_value()) { clear_value(); set_has_string_value(); - value_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.string_value_.InitDefault(); } - value_.string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + value_.string_value_.Set(value, GetArenaForAllocation()); } inline std::string* Literal::_internal_mutable_string_value() { if (!_internal_has_string_value()) { clear_value(); set_has_string_value(); - value_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.string_value_.InitDefault(); } - return value_.string_value_.Mutable( - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return value_.string_value_.Mutable( GetArenaForAllocation()); } inline std::string* Literal::release_string_value() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Literal.string_value) if (_internal_has_string_value()) { clear_has_value(); - return value_.string_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return value_.string_value_.Release(); } else { return nullptr; } @@ -18542,11 +18057,7 @@ inline void Literal::set_allocated_string_value(std::string* string_value) { } if (string_value != nullptr) { set_has_string_value(); - value_.string_value_.UnsafeSetDefault(string_value); - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation(); - if (arena != nullptr) { - arena->Own(string_value); - } + value_.string_value_.InitAllocated(string_value, GetArenaForAllocation()); } // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.Literal.string_value) } @@ -18643,24 +18154,24 @@ inline void Literal::clear_long_value() { clear_has_value(); } } -inline ::PROTOBUF_NAMESPACE_ID::int64 Literal::_internal_long_value() const { +inline int64_t Literal::_internal_long_value() const { if (_internal_has_long_value()) { return value_.long_value_; } return int64_t{0}; } -inline void Literal::_internal_set_long_value(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void Literal::_internal_set_long_value(int64_t value) { if (!_internal_has_long_value()) { clear_value(); set_has_long_value(); } value_.long_value_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::int64 Literal::long_value() const { +inline int64_t Literal::long_value() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.Literal.long_value) return _internal_long_value(); } -inline void Literal::set_long_value(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void Literal::set_long_value(int64_t value) { _internal_set_long_value(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.Literal.long_value) } @@ -18681,24 +18192,24 @@ inline void Literal::clear_nano_time_value() { clear_has_value(); } } -inline ::PROTOBUF_NAMESPACE_ID::int64 Literal::_internal_nano_time_value() const { +inline int64_t Literal::_internal_nano_time_value() const { if (_internal_has_nano_time_value()) { return value_.nano_time_value_; } return int64_t{0}; } -inline void Literal::_internal_set_nano_time_value(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void Literal::_internal_set_nano_time_value(int64_t value) { if (!_internal_has_nano_time_value()) { clear_value(); set_has_nano_time_value(); } value_.nano_time_value_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::int64 Literal::nano_time_value() const { +inline int64_t Literal::nano_time_value() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.Literal.nano_time_value) return _internal_nano_time_value(); } -inline void Literal::set_nano_time_value(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void Literal::set_nano_time_value(int64_t value) { _internal_set_nano_time_value(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.Literal.nano_time_value) } @@ -18738,7 +18249,7 @@ inline ::io::deephaven::proto::backplane::grpc::Reference* Value::release_refere // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Value.reference) if (_internal_has_reference()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::Reference* temp = data_.reference_; + ::io::deephaven::proto::backplane::grpc::Reference* temp = data_.reference_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -18812,7 +18323,7 @@ inline ::io::deephaven::proto::backplane::grpc::Literal* Value::release_literal( // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Value.literal) if (_internal_has_literal()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::Literal* temp = data_.literal_; + ::io::deephaven::proto::backplane::grpc::Literal* temp = data_.literal_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -18899,7 +18410,7 @@ inline ::io::deephaven::proto::backplane::grpc::AndCondition* Condition::release // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.and) if (_internal_has_and_()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::AndCondition* temp = data_.and__; + ::io::deephaven::proto::backplane::grpc::AndCondition* temp = data_.and__; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -18973,7 +18484,7 @@ inline ::io::deephaven::proto::backplane::grpc::OrCondition* Condition::release_ // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.or) if (_internal_has_or_()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::OrCondition* temp = data_.or__; + ::io::deephaven::proto::backplane::grpc::OrCondition* temp = data_.or__; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19047,7 +18558,7 @@ inline ::io::deephaven::proto::backplane::grpc::NotCondition* Condition::release // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.not) if (_internal_has_not_()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::NotCondition* temp = data_.not__; + ::io::deephaven::proto::backplane::grpc::NotCondition* temp = data_.not__; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19121,7 +18632,7 @@ inline ::io::deephaven::proto::backplane::grpc::CompareCondition* Condition::rel // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.compare) if (_internal_has_compare()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::CompareCondition* temp = data_.compare_; + ::io::deephaven::proto::backplane::grpc::CompareCondition* temp = data_.compare_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19195,7 +18706,7 @@ inline ::io::deephaven::proto::backplane::grpc::InCondition* Condition::release_ // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.in) if (_internal_has_in()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::InCondition* temp = data_.in_; + ::io::deephaven::proto::backplane::grpc::InCondition* temp = data_.in_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19269,7 +18780,7 @@ inline ::io::deephaven::proto::backplane::grpc::InvokeCondition* Condition::rele // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.invoke) if (_internal_has_invoke()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::InvokeCondition* temp = data_.invoke_; + ::io::deephaven::proto::backplane::grpc::InvokeCondition* temp = data_.invoke_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19343,7 +18854,7 @@ inline ::io::deephaven::proto::backplane::grpc::IsNullCondition* Condition::rele // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.is_null) if (_internal_has_is_null()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::IsNullCondition* temp = data_.is_null_; + ::io::deephaven::proto::backplane::grpc::IsNullCondition* temp = data_.is_null_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19417,7 +18928,7 @@ inline ::io::deephaven::proto::backplane::grpc::MatchesCondition* Condition::rel // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.matches) if (_internal_has_matches()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::MatchesCondition* temp = data_.matches_; + ::io::deephaven::proto::backplane::grpc::MatchesCondition* temp = data_.matches_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19491,7 +19002,7 @@ inline ::io::deephaven::proto::backplane::grpc::ContainsCondition* Condition::re // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.contains) if (_internal_has_contains()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::ContainsCondition* temp = data_.contains_; + ::io::deephaven::proto::backplane::grpc::ContainsCondition* temp = data_.contains_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19565,7 +19076,7 @@ inline ::io::deephaven::proto::backplane::grpc::SearchCondition* Condition::rele // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Condition.search) if (_internal_has_search()) { clear_has_data(); - ::io::deephaven::proto::backplane::grpc::SearchCondition* temp = data_.search_; + ::io::deephaven::proto::backplane::grpc::SearchCondition* temp = data_.search_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -19795,7 +19306,7 @@ inline void NotCondition::set_allocated_filter(::io::deephaven::proto::backplane } if (filter) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Condition>::GetOwningArena(filter); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(filter); if (message_arena != submessage_arena) { filter = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, filter, submessage_arena); @@ -19929,7 +19440,7 @@ inline void CompareCondition::set_allocated_lhs(::io::deephaven::proto::backplan } if (lhs) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Value>::GetOwningArena(lhs); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(lhs); if (message_arena != submessage_arena) { lhs = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, lhs, submessage_arena); @@ -20019,7 +19530,7 @@ inline void CompareCondition::set_allocated_rhs(::io::deephaven::proto::backplan } if (rhs) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Value>::GetOwningArena(rhs); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(rhs); if (message_arena != submessage_arena) { rhs = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, rhs, submessage_arena); @@ -20113,7 +19624,7 @@ inline void InCondition::set_allocated_target(::io::deephaven::proto::backplane: } if (target) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Value>::GetOwningArena(target); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(target); if (message_arena != submessage_arena) { target = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, target, submessage_arena); @@ -20222,7 +19733,7 @@ template inline PROTOBUF_ALWAYS_INLINE void InvokeCondition::set_method(ArgT0&& arg0, ArgT... args) { - method_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + method_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.InvokeCondition.method) } inline std::string* InvokeCondition::mutable_method() { @@ -20235,15 +19746,15 @@ inline const std::string& InvokeCondition::_internal_method() const { } inline void InvokeCondition::_internal_set_method(const std::string& value) { - method_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + method_.Set(value, GetArenaForAllocation()); } inline std::string* InvokeCondition::_internal_mutable_method() { - return method_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return method_.Mutable(GetArenaForAllocation()); } inline std::string* InvokeCondition::release_method() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.InvokeCondition.method) - return method_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return method_.Release(); } inline void InvokeCondition::set_allocated_method(std::string* method) { if (method != nullptr) { @@ -20251,8 +19762,12 @@ inline void InvokeCondition::set_allocated_method(std::string* method) { } else { } - method_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), method, - GetArenaForAllocation()); + method_.SetAllocated(method, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (method_.IsDefault()) { + method_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.InvokeCondition.method) } @@ -20333,7 +19848,7 @@ inline void InvokeCondition::set_allocated_target(::io::deephaven::proto::backpl } if (target) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Value>::GetOwningArena(target); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(target); if (message_arena != submessage_arena) { target = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, target, submessage_arena); @@ -20467,7 +19982,7 @@ inline void IsNullCondition::set_allocated_reference(::io::deephaven::proto::bac } if (reference) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Reference>::GetOwningArena(reference); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reference); if (message_arena != submessage_arena) { reference = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, reference, submessage_arena); @@ -20561,7 +20076,7 @@ inline void MatchesCondition::set_allocated_reference(::io::deephaven::proto::ba } if (reference) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Reference>::GetOwningArena(reference); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reference); if (message_arena != submessage_arena) { reference = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, reference, submessage_arena); @@ -20586,7 +20101,7 @@ template inline PROTOBUF_ALWAYS_INLINE void MatchesCondition::set_regex(ArgT0&& arg0, ArgT... args) { - regex_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + regex_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.MatchesCondition.regex) } inline std::string* MatchesCondition::mutable_regex() { @@ -20599,15 +20114,15 @@ inline const std::string& MatchesCondition::_internal_regex() const { } inline void MatchesCondition::_internal_set_regex(const std::string& value) { - regex_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + regex_.Set(value, GetArenaForAllocation()); } inline std::string* MatchesCondition::_internal_mutable_regex() { - return regex_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return regex_.Mutable(GetArenaForAllocation()); } inline std::string* MatchesCondition::release_regex() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.MatchesCondition.regex) - return regex_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return regex_.Release(); } inline void MatchesCondition::set_allocated_regex(std::string* regex) { if (regex != nullptr) { @@ -20615,8 +20130,12 @@ inline void MatchesCondition::set_allocated_regex(std::string* regex) { } else { } - regex_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), regex, - GetArenaForAllocation()); + regex_.SetAllocated(regex, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (regex_.IsDefault()) { + regex_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.MatchesCondition.regex) } @@ -20741,7 +20260,7 @@ inline void ContainsCondition::set_allocated_reference(::io::deephaven::proto::b } if (reference) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Reference>::GetOwningArena(reference); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reference); if (message_arena != submessage_arena) { reference = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, reference, submessage_arena); @@ -20766,7 +20285,7 @@ template inline PROTOBUF_ALWAYS_INLINE void ContainsCondition::set_search_string(ArgT0&& arg0, ArgT... args) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + search_string_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.ContainsCondition.search_string) } inline std::string* ContainsCondition::mutable_search_string() { @@ -20779,15 +20298,15 @@ inline const std::string& ContainsCondition::_internal_search_string() const { } inline void ContainsCondition::_internal_set_search_string(const std::string& value) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + search_string_.Set(value, GetArenaForAllocation()); } inline std::string* ContainsCondition::_internal_mutable_search_string() { - return search_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return search_string_.Mutable(GetArenaForAllocation()); } inline std::string* ContainsCondition::release_search_string() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.ContainsCondition.search_string) - return search_string_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return search_string_.Release(); } inline void ContainsCondition::set_allocated_search_string(std::string* search_string) { if (search_string != nullptr) { @@ -20795,8 +20314,12 @@ inline void ContainsCondition::set_allocated_search_string(std::string* search_s } else { } - search_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), search_string, - GetArenaForAllocation()); + search_string_.SetAllocated(search_string, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (search_string_.IsDefault()) { + search_string_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.ContainsCondition.search_string) } @@ -20856,7 +20379,7 @@ template inline PROTOBUF_ALWAYS_INLINE void SearchCondition::set_search_string(ArgT0&& arg0, ArgT... args) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + search_string_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.SearchCondition.search_string) } inline std::string* SearchCondition::mutable_search_string() { @@ -20869,15 +20392,15 @@ inline const std::string& SearchCondition::_internal_search_string() const { } inline void SearchCondition::_internal_set_search_string(const std::string& value) { - search_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + search_string_.Set(value, GetArenaForAllocation()); } inline std::string* SearchCondition::_internal_mutable_search_string() { - return search_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return search_string_.Mutable(GetArenaForAllocation()); } inline std::string* SearchCondition::release_search_string() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.SearchCondition.search_string) - return search_string_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return search_string_.Release(); } inline void SearchCondition::set_allocated_search_string(std::string* search_string) { if (search_string != nullptr) { @@ -20885,8 +20408,12 @@ inline void SearchCondition::set_allocated_search_string(std::string* search_str } else { } - search_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), search_string, - GetArenaForAllocation()); + search_string_.SetAllocated(search_string, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (search_string_.IsDefault()) { + search_string_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.SearchCondition.search_string) } @@ -21005,8 +20532,7 @@ inline void FlattenRequest::set_allocated_result_id(::io::deephaven::proto::back } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -21097,7 +20623,7 @@ inline void FlattenRequest::set_allocated_source_id(::io::deephaven::proto::back } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -21126,18 +20652,18 @@ inline void RunChartDownsampleRequest_ZoomRange::clear_min_date_nanos() { min_date_nanos_ = int64_t{0}; _has_bits_[0] &= ~0x00000001u; } -inline ::PROTOBUF_NAMESPACE_ID::int64 RunChartDownsampleRequest_ZoomRange::_internal_min_date_nanos() const { +inline int64_t RunChartDownsampleRequest_ZoomRange::_internal_min_date_nanos() const { return min_date_nanos_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 RunChartDownsampleRequest_ZoomRange::min_date_nanos() const { +inline int64_t RunChartDownsampleRequest_ZoomRange::min_date_nanos() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.min_date_nanos) return _internal_min_date_nanos(); } -inline void RunChartDownsampleRequest_ZoomRange::_internal_set_min_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void RunChartDownsampleRequest_ZoomRange::_internal_set_min_date_nanos(int64_t value) { _has_bits_[0] |= 0x00000001u; min_date_nanos_ = value; } -inline void RunChartDownsampleRequest_ZoomRange::set_min_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void RunChartDownsampleRequest_ZoomRange::set_min_date_nanos(int64_t value) { _internal_set_min_date_nanos(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.min_date_nanos) } @@ -21154,18 +20680,18 @@ inline void RunChartDownsampleRequest_ZoomRange::clear_max_date_nanos() { max_date_nanos_ = int64_t{0}; _has_bits_[0] &= ~0x00000002u; } -inline ::PROTOBUF_NAMESPACE_ID::int64 RunChartDownsampleRequest_ZoomRange::_internal_max_date_nanos() const { +inline int64_t RunChartDownsampleRequest_ZoomRange::_internal_max_date_nanos() const { return max_date_nanos_; } -inline ::PROTOBUF_NAMESPACE_ID::int64 RunChartDownsampleRequest_ZoomRange::max_date_nanos() const { +inline int64_t RunChartDownsampleRequest_ZoomRange::max_date_nanos() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.max_date_nanos) return _internal_max_date_nanos(); } -inline void RunChartDownsampleRequest_ZoomRange::_internal_set_max_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void RunChartDownsampleRequest_ZoomRange::_internal_set_max_date_nanos(int64_t value) { _has_bits_[0] |= 0x00000002u; max_date_nanos_ = value; } -inline void RunChartDownsampleRequest_ZoomRange::set_max_date_nanos(::PROTOBUF_NAMESPACE_ID::int64 value) { +inline void RunChartDownsampleRequest_ZoomRange::set_max_date_nanos(int64_t value) { _internal_set_max_date_nanos(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange.max_date_nanos) } @@ -21245,8 +20771,7 @@ inline void RunChartDownsampleRequest::set_allocated_result_id(::io::deephaven:: } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -21337,7 +20862,7 @@ inline void RunChartDownsampleRequest::set_allocated_source_id(::io::deephaven:: } if (source_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::TableReference>::GetOwningArena(source_id); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_id); if (message_arena != submessage_arena) { source_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_id, submessage_arena); @@ -21354,18 +20879,18 @@ inline void RunChartDownsampleRequest::set_allocated_source_id(::io::deephaven:: inline void RunChartDownsampleRequest::clear_pixel_count() { pixel_count_ = 0; } -inline ::PROTOBUF_NAMESPACE_ID::int32 RunChartDownsampleRequest::_internal_pixel_count() const { +inline int32_t RunChartDownsampleRequest::_internal_pixel_count() const { return pixel_count_; } -inline ::PROTOBUF_NAMESPACE_ID::int32 RunChartDownsampleRequest::pixel_count() const { +inline int32_t RunChartDownsampleRequest::pixel_count() const { // @@protoc_insertion_point(field_get:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.pixel_count) return _internal_pixel_count(); } -inline void RunChartDownsampleRequest::_internal_set_pixel_count(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void RunChartDownsampleRequest::_internal_set_pixel_count(int32_t value) { pixel_count_ = value; } -inline void RunChartDownsampleRequest::set_pixel_count(::PROTOBUF_NAMESPACE_ID::int32 value) { +inline void RunChartDownsampleRequest::set_pixel_count(int32_t value) { _internal_set_pixel_count(value); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.pixel_count) } @@ -21447,7 +20972,7 @@ inline void RunChartDownsampleRequest::set_allocated_zoom_range(::io::deephaven: } if (zoom_range) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest_ZoomRange>::GetOwningArena(zoom_range); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(zoom_range); if (message_arena != submessage_arena) { zoom_range = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, zoom_range, submessage_arena); @@ -21472,7 +20997,7 @@ template inline PROTOBUF_ALWAYS_INLINE void RunChartDownsampleRequest::set_x_column_name(ArgT0&& arg0, ArgT... args) { - x_column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + x_column_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name) } inline std::string* RunChartDownsampleRequest::mutable_x_column_name() { @@ -21485,15 +21010,15 @@ inline const std::string& RunChartDownsampleRequest::_internal_x_column_name() c } inline void RunChartDownsampleRequest::_internal_set_x_column_name(const std::string& value) { - x_column_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + x_column_name_.Set(value, GetArenaForAllocation()); } inline std::string* RunChartDownsampleRequest::_internal_mutable_x_column_name() { - return x_column_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return x_column_name_.Mutable(GetArenaForAllocation()); } inline std::string* RunChartDownsampleRequest::release_x_column_name() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name) - return x_column_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return x_column_name_.Release(); } inline void RunChartDownsampleRequest::set_allocated_x_column_name(std::string* x_column_name) { if (x_column_name != nullptr) { @@ -21501,8 +21026,12 @@ inline void RunChartDownsampleRequest::set_allocated_x_column_name(std::string* } else { } - x_column_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), x_column_name, - GetArenaForAllocation()); + x_column_name_.SetAllocated(x_column_name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (x_column_name_.IsDefault()) { + x_column_name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.x_column_name) } @@ -21690,7 +21219,7 @@ inline ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTab // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_append_only) if (_internal_has_in_memory_append_only()) { clear_has_kind(); - ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* temp = kind_.in_memory_append_only_; + ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryAppendOnly* temp = kind_.in_memory_append_only_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -21764,7 +21293,7 @@ inline ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTab // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_key_backed) if (_internal_has_in_memory_key_backed()) { clear_has_kind(); - ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* temp = kind_.in_memory_key_backed_; + ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind_InMemoryKeyBacked* temp = kind_.in_memory_key_backed_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -21900,8 +21429,7 @@ inline void CreateInputTableRequest::set_allocated_result_id(::io::deephaven::pr } if (result_id) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(result_id)); if (message_arena != submessage_arena) { result_id = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -21937,7 +21465,7 @@ inline ::io::deephaven::proto::backplane::grpc::TableReference* CreateInputTable // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.source_table_id) if (_internal_has_source_table_id()) { clear_has_definition(); - ::io::deephaven::proto::backplane::grpc::TableReference* temp = definition_.source_table_id_; + ::io::deephaven::proto::backplane::grpc::TableReference* temp = definition_.source_table_id_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22001,7 +21529,7 @@ inline void CreateInputTableRequest::set_has_schema() { } inline void CreateInputTableRequest::clear_schema() { if (_internal_has_schema()) { - definition_.schema_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + definition_.schema_.Destroy(); clear_has_definition(); } } @@ -22014,9 +21542,9 @@ inline void CreateInputTableRequest::set_schema(ArgT0&& arg0, ArgT... args) { if (!_internal_has_schema()) { clear_definition(); set_has_schema(); - definition_.schema_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + definition_.schema_.InitDefault(); } - definition_.schema_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + definition_.schema_.SetBytes( static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.schema) } inline std::string* CreateInputTableRequest::mutable_schema() { @@ -22034,24 +21562,23 @@ inline void CreateInputTableRequest::_internal_set_schema(const std::string& val if (!_internal_has_schema()) { clear_definition(); set_has_schema(); - definition_.schema_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + definition_.schema_.InitDefault(); } - definition_.schema_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + definition_.schema_.Set(value, GetArenaForAllocation()); } inline std::string* CreateInputTableRequest::_internal_mutable_schema() { if (!_internal_has_schema()) { clear_definition(); set_has_schema(); - definition_.schema_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + definition_.schema_.InitDefault(); } - return definition_.schema_.Mutable( - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return definition_.schema_.Mutable( GetArenaForAllocation()); } inline std::string* CreateInputTableRequest::release_schema() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.schema) if (_internal_has_schema()) { clear_has_definition(); - return definition_.schema_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return definition_.schema_.Release(); } else { return nullptr; } @@ -22062,11 +21589,7 @@ inline void CreateInputTableRequest::set_allocated_schema(std::string* schema) { } if (schema != nullptr) { set_has_schema(); - definition_.schema_.UnsafeSetDefault(schema); - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation(); - if (arena != nullptr) { - arena->Own(schema); - } + definition_.schema_.InitAllocated(schema, GetArenaForAllocation()); } // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.schema) } @@ -22148,7 +21671,7 @@ inline void CreateInputTableRequest::set_allocated_kind(::io::deephaven::proto:: } if (kind) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::CreateInputTableRequest_InputTableKind>::GetOwningArena(kind); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(kind); if (message_arena != submessage_arena) { kind = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, kind, submessage_arena); @@ -22196,7 +21719,7 @@ inline ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* BatchTableReq // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.empty_table) if (_internal_has_empty_table()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* temp = op_.empty_table_; + ::io::deephaven::proto::backplane::grpc::EmptyTableRequest* temp = op_.empty_table_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22270,7 +21793,7 @@ inline ::io::deephaven::proto::backplane::grpc::TimeTableRequest* BatchTableRequ // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.time_table) if (_internal_has_time_table()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::TimeTableRequest* temp = op_.time_table_; + ::io::deephaven::proto::backplane::grpc::TimeTableRequest* temp = op_.time_table_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22344,7 +21867,7 @@ inline ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* BatchTableRe // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.drop_columns) if (_internal_has_drop_columns()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* temp = op_.drop_columns_; + ::io::deephaven::proto::backplane::grpc::DropColumnsRequest* temp = op_.drop_columns_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22418,7 +21941,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update) if (_internal_has_update()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.update_; + ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.update_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22492,7 +22015,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.lazy_update) if (_internal_has_lazy_update()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.lazy_update_; + ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.lazy_update_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22566,7 +22089,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.view) if (_internal_has_view()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.view_; + ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.view_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22640,7 +22163,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_view) if (_internal_has_update_view()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.update_view_; + ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.update_view_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22714,7 +22237,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select) if (_internal_has_select()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.select_; + ::io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest* temp = op_.select_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22788,7 +22311,7 @@ inline ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select_distinct) if (_internal_has_select_distinct()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* temp = op_.select_distinct_; + ::io::deephaven::proto::backplane::grpc::SelectDistinctRequest* temp = op_.select_distinct_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22862,7 +22385,7 @@ inline ::io::deephaven::proto::backplane::grpc::FilterTableRequest* BatchTableRe // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.filter) if (_internal_has_filter()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::FilterTableRequest* temp = op_.filter_; + ::io::deephaven::proto::backplane::grpc::FilterTableRequest* temp = op_.filter_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -22936,7 +22459,7 @@ inline ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.unstructured_filter) if (_internal_has_unstructured_filter()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* temp = op_.unstructured_filter_; + ::io::deephaven::proto::backplane::grpc::UnstructuredFilterTableRequest* temp = op_.unstructured_filter_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23010,7 +22533,7 @@ inline ::io::deephaven::proto::backplane::grpc::SortTableRequest* BatchTableRequ // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.sort) if (_internal_has_sort()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SortTableRequest* temp = op_.sort_; + ::io::deephaven::proto::backplane::grpc::SortTableRequest* temp = op_.sort_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23084,7 +22607,7 @@ inline ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* BatchTableReq // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head) if (_internal_has_head()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* temp = op_.head_; + ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* temp = op_.head_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23158,7 +22681,7 @@ inline ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* BatchTableReq // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail) if (_internal_has_tail()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* temp = op_.tail_; + ::io::deephaven::proto::backplane::grpc::HeadOrTailRequest* temp = op_.tail_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23232,7 +22755,7 @@ inline ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* BatchTableR // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head_by) if (_internal_has_head_by()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* temp = op_.head_by_; + ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* temp = op_.head_by_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23306,7 +22829,7 @@ inline ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* BatchTableR // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail_by) if (_internal_has_tail_by()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* temp = op_.tail_by_; + ::io::deephaven::proto::backplane::grpc::HeadOrTailByRequest* temp = op_.tail_by_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23380,7 +22903,7 @@ inline ::io::deephaven::proto::backplane::grpc::UngroupRequest* BatchTableReques // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.ungroup) if (_internal_has_ungroup()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::UngroupRequest* temp = op_.ungroup_; + ::io::deephaven::proto::backplane::grpc::UngroupRequest* temp = op_.ungroup_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23454,7 +22977,7 @@ inline ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* BatchTableRe // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.merge) if (_internal_has_merge()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* temp = op_.merge_; + ::io::deephaven::proto::backplane::grpc::MergeTablesRequest* temp = op_.merge_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23528,7 +23051,7 @@ inline ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.combo_aggregate) if (_internal_has_combo_aggregate()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* temp = op_.combo_aggregate_; + ::io::deephaven::proto::backplane::grpc::ComboAggregateRequest* temp = op_.combo_aggregate_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23602,7 +23125,7 @@ inline ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* BatchTable // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.snapshot) if (_internal_has_snapshot()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* temp = op_.snapshot_; + ::io::deephaven::proto::backplane::grpc::SnapshotTableRequest* temp = op_.snapshot_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23676,7 +23199,7 @@ inline ::io::deephaven::proto::backplane::grpc::FlattenRequest* BatchTableReques // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.flatten) if (_internal_has_flatten()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::FlattenRequest* temp = op_.flatten_; + ::io::deephaven::proto::backplane::grpc::FlattenRequest* temp = op_.flatten_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23750,7 +23273,7 @@ inline ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* Batch // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.run_chart_downsample) if (_internal_has_run_chart_downsample()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* temp = op_.run_chart_downsample_; + ::io::deephaven::proto::backplane::grpc::RunChartDownsampleRequest* temp = op_.run_chart_downsample_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23824,7 +23347,7 @@ inline ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* BatchTab // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.cross_join) if (_internal_has_cross_join()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* temp = op_.cross_join_; + ::io::deephaven::proto::backplane::grpc::CrossJoinTablesRequest* temp = op_.cross_join_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23898,7 +23421,7 @@ inline ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* BatchT // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.natural_join) if (_internal_has_natural_join()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* temp = op_.natural_join_; + ::io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest* temp = op_.natural_join_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -23972,7 +23495,7 @@ inline ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* BatchTab // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.exact_join) if (_internal_has_exact_join()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* temp = op_.exact_join_; + ::io::deephaven::proto::backplane::grpc::ExactJoinTablesRequest* temp = op_.exact_join_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24046,7 +23569,7 @@ inline ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.left_join) if (_internal_has_left_join()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* temp = op_.left_join_; + ::io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest* temp = op_.left_join_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24120,7 +23643,7 @@ inline ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* BatchTabl // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.as_of_join) if (_internal_has_as_of_join()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* temp = op_.as_of_join_; + ::io::deephaven::proto::backplane::grpc::AsOfJoinTablesRequest* temp = op_.as_of_join_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24194,7 +23717,7 @@ inline ::io::deephaven::proto::backplane::grpc::FetchTableRequest* BatchTableReq // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_table) if (_internal_has_fetch_table()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::FetchTableRequest* temp = op_.fetch_table_; + ::io::deephaven::proto::backplane::grpc::FetchTableRequest* temp = op_.fetch_table_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24268,7 +23791,7 @@ inline ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* BatchTa // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_pandas_table) if (_internal_has_fetch_pandas_table()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* temp = op_.fetch_pandas_table_; + ::io::deephaven::proto::backplane::grpc::FetchPandasTableRequest* temp = op_.fetch_pandas_table_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24342,7 +23865,7 @@ inline ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* Batc // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.apply_preview_columns) if (_internal_has_apply_preview_columns()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* temp = op_.apply_preview_columns_; + ::io::deephaven::proto::backplane::grpc::ApplyPreviewColumnsRequest* temp = op_.apply_preview_columns_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24416,7 +23939,7 @@ inline ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* BatchTa // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.create_input_table) if (_internal_has_create_input_table()) { clear_has_op(); - ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* temp = op_.create_input_table_; + ::io::deephaven::proto::backplane::grpc::CreateInputTableRequest* temp = op_.create_input_table_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } @@ -24624,10 +24147,6 @@ BatchTableRequest::ops() const { // ------------------------------------------------------------------- -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - // @@protoc_insertion_point(namespace_scope) diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.cc index 5bf4ac3bc22..213a92c6cfd 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/ticket.proto diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.h index 97f4ffbb538..3e7ff090aab 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.grpc.pb.h @@ -1,20 +1,15 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: deephaven/proto/ticket.proto // Original file comments: // -// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending -// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending #ifndef GRPC_deephaven_2fproto_2fticket_2eproto__INCLUDED #define GRPC_deephaven_2fproto_2fticket_2eproto__INCLUDED #include "deephaven/proto/ticket.pb.h" #include -#include #include #include #include diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.cc b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.cc index 84d77fda93c..b20da6a67f3 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.cc +++ b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.cc @@ -1,6 +1,3 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/ticket.proto @@ -19,46 +16,50 @@ #include PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + namespace io { namespace deephaven { namespace proto { namespace backplane { namespace grpc { -constexpr Ticket::Ticket( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : ticket_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +PROTOBUF_CONSTEXPR Ticket::Ticket( + ::_pbi::ConstantInitialized) + : ticket_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){} struct TicketDefaultTypeInternal { - constexpr TicketDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TicketDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TicketDefaultTypeInternal() {} union { Ticket _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TicketDefaultTypeInternal _Ticket_default_instance_; -constexpr TypedTicket::TypedTicket( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TicketDefaultTypeInternal _Ticket_default_instance_; +PROTOBUF_CONSTEXPR TypedTicket::TypedTicket( + ::_pbi::ConstantInitialized) + : type_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}) , ticket_(nullptr){} struct TypedTicketDefaultTypeInternal { - constexpr TypedTicketDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR TypedTicketDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} ~TypedTicketDefaultTypeInternal() {} union { TypedTicket _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TypedTicketDefaultTypeInternal _TypedTicket_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypedTicketDefaultTypeInternal _TypedTicket_default_instance_; } // namespace grpc } // namespace backplane } // namespace proto } // namespace deephaven } // namespace io -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_deephaven_2fproto_2fticket_2eproto[2]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fticket_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fticket_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_deephaven_2fproto_2fticket_2eproto[2]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_deephaven_2fproto_2fticket_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_deephaven_2fproto_2fticket_2eproto = nullptr; -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fticket_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_deephaven_2fproto_2fticket_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::Ticket, _internal_metadata_), ~0u, // no _extensions_ @@ -75,14 +76,14 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_deephaven_2fproto_2fticket_2ep PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TypedTicket, ticket_), PROTOBUF_FIELD_OFFSET(::io::deephaven::proto::backplane::grpc::TypedTicket, type_), }; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::Ticket)}, { 7, -1, -1, sizeof(::io::deephaven::proto::backplane::grpc::TypedTicket)}, }; -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_), - reinterpret_cast(&::io::deephaven::proto::backplane::grpc::_TypedTicket_default_instance_), +static const ::_pb::Message* const file_default_instances[] = { + &::io::deephaven::proto::backplane::grpc::_Ticket_default_instance_._instance, + &::io::deephaven::proto::backplane::grpc::_TypedTicket_default_instance_._instance, }; const char descriptor_table_protodef_deephaven_2fproto_2fticket_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -92,19 +93,21 @@ const char descriptor_table_protodef_deephaven_2fproto_2fticket_2eproto[] PROTOB "(\0132).io.deephaven.proto.backplane.grpc.T" "icket\022\014\n\004type\030\002 \001(\tB\004H\001P\001b\006proto3" ; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_deephaven_2fproto_2fticket_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fticket_2eproto = { - false, false, 193, descriptor_table_protodef_deephaven_2fproto_2fticket_2eproto, "deephaven/proto/ticket.proto", - &descriptor_table_deephaven_2fproto_2fticket_2eproto_once, nullptr, 0, 2, - schemas, file_default_instances, TableStruct_deephaven_2fproto_2fticket_2eproto::offsets, - file_level_metadata_deephaven_2fproto_2fticket_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fticket_2eproto, file_level_service_descriptors_deephaven_2fproto_2fticket_2eproto, +static ::_pbi::once_flag descriptor_table_deephaven_2fproto_2fticket_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_deephaven_2fproto_2fticket_2eproto = { + false, false, 193, descriptor_table_protodef_deephaven_2fproto_2fticket_2eproto, + "deephaven/proto/ticket.proto", + &descriptor_table_deephaven_2fproto_2fticket_2eproto_once, nullptr, 0, 2, + schemas, file_default_instances, TableStruct_deephaven_2fproto_2fticket_2eproto::offsets, + file_level_metadata_deephaven_2fproto_2fticket_2eproto, file_level_enum_descriptors_deephaven_2fproto_2fticket_2eproto, + file_level_service_descriptors_deephaven_2fproto_2fticket_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_deephaven_2fproto_2fticket_2eproto_getter() { +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_deephaven_2fproto_2fticket_2eproto_getter() { return &descriptor_table_deephaven_2fproto_2fticket_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fticket_2eproto(&descriptor_table_deephaven_2fproto_2fticket_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_deephaven_2fproto_2fticket_2eproto(&descriptor_table_deephaven_2fproto_2fticket_2eproto); namespace io { namespace deephaven { namespace proto { @@ -121,51 +124,50 @@ Ticket::Ticket(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.Ticket) } Ticket::Ticket(const Ticket& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ticket_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ticket_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + ticket_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_ticket().empty()) { - ticket_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ticket(), + ticket_.Set(from._internal_ticket(), GetArenaForAllocation()); } // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.Ticket) } -void Ticket::SharedCtor() { -ticket_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void Ticket::SharedCtor() { +ticket_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + ticket_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } Ticket::~Ticket() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.Ticket) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void Ticket::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - ticket_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ticket_.Destroy(); } -void Ticket::ArenaDtor(void* object) { - Ticket* _this = reinterpret_cast< Ticket* >(object); - (void)_this; -} -void Ticket::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void Ticket::SetCachedSize(int size) const { _cached_size_.Set(size); } void Ticket::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.Ticket) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -173,17 +175,17 @@ void Ticket::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Ticket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Ticket::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // bytes ticket = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { auto str = _internal_mutable_ticket(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -211,10 +213,10 @@ const char* Ticket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::int #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* Ticket::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* Ticket::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.Ticket) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // bytes ticket = 1; @@ -224,7 +226,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Ticket::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.Ticket) @@ -235,7 +237,7 @@ size_t Ticket::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.Ticket) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -265,7 +267,7 @@ void Ticket::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void Ticket::MergeFrom(const Ticket& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.Ticket) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_ticket().empty()) { @@ -291,14 +293,13 @@ void Ticket::InternalSwap(Ticket* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &ticket_, lhs_arena, &other->ticket_, rhs_arena ); } ::PROTOBUF_NAMESPACE_ID::Metadata Ticket::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fticket_2eproto_getter, &descriptor_table_deephaven_2fproto_2fticket_2eproto_once, file_level_metadata_deephaven_2fproto_2fticket_2eproto[0]); } @@ -318,17 +319,17 @@ TypedTicket::TypedTicket(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } // @@protoc_insertion_point(arena_constructor:io.deephaven.proto.backplane.grpc.TypedTicket) } TypedTicket::TypedTicket(const TypedTicket& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_type().empty()) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(), + type_.Set(from._internal_type(), GetArenaForAllocation()); } if (from._internal_has_ticket()) { @@ -339,37 +340,36 @@ TypedTicket::TypedTicket(const TypedTicket& from) // @@protoc_insertion_point(copy_constructor:io.deephaven.proto.backplane.grpc.TypedTicket) } -void TypedTicket::SharedCtor() { -type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +inline void TypedTicket::SharedCtor() { +type_.InitDefault(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + type_.Set("", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING ticket_ = nullptr; } TypedTicket::~TypedTicket() { // @@protoc_insertion_point(destructor:io.deephaven.proto.backplane.grpc.TypedTicket) - if (GetArenaForAllocation() != nullptr) return; + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } inline void TypedTicket::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + type_.Destroy(); if (this != internal_default_instance()) delete ticket_; } -void TypedTicket::ArenaDtor(void* object) { - TypedTicket* _this = reinterpret_cast< TypedTicket* >(object); - (void)_this; -} -void TypedTicket::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} void TypedTicket::SetCachedSize(int size) const { _cached_size_.Set(size); } void TypedTicket::Clear() { // @@protoc_insertion_point(message_clear_start:io.deephaven.proto.backplane.grpc.TypedTicket) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -381,15 +381,15 @@ void TypedTicket::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TypedTicket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* TypedTicket::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_ticket(), ptr); CHK_(ptr); } else @@ -397,11 +397,11 @@ const char* TypedTicket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID continue; // string type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TypedTicket.type")); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "io.deephaven.proto.backplane.grpc.TypedTicket.type")); } else goto handle_unusual; continue; @@ -428,18 +428,17 @@ const char* TypedTicket::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* TypedTicket::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +uint8_t* TypedTicket::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:io.deephaven.proto.backplane.grpc.TypedTicket) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; // .io.deephaven.proto.backplane.grpc.Ticket ticket = 1; if (this->_internal_has_ticket()) { - target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::ticket(this), target, stream); + InternalWriteMessage(1, _Internal::ticket(this), + _Internal::ticket(this).GetCachedSize(), target, stream); } // string type = 2; @@ -453,7 +452,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* TypedTicket::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:io.deephaven.proto.backplane.grpc.TypedTicket) @@ -464,7 +463,7 @@ size_t TypedTicket::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:io.deephaven.proto.backplane.grpc.TypedTicket) size_t total_size = 0; - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -501,7 +500,7 @@ void TypedTicket::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, void TypedTicket::MergeFrom(const TypedTicket& from) { // @@protoc_insertion_point(class_specific_merge_from_start:io.deephaven.proto.backplane.grpc.TypedTicket) GOOGLE_DCHECK_NE(&from, this); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_type().empty()) { @@ -530,7 +529,6 @@ void TypedTicket::InternalSwap(TypedTicket* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &type_, lhs_arena, &other->type_, rhs_arena ); @@ -538,7 +536,7 @@ void TypedTicket::InternalSwap(TypedTicket* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata TypedTicket::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + return ::_pbi::AssignDescriptors( &descriptor_table_deephaven_2fproto_2fticket_2eproto_getter, &descriptor_table_deephaven_2fproto_2fticket_2eproto_once, file_level_metadata_deephaven_2fproto_2fticket_2eproto[1]); } @@ -550,10 +548,12 @@ ::PROTOBUF_NAMESPACE_ID::Metadata TypedTicket::GetMetadata() const { } // namespace deephaven } // namespace io PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Ticket* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Ticket >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::Ticket* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::Ticket >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::Ticket >(arena); } -template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TypedTicket* Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TypedTicket >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::io::deephaven::proto::backplane::grpc::TypedTicket* +Arena::CreateMaybeMessage< ::io::deephaven::proto::backplane::grpc::TypedTicket >(Arena* arena) { return Arena::CreateMessageInternal< ::io::deephaven::proto::backplane::grpc::TypedTicket >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.h b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.h index 34c2283bc90..effd1066b8b 100644 --- a/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.h +++ b/cpp-client/deephaven/client/proto/deephaven/proto/ticket.pb.h @@ -1,6 +1,3 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: deephaven/proto/ticket.proto @@ -11,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3018000 +#if PROTOBUF_VERSION < 3020000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -26,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -45,15 +41,7 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_deephaven_2fproto_2fticket_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; + static const uint32_t offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_deephaven_2fproto_2fticket_2eproto; namespace io { @@ -89,7 +77,7 @@ class Ticket final : public: inline Ticket() : Ticket(nullptr) {} ~Ticket() override; - explicit constexpr Ticket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Ticket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Ticket(const Ticket& from); Ticket(Ticket&& from) noexcept @@ -139,7 +127,12 @@ class Ticket final : } inline void Swap(Ticket* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -153,11 +146,7 @@ class Ticket final : // implements Message ---------------------------------------------- - inline Ticket* New() const final { - return new Ticket(); - } - - Ticket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + Ticket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -172,8 +161,8 @@ class Ticket final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -181,6 +170,8 @@ class Ticket final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Ticket* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.Ticket"; @@ -188,9 +179,6 @@ class Ticket final : protected: explicit Ticket(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -211,7 +199,7 @@ class Ticket final : template void set_ticket(ArgT0&& arg0, ArgT... args); std::string* mutable_ticket(); - PROTOBUF_MUST_USE_RESULT std::string* release_ticket(); + PROTOBUF_NODISCARD std::string* release_ticket(); void set_allocated_ticket(std::string* ticket); private: const std::string& _internal_ticket() const; @@ -237,7 +225,7 @@ class TypedTicket final : public: inline TypedTicket() : TypedTicket(nullptr) {} ~TypedTicket() override; - explicit constexpr TypedTicket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR TypedTicket(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); TypedTicket(const TypedTicket& from); TypedTicket(TypedTicket&& from) noexcept @@ -287,7 +275,12 @@ class TypedTicket final : } inline void Swap(TypedTicket* other) { if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -301,11 +294,7 @@ class TypedTicket final : // implements Message ---------------------------------------------- - inline TypedTicket* New() const final { - return new TypedTicket(); - } - - TypedTicket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + TypedTicket* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; @@ -320,8 +309,8 @@ class TypedTicket final : size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: @@ -329,6 +318,8 @@ class TypedTicket final : void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TypedTicket* other); + + private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "io.deephaven.proto.backplane.grpc.TypedTicket"; @@ -336,9 +327,6 @@ class TypedTicket final : protected: explicit TypedTicket(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -360,7 +348,7 @@ class TypedTicket final : template void set_type(ArgT0&& arg0, ArgT... args); std::string* mutable_type(); - PROTOBUF_MUST_USE_RESULT std::string* release_type(); + PROTOBUF_NODISCARD std::string* release_type(); void set_allocated_type(std::string* type); private: const std::string& _internal_type() const; @@ -375,7 +363,7 @@ class TypedTicket final : public: void clear_ticket(); const ::io::deephaven::proto::backplane::grpc::Ticket& ticket() const; - PROTOBUF_MUST_USE_RESULT ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); + PROTOBUF_NODISCARD ::io::deephaven::proto::backplane::grpc::Ticket* release_ticket(); ::io::deephaven::proto::backplane::grpc::Ticket* mutable_ticket(); void set_allocated_ticket(::io::deephaven::proto::backplane::grpc::Ticket* ticket); private: @@ -421,7 +409,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Ticket::set_ticket(ArgT0&& arg0, ArgT... args) { - ticket_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + ticket_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.Ticket.ticket) } inline std::string* Ticket::mutable_ticket() { @@ -434,15 +422,15 @@ inline const std::string& Ticket::_internal_ticket() const { } inline void Ticket::_internal_set_ticket(const std::string& value) { - ticket_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + ticket_.Set(value, GetArenaForAllocation()); } inline std::string* Ticket::_internal_mutable_ticket() { - return ticket_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return ticket_.Mutable(GetArenaForAllocation()); } inline std::string* Ticket::release_ticket() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.Ticket.ticket) - return ticket_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return ticket_.Release(); } inline void Ticket::set_allocated_ticket(std::string* ticket) { if (ticket != nullptr) { @@ -450,8 +438,12 @@ inline void Ticket::set_allocated_ticket(std::string* ticket) { } else { } - ticket_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ticket, - GetArenaForAllocation()); + ticket_.SetAllocated(ticket, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (ticket_.IsDefault()) { + ticket_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.Ticket.ticket) } @@ -536,7 +528,7 @@ inline void TypedTicket::set_allocated_ticket(::io::deephaven::proto::backplane: } if (ticket) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::io::deephaven::proto::backplane::grpc::Ticket>::GetOwningArena(ticket); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(ticket); if (message_arena != submessage_arena) { ticket = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, ticket, submessage_arena); @@ -561,7 +553,7 @@ template inline PROTOBUF_ALWAYS_INLINE void TypedTicket::set_type(ArgT0&& arg0, ArgT... args) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:io.deephaven.proto.backplane.grpc.TypedTicket.type) } inline std::string* TypedTicket::mutable_type() { @@ -574,15 +566,15 @@ inline const std::string& TypedTicket::_internal_type() const { } inline void TypedTicket::_internal_set_type(const std::string& value) { - type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + type_.Set(value, GetArenaForAllocation()); } inline std::string* TypedTicket::_internal_mutable_type() { - return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return type_.Mutable(GetArenaForAllocation()); } inline std::string* TypedTicket::release_type() { // @@protoc_insertion_point(field_release:io.deephaven.proto.backplane.grpc.TypedTicket.type) - return type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return type_.Release(); } inline void TypedTicket::set_allocated_type(std::string* type) { if (type != nullptr) { @@ -590,8 +582,12 @@ inline void TypedTicket::set_allocated_type(std::string* type) { } else { } - type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type, - GetArenaForAllocation()); + type_.SetAllocated(type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (type_.IsDefault()) { + type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:io.deephaven.proto.backplane.grpc.TypedTicket.type) } diff --git a/cpp-client/deephaven/client/src/chunk/chunk.cc b/cpp-client/deephaven/client/src/chunk/chunk.cc new file mode 100644 index 00000000000..af0432688db --- /dev/null +++ b/cpp-client/deephaven/client/src/chunk/chunk.cc @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/chunk/chunk.h" + +#include "deephaven/client/utility/utility.h" + +using deephaven::client::utility::separatedList; +using deephaven::client::utility::stringf; + +namespace deephaven::client::chunk { +void Chunk::checkSize(size_t proposedSize, std::string_view what) const { + if (proposedSize > size_) { + auto message = stringf("%o: new size > size (%o > %o)", what, proposedSize, size_); + throw std::runtime_error(message); + } +} + +namespace { +struct MyVisitor { + template + Chunk &operator()(T &arg) { + return arg; + } +}; + +struct MyConstVisitor { + template + const Chunk &operator()(const T &arg) const { + return arg; + } +}; +} // namespace + +Chunk &AnyChunk::unwrap() { + MyVisitor v; + return std::visit(v, variant_); +} + +const Chunk &AnyChunk::unwrap() const { + MyConstVisitor v; + return std::visit(v, variant_); +} +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/src/chunk/chunk_filler.cc b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc new file mode 100644 index 00000000000..b49c2cb3e20 --- /dev/null +++ b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/chunk/chunk_filler.h" + +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/impl/util.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::stringf; +using deephaven::client::utility::verboseCast; +using deephaven::client::container::RowSequence; + +namespace deephaven::client::chunk { +namespace { +struct Visitor final : arrow::ArrayVisitor { + Visitor(const RowSequence &keys, Chunk *dest) : keys_(keys), dest_(dest) {} + + arrow::Status Visit(const arrow::Int32Array &array) final { + return fillNumericChunk(array); + } + + arrow::Status Visit(const arrow::Int64Array &array) final { + return fillNumericChunk(array); + } + + arrow::Status Visit(const arrow::UInt64Array &array) final { + return fillNumericChunk(array); + } + + arrow::Status Visit(const arrow::DoubleArray &array) final { + return fillNumericChunk(array); + } + + template + arrow::Status fillNumericChunk(const TArrowAray &array) { + auto *typedDest = verboseCast*>(dest_, DEEPHAVEN_PRETTY_FUNCTION); + checkSize(typedDest->size()); + size_t destIndex = 0; + auto copyChunk = [&destIndex, &array, typedDest](uint64_t begin, uint64_t end) { + for (auto current = begin; current != end; ++current) { + if (array.IsNull(current)) { + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Not handling nulls yet")); + } + auto val = array.Value((int64_t)current); + typedDest->data()[destIndex] = val; + ++destIndex; + } + }; + keys_.forEachChunk(copyChunk); + return arrow::Status::OK(); + } + + void checkSize(size_t destSize) { + if (destSize < keys_.size()) { + throw std::runtime_error( + DEEPHAVEN_DEBUG_MSG(stringf("destSize < keys_.size() (%d < %d)", destSize, keys_.size()))); + } + } + + const RowSequence &keys_; + Chunk *const dest_; +}; +} // namespace + +void ChunkFiller::fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *dest) { + Visitor visitor(keys, dest); + okOrThrow(DEEPHAVEN_EXPR_MSG(src.Accept(&visitor))); +} +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/src/chunk/chunk_maker.cc b/cpp-client/deephaven/client/src/chunk/chunk_maker.cc new file mode 100644 index 00000000000..a8287ee14a9 --- /dev/null +++ b/cpp-client/deephaven/client/src/chunk/chunk_maker.cc @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/chunk/chunk_maker.h" + +#include "deephaven/client/column/column_source.h" + +using deephaven::client::column::ColumnSourceVisitor; +using deephaven::client::column::DoubleColumnSource; +using deephaven::client::column::FloatColumnSource; +using deephaven::client::column::Int8ColumnSource; +using deephaven::client::column::Int16ColumnSource; +using deephaven::client::column::Int32ColumnSource; +using deephaven::client::column::Int64ColumnSource; +using deephaven::client::column::StringColumnSource; + +namespace deephaven::client::chunk { +namespace { +struct Visitor final : ColumnSourceVisitor { + explicit Visitor(size_t chunkSize) : chunkSize_(chunkSize) {} + + void visit(const Int8ColumnSource &source) final { + result_ = Int8Chunk::create(chunkSize_); + } + + void visit(const Int16ColumnSource &source) final { + result_ = Int16Chunk::create(chunkSize_); + } + + void visit(const Int32ColumnSource &source) final { + result_ = Int32Chunk::create(chunkSize_); + } + + void visit(const Int64ColumnSource &source) final { + result_ = Int64Chunk::create(chunkSize_); + } + + void visit(const FloatColumnSource &source) final { + result_ = FloatChunk::create(chunkSize_); + } + + void visit(const DoubleColumnSource &source) final { + result_ = DoubleChunk::create(chunkSize_); + } + + void visit(const StringColumnSource &source) final { + result_ = StringChunk::create(chunkSize_); + } + + size_t chunkSize_; + AnyChunk result_; +}; +} // namespace + +AnyChunk ChunkMaker::createChunkFor(const ColumnSource &columnSource, + size_t chunkSize) { + Visitor v(chunkSize); + columnSource.acceptVisitor(&v); + return std::move(v.result_); +} +} // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/src/highlevel/client.cc b/cpp-client/deephaven/client/src/client.cc similarity index 94% rename from cpp-client/deephaven/client/src/highlevel/client.cc rename to cpp-client/deephaven/client/src/client.cc index 70d0a735cc5..1afeb93bba8 100644 --- a/cpp-client/deephaven/client/src/highlevel/client.cc +++ b/cpp-client/deephaven/client/src/client.cc @@ -1,17 +1,18 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include #include -#include "deephaven/client/highlevel/impl/columns_impl.h" -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" -#include "deephaven/client/highlevel/impl/aggregate_impl.h" -#include "deephaven/client/highlevel/impl/client_impl.h" -#include "deephaven/client/highlevel/impl/table_handle_impl.h" -#include "deephaven/client/highlevel/impl/table_handle_manager_impl.h" -#include "deephaven/client/highlevel/columns.h" +#include "deephaven/client/columns.h" +#include "deephaven/client/impl/columns_impl.h" +#include "deephaven/client/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/aggregate_impl.h" +#include "deephaven/client/impl/client_impl.h" +#include "deephaven/client/impl/table_handle_impl.h" +#include "deephaven/client/impl/table_handle_manager_impl.h" +#include "deephaven/client/subscription/subscription_handle.h" #include "deephaven/client/utility/utility.h" using grpc::Channel; @@ -21,15 +22,16 @@ using io::deephaven::proto::backplane::grpc::ComboAggregateRequest; using io::deephaven::proto::backplane::grpc::HandshakeRequest; using io::deephaven::proto::backplane::grpc::HandshakeResponse; using io::deephaven::proto::backplane::grpc::Ticket; -using deephaven::client::lowlevel::Server; -using deephaven::client::highlevel::Column; -using deephaven::client::highlevel::DateTimeCol; -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::StrCol; -using deephaven::client::highlevel::impl::StrColImpl; -using deephaven::client::highlevel::impl::AggregateComboImpl; -using deephaven::client::highlevel::impl::AggregateImpl; -using deephaven::client::highlevel::impl::ClientImpl; +using deephaven::client::server::Server; +using deephaven::client::Column; +using deephaven::client::DateTimeCol; +using deephaven::client::NumCol; +using deephaven::client::StrCol; +using deephaven::client::impl::StrColImpl; +using deephaven::client::impl::AggregateComboImpl; +using deephaven::client::impl::AggregateImpl; +using deephaven::client::impl::ClientImpl; +using deephaven::client::subscription::SubscriptionHandle; using deephaven::client::utility::Executor; using deephaven::client::utility::SimpleOstringstream; using deephaven::client::utility::SFCallback; @@ -37,9 +39,7 @@ using deephaven::client::utility::separatedList; using deephaven::client::utility::stringf; using deephaven::client::utility::okOrThrow; -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace { void printTableData(std::ostream &s, const TableHandle &tableHandle, bool wantHeaders); } // namespace @@ -521,11 +521,12 @@ std::shared_ptr TableHandle::getFlightStreamR return getManager().createFlightWrapper().getFlightStreamReader(*this); } -void TableHandle::subscribe(std::shared_ptr callback) { - impl_->subscribe(std::move(callback)); +std::shared_ptr TableHandle::subscribe( + std::shared_ptr callback, bool wantImmer) { + return impl_->subscribe(std::move(callback), wantImmer); } -void TableHandle::unsubscribe(std::shared_ptr callback) { +void TableHandle::unsubscribe(std::shared_ptr callback) { impl_->unsubscribe(std::move(callback)); } @@ -544,7 +545,7 @@ std::ostream &operator<<(std::ostream &s, const TableHandleStreamAdaptor &o) { } std::string ConvertToString::toString( - const deephaven::client::highlevel::SelectColumn &selectColumn) { + const deephaven::client::SelectColumn &selectColumn) { SimpleOstringstream oss; selectColumn.getIrisRepresentableImpl()->streamIrisRepresentation(oss); return std::move(oss.str()); @@ -586,6 +587,5 @@ void printTableData(std::ostream &s, const TableHandle &tableHandle, bool wantHe } } } // namespace -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client + diff --git a/cpp-client/deephaven/client/src/column/column_source.cc b/cpp-client/deephaven/client/src/column/column_source.cc new file mode 100644 index 00000000000..616d795eaf9 --- /dev/null +++ b/cpp-client/deephaven/client/src/column/column_source.cc @@ -0,0 +1,9 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/column/column_source.h" + +namespace deephaven::client::column { +ColumnSource::~ColumnSource() = default; +MutableColumnSource::~MutableColumnSource() = default; +} // namespace deephaven::client::column diff --git a/cpp-client/deephaven/client/src/highlevel/columns.cc b/cpp-client/deephaven/client/src/columns.cc similarity index 88% rename from cpp-client/deephaven/client/src/highlevel/columns.cc rename to cpp-client/deephaven/client/src/columns.cc index 08093de0309..9f0cc07346f 100644 --- a/cpp-client/deephaven/client/src/highlevel/columns.cc +++ b/cpp-client/deephaven/client/src/columns.cc @@ -1,13 +1,11 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/columns.h" +#include "deephaven/client/columns.h" -#include "deephaven/client/highlevel/impl/columns_impl.h" +#include "deephaven/client/impl/columns_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { IrisRepresentable::~IrisRepresentable() = default; SelectColumn::~SelectColumn() = default; @@ -15,10 +13,11 @@ MatchWithColumn::~MatchWithColumn() = default; Column::Column(std::shared_ptr impl) : IrisRepresentable(impl), SelectColumn(impl), MatchWithColumn(impl) {} + Column::~Column() = default; -const std::string & Column::name() const { - return dynamic_cast(impl_.get())->name(); +const std::string &Column::name() const { + return dynamic_cast(impl_.get())->name(); } SortPair Column::ascending(bool abs) const { @@ -47,6 +46,7 @@ SortPair SortPair::descending(const Column &column, bool abs) { SortPair::SortPair(std::string column, SortDirection direction, bool abs) : column_(std::move(column)), direction_(direction), abs_(abs) {} + SortPair::~SortPair() = default; NumCol NumCol::create(std::string name) { @@ -56,6 +56,7 @@ NumCol NumCol::create(std::string name) { NumCol::NumCol(std::shared_ptr impl) : IrisRepresentable(impl), NumericExpression(impl), Column(std::move(impl)) {} + NumCol::~NumCol() = default; StrCol StrCol::create(std::string name) { @@ -65,14 +66,17 @@ StrCol StrCol::create(std::string name) { StrCol::StrCol(std::shared_ptr impl) : IrisRepresentable(impl), StringExpression(impl), Column(std::move(impl)) {} + StrCol::~StrCol() = default; DateTimeCol DateTimeCol::create(std::string name) { auto impl = impl::DateTimeColImpl::create(std::move(name)); return DateTimeCol(std::move(impl)); } + DateTimeCol::DateTimeCol(std::shared_ptr impl) : IrisRepresentable(impl), DateTimeExpression(impl), Column(std::move(impl)) {} + DateTimeCol::~DateTimeCol() = default; AssignedColumn AssignedColumn::create(std::string name, @@ -83,8 +87,6 @@ AssignedColumn AssignedColumn::create(std::string name, AssignedColumn::AssignedColumn(std::shared_ptr impl) : IrisRepresentable(impl), SelectColumn(impl), impl_(std::move(impl)) {} -AssignedColumn::~AssignedColumn() = default; -} // namespace highlevel -} // namespace client -} // namespace deephaven +AssignedColumn::~AssignedColumn() = default; +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/container/row_sequence.cc b/cpp-client/deephaven/client/src/container/row_sequence.cc new file mode 100644 index 00000000000..a1b20478da9 --- /dev/null +++ b/cpp-client/deephaven/client/src/container/row_sequence.cc @@ -0,0 +1,255 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::utility::stringf; + +namespace deephaven::client::container { +std::shared_ptr RowSequence::createEmpty() { + return RowSequenceBuilder().build(); +} + +std::shared_ptr RowSequence::createSequential(uint64_t begin, uint64_t end) { + RowSequenceBuilder builder; + builder.addRange(begin, end); + return builder.build(); +} + +RowSequence::~RowSequence() = default; + +std::ostream &operator<<(std::ostream &s, const RowSequence &o) { + s << '['; + auto iter = o.getRowSequenceIterator(); + const char *sep = ""; + uint64_t item; + while (iter->tryGetNext(&item)) { + s << sep << item; + sep = ", "; + } + s << ']'; + return s; +} + +namespace { +class MyRowSequence final : public RowSequence { + // begin->end + typedef std::map ranges_t; +public: + MyRowSequence(std::shared_ptr ranges, ranges_t::const_iterator beginp, + size_t entryOffset, size_t size); + ~MyRowSequence() final = default; + std::shared_ptr getRowSequenceIterator() const final; + + std::shared_ptr take(size_t size) const final; + std::shared_ptr drop(size_t size) const final; + + void forEachChunk(const std::function &f) const final; + + size_t size() const final { + return size_; + } + +private: + std::shared_ptr ranges_; + ranges_t::const_iterator beginp_; + size_t entryOffset_ = 0; + size_t size_ = 0; +}; + +class MyRowSequenceIterator final : public RowSequenceIterator { + typedef std::map ranges_t; +public: + MyRowSequenceIterator(std::shared_ptr ranges, ranges_t::const_iterator currentp, + size_t currentOffset, size_t size); + ~MyRowSequenceIterator() final = default; + bool tryGetNext(uint64_t *result) final; + +private: + std::shared_ptr ranges_; + ranges_t::const_iterator current_; + size_t currentOffset_ = 0; + size_t size_ = 0; +}; +} // namespace + +RowSequenceIterator::~RowSequenceIterator() = default; +RowSequenceBuilder::RowSequenceBuilder() = default; +RowSequenceBuilder::~RowSequenceBuilder() = default; + +void RowSequenceBuilder::addRange(uint64_t begin, uint64_t end) { + if (begin > end) { + throw std::runtime_error(stringf("Malformed range [%o,%o)", begin, end)); + } + + if (begin == end) { + return; + } + + // First we look to the right to see if this range can be combined with the next range. + ranges_t::node_type node; + auto ip = ranges_.upper_bound(begin); + // We will use this below. + std::optional prevIp; + if (ip != ranges_.begin()) { + prevIp = std::prev(ip); + } + // ip points to the first element greater than begin, or it is end() + if (ip != ranges_.end()) { + // ip points to the first element greater than begin + // + // Example: + // Assuming our input [begin, end) is [3, 5) + // If the range to the right is [6, 9), then they are not connected. + // If the range to the right is [5, 9) then they abut and can be merged. + // If the range to the right is [4, 9] then this is an error. Our caller is not allowed to + // call us with overlapping ranges. + if (end > ip->first) { + // This is the [4, 9) error case from the example. + auto message = stringf("Looking right: new range [%o,%o) would overlap with existing range [%o, %o)", + begin, end, ip->first, ip->second); + throw std::runtime_error(message); + } + if (end == ip->first) { + // This is the [5, 9) "abutting" case in the example. + // Extend the range we are adding to include this range. + end = ip->second; + // Then extract the node. Ultimately we will either discard this node or change its key + // (the begin part of the range) and reinsert it. + node = ranges_.extract(ip); + // Now our input is [3, 9) and we've got "node" in a temporary variable whose heap storage + // we might reuse if we can. + } + } + + // At this point our input range is either the original or modified [begin, end), and we might + // have node storage that we can reuse. + + // Now we look to the left to see if the input range can be combined with the previous range. + if (prevIp.has_value()) { + ip = *prevIp; // convenient to move to this temporary + + // Example: our input is [3, 5) + // If the range to the left is [0, 2) then they are not connected. + // If the range to the left is [0, 3) then they abut, and we can just reset the right + // side of the left range to [0, 5]. + // If the range to the left is [0, 4) then this is an error due to overlap. + if (ip->second > begin) { + // This is the [0, 4) error case from the example. + auto message = stringf( + "Looking left: new range [%o,%o) would overlap with existing range [%o, %o)", + begin, end, ip->first, ip->second); + throw std::runtime_error(message); + } + + if (ip->second == begin) { + // This is the [0, 3) "abutting" case in the example. + // Extend the range we are adding to include this range. + // In our example we just reset the range to be [0, 5). + ip->second = end; + size_ += end - begin; + return; + } + } + + // If we get here, we were not able to merge with the left node. So we have an interval that + // needs to be inserted and we may or may not be able to reuse heap storage previous extracted + // from the right. + if (node.empty()) { + // We were not able to reuse any nodes + ranges_.insert(std::make_pair(begin, end)); + } else { + // We were able to reuse at least one node (if we merged on both sides, then we can reuse + // one node and discard one node). + node.key() = begin; + node.mapped() = end; + ranges_.insert(std::move(node)); + } + size_ += end - begin; +} + +std::shared_ptr RowSequenceBuilder::build() { + auto sp = std::make_shared(std::move(ranges_)); + auto begin = sp->begin(); + return std::make_shared(std::move(sp), begin, 0, size_); +} + +namespace { +MyRowSequence::MyRowSequence(std::shared_ptr ranges, ranges_t::const_iterator beginp, + size_t entryOffset, size_t size) : ranges_(std::move(ranges)), beginp_(beginp), + entryOffset_(entryOffset), size_(size) {} + +std::shared_ptr MyRowSequence::getRowSequenceIterator() const { + return std::make_shared(ranges_, beginp_, entryOffset_, size_); +} + +std::shared_ptr MyRowSequence::take(size_t size) const { + auto newSize = std::min(size, size_); + return std::make_shared(ranges_, beginp_, entryOffset_, newSize); +} + +std::shared_ptr MyRowSequence::drop(size_t size) const { + auto current = beginp_; + auto currentOffset = entryOffset_; + auto sizeToDrop = std::min(size, size_); + auto newSize = size_ - sizeToDrop; + while (sizeToDrop != 0) { + auto entrySize = current->second - current->first; + if (currentOffset == entrySize) { + ++current; + currentOffset = 0; + continue; + } + auto entryRemaining = entrySize - currentOffset; + auto amountToConsume = std::min(entryRemaining, sizeToDrop); + currentOffset += amountToConsume; + sizeToDrop -= amountToConsume; + } + return std::make_shared(ranges_, current, currentOffset, newSize); +} + +void MyRowSequence::forEachChunk(const std::function &f) + const { + // The code is similar to "drop" + auto current = beginp_; + auto currentOffset = entryOffset_; + auto remaining = size_; + while (remaining != 0) { + auto entrySize = current->second - current->first; + if (currentOffset == entrySize) { + ++current; + currentOffset = 0; + continue; + } + auto entryRemaining = entrySize - currentOffset; + auto amountToConsume = std::min(entryRemaining, remaining); + auto begin = current->first + currentOffset; + auto end = begin + amountToConsume; + currentOffset += amountToConsume; + remaining -= amountToConsume; + f(begin, end); + } +} + +MyRowSequenceIterator::MyRowSequenceIterator(std::shared_ptr ranges, + ranges_t::const_iterator current, size_t currentOffset, size_t size) : + ranges_(std::move(ranges)), current_(current), currentOffset_(currentOffset), size_(size) {} + +bool MyRowSequenceIterator::tryGetNext(uint64_t *result) { + while (size_ != 0) { + auto entrySize = current_->second - current_->first; + if (currentOffset_ < entrySize) { + *result = current_->first + currentOffset_; + ++currentOffset_; + --size_; + return true; + } + currentOffset_ = 0; + ++current_; + } + return false; +} +} // namespace +} // namespace deephaven::client::container + diff --git a/cpp-client/deephaven/client/src/highlevel/expressions.cc b/cpp-client/deephaven/client/src/expressions.cc similarity index 91% rename from cpp-client/deephaven/client/src/highlevel/expressions.cc rename to cpp-client/deephaven/client/src/expressions.cc index 6eccb89ebee..7dc60f88ddb 100644 --- a/cpp-client/deephaven/client/src/highlevel/expressions.cc +++ b/cpp-client/deephaven/client/src/expressions.cc @@ -1,19 +1,18 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/expressions.h" - -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" -#include "deephaven/client/highlevel/impl/datetime_expression_impl.h" -#include "deephaven/client/highlevel/impl/expression_impl.h" -#include "deephaven/client/highlevel/impl/numeric_expression_impl.h" -#include "deephaven/client/highlevel/impl/string_expression_impl.h" -#include "deephaven/client/highlevel/columns.h" - -namespace deephaven { -namespace client { -namespace highlevel { +#include "deephaven/client/expressions.h" + +#include "deephaven/client/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/datetime_expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" +#include "deephaven/client/impl/numeric_expression_impl.h" +#include "deephaven/client/impl/string_expression_impl.h" +#include "deephaven/client/columns.h" + +namespace deephaven::client { Expression::Expression(std::shared_ptr impl) : impl_(std::move(impl)) {} + Expression::~Expression() = default; AssignedColumn Expression::as(std::string columnName) const { @@ -30,7 +29,8 @@ BooleanExpression Expression::isNull() const { return BooleanExpression(std::move(resultImpl)); } -std::shared_ptr BooleanExpression::implAsBooleanExpressionImpl() const { +std::shared_ptr +BooleanExpression::implAsBooleanExpressionImpl() const { return std::dynamic_pointer_cast(impl_); } @@ -54,11 +54,11 @@ BooleanExpression operator|(const BooleanExpression &lhs, const BooleanExpressio NumericExpression::NumericExpression(std::shared_ptr impl) : Expression(std::move(impl)) {} -NumericExpression::NumericExpression(int value) : +NumericExpression::NumericExpression(int32_t value) : Expression(impl::NumericExpressionImpl::createInt64Literal(value)) { } -NumericExpression::NumericExpression(long value) : +NumericExpression::NumericExpression(int64_t value) : Expression(impl::NumericExpressionImpl::createInt64Literal(value)) { } @@ -72,7 +72,8 @@ NumericExpression::NumericExpression(double value) : NumericExpression::~NumericExpression() = default; -std::shared_ptr NumericExpression::implAsNumericExpressionImpl() const { +std::shared_ptr +NumericExpression::implAsNumericExpressionImpl() const { return std::dynamic_pointer_cast(impl_); } @@ -87,6 +88,7 @@ NumericExpression operator-(const NumericExpression &item) { item.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator~(const NumericExpression &item) { auto resultImpl = impl::NumericExpressionImpl::createUnaryOperator('~', item.implAsNumericExpressionImpl()); @@ -98,36 +100,43 @@ NumericExpression operator+(const NumericExpression &lhs, const NumericExpressio lhs.implAsNumericExpressionImpl(), '+', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator-(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '-', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator*(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '*', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator/(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '/', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator%(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '%', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator^(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '^', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator&(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '&', rhs.implAsNumericExpressionImpl()); return NumericExpression(std::move(resultImpl)); } + NumericExpression operator|(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createBinaryOperator( lhs.implAsNumericExpressionImpl(), '|', rhs.implAsNumericExpressionImpl()); @@ -139,26 +148,31 @@ BooleanExpression operator<(const NumericExpression &lhs, const NumericExpressio lhs.implAsNumericExpressionImpl(), "<", rhs.implAsNumericExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator<=(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createComparisonOperator( lhs.implAsNumericExpressionImpl(), "<=", rhs.implAsNumericExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator==(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createComparisonOperator( lhs.implAsNumericExpressionImpl(), "==", rhs.implAsNumericExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator!=(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createComparisonOperator( lhs.implAsNumericExpressionImpl(), "!=", rhs.implAsNumericExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>=(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createComparisonOperator( lhs.implAsNumericExpressionImpl(), ">=", rhs.implAsNumericExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>(const NumericExpression &lhs, const NumericExpression &rhs) { auto resultImpl = impl::NumericExpressionImpl::createComparisonOperator( lhs.implAsNumericExpressionImpl(), ">", rhs.implAsNumericExpressionImpl()); @@ -167,12 +181,17 @@ BooleanExpression operator>(const NumericExpression &lhs, const NumericExpressio StringExpression::StringExpression(const char *value) : StringExpression(impl::StringExpressionImpl::createLiteral(value)) {} + StringExpression::StringExpression(std::string_view value) : - StringExpression(impl::StringExpressionImpl::createLiteral(std::string(value.data(), value.size()))) {} + StringExpression( + impl::StringExpressionImpl::createLiteral(std::string(value.data(), value.size()))) {} + StringExpression::StringExpression(std::string value) : StringExpression(impl::StringExpressionImpl::createLiteral(std::move(value))) {} + StringExpression::StringExpression(std::shared_ptr impl) : Expression(std::move(impl)) {} + StringExpression::~StringExpression() = default; std::shared_ptr StringExpression::implAsStringExpressionImpl() const { @@ -182,7 +201,8 @@ std::shared_ptr StringExpression::implAsStringExpres namespace { BooleanExpression stringMethodHelper(const StringExpression &lhs, const char *method, const StringExpression &rhs) { - auto impl = impl::BooleanExpressionImpl::createBooleanValuedInstanceMethod(lhs.implAsStringExpressionImpl(), + auto impl = impl::BooleanExpressionImpl::createBooleanValuedInstanceMethod( + lhs.implAsStringExpressionImpl(), method, rhs.implAsExpressionImpl()); return BooleanExpression(std::move(impl)); } @@ -215,26 +235,31 @@ BooleanExpression operator<(const StringExpression &lhs, const StringExpression "<", rhs.implAsStringExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator<=(const StringExpression &lhs, const StringExpression &rhs) { auto resultImpl = impl::StringExpressionImpl::createComparison( lhs.implAsStringExpressionImpl(), "<=", rhs.implAsStringExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator==(const StringExpression &lhs, const StringExpression &rhs) { auto resultImpl = impl::StringExpressionImpl::createComparison( lhs.implAsStringExpressionImpl(), "==", rhs.implAsStringExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator!=(const StringExpression &lhs, const StringExpression &rhs) { auto resultImpl = impl::StringExpressionImpl::createComparison( lhs.implAsStringExpressionImpl(), "!=", rhs.implAsStringExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>=(const StringExpression &lhs, const StringExpression &rhs) { auto resultImpl = impl::StringExpressionImpl::createComparison( lhs.implAsStringExpressionImpl(), ">=", rhs.implAsStringExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>(const StringExpression &lhs, const StringExpression &rhs) { auto resultImpl = impl::StringExpressionImpl::createComparison( lhs.implAsStringExpressionImpl(), ">", rhs.implAsStringExpressionImpl()); @@ -243,50 +268,61 @@ BooleanExpression operator>(const StringExpression &lhs, const StringExpression DateTimeExpression::DateTimeExpression(const char *value) : DateTimeExpression(impl::DateTimeExpressionImpl::createFromLiteral(value)) {} + DateTimeExpression::DateTimeExpression(std::string_view value) : - DateTimeExpression(impl::DateTimeExpressionImpl::createFromLiteral(std::string(value.data(), value.size()))) {} + DateTimeExpression( + impl::DateTimeExpressionImpl::createFromLiteral(std::string(value.data(), value.size()))) {} + DateTimeExpression::DateTimeExpression(std::string value) : DateTimeExpression(impl::DateTimeExpressionImpl::createFromLiteral(std::move(value))) {} + DateTimeExpression::DateTimeExpression(const DateTime &value) : DateTimeExpression(impl::DateTimeExpressionImpl::createFromDateTime(value)) {} + DateTimeExpression::DateTimeExpression(std::shared_ptr impl) : Expression(std::move(impl)) {} + DateTimeExpression::~DateTimeExpression() = default; -std::shared_ptr DateTimeExpression::implAsDateTimeExpressionImpl() const { +std::shared_ptr +DateTimeExpression::implAsDateTimeExpressionImpl() const { return std::dynamic_pointer_cast(impl_); } BooleanExpression operator<(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { - auto resultImpl = impl::DateTimeExpressionImpl::createComparison(lhs.implAsDateTimeExpressionImpl(), + auto resultImpl = impl::DateTimeExpressionImpl::createComparison( + lhs.implAsDateTimeExpressionImpl(), "<", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator<=(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { auto resultImpl = impl::DateTimeExpressionImpl::createComparison( lhs.implAsDateTimeExpressionImpl(), "<=", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator==(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { auto resultImpl = impl::DateTimeExpressionImpl::createComparison( lhs.implAsDateTimeExpressionImpl(), "==", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator!=(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { auto resultImpl = impl::DateTimeExpressionImpl::createComparison( lhs.implAsDateTimeExpressionImpl(), "!=", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>=(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { auto resultImpl = impl::DateTimeExpressionImpl::createComparison( lhs.implAsDateTimeExpressionImpl(), ">=", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } + BooleanExpression operator>(const DateTimeExpression &lhs, const DateTimeExpression &rhs) { auto resultImpl = impl::DateTimeExpressionImpl::createComparison( lhs.implAsDateTimeExpressionImpl(), ">", rhs.implAsDateTimeExpressionImpl()); return BooleanExpression(std::move(resultImpl)); } -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/sad/chunk_filler.cc b/cpp-client/deephaven/client/src/highlevel/sad/chunk_filler.cc deleted file mode 100644 index cd83a3b52a9..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/chunk_filler.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/chunk_filler.h" -#include "deephaven/client/highlevel/impl/util.h" -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::okOrThrow; -using deephaven::client::utility::stringf; -using deephaven::client::highlevel::impl::verboseCast; - -namespace deephaven::client::highlevel::sad { -namespace { -struct Visitor final : arrow::ArrayVisitor { - Visitor(const SadRowSequence &keys, SadChunk *const dest) : keys_(keys), dest_(dest) {} - - arrow::Status Visit(const arrow::Int32Array &array) final; - arrow::Status Visit(const arrow::Int64Array &array) final; - arrow::Status Visit(const arrow::DoubleArray &array) final; - - const SadRowSequence &keys_; - SadChunk *const dest_; - std::shared_ptr result_; -}; -} // namespace - -void ChunkFiller::fillChunk(const arrow::Array &src, const SadRowSequence &keys, SadChunk *const dest) { - if (keys.size() < dest->capacity()) { - auto message = stringf("keys.size() < dest->capacity() (%d < %d)", keys.size(), dest->capacity()); - throw std::runtime_error(message); - } - Visitor visitor(keys, dest); - okOrThrow(DEEPHAVEN_EXPR_MSG(src.Accept(&visitor))); -} - -namespace { -arrow::Status Visitor::Visit(const arrow::Int32Array &array) { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest_); - int64_t destIndex = 0; - int64_t srcIndex; - auto iter = keys_.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - typedDest->data()[destIndex++] = array.Value(srcIndex); - } - return arrow::Status::OK(); -} - -arrow::Status Visitor::Visit(const arrow::Int64Array &array) { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest_); - int64_t destIndex = 0; - int64_t srcIndex; - auto iter = keys_.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - typedDest->data()[destIndex++] = array.Value(srcIndex); - } - return arrow::Status::OK(); -} - -arrow::Status Visitor::Visit(const arrow::DoubleArray &array) { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest_); - int64_t destIndex = 0; - int64_t srcIndex; - auto iter = keys_.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - typedDest->data()[destIndex++] = array.Value(srcIndex); - } - return arrow::Status::OK(); -} -} // namespace -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/chunk_maker.cc b/cpp-client/deephaven/client/src/highlevel/sad/chunk_maker.cc deleted file mode 100644 index 79a2ecca685..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/chunk_maker.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/chunk_maker.h" - -namespace deephaven::client::highlevel::sad { -namespace { -struct Visitor final : SadColumnSourceVisitor { - explicit Visitor(size_t chunkSize) : chunkSize_(chunkSize) {} - void visit(const SadIntColumnSource *source) final; - void visit(const SadLongColumnSource *source) final; - void visit(const SadDoubleColumnSource *source) final; - - size_t chunkSize_; - std::shared_ptr result_; -}; -} // namespace - -std::shared_ptr ChunkMaker::createChunkFor(const SadColumnSource &columnSource, - size_t chunkSize) { - Visitor v(chunkSize); - columnSource.acceptVisitor(&v); - return std::move(v.result_); -} - -namespace { -void Visitor::visit(const SadIntColumnSource *source) { - result_ = SadIntChunk::create(chunkSize_); -} - -void Visitor::visit(const SadLongColumnSource *source) { - result_ = SadLongChunk::create(chunkSize_); -} - -void Visitor::visit(const SadDoubleColumnSource *source) { - result_ = SadDoubleChunk::create(chunkSize_); -} -} // namespace -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_chunk.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_chunk.cc deleted file mode 100644 index 394b60ec06e..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_chunk.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_chunk.h" - -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::stringf; - -namespace deephaven::client::highlevel::sad { -SadChunk::~SadChunk() = default; - -std::shared_ptr SadIntChunk::create(size_t size) { - return std::make_shared(Private(), size); -} - -std::shared_ptr SadLongChunk::create(size_t size) { - return std::make_shared(Private(), size); -} - -std::shared_ptr SadSizeTChunk::create(size_t size) { - return std::make_shared(Private(), size); -} - -std::shared_ptr SadDoubleChunk::create(size_t size) { - return std::make_shared(Private(), size); -} -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_column_source.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_column_source.cc deleted file mode 100644 index 08cababd58f..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_column_source.cc +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_column_source.h" -#include "deephaven/client/highlevel/impl/util.h" -#include "deephaven/client/highlevel/sad/sad_chunk.h" - -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::streamf; -using deephaven::client::utility::stringf; -using deephaven::client::highlevel::impl::verboseCast; - -namespace deephaven::client::highlevel::sad { -namespace { -class MySadLongColumnSourceContext final : public SadColumnSourceContext { -public: -}; - -class MySadDoubleColumnSourceContext final : public SadColumnSourceContext { -public: -}; - -void assertFits(size_t size, size_t capacity); -void assertInRange(size_t index, size_t size); -} // namespace -SadColumnSource::~SadColumnSource() = default; -SadMutableColumnSource::~SadMutableColumnSource() = default; -SadIntColumnSource::~SadIntColumnSource() = default; -SadLongColumnSource::~SadLongColumnSource() = default; -SadDoubleColumnSource::~SadDoubleColumnSource() = default; - -std::shared_ptr SadIntArrayColumnSource::create() { - return std::make_shared(Private()); -} - -SadIntArrayColumnSource::SadIntArrayColumnSource(Private) {} -SadIntArrayColumnSource::~SadIntArrayColumnSource() = default; - -std::shared_ptr SadIntArrayColumnSource::createContext(size_t chunkSize) const { - // We're not really using contexts yet. - return std::make_shared(); -} - -void SadIntArrayColumnSource::fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, - size_t size, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(size, dest->capacity()); - - for (size_t i = 0; i < size; ++i) { - auto srcIndex = rowKeys.data()[i]; - assertInRange(srcIndex, data_.size()); - typedDest->data()[i] = this->data_[srcIndex]; - } -} - -void SadIntArrayColumnSource::fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(rows.size(), dest->capacity()); - - size_t destIndex = 0; - int64_t srcIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - assertInRange(srcIndex, data_.size()); - typedDest->data()[destIndex] = data_[srcIndex]; - ++destIndex; - } -} - -void SadIntArrayColumnSource::fillFromChunk(SadContext *context, const SadChunk &src, - const SadRowSequence &rows) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(rows.size(), src.capacity()); - - size_t srcIndex = 0; - int64_t destIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&destIndex)) { - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[srcIndex]; - ++srcIndex; - } -} - -void SadIntArrayColumnSource::fillFromChunkUnordered(SadContext *context, const SadChunk &src, - const SadLongChunk &rowKeys, size_t size) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(size, src.capacity()); - - for (size_t i = 0; i < size; ++i) { - auto destIndex = rowKeys.data()[i]; - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[i]; - } -} - -void SadIntArrayColumnSource::ensureSize(size_t size) { - if (size > data_.size()) { - data_.resize(size); - } -} - -void SadIntArrayColumnSource::acceptVisitor(SadColumnSourceVisitor *visitor) const { - visitor->visit(this); -} - -std::shared_ptr SadLongArrayColumnSource::create() { - return std::make_shared(Private()); -} - -SadLongArrayColumnSource::SadLongArrayColumnSource(Private) {} -SadLongArrayColumnSource::~SadLongArrayColumnSource() = default; - -std::shared_ptr SadLongArrayColumnSource::createContext(size_t chunkSize) const { - // We're not really using contexts yet. - return std::make_shared(); -} - -void SadLongArrayColumnSource::fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, - size_t size, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(size, dest->capacity()); - - for (size_t i = 0; i < size; ++i) { - auto srcIndex = rowKeys.data()[i]; - assertInRange(srcIndex, data_.size()); - typedDest->data()[i] = this->data_[srcIndex]; - } -} - -void SadLongArrayColumnSource::fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(rows.size(), dest->capacity()); - - size_t destIndex = 0; - int64_t srcIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - assertInRange(srcIndex, data_.size()); - typedDest->data()[destIndex] = data_[srcIndex]; - ++destIndex; - } -} - -void SadLongArrayColumnSource::fillFromChunk(SadContext *context, const SadChunk &src, - const SadRowSequence &rows) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(rows.size(), src.capacity()); - - size_t srcIndex = 0; - int64_t destIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&destIndex)) { - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[srcIndex]; - ++srcIndex; - } -} - -void SadLongArrayColumnSource::fillFromChunkUnordered(SadContext *context, const SadChunk &src, - const SadLongChunk &rowKeys, size_t size) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(size, src.capacity()); - - for (size_t i = 0; i < size; ++i) { - auto destIndex = rowKeys.data()[i]; - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[i]; - } -} - -void SadLongArrayColumnSource::ensureSize(size_t size) { - if (size > data_.size()) { - data_.resize(size); - } -} - -void SadLongArrayColumnSource::acceptVisitor(SadColumnSourceVisitor *visitor) const { - visitor->visit(this); -} - -std::shared_ptr SadDoubleArrayColumnSource::create() { - return std::make_shared(Private()); -} - -SadDoubleArrayColumnSource::SadDoubleArrayColumnSource(Private) {} -SadDoubleArrayColumnSource::~SadDoubleArrayColumnSource() = default; - -std::shared_ptr SadDoubleArrayColumnSource::createContext(size_t chunkSize) const { - // We're not really using contexts yet. - return std::make_shared(); -} - -void SadDoubleArrayColumnSource::fillChunkUnordered(SadContext *context, const SadLongChunk &rowKeys, - size_t size, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(size, dest->capacity()); - - for (size_t i = 0; i < size; ++i) { - auto srcIndex = rowKeys.data()[i]; - assertInRange(srcIndex, data_.size()); - typedDest->data()[i] = this->data_[srcIndex]; - } -} - -void SadDoubleArrayColumnSource::fillChunk(SadContext *context, const SadRowSequence &rows, SadChunk *dest) const { - auto *typedDest = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, dest); - assertFits(rows.size(), dest->capacity()); - - size_t destIndex = 0; - int64_t srcIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&srcIndex)) { - assertInRange(srcIndex, data_.size()); - typedDest->data()[destIndex] = data_[srcIndex]; - ++destIndex; - } -} - -void SadDoubleArrayColumnSource::fillFromChunk(SadContext *context, const SadChunk &src, - const SadRowSequence &rows) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(rows.size(), src.capacity()); - - size_t srcIndex = 0; - int64_t destIndex; - auto iter = rows.getRowSequenceIterator(); - while (iter->tryGetNext(&destIndex)) { - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[srcIndex]; - ++srcIndex; - } -} - -void SadDoubleArrayColumnSource::fillFromChunkUnordered(SadContext *context, const SadChunk &src, - const SadLongChunk &rowKeys, size_t size) { - auto *typedSrc = verboseCast(DEEPHAVEN_PRETTY_FUNCTION, &src); - assertFits(size, src.capacity()); - - for (size_t i = 0; i < size; ++i) { - auto destIndex = rowKeys.data()[i]; - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[i]; - } -} - -void SadDoubleArrayColumnSource::ensureSize(size_t size) { - if (size > data_.size()) { - data_.resize(size); - } -} - -void SadDoubleArrayColumnSource::acceptVisitor(SadColumnSourceVisitor *visitor) const { - visitor->visit(this); -} - -SadColumnSourceContext::~SadColumnSourceContext() = default; - -namespace { -void assertFits(size_t size, size_t capacity) { - if (size > capacity) { - auto message = stringf("Expected capacity at least %o, have %o", size, capacity); - throw std::runtime_error(message); - } -} - -void assertInRange(size_t index, size_t size) { - if (index >= size) { - auto message = stringf("srcIndex %o >= size %o", index, size); - throw std::runtime_error(message); - } -} -} // namespace -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_context.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_context.cc deleted file mode 100644 index 2ab8179354a..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_context.cc +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_context.h" - -namespace deephaven::client::highlevel::sad { -SadContext::~SadContext() = default; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_row_sequence.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_row_sequence.cc deleted file mode 100644 index d2eef04de54..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_row_sequence.cc +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" - -namespace deephaven::client::highlevel::sad { -namespace { -/** - * Holds a slice of a set::set - */ -class MySadRowSequence final : public SadRowSequence { - typedef std::set data_t; -public: - MySadRowSequence(std::shared_ptr data, data_t::const_iterator begin, - data_t::const_iterator end, size_t size); - ~MySadRowSequence() final = default; - std::shared_ptr getRowSequenceIterator() const final; - std::shared_ptr getRowSequenceReverseIterator() const final; - size_t size() const final { - return size_; - } - -private: - std::shared_ptr data_; - data_t::const_iterator begin_; - data_t::const_iterator end_; - size_t size_ = 0; -}; - -class MySadRowSequenceIterator final : public SadRowSequenceIterator { - typedef std::set data_t; -public: - MySadRowSequenceIterator(std::shared_ptr data, data_t::const_iterator begin, - data_t::const_iterator end, size_t size, bool forward); - ~MySadRowSequenceIterator() final = default; - std::shared_ptr getNextRowSequenceWithLength(size_t size) final; - bool tryGetNext(int64_t *result) final; - -private: - std::shared_ptr data_; - data_t::const_iterator begin_; - data_t::const_iterator end_; - size_t size_ = 0; - bool forward_ = true; -}; -} // namespace - -std::shared_ptr SadRowSequence::createSequential(int64_t begin, int64_t end) { - // Inefficient hack for now. The efficient thing to do would be to make a special implementation - // that just iterates over the range. - SadRowSequenceBuilder builder; - if (begin != end) { - // Sad: decide on whether you want half-open or fully-closed intervals. - builder.addRange(begin, end - 1); - } - return builder.build(); -} - -SadRowSequence::~SadRowSequence() = default; - -std::ostream &operator<<(std::ostream &s, const SadRowSequence &o) { - s << '['; - auto iter = o.getRowSequenceIterator(); - const char *sep = ""; - int64_t item; - while (iter->tryGetNext(&item)) { - s << sep << item; - sep = ", "; - } - s << ']'; - return s; -} - -SadRowSequenceIterator::~SadRowSequenceIterator() = default; - -SadRowSequenceBuilder::SadRowSequenceBuilder() : data_(std::make_shared>()) {} -SadRowSequenceBuilder::~SadRowSequenceBuilder() = default; - -void SadRowSequenceBuilder::addRange(int64_t first, int64_t last) { - if (first > last) { - return; - } - while (true) { - data_->insert(first); - if (first == last) { - return; - } - ++first; - } -} - -std::shared_ptr SadRowSequenceBuilder::build() { - auto begin = data_->begin(); - auto end = data_->end(); - auto size = data_->size(); - return std::make_shared(std::move(data_), begin, end, size); -} - -namespace { -MySadRowSequence::MySadRowSequence(std::shared_ptr data, data_t::const_iterator begin, - data_t::const_iterator end, size_t size) : data_(std::move(data)), begin_(begin), - end_(end), size_(size) {} - -std::shared_ptr MySadRowSequence::getRowSequenceIterator() const { - return std::make_shared(data_, begin_, end_, size_, true); -} - -std::shared_ptr MySadRowSequence::getRowSequenceReverseIterator() const { - return std::make_shared(data_, begin_, end_, size_, false); -} - -MySadRowSequenceIterator::MySadRowSequenceIterator( - std::shared_ptr data, data_t::const_iterator begin, - data_t::const_iterator end, size_t size, bool forward) : data_(std::move(data)), begin_(begin), - end_(end), size_(size), forward_(forward) {} - -bool MySadRowSequenceIterator::tryGetNext(int64_t *result) { - if (begin_ == end_) { - return false; - } - if (forward_) { - *result = *begin_++; - } else { - *result = *--end_; - } - --size_; - return true; -} - -std::shared_ptr -MySadRowSequenceIterator::getNextRowSequenceWithLength(size_t size) { - auto sizeToUse = std::min(size, size_); - data_t::const_iterator newBegin, newEnd; - if (forward_) { - newBegin = begin_; - std::advance(begin_, sizeToUse); - newEnd = begin_; - } else { - newEnd = end_; - std::advance(end_, -(ssize_t)sizeToUse); - newBegin = end_; - } - size_ -= sizeToUse; - return std::make_shared(data_, newBegin, newEnd, sizeToUse); -} - -} // namespace -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_table.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_table.cc deleted file mode 100644 index a1c8c457e7d..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_table.cc +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_table.h" - -#include -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::streamf; -using deephaven::client::utility::stringf; - -namespace deephaven::client::highlevel::sad { -SadTable::SadTable() = default; -SadTable::~SadTable() = default; -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_ticking_table.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_ticking_table.cc deleted file mode 100644 index 3f02cd2f398..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_ticking_table.cc +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_ticking_table.h" - -#include -#include - -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::streamf; -using deephaven::client::utility::stringf; - -namespace deephaven::client::highlevel::sad { -namespace { -void mapShifter(int64_t start, int64_t endInclusive, int64_t dest, std::map *zm); -void applyShiftData(const SadRowSequence &startIndex, const SadRowSequence &endInclusiveIndex, - const SadRowSequence &destIndex, - const std::function &processShift); - -class MyRowSequence final : public SadRowSequence { - typedef std::map data_t; -public: - MyRowSequence(std::shared_ptr data, data_t::const_iterator begin, - data_t::const_iterator end, size_t size); - ~MyRowSequence() final = default; - std::shared_ptr getRowSequenceIterator() const final; - std::shared_ptr getRowSequenceReverseIterator() const final; - size_t size() const final { - return size_; - } - -private: - std::shared_ptr data_; - data_t::const_iterator begin_; - data_t::const_iterator end_; - size_t size_ = 0; -}; - -class MyRowSequenceIterator final : public SadRowSequenceIterator { - typedef std::map data_t; -public: - MyRowSequenceIterator(std::shared_ptr data, - data_t::const_iterator begin, data_t::const_iterator end, size_t size, bool forward); - ~MyRowSequenceIterator() final; - - std::shared_ptr getNextRowSequenceWithLength(size_t size) final; - bool tryGetNext(int64_t *result) final; - -private: - std::shared_ptr data_; - data_t::const_iterator begin_; - data_t::const_iterator end_; - size_t size_ = 0; - bool forward_ = false; -}; -} // namespace - -std::shared_ptr SadTickingTable::create(std::vector> columns) { - return std::make_shared(Private(), std::move(columns)); -} -SadTickingTable::SadTickingTable(Private, std::vector> columns) : - columns_(std::move(columns)) { - redirection_ = std::make_shared>(); -} -SadTickingTable::~SadTickingTable() = default; - -std::shared_ptr SadTickingTable::add(const SadRowSequence &addedRows) { - auto rowKeys = SadLongChunk::create(addedRows.size()); - auto iter = addedRows.getRowSequenceIterator(); - int64_t row; - size_t destIndex = 0; - while (iter->tryGetNext(&row)) { - int64_t nextRedirectedRow; - if (!slotsToReuse_.empty()) { - nextRedirectedRow = slotsToReuse_.back(); - slotsToReuse_.pop_back(); - } else { - nextRedirectedRow = (int64_t)redirection_->size(); - } - auto result = redirection_->insert(std::make_pair(row, nextRedirectedRow)); - if (!result.second) { - auto message = stringf("Row %o already exists", row); - throw std::runtime_error(message); - } - rowKeys->data()[destIndex] = nextRedirectedRow; - ++destIndex; - } - return SadUnwrappedTable::create(std::move(rowKeys), destIndex, columns_); -} - -void SadTickingTable::erase(const SadRowSequence &removedRows) { - auto iter = removedRows.getRowSequenceIterator(); - int64_t row; - while (iter->tryGetNext(&row)) { - auto ip = redirection_->find(row); - if (ip == redirection_->end()) { - auto message = stringf("Can't find row %o", row); - throw std::runtime_error(message); - } - slotsToReuse_.push_back(ip->second); - redirection_->erase(ip); - } -} - -void SadTickingTable::shift(const SadRowSequence &startIndex, const SadRowSequence &endInclusiveIndex, - const SadRowSequence &destIndex) { - auto processShift = [this](int64_t s, int64_t ei, int64_t dest) { - mapShifter(s, ei, dest, redirection_.get()); - }; - applyShiftData(startIndex, endInclusiveIndex, destIndex, processShift); -} - -std::shared_ptr SadTickingTable::getRowSequence() const { - return std::make_shared(redirection_, redirection_->begin(), redirection_->end(), - redirection_->size()); -} - -std::shared_ptr -SadTickingTable::unwrap(const std::shared_ptr &rows, - const std::vector &cols) const { - auto rowKeys = SadLongChunk::create(rows->size()); - auto iter = rows->getRowSequenceIterator(); - size_t destIndex = 0; - int64_t rowKey; - while (iter->tryGetNext(&rowKey)) { - auto ip = redirection_->find(rowKey); - if (ip == redirection_->end()) { - auto message = stringf("Can't find rowkey %o", rowKey); - throw std::runtime_error(message); - } - rowKeys->data()[destIndex++] = ip->second; - } - - std::vector> columns; - columns.reserve(cols.size()); - for (auto colIndex : cols) { - if (colIndex >= columns_.size()) { - auto message = stringf("No such columnindex %o", colIndex); - throw std::runtime_error(message); - } - columns.push_back(columns_[colIndex]); - } - return SadUnwrappedTable::create(std::move(rowKeys), destIndex, std::move(columns)); -} - -std::shared_ptr SadTickingTable::getColumn(size_t columnIndex) const { - throw std::runtime_error("SadTickingTable: getColumn [redirected]: not implemented yet"); -} - -namespace { -void applyShiftData(const SadRowSequence &startIndex, const SadRowSequence &endInclusiveIndex, - const SadRowSequence &destIndex, - const std::function &processShift) { - if (startIndex.empty()) { - return; - } - - // Loop twice: once in the forward direction (applying negative shifts), and once in the reverse direction - // (applying positive shifts). - for (auto direction = 0; direction < 2; ++direction) { - std::shared_ptr startIter, endIter, destIter; - if (direction == 0) { - startIter = startIndex.getRowSequenceIterator(); - endIter = endInclusiveIndex.getRowSequenceIterator(); - destIter = destIndex.getRowSequenceIterator(); - } else { - startIter = startIndex.getRowSequenceReverseIterator(); - endIter = endInclusiveIndex.getRowSequenceReverseIterator(); - destIter = destIndex.getRowSequenceReverseIterator(); - } - int64_t start, end, dest; - while (startIter->tryGetNext(&start)) { - if (!endIter->tryGetNext(&end) || !destIter->tryGetNext(&dest)) { - throw std::runtime_error("Sequences not of same size"); - } - if (direction == 0) { - // If forward, only process negative shifts. - if (dest >= 0) { - continue; - } - } else { - // If reverse, only process positive shifts. - if (dest <= 0) { - continue; - } - } - const char *dirText = direction == 0 ? "(positive)" : "(negative)"; - streamf(std::cerr, "Processing %o shift src [%o..%o] dest %o\n", dirText, start, end, dest); - processShift(start, end, dest); - } - } -} - -void mapShifter(int64_t start, int64_t endInclusive, int64_t dest, std::map *zm) { - auto delta = dest - start; - if (delta < 0) { - auto currentp = zm->lower_bound(start); - while (true) { - if (currentp == zm->end() || currentp->first > endInclusive) { - return; - } - auto nextp = std::next(currentp); - auto node = zm->extract(currentp); - auto newKey = node.key() + delta; - streamf(std::cerr, "Working forwards, moving key from %o to %o\n", node.key(), newKey); - node.key() = newKey; - zm->insert(std::move(node)); - currentp = nextp; - ++dest; - } - } - - // delta >= 0 so move in the reverse direction - auto currentp = zm->upper_bound(endInclusive); - if (currentp == zm->begin()) { - return; - } - --currentp; - while (true) { - if (currentp->first < start) { - return; - } - std::optional::iterator> nextp; - if (currentp != zm->begin()) { - nextp = std::prev(currentp); - } - auto node = zm->extract(currentp); - auto newKey = node.key() + delta; - streamf(std::cerr, "Working backwards, moving key from %o to %o\n", node.key(), newKey); - node.key() = newKey; - zm->insert(std::move(node)); - if (!nextp.has_value()) { - return; - } - currentp = *nextp; - --dest; - } -} - -MyRowSequence::MyRowSequence(std::shared_ptr data, - data_t::const_iterator begin, data_t::const_iterator end, size_t size) - : data_(std::move(data)), begin_(begin), end_(end), size_(size) {} - - std::shared_ptr - MyRowSequence::getRowSequenceIterator() const { - return std::make_shared(data_, begin_, end_, size_, true); -} - -std::shared_ptr -MyRowSequence::getRowSequenceReverseIterator() const { - return std::make_shared(data_, begin_, end_, size_, false); -} - -MyRowSequenceIterator::MyRowSequenceIterator(std::shared_ptr data, - data_t::const_iterator begin, data_t::const_iterator end, size_t size, bool forward) - : data_(std::move(data)), begin_(begin), end_(end), size_(size), forward_(forward) {} - MyRowSequenceIterator::~MyRowSequenceIterator() = default; - -bool MyRowSequenceIterator::tryGetNext(int64_t *result) { - if (begin_ == end_) { - return false; - } - if (forward_) { - *result = begin_->first; - ++begin_; - } else { - --end_; - *result = end_->first; - } - --size_; - return true; -} - -std::shared_ptr -MyRowSequenceIterator::getNextRowSequenceWithLength(size_t size) { - // TODO(kosak): iterates whole set. ugh. - auto remaining = std::distance(begin_, end_); - auto sizeToUse = std::min((ssize_t)size, remaining); - data_t::const_iterator newBegin, newEnd; - if (forward_) { - newBegin = begin_; - std::advance(begin_, sizeToUse); - newEnd = begin_; - } else { - newEnd = end_; - std::advance(end_, -sizeToUse); - newBegin = end_; - } - size_ -= sizeToUse; - return std::make_shared(data_, newBegin, newEnd, sizeToUse); -} -} // namespace -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/sad/sad_unwrapped_table.cc b/cpp-client/deephaven/client/src/highlevel/sad/sad_unwrapped_table.cc deleted file mode 100644 index 27966db9f0f..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/sad/sad_unwrapped_table.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/sad/sad_unwrapped_table.h" - -#include -#include "deephaven/client/utility/utility.h" - -namespace deephaven::client::highlevel::sad { -std::shared_ptr SadUnwrappedTable::create(std::shared_ptr rowKeys, - size_t numRows, std::vector> columns) { - return std::make_shared(Private(), std::move(rowKeys), numRows, std::move(columns)); -} - -SadUnwrappedTable::SadUnwrappedTable(Private, std::shared_ptr &&rowKeys, size_t numRows, - std::vector> &&columns) : rowKeys_(std::move(rowKeys)), - numRows_(numRows), columns_(std::move(columns)) {} - -SadUnwrappedTable::~SadUnwrappedTable() = default; - -std::shared_ptr SadUnwrappedTable::getUnorderedRowKeys() const { - return rowKeys_; -} - -std::shared_ptr SadUnwrappedTable::getColumn(size_t columnIndex) const { - return columns_[columnIndex]; -} -} // namespace deephaven::client::highlevel::sad diff --git a/cpp-client/deephaven/client/src/highlevel/ticking.cc b/cpp-client/deephaven/client/src/highlevel/ticking.cc deleted file mode 100644 index 20b6525d343..00000000000 --- a/cpp-client/deephaven/client/src/highlevel/ticking.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/highlevel/ticking.h" - -namespace deephaven::client::highlevel { -} // namespace deephaven::client::highlevel diff --git a/cpp-client/deephaven/client/src/immerutil/abstract_flex_vector.cc b/cpp-client/deephaven/client/src/immerutil/abstract_flex_vector.cc new file mode 100644 index 00000000000..be8b915bb2b --- /dev/null +++ b/cpp-client/deephaven/client/src/immerutil/abstract_flex_vector.cc @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/immerutil/abstract_flex_vector.h" +#include "deephaven/client/immerutil/immer_column_source.h" + +using deephaven::client::column::ColumnSource; + +namespace deephaven::client::immerutil { +AbstractFlexVectorBase::~AbstractFlexVectorBase() = default; +} // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/src/immerutil/immer_column_source.cc b/cpp-client/deephaven/client/src/immerutil/immer_column_source.cc new file mode 100644 index 00000000000..953b0b5cc30 --- /dev/null +++ b/cpp-client/deephaven/client/src/immerutil/immer_column_source.cc @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/immerutil/immer_column_source.h" + +#include "deephaven/client/utility/utility.h" +#include "deephaven/client/column/column_source.h" +using deephaven::client::utility::stringf; + +namespace deephaven::client::immerutil { +} // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/src/highlevel/impl/aggregate_impl.cc b/cpp-client/deephaven/client/src/impl/aggregate_impl.cc similarity index 79% rename from cpp-client/deephaven/client/src/highlevel/impl/aggregate_impl.cc rename to cpp-client/deephaven/client/src/impl/aggregate_impl.cc index 88f2f23c145..530e5365b7b 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/aggregate_impl.cc +++ b/cpp-client/deephaven/client/src/impl/aggregate_impl.cc @@ -1,13 +1,10 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/aggregate_impl.h" +#include "deephaven/client/impl/aggregate_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { - std::shared_ptr AggregateImpl::create( ComboAggregateRequest::Aggregate descriptor) { return std::make_shared(Private(), std::move(descriptor)); @@ -25,6 +22,4 @@ AggregateComboImpl::AggregateComboImpl(Private, std::vector aggregates) : aggregates_(std::move(aggregates)) {} } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/boolean_expression_impl.cc b/cpp-client/deephaven/client/src/impl/boolean_expression_impl.cc similarity index 88% rename from cpp-client/deephaven/client/src/highlevel/impl/boolean_expression_impl.cc rename to cpp-client/deephaven/client/src/impl/boolean_expression_impl.cc index 43e7fe29f10..bb16dfb1ad8 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/boolean_expression_impl.cc +++ b/cpp-client/deephaven/client/src/impl/boolean_expression_impl.cc @@ -1,24 +1,23 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/boolean_expression_impl.h" #include #include -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" #include "deephaven/client/utility/utility.h" using deephaven::client::utility::separatedList; -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { namespace { class NotExpressionImpl final : public BooleanExpressionImpl { - struct Private {}; + struct Private { + }; public: - static std::shared_ptr create(std::shared_ptr child); + static std::shared_ptr + create(std::shared_ptr child); NotExpressionImpl(Private, std::shared_ptr &&child); ~NotExpressionImpl() final; @@ -29,7 +28,8 @@ class NotExpressionImpl final : public BooleanExpressionImpl { }; class AndExpressionImpl final : public BooleanExpressionImpl { - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(std::shared_ptr lhs, std::shared_ptr rhs); @@ -43,7 +43,8 @@ class AndExpressionImpl final : public BooleanExpressionImpl { }; class OrExpressionImpl final : public BooleanExpressionImpl { - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(std::shared_ptr lhs, std::shared_ptr rhs); @@ -58,7 +59,8 @@ class OrExpressionImpl final : public BooleanExpressionImpl { class BooleanValuedInstanceMethod final : public BooleanExpressionImpl { - struct Private {}; + struct Private { + }; public: static std::shared_ptr create(std::shared_ptr lhs, std::string method, std::shared_ptr rhs); @@ -111,6 +113,7 @@ std::shared_ptr NotExpressionImpl::create( NotExpressionImpl::NotExpressionImpl(Private, std::shared_ptr &&child) : child_(std::move(child)) {} + NotExpressionImpl::~NotExpressionImpl() = default; void NotExpressionImpl::streamIrisRepresentation(std::ostream &s) const { @@ -121,14 +124,14 @@ void NotExpressionImpl::streamIrisRepresentation(std::ostream &s) const { std::shared_ptr AndExpressionImpl::create( std::shared_ptr lhs, std::shared_ptr rhs) { std::vector> children; - const auto *lhsAsAnd = dynamic_cast(lhs.get()); + const auto *lhsAsAnd = dynamic_cast(lhs.get()); if (lhsAsAnd != nullptr) { children.insert(children.end(), lhsAsAnd->children_.begin(), lhsAsAnd->children_.end()); } else { children.push_back(std::move(lhs)); } - const auto *rhsAsAnd = dynamic_cast(rhs.get()); + const auto *rhsAsAnd = dynamic_cast(rhs.get()); if (rhsAsAnd != nullptr) { children.insert(children.end(), rhsAsAnd->children_.begin(), rhsAsAnd->children_.end()); } else { @@ -139,7 +142,9 @@ std::shared_ptr AndExpressionImpl::create( } AndExpressionImpl::AndExpressionImpl(Private, - std::vector> &&children) : children_(std::move(children)) {} + std::vector> &&children) : children_( + std::move(children)) {} + AndExpressionImpl::~AndExpressionImpl() = default; void AndExpressionImpl::streamIrisRepresentation(std::ostream &s) const { @@ -151,14 +156,14 @@ void AndExpressionImpl::streamIrisRepresentation(std::ostream &s) const { std::shared_ptr OrExpressionImpl::create( std::shared_ptr lhs, std::shared_ptr rhs) { std::vector> children; - const auto *lhsAsOr = dynamic_cast(lhs.get()); + const auto *lhsAsOr = dynamic_cast(lhs.get()); if (lhsAsOr != nullptr) { children.insert(children.end(), lhsAsOr->children_.begin(), lhsAsOr->children_.end()); } else { children.push_back(std::move(lhs)); } - const auto *rhsAsOr = dynamic_cast(lhs.get()); + const auto *rhsAsOr = dynamic_cast(lhs.get()); if (rhsAsOr != nullptr) { children.insert(children.end(), rhsAsOr->children_.begin(), rhsAsOr->children_.end()); } else { @@ -169,7 +174,9 @@ std::shared_ptr OrExpressionImpl::create( } OrExpressionImpl::OrExpressionImpl(Private, - std::vector> &&children) : children_(std::move(children)) {} + std::vector> &&children) : children_( + std::move(children)) {} + OrExpressionImpl::~OrExpressionImpl() = default; void OrExpressionImpl::streamIrisRepresentation(std::ostream &s) const { @@ -188,6 +195,7 @@ BooleanValuedInstanceMethod::BooleanValuedInstanceMethod(Private, std::shared_ptr &&lhs, std::string &&method, std::shared_ptr &&rhs) : lhs_(std::move(lhs)), method_(std::move(method)), rhs_(std::move(rhs)) {} + BooleanValuedInstanceMethod::~BooleanValuedInstanceMethod() = default; void BooleanValuedInstanceMethod::streamIrisRepresentation(std::ostream &s) const { @@ -198,7 +206,4 @@ void BooleanValuedInstanceMethod::streamIrisRepresentation(std::ostream &s) cons s << "))"; } } // namespace -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/src/highlevel/impl/client_impl.cc b/cpp-client/deephaven/client/src/impl/client_impl.cc similarity index 82% rename from cpp-client/deephaven/client/src/highlevel/impl/client_impl.cc rename to cpp-client/deephaven/client/src/impl/client_impl.cc index 6df060ca146..122e5395880 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/client_impl.cc +++ b/cpp-client/deephaven/client/src/impl/client_impl.cc @@ -1,25 +1,23 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/client_impl.h" +#include "deephaven/client/impl/client_impl.h" #include -#include "deephaven/client/highlevel/impl/table_handle_manager_impl.h" +#include "deephaven/client/impl/table_handle_manager_impl.h" #include "deephaven/client/utility/utility.h" #include "deephaven/client/utility/callbacks.h" using io::deephaven::proto::backplane::grpc::HandshakeResponse; using io::deephaven::proto::backplane::script::grpc::StartConsoleResponse; -using deephaven::client::highlevel::impl::TableHandleManagerImpl; -using deephaven::client::lowlevel::Server; +using deephaven::client::impl::TableHandleManagerImpl; +using deephaven::client::server::Server; using deephaven::client::utility::Executor; using deephaven::client::utility::SFCallback; using deephaven::client::utility::stringf; using deephaven::client::utility::streamf; -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { std::shared_ptr ClientImpl::create(std::shared_ptr server, std::shared_ptr executor, std::shared_ptr flightExecutor) { @@ -44,8 +42,7 @@ std::shared_ptr ClientImpl::create(std::shared_ptr server, ClientImpl::ClientImpl(Private, std::shared_ptr &&managerImpl) : managerImpl_(std::move(managerImpl)) {} + ClientImpl::~ClientImpl() = default; } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/columns_impl.cc b/cpp-client/deephaven/client/src/impl/columns_impl.cc similarity index 86% rename from cpp-client/deephaven/client/src/highlevel/impl/columns_impl.cc rename to cpp-client/deephaven/client/src/impl/columns_impl.cc index 6171d4b9f64..67de1926299 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/columns_impl.cc +++ b/cpp-client/deephaven/client/src/impl/columns_impl.cc @@ -1,17 +1,16 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/columns_impl.h" +#include "deephaven/client/impl/columns_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { std::shared_ptr ColumnImpl::create(std::string name) { return std::make_shared(Private(), std::move(name)); } ColumnImpl::ColumnImpl(Private, std::string name) : name_(std::move(name)) {} + ColumnImpl::~ColumnImpl() = default; void ColumnImpl::streamIrisRepresentation(std::ostream &s) const { @@ -23,6 +22,7 @@ std::shared_ptr NumColImpl::create(std::string name) { } NumColImpl::NumColImpl(Private, std::string name) : ColumnImpl(Private(), std::move(name)) {} + NumColImpl::~NumColImpl() = default; std::shared_ptr StrColImpl::create(std::string name) { @@ -30,13 +30,16 @@ std::shared_ptr StrColImpl::create(std::string name) { } StrColImpl::StrColImpl(Private, std::string name) : ColumnImpl(Private(), std::move(name)) {} + StrColImpl::~StrColImpl() = default; std::shared_ptr DateTimeColImpl::create(std::string name) { return std::make_shared(Private(), std::move(name)); } -DateTimeColImpl::DateTimeColImpl(Private, std::string name) : ColumnImpl(Private(), std::move(name)) {} +DateTimeColImpl::DateTimeColImpl(Private, std::string name) : ColumnImpl(Private(), + std::move(name)) {} + DateTimeColImpl::~DateTimeColImpl() = default; std::shared_ptr AssignedColumnImpl::create(std::string name, @@ -44,8 +47,10 @@ std::shared_ptr AssignedColumnImpl::create(std::string name, return std::make_shared(Private(), std::move(name), std::move(expr)); } -AssignedColumnImpl::AssignedColumnImpl(Private, std::string name, std::shared_ptr expr) +AssignedColumnImpl::AssignedColumnImpl(Private, std::string name, + std::shared_ptr expr) : name_(std::move(name)), expr_(std::move(expr)) {} + AssignedColumnImpl::~AssignedColumnImpl() = default; void AssignedColumnImpl::streamIrisRepresentation(std::ostream &s) const { @@ -54,6 +59,4 @@ void AssignedColumnImpl::streamIrisRepresentation(std::ostream &s) const { expr_->streamIrisRepresentation(s); } } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/datetime_expression_impl.cc b/cpp-client/deephaven/client/src/impl/datetime_expression_impl.cc similarity index 76% rename from cpp-client/deephaven/client/src/highlevel/impl/datetime_expression_impl.cc rename to cpp-client/deephaven/client/src/impl/datetime_expression_impl.cc index 736c1ac2104..2600e3f908e 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/datetime_expression_impl.cc +++ b/cpp-client/deephaven/client/src/impl/datetime_expression_impl.cc @@ -1,26 +1,25 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/datetime_expression_impl.h" +#include "deephaven/client/impl/datetime_expression_impl.h" #include #include -#include "deephaven/client/highlevel/columns.h" -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" -#include "deephaven/client/highlevel/impl/expression_impl.h" -#include "deephaven/client/highlevel/impl/escape_utils.h" +#include "deephaven/client/columns.h" +#include "deephaven/client/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" +#include "deephaven/client/impl/escape_utils.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::DateTime; +using deephaven::client::DateTime; -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { namespace { class DateTimeLiteralImpl final : public DateTimeExpressionImpl { public: explicit DateTimeLiteralImpl(std::string value) : value_(std::move(value)) {} + ~DateTimeLiteralImpl() final = default; void streamIrisRepresentation(std::ostream &s) const final; @@ -32,6 +31,7 @@ class DateTimeLiteralImpl final : public DateTimeExpressionImpl { class DateTimeDateTimeImpl final : public DateTimeExpressionImpl { public: explicit DateTimeDateTimeImpl(const DateTime &value) : value_(value) {} + ~DateTimeDateTimeImpl() final = default; void streamIrisRepresentation(std::ostream &s) const final; @@ -45,6 +45,7 @@ class DateTimeComparisonImpl final : public BooleanExpressionImpl { DateTimeComparisonImpl(std::shared_ptr lhs, const char *compareOp, std::shared_ptr rhs) : lhs_(std::move(lhs)), compareOp_(compareOp), rhs_(std::move(rhs)) {} + ~DateTimeComparisonImpl() final = default; void streamIrisRepresentation(std::ostream &s) const final; @@ -56,11 +57,13 @@ class DateTimeComparisonImpl final : public BooleanExpressionImpl { }; } // namespace -std::shared_ptr DateTimeExpressionImpl::createFromLiteral(std::string value) { +std::shared_ptr +DateTimeExpressionImpl::createFromLiteral(std::string value) { return std::make_shared(std::move(value)); } -std::shared_ptr DateTimeExpressionImpl::createFromDateTime(const DateTime &value) { +std::shared_ptr +DateTimeExpressionImpl::createFromDateTime(const DateTime &value) { return std::make_shared(value); } @@ -94,8 +97,6 @@ void DateTimeComparisonImpl::streamIrisRepresentation(std::ostream &s) const { rhs_->streamIrisRepresentation(s); s << ')'; } -} // namespace +} // namespace } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/escape_utils.cc b/cpp-client/deephaven/client/src/impl/escape_utils.cc similarity index 86% rename from cpp-client/deephaven/client/src/highlevel/impl/escape_utils.cc rename to cpp-client/deephaven/client/src/impl/escape_utils.cc index 454f1bbd6c4..a0341a63b03 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/escape_utils.cc +++ b/cpp-client/deephaven/client/src/impl/escape_utils.cc @@ -1,15 +1,13 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/escape_utils.h" +#include "deephaven/client/impl/escape_utils.h" #include #include #include -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { std::string EscapeUtils::escapeJava(std::string_view s) { std::string result; @@ -21,7 +19,7 @@ void EscapeUtils::appendEscapedJava(std::string_view s, std::string *result) { typedef std::wstring_convert, char16_t> converter_t; std::u16string u16s = converter_t().from_bytes(s.begin(), s.end()); - for (auto u16ch : u16s) { + for (auto u16ch: u16s) { switch (u16ch) { case '\b': result->append("\\b"); @@ -60,6 +58,4 @@ void EscapeUtils::appendEscapedJava(std::string_view s, std::string *result) { } } } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/expression_impl.cc b/cpp-client/deephaven/client/src/impl/expression_impl.cc similarity index 81% rename from cpp-client/deephaven/client/src/highlevel/impl/expression_impl.cc rename to cpp-client/deephaven/client/src/impl/expression_impl.cc index 3175b7521ca..32f1d13b6cf 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/expression_impl.cc +++ b/cpp-client/deephaven/client/src/impl/expression_impl.cc @@ -1,15 +1,12 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/impl/expression_impl.h" #include -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/boolean_expression_impl.h" -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { namespace { class IsNullExpressionImpl final : public BooleanExpressionImpl { public: @@ -51,7 +48,4 @@ void IsNullExpressionImpl::streamIrisRepresentation(std::ostream &s) const { void streamIris(std::ostream &s, const std::shared_ptr &o) { o->streamIrisRepresentation(s); } -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/src/highlevel/impl/numeric_expression_impl.cc b/cpp-client/deephaven/client/src/impl/numeric_expression_impl.cc similarity index 93% rename from cpp-client/deephaven/client/src/highlevel/impl/numeric_expression_impl.cc rename to cpp-client/deephaven/client/src/impl/numeric_expression_impl.cc index 65cf19447a0..8f863474c36 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/numeric_expression_impl.cc +++ b/cpp-client/deephaven/client/src/impl/numeric_expression_impl.cc @@ -1,18 +1,15 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/numeric_expression_impl.h" +#include "deephaven/client/impl/numeric_expression_impl.h" #include -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/boolean_expression_impl.h" #include "deephaven/client/utility/utility.h" using deephaven::client::utility::SimpleOstringstream; -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { namespace { class NumericUnaryOperatorImpl final : public NumericExpressionImpl { public: @@ -152,7 +149,4 @@ void DoubleLiteralImpl::streamIrisRepresentation(std::ostream &s) const { s << oss.str(); } } // namespace -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/src/highlevel/impl/string_expression_impl.cc b/cpp-client/deephaven/client/src/impl/string_expression_impl.cc similarity index 90% rename from cpp-client/deephaven/client/src/highlevel/impl/string_expression_impl.cc rename to cpp-client/deephaven/client/src/impl/string_expression_impl.cc index 3a3b8692f05..f8744dc77d4 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/string_expression_impl.cc +++ b/cpp-client/deephaven/client/src/impl/string_expression_impl.cc @@ -1,20 +1,18 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/string_expression_impl.h" +#include "deephaven/client/impl/string_expression_impl.h" #include #include -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" -#include "deephaven/client/highlevel/impl/escape_utils.h" -#include "deephaven/client/highlevel/impl/expression_impl.h" +#include "deephaven/client/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/escape_utils.h" +#include "deephaven/client/impl/expression_impl.h" #include "deephaven/client/utility/utility.h" using deephaven::client::utility::separatedList; -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { namespace impl { namespace { class StringLiteralImpl final : public StringExpressionImpl { @@ -119,6 +117,4 @@ void StringComparisonImpl::streamIrisRepresentation(std::ostream &s) const { } } // namespace } // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/table_handle_impl.cc b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc similarity index 55% rename from cpp-client/deephaven/client/src/highlevel/impl/table_handle_impl.cc rename to cpp-client/deephaven/client/src/impl/table_handle_impl.cc index 6e3d89110ac..22e917f441e 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/table_handle_impl.cc +++ b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc @@ -1,7 +1,7 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/table_handle_impl.h" +#include "deephaven/client/impl/table_handle_impl.h" #include #include @@ -12,18 +12,20 @@ #include #include #include -#include "deephaven/client/highlevel/impl/boolean_expression_impl.h" -#include "deephaven/client/highlevel/impl/columns_impl.h" -#include "deephaven/client/highlevel/impl/table_handle_manager_impl.h" -#include "deephaven/client/highlevel/client.h" -#include "deephaven/client/highlevel/columns.h" -#include "deephaven/client/highlevel/sad/chunk_filler.h" -#include "deephaven/client/highlevel/sad/chunk_maker.h" -#include "deephaven/client/highlevel/sad/sad_context.h" -#include "deephaven/client/highlevel/sad/sad_row_sequence.h" -#include "deephaven/client/highlevel/sad/sad_table.h" -#include "deephaven/client/highlevel/sad/sad_ticking_table.h" +#include "deephaven/client/impl/boolean_expression_impl.h" +#include "deephaven/client/impl/columns_impl.h" +#include "deephaven/client/impl/table_handle_manager_impl.h" +#include "deephaven/client/client.h" +#include "deephaven/client/columns.h" +#include "deephaven/client/chunk/chunk_filler.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/table/table.h" +#include "deephaven/client/ticking.h" +#include "deephaven/client/subscription/subscribe_thread.h" +#include "deephaven/client/subscription/subscription_handle.h" #include "deephaven/client/utility/callbacks.h" +#include "deephaven/client/utility/misc.h" #include "deephaven/client/utility/utility.h" #include "deephaven/flatbuf/Barrage_generated.h" @@ -32,24 +34,24 @@ using io::deephaven::proto::backplane::grpc::SortDescriptor; using io::deephaven::proto::backplane::grpc::TableReference; using io::deephaven::proto::backplane::grpc::Ticket; using io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse; -using deephaven::client::highlevel::SortDirection; -using deephaven::client::highlevel::impl::ColumnImpl; -using deephaven::client::highlevel::impl::DateTimeColImpl; -using deephaven::client::highlevel::impl::NumColImpl; -using deephaven::client::highlevel::impl::StrColImpl; -using deephaven::client::highlevel::sad::ChunkFiller; -using deephaven::client::highlevel::sad::ChunkMaker; -using deephaven::client::highlevel::sad::SadColumnSource; -using deephaven::client::highlevel::sad::SadContext; -using deephaven::client::highlevel::sad::SadIntArrayColumnSource; -using deephaven::client::highlevel::sad::SadLongArrayColumnSource; -using deephaven::client::highlevel::sad::SadDoubleArrayColumnSource; -using deephaven::client::highlevel::sad::SadMutableColumnSource; -using deephaven::client::highlevel::sad::SadRowSequence; -using deephaven::client::highlevel::sad::SadRowSequenceBuilder; -using deephaven::client::highlevel::sad::SadTable; -using deephaven::client::highlevel::sad::SadTickingTable; +using deephaven::client::SortDirection; +using deephaven::client::impl::ColumnImpl; +using deephaven::client::impl::DateTimeColImpl; +using deephaven::client::impl::NumColImpl; +using deephaven::client::impl::StrColImpl; +using deephaven::client::chunk::ChunkFiller; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::column::ColumnSource; +using deephaven::client::column::MutableColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::container::RowSequenceIterator; +using deephaven::client::table::Table; +using deephaven::client::subscription::startSubscribeThread; +using deephaven::client::subscription::SubscriptionHandle; using deephaven::client::utility::Callback; +using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::makeReservedVector; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::separatedList; using deephaven::client::utility::SFCallback; @@ -65,11 +67,9 @@ using io::deephaven::barrage::flatbuf::ColumnConversionMode; using io::deephaven::barrage::flatbuf::CreateBarrageMessageWrapper; using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionOptions; using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionRequest; -using io::deephaven::barrage::flatbuf::GetBarrageMessageWrapper; -namespace deephaven::client::highlevel { +namespace deephaven::client { namespace impl { - std::shared_ptr TableHandleImpl::createEtcCallback(const TableHandleManagerImpl *thm) { return internal::LazyState::create(thm->server(), thm->flightExecutor()); } @@ -82,10 +82,8 @@ std::shared_ptr TableHandleImpl::createSatisfiedCallback( std::shared_ptr TableHandleImpl::create(std::shared_ptr thm, Ticket ticket, std::shared_ptr etcCallback) { - auto result = std::make_shared(Private(), std::move(thm), std::move(ticket), + return std::make_shared(Private(), std::move(thm), std::move(ticket), std::move(etcCallback)); - result->weakSelf_ = result; - return result; } TableHandleImpl::TableHandleImpl(Private, std::shared_ptr &&thm, @@ -341,502 +339,27 @@ std::shared_ptr TableHandleImpl::asOfJoin(AsOfJoinTablesRequest return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); } -namespace { -class ThreadNubbin; -class SubscribeNubbin final : public Callback<> { - typedef deephaven::client::lowlevel::Server Server; - -public: - SubscribeNubbin(std::shared_ptr server, std::vector ticketBytes, - std::shared_ptr colDefs, - std::promise promise, std::shared_ptr callback); - void invoke() final; - - static std::shared_ptr sadClown_; - -private: - void invokeHelper(); - - std::shared_ptr server_; - std::vector ticketBytes_; - std::shared_ptr colDefs_; - std::promise promise_; - std::shared_ptr callback_; -}; - -// A simple extension to arrow::Buffer that owns its DetachedBuffer storage -class ZamboniBuffer : public arrow::Buffer { -public: - explicit ZamboniBuffer(flatbuffers::DetachedBuffer buffer); - -private: - flatbuffers::DetachedBuffer buffer_; -}; - -class ThreadNubbin { -public: - ThreadNubbin(std::unique_ptr fsr, - std::shared_ptr colDefs, - std::shared_ptr callback); - - static void runForever(const std::shared_ptr &self); - -private: - void runForeverHelper(); - void runForeverHelperImpl(); - -public: - std::unique_ptr fsr_; - std::shared_ptr colDefs_; - std::shared_ptr callback_; -}; - -struct Constants { - static constexpr const int8_t SHORT_VALUE = 1; - static constexpr const int8_t INT_VALUE = 2; - static constexpr const int8_t LONG_VALUE = 3; - static constexpr const int8_t BYTE_VALUE = 4; - - static constexpr const int8_t VALUE_MASK = 7; - - static constexpr const int8_t OFFSET = 8; - static constexpr const int8_t SHORT_ARRAY = 16; - static constexpr const int8_t BYTE_ARRAY = 24; - static constexpr const int8_t END = 32; - static constexpr const int8_t CMD_MASK = 0x78; -}; - -class DataInput { -public: - DataInput(const void *start, size_t size) : data_(static_cast(start)), size_(size) {} - int64_t readLong(); - int32_t readInt(); - int16_t readShort(); - int8_t readByte(); - -private: - const char *data_ = nullptr; - size_t size_ = 0; -}; - -std::shared_ptr makeColumnSource(const arrow::DataType &dataType); -int64_t readValue(DataInput *in, int command); - -std::shared_ptr readExternalCompressedDelta(DataInput *in); -} // namespace - -namespace { -SubscribeNubbin::SubscribeNubbin(std::shared_ptr server, std::vector ticketBytes, - std::shared_ptr colDefs, std::promise promise, - std::shared_ptr callback) : - server_(std::move(server)), ticketBytes_(std::move(ticketBytes)), colDefs_(std::move(colDefs)), - promise_(std::move(promise)), callback_(std::move(callback)) {} - -ZamboniBuffer::ZamboniBuffer(flatbuffers::DetachedBuffer buffer) : - arrow::Buffer(buffer.data(), int64_t(buffer.size())), buffer_(std::move(buffer)) {} - -void SubscribeNubbin::invoke() { - try { - invokeHelper(); - // If you made it this far, then you have been successful! - promise_.set_value(); - } catch (const std::exception &e) { - promise_.set_exception(std::make_exception_ptr(e)); - } -} - -constexpr const uint32_t deephavenMagicNumber = 0x6E687064U; - -std::shared_ptr SubscribeNubbin::sadClown_; - -void SubscribeNubbin::invokeHelper() { - arrow::flight::FlightCallOptions fco; - fco.headers.push_back(server_->makeBlessing()); - auto *client = server_->flightClient(); - - arrow::flight::FlightDescriptor dummy; - char magicData[4]; - uint32_t src = deephavenMagicNumber; - memcpy(magicData, &src, sizeof(magicData)); - - dummy.type = arrow::flight::FlightDescriptor::DescriptorType::CMD; - dummy.cmd = std::string(magicData, 4); - std::unique_ptr fsw; - std::unique_ptr fsr; - okOrThrow(DEEPHAVEN_EXPR_MSG(client->DoExchange(fco, dummy, &fsw, &fsr))); - - // Make a BarrageMessageWrapper - // ...Whose payload is a BarrageSubscriptionRequest - // ......which has BarrageSubscriptionOptions - - flatbuffers::FlatBufferBuilder payloadBuilder(4096); - - auto subOptions = CreateBarrageSubscriptionOptions(payloadBuilder, - ColumnConversionMode::ColumnConversionMode_Stringify, true, 0, 4096); - - auto ticket = payloadBuilder.CreateVector(ticketBytes_); - auto subreq = CreateBarrageSubscriptionRequest(payloadBuilder, ticket, {}, {}, subOptions); - payloadBuilder.Finish(subreq); - // TODO: fix sad cast - const auto *payloadp = (int8_t*)payloadBuilder.GetBufferPointer(); - const auto payloadSize = payloadBuilder.GetSize(); - - // TODO: I'd really like to just point this buffer backwards to the thing I just created, rather - // then copying it. But, eh, version 2. - flatbuffers::FlatBufferBuilder wrapperBuilder(4096); - auto payload = wrapperBuilder.CreateVector(payloadp, payloadSize); - auto messageWrapper = CreateBarrageMessageWrapper(wrapperBuilder, deephavenMagicNumber, - BarrageMessageType::BarrageMessageType_BarrageSubscriptionRequest, payload); - wrapperBuilder.Finish(messageWrapper); - auto wrapperBuffer = wrapperBuilder.Release(); - - auto buffer = std::make_shared(std::move(wrapperBuffer)); - okOrThrow(DEEPHAVEN_EXPR_MSG(fsw->WriteMetadata(std::move(buffer)))); - - auto threadNubbin = std::make_shared(std::move(fsr), - std::move(colDefs_), std::move(callback_)); - sadClown_ = threadNubbin; - std::thread t(&ThreadNubbin::runForever, std::move(threadNubbin)); - t.detach(); -} - -ThreadNubbin::ThreadNubbin(std::unique_ptr fsr, - std::shared_ptr colDefs, std::shared_ptr callback) : - fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)) {} - -void ThreadNubbin::runForever(const std::shared_ptr &self) { - std::cerr << "Hi, ThreadNubbin is awake\n"; - try { - self->runForeverHelper(); - } catch (const std::exception &e) { - streamf(std::cerr, "Caught exception in main table handle loop: %o\n", e.what()); - self->callback_->onFailure(std::make_exception_ptr(e)); - } - std::cerr << "ThreadNubbin is exiting. Bye.\n"; -} - -void ThreadNubbin::runForeverHelper() { - std::exception_ptr eptr; - try { - runForeverHelperImpl(); - } - catch (...) { - eptr = std::current_exception(); - } - callback_->onFailure(eptr); -} - -void ThreadNubbin::runForeverHelperImpl() { - const auto &vec = colDefs_->vec(); - // Create some MutableColumnSources and keep two views on them: a Mutable view which we - // will keep around locally in order to effect changes, and a readonly view used to make the - // table. - std::vector> mutableColumns; - std::vector> tableColumns; - mutableColumns.reserve(vec.size()); - tableColumns.reserve(vec.size()); - for (const auto &entry : vec) { - auto cs = makeColumnSource(*entry.second); - tableColumns.push_back(cs); - mutableColumns.push_back(std::move(cs)); - } - - auto sadTable = SadTickingTable::create(std::move(tableColumns)); - arrow::flight::FlightStreamChunk flightStreamChunk; - while (true) { - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); - // streamf(std::cerr, "GOT A NUBBIN\n%o\n", chunk.data->ToString()); - if (flightStreamChunk.app_metadata == nullptr) { - std::cerr << "TODO(kosak) -- chunk.app_metdata == nullptr\n"; - continue; - } - - const auto *q = flightStreamChunk.app_metadata->data(); - const auto *zamboni = GetBarrageMessageWrapper(q); - if (zamboni->magic() != deephavenMagicNumber) { - continue; - } - if (zamboni->msg_type() != BarrageMessageType::BarrageMessageType_BarrageUpdateMetadata) { - continue; - } - - auto rowSequence = sadTable->getRowSequence(); - streamf(std::cerr, "My rowseq is currently %o\n", rowSequence); - - const auto *pp = zamboni->msg_payload()->data(); - auto *nubbinp = flatbuffers::GetRoot(pp); - streamf(std::cerr, "num_add_batches=%o, num_mod_batches=%o\n", nubbinp->num_add_batches(), nubbinp->num_mod_batches()); - - DataInput diAdded(nubbinp->added_rows()->data(), nubbinp->added_rows()->size()); - auto addedRows = readExternalCompressedDelta(&diAdded); - DataInput diRemoved(nubbinp->removed_rows()->data(), nubbinp->removed_rows()->size()); - auto removedRows = readExternalCompressedDelta(&diRemoved); - - DataInput di(nubbinp->shift_data()->data(), nubbinp->shift_data()->size()); - auto startIndex = readExternalCompressedDelta(&di); - auto endIndex = readExternalCompressedDelta(&di); - auto destIndex = readExternalCompressedDelta(&di); - - streamf(std::cerr, "RemovedRows: {%o}\n", *removedRows); - streamf(std::cerr, "AddedRows: {%o}\n", *addedRows); - streamf(std::cerr, "shift start: {%o}\n", *startIndex); - streamf(std::cerr, "shift end: {%o}\n", *endIndex); - streamf(std::cerr, "shift dest: {%o}\n", *destIndex); - - // removes - // shifts - // adds - // modifies - - if (!addedRows->empty()) { - streamf(std::cerr, "There was some new data: %o rows, %o columns:\n", - flightStreamChunk.data->num_rows(), flightStreamChunk.data->num_columns()); - const auto &srcCols = flightStreamChunk.data->columns(); - for (size_t colNum = 0; colNum < srcCols.size(); ++colNum) { - streamf(std::cerr, "Column %o\n", colNum); - const auto &srcCol = srcCols[colNum]; - for (uint32_t ii = 0; ii < addedRows->size(); ++ii) { - const auto &res = srcCol->GetScalar(ii); - streamf(std::cerr, "%o: %o\n", ii, res.ValueOrDie()->ToString()); - } - } - } - - // 1. Removes - sadTable->erase(*removedRows); - - // 2. Shifts - if (nubbinp->shift_data()->size() != 0) { - sadTable->shift(*startIndex, *endIndex, *destIndex); - } - - // 3. Adds - { - auto unwrappedTable = sadTable->add(*addedRows); - auto rowKeys = unwrappedTable->getUnorderedRowKeys(); - - const auto &srcCols = flightStreamChunk.data->columns(); - auto ncols = srcCols.size(); - if (ncols != sadTable->numColumns()) { - auto message = stringf("Received %o columns, but my table has %o columns", ncols, - sadTable->numColumns()); - throw std::runtime_error(message); - } - - auto numRows = unwrappedTable->numRows(); - auto sequentialRows = SadRowSequence::createSequential(0, (int64_t)numRows); - - for (size_t i = 0; i < ncols; ++i) { - const auto &srcColArrow = *srcCols[i]; - - auto &destColDh = mutableColumns[i]; - auto context = destColDh->createContext(numRows); - auto chunk = ChunkMaker::createChunkFor(*destColDh, numRows); - - ChunkFiller::fillChunk(srcColArrow, *sequentialRows, chunk.get()); - destColDh->fillFromChunkUnordered(context.get(), *chunk, *rowKeys, numRows); - } - } - - // 4, Modifies - const auto &mcms = *nubbinp->mod_column_nodes(); - for (size_t i = 0; i < mcms.size(); ++i) { - const auto &elt = mcms.Get(i); - DataInput diModified(elt->modified_rows()->data(), elt->modified_rows()->size()); - auto modIndex = readExternalCompressedDelta(&diModified); - - if (modIndex->empty()) { - continue; - } - - auto zamboniRows = modIndex->size(); - - const auto &srcCols = flightStreamChunk.data->columns(); - const auto &srcColArrow = *srcCols[i]; - - auto &destColDh = mutableColumns[i]; - auto context = destColDh->createContext(zamboniRows); - auto chunk = ChunkMaker::createChunkFor(*destColDh, zamboniRows); - - auto sequentialRows = SadRowSequence::createSequential(0, (int64_t)zamboniRows); - - ChunkFiller::fillChunk(srcColArrow, *sequentialRows, chunk.get()); - destColDh->fillFromChunk(context.get(), *chunk, *modIndex); - } - - rowSequence = sadTable->getRowSequence(); - streamf(std::cerr, "Now my index looks like this: [%o]\n", *rowSequence); - - // TODO(kosak): Do something about the sharing story for SadTable - callback_->onTick(sadTable); - } -} -} // namespace - -namespace { -std::shared_ptr readExternalCompressedDelta(DataInput *in) { - SadRowSequenceBuilder builder; - - int64_t offset = 0; - - int64_t pending = -1; - auto consume = [&pending, &builder](int64_t v) { - auto s = pending; - if (s == -1) { - pending = v; - } else if (v < 0) { - builder.addRange(s, -v); - pending = -1; - } else { - builder.add(s); - pending = v; - } - }; - - while (true) { - int64_t actualValue; - int command = in->readByte(); - - switch (command & Constants::CMD_MASK) { - case Constants::OFFSET: { - int64_t value = readValue(in, command); - actualValue = offset + (value < 0 ? -value : value); - consume(value < 0 ? -actualValue : actualValue); - offset = actualValue; - break; - } - - case Constants::SHORT_ARRAY: { - int shortCount = (int) readValue(in, command); - for (int ii = 0; ii < shortCount; ++ii) { - int16_t shortValue = in->readShort(); - actualValue = offset + (shortValue < 0 ? -shortValue : shortValue); - consume(shortValue < 0 ? -actualValue : actualValue); - offset = actualValue; - } - break; - } - - case Constants::BYTE_ARRAY: { - int byteCount = (int) readValue(in, command); - for (int ii = 0; ii < byteCount; ++ii) { - int8_t byteValue = in->readByte(); - actualValue = offset + (byteValue < 0 ? -byteValue : byteValue); - consume(byteValue < 0 ? -actualValue : actualValue); - offset = actualValue; - } - break; - } - - case Constants::END: { - if (pending >= 0) { - builder.add(pending); - } - return builder.build(); - } - - default: - throw std::runtime_error(stringf("Bad command: %o", command)); - } - } -} - -struct MyVisitor final : public arrow::TypeVisitor { - arrow::Status Visit(const arrow::Int32Type &type) final { - result_ = SadIntArrayColumnSource::create(); - return arrow::Status::OK(); - } - - arrow::Status Visit(const arrow::Int64Type &type) final { - result_ = SadLongArrayColumnSource::create(); - return arrow::Status::OK(); - } - - arrow::Status Visit(const arrow::DoubleType &type) final { - result_ = SadDoubleArrayColumnSource::create(); - return arrow::Status::OK(); - } - - std::shared_ptr result_; -}; - -std::shared_ptr makeColumnSource(const arrow::DataType &dataType) { - MyVisitor v; - okOrThrow(DEEPHAVEN_EXPR_MSG(dataType.Accept(&v))); - return std::move(v.result_); -} - -int64_t readValue(DataInput *in, int command) { - switch (command & Constants::VALUE_MASK) { - case Constants::LONG_VALUE: { - return in->readLong(); - } - case Constants::INT_VALUE: { - return in->readInt(); - } - case Constants::SHORT_VALUE: { - return in->readShort(); - } - case Constants::BYTE_VALUE: { - return in->readByte(); - } - default: { - throw std::runtime_error(stringf("Bad command: %o", command)); - } - } -} - -int8_t DataInput::readByte() { - int8_t result; - std::memcpy(&result, data_, sizeof(result)); - data_ += sizeof(result); - return result; -} - -int16_t DataInput::readShort() { - int16_t result; - std::memcpy(&result, data_, sizeof(result)); - data_ += sizeof(result); - return result; -} - -int32_t DataInput::readInt() { - int32_t result; - std::memcpy(&result, data_, sizeof(result)); - data_ += sizeof(result); - return result; -} - -int64_t DataInput::readLong() { - int64_t result; - std::memcpy(&result, data_, sizeof(result)); - data_ += sizeof(result); - return result; -} -} // namespace - -void TableHandleImpl::subscribe(std::shared_ptr callback) { +std::shared_ptr TableHandleImpl::subscribe( + std::shared_ptr callback, bool wantImmer) { // On the flight executor thread, we invoke DoExchange (waiting for a successful response). // We wait for that response here. That makes the first part of this call synchronous. If there // is an error in the DoExchange invocation, the caller will get an exception here. The // remainder of the interaction (namely, the sending of a BarrageSubscriptionRequest and the // parsing of all the replies) is done on a newly-created thread dedicated to that job. + auto colDefs = lazyState_->getColumnDefinitions(); + auto handle = startSubscribeThread(managerImpl_->server(), managerImpl_->flightExecutor().get(), + colDefs, ticket_, std::move(callback), wantImmer); - auto coldefs = lazyState_->getColumnDefinitions(); - std::vector ticketBytes(ticket_.ticket().begin(), ticket_.ticket().end()); - - std::promise promise; - auto future = promise.get_future(); - auto innerCb = std::make_shared(managerImpl_->server(), std::move(ticketBytes), - std::move(coldefs), std::move(promise), std::move(callback)); - managerImpl_->flightExecutor()->invoke(std::move(innerCb)); - future.wait(); + subscriptions_.insert(handle); + return handle; } -void TableHandleImpl::unsubscribe(std::shared_ptr callback) { - std::cerr << "TODO(kosak) -- unsubscribe\n"; - std::cerr << "I'm kind of worried about this\n"; - SubscribeNubbin::sadClown_->fsr_->Cancel(); +void TableHandleImpl::unsubscribe(std::shared_ptr handle) { + auto node = subscriptions_.extract(handle); + if (node.empty()) { + return; + } + node.value()->cancel(); } std::vector> TableHandleImpl::getColumnImpls() { @@ -1058,9 +581,6 @@ void LazyState::getColumnDefinitionsAsync( ticketFuture_.invoke(std::move(innerCb)); } -ColumnDefinitions::ColumnDefinitions(vec_t vec, map_t map) : vec_(std::move(vec)), - map_(std::move(map)) {} -ColumnDefinitions::~ColumnDefinitions() = default; } // namespace internal } // namespace impl -} // namespace deephaven::client::highlevel +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/impl/table_handle_manager_impl.cc b/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc similarity index 87% rename from cpp-client/deephaven/client/src/highlevel/impl/table_handle_manager_impl.cc rename to cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc index 36bee9a496c..bc3d9250acd 100644 --- a/cpp-client/deephaven/client/src/highlevel/impl/table_handle_manager_impl.cc +++ b/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc @@ -1,12 +1,12 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/impl/table_handle_manager_impl.h" +#include "deephaven/client/impl/table_handle_manager_impl.h" #include #include "deephaven/client/utility/utility.h" #include "deephaven/client/utility/executor.h" -#include "deephaven/client/highlevel/impl/table_handle_impl.h" +#include "deephaven/client/impl/table_handle_impl.h" using deephaven::client::utility::Callback; using deephaven::client::utility::Executor; @@ -15,10 +15,7 @@ using deephaven::client::utility::SFCallback; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; -namespace deephaven { -namespace client { -namespace highlevel { -namespace impl { +namespace deephaven::client::impl { std::shared_ptr TableHandleManagerImpl::create(Ticket consoleId, std::shared_ptr server, std::shared_ptr executor, std::shared_ptr flightExecutor) { @@ -58,12 +55,9 @@ std::shared_ptr TableHandleManagerImpl::timeTable(int64_t start std::tuple, arrow::flight::FlightDescriptor> TableHandleManagerImpl::newTicket() const { - auto [ticket, fd] = server_->newTicketAndFlightDescriptor(); + auto[ticket, fd] = server_->newTicketAndFlightDescriptor(); auto cb = TableHandleImpl::createSatisfiedCallback(this, ticket); auto th = TableHandleImpl::create(self_.lock(), std::move(ticket), std::move(cb)); return std::make_tuple(std::move(th), std::move(fd)); } -} // namespace impl -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/src/lowlevel/server.cc b/cpp-client/deephaven/client/src/server/server.cc similarity index 94% rename from cpp-client/deephaven/client/src/lowlevel/server.cc rename to cpp-client/deephaven/client/src/server/server.cc index 63b310ebb25..5ad1f620211 100644 --- a/cpp-client/deephaven/client/src/lowlevel/server.cc +++ b/cpp-client/deephaven/client/src/server/server.cc @@ -1,7 +1,7 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/lowlevel/server.h" +#include "deephaven/client/server/server.h" #include #include @@ -41,12 +41,11 @@ using io::deephaven::proto::backplane::grpc::Ticket; using io::deephaven::proto::backplane::script::grpc::BindTableToVariableRequest; using io::deephaven::proto::backplane::script::grpc::StartConsoleRequest; -namespace deephaven { -namespace client { -namespace lowlevel { +namespace deephaven::client::server { namespace { Ticket makeScopeReference(std::string_view tableName); -void moveVectorData(std::vector src, google::protobuf::RepeatedPtrField *dest); +void +moveVectorData(std::vector src, google::protobuf::RepeatedPtrField *dest); } // namespace std::shared_ptr Server::createFromTarget(const std::string &target) { @@ -142,7 +141,7 @@ void Server::startConsoleAsync(std::shared_ptr> auto ticket = newTicket(); StartConsoleRequest req; *req.mutable_result_id() = std::move(ticket); - req.set_session_type("groovy"); + req.set_session_type("python"); sendRpc(req, std::move(callback), consoleStub(), &ConsoleService::Stub::AsyncStartConsole, true); } @@ -178,25 +177,29 @@ Ticket Server::timeTableAsync(int64_t startTimeNanos, int64_t periodNanos, Ticket Server::selectAsync(Ticket parentTicket, std::vector columnSpecs, std::shared_ptr etcCallback) { - return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), std::move(etcCallback), + return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), + std::move(etcCallback), &TableService::Stub::AsyncSelect); } Ticket Server::updateAsync(Ticket parentTicket, std::vector columnSpecs, std::shared_ptr etcCallback) { - return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), std::move(etcCallback), + return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), + std::move(etcCallback), &TableService::Stub::AsyncUpdate); } Ticket Server::viewAsync(Ticket parentTicket, std::vector columnSpecs, std::shared_ptr etcCallback) { - return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), std::move(etcCallback), + return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), + std::move(etcCallback), &TableService::Stub::AsyncView); } Ticket Server::updateViewAsync(Ticket parentTicket, std::vector columnSpecs, std::shared_ptr etcCallback) { - return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), std::move(etcCallback), + return selectOrUpdateHelper(std::move(parentTicket), std::move(columnSpecs), + std::move(etcCallback), &TableService::Stub::AsyncUpdateView); } @@ -206,7 +209,7 @@ Ticket Server::selectOrUpdateHelper(Ticket parentTicket, std::vectormutable_ticket() = std::move(parentTicket); - for (auto &cs : columnSpecs) { + for (auto &cs: columnSpecs) { *req.mutable_column_specs()->Add() = std::move(cs); } sendRpc(req, std::move(etcCallback), tableStub(), method, true); @@ -242,7 +245,7 @@ Ticket Server::sortAsync(Ticket parentTicket, std::vector sortDe SortTableRequest req; *req.mutable_result_id() = result; *req.mutable_source_id()->mutable_ticket() = std::move(parentTicket); - for (auto &sd : sortDescriptors) { + for (auto &sd: sortDescriptors) { *req.mutable_sorts()->Add() = std::move(sd); } sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncSort, true); @@ -258,10 +261,10 @@ Ticket Server::comboAggregateDescriptorAsync(Ticket parentTicket, ComboAggregateRequest req; *req.mutable_result_id() = result; *req.mutable_source_id()->mutable_ticket() = std::move(parentTicket); - for (auto &agg : aggregates) { + for (auto &agg: aggregates) { *req.mutable_aggregates()->Add() = std::move(agg); } - for (auto &gbc : groupByColumns) { + for (auto &gbc: groupByColumns) { *req.mutable_group_by_columns()->Add() = std::move(gbc); } req.set_force_combo(forceCombo); @@ -276,7 +279,7 @@ Ticket Server::headOrTailByAsync(Ticket parentTicket, bool head, *req.mutable_result_id() = result; *req.mutable_source_id()->mutable_ticket() = std::move(parentTicket); req.set_num_rows(n); - for (auto &cs : columnSpecs) { + for (auto &cs: columnSpecs) { req.mutable_group_by_column_specs()->Add(std::move(cs)); } const auto &which = head ? &TableService::Stub::AsyncHeadBy : &TableService::Stub::AsyncTailBy; @@ -313,7 +316,7 @@ Ticket Server::mergeAsync(std::vector sourceTickets, std::string keyColu auto result = newTicket(); MergeTablesRequest req; *req.mutable_result_id() = result; - for (auto &t : sourceTickets) { + for (auto &t: sourceTickets) { *req.mutable_source_ids()->Add()->mutable_ticket() = std::move(t); } req.set_key_column(std::move(keyColumn)); @@ -331,7 +334,8 @@ Ticket Server::crossJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket, *req.mutable_right_id()->mutable_ticket() = std::move(rightTableTicket); moveVectorData(std::move(columnsToMatch), req.mutable_columns_to_match()); moveVectorData(std::move(columnsToAdd), req.mutable_columns_to_add()); - sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncCrossJoinTables, true); + sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncCrossJoinTables, + true); return result; } @@ -345,7 +349,8 @@ Ticket Server::naturalJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket, *req.mutable_right_id()->mutable_ticket() = std::move(rightTableTicket); moveVectorData(std::move(columnsToMatch), req.mutable_columns_to_match()); moveVectorData(std::move(columnsToAdd), req.mutable_columns_to_add()); - sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncNaturalJoinTables, true); + sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncNaturalJoinTables, + true); return result; } @@ -359,7 +364,8 @@ Ticket Server::exactJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket, *req.mutable_right_id()->mutable_ticket() = std::move(rightTableTicket); moveVectorData(std::move(columnsToMatch), req.mutable_columns_to_match()); moveVectorData(std::move(columnsToAdd), req.mutable_columns_to_add()); - sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncExactJoinTables, true); + sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncExactJoinTables, + true); return result; } @@ -378,14 +384,16 @@ Ticket Server::asOfJoinAsync(AsOfJoinTablesRequest::MatchRule matchRule, Ticket return result; } -void Server::bindToVariableAsync(const Ticket &consoleId, const Ticket &tableId, std::string variable, +void +Server::bindToVariableAsync(const Ticket &consoleId, const Ticket &tableId, std::string variable, std::shared_ptr> callback) { BindTableToVariableRequest req; *req.mutable_console_id() = consoleId; req.set_variable_name(std::move(variable)); *req.mutable_table_id() = tableId; - sendRpc(req, std::move(callback), consoleStub(), &ConsoleService::Stub::AsyncBindTableToVariable, true); + sendRpc(req, std::move(callback), consoleStub(), &ConsoleService::Stub::AsyncBindTableToVariable, + true); } std::pair Server::makeBlessing() const { @@ -445,6 +453,7 @@ bool Server::processNextCompletionQueueItem() { CompletionQueueCallback::CompletionQueueCallback(std::shared_ptr failureCallback) : failureCallback_(std::move(failureCallback)) {} + CompletionQueueCallback::~CompletionQueueCallback() = default; namespace { @@ -458,11 +467,9 @@ Ticket makeScopeReference(std::string_view tableName) { void moveVectorData(std::vector src, google::protobuf::RepeatedPtrField *dest) { - for (auto &s : src) { + for (auto &s: src) { dest->Add(std::move(s)); } } } // namespace -} // namespace lowlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::server diff --git a/cpp-client/deephaven/client/src/subscription/batch_parser.cc b/cpp-client/deephaven/client/src/subscription/batch_parser.cc new file mode 100644 index 00000000000..804fb1063e8 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/batch_parser.cc @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/batch_parser.h" + +#include +#include +#include "deephaven/client/utility/utility.h" + +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::stringf; + +namespace deephaven::client::subscription { +// Processes all of the adds in this add batch. Will invoke (numAdds - 1) additional calls to GetNext(). +void BatchParser::parseBatches( + const ColumnDefinitions &colDefs, + size_t numBatches, + bool allowInconsistentColumnSizes, + arrow::flight::FlightStreamReader *fsr, + arrow::flight::FlightStreamChunk *flightStreamChunk, + const std::function> &)> &callback) { + auto colDefsSize = colDefs.vec().size(); + if (numBatches == 0) { + return; + } + + while (true) { + const auto &srcCols = flightStreamChunk->data->columns(); + auto ncols = srcCols.size(); + if (ncols != colDefsSize) { + throw std::runtime_error(stringf("Received %o columns, but my table has %o columns", ncols, + colDefsSize)); + } + + if (!allowInconsistentColumnSizes) { + auto numRows = srcCols[0]->length(); + for (size_t i = 1; i < ncols; ++i) { + const auto &srcColArrow = *srcCols[i]; + // I think you do not want this check for the modify case. When you are parsing modify + // messages, the columns may indeed be of different sizes. + if (srcColArrow.length() != numRows) { + auto message = stringf( + "Inconsistent column lengths: Column 0 has %o rows, but column %o has %o rows", + numRows, i, srcColArrow.length()); + throw std::runtime_error(message); + } + } + } + + callback(srcCols); + + if (--numBatches == 0) { + return; + } + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr->Next(flightStreamChunk))); + } +} + +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/classic_table_state.cc b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc new file mode 100644 index 00000000000..6fd2aa4141b --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/classic_table_state.h" + +#include +#include "deephaven/client/chunk/chunk_filler.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/subscription/shift_processor.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::chunk::ChunkFiller; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::chunk::UInt64Chunk; +using deephaven::client::column::ColumnSource; +using deephaven::client::column::MutableColumnSource; +using deephaven::client::column::NumericArrayColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::table::Table; +using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::makeReservedVector; +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; + +namespace deephaven::client::subscription { +namespace { +void mapShifter(uint64_t begin, uint64_t end, uint64_t dest, std::map *map); + +std::vector> +makeColumnSources(const ColumnDefinitions &colDefs); + +class TableView final : public Table { +public: + TableView(std::vector> columns, + std::shared_ptr> redirection); + ~TableView() final; + + std::shared_ptr getRowSequence() const final; + + std::shared_ptr getColumn(size_t columnIndex) const final { + // This is actually wrong. It needs to return a redirected column. + // return columns_[columnIndex]; + throw std::runtime_error("TODO(kosak): need to make a redirected column."); + } + + size_t numRows() const final { + return redirection_->size(); + } + + size_t numColumns() const override { + return columns_.size(); + } + +private: + std::vector> columns_; + std::shared_ptr> redirection_; +}; + +class UnwrappedTableView final : public Table { +public: + UnwrappedTableView(std::vector> columns, size_t numRows); + ~UnwrappedTableView() final; + + std::shared_ptr getRowSequence() const final; + + std::shared_ptr getColumn(size_t columnIndex) const final { + return columns_[columnIndex]; + } + + size_t numRows() const final { + return numRows_; + } + + size_t numColumns() const override { + return columns_.size(); + } + +private: + std::vector> columns_; + size_t numRows_ = 0; +}; +} + +ClassicTableState::ClassicTableState(const ColumnDefinitions &colDefs) : + redirection_(std::make_shared>()) { + columns_ = makeColumnSources(colDefs); +} + +ClassicTableState::~ClassicTableState() = default; + +UInt64Chunk ClassicTableState::erase(const RowSequence &rowsToRemoveKeySpace) { + auto nrows = rowsToRemoveKeySpace.size(); + auto result = UInt64Chunk::create(nrows); + auto *destp = result.data(); + auto removeRange = [this, &destp](uint64_t beginKey, uint64_t endKey) { + auto beginp = redirection_->find(beginKey); + if (beginp == redirection_->end()) { + throw std::runtime_error(stringf("Can't find beginKey %o", beginKey)); + } + + auto currentp = beginp; + for (auto current = beginKey; current != endKey; ++current) { + if (currentp->first != current) { + throw std::runtime_error(stringf("Can't find key %o", current)); + } + *destp = currentp->second; + ++destp; + ++currentp; + } + redirection_->erase(beginp, currentp); + }; + rowsToRemoveKeySpace.forEachChunk(removeRange); + return result; +} + +UInt64Chunk ClassicTableState::addKeys(const RowSequence &addedRowsKeySpace) { + // In order to give back an ordered row sequence (because at the moment we don't have an + // unordered row sequence), we sort the keys we're going to reuse. + auto nrows = addedRowsKeySpace.size(); + auto numKeysToReuse = std::min(nrows, slotsToReuse_.size()); + auto reuseBegin = slotsToReuse_.end() - static_cast(numKeysToReuse); + auto reuseEnd = slotsToReuse_.end(); + std::sort(reuseBegin, reuseEnd); + + auto reuseCurrent = reuseBegin; + + auto result = UInt64Chunk::create(nrows); + auto *destp = result.data(); + auto addRange = [this, &reuseCurrent, reuseEnd, &destp](uint64_t beginKey, uint64_t endKey) { + for (auto current = beginKey; current != endKey; ++current) { + uint64_t keyPositionSpace; + if (reuseCurrent != reuseEnd) { + keyPositionSpace = *reuseCurrent++; + } else { + keyPositionSpace = redirection_->size(); + } + auto result = redirection_->insert(std::make_pair(current, keyPositionSpace)); + if (!result.second) { + throw std::runtime_error(stringf("Can't add because key %o already exists", current)); + } + *destp++ = keyPositionSpace; + } + }; + addedRowsKeySpace.forEachChunk(addRange); + slotsToReuse_.erase(reuseBegin, reuseEnd); + return result; +} + +void ClassicTableState::addData(const std::vector> &data, + const UInt64Chunk &rowsToAddIndexSpace) { + auto ncols = data.size(); + auto nrows = rowsToAddIndexSpace.size(); + auto sequentialRows = RowSequence::createSequential(0, nrows); + for (size_t i = 0; i < ncols; ++i) { + const auto &src = *data[i]; + auto *dest = columns_[i].get(); + auto anyChunk = ChunkMaker::createChunkFor(*dest, nrows); + auto &chunk = anyChunk.unwrap(); + ChunkFiller::fillChunk(src, *sequentialRows, &chunk); + dest->fillFromChunkUnordered(chunk, rowsToAddIndexSpace); + } +} + +void ClassicTableState::applyShifts(const RowSequence &firstIndex, const RowSequence &lastIndex, + const RowSequence &destIndex) { + auto *redir = redirection_.get(); + auto processShift = [redir](uint64_t first, uint64_t last, uint64_t dest) { + uint64_t begin = first; + uint64_t end = ((uint64_t) last) + 1; + uint64_t destBegin = dest; + mapShifter(begin, end, destBegin, redir); + }; + ShiftProcessor::applyShiftData(firstIndex, lastIndex, destIndex, processShift); +} + +std::shared_ptr
ClassicTableState::snapshot() const { + return std::make_shared(columns_, redirection_); +} + +std::shared_ptr
ClassicTableState::snapshotUnwrapped() const { + return std::make_shared(columns_, redirection_->size()); +} + +std::vector ClassicTableState::modifyKeys( + const std::vector> &rowsToModifyKeySpace) { + auto nrows = rowsToModifyKeySpace.size(); + auto sequentialRows = RowSequence::createSequential(0, nrows); + + auto ncols = rowsToModifyKeySpace.size(); + auto result = makeReservedVector(ncols); + for (size_t i = 0; i < ncols; ++i) { + auto rowSequence = modifyKeysHelper(*rowsToModifyKeySpace[i]); + result.push_back(std::move(rowSequence)); + } + return result; +} + +UInt64Chunk ClassicTableState::modifyKeysHelper( + const RowSequence &rowsToModifyKeySpace) { + auto nrows = rowsToModifyKeySpace.size(); + auto result = UInt64Chunk::create(nrows); + auto *destp = result.data(); + auto modifyRange = [this, &destp](uint64_t beginKey, uint64_t endKey) { + auto beginp = redirection_->find(beginKey); + if (beginp == redirection_->end()) { + throw std::runtime_error(stringf("Can't find beginKey %o", beginKey)); + } + + auto currentp = beginp; + for (auto current = beginKey; current != endKey; ++current) { + if (currentp->first != current) { + throw std::runtime_error(stringf("Can't find key %o", current)); + } + *destp = currentp->second; + ++currentp; + ++destp; + } + }; + rowsToModifyKeySpace.forEachChunk(modifyRange); + if (destp != result.data() + nrows) { + throw std::runtime_error("destp != result->data() + nrows"); + } + return result; +} + +void ClassicTableState::modifyData(const std::vector> &src, + const std::vector &rowsToModifyIndexSpace) { + auto ncols = rowsToModifyIndexSpace.size(); + for (size_t i = 0; i < ncols; ++i) { + const auto &rows = rowsToModifyIndexSpace[i]; + const auto &srcArray = *src[i]; + auto *destCol = columns_[i].get(); + auto nrows = rows.size(); + auto sequentialRows = RowSequence::createSequential(0, nrows); + auto anyChunk = ChunkMaker::createChunkFor(*destCol, nrows); + auto &chunk = anyChunk.unwrap(); + ChunkFiller::fillChunk(srcArray, *sequentialRows, &chunk); + destCol->fillFromChunkUnordered(chunk, rows); + } +} + +namespace { +void mapShifter(uint64_t begin, uint64_t end, uint64_t dest, std::map *map) { + if (dest < begin) { + // dest < begin, so shift down, moving forwards. + auto delta = begin - dest; + auto currentp = map->lower_bound(begin); + // currentp points to map->end(), or to the first key >= begin + while (true) { + if (currentp == map->end() || currentp->first >= end) { + return; + } + auto nextp = std::next(currentp); + auto node = map->extract(currentp); + auto newKey = node.key() - delta; +// streamf(std::cerr, "Shifting down, working forwards, moving key from %o to %o\n", node.key(), +// newKey); + node.key() = newKey; + map->insert(std::move(node)); + currentp = nextp; + } + return; + } + + // dest >= begin, so shift up, moving backwards. + auto delta = dest - begin; + auto currentp = map->lower_bound(end); + // currentp points to map->begin(), or to the first key >= end + if (currentp == map->begin()) { + return; + } + --currentp; + // now currentp points to the last key < end + while (true) { + if (currentp->first < begin) { + return; + } + // using map->end() as a sentinel, sort of viewing it as "wrapping around". + auto nextp = currentp != map->begin() ? std::prev(currentp) : map->end(); + auto node = map->extract(currentp); + auto newKey = node.key() + delta; +// streamf(std::cerr, "Shifting up, working backwards, moving key from %o to %o\n", node.key(), +// newKey); + node.key() = newKey; + map->insert(std::move(node)); + if (nextp == map->end()) { + return; + } + currentp = nextp; + } +} + +struct MyVisitor final : public arrow::TypeVisitor { + arrow::Status Visit(const arrow::Int32Type &type) final { + columnSource_ = NumericArrayColumnSource::create(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::Int64Type &type) final { + columnSource_ = NumericArrayColumnSource::create(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::DoubleType &type) final { + columnSource_ = NumericArrayColumnSource::create(); + return arrow::Status::OK(); + } + + std::shared_ptr columnSource_; +}; + +std::vector> makeColumnSources(const ColumnDefinitions &colDefs) { + std::vector> result; + for (const auto &[name, arrowType] : colDefs.vec()) { + MyVisitor v; + okOrThrow(DEEPHAVEN_EXPR_MSG(arrowType->Accept(&v))); + result.push_back(v.columnSource_); + } + + return result; +} + +TableView::TableView(std::vector> columns, + std::shared_ptr> redirection) : columns_(std::move(columns)), + redirection_(std::move(redirection)) {} +TableView::~TableView() = default; + +std::shared_ptr TableView::getRowSequence() const { + throw std::runtime_error("TODO(kosak)"); +} + +UnwrappedTableView::UnwrappedTableView(std::vector> columns, + size_t numRows) : columns_(std::move(columns)), numRows_(numRows) {} +UnwrappedTableView::~UnwrappedTableView() = default; + +std::shared_ptr UnwrappedTableView::getRowSequence() const { + throw std::runtime_error("TODO(kosak)"); +} +} // namespace +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/immer_table_state.cc b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc new file mode 100644 index 00000000000..e7449a83ff4 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/immer_table_state.h" + +#include +#include + +#include "deephaven/client/arrowutil/arrow_visitors.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/immerutil/abstract_flex_vector.h" +#include "deephaven/client/subscription/shift_processor.h" +#include "deephaven/client/utility/utility.h" +#include "immer/flex_vector.hpp" +#include "immer/flex_vector_transient.hpp" + +using deephaven::client::arrowutil::ArrowTypeVisitor; +using deephaven::client::arrowutil::ArrowArrayTypeVisitor; +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::column::ColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::container::RowSequenceIterator; +using deephaven::client::subscription::ShiftProcessor; +using deephaven::client::immerutil::AbstractFlexVectorBase; +using deephaven::client::table::Table; +using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::makeReservedVector; +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; + +namespace deephaven::client::subscription { +namespace { +// void mapShifter(int64_t start, int64_t endInclusive, int64_t dest, std::map *zm); +class MyTable final : public Table { +public: + explicit MyTable(std::vector> sources, size_t numRows); + ~MyTable() final; + + std::shared_ptr getRowSequence() const final; + std::shared_ptr getColumn(size_t columnIndex) const final { + return sources_[columnIndex]; + } + size_t numRows() const final { + return numRows_; + } + size_t numColumns() const final { + return sources_.size(); + } + +private: + std::vector> sources_; + size_t numRows_ = 0; +}; + +std::vector> makeFlexVectorsFromColDefs( + const ColumnDefinitions &colDefs); +std::vector> makeFlexVectorsFromArrays( + const std::vector> &arrays); +} // namespace + +//ImmerTableState::ImmerTableState(const ColumnDefinitions &colDefs) +// std::vector> flexVectors) : +// flexVectors_(std::move(flexVectors)) {} + +ImmerTableState::ImmerTableState(const ColumnDefinitions &colDefs) { + flexVectors_ = makeFlexVectorsFromColDefs(colDefs); +} + +ImmerTableState::~ImmerTableState() = default; + +std::shared_ptr ImmerTableState::addKeys(const RowSequence &rowsToAddKeySpace) { + return spaceMapper_.addKeys(rowsToAddKeySpace); +} + +void ImmerTableState::addData(const std::vector> &data, + const RowSequence &rowsToAddIndexSpace) { + auto ncols = data.size(); + if (ncols != flexVectors_.size()) { + throw std::runtime_error(stringf("ncols != flexVectors_.size() (%o != %o)", + ncols, flexVectors_.size())); + } + auto addedData = makeFlexVectorsFromArrays(data); + + auto addChunk = [this, &addedData](uint64_t beginIndex, uint64_t endIndex) { + auto size = endIndex - beginIndex; + + for (size_t i = 0; i < flexVectors_.size(); ++i) { + auto &fv = flexVectors_[i]; + auto &ad = addedData[i]; + + auto fvTemp = std::move(fv); + // Give "fv" its original values up to 'beginIndex'; leave fvTemp with the rest. + fv = fvTemp->take(beginIndex); + fvTemp->inPlaceDrop(beginIndex); + + // Append the next 'size' values from 'addedData' to 'fv' and drop them from 'addedData'. + fv->inPlaceAppend(ad->take(size)); + ad->inPlaceDrop(size); + + // Append the residual items back from 'fvTemp'. + fv->inPlaceAppend(std::move(fvTemp)); + } + }; + rowsToAddIndexSpace.forEachChunk(addChunk); +} + +std::shared_ptr ImmerTableState::erase(const RowSequence &rowsToRemoveKeySpace) { + auto result = spaceMapper_.convertKeysToIndices(rowsToRemoveKeySpace); + + auto eraseChunk = [this](uint64_t beginKey, uint64_t endKey) { + auto size = endKey - beginKey; + auto beginIndex = spaceMapper_.eraseRange(beginKey, endKey); + auto endIndex = beginIndex + size; + + for (auto &fv : flexVectors_) { + auto fvTemp = std::move(fv); + fv = fvTemp->take(beginIndex); + fvTemp->inPlaceDrop(endIndex); + fv->inPlaceAppend(std::move(fvTemp)); + } + }; + rowsToRemoveKeySpace.forEachChunk(eraseChunk); + return result; +} + +std::vector> ImmerTableState::modifyKeys( + const std::vector> &rowsToModifyKeySpace) { + auto ncols = rowsToModifyKeySpace.size(); + auto result = makeReservedVector>(ncols); + for (const auto &rs : rowsToModifyKeySpace) { + result.push_back(spaceMapper_.convertKeysToIndices(*rs)); + } + return result; +} + +void ImmerTableState::modifyData(const std::vector> &data, + const std::vector> &rowsToModifyIndexSpace) { + auto ncols = data.size(); + if (ncols != rowsToModifyIndexSpace.size()) { + throw std::runtime_error(stringf("data.size() != rowsToModifyIndexSpace.size() (%o != %o)", + ncols, rowsToModifyIndexSpace.size())); + } + auto modifiedData = makeFlexVectorsFromArrays(data); + + for (size_t i = 0; i < ncols; ++i) { + modifyColumn(i, std::move(modifiedData[i]), *rowsToModifyIndexSpace[i]); + } +} + +void ImmerTableState::modifyColumn(size_t colNum, + std::unique_ptr modifiedData, + const RowSequence &rowsToModifyIndexSpace) { + auto &fv = flexVectors_[colNum]; + auto modifyChunk = [&fv, &modifiedData](uint64_t beginIndex, uint64_t endIndex) { + auto size = endIndex - beginIndex; + auto fvTemp = std::move(fv); + + // Give 'fv' its original values up to 'beginIndex'; but drop values up to 'endIndex' + fv = fvTemp->take(beginIndex); + fvTemp->inPlaceDrop(endIndex); + + // Take 'size' values from 'modifiedData' and drop them from 'modifiedData' + fv->inPlaceAppend(modifiedData->take(size)); + modifiedData->inPlaceDrop(size); + + // Append the residual items back from 'fvTemp'. + fv->inPlaceAppend(std::move(fvTemp)); + }; + rowsToModifyIndexSpace.forEachChunk(modifyChunk); +} + +void ImmerTableState::applyShifts(const RowSequence &firstIndex, const RowSequence &lastIndex, + const RowSequence &destIndex) { + auto processShift = [this](int64_t first, int64_t last, int64_t dest) { + uint64_t begin = first; + uint64_t end = ((uint64_t)last) + 1; + uint64_t destBegin = dest; + spaceMapper_.applyShift(begin, end, destBegin); + }; + ShiftProcessor::applyShiftData(firstIndex, lastIndex, destIndex, processShift); +} + +std::shared_ptr
ImmerTableState::snapshot() const { + auto columnSources = makeReservedVector>(flexVectors_.size()); + for (const auto &fv : flexVectors_) { + columnSources.push_back(fv->makeColumnSource()); + } + return std::make_shared(std::move(columnSources), spaceMapper_.size()); +} + +namespace { + +MyTable::MyTable(std::vector> sources, size_t numRows) : + sources_(std::move(sources)), numRows_(numRows) {} +MyTable::~MyTable() = default; + +std::shared_ptr MyTable::getRowSequence() const { + // Need a utility for this + RowSequenceBuilder rb; + rb.addRange(0, numRows_); + return rb.build(); +} + +struct FlexVectorMaker final { + template + void operator()() { + result_ = AbstractFlexVectorBase::create(immer::flex_vector()); + } + + std::unique_ptr result_; +}; + +std::vector> makeFlexVectorsFromColDefs( + const ColumnDefinitions &colDefs) { + auto ncols = colDefs.vec().size(); + auto result = makeReservedVector>(ncols); + for (const auto &colDef : colDefs.vec()) { + ArrowTypeVisitor v; + okOrThrow(DEEPHAVEN_EXPR_MSG(colDef.second->Accept(&v))); + result.push_back(std::move(v.inner().result_)); + } + return result; +} + +std::vector> makeFlexVectorsFromArrays( + const std::vector> &arrays) { + auto ncols = arrays.size(); + auto result = makeReservedVector>(ncols); + for (const auto &a : arrays) { + ArrowArrayTypeVisitor v; + okOrThrow(DEEPHAVEN_EXPR_MSG(a->Accept(&v))); + v.inner().result_->inPlaceAppendArrow(*a); + result.push_back(std::move(v.inner().result_)); + } + return result; +} +} // namespace +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/index_decoder.cc b/cpp-client/deephaven/client/src/subscription/index_decoder.cc new file mode 100644 index 00000000000..854e3f17867 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/index_decoder.cc @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/index_decoder.h" + +#include +#include +#include "deephaven/flatbuf/Barrage_generated.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::utility::stringf; + +namespace deephaven::client::subscription { +namespace { +struct Constants { + static constexpr const int8_t SHORT_VALUE = 1; + static constexpr const int8_t INT_VALUE = 2; + static constexpr const int8_t LONG_VALUE = 3; + static constexpr const int8_t BYTE_VALUE = 4; + + static constexpr const int8_t VALUE_MASK = 7; + + static constexpr const int8_t OFFSET = 8; + static constexpr const int8_t SHORT_ARRAY = 16; + static constexpr const int8_t BYTE_ARRAY = 24; + static constexpr const int8_t END = 32; + static constexpr const int8_t CMD_MASK = 0x78; +}; +} // namespace + +std::shared_ptr IndexDecoder::readExternalCompressedDelta(DataInput *in) { + RowSequenceBuilder builder; + + int64_t offset = 0; + + int64_t pending = -1; + auto consume = [&pending, &builder](int64_t v) { + auto s = pending; + if (s == -1) { + pending = v; + } else if (v < 0) { + auto begin = (uint64_t)s; + auto end = ((uint64_t)-v) + 1; + builder.addRange(begin, end); + pending = -1; + } else { + builder.add(s); + pending = v; + } + }; + + while (true) { + int64_t actualValue; + int command = in->readByte(); + + switch (command & Constants::CMD_MASK) { + case Constants::OFFSET: { + int64_t value = in->readValue(command); + actualValue = offset + (value < 0 ? -value : value); + consume(value < 0 ? -actualValue : actualValue); + offset = actualValue; + break; + } + + case Constants::SHORT_ARRAY: { + int shortCount = (int) in->readValue(command); + for (int ii = 0; ii < shortCount; ++ii) { + int16_t shortValue = in->readShort(); + actualValue = offset + (shortValue < 0 ? -shortValue : shortValue); + consume(shortValue < 0 ? -actualValue : actualValue); + offset = actualValue; + } + break; + } + + case Constants::BYTE_ARRAY: { + int byteCount = (int) in->readValue(command); + for (int ii = 0; ii < byteCount; ++ii) { + int8_t byteValue = in->readByte(); + actualValue = offset + (byteValue < 0 ? -byteValue : byteValue); + consume(byteValue < 0 ? -actualValue : actualValue); + offset = actualValue; + } + break; + } + + case Constants::END: { + if (pending >= 0) { + builder.add(pending); + } + return builder.build(); + } + + default: + throw std::runtime_error(stringf("Bad command: %o", command)); + } + } +} + +int64_t DataInput::readValue(int command) { + switch (command & Constants::VALUE_MASK) { + case Constants::LONG_VALUE: { + return readLong(); + } + case Constants::INT_VALUE: { + return readInt(); + } + case Constants::SHORT_VALUE: { + return readShort(); + } + case Constants::BYTE_VALUE: { + return readByte(); + } + default: { + throw std::runtime_error(stringf("Bad command: %o", command)); + } + } +} + +int8_t DataInput::readByte() { + int8_t result; + std::memcpy(&result, data_, sizeof(result)); + data_ += sizeof(result); + return result; +} + +int16_t DataInput::readShort() { + int16_t result; + std::memcpy(&result, data_, sizeof(result)); + data_ += sizeof(result); + return result; +} + +int32_t DataInput::readInt() { + int32_t result; + std::memcpy(&result, data_, sizeof(result)); + data_ += sizeof(result); + return result; +} + +int64_t DataInput::readLong() { + int64_t result; + std::memcpy(&result, data_, sizeof(result)); + data_ += sizeof(result); + return result; +} +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/shift_processor.cc b/cpp-client/deephaven/client/src/subscription/shift_processor.cc new file mode 100644 index 00000000000..a0943ac4dc4 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/shift_processor.cc @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/shift_processor.h" + +namespace deephaven::client::subscription { +void ShiftProcessor::applyShiftData(const RowSequence &firstIndex, const RowSequence &lastIndex, + const RowSequence &destIndex, + const std::function &processShift) { + if (firstIndex.empty()) { + return; + } + + // Loop twice: once in the forward direction (applying negative shifts), and once in the reverse + // direction (applying positive shifts). Because we don't have a reverse iterator at the moment, + // we save up the reverse tuples for processing in a separate step. + std::vector > positiveShifts; + auto startIter = firstIndex.getRowSequenceIterator(); + auto endIter = lastIndex.getRowSequenceIterator(); + auto destIter = destIndex.getRowSequenceIterator(); + auto showMessage = [](size_t first, size_t last, size_t dest) { +// const char *which = dest >= last ? "positive" : "negative"; +// streamf(std::cerr, "Processing %o shift src [%o..%o] dest %o\n", which, first, last, dest); + }; + { + uint64_t first, last, dest; + while (startIter->tryGetNext(&first)) { + if (!endIter->tryGetNext(&last) || !destIter->tryGetNext(&dest)) { + throw std::runtime_error("Sequences not of same size"); + } + if (dest >= first) { + positiveShifts.emplace_back(first, last, dest); + continue; + } + showMessage(first, last, dest); + processShift(first, last, dest); + } + } + + for (auto ip = positiveShifts.rbegin(); ip != positiveShifts.rend(); ++ip) { + auto first = std::get<0>(*ip); + auto last = std::get<1>(*ip); + auto dest = std::get<2>(*ip); + showMessage(first, last, dest); + processShift(first, last, dest); + } +} +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/space_mapper.cc b/cpp-client/deephaven/client/src/subscription/space_mapper.cc new file mode 100644 index 00000000000..b849167e537 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/space_mapper.cc @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/space_mapper.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::utility::separatedList; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; + +namespace deephaven::client::subscription { +namespace { +// We make an "iterator" that refers to a point in a numeric range. +// This is useful because we can use the "range" version of boost::multiset::insert, which +// uses hints internally and should be somewhat faster for inserting contiguous values. +struct SimpleRangeIterator { + explicit SimpleRangeIterator(uint64_t value) : value_(value) {} + + uint64_t operator*() const { return value_; } + + SimpleRangeIterator &operator++() { + ++value_; + return *this; + } + + friend bool operator!=(const SimpleRangeIterator &lhs, const SimpleRangeIterator &rhs) { + return lhs.value_ != rhs.value_; + } + + uint64_t value_; +}; +} +SpaceMapper::SpaceMapper() = default; +SpaceMapper::~SpaceMapper() = default; + +uint64_t SpaceMapper::addRange(uint64_t beginKey, uint64_t endKey) { + auto size = endKey - beginKey; + if (size == 0) { + return 0; // arbitrary + } + auto initialSize = set_.size(); + set_.insert(SimpleRangeIterator(beginKey), SimpleRangeIterator(endKey)); + if (set_.size() != initialSize + size) { + throw std::runtime_error(stringf("Some elements of [%o,%o) were already in the set", beginKey, + endKey)); + } + return set_.find_rank(beginKey); +} + +uint64_t SpaceMapper::eraseRange(uint64_t beginKey, uint64_t endKey) { + size_t size = endKey - beginKey; + if (size == 0) { + return 0; // arbitrary + } + auto ip = set_.find(beginKey); + // This is ok (I think) even in the not-found case because set_.rank(set_.end()) is defined, and + // is set_.size(). The not-found case will throw an exception shortly in the test inside the loop. + auto result = set_.rank(ip); + for (auto current = beginKey; current != endKey; ++current) { + if (ip == set_.end() || *ip != current) { + throw std::runtime_error(stringf("key %o was not in the set", current)); + } + ip = set_.erase(ip); + } + return result; +} + +void SpaceMapper::applyShift(uint64_t beginKey, uint64_t endKey, uint64_t destKey) { + if (beginKey == endKey) { + return; + } + if (destKey > beginKey) { + auto amountToAdd = destKey - beginKey; + // positive shift: work backwards + auto ip = set_.lower_bound(endKey); + // ip is the first element >= endKey, or it is end() + if (ip == set_.begin()) { + return; + } + --ip; + // ip is the last element < endKey + while (true) { + if (*ip < beginKey) { + // exceeded range + return; + } + std::optional prev; + if (ip != set_.begin()) { + prev = std::prev(ip); + } + auto node = set_.extract(ip); + node.value() = node.value() + amountToAdd; + set_.insert(std::move(node)); + if (!prev.has_value()) { + return; + } + ip = *prev; + } + return; + } + + // destKey <= beginKey, shifts are negative, so work in the forward direction + auto amountToSubtract = beginKey - destKey; + // negative shift: work forwards + auto ip = set_.lower_bound(beginKey); + // ip == end, or the first element >= beginKey + while (true) { + if (ip == set_.end() || *ip >= endKey) { + return; + } + auto nextp = std::next(ip); + auto node = set_.extract(ip); + node.value() = node.value() - amountToSubtract; + set_.insert(std::move(node)); + ip = nextp; + } +} + +std::shared_ptr SpaceMapper::addKeys(const RowSequence &keys) { + RowSequenceBuilder builder; + auto addChunk = [this, &builder](uint64_t beginKey, uint64_t endKey) { + auto size = endKey - beginKey; + auto beginIndex = addRange(beginKey, endKey); + builder.addRange(beginIndex, beginIndex + size); + }; + keys.forEachChunk(addChunk); + return builder.build(); +} + +std::shared_ptr SpaceMapper::convertKeysToIndices(const RowSequence &keys) const { + RowSequenceBuilder builder; + auto convertChunk = [this, &builder](uint64_t begin, uint64_t end) { + auto beginp = set_.find(begin); + if (beginp == set_.end()) { + throw std::runtime_error(stringf("begin key %o is not in the src map", begin)); + } + auto nextRank = set_.rank(beginp); + // Confirm we have entries for everything in the range. + auto currentp = beginp; + for (auto current = begin; current != end; ++current) { + if (current != *currentp) { + throw std::runtime_error(stringf("current key %o is in not the src map", begin)); + } + ++currentp; + } + auto size = end - begin; + builder.addRange(nextRank, nextRank + size); + }; + keys.forEachChunk(convertChunk); + return builder.build(); +} +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc new file mode 100644 index 00000000000..e97c770fe9b --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/subscribe_thread.h" + +#include +#include "deephaven/client/ticking.h" +#include "deephaven/client/server/server.h" +#include "deephaven/client/subscription/index_decoder.h" +#include "deephaven/client/subscription/update_processor.h" +#include "deephaven/client/utility/callbacks.h" +#include "deephaven/client/utility/executor.h" +#include "deephaven/client/utility/misc.h" +#include "deephaven/flatbuf/Barrage_generated.h" + +using deephaven::client::TickingCallback; +using deephaven::client::subscription::UpdateProcessor; +using deephaven::client::utility::Callback; +using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::Executor; +using deephaven::client::utility::okOrThrow; +using deephaven::client::server::Server; +using io::deephaven::barrage::flatbuf::BarrageMessageType; +using io::deephaven::barrage::flatbuf::ColumnConversionMode; +using io::deephaven::proto::backplane::grpc::Ticket; + +namespace deephaven::client::subscription { +namespace { +class SubscribeState final : public Callback<> { + typedef deephaven::client::server::Server Server; + +public: + SubscribeState(std::shared_ptr server, std::vector ticketBytes, + std::shared_ptr colDefs, + std::promise> promise, + std::shared_ptr callback, + bool wantImmer); + void invoke() final; + +private: + std::shared_ptr invokeHelper(); + + std::shared_ptr server_; + std::vector ticketBytes_; + std::shared_ptr colDefs_; + std::promise> promise_; + std::shared_ptr callback_; + bool wantImmer_ = false; +}; + +// A simple extension to arrow::Buffer that owns its DetachedBuffer storage +class OwningBuffer final : public arrow::Buffer { +public: + explicit OwningBuffer(flatbuffers::DetachedBuffer buffer); + ~OwningBuffer() final; + +private: + flatbuffers::DetachedBuffer buffer_; +}; +} // namespace + +std::shared_ptr startSubscribeThread( + std::shared_ptr server, + Executor *flightExecutor, + std::shared_ptr columnDefinitions, + const Ticket &ticket, + std::shared_ptr callback, + bool wantImmer) { + std::promise> promise; + auto future = promise.get_future(); + std::vector ticketBytes(ticket.ticket().begin(), ticket.ticket().end()); + auto ss = std::make_shared(std::move(server), std::move(ticketBytes), + std::move(columnDefinitions), std::move(promise), std::move(callback), wantImmer); + flightExecutor->invoke(std::move(ss)); + return future.get(); +} + +namespace { +SubscribeState::SubscribeState(std::shared_ptr server, std::vector ticketBytes, + std::shared_ptr colDefs, std::promise> promise, + std::shared_ptr callback, bool wantImmer) : + server_(std::move(server)), ticketBytes_(std::move(ticketBytes)), colDefs_(std::move(colDefs)), + promise_(std::move(promise)), callback_(std::move(callback)), wantImmer_(wantImmer) {} + +void SubscribeState::invoke() { + try { + auto handle = invokeHelper(); + // If you made it this far, then you have been successful! + promise_.set_value(std::move(handle)); + } catch (const std::exception &e) { + promise_.set_exception(std::make_exception_ptr(e)); + } +} + +namespace { +// Wrapper class that forwards the "cancel" call from SubscriptionHandle to the UpdateProcessor +struct CancelWrapper final : SubscriptionHandle { + explicit CancelWrapper(std::shared_ptr updateProcessor) : + updateProcessor_(std::move(updateProcessor)) {} + + void cancel() final { + updateProcessor_->cancel(); + } + + std::shared_ptr updateProcessor_; +}; +} // namespace + +std::shared_ptr SubscribeState::invokeHelper() { + arrow::flight::FlightCallOptions fco; + fco.headers.push_back(server_->makeBlessing()); + auto *client = server_->flightClient(); + + arrow::flight::FlightDescriptor dummy; + char magicData[4]; + uint32_t src = deephavenMagicNumber; + memcpy(magicData, &src, sizeof(magicData)); + + dummy.type = arrow::flight::FlightDescriptor::DescriptorType::CMD; + dummy.cmd = std::string(magicData, 4); + std::unique_ptr fsw; + std::unique_ptr fsr; + okOrThrow(DEEPHAVEN_EXPR_MSG(client->DoExchange(fco, dummy, &fsw, &fsr))); + + // Make a BarrageMessageWrapper + // ...Whose payload is a BarrageSubscriptionRequest + // ......which has BarrageSubscriptionOptions + + flatbuffers::FlatBufferBuilder payloadBuilder(4096); + + auto subOptions = CreateBarrageSubscriptionOptions(payloadBuilder, + ColumnConversionMode::ColumnConversionMode_Stringify, true, 0, 4096); + + auto ticket = payloadBuilder.CreateVector(ticketBytes_); + auto subreq = CreateBarrageSubscriptionRequest(payloadBuilder, ticket, {}, {}, subOptions); + payloadBuilder.Finish(subreq); + // TODO(kosak): fix sad cast + const auto *payloadp = (int8_t*)payloadBuilder.GetBufferPointer(); + const auto payloadSize = payloadBuilder.GetSize(); + + // TODO: I'd really like to just point this buffer backwards to the thing I just created, rather + // then copying it. But, eh, version 2. + flatbuffers::FlatBufferBuilder wrapperBuilder(4096); + auto payload = wrapperBuilder.CreateVector(payloadp, payloadSize); + auto messageWrapper = CreateBarrageMessageWrapper(wrapperBuilder, deephavenMagicNumber, + BarrageMessageType::BarrageMessageType_BarrageSubscriptionRequest, payload); + wrapperBuilder.Finish(messageWrapper); + auto wrapperBuffer = wrapperBuilder.Release(); + + auto buffer = std::make_shared(std::move(wrapperBuffer)); + okOrThrow(DEEPHAVEN_EXPR_MSG(fsw->WriteMetadata(std::move(buffer)))); + + // Run forever (until error or cancellation) + auto processor = UpdateProcessor::startThread(std::move(fsr), std::move(colDefs_), + std::move(callback_), wantImmer_); + return std::make_shared(std::move(processor)); +} + +OwningBuffer::OwningBuffer(flatbuffers::DetachedBuffer buffer) : + arrow::Buffer(buffer.data(), int64_t(buffer.size())), buffer_(std::move(buffer)) {} +OwningBuffer::~OwningBuffer() = default; +} // namespace +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/update_processor.cc b/cpp-client/deephaven/client/src/subscription/update_processor.cc new file mode 100644 index 00000000000..30005c264c2 --- /dev/null +++ b/cpp-client/deephaven/client/src/subscription/update_processor.cc @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/subscription/update_processor.h" + +#include +#include +#include "deephaven/client/chunk/chunk_filler.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/immerutil/abstract_flex_vector.h" +#include "deephaven/client/immerutil/immer_column_source.h" +#include "deephaven/client/subscription/batch_parser.h" +#include "deephaven/client/subscription/classic_table_state.h" +#include "deephaven/client/subscription/immer_table_state.h" +#include "deephaven/client/subscription/index_decoder.h" +#include "deephaven/client/utility/utility.h" +#include "deephaven/client/ticking.h" +#include "deephaven/flatbuf/Barrage_generated.h" + +using deephaven::client::ClassicTickingUpdate; +using deephaven::client::chunk::ChunkFiller; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::chunk::UInt64Chunk; +using deephaven::client::column::MutableColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::immerutil::AbstractFlexVectorBase; +using deephaven::client::subscription::BatchParser; +using deephaven::client::table::Table; +using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::makeReservedVector; +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; + +using io::deephaven::barrage::flatbuf::BarrageMessageType; +using io::deephaven::barrage::flatbuf::BarrageMessageWrapper; +using io::deephaven::barrage::flatbuf::BarrageModColumnMetadata; +using io::deephaven::barrage::flatbuf::BarrageUpdateMetadata; +using io::deephaven::barrage::flatbuf::ColumnConversionMode; +using io::deephaven::barrage::flatbuf::CreateBarrageMessageWrapper; +using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionOptions; +using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionRequest; + +namespace deephaven::client::subscription { +namespace { +struct ExtractedMetadata { + ExtractedMetadata(size_t numAdds, + size_t numMods, + std::shared_ptr removedRows, + std::shared_ptr shiftStartIndex, + std::shared_ptr shiftEndIndex, + std::shared_ptr shiftDestIndex, + std::shared_ptr addedRows, + std::vector> modifiedRows); + ~ExtractedMetadata(); + + size_t numAdds_ = 0; + size_t numMods_ = 0; + std::shared_ptr removedRows_; + std::shared_ptr shiftStartIndex_; + std::shared_ptr shiftEndIndex_; + std::shared_ptr shiftDestIndex_; + std::shared_ptr addedRows_; + std::vector> modifiedRows_; +}; + +std::optional extractMetadata( + const arrow::flight::FlightStreamChunk &flightStreamChunk); +} // namespace + +std::shared_ptr UpdateProcessor::startThread( + std::unique_ptr fsr, + std::shared_ptr colDefs, + std::shared_ptr callback, + bool wantImmer) { + auto result = std::make_shared(std::move(fsr), + std::move(colDefs), std::move(callback)); + std::thread t(&UpdateProcessor::runForever, result, wantImmer); + t.detach(); + return result; +} + +UpdateProcessor::UpdateProcessor(std::unique_ptr fsr, + std::shared_ptr colDefs, std::shared_ptr callback) : + fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)) {} + +UpdateProcessor::~UpdateProcessor() = default; + +void UpdateProcessor::cancel() { + fsr_->Cancel(); +} + +void UpdateProcessor::runForever(const std::shared_ptr &self, bool wantImmer) { + std::cerr << "UpdateProcessor is starting.\n"; + std::exception_ptr eptr; + try { + if (wantImmer) { + self->immerRunForeverHelper(); + } else { + self->classicRunForeverHelper(); + } + } catch (...) { + eptr = std::current_exception(); + self->callback_->onFailure(eptr); + } + std::cerr << "UpdateProcessor is exiting.\n"; +} + +void UpdateProcessor::classicRunForeverHelper() { + ClassicTableState state(*colDefs_); + + // In this loop we process Arrow Flight messages until error or cancellation. + arrow::flight::FlightStreamChunk flightStreamChunk; + while (true) { + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); + + // Parse all the metadata out of the Barrage message before we advance the cursor past it. + auto mdo = extractMetadata(flightStreamChunk); + if (!mdo.has_value()) { + continue; + } + auto &md = *mdo; + + // Correct order to process all this info is: + // 1. removes + // 2. shifts + // 3. adds + // 4. modifies + + // 1. Removes + auto removedRowsKeySpace = std::move(md.removedRows_); + auto removedRowsIndexSpace = state.erase(*removedRowsKeySpace); + + // 2. Shifts + state.applyShifts(*md.shiftStartIndex_, *md.shiftEndIndex_, *md.shiftDestIndex_); + + // 3. Adds + auto addedRowsKeySpace = RowSequence::createEmpty(); + auto addedRowsIndexSpace = UInt64Chunk::create(0); + if (md.numAdds_ != 0) { + addedRowsKeySpace = std::move(md.addedRows_); + addedRowsIndexSpace = state.addKeys(*addedRowsKeySpace); + + // Copy everything. + auto rowsRemaining = addedRowsIndexSpace.take(addedRowsIndexSpace.size()); + + auto processAddBatch = [&state, &rowsRemaining]( + const std::vector> &data) { + if (data.empty()) { + return; + } + auto size = data[0]->length(); + auto rowsToAddThisTime = rowsRemaining.take(size); + rowsRemaining = rowsRemaining.drop(size); + state.addData(data, rowsToAddThisTime); + }; + BatchParser::parseBatches(*colDefs_, md.numAdds_, false, fsr_.get(), &flightStreamChunk, + processAddBatch); + + if (md.numMods_ != 0) { + // Currently the FlightStreamReader is pointing to the last add record. We need to advance + // it so it points to the first mod record. + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); + } + } + + auto ncols = colDefs_->vec().size(); + + // 4. Modifies + auto modifiedRowsKeySpace = std::move(md.modifiedRows_); + auto modifiedRowsIndexSpace = state.modifyKeys(modifiedRowsKeySpace); + if (md.numMods_ != 0) { + // Local copy of modifiedRowsIndexSpace + auto keysRemaining = makeReservedVector(ncols); + for (const auto &keys : modifiedRowsIndexSpace) { + keysRemaining.push_back(keys.take(keys.size())); + } + + std::vector keysToModifyThisTime(ncols); + + auto processModifyBatch = [&state, &keysRemaining, &keysToModifyThisTime, ncols]( + const std::vector> &data) { + if (data.size() != ncols) { + throw std::runtime_error(stringf("data.size() != ncols (%o != %o)", data.size(), ncols)); + } + for (size_t i = 0; i < data.size(); ++i) { + const auto &src = data[i]; + auto &krm = keysRemaining[i]; + keysToModifyThisTime[i] = krm.take(src->length()); + krm = krm.drop(src->length()); + } + state.modifyData(data, keysToModifyThisTime); + }; + + BatchParser::parseBatches(*colDefs_, md.numMods_, true, fsr_.get(), &flightStreamChunk, + processModifyBatch); + } + + auto currentTableKeySpace = state.snapshot(); + auto currentTableIndexSpace = state.snapshotUnwrapped(); + + ClassicTickingUpdate update(std::move(removedRowsKeySpace), std::move(removedRowsIndexSpace), + std::move(addedRowsKeySpace), std::move(addedRowsIndexSpace), + std::move(modifiedRowsKeySpace), std::move(modifiedRowsIndexSpace), + std::move(currentTableKeySpace), std::move(currentTableIndexSpace)); + callback_->onTick(update); + } +} + +void UpdateProcessor::immerRunForeverHelper() { + ImmerTableState state(*colDefs_); + + // In this loop we process Arrow Flight messages until error or cancellation. + arrow::flight::FlightStreamChunk flightStreamChunk; + while (true) { + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); + + // Parse all the metadata out of the Barrage message before we advance the cursor past it. + auto mdo = extractMetadata(flightStreamChunk); + if (!mdo.has_value()) { + continue; + } + auto &md = *mdo; + + // Correct order to process all this info is: + // 1. removes + // 2. shifts + // 3. adds + // 4. modifies + + // 1. Removes + auto beforeRemoves = state.snapshot(); + auto removedRowsKeySpace = std::move(md.removedRows_); + auto removedRowsIndexSpace = state.erase(*removedRowsKeySpace); + + // 2. Shifts + state.applyShifts(*md.shiftStartIndex_, *md.shiftEndIndex_, *md.shiftDestIndex_); + + // 3. Adds + auto addedRowsKeySpace = RowSequence::createEmpty(); + auto addedRowsIndexSpace = RowSequence::createEmpty(); + if (md.numAdds_ != 0) { + addedRowsKeySpace = std::move(md.addedRows_); + addedRowsIndexSpace = state.addKeys(*addedRowsKeySpace); + + // Copy everything. + auto rowsRemaining = addedRowsIndexSpace->take(addedRowsIndexSpace->size()); + + auto processAddBatch = [&state, &rowsRemaining]( + const std::vector> &data) { + if (data.empty()) { + return; + } + auto size = data[0]->length(); + auto rowsToAddThisTime = rowsRemaining->take(size); + rowsRemaining = rowsRemaining->drop(size); + state.addData(data, *rowsToAddThisTime); + }; + BatchParser::parseBatches(*colDefs_, md.numAdds_, false, fsr_.get(), &flightStreamChunk, + processAddBatch); + + if (md.numMods_ != 0) { + // Currently the FlightStreamReader is pointing to the last add record. We need to advance + // it so it points to the first mod record. + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); + } + } + + auto beforeModifies = state.snapshot(); + + auto ncols = colDefs_->vec().size(); + + // 4. Modifies + auto modifiedRowsKeySpace = std::move(md.modifiedRows_); + auto modifiedRowsIndexSpace = state.modifyKeys(modifiedRowsKeySpace); + if (md.numMods_ != 0) { + // Local copy of modifiedRowsIndexSpace + auto keysRemaining = makeReservedVector>(ncols); + for (const auto &keys : modifiedRowsIndexSpace) { + keysRemaining.push_back(keys->take(keys->size())); + } + + std::vector> keysToModifyThisTime(ncols); + + auto processModifyBatch = [&state, &keysRemaining, &keysToModifyThisTime, ncols]( + const std::vector> &data) { + if (data.size() != ncols) { + throw std::runtime_error(stringf("data.size() != ncols (%o != %o)", data.size(), ncols)); + } + for (size_t i = 0; i < data.size(); ++i) { + const auto &src = data[i]; + auto &krm = keysRemaining[i]; + keysToModifyThisTime[i] = krm->take(src->length()); + krm = krm->drop(src->length()); + } + state.modifyData(data, keysToModifyThisTime); + }; + + BatchParser::parseBatches(*colDefs_, md.numMods_, true, fsr_.get(), &flightStreamChunk, + processModifyBatch); + } + + auto current = state.snapshot(); + ImmerTickingUpdate update(std::move(beforeRemoves), std::move(beforeModifies), + std::move(current), std::move(removedRowsIndexSpace), std::move(modifiedRowsIndexSpace), + std::move(addedRowsIndexSpace)); + callback_->onTick(std::move(update)); + } +} + +namespace { +std::optional extractMetadata( + const arrow::flight::FlightStreamChunk &flightStreamChunk) { + if (flightStreamChunk.app_metadata == nullptr) { + std::cerr << "TODO(kosak) -- unexpected - chunk.app_metdata == nullptr\n"; + return {}; + } + + const auto *barrageWrapperRaw = flightStreamChunk.app_metadata->data(); + const auto *barrageWrapper = flatbuffers::GetRoot(barrageWrapperRaw); + if (barrageWrapper->magic() != deephavenMagicNumber) { + return {}; + } + if (barrageWrapper->msg_type() != + BarrageMessageType::BarrageMessageType_BarrageUpdateMetadata) { + return {}; + } + + const auto *bmdRaw = barrageWrapper->msg_payload()->data(); + const auto *bmd = flatbuffers::GetRoot(bmdRaw); + auto numAdds = bmd->num_add_batches(); + auto numMods = bmd->num_mod_batches(); + // streamf(std::cerr, "num_add_batches=%o, num_mod_batches=%o\n", numAdds, numMods); + // streamf(std::cerr, "FYI, my row sequence is currently %o\n", *tickingTable->getRowSequence()); + + DataInput diAdded(*bmd->added_rows()); + DataInput diRemoved(*bmd->removed_rows()); + DataInput diThreeShiftIndexes(*bmd->shift_data()); + + auto addedRows = IndexDecoder::readExternalCompressedDelta(&diAdded); + auto removedRows = IndexDecoder::readExternalCompressedDelta(&diRemoved); + auto shiftStartIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + auto shiftEndIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + auto shiftDestIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + + std::vector> perColumnModifies; + if (numMods != 0) { + const auto &modColumnNodes = *bmd->mod_column_nodes(); + perColumnModifies.reserve(modColumnNodes.size()); + for (size_t i = 0; i < modColumnNodes.size(); ++i) { + const auto &elt = modColumnNodes.Get(i); + DataInput diModified(*elt->modified_rows()); + auto modRows = IndexDecoder::readExternalCompressedDelta(&diModified); + perColumnModifies.push_back(std::move(modRows)); + } + } +// streamf(std::cerr, "RemovedRows: {%o}\n", *removedRows); +// streamf(std::cerr, "AddedRows: {%o}\n", *addedRows); +// streamf(std::cerr, "shift start: {%o}\n", *shiftStartIndex); +// streamf(std::cerr, "shift end: {%o}\n", *shiftEndIndex); +// streamf(std::cerr, "shift dest: {%o}\n", *shiftDestIndex); + + return ExtractedMetadata(numAdds, + numMods, + std::move(removedRows), + std::move(shiftStartIndex), + std::move(shiftEndIndex), + std::move(shiftDestIndex), + std::move(addedRows), + std::move(perColumnModifies)); +} + +ExtractedMetadata::ExtractedMetadata(size_t numAdds, size_t numMods, + std::shared_ptr removedRows, std::shared_ptr shiftStartIndex, + std::shared_ptr shiftEndIndex, std::shared_ptr shiftDestIndex, + std::shared_ptr addedRows, + std::vector> modifiedRows) : + numAdds_(numAdds), numMods_(numMods), + removedRows_(std::move(removedRows)), shiftStartIndex_(std::move(shiftStartIndex)), + shiftEndIndex_(std::move(shiftEndIndex)), shiftDestIndex_(std::move(shiftDestIndex)), + addedRows_(std::move(addedRows)), modifiedRows_(std::move(modifiedRows)) {} + +ExtractedMetadata::~ExtractedMetadata() = default; + +//ThreadNubbin::ThreadNubbin(std::unique_ptr fsr, +// std::shared_ptr colDefs, std::shared_ptr callback) : +// fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)) {} +} // namespace +} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/table/table.cc b/cpp-client/deephaven/client/src/table/table.cc new file mode 100644 index 00000000000..d75fcbabf4c --- /dev/null +++ b/cpp-client/deephaven/client/src/table/table.cc @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/table/table.h" + +namespace deephaven::client::table { +} // namespace deephaven::client::table diff --git a/cpp-client/deephaven/client/src/ticking.cc b/cpp-client/deephaven/client/src/ticking.cc new file mode 100644 index 00000000000..cd3bf250e3f --- /dev/null +++ b/cpp-client/deephaven/client/src/ticking.cc @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/ticking.h" + +namespace deephaven::client { +ClassicTickingUpdate::ClassicTickingUpdate(std::shared_ptr removedRowsKeySpace, + UInt64Chunk removedRowsIndexSpace, + std::shared_ptr addedRowsKeySpace, + UInt64Chunk addedRowsIndexSpace, + std::vector> modifiedRowsKeySpace, + std::vector modifiedRowsIndexSpace, + std::shared_ptr
currentTableKeySpace, + std::shared_ptr
currentTableIndexSpace) : + removedRowsKeySpace_(std::move(removedRowsKeySpace)), + removedRowsIndexSpace_(std::move(removedRowsIndexSpace)), + addedRowsKeySpace_(std::move(addedRowsKeySpace)), + addedRowsIndexSpace_(std::move(addedRowsIndexSpace)), + modifiedRowsKeySpace_(std::move(modifiedRowsKeySpace)), + modifiedRowsIndexSpace_(std::move(modifiedRowsIndexSpace)), + currentTableKeySpace_(std::move(currentTableKeySpace)), + currentTableIndexSpace_(std::move(currentTableIndexSpace)) {} +ClassicTickingUpdate::ClassicTickingUpdate(ClassicTickingUpdate &&other) noexcept = default; +ClassicTickingUpdate &ClassicTickingUpdate::operator=(ClassicTickingUpdate &&other) noexcept = default; +ClassicTickingUpdate::~ClassicTickingUpdate() = default; + +ImmerTickingUpdate::ImmerTickingUpdate(std::shared_ptr
beforeRemoves, + std::shared_ptr
beforeModifies, + std::shared_ptr
current, + std::shared_ptr removed, + std::vector> modified, + std::shared_ptr added) : beforeRemoves_(std::move(beforeRemoves)), + beforeModifies_(std::move(beforeModifies)), + current_(std::move(current)), + removed_(std::move(removed)), + modified_(std::move(modified)), + added_(std::move(added)) {} + +ImmerTickingUpdate::ImmerTickingUpdate(ImmerTickingUpdate &&other) noexcept = default; +ImmerTickingUpdate &ImmerTickingUpdate::operator=(ImmerTickingUpdate &&other) noexcept = default; +ImmerTickingUpdate::~ImmerTickingUpdate() = default; + +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/highlevel/types.cc b/cpp-client/deephaven/client/src/types.cc similarity index 91% rename from cpp-client/deephaven/client/src/highlevel/types.cc rename to cpp-client/deephaven/client/src/types.cc index 4a7af7e40cc..fafe8f3c64b 100644 --- a/cpp-client/deephaven/client/src/highlevel/types.cc +++ b/cpp-client/deephaven/client/src/types.cc @@ -1,11 +1,9 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "deephaven/client/highlevel/types.h" +#include "deephaven/client/types.h" -namespace deephaven { -namespace client { -namespace highlevel { +namespace deephaven::client { const char16_t DeephavenConstants::NULL_CHAR; const float DeephavenConstants::NULL_FLOAT; @@ -45,8 +43,10 @@ const int64_t DeephavenConstants::MIN_LONG; const int64_t DeephavenConstants::MAX_LONG; DateTime::DateTime(int year, int month, int day) : DateTime(year, month, day, 0, 0, 0, 0) {} + DateTime::DateTime(int year, int month, int day, int hour, int minute, int second) : -DateTime(year, month, day, hour, minute, second, 0) {} + DateTime(year, month, day, hour, minute, second, 0) {} + DateTime::DateTime(int year, int month, int day, int hour, int minute, int second, long nanos) { struct tm tm = {}; @@ -73,6 +73,4 @@ void DateTime::streamIrisRepresentation(std::ostream &s) const { snprintf(nanosBuffer, sizeof(nanosBuffer), "%09zd", nanos); s << dateBuffer << '.' << nanosBuffer << " UTC"; } -} // namespace highlevel -} // namespace client -} // namespace deephaven +} // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/utility/misc.cc b/cpp-client/deephaven/client/src/utility/misc.cc new file mode 100644 index 00000000000..786c98c4ab9 --- /dev/null +++ b/cpp-client/deephaven/client/src/utility/misc.cc @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/utility/misc.h" + +namespace deephaven::client::utility { +ColumnDefinitions::ColumnDefinitions(vec_t vec, map_t map) : vec_(std::move(vec)), + map_(std::move(map)) {} +ColumnDefinitions::~ColumnDefinitions() = default; +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/src/utility/table_maker.cc b/cpp-client/deephaven/client/src/utility/table_maker.cc index bcedb92bbda..d251a7bf03f 100644 --- a/cpp-client/deephaven/client/src/utility/table_maker.cc +++ b/cpp-client/deephaven/client/src/utility/table_maker.cc @@ -4,7 +4,7 @@ #include "deephaven/client/utility/table_maker.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandle; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::valueOrThrow; @@ -25,9 +25,9 @@ void TableMaker::finishAddColumn(std::string name, internal::TypeConverter info) if (columns_.empty()) { numRows_ = info.column()->length(); } else if (numRows_ != info.column()->length()) { - auto message = stringf("Column sizes not consistent: expected %o, have %o", numRows_, - info.column()->length()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG( + stringf("Column sizes not consistent: expected %o, have %o", numRows_, + info.column()->length()))); } columns_.push_back(std::move(info.column())); diff --git a/cpp-client/deephaven/client/src/utility/utility.cc b/cpp-client/deephaven/client/src/utility/utility.cc index 2f5f6d8009b..868c4fef0cb 100644 --- a/cpp-client/deephaven/client/src/utility/utility.cc +++ b/cpp-client/deephaven/client/src/utility/utility.cc @@ -8,14 +8,21 @@ using namespace std; -namespace deephaven { -namespace client { -namespace utility { +namespace deephaven::client::utility { namespace { void dumpTillPercentOrEnd(ostream &result, const char **fmt); } // namespace +void assertLessEq(size_t lhs, size_t rhs, std::string_view context, std::string_view lhsText, + std::string_view rhsText) { + if (lhs <= rhs) { + return; + } + auto message = stringf("%o: assertion failed: %o <= %o (%o <= %o)", + context, lhs, rhs, lhsText, rhsText); +} + SimpleOstringstream::SimpleOstringstream() : std::ostream(this), dest_(&internalBuffer_) {} SimpleOstringstream::SimpleOstringstream(std::string *clientBuffer) : std::ostream(this), @@ -86,24 +93,37 @@ bool dumpFormat(ostream &result, const char **fmt, bool placeholderExpected) { } } // namespace internal -std::shared_ptr>> stringVecToShared(std::vector src) { +std::shared_ptr>> +stringVecToShared(std::vector src) { auto result = std::make_shared>>(); result->reserve(src.size()); - for (auto &s : src) { + for (auto &s: src) { result->push_back(std::make_shared(std::move(s))); } return result; } -void okOrThrow(const arrow::Status &status, const char *message) { +DebugInfo::DebugInfo(const char *func, const char *file, size_t line, const char *args) : + func_(func), file_(file), line_(line), args_(args) {} + +std::ostream &operator<<(std::ostream &s, const DebugInfo &o) { + return streamf(s, "%o@%o:%o args=(%o))", o.func_, o.file_, o.line_, o.args_); +} + +void okOrThrow(const DebugInfo &debugInfo, const arrow::Status &status) { if (status.ok()) { return; } - auto msg = stringf("Status: %o. Caller message: %o", status, message != nullptr ? message : "(none)"); + auto msg = stringf("Status: %o. Caller: %o", status, debugInfo); throw std::runtime_error(msg); } +std::string formatDebugString(const char *func, const char *file, size_t line, + const std::string &message) { + return stringf("%o@%o:%o: %o", func, file, line, message); +} + namespace { void dumpTillPercentOrEnd(ostream &result, const char **fmt) { const char *start = *fmt; @@ -122,6 +142,4 @@ void dumpTillPercentOrEnd(ostream &result, const char **fmt) { *fmt = p; } } // namespace -} // namespace utility -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt b/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt new file mode 100644 index 00000000000..854c7efc32f --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt @@ -0,0 +1,7 @@ +TODO: put correct license here +indicating we are using Flatbuffers v2.0.6 +modifications are: +- copied only the files we needed +- moved the namespace of the code to a Deephaven-internal namespace, + so as not to conflict with any other flatbuffers being linked + (such as the one inside Arrow) diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h new file mode 100644 index 00000000000..108f628d55e --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h @@ -0,0 +1,68 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_ALLOCATOR_H_ +#define FLATBUFFERS_ALLOCATOR_H_ + +#include "flatbuffers/base.h" + +namespace deephaven::third_party::flatbuffers { + +// Allocator interface. This is flatbuffers-specific and meant only for +// `vector_downward` usage. +class Allocator { + public: + virtual ~Allocator() {} + + // Allocate `size` bytes of memory. + virtual uint8_t *allocate(size_t size) = 0; + + // Deallocate `size` bytes of memory at `p` allocated by this allocator. + virtual void deallocate(uint8_t *p, size_t size) = 0; + + // Reallocate `new_size` bytes of memory, replacing the old region of size + // `old_size` at `p`. In contrast to a normal realloc, this grows downwards, + // and is intended specifcally for `vector_downward` use. + // `in_use_back` and `in_use_front` indicate how much of `old_size` is + // actually in use at each end, and needs to be copied. + virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size, + size_t new_size, size_t in_use_back, + size_t in_use_front) { + FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows + uint8_t *new_p = allocate(new_size); + memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, + in_use_front); + deallocate(old_p, old_size); + return new_p; + } + + protected: + // Called by `reallocate_downward` to copy memory from `old_p` of `old_size` + // to `new_p` of `new_size`. Only memory of size `in_use_front` and + // `in_use_back` will be copied from the front and back of the old memory + // allocation. + void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p, + size_t new_size, size_t in_use_back, + size_t in_use_front) { + memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back, + in_use_back); + memcpy(new_p, old_p, in_use_front); + } +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_ALLOCATOR_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/array.h b/cpp-client/deephaven/client/third_party/flatbuffers/array.h new file mode 100644 index 00000000000..fb4863ceb51 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/array.h @@ -0,0 +1,243 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_ARRAY_H_ +#define FLATBUFFERS_ARRAY_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/stl_emulation.h" +#include "flatbuffers/vector.h" + +namespace deephaven::third_party::flatbuffers { + +// This is used as a helper type for accessing arrays. +template class Array { + // Array can carry only POD data types (scalars or structs). + typedef typename flatbuffers::bool_constant::value> + scalar_tag; + typedef + typename flatbuffers::conditional::type + IndirectHelperType; + + public: + typedef uint16_t size_type; + typedef typename IndirectHelper::return_type return_type; + typedef VectorIterator const_iterator; + typedef VectorReverseIterator const_reverse_iterator; + + // If T is a LE-scalar or a struct (!scalar_tag::value). + static FLATBUFFERS_CONSTEXPR bool is_span_observable = + (scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1)) || + !scalar_tag::value; + + FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; } + + return_type Get(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return IndirectHelper::Read(Data(), i); + } + + return_type operator[](uoffset_t i) const { return Get(i); } + + // If this is a Vector of enums, T will be its storage type, not the enum + // type. This function makes it convenient to retrieve value with enum + // type E. + template E GetEnum(uoffset_t i) const { + return static_cast(Get(i)); + } + + const_iterator begin() const { return const_iterator(Data(), 0); } + const_iterator end() const { return const_iterator(Data(), size()); } + + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + + const_iterator cbegin() const { return begin(); } + const_iterator cend() const { return end(); } + + const_reverse_iterator crbegin() const { return rbegin(); } + const_reverse_iterator crend() const { return rend(); } + + // Get a mutable pointer to elements inside this array. + // This method used to mutate arrays of structs followed by a @p Mutate + // operation. For primitive types use @p Mutate directly. + // @warning Assignments and reads to/from the dereferenced pointer are not + // automatically converted to the correct endianness. + typename flatbuffers::conditional::type + GetMutablePointer(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return const_cast(&data()[i]); + } + + // Change elements if you have a non-const pointer to this object. + void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); } + + // The raw data in little endian format. Use with care. + const uint8_t *Data() const { return data_; } + + uint8_t *Data() { return data_; } + + // Similarly, but typed, much like std::vector::data + const T *data() const { return reinterpret_cast(Data()); } + T *data() { return reinterpret_cast(Data()); } + + // Copy data from a span with endian conversion. + // If this Array and the span overlap, the behavior is undefined. + void CopyFromSpan(flatbuffers::span src) { + const auto p1 = reinterpret_cast(src.data()); + const auto p2 = Data(); + FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && + !(p2 >= p1 && p2 < (p1 + length))); + (void)p1; + (void)p2; + CopyFromSpanImpl(flatbuffers::bool_constant(), src); + } + + protected: + void MutateImpl(flatbuffers::true_type, uoffset_t i, const T &val) { + FLATBUFFERS_ASSERT(i < size()); + WriteScalar(data() + i, val); + } + + void MutateImpl(flatbuffers::false_type, uoffset_t i, const T &val) { + *(GetMutablePointer(i)) = val; + } + + void CopyFromSpanImpl(flatbuffers::true_type, + flatbuffers::span src) { + // Use std::memcpy() instead of std::copy() to avoid performance degradation + // due to aliasing if T is char or unsigned char. + // The size is known at compile time, so memcpy would be inlined. + std::memcpy(data(), src.data(), length * sizeof(T)); + } + + // Copy data from flatbuffers::span with endian conversion. + void CopyFromSpanImpl(flatbuffers::false_type, + flatbuffers::span src) { + for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); } + } + + // This class is only used to access pre-existing data. Don't ever + // try to construct these manually. + // 'constexpr' allows us to use 'size()' at compile time. + // @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on + // a constructor. +#if defined(__cpp_constexpr) + constexpr Array(); +#else + Array(); +#endif + + uint8_t data_[length * sizeof(T)]; + + private: + // This class is a pointer. Copying will therefore create an invalid object. + // Private and unimplemented copy constructor. + Array(const Array &); + Array &operator=(const Array &); +}; + +// Specialization for Array[struct] with access using Offset pointer. +// This specialization used by idl_gen_text.cpp. +template class Array, length> { + static_assert(flatbuffers::is_same::value, "unexpected type T"); + + public: + typedef const void *return_type; + + const uint8_t *Data() const { return data_; } + + // Make idl_gen_text.cpp::PrintContainer happy. + return_type operator[](uoffset_t) const { + FLATBUFFERS_ASSERT(false); + return nullptr; + } + + private: + // This class is only used to access pre-existing data. + Array(); + Array(const Array &); + Array &operator=(const Array &); + + uint8_t data_[1]; +}; + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Array &arr) + FLATBUFFERS_NOEXCEPT { + static_assert( + Array::is_span_observable, + "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); + return span(arr.data(), N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( + const Array &arr) FLATBUFFERS_NOEXCEPT { + static_assert( + Array::is_span_observable, + "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); + return span(arr.data(), N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span +make_bytes_span(Array &arr) FLATBUFFERS_NOEXCEPT { + static_assert(Array::is_span_observable, + "internal error, Array might hold only scalars or structs"); + return span(arr.Data(), sizeof(U) * N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span +make_bytes_span(const Array &arr) FLATBUFFERS_NOEXCEPT { + static_assert(Array::is_span_observable, + "internal error, Array might hold only scalars or structs"); + return span(arr.Data(), sizeof(U) * N); +} + +// Cast a raw T[length] to a raw flatbuffers::Array +// without endian conversion. Use with care. +// TODO: move these Cast-methods to `internal` namespace. +template +Array &CastToArray(T (&arr)[length]) { + return *reinterpret_cast *>(arr); +} + +template +const Array &CastToArray(const T (&arr)[length]) { + return *reinterpret_cast *>(arr); +} + +template +Array &CastToArrayOfEnum(T (&arr)[length]) { + static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); + return *reinterpret_cast *>(arr); +} + +template +const Array &CastToArrayOfEnum(const T (&arr)[length]) { + static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); + return *reinterpret_cast *>(arr); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_ARRAY_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/base.h b/cpp-client/deephaven/client/third_party/flatbuffers/base.h new file mode 100644 index 00000000000..08b6af45370 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/base.h @@ -0,0 +1,474 @@ +#ifndef FLATBUFFERS_BASE_H_ +#define FLATBUFFERS_BASE_H_ + +// clang-format off + +// If activate should be declared and included first. +#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \ + defined(_MSC_VER) && defined(_DEBUG) + // The _CRTDBG_MAP_ALLOC inside will replace + // calloc/free (etc) to its debug version using #define directives. + #define _CRTDBG_MAP_ALLOC + #include + #include + // Replace operator new by trace-enabled version. + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) + #define new DEBUG_NEW +#endif + +#if !defined(FLATBUFFERS_ASSERT) +#include +#define FLATBUFFERS_ASSERT assert +#elif defined(FLATBUFFERS_ASSERT_INCLUDE) +// Include file with forward declaration +#include FLATBUFFERS_ASSERT_INCLUDE +#endif + +#ifndef ARDUINO +#include +#endif + +#include +#include +#include + +#if defined(ARDUINO) && !defined(ARDUINOSTL_M_H) + #include +#else + #include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT) + #include +#endif + +#ifdef __ANDROID__ + #include +#endif + +#if defined(__ICCARM__) +#include +#endif + +// Note the __clang__ check is needed, because clang presents itself +// as an older GNUC compiler (4.2). +// Clang 3.3 and later implement all of the ISO C++ 2011 standard. +// Clang 3.4 and later implement all of the ISO C++ 2014 standard. +// http://clang.llvm.org/cxx_status.html + +// Note the MSVC value '__cplusplus' may be incorrect: +// The '__cplusplus' predefined macro in the MSVC stuck at the value 199711L, +// indicating (erroneously!) that the compiler conformed to the C++98 Standard. +// This value should be correct starting from MSVC2017-15.7-Preview-3. +// The '__cplusplus' will be valid only if MSVC2017-15.7-P3 and the `/Zc:__cplusplus` switch is set. +// Workaround (for details see MSDN): +// Use the _MSC_VER and _MSVC_LANG definition instead of the __cplusplus for compatibility. +// The _MSVC_LANG macro reports the Standard version regardless of the '/Zc:__cplusplus' switch. + +#if defined(__GNUC__) && !defined(__clang__) + #define FLATBUFFERS_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#else + #define FLATBUFFERS_GCC 0 +#endif + +#if defined(__clang__) + #define FLATBUFFERS_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#else + #define FLATBUFFERS_CLANG 0 +#endif + +/// @cond FLATBUFFERS_INTERNAL +#if __cplusplus <= 199711L && \ + (!defined(_MSC_VER) || _MSC_VER < 1600) && \ + (!defined(__GNUC__) || \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)) + #error A C++11 compatible compiler with support for the auto typing is \ + required for FlatBuffers. + #error __cplusplus _MSC_VER __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ +#endif + +#if !defined(__clang__) && \ + defined(__GNUC__) && \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600) + // Backwards compatibility for g++ 4.4, and 4.5 which don't have the nullptr + // and constexpr keywords. Note the __clang__ check is needed, because clang + // presents itself as an older GNUC compiler. + #ifndef nullptr_t + const class nullptr_t { + public: + template inline operator T*() const { return 0; } + private: + void operator&() const; + } nullptr = {}; + #endif + #ifndef constexpr + #define constexpr const + #endif +#endif + +// The wire format uses a little endian encoding (since that's efficient for +// the common platforms). +#if defined(__s390x__) + #define FLATBUFFERS_LITTLEENDIAN 0 +#endif // __s390x__ +#if !defined(FLATBUFFERS_LITTLEENDIAN) + #if defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__) + #if (defined(__BIG_ENDIAN__) || \ + (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) + #define FLATBUFFERS_LITTLEENDIAN 0 + #else + #define FLATBUFFERS_LITTLEENDIAN 1 + #endif // __BIG_ENDIAN__ + #elif defined(_MSC_VER) + #if defined(_M_PPC) + #define FLATBUFFERS_LITTLEENDIAN 0 + #else + #define FLATBUFFERS_LITTLEENDIAN 1 + #endif + #else + #error Unable to determine endianness, define FLATBUFFERS_LITTLEENDIAN. + #endif +#endif // !defined(FLATBUFFERS_LITTLEENDIAN) + +#define FLATBUFFERS_VERSION_MAJOR 2 +#define FLATBUFFERS_VERSION_MINOR 0 +#define FLATBUFFERS_VERSION_REVISION 6 +#define FLATBUFFERS_STRING_EXPAND(X) #X +#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) +namespace deephaven::third_party::flatbuffers { + // Returns version as string "MAJOR.MINOR.REVISION". + const char* FLATBUFFERS_VERSION(); +} + +#if (!defined(_MSC_VER) || _MSC_VER > 1600) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \ + defined(__clang__) + #define FLATBUFFERS_FINAL_CLASS final + #define FLATBUFFERS_OVERRIDE override + #define FLATBUFFERS_EXPLICIT_CPP11 explicit + #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : ::deephaven::third_party::flatbuffers::voffset_t +#else + #define FLATBUFFERS_FINAL_CLASS + #define FLATBUFFERS_OVERRIDE + #define FLATBUFFERS_EXPLICIT_CPP11 + #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE +#endif + +#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ + (defined(__cpp_constexpr) && __cpp_constexpr >= 200704) + #define FLATBUFFERS_CONSTEXPR constexpr + #define FLATBUFFERS_CONSTEXPR_CPP11 constexpr + #define FLATBUFFERS_CONSTEXPR_DEFINED +#else + #define FLATBUFFERS_CONSTEXPR const + #define FLATBUFFERS_CONSTEXPR_CPP11 +#endif + +#if (defined(__cplusplus) && __cplusplus >= 201402L) || \ + (defined(__cpp_constexpr) && __cpp_constexpr >= 201304) + #define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR_CPP11 +#else + #define FLATBUFFERS_CONSTEXPR_CPP14 +#endif + +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ + (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023026)) || \ + defined(__clang__) + #define FLATBUFFERS_NOEXCEPT noexcept +#else + #define FLATBUFFERS_NOEXCEPT +#endif + +// NOTE: the FLATBUFFERS_DELETE_FUNC macro may change the access mode to +// private, so be sure to put it at the end or reset access mode explicitly. +#if (!defined(_MSC_VER) || _MSC_FULL_VER >= 180020827) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) || \ + defined(__clang__) + #define FLATBUFFERS_DELETE_FUNC(func) func = delete +#else + #define FLATBUFFERS_DELETE_FUNC(func) private: func +#endif + +#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ + defined(__clang__) + #define FLATBUFFERS_DEFAULT_DECLARATION +#endif + +// Check if we can use template aliases +// Not possible if Microsoft Compiler before 2012 +// Possible is the language feature __cpp_alias_templates is defined well +// Or possible if the C++ std is C+11 or newer +#if (defined(_MSC_VER) && _MSC_VER > 1700 /* MSVC2012 */) \ + || (defined(__cpp_alias_templates) && __cpp_alias_templates >= 200704) \ + || (defined(__cplusplus) && __cplusplus >= 201103L) + #define FLATBUFFERS_TEMPLATES_ALIASES +#endif + +#ifndef FLATBUFFERS_HAS_STRING_VIEW + // Only provide flatbuffers::string_view if __has_include can be used + // to detect a header that provides an implementation + #if defined(__has_include) + // Check for std::string_view (in c++17) + #if __has_include() && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17)) + #include + namespace deephaven::third_party::flatbuffers { + typedef std::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for std::experimental::string_view (in c++14, compiler-dependent) + #elif __has_include() && (__cplusplus >= 201411) + #include + namespace deephaven::third_party::flatbuffers { + typedef std::experimental::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for absl::string_view + #elif __has_include("absl/strings/string_view.h") + #include "absl/strings/string_view.h" + namespace deephaven::third_party::flatbuffers { + typedef absl::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + #endif + #endif // __has_include +#endif // !FLATBUFFERS_HAS_STRING_VIEW + +#ifndef FLATBUFFERS_GENERAL_HEAP_ALLOC_OK + // Allow heap allocations to be used + #define FLATBUFFERS_GENERAL_HEAP_ALLOC_OK 1 +#endif // !FLATBUFFERS_GENERAL_HEAP_ALLOC_OK + +#ifndef FLATBUFFERS_HAS_NEW_STRTOD + // Modern (C++11) strtod and strtof functions are available for use. + // 1) nan/inf strings as argument of strtod; + // 2) hex-float as argument of strtod/strtof. + #if (defined(_MSC_VER) && _MSC_VER >= 1900) || \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ + (defined(__clang__)) + #define FLATBUFFERS_HAS_NEW_STRTOD 1 + #endif +#endif // !FLATBUFFERS_HAS_NEW_STRTOD + +#ifndef FLATBUFFERS_LOCALE_INDEPENDENT + // Enable locale independent functions {strtof_l, strtod_l,strtoll_l, strtoull_l}. + #if ((defined(_MSC_VER) && _MSC_VER >= 1800) || \ + (defined(_XOPEN_VERSION) && (_XOPEN_VERSION>=700)) && (!defined(__ANDROID_API__) || (defined(__ANDROID_API__) && (__ANDROID_API__>=21)))) + #define FLATBUFFERS_LOCALE_INDEPENDENT 1 + #else + #define FLATBUFFERS_LOCALE_INDEPENDENT 0 + #endif +#endif // !FLATBUFFERS_LOCALE_INDEPENDENT + +// Suppress Undefined Behavior Sanitizer (recoverable only). Usage: +// - __supress_ubsan__("undefined") +// - __supress_ubsan__("signed-integer-overflow") +#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7)) + #define __supress_ubsan__(type) __attribute__((no_sanitize(type))) +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409) + #define __supress_ubsan__(type) __attribute__((no_sanitize_undefined)) +#else + #define __supress_ubsan__(type) +#endif + +// This is constexpr function used for checking compile-time constants. +// Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`. +template FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) { + return !!t; +} + +// Enable C++ attribute [[]] if std:c++17 or higher. +#if ((__cplusplus >= 201703L) \ + || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) + // All attributes unknown to an implementation are ignored without causing an error. + #define FLATBUFFERS_ATTRIBUTE(attr) attr + + #define FLATBUFFERS_FALLTHROUGH() [[fallthrough]] +#else + #define FLATBUFFERS_ATTRIBUTE(attr) + + #if FLATBUFFERS_CLANG >= 30800 + #define FLATBUFFERS_FALLTHROUGH() [[clang::fallthrough]] + #elif FLATBUFFERS_GCC >= 70300 + #define FLATBUFFERS_FALLTHROUGH() [[gnu::fallthrough]] + #else + #define FLATBUFFERS_FALLTHROUGH() + #endif +#endif + +/// @endcond + +/// @file +namespace deephaven::third_party::flatbuffers { + +/// @cond FLATBUFFERS_INTERNAL +// Our default offset / size type, 32bit on purpose on 64bit systems. +// Also, using a consistent offset type maintains compatibility of serialized +// offset values between 32bit and 64bit systems. +typedef uint32_t uoffset_t; + +// Signed offsets for references that can go in both directions. +typedef int32_t soffset_t; + +// Offset/index used in v-tables, can be changed to uint8_t in +// format forks to save a bit of space if desired. +typedef uint16_t voffset_t; + +typedef uintmax_t largest_scalar_t; + +// In 32bits, this evaluates to 2GB - 1 +#define FLATBUFFERS_MAX_BUFFER_SIZE ((1ULL << (sizeof(::deephaven::third_party::flatbuffers::soffset_t) * 8 - 1)) - 1) + +// We support aligning the contents of buffers up to this size. +#define FLATBUFFERS_MAX_ALIGNMENT 16 + +/// @brief The length of a FlatBuffer file header. +static const size_t kFileIdentifierLength = 4; + +inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) { + return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) && + (align & (align - 1)) == 0; // must be power of 2 +} + +#if defined(_MSC_VER) + #pragma warning(disable: 4351) // C4351: new behavior: elements of array ... will be default initialized + #pragma warning(push) + #pragma warning(disable: 4127) // C4127: conditional expression is constant +#endif + +template T EndianSwap(T t) { + #if defined(_MSC_VER) + #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort + #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong + #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 + #elif defined(__ICCARM__) + #define FLATBUFFERS_BYTESWAP16 __REV16 + #define FLATBUFFERS_BYTESWAP32 __REV + #define FLATBUFFERS_BYTESWAP64(x) \ + ((__REV(static_cast(x >> 32U))) | (static_cast(__REV(static_cast(x)))) << 32U) + #else + #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__) + // __builtin_bswap16 was missing prior to GCC 4.8. + #define FLATBUFFERS_BYTESWAP16(x) \ + static_cast(__builtin_bswap32(static_cast(x) << 16)) + #else + #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 + #endif + #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 + #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 + #endif + if (sizeof(T) == 1) { // Compile-time if-then's. + return t; + } else if (sizeof(T) == 2) { + union { T t; uint16_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP16(u.i); + return u.t; + } else if (sizeof(T) == 4) { + union { T t; uint32_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP32(u.i); + return u.t; + } else if (sizeof(T) == 8) { + union { T t; uint64_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP64(u.i); + return u.t; + } else { + FLATBUFFERS_ASSERT(0); + return t; + } +} + +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + + +template T EndianScalar(T t) { + #if FLATBUFFERS_LITTLEENDIAN + return t; + #else + return EndianSwap(t); + #endif +} + +template +// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. +__supress_ubsan__("alignment") +T ReadScalar(const void *p) { + return EndianScalar(*reinterpret_cast(p)); +} + +// See https://github.com/google/flatbuffers/issues/5950 + +#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + +template +// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. +__supress_ubsan__("alignment") +void WriteScalar(void *p, T t) { + *reinterpret_cast(p) = EndianScalar(t); +} + +template struct Offset; +template __supress_ubsan__("alignment") void WriteScalar(void *p, Offset t) { + *reinterpret_cast(p) = EndianScalar(t.o); +} + +#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) + #pragma GCC diagnostic pop +#endif + +// Computes how many bytes you'd have to pad to be able to write an +// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in +// memory). +__supress_ubsan__("unsigned-integer-overflow") +inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) { + return ((~buf_size) + 1) & (scalar_size - 1); +} + +// Generic 'operator==' with conditional specialisations. +// T e - new value of a scalar field. +// T def - default of scalar (is known at compile-time). +template inline bool IsTheSameAs(T e, T def) { return e == def; } + +#if defined(FLATBUFFERS_NAN_DEFAULTS) && \ + defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) +// Like `operator==(e, def)` with weak NaN if T=(float|double). +template inline bool IsFloatTheSameAs(T e, T def) { + return (e == def) || ((def != def) && (e != e)); +} +template<> inline bool IsTheSameAs(float e, float def) { + return IsFloatTheSameAs(e, def); +} +template<> inline bool IsTheSameAs(double e, double def) { + return IsFloatTheSameAs(e, def); +} +#endif + +// Check 'v' is out of closed range [low; high]. +// Workaround for GCC warning [-Werror=type-limits]: +// comparison is always true due to limited range of data type. +template +inline bool IsOutRange(const T &v, const T &low, const T &high) { + return (v < low) || (high < v); +} + +// Check 'v' is in closed range [low; high]. +template +inline bool IsInRange(const T &v, const T &low, const T &high) { + return !IsOutRange(v, low, high); +} + +} // namespace flatbuffers +#endif // FLATBUFFERS_BASE_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h new file mode 100644 index 00000000000..a0c2c76d818 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h @@ -0,0 +1,142 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_BUFFER_H_ +#define FLATBUFFERS_BUFFER_H_ + +#include "flatbuffers/base.h" + +namespace deephaven::third_party::flatbuffers { + +// Wrapper for uoffset_t to allow safe template specialization. +// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). +template struct Offset { + uoffset_t o; + Offset() : o(0) {} + Offset(uoffset_t _o) : o(_o) {} + Offset Union() const { return Offset(o); } + bool IsNull() const { return !o; } +}; + +inline void EndianCheck() { + int endiantest = 1; + // If this fails, see FLATBUFFERS_LITTLEENDIAN above. + FLATBUFFERS_ASSERT(*reinterpret_cast(&endiantest) == + FLATBUFFERS_LITTLEENDIAN); + (void)endiantest; +} + +template FLATBUFFERS_CONSTEXPR size_t AlignOf() { + // clang-format off + #ifdef _MSC_VER + return __alignof(T); + #else + #ifndef alignof + return __alignof__(T); + #else + return alignof(T); + #endif + #endif + // clang-format on +} + +// Lexicographically compare two strings (possibly containing nulls), and +// return true if the first is less than the second. +static inline bool StringLessThan(const char *a_data, uoffset_t a_size, + const char *b_data, uoffset_t b_size) { + const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); + return cmp == 0 ? a_size < b_size : cmp < 0; +} + +// When we read serialized data from memory, in the case of most scalars, +// we want to just read T, but in the case of Offset, we want to actually +// perform the indirection and return a pointer. +// The template specialization below does just that. +// It is wrapped in a struct since function templates can't overload on the +// return type like this. +// The typedef is for the convenience of callers of this function +// (avoiding the need for a trailing return decltype) +template struct IndirectHelper { + typedef T return_type; + typedef T mutable_return_type; + static const size_t element_stride = sizeof(T); + static return_type Read(const uint8_t *p, uoffset_t i) { + return EndianScalar((reinterpret_cast(p))[i]); + } +}; +template struct IndirectHelper> { + typedef const T *return_type; + typedef T *mutable_return_type; + static const size_t element_stride = sizeof(uoffset_t); + static return_type Read(const uint8_t *p, uoffset_t i) { + p += i * sizeof(uoffset_t); + return reinterpret_cast(p + ReadScalar(p)); + } +}; +template struct IndirectHelper { + typedef const T *return_type; + typedef T *mutable_return_type; + static const size_t element_stride = sizeof(T); + static return_type Read(const uint8_t *p, uoffset_t i) { + return reinterpret_cast(p + i * sizeof(T)); + } +}; + +/// @brief Get a pointer to the the file_identifier section of the buffer. +/// @return Returns a const char pointer to the start of the file_identifier +/// characters in the buffer. The returned char * has length +/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. +/// This function is UNDEFINED for FlatBuffers whose schema does not include +/// a file_identifier (likely points at padding or the start of a the root +/// vtable). +inline const char *GetBufferIdentifier(const void *buf, + bool size_prefixed = false) { + return reinterpret_cast(buf) + + ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t)); +} + +// Helper to see if the identifier in a buffer has the expected value. +inline bool BufferHasIdentifier(const void *buf, const char *identifier, + bool size_prefixed = false) { + return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier, + flatbuffers::kFileIdentifierLength) == 0; +} + +/// @cond FLATBUFFERS_INTERNAL +// Helpers to get a typed pointer to the root object contained in the buffer. +template T *GetMutableRoot(void *buf) { + EndianCheck(); + return reinterpret_cast( + reinterpret_cast(buf) + + EndianScalar(*reinterpret_cast(buf))); +} + +template T *GetMutableSizePrefixedRoot(void *buf) { + return GetMutableRoot(reinterpret_cast(buf) + + sizeof(uoffset_t)); +} + +template const T *GetRoot(const void *buf) { + return GetMutableRoot(const_cast(buf)); +} + +template const T *GetSizePrefixedRoot(const void *buf) { + return GetRoot(reinterpret_cast(buf) + sizeof(uoffset_t)); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_BUFFER_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h b/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h new file mode 100644 index 00000000000..8f1b7b9bd49 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_BUFFER_REF_H_ +#define FLATBUFFERS_BUFFER_REF_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/verifier.h" + +namespace deephaven::third_party::flatbuffers { + +// Convenient way to bundle a buffer and its length, to pass it around +// typed by its root. +// A BufferRef does not own its buffer. +struct BufferRefBase {}; // for std::is_base_of + +template struct BufferRef : BufferRefBase { + BufferRef() : buf(nullptr), len(0), must_free(false) {} + BufferRef(uint8_t *_buf, uoffset_t _len) + : buf(_buf), len(_len), must_free(false) {} + + ~BufferRef() { + if (must_free) free(buf); + } + + const T *GetRoot() const { return flatbuffers::GetRoot(buf); } + + bool Verify() { + Verifier verifier(buf, len); + return verifier.VerifyBuffer(nullptr); + } + + uint8_t *buf; + uoffset_t len; + bool must_free; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_BUFFER_REF_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h new file mode 100644 index 00000000000..a567367677f --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_ +#define FLATBUFFERS_DEFAULT_ALLOCATOR_H_ + +#include "flatbuffers/allocator.h" +#include "flatbuffers/base.h" + +namespace deephaven::third_party::flatbuffers { + +// DefaultAllocator uses new/delete to allocate memory regions +class DefaultAllocator : public Allocator { + public: + uint8_t *allocate(size_t size) FLATBUFFERS_OVERRIDE { + return new uint8_t[size]; + } + + void deallocate(uint8_t *p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; } + + static void dealloc(void *p, size_t) { delete[] static_cast(p); } +}; + +// These functions allow for a null allocator to mean use the default allocator, +// as used by DetachedBuffer and vector_downward below. +// This is to avoid having a statically or dynamically allocated default +// allocator, or having to move it between the classes that may own it. +inline uint8_t *Allocate(Allocator *allocator, size_t size) { + return allocator ? allocator->allocate(size) + : DefaultAllocator().allocate(size); +} + +inline void Deallocate(Allocator *allocator, uint8_t *p, size_t size) { + if (allocator) + allocator->deallocate(p, size); + else + DefaultAllocator().deallocate(p, size); +} + +inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p, + size_t old_size, size_t new_size, + size_t in_use_back, size_t in_use_front) { + return allocator ? allocator->reallocate_downward(old_p, old_size, new_size, + in_use_back, in_use_front) + : DefaultAllocator().reallocate_downward( + old_p, old_size, new_size, in_use_back, in_use_front); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h new file mode 100644 index 00000000000..6d878c53e93 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h @@ -0,0 +1,114 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_DETACHED_BUFFER_H_ +#define FLATBUFFERS_DETACHED_BUFFER_H_ + +#include "flatbuffers/allocator.h" +#include "flatbuffers/base.h" +#include "flatbuffers/default_allocator.h" + +namespace deephaven::third_party::flatbuffers { + +// DetachedBuffer is a finished flatbuffer memory region, detached from its +// builder. The original memory region and allocator are also stored so that +// the DetachedBuffer can manage the memory lifetime. +class DetachedBuffer { + public: + DetachedBuffer() + : allocator_(nullptr), + own_allocator_(false), + buf_(nullptr), + reserved_(0), + cur_(nullptr), + size_(0) {} + + DetachedBuffer(Allocator *allocator, bool own_allocator, uint8_t *buf, + size_t reserved, uint8_t *cur, size_t sz) + : allocator_(allocator), + own_allocator_(own_allocator), + buf_(buf), + reserved_(reserved), + cur_(cur), + size_(sz) {} + + DetachedBuffer(DetachedBuffer &&other) + : allocator_(other.allocator_), + own_allocator_(other.own_allocator_), + buf_(other.buf_), + reserved_(other.reserved_), + cur_(other.cur_), + size_(other.size_) { + other.reset(); + } + + DetachedBuffer &operator=(DetachedBuffer &&other) { + if (this == &other) return *this; + + destroy(); + + allocator_ = other.allocator_; + own_allocator_ = other.own_allocator_; + buf_ = other.buf_; + reserved_ = other.reserved_; + cur_ = other.cur_; + size_ = other.size_; + + other.reset(); + + return *this; + } + + ~DetachedBuffer() { destroy(); } + + const uint8_t *data() const { return cur_; } + + uint8_t *data() { return cur_; } + + size_t size() const { return size_; } + + // These may change access mode, leave these at end of public section + FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other)); + FLATBUFFERS_DELETE_FUNC( + DetachedBuffer &operator=(const DetachedBuffer &other)); + + protected: + Allocator *allocator_; + bool own_allocator_; + uint8_t *buf_; + size_t reserved_; + uint8_t *cur_; + size_t size_; + + inline void destroy() { + if (buf_) Deallocate(allocator_, buf_, reserved_); + if (own_allocator_ && allocator_) { delete allocator_; } + reset(); + } + + inline void reset() { + allocator_ = nullptr; + own_allocator_ = false; + buf_ = nullptr; + reserved_ = 0; + cur_ = nullptr; + size_ = 0; + } +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_DETACHED_BUFFER_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h new file mode 100644 index 00000000000..430bc788ff7 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h @@ -0,0 +1,1197 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_ +#define FLATBUFFERS_FLATBUFFER_BUILDER_H_ + +#include + +#include "flatbuffers/allocator.h" +#include "flatbuffers/array.h" +#include "flatbuffers/base.h" +#include "flatbuffers/buffer_ref.h" +#include "flatbuffers/default_allocator.h" +#include "flatbuffers/detached_buffer.h" +#include "flatbuffers/stl_emulation.h" +#include "flatbuffers/string.h" +#include "flatbuffers/struct.h" +#include "flatbuffers/table.h" +#include "flatbuffers/vector.h" +#include "flatbuffers/vector_downward.h" +#include "flatbuffers/verifier.h" + +namespace deephaven::third_party::flatbuffers { + +// Converts a Field ID to a virtual table offset. +inline voffset_t FieldIndexToOffset(voffset_t field_id) { + // Should correspond to what EndTable() below builds up. + const int fixed_fields = 2; // Vtable size and Object Size. + return static_cast((field_id + fixed_fields) * sizeof(voffset_t)); +} + +template> +const T *data(const std::vector &v) { + // Eventually the returned pointer gets passed down to memcpy, so + // we need it to be non-null to avoid undefined behavior. + static uint8_t t; + return v.empty() ? reinterpret_cast(&t) : &v.front(); +} +template> +T *data(std::vector &v) { + // Eventually the returned pointer gets passed down to memcpy, so + // we need it to be non-null to avoid undefined behavior. + static uint8_t t; + return v.empty() ? reinterpret_cast(&t) : &v.front(); +} + +/// @addtogroup flatbuffers_cpp_api +/// @{ +/// @class FlatBufferBuilder +/// @brief Helper class to hold data needed in creation of a FlatBuffer. +/// To serialize data, you typically call one of the `Create*()` functions in +/// the generated code, which in turn call a sequence of `StartTable`/ +/// `PushElement`/`AddElement`/`EndTable`, or the builtin `CreateString`/ +/// `CreateVector` functions. Do this is depth-first order to build up a tree to +/// the root. `Finish()` wraps up the buffer ready for transport. +class FlatBufferBuilder { + public: + /// @brief Default constructor for FlatBufferBuilder. + /// @param[in] initial_size The initial size of the buffer, in bytes. Defaults + /// to `1024`. + /// @param[in] allocator An `Allocator` to use. If null will use + /// `DefaultAllocator`. + /// @param[in] own_allocator Whether the builder/vector should own the + /// allocator. Defaults to / `false`. + /// @param[in] buffer_minalign Force the buffer to be aligned to the given + /// minimum alignment upon reallocation. Only needed if you intend to store + /// types with custom alignment AND you wish to read the buffer in-place + /// directly after creation. + explicit FlatBufferBuilder( + size_t initial_size = 1024, Allocator *allocator = nullptr, + bool own_allocator = false, + size_t buffer_minalign = AlignOf()) + : buf_(initial_size, allocator, own_allocator, buffer_minalign), + num_field_loc(0), + max_voffset_(0), + nested(false), + finished(false), + minalign_(1), + force_defaults_(false), + dedup_vtables_(true), + string_pool(nullptr) { + EndianCheck(); + } + + /// @brief Move constructor for FlatBufferBuilder. + FlatBufferBuilder(FlatBufferBuilder &&other) + : buf_(1024, nullptr, false, AlignOf()), + num_field_loc(0), + max_voffset_(0), + nested(false), + finished(false), + minalign_(1), + force_defaults_(false), + dedup_vtables_(true), + string_pool(nullptr) { + EndianCheck(); + // Default construct and swap idiom. + // Lack of delegating constructors in vs2010 makes it more verbose than + // needed. + Swap(other); + } + + /// @brief Move assignment operator for FlatBufferBuilder. + FlatBufferBuilder &operator=(FlatBufferBuilder &&other) { + // Move construct a temporary and swap idiom + FlatBufferBuilder temp(std::move(other)); + Swap(temp); + return *this; + } + + void Swap(FlatBufferBuilder &other) { + using std::swap; + buf_.swap(other.buf_); + swap(num_field_loc, other.num_field_loc); + swap(max_voffset_, other.max_voffset_); + swap(nested, other.nested); + swap(finished, other.finished); + swap(minalign_, other.minalign_); + swap(force_defaults_, other.force_defaults_); + swap(dedup_vtables_, other.dedup_vtables_); + swap(string_pool, other.string_pool); + } + + ~FlatBufferBuilder() { + if (string_pool) delete string_pool; + } + + void Reset() { + Clear(); // clear builder state + buf_.reset(); // deallocate buffer + } + + /// @brief Reset all the state in this FlatBufferBuilder so it can be reused + /// to construct another buffer. + void Clear() { + ClearOffsets(); + buf_.clear(); + nested = false; + finished = false; + minalign_ = 1; + if (string_pool) string_pool->clear(); + } + + /// @brief The current size of the serialized buffer, counting from the end. + /// @return Returns an `uoffset_t` with the current size of the buffer. + uoffset_t GetSize() const { return buf_.size(); } + + /// @brief Get the serialized buffer (after you call `Finish()`). + /// @return Returns an `uint8_t` pointer to the FlatBuffer data inside the + /// buffer. + uint8_t *GetBufferPointer() const { + Finished(); + return buf_.data(); + } + + /// @brief Get the serialized buffer (after you call `Finish()`) as a span. + /// @return Returns a constructed flatbuffers::span that is a view over the + /// FlatBuffer data inside the buffer. + flatbuffers::span GetBufferSpan() const { + Finished(); + return flatbuffers::span(buf_.data(), buf_.size()); + } + + /// @brief Get a pointer to an unfinished buffer. + /// @return Returns a `uint8_t` pointer to the unfinished buffer. + uint8_t *GetCurrentBufferPointer() const { return buf_.data(); } + + /// @brief Get the released pointer to the serialized buffer. + /// @warning Do NOT attempt to use this FlatBufferBuilder afterwards! + /// @return A `FlatBuffer` that owns the buffer and its allocator and + /// behaves similar to a `unique_ptr` with a deleter. + FLATBUFFERS_ATTRIBUTE([[deprecated("use Release() instead")]]) + DetachedBuffer ReleaseBufferPointer() { + Finished(); + return buf_.release(); + } + + /// @brief Get the released DetachedBuffer. + /// @return A `DetachedBuffer` that owns the buffer and its allocator. + DetachedBuffer Release() { + Finished(); + return buf_.release(); + } + + /// @brief Get the released pointer to the serialized buffer. + /// @param size The size of the memory block containing + /// the serialized `FlatBuffer`. + /// @param offset The offset from the released pointer where the finished + /// `FlatBuffer` starts. + /// @return A raw pointer to the start of the memory block containing + /// the serialized `FlatBuffer`. + /// @remark If the allocator is owned, it gets deleted when the destructor is + /// called.. + uint8_t *ReleaseRaw(size_t &size, size_t &offset) { + Finished(); + return buf_.release_raw(size, offset); + } + + /// @brief get the minimum alignment this buffer needs to be accessed + /// properly. This is only known once all elements have been written (after + /// you call Finish()). You can use this information if you need to embed + /// a FlatBuffer in some other buffer, such that you can later read it + /// without first having to copy it into its own buffer. + size_t GetBufferMinAlignment() const { + Finished(); + return minalign_; + } + + /// @cond FLATBUFFERS_INTERNAL + void Finished() const { + // If you get this assert, you're attempting to get access a buffer + // which hasn't been finished yet. Be sure to call + // FlatBufferBuilder::Finish with your root table. + // If you really need to access an unfinished buffer, call + // GetCurrentBufferPointer instead. + FLATBUFFERS_ASSERT(finished); + } + /// @endcond + + /// @brief In order to save space, fields that are set to their default value + /// don't get serialized into the buffer. + /// @param[in] fd When set to `true`, always serializes default values that + /// are set. Optional fields which are not set explicitly, will still not be + /// serialized. + void ForceDefaults(bool fd) { force_defaults_ = fd; } + + /// @brief By default vtables are deduped in order to save space. + /// @param[in] dedup When set to `true`, dedup vtables. + void DedupVtables(bool dedup) { dedup_vtables_ = dedup; } + + /// @cond FLATBUFFERS_INTERNAL + void Pad(size_t num_bytes) { buf_.fill(num_bytes); } + + void TrackMinAlign(size_t elem_size) { + if (elem_size > minalign_) minalign_ = elem_size; + } + + void Align(size_t elem_size) { + TrackMinAlign(elem_size); + buf_.fill(PaddingBytes(buf_.size(), elem_size)); + } + + void PushFlatBuffer(const uint8_t *bytes, size_t size) { + PushBytes(bytes, size); + finished = true; + } + + void PushBytes(const uint8_t *bytes, size_t size) { buf_.push(bytes, size); } + + void PopBytes(size_t amount) { buf_.pop(amount); } + + template void AssertScalarT() { + // The code assumes power of 2 sizes and endian-swap-ability. + static_assert(flatbuffers::is_scalar::value, "T must be a scalar type"); + } + + // Write a single aligned scalar to the buffer + template uoffset_t PushElement(T element) { + AssertScalarT(); + Align(sizeof(T)); + buf_.push_small(EndianScalar(element)); + return GetSize(); + } + + template uoffset_t PushElement(Offset off) { + // Special case for offsets: see ReferTo below. + return PushElement(ReferTo(off.o)); + } + + // When writing fields, we track where they are, so we can create correct + // vtables later. + void TrackField(voffset_t field, uoffset_t off) { + FieldLoc fl = { off, field }; + buf_.scratch_push_small(fl); + num_field_loc++; + if (field > max_voffset_) { max_voffset_ = field; } + } + + // Like PushElement, but additionally tracks the field this represents. + template void AddElement(voffset_t field, T e, T def) { + // We don't serialize values equal to the default. + if (IsTheSameAs(e, def) && !force_defaults_) return; + TrackField(field, PushElement(e)); + } + + template void AddElement(voffset_t field, T e) { + TrackField(field, PushElement(e)); + } + + template void AddOffset(voffset_t field, Offset off) { + if (off.IsNull()) return; // Don't store. + AddElement(field, ReferTo(off.o), static_cast(0)); + } + + template void AddStruct(voffset_t field, const T *structptr) { + if (!structptr) return; // Default, don't store. + Align(AlignOf()); + buf_.push_small(*structptr); + TrackField(field, GetSize()); + } + + void AddStructOffset(voffset_t field, uoffset_t off) { + TrackField(field, off); + } + + // Offsets initially are relative to the end of the buffer (downwards). + // This function converts them to be relative to the current location + // in the buffer (when stored here), pointing upwards. + uoffset_t ReferTo(uoffset_t off) { + // Align to ensure GetSize() below is correct. + Align(sizeof(uoffset_t)); + // Offset must refer to something already in buffer. + const uoffset_t size = GetSize(); + FLATBUFFERS_ASSERT(off && off <= size); + return size - off + static_cast(sizeof(uoffset_t)); + } + + void NotNested() { + // If you hit this, you're trying to construct a Table/Vector/String + // during the construction of its parent table (between the MyTableBuilder + // and table.Finish(). + // Move the creation of these sub-objects to above the MyTableBuilder to + // not get this assert. + // Ignoring this assert may appear to work in simple cases, but the reason + // it is here is that storing objects in-line may cause vtable offsets + // to not fit anymore. It also leads to vtable duplication. + FLATBUFFERS_ASSERT(!nested); + // If you hit this, fields were added outside the scope of a table. + FLATBUFFERS_ASSERT(!num_field_loc); + } + + // From generated code (or from the parser), we call StartTable/EndTable + // with a sequence of AddElement calls in between. + uoffset_t StartTable() { + NotNested(); + nested = true; + return GetSize(); + } + + // This finishes one serialized object by generating the vtable if it's a + // table, comparing it against existing vtables, and writing the + // resulting vtable offset. + uoffset_t EndTable(uoffset_t start) { + // If you get this assert, a corresponding StartTable wasn't called. + FLATBUFFERS_ASSERT(nested); + // Write the vtable offset, which is the start of any Table. + // We fill it's value later. + auto vtableoffsetloc = PushElement(0); + // Write a vtable, which consists entirely of voffset_t elements. + // It starts with the number of offsets, followed by a type id, followed + // by the offsets themselves. In reverse: + // Include space for the last offset and ensure empty tables have a + // minimum size. + max_voffset_ = + (std::max)(static_cast(max_voffset_ + sizeof(voffset_t)), + FieldIndexToOffset(0)); + buf_.fill_big(max_voffset_); + auto table_object_size = vtableoffsetloc - start; + // Vtable use 16bit offsets. + FLATBUFFERS_ASSERT(table_object_size < 0x10000); + WriteScalar(buf_.data() + sizeof(voffset_t), + static_cast(table_object_size)); + WriteScalar(buf_.data(), max_voffset_); + // Write the offsets into the table + for (auto it = buf_.scratch_end() - num_field_loc * sizeof(FieldLoc); + it < buf_.scratch_end(); it += sizeof(FieldLoc)) { + auto field_location = reinterpret_cast(it); + auto pos = static_cast(vtableoffsetloc - field_location->off); + // If this asserts, it means you've set a field twice. + FLATBUFFERS_ASSERT( + !ReadScalar(buf_.data() + field_location->id)); + WriteScalar(buf_.data() + field_location->id, pos); + } + ClearOffsets(); + auto vt1 = reinterpret_cast(buf_.data()); + auto vt1_size = ReadScalar(vt1); + auto vt_use = GetSize(); + // See if we already have generated a vtable with this exact same + // layout before. If so, make it point to the old one, remove this one. + if (dedup_vtables_) { + for (auto it = buf_.scratch_data(); it < buf_.scratch_end(); + it += sizeof(uoffset_t)) { + auto vt_offset_ptr = reinterpret_cast(it); + auto vt2 = reinterpret_cast(buf_.data_at(*vt_offset_ptr)); + auto vt2_size = ReadScalar(vt2); + if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; + vt_use = *vt_offset_ptr; + buf_.pop(GetSize() - vtableoffsetloc); + break; + } + } + // If this is a new vtable, remember it. + if (vt_use == GetSize()) { buf_.scratch_push_small(vt_use); } + // Fill the vtable offset we created above. + // The offset points from the beginning of the object to where the + // vtable is stored. + // Offsets default direction is downward in memory for future format + // flexibility (storing all vtables at the start of the file). + WriteScalar(buf_.data_at(vtableoffsetloc), + static_cast(vt_use) - + static_cast(vtableoffsetloc)); + + nested = false; + return vtableoffsetloc; + } + + FLATBUFFERS_ATTRIBUTE([[deprecated("call the version above instead")]]) + uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) { + return EndTable(start); + } + + // This checks a required field has been set in a given table that has + // just been constructed. + template void Required(Offset table, voffset_t field); + + uoffset_t StartStruct(size_t alignment) { + Align(alignment); + return GetSize(); + } + + uoffset_t EndStruct() { return GetSize(); } + + void ClearOffsets() { + buf_.scratch_pop(num_field_loc * sizeof(FieldLoc)); + num_field_loc = 0; + max_voffset_ = 0; + } + + // Aligns such that when "len" bytes are written, an object can be written + // after it with "alignment" without padding. + void PreAlign(size_t len, size_t alignment) { + TrackMinAlign(alignment); + buf_.fill(PaddingBytes(GetSize() + len, alignment)); + } + template void PreAlign(size_t len) { + AssertScalarT(); + PreAlign(len, sizeof(T)); + } + /// @endcond + + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const char pointer to the data to be stored as a string. + /// @param[in] len The number of bytes that should be stored from `str`. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateString(const char *str, size_t len) { + NotNested(); + PreAlign(len + 1); // Always 0-terminated. + buf_.fill(1); + PushBytes(reinterpret_cast(str), len); + PushElement(static_cast(len)); + return Offset(GetSize()); + } + + /// @brief Store a string in the buffer, which is null-terminated. + /// @param[in] str A const char pointer to a C-string to add to the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateString(const char *str) { + return CreateString(str, strlen(str)); + } + + /// @brief Store a string in the buffer, which is null-terminated. + /// @param[in] str A char pointer to a C-string to add to the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateString(char *str) { + return CreateString(str, strlen(str)); + } + + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const reference to a std::string to store in the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateString(const std::string &str) { + return CreateString(str.c_str(), str.length()); + } + + // clang-format off + #ifdef FLATBUFFERS_HAS_STRING_VIEW + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const string_view to copy in to the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateString(flatbuffers::string_view str) { + return CreateString(str.data(), str.size()); + } + #endif // FLATBUFFERS_HAS_STRING_VIEW + // clang-format on + + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const pointer to a `String` struct to add to the buffer. + /// @return Returns the offset in the buffer where the string starts + Offset CreateString(const String *str) { + return str ? CreateString(str->c_str(), str->size()) : 0; + } + + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const reference to a std::string like type with support + /// of T::c_str() and T::length() to store in the buffer. + /// @return Returns the offset in the buffer where the string starts. + template Offset CreateString(const T &str) { + return CreateString(str.c_str(), str.length()); + } + + /// @brief Store a string in the buffer, which can contain any binary data. + /// If a string with this exact contents has already been serialized before, + /// instead simply returns the offset of the existing string. This uses a map + /// stored on the heap, but only stores the numerical offsets. + /// @param[in] str A const char pointer to the data to be stored as a string. + /// @param[in] len The number of bytes that should be stored from `str`. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateSharedString(const char *str, size_t len) { + FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); + if (!string_pool) + string_pool = new StringOffsetMap(StringOffsetCompare(buf_)); + auto size_before_string = buf_.size(); + // Must first serialize the string, since the set is all offsets into + // buffer. + auto off = CreateString(str, len); + auto it = string_pool->find(off); + // If it exists we reuse existing serialized data! + if (it != string_pool->end()) { + // We can remove the string we serialized. + buf_.pop(buf_.size() - size_before_string); + return *it; + } + // Record this string for future use. + string_pool->insert(off); + return off; + } + +#ifdef FLATBUFFERS_HAS_STRING_VIEW + /// @brief Store a string in the buffer, which can contain any binary data. + /// If a string with this exact contents has already been serialized before, + /// instead simply returns the offset of the existing string. This uses a map + /// stored on the heap, but only stores the numerical offsets. + /// @param[in] str A const std::string_view to store in the buffer. + /// @return Returns the offset in the buffer where the string starts + Offset CreateSharedString(const flatbuffers::string_view str) { + return CreateSharedString(str.data(), str.size()); + } +#else + /// @brief Store a string in the buffer, which null-terminated. + /// If a string with this exact contents has already been serialized before, + /// instead simply returns the offset of the existing string. This uses a map + /// stored on the heap, but only stores the numerical offsets. + /// @param[in] str A const char pointer to a C-string to add to the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateSharedString(const char *str) { + return CreateSharedString(str, strlen(str)); + } + + /// @brief Store a string in the buffer, which can contain any binary data. + /// If a string with this exact contents has already been serialized before, + /// instead simply returns the offset of the existing string. This uses a map + /// stored on the heap, but only stores the numerical offsets. + /// @param[in] str A const reference to a std::string to store in the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset CreateSharedString(const std::string &str) { + return CreateSharedString(str.c_str(), str.length()); + } +#endif + + /// @brief Store a string in the buffer, which can contain any binary data. + /// If a string with this exact contents has already been serialized before, + /// instead simply returns the offset of the existing string. This uses a map + /// stored on the heap, but only stores the numerical offsets. + /// @param[in] str A const pointer to a `String` struct to add to the buffer. + /// @return Returns the offset in the buffer where the string starts + Offset CreateSharedString(const String *str) { + return CreateSharedString(str->c_str(), str->size()); + } + + /// @cond FLATBUFFERS_INTERNAL + uoffset_t EndVector(size_t len) { + FLATBUFFERS_ASSERT(nested); // Hit if no corresponding StartVector. + nested = false; + return PushElement(static_cast(len)); + } + + void StartVector(size_t len, size_t elemsize) { + NotNested(); + nested = true; + PreAlign(len * elemsize); + PreAlign(len * elemsize, elemsize); // Just in case elemsize > uoffset_t. + } + + // Call this right before StartVector/CreateVector if you want to force the + // alignment to be something different than what the element size would + // normally dictate. + // This is useful when storing a nested_flatbuffer in a vector of bytes, + // or when storing SIMD floats, etc. + void ForceVectorAlignment(size_t len, size_t elemsize, size_t alignment) { + FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); + PreAlign(len * elemsize, alignment); + } + + // Similar to ForceVectorAlignment but for String fields. + void ForceStringAlignment(size_t len, size_t alignment) { + FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); + PreAlign((len + 1) * sizeof(char), alignment); + } + + /// @endcond + + /// @brief Serialize an array into a FlatBuffer `vector`. + /// @tparam T The data type of the array elements. + /// @param[in] v A pointer to the array of type `T` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template Offset> CreateVector(const T *v, size_t len) { + // If this assert hits, you're specifying a template argument that is + // causing the wrong overload to be selected, remove it. + AssertScalarT(); + StartVector(len, sizeof(T)); + if (len == 0) { return Offset>(EndVector(len)); } + // clang-format off + #if FLATBUFFERS_LITTLEENDIAN + PushBytes(reinterpret_cast(v), len * sizeof(T)); + #else + if (sizeof(T) == 1) { + PushBytes(reinterpret_cast(v), len); + } else { + for (auto i = len; i > 0; ) { + PushElement(v[--i]); + } + } + #endif + // clang-format on + return Offset>(EndVector(len)); + } + + /// @brief Serialize an array like object into a FlatBuffer `vector`. + /// @tparam T The data type of the array elements. + /// @tparam C The type of the array. + /// @param[in] array A reference to an array like object of type `T` to + /// serialize into the buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template Offset> CreateVector(const C &array) { + return CreateVector(array.data(), array.size()); + } + + template + Offset>> CreateVector(const Offset *v, size_t len) { + StartVector(len, sizeof(Offset)); + for (auto i = len; i > 0;) { PushElement(v[--i]); } + return Offset>>(EndVector(len)); + } + + /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. + /// @tparam T The data type of the `std::vector` elements. + /// @param v A const reference to the `std::vector` to serialize into the + /// buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVector(const std::vector &v) { + return CreateVector(data(v), v.size()); + } + + // vector may be implemented using a bit-set, so we can't access it as + // an array. Instead, read elements manually. + // Background: https://isocpp.org/blog/2012/11/on-vectorbool + Offset> CreateVector(const std::vector &v) { + StartVector(v.size(), sizeof(uint8_t)); + for (auto i = v.size(); i > 0;) { + PushElement(static_cast(v[--i])); + } + return Offset>(EndVector(v.size())); + } + + /// @brief Serialize values returned by a function into a FlatBuffer `vector`. + /// This is a convenience function that takes care of iteration for you. + /// @tparam T The data type of the `std::vector` elements. + /// @param f A function that takes the current iteration 0..vector_size-1 and + /// returns any type that you can construct a FlatBuffers vector out of. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVector(size_t vector_size, + const std::function &f) { + FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); + std::vector elems(vector_size); + for (size_t i = 0; i < vector_size; i++) elems[i] = f(i); + return CreateVector(elems); + } + + /// @brief Serialize values returned by a function into a FlatBuffer `vector`. + /// This is a convenience function that takes care of iteration for you. This + /// uses a vector stored on the heap to store the intermediate results of the + /// iteration. + /// @tparam T The data type of the `std::vector` elements. + /// @param f A function that takes the current iteration 0..vector_size-1, + /// and the state parameter returning any type that you can construct a + /// FlatBuffers vector out of. + /// @param state State passed to f. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVector(size_t vector_size, F f, S *state) { + FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); + std::vector elems(vector_size); + for (size_t i = 0; i < vector_size; i++) elems[i] = f(i, state); + return CreateVector(elems); + } + + /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. + /// This is a convenience function for a common case. + /// @param v A const reference to the `std::vector` to serialize into the + /// buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset>> CreateVectorOfStrings( + const std::vector &v) { + return CreateVectorOfStrings(v.cbegin(), v.cend()); + } + + /// @brief Serialize a collection of Strings into a FlatBuffer `vector`. + /// This is a convenience function for a common case. + /// @param begin The begining iterator of the collection + /// @param end The ending iterator of the collection + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset>> CreateVectorOfStrings(It begin, It end) { + auto size = std::distance(begin, end); + auto scratch_buffer_usage = size * sizeof(Offset); + // If there is not enough space to store the offsets, there definitely won't + // be enough space to store all the strings. So ensuring space for the + // scratch region is OK, for it it fails, it would have failed later. + buf_.ensure_space(scratch_buffer_usage); + for (auto it = begin; it != end; ++it) { + buf_.scratch_push_small(CreateString(*it)); + } + StartVector(size, sizeof(Offset)); + for (auto i = 1; i <= size; i++) { + // Note we re-evaluate the buf location each iteration to account for any + // underlying buffer resizing that may occur. + PushElement(*reinterpret_cast *>( + buf_.scratch_end() - i * sizeof(Offset))); + } + buf_.scratch_pop(scratch_buffer_usage); + return Offset>>(EndVector(size)); + } + + /// @brief Serialize an array of structs into a FlatBuffer `vector`. + /// @tparam T The data type of the struct array elements. + /// @param[in] v A pointer to the array of type `T` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVectorOfStructs(const T *v, size_t len) { + StartVector(len * sizeof(T) / AlignOf(), AlignOf()); + if (len > 0) { + PushBytes(reinterpret_cast(v), sizeof(T) * len); + } + return Offset>(EndVector(len)); + } + + /// @brief Serialize an array of native structs into a FlatBuffer `vector`. + /// @tparam T The data type of the struct array elements. + /// @tparam S The data type of the native struct array elements. + /// @param[in] v A pointer to the array of type `S` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @param[in] pack_func Pointer to a function to convert the native struct + /// to the FlatBuffer struct. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVectorOfNativeStructs( + const S *v, size_t len, T (*const pack_func)(const S &)) { + FLATBUFFERS_ASSERT(pack_func); + auto structs = StartVectorOfStructs(len); + for (size_t i = 0; i < len; i++) { structs[i] = pack_func(v[i]); } + return EndVectorOfStructs(len); + } + + /// @brief Serialize an array of native structs into a FlatBuffer `vector`. + /// @tparam T The data type of the struct array elements. + /// @tparam S The data type of the native struct array elements. + /// @param[in] v A pointer to the array of type `S` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVectorOfNativeStructs(const S *v, + size_t len) { + extern T Pack(const S &); + return CreateVectorOfNativeStructs(v, len, Pack); + } + + /// @brief Serialize an array of structs into a FlatBuffer `vector`. + /// @tparam T The data type of the struct array elements. + /// @param[in] filler A function that takes the current iteration + /// 0..vector_size-1 and a pointer to the struct that must be filled. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + /// This is mostly useful when flatbuffers are generated with mutation + /// accessors. + template + Offset> CreateVectorOfStructs( + size_t vector_size, const std::function &filler) { + T *structs = StartVectorOfStructs(vector_size); + for (size_t i = 0; i < vector_size; i++) { + filler(i, structs); + structs++; + } + return EndVectorOfStructs(vector_size); + } + + /// @brief Serialize an array of structs into a FlatBuffer `vector`. + /// @tparam T The data type of the struct array elements. + /// @param[in] f A function that takes the current iteration 0..vector_size-1, + /// a pointer to the struct that must be filled and the state argument. + /// @param[in] state Arbitrary state to pass to f. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + /// This is mostly useful when flatbuffers are generated with mutation + /// accessors. + template + Offset> CreateVectorOfStructs(size_t vector_size, F f, + S *state) { + T *structs = StartVectorOfStructs(vector_size); + for (size_t i = 0; i < vector_size; i++) { + f(i, structs, state); + structs++; + } + return EndVectorOfStructs(vector_size); + } + + /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector`. + /// @tparam T The data type of the `std::vector` struct elements. + /// @param[in] v A const reference to the `std::vector` of structs to + /// serialize into the buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVectorOfStructs( + const std::vector &v) { + return CreateVectorOfStructs(data(v), v.size()); + } + + /// @brief Serialize a `std::vector` of native structs into a FlatBuffer + /// `vector`. + /// @tparam T The data type of the `std::vector` struct elements. + /// @tparam S The data type of the `std::vector` native struct elements. + /// @param[in] v A const reference to the `std::vector` of structs to + /// serialize into the buffer as a `vector`. + /// @param[in] pack_func Pointer to a function to convert the native struct + /// to the FlatBuffer struct. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVectorOfNativeStructs( + const std::vector &v, T (*const pack_func)(const S &)) { + return CreateVectorOfNativeStructs(data(v), v.size(), pack_func); + } + + /// @brief Serialize a `std::vector` of native structs into a FlatBuffer + /// `vector`. + /// @tparam T The data type of the `std::vector` struct elements. + /// @tparam S The data type of the `std::vector` native struct elements. + /// @param[in] v A const reference to the `std::vector` of structs to + /// serialize into the buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVectorOfNativeStructs( + const std::vector &v) { + return CreateVectorOfNativeStructs(data(v), v.size()); + } + + /// @cond FLATBUFFERS_INTERNAL + template struct StructKeyComparator { + bool operator()(const T &a, const T &b) const { + return a.KeyCompareLessThan(&b); + } + }; + /// @endcond + + /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector` + /// in sorted order. + /// @tparam T The data type of the `std::vector` struct elements. + /// @param[in] v A const reference to the `std::vector` of structs to + /// serialize into the buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVectorOfSortedStructs( + std::vector *v) { + return CreateVectorOfSortedStructs(data(*v), v->size()); + } + + /// @brief Serialize a `std::vector` of native structs into a FlatBuffer + /// `vector` in sorted order. + /// @tparam T The data type of the `std::vector` struct elements. + /// @tparam S The data type of the `std::vector` native struct elements. + /// @param[in] v A const reference to the `std::vector` of structs to + /// serialize into the buffer as a `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset> CreateVectorOfSortedNativeStructs( + std::vector *v) { + return CreateVectorOfSortedNativeStructs(data(*v), v->size()); + } + + /// @brief Serialize an array of structs into a FlatBuffer `vector` in sorted + /// order. + /// @tparam T The data type of the struct array elements. + /// @param[in] v A pointer to the array of type `T` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVectorOfSortedStructs(T *v, size_t len) { + std::stable_sort(v, v + len, StructKeyComparator()); + return CreateVectorOfStructs(v, len); + } + + /// @brief Serialize an array of native structs into a FlatBuffer `vector` in + /// sorted order. + /// @tparam T The data type of the struct array elements. + /// @tparam S The data type of the native struct array elements. + /// @param[in] v A pointer to the array of type `S` to serialize into the + /// buffer as a `vector`. + /// @param[in] len The number of elements to serialize. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset> CreateVectorOfSortedNativeStructs(S *v, + size_t len) { + extern T Pack(const S &); + auto structs = StartVectorOfStructs(len); + for (size_t i = 0; i < len; i++) { structs[i] = Pack(v[i]); } + std::stable_sort(structs, structs + len, StructKeyComparator()); + return EndVectorOfStructs(len); + } + + /// @cond FLATBUFFERS_INTERNAL + template struct TableKeyComparator { + TableKeyComparator(vector_downward &buf) : buf_(buf) {} + TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {} + bool operator()(const Offset &a, const Offset &b) const { + auto table_a = reinterpret_cast(buf_.data_at(a.o)); + auto table_b = reinterpret_cast(buf_.data_at(b.o)); + return table_a->KeyCompareLessThan(table_b); + } + vector_downward &buf_; + + private: + FLATBUFFERS_DELETE_FUNC( + TableKeyComparator &operator=(const TableKeyComparator &other)); + }; + /// @endcond + + /// @brief Serialize an array of `table` offsets as a `vector` in the buffer + /// in sorted order. + /// @tparam T The data type that the offset refers to. + /// @param[in] v An array of type `Offset` that contains the `table` + /// offsets to store in the buffer in sorted order. + /// @param[in] len The number of elements to store in the `vector`. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template + Offset>> CreateVectorOfSortedTables(Offset *v, + size_t len) { + std::stable_sort(v, v + len, TableKeyComparator(buf_)); + return CreateVector(v, len); + } + + /// @brief Serialize an array of `table` offsets as a `vector` in the buffer + /// in sorted order. + /// @tparam T The data type that the offset refers to. + /// @param[in] v An array of type `Offset` that contains the `table` + /// offsets to store in the buffer in sorted order. + /// @return Returns a typed `Offset` into the serialized data indicating + /// where the vector is stored. + template> + Offset>> CreateVectorOfSortedTables( + std::vector, Alloc> *v) { + return CreateVectorOfSortedTables(data(*v), v->size()); + } + + /// @brief Specialized version of `CreateVector` for non-copying use cases. + /// Write the data any time later to the returned buffer pointer `buf`. + /// @param[in] len The number of elements to store in the `vector`. + /// @param[in] elemsize The size of each element in the `vector`. + /// @param[out] buf A pointer to a `uint8_t` pointer that can be + /// written to at a later time to serialize the data into a `vector` + /// in the buffer. + uoffset_t CreateUninitializedVector(size_t len, size_t elemsize, + uint8_t **buf) { + NotNested(); + StartVector(len, elemsize); + buf_.make_space(len * elemsize); + auto vec_start = GetSize(); + auto vec_end = EndVector(len); + *buf = buf_.data_at(vec_start); + return vec_end; + } + + /// @brief Specialized version of `CreateVector` for non-copying use cases. + /// Write the data any time later to the returned buffer pointer `buf`. + /// @tparam T The data type of the data that will be stored in the buffer + /// as a `vector`. + /// @param[in] len The number of elements to store in the `vector`. + /// @param[out] buf A pointer to a pointer of type `T` that can be + /// written to at a later time to serialize the data into a `vector` + /// in the buffer. + template + Offset> CreateUninitializedVector(size_t len, T **buf) { + AssertScalarT(); + return CreateUninitializedVector(len, sizeof(T), + reinterpret_cast(buf)); + } + + template + Offset> CreateUninitializedVectorOfStructs(size_t len, + T **buf) { + return CreateUninitializedVector(len, sizeof(T), + reinterpret_cast(buf)); + } + + // @brief Create a vector of scalar type T given as input a vector of scalar + // type U, useful with e.g. pre "enum class" enums, or any existing scalar + // data of the wrong type. + template + Offset> CreateVectorScalarCast(const U *v, size_t len) { + AssertScalarT(); + AssertScalarT(); + StartVector(len, sizeof(T)); + for (auto i = len; i > 0;) { PushElement(static_cast(v[--i])); } + return Offset>(EndVector(len)); + } + + /// @brief Write a struct by itself, typically to be part of a union. + template Offset CreateStruct(const T &structobj) { + NotNested(); + Align(AlignOf()); + buf_.push_small(structobj); + return Offset(GetSize()); + } + + /// @brief Finish serializing a buffer by writing the root offset. + /// @param[in] file_identifier If a `file_identifier` is given, the buffer + /// will be prefixed with a standard FlatBuffers file header. + template + void Finish(Offset root, const char *file_identifier = nullptr) { + Finish(root.o, file_identifier, false); + } + + /// @brief Finish a buffer with a 32 bit size field pre-fixed (size of the + /// buffer following the size field). These buffers are NOT compatible + /// with standard buffers created by Finish, i.e. you can't call GetRoot + /// on them, you have to use GetSizePrefixedRoot instead. + /// All >32 bit quantities in this buffer will be aligned when the whole + /// size pre-fixed buffer is aligned. + /// These kinds of buffers are useful for creating a stream of FlatBuffers. + template + void FinishSizePrefixed(Offset root, + const char *file_identifier = nullptr) { + Finish(root.o, file_identifier, true); + } + + void SwapBufAllocator(FlatBufferBuilder &other) { + buf_.swap_allocator(other.buf_); + } + + /// @brief The length of a FlatBuffer file header. + static const size_t kFileIdentifierLength = + ::deephaven::third_party::flatbuffers::kFileIdentifierLength; + + protected: + // You shouldn't really be copying instances of this class. + FlatBufferBuilder(const FlatBufferBuilder &); + FlatBufferBuilder &operator=(const FlatBufferBuilder &); + + void Finish(uoffset_t root, const char *file_identifier, bool size_prefix) { + NotNested(); + buf_.clear_scratch(); + // This will cause the whole buffer to be aligned. + PreAlign((size_prefix ? sizeof(uoffset_t) : 0) + sizeof(uoffset_t) + + (file_identifier ? kFileIdentifierLength : 0), + minalign_); + if (file_identifier) { + FLATBUFFERS_ASSERT(strlen(file_identifier) == kFileIdentifierLength); + PushBytes(reinterpret_cast(file_identifier), + kFileIdentifierLength); + } + PushElement(ReferTo(root)); // Location of root. + if (size_prefix) { PushElement(GetSize()); } + finished = true; + } + + struct FieldLoc { + uoffset_t off; + voffset_t id; + }; + + vector_downward buf_; + + // Accumulating offsets of table members while it is being built. + // We store these in the scratch pad of buf_, after the vtable offsets. + uoffset_t num_field_loc; + // Track how much of the vtable is in use, so we can output the most compact + // possible vtable. + voffset_t max_voffset_; + + // Ensure objects are not nested. + bool nested; + + // Ensure the buffer is finished before it is being accessed. + bool finished; + + size_t minalign_; + + bool force_defaults_; // Serialize values equal to their defaults anyway. + + bool dedup_vtables_; + + struct StringOffsetCompare { + StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {} + bool operator()(const Offset &a, const Offset &b) const { + auto stra = reinterpret_cast(buf_->data_at(a.o)); + auto strb = reinterpret_cast(buf_->data_at(b.o)); + return StringLessThan(stra->data(), stra->size(), strb->data(), + strb->size()); + } + const vector_downward *buf_; + }; + + // For use with CreateSharedString. Instantiated on first use only. + typedef std::set, StringOffsetCompare> StringOffsetMap; + StringOffsetMap *string_pool; + + private: + // Allocates space for a vector of structures. + // Must be completed with EndVectorOfStructs(). + template T *StartVectorOfStructs(size_t vector_size) { + StartVector(vector_size * sizeof(T) / AlignOf(), AlignOf()); + return reinterpret_cast(buf_.make_space(vector_size * sizeof(T))); + } + + // End the vector of structures in the flatbuffers. + // Vector should have previously be started with StartVectorOfStructs(). + template + Offset> EndVectorOfStructs(size_t vector_size) { + return Offset>(EndVector(vector_size)); + } +}; +/// @} + +/// Helpers to get a typed pointer to objects that are currently being built. +/// @warning Creating new objects will lead to reallocations and invalidates +/// the pointer! +template +T *GetMutableTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { + return reinterpret_cast(fbb.GetCurrentBufferPointer() + fbb.GetSize() - + offset.o); +} + +template +const T *GetTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { + return GetMutableTemporaryPointer(fbb, offset); +} + +template +void FlatBufferBuilder::Required(Offset table, voffset_t field) { + auto table_ptr = reinterpret_cast(buf_.data_at(table.o)); + bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; + // If this fails, the caller will show what field needs to be set. + FLATBUFFERS_ASSERT(ok); + (void)ok; +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_VECTOR_DOWNWARD_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h new file mode 100644 index 00000000000..d4f96801a86 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h @@ -0,0 +1,270 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_H_ +#define FLATBUFFERS_H_ + +// TODO: These includes are for mitigating the pains of users editing their +// source because they relied on flatbuffers.h to include everything for them. +#include "flatbuffers/array.h" +#include "flatbuffers/base.h" +#include "flatbuffers/buffer.h" +#include "flatbuffers/buffer_ref.h" +#include "flatbuffers/detached_buffer.h" +#include "flatbuffers/flatbuffer_builder.h" +#include "flatbuffers/stl_emulation.h" +#include "flatbuffers/string.h" +#include "flatbuffers/struct.h" +#include "flatbuffers/table.h" +#include "flatbuffers/vector.h" +#include "flatbuffers/vector_downward.h" +#include "flatbuffers/verifier.h" + +namespace deephaven::third_party::flatbuffers { + +/// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. +/// it is the opposite transformation of GetRoot(). +/// This may be useful if you want to pass on a root and have the recipient +/// delete the buffer afterwards. +inline const uint8_t *GetBufferStartFromRootPointer(const void *root) { + auto table = reinterpret_cast(root); + auto vtable = table->GetVTable(); + // Either the vtable is before the root or after the root. + auto start = (std::min)(vtable, reinterpret_cast(root)); + // Align to at least sizeof(uoffset_t). + start = reinterpret_cast(reinterpret_cast(start) & + ~(sizeof(uoffset_t) - 1)); + // Additionally, there may be a file_identifier in the buffer, and the root + // offset. The buffer may have been aligned to any size between + // sizeof(uoffset_t) and FLATBUFFERS_MAX_ALIGNMENT (see "force_align"). + // Sadly, the exact alignment is only known when constructing the buffer, + // since it depends on the presence of values with said alignment properties. + // So instead, we simply look at the next uoffset_t values (root, + // file_identifier, and alignment padding) to see which points to the root. + // None of the other values can "impersonate" the root since they will either + // be 0 or four ASCII characters. + static_assert(flatbuffers::kFileIdentifierLength == sizeof(uoffset_t), + "file_identifier is assumed to be the same size as uoffset_t"); + for (auto possible_roots = FLATBUFFERS_MAX_ALIGNMENT / sizeof(uoffset_t) + 1; + possible_roots; possible_roots--) { + start -= sizeof(uoffset_t); + if (ReadScalar(start) + start == + reinterpret_cast(root)) + return start; + } + // We didn't find the root, either the "root" passed isn't really a root, + // or the buffer is corrupt. + // Assert, because calling this function with bad data may cause reads + // outside of buffer boundaries. + FLATBUFFERS_ASSERT(false); + return nullptr; +} + +/// @brief This return the prefixed size of a FlatBuffer. +inline uoffset_t GetPrefixedSize(const uint8_t *buf) { + return ReadScalar(buf); +} + +// Base class for native objects (FlatBuffer data de-serialized into native +// C++ data structures). +// Contains no functionality, purely documentative. +struct NativeTable {}; + +/// @brief Function types to be used with resolving hashes into objects and +/// back again. The resolver gets a pointer to a field inside an object API +/// object that is of the type specified in the schema using the attribute +/// `cpp_type` (it is thus important whatever you write to this address +/// matches that type). The value of this field is initially null, so you +/// may choose to implement a delayed binding lookup using this function +/// if you wish. The resolver does the opposite lookup, for when the object +/// is being serialized again. +typedef uint64_t hash_value_t; +typedef std::function + resolver_function_t; +typedef std::function rehasher_function_t; + +// Helper function to test if a field is present, using any of the field +// enums in the generated code. +// `table` must be a generated table type. Since this is a template parameter, +// this is not typechecked to be a subclass of Table, so beware! +// Note: this function will return false for fields equal to the default +// value, since they're not stored in the buffer (unless force_defaults was +// used). +template +bool IsFieldPresent(const T *table, typename T::FlatBuffersVTableOffset field) { + // Cast, since Table is a private baseclass of any table types. + return reinterpret_cast(table)->CheckField( + static_cast(field)); +} + +// Utility function for reverse lookups on the EnumNames*() functions +// (in the generated C++ code) +// names must be NULL terminated. +inline int LookupEnum(const char **names, const char *name) { + for (const char **p = names; *p; p++) + if (!strcmp(*p, name)) return static_cast(p - names); + return -1; +} + +// These macros allow us to layout a struct with a guarantee that they'll end +// up looking the same on different compilers and platforms. +// It does this by disallowing the compiler to do any padding, and then +// does padding itself by inserting extra padding fields that make every +// element aligned to its own size. +// Additionally, it manually sets the alignment of the struct as a whole, +// which is typically its largest element, or a custom size set in the schema +// by the force_align attribute. +// These are used in the generated code only. + +// clang-format off +#if defined(_MSC_VER) + #define FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(alignment) \ + __pragma(pack(1)) \ + struct __declspec(align(alignment)) + #define FLATBUFFERS_STRUCT_END(name, size) \ + __pragma(pack()) \ + static_assert(sizeof(name) == size, "compiler breaks packing rules") +#elif defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__) + #define FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(alignment) \ + _Pragma("pack(1)") \ + struct __attribute__((aligned(alignment))) + #define FLATBUFFERS_STRUCT_END(name, size) \ + _Pragma("pack()") \ + static_assert(sizeof(name) == size, "compiler breaks packing rules") +#else + #error Unknown compiler, please define structure alignment macros +#endif +// clang-format on + +// Minimal reflection via code generation. +// Besides full-fat reflection (see reflection.h) and parsing/printing by +// loading schemas (see idl.h), we can also have code generation for minimal +// reflection data which allows pretty-printing and other uses without needing +// a schema or a parser. +// Generate code with --reflect-types (types only) or --reflect-names (names +// also) to enable. +// See minireflect.h for utilities using this functionality. + +// These types are organized slightly differently as the ones in idl.h. +enum SequenceType { ST_TABLE, ST_STRUCT, ST_UNION, ST_ENUM }; + +// Scalars have the same order as in idl.h +// clang-format off +#define FLATBUFFERS_GEN_ELEMENTARY_TYPES(ET) \ + ET(ET_UTYPE) \ + ET(ET_BOOL) \ + ET(ET_CHAR) \ + ET(ET_UCHAR) \ + ET(ET_SHORT) \ + ET(ET_USHORT) \ + ET(ET_INT) \ + ET(ET_UINT) \ + ET(ET_LONG) \ + ET(ET_ULONG) \ + ET(ET_FLOAT) \ + ET(ET_DOUBLE) \ + ET(ET_STRING) \ + ET(ET_SEQUENCE) // See SequenceType. + +enum ElementaryType { + #define FLATBUFFERS_ET(E) E, + FLATBUFFERS_GEN_ELEMENTARY_TYPES(FLATBUFFERS_ET) + #undef FLATBUFFERS_ET +}; + +inline const char * const *ElementaryTypeNames() { + static const char * const names[] = { + #define FLATBUFFERS_ET(E) #E, + FLATBUFFERS_GEN_ELEMENTARY_TYPES(FLATBUFFERS_ET) + #undef FLATBUFFERS_ET + }; + return names; +} +// clang-format on + +// Basic type info cost just 16bits per field! +// We're explicitly defining the signedness since the signedness of integer +// bitfields is otherwise implementation-defined and causes warnings on older +// GCC compilers. +struct TypeCode { + // ElementaryType + unsigned short base_type : 4; + // Either vector (in table) or array (in struct) + unsigned short is_repeating : 1; + // Index into type_refs below, or -1 for none. + signed short sequence_ref : 11; +}; + +static_assert(sizeof(TypeCode) == 2, "TypeCode"); + +struct TypeTable; + +// Signature of the static method present in each type. +typedef const TypeTable *(*TypeFunction)(); + +struct TypeTable { + SequenceType st; + size_t num_elems; // of type_codes, values, names (but not type_refs). + const TypeCode *type_codes; // num_elems count + const TypeFunction *type_refs; // less than num_elems entries (see TypeCode). + const int16_t *array_sizes; // less than num_elems entries (see TypeCode). + const int64_t *values; // Only set for non-consecutive enum/union or structs. + const char *const *names; // Only set if compiled with --reflect-names. +}; + +// String which identifies the current version of FlatBuffers. +inline const char *flatbuffers_version_string() { + return "FlatBuffers " FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "." + FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "." + FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION); +} + +// clang-format off +#define FLATBUFFERS_DEFINE_BITMASK_OPERATORS(E, T)\ + inline E operator | (E lhs, E rhs){\ + return E(T(lhs) | T(rhs));\ + }\ + inline E operator & (E lhs, E rhs){\ + return E(T(lhs) & T(rhs));\ + }\ + inline E operator ^ (E lhs, E rhs){\ + return E(T(lhs) ^ T(rhs));\ + }\ + inline E operator ~ (E lhs){\ + return E(~T(lhs));\ + }\ + inline E operator |= (E &lhs, E rhs){\ + lhs = lhs | rhs;\ + return lhs;\ + }\ + inline E operator &= (E &lhs, E rhs){\ + lhs = lhs & rhs;\ + return lhs;\ + }\ + inline E operator ^= (E &lhs, E rhs){\ + lhs = lhs ^ rhs;\ + return lhs;\ + }\ + inline bool operator !(E rhs) \ + {\ + return !bool(T(rhs)); \ + } +/// @endcond +} // namespace flatbuffers + +// clang-format on + +#endif // FLATBUFFERS_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h b/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h new file mode 100644 index 00000000000..11607a45be1 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h @@ -0,0 +1,509 @@ +/* + * Copyright 2017 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_STL_EMULATION_H_ +#define FLATBUFFERS_STL_EMULATION_H_ + +// clang-format off +#include "flatbuffers/base.h" + +#include +#include +#include +#include +#include + +// Detect C++17 compatible compiler. +// __cplusplus >= 201703L - a compiler has support of 'static inline' variables. +#if defined(FLATBUFFERS_USE_STD_OPTIONAL) \ + || (defined(__cplusplus) && __cplusplus >= 201703L) \ + || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)) + #include + #ifndef FLATBUFFERS_USE_STD_OPTIONAL + #define FLATBUFFERS_USE_STD_OPTIONAL + #endif +#endif // defined(FLATBUFFERS_USE_STD_OPTIONAL) ... + +// The __cpp_lib_span is the predefined feature macro. +#if defined(FLATBUFFERS_USE_STD_SPAN) + #include +#elif defined(__cpp_lib_span) && defined(__has_include) + #if __has_include() + #include + #define FLATBUFFERS_USE_STD_SPAN + #endif +#else + // Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined. + #if !defined(FLATBUFFERS_TEMPLATES_ALIASES) + #define FLATBUFFERS_SPAN_MINIMAL + #else + // Enable implicit construction of a span from a std::array. + #include + #endif +#endif // defined(FLATBUFFERS_USE_STD_SPAN) + +// This header provides backwards compatibility for older versions of the STL. +namespace deephaven::third_party::flatbuffers { + +#if defined(FLATBUFFERS_TEMPLATES_ALIASES) + template + using numeric_limits = std::numeric_limits; +#else + template class numeric_limits : + public std::numeric_limits {}; +#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + +#if defined(FLATBUFFERS_TEMPLATES_ALIASES) + template using is_scalar = std::is_scalar; + template using is_same = std::is_same; + template using is_floating_point = std::is_floating_point; + template using is_unsigned = std::is_unsigned; + template using is_enum = std::is_enum; + template using make_unsigned = std::make_unsigned; + template + using conditional = std::conditional; + template + using integral_constant = std::integral_constant; + template + using bool_constant = integral_constant; + using true_type = std::true_type; + using false_type = std::false_type; +#else + // MSVC 2010 doesn't support C++11 aliases. + template struct is_scalar : public std::is_scalar {}; + template struct is_same : public std::is_same {}; + template struct is_floating_point : + public std::is_floating_point {}; + template struct is_unsigned : public std::is_unsigned {}; + template struct is_enum : public std::is_enum {}; + template struct make_unsigned : public std::make_unsigned {}; + template + struct conditional : public std::conditional {}; + template + struct integral_constant : public std::integral_constant {}; + template + struct bool_constant : public integral_constant {}; + typedef bool_constant true_type; + typedef bool_constant false_type; +#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + +#if defined(FLATBUFFERS_TEMPLATES_ALIASES) + template using unique_ptr = std::unique_ptr; +#else + // MSVC 2010 doesn't support C++11 aliases. + // We're manually "aliasing" the class here as we want to bring unique_ptr + // into the flatbuffers namespace. We have unique_ptr in the flatbuffers + // namespace we have a completely independent implementation (see below) + // for C++98 STL implementations. + template class unique_ptr : public std::unique_ptr { + public: + unique_ptr() {} + explicit unique_ptr(T* p) : std::unique_ptr(p) {} + unique_ptr(std::unique_ptr&& u) { *this = std::move(u); } + unique_ptr(unique_ptr&& u) { *this = std::move(u); } + unique_ptr& operator=(std::unique_ptr&& u) { + std::unique_ptr::reset(u.release()); + return *this; + } + unique_ptr& operator=(unique_ptr&& u) { + std::unique_ptr::reset(u.release()); + return *this; + } + unique_ptr& operator=(T* p) { + return std::unique_ptr::operator=(p); + } + }; +#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + +#ifdef FLATBUFFERS_USE_STD_OPTIONAL +template +using Optional = std::optional; +using nullopt_t = std::nullopt_t; +inline constexpr nullopt_t nullopt = std::nullopt; + +#else +// Limited implementation of Optional type for a scalar T. +// This implementation limited by trivial types compatible with +// std::is_arithmetic or std::is_enum type traits. + +// A tag to indicate an empty flatbuffers::optional. +struct nullopt_t { + explicit FLATBUFFERS_CONSTEXPR_CPP11 nullopt_t(int) {} +}; + +#if defined(FLATBUFFERS_CONSTEXPR_DEFINED) + namespace internal { + template struct nullopt_holder { + static constexpr nullopt_t instance_ = nullopt_t(0); + }; + template + constexpr nullopt_t nullopt_holder::instance_; + } + static constexpr const nullopt_t &nullopt = internal::nullopt_holder::instance_; + +#else + namespace internal { + template struct nullopt_holder { + static const nullopt_t instance_; + }; + template + const nullopt_t nullopt_holder::instance_ = nullopt_t(0); + } + static const nullopt_t &nullopt = internal::nullopt_holder::instance_; + +#endif + +template +class Optional FLATBUFFERS_FINAL_CLASS { + // Non-scalar 'T' would extremely complicated Optional. + // Use is_scalar checking because flatbuffers flatbuffers::is_arithmetic + // isn't implemented. + static_assert(flatbuffers::is_scalar::value, "unexpected type T"); + + public: + ~Optional() {} + + FLATBUFFERS_CONSTEXPR_CPP11 Optional() FLATBUFFERS_NOEXCEPT + : value_(), has_value_(false) {} + + FLATBUFFERS_CONSTEXPR_CPP11 Optional(nullopt_t) FLATBUFFERS_NOEXCEPT + : value_(), has_value_(false) {} + + FLATBUFFERS_CONSTEXPR_CPP11 Optional(T val) FLATBUFFERS_NOEXCEPT + : value_(val), has_value_(true) {} + + FLATBUFFERS_CONSTEXPR_CPP11 Optional(const Optional &other) FLATBUFFERS_NOEXCEPT + : value_(other.value_), has_value_(other.has_value_) {} + + FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(const Optional &other) FLATBUFFERS_NOEXCEPT { + value_ = other.value_; + has_value_ = other.has_value_; + return *this; + } + + FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(nullopt_t) FLATBUFFERS_NOEXCEPT { + value_ = T(); + has_value_ = false; + return *this; + } + + FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(T val) FLATBUFFERS_NOEXCEPT { + value_ = val; + has_value_ = true; + return *this; + } + + void reset() FLATBUFFERS_NOEXCEPT { + *this = nullopt; + } + + void swap(Optional &other) FLATBUFFERS_NOEXCEPT { + std::swap(value_, other.value_); + std::swap(has_value_, other.has_value_); + } + + FLATBUFFERS_CONSTEXPR_CPP11 FLATBUFFERS_EXPLICIT_CPP11 operator bool() const FLATBUFFERS_NOEXCEPT { + return has_value_; + } + + FLATBUFFERS_CONSTEXPR_CPP11 bool has_value() const FLATBUFFERS_NOEXCEPT { + return has_value_; + } + + FLATBUFFERS_CONSTEXPR_CPP11 const T& operator*() const FLATBUFFERS_NOEXCEPT { + return value_; + } + + const T& value() const { + FLATBUFFERS_ASSERT(has_value()); + return value_; + } + + T value_or(T default_value) const FLATBUFFERS_NOEXCEPT { + return has_value() ? value_ : default_value; + } + + private: + T value_; + bool has_value_; +}; + +template +FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional& opt, nullopt_t) FLATBUFFERS_NOEXCEPT { + return !opt; +} +template +FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(nullopt_t, const Optional& opt) FLATBUFFERS_NOEXCEPT { + return !opt; +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional& lhs, const U& rhs) FLATBUFFERS_NOEXCEPT { + return static_cast(lhs) && (*lhs == rhs); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const T& lhs, const Optional& rhs) FLATBUFFERS_NOEXCEPT { + return static_cast(rhs) && (lhs == *rhs); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional& lhs, const Optional& rhs) FLATBUFFERS_NOEXCEPT { + return static_cast(lhs) != static_cast(rhs) + ? false + : !static_cast(lhs) ? false : (*lhs == *rhs); +} +#endif // FLATBUFFERS_USE_STD_OPTIONAL + + +// Very limited and naive partial implementation of C++20 std::span. +#if defined(FLATBUFFERS_USE_STD_SPAN) + inline constexpr std::size_t dynamic_extent = std::dynamic_extent; + template + using span = std::span; + +#else // !defined(FLATBUFFERS_USE_STD_SPAN) +FLATBUFFERS_CONSTEXPR std::size_t dynamic_extent = static_cast(-1); + +// Exclude this code if MSVC2010 or non-STL Android is active. +// The non-STL Android doesn't have `std::is_convertible` required for SFINAE. +#if !defined(FLATBUFFERS_SPAN_MINIMAL) +namespace internal { + // This is SFINAE helper class for checking of a common condition: + // > This overload only participates in overload resolution + // > Check whether a pointer to an array of U can be converted + // > to a pointer to an array of E. + // This helper is used for checking of 'U -> const U'. + template + struct is_span_convertable { + using type = + typename std::conditional::value + && (Extent == dynamic_extent || N == Extent), + int, void>::type; + }; + + template + struct SpanIterator { + // TODO: upgrade to std::random_access_iterator_tag. + using iterator_category = std::forward_iterator_tag; + using difference_type = std::ptrdiff_t; + using value_type = typename std::remove_cv::type; + using reference = T&; + using pointer = T*; + + // Convince MSVC compiler that this iterator is trusted (it is verified). + #ifdef _MSC_VER + using _Unchecked_type = pointer; + #endif // _MSC_VER + + SpanIterator(pointer ptr) : ptr_(ptr) {} + reference operator*() const { return *ptr_; } + pointer operator->() { return ptr_; } + SpanIterator& operator++() { ptr_++; return *this; } + SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; } + + friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; } + friend bool operator!= (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ != rhs.ptr_; } + + private: + pointer ptr_; + }; +} // namespace internal +#endif // !defined(FLATBUFFERS_SPAN_MINIMAL) + +// T - element type; must be a complete type that is not an abstract +// class type. +// Extent - the number of elements in the sequence, or dynamic. +template +class span FLATBUFFERS_FINAL_CLASS { + public: + typedef T element_type; + typedef T& reference; + typedef const T& const_reference; + typedef T* pointer; + typedef const T* const_pointer; + typedef std::size_t size_type; + + static FLATBUFFERS_CONSTEXPR size_type extent = Extent; + + // Returns the number of elements in the span. + FLATBUFFERS_CONSTEXPR_CPP11 size_type size() const FLATBUFFERS_NOEXCEPT { + return count_; + } + + // Returns the size of the sequence in bytes. + FLATBUFFERS_CONSTEXPR_CPP11 + size_type size_bytes() const FLATBUFFERS_NOEXCEPT { + return size() * sizeof(element_type); + } + + // Checks if the span is empty. + FLATBUFFERS_CONSTEXPR_CPP11 bool empty() const FLATBUFFERS_NOEXCEPT { + return size() == 0; + } + + // Returns a pointer to the beginning of the sequence. + FLATBUFFERS_CONSTEXPR_CPP11 pointer data() const FLATBUFFERS_NOEXCEPT { + return data_; + } + + #if !defined(FLATBUFFERS_SPAN_MINIMAL) + using Iterator = internal::SpanIterator; + using ConstIterator = internal::SpanIterator; + + Iterator begin() const { return Iterator(data()); } + Iterator end() const { return Iterator(data() + size()); } + + ConstIterator cbegin() const { return ConstIterator(data()); } + ConstIterator cend() const { return ConstIterator(data() + size()); } + #endif + + // Returns a reference to the idx-th element of the sequence. + // The behavior is undefined if the idx is greater than or equal to size(). + FLATBUFFERS_CONSTEXPR_CPP11 reference operator[](size_type idx) const { + return data()[idx]; + } + + FLATBUFFERS_CONSTEXPR_CPP11 span(const span &other) FLATBUFFERS_NOEXCEPT + : data_(other.data_), count_(other.count_) {} + + FLATBUFFERS_CONSTEXPR_CPP14 span &operator=(const span &other) + FLATBUFFERS_NOEXCEPT { + data_ = other.data_; + count_ = other.count_; + } + + // Limited implementation of + // `template constexpr std::span(It first, size_type count);`. + // + // Constructs a span that is a view over the range [first, first + count); + // the resulting span has: data() == first and size() == count. + // The behavior is undefined if [first, first + count) is not a valid range, + // or if (extent != flatbuffers::dynamic_extent && count != extent). + FLATBUFFERS_CONSTEXPR_CPP11 + explicit span(pointer first, size_type count) FLATBUFFERS_NOEXCEPT + : data_ (Extent == dynamic_extent ? first : (Extent == count ? first : nullptr)), + count_(Extent == dynamic_extent ? count : (Extent == count ? Extent : 0)) { + // Make span empty if the count argument is incompatible with span. + } + + // Exclude this code if MSVC2010 is active. The MSVC2010 isn't C++11 + // compliant, it doesn't support default template arguments for functions. + #if defined(FLATBUFFERS_SPAN_MINIMAL) + FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr), + count_(0) { + static_assert(extent == 0 || extent == dynamic_extent, "invalid span"); + } + + #else + // Constructs an empty span whose data() == nullptr and size() == 0. + // This overload only participates in overload resolution if + // extent == 0 || extent == flatbuffers::dynamic_extent. + // A dummy template argument N is need dependency for SFINAE. + template::type = 0> + FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr), + count_(0) { + static_assert(extent == 0 || extent == dynamic_extent, "invalid span"); + } + + // Constructs a span that is a view over the array arr; the resulting span + // has size() == N and data() == std::data(arr). These overloads only + // participate in overload resolution if + // extent == std::dynamic_extent || N == extent is true and + // std::remove_pointer_t(*)[] + // is convertible to element_type (*)[]. + template::type = 0> + FLATBUFFERS_CONSTEXPR_CPP11 span(element_type (&arr)[N]) FLATBUFFERS_NOEXCEPT + : data_(arr), count_(N) {} + + template::type = 0> + FLATBUFFERS_CONSTEXPR_CPP11 span(std::array &arr) FLATBUFFERS_NOEXCEPT + : data_(arr.data()), count_(N) {} + + //template + //FLATBUFFERS_CONSTEXPR_CPP11 span(std::array &arr) FLATBUFFERS_NOEXCEPT + // : data_(arr.data()), count_(N) {} + + template::type = 0> + FLATBUFFERS_CONSTEXPR_CPP11 span(const std::array &arr) FLATBUFFERS_NOEXCEPT + : data_(arr.data()), count_(N) {} + + // Converting constructor from another span s; + // the resulting span has size() == s.size() and data() == s.data(). + // This overload only participates in overload resolution + // if extent == std::dynamic_extent || N == extent is true and U (*)[] + // is convertible to element_type (*)[]. + template::type = 0> + FLATBUFFERS_CONSTEXPR_CPP11 span(const flatbuffers::span &s) FLATBUFFERS_NOEXCEPT + : span(s.data(), s.size()) { + } + + #endif // !defined(FLATBUFFERS_SPAN_MINIMAL) + + private: + // This is a naive implementation with 'count_' member even if (Extent != dynamic_extent). + pointer const data_; + const size_type count_; +}; +#endif // defined(FLATBUFFERS_USE_STD_SPAN) + +#if !defined(FLATBUFFERS_SPAN_MINIMAL) +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(U(&arr)[N]) FLATBUFFERS_NOEXCEPT { + return span(arr); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(const U(&arr)[N]) FLATBUFFERS_NOEXCEPT { + return span(arr); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(std::array &arr) FLATBUFFERS_NOEXCEPT { + return span(arr); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(const std::array &arr) FLATBUFFERS_NOEXCEPT { + return span(arr); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { + return span(first, count); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 +flatbuffers::span make_span(const U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { + return span(first, count); +} +#endif // !defined(FLATBUFFERS_SPAN_MINIMAL) + +} // namespace flatbuffers + +#endif // FLATBUFFERS_STL_EMULATION_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/string.h b/cpp-client/deephaven/client/third_party/flatbuffers/string.h new file mode 100644 index 00000000000..8f2ff715b4b --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/string.h @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_STRING_H_ +#define FLATBUFFERS_STRING_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/vector.h" + +namespace deephaven::third_party::flatbuffers { + +struct String : public Vector { + const char *c_str() const { return reinterpret_cast(Data()); } + std::string str() const { return std::string(c_str(), size()); } + + // clang-format off + #ifdef FLATBUFFERS_HAS_STRING_VIEW + flatbuffers::string_view string_view() const { + return flatbuffers::string_view(c_str(), size()); + } + #endif // FLATBUFFERS_HAS_STRING_VIEW + // clang-format on + + bool operator<(const String &o) const { + return StringLessThan(this->data(), this->size(), o.data(), o.size()); + } +}; + +// Convenience function to get std::string from a String returning an empty +// string on null pointer. +static inline std::string GetString(const String *str) { + return str ? str->str() : ""; +} + +// Convenience function to get char* from a String returning an empty string on +// null pointer. +static inline const char *GetCstring(const String *str) { + return str ? str->c_str() : ""; +} + +#ifdef FLATBUFFERS_HAS_STRING_VIEW +// Convenience function to get string_view from a String returning an empty +// string_view on null pointer. +static inline flatbuffers::string_view GetStringView(const String *str) { + return str ? str->string_view() : flatbuffers::string_view(); +} +#endif // FLATBUFFERS_HAS_STRING_VIEW + +} // namespace flatbuffers + +#endif // FLATBUFFERS_STRING_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/struct.h b/cpp-client/deephaven/client/third_party/flatbuffers/struct.h new file mode 100644 index 00000000000..1725b7151f2 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/struct.h @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_STRUCT_H_ +#define FLATBUFFERS_STRUCT_H_ + +#include "flatbuffers/base.h" + +namespace deephaven::third_party::flatbuffers { + +// "structs" are flat structures that do not have an offset table, thus +// always have all members present and do not support forwards/backwards +// compatible extensions. + +class Struct FLATBUFFERS_FINAL_CLASS { + public: + template T GetField(uoffset_t o) const { + return ReadScalar(&data_[o]); + } + + template T GetStruct(uoffset_t o) const { + return reinterpret_cast(&data_[o]); + } + + const uint8_t *GetAddressOf(uoffset_t o) const { return &data_[o]; } + uint8_t *GetAddressOf(uoffset_t o) { return &data_[o]; } + + private: + // private constructor & copy constructor: you obtain instances of this + // class by pointing to existing data only + Struct(); + Struct(const Struct &); + Struct &operator=(const Struct &); + + uint8_t data_[1]; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_STRUCT_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/table.h b/cpp-client/deephaven/client/third_party/flatbuffers/table.h new file mode 100644 index 00000000000..40a50221138 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/table.h @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_TABLE_H_ +#define FLATBUFFERS_TABLE_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/verifier.h" + +namespace deephaven::third_party::flatbuffers { + +// "tables" use an offset table (possibly shared) that allows fields to be +// omitted and added at will, but uses an extra indirection to read. +class Table { + public: + const uint8_t *GetVTable() const { + return data_ - ReadScalar(data_); + } + + // This gets the field offset for any of the functions below it, or 0 + // if the field was not present. + voffset_t GetOptionalFieldOffset(voffset_t field) const { + // The vtable offset is always at the start. + auto vtable = GetVTable(); + // The first element is the size of the vtable (fields + type id + itself). + auto vtsize = ReadScalar(vtable); + // If the field we're accessing is outside the vtable, we're reading older + // data, so it's the same as if the offset was 0 (not present). + return field < vtsize ? ReadScalar(vtable + field) : 0; + } + + template T GetField(voffset_t field, T defaultval) const { + auto field_offset = GetOptionalFieldOffset(field); + return field_offset ? ReadScalar(data_ + field_offset) : defaultval; + } + + template P GetPointer(voffset_t field) { + auto field_offset = GetOptionalFieldOffset(field); + auto p = data_ + field_offset; + return field_offset ? reinterpret_cast

(p + ReadScalar(p)) + : nullptr; + } + template P GetPointer(voffset_t field) const { + return const_cast

(this)->GetPointer

(field); + } + + template P GetStruct(voffset_t field) const { + auto field_offset = GetOptionalFieldOffset(field); + auto p = const_cast(data_ + field_offset); + return field_offset ? reinterpret_cast

(p) : nullptr; + } + + template + flatbuffers::Optional GetOptional(voffset_t field) const { + auto field_offset = GetOptionalFieldOffset(field); + auto p = data_ + field_offset; + return field_offset ? Optional(static_cast(ReadScalar(p))) + : Optional(); + } + + template bool SetField(voffset_t field, T val, T def) { + auto field_offset = GetOptionalFieldOffset(field); + if (!field_offset) return IsTheSameAs(val, def); + WriteScalar(data_ + field_offset, val); + return true; + } + template bool SetField(voffset_t field, T val) { + auto field_offset = GetOptionalFieldOffset(field); + if (!field_offset) return false; + WriteScalar(data_ + field_offset, val); + return true; + } + + bool SetPointer(voffset_t field, const uint8_t *val) { + auto field_offset = GetOptionalFieldOffset(field); + if (!field_offset) return false; + WriteScalar(data_ + field_offset, + static_cast(val - (data_ + field_offset))); + return true; + } + + uint8_t *GetAddressOf(voffset_t field) { + auto field_offset = GetOptionalFieldOffset(field); + return field_offset ? data_ + field_offset : nullptr; + } + const uint8_t *GetAddressOf(voffset_t field) const { + return const_cast

(this)->GetAddressOf(field); + } + + bool CheckField(voffset_t field) const { + return GetOptionalFieldOffset(field) != 0; + } + + // Verify the vtable of this table. + // Call this once per table, followed by VerifyField once per field. + bool VerifyTableStart(Verifier &verifier) const { + return verifier.VerifyTableStart(data_); + } + + // Verify a particular field. + template + bool VerifyField(const Verifier &verifier, voffset_t field, + size_t align) const { + // Calling GetOptionalFieldOffset should be safe now thanks to + // VerifyTable(). + auto field_offset = GetOptionalFieldOffset(field); + // Check the actual field. + return !field_offset || verifier.VerifyField(data_, field_offset, align); + } + + // VerifyField for required fields. + template + bool VerifyFieldRequired(const Verifier &verifier, voffset_t field, + size_t align) const { + auto field_offset = GetOptionalFieldOffset(field); + return verifier.Check(field_offset != 0) && + verifier.VerifyField(data_, field_offset, align); + } + + // Versions for offsets. + bool VerifyOffset(const Verifier &verifier, voffset_t field) const { + auto field_offset = GetOptionalFieldOffset(field); + return !field_offset || verifier.VerifyOffset(data_, field_offset); + } + + bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const { + auto field_offset = GetOptionalFieldOffset(field); + return verifier.Check(field_offset != 0) && + verifier.VerifyOffset(data_, field_offset); + } + + private: + // private constructor & copy constructor: you obtain instances of this + // class by pointing to existing data only + Table(); + Table(const Table &other); + Table &operator=(const Table &); + + uint8_t data_[1]; +}; + +// This specialization allows avoiding warnings like: +// MSVC C4800: type: forcing value to bool 'true' or 'false'. +template<> +inline flatbuffers::Optional Table::GetOptional( + voffset_t field) const { + auto field_offset = GetOptionalFieldOffset(field); + auto p = data_ + field_offset; + return field_offset ? Optional(ReadScalar(p) != 0) + : Optional(); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_TABLE_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/util.h b/cpp-client/deephaven/client/third_party/flatbuffers/util.h new file mode 100644 index 00000000000..200f27a3eba --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/util.h @@ -0,0 +1,690 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_UTIL_H_ +#define FLATBUFFERS_UTIL_H_ + +#include +#include + +#include "flatbuffers/base.h" +#include "flatbuffers/stl_emulation.h" + +#ifndef FLATBUFFERS_PREFER_PRINTF +# include +# include +#else // FLATBUFFERS_PREFER_PRINTF +# include +# include +#endif // FLATBUFFERS_PREFER_PRINTF + +#include + +namespace deephaven::third_party::flatbuffers { + +// @locale-independent functions for ASCII characters set. + +// Fast checking that character lies in closed range: [a <= x <= b] +// using one compare (conditional branch) operator. +inline bool check_ascii_range(char x, char a, char b) { + FLATBUFFERS_ASSERT(a <= b); + // (Hacker's Delight): `a <= x <= b` <=> `(x-a) <={u} (b-a)`. + // The x, a, b will be promoted to int and subtracted without overflow. + return static_cast(x - a) <= static_cast(b - a); +} + +// Case-insensitive isalpha +inline bool is_alpha(char c) { + // ASCII only: alpha to upper case => reset bit 0x20 (~0x20 = 0xDF). + return check_ascii_range(c & 0xDF, 'a' & 0xDF, 'z' & 0xDF); +} + +// Check for uppercase alpha +inline bool is_alpha_upper(char c) { return check_ascii_range(c, 'A', 'Z'); } + +// Check (case-insensitive) that `c` is equal to alpha. +inline bool is_alpha_char(char c, char alpha) { + FLATBUFFERS_ASSERT(is_alpha(alpha)); + // ASCII only: alpha to upper case => reset bit 0x20 (~0x20 = 0xDF). + return ((c & 0xDF) == (alpha & 0xDF)); +} + +// https://en.cppreference.com/w/cpp/string/byte/isxdigit +// isdigit and isxdigit are the only standard narrow character classification +// functions that are not affected by the currently installed C locale. although +// some implementations (e.g. Microsoft in 1252 codepage) may classify +// additional single-byte characters as digits. +inline bool is_digit(char c) { return check_ascii_range(c, '0', '9'); } + +inline bool is_xdigit(char c) { + // Replace by look-up table. + return is_digit(c) || check_ascii_range(c & 0xDF, 'a' & 0xDF, 'f' & 0xDF); +} + +// Case-insensitive isalnum +inline bool is_alnum(char c) { return is_alpha(c) || is_digit(c); } + +inline char CharToUpper(char c) { + return static_cast(::toupper(static_cast(c))); +} + +inline char CharToLower(char c) { + return static_cast(::tolower(static_cast(c))); +} + +// @end-locale-independent functions for ASCII character set + +#ifdef FLATBUFFERS_PREFER_PRINTF +template size_t IntToDigitCount(T t) { + size_t digit_count = 0; + // Count the sign for negative numbers + if (t < 0) digit_count++; + // Count a single 0 left of the dot for fractional numbers + if (-1 < t && t < 1) digit_count++; + // Count digits until fractional part + T eps = std::numeric_limits::epsilon(); + while (t <= (-1 + eps) || (1 - eps) <= t) { + t /= 10; + digit_count++; + } + return digit_count; +} + +template size_t NumToStringWidth(T t, int precision = 0) { + size_t string_width = IntToDigitCount(t); + // Count the dot for floating point numbers + if (precision) string_width += (precision + 1); + return string_width; +} + +template +std::string NumToStringImplWrapper(T t, const char *fmt, int precision = 0) { + size_t string_width = NumToStringWidth(t, precision); + std::string s(string_width, 0x00); + // Allow snprintf to use std::string trailing null to detect buffer overflow + snprintf(const_cast(s.data()), (s.size() + 1), fmt, string_width, t); + return s; +} +#endif // FLATBUFFERS_PREFER_PRINTF + +// Convert an integer or floating point value to a string. +// In contrast to std::stringstream, "char" values are +// converted to a string of digits, and we don't use scientific notation. +template std::string NumToString(T t) { + // clang-format off + + #ifndef FLATBUFFERS_PREFER_PRINTF + std::stringstream ss; + ss << t; + return ss.str(); + #else // FLATBUFFERS_PREFER_PRINTF + auto v = static_cast(t); + return NumToStringImplWrapper(v, "%.*lld"); + #endif // FLATBUFFERS_PREFER_PRINTF + // clang-format on +} +// Avoid char types used as character data. +template<> inline std::string NumToString(signed char t) { + return NumToString(static_cast(t)); +} +template<> inline std::string NumToString(unsigned char t) { + return NumToString(static_cast(t)); +} +template<> inline std::string NumToString(char t) { + return NumToString(static_cast(t)); +} + +// Special versions for floats/doubles. +template std::string FloatToString(T t, int precision) { + // clang-format off + + #ifndef FLATBUFFERS_PREFER_PRINTF + // to_string() prints different numbers of digits for floats depending on + // platform and isn't available on Android, so we use stringstream + std::stringstream ss; + // Use std::fixed to suppress scientific notation. + ss << std::fixed; + // Default precision is 6, we want that to be higher for doubles. + ss << std::setprecision(precision); + ss << t; + auto s = ss.str(); + #else // FLATBUFFERS_PREFER_PRINTF + auto v = static_cast(t); + auto s = NumToStringImplWrapper(v, "%0.*f", precision); + #endif // FLATBUFFERS_PREFER_PRINTF + // clang-format on + // Sadly, std::fixed turns "1" into "1.00000", so here we undo that. + auto p = s.find_last_not_of('0'); + if (p != std::string::npos) { + // Strip trailing zeroes. If it is a whole number, keep one zero. + s.resize(p + (s[p] == '.' ? 2 : 1)); + } + return s; +} + +template<> inline std::string NumToString(double t) { + return FloatToString(t, 12); +} +template<> inline std::string NumToString(float t) { + return FloatToString(t, 6); +} + +// Convert an integer value to a hexadecimal string. +// The returned string length is always xdigits long, prefixed by 0 digits. +// For example, IntToStringHex(0x23, 8) returns the string "00000023". +inline std::string IntToStringHex(int i, int xdigits) { + FLATBUFFERS_ASSERT(i >= 0); + // clang-format off + + #ifndef FLATBUFFERS_PREFER_PRINTF + std::stringstream ss; + ss << std::setw(xdigits) << std::setfill('0') << std::hex << std::uppercase + << i; + return ss.str(); + #else // FLATBUFFERS_PREFER_PRINTF + return NumToStringImplWrapper(i, "%.*X", xdigits); + #endif // FLATBUFFERS_PREFER_PRINTF + // clang-format on +} + +// clang-format off +// Use locale independent functions {strtod_l, strtof_l, strtoll_l, strtoull_l}. +#if defined(FLATBUFFERS_LOCALE_INDEPENDENT) && (FLATBUFFERS_LOCALE_INDEPENDENT > 0) + class ClassicLocale { + #ifdef _MSC_VER + typedef _locale_t locale_type; + #else + typedef locale_t locale_type; // POSIX.1-2008 locale_t type + #endif + ClassicLocale(); + ~ClassicLocale(); + locale_type locale_; + static ClassicLocale instance_; + public: + static locale_type Get() { return instance_.locale_; } + }; + + #ifdef _MSC_VER + #define __strtoull_impl(s, pe, b) _strtoui64_l(s, pe, b, ClassicLocale::Get()) + #define __strtoll_impl(s, pe, b) _strtoi64_l(s, pe, b, ClassicLocale::Get()) + #define __strtod_impl(s, pe) _strtod_l(s, pe, ClassicLocale::Get()) + #define __strtof_impl(s, pe) _strtof_l(s, pe, ClassicLocale::Get()) + #else + #define __strtoull_impl(s, pe, b) strtoull_l(s, pe, b, ClassicLocale::Get()) + #define __strtoll_impl(s, pe, b) strtoll_l(s, pe, b, ClassicLocale::Get()) + #define __strtod_impl(s, pe) strtod_l(s, pe, ClassicLocale::Get()) + #define __strtof_impl(s, pe) strtof_l(s, pe, ClassicLocale::Get()) + #endif +#else + #define __strtod_impl(s, pe) strtod(s, pe) + #define __strtof_impl(s, pe) static_cast(strtod(s, pe)) + #ifdef _MSC_VER + #define __strtoull_impl(s, pe, b) _strtoui64(s, pe, b) + #define __strtoll_impl(s, pe, b) _strtoi64(s, pe, b) + #else + #define __strtoull_impl(s, pe, b) strtoull(s, pe, b) + #define __strtoll_impl(s, pe, b) strtoll(s, pe, b) + #endif +#endif + +inline void strtoval_impl(int64_t *val, const char *str, char **endptr, + int base) { + *val = __strtoll_impl(str, endptr, base); +} + +inline void strtoval_impl(uint64_t *val, const char *str, char **endptr, + int base) { + *val = __strtoull_impl(str, endptr, base); +} + +inline void strtoval_impl(double *val, const char *str, char **endptr) { + *val = __strtod_impl(str, endptr); +} + +// UBSAN: double to float is safe if numeric_limits::is_iec559 is true. +__supress_ubsan__("float-cast-overflow") +inline void strtoval_impl(float *val, const char *str, char **endptr) { + *val = __strtof_impl(str, endptr); +} +#undef __strtoull_impl +#undef __strtoll_impl +#undef __strtod_impl +#undef __strtof_impl +// clang-format on + +// Adaptor for strtoull()/strtoll(). +// Flatbuffers accepts numbers with any count of leading zeros (-009 is -9), +// while strtoll with base=0 interprets first leading zero as octal prefix. +// In future, it is possible to add prefixed 0b0101. +// 1) Checks errno code for overflow condition (out of range). +// 2) If base <= 0, function try to detect base of number by prefix. +// +// Return value (like strtoull and strtoll, but reject partial result): +// - If successful, an integer value corresponding to the str is returned. +// - If full string conversion can't be performed, 0 is returned. +// - If the converted value falls out of range of corresponding return type, a +// range error occurs. In this case value MAX(T)/MIN(T) is returned. +template +inline bool StringToIntegerImpl(T *val, const char *const str, + const int base = 0, + const bool check_errno = true) { + // T is int64_t or uint64_T + FLATBUFFERS_ASSERT(str); + if (base <= 0) { + auto s = str; + while (*s && !is_digit(*s)) s++; + if (s[0] == '0' && is_alpha_char(s[1], 'X')) + return StringToIntegerImpl(val, str, 16, check_errno); + // if a prefix not match, try base=10 + return StringToIntegerImpl(val, str, 10, check_errno); + } else { + if (check_errno) errno = 0; // clear thread-local errno + auto endptr = str; + strtoval_impl(val, str, const_cast(&endptr), base); + if ((*endptr != '\0') || (endptr == str)) { + *val = 0; // erase partial result + return false; // invalid string + } + // errno is out-of-range, return MAX/MIN + if (check_errno && errno) return false; + return true; + } +} + +template +inline bool StringToFloatImpl(T *val, const char *const str) { + // Type T must be either float or double. + FLATBUFFERS_ASSERT(str && val); + auto end = str; + strtoval_impl(val, str, const_cast(&end)); + auto done = (end != str) && (*end == '\0'); + if (!done) *val = 0; // erase partial result + return done; +} + +// Convert a string to an instance of T. +// Return value (matched with StringToInteger64Impl and strtod): +// - If successful, a numeric value corresponding to the str is returned. +// - If full string conversion can't be performed, 0 is returned. +// - If the converted value falls out of range of corresponding return type, a +// range error occurs. In this case value MAX(T)/MIN(T) is returned. +template inline bool StringToNumber(const char *s, T *val) { + // Assert on `unsigned long` and `signed long` on LP64. + // If it is necessary, it could be solved with flatbuffers::enable_if. + static_assert(sizeof(T) < sizeof(int64_t), "unexpected type T"); + FLATBUFFERS_ASSERT(s && val); + int64_t i64; + // The errno check isn't needed, will return MAX/MIN on overflow. + if (StringToIntegerImpl(&i64, s, 0, false)) { + const int64_t max = (flatbuffers::numeric_limits::max)(); + const int64_t min = flatbuffers::numeric_limits::lowest(); + if (i64 > max) { + *val = static_cast(max); + return false; + } + if (i64 < min) { + // For unsigned types return max to distinguish from + // "no conversion can be performed" when 0 is returned. + *val = static_cast(flatbuffers::is_unsigned::value ? max : min); + return false; + } + *val = static_cast(i64); + return true; + } + *val = 0; + return false; +} + +template<> inline bool StringToNumber(const char *str, int64_t *val) { + return StringToIntegerImpl(val, str); +} + +template<> +inline bool StringToNumber(const char *str, uint64_t *val) { + if (!StringToIntegerImpl(val, str)) return false; + // The strtoull accepts negative numbers: + // If the minus sign was part of the input sequence, the numeric value + // calculated from the sequence of digits is negated as if by unary minus + // in the result type, which applies unsigned integer wraparound rules. + // Fix this behaviour (except -0). + if (*val) { + auto s = str; + while (*s && !is_digit(*s)) s++; + s = (s > str) ? (s - 1) : s; // step back to one symbol + if (*s == '-') { + // For unsigned types return the max to distinguish from + // "no conversion can be performed". + *val = (flatbuffers::numeric_limits::max)(); + return false; + } + } + return true; +} + +template<> inline bool StringToNumber(const char *s, float *val) { + return StringToFloatImpl(val, s); +} + +template<> inline bool StringToNumber(const char *s, double *val) { + return StringToFloatImpl(val, s); +} + +inline int64_t StringToInt(const char *s, int base = 10) { + int64_t val; + return StringToIntegerImpl(&val, s, base) ? val : 0; +} + +inline uint64_t StringToUInt(const char *s, int base = 10) { + uint64_t val; + return StringToIntegerImpl(&val, s, base) ? val : 0; +} + +typedef bool (*LoadFileFunction)(const char *filename, bool binary, + std::string *dest); +typedef bool (*FileExistsFunction)(const char *filename); + +LoadFileFunction SetLoadFileFunction(LoadFileFunction load_file_function); + +FileExistsFunction SetFileExistsFunction( + FileExistsFunction file_exists_function); + +// Check if file "name" exists. +bool FileExists(const char *name); + +// Check if "name" exists and it is also a directory. +bool DirExists(const char *name); + +// Load file "name" into "buf" returning true if successful +// false otherwise. If "binary" is false data is read +// using ifstream's text mode, otherwise data is read with +// no transcoding. +bool LoadFile(const char *name, bool binary, std::string *buf); + +// Save data "buf" of length "len" bytes into a file +// "name" returning true if successful, false otherwise. +// If "binary" is false data is written using ifstream's +// text mode, otherwise data is written with no +// transcoding. +bool SaveFile(const char *name, const char *buf, size_t len, bool binary); + +// Save data "buf" into file "name" returning true if +// successful, false otherwise. If "binary" is false +// data is written using ifstream's text mode, otherwise +// data is written with no transcoding. +inline bool SaveFile(const char *name, const std::string &buf, bool binary) { + return SaveFile(name, buf.c_str(), buf.size(), binary); +} + +// Functionality for minimalistic portable path handling. + +// The functions below behave correctly regardless of whether posix ('/') or +// Windows ('/' or '\\') separators are used. + +// Any new separators inserted are always posix. +FLATBUFFERS_CONSTEXPR char kPathSeparator = '/'; + +// Returns the path with the extension, if any, removed. +std::string StripExtension(const std::string &filepath); + +// Returns the extension, if any. +std::string GetExtension(const std::string &filepath); + +// Return the last component of the path, after the last separator. +std::string StripPath(const std::string &filepath); + +// Strip the last component of the path + separator. +std::string StripFileName(const std::string &filepath); + +// Concatenates a path with a filename, regardless of whether the path +// ends in a separator or not. +std::string ConCatPathFileName(const std::string &path, + const std::string &filename); + +// Replaces any '\\' separators with '/' +std::string PosixPath(const char *path); +std::string PosixPath(const std::string &path); + +// This function ensure a directory exists, by recursively +// creating dirs for any parts of the path that don't exist yet. +void EnsureDirExists(const std::string &filepath); + +// Obtains the absolute path from any other path. +// Returns the input path if the absolute path couldn't be resolved. +std::string AbsolutePath(const std::string &filepath); + +// Returns files relative to the --project_root path, prefixed with `//`. +std::string RelativeToRootPath(const std::string &project, + const std::string &filepath); + +// To and from UTF-8 unicode conversion functions + +// Convert a unicode code point into a UTF-8 representation by appending it +// to a string. Returns the number of bytes generated. +inline int ToUTF8(uint32_t ucc, std::string *out) { + FLATBUFFERS_ASSERT(!(ucc & 0x80000000)); // Top bit can't be set. + // 6 possible encodings: http://en.wikipedia.org/wiki/UTF-8 + for (int i = 0; i < 6; i++) { + // Max bits this encoding can represent. + uint32_t max_bits = 6 + i * 5 + static_cast(!i); + if (ucc < (1u << max_bits)) { // does it fit? + // Remaining bits not encoded in the first byte, store 6 bits each + uint32_t remain_bits = i * 6; + // Store first byte: + (*out) += static_cast((0xFE << (max_bits - remain_bits)) | + (ucc >> remain_bits)); + // Store remaining bytes: + for (int j = i - 1; j >= 0; j--) { + (*out) += static_cast(((ucc >> (j * 6)) & 0x3F) | 0x80); + } + return i + 1; // Return the number of bytes added. + } + } + FLATBUFFERS_ASSERT(0); // Impossible to arrive here. + return -1; +} + +// Converts whatever prefix of the incoming string corresponds to a valid +// UTF-8 sequence into a unicode code. The incoming pointer will have been +// advanced past all bytes parsed. +// returns -1 upon corrupt UTF-8 encoding (ignore the incoming pointer in +// this case). +inline int FromUTF8(const char **in) { + int len = 0; + // Count leading 1 bits. + for (int mask = 0x80; mask >= 0x04; mask >>= 1) { + if (**in & mask) { + len++; + } else { + break; + } + } + if ((static_cast(**in) << len) & 0x80) + return -1; // Bit after leading 1's must be 0. + if (!len) return *(*in)++; + // UTF-8 encoded values with a length are between 2 and 4 bytes. + if (len < 2 || len > 4) { return -1; } + // Grab initial bits of the code. + int ucc = *(*in)++ & ((1 << (7 - len)) - 1); + for (int i = 0; i < len - 1; i++) { + if ((**in & 0xC0) != 0x80) return -1; // Upper bits must 1 0. + ucc <<= 6; + ucc |= *(*in)++ & 0x3F; // Grab 6 more bits of the code. + } + // UTF-8 cannot encode values between 0xD800 and 0xDFFF (reserved for + // UTF-16 surrogate pairs). + if (ucc >= 0xD800 && ucc <= 0xDFFF) { return -1; } + // UTF-8 must represent code points in their shortest possible encoding. + switch (len) { + case 2: + // Two bytes of UTF-8 can represent code points from U+0080 to U+07FF. + if (ucc < 0x0080 || ucc > 0x07FF) { return -1; } + break; + case 3: + // Three bytes of UTF-8 can represent code points from U+0800 to U+FFFF. + if (ucc < 0x0800 || ucc > 0xFFFF) { return -1; } + break; + case 4: + // Four bytes of UTF-8 can represent code points from U+10000 to U+10FFFF. + if (ucc < 0x10000 || ucc > 0x10FFFF) { return -1; } + break; + } + return ucc; +} + +#ifndef FLATBUFFERS_PREFER_PRINTF +// Wraps a string to a maximum length, inserting new lines where necessary. Any +// existing whitespace will be collapsed down to a single space. A prefix or +// suffix can be provided, which will be inserted before or after a wrapped +// line, respectively. +inline std::string WordWrap(const std::string in, size_t max_length, + const std::string wrapped_line_prefix, + const std::string wrapped_line_suffix) { + std::istringstream in_stream(in); + std::string wrapped, line, word; + + in_stream >> word; + line = word; + + while (in_stream >> word) { + if ((line.length() + 1 + word.length() + wrapped_line_suffix.length()) < + max_length) { + line += " " + word; + } else { + wrapped += line + wrapped_line_suffix + "\n"; + line = wrapped_line_prefix + word; + } + } + wrapped += line; + + return wrapped; +} +#endif // !FLATBUFFERS_PREFER_PRINTF + +inline bool EscapeString(const char *s, size_t length, std::string *_text, + bool allow_non_utf8, bool natural_utf8) { + std::string &text = *_text; + text += "\""; + for (uoffset_t i = 0; i < length; i++) { + char c = s[i]; + switch (c) { + case '\n': text += "\\n"; break; + case '\t': text += "\\t"; break; + case '\r': text += "\\r"; break; + case '\b': text += "\\b"; break; + case '\f': text += "\\f"; break; + case '\"': text += "\\\""; break; + case '\\': text += "\\\\"; break; + default: + if (c >= ' ' && c <= '~') { + text += c; + } else { + // Not printable ASCII data. Let's see if it's valid UTF-8 first: + const char *utf8 = s + i; + int ucc = FromUTF8(&utf8); + if (ucc < 0) { + if (allow_non_utf8) { + text += "\\x"; + text += IntToStringHex(static_cast(c), 2); + } else { + // There are two cases here: + // + // 1) We reached here by parsing an IDL file. In that case, + // we previously checked for non-UTF-8, so we shouldn't reach + // here. + // + // 2) We reached here by someone calling GenerateText() + // on a previously-serialized flatbuffer. The data might have + // non-UTF-8 Strings, or might be corrupt. + // + // In both cases, we have to give up and inform the caller + // they have no JSON. + return false; + } + } else { + if (natural_utf8) { + // utf8 points to past all utf-8 bytes parsed + text.append(s + i, static_cast(utf8 - s - i)); + } else if (ucc <= 0xFFFF) { + // Parses as Unicode within JSON's \uXXXX range, so use that. + text += "\\u"; + text += IntToStringHex(ucc, 4); + } else if (ucc <= 0x10FFFF) { + // Encode Unicode SMP values to a surrogate pair using two \u + // escapes. + uint32_t base = ucc - 0x10000; + auto high_surrogate = (base >> 10) + 0xD800; + auto low_surrogate = (base & 0x03FF) + 0xDC00; + text += "\\u"; + text += IntToStringHex(high_surrogate, 4); + text += "\\u"; + text += IntToStringHex(low_surrogate, 4); + } + // Skip past characters recognized. + i = static_cast(utf8 - s - 1); + } + } + break; + } + } + text += "\""; + return true; +} + +inline std::string BufferToHexText(const void *buffer, size_t buffer_size, + size_t max_length, + const std::string &wrapped_line_prefix, + const std::string &wrapped_line_suffix) { + std::string text = wrapped_line_prefix; + size_t start_offset = 0; + const char *s = reinterpret_cast(buffer); + for (size_t i = 0; s && i < buffer_size; i++) { + // Last iteration or do we have more? + bool have_more = i + 1 < buffer_size; + text += "0x"; + text += IntToStringHex(static_cast(s[i]), 2); + if (have_more) { text += ','; } + // If we have more to process and we reached max_length + if (have_more && + text.size() + wrapped_line_suffix.size() >= start_offset + max_length) { + text += wrapped_line_suffix; + text += '\n'; + start_offset = text.size(); + text += wrapped_line_prefix; + } + } + text += wrapped_line_suffix; + return text; +} + +// Remove paired quotes in a string: "text"|'text' -> text. +std::string RemoveStringQuotes(const std::string &s); + +// Change th global C-locale to locale with name . +// Returns an actual locale name in <_value>, useful if locale_name is "" or +// null. +bool SetGlobalTestLocale(const char *locale_name, + std::string *_value = nullptr); + +// Read (or test) a value of environment variable. +bool ReadEnvironmentVariable(const char *var_name, + std::string *_value = nullptr); + +// MSVC specific: Send all assert reports to STDOUT to prevent CI hangs. +void SetupDefaultCRTReportMode(); + +} // namespace flatbuffers + +#endif // FLATBUFFERS_UTIL_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector.h b/cpp-client/deephaven/client/third_party/flatbuffers/vector.h new file mode 100644 index 00000000000..d15c232127d --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/vector.h @@ -0,0 +1,370 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_VECTOR_H_ +#define FLATBUFFERS_VECTOR_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/buffer.h" + +namespace deephaven::third_party::flatbuffers { + +struct String; + +// An STL compatible iterator implementation for Vector below, effectively +// calling Get() for every element. +template struct VectorIterator { + typedef std::random_access_iterator_tag iterator_category; + typedef IT value_type; + typedef ptrdiff_t difference_type; + typedef IT *pointer; + typedef IT &reference; + + VectorIterator(const uint8_t *data, uoffset_t i) + : data_(data + IndirectHelper::element_stride * i) {} + VectorIterator(const VectorIterator &other) : data_(other.data_) {} + VectorIterator() : data_(nullptr) {} + + VectorIterator &operator=(const VectorIterator &other) { + data_ = other.data_; + return *this; + } + + VectorIterator &operator=(VectorIterator &&other) { + data_ = other.data_; + return *this; + } + + bool operator==(const VectorIterator &other) const { + return data_ == other.data_; + } + + bool operator<(const VectorIterator &other) const { + return data_ < other.data_; + } + + bool operator!=(const VectorIterator &other) const { + return data_ != other.data_; + } + + difference_type operator-(const VectorIterator &other) const { + return (data_ - other.data_) / IndirectHelper::element_stride; + } + + // Note: return type is incompatible with the standard + // `reference operator*()`. + IT operator*() const { return IndirectHelper::Read(data_, 0); } + + // Note: return type is incompatible with the standard + // `pointer operator->()`. + IT operator->() const { return IndirectHelper::Read(data_, 0); } + + VectorIterator &operator++() { + data_ += IndirectHelper::element_stride; + return *this; + } + + VectorIterator operator++(int) { + VectorIterator temp(data_, 0); + data_ += IndirectHelper::element_stride; + return temp; + } + + VectorIterator operator+(const uoffset_t &offset) const { + return VectorIterator(data_ + offset * IndirectHelper::element_stride, + 0); + } + + VectorIterator &operator+=(const uoffset_t &offset) { + data_ += offset * IndirectHelper::element_stride; + return *this; + } + + VectorIterator &operator--() { + data_ -= IndirectHelper::element_stride; + return *this; + } + + VectorIterator operator--(int) { + VectorIterator temp(data_, 0); + data_ -= IndirectHelper::element_stride; + return temp; + } + + VectorIterator operator-(const uoffset_t &offset) const { + return VectorIterator(data_ - offset * IndirectHelper::element_stride, + 0); + } + + VectorIterator &operator-=(const uoffset_t &offset) { + data_ -= offset * IndirectHelper::element_stride; + return *this; + } + + private: + const uint8_t *data_; +}; + +template +struct VectorReverseIterator : public std::reverse_iterator { + explicit VectorReverseIterator(Iterator iter) + : std::reverse_iterator(iter) {} + + // Note: return type is incompatible with the standard + // `reference operator*()`. + typename Iterator::value_type operator*() const { + auto tmp = std::reverse_iterator::current; + return *--tmp; + } + + // Note: return type is incompatible with the standard + // `pointer operator->()`. + typename Iterator::value_type operator->() const { + auto tmp = std::reverse_iterator::current; + return *--tmp; + } +}; + +// This is used as a helper type for accessing vectors. +// Vector::data() assumes the vector elements start after the length field. +template class Vector { + public: + typedef VectorIterator::mutable_return_type> + iterator; + typedef VectorIterator::return_type> + const_iterator; + typedef VectorReverseIterator reverse_iterator; + typedef VectorReverseIterator const_reverse_iterator; + + typedef typename flatbuffers::bool_constant::value> + scalar_tag; + + static FLATBUFFERS_CONSTEXPR bool is_span_observable = + scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1); + + uoffset_t size() const { return EndianScalar(length_); } + + // Deprecated: use size(). Here for backwards compatibility. + FLATBUFFERS_ATTRIBUTE([[deprecated("use size() instead")]]) + uoffset_t Length() const { return size(); } + + typedef typename IndirectHelper::return_type return_type; + typedef typename IndirectHelper::mutable_return_type mutable_return_type; + typedef return_type value_type; + + return_type Get(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return IndirectHelper::Read(Data(), i); + } + + return_type operator[](uoffset_t i) const { return Get(i); } + + // If this is a Vector of enums, T will be its storage type, not the enum + // type. This function makes it convenient to retrieve value with enum + // type E. + template E GetEnum(uoffset_t i) const { + return static_cast(Get(i)); + } + + // If this a vector of unions, this does the cast for you. There's no check + // to make sure this is the right type! + template const U *GetAs(uoffset_t i) const { + return reinterpret_cast(Get(i)); + } + + // If this a vector of unions, this does the cast for you. There's no check + // to make sure this is actually a string! + const String *GetAsString(uoffset_t i) const { + return reinterpret_cast(Get(i)); + } + + const void *GetStructFromOffset(size_t o) const { + return reinterpret_cast(Data() + o); + } + + iterator begin() { return iterator(Data(), 0); } + const_iterator begin() const { return const_iterator(Data(), 0); } + + iterator end() { return iterator(Data(), size()); } + const_iterator end() const { return const_iterator(Data(), size()); } + + reverse_iterator rbegin() { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + + reverse_iterator rend() { return reverse_iterator(begin()); } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + + const_iterator cbegin() const { return begin(); } + + const_iterator cend() const { return end(); } + + const_reverse_iterator crbegin() const { return rbegin(); } + + const_reverse_iterator crend() const { return rend(); } + + // Change elements if you have a non-const pointer to this object. + // Scalars only. See reflection.h, and the documentation. + void Mutate(uoffset_t i, const T &val) { + FLATBUFFERS_ASSERT(i < size()); + WriteScalar(data() + i, val); + } + + // Change an element of a vector of tables (or strings). + // "val" points to the new table/string, as you can obtain from + // e.g. reflection::AddFlatBuffer(). + void MutateOffset(uoffset_t i, const uint8_t *val) { + FLATBUFFERS_ASSERT(i < size()); + static_assert(sizeof(T) == sizeof(uoffset_t), "Unrelated types"); + WriteScalar(data() + i, + static_cast(val - (Data() + i * sizeof(uoffset_t)))); + } + + // Get a mutable pointer to tables/strings inside this vector. + mutable_return_type GetMutableObject(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return const_cast(IndirectHelper::Read(Data(), i)); + } + + // The raw data in little endian format. Use with care. + const uint8_t *Data() const { + return reinterpret_cast(&length_ + 1); + } + + uint8_t *Data() { return reinterpret_cast(&length_ + 1); } + + // Similarly, but typed, much like std::vector::data + const T *data() const { return reinterpret_cast(Data()); } + T *data() { return reinterpret_cast(Data()); } + + template return_type LookupByKey(K key) const { + void *search_result = std::bsearch( + &key, Data(), size(), IndirectHelper::element_stride, KeyCompare); + + if (!search_result) { + return nullptr; // Key not found. + } + + const uint8_t *element = reinterpret_cast(search_result); + + return IndirectHelper::Read(element, 0); + } + + template mutable_return_type MutableLookupByKey(K key) { + return const_cast(LookupByKey(key)); + } + + protected: + // This class is only used to access pre-existing data. Don't ever + // try to construct these manually. + Vector(); + + uoffset_t length_; + + private: + // This class is a pointer. Copying will therefore create an invalid object. + // Private and unimplemented copy constructor. + Vector(const Vector &); + Vector &operator=(const Vector &); + + template static int KeyCompare(const void *ap, const void *bp) { + const K *key = reinterpret_cast(ap); + const uint8_t *data = reinterpret_cast(bp); + auto table = IndirectHelper::Read(data, 0); + + // std::bsearch compares with the operands transposed, so we negate the + // result here. + return -table->KeyCompareWithValue(*key); + } +}; + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Vector &vec) + FLATBUFFERS_NOEXCEPT { + static_assert(Vector::is_span_observable, + "wrong type U, only LE-scalar, or byte types are allowed"); + return span(vec.data(), vec.size()); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( + const Vector &vec) FLATBUFFERS_NOEXCEPT { + static_assert(Vector::is_span_observable, + "wrong type U, only LE-scalar, or byte types are allowed"); + return span(vec.data(), vec.size()); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_bytes_span( + Vector &vec) FLATBUFFERS_NOEXCEPT { + static_assert(Vector::scalar_tag::value, + "wrong type U, only LE-scalar, or byte types are allowed"); + return span(vec.Data(), vec.size() * sizeof(U)); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_bytes_span( + const Vector &vec) FLATBUFFERS_NOEXCEPT { + static_assert(Vector::scalar_tag::value, + "wrong type U, only LE-scalar, or byte types are allowed"); + return span(vec.Data(), vec.size() * sizeof(U)); +} + +// Represent a vector much like the template above, but in this case we +// don't know what the element types are (used with reflection.h). +class VectorOfAny { + public: + uoffset_t size() const { return EndianScalar(length_); } + + const uint8_t *Data() const { + return reinterpret_cast(&length_ + 1); + } + uint8_t *Data() { return reinterpret_cast(&length_ + 1); } + + protected: + VectorOfAny(); + + uoffset_t length_; + + private: + VectorOfAny(const VectorOfAny &); + VectorOfAny &operator=(const VectorOfAny &); +}; + +template +Vector> *VectorCast(Vector> *ptr) { + static_assert(std::is_base_of::value, "Unrelated types"); + return reinterpret_cast> *>(ptr); +} + +template +const Vector> *VectorCast(const Vector> *ptr) { + static_assert(std::is_base_of::value, "Unrelated types"); + return reinterpret_cast> *>(ptr); +} + +// Convenient helper function to get the length of any vector, regardless +// of whether it is null or not (the field is not set). +template static inline size_t VectorLength(const Vector *v) { + return v ? v->size() : 0; +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_VERIFIER_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h b/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h new file mode 100644 index 00000000000..7d719ced46d --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h @@ -0,0 +1,271 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_VECTOR_DOWNWARD_H_ +#define FLATBUFFERS_VECTOR_DOWNWARD_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/default_allocator.h" +#include "flatbuffers/detached_buffer.h" + +namespace deephaven::third_party::flatbuffers { + +// This is a minimal replication of std::vector functionality, +// except growing from higher to lower addresses. i.e push_back() inserts data +// in the lowest address in the vector. +// Since this vector leaves the lower part unused, we support a "scratch-pad" +// that can be stored there for temporary data, to share the allocated space. +// Essentially, this supports 2 std::vectors in a single buffer. +class vector_downward { + public: + explicit vector_downward(size_t initial_size, Allocator *allocator, + bool own_allocator, size_t buffer_minalign) + : allocator_(allocator), + own_allocator_(own_allocator), + initial_size_(initial_size), + buffer_minalign_(buffer_minalign), + reserved_(0), + size_(0), + buf_(nullptr), + cur_(nullptr), + scratch_(nullptr) {} + + vector_downward(vector_downward &&other) + // clang-format on + : allocator_(other.allocator_), + own_allocator_(other.own_allocator_), + initial_size_(other.initial_size_), + buffer_minalign_(other.buffer_minalign_), + reserved_(other.reserved_), + size_(other.size_), + buf_(other.buf_), + cur_(other.cur_), + scratch_(other.scratch_) { + // No change in other.allocator_ + // No change in other.initial_size_ + // No change in other.buffer_minalign_ + other.own_allocator_ = false; + other.reserved_ = 0; + other.buf_ = nullptr; + other.cur_ = nullptr; + other.scratch_ = nullptr; + } + + vector_downward &operator=(vector_downward &&other) { + // Move construct a temporary and swap idiom + vector_downward temp(std::move(other)); + swap(temp); + return *this; + } + + ~vector_downward() { + clear_buffer(); + clear_allocator(); + } + + void reset() { + clear_buffer(); + clear(); + } + + void clear() { + if (buf_) { + cur_ = buf_ + reserved_; + } else { + reserved_ = 0; + cur_ = nullptr; + } + size_ = 0; + clear_scratch(); + } + + void clear_scratch() { scratch_ = buf_; } + + void clear_allocator() { + if (own_allocator_ && allocator_) { delete allocator_; } + allocator_ = nullptr; + own_allocator_ = false; + } + + void clear_buffer() { + if (buf_) Deallocate(allocator_, buf_, reserved_); + buf_ = nullptr; + } + + // Relinquish the pointer to the caller. + uint8_t *release_raw(size_t &allocated_bytes, size_t &offset) { + auto *buf = buf_; + allocated_bytes = reserved_; + offset = static_cast(cur_ - buf_); + + // release_raw only relinquishes the buffer ownership. + // Does not deallocate or reset the allocator. Destructor will do that. + buf_ = nullptr; + clear(); + return buf; + } + + // Relinquish the pointer to the caller. + DetachedBuffer release() { + // allocator ownership (if any) is transferred to DetachedBuffer. + DetachedBuffer fb(allocator_, own_allocator_, buf_, reserved_, cur_, + size()); + if (own_allocator_) { + allocator_ = nullptr; + own_allocator_ = false; + } + buf_ = nullptr; + clear(); + return fb; + } + + size_t ensure_space(size_t len) { + FLATBUFFERS_ASSERT(cur_ >= scratch_ && scratch_ >= buf_); + if (len > static_cast(cur_ - scratch_)) { reallocate(len); } + // Beyond this, signed offsets may not have enough range: + // (FlatBuffers > 2GB not supported). + FLATBUFFERS_ASSERT(size() < FLATBUFFERS_MAX_BUFFER_SIZE); + return len; + } + + inline uint8_t *make_space(size_t len) { + if (len) { + ensure_space(len); + cur_ -= len; + size_ += static_cast(len); + } + return cur_; + } + + // Returns nullptr if using the DefaultAllocator. + Allocator *get_custom_allocator() { return allocator_; } + + inline uoffset_t size() const { return size_; } + + uoffset_t scratch_size() const { + return static_cast(scratch_ - buf_); + } + + size_t capacity() const { return reserved_; } + + uint8_t *data() const { + FLATBUFFERS_ASSERT(cur_); + return cur_; + } + + uint8_t *scratch_data() const { + FLATBUFFERS_ASSERT(buf_); + return buf_; + } + + uint8_t *scratch_end() const { + FLATBUFFERS_ASSERT(scratch_); + return scratch_; + } + + uint8_t *data_at(size_t offset) const { return buf_ + reserved_ - offset; } + + void push(const uint8_t *bytes, size_t num) { + if (num > 0) { memcpy(make_space(num), bytes, num); } + } + + // Specialized version of push() that avoids memcpy call for small data. + template void push_small(const T &little_endian_t) { + make_space(sizeof(T)); + *reinterpret_cast(cur_) = little_endian_t; + } + + template void scratch_push_small(const T &t) { + ensure_space(sizeof(T)); + *reinterpret_cast(scratch_) = t; + scratch_ += sizeof(T); + } + + // fill() is most frequently called with small byte counts (<= 4), + // which is why we're using loops rather than calling memset. + void fill(size_t zero_pad_bytes) { + make_space(zero_pad_bytes); + for (size_t i = 0; i < zero_pad_bytes; i++) cur_[i] = 0; + } + + // Version for when we know the size is larger. + // Precondition: zero_pad_bytes > 0 + void fill_big(size_t zero_pad_bytes) { + memset(make_space(zero_pad_bytes), 0, zero_pad_bytes); + } + + void pop(size_t bytes_to_remove) { + cur_ += bytes_to_remove; + size_ -= static_cast(bytes_to_remove); + } + + void scratch_pop(size_t bytes_to_remove) { scratch_ -= bytes_to_remove; } + + void swap(vector_downward &other) { + using std::swap; + swap(allocator_, other.allocator_); + swap(own_allocator_, other.own_allocator_); + swap(initial_size_, other.initial_size_); + swap(buffer_minalign_, other.buffer_minalign_); + swap(reserved_, other.reserved_); + swap(size_, other.size_); + swap(buf_, other.buf_); + swap(cur_, other.cur_); + swap(scratch_, other.scratch_); + } + + void swap_allocator(vector_downward &other) { + using std::swap; + swap(allocator_, other.allocator_); + swap(own_allocator_, other.own_allocator_); + } + + private: + // You shouldn't really be copying instances of this class. + FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward &)); + FLATBUFFERS_DELETE_FUNC(vector_downward &operator=(const vector_downward &)); + + Allocator *allocator_; + bool own_allocator_; + size_t initial_size_; + size_t buffer_minalign_; + size_t reserved_; + uoffset_t size_; + uint8_t *buf_; + uint8_t *cur_; // Points at location between empty (below) and used (above). + uint8_t *scratch_; // Points to the end of the scratchpad in use. + + void reallocate(size_t len) { + auto old_reserved = reserved_; + auto old_size = size(); + auto old_scratch_size = scratch_size(); + reserved_ += + (std::max)(len, old_reserved ? old_reserved / 2 : initial_size_); + reserved_ = (reserved_ + buffer_minalign_ - 1) & ~(buffer_minalign_ - 1); + if (buf_) { + buf_ = ReallocateDownward(allocator_, buf_, old_reserved, reserved_, + old_size, old_scratch_size); + } else { + buf_ = Allocate(allocator_, reserved_); + } + cur_ = buf_ + reserved_ - old_size; + scratch_ = buf_ + old_scratch_size; + } +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_VECTOR_DOWNWARD_H_ diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h b/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h new file mode 100644 index 00000000000..1c170bd1077 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h @@ -0,0 +1,283 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_VERIFIER_H_ +#define FLATBUFFERS_VERIFIER_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/util.h" +#include "flatbuffers/vector.h" + +namespace deephaven::third_party::flatbuffers { + +// Helper class to verify the integrity of a FlatBuffer +class Verifier FLATBUFFERS_FINAL_CLASS { + public: + Verifier(const uint8_t *buf, size_t buf_len, uoffset_t _max_depth = 64, + uoffset_t _max_tables = 1000000, bool _check_alignment = true) + : buf_(buf), + size_(buf_len), + depth_(0), + max_depth_(_max_depth), + num_tables_(0), + max_tables_(_max_tables), + upper_bound_(0), + check_alignment_(_check_alignment), + flex_reuse_tracker_(nullptr) { + FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE); + } + + // Central location where any verification failures register. + bool Check(bool ok) const { + // clang-format off + #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE + FLATBUFFERS_ASSERT(ok); + #endif + #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + if (!ok) + upper_bound_ = 0; + #endif + // clang-format on + return ok; + } + + // Verify any range within the buffer. + bool Verify(size_t elem, size_t elem_len) const { + // clang-format off + #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + auto upper_bound = elem + elem_len; + if (upper_bound_ < upper_bound) + upper_bound_ = upper_bound; + #endif + // clang-format on + return Check(elem_len < size_ && elem <= size_ - elem_len); + } + + bool VerifyAlignment(size_t elem, size_t align) const { + return Check((elem & (align - 1)) == 0 || !check_alignment_); + } + + // Verify a range indicated by sizeof(T). + template bool Verify(size_t elem) const { + return VerifyAlignment(elem, sizeof(T)) && Verify(elem, sizeof(T)); + } + + bool VerifyFromPointer(const uint8_t *p, size_t len) { + auto o = static_cast(p - buf_); + return Verify(o, len); + } + + // Verify relative to a known-good base pointer. + bool VerifyFieldStruct(const uint8_t *base, voffset_t elem_off, + size_t elem_len, size_t align) const { + auto f = static_cast(base - buf_) + elem_off; + return VerifyAlignment(f, align) && Verify(f, elem_len); + } + + template + bool VerifyField(const uint8_t *base, voffset_t elem_off, + size_t align) const { + auto f = static_cast(base - buf_) + elem_off; + return VerifyAlignment(f, align) && Verify(f, sizeof(T)); + } + + // Verify a pointer (may be NULL) of a table type. + template bool VerifyTable(const T *table) { + return !table || table->Verify(*this); + } + + // Verify a pointer (may be NULL) of any vector type. + template bool VerifyVector(const Vector *vec) const { + return !vec || VerifyVectorOrString(reinterpret_cast(vec), + sizeof(T)); + } + + // Verify a pointer (may be NULL) of a vector to struct. + template bool VerifyVector(const Vector *vec) const { + return VerifyVector(reinterpret_cast *>(vec)); + } + + // Verify a pointer (may be NULL) to string. + bool VerifyString(const String *str) const { + size_t end; + return !str || (VerifyVectorOrString(reinterpret_cast(str), + 1, &end) && + Verify(end, 1) && // Must have terminator + Check(buf_[end] == '\0')); // Terminating byte must be 0. + } + + // Common code between vectors and strings. + bool VerifyVectorOrString(const uint8_t *vec, size_t elem_size, + size_t *end = nullptr) const { + auto veco = static_cast(vec - buf_); + // Check we can read the size field. + if (!Verify(veco)) return false; + // Check the whole array. If this is a string, the byte past the array + // must be 0. + auto size = ReadScalar(vec); + auto max_elems = FLATBUFFERS_MAX_BUFFER_SIZE / elem_size; + if (!Check(size < max_elems)) + return false; // Protect against byte_size overflowing. + auto byte_size = sizeof(size) + elem_size * size; + if (end) *end = veco + byte_size; + return Verify(veco, byte_size); + } + + // Special case for string contents, after the above has been called. + bool VerifyVectorOfStrings(const Vector> *vec) const { + if (vec) { + for (uoffset_t i = 0; i < vec->size(); i++) { + if (!VerifyString(vec->Get(i))) return false; + } + } + return true; + } + + // Special case for table contents, after the above has been called. + template bool VerifyVectorOfTables(const Vector> *vec) { + if (vec) { + for (uoffset_t i = 0; i < vec->size(); i++) { + if (!vec->Get(i)->Verify(*this)) return false; + } + } + return true; + } + + __supress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart( + const uint8_t *table) { + // Check the vtable offset. + auto tableo = static_cast(table - buf_); + if (!Verify(tableo)) return false; + // This offset may be signed, but doing the subtraction unsigned always + // gives the result we want. + auto vtableo = tableo - static_cast(ReadScalar(table)); + // Check the vtable size field, then check vtable fits in its entirety. + return VerifyComplexity() && Verify(vtableo) && + VerifyAlignment(ReadScalar(buf_ + vtableo), + sizeof(voffset_t)) && + Verify(vtableo, ReadScalar(buf_ + vtableo)); + } + + template + bool VerifyBufferFromStart(const char *identifier, size_t start) { + if (identifier && !Check((size_ >= 2 * sizeof(flatbuffers::uoffset_t) && + BufferHasIdentifier(buf_ + start, identifier)))) { + return false; + } + + // Call T::Verify, which must be in the generated code for this type. + auto o = VerifyOffset(start); + return o && reinterpret_cast(buf_ + start + o)->Verify(*this) + // clang-format off + #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + && GetComputedSize() + #endif + ; + // clang-format on + } + + template + bool VerifyNestedFlatBuffer(const Vector *buf, + const char *identifier) { + if (!buf) return true; + Verifier nested_verifier(buf->data(), buf->size()); + return nested_verifier.VerifyBuffer(identifier); + } + + // Verify this whole buffer, starting with root type T. + template bool VerifyBuffer() { return VerifyBuffer(nullptr); } + + template bool VerifyBuffer(const char *identifier) { + return VerifyBufferFromStart(identifier, 0); + } + + template bool VerifySizePrefixedBuffer(const char *identifier) { + return Verify(0U) && + ReadScalar(buf_) == size_ - sizeof(uoffset_t) && + VerifyBufferFromStart(identifier, sizeof(uoffset_t)); + } + + uoffset_t VerifyOffset(size_t start) const { + if (!Verify(start)) return 0; + auto o = ReadScalar(buf_ + start); + // May not point to itself. + if (!Check(o != 0)) return 0; + // Can't wrap around / buffers are max 2GB. + if (!Check(static_cast(o) >= 0)) return 0; + // Must be inside the buffer to create a pointer from it (pointer outside + // buffer is UB). + if (!Verify(start + o, 1)) return 0; + return o; + } + + uoffset_t VerifyOffset(const uint8_t *base, voffset_t start) const { + return VerifyOffset(static_cast(base - buf_) + start); + } + + // Called at the start of a table to increase counters measuring data + // structure depth and amount, and possibly bails out with false if + // limits set by the constructor have been hit. Needs to be balanced + // with EndTable(). + bool VerifyComplexity() { + depth_++; + num_tables_++; + return Check(depth_ <= max_depth_ && num_tables_ <= max_tables_); + } + + // Called at the end of a table to pop the depth count. + bool EndTable() { + depth_--; + return true; + } + + // Returns the message size in bytes + size_t GetComputedSize() const { + // clang-format off + #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + uintptr_t size = upper_bound_; + // Align the size to uoffset_t + size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1); + return (size > size_) ? 0 : size; + #else + // Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work. + (void)upper_bound_; + FLATBUFFERS_ASSERT(false); + return 0; + #endif + // clang-format on + } + + std::vector *GetFlexReuseTracker() { return flex_reuse_tracker_; } + + void SetFlexReuseTracker(std::vector *rt) { + flex_reuse_tracker_ = rt; + } + + private: + const uint8_t *buf_; + size_t size_; + uoffset_t depth_; + uoffset_t max_depth_; + uoffset_t num_tables_; + uoffset_t max_tables_; + mutable size_t upper_bound_; + bool check_alignment_; + std::vector *flex_reuse_tracker_; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_VERIFIER_H_ diff --git a/cpp-examples/build-all-examples/CMakeLists.txt b/cpp-examples/build-all-examples/CMakeLists.txt index 934610a0600..f4c529838b4 100644 --- a/cpp-examples/build-all-examples/CMakeLists.txt +++ b/cpp-examples/build-all-examples/CMakeLists.txt @@ -2,8 +2,10 @@ cmake_minimum_required(VERSION 3.16) project(build-all-examples) add_subdirectory(../cleanup cleanup_dir) +add_subdirectory(../compare_approaches compare_approaches_dir) add_subdirectory(../create_table_with_arrow_flight create_table_with_arrow_flight_dir) add_subdirectory(../create_table_with_table_maker create_table_with_table_maker_dir) +add_subdirectory(../do_exchange do_exchange_dir) add_subdirectory(../hello_world hello_world_dir) add_subdirectory(../readcsv readcsv_dir) add_subdirectory(../read_table_with_arrow_flight read_table_with_arrow_flight_dir) diff --git a/cpp-examples/cleanup/main.cc b/cpp-examples/cleanup/main.cc index c7db58992cf..b42ac930493 100644 --- a/cpp-examples/cleanup/main.cc +++ b/cpp-examples/cleanup/main.cc @@ -2,14 +2,31 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::TableHandleManager; +using deephaven::client::NumCol; +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; // This example shows explicit QueryTable cleanup using destructors/RAII. +namespace { +void doit(const TableHandleManager &manager); +} + +int main() { + const char *server = "localhost:10000"; + + try { + auto client = Client::connect(server); + auto manager = client.getManager(); + doit(manager); + } catch (const std::runtime_error &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { void doit(const TableHandleManager &manager) { auto table = manager.emptyTable(10).update("X = ii % 2", "Y = ii"); auto [x, y] = table.getCols("X", "Y"); @@ -37,15 +54,4 @@ void doit(const TableHandleManager &manager) { // t1 and the TableHandleManger will be destructed here. } - -int main() { - const char *server = "localhost:10000"; - - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - doit(manager); - } catch (const std::runtime_error &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } -} +} // namespace diff --git a/cpp-examples/compare_approaches/CMakeLists.txt b/cpp-examples/compare_approaches/CMakeLists.txt new file mode 100644 index 00000000000..c3e1e081d95 --- /dev/null +++ b/cpp-examples/compare_approaches/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.16) +project(compare_approaches) + +set(CMAKE_CXX_STANDARD 17) + +add_subdirectory(../../cpp-client/deephaven deephaven_dir) +#find_package(deephaven REQUIRED) + +find_package(Arrow REQUIRED) +find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) +find_package(Boost REQUIRED) +find_package(Immer REQUIRED) +find_package(Protobuf REQUIRED) +find_package(gRPC REQUIRED) +find_package(Threads REQUIRED) +find_package(Immer REQUIRED) + +add_executable(compare_approaches main.cc) + +target_link_libraries(compare_approaches deephaven::client) diff --git a/cpp-examples/compare_approaches/main.cc b/cpp-examples/compare_approaches/main.cc new file mode 100644 index 00000000000..4d69d682070 --- /dev/null +++ b/cpp-examples/compare_approaches/main.cc @@ -0,0 +1,671 @@ +/* + * Copyright (c) 2016-2020 Deephaven Data Labs and Patent Pending + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "deephaven/client/client.h" +#include "deephaven/client/ticking.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/table/table.h" +#include "deephaven/client/utility/table_maker.h" +#include "deephaven/client/utility/utility.h" +#include "immer/algorithm.hpp" + +using deephaven::client::Client; +using deephaven::client::NumCol; +using deephaven::client::SortPair; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TickingCallback; +using deephaven::client::ClassicTickingUpdate; +using deephaven::client::ImmerTickingUpdate; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::chunk::AnyChunk; +using deephaven::client::chunk::ChunkVisitor; +using deephaven::client::chunk::Chunk; +using deephaven::client::chunk::DoubleChunk; +using deephaven::client::chunk::Int32Chunk; +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::chunk::UInt64Chunk; +using deephaven::client::column::ColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::table::Table; +using deephaven::client::utility::makeReservedVector; +using deephaven::client::utility::okOrThrow; +using deephaven::client::utility::separatedList; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; +using deephaven::client::utility::TableMaker; +using deephaven::client::utility::valueOrThrow; +using deephaven::client::utility::verboseCast; + +using std::size_t; + +namespace { +struct UserConfig { + UserConfig(std::string server, bool wantLastBy, bool wantImmer, int64_t period, int64_t tableSize, + int64_t endSerialNumber, int64_t keyFactor, int64_t numAdditionalCols); + ~UserConfig(); + + std::string server_; + bool wantLastBy_ = false; + bool wantImmer_ = false; + int64_t period_ = 0; + int64_t tableSize_ = 0; + int64_t endSerialNumber_ = 0; + int64_t keyFactor_ = 0; + int64_t numAdditionalCols_ = 0; + + friend std::ostream &operator<<(std::ostream &s, const UserConfig &o); +}; + +struct RuntimeConfig { + RuntimeConfig(size_t keyColumn, size_t serialNumberColumn) : keyColumn_(keyColumn), + serialNumberColumn_(serialNumberColumn) {} + + size_t keyColumn_ = 0; + size_t serialNumberColumn_ = 0; +}; + +UserConfig parseArgs(int argc, const char **argv); +void demo(std::shared_ptr config, TableHandleManager *manager); +std::pair> makeQuery(const UserConfig *userConfig, + TableHandleManager *manager); +void showUsageAndExit(); +int64_t getLong(std::string_view s); +} // namespace + +int main(int argc, const char **argv) { + auto config = parseArgs(argc, argv); + streamf(std::cout, "Config is %o\n", config); + try { + auto client = Client::connect(config.server_); + auto manager = client.getManager(); + auto sharedConfig = std::make_shared(std::move(config)); + demo(std::move(sharedConfig), &manager); + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { +UserConfig parseArgs(int argc, const char **argv) { + if (argc != 9) { + showUsageAndExit(); + } + size_t nextIndex = 1; + std::string serverAndPort = argv[nextIndex++]; + + std::string_view tailVsLastBy = argv[nextIndex++]; + bool wantLastBy; + if (tailVsLastBy == "lastby") { + wantLastBy = true; + } else if (tailVsLastBy == "tail") { + wantLastBy = false; + } else { + showUsageAndExit(); + } + + std::string_view immerVsClassic = argv[nextIndex++]; + bool wantImmer; + if (immerVsClassic == "immer") { + wantImmer = true; + } else if (immerVsClassic == "classic") { + wantImmer = false; + } else { + showUsageAndExit(); + } + + auto period = getLong(argv[nextIndex++]); + auto tableSize = getLong(argv[nextIndex++]); + auto endSerialNumber = getLong(argv[nextIndex++]); + auto keyFactor = getLong(argv[nextIndex++]); + auto numAdditionalCols = getLong(argv[nextIndex++]); + + return UserConfig(std::move(serverAndPort), wantLastBy, wantImmer, period, tableSize, + endSerialNumber, keyFactor, numAdditionalCols); +} + +int64_t getLong(std::string_view s) { + int64_t value; + auto res = std::from_chars(s.begin(), s.end(), value); + if (res.ec != std::errc()) { + throw std::runtime_error(stringf("Couldn't parse %o, error code is %o", s, (int)res.ec)); + } + if (res.ptr != s.end()) { + throw std::runtime_error(stringf("Non-numeric material in %o", s)); + } + return value; +} + +void showUsageAndExit() { + streamf(std::cerr, + "Usage: server:port (tail/lastby) (immer/classic) period tableSize endSerialNumber keyFactor numAdditionalCols\n" + "server:port\n" + " The server endpoint, such as localhost:10000\n" + "(tail/lastby):\n" + " tail - creates an append-only table\n" + " lastby - creates a table with lastby (will experience shifts and modifies)\n" + "(immer/classic):\n" + " immer - use Immer data structures to track the table data\n" + " classic - use traditional data structures to track the table data\n" + "period:\n" + " The server adds a new row every 'period' nanoseconds\n" + "tableSize:\n" + " The max size of the table (in general this is smaller than the number of new rows created because rows can wrap around and replace previous versions)\n" + "endSerialNumber:\n" + " The (exclusive) upper bound of row numbers added to the table. The table will stop changing at this point\n" + "keyFactor:\n" + " The serial number is multiplied by the keyFactor in order to spread rows around and cause a lot of shifts or modifies\n" + "numAdditionalCols:\n" + " Number of additional autogenerated data columns\n" + "\n" + "One reasonable test would be:\n" + " localhost:10000 tail immer 10000000 1000 10000 3 5\n" + ); + std::exit(1); +} + +// or maybe make a stream manipulator +std::string getWhat(std::exception_ptr ep); + +class SerialNumberProcessor final { +public: + void process(Int64Chunk *unorderedSerialNumbers); + +private: + int64_t nextExpectedSerial_ = 0; +}; + +class Stopwatch { +public: + Stopwatch(); + + bool pulse(size_t *elapsedSeconds); + +private: + std::chrono::steady_clock::time_point start_; + std::chrono::steady_clock::time_point last_; +}; + +class StatsProcessor { +public: + void update(size_t rowsRemoved, size_t rowsAdded, size_t rowsModifiedEstimated, + size_t cellsModified); + void showStats(size_t numCols, size_t elapsedSeconds); + +private: + size_t lastRowsRemoved_ = 0; + size_t lastRowsAdded_ = 0; + size_t lastRowsModifiedEstimated_ = 0; + size_t lastCellsModified_ = 0; + + size_t rowsRemoved_ = 0; + size_t rowsAdded_ = 0; + size_t rowsModifiedEstimated_ = 0; + size_t cellsModified_ = 0; +}; + +class TableScanner { +public: + void scanTable(const Table &table); +}; + +class FragmentationAnalyzer { +public: + void analyze(const Table &table); + +private: + void analyzeHelper(std::string_view what, const ColumnSource &col); +}; + +class ClassicProcessor { + struct Private {}; +public: + static std::shared_ptr create(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig); + + ClassicProcessor(Private, std::shared_ptr userConfig, + std::shared_ptr runtimeConfi); + ~ClassicProcessor(); + + void processUpdate(const ClassicTickingUpdate &update); + +private: + void processSerialNumber(const ClassicTickingUpdate &update); + + std::shared_ptr userConfig_; + std::shared_ptr runtimeConfig_; + SerialNumberProcessor serialNumberProcessor_; + StatsProcessor statsProcessor_; + TableScanner tableScanner_; + Stopwatch stopwatch_; +}; + +class ImmerProcessor { + struct Private {}; +public: + static std::shared_ptr create(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig); + + ImmerProcessor(Private, std::shared_ptr userConfig, + std::shared_ptr runtimeConfi); + ~ImmerProcessor(); + + void post(ImmerTickingUpdate update); + +private: + static void runForever(std::shared_ptr self); + void runForeverHelper(); + void processUpdate(const ImmerTickingUpdate &update); + void processSerialNumber(const ImmerTickingUpdate &update); + + std::shared_ptr userConfig_; + std::shared_ptr runtimeConfig_; + SerialNumberProcessor serialNumberProcessor_; + StatsProcessor statsProcessor_; + TableScanner tableScanner_; + Stopwatch stopwatch_; + FragmentationAnalyzer fragmentationAnalyzer_; + std::mutex mutex_; + std::condition_variable condvar_; + std::queue todo_; +}; + +class DemoCallback final : public TickingCallback { +public: + explicit DemoCallback(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig); + ~DemoCallback() final; + + void onFailure(std::exception_ptr ep) final; + void onTick(const ClassicTickingUpdate &update) final; + void onTick(ImmerTickingUpdate update) final; + +private: + std::shared_ptr classicProcessor_; + std::shared_ptr immerProcessor_; +}; + +void demo(std::shared_ptr userConfig, TableHandleManager *manager) { + auto [table, runtimeConfig] = makeQuery(userConfig.get(), manager); + table.bindToVariable("showme"); + + auto wantImmer = userConfig->wantImmer_; + auto myCallback = std::make_shared(std::move(userConfig), std::move(runtimeConfig)); + auto handle = table.subscribe(myCallback, wantImmer); + std::cout << "Press enter to stop:\n"; + std::string temp; + std::getline(std::cin, temp); + std::cerr << "Unsubscribing, then sleeping for 5 seconds\n"; + table.unsubscribe(handle); + std::this_thread::sleep_for(std::chrono::seconds(5)); + std::cerr << "exiting\n"; +} + +std::pair> makeQuery(const UserConfig *userConfig, + TableHandleManager *manager) { + auto start = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + + auto table = manager->timeTable(start, userConfig->period_).view("SerialNumber = ii"); + auto sn = table.getNumCol("SerialNumber"); + // Demo is done at 'maxSerialNumber' + table = table.where(sn < userConfig->endSerialNumber_); + // Key column: increasing, but wraps at 'tableSize' + table = table.updateView(((sn * userConfig->keyFactor_) % userConfig->tableSize_).as("Key")); + std::shared_ptr runtimeConfig; + if (userConfig->wantLastBy_) { + table = table.lastBy("Key"); + runtimeConfig = std::make_shared(0, 1); + } else { + table = table.tail(userConfig->tableSize_); + runtimeConfig = std::make_shared(1, 0); + } + + for (int32_t i = 0; i < userConfig->numAdditionalCols_; ++i) { + auto colName = stringf("Col%o", i); + table = table.updateView((sn * (i + 1)).as(colName)); + } + + return std::make_pair(std::move(table), std::move(runtimeConfig)); +} + +DemoCallback::DemoCallback(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig) { + classicProcessor_ = ClassicProcessor::create(userConfig, runtimeConfig); + immerProcessor_ = ImmerProcessor::create(std::move(userConfig), std::move(runtimeConfig)); +} +DemoCallback::~DemoCallback() = default; + +void DemoCallback::onFailure(std::exception_ptr ep) { + streamf(std::cerr, "Callback reported failure: %o\n", getWhat(std::move(ep))); +} + +void DemoCallback::onTick(const ClassicTickingUpdate &update) { + classicProcessor_->processUpdate(update); +} + +void DemoCallback::onTick(ImmerTickingUpdate update) { + immerProcessor_->post(std::move(update)); +} + +std::shared_ptr ClassicProcessor::create(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig) { + return std::make_shared(Private(), std::move(userConfig), std::move(runtimeConfig)); +} + +ClassicProcessor::ClassicProcessor(Private,std::shared_ptr userConfig, + std::shared_ptr runtimeConfig) + : userConfig_(std::move(userConfig)), runtimeConfig_(std::move(runtimeConfig)) {} + +ClassicProcessor::~ClassicProcessor() = default; + +void ClassicProcessor::processUpdate(const ClassicTickingUpdate &update) { + const auto &table = *update.currentTableIndexSpace(); + auto numCols = table.numColumns(); + auto expectedNumColumns = 2 + userConfig_->numAdditionalCols_; + if (numCols != expectedNumColumns) { + throw std::runtime_error(stringf("Expected %o columns, got %o", expectedNumColumns, numCols)); + } + + size_t rowsModifiedEstimated = 0; + size_t cellsModified = 0; + for (const auto &mods : update.modifiedRowsKeySpace()) { + rowsModifiedEstimated = std::max(rowsModifiedEstimated, mods->size()); + cellsModified += mods->size(); + } + statsProcessor_.update(update.removedRowsKeySpace()->size(), + update.addedRowsKeySpace()->size(), rowsModifiedEstimated, cellsModified); + processSerialNumber(update); + size_t elapsedSeconds; + if (stopwatch_.pulse(&elapsedSeconds)) { + tableScanner_.scanTable(table); + statsProcessor_.showStats(numCols, elapsedSeconds); + } +} + +void ClassicProcessor::processSerialNumber(const ClassicTickingUpdate &update) { + // Do a bunch of work to make sure we received contiguous serial numbers without any skips. + const auto &table = *update.currentTableIndexSpace(); + auto sni = runtimeConfig_->serialNumberColumn_; + const auto &serialNumberCol = table.getColumn(sni); + + const auto &addedRows = update.addedRowsIndexSpace(); + const auto &modRowsVec = update.modifiedRowsIndexSpace(); + UInt64Chunk emptyModifiedRows; + const auto *modifiedRowsToUse = sni < modRowsVec.size() ? &modRowsVec[sni] : &emptyModifiedRows; + + auto totalChunkSize = addedRows.size() + modifiedRowsToUse->size(); + if (totalChunkSize == 0) { + return; + } + auto totalChunk = Int64Chunk::create(totalChunkSize); + auto addSlice = totalChunk.take(addedRows.size()); + auto modSlice = totalChunk.drop(addedRows.size()); + + serialNumberCol->fillChunkUnordered(addedRows, &addSlice); + serialNumberCol->fillChunkUnordered(*modifiedRowsToUse, &modSlice); + + serialNumberProcessor_.process(&totalChunk); +} + +std::shared_ptr ImmerProcessor::create(std::shared_ptr userConfig, + std::shared_ptr runtimeConfig) { + auto result = std::make_shared(Private(), std::move(userConfig), + std::move(runtimeConfig)); + std::thread t(&runForever, result); + t.detach(); + return result; +} + +ImmerProcessor::ImmerProcessor(Private,std::shared_ptr userConfig, + std::shared_ptr runtimeConfig) + : userConfig_(std::move(userConfig)), runtimeConfig_(std::move(runtimeConfig)) {} + + ImmerProcessor::~ImmerProcessor() = default; + +void ImmerProcessor::post(ImmerTickingUpdate update) { + mutex_.lock(); + auto empty = todo_.empty(); + todo_.push(std::move(update)); + mutex_.unlock(); + if (empty) { + condvar_.notify_all(); + } +} + +void ImmerProcessor::runForever(std::shared_ptr self) { + std::cerr << "Immer processor thread starting up\n"; + try { + self->runForeverHelper(); + } catch (const std::exception &e) { + streamf(std::cerr, "Caught exception: %o\n", e.what()); + } + std::cerr << "Immer processor thread shutting down\n"; +} + +void ImmerProcessor::runForeverHelper() { + while (true) { + std::unique_lock guard(mutex_); + while (todo_.empty()) { + condvar_.wait(guard); + } + auto update = std::move(todo_.front()); + todo_.pop(); + guard.unlock(); + + processUpdate(update); + } +} + +void ImmerProcessor::processUpdate(const ImmerTickingUpdate &update) { + const auto &table = *update.current(); + auto numCols = table.numColumns(); + auto expectedNumColumns = 2 + userConfig_->numAdditionalCols_; + if (numCols != expectedNumColumns) { + throw std::runtime_error(stringf("Expected %o columns, got %o", expectedNumColumns, numCols)); + } + size_t rowsModifiedEstimated = 0; + size_t cellsModified = 0; + for (const auto &mods : update.modified()) { + rowsModifiedEstimated = std::max(rowsModifiedEstimated, mods->size()); + cellsModified += mods->size(); + } + statsProcessor_.update(update.removed()->size(), + update.added()->size(), rowsModifiedEstimated, cellsModified); + + processSerialNumber(update); + size_t elapsedSeconds; + if (stopwatch_.pulse(&elapsedSeconds)) { + tableScanner_.scanTable(table); + statsProcessor_.showStats(numCols, elapsedSeconds); + fragmentationAnalyzer_.analyze(*update.current()); + } +} + +void ImmerProcessor::processSerialNumber(const ImmerTickingUpdate &update) { + // Do a bunch of work to make sure we received contiguous serial numbers without any skips. + const auto &table = *update.current(); + auto sni = runtimeConfig_->serialNumberColumn_; + const auto &serialNumberCol = table.getColumn(sni); + + const auto &addedRows = update.added(); + const auto &modRowsVec = update.modified(); + auto emptyModifiedRows = RowSequence::createEmpty(); + const auto *modifiedRowsToUse = sni < modRowsVec.size() ? modRowsVec[sni].get() : emptyModifiedRows.get(); + + auto totalChunkSize = addedRows->size() + modifiedRowsToUse->size(); + if (totalChunkSize == 0) { + return; + } + auto totalChunk = Int64Chunk::create(totalChunkSize); + auto addSlice = totalChunk.take(addedRows->size()); + auto modSlice = totalChunk.drop(addedRows->size()); + + serialNumberCol->fillChunk(*addedRows, &addSlice); + serialNumberCol->fillChunk(*modifiedRowsToUse, &modSlice); + + serialNumberProcessor_.process(&totalChunk); +} + +void SerialNumberProcessor::process(Int64Chunk *unorderedSerialNumbers) { + auto &usns = *unorderedSerialNumbers; + std::sort(usns.begin(), usns.end()); + auto firstSerial = *usns.begin(); + auto lastSerial = *(usns.end() - 1); // Safe because chunk is not empty. + if (lastSerial - firstSerial + 1 != usns.size()) { + throw std::runtime_error(stringf("Serial numbers not contiguous [%o..%o]", firstSerial, lastSerial)); + } + if (firstSerial != nextExpectedSerial_) { + throw std::runtime_error(stringf("Expected next serial %o, got %o", nextExpectedSerial_, + firstSerial)); + } + nextExpectedSerial_ = lastSerial + 1; + streamf(std::cout, "next expected serial %o\n", nextExpectedSerial_); +} + +Stopwatch::Stopwatch() { + auto now = std::chrono::steady_clock::now(); + start_ = now; + last_ = now; +} + +bool Stopwatch::pulse(size_t *elapsedSeconds) { + auto now = std::chrono::steady_clock::now(); + *elapsedSeconds = std::chrono::duration_cast(now - start_).count(); + auto thisPulse = std::chrono::duration_cast(now - last_).count(); + if (thisPulse < 5) { + return false; + } + last_ = now; + return true; +} + +void StatsProcessor::update(size_t rowsRemoved, size_t rowsAdded, + size_t rowsModifiedEstimated, size_t cellsModified) { + rowsRemoved_ += rowsRemoved; + rowsAdded_ += rowsAdded; + rowsModifiedEstimated_ += rowsModifiedEstimated; + cellsModified_ += cellsModified; +} + +void StatsProcessor::showStats(size_t numCols, size_t elapsedSeconds) { + auto deltaRemoved = rowsRemoved_ - lastRowsRemoved_; + auto deltaAdded = rowsAdded_ - lastRowsAdded_; + auto deltaModifiedRows = rowsModifiedEstimated_ - lastRowsModifiedEstimated_; + auto deltaModifiedCells = cellsModified_ - lastCellsModified_; + auto totalRows = rowsRemoved_ + rowsAdded_ + rowsModifiedEstimated_; + auto totalCells = rowsRemoved_ * numCols + rowsAdded_ * numCols + cellsModified_; + auto rowsPerSec = totalRows / elapsedSeconds; + auto cellsPerSec = totalCells / elapsedSeconds; + + lastRowsRemoved_ = rowsRemoved_; + lastRowsAdded_ = rowsAdded_; + lastRowsModifiedEstimated_ = rowsModifiedEstimated_; + lastCellsModified_ = cellsModified_; + streamf(std::cout, + "removed %o rows, added %o rows, modified %o rows (%o cells) (totals %o, %o, %o, %o). " + "Total %o rows (%o cells) in %o seconds (%o rows / second) (%o cells / second)\n", + deltaRemoved, deltaAdded, deltaModifiedRows, deltaModifiedCells, + rowsRemoved_, rowsAdded_, rowsModifiedEstimated_, cellsModified_, + totalRows, totalCells, elapsedSeconds, rowsPerSec, cellsPerSec); +} + +void TableScanner::scanTable(const Table &table) { + auto start = std::chrono::system_clock::now(); + auto ncols = table.numColumns(); + auto nrows = table.numRows(); + std::vector results(ncols); + auto allRows = RowSequence::createSequential(0, nrows); + for (size_t colNum = 0; colNum < ncols; ++colNum) { + const auto &col = table.getColumn(colNum); + auto chunk = ChunkMaker::createChunkFor(*col, nrows); + col->fillChunk(*allRows, &chunk.unwrap()); + + // Assume for now that all the columns are int64_t + const auto &typedChunk = chunk.get(); + int64_t total = 0; + for (auto element : typedChunk) { + total += element; + } + results[colNum] = total; + } + auto end = std::chrono::system_clock::now(); + auto duration = std::chrono::duration_cast(end - start).count(); + auto durationMillis = (double)duration / 1'000; + streamf(std::cout, "Table scan took %o millis. Sums are %o\n", durationMillis, + separatedList(results.begin(), results.end(), ", ")); +} + +void FragmentationAnalyzer::analyze(const Table &table) { + for (size_t i = 0; i < table.numColumns(); ++i) { + const auto &col = table.getColumn(i); + auto what = stringf("Col %o", i); + analyzeHelper(what, *col); + } +} + +void FragmentationAnalyzer::analyzeHelper(std::string_view what, const ColumnSource &col) { + const auto underlying = col.backdoor(); + const auto * const *vecpp = std::any_cast*>(&underlying); + if (vecpp == nullptr) { + return; + } + const auto *src = *vecpp; + std::map sizes; + auto analyze = [&sizes](const int64_t *begin, const int64_t *end) { + auto size = end - begin; + ++sizes[size]; + }; + immer::for_each_chunk(src->begin(), src->end(), analyze); + + auto renderSize = [](std::ostream &s, const std::pair &p) { + streamf(s, "%o:%o", p.first, p.second); + }; + + streamf(std::cout, "Immer histogram for %o: %o\n", what, separatedList(sizes.begin(), sizes.end(), + ", ", renderSize)); +} + +UserConfig::UserConfig(std::string server, bool wantLastBy, bool wantImmer, int64_t period, + int64_t tableSize, int64_t endSerialNumber, int64_t keyFactor, int64_t numAdditionalCols) : + server_(std::move(server)), wantLastBy_(wantLastBy), wantImmer_(wantImmer), period_(period), + tableSize_(tableSize),endSerialNumber_(endSerialNumber), keyFactor_(keyFactor), + numAdditionalCols_(numAdditionalCols) {} +UserConfig::~UserConfig() = default; + +std::string getWhat(std::exception_ptr ep) { + try { + std::rethrow_exception(std::move(ep)); + } catch (const std::exception &e) { + return e.what(); + } catch (...) { + return "(unknown exception)"; + } +} + +std::ostream &operator<<(std::ostream &s, const UserConfig &o) { + return streamf(s, "server: %o\n" + "wantLastBy: %o\n" + "wantImmer: %o\n" + "period: %o\n" + "tableSize: %o\n" + "endSerialNumber: %o\n" + "keyFactor: %o\n" + "numAdditionalCols: %o", + o.server_, o.wantLastBy_, o.wantImmer_, o.period_, o.tableSize_, o.endSerialNumber_, o.keyFactor_, + o.numAdditionalCols_); +} +} // namespace diff --git a/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt b/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt index 61108d9a103..6269e738a55 100644 --- a/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt +++ b/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(arrow_flight_maker) +project(create_table_with_arrow_flight) set(CMAKE_CXX_STANDARD 17) @@ -12,6 +12,6 @@ find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) find_package(Threads REQUIRED) -add_executable(arrow_flight_maker main.cc) +add_executable(create_table_with_arrow_flight main.cc) -target_link_libraries(arrow_flight_maker deephaven::client) +target_link_libraries(create_table_with_arrow_flight deephaven::client) diff --git a/cpp-examples/create_table_with_arrow_flight/main.cc b/cpp-examples/create_table_with_arrow_flight/main.cc index 785d1279ca2..94c874df43f 100644 --- a/cpp-examples/create_table_with_arrow_flight/main.cc +++ b/cpp-examples/create_table_with_arrow_flight/main.cc @@ -2,57 +2,95 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/table_maker.h" -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::TableHandleManager; +using deephaven::client::NumCol; +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::valueOrThrow; using deephaven::client::utility::TableMaker; +namespace { +void doit(const TableHandleManager &manager); +} // namespace + // This example shows how to use the Arrow Flight client to make a simple table. +int main() { + const char *server = "localhost:10000"; + + try { + auto client = Client::connect(server); + auto manager = client.getManager(); + doit(manager); + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { void doit(const TableHandleManager &manager) { // 1. Build schema arrow::SchemaBuilder schemaBuilder; // 2. Add "Symbol" column (type: string) to schema - auto symbolMetadata = std::make_shared(); - okOrThrow(DEEPHAVEN_EXPR_MSG(symbolMetadata->Set("deephaven:type", "java.lang.String"))); - auto symbolField = std::make_shared("Symbol", - std::make_shared(), true, std::move(symbolMetadata)); - okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(symbolField))); + { + auto symbolMetadata = std::make_shared(); + okOrThrow(DEEPHAVEN_EXPR_MSG(symbolMetadata->Set("deephaven:type", "java.lang.String"))); + auto symbolField = std::make_shared("Symbol", + std::make_shared(), true, std::move(symbolMetadata)); + okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(symbolField))); + } // 3. Add "Price" column (type: double) to schema - auto priceMetadata = std::make_shared(); - okOrThrow(DEEPHAVEN_EXPR_MSG(priceMetadata->Set("deephaven:type", "double"))); - auto priceField = std::make_shared("Price", - std::make_shared(), true, std::move(priceMetadata)); - okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(priceField))); + { + auto priceMetadata = std::make_shared(); + okOrThrow(DEEPHAVEN_EXPR_MSG(priceMetadata->Set("deephaven:type", "double"))); + auto priceField = std::make_shared("Price", + std::make_shared(), true, std::move(priceMetadata)); + okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(priceField))); + } + + // 4. Add "Volume" column (type: int) to schema + { + auto volumeMetadata = std::make_shared(); + okOrThrow(DEEPHAVEN_EXPR_MSG(volumeMetadata->Set("deephaven:type", "int"))); + auto volumeField = std::make_shared("Volume", + std::make_shared(), true, std::move(volumeMetadata)); + okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(volumeField))); + } // 4. Schema is done auto schema = valueOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.Finish())); - // 5. Prepare symbol and price data + // 5. Prepare symbol, price, and volume data cells std::vector symbols{"FB", "AAPL", "NFLX", "GOOG"}; std::vector prices{101.1, 102.2, 103.3, 104.4}; + std::vector volumes{1000, 2000, 3000, 4000}; auto numRows = static_cast(symbols.size()); - if (numRows != prices.size()) { - throw std::runtime_error("sizes don't match"); + if (numRows != prices.size() || numRows != volumes.size()) { + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("sizes don't match")); } // 6. Move data to Arrow column builders arrow::StringBuilder symbolBuilder; arrow::DoubleBuilder priceBuilder; - symbolBuilder.AppendValues(symbols); - priceBuilder.AppendValues(prices); + arrow::Int32Builder volumeBuilder; + okOrThrow(DEEPHAVEN_EXPR_MSG(symbolBuilder.AppendValues(symbols))); + okOrThrow(DEEPHAVEN_EXPR_MSG(priceBuilder.AppendValues(prices))); + okOrThrow(DEEPHAVEN_EXPR_MSG(volumeBuilder.AppendValues(volumes))); + + auto symbolArray = valueOrThrow(DEEPHAVEN_EXPR_MSG(symbolBuilder.Finish())); + auto priceArray = valueOrThrow(DEEPHAVEN_EXPR_MSG(priceBuilder.Finish())); + auto volumeArray = valueOrThrow(DEEPHAVEN_EXPR_MSG(volumeBuilder.Finish())); // 7. Get Arrow columns from builders std::vector> columns = { - valueOrThrow(DEEPHAVEN_EXPR_MSG(symbolBuilder.Finish())), - valueOrThrow(DEEPHAVEN_EXPR_MSG(priceBuilder.Finish())) + std::move(symbolArray), + std::move(priceArray), + std::move(volumeArray) }; // 8. Get a Deephaven "FlightWrapper" object to access Arrow Flight @@ -84,15 +122,4 @@ void doit(const TableHandleManager &manager) { // 14. Use Deephaven high level operations to fetch the table and print it std::cout << "table is:\n" << table.stream(true) << std::endl; } - -int main() { - const char *server = "localhost:10000"; - - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - doit(manager); - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } -} +} // namespace diff --git a/cpp-examples/create_table_with_table_maker/CMakeLists.txt b/cpp-examples/create_table_with_table_maker/CMakeLists.txt index 5c72b6f7c84..1ab8e343f60 100644 --- a/cpp-examples/create_table_with_table_maker/CMakeLists.txt +++ b/cpp-examples/create_table_with_table_maker/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(table_maker) +project(create_table_with_table_maker) set(CMAKE_CXX_STANDARD 17) @@ -12,6 +12,6 @@ find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) find_package(Threads REQUIRED) -add_executable(table_maker main.cc) +add_executable(create_table_with_table_maker main.cc) -target_link_libraries(table_maker deephaven::client) +target_link_libraries(create_table_with_table_maker deephaven::client) diff --git a/cpp-examples/create_table_with_table_maker/main.cc b/cpp-examples/create_table_with_table_maker/main.cc index ee8acdd7255..1bafb1d65c6 100644 --- a/cpp-examples/create_table_with_table_maker/main.cc +++ b/cpp-examples/create_table_with_table_maker/main.cc @@ -2,27 +2,20 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/table_maker.h" -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::TableHandleManager; +using deephaven::client::NumCol; +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; using deephaven::client::utility::TableMaker; -// This example shows how to use the TableMaker wrapper to make a simple table. -void doit(const TableHandleManager &manager) { - TableMaker tm; - std::vector symbols{"FB", "AAPL", "NFLX", "GOOG"}; - std::vector prices{101.1, 102.2, 103.3, 104.4}; - tm.addColumn("Symbol", symbols); - tm.addColumn("Price", prices); - auto table = tm.makeTable(manager); - - std::cout << "table is:\n" << table.stream(true) << std::endl; -} +namespace { +void doit(const TableHandleManager &manager); +} // namespace +// This example shows how to use the TableMaker wrapper to make a simple table. int main() { const char *server = "localhost:10000"; try { @@ -33,3 +26,16 @@ int main() { std::cerr << "Caught exception: " << e.what() << '\n'; } } + +namespace { +void doit(const TableHandleManager &manager) { + TableMaker tm; + std::vector symbols{"FB", "AAPL", "IBM"}; + std::vector prices{111.111, 222.222, 333.333}; + tm.addColumn("Symbol", symbols); + tm.addColumn("Price", prices); + auto table = tm.makeTable(manager); + + std::cout << "table is:\n" << table.stream(true) << std::endl; +} +} // namespace diff --git a/cpp-examples/do_exchange/CMakeLists.txt b/cpp-examples/do_exchange/CMakeLists.txt index e069a763c73..8e00f4a7a9b 100644 --- a/cpp-examples/do_exchange/CMakeLists.txt +++ b/cpp-examples/do_exchange/CMakeLists.txt @@ -12,7 +12,7 @@ find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) find_package(Threads REQUIRED) -find_package(Flatbuffers REQUIRED) +find_package(Immer REQUIRED) add_executable(do_exchange main.cc) diff --git a/cpp-examples/do_exchange/main.cc b/cpp-examples/do_exchange/main.cc index 65ccca61f02..08817531c55 100644 --- a/cpp-examples/do_exchange/main.cc +++ b/cpp-examples/do_exchange/main.cc @@ -2,31 +2,39 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include +#include #include #include -#include "deephaven/client/highlevel/client.h" -#include "deephaven/client/highlevel/ticking.h" -#include "deephaven/client/highlevel/sad/chunk_maker.h" -#include "deephaven/client/highlevel/sad/sad_chunk.h" -#include "deephaven/client/highlevel/sad/sad_context.h" +#include "deephaven/client/client.h" +#include "deephaven/client/ticking.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/table/table.h" #include "deephaven/client/utility/table_maker.h" #include "deephaven/client/utility/utility.h" - -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::SortPair; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TickingCallback; -using deephaven::client::highlevel::sad::ChunkMaker; -using deephaven::client::highlevel::sad::SadChunk; -using deephaven::client::highlevel::sad::SadChunkVisitor; -using deephaven::client::highlevel::sad::SadContext; -using deephaven::client::highlevel::sad::SadDoubleChunk; -using deephaven::client::highlevel::sad::SadIntChunk; -using deephaven::client::highlevel::sad::SadLongChunk; -using deephaven::client::highlevel::sad::SadSizeTChunk; +#include "immer/algorithm.hpp" + +using deephaven::client::Client; +using deephaven::client::NumCol; +using deephaven::client::SortPair; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TickingCallback; +using deephaven::client::ClassicTickingUpdate; +using deephaven::client::ImmerTickingUpdate; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::chunk::AnyChunk; +using deephaven::client::chunk::ChunkVisitor; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::chunk::DoubleChunk; +using deephaven::client::chunk::Int32Chunk; +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::chunk::UInt64Chunk; +using deephaven::client::table::Table; +using deephaven::client::utility::makeReservedVector; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::separatedList; using deephaven::client::utility::streamf; @@ -36,17 +44,76 @@ using deephaven::client::utility::valueOrThrow; using std::size_t; -// Hey, we should standardize on either deephaven or io::deephaven +namespace { +void doit(const TableHandleManager &manager); +void makeModifiesHappen(const TableHandleManager &manager); +void millionRows(const TableHandleManager &manager); +void lastBy(const TableHandleManager &manager); +void varietyOfTypes(const TableHandleManager &manager); +void demo(const TableHandleManager &manager); +template +void ensure(std::vector *vec, size_t size); +template +struct optionalAdaptor_t { + explicit optionalAdaptor_t(const std::optional &value) : value_(value) {} + const std::optional &value_; + + friend std::ostream &operator<<(std::ostream &s, const optionalAdaptor_t &o) { + if (!o.value_.has_value()) { + return s << "[none]"; + } + return s << *o.value_; + } +}; + +template +optionalAdaptor_t adaptOptional(const std::optional &value) { + return optionalAdaptor_t(value); +} +} // namespace + +int main() { + const char *server = "localhost:10000"; + try { + auto client = Client::connect(server); + auto manager = client.getManager(); + varietyOfTypes(manager); + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +// TODO(kosak): we should standardize on either deephaven or io::deephaven namespace { class Callback final : public TickingCallback { public: void onFailure(std::exception_ptr ep) final; - void onTick(const std::shared_ptr &table) final; + void onTick(const ClassicTickingUpdate &update) final; + void onTick(ImmerTickingUpdate update) final; + bool failed() const { return failed_; } private: - std::atomic failed_ = false; + std::atomic failed_ = false; +}; + +class DemoCallback final : public TickingCallback { +public: + void onFailure(std::exception_ptr ep) final; + void onTick(const ClassicTickingUpdate &update) final; + void onTick(ImmerTickingUpdate update) final; + +private: + void processClassicCommon(const Table &table, const UInt64Chunk &affectedRows); + void processImmerCommon(const Table &table, const RowSequence &affectedRows); + void updateCache(const Int64Chunk &tableContentsKeys, const Int64Chunk &tableContentsValues); + void periodicCheck(); + + std::vector> receivedValues_; + std::vector> recalcedValues_; + int64_t maxValueReceived_ = -1; + int64_t nextValueToRecalc_ = 0; }; // or maybe make a stream manipulator @@ -57,23 +124,12 @@ void Callback::onFailure(std::exception_ptr ep) { failed_ = true; } -class ElementStreamer final : public SadChunkVisitor { +class ElementStreamer final { public: ElementStreamer(std::ostream &s, size_t index) : s_(s), index_(index) {} - void visit(const SadIntChunk &chunk) const final { - s_ << chunk.data()[index_]; - } - - void visit(const SadLongChunk &chunk) const final { - s_ << chunk.data()[index_]; - } - - void visit(const SadDoubleChunk &chunk) const final { - s_ << chunk.data()[index_]; - } - - void visit(const SadSizeTChunk &chunk) const final { + template + void operator()(const T &chunk) const { s_ << chunk.data()[index_]; } @@ -82,54 +138,75 @@ class ElementStreamer final : public SadChunkVisitor { size_t index_ = 0; }; -template inline std::vector reserved_vector(size_t n) { - std::vector v; - v.reserve(n); - return v; -} - -void Callback::onTick(const std::shared_ptr &table) { - // Deliberately chosen to be small so I can test chunking. In production this would be a lot larger. - const size_t chunkSize = 8; +void dumpTable(std::string_view what, const Table &table, const std::vector &whichCols, + std::shared_ptr rows); - auto ncols = table->numColumns(); - auto selectedCols = reserved_vector(ncols); +void Callback::onTick(const ClassicTickingUpdate &update) { + streamf(std::cout, "adds: %o\n", *update.addedRowsKeySpace()); + auto render = [](std::ostream &s, const std::shared_ptr &rs) { + s << *rs; + }; + streamf(std::cout, "modifies: %o\n", separatedList(update.modifiedRowsKeySpace().begin(), + update.modifiedRowsKeySpace().end(), " === ", render)); +} - for (size_t col = 0; col < ncols; ++col) { - selectedCols.push_back(col); +void Callback::onTick(ImmerTickingUpdate update) { + auto ncols = update.current()->numColumns(); + auto allCols = makeReservedVector(update.current()->numColumns()); + for (size_t i = 0; i < ncols; ++i) { + allCols.push_back(i); } - auto nrows = table->numRows(); - - auto outerIter = table->getRowSequence()->getRowSequenceIterator(); - - for (size_t startRow = 0; startRow < nrows; startRow += chunkSize) { - auto selectedRows = outerIter->getNextRowSequenceWithLength(chunkSize); - auto thisSize = selectedRows->size(); + dumpTable("removed", *update.beforeRemoves(), allCols, update.removed()); + for (size_t i = 0; i < update.modified().size(); ++i) { + std::vector oneCol{i}; + auto prevText = stringf("Col%o-prev", i); + auto currText = stringf("Col%o-curr", i); + dumpTable(prevText, *update.beforeModifies(), allCols, update.modified()[i]); + dumpTable(currText, *update.current(), allCols, update.modified()[i]); + } + dumpTable("added", *update.current(), allCols, update.added()); +} - auto unwrappedTable = table->unwrap(selectedRows, selectedCols); - auto rowKeys = unwrappedTable->getUnorderedRowKeys(); +void dumpTable(std::string_view what, const Table &table, const std::vector &whichCols, + std::shared_ptr rows) { + if (rows->empty()) { + return; + } + streamf(std::cout, "===== THIS IS %o =====\n", what); + // Deliberately chosen to be small so I can test chunking. + const size_t chunkSize = 16; + + auto ncols = whichCols.size(); + auto chunks = makeReservedVector(ncols); + for (auto col : whichCols) { + const auto &c = table.getColumn(col); + auto chunk = ChunkMaker::createChunkFor(*c, chunkSize); + chunks.push_back(std::move(chunk)); + } - auto contexts = reserved_vector>(ncols); - auto chunks = reserved_vector>(ncols); + while (true) { + auto chunkOfRows = rows->take(chunkSize); + rows = rows->drop(chunkSize); + auto thisSize = chunkOfRows->size(); + if (thisSize == 0) { + break; + } - for (size_t col = 0; col < ncols; ++col) { - const auto &c = unwrappedTable->getColumn(col); - auto context = c->createContext(thisSize); - auto chunk = ChunkMaker::createChunkFor(*c, thisSize); - c->fillChunkUnordered(context.get(), *rowKeys, thisSize, chunk.get()); - chunks.push_back(std::move(chunk)); - contexts.push_back(std::move(context)); + for (size_t i = 0; i < ncols; ++i) { + const auto &c = table.getColumn(whichCols[i]); + auto &chunk = chunks[i].unwrap(); + c->fillChunk(*chunkOfRows, &chunk); } + for (size_t j = 0; j < thisSize; ++j) { - ElementStreamer es(std::cerr, j); - auto chunk_accept = [&es](std::ostream &s, const std::shared_ptr &chunk) { - chunk->acceptVisitor(es); + ElementStreamer es(std::cout, j); + auto chunkAcceptor = [&es](std::ostream &s, const AnyChunk &chunk) { + chunk.visit(es); }; - std::cerr << deephaven::client::utility::separatedList(chunks.begin(), chunks.end(), ", ", chunk_accept) << '\n'; + std::cout << separatedList(chunks.begin(), chunks.end(), ", ", chunkAcceptor) << '\n'; } } } -} // namespace void doit(const TableHandleManager &manager) { auto start = std::chrono::duration_cast( @@ -158,7 +235,7 @@ void doit(const TableHandleManager &manager) { // .head(10); auto myCallback = std::make_shared(); - tt1.subscribe(myCallback); + auto subscriptionHandle = tt1.subscribe(myCallback, true); uint32_t tens_of_seconds_to_run = 50000; while (tens_of_seconds_to_run-- > 0) { std::this_thread::sleep_for(std::chrono::milliseconds (100)); @@ -168,7 +245,7 @@ void doit(const TableHandleManager &manager) { } } std::cerr << "I unsubscribed here.\n"; - tt1.unsubscribe(std::move(myCallback)); + tt1.unsubscribe(std::move(subscriptionHandle)); std::this_thread::sleep_for(std::chrono::seconds(5)); std::cerr << "exiting.\n"; } @@ -224,27 +301,248 @@ void makeModifiesHappen(const TableHandleManager &manager) { tt1.bindToVariable("showme"); auto myCallback = std::make_shared(); - tt1.subscribe(myCallback); + auto handle = tt1.subscribe(myCallback, true); std::this_thread::sleep_for(std::chrono::seconds(5'000)); std::cerr << "I unsubscribed here\n"; - tt1.unsubscribe(std::move(myCallback)); + tt1.unsubscribe(std::move(handle)); std::this_thread::sleep_for(std::chrono::seconds(5)); std::cerr << "exiting\n"; } -int main() { - const char *server = "localhost:10000"; +void millionRows(const TableHandleManager &manager) { + auto start = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - makeModifiesHappen(manager); - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; +// const size_t topAndBottomSize = 500'000; + const size_t topAndBottomSize = 10; + auto tTop = manager.emptyTable(topAndBottomSize).select("Value = ii"); + auto tBottom = manager.emptyTable(topAndBottomSize).select("Value = 10_000_000 + ii"); + auto pulsatingMiddle = manager.timeTable(start, 1 * 1'000'000'000L) + .tail(10) + .select("Selector = ((int)(Timestamp.getNanos() / 1_000_000_000)) % 20") + .where("Selector < 10") + .select("Value = 1_000_000L + Selector"); + + auto table = tTop.merge({pulsatingMiddle, tBottom}); + + table.bindToVariable("showme"); + + auto myCallback = std::make_shared(); + auto handle = table.subscribe(myCallback, true); + std::this_thread::sleep_for(std::chrono::seconds(5'000)); + std::cerr << "I unsubscribed here\n"; + table.unsubscribe(handle); + std::this_thread::sleep_for(std::chrono::seconds(5)); + std::cerr << "exiting\n"; +} + +void demo(const TableHandleManager &manager) { + auto start = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + + const long modSize = 1000; + auto table = manager.timeTable(start, 1 * 100'000'000L) + .view("II = ii") + .where("II < 500") + .view("Temp1 = (II ^ (long)(II / 65536)) * 0x8febca6b", + "Temp2 = (Temp1 ^ ((long)(Temp1 / 8192))) * 0xc2b2ae35", + "HashValue = Temp2 ^ (long)(Temp2 / 65536)", + "II"); + + // might as well use this interface once in a while + auto [hv, ii] = table.getCols("HashValue", "II"); + auto t2 = table.view((hv % modSize).as("Key"), "Value = II"); + auto key = t2.getNumCol("Key"); + auto lb = t2.lastBy(key).sort({key.ascending()}); + + lb.bindToVariable("showme"); + + auto myCallback = std::make_shared(); + auto handle = lb.subscribe(myCallback, false); + std::this_thread::sleep_for(std::chrono::seconds(5'000)); + std::cerr << "I unsubscribed here\n"; + lb.unsubscribe(handle); + std::this_thread::sleep_for(std::chrono::seconds(5)); + std::cerr << "exiting\n"; +} + +void lastBy(const TableHandleManager &manager) { + auto start = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + + const long modSize = 10; + auto table = manager.timeTable(start, 1 * 10'000'000L) + .select("II = ii") + .where("II < 2000") + .select("Temp1 = (II ^ (long)(II / 65536)) * 0x8febca6b", + "Temp2 = (Temp1 ^ ((long)(Temp1 / 8192))) * 0xc2b2ae35", + "HashValue = Temp2 ^ (long)(Temp2 / 65536)", + "II"); + + // might as well use this interface once in a while + auto [hv, ii] = table.getCols("HashValue", "II"); + auto t2 = table.select((hv % modSize).as("Key"), "Value = II"); + auto key = t2.getNumCol("Key"); + auto lb = t2.lastBy(key).sort({key.ascending()}); + + lb.bindToVariable("showme"); + + auto myCallback = std::make_shared(); + auto handle = lb.subscribe(myCallback, true); + std::this_thread::sleep_for(std::chrono::seconds(5'000)); + std::cerr << "I unsubscribed here\n"; + lb.unsubscribe(handle); + std::this_thread::sleep_for(std::chrono::seconds(5)); + std::cerr << "exiting\n"; +} + +void varietyOfTypes(const TableHandleManager &manager) { + auto start = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + + auto table = manager.timeTable(start, 1 * 1'000'000'000L) + .select("XXX = `hello`", "YYY = (short)12", "ZZZ = (byte)65", "QQ = `true`"); + + table.bindToVariable("showme"); + + auto myCallback = std::make_shared(); + auto handle = table.subscribe(myCallback, true); + std::this_thread::sleep_for(std::chrono::seconds(8)); + std::cerr << "I unsubscribed here\n"; + table.unsubscribe(handle); + std::this_thread::sleep_for(std::chrono::seconds(5)); + std::cerr << "exiting\n"; +} + +void DemoCallback::onFailure(std::exception_ptr ep) { + streamf(std::cerr, "Callback reported failure: %o\n", getWhat(std::move(ep))); +} + +void DemoCallback::onTick(const ClassicTickingUpdate &update) { + const auto &table = *update.currentTableIndexSpace(); + const auto &addedRows = update.addedRowsIndexSpace(); + if (table.numColumns() != 2) { + throw std::runtime_error(stringf("Expected 2 columns, got %o", table.numColumns())); } + processClassicCommon(table, addedRows); + + const auto &modifiedRows = update.modifiedRowsIndexSpace(); + if (!modifiedRows.empty()) { + if (modifiedRows.size() != 2) { + throw std::runtime_error(stringf("Expected 2 modified rows, got %o", modifiedRows.size())); + } + const auto &tableContentsKeyMods = modifiedRows[0]; + const auto &tableContenstsValueMods = modifiedRows[1]; + if (tableContentsKeyMods.size() != 0) { + throw std::runtime_error( + stringf("Our application doesn't modify the key column, but got %o", + tableContentsKeyMods.size())); + } + processClassicCommon(table, tableContenstsValueMods); + } + periodicCheck(); } -namespace { +void DemoCallback::processClassicCommon(const Table &table, const UInt64Chunk &affectedRows) { + auto nrows = affectedRows.size(); + auto tableContentsKeys = Int64Chunk::create(nrows); + auto tableContentsValues = Int64Chunk::create(nrows); + const auto &keyCol = table.getColumn(0); + const auto &valueCol = table.getColumn(1); + keyCol->fillChunkUnordered(affectedRows, &tableContentsKeys); + valueCol->fillChunkUnordered(affectedRows, &tableContentsValues); + updateCache(tableContentsKeys, tableContentsValues); +} + +void DemoCallback::onTick(ImmerTickingUpdate update) { + const auto &table = *update.current(); + const auto &added = *update.added(); + if (table.numColumns() != 2) { + throw std::runtime_error(stringf("Expected 2 columns, got %o", table.numColumns())); + } + processImmerCommon(table, added); + + const auto &modified = update.modified(); + if (!modified.empty()) { + if (modified.size() != 2) { + throw std::runtime_error(stringf("Expected 2 modified rows, got %o", modified.size())); + } + const auto &tableContentsKeyMods = *modified[0]; + const auto &tableContenstsValueMods = *modified[1]; + if (!tableContentsKeyMods.empty()) { + throw std::runtime_error(stringf("Our application doesn't modify the key column, but got %o", + tableContentsKeyMods.size())); + } + processImmerCommon(table, tableContenstsValueMods); + } + periodicCheck(); +} + +void DemoCallback::processImmerCommon(const Table &table, const RowSequence &affectedRows) { + auto nrows = affectedRows.size(); + auto tableContentsKeys = Int64Chunk::create(nrows); + auto tableContentsValues = Int64Chunk::create(nrows); + const auto &keyCol = table.getColumn(0); + const auto &valueCol = table.getColumn(1); + keyCol->fillChunk(affectedRows, &tableContentsKeys); + valueCol->fillChunk(affectedRows, &tableContentsValues); + updateCache(tableContentsKeys, tableContentsValues); +} + +void DemoCallback::updateCache(const Int64Chunk &tableContentsKeys, const Int64Chunk &tableContentsValues) { + auto size = tableContentsKeys.size(); + if (size != tableContentsValues.size()) { + throw std::runtime_error( + stringf("Expected tableContentsKeys.size() == tableContentsValues.size(), got (%o != %o)", + size, tableContentsValues.size())); + } + for (size_t i = 0; i < size; ++i) { + auto key = tableContentsKeys.data()[i]; + auto value = tableContentsValues.data()[i]; + streamf(std::cout, "%o - %o\n", key, value); + ensure(&receivedValues_, key + 1); + receivedValues_[key] = value; + maxValueReceived_ = std::max(maxValueReceived_, value); + } +} + +void DemoCallback::periodicCheck() { + streamf(std::cout, "hello, max value seen is %o\n", maxValueReceived_); + + auto end = maxValueReceived_ + 1; + for (auto ii = nextValueToRecalc_; ii != end; ++ii) { + // We need to do these divides as floating point because that's what the server is doing. + auto temp1 = (ii ^ (int64_t)(ii / 65536.0)) * 0x8febca6b; + auto temp2 = (temp1 ^ ((int64_t)(temp1 / 8192.0))) * 0xc2b2ae35; + auto hashValue = temp2 ^ (int64_t)(temp2 / 65536.0); + auto key = hashValue % 1000; + auto value = ii; + ensure(&recalcedValues_, key + 1); + recalcedValues_[key] = value; + } + + if (receivedValues_.size() != recalcedValues_.size()) { + throw std::runtime_error(stringf("receivedValues_.size() != recalcedValues_.size() (%o != %o)", + receivedValues_.size(), recalcedValues_.size())); + } + + for (auto ii = nextValueToRecalc_; ii != end; ++ii) { + if (receivedValues_[ii] == recalcedValues_[ii]) { + continue; + } + throw std::runtime_error(stringf("At offset %o, received != recalc (%o != %o)", + ii, adaptOptional(receivedValues_[ii]), adaptOptional(recalcedValues_[ii]))); + } + + nextValueToRecalc_ = end; +} + +template +void ensure(std::vector *vec, size_t size) { + if (size > vec->size()) { + vec->resize(size); + } +} std::string getWhat(std::exception_ptr ep) { try { @@ -255,6 +553,4 @@ std::string getWhat(std::exception_ptr ep) { return "(unknown exception)"; } } - - } // namespace diff --git a/cpp-examples/hello_world/main.cc b/cpp-examples/hello_world/main.cc index 50c5f882bba..27b7e38b72e 100644 --- a/cpp-examples/hello_world/main.cc +++ b/cpp-examples/hello_world/main.cc @@ -3,10 +3,9 @@ */ #include #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" - -using deephaven::client::highlevel::Client; +using deephaven::client::Client; int main() { const char *server = "localhost:10000"; diff --git a/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt b/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt index e1721830d62..f2c7b7f3d98 100644 --- a/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt +++ b/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(table_reader) +project(read_table_with_arrow_flight) set(CMAKE_CXX_STANDARD 17) @@ -13,6 +13,6 @@ find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) find_package(Threads REQUIRED) -add_executable(table_reader main.cc) +add_executable(read_table_with_arrow_flight main.cc) -target_link_libraries(table_reader deephaven::client) +target_link_libraries(read_table_with_arrow_flight deephaven::client) diff --git a/cpp-examples/read_table_with_arrow_flight/main.cc b/cpp-examples/read_table_with_arrow_flight/main.cc index 4b9edaaf8ed..48d9b387566 100644 --- a/cpp-examples/read_table_with_arrow_flight/main.cc +++ b/cpp-examples/read_table_with_arrow_flight/main.cc @@ -2,17 +2,36 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/table_maker.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::TableHandleManager; +using deephaven::client::NumCol; +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::TableMaker; +namespace { +TableHandle makeTable(const TableHandleManager &manager); +void dumpSymbolColumn(const TableHandle &tableHandle); +} // namespace + +int main() { + const char *server = "localhost:10000"; + + try { + auto client = Client::connect(server); + auto manager = client.getManager(); + auto table = makeTable(manager); + dumpSymbolColumn(table); + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { TableHandle makeTable(const TableHandleManager &manager) { TableMaker tm; std::vector symbols{"FB", "AAPL", "NFLX", "GOOG"}; @@ -33,24 +52,24 @@ void dumpSymbolColumn(const TableHandle &tableHandle) { auto symbolChunk = chunk.data->GetColumnByName("Symbol"); if (symbolChunk == nullptr) { - throw std::runtime_error("Symbol column not found"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Symbol column not found")); } auto priceChunk = chunk.data->GetColumnByName("Price"); if (priceChunk == nullptr) { - throw std::runtime_error("Price column not found"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Price column not found")); } auto symbolAsStringArray = std::dynamic_pointer_cast(symbolChunk); auto priceAsDoubleArray = std::dynamic_pointer_cast(priceChunk); if (symbolAsStringArray == nullptr) { - throw std::runtime_error("symbolChunk was not an arrow::StringArray"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("symbolChunk was not an arrow::StringArray")); } if (priceAsDoubleArray == nullptr) { - throw std::runtime_error("priceChunk was not an arrow::DoubleArray"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("priceChunk was not an arrow::DoubleArray")); } if (symbolAsStringArray->length() != priceAsDoubleArray->length()) { - throw std::runtime_error("Lengths differ"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Lengths differ")); } for (int64_t i = 0; i < symbolAsStringArray->length(); ++i) { @@ -60,16 +79,4 @@ void dumpSymbolColumn(const TableHandle &tableHandle) { } } } - -int main() { - const char *server = "localhost:10000"; - - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - auto table = makeTable(manager); - dumpSymbolColumn(table); - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } -} +} // namespace diff --git a/cpp-examples/readcsv/main.cc b/cpp-examples/readcsv/main.cc index 53a21507634..8b98cae97dc 100644 --- a/cpp-examples/readcsv/main.cc +++ b/cpp-examples/readcsv/main.cc @@ -10,16 +10,41 @@ #include "arrow/csv/api.h" #include "arrow/status.h" #include "arrow/pretty_print.h" -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::Client; +using deephaven::client::TableHandleManager; +using deephaven::client::Client; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::valueOrThrow; namespace { +arrow::Status doit(const TableHandleManager &manager, const std::string &csvfn); +} // namespace + +int main(int argc, char* argv[]) { + if (argc != 2) { + std::cerr << "Usage: " << argv[0] << " filename" << std::endl; + std::exit(1); + } + + const char *server = "localhost:10000"; + + try { + auto client = Client::connect(server); + auto manager = client.getManager(); + auto st = doit(manager, argv[1]); + if (!st.ok()) { + std::cerr << "Failed with status " << st << std::endl; + } + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } + + return 0; +} +namespace { arrow::Status doit(const TableHandleManager &manager, const std::string &csvfn) { auto input_file = valueOrThrow( DEEPHAVEN_EXPR_MSG(arrow::io::ReadableFile::Open(csvfn))); @@ -49,10 +74,10 @@ arrow::Status doit(const TableHandleManager &manager, const std::string &csvfn) const auto &srcColumns = arrow_table->columns(); const size_t ncols = srcColumns.size(); - const size_t nchunks = srcColumns[0]->num_chunks(); + const int nchunks = srcColumns[0]->num_chunks(); std::vector> destColumns(ncols); - for (size_t chunkIndex = 0; chunkIndex < nchunks; ++chunkIndex) { - for (size_t colIndex = 0; colIndex < ncols; ++colIndex) { + for (int chunkIndex = 0; chunkIndex < nchunks; ++chunkIndex) { + for (int colIndex = 0; colIndex < ncols; ++colIndex) { destColumns[colIndex] = srcColumns[colIndex]->chunk(chunkIndex); } auto batch = arrow::RecordBatch::Make(arrow_table->schema(), destColumns[0]->length(), destColumns); @@ -66,30 +91,7 @@ arrow::Status doit(const TableHandleManager &manager, const std::string &csvfn) okOrThrow(DEEPHAVEN_EXPR_MSG(fsw->Close())); std::cout << "table is:\n" << table_handle.stream(true) << std::endl; + table_handle.bindToVariable("showme"); return arrow::Status::OK(); } - } // namespace - -int main(int argc, char* argv[]) { - - if (argc != 2) { - std::cerr << "Usage: " << argv[0] << " filename" << std::endl; - std::exit(1); - } - - const char *server = "localhost:10000"; - - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - auto st = doit(manager, argv[1]); - if (!st.ok()) { - std::cerr << "Failed with status " << st << std::endl; - } - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } - - return 0; -} diff --git a/proto/proto-backplane-grpc/src/main/proto/build-cpp-protos.sh b/proto/proto-backplane-grpc/src/main/proto/build-cpp-protos.sh new file mode 100755 index 00000000000..312f05615cc --- /dev/null +++ b/proto/proto-backplane-grpc/src/main/proto/build-cpp-protos.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +: ${DHDEPS_HOME:=$HOME/dhcpp} +: ${CPP_PROTO_BUILD_DIR:=build} + +set -eux +mkdir -p "${CPP_PROTO_BUILD_DIR}" +$DHDEPS_HOME/local/protobuf/bin/protoc `find . -name \*.proto` --cpp_out=${CPP_PROTO_BUILD_DIR} --grpc_out=${CPP_PROTO_BUILD_DIR} --plugin=protoc-gen-grpc=$DHDEPS_HOME/local/grpc/bin/grpc_cpp_plugin +mv ${CPP_PROTO_BUILD_DIR}/deephaven/proto/*.{h,cc} ../../../../../cpp-client/deephaven/client/proto/deephaven/proto diff --git a/py/client2/.gitignore b/py/client2/.gitignore new file mode 100644 index 00000000000..0c0dbb8ec43 --- /dev/null +++ b/py/client2/.gitignore @@ -0,0 +1 @@ +.eggs diff --git a/py/client2/CMakeLists.txt b/py/client2/CMakeLists.txt new file mode 100644 index 00000000000..36aa6f89a2b --- /dev/null +++ b/py/client2/CMakeLists.txt @@ -0,0 +1,105 @@ +cmake_minimum_required(VERSION 3.16) +project(pydeephaven2) + +# Running from a Python sdist tarball +set(LOCAL_CMAKE_MODULES "${CMAKE_SOURCE_DIR}/cmake_modules") +if(EXISTS "${LOCAL_CMAKE_MODULES}") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LOCAL_CMAKE_MODULES}) +endif() + +set(Python3_FIND_STRATEGY "LOCATION") +set(Python3_FIND_REGISTRY "LAST") +set(Python3_FIND_FRAMEWORK "LAST") + +# Allow "make install" to not depend on all targets. +# +# Must be declared in the top-level CMakeLists.txt. +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true) + +set(CMAKE_MACOSX_RPATH 1) +if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) + set(CMAKE_OSX_DEPLOYMENT_TARGET $ENV{MACOSX_DEPLOYMENT_TARGET}) +else() + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) +endif() + +include(BuildUtils) + +# Cython generated code emits way to many warnings at CHECKIN and EVERYTHING +set(BUILD_WARNING_LEVEL "PRODUCTION") + +# If build in-source, create the latest symlink. If build out-of-source, which is +# preferred, simply output the binaries in the build folder +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) + set(BUILD_OUTPUT_ROOT_DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/build/${BUILD_SUBDIR_NAME}") + # Link build/latest to the current build directory, to avoid developers + # accidentally running the latest debug build when in fact they're building + # release builds. + file(MAKE_DIRECTORY ${BUILD_OUTPUT_ROOT_DIRECTORY}) + if(NOT APPLE) + set(MORE_ARGS "-T") + endif() + execute_process(COMMAND ln ${MORE_ARGS} -sf ${BUILD_OUTPUT_ROOT_DIRECTORY} + ${CMAKE_CURRENT_BINARY_DIR}/build/latest) +else() + set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${BUILD_SUBDIR_NAME}") +endif() + +message(STATUS "Generator: ${CMAKE_GENERATOR}") +message(STATUS "Build output directory: ${BUILD_OUTPUT_ROOT_DIRECTORY}") + +# where to put generated archives (.a files) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") +set(ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") + +# where to put generated libraries (.so files) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") +set(LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") + +# where to put generated binaries +set(EXECUTABLE_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}") + +# Python and Numpy libraries +find_package(Python3Alt REQUIRED) +include(UseCython) + +include_directories(SYSTEM ${NUMPY_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} src) +include_directories(SYSTEM ../../cpp-client/deephaven/client/include/public) + +#find_package(deephaven REQUIRED) +add_subdirectory(../../cpp-client/deephaven deephaven_dir) + +# Always bundle includes +#get_filename_component(DEEPHAVEN_INCLUDE_REALPATH "../../cpp-client/deephaven/client/include" REALPATH) +#file(COPY ${DEEPHAVEN_INCLUDE_REALPATH} DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY}/include) + +if(UNIX) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +endif() + +set(CYTHON_EXTENSIONS + # Add here to list as more pxd wrapping is done. + pydeephaven2) + +foreach(module ${CYTHON_EXTENSIONS}) + string(REPLACE "." ";" directories ${module}) + list(GET directories -1 module_name) + list(REMOVE_AT directories -1) + + string(REPLACE "." "/" module_root "${module}") + set(module_SRC ${CMAKE_PROJECT_NAME}/${module_root}.pyx) + set_source_files_properties(${module_SRC} PROPERTIES CYTHON_IS_CXX 1) + + cython_add_module(${module_name} ${module_name}_pyx ${module_name}_output ${module_SRC}) + + if(directories) + string(REPLACE ";" "/" module_output_directory ${directories}) + set_target_properties(${module_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY + ${module_output_directory}) + endif() + + target_link_libraries(${module_name} PRIVATE ${LINK_LIBS}) + + # Generated files will be moved to the right directory by setup.py. +endforeach(module) diff --git a/py/client2/README.md b/py/client2/README.md new file mode 100644 index 00000000000..bbf20b91f93 --- /dev/null +++ b/py/client2/README.md @@ -0,0 +1,34 @@ +Client using Cython-wrapped C++ code. + +To build the code in this directory, you need a python environment with cython and numpy. +Set the `CMAKE_PREFIX_PATH` environment variable to include all DH's cpp-client dependencies. +Your `CMAKE_PREFIX_PATH` should look something like: + +``` +CMAKE_PREFIX_PATH=\ +/home/cfs/dhcpp/local/abseil:\ +/home/cfs/dhcpp/local/arrow:\ +/home/cfs/dhcpp/local/boost:\ +/home/cfs/dhcpp/local/cares:\ +/home/cfs/dhcpp/local/flatbuffers:\ +/home/cfs/dhcpp/local/gflags:\ +/home/cfs/dhcpp/local/grpc:\ +/home/cfs/dhcpp/local/immer:\ +/home/cfs/dhcpp/local/protobuf:\ +/home/cfs/dhcpp/local/re2:\ +/home/cfs/dhcpp/local/zlib +``` + +(if you used `build-dependencies.sh` to build them, the value is printed at the end). +Then run: + +``` + $ python setup.py build_ext --inplace +``` + +Other environment variables useful for debugging: + +* `VERBOSE=1` prints detailed compiler invocations, including flags like `-I`. +* `PARALLEL=9` run up to 9 parallel processes, useful to speed up the compilation. Set the value to your number of CPUS + 1. +* `CMAKE_FLAGS=...` set to any desired value to pass down that flag to cmake; `--trace-expand` shows cmake decision as they are being made. + diff --git a/py/client2/cmake_modules/BuildUtils.cmake b/py/client2/cmake_modules/BuildUtils.cmake new file mode 100644 index 00000000000..cd8290d1bbb --- /dev/null +++ b/py/client2/cmake_modules/BuildUtils.cmake @@ -0,0 +1,936 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Common path suffixes to be searched by find_library or find_path. +# Windows artifacts may be found under "/Library", so +# search there as well. +set(ARROW_LIBRARY_PATH_SUFFIXES + "${CMAKE_LIBRARY_ARCHITECTURE}" + "lib/${CMAKE_LIBRARY_ARCHITECTURE}" + "lib64" + "lib32" + "lib" + "bin" + "Library" + "Library/lib" + "Library/bin") +set(ARROW_INCLUDE_PATH_SUFFIXES "include" "Library" "Library/include") + +set(ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS) +if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # boost/process/detail/windows/handle_workaround.hpp doesn't work + # without BOOST_USE_WINDOWS_H with MinGW because MinGW doesn't + # provide __kernel_entry without winternl.h. + # + # See also: + # https://github.com/boostorg/process/blob/develop/include/boost/process/detail/windows/handle_workaround.hpp + # + # You can use this like the following: + # + # target_compile_definitions(target PRIVATE + # ${ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS}) + list(APPEND ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS "BOOST_USE_WINDOWS_H=1") +endif() + +function(ADD_THIRDPARTY_LIB LIB_NAME) + set(options) + set(one_value_args SHARED_LIB STATIC_LIB) + set(multi_value_args DEPS INCLUDE_DIRECTORIES) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(ARG_STATIC_LIB AND ARG_SHARED_LIB) + set(AUG_LIB_NAME "${LIB_NAME}_static") + add_library(${AUG_LIB_NAME} STATIC IMPORTED) + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_LOCATION + "${ARG_STATIC_LIB}") + if(ARG_DEPS) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES + "${ARG_DEPS}") + endif() + message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}") + if(ARG_INCLUDE_DIRECTORIES) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${ARG_INCLUDE_DIRECTORIES}") + endif() + + set(AUG_LIB_NAME "${LIB_NAME}_shared") + add_library(${AUG_LIB_NAME} SHARED IMPORTED) + + if(WIN32) + # Mark the ".lib" location as part of a Windows DLL + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_IMPLIB + "${ARG_SHARED_LIB}") + else() + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_LOCATION + "${ARG_SHARED_LIB}") + endif() + if(ARG_DEPS) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES + "${ARG_DEPS}") + endif() + message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}") + if(ARG_INCLUDE_DIRECTORIES) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${ARG_INCLUDE_DIRECTORIES}") + endif() + elseif(ARG_STATIC_LIB) + set(AUG_LIB_NAME "${LIB_NAME}_static") + add_library(${AUG_LIB_NAME} STATIC IMPORTED) + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_LOCATION + "${ARG_STATIC_LIB}") + if(ARG_DEPS) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES + "${ARG_DEPS}") + endif() + message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}") + if(ARG_INCLUDE_DIRECTORIES) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${ARG_INCLUDE_DIRECTORIES}") + endif() + elseif(ARG_SHARED_LIB) + set(AUG_LIB_NAME "${LIB_NAME}_shared") + add_library(${AUG_LIB_NAME} SHARED IMPORTED) + + if(WIN32) + # Mark the ".lib" location as part of a Windows DLL + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_IMPLIB + "${ARG_SHARED_LIB}") + else() + set_target_properties(${AUG_LIB_NAME} PROPERTIES IMPORTED_LOCATION + "${ARG_SHARED_LIB}") + endif() + message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}") + if(ARG_DEPS) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES + "${ARG_DEPS}") + endif() + if(ARG_INCLUDE_DIRECTORIES) + set_target_properties(${AUG_LIB_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${ARG_INCLUDE_DIRECTORIES}") + endif() + else() + message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}") + endif() +endfunction() + +function(REUSE_PRECOMPILED_HEADER_LIB TARGET_NAME LIB_NAME) + if(ARROW_USE_PRECOMPILED_HEADERS) + target_precompile_headers(${TARGET_NAME} REUSE_FROM ${LIB_NAME}) + endif() +endfunction() + +# Based on MIT-licensed +# https://gist.github.com/cristianadam/ef920342939a89fae3e8a85ca9459b49 +function(create_merged_static_lib output_target) + set(options) + set(one_value_args NAME ROOT) + set(multi_value_args TO_MERGE) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + set(output_lib_path + ${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_STATIC_LIBRARY_PREFIX}${ARG_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + set(all_library_paths $) + foreach(lib ${ARG_TO_MERGE}) + list(APPEND all_library_paths $) + endforeach() + + if(APPLE) + set(BUNDLE_COMMAND "libtool" "-no_warning_for_no_symbols" "-static" "-o" + ${output_lib_path} ${all_library_paths}) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|GNU|Intel)$") + set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) + + file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") + file(APPEND ${ar_script_path}.in "ADDLIB $\n") + + foreach(lib ${ARG_TO_MERGE}) + file(APPEND ${ar_script_path}.in "ADDLIB $\n") + endforeach() + + file(APPEND ${ar_script_path}.in "SAVE\nEND\n") + file(GENERATE + OUTPUT ${ar_script_path} + INPUT ${ar_script_path}.in) + set(ar_tool ${CMAKE_AR}) + + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION) + set(ar_tool ${CMAKE_CXX_COMPILER_AR}) + endif() + + set(BUNDLE_COMMAND ${ar_tool} -M < ${ar_script_path}) + + elseif(MSVC) + if(NOT CMAKE_LIBTOOL) + find_program(lib_tool lib HINTS "${CMAKE_CXX_COMPILER}/..") + if("${lib_tool}" STREQUAL "lib_tool-NOTFOUND") + message(FATAL_ERROR "Cannot locate libtool to bundle libraries") + endif() + else() + set(${lib_tool} ${CMAKE_LIBTOOL}) + endif() + set(BUNDLE_TOOL ${lib_tool}) + set(BUNDLE_COMMAND ${BUNDLE_TOOL} /NOLOGO /OUT:${output_lib_path} + ${all_library_paths}) + else() + message(FATAL_ERROR "Unknown bundle scenario!") + endif() + + add_custom_command(COMMAND ${BUNDLE_COMMAND} + OUTPUT ${output_lib_path} + COMMENT "Bundling ${output_lib_path}" + VERBATIM) + + message(STATUS "Creating bundled static library target ${output_target} at ${output_lib_path}" + ) + + add_custom_target(${output_target} ALL DEPENDS ${output_lib_path}) + add_dependencies(${output_target} ${ARG_ROOT} ${ARG_TO_MERGE}) + install(FILES ${output_lib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endfunction() + +# \arg OUTPUTS list to append built targets to +function(ADD_ARROW_LIB LIB_NAME) + set(options) + set(one_value_args + BUILD_SHARED + BUILD_STATIC + CMAKE_PACKAGE_NAME + PKG_CONFIG_NAME + SHARED_LINK_FLAGS + PRECOMPILED_HEADER_LIB) + set(multi_value_args + SOURCES + PRECOMPILED_HEADERS + OUTPUTS + STATIC_LINK_LIBS + SHARED_LINK_LIBS + SHARED_PRIVATE_LINK_LIBS + EXTRA_INCLUDES + PRIVATE_INCLUDES + DEPENDENCIES + SHARED_INSTALL_INTERFACE_LIBS + STATIC_INSTALL_INTERFACE_LIBS + OUTPUT_PATH) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(ARG_OUTPUTS) + set(${ARG_OUTPUTS}) + endif() + + # Allow overriding ARROW_BUILD_SHARED and ARROW_BUILD_STATIC + if(DEFINED ARG_BUILD_SHARED) + set(BUILD_SHARED ${ARG_BUILD_SHARED}) + else() + set(BUILD_SHARED ${ARROW_BUILD_SHARED}) + endif() + if(DEFINED ARG_BUILD_STATIC) + set(BUILD_STATIC ${ARG_BUILD_STATIC}) + else() + set(BUILD_STATIC ${ARROW_BUILD_STATIC}) + endif() + if(ARG_OUTPUT_PATH) + set(OUTPUT_PATH ${ARG_OUTPUT_PATH}) + else() + set(OUTPUT_PATH ${BUILD_OUTPUT_ROOT_DIRECTORY}) + endif() + + if(WIN32 OR (CMAKE_GENERATOR STREQUAL Xcode)) + # We need to compile C++ separately for each library kind (shared and static) + # because of dllexport declarations on Windows. + # The Xcode generator doesn't reliably work with Xcode as target names are not + # guessed correctly. + set(USE_OBJLIB OFF) + else() + set(USE_OBJLIB ON) + endif() + + if(USE_OBJLIB) + # Generate a single "objlib" from all C++ modules and link + # that "objlib" into each library kind, to avoid compiling twice + add_library(${LIB_NAME}_objlib OBJECT ${ARG_SOURCES}) + # Necessary to make static linking into other shared libraries work properly + set_property(TARGET ${LIB_NAME}_objlib PROPERTY POSITION_INDEPENDENT_CODE 1) + if(ARG_DEPENDENCIES) + add_dependencies(${LIB_NAME}_objlib ${ARG_DEPENDENCIES}) + endif() + if(ARG_PRECOMPILED_HEADER_LIB) + reuse_precompiled_header_lib(${LIB_NAME}_objlib ${ARG_PRECOMPILED_HEADER_LIB}) + endif() + if(ARG_PRECOMPILED_HEADERS AND ARROW_USE_PRECOMPILED_HEADERS) + target_precompile_headers(${LIB_NAME}_objlib PRIVATE ${ARG_PRECOMPILED_HEADERS}) + endif() + set(LIB_DEPS $) + set(LIB_INCLUDES) + set(EXTRA_DEPS) + + if(ARG_OUTPUTS) + list(APPEND ${ARG_OUTPUTS} ${LIB_NAME}_objlib) + endif() + + if(ARG_EXTRA_INCLUDES) + target_include_directories(${LIB_NAME}_objlib SYSTEM PUBLIC ${ARG_EXTRA_INCLUDES}) + endif() + if(ARG_PRIVATE_INCLUDES) + target_include_directories(${LIB_NAME}_objlib PRIVATE ${ARG_PRIVATE_INCLUDES}) + endif() + else() + # Prepare arguments for separate compilation of static and shared libs below + # TODO: add PCH directives + set(LIB_DEPS ${ARG_SOURCES}) + set(EXTRA_DEPS ${ARG_DEPENDENCIES}) + + if(ARG_EXTRA_INCLUDES) + set(LIB_INCLUDES ${ARG_EXTRA_INCLUDES}) + endif() + endif() + + set(RUNTIME_INSTALL_DIR bin) + + if(BUILD_SHARED) + add_library(${LIB_NAME}_shared SHARED ${LIB_DEPS}) + if(EXTRA_DEPS) + add_dependencies(${LIB_NAME}_shared ${EXTRA_DEPS}) + endif() + + if(ARG_PRECOMPILED_HEADER_LIB) + reuse_precompiled_header_lib(${LIB_NAME}_shared ${ARG_PRECOMPILED_HEADER_LIB}) + endif() + + if(ARG_OUTPUTS) + list(APPEND ${ARG_OUTPUTS} ${LIB_NAME}_shared) + endif() + + if(LIB_INCLUDES) + target_include_directories(${LIB_NAME}_shared SYSTEM PUBLIC ${ARG_EXTRA_INCLUDES}) + endif() + + if(ARG_PRIVATE_INCLUDES) + target_include_directories(${LIB_NAME}_shared PRIVATE ${ARG_PRIVATE_INCLUDES}) + endif() + + # On iOS, specifying -undefined conflicts with enabling bitcode + if(APPLE + AND NOT IOS + AND NOT DEFINED ENV{EMSCRIPTEN}) + # On OS X, you can avoid linking at library load time and instead + # expecting that the symbols have been loaded separately. This happens + # with libpython* where there can be conflicts between system Python and + # the Python from a thirdparty distribution + # + # When running with the Emscripten Compiler, we need not worry about + # python, and the Emscripten Compiler does not support this option. + set(ARG_SHARED_LINK_FLAGS "-undefined dynamic_lookup ${ARG_SHARED_LINK_FLAGS}") + endif() + + set_target_properties(${LIB_NAME}_shared + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${OUTPUT_PATH}" + RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_PATH}" + PDB_OUTPUT_DIRECTORY "${OUTPUT_PATH}" + LINK_FLAGS "${ARG_SHARED_LINK_FLAGS}" + OUTPUT_NAME ${LIB_NAME} + VERSION "${ARROW_FULL_SO_VERSION}" + SOVERSION "${ARROW_SO_VERSION}") + + target_link_libraries(${LIB_NAME}_shared + LINK_PUBLIC + "$" + "$" + LINK_PRIVATE + ${ARG_SHARED_PRIVATE_LINK_LIBS}) + + if(ARROW_RPATH_ORIGIN) + if(APPLE) + set(_lib_install_rpath "@loader_path") + else() + set(_lib_install_rpath "\$ORIGIN") + endif() + set_target_properties(${LIB_NAME}_shared PROPERTIES INSTALL_RPATH + ${_lib_install_rpath}) + endif() + + if(APPLE) + if(ARROW_INSTALL_NAME_RPATH) + set(_lib_install_name "@rpath") + else() + set(_lib_install_name "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif() + set_target_properties(${LIB_NAME}_shared + PROPERTIES BUILD_WITH_INSTALL_RPATH ON INSTALL_NAME_DIR + "${_lib_install_name}") + endif() + + install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL} + EXPORT ${LIB_NAME}_targets + RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + if(BUILD_STATIC) + add_library(${LIB_NAME}_static STATIC ${LIB_DEPS}) + if(EXTRA_DEPS) + add_dependencies(${LIB_NAME}_static ${EXTRA_DEPS}) + endif() + + if(ARG_PRECOMPILED_HEADER_LIB) + reuse_precompiled_header_lib(${LIB_NAME}_static ${ARG_PRECOMPILED_HEADER_LIB}) + endif() + + if(ARG_OUTPUTS) + list(APPEND ${ARG_OUTPUTS} ${LIB_NAME}_static) + endif() + + if(LIB_INCLUDES) + target_include_directories(${LIB_NAME}_static SYSTEM PUBLIC ${ARG_EXTRA_INCLUDES}) + endif() + + if(ARG_PRIVATE_INCLUDES) + target_include_directories(${LIB_NAME}_static PRIVATE ${ARG_PRIVATE_INCLUDES}) + endif() + + if(MSVC_TOOLCHAIN) + set(LIB_NAME_STATIC ${LIB_NAME}_static) + else() + set(LIB_NAME_STATIC ${LIB_NAME}) + endif() + + if(ARROW_BUILD_STATIC AND WIN32) + target_compile_definitions(${LIB_NAME}_static PUBLIC ARROW_STATIC) + endif() + + set_target_properties(${LIB_NAME}_static + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${OUTPUT_PATH}" + OUTPUT_NAME ${LIB_NAME_STATIC}) + + if(ARG_STATIC_INSTALL_INTERFACE_LIBS) + target_link_libraries(${LIB_NAME}_static LINK_PUBLIC + "$") + endif() + + if(ARG_STATIC_LINK_LIBS) + target_link_libraries(${LIB_NAME}_static LINK_PRIVATE + "$") + endif() + + install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL} + EXPORT ${LIB_NAME}_targets + RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + if(ARG_CMAKE_PACKAGE_NAME) + arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}") + + set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake") + install(EXPORT ${LIB_NAME}_targets + FILE "${TARGETS_CMAKE}" + DESTINATION "${ARROW_CMAKE_INSTALL_DIR}") + + set(CONFIG_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Config.cmake") + set(BUILT_CONFIG_CMAKE "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_CMAKE}") + configure_package_config_file("${CONFIG_CMAKE}.in" "${BUILT_CONFIG_CMAKE}" + INSTALL_DESTINATION "${ARROW_CMAKE_INSTALL_DIR}") + install(FILES "${BUILT_CONFIG_CMAKE}" DESTINATION "${ARROW_CMAKE_INSTALL_DIR}") + + set(CONFIG_VERSION_CMAKE "${ARG_CMAKE_PACKAGE_NAME}ConfigVersion.cmake") + set(BUILT_CONFIG_VERSION_CMAKE "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_VERSION_CMAKE}") + write_basic_package_version_file( + "${BUILT_CONFIG_VERSION_CMAKE}" + VERSION ${${PROJECT_NAME}_VERSION} + COMPATIBILITY AnyNewerVersion) + install(FILES "${BUILT_CONFIG_VERSION_CMAKE}" + DESTINATION "${ARROW_CMAKE_INSTALL_DIR}") + endif() + + if(ARG_PKG_CONFIG_NAME) + arrow_add_pkg_config("${ARG_PKG_CONFIG_NAME}") + endif() + + # Modify variable in calling scope + if(ARG_OUTPUTS) + set(${ARG_OUTPUTS} + ${${ARG_OUTPUTS}} + PARENT_SCOPE) + endif() +endfunction() + +# +# Benchmarking +# +# Add a new micro benchmark, with or without an executable that should be built. +# If benchmarks are enabled then they will be run along side unit tests with ctest. +# 'make benchmark' and 'make unittest' to build/run only benchmark or unittests, +# respectively. +# +# REL_BENCHMARK_NAME is the name of the benchmark app. It may be a single component +# (e.g. monotime-benchmark) or contain additional components (e.g. +# net/net_util-benchmark). Either way, the last component must be a globally +# unique name. + +# The benchmark will registered as unit test with ctest with a label +# of 'benchmark'. +# +# Arguments after the test name will be passed to set_tests_properties(). +# +# \arg PREFIX a string to append to the name of the benchmark executable. For +# example, if you have src/arrow/foo/bar-benchmark.cc, then PREFIX "foo" will +# create test executable foo-bar-benchmark +# \arg LABELS the benchmark label or labels to assign the unit tests to. By +# default, benchmarks will go in the "benchmark" group. Custom targets for the +# group names must exist +function(ADD_BENCHMARK REL_BENCHMARK_NAME) + set(options) + set(one_value_args) + set(multi_value_args + EXTRA_LINK_LIBS + STATIC_LINK_LIBS + DEPENDENCIES + PREFIX + LABELS) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(NO_BENCHMARKS) + return() + endif() + get_filename_component(BENCHMARK_NAME ${REL_BENCHMARK_NAME} NAME_WE) + + if(ARG_PREFIX) + set(BENCHMARK_NAME "${ARG_PREFIX}-${BENCHMARK_NAME}") + endif() + + # Make sure the executable name contains only hyphens, not underscores + string(REPLACE "_" "-" BENCHMARK_NAME ${BENCHMARK_NAME}) + + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${REL_BENCHMARK_NAME}.cc) + # This benchmark has a corresponding .cc file, set it up as an executable. + set(BENCHMARK_PATH "${EXECUTABLE_OUTPUT_PATH}/${BENCHMARK_NAME}") + add_executable(${BENCHMARK_NAME} "${REL_BENCHMARK_NAME}.cc") + + if(ARG_STATIC_LINK_LIBS) + # Customize link libraries + target_link_libraries(${BENCHMARK_NAME} PRIVATE ${ARG_STATIC_LINK_LIBS}) + else() + target_link_libraries(${BENCHMARK_NAME} PRIVATE ${ARROW_BENCHMARK_LINK_LIBS}) + endif() + add_dependencies(benchmark ${BENCHMARK_NAME}) + set(NO_COLOR "--color_print=false") + + if(ARG_EXTRA_LINK_LIBS) + target_link_libraries(${BENCHMARK_NAME} PRIVATE ${ARG_EXTRA_LINK_LIBS}) + endif() + else() + # No executable, just invoke the benchmark (probably a script) directly. + set(BENCHMARK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${REL_BENCHMARK_NAME}) + set(NO_COLOR "") + endif() + + # With OSX and conda, we need to set the correct RPATH so that dependencies + # are found. The installed libraries with conda have an RPATH that matches + # for executables and libraries lying in $ENV{CONDA_PREFIX}/bin or + # $ENV{CONDA_PREFIX}/lib but our test libraries and executables are not + # installed there. + if(NOT "$ENV{CONDA_PREFIX}" STREQUAL "" AND APPLE) + set_target_properties(${BENCHMARK_NAME} + PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE + INSTALL_RPATH_USE_LINK_PATH TRUE + INSTALL_RPATH + "$ENV{CONDA_PREFIX}/lib;${EXECUTABLE_OUTPUT_PATH}") + endif() + + # Add test as dependency of relevant label targets + add_dependencies(all-benchmarks ${BENCHMARK_NAME}) + foreach(TARGET ${ARG_LABELS}) + add_dependencies(${TARGET} ${BENCHMARK_NAME}) + endforeach() + + if(ARG_DEPENDENCIES) + add_dependencies(${BENCHMARK_NAME} ${ARG_DEPENDENCIES}) + endif() + + if(ARG_LABELS) + set(ARG_LABELS "benchmark;${ARG_LABELS}") + else() + set(ARG_LABELS benchmark) + endif() + + add_test(${BENCHMARK_NAME} + ${BUILD_SUPPORT_DIR}/run-test.sh + ${CMAKE_BINARY_DIR} + benchmark + ${BENCHMARK_PATH} + ${NO_COLOR}) + set_property(TEST ${BENCHMARK_NAME} + APPEND + PROPERTY LABELS ${ARG_LABELS}) +endfunction() + +# +# Testing +# +# Add a new test case, with or without an executable that should be built. +# +# REL_TEST_NAME is the name of the test. It may be a single component +# (e.g. monotime-test) or contain additional components (e.g. +# net/net_util-test). Either way, the last component must be a globally +# unique name. +# +# If given, SOURCES is the list of C++ source files to compile into the test +# executable. Otherwise, "REL_TEST_NAME.cc" is used. +# +# The unit test is added with a label of "unittest" to support filtering with +# ctest. +# +# Arguments after the test name will be passed to set_tests_properties(). +# +# \arg ENABLED if passed, add this unit test even if ARROW_BUILD_TESTS is off +# \arg PREFIX a string to append to the name of the test executable. For +# example, if you have src/arrow/foo/bar-test.cc, then PREFIX "foo" will create +# test executable foo-bar-test +# \arg LABELS the unit test label or labels to assign the unit tests +# to. By default, unit tests will go in the "unittest" group, but if we have +# multiple unit tests in some subgroup, you can assign a test to multiple +# groups use the syntax unittest;GROUP2;GROUP3. Custom targets for the group +# names must exist +function(ADD_TEST_CASE REL_TEST_NAME) + set(options NO_VALGRIND ENABLED) + set(one_value_args PRECOMPILED_HEADER_LIB) + set(multi_value_args + SOURCES + PRECOMPILED_HEADERS + STATIC_LINK_LIBS + EXTRA_LINK_LIBS + EXTRA_INCLUDES + EXTRA_DEPENDENCIES + LABELS + EXTRA_LABELS + PREFIX) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(NO_TESTS AND NOT ARG_ENABLED) + return() + endif() + get_filename_component(TEST_NAME ${REL_TEST_NAME} NAME_WE) + + if(ARG_PREFIX) + set(TEST_NAME "${ARG_PREFIX}-${TEST_NAME}") + endif() + + if(ARG_SOURCES) + set(SOURCES ${ARG_SOURCES}) + else() + set(SOURCES "${REL_TEST_NAME}.cc") + endif() + + # Make sure the executable name contains only hyphens, not underscores + string(REPLACE "_" "-" TEST_NAME ${TEST_NAME}) + + set(TEST_PATH "${EXECUTABLE_OUTPUT_PATH}/${TEST_NAME}") + add_executable(${TEST_NAME} ${SOURCES}) + + # With OSX and conda, we need to set the correct RPATH so that dependencies + # are found. The installed libraries with conda have an RPATH that matches + # for executables and libraries lying in $ENV{CONDA_PREFIX}/bin or + # $ENV{CONDA_PREFIX}/lib but our test libraries and executables are not + # installed there. + if(NOT "$ENV{CONDA_PREFIX}" STREQUAL "" AND APPLE) + set_target_properties(${TEST_NAME} + PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE + INSTALL_RPATH_USE_LINK_PATH TRUE + INSTALL_RPATH + "${EXECUTABLE_OUTPUT_PATH};$ENV{CONDA_PREFIX}/lib") + endif() + + if(ARG_STATIC_LINK_LIBS) + # Customize link libraries + target_link_libraries(${TEST_NAME} PRIVATE ${ARG_STATIC_LINK_LIBS}) + else() + target_link_libraries(${TEST_NAME} PRIVATE ${ARROW_TEST_LINK_LIBS}) + endif() + + if(ARG_PRECOMPILED_HEADER_LIB) + reuse_precompiled_header_lib(${TEST_NAME} ${ARG_PRECOMPILED_HEADER_LIB}) + endif() + + if(ARG_PRECOMPILED_HEADERS AND ARROW_USE_PRECOMPILED_HEADERS) + target_precompile_headers(${TEST_NAME} PRIVATE ${ARG_PRECOMPILED_HEADERS}) + endif() + + if(ARG_EXTRA_LINK_LIBS) + target_link_libraries(${TEST_NAME} PRIVATE ${ARG_EXTRA_LINK_LIBS}) + endif() + + if(ARG_EXTRA_INCLUDES) + target_include_directories(${TEST_NAME} SYSTEM PUBLIC ${ARG_EXTRA_INCLUDES}) + endif() + + if(ARG_EXTRA_DEPENDENCIES) + add_dependencies(${TEST_NAME} ${ARG_EXTRA_DEPENDENCIES}) + endif() + + if(ARROW_TEST_MEMCHECK AND NOT ARG_NO_VALGRIND) + add_test(${TEST_NAME} + bash + -c + "cd '${CMAKE_SOURCE_DIR}'; \ + valgrind --suppressions=valgrind.supp --tool=memcheck --gen-suppressions=all \ + --num-callers=500 --leak-check=full --leak-check-heuristics=stdstring \ + --error-exitcode=1 ${TEST_PATH}") + elseif(WIN32) + add_test(${TEST_NAME} ${TEST_PATH}) + else() + add_test(${TEST_NAME} + ${BUILD_SUPPORT_DIR}/run-test.sh + ${CMAKE_BINARY_DIR} + test + ${TEST_PATH}) + endif() + + # Add test as dependency of relevant targets + add_dependencies(all-tests ${TEST_NAME}) + foreach(TARGET ${ARG_LABELS}) + add_dependencies(${TARGET} ${TEST_NAME}) + endforeach() + + set(LABELS) + list(APPEND LABELS "unittest") + if(ARG_LABELS) + list(APPEND LABELS ${ARG_LABELS}) + endif() + # EXTRA_LABELS don't create their own dependencies, they are only used + # to ease running certain test categories. + if(ARG_EXTRA_LABELS) + list(APPEND LABELS ${ARG_EXTRA_LABELS}) + endif() + + foreach(LABEL ${ARG_LABELS}) + # ensure there is a cmake target which exercises tests with this LABEL + set(LABEL_TEST_NAME "test-${LABEL}") + if(NOT TARGET ${LABEL_TEST_NAME}) + add_custom_target(${LABEL_TEST_NAME} + ctest -L "${LABEL}" --output-on-failure + USES_TERMINAL) + endif() + # ensure the test is (re)built before the LABEL test runs + add_dependencies(${LABEL_TEST_NAME} ${TEST_NAME}) + endforeach() + + set_property(TEST ${TEST_NAME} + APPEND + PROPERTY LABELS ${LABELS}) +endfunction() + +# +# Examples +# +# Add a new example, with or without an executable that should be built. +# If examples are enabled then they will be run along side unit tests with ctest. +# 'make runexample' to build/run only examples. +# +# REL_EXAMPLE_NAME is the name of the example app. It may be a single component +# (e.g. monotime-example) or contain additional components (e.g. +# net/net_util-example). Either way, the last component must be a globally +# unique name. + +# The example will registered as unit test with ctest with a label +# of 'example'. +# +# Arguments after the test name will be passed to set_tests_properties(). +# +# \arg PREFIX a string to append to the name of the example executable. For +# example, if you have src/arrow/foo/bar-example.cc, then PREFIX "foo" will +# create test executable foo-bar-example +function(ADD_ARROW_EXAMPLE REL_EXAMPLE_NAME) + set(options) + set(one_value_args) + set(multi_value_args EXTRA_LINK_LIBS DEPENDENCIES PREFIX) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(NO_EXAMPLES) + return() + endif() + get_filename_component(EXAMPLE_NAME ${REL_EXAMPLE_NAME} NAME_WE) + + if(ARG_PREFIX) + set(EXAMPLE_NAME "${ARG_PREFIX}-${EXAMPLE_NAME}") + endif() + + if(EXISTS ${CMAKE_SOURCE_DIR}/examples/arrow/${REL_EXAMPLE_NAME}.cc) + # This example has a corresponding .cc file, set it up as an executable. + set(EXAMPLE_PATH "${EXECUTABLE_OUTPUT_PATH}/${EXAMPLE_NAME}") + add_executable(${EXAMPLE_NAME} "${REL_EXAMPLE_NAME}.cc") + target_link_libraries(${EXAMPLE_NAME} ${ARROW_EXAMPLE_LINK_LIBS}) + add_dependencies(runexample ${EXAMPLE_NAME}) + set(NO_COLOR "--color_print=false") + + if(ARG_EXTRA_LINK_LIBS) + target_link_libraries(${EXAMPLE_NAME} ${ARG_EXTRA_LINK_LIBS}) + endif() + endif() + + if(ARG_DEPENDENCIES) + add_dependencies(${EXAMPLE_NAME} ${ARG_DEPENDENCIES}) + endif() + + add_test(${EXAMPLE_NAME} ${EXAMPLE_PATH}) + set_tests_properties(${EXAMPLE_NAME} PROPERTIES LABELS "example") +endfunction() + +# +# Fuzzing +# +# Add new fuzz target executable. +# +# The single source file must define a function: +# extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +# +# No main function must be present within the source file! +# +function(ADD_FUZZ_TARGET REL_FUZZING_NAME) + set(options) + set(one_value_args PREFIX) + set(multi_value_args LINK_LIBS) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(ARG_UNPARSED_ARGUMENTS) + message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif() + + if(NO_FUZZING) + return() + endif() + + get_filename_component(FUZZING_NAME ${REL_FUZZING_NAME} NAME_WE) + + # Make sure the executable name contains only hyphens, not underscores + string(REPLACE "_" "-" FUZZING_NAME ${FUZZING_NAME}) + + if(ARG_PREFIX) + set(FUZZING_NAME "${ARG_PREFIX}-${FUZZING_NAME}") + endif() + + # For OSS-Fuzz + # (https://google.github.io/oss-fuzz/advanced-topics/ideal-integration/) + if(DEFINED ENV{LIB_FUZZING_ENGINE}) + set(FUZZ_LDFLAGS $ENV{LIB_FUZZING_ENGINE}) + else() + set(FUZZ_LDFLAGS "-fsanitize=fuzzer") + endif() + + add_executable(${FUZZING_NAME} "${REL_FUZZING_NAME}.cc") + target_link_libraries(${FUZZING_NAME} ${LINK_LIBS}) + target_compile_options(${FUZZING_NAME} PRIVATE ${FUZZ_LDFLAGS}) + set_target_properties(${FUZZING_NAME} PROPERTIES LINK_FLAGS ${FUZZ_LDFLAGS} LABELS + "fuzzing") +endfunction() + +function(ARROW_INSTALL_ALL_HEADERS PATH) + set(options) + set(one_value_args) + set(multi_value_args PATTERN) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + if(NOT ARG_PATTERN) + # The .hpp extension is used by some vendored libraries + set(ARG_PATTERN "*.h" "*.hpp") + endif() + file(GLOB CURRENT_DIRECTORY_HEADERS ${ARG_PATTERN}) + + set(PUBLIC_HEADERS) + foreach(HEADER ${CURRENT_DIRECTORY_HEADERS}) + get_filename_component(HEADER_BASENAME ${HEADER} NAME) + if(HEADER_BASENAME MATCHES "internal") + continue() + endif() + list(APPEND PUBLIC_HEADERS ${HEADER}) + endforeach() + install(FILES ${PUBLIC_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PATH}") +endfunction() + +function(ARROW_ADD_PKG_CONFIG MODULE) + configure_file(${MODULE}.pc.in "${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") +endfunction() + +function(ARROW_INSTALL_CMAKE_FIND_MODULE MODULE) + install(FILES "${ARROW_SOURCE_DIR}/cmake_modules/Find${MODULE}.cmake" + DESTINATION "${ARROW_CMAKE_INSTALL_DIR}") +endfunction() + +# Implementations of lisp "car" and "cdr" functions +macro(ARROW_CAR var) + set(${var} ${ARGV1}) +endmacro() + +macro(ARROW_CDR var rest) + set(${var} ${ARGN}) +endmacro() diff --git a/py/client2/cmake_modules/FindPython3Alt.cmake b/py/client2/cmake_modules/FindPython3Alt.cmake new file mode 100644 index 00000000000..ab91c7be052 --- /dev/null +++ b/py/client2/cmake_modules/FindPython3Alt.cmake @@ -0,0 +1,96 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This module finds the libraries corresponding to the Python 3 interpreter +# and the NumPy package, and sets the following variables: +# - PYTHON_EXECUTABLE +# - PYTHON_INCLUDE_DIRS +# - PYTHON_LIBRARIES +# - PYTHON_OTHER_LIBS +# - NUMPY_INCLUDE_DIRS + +# Need CMake 3.15 or later for Python3_FIND_STRATEGY +if(${CMAKE_VERSION} VERSION_LESS "3.15.0") + # Use deprecated Python- and NumPy-finding code + if(Python3Alt_FIND_REQUIRED) + find_package(PythonLibsNew REQUIRED) + find_package(NumPy REQUIRED) + else() + find_package(PythonLibsNew) + find_package(NumPy) + endif() + find_package_handle_standard_args( + Python3Alt REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_INCLUDE_DIRS NUMPY_INCLUDE_DIRS) + return() +endif() + +if(${CMAKE_VERSION} VERSION_LESS "3.18.0" OR ARROW_BUILD_TESTS) + # When building arrow-python-test, we need libpython to be present, so ask for + # the full "Development" component. Also ask for it on CMake < 3.18, + # where "Development.Module" is not available. + if(Python3Alt_FIND_REQUIRED) + find_package(Python3 + COMPONENTS Interpreter Development NumPy + REQUIRED) + else() + find_package(Python3 COMPONENTS Interpreter Development NumPy) + endif() +else() + if(Python3Alt_FIND_REQUIRED) + find_package(Python3 + COMPONENTS Interpreter Development.Module NumPy + REQUIRED) + else() + find_package(Python3 COMPONENTS Interpreter Development.Module NumPy) + endif() +endif() + +if(NOT Python3_FOUND) + return() +endif() + +set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) +set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) +set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) +set(PYTHON_OTHER_LIBS) + +get_target_property(NUMPY_INCLUDE_DIRS Python3::NumPy INTERFACE_INCLUDE_DIRECTORIES) + +# CMake's python3_add_library() doesn't apply the required extension suffix, +# detect it ourselves. +# (https://gitlab.kitware.com/cmake/cmake/issues/20408) +execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" + "from distutils import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" + RESULT_VARIABLE _PYTHON_RESULT + OUTPUT_VARIABLE _PYTHON_STDOUT + ERROR_VARIABLE _PYTHON_STDERR) + +if(NOT _PYTHON_RESULT MATCHES 0) + if(Python3Alt_FIND_REQUIRED) + message(FATAL_ERROR "Python 3 config failure:\n${_PYTHON_STDERR}") + endif() +endif() + +string(STRIP ${_PYTHON_STDOUT} _EXT_SUFFIX) + +function(PYTHON_ADD_MODULE name) + python3_add_library(${name} MODULE ${ARGN}) + set_target_properties(${name} PROPERTIES SUFFIX ${_EXT_SUFFIX}) +endfunction() + +find_package_handle_standard_args( + Python3Alt REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_INCLUDE_DIRS NUMPY_INCLUDE_DIRS) diff --git a/py/client2/cmake_modules/UseCython.cmake b/py/client2/cmake_modules/UseCython.cmake new file mode 100644 index 00000000000..f2025efb4c9 --- /dev/null +++ b/py/client2/cmake_modules/UseCython.cmake @@ -0,0 +1,187 @@ +# Define a function to create Cython modules. +# +# For more information on the Cython project, see http://cython.org/. +# "Cython is a language that makes writing C extensions for the Python language +# as easy as Python itself." +# +# This file defines a CMake function to build a Cython Python module. +# To use it, first include this file. +# +# include( UseCython ) +# +# Then call cython_add_module to create a module. +# +# cython_add_module( ... ) +# +# Where is the desired name of the target for the resulting Python module, +# is the desired name of the target that runs the Cython compiler +# to generate the needed C or C++ files, is a variable to hold the +# files generated by Cython, and ... are source files +# to be compiled into the module, e.g. *.pyx, *.c, *.cxx, etc. +# only one .pyx file may be present for each target +# (this is an inherent limitation of Cython). +# +# The sample paths set with the CMake include_directories() command will be used +# for include directories to search for *.pxd when running the Cython compiler. +# +# Cache variables that effect the behavior include: +# +# CYTHON_ANNOTATE +# CYTHON_NO_DOCSTRINGS +# CYTHON_FLAGS +# +# Source file properties that effect the build process are +# +# CYTHON_IS_CXX +# CYTHON_IS_PUBLIC +# CYTHON_IS_API +# +# If this is set of a *.pyx file with CMake set_source_files_properties() +# command, the file will be compiled as a C++ file. +# +# See also FindCython.cmake + +#============================================================================= +# Copyright 2011 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Configuration options. +set(CYTHON_ANNOTATE OFF CACHE BOOL "Create an annotated .html file when compiling *.pyx.") +set(CYTHON_NO_DOCSTRINGS OFF CACHE BOOL "Strip docstrings from the compiled module.") +set(CYTHON_FLAGS "" CACHE STRING "Extra flags to the cython compiler.") +mark_as_advanced(CYTHON_ANNOTATE CYTHON_NO_DOCSTRINGS CYTHON_FLAGS) + +find_package(Python3Alt REQUIRED) + +# (using another C++ extension breaks coverage) +set(CYTHON_CXX_EXTENSION "cpp") +set(CYTHON_C_EXTENSION "c") + +# Create a *.c or *.cpp file from a *.pyx file. +# Input the generated file basename. The generate files will put into the variable +# placed in the "generated_files" argument. Finally all the *.py and *.pyx files. +function(compile_pyx + _name + pyx_target_name + generated_files + pyx_file) + # Default to assuming all files are C. + set(cxx_arg "") + set(extension ${CYTHON_C_EXTENSION}) + set(pyx_lang "C") + set(comment "Compiling Cython C source for ${_name}...") + + get_filename_component(pyx_file_basename "${pyx_file}" NAME_WE) + + # Determine if it is a C or C++ file. + get_source_file_property(property_is_cxx ${pyx_file} CYTHON_IS_CXX) + if(${property_is_cxx}) + set(cxx_arg "--cplus") + set(extension ${CYTHON_CXX_EXTENSION}) + set(pyx_lang "CXX") + set(comment "Compiling Cython CXX source for ${_name}...") + endif() + get_source_file_property(pyx_location ${pyx_file} LOCATION) + + set(output_file "${_name}.${extension}") + + # Set additional flags. + if(CYTHON_ANNOTATE) + set(annotate_arg "--annotate") + endif() + + if(CYTHON_NO_DOCSTRINGS) + set(no_docstrings_arg "--no-docstrings") + endif() + + if(NOT WIN32) + string( TOLOWER "${CMAKE_BUILD_TYPE}" build_type ) + if("${build_type}" STREQUAL "debug" + OR "${build_type}" STREQUAL "relwithdebinfo") + set(cython_debug_arg "--gdb") + endif() + endif() + + # Determining generated file names. + get_source_file_property(property_is_public ${pyx_file} CYTHON_PUBLIC) + get_source_file_property(property_is_api ${pyx_file} CYTHON_API) + if(${property_is_api}) + set(_generated_files "${output_file}" "${_name}.h" "${name}_api.h") + elseif(${property_is_public}) + set(_generated_files "${output_file}" "${_name}.h") + else() + set(_generated_files "${output_file}") + endif() + set_source_files_properties(${_generated_files} PROPERTIES GENERATED TRUE) + + if(NOT WIN32) + # Cython creates a lot of compiler warning detritus on clang + set_source_files_properties(${_generated_files} PROPERTIES COMPILE_FLAGS + -Wno-unused-function) + endif() + + set(${generated_files} ${_generated_files} PARENT_SCOPE) + + # Add the command to run the compiler. + add_custom_target( + ${pyx_target_name} + COMMAND ${PYTHON_EXECUTABLE} + -m + cython + ${cxx_arg} + ${annotate_arg} + ${no_docstrings_arg} + ${cython_debug_arg} + ${CYTHON_FLAGS} + # Necessary for autodoc of function arguments + --directive embedsignature=True + # Necessary for Cython code coverage + --working + ${CMAKE_CURRENT_SOURCE_DIR} + --output-file + "${CMAKE_CURRENT_BINARY_DIR}/${output_file}" + "${CMAKE_CURRENT_SOURCE_DIR}/${pyx_file}" + DEPENDS ${pyx_location} + # Do not specify byproducts for now since they don't work with the older + # version of cmake available in the apt repositories. + #BYPRODUCTS ${_generated_files} + COMMENT ${comment}) + + # Remove their visibility to the user. + set(corresponding_pxd_file "" CACHE INTERNAL "") + set(header_location "" CACHE INTERNAL "") + set(pxd_location "" CACHE INTERNAL "") +endfunction() + +# cython_add_module( src1 src2 ... srcN ) +# Build the Cython Python module. +function(cython_add_module _name pyx_target_name generated_files) + set(pyx_module_source "") + set(other_module_sources "") + foreach(_file ${ARGN}) + if(${_file} MATCHES ".*\\.py[x]?$") + list(APPEND pyx_module_source ${_file}) + else() + list(APPEND other_module_sources ${_file}) + endif() + endforeach() + compile_pyx(${_name} ${pyx_target_name} _generated_files ${pyx_module_source}) + set(${generated_files} ${_generated_files} PARENT_SCOPE) + include_directories(${PYTHON_INCLUDE_DIRS}) + python_add_module(${_name} ${_generated_files} ${other_module_sources}) + add_dependencies(${_name} ${pyx_target_name}) +endfunction() + +include(CMakeParseArguments) diff --git a/py/client2/pydeephaven2/.gitignore b/py/client2/pydeephaven2/.gitignore new file mode 100644 index 00000000000..52a221d90b7 --- /dev/null +++ b/py/client2/pydeephaven2/.gitignore @@ -0,0 +1 @@ +pydeephaven2.cpython-38-x86_64-linux-gnu.so diff --git a/py/client2/pydeephaven2/__init__.pxd b/py/client2/pydeephaven2/__init__.pxd new file mode 100644 index 00000000000..ea2afb45477 --- /dev/null +++ b/py/client2/pydeephaven2/__init__.pxd @@ -0,0 +1 @@ +#from pydeephaven2.includes.libdeephaven cimport (CDateTime) diff --git a/py/client2/pydeephaven2/__init__.py b/py/client2/pydeephaven2/__init__.py new file mode 100644 index 00000000000..ac5ec61e509 --- /dev/null +++ b/py/client2/pydeephaven2/__init__.py @@ -0,0 +1,30 @@ +#import gc as _gc +#import os as _os + +# ARROW-8684: Disable GC while initializing Cython extension module, +# to workaround Cython bug in https://github.com/cython/cython/issues/3603 +#_gc_enabled = _gc.isenabled() +#_gc.disable() +#import pydeephaven2.lib as _lib +#if _gc_enabled: +# _gc.enable() + +#from pydeephaven2.lib import (DateTime) + +def get_include(): + """ + Return absolute path to directory containing Arrow C++ include + headers. Similar to numpy.get_include + """ + return _os.path.join(_os.path.dirname(__file__), 'include') + +def get_libraries(): + """ + Return list of library names to include in the `libraries` argument for C + or Cython extensions using pydeephaven2 + """ + return ['pydeephaven2'] + +def get_library_dirs(): + package_cwd = _os.path.dirname(__file__) + library_dirs = [package_cwd] diff --git a/py/client2/pydeephaven2/includes/__init__.pxd b/py/client2/pydeephaven2/includes/__init__.pxd new file mode 100644 index 00000000000..e69de29bb2d diff --git a/py/client2/pydeephaven2/includes/libdeephaven.pxd b/py/client2/pydeephaven2/includes/libdeephaven.pxd new file mode 100644 index 00000000000..2b615112460 --- /dev/null +++ b/py/client2/pydeephaven2/includes/libdeephaven.pxd @@ -0,0 +1,18 @@ +# distutils: language = c++ + +from libc.stdint cimport int64_t + +# TODO: provide an include path to avoid hardcoding all over the place the common prefix. +cdef extern from "../../../../cpp-client/deephaven/client/src/types.cc": + pass + +cdef extern from "../../../../cpp-client/deephaven/client/include/public/deephaven/client/types.h" namespace "deephaven::client": + cdef cppclass CDateTime "deephaven::client::DateTime" nogil: + CDateTime() except + + CDateTime(int64_t) except + + CDateTime(int, int, int) except + + CDateTime(int, int, int, int, int, int) except + + CDateTime(int, int, int, int, int, int, long) except + + int64_t nanos() + @staticmethod + CDateTime fromNanos(long) diff --git a/py/client2/pydeephaven2/pydeephaven2.pyx b/py/client2/pydeephaven2/pydeephaven2.pyx new file mode 100644 index 00000000000..a3826fbc95e --- /dev/null +++ b/py/client2/pydeephaven2/pydeephaven2.pyx @@ -0,0 +1,3 @@ +# cython: language_level = 3 + +include "types.pxi" diff --git a/py/client2/pydeephaven2/types.pxi b/py/client2/pydeephaven2/types.pxi new file mode 100644 index 00000000000..09bc60508ef --- /dev/null +++ b/py/client2/pydeephaven2/types.pxi @@ -0,0 +1,28 @@ +# cython: profile=False +# distutils: language = c++ +# cython: language_level = 3 + +from libc.stdint cimport int64_t + +from pydeephaven2.includes.libdeephaven cimport CDateTime + +cdef class DateTime: + cdef CDateTime* c_datetime + + def __cinit__(self, int year=-1, int month=-1, int day=-1, int hour=-1, int minute=-1, int second=-1, long nanos=-1): + if year == -1 and month == -1 and day == -1 and hour == -1 and minute == -1 and second == -1: + if nanos == -1: + raise ValueError('nanos must be >= 0.') + self.c_datetime = new CDateTime(nanos) + return + if year != -1 or month != -1 or day != -1 or hour != -1 or minute != -1 or second != -1: + raise ValueError('Either all of (year,month,day,hour,minute,second) are provided or none of them are.') + if nanos == -1: + nanos = 0 + self.c_datetime = new CDateTime(year, month, day, hour, minute, second, nanos) + + def nanos(self): + return self.c_datetime.nanos() + + def __dealloc__(self): + del self.c_datetime diff --git a/py/client2/setup.py b/py/client2/setup.py new file mode 100644 index 00000000000..d0eb3eb0d2e --- /dev/null +++ b/py/client2/setup.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python + +import contextlib +import os +import os.path +from os.path import join as pjoin +import re +import shlex +import shutil +import sysconfig + +import pkg_resources +from setuptools import setup, Extension, Distribution + +from Cython.Distutils import build_ext as _build_ext +import Cython +from Cython.Build import cythonize + +project_name='pydeephaven2' + +ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') + +@contextlib.contextmanager +def changed_dir(dirname): + oldcwd = os.getcwd() + os.chdir(dirname) + try: + yield + finally: + os.chdir(oldcwd) + + +def strtobool(val): + """Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + """ + # Copied from distutils + val = val.lower() + if val in ('y', 'yes', 't', 'true', 'on', '1'): + return 1 + elif val in ('n', 'no', 'f', 'false', 'off', '0'): + return 0 + else: + raise ValueError("invalid truth value %r" % (val,)) + +class build_ext(_build_ext): + _found_names = () + def build_extensions(self): + numpy_incl = pkg_resources.resource_filename('numpy', 'core/include') + + self.extensions = [ext for ext in self.extensions + if ext.name != '__dummy__'] + + for ext in self.extensions: + if (hasattr(ext, 'include_dirs') and + numpy_incl not in ext.include_dirs): + ext.include_dirs.append(numpy_incl) + _build_ext.build_extensions(self) + + def run(self): + self._run_cmake() + _build_ext.run(self) + + def initialize_options(self): + self.extra_cmake_args = os.environ.get('CMAKE_OPTIONS', '') + self.build_type = os.environ.get('BUILD_TYPE', + 'release').lower() + self.bundle_cython_cpp = strtobool( + os.environ.get('BUNDLE_CYTHON_CPP', '0')) + _build_ext.initialize_options(self) + + MODULE_NAMES = [ project_name ] + + def _run_cmake(self): + # check if build_type is correctly passed / set + if self.build_type.lower() not in ('release', 'debug'): + raise ValueError("build_type needs to " + "be 'release' or 'debug'") + + # The directory containing this setup.py + source = os.path.dirname(os.path.abspath(__file__)) + + # The staging directory for the module being built + build_cmd = self.get_finalized_command('build') + build_temp = pjoin(os.getcwd(), build_cmd.build_temp) + build_lib = pjoin(os.getcwd(), build_cmd.build_lib) + saved_cwd = os.getcwd() + + if not os.path.isdir(build_temp): + self.mkpath(build_temp) + + # Change to the build directory + with changed_dir(build_temp): + # Detect if we built elsewhere + if os.path.isfile('CMakeCache.txt'): + cachefile = open('CMakeCache.txt', 'r') + cachedir = re.search('CMAKE_CACHEFILE_DIR:INTERNAL=(.*)', + cachefile.read()).group(1) + cachefile.close() + if (cachedir != build_temp): + return + + static_lib_option = '' + + cmake_options = [ + static_lib_option, + ] + + cmake_options.append('-DCMAKE_BUILD_TYPE={0}' + .format(self.build_type.lower())) + + build_tool_args = [] + build_tool_args.append('--') + if os.environ.get('VERBOSE', '0') == '1': + cmake_options.append('-DCMAKE_VERBOSE_MAKEFILE=ON') + if os.environ.get('CMAKE_PREFIX_PATH'): + cmake_options.append('-DCMAKE_PREFIX_PATH={0}' + .format(os.environ['CMAKE_PREFIX_PATH'])) + if os.environ.get('PARALLEL'): + build_tool_args.append( + '-j{0}'.format(os.environ['PARALLEL'])) + + extra_cmake_args = shlex.split(self.extra_cmake_args) + + # Generate the build files + print("-- Running cmake for " + project_name) + self.spawn(['cmake'] + extra_cmake_args + cmake_options + [source]) + print("-- Finished cmake for " + project_name) + + print("-- Running cmake --build for " + project_name) + self.spawn(['cmake', '--build', '.', '--config', self.build_type] + + build_tool_args) + print("-- Finished cmake --build for " + project_name) + + if self.inplace: + # a bit hacky + build_lib = saved_cwd + + # Move the libraries to the place expected by the Python build + try: + os.makedirs(pjoin(build_lib, project_name)) + except OSError: + pass + + # Move the built C-extension to the place expected by the Python + # build + self._found_names = [] + for name in self.MODULE_NAMES: + built_path = self.get_ext_built(name) + if not os.path.exists(built_path): + print('Did not find {0}'.format(built_path)) + raise RuntimeError('C-extension failed to build:', + os.path.abspath(built_path)) + + # The destination path to move the built C extension to + ext_path = pjoin(build_lib, self._get_cmake_ext_path(name)) + if os.path.exists(ext_path): + os.remove(ext_path) + self.mkpath(os.path.dirname(ext_path)) + + if self.bundle_cython_cpp: + self._bundle_cython_cpp(name, build_lib) + + print('Moving built C-extension', built_path, + 'to build path', ext_path) + shutil.move(built_path, ext_path) + self._found_names.append(name) + + if os.path.exists(self.get_ext_built_api_header(name)): + shutil.move(self.get_ext_built_api_header(name), + pjoin(os.path.dirname(ext_path), + name + '_api.h')) + + def get_names(self): + return self._found_names + + def get_outputs(self): + # Just the C extensions + # regular_exts = _build_ext.get_outputs(self) + return [self._get_cmake_ext_path(name) + for name in self.get_names()] + + def _get_build_dir(self): + # Get the package directory from build_py + build_py = self.get_finalized_command('build_py') + return build_py.get_package_dir(project_name) + + def get_ext_generated_cpp_source(self, name): + return pjoin(name + ".cpp") + + def get_ext_built_api_header(self, name): + return pjoin(name + "_api.h") + + def get_ext_built(self, name): + return name + ext_suffix + + def _get_cmake_ext_path(self, name): + # This is the name of the C-extension + filename = name + ext_suffix + return pjoin(self._get_build_dir(), filename) + +with open('README.md') as f: + long_description = f.read() + +class BinaryDistribution(Distribution): + def has_ext_modules(foo): + return True + +install_requires = () +setup_requires = [] +packages = [ project_name ] + +setup( + name=project_name, + packages=packages, + zip_safe=False, + package_data={project_name: ['*.pxd', '*.pyx', 'includes/*.pxd']}, + include_package_data=True, + distclass=BinaryDistribution, + # Dummy extension to trigger build_ext + ext_modules=[Extension('__dummy__', sources=[])], +# ext_modules=cythonize(Extension( +# project_name + ".pyx", +# sources=["../../cpp-client/deephaven/client/src/types.cc"], +# include_dirs=["../../cpp-client/deephaven/client/include/public" ], +# language="c++" +# )), + cmdclass={ + 'build_ext': build_ext + }, + install_requires=install_requires, + python_requires='>=3.7', + description='Python client library for Deephaven Community', + long_description=long_description, + long_description_content_type='text/markdown', + classifiers=[ + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + ], + license='source vailable', # TODO + maintainer='Deephaven', + maintainer_email='dev@deephaven.io', # TODO + url='https://deephaven.io/' +) From 56d9de572313cc1379d1ccdaef9bcba6a6a3a93b Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Mon, 25 Jul 2022 09:17:36 -0600 Subject: [PATCH 027/215] Remove np array unnecessary assignment on dt col (#2675) --- py/server/deephaven/numpy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py/server/deephaven/numpy.py b/py/server/deephaven/numpy.py index 1fc05cf5b87..a4758e1d65f 100644 --- a/py/server/deephaven/numpy.py +++ b/py/server/deephaven/numpy.py @@ -44,7 +44,6 @@ def column_to_numpy_array(col_def: Column, j_array: jpy.JType) -> np.ndarray: longs = _JPrimitiveArrayConversionUtility.translateArrayDateTimeToLong(j_array) np_long_array = np.frombuffer(longs, np.int64) np_array = np_long_array.view(col_def.data_type.np_type) - np_array[:] = np_long_array elif col_def.data_type == dtypes.bool_: bytes_ = _JPrimitiveArrayConversionUtility.translateArrayBooleanToByte(j_array) np_array = np.frombuffer(bytes_, col_def.data_type.np_type) From ee2e652a735e98753f2b305080ce7097a875509f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 25 Jul 2022 11:33:24 -0500 Subject: [PATCH 028/215] Extract DH testing server to a gradle extension for reuse (#2677) --- .../io.deephaven.deephaven-in-docker.gradle | 9 ++ .../docker/DeephavenInDockerExtension.groovy | 90 +++++++++++++++++++ py/client/build.gradle | 58 ++---------- 3 files changed, 107 insertions(+), 50 deletions(-) create mode 100644 buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle create mode 100644 buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy diff --git a/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle b/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle new file mode 100644 index 00000000000..7a9217f2cec --- /dev/null +++ b/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle @@ -0,0 +1,9 @@ +plugins { + id 'com.bmuschko.docker-remote-api' + id 'io.deephaven.project.register' + id 'license' +} + +import io.deephaven.tools.docker.DeephavenInDockerExtension + +project.extensions.create('deephavenDocker', DeephavenInDockerExtension, project) diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy new file mode 100644 index 00000000000..c43e9884e6a --- /dev/null +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy @@ -0,0 +1,90 @@ +package io.deephaven.tools.docker + +import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer +import com.bmuschko.gradle.docker.tasks.container.DockerRemoveContainer +import com.bmuschko.gradle.docker.tasks.container.DockerStartContainer +import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage +import com.bmuschko.gradle.docker.tasks.network.DockerCreateNetwork +import com.bmuschko.gradle.docker.tasks.network.DockerRemoveNetwork +import groovy.transform.CompileStatic +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.provider.Property +import org.gradle.api.tasks.TaskProvider + +import javax.inject.Inject + +/** + * Extension to manage tasks around starting and stopping a Deephaven Core instance. Presently, to enable support for + * python in the server, this uses docker. + * + * This isn't very configurable at this time, but the kinds of projects that will use this don't yet need a lot of + * flexibility. + */ +@CompileStatic +public abstract class DeephavenInDockerExtension { + final TaskProvider startTask + final TaskProvider healthyTask + final TaskProvider endTask + + final String deephavenServerProject + final String serverTask + + abstract Property getNetworkName() + + abstract Property getContainerName() + + abstract Property getAwaitStatusTimeout() + abstract Property getCheckInterval() + + @Inject + DeephavenInDockerExtension(Project project) { + awaitStatusTimeout.set 20 + checkInterval.set 100 + + // irritating configuration order of operations to work out here, so just leaving + // these as constants until we decide they aren't any more + deephavenServerProject = ':docker-server' + serverTask = 'buildDocker-server' + def serverProject = project.evaluationDependsOn(deephavenServerProject) + + def createDeephavenGrpcApiNetwork = project.tasks.register('createDeephavenGrpcApiNetwork', DockerCreateNetwork) { task -> + task.networkName.set networkName.get() + } + def removeDeephavenGrpcApiNetwork = project.tasks.register('removeDeephavenGrpcApiNetwork', DockerRemoveNetwork) {task -> + task.networkId.set networkName.get() + } + + def createDeephavenGrpcApi = project.tasks.register('createDeephavenGrpcApi', DockerCreateContainer) { task -> + DockerBuildImage grpcApiImage = serverProject.tasks.findByName(serverTask) as DockerBuildImage + + task.dependsOn(grpcApiImage, createDeephavenGrpcApiNetwork) + task.targetImageId grpcApiImage.getImageId() + task.containerName.set containerName.get() + task.hostConfig.network.set networkName.get() + } + + startTask = project.tasks.register('startDeephaven', DockerStartContainer) { task -> + task.dependsOn createDeephavenGrpcApi + task.containerId.set containerName.get() + } + + healthyTask = project.tasks.register('waitForHealthy', WaitForHealthyContainer) { task -> + task.dependsOn startTask + + task.awaitStatusTimeout.set this.awaitStatusTimeout.get() + task.checkInterval.set this.checkInterval.get() + + task.containerId.set containerName.get() + } + + endTask = project.tasks.register('stopDeephaven', DockerRemoveContainer) { task -> + task.dependsOn createDeephavenGrpcApi + task.finalizedBy removeDeephavenGrpcApiNetwork + + task.targetContainerId containerName.get() + task.force.set true + task.removeVolumes.set true + } + } +} diff --git a/py/client/build.gradle b/py/client/build.gradle index 6c0a6d6332c..c8e5ac392cf 100644 --- a/py/client/build.gradle +++ b/py/client/build.gradle @@ -1,14 +1,9 @@ -import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer -import com.bmuschko.gradle.docker.tasks.container.DockerStartContainer -import com.bmuschko.gradle.docker.tasks.container.DockerRemoveContainer -import com.bmuschko.gradle.docker.tasks.network.DockerCreateNetwork -import com.bmuschko.gradle.docker.tasks.network.DockerRemoveNetwork -import io.deephaven.tools.docker.WaitForHealthyContainer import io.deephaven.tools.docker.DiffTask plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.python-wheel' + id 'io.deephaven.deephaven-in-docker' } evaluationDependsOn Docker.registryProject('python') @@ -77,48 +72,12 @@ def updateProtobuf = tasks.register('updateProtobuf', Sync) { } // Start up a docker container for the grpc server, then run pydeephaven test -evaluationDependsOn(':docker-server') String randomSuffix = UUID.randomUUID().toString(); -String dockerContainerName = "pydeephaven-test-container-${randomSuffix}" -String dockerNetworkName = "pydeephaven-network-${randomSuffix}" -def createDeephavenGrpcApiNetwork = tasks.register('createDeephavenGrpcApiNetwork', DockerCreateNetwork) { - networkName.set dockerNetworkName +deephavenDocker { + containerName.set "pydeephaven-test-container-${randomSuffix}" + networkName.set "pydeephaven-network-${randomSuffix}" } -def removeDeephavenGrpcApiNetwork = tasks.register('removeDeephavenGrpcApiNetwork', DockerRemoveNetwork) { - networkId.set dockerNetworkName -} - -def createDeephavenGrpcApi = tasks.register('createDeephavenGrpcApi', DockerCreateContainer) { - def grpcApiImage = project(':docker-server').tasks.findByName('buildDocker-server')//docker-server-netty - dependsOn grpcApiImage, createDeephavenGrpcApiNetwork - targetImageId grpcApiImage.getImageId() - containerName.set dockerContainerName - hostConfig.network.set dockerNetworkName -} -def startDeephavenGrpcApi = tasks.register('startDeephavenGrpcApi', DockerStartContainer) { - dependsOn createDeephavenGrpcApi - containerId.set dockerContainerName -} -def waitForHealthy = tasks.register('waitForHealthy', WaitForHealthyContainer) { - dependsOn startDeephavenGrpcApi - - awaitStatusTimeout.set 20 - checkInterval.set 100 - containerId.set dockerContainerName -} -def stopDeephavenGrpcApi = tasks.register('stopDeephavenGrpcApi', DockerRemoveContainer) { - dependsOn createDeephavenGrpcApi - finalizedBy removeDeephavenGrpcApiNetwork - - targetContainerId dockerContainerName - force.set true - removeVolumes.set true - -// onError { t -> -// // ignore, container might not exist -// } -} tasks.getByName('check').dependsOn(Docker.registerDockerTask(project, 'testPyClient') { copyIn { from('pydeephaven') { @@ -128,16 +87,15 @@ tasks.getByName('check').dependsOn(Docker.registerDockerTask(project, 'testPyCli into 'project/tests' } } -// parentContainers = [ ] - containerDependencies.dependsOn = [waitForHealthy, createDeephavenGrpcApiNetwork] - containerDependencies.finalizedBy = stopDeephavenGrpcApi - network = dockerNetworkName + containerDependencies.dependsOn = [deephavenDocker.healthyTask] + containerDependencies.finalizedBy = deephavenDocker.endTask + network = deephavenDocker.networkName.get() dockerfile { from('deephaven/python:local-build') runCommand '''set -eux; \\ pip3 install unittest-xml-reporting==3.0.4 pyarrow==7.0.0 protobuf==3.20.1 grpcio==1.46.0 bitstring==3.1.9 pandas==1.2.5 timeout-decorator==0.5.0;\\ mkdir -p /out/report''' - environmentVariable 'DH_HOST', dockerContainerName + environmentVariable 'DH_HOST', deephavenDocker.containerName.get() environmentVariable 'DH_PORT', '8080' copyFile('project', '/project') From ae04f2db9f2f82e551f2f980bd757311d4ca0f36 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Mon, 25 Jul 2022 14:48:30 -0400 Subject: [PATCH 029/215] Update web to 0.15.1 (#2676) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.15.1 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 14809f6cdfd..7e7cf13d5fa 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.14.1 +ARG WEB_VERSION=0.15.1 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 198ddea6b06b38b60327fa4f7081f620b98f6d49 Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Mon, 25 Jul 2022 15:31:29 -0700 Subject: [PATCH 030/215] renamed Java updateBy objects (#2680) --- .../java/io/deephaven/engine/table/Table.java | 16 +-- .../engine/table/impl/DeferredViewTable.java | 4 +- .../engine/table/impl/QueryTable.java | 4 +- .../engine/table/impl/SimpleSourceTable.java | 4 +- .../engine/table/impl/TableWithDefaults.java | 15 +-- .../engine/table/impl/UncoalescedTable.java | 4 +- .../deephaven/engine/table/impl/UpdateBy.java | 4 +- .../table/impl/UpdateByOperatorFactory.java | 18 ++-- .../PartitionedTableProxyImpl.java | 17 +-- .../ema/BasePrimitiveEMAOperator.java | 6 +- .../updateby/ema/BigDecimalEMAOperator.java | 4 +- .../updateby/ema/BigIntegerEMAOperator.java | 4 +- .../updateby/ema/BigNumberEMAOperator.java | 6 +- .../impl/updateby/ema/ByteEMAOperator.java | 4 +- .../impl/updateby/ema/DoubleEMAOperator.java | 4 +- .../impl/updateby/ema/FloatEMAOperator.java | 4 +- .../impl/updateby/ema/IntEMAOperator.java | 4 +- .../impl/updateby/ema/LongEMAOperator.java | 4 +- .../impl/updateby/ema/ShortEMAOperator.java | 4 +- .../engine/util/GroovyDeephavenSession.java | 2 +- .../table/impl/updateby/TestCumMinMax.java | 18 ++-- .../table/impl/updateby/TestCumProd.java | 23 ++-- .../table/impl/updateby/TestCumSum.java | 20 ++-- .../engine/table/impl/updateby/TestEma.java | 100 +++++++++--------- .../table/impl/updateby/TestForwardFill.java | 24 ++--- .../impl/updateby/TestUpdateByGeneral.java | 20 ++-- .../io/deephaven/qst/table/TableBase.java | 16 +-- .../io/deephaven/qst/table/UpdateByTable.java | 10 +- .../qst/table/TableCreatorImplTest.java | 6 +- .../io/deephaven/api/TableOperations.java | 16 +-- .../deephaven/api/TableOperationsAdapter.java | 16 +-- ...Clause.java => ColumnUpdateOperation.java} | 6 +- ...{EmaControl.java => OperationControl.java} | 12 +-- ...teByClause.java => UpdateByOperation.java} | 56 +++++----- .../deephaven/api/updateby/spec/EmaSpec.java | 16 +-- .../api/updateby/spec/UpdateBySpec.java | 22 ++-- .../api/updateby/spec/UpdateBySpecBase.java | 18 ++-- 37 files changed, 269 insertions(+), 262 deletions(-) rename table-api/src/main/java/io/deephaven/api/updateby/{ColumnUpdateClause.java => ColumnUpdateOperation.java} (85%) rename table-api/src/main/java/io/deephaven/api/updateby/{EmaControl.java => OperationControl.java} (93%) rename table-api/src/main/java/io/deephaven/api/updateby/{UpdateByClause.java => UpdateByOperation.java} (74%) diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index 31bde70cab0..0cf7aa0336e 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -7,7 +7,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.liveness.LivenessNode; import io.deephaven.engine.rowset.TrackingRowSet; @@ -1735,7 +1735,7 @@ Table rollup(Collection aggregations, boolean includeCons * @return a table with the same rowset, with the specified operation applied to the entire table */ @ConcurrentMethod - Table updateBy(@NotNull final UpdateByClause operation); + Table updateBy(@NotNull final UpdateByOperation operation); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1747,7 +1747,7 @@ Table rollup(Collection aggregations, boolean includeCons * @return a table with the same rowset, with the specified operations applied to the entire table. */ @ConcurrentMethod - Table updateBy(@NotNull final Collection operations); + Table updateBy(@NotNull final Collection operations); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1761,7 +1761,7 @@ Table rollup(Collection aggregations, boolean includeCons */ @ConcurrentMethod Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations); + @NotNull final Collection operations); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1775,7 +1775,7 @@ Table updateBy(@NotNull final UpdateByControl control, * {@code byColumns} */ @ConcurrentMethod - Table updateBy(@NotNull final UpdateByClause operation, final String... byColumns); + Table updateBy(@NotNull final UpdateByOperation operation, final String... byColumns); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1789,7 +1789,7 @@ Table updateBy(@NotNull final UpdateByControl control, * {@code byColumns} */ @ConcurrentMethod - Table updateBy(@NotNull final Collection operations, final String... byColumns); + Table updateBy(@NotNull final Collection operations, final String... byColumns); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1803,7 +1803,7 @@ Table updateBy(@NotNull final UpdateByControl control, * {@code byColumns} */ @ConcurrentMethod - Table updateBy(@NotNull Collection operations, + Table updateBy(@NotNull Collection operations, @NotNull Collection byColumns); /** @@ -1820,7 +1820,7 @@ Table updateBy(@NotNull Collection operations, */ @ConcurrentMethod Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations, + @NotNull final Collection operations, @NotNull final Collection byColumns); // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java index ca4d8e8a58a..91ab507d77f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java @@ -5,7 +5,7 @@ import io.deephaven.api.Selectable; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.base.reference.SimpleReference; import io.deephaven.base.verify.Assert; @@ -269,7 +269,7 @@ protected Table redefine(TableDefinition newDefinitionExternal, TableDefinition @Override public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, + @NotNull final Collection ops, @NotNull final Collection byColumns) { return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), () -> UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control)); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index f2910f8eb36..6a909ba8cc1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -13,7 +13,7 @@ import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.agg.spec.AggSpecColumnReferences; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.Require; @@ -3024,7 +3024,7 @@ public R memoizeResult(MemoizedOperationKey memoKey, Supplier operation) @Override public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, + @NotNull final Collection ops, @NotNull final Collection byColumns) { return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), () -> UpdateBy.updateBy(this, ops, byColumns, control)); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java index 02d22a55443..dcd80d5eb42 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java @@ -7,7 +7,7 @@ import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.engine.updategraph.UpdateSourceRegistrar; import io.deephaven.engine.table.impl.locations.TableLocationProvider; @@ -68,7 +68,7 @@ protected final Table redefine(TableDefinition newDefinitionExternal, TableDefin @Override public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, + @NotNull final Collection ops, @NotNull final Collection byColumns) { return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), () -> UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control)); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java index b6a4adfbc9b..cde9c0d8713 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java @@ -7,7 +7,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.base.Pair; import io.deephaven.base.StringUtils; @@ -1121,34 +1121,35 @@ default Table rollup(Collection aggregations, boolean inc @ConcurrentMethod default Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations) { + @NotNull final Collection operations) { return updateBy(control, operations, Collections.emptyList()); } @ConcurrentMethod - default Table updateBy(@NotNull Collection operations, + default Table updateBy(@NotNull Collection operations, @NotNull Collection byColumns) { return updateBy(UpdateByControl.defaultInstance(), operations, byColumns); } @ConcurrentMethod - default Table updateBy(@NotNull final Collection operations, final String... byColumns) { + default Table updateBy(@NotNull final Collection operations, + final String... byColumns) { return updateBy(UpdateByControl.defaultInstance(), operations, Selectable.from(byColumns)); } @ConcurrentMethod - default Table updateBy(@NotNull final Collection operations) { + default Table updateBy(@NotNull final Collection operations) { return updateBy(UpdateByControl.defaultInstance(), operations, Collections.emptyList()); } @ConcurrentMethod - default Table updateBy(@NotNull final UpdateByClause operation, final String... byColumns) { + default Table updateBy(@NotNull final UpdateByOperation operation, final String... byColumns) { return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), Selectable.from(byColumns)); } @ConcurrentMethod - default Table updateBy(@NotNull final UpdateByClause operation) { + default Table updateBy(@NotNull final UpdateByOperation operation) { return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), Collections.emptyList()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java index 5446aaaab08..e1b41d511bc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java @@ -9,7 +9,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.base.verify.Assert; import io.deephaven.engine.liveness.Liveness; @@ -483,7 +483,7 @@ public Table treeTable(String idColumn, String parentColumn) { @Override @ConcurrentMethod public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, + @NotNull final Collection ops, @NotNull final Collection byColumns) { return UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java index 2ea7e478334..b0ec513f4bb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java @@ -3,7 +3,7 @@ import gnu.trove.map.hash.TObjectIntHashMap; import io.deephaven.api.Selectable; import io.deephaven.api.Strings; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; @@ -82,7 +82,7 @@ protected UpdateBy(@NotNull final UpdateByOperator[] operators, * @return a new table with the same index as the source with all the operations applied. */ public static Table updateBy(@NotNull final QueryTable source, - @NotNull final Collection clauses, + @NotNull final Collection clauses, @NotNull final Collection byColumns, @NotNull final UpdateByControl control) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java index 213a323f80e..429cf2644d5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java @@ -1,8 +1,8 @@ package io.deephaven.engine.table.impl; import io.deephaven.api.agg.Pair; -import io.deephaven.api.updateby.ColumnUpdateClause; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.ColumnUpdateOperation; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.api.updateby.spec.*; import io.deephaven.engine.table.ColumnSource; @@ -30,7 +30,7 @@ import static io.deephaven.util.QueryConstants.NULL_BYTE; /** - * A factory to visit all of the {@link UpdateByClause}s to produce a set of {@link UpdateByOperator}s that + * A factory to visit all of the {@link UpdateByOperation}s to produce a set of {@link UpdateByOperator}s that * {@link UpdateBy} can use to produce a result. */ public class UpdateByOperatorFactory { @@ -51,7 +51,7 @@ public UpdateByOperatorFactory(@NotNull final TableWithDefaults source, this.control = control; } - final Collection getOperators(@NotNull final Collection specs) { + final Collection getOperators(@NotNull final Collection specs) { final OperationVisitor v = new OperationVisitor(); specs.forEach(s -> s.walk(v)); return v.ops; @@ -102,17 +102,17 @@ static MatchPair[] createOneToOneMatchPairs(final @NotNull Table table, .toArray(MatchPair[]::new); } - public String describe(Collection clauses) { + public String describe(Collection clauses) { final Describer d = new Describer(); clauses.forEach(c -> c.walk(d)); return d.descriptionBuilder.toString(); } - private static class Describer implements UpdateByClause.Visitor { + private static class Describer implements UpdateByOperation.Visitor { final StringBuilder descriptionBuilder = new StringBuilder(); @Override - public Void visit(ColumnUpdateClause clause) { + public Void visit(ColumnUpdateOperation clause) { final MatchPair[] pairs = parseMatchPairs(clause.columns()); final String columnStr; if (pairs.length == 0) { @@ -126,7 +126,7 @@ public Void visit(ColumnUpdateClause clause) { } } - private class OperationVisitor implements UpdateBySpec.Visitor, UpdateByClause.Visitor { + private class OperationVisitor implements UpdateBySpec.Visitor, UpdateByOperation.Visitor { private final List ops = new ArrayList<>(); private MatchPair[] pairs; @@ -142,7 +142,7 @@ public boolean isTimeType(final @NotNull Class type) { } @Override - public Void visit(@NotNull final ColumnUpdateClause clause) { + public Void visit(@NotNull final ColumnUpdateOperation clause) { final UpdateBySpec spec = clause.spec(); pairs = createColumnsToAddIfMissing(source, parseMatchPairs(clause.columns()), spec, groupByColumns); spec.walk(this); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 23c7b1cc847..01bc079b000 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -7,7 +7,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.table.MatchPair; @@ -665,38 +665,39 @@ public PartitionedTable.Proxy aggBy(Collection aggregatio } @Override - public PartitionedTable.Proxy updateBy(UpdateByClause operation) { + public PartitionedTable.Proxy updateBy(UpdateByOperation operation) { return basicTransform(ct -> ct.updateBy(operation)); } @Override - public PartitionedTable.Proxy updateBy(UpdateByClause operation, String... byColumns) { + public PartitionedTable.Proxy updateBy(UpdateByOperation operation, String... byColumns) { return basicTransform(ct -> ct.updateBy(operation, byColumns)); } @Override - public PartitionedTable.Proxy updateBy(Collection operations) { + public PartitionedTable.Proxy updateBy(Collection operations) { return basicTransform(ct -> ct.updateBy(operations)); } @Override - public PartitionedTable.Proxy updateBy(Collection operations, String... byColumns) { + public PartitionedTable.Proxy updateBy(Collection operations, String... byColumns) { return basicTransform(ct -> ct.updateBy(operations, byColumns)); } @Override - public PartitionedTable.Proxy updateBy(Collection operations, + public PartitionedTable.Proxy updateBy(Collection operations, Collection byColumns) { return basicTransform(ct -> ct.updateBy(operations, byColumns)); } @Override - public PartitionedTable.Proxy updateBy(UpdateByControl control, Collection operations) { + public PartitionedTable.Proxy updateBy(UpdateByControl control, + Collection operations) { return basicTransform(ct -> ct.updateBy(control, operations)); } @Override - public PartitionedTable.Proxy updateBy(UpdateByControl control, Collection operations, + public PartitionedTable.Proxy updateBy(UpdateByControl control, Collection operations, Collection byColumns) { return basicTransform(ct -> ct.updateBy(control, operations, byColumns)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java index 273e2745d2b..5dec7ff97bd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BasePrimitiveEMAOperator.java @@ -1,5 +1,6 @@ package io.deephaven.engine.table.impl.updateby.ema; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.LongChunk; @@ -10,7 +11,6 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.api.updateby.BadDataBehavior; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.TableUpdate; import io.deephaven.engine.table.impl.UpdateBy; @@ -30,7 +30,7 @@ import static io.deephaven.util.QueryConstants.NULL_LONG; public abstract class BasePrimitiveEMAOperator extends BaseDoubleUpdateByOperator { - protected final EmaControl control; + protected final OperationControl control; protected final LongRecordingUpdateByOperator timeRecorder; protected final double timeScaleUnits; private LongArraySource bucketLastTimestamp; @@ -63,7 +63,7 @@ class EmaContext extends Context { */ public BasePrimitiveEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @Nullable final RowRedirection rowRedirection) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java index de7011ddcc7..3cb151c8a3e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigDecimalEMAOperator.java @@ -4,7 +4,7 @@ import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -31,7 +31,7 @@ public class BigDecimalEMAOperator extends BigNumberEMAOperator { */ public BigDecimalEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java index b61137c43d5..26a2676bc5e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigIntegerEMAOperator.java @@ -1,10 +1,10 @@ package io.deephaven.engine.table.impl.updateby.ema; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -31,7 +31,7 @@ public class BigIntegerEMAOperator extends BigNumberEMAOperator { */ public BigIntegerEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java index 90ccfd147e4..a0b93df7f53 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/BigNumberEMAOperator.java @@ -1,7 +1,7 @@ package io.deephaven.engine.table.impl.updateby.ema; import io.deephaven.api.updateby.BadDataBehavior; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.LongChunk; @@ -31,7 +31,7 @@ public abstract class BigNumberEMAOperator extends BaseObjectUpdateByOperator { protected final ColumnSource valueSource; - protected final EmaControl control; + protected final OperationControl control; protected final LongRecordingUpdateByOperator timeRecorder; protected final double timeScaleUnits; @@ -65,7 +65,7 @@ class EmaContext extends Context { */ public BigNumberEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java index 6948d38bf5c..4067dad979c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java @@ -10,7 +10,7 @@ import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -36,7 +36,7 @@ public class ByteEMAOperator extends BasePrimitiveEMAOperator { */ public ByteEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java index d09a101d815..cd477823b0c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/DoubleEMAOperator.java @@ -5,13 +5,13 @@ */ package io.deephaven.engine.table.impl.updateby.ema; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.api.updateby.BadDataBehavior; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -37,7 +37,7 @@ public class DoubleEMAOperator extends BasePrimitiveEMAOperator { */ public DoubleEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java index b26f5d5261d..5560ce36da0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/FloatEMAOperator.java @@ -1,12 +1,12 @@ package io.deephaven.engine.table.impl.updateby.ema; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.api.updateby.BadDataBehavior; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -32,7 +32,7 @@ public class FloatEMAOperator extends BasePrimitiveEMAOperator { */ public FloatEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java index 0de3ab53a3d..5f391dde775 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java @@ -10,7 +10,7 @@ import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -36,7 +36,7 @@ public class IntEMAOperator extends BasePrimitiveEMAOperator { */ public IntEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java index 924e6b92c92..d0e35e2dba0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java @@ -10,7 +10,7 @@ import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -36,7 +36,7 @@ public class LongEMAOperator extends BasePrimitiveEMAOperator { */ public LongEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ShortEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ShortEMAOperator.java index 126562f7d57..69877c4b1b8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ShortEMAOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ShortEMAOperator.java @@ -1,11 +1,11 @@ package io.deephaven.engine.table.impl.updateby.ema; +import io.deephaven.api.updateby.OperationControl; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; import io.deephaven.chunk.WritableDoubleChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -31,7 +31,7 @@ public class ShortEMAOperator extends BasePrimitiveEMAOperator { */ public ShortEMAOperator(@NotNull final MatchPair pair, @NotNull final String[] affectingColumns, - @NotNull final EmaControl control, + @NotNull final OperationControl control, @Nullable final LongRecordingUpdateByOperator timeRecorder, final long timeScaleUnits, @NotNull final ColumnSource valueSource, diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java index 3a4f88b60fc..ebad91480bd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java @@ -541,7 +541,7 @@ private Pair fullCommand(String command) { "import static io.deephaven.time.TimeZone.*;\n" + "import static io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils.*;\n" + "import static io.deephaven.api.agg.Aggregation.*;\n" + - "import static io.deephaven.api.updateby.UpdateByClause.*;\n" + + "import static io.deephaven.api.updateby.UpdateByOperation.*;\n" + StringUtils.joinStrings(scriptImports, "\n") + "\n"; return new Pair<>(commandPrefix, commandPrefix + command diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java index 8afe22afdd8..0583aaa3042 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumMinMax.java @@ -1,8 +1,8 @@ package io.deephaven.engine.table.impl.updateby; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; import io.deephaven.engine.table.impl.EvalNugget; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.TstUtils; @@ -30,10 +30,10 @@ public void testStaticZeroKey() { final QueryTable t = createTestTable(100000, false, false, false, 0x2134BCFA).t; final Table result = t.updateBy(List.of( - UpdateByClause.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", + UpdateByOperation.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", "longColMin=longCol", "floatColMin=floatCol", "doubleColMin=doubleCol", "bigIntColMin=bigIntCol", "bigDecimalColMin=bigDecimalCol"), - UpdateByClause.CumMax("byteColMax=byteCol", "shortColMax=shortCol", "intColMax=intCol", + UpdateByOperation.CumMax("byteColMax=byteCol", "shortColMax=shortCol", "intColMax=intCol", "longColMax=longCol", "floatColMax=floatCol", "doubleColMax=doubleCol", "bigIntColMax=bigIntCol", "bigDecimalColMax=bigDecimalCol"))); for (String col : t.getDefinition().getColumnNamesArray()) { @@ -63,10 +63,10 @@ private void doTestStaticBucketed(boolean grouped) { final QueryTable t = createTestTable(100000, true, grouped, false, 0xACDB4321).t; final Table result = t.updateBy(List.of( - UpdateByClause.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", + UpdateByOperation.CumMin("byteColMin=byteCol", "shortColMin=shortCol", "intColMin=intCol", "longColMin=longCol", "floatColMin=floatCol", "doubleColMin=doubleCol", "bigIntColMin=bigIntCol", "bigDecimalColMin=bigDecimalCol"), - UpdateByClause.CumMax("byteColMax=byteCol", "shortColMax=shortCol", "intColMax=intCol", + UpdateByOperation.CumMax("byteColMax=byteCol", "shortColMax=shortCol", "intColMax=intCol", "longColMax=longCol", "floatColMax=floatCol", "doubleColMax=doubleCol", "bigIntColMax=bigIntCol", "bigDecimalColMax=bigDecimalCol")), "Sym"); @@ -122,15 +122,15 @@ private void doTestTicking(boolean bucketed, boolean appendOnly) { new EvalNugget() { @Override protected Table e() { - return bucketed ? t.updateBy(UpdateByClause.CumMin(), "Sym") - : t.updateBy(UpdateByClause.CumMin()); + return bucketed ? t.updateBy(UpdateByOperation.CumMin(), "Sym") + : t.updateBy(UpdateByOperation.CumMin()); } }, new EvalNugget() { @Override protected Table e() { - return bucketed ? t.updateBy(UpdateByClause.CumMax(), "Sym") - : t.updateBy(UpdateByClause.CumMax()); + return bucketed ? t.updateBy(UpdateByOperation.CumMax(), "Sym") + : t.updateBy(UpdateByOperation.CumMax()); } } }; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java index a247a9bc0a8..9fa7acfed28 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java @@ -3,7 +3,7 @@ import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.function.Numeric; @@ -34,7 +34,7 @@ public class TestCumProd extends BaseUpdateByTest { @Test public void testStaticZeroKey() { final QueryTable t = createTestTable(1000, false, false, false, 0xABCD1234).t; - final Table result = t.updateBy(UpdateByClause.CumProd()); + final Table result = t.updateBy(UpdateByOperation.CumProd()); for (String col : t.getDefinition().getColumnNamesArray()) { if ("boolCol".equals(col)) { continue; @@ -64,9 +64,9 @@ public void testNullOnBucketChange() throws IOException { longCol("IntValProd", 1, 2, NULL_LONG, 3)); final Table r = t.updateBy(List.of( - UpdateByClause.CumProd("ByteValProd=ByteVal"), - UpdateByClause.CumProd("ShortValProd=ShortVal"), - UpdateByClause.CumProd("IntValProd=IntVal")), "Sym"); + UpdateByOperation.CumProd("ByteValProd=ByteVal"), + UpdateByOperation.CumProd("ShortValProd=ShortVal"), + UpdateByOperation.CumProd("IntValProd=IntVal")), "Sym"); assertTableEquals(expected, r); } @@ -84,8 +84,9 @@ public void testStaticGroupedBucketed() { private void doTestStaticBucketed(boolean grouped) { final QueryTable t = createTestTable(10000, true, grouped, false, 0x4321CBDA).t; - final Table result = t.updateBy(UpdateByClause.CumProd("byteCol", "shortCol", "intCol", "longCol", "floatCol", - "doubleCol", "bigIntCol", "bigDecimalCol"), "Sym"); + final Table result = + t.updateBy(UpdateByOperation.CumProd("byteCol", "shortCol", "intCol", "longCol", "floatCol", + "doubleCol", "bigIntCol", "bigDecimalCol"), "Sym"); final PartitionedTable preOp = t.partitionBy("Sym"); final PartitionedTable postOp = result.partitionBy("Sym"); @@ -125,8 +126,8 @@ private void doTestAppendOnly(boolean bucketed) { new EvalNugget() { @Override protected Table e() { - return bucketed ? t.updateBy(UpdateByClause.CumProd(), "Sym") - : t.updateBy(UpdateByClause.CumProd()); + return bucketed ? t.updateBy(UpdateByOperation.CumProd(), "Sym") + : t.updateBy(UpdateByOperation.CumProd()); } } }; @@ -147,7 +148,7 @@ public void testZeroKeyGeneralTicking() { new EvalNugget() { @Override protected Table e() { - return t.updateBy(UpdateByClause.CumProd()); + return t.updateBy(UpdateByOperation.CumProd()); } } }; @@ -169,7 +170,7 @@ public void testBucketedGeneralTicking() { new EvalNugget() { @Override protected Table e() { - return t.updateBy(UpdateByClause.CumProd(), "Sym"); + return t.updateBy(UpdateByOperation.CumProd(), "Sym"); } } }; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java index d7645099843..4f980c6a918 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java @@ -1,9 +1,9 @@ package io.deephaven.engine.table.impl.updateby; import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.function.Numeric; @@ -37,7 +37,7 @@ public void testStaticZeroKey() { final QueryTable t = createTestTable(100000, false, false, false, 0x31313131).t; t.setRefreshing(false); - final Table summed = t.updateBy(UpdateByClause.CumSum()); + final Table summed = t.updateBy(UpdateByOperation.CumSum()); for (String col : t.getDefinition().getColumnNamesArray()) { assertWithCumSum(t.getColumn(col).getDirect(), summed.getColumn(col).getDirect(), summed.getColumn(col).getType()); @@ -64,9 +64,9 @@ public void testNullOnBucketChange() throws IOException { longCol("IntValSum", 1, 3, NULL_LONG, 3)); final Table r = t.updateBy(List.of( - UpdateByClause.CumSum("ByteValSum=ByteVal"), - UpdateByClause.CumSum("ShortValSum=ShortVal"), - UpdateByClause.CumSum("IntValSum=IntVal")), "Sym"); + UpdateByOperation.CumSum("ByteValSum=ByteVal"), + UpdateByOperation.CumSum("ShortValSum=ShortVal"), + UpdateByOperation.CumSum("IntValSum=IntVal")), "Sym"); assertTableEquals(expected, r); } @@ -84,7 +84,7 @@ public void testStaticGroupedBucketed() { private void doTestStaticBucketed(boolean grouped) { final QueryTable t = createTestTable(100000, true, grouped, false, 0x31313131).t; - final Table summed = t.updateBy(UpdateByClause.CumSum("byteCol", "shortCol", "intCol", "longCol", "floatCol", + final Table summed = t.updateBy(UpdateByOperation.CumSum("byteCol", "shortCol", "intCol", "longCol", "floatCol", "doubleCol", "boolCol", "bigIntCol", "bigDecimalCol"), "Sym"); @@ -126,8 +126,8 @@ private void doTestAppendOnly(boolean bucketed) { new EvalNugget() { @Override protected Table e() { - return bucketed ? t.updateBy(UpdateByClause.CumSum(), "Sym") - : t.updateBy(UpdateByClause.CumSum()); + return bucketed ? t.updateBy(UpdateByOperation.CumSum(), "Sym") + : t.updateBy(UpdateByOperation.CumSum()); } } }; @@ -148,7 +148,7 @@ public void testZeroKeyGeneralTicking() { new EvalNugget() { @Override protected Table e() { - return t.updateBy(UpdateByClause.CumSum()); + return t.updateBy(UpdateByOperation.CumSum()); } } }; @@ -170,7 +170,7 @@ public void testBucketedGeneralTicking() { new EvalNugget() { @Override protected Table e() { - return t.updateBy(UpdateByClause.CumSum(), "Sym"); + return t.updateBy(UpdateByOperation.CumSum(), "Sym"); } } }; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java index a6650bb76d0..47b67ca78db 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java @@ -1,10 +1,10 @@ package io.deephaven.engine.table.impl.updateby; +import io.deephaven.api.updateby.OperationControl; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.api.updateby.BadDataBehavior; -import io.deephaven.api.updateby.EmaControl; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; import io.deephaven.engine.table.impl.EvalNugget; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.TableWithDefaults; @@ -47,11 +47,11 @@ public void testStaticZeroKey() { convertDateTime("2022-03-09T09:00:00.000 NY"), convertDateTime("2022-03-09T16:30:00.000 NY"))}).t; - final EmaControl skipControl = EmaControl.builder() + final OperationControl skipControl = OperationControl.builder() .onNullValue(BadDataBehavior.SKIP) .onNanValue(BadDataBehavior.SKIP).build(); - final EmaControl resetControl = EmaControl.builder() + final OperationControl resetControl = OperationControl.builder() .onNullValue(BadDataBehavior.RESET) .onNanValue(BadDataBehavior.RESET).build(); @@ -81,11 +81,11 @@ private void doTestStaticBucketed(boolean grouped) { convertDateTime("2022-03-09T09:00:00.000 NY"), convertDateTime("2022-03-09T16:30:00.000 NY"))}).t; - final EmaControl skipControl = EmaControl.builder() + final OperationControl skipControl = OperationControl.builder() .onNullValue(BadDataBehavior.SKIP) .onNanValue(BadDataBehavior.SKIP).build(); - final EmaControl resetControl = EmaControl.builder() + final OperationControl resetControl = OperationControl.builder() .onNullValue(BadDataBehavior.RESET) .onNanValue(BadDataBehavior.RESET).build(); computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, skipControl, "Sym"); @@ -97,48 +97,50 @@ private void doTestStaticBucketed(boolean grouped) { @Test public void testThrowBehaviors() { - final EmaControl throwControl = EmaControl.builder() + final OperationControl throwControl = OperationControl.builder() .onNullValue(BadDataBehavior.THROW).build(); final TableWithDefaults bytes = testTable(RowSetFactory.flat(4).toTracking(), byteCol("col", (byte) 0, (byte) 1, NULL_BYTE, (byte) 3)); assertThrows(TableDataException.class, - () -> bytes.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> bytes.updateBy(UpdateByOperation.Ema(throwControl, 10))); assertThrows(TableDataException.class, - () -> bytes.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> bytes.updateBy(UpdateByOperation.Ema(throwControl, 10))); TableWithDefaults shorts = testTable(RowSetFactory.flat(4).toTracking(), shortCol("col", (short) 0, (short) 1, NULL_SHORT, (short) 3)); assertThrows(TableDataException.class, - () -> shorts.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> shorts.updateBy(UpdateByOperation.Ema(throwControl, 10))); TableWithDefaults ints = testTable(RowSetFactory.flat(4).toTracking(), intCol("col", 0, 1, NULL_INT, 3)); assertThrows(TableDataException.class, - () -> ints.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> ints.updateBy(UpdateByOperation.Ema(throwControl, 10))); TableWithDefaults longs = testTable(RowSetFactory.flat(4).toTracking(), longCol("col", 0, 1, NULL_LONG, 3)); assertThrows(TableDataException.class, - () -> longs.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> longs.updateBy(UpdateByOperation.Ema(throwControl, 10))); TableWithDefaults floats = testTable(RowSetFactory.flat(4).toTracking(), floatCol("col", 0, 1, NULL_FLOAT, Float.NaN)); assertThrows(TableDataException.class, () -> floats.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.THROW).build(), 10)), + UpdateByOperation.Ema(OperationControl.builder().onNullValue(BadDataBehavior.THROW).build(), + 10)), "Encountered null value during EMA processing"); assertThrows(TableDataException.class, () -> floats.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.THROW).build(), 10)), + UpdateByOperation.Ema(OperationControl.builder().onNanValue(BadDataBehavior.THROW).build(), + 10)), "Encountered NaN value during EMA processing"); TableWithDefaults doubles = testTable(RowSetFactory.flat(4).toTracking(), @@ -146,12 +148,14 @@ public void testThrowBehaviors() { assertThrows(TableDataException.class, () -> doubles.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNullValue(BadDataBehavior.THROW).build(), 10)), + UpdateByOperation.Ema(OperationControl.builder().onNullValue(BadDataBehavior.THROW).build(), + 10)), "Encountered null value during EMA processing"); assertThrows(TableDataException.class, () -> doubles.updateBy( - UpdateByClause.Ema(EmaControl.builder().onNanValue(BadDataBehavior.THROW).build(), 10)), + UpdateByOperation.Ema(OperationControl.builder().onNanValue(BadDataBehavior.THROW).build(), + 10)), "Encountered NaN value during EMA processing"); @@ -159,13 +163,13 @@ public void testThrowBehaviors() { col("col", BigInteger.valueOf(0), BigInteger.valueOf(1), null, BigInteger.valueOf(3))); assertThrows(TableDataException.class, - () -> bi.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> bi.updateBy(UpdateByOperation.Ema(throwControl, 10))); TableWithDefaults bd = testTable(RowSetFactory.flat(4).toTracking(), col("col", BigDecimal.valueOf(0), BigDecimal.valueOf(1), null, BigDecimal.valueOf(3))); assertThrows(TableDataException.class, - () -> bd.updateBy(UpdateByClause.Ema(throwControl, 10))); + () -> bd.updateBy(UpdateByOperation.Ema(throwControl, 10))); } @Test @@ -220,21 +224,21 @@ public void testTimeThrowBehaviors() { private void testThrowsInternal(TableWithDefaults table) { assertThrows(TableDataException.class, - () -> table.updateBy(UpdateByClause.Ema( - EmaControl.builder().build(), "ts", 100)), + () -> table.updateBy(UpdateByOperation.Ema( + OperationControl.builder().build(), "ts", 100)), "Encountered negative delta time during EMA processing"); assertThrows(TableDataException.class, - () -> table.updateBy(UpdateByClause.Ema( - EmaControl.builder() + () -> table.updateBy(UpdateByOperation.Ema( + OperationControl.builder() .onNegativeDeltaTime(BadDataBehavior.SKIP) .onZeroDeltaTime(BadDataBehavior.THROW).build(), "ts", 100)), "Encountered zero delta time during EMA processing"); assertThrows(TableDataException.class, - () -> table.updateBy(UpdateByClause.Ema( - EmaControl.builder() + () -> table.updateBy(UpdateByOperation.Ema( + OperationControl.builder() .onNegativeDeltaTime(BadDataBehavior.SKIP) .onNullTime(BadDataBehavior.THROW).build(), "ts", 100)), @@ -282,35 +286,35 @@ public void testResetBehavior() { BigDecimal.valueOf(5))); // Test reset for NaN values - final EmaControl resetControl = EmaControl.builder() + final OperationControl resetControl = OperationControl.builder() .onNanValue(BadDataBehavior.RESET) .build(); TableWithDefaults input = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, Double.NaN, 1)); - Table result = input.updateBy(UpdateByClause.Ema(resetControl, 100)); + Table result = input.updateBy(UpdateByOperation.Ema(resetControl, 100)); expected = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, NULL_DOUBLE, 1)); assertTableEquals(expected, result); input = testTable(RowSetFactory.flat(3).toTracking(), floatCol("col", 0, Float.NaN, 1)); - result = input.updateBy(UpdateByClause.Ema(resetControl, 100)); + result = input.updateBy(UpdateByOperation.Ema(resetControl, 100)); expected = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, NULL_DOUBLE, 1)); assertTableEquals(expected, result); } private void testResetBehaviorInternal(Table expected, final ColumnHolder ts, final ColumnHolder col) { - final EmaControl resetControl = EmaControl.builder().onNegativeDeltaTime(BadDataBehavior.RESET) + final OperationControl resetControl = OperationControl.builder().onNegativeDeltaTime(BadDataBehavior.RESET) .onNullTime(BadDataBehavior.RESET) .onZeroDeltaTime(BadDataBehavior.RESET) .build(); TableWithDefaults input = testTable(RowSetFactory.flat(6).toTracking(), ts, col); - final Table result = input.updateBy(UpdateByClause.Ema(resetControl, "ts", 1_000_000_000)); + final Table result = input.updateBy(UpdateByOperation.Ema(resetControl, "ts", 1_000_000_000)); assertTableEquals(expected, result); } @Test public void testPoison() { - final EmaControl nanCtl = EmaControl.builder().onNanValue(BadDataBehavior.POISON) + final OperationControl nanCtl = OperationControl.builder().onNanValue(BadDataBehavior.POISON) .onNullValue(BadDataBehavior.RESET) .onNullTime(BadDataBehavior.RESET) .onNegativeDeltaTime(BadDataBehavior.RESET) @@ -320,9 +324,9 @@ public void testPoison() { doubleCol("col", 0, Double.NaN, NULL_DOUBLE, Double.NaN, Double.NaN)); TableWithDefaults input = testTable(RowSetFactory.flat(5).toTracking(), doubleCol("col", 0, Double.NaN, NULL_DOUBLE, Double.NaN, 4)); - assertTableEquals(expected, input.updateBy(UpdateByClause.Ema(nanCtl, 10))); + assertTableEquals(expected, input.updateBy(UpdateByOperation.Ema(nanCtl, 10))); input = testTable(RowSetFactory.flat(5).toTracking(), floatCol("col", 0, Float.NaN, NULL_FLOAT, Float.NaN, 4)); - assertTableEquals(expected, input.updateBy(UpdateByClause.Ema(nanCtl, 10))); + assertTableEquals(expected, input.updateBy(UpdateByOperation.Ema(nanCtl, 10))); final ColumnHolder ts = col("ts", convertDateTime("2022-03-11T09:30:00.000 NY"), @@ -336,12 +340,12 @@ public void testPoison() { doubleCol("col", 0, Double.NaN, NULL_DOUBLE, Double.NaN, Double.NaN, NULL_DOUBLE)); input = testTable(RowSetFactory.flat(6).toTracking(), ts, doubleCol("col", 0, Double.NaN, 2, Double.NaN, 4, 5)); - Table result = input.updateBy(UpdateByClause.Ema(nanCtl, "ts", 10)); + Table result = input.updateBy(UpdateByOperation.Ema(nanCtl, "ts", 10)); assertTableEquals(expected, result); input = testTable(RowSetFactory.flat(6).toTracking(), ts, floatCol("col", 0, Float.NaN, 2, Float.NaN, 4, 5)); - assertTableEquals(expected, input.updateBy(UpdateByClause.Ema(nanCtl, "ts", 10))); + assertTableEquals(expected, input.updateBy(UpdateByOperation.Ema(nanCtl, "ts", 10))); } // endregion @@ -380,11 +384,11 @@ private void doTestTicking(boolean bucketed, boolean appendOnly) { timeResult.t.setAttribute(Table.ADD_ONLY_TABLE_ATTRIBUTE, Boolean.TRUE); } - final EmaControl skipControl = EmaControl.builder() + final OperationControl skipControl = OperationControl.builder() .onNullValue(BadDataBehavior.SKIP) .onNanValue(BadDataBehavior.SKIP).build(); - final EmaControl resetControl = EmaControl.builder() + final OperationControl resetControl = OperationControl.builder() .onNullValue(BadDataBehavior.RESET) .onNanValue(BadDataBehavior.RESET).build(); @@ -393,16 +397,16 @@ private void doTestTicking(boolean bucketed, boolean appendOnly) { @Override protected Table e() { return bucketed - ? tickResult.t.updateBy(UpdateByClause.Ema(skipControl, 100), "Sym") - : tickResult.t.updateBy(UpdateByClause.Ema(skipControl, 100)); + ? tickResult.t.updateBy(UpdateByOperation.Ema(skipControl, 100), "Sym") + : tickResult.t.updateBy(UpdateByOperation.Ema(skipControl, 100)); } }, new EvalNugget() { @Override protected Table e() { return bucketed - ? tickResult.t.updateBy(UpdateByClause.Ema(resetControl, 100), "Sym") - : tickResult.t.updateBy(UpdateByClause.Ema(resetControl, 100)); + ? tickResult.t.updateBy(UpdateByOperation.Ema(resetControl, 100), "Sym") + : tickResult.t.updateBy(UpdateByOperation.Ema(resetControl, 100)); } } }; @@ -416,8 +420,8 @@ protected Table e() { base = (TableWithDefaults) base.sort("ts"); } return bucketed - ? base.updateBy(UpdateByClause.Ema(skipControl, "ts", 10 * MINUTE), "Sym") - : base.updateBy(UpdateByClause.Ema(skipControl, "ts", 10 * MINUTE)); + ? base.updateBy(UpdateByOperation.Ema(skipControl, "ts", 10 * MINUTE), "Sym") + : base.updateBy(UpdateByOperation.Ema(skipControl, "ts", 10 * MINUTE)); } }, new EvalNugget() { @@ -428,8 +432,8 @@ protected Table e() { base = (TableWithDefaults) base.sort("ts"); } return bucketed - ? base.updateBy(UpdateByClause.Ema(resetControl, "ts", 10 * MINUTE), "Sym") - : base.updateBy(UpdateByClause.Ema(resetControl, "ts", 10 * MINUTE)); + ? base.updateBy(UpdateByOperation.Ema(resetControl, "ts", 10 * MINUTE), "Sym") + : base.updateBy(UpdateByOperation.Ema(resetControl, "ts", 10 * MINUTE)); } } }; @@ -460,7 +464,7 @@ protected Table e() { private void computeEma(TableWithDefaults source, final String tsCol, long scale, - EmaControl control, + OperationControl control, String... groups) { final boolean useTicks = StringUtils.isNullOrEmpty(tsCol); final ByEmaSimple bes = new ByEmaSimple( @@ -501,11 +505,11 @@ private void computeEma(TableWithDefaults source, "bigIntCol= Double.isNaN(bigIntCol) ? NULL_DOUBLE : bigIntCol", "bigDecimalCol= Double.isNaN(bigDecimalCol) ? NULL_DOUBLE : bigDecimalCol"); - final UpdateByClause emaClause; + final UpdateByOperation emaClause; if (useTicks) { - emaClause = UpdateByClause.Ema(control, scale); + emaClause = UpdateByOperation.Ema(control, scale); } else { - emaClause = UpdateByClause.Ema(control, tsCol, scale); + emaClause = UpdateByOperation.Ema(control, tsCol, scale); } final Table result = source.updateBy(emaClause, groups) diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java index 88f3761913a..6b7cb692f80 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java @@ -1,10 +1,10 @@ package io.deephaven.engine.table.impl.updateby; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.TableTools; @@ -37,7 +37,7 @@ public void testStaticZeroKey() { final QueryTable t = createTestTable(100000, true, false, false, 0x507A70, new String[] {"charCol"}, new TstUtils.Generator[] {new TstUtils.CharGenerator('A', 'Z', .1)}).t; - final Table filled = t.updateBy(UpdateByClause.Fill()); + final Table filled = t.updateBy(UpdateByOperation.Fill()); for (String col : t.getDefinition().getColumnNamesArray()) { assertWithForwardFill(t.getColumn(col).getDirect(), filled.getColumn(col).getDirect()); } @@ -50,7 +50,7 @@ public void testNoKeyAddOnly() throws Exception { stringCol("Sentinel", null, null, null, "G", "H", null, "K", "L"), intCol("Val", 1, 3, 5, NULL_INT, NULL_INT, 9, 10, NULL_INT)); - final Table result = src.updateBy(UpdateByClause.Fill()); + final Table result = src.updateBy(UpdateByOperation.Fill()); final TableUpdateValidator validator = TableUpdateValidator.make((QueryTable) result); final FailureListener failureListener = new FailureListener(); validator.getResultTable().listenForUpdates(failureListener); @@ -108,7 +108,7 @@ public void testNoKeyAddAndRemoves() throws Exception { stringCol("Sentinel", null, null, null, "G", "H", null, "K", "L"), intCol("Val", 1, 3, 5, NULL_INT, NULL_INT, 9, 10, NULL_INT)); - final Table result = src.updateBy(UpdateByClause.Fill()); + final Table result = src.updateBy(UpdateByOperation.Fill()); final TableUpdateValidator validator = TableUpdateValidator.make((QueryTable) result); final FailureListener failureListener = new FailureListener(); validator.getResultTable().listenForUpdates(failureListener); @@ -160,7 +160,7 @@ public void testNoKeyGeneral() throws Exception { stringCol("Sentinel", null, null, null, "G", "H", null, "time toK", "L"), intCol("Val", 1, 3, 5, NULL_INT, NULL_INT, 9, 10, NULL_INT)); - final Table result = src.updateBy(UpdateByClause.Fill()); + final Table result = src.updateBy(UpdateByOperation.Fill()); final TableUpdateValidator validator = TableUpdateValidator.make((QueryTable) result); final FailureListener failureListener = new FailureListener(); validator.getResultTable().listenForUpdates(failureListener); @@ -232,7 +232,7 @@ public void testNoKeyModifyWithPreviousNoChange() throws Exception { stringCol("Sentinel", "A", "B", "C", "D", "E", null, "G"), intCol("Val", 0, 1, 2, 3, 4, 5, 6)); - final Table result = src.updateBy(UpdateByClause.Fill()); + final Table result = src.updateBy(UpdateByOperation.Fill()); updateAndValidate(src, result, () -> { final RowSet idx = i(2, 3, 4); addToTable(src, idx, @@ -259,12 +259,12 @@ private void doTestNoKeyIncremental(String context, int steps, int size, int see final EvalNuggetInterface[] en = new EvalNuggetInterface[] { new EvalNugget() { public Table e() { - return queryTable.updateBy(UpdateByClause.Fill()); + return queryTable.updateBy(UpdateByOperation.Fill()); } }, new EvalNugget() { public Table e() { - return ((TableWithDefaults) queryTable.sort("intCol")).updateBy(UpdateByClause.Fill()); + return ((TableWithDefaults) queryTable.sort("intCol")).updateBy(UpdateByOperation.Fill()); } }, }; @@ -328,7 +328,7 @@ public void testStaticBucketed() { final QueryTable t = createTestTable(100000, true, false, false, 0x507A70, new String[] {"charCol"}, new Generator[] {new CharGenerator('A', 'Z', .1)}).t; - final Table filled = t.updateBy(UpdateByClause.Fill(), "Sym"); + final Table filled = t.updateBy(UpdateByOperation.Fill(), "Sym"); final PartitionedTable preOp = t.partitionBy("Sym"); final PartitionedTable postOp = filled.partitionBy("Sym"); @@ -349,7 +349,7 @@ public void testStaticGroupedBucketed() { final QueryTable t = createTestTable(100000, true, true, false, 0x507A70, new String[] {"charCol"}, new Generator[] {new CharGenerator('A', 'Z', .1)}).t; - final Table filled = t.updateBy(UpdateByClause.Fill(), "Sym"); + final Table filled = t.updateBy(UpdateByOperation.Fill(), "Sym"); final PartitionedTable preOp = t.partitionBy("Sym"); final PartitionedTable postOp = filled.partitionBy("Sym"); @@ -385,8 +385,8 @@ private void doTestAppendOnly(boolean bucketed) { new EvalNugget() { @Override protected Table e() { - return bucketed ? t.updateBy(UpdateByClause.Fill(), "Sym") - : t.updateBy(UpdateByClause.Fill()); + return bucketed ? t.updateBy(UpdateByOperation.Fill(), "Sym") + : t.updateBy(UpdateByOperation.Fill()); } } }; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java index e0b0b3f4f3b..18a8715c9f0 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java @@ -2,9 +2,9 @@ import io.deephaven.api.Selectable; import io.deephaven.api.updateby.BadDataBehavior; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.Table; -import io.deephaven.api.updateby.UpdateByClause; import io.deephaven.engine.table.impl.EvalNugget; import io.deephaven.engine.table.impl.TableWithDefaults; import io.deephaven.engine.table.impl.TstUtils; @@ -72,7 +72,7 @@ private void doTestTicking(boolean redirected, boolean bucketed, boolean appendO result.t.setAttribute(Table.ADD_ONLY_TABLE_ATTRIBUTE, Boolean.TRUE); } - final EmaControl skipControl = EmaControl.builder() + final OperationControl skipControl = OperationControl.builder() .onNullValue(BadDataBehavior.SKIP) .onNanValue(BadDataBehavior.SKIP).build(); @@ -88,14 +88,14 @@ protected Table e() { } final String[] columnNamesArray = base.getDefinition().getColumnNamesArray(); - final Collection clauses = List.of( - UpdateByClause.Fill(), - UpdateByClause.Ema(skipControl, "ts", 10 * MINUTE, + final Collection clauses = List.of( + UpdateByOperation.Fill(), + UpdateByOperation.Ema(skipControl, "ts", 10 * MINUTE, makeOpColNames(columnNamesArray, "_ema", "Sym", "ts", "boolCol")), - UpdateByClause.CumSum(makeOpColNames(columnNamesArray, "_sum", "Sym", "ts")), - UpdateByClause.CumMin(makeOpColNames(columnNamesArray, "_min", "boolCol")), - UpdateByClause.CumMax(makeOpColNames(columnNamesArray, "_max", "boolCol")), - UpdateByClause + UpdateByOperation.CumSum(makeOpColNames(columnNamesArray, "_sum", "Sym", "ts")), + UpdateByOperation.CumMin(makeOpColNames(columnNamesArray, "_min", "boolCol")), + UpdateByOperation.CumMax(makeOpColNames(columnNamesArray, "_max", "boolCol")), + UpdateByOperation .CumProd(makeOpColNames(columnNamesArray, "_prod", "Sym", "ts", "boolCol"))); final UpdateByControl control = UpdateByControl.builder().useRedirection(redirected).build(); return bucketed diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index 30bfb5dcace..59b645e94da 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -14,7 +14,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.qst.TableCreationLogic; @@ -457,7 +457,7 @@ public final AggregationTable aggBy(Collection aggregatio } @Override - public final UpdateByTable updateBy(UpdateByClause operation) { + public final UpdateByTable updateBy(UpdateByOperation operation) { return UpdateByTable.builder() .parent(this) .addOperations(operation) @@ -465,7 +465,7 @@ public final UpdateByTable updateBy(UpdateByClause operation) { } @Override - public final UpdateByTable updateBy(UpdateByClause operation, String... byColumns) { + public final UpdateByTable updateBy(UpdateByOperation operation, String... byColumns) { UpdateByTable.Builder builder = UpdateByTable.builder() .parent(this) .addOperations(operation); @@ -476,7 +476,7 @@ public final UpdateByTable updateBy(UpdateByClause operation, String... byColumn } @Override - public final UpdateByTable updateBy(Collection operations, + public final UpdateByTable updateBy(Collection operations, Collection byColumns) { return UpdateByTable.builder() .parent(this) @@ -486,7 +486,7 @@ public final UpdateByTable updateBy(Collection operati } @Override - public final UpdateByTable updateBy(Collection operations) { + public final UpdateByTable updateBy(Collection operations) { return UpdateByTable.builder() .parent(this) .addAllOperations(operations) @@ -494,7 +494,7 @@ public final UpdateByTable updateBy(Collection operati } @Override - public final UpdateByTable updateBy(Collection operations, String... byColumns) { + public final UpdateByTable updateBy(Collection operations, String... byColumns) { UpdateByTable.Builder builder = UpdateByTable.builder() .parent(this) .addAllOperations(operations); @@ -505,7 +505,7 @@ public final UpdateByTable updateBy(Collection operati } @Override - public final UpdateByTable updateBy(UpdateByControl control, Collection operations) { + public final UpdateByTable updateBy(UpdateByControl control, Collection operations) { return UpdateByTable.builder() .parent(this) .control(control) @@ -514,7 +514,7 @@ public final UpdateByTable updateBy(UpdateByControl control, Collection operations, + public final UpdateByTable updateBy(UpdateByControl control, Collection operations, Collection byColumns) { return UpdateByTable.builder() .parent(this) diff --git a/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java b/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java index bd7eb8841b0..cca47da33af 100644 --- a/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java @@ -4,7 +4,7 @@ package io.deephaven.qst.table; import io.deephaven.annotations.NodeStyle; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import org.immutables.value.Value.Check; import org.immutables.value.Value.Immutable; @@ -22,7 +22,7 @@ public static Builder builder() { public abstract Optional control(); - public abstract List operations(); + public abstract List operations(); @Override public final V walk(V visitor) { @@ -40,10 +40,10 @@ final void checkNumOperations() { public interface Builder extends ByTableBase.Builder { Builder control(UpdateByControl control); - Builder addOperations(UpdateByClause element); + Builder addOperations(UpdateByOperation element); - Builder addOperations(UpdateByClause... elements); + Builder addOperations(UpdateByOperation... elements); - Builder addAllOperations(Iterable elements); + Builder addAllOperations(Iterable elements); } } diff --git a/qst/src/test/java/io/deephaven/qst/table/TableCreatorImplTest.java b/qst/src/test/java/io/deephaven/qst/table/TableCreatorImplTest.java index 5482637d14d..16732f11112 100644 --- a/qst/src/test/java/io/deephaven/qst/table/TableCreatorImplTest.java +++ b/qst/src/test/java/io/deephaven/qst/table/TableCreatorImplTest.java @@ -5,7 +5,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.qst.examples.EmployeesExample; import io.deephaven.qst.column.Column; @@ -111,11 +111,11 @@ static TableSpec updateFooEqBar(TableSpec table) { } static TableSpec updateByFooCumSum(TableSpec table) { - return table.updateBy(UpdateByClause.CumSum("Foo")); + return table.updateBy(UpdateByOperation.CumSum("Foo")); } static TableSpec updateByFooCumSumByBar(TableSpec table) { - return table.updateBy(UpdateByClause.CumSum("Foo"), "Bar"); + return table.updateBy(UpdateByOperation.CumSum("Foo"), "Bar"); } static TableSpec selectFoo(TableSpec table) { diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index a835ef3704a..9168849bd66 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -6,7 +6,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import java.util.Collection; @@ -519,19 +519,19 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, // ------------------------------------------------------------------------------------------- - TOPS updateBy(UpdateByClause operation); + TOPS updateBy(UpdateByOperation operation); - TOPS updateBy(Collection operations); + TOPS updateBy(Collection operations); - TOPS updateBy(UpdateByControl control, Collection operations); + TOPS updateBy(UpdateByControl control, Collection operations); - TOPS updateBy(UpdateByClause operation, final String... byColumns); + TOPS updateBy(UpdateByOperation operation, final String... byColumns); - TOPS updateBy(Collection operations, final String... byColumns); + TOPS updateBy(Collection operations, final String... byColumns); - TOPS updateBy(Collection operations, Collection byColumns); + TOPS updateBy(Collection operations, Collection byColumns); - TOPS updateBy(UpdateByControl control, Collection operations, + TOPS updateBy(UpdateByControl control, Collection operations, Collection byColumns); // ------------------------------------------------------------------------------------------- diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java index 4786627d1ce..2c39b2d9ae5 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java @@ -6,7 +6,7 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByClause; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import java.util.Collection; @@ -318,38 +318,38 @@ public final TOPS_1 aggBy(Collection aggregations, @Override - public final TOPS_1 updateBy(UpdateByClause operation) { + public final TOPS_1 updateBy(UpdateByOperation operation) { return adapt(delegate.updateBy(operation)); } @Override - public final TOPS_1 updateBy(UpdateByClause operation, String... byColumns) { + public final TOPS_1 updateBy(UpdateByOperation operation, String... byColumns) { return adapt(delegate.updateBy(operation, byColumns)); } @Override - public final TOPS_1 updateBy(Collection operations) { + public final TOPS_1 updateBy(Collection operations) { return adapt(delegate.updateBy(operations)); } @Override - public final TOPS_1 updateBy(Collection operations, String... byColumns) { + public final TOPS_1 updateBy(Collection operations, String... byColumns) { return adapt(delegate.updateBy(operations, byColumns)); } @Override - public final TOPS_1 updateBy(Collection operations, + public final TOPS_1 updateBy(Collection operations, Collection byColumns) { return adapt(delegate.updateBy(operations, byColumns)); } @Override - public final TOPS_1 updateBy(UpdateByControl control, Collection operations) { + public final TOPS_1 updateBy(UpdateByControl control, Collection operations) { return adapt(delegate.updateBy(control, operations)); } @Override - public final TOPS_1 updateBy(UpdateByControl control, Collection operations, + public final TOPS_1 updateBy(UpdateByControl control, Collection operations, Collection byColumns) { return adapt(delegate.updateBy(control, operations, byColumns)); } diff --git a/table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateClause.java b/table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateOperation.java similarity index 85% rename from table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateClause.java rename to table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateOperation.java index 5756242baaa..82d3f7aece2 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateClause.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/ColumnUpdateOperation.java @@ -9,9 +9,9 @@ @Immutable @BuildableStyle -public abstract class ColumnUpdateClause implements UpdateByClause { +public abstract class ColumnUpdateOperation implements UpdateByOperation { public static Builder builder() { - return ImmutableColumnUpdateClause.builder(); + return ImmutableColumnUpdateOperation.builder(); } @@ -40,6 +40,6 @@ public interface Builder { Builder addAllColumns(Iterable elements); - ColumnUpdateClause build(); + ColumnUpdateOperation build(); } } diff --git a/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java b/table-api/src/main/java/io/deephaven/api/updateby/OperationControl.java similarity index 93% rename from table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java rename to table-api/src/main/java/io/deephaven/api/updateby/OperationControl.java index 98f823645d7..41ca5fcbd27 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/EmaControl.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/OperationControl.java @@ -9,7 +9,7 @@ /** *

- * Control parameters for performing EMAs with Table#updateBy() + * Control parameters for performing operations with Table#updateBy() *

*

* Defaults are as follows @@ -25,12 +25,12 @@ */ @Immutable @BuildableStyle -public abstract class EmaControl { +public abstract class OperationControl { public static Builder builder() { - return ImmutableEmaControl.builder(); + return ImmutableOperationControl.builder(); } - public static EmaControl defaultInstance() { + public static OperationControl defaultInstance() { return builder().build(); } @@ -117,7 +117,7 @@ public MathContext bigValueContextOrDefault() { * * @return the explicit new instance */ - public final EmaControl materialize() { + public final OperationControl materialize() { return builder() .onNullValue(onNullValueOrDefault()) .onNanValue(onNanValueOrDefault()) @@ -141,6 +141,6 @@ public interface Builder { Builder bigValueContext(MathContext context); - EmaControl build(); + OperationControl build(); } } diff --git a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByOperation.java similarity index 74% rename from table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java rename to table-api/src/main/java/io/deephaven/api/updateby/UpdateByOperation.java index 43920c06e8f..6269c471059 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/UpdateByClause.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/UpdateByOperation.java @@ -4,22 +4,20 @@ import io.deephaven.api.updateby.spec.*; import java.time.Duration; -import java.util.Arrays; -import java.util.Collection; /** * Defines an operation that can be applied to a table with Table#updateBy()} */ -public interface UpdateByClause { +public interface UpdateByOperation { /** * Conjoin an {@link UpdateBySpec} with columns for it to be applied to so the engine can construct the proper * operators. * * @param spec the {@link UpdateBySpec} that defines the operation to perform * @param columns the columns to apply the operation to. - * @return a {@link ColumnUpdateClause} that will be used to construct operations for each column + * @return a {@link ColumnUpdateOperation} that will be used to construct operations for each column */ - static ColumnUpdateClause of(final UpdateBySpec spec, final String... columns) { + static ColumnUpdateOperation of(final UpdateBySpec spec, final String... columns) { return spec.clause(columns); } @@ -29,9 +27,9 @@ static ColumnUpdateClause of(final UpdateBySpec spec, final String... columns) { * * @param spec the {@link UpdateBySpec} that defines the operation to perform * @param columns the columns to apply the operation to. - * @return a {@link ColumnUpdateClause} that will be used to construct operations for each column + * @return a {@link ColumnUpdateOperation} that will be used to construct operations for each column */ - static ColumnUpdateClause of(final UpdateBySpec spec, final Pair... columns) { + static ColumnUpdateOperation of(final UpdateBySpec spec, final Pair... columns) { return spec.clause(columns); } @@ -41,7 +39,7 @@ static ColumnUpdateClause of(final UpdateBySpec spec, final Pair... columns) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause CumSum(String... pairs) { + static UpdateByOperation CumSum(String... pairs) { return CumSumSpec.of().clause(pairs); } @@ -51,7 +49,7 @@ static UpdateByClause CumSum(String... pairs) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause CumProd(String... pairs) { + static UpdateByOperation CumProd(String... pairs) { return CumProdSpec.of().clause(pairs); } @@ -61,7 +59,7 @@ static UpdateByClause CumProd(String... pairs) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause CumMin(String... pairs) { + static UpdateByOperation CumMin(String... pairs) { return CumMinMaxSpec.of(false).clause(pairs); } @@ -71,7 +69,7 @@ static UpdateByClause CumMin(String... pairs) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause CumMax(String... pairs) { + static UpdateByOperation CumMax(String... pairs) { return CumMinMaxSpec.of(true).clause(pairs); } @@ -81,13 +79,13 @@ static UpdateByClause CumMax(String... pairs) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Fill(String... pairs) { + static UpdateByOperation Fill(String... pairs) { return FillBySpec.of().clause(pairs); } /** * Create an {@link EmaSpec exponential moving average} for the supplied column name pairs, using ticks as the decay - * unit. Uses the default EmaControl settings. + * unit. Uses the default OperationControl settings. *

* The formula used is *

@@ -101,7 +99,7 @@ static UpdateByClause Fill(String... pairs) { * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(long timeScaleTicks, String... pairs) { + static UpdateByOperation Ema(long timeScaleTicks, String... pairs) { return EmaSpec.ofTicks(timeScaleTicks).clause(pairs); } @@ -117,19 +115,19 @@ static UpdateByClause Ema(long timeScaleTicks, String... pairs) { * ema_next = a * ema_last + (1 - a) * value * * - * @param control a {@link EmaControl control} object that defines how special cases should behave. See - * {@link EmaControl} for further details. + * @param control a {@link OperationControl control} object that defines how special cases should behave. See + * {@link OperationControl} for further details. * @param timeScaleTicks the decay rate in ticks * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(final EmaControl control, long timeScaleTicks, String... pairs) { + static UpdateByOperation Ema(final OperationControl control, long timeScaleTicks, String... pairs) { return EmaSpec.ofTicks(control, timeScaleTicks).clause(pairs); } /** * Create an {@link EmaSpec exponential moving average} for the supplied column name pairs, using time as the decay - * unit. Uses the default EmaControl settings. + * unit. Uses the default OperationControl settings. *

* The formula used is *

@@ -144,7 +142,7 @@ static UpdateByClause Ema(final EmaControl control, long timeScaleTicks, String. * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(String timestampColumn, long timeScaleNanos, String... pairs) { + static UpdateByOperation Ema(String timestampColumn, long timeScaleNanos, String... pairs) { return EmaSpec.ofTime(timestampColumn, timeScaleNanos).clause(pairs); } @@ -160,20 +158,21 @@ static UpdateByClause Ema(String timestampColumn, long timeScaleNanos, String... * ema_next = a * ema_last + (1 - a) * value * * - * @param control a {@link EmaControl control} object that defines how special cases should behave. See - * {@link EmaControl} for further details. + * @param control a {@link OperationControl control} object that defines how special cases should behave. See + * {@link OperationControl} for further details. * @param timestampColumn the column in the source table to use for timestamps * @param timeScaleNanos the decay rate in nanoseconds * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(EmaControl control, String timestampColumn, long timeScaleNanos, String... pairs) { + static UpdateByOperation Ema(OperationControl control, String timestampColumn, long timeScaleNanos, + String... pairs) { return EmaSpec.ofTime(control, timestampColumn, timeScaleNanos).clause(pairs); } /** * Create an {@link EmaSpec exponential moving average} for the supplied column name pairs, using time as the decay - * unit. Uses the default EmaControl settings. + * unit. Uses the default OperationControl settings. *

* The formula used is *

@@ -188,7 +187,7 @@ static UpdateByClause Ema(EmaControl control, String timestampColumn, long timeS * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(String timestampColumn, Duration emaDuration, String... pairs) { + static UpdateByOperation Ema(String timestampColumn, Duration emaDuration, String... pairs) { return EmaSpec.ofTime(timestampColumn, emaDuration).clause(pairs); } @@ -204,20 +203,21 @@ static UpdateByClause Ema(String timestampColumn, Duration emaDuration, String.. * ema_next = a * ema_last + (1 - a) * value * * - * @param control a {@link EmaControl control} object that defines how special cases should behave. See - * {@link EmaControl} for further details. + * @param control a {@link OperationControl control} object that defines how special cases should behave. See + * {@link OperationControl} for further details. * @param timestampColumn the column in the source table to use for timestamps * @param emaDuration the decay rate as {@Link Duration duration} * @param pairs The input/output column name pairs * @return The aggregation */ - static UpdateByClause Ema(EmaControl control, String timestampColumn, Duration emaDuration, String... pairs) { + static UpdateByOperation Ema(OperationControl control, String timestampColumn, Duration emaDuration, + String... pairs) { return EmaSpec.ofTime(control, timestampColumn, emaDuration).clause(pairs); } T walk(Visitor visitor); interface Visitor { - T visit(ColumnUpdateClause clause); + T visit(ColumnUpdateOperation clause); } } diff --git a/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java b/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java index c2ccf7c086f..536f91085c4 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/spec/EmaSpec.java @@ -1,7 +1,7 @@ package io.deephaven.api.updateby.spec; import io.deephaven.annotations.BuildableStyle; -import io.deephaven.api.updateby.EmaControl; +import io.deephaven.api.updateby.OperationControl; import org.immutables.value.Value.Immutable; import java.time.Duration; @@ -14,7 +14,7 @@ @BuildableStyle public abstract class EmaSpec extends UpdateBySpecBase { - public static EmaSpec of(EmaControl control, TimeScale timeScale) { + public static EmaSpec of(OperationControl control, TimeScale timeScale) { return ImmutableEmaSpec.builder().control(control).timeScale(timeScale).build(); } @@ -22,7 +22,7 @@ public static EmaSpec of(TimeScale timeScale) { return ImmutableEmaSpec.builder().timeScale(timeScale).build(); } - public static EmaSpec ofTime(final EmaControl control, + public static EmaSpec ofTime(final OperationControl control, final String timestampCol, long timeScaleNanos) { return of(control, TimeScale.ofTime(timestampCol, timeScaleNanos)); @@ -32,7 +32,7 @@ public static EmaSpec ofTime(final String timestampCol, long timeScaleNanos) { return of(TimeScale.ofTime(timestampCol, timeScaleNanos)); } - public static EmaSpec ofTime(final EmaControl control, + public static EmaSpec ofTime(final OperationControl control, final String timestampCol, Duration emaDuration) { return of(control, TimeScale.ofTime(timestampCol, emaDuration)); @@ -42,7 +42,7 @@ public static EmaSpec ofTime(final String timestampCol, Duration emaDuration) { return of(TimeScale.ofTime(timestampCol, emaDuration)); } - public static EmaSpec ofTicks(EmaControl control, long tickWindow) { + public static EmaSpec ofTicks(OperationControl control, long tickWindow) { return of(control, TimeScale.ofTicks(tickWindow)); } @@ -50,12 +50,12 @@ public static EmaSpec ofTicks(long tickWindow) { return of(TimeScale.ofTicks(tickWindow)); } - public abstract Optional control(); + public abstract Optional control(); public abstract TimeScale timeScale(); - public final EmaControl controlOrDefault() { - return control().orElseGet(EmaControl::defaultInstance); + public final OperationControl controlOrDefault() { + return control().orElseGet(OperationControl::defaultInstance); } @Override diff --git a/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpec.java b/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpec.java index 916f46bc18e..e8fb67759f5 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpec.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpec.java @@ -1,7 +1,7 @@ package io.deephaven.api.updateby.spec; import io.deephaven.api.agg.Pair; -import io.deephaven.api.updateby.ColumnUpdateClause; +import io.deephaven.api.updateby.ColumnUpdateOperation; import java.util.Collection; @@ -19,44 +19,44 @@ public interface UpdateBySpec { boolean applicableTo(final Class inputType); /** - * Build a {@link ColumnUpdateClause} for this UpdateBySpec. + * Build a {@link ColumnUpdateOperation} for this UpdateBySpec. * * @param pair The input/output column name pair * @return The clause */ - ColumnUpdateClause clause(String pair); + ColumnUpdateOperation clause(String pair); /** - * Build a {@link ColumnUpdateClause} for this UpdateBySpec. + * Build a {@link ColumnUpdateOperation} for this UpdateBySpec. * * @param pair The input/output column name pair * @return The clause */ - ColumnUpdateClause clause(Pair pair); + ColumnUpdateOperation clause(Pair pair); /** - * Build a {@link ColumnUpdateClause} clause for this UpdateBySpec. + * Build a {@link ColumnUpdateOperation} clause for this UpdateBySpec. * * @param pairs The input/output column name pairs * @return The aggregation */ - ColumnUpdateClause clause(String... pairs); + ColumnUpdateOperation clause(String... pairs); /** - * Build a {@link ColumnUpdateClause} clause for this UpdateBySpec. + * Build a {@link ColumnUpdateOperation} clause for this UpdateBySpec. * * @param pairs The input/output column name pairs * @return The aggregation */ - ColumnUpdateClause clause(Pair... pairs); + ColumnUpdateOperation clause(Pair... pairs); /** - * Build a {@link ColumnUpdateClause} clause for this UpdateBySpec. + * Build a {@link ColumnUpdateOperation} clause for this UpdateBySpec. * * @param pairs The input/output column name pairs * @return The aggregation */ - ColumnUpdateClause clause(Collection pairs); + ColumnUpdateOperation clause(Collection pairs); // region Visitor T walk(Visitor visitor); diff --git a/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpecBase.java b/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpecBase.java index a4a09b85b7c..6c3d54127ae 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpecBase.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/spec/UpdateBySpecBase.java @@ -1,7 +1,7 @@ package io.deephaven.api.updateby.spec; import io.deephaven.api.agg.Pair; -import io.deephaven.api.updateby.ColumnUpdateClause; +import io.deephaven.api.updateby.ColumnUpdateOperation; import java.util.Arrays; import java.util.Collection; @@ -10,36 +10,36 @@ public abstract class UpdateBySpecBase implements UpdateBySpec { @Override - public final ColumnUpdateClause clause(String pair) { + public final ColumnUpdateOperation clause(String pair) { return clause(Pair.parse(pair)); } @Override - public final ColumnUpdateClause clause(Pair pair) { - return ColumnUpdateClause.builder() + public final ColumnUpdateOperation clause(Pair pair) { + return ColumnUpdateOperation.builder() .spec(this) .addColumns(pair) .build(); } @Override - public final ColumnUpdateClause clause(String... pairs) { + public final ColumnUpdateOperation clause(String... pairs) { return clause(Arrays.stream(pairs) .map(Pair::parse) .collect(Collectors.toList())); } @Override - public final ColumnUpdateClause clause(Pair... pairs) { - return ColumnUpdateClause.builder() + public final ColumnUpdateOperation clause(Pair... pairs) { + return ColumnUpdateOperation.builder() .spec(this) .addColumns(pairs) .build(); } @Override - public final ColumnUpdateClause clause(Collection pairs) { - return ColumnUpdateClause.builder() + public final ColumnUpdateOperation clause(Collection pairs) { + return ColumnUpdateOperation.builder() .spec(this) .addAllColumns(pairs) .build(); From 344d4e06b32628b10678ff8c971202dfcfb8d025 Mon Sep 17 00:00:00 2001 From: SuperTails Date: Mon, 25 Jul 2022 17:56:44 -0600 Subject: [PATCH 031/215] Go Client API (#2497) This is the initial revision of the Go client library for Deephaven. Using the gRPC/Flight api, this can start a session, create tables and run remote code, and fetch data. Ticking deltas are not yet implemented, but data is instead read and written using standard Apache Arrow Flight operations. Fixes #2523 Co-authored-by: Nathaniel Bauernfeind Co-authored-by: Chip Kent Co-authored-by: Colin Alworth --- .../io/deephaven/tools/docker/DiffTask.groovy | 12 +- docker/registry/go/build.gradle | 3 + docker/registry/go/gradle.properties | 3 + go/README.md | 49 + go/build.gradle | 81 + go/go-test-to-junit.sh | 9 + go/go.mod | 32 + go/go.sum | 575 ++ go/gradle.properties | 1 + .../proto/application/application.pb.go | 363 + .../proto/application/application_grpc.pb.go | 146 + go/internal/proto/console/console.pb.go | 5183 +++++++++++++ go/internal/proto/console/console_grpc.pb.go | 500 ++ go/internal/proto/inputtable/inputtable.pb.go | 382 + .../proto/inputtable/inputtable_grpc.pb.go | 153 + go/internal/proto/object/object.pb.go | 257 + go/internal/proto/object/object_grpc.pb.go | 105 + .../partitionedtable/partitionedtable.pb.go | 586 ++ .../partitionedtable_grpc.pb.go | 215 + go/internal/proto/session/session.pb.go | 1160 +++ go/internal/proto/session/session_grpc.pb.go | 401 + go/internal/proto/table/table.pb.go | 6541 +++++++++++++++++ go/internal/proto/table/table_grpc.pb.go | 1511 ++++ go/internal/proto/ticket/ticket.pb.go | 231 + go/internal/test_tools/test_tools.go | 90 + go/pkg/client/client.go | 279 + go/pkg/client/client_test.go | 252 + go/pkg/client/console_stub.go | 73 + go/pkg/client/console_test.go | 58 + go/pkg/client/example_fetch_table_test.go | 66 + go/pkg/client/example_import_table_test.go | 101 + go/pkg/client/example_input_table_test.go | 112 + go/pkg/client/example_run_script_test.go | 83 + go/pkg/client/example_table_ops_test.go | 244 + go/pkg/client/fieldmanager.go | 116 + go/pkg/client/flight_stub.go | 134 + go/pkg/client/inputtable_stub.go | 183 + go/pkg/client/inputtable_test.go | 330 + go/pkg/client/query.go | 1527 ++++ go/pkg/client/query_test.go | 1153 +++ go/pkg/client/session_stub.go | 204 + go/pkg/client/table_stub.go | 773 ++ go/pkg/client/tablehandle.go | 656 ++ go/pkg/client/tablehandle_test.go | 632 ++ go/pkg/client/ticketfactory.go | 41 + proto/proto-backplane-grpc/Dockerfile | 25 + proto/proto-backplane-grpc/build.gradle | 7 +- .../proto/deephaven/proto/application.proto | 1 + .../main/proto/deephaven/proto/console.proto | 2 +- .../proto/deephaven/proto/inputtable.proto | 1 + .../main/proto/deephaven/proto/object.proto | 1 + .../deephaven/proto/partitionedtable.proto | 1 + .../main/proto/deephaven/proto/session.proto | 1 + .../main/proto/deephaven/proto/table.proto | 1 + .../main/proto/deephaven/proto/ticket.proto | 1 + py/client/build.gradle | 2 +- .../pydeephaven/proto/application_pb2.py | 4 +- py/client/pydeephaven/proto/console_pb2.py | 209 +- py/client/pydeephaven/proto/inputtable_pb2.py | 4 +- py/client/pydeephaven/proto/object_pb2.py | 4 +- .../pydeephaven/proto/partitionedtable_pb2.py | 4 +- py/client/pydeephaven/proto/session_pb2.py | 4 +- py/client/pydeephaven/proto/table_pb2.py | 4 +- py/client/pydeephaven/proto/ticket_pb2.py | 4 +- .../session/SessionServiceGrpcImpl.java | 10 + settings.gradle | 3 +- 66 files changed, 25774 insertions(+), 125 deletions(-) create mode 100644 docker/registry/go/build.gradle create mode 100644 docker/registry/go/gradle.properties create mode 100644 go/README.md create mode 100644 go/build.gradle create mode 100755 go/go-test-to-junit.sh create mode 100644 go/go.mod create mode 100644 go/go.sum create mode 100644 go/gradle.properties create mode 100644 go/internal/proto/application/application.pb.go create mode 100644 go/internal/proto/application/application_grpc.pb.go create mode 100644 go/internal/proto/console/console.pb.go create mode 100644 go/internal/proto/console/console_grpc.pb.go create mode 100644 go/internal/proto/inputtable/inputtable.pb.go create mode 100644 go/internal/proto/inputtable/inputtable_grpc.pb.go create mode 100644 go/internal/proto/object/object.pb.go create mode 100644 go/internal/proto/object/object_grpc.pb.go create mode 100644 go/internal/proto/partitionedtable/partitionedtable.pb.go create mode 100644 go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go create mode 100644 go/internal/proto/session/session.pb.go create mode 100644 go/internal/proto/session/session_grpc.pb.go create mode 100644 go/internal/proto/table/table.pb.go create mode 100644 go/internal/proto/table/table_grpc.pb.go create mode 100644 go/internal/proto/ticket/ticket.pb.go create mode 100644 go/internal/test_tools/test_tools.go create mode 100644 go/pkg/client/client.go create mode 100644 go/pkg/client/client_test.go create mode 100644 go/pkg/client/console_stub.go create mode 100644 go/pkg/client/console_test.go create mode 100644 go/pkg/client/example_fetch_table_test.go create mode 100644 go/pkg/client/example_import_table_test.go create mode 100644 go/pkg/client/example_input_table_test.go create mode 100644 go/pkg/client/example_run_script_test.go create mode 100644 go/pkg/client/example_table_ops_test.go create mode 100644 go/pkg/client/fieldmanager.go create mode 100644 go/pkg/client/flight_stub.go create mode 100644 go/pkg/client/inputtable_stub.go create mode 100644 go/pkg/client/inputtable_test.go create mode 100644 go/pkg/client/query.go create mode 100644 go/pkg/client/query_test.go create mode 100644 go/pkg/client/session_stub.go create mode 100644 go/pkg/client/table_stub.go create mode 100644 go/pkg/client/tablehandle.go create mode 100644 go/pkg/client/tablehandle_test.go create mode 100644 go/pkg/client/ticketfactory.go diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy index 8f24387603d..d32bfdd29a6 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy @@ -3,11 +3,14 @@ package io.deephaven.tools.docker import groovy.transform.CompileStatic import org.gradle.api.Action import org.gradle.api.DefaultTask +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.FileVisitDetails import org.gradle.api.internal.file.FileLookup import org.gradle.api.provider.Property import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.util.PatternFilterable import org.gradle.api.tasks.util.PatternSet @@ -25,7 +28,7 @@ abstract class DiffTask extends DefaultTask { // This is an Object because Gradle doesn't define an interface for getAsFileTree(), so we // will resolve it when we execute the task. This allows us to read from various sources, // such as configurations. - @Input + @InputFiles abstract Property getExpectedContents() // In contrast, this is assumed to be a source directory, to easily allow some Sync action // to easily be the "fix this mistake" counterpart to this task @@ -54,6 +57,11 @@ abstract class DiffTask extends DefaultTask { throw new UnsupportedOperationException(); } + @Internal + ConfigurableFileCollection getExpectedContentsFiles() { + project.files(getExpectedContents().get()) + } + @TaskAction void diff() { def resolver = getFileLookup().getFileResolver(getActualContents().asFile.get()) @@ -74,7 +82,7 @@ abstract class DiffTask extends DefaultTask { existingFiles.add(details.file.toPath()); } - project.files(getExpectedContents().get()).asFileTree.visit { FileVisitDetails details -> + expectedContentsFiles.asFileTree.visit { FileVisitDetails details -> if (details.isDirectory()) { return; } diff --git a/docker/registry/go/build.gradle b/docker/registry/go/build.gradle new file mode 100644 index 00000000000..a9bb1568cd2 --- /dev/null +++ b/docker/registry/go/build.gradle @@ -0,0 +1,3 @@ +plugins { + id 'io.deephaven.project.register' +} diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties new file mode 100644 index 00000000000..849cac8b49d --- /dev/null +++ b/docker/registry/go/gradle.properties @@ -0,0 +1,3 @@ +io.deephaven.project.ProjectType=DOCKER_REGISTRY +deephaven.registry.imageName=golang:1 +deephaven.registry.imageId=golang@sha256:9349ed889adb906efa5ebc06485fe1b6a12fb265a01c9266a137bb1352565560 diff --git a/go/README.md b/go/README.md new file mode 100644 index 00000000000..399c86500a6 --- /dev/null +++ b/go/README.md @@ -0,0 +1,49 @@ +# Deephaven Go Client + +This is a Go package that provides a client interface for [Deephaven Community Core](https://github.com/deephaven/deephaven-core). +Details on usage can be found in the examples and in the documentation (both listed below). + +## Setup + +First, you will need a working Go install (1.13+ is required; so apt-get is often too outdated). +It can be installed from [the official site](https://go.dev/doc/install). + +In order to run tests or examples, a Deephaven server must be running. +To run a server, follow the instructions [here](https://github.com/deephaven/deephaven-core#run-deephaven). + +## Tests + +To run tests, simply run the following command from this folder. +``` +$ go test -v ./... +``` +All tests should pass within 30 seconds. +Tests assume the server is on `localhost:10000` by default, but can be configured by setting the `DH_HOST` and `DH_PORT` environment variables. + +## Examples + +This project also includes several example applications. +Examples assume the server is running on `localhost:10000` by default, +but can be configured by setting the `DH_HOST` and `DH_PORT` environment variables. +An example can be run using one of the following commands: +```bash +$ go test -v ./client/example_basic_query_test.go +$ go test -v ./client/example_fetch_table_test.go +$ go test -v ./client/example_import_table_test.go +$ go test -v ./client/example_input_table_test.go +$ go test -v ./client/example_run_script_test.go +``` + +The source code is available in the directory for each example. + +## Viewing Docs + +Online documentation for this package can be found [on this page](https://pkg.go.dev/github.com/deephaven/deephaven-core/go/). + +To generate and view docs locally, use Godoc: +``` +$ go get -v golang.org/x/tools/cmd/godoc # Installation, only needs to be done once +$ godoc +``` +This will start up a web server (by default on [`http://localhost:6060`](http://localhost:6060)) that can be opened in a browser. +The docs for the package will be at [this link](http://localhost:6060/pkg/github.com/deephaven/deephaven-core/go/pkg/client/). \ No newline at end of file diff --git a/go/build.gradle b/go/build.gradle new file mode 100644 index 00000000000..c828e208456 --- /dev/null +++ b/go/build.gradle @@ -0,0 +1,81 @@ +import io.deephaven.tools.docker.DiffTask + +plugins { + id 'com.bmuschko.docker-remote-api' + id 'io.deephaven.project.register' + id 'io.deephaven.deephaven-in-docker' +} + +evaluationDependsOn Docker.registryProject('go') + + +// The Go convention is to check in generated sources - while there is a "central repo server" for Go, it is a proxy +// that merely polls each proxy several times an hour, but doesn't allow contents to be deployed to it. As such, +// any generated code must exist in git, and will be downloaded from there. As part of the build then, we generate and +// compare/overwrite protobuf sources. +configurations { + go {} +} +dependencies { + go project(path: ':proto:proto-backplane-grpc', configuration: 'go') +} +def compare = tasks.register('compareProtobuf', DiffTask) { + expectedContents.set configurations.go + actualContents.set layout.projectDirectory + generateTask.set ':go:updateProtobuf' + + ignore { + exclude 'internal/proto/**' + } +} +// fail a "check" build if these are out of date +tasks.getByName('quick').dependsOn(compare) + +tasks.register('updateProtobuf', Sync) { + finalizedBy compare + from configurations.go + into layout.projectDirectory + preserve { + exclude 'internal/proto/**' + } +} + + +// start a grpc-api server +String randomSuffix = UUID.randomUUID().toString(); +deephavenDocker { + containerName.set "dh-server-for-go-${randomSuffix}" + networkName.set "go-test-network-${randomSuffix}" +} +def testGoClient = Docker.registerDockerTask(project, 'testGoClient') { + copyIn { + from(layout.projectDirectory) { + include 'pkg/**' + include 'internal/**' + include 'go.mod' + include 'go.sum' + include 'go-test-to-junit.sh' + } + } + copyOut { + into layout.buildDirectory.dir('test-results') + } + dockerfile { + from('deephaven/go:local-build') + environmentVariable 'DH_HOST', deephavenDocker.containerName.get() + environmentVariable 'DH_PORT', '8080' + copyFile('.', '/project') + workingDir('/project') + runCommand('''set -eux; \\ + mkdir /out; \\ + go mod download; \\ + go install github.com/jstemmer/go-junit-report/v2@latest + ''') + } + containerDependencies.dependsOn = [deephavenDocker.healthyTask] + containerDependencies.finalizedBy = deephavenDocker.endTask + network = deephavenDocker.networkName.get() + parentContainers = [ Docker.registryTask(project, 'go') ] + entrypoint = ['./go-test-to-junit.sh', '/out/go-test.xml', '/out/go.log'] +} +tasks.check.dependsOn(testGoClient) diff --git a/go/go-test-to-junit.sh b/go/go-test-to-junit.sh new file mode 100755 index 00000000000..2c273779f92 --- /dev/null +++ b/go/go-test-to-junit.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o nounset +set -o xtrace + +XML=${1}; + +go test -vet=all -v ./... 2>&1 | go-junit-report -set-exit-code -iocopy -out "$XML"; diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 00000000000..676e0170c45 --- /dev/null +++ b/go/go.mod @@ -0,0 +1,32 @@ +module github.com/deephaven/deephaven-core/go + +go 1.18 + +require ( + github.com/apache/arrow/go/v8 v8.0.0 + google.golang.org/grpc v1.47.0 + google.golang.org/protobuf v1.27.1 +) + +require ( + github.com/andybalholm/brotli v1.0.4 // indirect + github.com/apache/thrift v0.15.0 // indirect + github.com/goccy/go-json v0.9.6 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/flatbuffers v2.0.5+incompatible // indirect + github.com/klauspost/asmfmt v1.3.1 // indirect + github.com/klauspost/compress v1.14.2 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect + github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect + github.com/pierrec/lz4/v4 v4.1.12 // indirect + github.com/zeebo/xxh3 v1.0.1 // indirect + golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect + golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/tools v0.1.10 // indirect + golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect + google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect +) diff --git a/go/go.sum b/go/go.sum new file mode 100644 index 00000000000..b153ea9dcee --- /dev/null +++ b/go/go.sum @@ -0,0 +1,575 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v8 v8.0.0 h1:mG1dDlq8aQO4a/PB00T9H19Ga2imvqoFPHI5cykpibs= +github.com/apache/arrow/go/v8 v8.0.0/go.mod h1:63co72EKYQT9WKr8Y1Yconk4dysC0t79wNDauYO1ZGg= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.15.0 h1:aGvdaR0v1t9XLgjtBYwxcBvBOTMqClzwE26CHOgjW1Y= +github.com/apache/thrift v0.15.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/goccy/go-json v0.9.6 h1:5/4CtRQdtsX0sal8fdVhTaiMN01Ri8BExZZ8iRmHQ6E= +github.com/goccy/go-json v0.9.6/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v2.0.5+incompatible h1:ANsW0idDAXIY+mNHzIHxWRfabV2x5LUEEIIWcwsYgB8= +github.com/google/flatbuffers v2.0.5+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/asmfmt v1.3.1 h1:7xZi1N7s9gTLbqiM8KUv8TLyysavbTRGBT5/ly0bRtw= +github.com/klauspost/asmfmt v1.3.1/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.14.2 h1:S0OHlFk/Gbon/yauFJ4FfJJF5V0fc5HbBTJazi28pRw= +github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.12 h1:44l88ehTZAUGW4VlO1QC4zkilL99M6Y9MXNwEs0uzP8= +github.com/pierrec/lz4/v4 v4.1.12/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zeebo/xxh3 v1.0.1 h1:FMSRIbkrLikb/0hZxmltpg84VkqDAT5M8ufXynuhXsI= +github.com/zeebo/xxh3 v1.0.1/go.mod h1:8VHV24/3AZLn3b6Mlp/KuC33LWH687Wq6EnziEB+rsA= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20211216164055-b2b84827b756 h1:/5Bs7sWi0i3rOVO5KnM55OwugpsD4bRW1zywKoZjbkI= +golang.org/x/exp v0.0.0-20211216164055-b2b84827b756/go.mod h1:b9TAUYHmRtqA6klRHApnXMnj+OyLce4yF5cZCUbk2ps= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3 h1:DnoIG+QAMaF5NvxnGe/oKsgKcAc6PcUyl8q0VetfQ8s= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 h1:YxHp5zqIcAShDEvRr5/0rVESVS+njYF68PSdazrNLJo= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/go/gradle.properties b/go/gradle.properties new file mode 100644 index 00000000000..8f42cc0940f --- /dev/null +++ b/go/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=BASIC diff --git a/go/internal/proto/application/application.pb.go b/go/internal/proto/application/application.pb.go new file mode 100644 index 00000000000..debf7307af3 --- /dev/null +++ b/go/internal/proto/application/application.pb.go @@ -0,0 +1,363 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/application.proto + +package application + +import ( + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListFieldsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListFieldsRequest) Reset() { + *x = ListFieldsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_application_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFieldsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFieldsRequest) ProtoMessage() {} + +func (x *ListFieldsRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_application_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFieldsRequest.ProtoReflect.Descriptor instead. +func (*ListFieldsRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_application_proto_rawDescGZIP(), []int{0} +} + +// +// Represents a batch of fields. +type FieldsChangeUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Created []*FieldInfo `protobuf:"bytes,1,rep,name=created,proto3" json:"created,omitempty"` + Updated []*FieldInfo `protobuf:"bytes,2,rep,name=updated,proto3" json:"updated,omitempty"` + Removed []*FieldInfo `protobuf:"bytes,3,rep,name=removed,proto3" json:"removed,omitempty"` +} + +func (x *FieldsChangeUpdate) Reset() { + *x = FieldsChangeUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_application_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldsChangeUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldsChangeUpdate) ProtoMessage() {} + +func (x *FieldsChangeUpdate) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_application_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldsChangeUpdate.ProtoReflect.Descriptor instead. +func (*FieldsChangeUpdate) Descriptor() ([]byte, []int) { + return file_deephaven_proto_application_proto_rawDescGZIP(), []int{1} +} + +func (x *FieldsChangeUpdate) GetCreated() []*FieldInfo { + if x != nil { + return x.Created + } + return nil +} + +func (x *FieldsChangeUpdate) GetUpdated() []*FieldInfo { + if x != nil { + return x.Updated + } + return nil +} + +func (x *FieldsChangeUpdate) GetRemoved() []*FieldInfo { + if x != nil { + return x.Removed + } + return nil +} + +// +// A lightweight object describing the exposed field. +type FieldInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypedTicket *ticket.TypedTicket `protobuf:"bytes,1,opt,name=typed_ticket,json=typedTicket,proto3" json:"typed_ticket,omitempty"` + FieldName string `protobuf:"bytes,2,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + FieldDescription string `protobuf:"bytes,3,opt,name=field_description,json=fieldDescription,proto3" json:"field_description,omitempty"` + ApplicationName string `protobuf:"bytes,4,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"` // display-friendly identification + ApplicationId string `protobuf:"bytes,5,opt,name=application_id,json=applicationId,proto3" json:"application_id,omitempty"` // computer-friendly identification +} + +func (x *FieldInfo) Reset() { + *x = FieldInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_application_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldInfo) ProtoMessage() {} + +func (x *FieldInfo) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_application_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldInfo.ProtoReflect.Descriptor instead. +func (*FieldInfo) Descriptor() ([]byte, []int) { + return file_deephaven_proto_application_proto_rawDescGZIP(), []int{2} +} + +func (x *FieldInfo) GetTypedTicket() *ticket.TypedTicket { + if x != nil { + return x.TypedTicket + } + return nil +} + +func (x *FieldInfo) GetFieldName() string { + if x != nil { + return x.FieldName + } + return "" +} + +func (x *FieldInfo) GetFieldDescription() string { + if x != nil { + return x.FieldDescription + } + return "" +} + +func (x *FieldInfo) GetApplicationName() string { + if x != nil { + return x.ApplicationName + } + return "" +} + +func (x *FieldInfo) GetApplicationId() string { + if x != nil { + return x.ApplicationId + } + return "" +} + +var File_deephaven_proto_application_proto protoreflect.FileDescriptor + +var file_deephaven_proto_application_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xec, 0x01, 0x0a, 0x12, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x46, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x46, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0xfc, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x51, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0b, 0x74, 0x79, + 0x70, 0x65, 0x64, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0x93, 0x01, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, + 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x34, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x47, 0x48, + 0x01, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_application_proto_rawDescOnce sync.Once + file_deephaven_proto_application_proto_rawDescData = file_deephaven_proto_application_proto_rawDesc +) + +func file_deephaven_proto_application_proto_rawDescGZIP() []byte { + file_deephaven_proto_application_proto_rawDescOnce.Do(func() { + file_deephaven_proto_application_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_application_proto_rawDescData) + }) + return file_deephaven_proto_application_proto_rawDescData +} + +var file_deephaven_proto_application_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_deephaven_proto_application_proto_goTypes = []interface{}{ + (*ListFieldsRequest)(nil), // 0: io.deephaven.proto.backplane.grpc.ListFieldsRequest + (*FieldsChangeUpdate)(nil), // 1: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate + (*FieldInfo)(nil), // 2: io.deephaven.proto.backplane.grpc.FieldInfo + (*ticket.TypedTicket)(nil), // 3: io.deephaven.proto.backplane.grpc.TypedTicket +} +var file_deephaven_proto_application_proto_depIdxs = []int32{ + 2, // 0: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.created:type_name -> io.deephaven.proto.backplane.grpc.FieldInfo + 2, // 1: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.updated:type_name -> io.deephaven.proto.backplane.grpc.FieldInfo + 2, // 2: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate.removed:type_name -> io.deephaven.proto.backplane.grpc.FieldInfo + 3, // 3: io.deephaven.proto.backplane.grpc.FieldInfo.typed_ticket:type_name -> io.deephaven.proto.backplane.grpc.TypedTicket + 0, // 4: io.deephaven.proto.backplane.grpc.ApplicationService.ListFields:input_type -> io.deephaven.proto.backplane.grpc.ListFieldsRequest + 1, // 5: io.deephaven.proto.backplane.grpc.ApplicationService.ListFields:output_type -> io.deephaven.proto.backplane.grpc.FieldsChangeUpdate + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_application_proto_init() } +func file_deephaven_proto_application_proto_init() { + if File_deephaven_proto_application_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_application_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFieldsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_application_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldsChangeUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_application_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_application_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_application_proto_goTypes, + DependencyIndexes: file_deephaven_proto_application_proto_depIdxs, + MessageInfos: file_deephaven_proto_application_proto_msgTypes, + }.Build() + File_deephaven_proto_application_proto = out.File + file_deephaven_proto_application_proto_rawDesc = nil + file_deephaven_proto_application_proto_goTypes = nil + file_deephaven_proto_application_proto_depIdxs = nil +} diff --git a/go/internal/proto/application/application_grpc.pb.go b/go/internal/proto/application/application_grpc.pb.go new file mode 100644 index 00000000000..ffe92a1f241 --- /dev/null +++ b/go/internal/proto/application/application_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/application.proto + +package application + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ApplicationServiceClient is the client API for ApplicationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ApplicationServiceClient interface { + // + // Request the list of the fields exposed via the worker. + // + // - The first received message contains all fields that are currently available + // on the worker. None of these fields will be RemovedFields. + // - Subsequent messages modify the existing state. Fields are identified by + // their ticket and may be replaced or removed. + ListFields(ctx context.Context, in *ListFieldsRequest, opts ...grpc.CallOption) (ApplicationService_ListFieldsClient, error) +} + +type applicationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewApplicationServiceClient(cc grpc.ClientConnInterface) ApplicationServiceClient { + return &applicationServiceClient{cc} +} + +func (c *applicationServiceClient) ListFields(ctx context.Context, in *ListFieldsRequest, opts ...grpc.CallOption) (ApplicationService_ListFieldsClient, error) { + stream, err := c.cc.NewStream(ctx, &ApplicationService_ServiceDesc.Streams[0], "/io.deephaven.proto.backplane.grpc.ApplicationService/ListFields", opts...) + if err != nil { + return nil, err + } + x := &applicationServiceListFieldsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ApplicationService_ListFieldsClient interface { + Recv() (*FieldsChangeUpdate, error) + grpc.ClientStream +} + +type applicationServiceListFieldsClient struct { + grpc.ClientStream +} + +func (x *applicationServiceListFieldsClient) Recv() (*FieldsChangeUpdate, error) { + m := new(FieldsChangeUpdate) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ApplicationServiceServer is the server API for ApplicationService service. +// All implementations must embed UnimplementedApplicationServiceServer +// for forward compatibility +type ApplicationServiceServer interface { + // + // Request the list of the fields exposed via the worker. + // + // - The first received message contains all fields that are currently available + // on the worker. None of these fields will be RemovedFields. + // - Subsequent messages modify the existing state. Fields are identified by + // their ticket and may be replaced or removed. + ListFields(*ListFieldsRequest, ApplicationService_ListFieldsServer) error + mustEmbedUnimplementedApplicationServiceServer() +} + +// UnimplementedApplicationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedApplicationServiceServer struct { +} + +func (UnimplementedApplicationServiceServer) ListFields(*ListFieldsRequest, ApplicationService_ListFieldsServer) error { + return status.Errorf(codes.Unimplemented, "method ListFields not implemented") +} +func (UnimplementedApplicationServiceServer) mustEmbedUnimplementedApplicationServiceServer() {} + +// UnsafeApplicationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ApplicationServiceServer will +// result in compilation errors. +type UnsafeApplicationServiceServer interface { + mustEmbedUnimplementedApplicationServiceServer() +} + +func RegisterApplicationServiceServer(s grpc.ServiceRegistrar, srv ApplicationServiceServer) { + s.RegisterService(&ApplicationService_ServiceDesc, srv) +} + +func _ApplicationService_ListFields_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListFieldsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ApplicationServiceServer).ListFields(m, &applicationServiceListFieldsServer{stream}) +} + +type ApplicationService_ListFieldsServer interface { + Send(*FieldsChangeUpdate) error + grpc.ServerStream +} + +type applicationServiceListFieldsServer struct { + grpc.ServerStream +} + +func (x *applicationServiceListFieldsServer) Send(m *FieldsChangeUpdate) error { + return x.ServerStream.SendMsg(m) +} + +// ApplicationService_ServiceDesc is the grpc.ServiceDesc for ApplicationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ApplicationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.ApplicationService", + HandlerType: (*ApplicationServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListFields", + Handler: _ApplicationService_ListFields_Handler, + ServerStreams: true, + }, + }, + Metadata: "deephaven/proto/application.proto", +} diff --git a/go/internal/proto/console/console.pb.go b/go/internal/proto/console/console.pb.go new file mode 100644 index 00000000000..4c0d1afd4c6 --- /dev/null +++ b/go/internal/proto/console/console.pb.go @@ -0,0 +1,5183 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/console.proto + +package console + +import ( + application "github.com/deephaven/deephaven-core/go/internal/proto/application" + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FigureDescriptor_SeriesPlotStyle int32 + +const ( + FigureDescriptor_BAR FigureDescriptor_SeriesPlotStyle = 0 + FigureDescriptor_STACKED_BAR FigureDescriptor_SeriesPlotStyle = 1 + FigureDescriptor_LINE FigureDescriptor_SeriesPlotStyle = 2 + FigureDescriptor_AREA FigureDescriptor_SeriesPlotStyle = 3 + FigureDescriptor_STACKED_AREA FigureDescriptor_SeriesPlotStyle = 4 + FigureDescriptor_PIE FigureDescriptor_SeriesPlotStyle = 5 + FigureDescriptor_HISTOGRAM FigureDescriptor_SeriesPlotStyle = 6 + FigureDescriptor_OHLC FigureDescriptor_SeriesPlotStyle = 7 + FigureDescriptor_SCATTER FigureDescriptor_SeriesPlotStyle = 8 + FigureDescriptor_STEP FigureDescriptor_SeriesPlotStyle = 9 + FigureDescriptor_ERROR_BAR FigureDescriptor_SeriesPlotStyle = 10 + FigureDescriptor_TREEMAP FigureDescriptor_SeriesPlotStyle = 11 +) + +// Enum value maps for FigureDescriptor_SeriesPlotStyle. +var ( + FigureDescriptor_SeriesPlotStyle_name = map[int32]string{ + 0: "BAR", + 1: "STACKED_BAR", + 2: "LINE", + 3: "AREA", + 4: "STACKED_AREA", + 5: "PIE", + 6: "HISTOGRAM", + 7: "OHLC", + 8: "SCATTER", + 9: "STEP", + 10: "ERROR_BAR", + 11: "TREEMAP", + } + FigureDescriptor_SeriesPlotStyle_value = map[string]int32{ + "BAR": 0, + "STACKED_BAR": 1, + "LINE": 2, + "AREA": 3, + "STACKED_AREA": 4, + "PIE": 5, + "HISTOGRAM": 6, + "OHLC": 7, + "SCATTER": 8, + "STEP": 9, + "ERROR_BAR": 10, + "TREEMAP": 11, + } +) + +func (x FigureDescriptor_SeriesPlotStyle) Enum() *FigureDescriptor_SeriesPlotStyle { + p := new(FigureDescriptor_SeriesPlotStyle) + *p = x + return p +} + +func (x FigureDescriptor_SeriesPlotStyle) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_SeriesPlotStyle) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[0].Descriptor() +} + +func (FigureDescriptor_SeriesPlotStyle) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[0] +} + +func (x FigureDescriptor_SeriesPlotStyle) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_SeriesPlotStyle.Descriptor instead. +func (FigureDescriptor_SeriesPlotStyle) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0} +} + +type FigureDescriptor_SourceType int32 + +const ( + FigureDescriptor_X FigureDescriptor_SourceType = 0 + FigureDescriptor_Y FigureDescriptor_SourceType = 1 + FigureDescriptor_Z FigureDescriptor_SourceType = 2 + FigureDescriptor_X_LOW FigureDescriptor_SourceType = 3 + FigureDescriptor_X_HIGH FigureDescriptor_SourceType = 4 + FigureDescriptor_Y_LOW FigureDescriptor_SourceType = 5 + FigureDescriptor_Y_HIGH FigureDescriptor_SourceType = 6 + FigureDescriptor_TIME FigureDescriptor_SourceType = 7 + FigureDescriptor_OPEN FigureDescriptor_SourceType = 8 + FigureDescriptor_HIGH FigureDescriptor_SourceType = 9 + FigureDescriptor_LOW FigureDescriptor_SourceType = 10 + FigureDescriptor_CLOSE FigureDescriptor_SourceType = 11 + FigureDescriptor_SHAPE FigureDescriptor_SourceType = 12 + FigureDescriptor_SIZE FigureDescriptor_SourceType = 13 + FigureDescriptor_LABEL FigureDescriptor_SourceType = 14 + FigureDescriptor_COLOR FigureDescriptor_SourceType = 15 + FigureDescriptor_PARENT FigureDescriptor_SourceType = 16 + FigureDescriptor_HOVER_TEXT FigureDescriptor_SourceType = 17 + FigureDescriptor_TEXT FigureDescriptor_SourceType = 18 +) + +// Enum value maps for FigureDescriptor_SourceType. +var ( + FigureDescriptor_SourceType_name = map[int32]string{ + 0: "X", + 1: "Y", + 2: "Z", + 3: "X_LOW", + 4: "X_HIGH", + 5: "Y_LOW", + 6: "Y_HIGH", + 7: "TIME", + 8: "OPEN", + 9: "HIGH", + 10: "LOW", + 11: "CLOSE", + 12: "SHAPE", + 13: "SIZE", + 14: "LABEL", + 15: "COLOR", + 16: "PARENT", + 17: "HOVER_TEXT", + 18: "TEXT", + } + FigureDescriptor_SourceType_value = map[string]int32{ + "X": 0, + "Y": 1, + "Z": 2, + "X_LOW": 3, + "X_HIGH": 4, + "Y_LOW": 5, + "Y_HIGH": 6, + "TIME": 7, + "OPEN": 8, + "HIGH": 9, + "LOW": 10, + "CLOSE": 11, + "SHAPE": 12, + "SIZE": 13, + "LABEL": 14, + "COLOR": 15, + "PARENT": 16, + "HOVER_TEXT": 17, + "TEXT": 18, + } +) + +func (x FigureDescriptor_SourceType) Enum() *FigureDescriptor_SourceType { + p := new(FigureDescriptor_SourceType) + *p = x + return p +} + +func (x FigureDescriptor_SourceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_SourceType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[1].Descriptor() +} + +func (FigureDescriptor_SourceType) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[1] +} + +func (x FigureDescriptor_SourceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_SourceType.Descriptor instead. +func (FigureDescriptor_SourceType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 1} +} + +type FigureDescriptor_ChartDescriptor_ChartType int32 + +const ( + FigureDescriptor_ChartDescriptor_XY FigureDescriptor_ChartDescriptor_ChartType = 0 + FigureDescriptor_ChartDescriptor_PIE FigureDescriptor_ChartDescriptor_ChartType = 1 + FigureDescriptor_ChartDescriptor_OHLC FigureDescriptor_ChartDescriptor_ChartType = 2 + FigureDescriptor_ChartDescriptor_CATEGORY FigureDescriptor_ChartDescriptor_ChartType = 3 + FigureDescriptor_ChartDescriptor_XYZ FigureDescriptor_ChartDescriptor_ChartType = 4 + FigureDescriptor_ChartDescriptor_CATEGORY_3D FigureDescriptor_ChartDescriptor_ChartType = 5 + FigureDescriptor_ChartDescriptor_TREEMAP FigureDescriptor_ChartDescriptor_ChartType = 6 +) + +// Enum value maps for FigureDescriptor_ChartDescriptor_ChartType. +var ( + FigureDescriptor_ChartDescriptor_ChartType_name = map[int32]string{ + 0: "XY", + 1: "PIE", + 2: "OHLC", + 3: "CATEGORY", + 4: "XYZ", + 5: "CATEGORY_3D", + 6: "TREEMAP", + } + FigureDescriptor_ChartDescriptor_ChartType_value = map[string]int32{ + "XY": 0, + "PIE": 1, + "OHLC": 2, + "CATEGORY": 3, + "XYZ": 4, + "CATEGORY_3D": 5, + "TREEMAP": 6, + } +) + +func (x FigureDescriptor_ChartDescriptor_ChartType) Enum() *FigureDescriptor_ChartDescriptor_ChartType { + p := new(FigureDescriptor_ChartDescriptor_ChartType) + *p = x + return p +} + +func (x FigureDescriptor_ChartDescriptor_ChartType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_ChartDescriptor_ChartType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[2].Descriptor() +} + +func (FigureDescriptor_ChartDescriptor_ChartType) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[2] +} + +func (x FigureDescriptor_ChartDescriptor_ChartType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_ChartDescriptor_ChartType.Descriptor instead. +func (FigureDescriptor_ChartDescriptor_ChartType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0, 0} +} + +type FigureDescriptor_AxisDescriptor_AxisFormatType int32 + +const ( + FigureDescriptor_AxisDescriptor_CATEGORY FigureDescriptor_AxisDescriptor_AxisFormatType = 0 + FigureDescriptor_AxisDescriptor_NUMBER FigureDescriptor_AxisDescriptor_AxisFormatType = 1 +) + +// Enum value maps for FigureDescriptor_AxisDescriptor_AxisFormatType. +var ( + FigureDescriptor_AxisDescriptor_AxisFormatType_name = map[int32]string{ + 0: "CATEGORY", + 1: "NUMBER", + } + FigureDescriptor_AxisDescriptor_AxisFormatType_value = map[string]int32{ + "CATEGORY": 0, + "NUMBER": 1, + } +) + +func (x FigureDescriptor_AxisDescriptor_AxisFormatType) Enum() *FigureDescriptor_AxisDescriptor_AxisFormatType { + p := new(FigureDescriptor_AxisDescriptor_AxisFormatType) + *p = x + return p +} + +func (x FigureDescriptor_AxisDescriptor_AxisFormatType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_AxisDescriptor_AxisFormatType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[3].Descriptor() +} + +func (FigureDescriptor_AxisDescriptor_AxisFormatType) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[3] +} + +func (x FigureDescriptor_AxisDescriptor_AxisFormatType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_AxisDescriptor_AxisFormatType.Descriptor instead. +func (FigureDescriptor_AxisDescriptor_AxisFormatType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 0} +} + +type FigureDescriptor_AxisDescriptor_AxisType int32 + +const ( + FigureDescriptor_AxisDescriptor_X FigureDescriptor_AxisDescriptor_AxisType = 0 + FigureDescriptor_AxisDescriptor_Y FigureDescriptor_AxisDescriptor_AxisType = 1 + FigureDescriptor_AxisDescriptor_SHAPE FigureDescriptor_AxisDescriptor_AxisType = 2 + FigureDescriptor_AxisDescriptor_SIZE FigureDescriptor_AxisDescriptor_AxisType = 3 + FigureDescriptor_AxisDescriptor_LABEL FigureDescriptor_AxisDescriptor_AxisType = 4 + FigureDescriptor_AxisDescriptor_COLOR FigureDescriptor_AxisDescriptor_AxisType = 5 +) + +// Enum value maps for FigureDescriptor_AxisDescriptor_AxisType. +var ( + FigureDescriptor_AxisDescriptor_AxisType_name = map[int32]string{ + 0: "X", + 1: "Y", + 2: "SHAPE", + 3: "SIZE", + 4: "LABEL", + 5: "COLOR", + } + FigureDescriptor_AxisDescriptor_AxisType_value = map[string]int32{ + "X": 0, + "Y": 1, + "SHAPE": 2, + "SIZE": 3, + "LABEL": 4, + "COLOR": 5, + } +) + +func (x FigureDescriptor_AxisDescriptor_AxisType) Enum() *FigureDescriptor_AxisDescriptor_AxisType { + p := new(FigureDescriptor_AxisDescriptor_AxisType) + *p = x + return p +} + +func (x FigureDescriptor_AxisDescriptor_AxisType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_AxisDescriptor_AxisType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[4].Descriptor() +} + +func (FigureDescriptor_AxisDescriptor_AxisType) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[4] +} + +func (x FigureDescriptor_AxisDescriptor_AxisType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_AxisDescriptor_AxisType.Descriptor instead. +func (FigureDescriptor_AxisDescriptor_AxisType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 1} +} + +type FigureDescriptor_AxisDescriptor_AxisPosition int32 + +const ( + FigureDescriptor_AxisDescriptor_TOP FigureDescriptor_AxisDescriptor_AxisPosition = 0 + FigureDescriptor_AxisDescriptor_BOTTOM FigureDescriptor_AxisDescriptor_AxisPosition = 1 + FigureDescriptor_AxisDescriptor_LEFT FigureDescriptor_AxisDescriptor_AxisPosition = 2 + FigureDescriptor_AxisDescriptor_RIGHT FigureDescriptor_AxisDescriptor_AxisPosition = 3 + FigureDescriptor_AxisDescriptor_NONE FigureDescriptor_AxisDescriptor_AxisPosition = 4 +) + +// Enum value maps for FigureDescriptor_AxisDescriptor_AxisPosition. +var ( + FigureDescriptor_AxisDescriptor_AxisPosition_name = map[int32]string{ + 0: "TOP", + 1: "BOTTOM", + 2: "LEFT", + 3: "RIGHT", + 4: "NONE", + } + FigureDescriptor_AxisDescriptor_AxisPosition_value = map[string]int32{ + "TOP": 0, + "BOTTOM": 1, + "LEFT": 2, + "RIGHT": 3, + "NONE": 4, + } +) + +func (x FigureDescriptor_AxisDescriptor_AxisPosition) Enum() *FigureDescriptor_AxisDescriptor_AxisPosition { + p := new(FigureDescriptor_AxisDescriptor_AxisPosition) + *p = x + return p +} + +func (x FigureDescriptor_AxisDescriptor_AxisPosition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_AxisDescriptor_AxisPosition) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[5].Descriptor() +} + +func (FigureDescriptor_AxisDescriptor_AxisPosition) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[5] +} + +func (x FigureDescriptor_AxisDescriptor_AxisPosition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_AxisDescriptor_AxisPosition.Descriptor instead. +func (FigureDescriptor_AxisDescriptor_AxisPosition) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 2} +} + +type FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek int32 + +const ( + FigureDescriptor_BusinessCalendarDescriptor_SUNDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 0 + FigureDescriptor_BusinessCalendarDescriptor_MONDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 1 + FigureDescriptor_BusinessCalendarDescriptor_TUESDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 2 + FigureDescriptor_BusinessCalendarDescriptor_WEDNESDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 3 + FigureDescriptor_BusinessCalendarDescriptor_THURSDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 4 + FigureDescriptor_BusinessCalendarDescriptor_FRIDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 5 + FigureDescriptor_BusinessCalendarDescriptor_SATURDAY FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek = 6 +) + +// Enum value maps for FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek. +var ( + FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_name = map[int32]string{ + 0: "SUNDAY", + 1: "MONDAY", + 2: "TUESDAY", + 3: "WEDNESDAY", + 4: "THURSDAY", + 5: "FRIDAY", + 6: "SATURDAY", + } + FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek_value = map[string]int32{ + "SUNDAY": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + } +) + +func (x FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) Enum() *FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek { + p := new(FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) + *p = x + return p +} + +func (x FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_console_proto_enumTypes[6].Descriptor() +} + +func (FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) Type() protoreflect.EnumType { + return &file_deephaven_proto_console_proto_enumTypes[6] +} + +func (x FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek.Descriptor instead. +func (FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 0} +} + +type GetConsoleTypesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetConsoleTypesRequest) Reset() { + *x = GetConsoleTypesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConsoleTypesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConsoleTypesRequest) ProtoMessage() {} + +func (x *GetConsoleTypesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConsoleTypesRequest.ProtoReflect.Descriptor instead. +func (*GetConsoleTypesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{0} +} + +type GetConsoleTypesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleTypes []string `protobuf:"bytes,1,rep,name=console_types,json=consoleTypes,proto3" json:"console_types,omitempty"` +} + +func (x *GetConsoleTypesResponse) Reset() { + *x = GetConsoleTypesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConsoleTypesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConsoleTypesResponse) ProtoMessage() {} + +func (x *GetConsoleTypesResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConsoleTypesResponse.ProtoReflect.Descriptor instead. +func (*GetConsoleTypesResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{1} +} + +func (x *GetConsoleTypesResponse) GetConsoleTypes() []string { + if x != nil { + return x.ConsoleTypes + } + return nil +} + +type StartConsoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SessionType string `protobuf:"bytes,2,opt,name=session_type,json=sessionType,proto3" json:"session_type,omitempty"` +} + +func (x *StartConsoleRequest) Reset() { + *x = StartConsoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartConsoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartConsoleRequest) ProtoMessage() {} + +func (x *StartConsoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartConsoleRequest.ProtoReflect.Descriptor instead. +func (*StartConsoleRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{2} +} + +func (x *StartConsoleRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *StartConsoleRequest) GetSessionType() string { + if x != nil { + return x.SessionType + } + return "" +} + +type StartConsoleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *StartConsoleResponse) Reset() { + *x = StartConsoleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartConsoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartConsoleResponse) ProtoMessage() {} + +func (x *StartConsoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartConsoleResponse.ProtoReflect.Descriptor instead. +func (*StartConsoleResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{3} +} + +func (x *StartConsoleResponse) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type LogSubscriptionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // presently you get _all_ logs, not just your console + // Ticket console_id = 1; + LastSeenLogTimestamp int64 `protobuf:"varint,1,opt,name=last_seen_log_timestamp,json=lastSeenLogTimestamp,proto3" json:"last_seen_log_timestamp,omitempty"` + Levels []string `protobuf:"bytes,2,rep,name=levels,proto3" json:"levels,omitempty"` +} + +func (x *LogSubscriptionRequest) Reset() { + *x = LogSubscriptionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogSubscriptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogSubscriptionRequest) ProtoMessage() {} + +func (x *LogSubscriptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogSubscriptionRequest.ProtoReflect.Descriptor instead. +func (*LogSubscriptionRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{4} +} + +func (x *LogSubscriptionRequest) GetLastSeenLogTimestamp() int64 { + if x != nil { + return x.LastSeenLogTimestamp + } + return 0 +} + +func (x *LogSubscriptionRequest) GetLevels() []string { + if x != nil { + return x.Levels + } + return nil +} + +type LogSubscriptionData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Micros int64 `protobuf:"varint,1,opt,name=micros,proto3" json:"micros,omitempty"` + LogLevel string `protobuf:"bytes,2,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *LogSubscriptionData) Reset() { + *x = LogSubscriptionData{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogSubscriptionData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogSubscriptionData) ProtoMessage() {} + +func (x *LogSubscriptionData) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogSubscriptionData.ProtoReflect.Descriptor instead. +func (*LogSubscriptionData) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{5} +} + +func (x *LogSubscriptionData) GetMicros() int64 { + if x != nil { + return x.Micros + } + return 0 +} + +func (x *LogSubscriptionData) GetLogLevel() string { + if x != nil { + return x.LogLevel + } + return "" +} + +func (x *LogSubscriptionData) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ExecuteCommandRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` +} + +func (x *ExecuteCommandRequest) Reset() { + *x = ExecuteCommandRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecuteCommandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteCommandRequest) ProtoMessage() {} + +func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteCommandRequest.ProtoReflect.Descriptor instead. +func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{6} +} + +func (x *ExecuteCommandRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *ExecuteCommandRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type ExecuteCommandResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrorMessage string `protobuf:"bytes,1,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + Changes *application.FieldsChangeUpdate `protobuf:"bytes,2,opt,name=changes,proto3" json:"changes,omitempty"` +} + +func (x *ExecuteCommandResponse) Reset() { + *x = ExecuteCommandResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecuteCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteCommandResponse) ProtoMessage() {} + +func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteCommandResponse.ProtoReflect.Descriptor instead. +func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{7} +} + +func (x *ExecuteCommandResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *ExecuteCommandResponse) GetChanges() *application.FieldsChangeUpdate { + if x != nil { + return x.Changes + } + return nil +} + +type BindTableToVariableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + VariableName string `protobuf:"bytes,3,opt,name=variable_name,json=variableName,proto3" json:"variable_name,omitempty"` + TableId *ticket.Ticket `protobuf:"bytes,4,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` +} + +func (x *BindTableToVariableRequest) Reset() { + *x = BindTableToVariableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BindTableToVariableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindTableToVariableRequest) ProtoMessage() {} + +func (x *BindTableToVariableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindTableToVariableRequest.ProtoReflect.Descriptor instead. +func (*BindTableToVariableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{8} +} + +func (x *BindTableToVariableRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *BindTableToVariableRequest) GetVariableName() string { + if x != nil { + return x.VariableName + } + return "" +} + +func (x *BindTableToVariableRequest) GetTableId() *ticket.Ticket { + if x != nil { + return x.TableId + } + return nil +} + +type BindTableToVariableResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BindTableToVariableResponse) Reset() { + *x = BindTableToVariableResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BindTableToVariableResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindTableToVariableResponse) ProtoMessage() {} + +func (x *BindTableToVariableResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindTableToVariableResponse.ProtoReflect.Descriptor instead. +func (*BindTableToVariableResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{9} +} + +type CancelCommandRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + CommandId *ticket.Ticket `protobuf:"bytes,2,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` +} + +func (x *CancelCommandRequest) Reset() { + *x = CancelCommandRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelCommandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelCommandRequest) ProtoMessage() {} + +func (x *CancelCommandRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelCommandRequest.ProtoReflect.Descriptor instead. +func (*CancelCommandRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{10} +} + +func (x *CancelCommandRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *CancelCommandRequest) GetCommandId() *ticket.Ticket { + if x != nil { + return x.CommandId + } + return nil +} + +type CancelCommandResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelCommandResponse) Reset() { + *x = CancelCommandResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelCommandResponse) ProtoMessage() {} + +func (x *CancelCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelCommandResponse.ProtoReflect.Descriptor instead. +func (*CancelCommandResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{11} +} + +type AutoCompleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // *AutoCompleteRequest_OpenDocument + // *AutoCompleteRequest_ChangeDocument + // *AutoCompleteRequest_GetCompletionItems + // *AutoCompleteRequest_CloseDocument + Request isAutoCompleteRequest_Request `protobuf_oneof:"request"` +} + +func (x *AutoCompleteRequest) Reset() { + *x = AutoCompleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoCompleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoCompleteRequest) ProtoMessage() {} + +func (x *AutoCompleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoCompleteRequest.ProtoReflect.Descriptor instead. +func (*AutoCompleteRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{12} +} + +func (m *AutoCompleteRequest) GetRequest() isAutoCompleteRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *AutoCompleteRequest) GetOpenDocument() *OpenDocumentRequest { + if x, ok := x.GetRequest().(*AutoCompleteRequest_OpenDocument); ok { + return x.OpenDocument + } + return nil +} + +func (x *AutoCompleteRequest) GetChangeDocument() *ChangeDocumentRequest { + if x, ok := x.GetRequest().(*AutoCompleteRequest_ChangeDocument); ok { + return x.ChangeDocument + } + return nil +} + +func (x *AutoCompleteRequest) GetGetCompletionItems() *GetCompletionItemsRequest { + if x, ok := x.GetRequest().(*AutoCompleteRequest_GetCompletionItems); ok { + return x.GetCompletionItems + } + return nil +} + +func (x *AutoCompleteRequest) GetCloseDocument() *CloseDocumentRequest { + if x, ok := x.GetRequest().(*AutoCompleteRequest_CloseDocument); ok { + return x.CloseDocument + } + return nil +} + +type isAutoCompleteRequest_Request interface { + isAutoCompleteRequest_Request() +} + +type AutoCompleteRequest_OpenDocument struct { + // Starts a document in a given console - to end, just close the stream, the server will hang up right away + OpenDocument *OpenDocumentRequest `protobuf:"bytes,1,opt,name=open_document,json=openDocument,proto3,oneof"` +} + +type AutoCompleteRequest_ChangeDocument struct { + // Modifies the document that autocomplete can be requested on + ChangeDocument *ChangeDocumentRequest `protobuf:"bytes,2,opt,name=change_document,json=changeDocument,proto3,oneof"` +} + +type AutoCompleteRequest_GetCompletionItems struct { + // Requests that a response be sent back with completion items + GetCompletionItems *GetCompletionItemsRequest `protobuf:"bytes,3,opt,name=get_completion_items,json=getCompletionItems,proto3,oneof"` +} + +type AutoCompleteRequest_CloseDocument struct { + // Closes the document, indicating that it will not be referenced again + CloseDocument *CloseDocumentRequest `protobuf:"bytes,4,opt,name=close_document,json=closeDocument,proto3,oneof"` +} + +func (*AutoCompleteRequest_OpenDocument) isAutoCompleteRequest_Request() {} + +func (*AutoCompleteRequest_ChangeDocument) isAutoCompleteRequest_Request() {} + +func (*AutoCompleteRequest_GetCompletionItems) isAutoCompleteRequest_Request() {} + +func (*AutoCompleteRequest_CloseDocument) isAutoCompleteRequest_Request() {} + +type AutoCompleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // *AutoCompleteResponse_CompletionItems + Response isAutoCompleteResponse_Response `protobuf_oneof:"response"` +} + +func (x *AutoCompleteResponse) Reset() { + *x = AutoCompleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoCompleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoCompleteResponse) ProtoMessage() {} + +func (x *AutoCompleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoCompleteResponse.ProtoReflect.Descriptor instead. +func (*AutoCompleteResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{13} +} + +func (m *AutoCompleteResponse) GetResponse() isAutoCompleteResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *AutoCompleteResponse) GetCompletionItems() *GetCompletionItemsResponse { + if x, ok := x.GetResponse().(*AutoCompleteResponse_CompletionItems); ok { + return x.CompletionItems + } + return nil +} + +type isAutoCompleteResponse_Response interface { + isAutoCompleteResponse_Response() +} + +type AutoCompleteResponse_CompletionItems struct { + CompletionItems *GetCompletionItemsResponse `protobuf:"bytes,1,opt,name=completion_items,json=completionItems,proto3,oneof"` +} + +func (*AutoCompleteResponse_CompletionItems) isAutoCompleteResponse_Response() {} + +type BrowserNextResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BrowserNextResponse) Reset() { + *x = BrowserNextResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BrowserNextResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BrowserNextResponse) ProtoMessage() {} + +func (x *BrowserNextResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BrowserNextResponse.ProtoReflect.Descriptor instead. +func (*BrowserNextResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{14} +} + +type OpenDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + TextDocument *TextDocumentItem `protobuf:"bytes,2,opt,name=text_document,json=textDocument,proto3" json:"text_document,omitempty"` +} + +func (x *OpenDocumentRequest) Reset() { + *x = OpenDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OpenDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenDocumentRequest) ProtoMessage() {} + +func (x *OpenDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OpenDocumentRequest.ProtoReflect.Descriptor instead. +func (*OpenDocumentRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{15} +} + +func (x *OpenDocumentRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *OpenDocumentRequest) GetTextDocument() *TextDocumentItem { + if x != nil { + return x.TextDocument + } + return nil +} + +type TextDocumentItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + LanguageId string `protobuf:"bytes,2,opt,name=language_id,json=languageId,proto3" json:"language_id,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` +} + +func (x *TextDocumentItem) Reset() { + *x = TextDocumentItem{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextDocumentItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextDocumentItem) ProtoMessage() {} + +func (x *TextDocumentItem) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextDocumentItem.ProtoReflect.Descriptor instead. +func (*TextDocumentItem) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{16} +} + +func (x *TextDocumentItem) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *TextDocumentItem) GetLanguageId() string { + if x != nil { + return x.LanguageId + } + return "" +} + +func (x *TextDocumentItem) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *TextDocumentItem) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +type CloseDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + TextDocument *VersionedTextDocumentIdentifier `protobuf:"bytes,2,opt,name=text_document,json=textDocument,proto3" json:"text_document,omitempty"` //TODO actually just uri? +} + +func (x *CloseDocumentRequest) Reset() { + *x = CloseDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseDocumentRequest) ProtoMessage() {} + +func (x *CloseDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloseDocumentRequest.ProtoReflect.Descriptor instead. +func (*CloseDocumentRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{17} +} + +func (x *CloseDocumentRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *CloseDocumentRequest) GetTextDocument() *VersionedTextDocumentIdentifier { + if x != nil { + return x.TextDocument + } + return nil +} + +type ChangeDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + TextDocument *VersionedTextDocumentIdentifier `protobuf:"bytes,2,opt,name=text_document,json=textDocument,proto3" json:"text_document,omitempty"` //TODO actually just uri? + ContentChanges []*ChangeDocumentRequest_TextDocumentContentChangeEvent `protobuf:"bytes,3,rep,name=content_changes,json=contentChanges,proto3" json:"content_changes,omitempty"` +} + +func (x *ChangeDocumentRequest) Reset() { + *x = ChangeDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeDocumentRequest) ProtoMessage() {} + +func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeDocumentRequest.ProtoReflect.Descriptor instead. +func (*ChangeDocumentRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{18} +} + +func (x *ChangeDocumentRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *ChangeDocumentRequest) GetTextDocument() *VersionedTextDocumentIdentifier { + if x != nil { + return x.TextDocument + } + return nil +} + +func (x *ChangeDocumentRequest) GetContentChanges() []*ChangeDocumentRequest_TextDocumentContentChangeEvent { + if x != nil { + return x.ContentChanges + } + return nil +} + +type DocumentRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start *Position `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` + End *Position `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (x *DocumentRange) Reset() { + *x = DocumentRange{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentRange) ProtoMessage() {} + +func (x *DocumentRange) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentRange.ProtoReflect.Descriptor instead. +func (*DocumentRange) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{19} +} + +func (x *DocumentRange) GetStart() *Position { + if x != nil { + return x.Start + } + return nil +} + +func (x *DocumentRange) GetEnd() *Position { + if x != nil { + return x.End + } + return nil +} + +type VersionedTextDocumentIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *VersionedTextDocumentIdentifier) Reset() { + *x = VersionedTextDocumentIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VersionedTextDocumentIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionedTextDocumentIdentifier) ProtoMessage() {} + +func (x *VersionedTextDocumentIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VersionedTextDocumentIdentifier.ProtoReflect.Descriptor instead. +func (*VersionedTextDocumentIdentifier) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{20} +} + +func (x *VersionedTextDocumentIdentifier) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *VersionedTextDocumentIdentifier) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +type Position struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"` + Character int32 `protobuf:"varint,2,opt,name=character,proto3" json:"character,omitempty"` +} + +func (x *Position) Reset() { + *x = Position{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Position) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Position) ProtoMessage() {} + +func (x *Position) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Position.ProtoReflect.Descriptor instead. +func (*Position) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{21} +} + +func (x *Position) GetLine() int32 { + if x != nil { + return x.Line + } + return 0 +} + +func (x *Position) GetCharacter() int32 { + if x != nil { + return x.Character + } + return 0 +} + +type GetCompletionItemsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsoleId *ticket.Ticket `protobuf:"bytes,1,opt,name=console_id,json=consoleId,proto3" json:"console_id,omitempty"` + Context *CompletionContext `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"` + TextDocument *VersionedTextDocumentIdentifier `protobuf:"bytes,3,opt,name=text_document,json=textDocument,proto3" json:"text_document,omitempty"` + Position *Position `protobuf:"bytes,4,opt,name=position,proto3" json:"position,omitempty"` + RequestId int32 `protobuf:"varint,5,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` +} + +func (x *GetCompletionItemsRequest) Reset() { + *x = GetCompletionItemsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompletionItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompletionItemsRequest) ProtoMessage() {} + +func (x *GetCompletionItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCompletionItemsRequest.ProtoReflect.Descriptor instead. +func (*GetCompletionItemsRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{22} +} + +func (x *GetCompletionItemsRequest) GetConsoleId() *ticket.Ticket { + if x != nil { + return x.ConsoleId + } + return nil +} + +func (x *GetCompletionItemsRequest) GetContext() *CompletionContext { + if x != nil { + return x.Context + } + return nil +} + +func (x *GetCompletionItemsRequest) GetTextDocument() *VersionedTextDocumentIdentifier { + if x != nil { + return x.TextDocument + } + return nil +} + +func (x *GetCompletionItemsRequest) GetPosition() *Position { + if x != nil { + return x.Position + } + return nil +} + +func (x *GetCompletionItemsRequest) GetRequestId() int32 { + if x != nil { + return x.RequestId + } + return 0 +} + +type CompletionContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TriggerKind int32 `protobuf:"varint,1,opt,name=trigger_kind,json=triggerKind,proto3" json:"trigger_kind,omitempty"` + TriggerCharacter string `protobuf:"bytes,2,opt,name=trigger_character,json=triggerCharacter,proto3" json:"trigger_character,omitempty"` +} + +func (x *CompletionContext) Reset() { + *x = CompletionContext{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompletionContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompletionContext) ProtoMessage() {} + +func (x *CompletionContext) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompletionContext.ProtoReflect.Descriptor instead. +func (*CompletionContext) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{23} +} + +func (x *CompletionContext) GetTriggerKind() int32 { + if x != nil { + return x.TriggerKind + } + return 0 +} + +func (x *CompletionContext) GetTriggerCharacter() string { + if x != nil { + return x.TriggerCharacter + } + return "" +} + +type GetCompletionItemsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*CompletionItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + RequestId int32 `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *GetCompletionItemsResponse) Reset() { + *x = GetCompletionItemsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompletionItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompletionItemsResponse) ProtoMessage() {} + +func (x *GetCompletionItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCompletionItemsResponse.ProtoReflect.Descriptor instead. +func (*GetCompletionItemsResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{24} +} + +func (x *GetCompletionItemsResponse) GetItems() []*CompletionItem { + if x != nil { + return x.Items + } + return nil +} + +func (x *GetCompletionItemsResponse) GetRequestId() int32 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *GetCompletionItemsResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type CompletionItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start int32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + Length int32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` + Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` + Kind int32 `protobuf:"varint,4,opt,name=kind,proto3" json:"kind,omitempty"` + Detail string `protobuf:"bytes,5,opt,name=detail,proto3" json:"detail,omitempty"` + Documentation string `protobuf:"bytes,6,opt,name=documentation,proto3" json:"documentation,omitempty"` + Deprecated bool `protobuf:"varint,7,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + Preselect bool `protobuf:"varint,8,opt,name=preselect,proto3" json:"preselect,omitempty"` + TextEdit *TextEdit `protobuf:"bytes,9,opt,name=text_edit,json=textEdit,proto3" json:"text_edit,omitempty"` + SortText string `protobuf:"bytes,10,opt,name=sort_text,json=sortText,proto3" json:"sort_text,omitempty"` + FilterText string `protobuf:"bytes,11,opt,name=filter_text,json=filterText,proto3" json:"filter_text,omitempty"` + InsertTextFormat int32 `protobuf:"varint,12,opt,name=insert_text_format,json=insertTextFormat,proto3" json:"insert_text_format,omitempty"` + AdditionalTextEdits []*TextEdit `protobuf:"bytes,13,rep,name=additional_text_edits,json=additionalTextEdits,proto3" json:"additional_text_edits,omitempty"` + CommitCharacters []string `protobuf:"bytes,14,rep,name=commit_characters,json=commitCharacters,proto3" json:"commit_characters,omitempty"` +} + +func (x *CompletionItem) Reset() { + *x = CompletionItem{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompletionItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompletionItem) ProtoMessage() {} + +func (x *CompletionItem) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompletionItem.ProtoReflect.Descriptor instead. +func (*CompletionItem) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{25} +} + +func (x *CompletionItem) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *CompletionItem) GetLength() int32 { + if x != nil { + return x.Length + } + return 0 +} + +func (x *CompletionItem) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *CompletionItem) GetKind() int32 { + if x != nil { + return x.Kind + } + return 0 +} + +func (x *CompletionItem) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +func (x *CompletionItem) GetDocumentation() string { + if x != nil { + return x.Documentation + } + return "" +} + +func (x *CompletionItem) GetDeprecated() bool { + if x != nil { + return x.Deprecated + } + return false +} + +func (x *CompletionItem) GetPreselect() bool { + if x != nil { + return x.Preselect + } + return false +} + +func (x *CompletionItem) GetTextEdit() *TextEdit { + if x != nil { + return x.TextEdit + } + return nil +} + +func (x *CompletionItem) GetSortText() string { + if x != nil { + return x.SortText + } + return "" +} + +func (x *CompletionItem) GetFilterText() string { + if x != nil { + return x.FilterText + } + return "" +} + +func (x *CompletionItem) GetInsertTextFormat() int32 { + if x != nil { + return x.InsertTextFormat + } + return 0 +} + +func (x *CompletionItem) GetAdditionalTextEdits() []*TextEdit { + if x != nil { + return x.AdditionalTextEdits + } + return nil +} + +func (x *CompletionItem) GetCommitCharacters() []string { + if x != nil { + return x.CommitCharacters + } + return nil +} + +type TextEdit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Range *DocumentRange `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` +} + +func (x *TextEdit) Reset() { + *x = TextEdit{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextEdit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextEdit) ProtoMessage() {} + +func (x *TextEdit) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextEdit.ProtoReflect.Descriptor instead. +func (*TextEdit) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{26} +} + +func (x *TextEdit) GetRange() *DocumentRange { + if x != nil { + return x.Range + } + return nil +} + +func (x *TextEdit) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +type FigureDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title *string `protobuf:"bytes,1,opt,name=title,proto3,oneof" json:"title,omitempty"` + TitleFont string `protobuf:"bytes,2,opt,name=title_font,json=titleFont,proto3" json:"title_font,omitempty"` + TitleColor string `protobuf:"bytes,3,opt,name=title_color,json=titleColor,proto3" json:"title_color,omitempty"` + UpdateInterval int64 `protobuf:"varint,7,opt,name=update_interval,json=updateInterval,proto3" json:"update_interval,omitempty"` + Cols int32 `protobuf:"varint,8,opt,name=cols,proto3" json:"cols,omitempty"` + Rows int32 `protobuf:"varint,9,opt,name=rows,proto3" json:"rows,omitempty"` + Charts []*FigureDescriptor_ChartDescriptor `protobuf:"bytes,10,rep,name=charts,proto3" json:"charts,omitempty"` + Errors []string `protobuf:"bytes,13,rep,name=errors,proto3" json:"errors,omitempty"` +} + +func (x *FigureDescriptor) Reset() { + *x = FigureDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27} +} + +func (x *FigureDescriptor) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *FigureDescriptor) GetTitleFont() string { + if x != nil { + return x.TitleFont + } + return "" +} + +func (x *FigureDescriptor) GetTitleColor() string { + if x != nil { + return x.TitleColor + } + return "" +} + +func (x *FigureDescriptor) GetUpdateInterval() int64 { + if x != nil { + return x.UpdateInterval + } + return 0 +} + +func (x *FigureDescriptor) GetCols() int32 { + if x != nil { + return x.Cols + } + return 0 +} + +func (x *FigureDescriptor) GetRows() int32 { + if x != nil { + return x.Rows + } + return 0 +} + +func (x *FigureDescriptor) GetCharts() []*FigureDescriptor_ChartDescriptor { + if x != nil { + return x.Charts + } + return nil +} + +func (x *FigureDescriptor) GetErrors() []string { + if x != nil { + return x.Errors + } + return nil +} + +type ChangeDocumentRequest_TextDocumentContentChangeEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Range *DocumentRange `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"` + RangeLength int32 `protobuf:"varint,2,opt,name=range_length,json=rangeLength,proto3" json:"range_length,omitempty"` + Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` +} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) Reset() { + *x = ChangeDocumentRequest_TextDocumentContentChangeEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeDocumentRequest_TextDocumentContentChangeEvent) ProtoMessage() {} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeDocumentRequest_TextDocumentContentChangeEvent.ProtoReflect.Descriptor instead. +func (*ChangeDocumentRequest_TextDocumentContentChangeEvent) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) GetRange() *DocumentRange { + if x != nil { + return x.Range + } + return nil +} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) GetRangeLength() int32 { + if x != nil { + return x.RangeLength + } + return 0 +} + +func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +type FigureDescriptor_ChartDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Colspan int32 `protobuf:"varint,1,opt,name=colspan,proto3" json:"colspan,omitempty"` + Rowspan int32 `protobuf:"varint,2,opt,name=rowspan,proto3" json:"rowspan,omitempty"` + Series []*FigureDescriptor_SeriesDescriptor `protobuf:"bytes,3,rep,name=series,proto3" json:"series,omitempty"` + MultiSeries []*FigureDescriptor_MultiSeriesDescriptor `protobuf:"bytes,4,rep,name=multi_series,json=multiSeries,proto3" json:"multi_series,omitempty"` + Axes []*FigureDescriptor_AxisDescriptor `protobuf:"bytes,5,rep,name=axes,proto3" json:"axes,omitempty"` + ChartType FigureDescriptor_ChartDescriptor_ChartType `protobuf:"varint,6,opt,name=chart_type,json=chartType,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_ChartDescriptor_ChartType" json:"chart_type,omitempty"` + Title *string `protobuf:"bytes,7,opt,name=title,proto3,oneof" json:"title,omitempty"` + TitleFont string `protobuf:"bytes,8,opt,name=title_font,json=titleFont,proto3" json:"title_font,omitempty"` + TitleColor string `protobuf:"bytes,9,opt,name=title_color,json=titleColor,proto3" json:"title_color,omitempty"` + ShowLegend bool `protobuf:"varint,10,opt,name=show_legend,json=showLegend,proto3" json:"show_legend,omitempty"` + LegendFont string `protobuf:"bytes,11,opt,name=legend_font,json=legendFont,proto3" json:"legend_font,omitempty"` + LegendColor string `protobuf:"bytes,12,opt,name=legend_color,json=legendColor,proto3" json:"legend_color,omitempty"` + Is3D bool `protobuf:"varint,13,opt,name=is3d,proto3" json:"is3d,omitempty"` +} + +func (x *FigureDescriptor_ChartDescriptor) Reset() { + *x = FigureDescriptor_ChartDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_ChartDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_ChartDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_ChartDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_ChartDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_ChartDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0} +} + +func (x *FigureDescriptor_ChartDescriptor) GetColspan() int32 { + if x != nil { + return x.Colspan + } + return 0 +} + +func (x *FigureDescriptor_ChartDescriptor) GetRowspan() int32 { + if x != nil { + return x.Rowspan + } + return 0 +} + +func (x *FigureDescriptor_ChartDescriptor) GetSeries() []*FigureDescriptor_SeriesDescriptor { + if x != nil { + return x.Series + } + return nil +} + +func (x *FigureDescriptor_ChartDescriptor) GetMultiSeries() []*FigureDescriptor_MultiSeriesDescriptor { + if x != nil { + return x.MultiSeries + } + return nil +} + +func (x *FigureDescriptor_ChartDescriptor) GetAxes() []*FigureDescriptor_AxisDescriptor { + if x != nil { + return x.Axes + } + return nil +} + +func (x *FigureDescriptor_ChartDescriptor) GetChartType() FigureDescriptor_ChartDescriptor_ChartType { + if x != nil { + return x.ChartType + } + return FigureDescriptor_ChartDescriptor_XY +} + +func (x *FigureDescriptor_ChartDescriptor) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *FigureDescriptor_ChartDescriptor) GetTitleFont() string { + if x != nil { + return x.TitleFont + } + return "" +} + +func (x *FigureDescriptor_ChartDescriptor) GetTitleColor() string { + if x != nil { + return x.TitleColor + } + return "" +} + +func (x *FigureDescriptor_ChartDescriptor) GetShowLegend() bool { + if x != nil { + return x.ShowLegend + } + return false +} + +func (x *FigureDescriptor_ChartDescriptor) GetLegendFont() string { + if x != nil { + return x.LegendFont + } + return "" +} + +func (x *FigureDescriptor_ChartDescriptor) GetLegendColor() string { + if x != nil { + return x.LegendColor + } + return "" +} + +func (x *FigureDescriptor_ChartDescriptor) GetIs3D() bool { + if x != nil { + return x.Is3D + } + return false +} + +type FigureDescriptor_SeriesDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlotStyle FigureDescriptor_SeriesPlotStyle `protobuf:"varint,1,opt,name=plot_style,json=plotStyle,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_SeriesPlotStyle" json:"plot_style,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LinesVisible *bool `protobuf:"varint,3,opt,name=lines_visible,json=linesVisible,proto3,oneof" json:"lines_visible,omitempty"` + ShapesVisible *bool `protobuf:"varint,4,opt,name=shapes_visible,json=shapesVisible,proto3,oneof" json:"shapes_visible,omitempty"` + GradientVisible bool `protobuf:"varint,5,opt,name=gradient_visible,json=gradientVisible,proto3" json:"gradient_visible,omitempty"` + LineColor string `protobuf:"bytes,6,opt,name=line_color,json=lineColor,proto3" json:"line_color,omitempty"` + PointLabelFormat *string `protobuf:"bytes,8,opt,name=point_label_format,json=pointLabelFormat,proto3,oneof" json:"point_label_format,omitempty"` + XToolTipPattern *string `protobuf:"bytes,9,opt,name=x_tool_tip_pattern,json=xToolTipPattern,proto3,oneof" json:"x_tool_tip_pattern,omitempty"` + YToolTipPattern *string `protobuf:"bytes,10,opt,name=y_tool_tip_pattern,json=yToolTipPattern,proto3,oneof" json:"y_tool_tip_pattern,omitempty"` + ShapeLabel string `protobuf:"bytes,11,opt,name=shape_label,json=shapeLabel,proto3" json:"shape_label,omitempty"` + ShapeSize *float64 `protobuf:"fixed64,12,opt,name=shape_size,json=shapeSize,proto3,oneof" json:"shape_size,omitempty"` + ShapeColor string `protobuf:"bytes,13,opt,name=shape_color,json=shapeColor,proto3" json:"shape_color,omitempty"` + Shape string `protobuf:"bytes,14,opt,name=shape,proto3" json:"shape,omitempty"` + DataSources []*FigureDescriptor_SourceDescriptor `protobuf:"bytes,15,rep,name=data_sources,json=dataSources,proto3" json:"data_sources,omitempty"` +} + +func (x *FigureDescriptor_SeriesDescriptor) Reset() { + *x = FigureDescriptor_SeriesDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_SeriesDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_SeriesDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_SeriesDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_SeriesDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_SeriesDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 1} +} + +func (x *FigureDescriptor_SeriesDescriptor) GetPlotStyle() FigureDescriptor_SeriesPlotStyle { + if x != nil { + return x.PlotStyle + } + return FigureDescriptor_BAR +} + +func (x *FigureDescriptor_SeriesDescriptor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetLinesVisible() bool { + if x != nil && x.LinesVisible != nil { + return *x.LinesVisible + } + return false +} + +func (x *FigureDescriptor_SeriesDescriptor) GetShapesVisible() bool { + if x != nil && x.ShapesVisible != nil { + return *x.ShapesVisible + } + return false +} + +func (x *FigureDescriptor_SeriesDescriptor) GetGradientVisible() bool { + if x != nil { + return x.GradientVisible + } + return false +} + +func (x *FigureDescriptor_SeriesDescriptor) GetLineColor() string { + if x != nil { + return x.LineColor + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetPointLabelFormat() string { + if x != nil && x.PointLabelFormat != nil { + return *x.PointLabelFormat + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetXToolTipPattern() string { + if x != nil && x.XToolTipPattern != nil { + return *x.XToolTipPattern + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetYToolTipPattern() string { + if x != nil && x.YToolTipPattern != nil { + return *x.YToolTipPattern + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetShapeLabel() string { + if x != nil { + return x.ShapeLabel + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetShapeSize() float64 { + if x != nil && x.ShapeSize != nil { + return *x.ShapeSize + } + return 0 +} + +func (x *FigureDescriptor_SeriesDescriptor) GetShapeColor() string { + if x != nil { + return x.ShapeColor + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetShape() string { + if x != nil { + return x.Shape + } + return "" +} + +func (x *FigureDescriptor_SeriesDescriptor) GetDataSources() []*FigureDescriptor_SourceDescriptor { + if x != nil { + return x.DataSources + } + return nil +} + +type FigureDescriptor_MultiSeriesDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlotStyle FigureDescriptor_SeriesPlotStyle `protobuf:"varint,1,opt,name=plot_style,json=plotStyle,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_SeriesPlotStyle" json:"plot_style,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LineColor *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,3,opt,name=line_color,json=lineColor,proto3" json:"line_color,omitempty"` + PointColor *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,4,opt,name=point_color,json=pointColor,proto3" json:"point_color,omitempty"` + LinesVisible *FigureDescriptor_BoolMapWithDefault `protobuf:"bytes,5,opt,name=lines_visible,json=linesVisible,proto3" json:"lines_visible,omitempty"` + PointsVisible *FigureDescriptor_BoolMapWithDefault `protobuf:"bytes,6,opt,name=points_visible,json=pointsVisible,proto3" json:"points_visible,omitempty"` + GradientVisible *FigureDescriptor_BoolMapWithDefault `protobuf:"bytes,7,opt,name=gradient_visible,json=gradientVisible,proto3" json:"gradient_visible,omitempty"` + PointLabelFormat *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,8,opt,name=point_label_format,json=pointLabelFormat,proto3" json:"point_label_format,omitempty"` + XToolTipPattern *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,9,opt,name=x_tool_tip_pattern,json=xToolTipPattern,proto3" json:"x_tool_tip_pattern,omitempty"` + YToolTipPattern *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,10,opt,name=y_tool_tip_pattern,json=yToolTipPattern,proto3" json:"y_tool_tip_pattern,omitempty"` + PointLabel *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,11,opt,name=point_label,json=pointLabel,proto3" json:"point_label,omitempty"` + PointSize *FigureDescriptor_DoubleMapWithDefault `protobuf:"bytes,12,opt,name=point_size,json=pointSize,proto3" json:"point_size,omitempty"` + PointShape *FigureDescriptor_StringMapWithDefault `protobuf:"bytes,13,opt,name=point_shape,json=pointShape,proto3" json:"point_shape,omitempty"` + DataSources []*FigureDescriptor_MultiSeriesSourceDescriptor `protobuf:"bytes,14,rep,name=data_sources,json=dataSources,proto3" json:"data_sources,omitempty"` +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) Reset() { + *x = FigureDescriptor_MultiSeriesDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_MultiSeriesDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_MultiSeriesDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_MultiSeriesDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_MultiSeriesDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 2} +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPlotStyle() FigureDescriptor_SeriesPlotStyle { + if x != nil { + return x.PlotStyle + } + return FigureDescriptor_BAR +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetLineColor() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.LineColor + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointColor() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.PointColor + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetLinesVisible() *FigureDescriptor_BoolMapWithDefault { + if x != nil { + return x.LinesVisible + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointsVisible() *FigureDescriptor_BoolMapWithDefault { + if x != nil { + return x.PointsVisible + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetGradientVisible() *FigureDescriptor_BoolMapWithDefault { + if x != nil { + return x.GradientVisible + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointLabelFormat() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.PointLabelFormat + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetXToolTipPattern() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.XToolTipPattern + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetYToolTipPattern() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.YToolTipPattern + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointLabel() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.PointLabel + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointSize() *FigureDescriptor_DoubleMapWithDefault { + if x != nil { + return x.PointSize + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetPointShape() *FigureDescriptor_StringMapWithDefault { + if x != nil { + return x.PointShape + } + return nil +} + +func (x *FigureDescriptor_MultiSeriesDescriptor) GetDataSources() []*FigureDescriptor_MultiSeriesSourceDescriptor { + if x != nil { + return x.DataSources + } + return nil +} + +type FigureDescriptor_StringMapWithDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultString *string `protobuf:"bytes,1,opt,name=default_string,json=defaultString,proto3,oneof" json:"default_string,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *FigureDescriptor_StringMapWithDefault) Reset() { + *x = FigureDescriptor_StringMapWithDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_StringMapWithDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_StringMapWithDefault) ProtoMessage() {} + +func (x *FigureDescriptor_StringMapWithDefault) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_StringMapWithDefault.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_StringMapWithDefault) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 3} +} + +func (x *FigureDescriptor_StringMapWithDefault) GetDefaultString() string { + if x != nil && x.DefaultString != nil { + return *x.DefaultString + } + return "" +} + +func (x *FigureDescriptor_StringMapWithDefault) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *FigureDescriptor_StringMapWithDefault) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type FigureDescriptor_DoubleMapWithDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultDouble *float64 `protobuf:"fixed64,1,opt,name=default_double,json=defaultDouble,proto3,oneof" json:"default_double,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + Values []float64 `protobuf:"fixed64,3,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *FigureDescriptor_DoubleMapWithDefault) Reset() { + *x = FigureDescriptor_DoubleMapWithDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_DoubleMapWithDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_DoubleMapWithDefault) ProtoMessage() {} + +func (x *FigureDescriptor_DoubleMapWithDefault) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_DoubleMapWithDefault.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_DoubleMapWithDefault) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 4} +} + +func (x *FigureDescriptor_DoubleMapWithDefault) GetDefaultDouble() float64 { + if x != nil && x.DefaultDouble != nil { + return *x.DefaultDouble + } + return 0 +} + +func (x *FigureDescriptor_DoubleMapWithDefault) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *FigureDescriptor_DoubleMapWithDefault) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +type FigureDescriptor_BoolMapWithDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultBool *bool `protobuf:"varint,1,opt,name=default_bool,json=defaultBool,proto3,oneof" json:"default_bool,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + Values []bool `protobuf:"varint,3,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *FigureDescriptor_BoolMapWithDefault) Reset() { + *x = FigureDescriptor_BoolMapWithDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_BoolMapWithDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_BoolMapWithDefault) ProtoMessage() {} + +func (x *FigureDescriptor_BoolMapWithDefault) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_BoolMapWithDefault.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_BoolMapWithDefault) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 5} +} + +func (x *FigureDescriptor_BoolMapWithDefault) GetDefaultBool() bool { + if x != nil && x.DefaultBool != nil { + return *x.DefaultBool + } + return false +} + +func (x *FigureDescriptor_BoolMapWithDefault) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *FigureDescriptor_BoolMapWithDefault) GetValues() []bool { + if x != nil { + return x.Values + } + return nil +} + +type FigureDescriptor_AxisDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + FormatType FigureDescriptor_AxisDescriptor_AxisFormatType `protobuf:"varint,2,opt,name=format_type,json=formatType,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_AxisDescriptor_AxisFormatType" json:"format_type,omitempty"` + Type FigureDescriptor_AxisDescriptor_AxisType `protobuf:"varint,3,opt,name=type,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_AxisDescriptor_AxisType" json:"type,omitempty"` + Position FigureDescriptor_AxisDescriptor_AxisPosition `protobuf:"varint,4,opt,name=position,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_AxisDescriptor_AxisPosition" json:"position,omitempty"` + Log bool `protobuf:"varint,5,opt,name=log,proto3" json:"log,omitempty"` + Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` + LabelFont string `protobuf:"bytes,7,opt,name=label_font,json=labelFont,proto3" json:"label_font,omitempty"` + TicksFont string `protobuf:"bytes,8,opt,name=ticks_font,json=ticksFont,proto3" json:"ticks_font,omitempty"` + FormatPattern *string `protobuf:"bytes,9,opt,name=format_pattern,json=formatPattern,proto3,oneof" json:"format_pattern,omitempty"` + Color string `protobuf:"bytes,10,opt,name=color,proto3" json:"color,omitempty"` + MinRange float64 `protobuf:"fixed64,11,opt,name=min_range,json=minRange,proto3" json:"min_range,omitempty"` + MaxRange float64 `protobuf:"fixed64,12,opt,name=max_range,json=maxRange,proto3" json:"max_range,omitempty"` + MinorTicksVisible bool `protobuf:"varint,13,opt,name=minor_ticks_visible,json=minorTicksVisible,proto3" json:"minor_ticks_visible,omitempty"` + MajorTicksVisible bool `protobuf:"varint,14,opt,name=major_ticks_visible,json=majorTicksVisible,proto3" json:"major_ticks_visible,omitempty"` + MinorTickCount int32 `protobuf:"varint,15,opt,name=minor_tick_count,json=minorTickCount,proto3" json:"minor_tick_count,omitempty"` + GapBetweenMajorTicks *float64 `protobuf:"fixed64,16,opt,name=gap_between_major_ticks,json=gapBetweenMajorTicks,proto3,oneof" json:"gap_between_major_ticks,omitempty"` + MajorTickLocations []float64 `protobuf:"fixed64,17,rep,packed,name=major_tick_locations,json=majorTickLocations,proto3" json:"major_tick_locations,omitempty"` + TickLabelAngle float64 `protobuf:"fixed64,18,opt,name=tick_label_angle,json=tickLabelAngle,proto3" json:"tick_label_angle,omitempty"` + Invert bool `protobuf:"varint,19,opt,name=invert,proto3" json:"invert,omitempty"` + IsTimeAxis bool `protobuf:"varint,20,opt,name=is_time_axis,json=isTimeAxis,proto3" json:"is_time_axis,omitempty"` + BusinessCalendarDescriptor *FigureDescriptor_BusinessCalendarDescriptor `protobuf:"bytes,21,opt,name=business_calendar_descriptor,json=businessCalendarDescriptor,proto3" json:"business_calendar_descriptor,omitempty"` +} + +func (x *FigureDescriptor_AxisDescriptor) Reset() { + *x = FigureDescriptor_AxisDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_AxisDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_AxisDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_AxisDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_AxisDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_AxisDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6} +} + +func (x *FigureDescriptor_AxisDescriptor) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetFormatType() FigureDescriptor_AxisDescriptor_AxisFormatType { + if x != nil { + return x.FormatType + } + return FigureDescriptor_AxisDescriptor_CATEGORY +} + +func (x *FigureDescriptor_AxisDescriptor) GetType() FigureDescriptor_AxisDescriptor_AxisType { + if x != nil { + return x.Type + } + return FigureDescriptor_AxisDescriptor_X +} + +func (x *FigureDescriptor_AxisDescriptor) GetPosition() FigureDescriptor_AxisDescriptor_AxisPosition { + if x != nil { + return x.Position + } + return FigureDescriptor_AxisDescriptor_TOP +} + +func (x *FigureDescriptor_AxisDescriptor) GetLog() bool { + if x != nil { + return x.Log + } + return false +} + +func (x *FigureDescriptor_AxisDescriptor) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetLabelFont() string { + if x != nil { + return x.LabelFont + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetTicksFont() string { + if x != nil { + return x.TicksFont + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetFormatPattern() string { + if x != nil && x.FormatPattern != nil { + return *x.FormatPattern + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +func (x *FigureDescriptor_AxisDescriptor) GetMinRange() float64 { + if x != nil { + return x.MinRange + } + return 0 +} + +func (x *FigureDescriptor_AxisDescriptor) GetMaxRange() float64 { + if x != nil { + return x.MaxRange + } + return 0 +} + +func (x *FigureDescriptor_AxisDescriptor) GetMinorTicksVisible() bool { + if x != nil { + return x.MinorTicksVisible + } + return false +} + +func (x *FigureDescriptor_AxisDescriptor) GetMajorTicksVisible() bool { + if x != nil { + return x.MajorTicksVisible + } + return false +} + +func (x *FigureDescriptor_AxisDescriptor) GetMinorTickCount() int32 { + if x != nil { + return x.MinorTickCount + } + return 0 +} + +func (x *FigureDescriptor_AxisDescriptor) GetGapBetweenMajorTicks() float64 { + if x != nil && x.GapBetweenMajorTicks != nil { + return *x.GapBetweenMajorTicks + } + return 0 +} + +func (x *FigureDescriptor_AxisDescriptor) GetMajorTickLocations() []float64 { + if x != nil { + return x.MajorTickLocations + } + return nil +} + +func (x *FigureDescriptor_AxisDescriptor) GetTickLabelAngle() float64 { + if x != nil { + return x.TickLabelAngle + } + return 0 +} + +func (x *FigureDescriptor_AxisDescriptor) GetInvert() bool { + if x != nil { + return x.Invert + } + return false +} + +func (x *FigureDescriptor_AxisDescriptor) GetIsTimeAxis() bool { + if x != nil { + return x.IsTimeAxis + } + return false +} + +func (x *FigureDescriptor_AxisDescriptor) GetBusinessCalendarDescriptor() *FigureDescriptor_BusinessCalendarDescriptor { + if x != nil { + return x.BusinessCalendarDescriptor + } + return nil +} + +type FigureDescriptor_BusinessCalendarDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + TimeZone string `protobuf:"bytes,2,opt,name=time_zone,json=timeZone,proto3" json:"time_zone,omitempty"` + BusinessDays []FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek `protobuf:"varint,3,rep,packed,name=business_days,json=businessDays,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek" json:"business_days,omitempty"` + BusinessPeriods []*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod `protobuf:"bytes,4,rep,name=business_periods,json=businessPeriods,proto3" json:"business_periods,omitempty"` + Holidays []*FigureDescriptor_BusinessCalendarDescriptor_Holiday `protobuf:"bytes,5,rep,name=holidays,proto3" json:"holidays,omitempty"` +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) Reset() { + *x = FigureDescriptor_BusinessCalendarDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_BusinessCalendarDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_BusinessCalendarDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7} +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) GetTimeZone() string { + if x != nil { + return x.TimeZone + } + return "" +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) GetBusinessDays() []FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek { + if x != nil { + return x.BusinessDays + } + return nil +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) GetBusinessPeriods() []*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod { + if x != nil { + return x.BusinessPeriods + } + return nil +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor) GetHolidays() []*FigureDescriptor_BusinessCalendarDescriptor_Holiday { + if x != nil { + return x.Holidays + } + return nil +} + +type FigureDescriptor_MultiSeriesSourceDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AxisId string `protobuf:"bytes,1,opt,name=axis_id,json=axisId,proto3" json:"axis_id,omitempty"` + Type FigureDescriptor_SourceType `protobuf:"varint,2,opt,name=type,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_SourceType" json:"type,omitempty"` + PartitionedTableId int32 `protobuf:"varint,3,opt,name=partitioned_table_id,json=partitionedTableId,proto3" json:"partitioned_table_id,omitempty"` + ColumnName string `protobuf:"bytes,4,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) Reset() { + *x = FigureDescriptor_MultiSeriesSourceDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_MultiSeriesSourceDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_MultiSeriesSourceDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_MultiSeriesSourceDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 8} +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) GetAxisId() string { + if x != nil { + return x.AxisId + } + return "" +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) GetType() FigureDescriptor_SourceType { + if x != nil { + return x.Type + } + return FigureDescriptor_X +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) GetPartitionedTableId() int32 { + if x != nil { + return x.PartitionedTableId + } + return 0 +} + +func (x *FigureDescriptor_MultiSeriesSourceDescriptor) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +type FigureDescriptor_SourceDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AxisId string `protobuf:"bytes,1,opt,name=axis_id,json=axisId,proto3" json:"axis_id,omitempty"` + Type FigureDescriptor_SourceType `protobuf:"varint,2,opt,name=type,proto3,enum=io.deephaven.proto.backplane.script.grpc.FigureDescriptor_SourceType" json:"type,omitempty"` + TableId int32 `protobuf:"varint,3,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` + PartitionedTableId int32 `protobuf:"varint,4,opt,name=partitioned_table_id,json=partitionedTableId,proto3" json:"partitioned_table_id,omitempty"` + ColumnName string `protobuf:"bytes,5,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` + ColumnType string `protobuf:"bytes,6,opt,name=column_type,json=columnType,proto3" json:"column_type,omitempty"` + OneClick *FigureDescriptor_OneClickDescriptor `protobuf:"bytes,7,opt,name=one_click,json=oneClick,proto3" json:"one_click,omitempty"` +} + +func (x *FigureDescriptor_SourceDescriptor) Reset() { + *x = FigureDescriptor_SourceDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_SourceDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_SourceDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_SourceDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_SourceDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_SourceDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 9} +} + +func (x *FigureDescriptor_SourceDescriptor) GetAxisId() string { + if x != nil { + return x.AxisId + } + return "" +} + +func (x *FigureDescriptor_SourceDescriptor) GetType() FigureDescriptor_SourceType { + if x != nil { + return x.Type + } + return FigureDescriptor_X +} + +func (x *FigureDescriptor_SourceDescriptor) GetTableId() int32 { + if x != nil { + return x.TableId + } + return 0 +} + +func (x *FigureDescriptor_SourceDescriptor) GetPartitionedTableId() int32 { + if x != nil { + return x.PartitionedTableId + } + return 0 +} + +func (x *FigureDescriptor_SourceDescriptor) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +func (x *FigureDescriptor_SourceDescriptor) GetColumnType() string { + if x != nil { + return x.ColumnType + } + return "" +} + +func (x *FigureDescriptor_SourceDescriptor) GetOneClick() *FigureDescriptor_OneClickDescriptor { + if x != nil { + return x.OneClick + } + return nil +} + +type FigureDescriptor_OneClickDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Columns []string `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` + ColumnTypes []string `protobuf:"bytes,2,rep,name=column_types,json=columnTypes,proto3" json:"column_types,omitempty"` + RequireAllFiltersToDisplay bool `protobuf:"varint,3,opt,name=require_all_filters_to_display,json=requireAllFiltersToDisplay,proto3" json:"require_all_filters_to_display,omitempty"` +} + +func (x *FigureDescriptor_OneClickDescriptor) Reset() { + *x = FigureDescriptor_OneClickDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_OneClickDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_OneClickDescriptor) ProtoMessage() {} + +func (x *FigureDescriptor_OneClickDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_OneClickDescriptor.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_OneClickDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 10} +} + +func (x *FigureDescriptor_OneClickDescriptor) GetColumns() []string { + if x != nil { + return x.Columns + } + return nil +} + +func (x *FigureDescriptor_OneClickDescriptor) GetColumnTypes() []string { + if x != nil { + return x.ColumnTypes + } + return nil +} + +func (x *FigureDescriptor_OneClickDescriptor) GetRequireAllFiltersToDisplay() bool { + if x != nil { + return x.RequireAllFiltersToDisplay + } + return false +} + +type FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open string `protobuf:"bytes,1,opt,name=open,proto3" json:"open,omitempty"` + Close string `protobuf:"bytes,2,opt,name=close,proto3" json:"close,omitempty"` +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) Reset() { + *x = FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) ProtoMessage() {} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 0} +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) GetOpen() string { + if x != nil { + return x.Open + } + return "" +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) GetClose() string { + if x != nil { + return x.Close + } + return "" +} + +type FigureDescriptor_BusinessCalendarDescriptor_Holiday struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Date *FigureDescriptor_BusinessCalendarDescriptor_LocalDate `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"` + BusinessPeriods []*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod `protobuf:"bytes,2,rep,name=business_periods,json=businessPeriods,proto3" json:"business_periods,omitempty"` +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) Reset() { + *x = FigureDescriptor_BusinessCalendarDescriptor_Holiday{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_BusinessCalendarDescriptor_Holiday) ProtoMessage() {} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_Holiday.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_BusinessCalendarDescriptor_Holiday) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 1} +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) GetDate() *FigureDescriptor_BusinessCalendarDescriptor_LocalDate { + if x != nil { + return x.Date + } + return nil +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) GetBusinessPeriods() []*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod { + if x != nil { + return x.BusinessPeriods + } + return nil +} + +type FigureDescriptor_BusinessCalendarDescriptor_LocalDate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"` + Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"` + Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"` +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) Reset() { + *x = FigureDescriptor_BusinessCalendarDescriptor_LocalDate{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate) ProtoMessage() {} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_LocalDate.ProtoReflect.Descriptor instead. +func (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 2} +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) GetYear() int32 { + if x != nil { + return x.Year + } + return 0 +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) GetMonth() int32 { + if x != nil { + return x.Month + } + return 0 +} + +func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) GetDay() int32 { + if x != nil { + return x.Day + } + return 0 +} + +var File_deephaven_proto_console_proto protoreflect.FileDescriptor + +var file_deephaven_proto_console_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x28, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x5e, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x6b, 0x0a, 0x16, 0x4c, 0x6f, 0x67, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x39, 0x0a, 0x17, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x6c, + 0x6f, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, + 0x4c, 0x6f, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x73, 0x22, 0x6e, 0x0a, 0x13, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x06, 0x6d, + 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x06, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x22, 0x7b, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, + 0x03, 0x22, 0x8e, 0x01, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x4f, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x22, 0xd7, 0x01, 0x0a, 0x1a, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x76, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x44, 0x0a, 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x1d, 0x0a, 0x1b, + 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x14, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x48, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xd4, 0x03, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x64, 0x0a, 0x0d, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x70, 0x65, 0x6e, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x6a, 0x0a, 0x0f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x14, 0x67, + 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x12, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, + 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x14, 0x41, 0x75, 0x74, + 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x71, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x15, 0x0a, 0x13, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x13, 0x4f, 0x70, 0x65, 0x6e, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x5f, 0x0a, 0x0d, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x74, 0x65, + 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x65, + 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, + 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, + 0xd0, 0x01, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, + 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x22, 0x84, 0x04, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, + 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x5e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x1a, 0xa6, 0x01, 0x0a, 0x1e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x44, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x4d, 0x0a, 0x1f, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, + 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x9b, 0x03, 0x0a, 0x19, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x55, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, + 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x2b, + 0x0a, 0x11, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, + 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0xa5, 0x01, 0x0a, 0x1a, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x22, 0xb6, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x72, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x09, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, + 0x74, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, + 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x6f, 0x72, 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x54, 0x65, 0x78, + 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x66, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x13, 0x61, 0x64, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x73, 0x12, + 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, + 0x74, 0x65, 0x72, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x08, + 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x83, 0x3a, 0x0a, 0x10, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x0f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x77, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, + 0x12, 0x62, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x72, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0d, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0xae, 0x06, 0x0a, + 0x0f, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, + 0x77, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x6f, 0x77, + 0x73, 0x70, 0x61, 0x6e, 0x12, 0x63, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x6d, 0x75, 0x6c, + 0x74, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x50, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x52, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x5d, + 0x0a, 0x04, 0x61, 0x78, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x61, 0x78, 0x65, 0x73, 0x12, 0x73, 0x0a, + 0x0a, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x54, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x4c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x46, 0x6f, 0x6e, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x33, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x69, 0x73, 0x33, 0x64, 0x22, 0x5b, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x72, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x58, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, + 0x49, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, 0x43, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, + 0x58, 0x59, 0x5a, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, + 0x59, 0x5f, 0x33, 0x44, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, 0x45, 0x4d, 0x41, + 0x50, 0x10, 0x06, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0xb3, 0x06, + 0x0a, 0x10, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x12, 0x69, 0x0a, 0x0a, 0x70, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, + 0x6c, 0x65, 0x52, 0x09, 0x70, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, + 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x73, + 0x68, 0x61, 0x70, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x56, 0x69, 0x73, + 0x69, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0f, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x12, 0x31, 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, + 0x10, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, + 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x03, 0x52, 0x0f, 0x78, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, + 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x12, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, + 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x04, 0x52, 0x0f, 0x79, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x70, + 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x68, 0x61, 0x70, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x68, 0x61, + 0x70, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x48, 0x05, 0x52, + 0x09, 0x73, 0x68, 0x61, 0x70, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x70, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, + 0x68, 0x61, 0x70, 0x65, 0x12, 0x6e, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, + 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, + 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x79, 0x5f, 0x74, 0x6f, + 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x4a, 0x04, 0x08, + 0x07, 0x10, 0x08, 0x1a, 0xa6, 0x0c, 0x0a, 0x15, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x69, 0x0a, + 0x0a, 0x70, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x70, + 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x0a, + 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x70, 0x0a, 0x0b, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x72, + 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x12, 0x74, 0x0a, 0x0e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x69, 0x73, + 0x69, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, + 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x78, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x52, 0x0f, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x12, 0x7d, 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, + 0x10, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x12, 0x7c, 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, + 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, + 0x78, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, + 0x7c, 0x0a, 0x12, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x79, 0x54, + 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x70, 0x0a, + 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, + 0x6e, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x70, 0x0a, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x70, + 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, + 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x81, 0x01, 0x0a, + 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x88, 0x01, + 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x11, 0x0a, + 0x0f, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x1a, 0x81, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, + 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x01, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x1a, 0x79, 0x0a, 0x12, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, + 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x88, + 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0f, + 0x0a, 0x0d, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x1a, + 0xb3, 0x0a, 0x0a, 0x0e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x79, 0x0a, 0x0b, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x58, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x66, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x52, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x72, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x6e, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x46, 0x6f, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, + 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, + 0x69, 0x63, 0x6b, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, + 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x54, + 0x69, 0x63, 0x6b, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, + 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x17, 0x67, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x74, + 0x77, 0x65, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x14, 0x67, 0x61, 0x70, 0x42, 0x65, 0x74, + 0x77, 0x65, 0x65, 0x6e, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x01, 0x52, + 0x12, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x5f, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x74, + 0x69, 0x63, 0x6b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x61, 0x78, 0x69, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x54, + 0x69, 0x6d, 0x65, 0x41, 0x78, 0x69, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x1c, 0x62, 0x75, 0x73, 0x69, + 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x55, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, + 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x1a, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, + 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x22, 0x2a, 0x0a, 0x0e, 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x22, 0x43, 0x0a, + 0x08, 0x41, 0x78, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, + 0x12, 0x05, 0x0a, 0x01, 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x41, 0x50, 0x45, + 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, + 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x4c, 0x4f, 0x52, + 0x10, 0x05, 0x22, 0x42, 0x0a, 0x0c, 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x42, + 0x4f, 0x54, 0x54, 0x4f, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, + 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47, 0x48, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, + 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x04, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x67, 0x61, + 0x70, 0x5f, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, + 0x74, 0x69, 0x63, 0x6b, 0x73, 0x1a, 0xe2, 0x07, 0x0a, 0x1a, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, + 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x5f, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x0c, + 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x44, 0x61, 0x79, 0x73, 0x12, 0x8f, 0x01, 0x0a, + 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x64, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, + 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, + 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, + 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x79, + 0x0a, 0x08, 0x68, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x5d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, + 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x52, + 0x08, 0x68, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x1a, 0x3a, 0x0a, 0x0e, 0x42, 0x75, 0x73, + 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, + 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x90, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x79, 0x12, 0x73, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x5f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, + 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x65, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, + 0x65, 0x73, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x64, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, + 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, + 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, + 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x1a, 0x47, 0x0a, 0x09, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x44, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, + 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x12, + 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, + 0x79, 0x22, 0x67, 0x0a, 0x09, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x0a, + 0x0a, 0x06, 0x53, 0x55, 0x4e, 0x44, 0x41, 0x59, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, + 0x4e, 0x44, 0x41, 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x55, 0x45, 0x53, 0x44, 0x41, + 0x59, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x45, 0x44, 0x4e, 0x45, 0x53, 0x44, 0x41, 0x59, + 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x48, 0x55, 0x52, 0x53, 0x44, 0x41, 0x59, 0x10, 0x04, + 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x49, 0x44, 0x41, 0x59, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, + 0x53, 0x41, 0x54, 0x55, 0x52, 0x44, 0x41, 0x59, 0x10, 0x06, 0x1a, 0xe4, 0x01, 0x0a, 0x1b, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, + 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, + 0x73, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, + 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x1a, 0x81, 0x03, 0x0a, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, 0x69, 0x73, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, 0x73, 0x49, 0x64, 0x12, + 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x12, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x6a, 0x0a, 0x09, 0x6f, 0x6e, 0x65, + 0x5f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x63, + 0x6b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x6f, 0x6e, 0x65, + 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x1a, 0x95, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, + 0x63, 0x6b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1e, 0x72, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, + 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0xa6, 0x01, + 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, + 0x65, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, + 0x41, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, + 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x52, 0x45, 0x41, 0x10, 0x03, 0x12, + 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x41, 0x52, 0x45, 0x41, 0x10, + 0x04, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x49, 0x45, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, + 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, + 0x43, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x43, 0x41, 0x54, 0x54, 0x45, 0x52, 0x10, 0x08, + 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x45, 0x50, 0x10, 0x09, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, + 0x45, 0x4d, 0x41, 0x50, 0x10, 0x0b, 0x22, 0xd2, 0x01, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, + 0x59, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x58, 0x5f, + 0x4c, 0x4f, 0x57, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x58, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, + 0x04, 0x12, 0x09, 0x0a, 0x05, 0x59, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, + 0x59, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, + 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x08, 0x12, 0x08, 0x0a, 0x04, + 0x48, 0x49, 0x47, 0x48, 0x10, 0x09, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x0a, 0x12, + 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x0b, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, + 0x41, 0x50, 0x45, 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x0d, 0x12, + 0x09, 0x0a, 0x05, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x10, 0x0e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, + 0x4c, 0x4f, 0x52, 0x10, 0x0f, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x10, + 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, + 0x11, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x12, 0x42, 0x08, 0x0a, 0x06, 0x5f, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x4a, 0x04, 0x08, 0x0c, 0x10, + 0x0d, 0x32, 0xff, 0x0a, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x8f, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x96, 0x01, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x54, + 0x6f, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3f, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa4, 0x01, 0x0a, 0x13, 0x42, 0x69, 0x6e, 0x64, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x44, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x99, + 0x01, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x4f, + 0x70, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x98, 0x01, 0x0a, 0x16, 0x4e, 0x65, 0x78, + 0x74, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, + 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, + 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, + 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_console_proto_rawDescOnce sync.Once + file_deephaven_proto_console_proto_rawDescData = file_deephaven_proto_console_proto_rawDesc +) + +func file_deephaven_proto_console_proto_rawDescGZIP() []byte { + file_deephaven_proto_console_proto_rawDescOnce.Do(func() { + file_deephaven_proto_console_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_console_proto_rawDescData) + }) + return file_deephaven_proto_console_proto_rawDescData +} + +var file_deephaven_proto_console_proto_enumTypes = make([]protoimpl.EnumInfo, 7) +var file_deephaven_proto_console_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_deephaven_proto_console_proto_goTypes = []interface{}{ + (FigureDescriptor_SeriesPlotStyle)(0), // 0: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle + (FigureDescriptor_SourceType)(0), // 1: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType + (FigureDescriptor_ChartDescriptor_ChartType)(0), // 2: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType + (FigureDescriptor_AxisDescriptor_AxisFormatType)(0), // 3: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType + (FigureDescriptor_AxisDescriptor_AxisType)(0), // 4: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType + (FigureDescriptor_AxisDescriptor_AxisPosition)(0), // 5: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition + (FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek)(0), // 6: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek + (*GetConsoleTypesRequest)(nil), // 7: io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest + (*GetConsoleTypesResponse)(nil), // 8: io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse + (*StartConsoleRequest)(nil), // 9: io.deephaven.proto.backplane.script.grpc.StartConsoleRequest + (*StartConsoleResponse)(nil), // 10: io.deephaven.proto.backplane.script.grpc.StartConsoleResponse + (*LogSubscriptionRequest)(nil), // 11: io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest + (*LogSubscriptionData)(nil), // 12: io.deephaven.proto.backplane.script.grpc.LogSubscriptionData + (*ExecuteCommandRequest)(nil), // 13: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest + (*ExecuteCommandResponse)(nil), // 14: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse + (*BindTableToVariableRequest)(nil), // 15: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest + (*BindTableToVariableResponse)(nil), // 16: io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse + (*CancelCommandRequest)(nil), // 17: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest + (*CancelCommandResponse)(nil), // 18: io.deephaven.proto.backplane.script.grpc.CancelCommandResponse + (*AutoCompleteRequest)(nil), // 19: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + (*AutoCompleteResponse)(nil), // 20: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + (*BrowserNextResponse)(nil), // 21: io.deephaven.proto.backplane.script.grpc.BrowserNextResponse + (*OpenDocumentRequest)(nil), // 22: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest + (*TextDocumentItem)(nil), // 23: io.deephaven.proto.backplane.script.grpc.TextDocumentItem + (*CloseDocumentRequest)(nil), // 24: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest + (*ChangeDocumentRequest)(nil), // 25: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest + (*DocumentRange)(nil), // 26: io.deephaven.proto.backplane.script.grpc.DocumentRange + (*VersionedTextDocumentIdentifier)(nil), // 27: io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + (*Position)(nil), // 28: io.deephaven.proto.backplane.script.grpc.Position + (*GetCompletionItemsRequest)(nil), // 29: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest + (*CompletionContext)(nil), // 30: io.deephaven.proto.backplane.script.grpc.CompletionContext + (*GetCompletionItemsResponse)(nil), // 31: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse + (*CompletionItem)(nil), // 32: io.deephaven.proto.backplane.script.grpc.CompletionItem + (*TextEdit)(nil), // 33: io.deephaven.proto.backplane.script.grpc.TextEdit + (*FigureDescriptor)(nil), // 34: io.deephaven.proto.backplane.script.grpc.FigureDescriptor + (*ChangeDocumentRequest_TextDocumentContentChangeEvent)(nil), // 35: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent + (*FigureDescriptor_ChartDescriptor)(nil), // 36: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor + (*FigureDescriptor_SeriesDescriptor)(nil), // 37: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor + (*FigureDescriptor_MultiSeriesDescriptor)(nil), // 38: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor + (*FigureDescriptor_StringMapWithDefault)(nil), // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + (*FigureDescriptor_DoubleMapWithDefault)(nil), // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault + (*FigureDescriptor_BoolMapWithDefault)(nil), // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + (*FigureDescriptor_AxisDescriptor)(nil), // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor + (*FigureDescriptor_BusinessCalendarDescriptor)(nil), // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor + (*FigureDescriptor_MultiSeriesSourceDescriptor)(nil), // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor + (*FigureDescriptor_SourceDescriptor)(nil), // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor + (*FigureDescriptor_OneClickDescriptor)(nil), // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor + (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod)(nil), // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + (*FigureDescriptor_BusinessCalendarDescriptor_Holiday)(nil), // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday + (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate)(nil), // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate + (*ticket.Ticket)(nil), // 50: io.deephaven.proto.backplane.grpc.Ticket + (*application.FieldsChangeUpdate)(nil), // 51: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate +} +var file_deephaven_proto_console_proto_depIdxs = []int32{ + 50, // 0: io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 50, // 1: io.deephaven.proto.backplane.script.grpc.StartConsoleResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 50, // 2: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 51, // 3: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.changes:type_name -> io.deephaven.proto.backplane.grpc.FieldsChangeUpdate + 50, // 4: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 50, // 5: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.table_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 50, // 6: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 50, // 7: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.command_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 22, // 8: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.open_document:type_name -> io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest + 25, // 9: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.change_document:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest + 29, // 10: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.get_completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest + 24, // 11: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.close_document:type_name -> io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest + 31, // 12: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse + 50, // 13: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 23, // 14: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.TextDocumentItem + 50, // 15: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 27, // 16: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 50, // 17: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 27, // 18: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 35, // 19: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.content_changes:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent + 28, // 20: io.deephaven.proto.backplane.script.grpc.DocumentRange.start:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 28, // 21: io.deephaven.proto.backplane.script.grpc.DocumentRange.end:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 50, // 22: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 30, // 23: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.context:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionContext + 27, // 24: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 28, // 25: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.position:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 32, // 26: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.items:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionItem + 33, // 27: io.deephaven.proto.backplane.script.grpc.CompletionItem.text_edit:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit + 33, // 28: io.deephaven.proto.backplane.script.grpc.CompletionItem.additional_text_edits:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit + 26, // 29: io.deephaven.proto.backplane.script.grpc.TextEdit.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange + 36, // 30: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.charts:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor + 26, // 31: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange + 37, // 32: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor + 38, // 33: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.multi_series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor + 42, // 34: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.axes:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor + 2, // 35: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.chart_type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType + 0, // 36: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.plot_style:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle + 45, // 37: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor + 0, // 38: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.plot_style:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle + 39, // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.line_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 39, // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 41, // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.lines_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 41, // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.points_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 41, // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.gradient_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 39, // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label_format:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 39, // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.x_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 39, // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.y_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 39, // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 40, // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_size:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault + 39, // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_shape:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 44, // 50: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor + 3, // 51: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType + 4, // 52: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType + 5, // 53: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.position:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition + 43, // 54: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.business_calendar_descriptor:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor + 6, // 55: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_days:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek + 47, // 56: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + 48, // 57: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.holidays:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday + 1, // 58: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType + 1, // 59: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType + 46, // 60: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.one_click:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor + 49, // 61: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.date:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate + 47, // 62: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + 7, // 63: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes:input_type -> io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest + 9, // 64: io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole:input_type -> io.deephaven.proto.backplane.script.grpc.StartConsoleRequest + 11, // 65: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:input_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest + 13, // 66: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:input_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest + 17, // 67: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:input_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandRequest + 15, // 68: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:input_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest + 19, // 69: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 19, // 70: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 19, // 71: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 8, // 72: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes:output_type -> io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse + 10, // 73: io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole:output_type -> io.deephaven.proto.backplane.script.grpc.StartConsoleResponse + 12, // 74: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:output_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionData + 14, // 75: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:output_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse + 18, // 76: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:output_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandResponse + 16, // 77: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:output_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse + 20, // 78: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + 20, // 79: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + 21, // 80: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.BrowserNextResponse + 72, // [72:81] is the sub-list for method output_type + 63, // [63:72] is the sub-list for method input_type + 63, // [63:63] is the sub-list for extension type_name + 63, // [63:63] is the sub-list for extension extendee + 0, // [0:63] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_console_proto_init() } +func file_deephaven_proto_console_proto_init() { + if File_deephaven_proto_console_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_console_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConsoleTypesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConsoleTypesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartConsoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartConsoleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogSubscriptionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogSubscriptionData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecuteCommandRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecuteCommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BindTableToVariableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BindTableToVariableResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelCommandRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelCommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoCompleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoCompleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BrowserNextResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextDocumentItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VersionedTextDocumentIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Position); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCompletionItemsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompletionContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCompletionItemsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompletionItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextEdit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeDocumentRequest_TextDocumentContentChangeEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_ChartDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_SeriesDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_MultiSeriesDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_StringMapWithDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_DoubleMapWithDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BoolMapWithDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_AxisDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_MultiSeriesSourceDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_SourceDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_OneClickDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_Holiday); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_LocalDate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_deephaven_proto_console_proto_msgTypes[12].OneofWrappers = []interface{}{ + (*AutoCompleteRequest_OpenDocument)(nil), + (*AutoCompleteRequest_ChangeDocument)(nil), + (*AutoCompleteRequest_GetCompletionItems)(nil), + (*AutoCompleteRequest_CloseDocument)(nil), + } + file_deephaven_proto_console_proto_msgTypes[13].OneofWrappers = []interface{}{ + (*AutoCompleteResponse_CompletionItems)(nil), + } + file_deephaven_proto_console_proto_msgTypes[27].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[29].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[30].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[32].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[33].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[34].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[35].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_console_proto_rawDesc, + NumEnums: 7, + NumMessages: 43, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_console_proto_goTypes, + DependencyIndexes: file_deephaven_proto_console_proto_depIdxs, + EnumInfos: file_deephaven_proto_console_proto_enumTypes, + MessageInfos: file_deephaven_proto_console_proto_msgTypes, + }.Build() + File_deephaven_proto_console_proto = out.File + file_deephaven_proto_console_proto_rawDesc = nil + file_deephaven_proto_console_proto_goTypes = nil + file_deephaven_proto_console_proto_depIdxs = nil +} diff --git a/go/internal/proto/console/console_grpc.pb.go b/go/internal/proto/console/console_grpc.pb.go new file mode 100644 index 00000000000..a301c32a60c --- /dev/null +++ b/go/internal/proto/console/console_grpc.pb.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/console.proto + +package console + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ConsoleServiceClient is the client API for ConsoleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ConsoleServiceClient interface { + GetConsoleTypes(ctx context.Context, in *GetConsoleTypesRequest, opts ...grpc.CallOption) (*GetConsoleTypesResponse, error) + StartConsole(ctx context.Context, in *StartConsoleRequest, opts ...grpc.CallOption) (*StartConsoleResponse, error) + SubscribeToLogs(ctx context.Context, in *LogSubscriptionRequest, opts ...grpc.CallOption) (ConsoleService_SubscribeToLogsClient, error) + ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) + CancelCommand(ctx context.Context, in *CancelCommandRequest, opts ...grpc.CallOption) (*CancelCommandResponse, error) + BindTableToVariable(ctx context.Context, in *BindTableToVariableRequest, opts ...grpc.CallOption) (*BindTableToVariableResponse, error) + // + // Starts a stream for autocomplete on the current session. More than one console, + // more than one document can be edited at a time using this, and they can separately + // be closed as well. A given document should only be edited within one stream at a + // time. + AutoCompleteStream(ctx context.Context, opts ...grpc.CallOption) (ConsoleService_AutoCompleteStreamClient, error) + // + // Half of the browser-based (browser's can't do bidirectional streams without websockets) + // implementation for AutoCompleteStream. + OpenAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (ConsoleService_OpenAutoCompleteStreamClient, error) + // + // Other half of the browser-based implementation for AutoCompleteStream. + NextAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (*BrowserNextResponse, error) +} + +type consoleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewConsoleServiceClient(cc grpc.ClientConnInterface) ConsoleServiceClient { + return &consoleServiceClient{cc} +} + +func (c *consoleServiceClient) GetConsoleTypes(ctx context.Context, in *GetConsoleTypesRequest, opts ...grpc.CallOption) (*GetConsoleTypesResponse, error) { + out := new(GetConsoleTypesResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetConsoleTypes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *consoleServiceClient) StartConsole(ctx context.Context, in *StartConsoleRequest, opts ...grpc.CallOption) (*StartConsoleResponse, error) { + out := new(StartConsoleResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/StartConsole", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *consoleServiceClient) SubscribeToLogs(ctx context.Context, in *LogSubscriptionRequest, opts ...grpc.CallOption) (ConsoleService_SubscribeToLogsClient, error) { + stream, err := c.cc.NewStream(ctx, &ConsoleService_ServiceDesc.Streams[0], "/io.deephaven.proto.backplane.script.grpc.ConsoleService/SubscribeToLogs", opts...) + if err != nil { + return nil, err + } + x := &consoleServiceSubscribeToLogsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ConsoleService_SubscribeToLogsClient interface { + Recv() (*LogSubscriptionData, error) + grpc.ClientStream +} + +type consoleServiceSubscribeToLogsClient struct { + grpc.ClientStream +} + +func (x *consoleServiceSubscribeToLogsClient) Recv() (*LogSubscriptionData, error) { + m := new(LogSubscriptionData) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *consoleServiceClient) ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) { + out := new(ExecuteCommandResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/ExecuteCommand", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *consoleServiceClient) CancelCommand(ctx context.Context, in *CancelCommandRequest, opts ...grpc.CallOption) (*CancelCommandResponse, error) { + out := new(CancelCommandResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/CancelCommand", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *consoleServiceClient) BindTableToVariable(ctx context.Context, in *BindTableToVariableRequest, opts ...grpc.CallOption) (*BindTableToVariableResponse, error) { + out := new(BindTableToVariableResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/BindTableToVariable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *consoleServiceClient) AutoCompleteStream(ctx context.Context, opts ...grpc.CallOption) (ConsoleService_AutoCompleteStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &ConsoleService_ServiceDesc.Streams[1], "/io.deephaven.proto.backplane.script.grpc.ConsoleService/AutoCompleteStream", opts...) + if err != nil { + return nil, err + } + x := &consoleServiceAutoCompleteStreamClient{stream} + return x, nil +} + +type ConsoleService_AutoCompleteStreamClient interface { + Send(*AutoCompleteRequest) error + Recv() (*AutoCompleteResponse, error) + grpc.ClientStream +} + +type consoleServiceAutoCompleteStreamClient struct { + grpc.ClientStream +} + +func (x *consoleServiceAutoCompleteStreamClient) Send(m *AutoCompleteRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *consoleServiceAutoCompleteStreamClient) Recv() (*AutoCompleteResponse, error) { + m := new(AutoCompleteResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *consoleServiceClient) OpenAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (ConsoleService_OpenAutoCompleteStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &ConsoleService_ServiceDesc.Streams[2], "/io.deephaven.proto.backplane.script.grpc.ConsoleService/OpenAutoCompleteStream", opts...) + if err != nil { + return nil, err + } + x := &consoleServiceOpenAutoCompleteStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ConsoleService_OpenAutoCompleteStreamClient interface { + Recv() (*AutoCompleteResponse, error) + grpc.ClientStream +} + +type consoleServiceOpenAutoCompleteStreamClient struct { + grpc.ClientStream +} + +func (x *consoleServiceOpenAutoCompleteStreamClient) Recv() (*AutoCompleteResponse, error) { + m := new(AutoCompleteResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *consoleServiceClient) NextAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (*BrowserNextResponse, error) { + out := new(BrowserNextResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/NextAutoCompleteStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConsoleServiceServer is the server API for ConsoleService service. +// All implementations must embed UnimplementedConsoleServiceServer +// for forward compatibility +type ConsoleServiceServer interface { + GetConsoleTypes(context.Context, *GetConsoleTypesRequest) (*GetConsoleTypesResponse, error) + StartConsole(context.Context, *StartConsoleRequest) (*StartConsoleResponse, error) + SubscribeToLogs(*LogSubscriptionRequest, ConsoleService_SubscribeToLogsServer) error + ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) + CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error) + BindTableToVariable(context.Context, *BindTableToVariableRequest) (*BindTableToVariableResponse, error) + // + // Starts a stream for autocomplete on the current session. More than one console, + // more than one document can be edited at a time using this, and they can separately + // be closed as well. A given document should only be edited within one stream at a + // time. + AutoCompleteStream(ConsoleService_AutoCompleteStreamServer) error + // + // Half of the browser-based (browser's can't do bidirectional streams without websockets) + // implementation for AutoCompleteStream. + OpenAutoCompleteStream(*AutoCompleteRequest, ConsoleService_OpenAutoCompleteStreamServer) error + // + // Other half of the browser-based implementation for AutoCompleteStream. + NextAutoCompleteStream(context.Context, *AutoCompleteRequest) (*BrowserNextResponse, error) + mustEmbedUnimplementedConsoleServiceServer() +} + +// UnimplementedConsoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedConsoleServiceServer struct { +} + +func (UnimplementedConsoleServiceServer) GetConsoleTypes(context.Context, *GetConsoleTypesRequest) (*GetConsoleTypesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConsoleTypes not implemented") +} +func (UnimplementedConsoleServiceServer) StartConsole(context.Context, *StartConsoleRequest) (*StartConsoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartConsole not implemented") +} +func (UnimplementedConsoleServiceServer) SubscribeToLogs(*LogSubscriptionRequest, ConsoleService_SubscribeToLogsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeToLogs not implemented") +} +func (UnimplementedConsoleServiceServer) ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteCommand not implemented") +} +func (UnimplementedConsoleServiceServer) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelCommand not implemented") +} +func (UnimplementedConsoleServiceServer) BindTableToVariable(context.Context, *BindTableToVariableRequest) (*BindTableToVariableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BindTableToVariable not implemented") +} +func (UnimplementedConsoleServiceServer) AutoCompleteStream(ConsoleService_AutoCompleteStreamServer) error { + return status.Errorf(codes.Unimplemented, "method AutoCompleteStream not implemented") +} +func (UnimplementedConsoleServiceServer) OpenAutoCompleteStream(*AutoCompleteRequest, ConsoleService_OpenAutoCompleteStreamServer) error { + return status.Errorf(codes.Unimplemented, "method OpenAutoCompleteStream not implemented") +} +func (UnimplementedConsoleServiceServer) NextAutoCompleteStream(context.Context, *AutoCompleteRequest) (*BrowserNextResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextAutoCompleteStream not implemented") +} +func (UnimplementedConsoleServiceServer) mustEmbedUnimplementedConsoleServiceServer() {} + +// UnsafeConsoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConsoleServiceServer will +// result in compilation errors. +type UnsafeConsoleServiceServer interface { + mustEmbedUnimplementedConsoleServiceServer() +} + +func RegisterConsoleServiceServer(s grpc.ServiceRegistrar, srv ConsoleServiceServer) { + s.RegisterService(&ConsoleService_ServiceDesc, srv) +} + +func _ConsoleService_GetConsoleTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConsoleTypesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).GetConsoleTypes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetConsoleTypes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).GetConsoleTypes(ctx, req.(*GetConsoleTypesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConsoleService_StartConsole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartConsoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).StartConsole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/StartConsole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).StartConsole(ctx, req.(*StartConsoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConsoleService_SubscribeToLogs_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(LogSubscriptionRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ConsoleServiceServer).SubscribeToLogs(m, &consoleServiceSubscribeToLogsServer{stream}) +} + +type ConsoleService_SubscribeToLogsServer interface { + Send(*LogSubscriptionData) error + grpc.ServerStream +} + +type consoleServiceSubscribeToLogsServer struct { + grpc.ServerStream +} + +func (x *consoleServiceSubscribeToLogsServer) Send(m *LogSubscriptionData) error { + return x.ServerStream.SendMsg(m) +} + +func _ConsoleService_ExecuteCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteCommandRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).ExecuteCommand(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/ExecuteCommand", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).ExecuteCommand(ctx, req.(*ExecuteCommandRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConsoleService_CancelCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelCommandRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).CancelCommand(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/CancelCommand", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).CancelCommand(ctx, req.(*CancelCommandRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConsoleService_BindTableToVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BindTableToVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).BindTableToVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/BindTableToVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).BindTableToVariable(ctx, req.(*BindTableToVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConsoleService_AutoCompleteStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ConsoleServiceServer).AutoCompleteStream(&consoleServiceAutoCompleteStreamServer{stream}) +} + +type ConsoleService_AutoCompleteStreamServer interface { + Send(*AutoCompleteResponse) error + Recv() (*AutoCompleteRequest, error) + grpc.ServerStream +} + +type consoleServiceAutoCompleteStreamServer struct { + grpc.ServerStream +} + +func (x *consoleServiceAutoCompleteStreamServer) Send(m *AutoCompleteResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *consoleServiceAutoCompleteStreamServer) Recv() (*AutoCompleteRequest, error) { + m := new(AutoCompleteRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _ConsoleService_OpenAutoCompleteStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AutoCompleteRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ConsoleServiceServer).OpenAutoCompleteStream(m, &consoleServiceOpenAutoCompleteStreamServer{stream}) +} + +type ConsoleService_OpenAutoCompleteStreamServer interface { + Send(*AutoCompleteResponse) error + grpc.ServerStream +} + +type consoleServiceOpenAutoCompleteStreamServer struct { + grpc.ServerStream +} + +func (x *consoleServiceOpenAutoCompleteStreamServer) Send(m *AutoCompleteResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ConsoleService_NextAutoCompleteStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AutoCompleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).NextAutoCompleteStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/NextAutoCompleteStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).NextAutoCompleteStream(ctx, req.(*AutoCompleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ConsoleService_ServiceDesc is the grpc.ServiceDesc for ConsoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ConsoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.script.grpc.ConsoleService", + HandlerType: (*ConsoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetConsoleTypes", + Handler: _ConsoleService_GetConsoleTypes_Handler, + }, + { + MethodName: "StartConsole", + Handler: _ConsoleService_StartConsole_Handler, + }, + { + MethodName: "ExecuteCommand", + Handler: _ConsoleService_ExecuteCommand_Handler, + }, + { + MethodName: "CancelCommand", + Handler: _ConsoleService_CancelCommand_Handler, + }, + { + MethodName: "BindTableToVariable", + Handler: _ConsoleService_BindTableToVariable_Handler, + }, + { + MethodName: "NextAutoCompleteStream", + Handler: _ConsoleService_NextAutoCompleteStream_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeToLogs", + Handler: _ConsoleService_SubscribeToLogs_Handler, + ServerStreams: true, + }, + { + StreamName: "AutoCompleteStream", + Handler: _ConsoleService_AutoCompleteStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "OpenAutoCompleteStream", + Handler: _ConsoleService_OpenAutoCompleteStream_Handler, + ServerStreams: true, + }, + }, + Metadata: "deephaven/proto/console.proto", +} diff --git a/go/internal/proto/inputtable/inputtable.pb.go b/go/internal/proto/inputtable/inputtable.pb.go new file mode 100644 index 00000000000..417f734b3de --- /dev/null +++ b/go/internal/proto/inputtable/inputtable.pb.go @@ -0,0 +1,382 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/inputtable.proto + +package inputtable + +import ( + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AddTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputTable *ticket.Ticket `protobuf:"bytes,1,opt,name=input_table,json=inputTable,proto3" json:"input_table,omitempty"` + TableToAdd *ticket.Ticket `protobuf:"bytes,2,opt,name=table_to_add,json=tableToAdd,proto3" json:"table_to_add,omitempty"` +} + +func (x *AddTableRequest) Reset() { + *x = AddTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddTableRequest) ProtoMessage() {} + +func (x *AddTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddTableRequest.ProtoReflect.Descriptor instead. +func (*AddTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_inputtable_proto_rawDescGZIP(), []int{0} +} + +func (x *AddTableRequest) GetInputTable() *ticket.Ticket { + if x != nil { + return x.InputTable + } + return nil +} + +func (x *AddTableRequest) GetTableToAdd() *ticket.Ticket { + if x != nil { + return x.TableToAdd + } + return nil +} + +type AddTableResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddTableResponse) Reset() { + *x = AddTableResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddTableResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddTableResponse) ProtoMessage() {} + +func (x *AddTableResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddTableResponse.ProtoReflect.Descriptor instead. +func (*AddTableResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_inputtable_proto_rawDescGZIP(), []int{1} +} + +type DeleteTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputTable *ticket.Ticket `protobuf:"bytes,1,opt,name=input_table,json=inputTable,proto3" json:"input_table,omitempty"` + TableToRemove *ticket.Ticket `protobuf:"bytes,2,opt,name=table_to_remove,json=tableToRemove,proto3" json:"table_to_remove,omitempty"` +} + +func (x *DeleteTableRequest) Reset() { + *x = DeleteTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTableRequest) ProtoMessage() {} + +func (x *DeleteTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTableRequest.ProtoReflect.Descriptor instead. +func (*DeleteTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_inputtable_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteTableRequest) GetInputTable() *ticket.Ticket { + if x != nil { + return x.InputTable + } + return nil +} + +func (x *DeleteTableRequest) GetTableToRemove() *ticket.Ticket { + if x != nil { + return x.TableToRemove + } + return nil +} + +type DeleteTableResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteTableResponse) Reset() { + *x = DeleteTableResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTableResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTableResponse) ProtoMessage() {} + +func (x *DeleteTableResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_inputtable_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTableResponse.ProtoReflect.Descriptor instead. +func (*DeleteTableResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_inputtable_proto_rawDescGZIP(), []int{3} +} + +var File_deephaven_proto_inputtable_proto protoreflect.FileDescriptor + +var file_deephaven_proto_inputtable_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x21, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x0b, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, + 0x61, 0x64, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x41, 0x64, 0x64, + 0x22, 0x12, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x0b, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0a, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0d, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xa6, 0x02, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8c, 0x01, 0x0a, 0x19, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x46, 0x48, 0x01, 0x50, 0x01, + 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_inputtable_proto_rawDescOnce sync.Once + file_deephaven_proto_inputtable_proto_rawDescData = file_deephaven_proto_inputtable_proto_rawDesc +) + +func file_deephaven_proto_inputtable_proto_rawDescGZIP() []byte { + file_deephaven_proto_inputtable_proto_rawDescOnce.Do(func() { + file_deephaven_proto_inputtable_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_inputtable_proto_rawDescData) + }) + return file_deephaven_proto_inputtable_proto_rawDescData +} + +var file_deephaven_proto_inputtable_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_deephaven_proto_inputtable_proto_goTypes = []interface{}{ + (*AddTableRequest)(nil), // 0: io.deephaven.proto.backplane.grpc.AddTableRequest + (*AddTableResponse)(nil), // 1: io.deephaven.proto.backplane.grpc.AddTableResponse + (*DeleteTableRequest)(nil), // 2: io.deephaven.proto.backplane.grpc.DeleteTableRequest + (*DeleteTableResponse)(nil), // 3: io.deephaven.proto.backplane.grpc.DeleteTableResponse + (*ticket.Ticket)(nil), // 4: io.deephaven.proto.backplane.grpc.Ticket +} +var file_deephaven_proto_inputtable_proto_depIdxs = []int32{ + 4, // 0: io.deephaven.proto.backplane.grpc.AddTableRequest.input_table:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 4, // 1: io.deephaven.proto.backplane.grpc.AddTableRequest.table_to_add:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 4, // 2: io.deephaven.proto.backplane.grpc.DeleteTableRequest.input_table:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 4, // 3: io.deephaven.proto.backplane.grpc.DeleteTableRequest.table_to_remove:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 0, // 4: io.deephaven.proto.backplane.grpc.InputTableService.AddTableToInputTable:input_type -> io.deephaven.proto.backplane.grpc.AddTableRequest + 2, // 5: io.deephaven.proto.backplane.grpc.InputTableService.DeleteTableFromInputTable:input_type -> io.deephaven.proto.backplane.grpc.DeleteTableRequest + 1, // 6: io.deephaven.proto.backplane.grpc.InputTableService.AddTableToInputTable:output_type -> io.deephaven.proto.backplane.grpc.AddTableResponse + 3, // 7: io.deephaven.proto.backplane.grpc.InputTableService.DeleteTableFromInputTable:output_type -> io.deephaven.proto.backplane.grpc.DeleteTableResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_inputtable_proto_init() } +func file_deephaven_proto_inputtable_proto_init() { + if File_deephaven_proto_inputtable_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_inputtable_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_inputtable_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddTableResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_inputtable_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_inputtable_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTableResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_inputtable_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_inputtable_proto_goTypes, + DependencyIndexes: file_deephaven_proto_inputtable_proto_depIdxs, + MessageInfos: file_deephaven_proto_inputtable_proto_msgTypes, + }.Build() + File_deephaven_proto_inputtable_proto = out.File + file_deephaven_proto_inputtable_proto_rawDesc = nil + file_deephaven_proto_inputtable_proto_goTypes = nil + file_deephaven_proto_inputtable_proto_depIdxs = nil +} diff --git a/go/internal/proto/inputtable/inputtable_grpc.pb.go b/go/internal/proto/inputtable/inputtable_grpc.pb.go new file mode 100644 index 00000000000..a902ce38907 --- /dev/null +++ b/go/internal/proto/inputtable/inputtable_grpc.pb.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/inputtable.proto + +package inputtable + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// InputTableServiceClient is the client API for InputTableService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type InputTableServiceClient interface { + // + // Adds the provided table to the specified input table. The new data to add must only have + // columns (name, types, and order) which match the given input table's columns. + AddTableToInputTable(ctx context.Context, in *AddTableRequest, opts ...grpc.CallOption) (*AddTableResponse, error) + // + // Removes the provided table from the specified input tables. The tables indicating which rows + // to remove are expected to only have columns that match the key columns of the input table. + DeleteTableFromInputTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*DeleteTableResponse, error) +} + +type inputTableServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewInputTableServiceClient(cc grpc.ClientConnInterface) InputTableServiceClient { + return &inputTableServiceClient{cc} +} + +func (c *inputTableServiceClient) AddTableToInputTable(ctx context.Context, in *AddTableRequest, opts ...grpc.CallOption) (*AddTableResponse, error) { + out := new(AddTableResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.InputTableService/AddTableToInputTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inputTableServiceClient) DeleteTableFromInputTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*DeleteTableResponse, error) { + out := new(DeleteTableResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.InputTableService/DeleteTableFromInputTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InputTableServiceServer is the server API for InputTableService service. +// All implementations must embed UnimplementedInputTableServiceServer +// for forward compatibility +type InputTableServiceServer interface { + // + // Adds the provided table to the specified input table. The new data to add must only have + // columns (name, types, and order) which match the given input table's columns. + AddTableToInputTable(context.Context, *AddTableRequest) (*AddTableResponse, error) + // + // Removes the provided table from the specified input tables. The tables indicating which rows + // to remove are expected to only have columns that match the key columns of the input table. + DeleteTableFromInputTable(context.Context, *DeleteTableRequest) (*DeleteTableResponse, error) + mustEmbedUnimplementedInputTableServiceServer() +} + +// UnimplementedInputTableServiceServer must be embedded to have forward compatible implementations. +type UnimplementedInputTableServiceServer struct { +} + +func (UnimplementedInputTableServiceServer) AddTableToInputTable(context.Context, *AddTableRequest) (*AddTableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddTableToInputTable not implemented") +} +func (UnimplementedInputTableServiceServer) DeleteTableFromInputTable(context.Context, *DeleteTableRequest) (*DeleteTableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteTableFromInputTable not implemented") +} +func (UnimplementedInputTableServiceServer) mustEmbedUnimplementedInputTableServiceServer() {} + +// UnsafeInputTableServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InputTableServiceServer will +// result in compilation errors. +type UnsafeInputTableServiceServer interface { + mustEmbedUnimplementedInputTableServiceServer() +} + +func RegisterInputTableServiceServer(s grpc.ServiceRegistrar, srv InputTableServiceServer) { + s.RegisterService(&InputTableService_ServiceDesc, srv) +} + +func _InputTableService_AddTableToInputTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InputTableServiceServer).AddTableToInputTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.InputTableService/AddTableToInputTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InputTableServiceServer).AddTableToInputTable(ctx, req.(*AddTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InputTableService_DeleteTableFromInputTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InputTableServiceServer).DeleteTableFromInputTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.InputTableService/DeleteTableFromInputTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InputTableServiceServer).DeleteTableFromInputTable(ctx, req.(*DeleteTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// InputTableService_ServiceDesc is the grpc.ServiceDesc for InputTableService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var InputTableService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.InputTableService", + HandlerType: (*InputTableServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddTableToInputTable", + Handler: _InputTableService_AddTableToInputTable_Handler, + }, + { + MethodName: "DeleteTableFromInputTable", + Handler: _InputTableService_DeleteTableFromInputTable_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "deephaven/proto/inputtable.proto", +} diff --git a/go/internal/proto/object/object.pb.go b/go/internal/proto/object/object.pb.go new file mode 100644 index 00000000000..f4316089e54 --- /dev/null +++ b/go/internal/proto/object/object.pb.go @@ -0,0 +1,257 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/object.proto + +package object + +import ( + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FetchObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceId *ticket.TypedTicket `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` +} + +func (x *FetchObjectRequest) Reset() { + *x = FetchObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_object_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchObjectRequest) ProtoMessage() {} + +func (x *FetchObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_object_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchObjectRequest.ProtoReflect.Descriptor instead. +func (*FetchObjectRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_object_proto_rawDescGZIP(), []int{0} +} + +func (x *FetchObjectRequest) GetSourceId() *ticket.TypedTicket { + if x != nil { + return x.SourceId + } + return nil +} + +type FetchObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + TypedExportId []*ticket.TypedTicket `protobuf:"bytes,3,rep,name=typed_export_id,json=typedExportId,proto3" json:"typed_export_id,omitempty"` +} + +func (x *FetchObjectResponse) Reset() { + *x = FetchObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_object_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchObjectResponse) ProtoMessage() {} + +func (x *FetchObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_object_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchObjectResponse.ProtoReflect.Descriptor instead. +func (*FetchObjectResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_object_proto_rawDescGZIP(), []int{1} +} + +func (x *FetchObjectResponse) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *FetchObjectResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *FetchObjectResponse) GetTypedExportId() []*ticket.TypedTicket { + if x != nil { + return x.TypedExportId + } + return nil +} + +var File_deephaven_proto_object_proto protoreflect.FileDescriptor + +var file_deephaven_proto_object_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x61, 0x0a, 0x12, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x64, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x22, 0x95, 0x01, 0x0a, 0x13, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x56, 0x0a, 0x0f, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x64, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0d, 0x74, 0x79, 0x70, + 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x32, 0x8f, 0x01, 0x0a, 0x0d, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0b, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x35, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x42, 0x48, 0x01, + 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_object_proto_rawDescOnce sync.Once + file_deephaven_proto_object_proto_rawDescData = file_deephaven_proto_object_proto_rawDesc +) + +func file_deephaven_proto_object_proto_rawDescGZIP() []byte { + file_deephaven_proto_object_proto_rawDescOnce.Do(func() { + file_deephaven_proto_object_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_object_proto_rawDescData) + }) + return file_deephaven_proto_object_proto_rawDescData +} + +var file_deephaven_proto_object_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_deephaven_proto_object_proto_goTypes = []interface{}{ + (*FetchObjectRequest)(nil), // 0: io.deephaven.proto.backplane.grpc.FetchObjectRequest + (*FetchObjectResponse)(nil), // 1: io.deephaven.proto.backplane.grpc.FetchObjectResponse + (*ticket.TypedTicket)(nil), // 2: io.deephaven.proto.backplane.grpc.TypedTicket +} +var file_deephaven_proto_object_proto_depIdxs = []int32{ + 2, // 0: io.deephaven.proto.backplane.grpc.FetchObjectRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TypedTicket + 2, // 1: io.deephaven.proto.backplane.grpc.FetchObjectResponse.typed_export_id:type_name -> io.deephaven.proto.backplane.grpc.TypedTicket + 0, // 2: io.deephaven.proto.backplane.grpc.ObjectService.FetchObject:input_type -> io.deephaven.proto.backplane.grpc.FetchObjectRequest + 1, // 3: io.deephaven.proto.backplane.grpc.ObjectService.FetchObject:output_type -> io.deephaven.proto.backplane.grpc.FetchObjectResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_object_proto_init() } +func file_deephaven_proto_object_proto_init() { + if File_deephaven_proto_object_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_object_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchObjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_object_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_object_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_object_proto_goTypes, + DependencyIndexes: file_deephaven_proto_object_proto_depIdxs, + MessageInfos: file_deephaven_proto_object_proto_msgTypes, + }.Build() + File_deephaven_proto_object_proto = out.File + file_deephaven_proto_object_proto_rawDesc = nil + file_deephaven_proto_object_proto_goTypes = nil + file_deephaven_proto_object_proto_depIdxs = nil +} diff --git a/go/internal/proto/object/object_grpc.pb.go b/go/internal/proto/object/object_grpc.pb.go new file mode 100644 index 00000000000..8b315fe7415 --- /dev/null +++ b/go/internal/proto/object/object_grpc.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/object.proto + +package object + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ObjectServiceClient is the client API for ObjectService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ObjectServiceClient interface { + FetchObject(ctx context.Context, in *FetchObjectRequest, opts ...grpc.CallOption) (*FetchObjectResponse, error) +} + +type objectServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient { + return &objectServiceClient{cc} +} + +func (c *objectServiceClient) FetchObject(ctx context.Context, in *FetchObjectRequest, opts ...grpc.CallOption) (*FetchObjectResponse, error) { + out := new(FetchObjectResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.ObjectService/FetchObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ObjectServiceServer is the server API for ObjectService service. +// All implementations must embed UnimplementedObjectServiceServer +// for forward compatibility +type ObjectServiceServer interface { + FetchObject(context.Context, *FetchObjectRequest) (*FetchObjectResponse, error) + mustEmbedUnimplementedObjectServiceServer() +} + +// UnimplementedObjectServiceServer must be embedded to have forward compatible implementations. +type UnimplementedObjectServiceServer struct { +} + +func (UnimplementedObjectServiceServer) FetchObject(context.Context, *FetchObjectRequest) (*FetchObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchObject not implemented") +} +func (UnimplementedObjectServiceServer) mustEmbedUnimplementedObjectServiceServer() {} + +// UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ObjectServiceServer will +// result in compilation errors. +type UnsafeObjectServiceServer interface { + mustEmbedUnimplementedObjectServiceServer() +} + +func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) { + s.RegisterService(&ObjectService_ServiceDesc, srv) +} + +func _ObjectService_FetchObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).FetchObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.ObjectService/FetchObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).FetchObject(ctx, req.(*FetchObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ObjectService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.ObjectService", + HandlerType: (*ObjectServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FetchObject", + Handler: _ObjectService_FetchObject_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "deephaven/proto/object.proto", +} diff --git a/go/internal/proto/partitionedtable/partitionedtable.pb.go b/go/internal/proto/partitionedtable/partitionedtable.pb.go new file mode 100644 index 00000000000..8ac9b13e287 --- /dev/null +++ b/go/internal/proto/partitionedtable/partitionedtable.pb.go @@ -0,0 +1,586 @@ +// +// Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/partitionedtable.proto + +package partitionedtable + +import ( + table "github.com/deephaven/deephaven-core/go/internal/proto/table" + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PartitionByRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TableId *ticket.Ticket `protobuf:"bytes,1,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + KeyColumnNames []string `protobuf:"bytes,3,rep,name=key_column_names,json=keyColumnNames,proto3" json:"key_column_names,omitempty"` + DropKeys bool `protobuf:"varint,4,opt,name=drop_keys,json=dropKeys,proto3" json:"drop_keys,omitempty"` +} + +func (x *PartitionByRequest) Reset() { + *x = PartitionByRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartitionByRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartitionByRequest) ProtoMessage() {} + +func (x *PartitionByRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartitionByRequest.ProtoReflect.Descriptor instead. +func (*PartitionByRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_partitionedtable_proto_rawDescGZIP(), []int{0} +} + +func (x *PartitionByRequest) GetTableId() *ticket.Ticket { + if x != nil { + return x.TableId + } + return nil +} + +func (x *PartitionByRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *PartitionByRequest) GetKeyColumnNames() []string { + if x != nil { + return x.KeyColumnNames + } + return nil +} + +func (x *PartitionByRequest) GetDropKeys() bool { + if x != nil { + return x.DropKeys + } + return false +} + +type PartitionByResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PartitionByResponse) Reset() { + *x = PartitionByResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartitionByResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartitionByResponse) ProtoMessage() {} + +func (x *PartitionByResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartitionByResponse.ProtoReflect.Descriptor instead. +func (*PartitionByResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_partitionedtable_proto_rawDescGZIP(), []int{1} +} + +type MergeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ticket for the PartitionedTable object to merge. + PartitionedTable *ticket.Ticket `protobuf:"bytes,1,opt,name=partitioned_table,json=partitionedTable,proto3" json:"partitioned_table,omitempty"` + // The ticket to use to hold the results of the merge operation. + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *MergeRequest) Reset() { + *x = MergeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MergeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeRequest) ProtoMessage() {} + +func (x *MergeRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeRequest.ProtoReflect.Descriptor instead. +func (*MergeRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_partitionedtable_proto_rawDescGZIP(), []int{2} +} + +func (x *MergeRequest) GetPartitionedTable() *ticket.Ticket { + if x != nil { + return x.PartitionedTable + } + return nil +} + +func (x *MergeRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type GetTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ticket for the PartitionedTable object to query. + PartitionedTable *ticket.Ticket `protobuf:"bytes,1,opt,name=partitioned_table,json=partitionedTable,proto3" json:"partitioned_table,omitempty"` + // The ticket for the table containing the key to fetch from the partitioned table. + KeyTableTicket *ticket.Ticket `protobuf:"bytes,2,opt,name=key_table_ticket,json=keyTableTicket,proto3" json:"key_table_ticket,omitempty"` + // The ticket to use to hold the newly returned table. + ResultId *ticket.Ticket `protobuf:"bytes,4,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *GetTableRequest) Reset() { + *x = GetTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTableRequest) ProtoMessage() {} + +func (x *GetTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTableRequest.ProtoReflect.Descriptor instead. +func (*GetTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_partitionedtable_proto_rawDescGZIP(), []int{3} +} + +func (x *GetTableRequest) GetPartitionedTable() *ticket.Ticket { + if x != nil { + return x.PartitionedTable + } + return nil +} + +func (x *GetTableRequest) GetKeyTableTicket() *ticket.Ticket { + if x != nil { + return x.KeyTableTicket + } + return nil +} + +func (x *GetTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +// +// A message that describes a partitioned table, able to be sent as a plugin object to a client. +// This object will also come with a ticket to the underlying table that can be used to get the +// constituent tables by key. +type PartitionedTableDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The names of the key columns. The underlying table will contain these columns - a client can + // subscribe to these columns to see what keys are present. + KeyColumnNames []string `protobuf:"bytes,1,rep,name=key_column_names,json=keyColumnNames,proto3" json:"key_column_names,omitempty"` + // The name of the column in the underlying table that contains the table represented by that row. + ConstituentColumnName string `protobuf:"bytes,4,opt,name=constituent_column_name,json=constituentColumnName,proto3" json:"constituent_column_name,omitempty"` + // True if the keys will be unique, so any set of known keys can be queried using GetTable. + UniqueKeys bool `protobuf:"varint,2,opt,name=unique_keys,json=uniqueKeys,proto3" json:"unique_keys,omitempty"` + // Returns a flight Messsage wrapping a Schema that will describe every table contained in this + // PartitionedTable. + ConstituentDefinitionSchema []byte `protobuf:"bytes,3,opt,name=constituent_definition_schema,json=constituentDefinitionSchema,proto3" json:"constituent_definition_schema,omitempty"` + // True if the underlying table may tick with updates. See PartitionedTable.constituentChangesPermitted() + // for more details. + ConstituentChangesPermitted bool `protobuf:"varint,5,opt,name=constituent_changes_permitted,json=constituentChangesPermitted,proto3" json:"constituent_changes_permitted,omitempty"` +} + +func (x *PartitionedTableDescriptor) Reset() { + *x = PartitionedTableDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartitionedTableDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartitionedTableDescriptor) ProtoMessage() {} + +func (x *PartitionedTableDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_partitionedtable_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartitionedTableDescriptor.ProtoReflect.Descriptor instead. +func (*PartitionedTableDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_partitionedtable_proto_rawDescGZIP(), []int{4} +} + +func (x *PartitionedTableDescriptor) GetKeyColumnNames() []string { + if x != nil { + return x.KeyColumnNames + } + return nil +} + +func (x *PartitionedTableDescriptor) GetConstituentColumnName() string { + if x != nil { + return x.ConstituentColumnName + } + return "" +} + +func (x *PartitionedTableDescriptor) GetUniqueKeys() bool { + if x != nil { + return x.UniqueKeys + } + return false +} + +func (x *PartitionedTableDescriptor) GetConstituentDefinitionSchema() []byte { + if x != nil { + return x.ConstituentDefinitionSchema + } + return nil +} + +func (x *PartitionedTableDescriptor) GetConstituentChangesPermitted() bool { + if x != nil { + return x.ConstituentChangesPermitted + } + return false +} + +var File_deephaven_proto_partitionedtable_proto protoreflect.FileDescriptor + +var file_deephaven_proto_partitionedtable_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe9, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, + 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x6b, + 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x72, 0x6f, 0x70, 0x4b, 0x65, + 0x79, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x0c, 0x4d, 0x65, + 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x56, 0x0a, 0x11, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x86, 0x02, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x56, + 0x0a, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x53, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0e, 0x6b, 0x65, 0x79, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x49, 0x64, 0x22, 0xa7, 0x02, 0x0a, 0x1a, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x6b, 0x65, + 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x17, + 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x71, 0x75, + 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x42, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, + 0x75, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1b, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x42, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x69, 0x74, 0x75, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x1b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x32, 0x96, 0x03, + 0x0a, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0b, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x05, 0x4d, 0x65, 0x72, 0x67, 0x65, + 0x12, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_partitionedtable_proto_rawDescOnce sync.Once + file_deephaven_proto_partitionedtable_proto_rawDescData = file_deephaven_proto_partitionedtable_proto_rawDesc +) + +func file_deephaven_proto_partitionedtable_proto_rawDescGZIP() []byte { + file_deephaven_proto_partitionedtable_proto_rawDescOnce.Do(func() { + file_deephaven_proto_partitionedtable_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_partitionedtable_proto_rawDescData) + }) + return file_deephaven_proto_partitionedtable_proto_rawDescData +} + +var file_deephaven_proto_partitionedtable_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_deephaven_proto_partitionedtable_proto_goTypes = []interface{}{ + (*PartitionByRequest)(nil), // 0: io.deephaven.proto.backplane.grpc.PartitionByRequest + (*PartitionByResponse)(nil), // 1: io.deephaven.proto.backplane.grpc.PartitionByResponse + (*MergeRequest)(nil), // 2: io.deephaven.proto.backplane.grpc.MergeRequest + (*GetTableRequest)(nil), // 3: io.deephaven.proto.backplane.grpc.GetTableRequest + (*PartitionedTableDescriptor)(nil), // 4: io.deephaven.proto.backplane.grpc.PartitionedTableDescriptor + (*ticket.Ticket)(nil), // 5: io.deephaven.proto.backplane.grpc.Ticket + (*table.ExportedTableCreationResponse)(nil), // 6: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse +} +var file_deephaven_proto_partitionedtable_proto_depIdxs = []int32{ + 5, // 0: io.deephaven.proto.backplane.grpc.PartitionByRequest.table_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 1: io.deephaven.proto.backplane.grpc.PartitionByRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 2: io.deephaven.proto.backplane.grpc.MergeRequest.partitioned_table:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 3: io.deephaven.proto.backplane.grpc.MergeRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 4: io.deephaven.proto.backplane.grpc.GetTableRequest.partitioned_table:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 5: io.deephaven.proto.backplane.grpc.GetTableRequest.key_table_ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 5, // 6: io.deephaven.proto.backplane.grpc.GetTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 0, // 7: io.deephaven.proto.backplane.grpc.PartitionedTableService.PartitionBy:input_type -> io.deephaven.proto.backplane.grpc.PartitionByRequest + 2, // 8: io.deephaven.proto.backplane.grpc.PartitionedTableService.Merge:input_type -> io.deephaven.proto.backplane.grpc.MergeRequest + 3, // 9: io.deephaven.proto.backplane.grpc.PartitionedTableService.GetTable:input_type -> io.deephaven.proto.backplane.grpc.GetTableRequest + 1, // 10: io.deephaven.proto.backplane.grpc.PartitionedTableService.PartitionBy:output_type -> io.deephaven.proto.backplane.grpc.PartitionByResponse + 6, // 11: io.deephaven.proto.backplane.grpc.PartitionedTableService.Merge:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 6, // 12: io.deephaven.proto.backplane.grpc.PartitionedTableService.GetTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 10, // [10:13] is the sub-list for method output_type + 7, // [7:10] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_partitionedtable_proto_init() } +func file_deephaven_proto_partitionedtable_proto_init() { + if File_deephaven_proto_partitionedtable_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_partitionedtable_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionByRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_partitionedtable_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionByResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_partitionedtable_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MergeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_partitionedtable_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_partitionedtable_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionedTableDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_partitionedtable_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_partitionedtable_proto_goTypes, + DependencyIndexes: file_deephaven_proto_partitionedtable_proto_depIdxs, + MessageInfos: file_deephaven_proto_partitionedtable_proto_msgTypes, + }.Build() + File_deephaven_proto_partitionedtable_proto = out.File + file_deephaven_proto_partitionedtable_proto_rawDesc = nil + file_deephaven_proto_partitionedtable_proto_goTypes = nil + file_deephaven_proto_partitionedtable_proto_depIdxs = nil +} diff --git a/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go b/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go new file mode 100644 index 00000000000..1e79d61bc67 --- /dev/null +++ b/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/partitionedtable.proto + +package partitionedtable + +import ( + context "context" + table "github.com/deephaven/deephaven-core/go/internal/proto/table" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PartitionedTableServiceClient is the client API for PartitionedTableService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PartitionedTableServiceClient interface { + // + // Transforms a table into a partitioned table, consisting of many separate table, each individually + // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + PartitionBy(ctx context.Context, in *PartitionByRequest, opts ...grpc.CallOption) (*PartitionByResponse, error) + // + // Given a partitioned table, returns a table with the contents of all of the constituent tables. + Merge(ctx context.Context, in *MergeRequest, opts ...grpc.CallOption) (*table.ExportedTableCreationResponse, error) + // + // Given a partitioned table and a row described by another table's contents, returns a table + // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + // more than one is present, FAILED_PRECONDITION will be sent in response. + // + // If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + // sent in response. + // + // The simplest way to generally use this is to subscribe to the key columns of the underlying + // table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + // desired keys, and pass that ticket to this service. After that request is sent (note that it + // is not required to wait for it to complete), that new table ticket can be used to make this + // GetTable request. + GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*table.ExportedTableCreationResponse, error) +} + +type partitionedTableServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPartitionedTableServiceClient(cc grpc.ClientConnInterface) PartitionedTableServiceClient { + return &partitionedTableServiceClient{cc} +} + +func (c *partitionedTableServiceClient) PartitionBy(ctx context.Context, in *PartitionByRequest, opts ...grpc.CallOption) (*PartitionByResponse, error) { + out := new(PartitionByResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.PartitionedTableService/PartitionBy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *partitionedTableServiceClient) Merge(ctx context.Context, in *MergeRequest, opts ...grpc.CallOption) (*table.ExportedTableCreationResponse, error) { + out := new(table.ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.PartitionedTableService/Merge", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *partitionedTableServiceClient) GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*table.ExportedTableCreationResponse, error) { + out := new(table.ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.PartitionedTableService/GetTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PartitionedTableServiceServer is the server API for PartitionedTableService service. +// All implementations must embed UnimplementedPartitionedTableServiceServer +// for forward compatibility +type PartitionedTableServiceServer interface { + // + // Transforms a table into a partitioned table, consisting of many separate table, each individually + // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. + PartitionBy(context.Context, *PartitionByRequest) (*PartitionByResponse, error) + // + // Given a partitioned table, returns a table with the contents of all of the constituent tables. + Merge(context.Context, *MergeRequest) (*table.ExportedTableCreationResponse, error) + // + // Given a partitioned table and a row described by another table's contents, returns a table + // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If + // more than one is present, FAILED_PRECONDITION will be sent in response. + // + // If the provided key table has any number of rows other than one, INVALID_ARGUMENT will be + // sent in response. + // + // The simplest way to generally use this is to subscribe to the key columns of the underlying + // table of a given PartitionedTable, then use /FlightService/DoPut to create a table with the + // desired keys, and pass that ticket to this service. After that request is sent (note that it + // is not required to wait for it to complete), that new table ticket can be used to make this + // GetTable request. + GetTable(context.Context, *GetTableRequest) (*table.ExportedTableCreationResponse, error) + mustEmbedUnimplementedPartitionedTableServiceServer() +} + +// UnimplementedPartitionedTableServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPartitionedTableServiceServer struct { +} + +func (UnimplementedPartitionedTableServiceServer) PartitionBy(context.Context, *PartitionByRequest) (*PartitionByResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PartitionBy not implemented") +} +func (UnimplementedPartitionedTableServiceServer) Merge(context.Context, *MergeRequest) (*table.ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Merge not implemented") +} +func (UnimplementedPartitionedTableServiceServer) GetTable(context.Context, *GetTableRequest) (*table.ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTable not implemented") +} +func (UnimplementedPartitionedTableServiceServer) mustEmbedUnimplementedPartitionedTableServiceServer() { +} + +// UnsafePartitionedTableServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PartitionedTableServiceServer will +// result in compilation errors. +type UnsafePartitionedTableServiceServer interface { + mustEmbedUnimplementedPartitionedTableServiceServer() +} + +func RegisterPartitionedTableServiceServer(s grpc.ServiceRegistrar, srv PartitionedTableServiceServer) { + s.RegisterService(&PartitionedTableService_ServiceDesc, srv) +} + +func _PartitionedTableService_PartitionBy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PartitionByRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartitionedTableServiceServer).PartitionBy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.PartitionedTableService/PartitionBy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartitionedTableServiceServer).PartitionBy(ctx, req.(*PartitionByRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PartitionedTableService_Merge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MergeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartitionedTableServiceServer).Merge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.PartitionedTableService/Merge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartitionedTableServiceServer).Merge(ctx, req.(*MergeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PartitionedTableService_GetTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartitionedTableServiceServer).GetTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.PartitionedTableService/GetTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartitionedTableServiceServer).GetTable(ctx, req.(*GetTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PartitionedTableService_ServiceDesc is the grpc.ServiceDesc for PartitionedTableService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PartitionedTableService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.PartitionedTableService", + HandlerType: (*PartitionedTableServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PartitionBy", + Handler: _PartitionedTableService_PartitionBy_Handler, + }, + { + MethodName: "Merge", + Handler: _PartitionedTableService_Merge_Handler, + }, + { + MethodName: "GetTable", + Handler: _PartitionedTableService_GetTable_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "deephaven/proto/partitionedtable.proto", +} diff --git a/go/internal/proto/session/session.pb.go b/go/internal/proto/session/session.pb.go new file mode 100644 index 00000000000..74847a3b946 --- /dev/null +++ b/go/internal/proto/session/session.pb.go @@ -0,0 +1,1160 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/session.proto + +package session + +import ( + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ExportNotification_State int32 + +const ( + ExportNotification_UNKNOWN ExportNotification_State = 0 // This item is a dependency, but hasn't been registered yet. + ExportNotification_PENDING ExportNotification_State = 1 // This item has pending dependencies. + ExportNotification_PUBLISHING ExportNotification_State = 2 // This item is a client-supplied dependency with no guarantee on timing to EXPORT state. + ExportNotification_QUEUED ExportNotification_State = 3 // This item is eligible for resolution and has been submitted to the executor. + ExportNotification_RUNNING ExportNotification_State = 4 // This item is now executing. + ExportNotification_EXPORTED ExportNotification_State = 5 // This item was successfully exported and is currently being retained. + ExportNotification_RELEASED ExportNotification_State = 6 // This item was successfully released. + ExportNotification_CANCELLED ExportNotification_State = 7 // CANCELLED: The user cancelled the item before it exported. + ExportNotification_FAILED ExportNotification_State = 8 // This item had a specific error. + ExportNotification_DEPENDENCY_FAILED ExportNotification_State = 9 // One of this item's dependencies had an internal error before it exported. + ExportNotification_DEPENDENCY_NEVER_FOUND ExportNotification_State = 10 // One of this item's dependencies was already released or never submitted within the out-of-order window. + ExportNotification_DEPENDENCY_CANCELLED ExportNotification_State = 11 // Dependency was cancelled, causing a cascading cancel that applies to this export. + ExportNotification_DEPENDENCY_RELEASED ExportNotification_State = 12 // Dependency was already released, causing a cascading failure that applies to this export. +) + +// Enum value maps for ExportNotification_State. +var ( + ExportNotification_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PENDING", + 2: "PUBLISHING", + 3: "QUEUED", + 4: "RUNNING", + 5: "EXPORTED", + 6: "RELEASED", + 7: "CANCELLED", + 8: "FAILED", + 9: "DEPENDENCY_FAILED", + 10: "DEPENDENCY_NEVER_FOUND", + 11: "DEPENDENCY_CANCELLED", + 12: "DEPENDENCY_RELEASED", + } + ExportNotification_State_value = map[string]int32{ + "UNKNOWN": 0, + "PENDING": 1, + "PUBLISHING": 2, + "QUEUED": 3, + "RUNNING": 4, + "EXPORTED": 5, + "RELEASED": 6, + "CANCELLED": 7, + "FAILED": 8, + "DEPENDENCY_FAILED": 9, + "DEPENDENCY_NEVER_FOUND": 10, + "DEPENDENCY_CANCELLED": 11, + "DEPENDENCY_RELEASED": 12, + } +) + +func (x ExportNotification_State) Enum() *ExportNotification_State { + p := new(ExportNotification_State) + *p = x + return p +} + +func (x ExportNotification_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ExportNotification_State) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_session_proto_enumTypes[0].Descriptor() +} + +func (ExportNotification_State) Type() protoreflect.EnumType { + return &file_deephaven_proto_session_proto_enumTypes[0] +} + +func (x ExportNotification_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ExportNotification_State.Descriptor instead. +func (ExportNotification_State) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8, 0} +} + +// +// The request that a client provides to a server on handshake. +type HandshakeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + // A defined protocol version. + // + // Deephaven's OSS protocols are as follows: + // - protocol = 0: most recent HandshakeResponse payload + // - protocol = 1: payload is BasicAuth + AuthProtocol int32 `protobuf:"zigzag32,1,opt,name=auth_protocol,json=authProtocol,proto3" json:"auth_protocol,omitempty"` + // + // Arbitrary auth/handshake info. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *HandshakeRequest) Reset() { + *x = HandshakeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HandshakeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HandshakeRequest) ProtoMessage() {} + +func (x *HandshakeRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead. +func (*HandshakeRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{0} +} + +func (x *HandshakeRequest) GetAuthProtocol() int32 { + if x != nil { + return x.AuthProtocol + } + return 0 +} + +func (x *HandshakeRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// +// Servers respond with information needed to make subsequent requests tied to this session. +// The session token should be refreshed prior to the deadline, which is represented as milliseconds since the +// epoch. Clients are encouraged to use the expiration delay and cookie deadline to determine a good time to refresh. +type HandshakeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + // The metadata header to identify the session. This value is static and defined via configuration. + MetadataHeader []byte `protobuf:"bytes,1,opt,name=metadata_header,json=metadataHeader,proto3" json:"metadata_header,omitempty"` + // + // Arbitrary session_token to assign to the value to the provided metadata header. + SessionToken []byte `protobuf:"bytes,2,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` + // + // When this session_token will be considered invalid by the server. + TokenDeadlineTimeMillis int64 `protobuf:"zigzag64,3,opt,name=token_deadline_time_millis,json=tokenDeadlineTimeMillis,proto3" json:"token_deadline_time_millis,omitempty"` + // + // The length of time that this token was intended to live. Note that `refreshSessionToken` may return the + // existing token to reduce overhead and to prevent denial-of-service caused by refreshing too frequently. + TokenExpirationDelayMillis int64 `protobuf:"zigzag64,4,opt,name=token_expiration_delay_millis,json=tokenExpirationDelayMillis,proto3" json:"token_expiration_delay_millis,omitempty"` +} + +func (x *HandshakeResponse) Reset() { + *x = HandshakeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HandshakeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HandshakeResponse) ProtoMessage() {} + +func (x *HandshakeResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead. +func (*HandshakeResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{1} +} + +func (x *HandshakeResponse) GetMetadataHeader() []byte { + if x != nil { + return x.MetadataHeader + } + return nil +} + +func (x *HandshakeResponse) GetSessionToken() []byte { + if x != nil { + return x.SessionToken + } + return nil +} + +func (x *HandshakeResponse) GetTokenDeadlineTimeMillis() int64 { + if x != nil { + return x.TokenDeadlineTimeMillis + } + return 0 +} + +func (x *HandshakeResponse) GetTokenExpirationDelayMillis() int64 { + if x != nil { + return x.TokenExpirationDelayMillis + } + return 0 +} + +type CloseSessionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CloseSessionResponse) Reset() { + *x = CloseSessionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseSessionResponse) ProtoMessage() {} + +func (x *CloseSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloseSessionResponse.ProtoReflect.Descriptor instead. +func (*CloseSessionResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{2} +} + +type ReleaseRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *ticket.Ticket `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ReleaseRequest) Reset() { + *x = ReleaseRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReleaseRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReleaseRequest) ProtoMessage() {} + +func (x *ReleaseRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReleaseRequest.ProtoReflect.Descriptor instead. +func (*ReleaseRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{3} +} + +func (x *ReleaseRequest) GetId() *ticket.Ticket { + if x != nil { + return x.Id + } + return nil +} + +type ReleaseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReleaseResponse) Reset() { + *x = ReleaseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReleaseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReleaseResponse) ProtoMessage() {} + +func (x *ReleaseResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReleaseResponse.ProtoReflect.Descriptor instead. +func (*ReleaseResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{4} +} + +type ExportRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceId *ticket.Ticket `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *ExportRequest) Reset() { + *x = ExportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportRequest) ProtoMessage() {} + +func (x *ExportRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportRequest.ProtoReflect.Descriptor instead. +func (*ExportRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{5} +} + +func (x *ExportRequest) GetSourceId() *ticket.Ticket { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *ExportRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type ExportResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExportResponse) Reset() { + *x = ExportResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportResponse) ProtoMessage() {} + +func (x *ExportResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportResponse.ProtoReflect.Descriptor instead. +func (*ExportResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{6} +} + +type ExportNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExportNotificationRequest) Reset() { + *x = ExportNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportNotificationRequest) ProtoMessage() {} + +func (x *ExportNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportNotificationRequest.ProtoReflect.Descriptor instead. +func (*ExportNotificationRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{7} +} + +type ExportNotification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ticket *ticket.Ticket `protobuf:"bytes,1,opt,name=ticket,proto3" json:"ticket,omitempty"` + ExportState ExportNotification_State `protobuf:"varint,2,opt,name=export_state,json=exportState,proto3,enum=io.deephaven.proto.backplane.grpc.ExportNotification_State" json:"export_state,omitempty"` + // + // any errors will include an id that can be used to find details of the error in the logs + Context string `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"` + // + // will be set to an identifier of the dependency that cascaded the error if applicable + DependentHandle string `protobuf:"bytes,4,opt,name=dependent_handle,json=dependentHandle,proto3" json:"dependent_handle,omitempty"` +} + +func (x *ExportNotification) Reset() { + *x = ExportNotification{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportNotification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportNotification) ProtoMessage() {} + +func (x *ExportNotification) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportNotification.ProtoReflect.Descriptor instead. +func (*ExportNotification) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8} +} + +func (x *ExportNotification) GetTicket() *ticket.Ticket { + if x != nil { + return x.Ticket + } + return nil +} + +func (x *ExportNotification) GetExportState() ExportNotification_State { + if x != nil { + return x.ExportState + } + return ExportNotification_UNKNOWN +} + +func (x *ExportNotification) GetContext() string { + if x != nil { + return x.Context + } + return "" +} + +func (x *ExportNotification) GetDependentHandle() string { + if x != nil { + return x.DependentHandle + } + return "" +} + +type TerminationNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TerminationNotificationRequest) Reset() { + *x = TerminationNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TerminationNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminationNotificationRequest) ProtoMessage() {} + +func (x *TerminationNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminationNotificationRequest.ProtoReflect.Descriptor instead. +func (*TerminationNotificationRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{9} +} + +type TerminationNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // whether or not this termination is expected + AbnormalTermination bool `protobuf:"varint,1,opt,name=abnormal_termination,json=abnormalTermination,proto3" json:"abnormal_termination,omitempty"` + // if additional information is available then provide it in this field + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + // if this is due to an exception, whether or not it was uncaught + IsFromUncaughtException bool `protobuf:"varint,3,opt,name=is_from_uncaught_exception,json=isFromUncaughtException,proto3" json:"is_from_uncaught_exception,omitempty"` + // if applicable, the list of stack traces in reverse causal order + StackTraces []*TerminationNotificationResponse_StackTrace `protobuf:"bytes,4,rep,name=stack_traces,json=stackTraces,proto3" json:"stack_traces,omitempty"` +} + +func (x *TerminationNotificationResponse) Reset() { + *x = TerminationNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TerminationNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminationNotificationResponse) ProtoMessage() {} + +func (x *TerminationNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminationNotificationResponse.ProtoReflect.Descriptor instead. +func (*TerminationNotificationResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{10} +} + +func (x *TerminationNotificationResponse) GetAbnormalTermination() bool { + if x != nil { + return x.AbnormalTermination + } + return false +} + +func (x *TerminationNotificationResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *TerminationNotificationResponse) GetIsFromUncaughtException() bool { + if x != nil { + return x.IsFromUncaughtException + } + return false +} + +func (x *TerminationNotificationResponse) GetStackTraces() []*TerminationNotificationResponse_StackTrace { + if x != nil { + return x.StackTraces + } + return nil +} + +type TerminationNotificationResponse_StackTrace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Elements []string `protobuf:"bytes,3,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *TerminationNotificationResponse_StackTrace) Reset() { + *x = TerminationNotificationResponse_StackTrace{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TerminationNotificationResponse_StackTrace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminationNotificationResponse_StackTrace) ProtoMessage() {} + +func (x *TerminationNotificationResponse_StackTrace) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminationNotificationResponse_StackTrace.ProtoReflect.Descriptor instead. +func (*TerminationNotificationResponse_StackTrace) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *TerminationNotificationResponse_StackTrace) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *TerminationNotificationResponse_StackTrace) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *TerminationNotificationResponse_StackTrace) GetElements() []string { + if x != nil { + return x.Elements + } + return nil +} + +var File_deephaven_proto_session_proto protoreflect.FileDescriptor + +var file_deephaven_proto_session_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x21, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x51, 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0c, 0x61, 0x75, 0x74, + 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x22, 0xe9, 0x01, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, + 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x17, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x45, 0x0a, 0x1d, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, + 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, + 0x02, 0x30, 0x01, 0x52, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, + 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe6, 0x03, 0x0a, 0x12, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x41, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x5e, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x29, 0x0a, 0x10, + 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x50, + 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x51, + 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, + 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, + 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, 0x06, + 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, + 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x44, + 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x09, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, + 0x5f, 0x4e, 0x45, 0x56, 0x45, 0x52, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0a, 0x12, 0x18, + 0x0a, 0x14, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x43, 0x41, 0x4e, + 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x45, 0x50, 0x45, + 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, + 0x0c, 0x22, 0x20, 0x0a, 0x1e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0xf3, 0x02, 0x0a, 0x1f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x62, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x62, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x54, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, + 0x63, 0x61, 0x75, 0x67, 0x68, 0x74, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x6e, + 0x63, 0x61, 0x75, 0x67, 0x68, 0x74, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x70, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x73, 0x1a, 0x56, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xb5, 0x07, 0x0a, 0x0e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0a, + 0x4e, 0x65, 0x77, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, + 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, + 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x0c, + 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x07, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x79, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x13, + 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, 0x12, 0xa2, 0x01, 0x0a, + 0x17, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_session_proto_rawDescOnce sync.Once + file_deephaven_proto_session_proto_rawDescData = file_deephaven_proto_session_proto_rawDesc +) + +func file_deephaven_proto_session_proto_rawDescGZIP() []byte { + file_deephaven_proto_session_proto_rawDescOnce.Do(func() { + file_deephaven_proto_session_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_session_proto_rawDescData) + }) + return file_deephaven_proto_session_proto_rawDescData +} + +var file_deephaven_proto_session_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_deephaven_proto_session_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_deephaven_proto_session_proto_goTypes = []interface{}{ + (ExportNotification_State)(0), // 0: io.deephaven.proto.backplane.grpc.ExportNotification.State + (*HandshakeRequest)(nil), // 1: io.deephaven.proto.backplane.grpc.HandshakeRequest + (*HandshakeResponse)(nil), // 2: io.deephaven.proto.backplane.grpc.HandshakeResponse + (*CloseSessionResponse)(nil), // 3: io.deephaven.proto.backplane.grpc.CloseSessionResponse + (*ReleaseRequest)(nil), // 4: io.deephaven.proto.backplane.grpc.ReleaseRequest + (*ReleaseResponse)(nil), // 5: io.deephaven.proto.backplane.grpc.ReleaseResponse + (*ExportRequest)(nil), // 6: io.deephaven.proto.backplane.grpc.ExportRequest + (*ExportResponse)(nil), // 7: io.deephaven.proto.backplane.grpc.ExportResponse + (*ExportNotificationRequest)(nil), // 8: io.deephaven.proto.backplane.grpc.ExportNotificationRequest + (*ExportNotification)(nil), // 9: io.deephaven.proto.backplane.grpc.ExportNotification + (*TerminationNotificationRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.TerminationNotificationRequest + (*TerminationNotificationResponse)(nil), // 11: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse + (*TerminationNotificationResponse_StackTrace)(nil), // 12: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace + (*ticket.Ticket)(nil), // 13: io.deephaven.proto.backplane.grpc.Ticket +} +var file_deephaven_proto_session_proto_depIdxs = []int32{ + 13, // 0: io.deephaven.proto.backplane.grpc.ReleaseRequest.id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 13, // 1: io.deephaven.proto.backplane.grpc.ExportRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 13, // 2: io.deephaven.proto.backplane.grpc.ExportRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 13, // 3: io.deephaven.proto.backplane.grpc.ExportNotification.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 0, // 4: io.deephaven.proto.backplane.grpc.ExportNotification.export_state:type_name -> io.deephaven.proto.backplane.grpc.ExportNotification.State + 12, // 5: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.stack_traces:type_name -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace + 1, // 6: io.deephaven.proto.backplane.grpc.SessionService.NewSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 1, // 7: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 1, // 8: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 4, // 9: io.deephaven.proto.backplane.grpc.SessionService.Release:input_type -> io.deephaven.proto.backplane.grpc.ReleaseRequest + 6, // 10: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:input_type -> io.deephaven.proto.backplane.grpc.ExportRequest + 8, // 11: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:input_type -> io.deephaven.proto.backplane.grpc.ExportNotificationRequest + 10, // 12: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:input_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationRequest + 2, // 13: io.deephaven.proto.backplane.grpc.SessionService.NewSession:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse + 2, // 14: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse + 3, // 15: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:output_type -> io.deephaven.proto.backplane.grpc.CloseSessionResponse + 5, // 16: io.deephaven.proto.backplane.grpc.SessionService.Release:output_type -> io.deephaven.proto.backplane.grpc.ReleaseResponse + 7, // 17: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:output_type -> io.deephaven.proto.backplane.grpc.ExportResponse + 9, // 18: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:output_type -> io.deephaven.proto.backplane.grpc.ExportNotification + 11, // 19: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:output_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse + 13, // [13:20] is the sub-list for method output_type + 6, // [6:13] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_session_proto_init() } +func file_deephaven_proto_session_proto_init() { + if File_deephaven_proto_session_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_session_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HandshakeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HandshakeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseSessionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReleaseRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReleaseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportNotification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminationNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminationNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminationNotificationResponse_StackTrace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_session_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_session_proto_goTypes, + DependencyIndexes: file_deephaven_proto_session_proto_depIdxs, + EnumInfos: file_deephaven_proto_session_proto_enumTypes, + MessageInfos: file_deephaven_proto_session_proto_msgTypes, + }.Build() + File_deephaven_proto_session_proto = out.File + file_deephaven_proto_session_proto_rawDesc = nil + file_deephaven_proto_session_proto_goTypes = nil + file_deephaven_proto_session_proto_depIdxs = nil +} diff --git a/go/internal/proto/session/session_grpc.pb.go b/go/internal/proto/session/session_grpc.pb.go new file mode 100644 index 00000000000..09351a70d93 --- /dev/null +++ b/go/internal/proto/session/session_grpc.pb.go @@ -0,0 +1,401 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/session.proto + +package session + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// SessionServiceClient is the client API for SessionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SessionServiceClient interface { + // + // Handshake between client and server to create a new session. The response includes a metadata header name and the + // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + NewSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) + // + // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated + // token that should replace the existing token for subsequent requests. + RefreshSessionToken(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) + // + // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all + // unreleased exports will be automatically released. + CloseSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*CloseSessionResponse, error) + // + // Attempts to release an export by its ticket. Returns true if an existing export was found. It is the client's + // responsibility to release all resources they no longer want the server to hold on to. Proactively cancels work; do + // not release a ticket that is needed by dependent work that has not yet finished + // (i.e. the dependencies that are staying around should first be in EXPORTED state). + Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error) + // + // Makes a copy from a source ticket to a client managed result ticket. The source ticket does not need to be + // a client managed ticket. + ExportFromTicket(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportResponse, error) + // + // Establish a stream to manage all session exports, including those lost due to partially complete rpc calls. + // + // New streams will flush notifications for all un-released exports, prior to seeing any new or updated exports + // for all live exports. After the refresh of existing state, subscribers will receive notifications of new and + // updated exports. An export id of zero will be sent to indicate all pre-existing exports have been sent. + ExportNotifications(ctx context.Context, in *ExportNotificationRequest, opts ...grpc.CallOption) (SessionService_ExportNotificationsClient, error) + // + // Receive a best-effort message on-exit indicating why this server is exiting. Reception of this message cannot be + // guaranteed. + TerminationNotification(ctx context.Context, in *TerminationNotificationRequest, opts ...grpc.CallOption) (*TerminationNotificationResponse, error) +} + +type sessionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { + return &sessionServiceClient{cc} +} + +func (c *sessionServiceClient) NewSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) { + out := new(HandshakeResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/NewSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sessionServiceClient) RefreshSessionToken(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) { + out := new(HandshakeResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/RefreshSessionToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sessionServiceClient) CloseSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*CloseSessionResponse, error) { + out := new(CloseSessionResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/CloseSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sessionServiceClient) Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error) { + out := new(ReleaseResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/Release", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sessionServiceClient) ExportFromTicket(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportResponse, error) { + out := new(ExportResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/ExportFromTicket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sessionServiceClient) ExportNotifications(ctx context.Context, in *ExportNotificationRequest, opts ...grpc.CallOption) (SessionService_ExportNotificationsClient, error) { + stream, err := c.cc.NewStream(ctx, &SessionService_ServiceDesc.Streams[0], "/io.deephaven.proto.backplane.grpc.SessionService/ExportNotifications", opts...) + if err != nil { + return nil, err + } + x := &sessionServiceExportNotificationsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type SessionService_ExportNotificationsClient interface { + Recv() (*ExportNotification, error) + grpc.ClientStream +} + +type sessionServiceExportNotificationsClient struct { + grpc.ClientStream +} + +func (x *sessionServiceExportNotificationsClient) Recv() (*ExportNotification, error) { + m := new(ExportNotification) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *sessionServiceClient) TerminationNotification(ctx context.Context, in *TerminationNotificationRequest, opts ...grpc.CallOption) (*TerminationNotificationResponse, error) { + out := new(TerminationNotificationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/TerminationNotification", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SessionServiceServer is the server API for SessionService service. +// All implementations must embed UnimplementedSessionServiceServer +// for forward compatibility +type SessionServiceServer interface { + // + // Handshake between client and server to create a new session. The response includes a metadata header name and the + // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + NewSession(context.Context, *HandshakeRequest) (*HandshakeResponse, error) + // + // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated + // token that should replace the existing token for subsequent requests. + RefreshSessionToken(context.Context, *HandshakeRequest) (*HandshakeResponse, error) + // + // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all + // unreleased exports will be automatically released. + CloseSession(context.Context, *HandshakeRequest) (*CloseSessionResponse, error) + // + // Attempts to release an export by its ticket. Returns true if an existing export was found. It is the client's + // responsibility to release all resources they no longer want the server to hold on to. Proactively cancels work; do + // not release a ticket that is needed by dependent work that has not yet finished + // (i.e. the dependencies that are staying around should first be in EXPORTED state). + Release(context.Context, *ReleaseRequest) (*ReleaseResponse, error) + // + // Makes a copy from a source ticket to a client managed result ticket. The source ticket does not need to be + // a client managed ticket. + ExportFromTicket(context.Context, *ExportRequest) (*ExportResponse, error) + // + // Establish a stream to manage all session exports, including those lost due to partially complete rpc calls. + // + // New streams will flush notifications for all un-released exports, prior to seeing any new or updated exports + // for all live exports. After the refresh of existing state, subscribers will receive notifications of new and + // updated exports. An export id of zero will be sent to indicate all pre-existing exports have been sent. + ExportNotifications(*ExportNotificationRequest, SessionService_ExportNotificationsServer) error + // + // Receive a best-effort message on-exit indicating why this server is exiting. Reception of this message cannot be + // guaranteed. + TerminationNotification(context.Context, *TerminationNotificationRequest) (*TerminationNotificationResponse, error) + mustEmbedUnimplementedSessionServiceServer() +} + +// UnimplementedSessionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedSessionServiceServer struct { +} + +func (UnimplementedSessionServiceServer) NewSession(context.Context, *HandshakeRequest) (*HandshakeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewSession not implemented") +} +func (UnimplementedSessionServiceServer) RefreshSessionToken(context.Context, *HandshakeRequest) (*HandshakeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshSessionToken not implemented") +} +func (UnimplementedSessionServiceServer) CloseSession(context.Context, *HandshakeRequest) (*CloseSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CloseSession not implemented") +} +func (UnimplementedSessionServiceServer) Release(context.Context, *ReleaseRequest) (*ReleaseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Release not implemented") +} +func (UnimplementedSessionServiceServer) ExportFromTicket(context.Context, *ExportRequest) (*ExportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExportFromTicket not implemented") +} +func (UnimplementedSessionServiceServer) ExportNotifications(*ExportNotificationRequest, SessionService_ExportNotificationsServer) error { + return status.Errorf(codes.Unimplemented, "method ExportNotifications not implemented") +} +func (UnimplementedSessionServiceServer) TerminationNotification(context.Context, *TerminationNotificationRequest) (*TerminationNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TerminationNotification not implemented") +} +func (UnimplementedSessionServiceServer) mustEmbedUnimplementedSessionServiceServer() {} + +// UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SessionServiceServer will +// result in compilation errors. +type UnsafeSessionServiceServer interface { + mustEmbedUnimplementedSessionServiceServer() +} + +func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer) { + s.RegisterService(&SessionService_ServiceDesc, srv) +} + +func _SessionService_NewSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HandshakeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).NewSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/NewSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).NewSession(ctx, req.(*HandshakeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SessionService_RefreshSessionToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HandshakeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).RefreshSessionToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/RefreshSessionToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).RefreshSessionToken(ctx, req.(*HandshakeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SessionService_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HandshakeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).CloseSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/CloseSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).CloseSession(ctx, req.(*HandshakeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SessionService_Release_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReleaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).Release(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/Release", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).Release(ctx, req.(*ReleaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SessionService_ExportFromTicket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).ExportFromTicket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/ExportFromTicket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).ExportFromTicket(ctx, req.(*ExportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SessionService_ExportNotifications_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ExportNotificationRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SessionServiceServer).ExportNotifications(m, &sessionServiceExportNotificationsServer{stream}) +} + +type SessionService_ExportNotificationsServer interface { + Send(*ExportNotification) error + grpc.ServerStream +} + +type sessionServiceExportNotificationsServer struct { + grpc.ServerStream +} + +func (x *sessionServiceExportNotificationsServer) Send(m *ExportNotification) error { + return x.ServerStream.SendMsg(m) +} + +func _SessionService_TerminationNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TerminationNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).TerminationNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.SessionService/TerminationNotification", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).TerminationNotification(ctx, req.(*TerminationNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SessionService_ServiceDesc is the grpc.ServiceDesc for SessionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SessionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.SessionService", + HandlerType: (*SessionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NewSession", + Handler: _SessionService_NewSession_Handler, + }, + { + MethodName: "RefreshSessionToken", + Handler: _SessionService_RefreshSessionToken_Handler, + }, + { + MethodName: "CloseSession", + Handler: _SessionService_CloseSession_Handler, + }, + { + MethodName: "Release", + Handler: _SessionService_Release_Handler, + }, + { + MethodName: "ExportFromTicket", + Handler: _SessionService_ExportFromTicket_Handler, + }, + { + MethodName: "TerminationNotification", + Handler: _SessionService_TerminationNotification_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ExportNotifications", + Handler: _SessionService_ExportNotifications_Handler, + ServerStreams: true, + }, + }, + Metadata: "deephaven/proto/session.proto", +} diff --git a/go/internal/proto/table/table.pb.go b/go/internal/proto/table/table.pb.go new file mode 100644 index 00000000000..62de901dabc --- /dev/null +++ b/go/internal/proto/table/table.pb.go @@ -0,0 +1,6541 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/table.proto + +package table + +import ( + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CaseSensitivity int32 + +const ( + CaseSensitivity_MATCH_CASE CaseSensitivity = 0 + CaseSensitivity_IGNORE_CASE CaseSensitivity = 1 +) + +// Enum value maps for CaseSensitivity. +var ( + CaseSensitivity_name = map[int32]string{ + 0: "MATCH_CASE", + 1: "IGNORE_CASE", + } + CaseSensitivity_value = map[string]int32{ + "MATCH_CASE": 0, + "IGNORE_CASE": 1, + } +) + +func (x CaseSensitivity) Enum() *CaseSensitivity { + p := new(CaseSensitivity) + *p = x + return p +} + +func (x CaseSensitivity) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CaseSensitivity) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[0].Descriptor() +} + +func (CaseSensitivity) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[0] +} + +func (x CaseSensitivity) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CaseSensitivity.Descriptor instead. +func (CaseSensitivity) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{0} +} + +type MatchType int32 + +const ( + MatchType_REGULAR MatchType = 0 + MatchType_INVERTED MatchType = 1 +) + +// Enum value maps for MatchType. +var ( + MatchType_name = map[int32]string{ + 0: "REGULAR", + 1: "INVERTED", + } + MatchType_value = map[string]int32{ + "REGULAR": 0, + "INVERTED": 1, + } +) + +func (x MatchType) Enum() *MatchType { + p := new(MatchType) + *p = x + return p +} + +func (x MatchType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MatchType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MatchType.Descriptor instead. +func (MatchType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{1} +} + +type AsOfJoinTablesRequest_MatchRule int32 + +const ( + AsOfJoinTablesRequest_LESS_THAN_EQUAL AsOfJoinTablesRequest_MatchRule = 0 + AsOfJoinTablesRequest_LESS_THAN AsOfJoinTablesRequest_MatchRule = 1 + AsOfJoinTablesRequest_GREATER_THAN_EQUAL AsOfJoinTablesRequest_MatchRule = 2 + AsOfJoinTablesRequest_GREATER_THAN AsOfJoinTablesRequest_MatchRule = 3 +) + +// Enum value maps for AsOfJoinTablesRequest_MatchRule. +var ( + AsOfJoinTablesRequest_MatchRule_name = map[int32]string{ + 0: "LESS_THAN_EQUAL", + 1: "LESS_THAN", + 2: "GREATER_THAN_EQUAL", + 3: "GREATER_THAN", + } + AsOfJoinTablesRequest_MatchRule_value = map[string]int32{ + "LESS_THAN_EQUAL": 0, + "LESS_THAN": 1, + "GREATER_THAN_EQUAL": 2, + "GREATER_THAN": 3, + } +) + +func (x AsOfJoinTablesRequest_MatchRule) Enum() *AsOfJoinTablesRequest_MatchRule { + p := new(AsOfJoinTablesRequest_MatchRule) + *p = x + return p +} + +func (x AsOfJoinTablesRequest_MatchRule) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AsOfJoinTablesRequest_MatchRule) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[2].Descriptor() +} + +func (AsOfJoinTablesRequest_MatchRule) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[2] +} + +func (x AsOfJoinTablesRequest_MatchRule) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AsOfJoinTablesRequest_MatchRule.Descriptor instead. +func (AsOfJoinTablesRequest_MatchRule) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{22, 0} +} + +type ComboAggregateRequest_AggType int32 + +const ( + ComboAggregateRequest_SUM ComboAggregateRequest_AggType = 0 + ComboAggregateRequest_ABS_SUM ComboAggregateRequest_AggType = 1 + ComboAggregateRequest_GROUP ComboAggregateRequest_AggType = 2 + ComboAggregateRequest_AVG ComboAggregateRequest_AggType = 3 + ComboAggregateRequest_COUNT ComboAggregateRequest_AggType = 4 + ComboAggregateRequest_FIRST ComboAggregateRequest_AggType = 5 + ComboAggregateRequest_LAST ComboAggregateRequest_AggType = 6 + ComboAggregateRequest_MIN ComboAggregateRequest_AggType = 7 + ComboAggregateRequest_MAX ComboAggregateRequest_AggType = 8 + ComboAggregateRequest_MEDIAN ComboAggregateRequest_AggType = 9 + ComboAggregateRequest_PERCENTILE ComboAggregateRequest_AggType = 10 + ComboAggregateRequest_STD ComboAggregateRequest_AggType = 11 + ComboAggregateRequest_VAR ComboAggregateRequest_AggType = 12 + ComboAggregateRequest_WEIGHTED_AVG ComboAggregateRequest_AggType = 13 +) + +// Enum value maps for ComboAggregateRequest_AggType. +var ( + ComboAggregateRequest_AggType_name = map[int32]string{ + 0: "SUM", + 1: "ABS_SUM", + 2: "GROUP", + 3: "AVG", + 4: "COUNT", + 5: "FIRST", + 6: "LAST", + 7: "MIN", + 8: "MAX", + 9: "MEDIAN", + 10: "PERCENTILE", + 11: "STD", + 12: "VAR", + 13: "WEIGHTED_AVG", + } + ComboAggregateRequest_AggType_value = map[string]int32{ + "SUM": 0, + "ABS_SUM": 1, + "GROUP": 2, + "AVG": 3, + "COUNT": 4, + "FIRST": 5, + "LAST": 6, + "MIN": 7, + "MAX": 8, + "MEDIAN": 9, + "PERCENTILE": 10, + "STD": 11, + "VAR": 12, + "WEIGHTED_AVG": 13, + } +) + +func (x ComboAggregateRequest_AggType) Enum() *ComboAggregateRequest_AggType { + p := new(ComboAggregateRequest_AggType) + *p = x + return p +} + +func (x ComboAggregateRequest_AggType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ComboAggregateRequest_AggType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[3].Descriptor() +} + +func (ComboAggregateRequest_AggType) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[3] +} + +func (x ComboAggregateRequest_AggType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ComboAggregateRequest_AggType.Descriptor instead. +func (ComboAggregateRequest_AggType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23, 0} +} + +type SortDescriptor_SortDirection int32 + +const ( + SortDescriptor_UNKNOWN SortDescriptor_SortDirection = 0 + SortDescriptor_DESCENDING SortDescriptor_SortDirection = -1 + SortDescriptor_ASCENDING SortDescriptor_SortDirection = 1 + SortDescriptor_REVERSE SortDescriptor_SortDirection = 2 +) + +// Enum value maps for SortDescriptor_SortDirection. +var ( + SortDescriptor_SortDirection_name = map[int32]string{ + 0: "UNKNOWN", + -1: "DESCENDING", + 1: "ASCENDING", + 2: "REVERSE", + } + SortDescriptor_SortDirection_value = map[string]int32{ + "UNKNOWN": 0, + "DESCENDING": -1, + "ASCENDING": 1, + "REVERSE": 2, + } +) + +func (x SortDescriptor_SortDirection) Enum() *SortDescriptor_SortDirection { + p := new(SortDescriptor_SortDirection) + *p = x + return p +} + +func (x SortDescriptor_SortDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortDescriptor_SortDirection) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[4].Descriptor() +} + +func (SortDescriptor_SortDirection) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[4] +} + +func (x SortDescriptor_SortDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortDescriptor_SortDirection.Descriptor instead. +func (SortDescriptor_SortDirection) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24, 0} +} + +type CompareCondition_CompareOperation int32 + +const ( + CompareCondition_LESS_THAN CompareCondition_CompareOperation = 0 + CompareCondition_LESS_THAN_OR_EQUAL CompareCondition_CompareOperation = 1 + CompareCondition_GREATER_THAN CompareCondition_CompareOperation = 2 + CompareCondition_GREATER_THAN_OR_EQUAL CompareCondition_CompareOperation = 3 + CompareCondition_EQUALS CompareCondition_CompareOperation = 4 + CompareCondition_NOT_EQUALS CompareCondition_CompareOperation = 5 +) + +// Enum value maps for CompareCondition_CompareOperation. +var ( + CompareCondition_CompareOperation_name = map[int32]string{ + 0: "LESS_THAN", + 1: "LESS_THAN_OR_EQUAL", + 2: "GREATER_THAN", + 3: "GREATER_THAN_OR_EQUAL", + 4: "EQUALS", + 5: "NOT_EQUALS", + } + CompareCondition_CompareOperation_value = map[string]int32{ + "LESS_THAN": 0, + "LESS_THAN_OR_EQUAL": 1, + "GREATER_THAN": 2, + "GREATER_THAN_OR_EQUAL": 3, + "EQUALS": 4, + "NOT_EQUALS": 5, + } +) + +func (x CompareCondition_CompareOperation) Enum() *CompareCondition_CompareOperation { + p := new(CompareCondition_CompareOperation) + *p = x + return p +} + +func (x CompareCondition_CompareOperation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CompareCondition_CompareOperation) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[5].Descriptor() +} + +func (CompareCondition_CompareOperation) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[5] +} + +func (x CompareCondition_CompareOperation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CompareCondition_CompareOperation.Descriptor instead. +func (CompareCondition_CompareOperation) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{34, 0} +} + +type TableReference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Ref: + // *TableReference_Ticket + // *TableReference_BatchOffset + Ref isTableReference_Ref `protobuf_oneof:"ref"` +} + +func (x *TableReference) Reset() { + *x = TableReference{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TableReference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TableReference) ProtoMessage() {} + +func (x *TableReference) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TableReference.ProtoReflect.Descriptor instead. +func (*TableReference) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{0} +} + +func (m *TableReference) GetRef() isTableReference_Ref { + if m != nil { + return m.Ref + } + return nil +} + +func (x *TableReference) GetTicket() *ticket.Ticket { + if x, ok := x.GetRef().(*TableReference_Ticket); ok { + return x.Ticket + } + return nil +} + +func (x *TableReference) GetBatchOffset() int32 { + if x, ok := x.GetRef().(*TableReference_BatchOffset); ok { + return x.BatchOffset + } + return 0 +} + +type isTableReference_Ref interface { + isTableReference_Ref() +} + +type TableReference_Ticket struct { + // an exported ticket + Ticket *ticket.Ticket `protobuf:"bytes,1,opt,name=ticket,proto3,oneof"` +} + +type TableReference_BatchOffset struct { + // an offset into a BatchRequest -- used to reference a result that will not be exported + BatchOffset int32 `protobuf:"zigzag32,2,opt,name=batch_offset,json=batchOffset,proto3,oneof"` +} + +func (*TableReference_Ticket) isTableReference_Ref() {} + +func (*TableReference_BatchOffset) isTableReference_Ref() {} + +type ExportedTableCreationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *TableReference `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + // If this is part of a batch, you may receive creation messages that indicate the sub-operation failed. + Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` + // If this is part of a batch, this errorInfo will be the message provided + ErrorInfo string `protobuf:"bytes,3,opt,name=error_info,json=errorInfo,proto3" json:"error_info,omitempty"` + // Schema as described in Arrow Message.fbs::Message. + SchemaHeader []byte `protobuf:"bytes,4,opt,name=schema_header,json=schemaHeader,proto3" json:"schema_header,omitempty"` + // Whether or not this table might change. + IsStatic bool `protobuf:"varint,5,opt,name=is_static,json=isStatic,proto3" json:"is_static,omitempty"` + // The current number of rows for this table. + Size int64 `protobuf:"zigzag64,6,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ExportedTableCreationResponse) Reset() { + *x = ExportedTableCreationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportedTableCreationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportedTableCreationResponse) ProtoMessage() {} + +func (x *ExportedTableCreationResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportedTableCreationResponse.ProtoReflect.Descriptor instead. +func (*ExportedTableCreationResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{1} +} + +func (x *ExportedTableCreationResponse) GetResultId() *TableReference { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *ExportedTableCreationResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ExportedTableCreationResponse) GetErrorInfo() string { + if x != nil { + return x.ErrorInfo + } + return "" +} + +func (x *ExportedTableCreationResponse) GetSchemaHeader() []byte { + if x != nil { + return x.SchemaHeader + } + return nil +} + +func (x *ExportedTableCreationResponse) GetIsStatic() bool { + if x != nil { + return x.IsStatic + } + return false +} + +func (x *ExportedTableCreationResponse) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type FetchTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceId *TableReference `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *FetchTableRequest) Reset() { + *x = FetchTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchTableRequest) ProtoMessage() {} + +func (x *FetchTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchTableRequest.ProtoReflect.Descriptor instead. +func (*FetchTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{2} +} + +func (x *FetchTableRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *FetchTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type ApplyPreviewColumnsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceId *TableReference `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *ApplyPreviewColumnsRequest) Reset() { + *x = ApplyPreviewColumnsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyPreviewColumnsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyPreviewColumnsRequest) ProtoMessage() {} + +func (x *ApplyPreviewColumnsRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyPreviewColumnsRequest.ProtoReflect.Descriptor instead. +func (*ApplyPreviewColumnsRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{3} +} + +func (x *ApplyPreviewColumnsRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *ApplyPreviewColumnsRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type FetchPandasTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceId *TableReference `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ResultId *ticket.Ticket `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` +} + +func (x *FetchPandasTableRequest) Reset() { + *x = FetchPandasTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchPandasTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchPandasTableRequest) ProtoMessage() {} + +func (x *FetchPandasTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchPandasTableRequest.ProtoReflect.Descriptor instead. +func (*FetchPandasTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{4} +} + +func (x *FetchPandasTableRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *FetchPandasTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +type ExportedTableUpdatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExportedTableUpdatesRequest) Reset() { + *x = ExportedTableUpdatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportedTableUpdatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportedTableUpdatesRequest) ProtoMessage() {} + +func (x *ExportedTableUpdatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportedTableUpdatesRequest.ProtoReflect.Descriptor instead. +func (*ExportedTableUpdatesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{5} +} + +type ExportedTableUpdateMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExportId *ticket.Ticket `protobuf:"bytes,1,opt,name=export_id,json=exportId,proto3" json:"export_id,omitempty"` + Size int64 `protobuf:"zigzag64,2,opt,name=size,proto3" json:"size,omitempty"` + UpdateFailureMessage string `protobuf:"bytes,3,opt,name=update_failure_message,json=updateFailureMessage,proto3" json:"update_failure_message,omitempty"` +} + +func (x *ExportedTableUpdateMessage) Reset() { + *x = ExportedTableUpdateMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportedTableUpdateMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportedTableUpdateMessage) ProtoMessage() {} + +func (x *ExportedTableUpdateMessage) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportedTableUpdateMessage.ProtoReflect.Descriptor instead. +func (*ExportedTableUpdateMessage) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{6} +} + +func (x *ExportedTableUpdateMessage) GetExportId() *ticket.Ticket { + if x != nil { + return x.ExportId + } + return nil +} + +func (x *ExportedTableUpdateMessage) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *ExportedTableUpdateMessage) GetUpdateFailureMessage() string { + if x != nil { + return x.UpdateFailureMessage + } + return "" +} + +type EmptyTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + Size int64 `protobuf:"zigzag64,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *EmptyTableRequest) Reset() { + *x = EmptyTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyTableRequest) ProtoMessage() {} + +func (x *EmptyTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyTableRequest.ProtoReflect.Descriptor instead. +func (*EmptyTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{7} +} + +func (x *EmptyTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *EmptyTableRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type TimeTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + StartTimeNanos int64 `protobuf:"zigzag64,2,opt,name=start_time_nanos,json=startTimeNanos,proto3" json:"start_time_nanos,omitempty"` + PeriodNanos int64 `protobuf:"zigzag64,3,opt,name=period_nanos,json=periodNanos,proto3" json:"period_nanos,omitempty"` +} + +func (x *TimeTableRequest) Reset() { + *x = TimeTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeTableRequest) ProtoMessage() {} + +func (x *TimeTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TimeTableRequest.ProtoReflect.Descriptor instead. +func (*TimeTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{8} +} + +func (x *TimeTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *TimeTableRequest) GetStartTimeNanos() int64 { + if x != nil { + return x.StartTimeNanos + } + return 0 +} + +func (x *TimeTableRequest) GetPeriodNanos() int64 { + if x != nil { + return x.PeriodNanos + } + return 0 +} + +type SelectOrUpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ColumnSpecs []string `protobuf:"bytes,3,rep,name=column_specs,json=columnSpecs,proto3" json:"column_specs,omitempty"` +} + +func (x *SelectOrUpdateRequest) Reset() { + *x = SelectOrUpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectOrUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectOrUpdateRequest) ProtoMessage() {} + +func (x *SelectOrUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelectOrUpdateRequest.ProtoReflect.Descriptor instead. +func (*SelectOrUpdateRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{9} +} + +func (x *SelectOrUpdateRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *SelectOrUpdateRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *SelectOrUpdateRequest) GetColumnSpecs() []string { + if x != nil { + return x.ColumnSpecs + } + return nil +} + +type SelectDistinctRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ColumnNames []string `protobuf:"bytes,3,rep,name=column_names,json=columnNames,proto3" json:"column_names,omitempty"` +} + +func (x *SelectDistinctRequest) Reset() { + *x = SelectDistinctRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectDistinctRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectDistinctRequest) ProtoMessage() {} + +func (x *SelectDistinctRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelectDistinctRequest.ProtoReflect.Descriptor instead. +func (*SelectDistinctRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{10} +} + +func (x *SelectDistinctRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *SelectDistinctRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *SelectDistinctRequest) GetColumnNames() []string { + if x != nil { + return x.ColumnNames + } + return nil +} + +type DropColumnsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ColumnNames []string `protobuf:"bytes,3,rep,name=column_names,json=columnNames,proto3" json:"column_names,omitempty"` +} + +func (x *DropColumnsRequest) Reset() { + *x = DropColumnsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropColumnsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropColumnsRequest) ProtoMessage() {} + +func (x *DropColumnsRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DropColumnsRequest.ProtoReflect.Descriptor instead. +func (*DropColumnsRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11} +} + +func (x *DropColumnsRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *DropColumnsRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *DropColumnsRequest) GetColumnNames() []string { + if x != nil { + return x.ColumnNames + } + return nil +} + +type UnstructuredFilterTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + Filters []string `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *UnstructuredFilterTableRequest) Reset() { + *x = UnstructuredFilterTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnstructuredFilterTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnstructuredFilterTableRequest) ProtoMessage() {} + +func (x *UnstructuredFilterTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnstructuredFilterTableRequest.ProtoReflect.Descriptor instead. +func (*UnstructuredFilterTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{12} +} + +func (x *UnstructuredFilterTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *UnstructuredFilterTableRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *UnstructuredFilterTableRequest) GetFilters() []string { + if x != nil { + return x.Filters + } + return nil +} + +type HeadOrTailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + NumRows int64 `protobuf:"zigzag64,3,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"` +} + +func (x *HeadOrTailRequest) Reset() { + *x = HeadOrTailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadOrTailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadOrTailRequest) ProtoMessage() {} + +func (x *HeadOrTailRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadOrTailRequest.ProtoReflect.Descriptor instead. +func (*HeadOrTailRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{13} +} + +func (x *HeadOrTailRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *HeadOrTailRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *HeadOrTailRequest) GetNumRows() int64 { + if x != nil { + return x.NumRows + } + return 0 +} + +type HeadOrTailByRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + NumRows int64 `protobuf:"zigzag64,3,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"` + GroupByColumnSpecs []string `protobuf:"bytes,4,rep,name=group_by_column_specs,json=groupByColumnSpecs,proto3" json:"group_by_column_specs,omitempty"` +} + +func (x *HeadOrTailByRequest) Reset() { + *x = HeadOrTailByRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadOrTailByRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadOrTailByRequest) ProtoMessage() {} + +func (x *HeadOrTailByRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadOrTailByRequest.ProtoReflect.Descriptor instead. +func (*HeadOrTailByRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{14} +} + +func (x *HeadOrTailByRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *HeadOrTailByRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *HeadOrTailByRequest) GetNumRows() int64 { + if x != nil { + return x.NumRows + } + return 0 +} + +func (x *HeadOrTailByRequest) GetGroupByColumnSpecs() []string { + if x != nil { + return x.GroupByColumnSpecs + } + return nil +} + +type UngroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + NullFill bool `protobuf:"varint,3,opt,name=null_fill,json=nullFill,proto3" json:"null_fill,omitempty"` + ColumnsToUngroup []string `protobuf:"bytes,4,rep,name=columns_to_ungroup,json=columnsToUngroup,proto3" json:"columns_to_ungroup,omitempty"` +} + +func (x *UngroupRequest) Reset() { + *x = UngroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UngroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UngroupRequest) ProtoMessage() {} + +func (x *UngroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UngroupRequest.ProtoReflect.Descriptor instead. +func (*UngroupRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{15} +} + +func (x *UngroupRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *UngroupRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *UngroupRequest) GetNullFill() bool { + if x != nil { + return x.NullFill + } + return false +} + +func (x *UngroupRequest) GetColumnsToUngroup() []string { + if x != nil { + return x.ColumnsToUngroup + } + return nil +} + +type MergeTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceIds []*TableReference `protobuf:"bytes,2,rep,name=source_ids,json=sourceIds,proto3" json:"source_ids,omitempty"` + KeyColumn string `protobuf:"bytes,3,opt,name=key_column,json=keyColumn,proto3" json:"key_column,omitempty"` // if specified, the result will be sorted by this column +} + +func (x *MergeTablesRequest) Reset() { + *x = MergeTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MergeTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeTablesRequest) ProtoMessage() {} + +func (x *MergeTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeTablesRequest.ProtoReflect.Descriptor instead. +func (*MergeTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{16} +} + +func (x *MergeTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *MergeTablesRequest) GetSourceIds() []*TableReference { + if x != nil { + return x.SourceIds + } + return nil +} + +func (x *MergeTablesRequest) GetKeyColumn() string { + if x != nil { + return x.KeyColumn + } + return "" +} + +type SnapshotTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + // The table on which to invoke the snapshot function. If unset, an empty(1) table will be used. + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + // The table to pass into the snapshot function. + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + // Whether to take an initial snapshot (passed to table.snapshot function). + DoInitialSnapshot bool `protobuf:"varint,4,opt,name=do_initial_snapshot,json=doInitialSnapshot,proto3" json:"do_initial_snapshot,omitempty"` + // Which columns to take from the left table (can be renamed if desired). + StampColumns []string `protobuf:"bytes,5,rep,name=stamp_columns,json=stampColumns,proto3" json:"stamp_columns,omitempty"` +} + +func (x *SnapshotTableRequest) Reset() { + *x = SnapshotTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SnapshotTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotTableRequest) ProtoMessage() {} + +func (x *SnapshotTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotTableRequest.ProtoReflect.Descriptor instead. +func (*SnapshotTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{17} +} + +func (x *SnapshotTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *SnapshotTableRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *SnapshotTableRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *SnapshotTableRequest) GetDoInitialSnapshot() bool { + if x != nil { + return x.DoInitialSnapshot + } + return false +} + +func (x *SnapshotTableRequest) GetStampColumns() []string { + if x != nil { + return x.StampColumns + } + return nil +} + +type CrossJoinTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + ColumnsToMatch []string `protobuf:"bytes,4,rep,name=columns_to_match,json=columnsToMatch,proto3" json:"columns_to_match,omitempty"` + ColumnsToAdd []string `protobuf:"bytes,5,rep,name=columns_to_add,json=columnsToAdd,proto3" json:"columns_to_add,omitempty"` + // the number of bits of key-space to initially reserve per group; default is 10 + ReserveBits int32 `protobuf:"varint,6,opt,name=reserve_bits,json=reserveBits,proto3" json:"reserve_bits,omitempty"` +} + +func (x *CrossJoinTablesRequest) Reset() { + *x = CrossJoinTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CrossJoinTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CrossJoinTablesRequest) ProtoMessage() {} + +func (x *CrossJoinTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CrossJoinTablesRequest.ProtoReflect.Descriptor instead. +func (*CrossJoinTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{18} +} + +func (x *CrossJoinTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *CrossJoinTablesRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *CrossJoinTablesRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *CrossJoinTablesRequest) GetColumnsToMatch() []string { + if x != nil { + return x.ColumnsToMatch + } + return nil +} + +func (x *CrossJoinTablesRequest) GetColumnsToAdd() []string { + if x != nil { + return x.ColumnsToAdd + } + return nil +} + +func (x *CrossJoinTablesRequest) GetReserveBits() int32 { + if x != nil { + return x.ReserveBits + } + return 0 +} + +type NaturalJoinTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + ColumnsToMatch []string `protobuf:"bytes,4,rep,name=columns_to_match,json=columnsToMatch,proto3" json:"columns_to_match,omitempty"` + ColumnsToAdd []string `protobuf:"bytes,5,rep,name=columns_to_add,json=columnsToAdd,proto3" json:"columns_to_add,omitempty"` +} + +func (x *NaturalJoinTablesRequest) Reset() { + *x = NaturalJoinTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NaturalJoinTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NaturalJoinTablesRequest) ProtoMessage() {} + +func (x *NaturalJoinTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NaturalJoinTablesRequest.ProtoReflect.Descriptor instead. +func (*NaturalJoinTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{19} +} + +func (x *NaturalJoinTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *NaturalJoinTablesRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *NaturalJoinTablesRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *NaturalJoinTablesRequest) GetColumnsToMatch() []string { + if x != nil { + return x.ColumnsToMatch + } + return nil +} + +func (x *NaturalJoinTablesRequest) GetColumnsToAdd() []string { + if x != nil { + return x.ColumnsToAdd + } + return nil +} + +type ExactJoinTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + ColumnsToMatch []string `protobuf:"bytes,4,rep,name=columns_to_match,json=columnsToMatch,proto3" json:"columns_to_match,omitempty"` + ColumnsToAdd []string `protobuf:"bytes,5,rep,name=columns_to_add,json=columnsToAdd,proto3" json:"columns_to_add,omitempty"` +} + +func (x *ExactJoinTablesRequest) Reset() { + *x = ExactJoinTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExactJoinTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExactJoinTablesRequest) ProtoMessage() {} + +func (x *ExactJoinTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExactJoinTablesRequest.ProtoReflect.Descriptor instead. +func (*ExactJoinTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{20} +} + +func (x *ExactJoinTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *ExactJoinTablesRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *ExactJoinTablesRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *ExactJoinTablesRequest) GetColumnsToMatch() []string { + if x != nil { + return x.ColumnsToMatch + } + return nil +} + +func (x *ExactJoinTablesRequest) GetColumnsToAdd() []string { + if x != nil { + return x.ColumnsToAdd + } + return nil +} + +type LeftJoinTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + ColumnsToMatch []string `protobuf:"bytes,4,rep,name=columns_to_match,json=columnsToMatch,proto3" json:"columns_to_match,omitempty"` + ColumnsToAdd []string `protobuf:"bytes,5,rep,name=columns_to_add,json=columnsToAdd,proto3" json:"columns_to_add,omitempty"` +} + +func (x *LeftJoinTablesRequest) Reset() { + *x = LeftJoinTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LeftJoinTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LeftJoinTablesRequest) ProtoMessage() {} + +func (x *LeftJoinTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LeftJoinTablesRequest.ProtoReflect.Descriptor instead. +func (*LeftJoinTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{21} +} + +func (x *LeftJoinTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *LeftJoinTablesRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *LeftJoinTablesRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *LeftJoinTablesRequest) GetColumnsToMatch() []string { + if x != nil { + return x.ColumnsToMatch + } + return nil +} + +func (x *LeftJoinTablesRequest) GetColumnsToAdd() []string { + if x != nil { + return x.ColumnsToAdd + } + return nil +} + +type AsOfJoinTablesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + LeftId *TableReference `protobuf:"bytes,2,opt,name=left_id,json=leftId,proto3" json:"left_id,omitempty"` + RightId *TableReference `protobuf:"bytes,3,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` + ColumnsToMatch []string `protobuf:"bytes,4,rep,name=columns_to_match,json=columnsToMatch,proto3" json:"columns_to_match,omitempty"` + ColumnsToAdd []string `protobuf:"bytes,5,rep,name=columns_to_add,json=columnsToAdd,proto3" json:"columns_to_add,omitempty"` + // Direction to search to find a match. LESS_THAN_EQUAL and LESS_THAN will be used to make a + // Table.aj() call, and GREATER_THAN_EQUAL and GREATER_THAN will be used to make a Table.raj() call. + AsOfMatchRule AsOfJoinTablesRequest_MatchRule `protobuf:"varint,7,opt,name=as_of_match_rule,json=asOfMatchRule,proto3,enum=io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest_MatchRule" json:"as_of_match_rule,omitempty"` +} + +func (x *AsOfJoinTablesRequest) Reset() { + *x = AsOfJoinTablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AsOfJoinTablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AsOfJoinTablesRequest) ProtoMessage() {} + +func (x *AsOfJoinTablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AsOfJoinTablesRequest.ProtoReflect.Descriptor instead. +func (*AsOfJoinTablesRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{22} +} + +func (x *AsOfJoinTablesRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *AsOfJoinTablesRequest) GetLeftId() *TableReference { + if x != nil { + return x.LeftId + } + return nil +} + +func (x *AsOfJoinTablesRequest) GetRightId() *TableReference { + if x != nil { + return x.RightId + } + return nil +} + +func (x *AsOfJoinTablesRequest) GetColumnsToMatch() []string { + if x != nil { + return x.ColumnsToMatch + } + return nil +} + +func (x *AsOfJoinTablesRequest) GetColumnsToAdd() []string { + if x != nil { + return x.ColumnsToAdd + } + return nil +} + +func (x *AsOfJoinTablesRequest) GetAsOfMatchRule() AsOfJoinTablesRequest_MatchRule { + if x != nil { + return x.AsOfMatchRule + } + return AsOfJoinTablesRequest_LESS_THAN_EQUAL +} + +type ComboAggregateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + Aggregates []*ComboAggregateRequest_Aggregate `protobuf:"bytes,3,rep,name=aggregates,proto3" json:"aggregates,omitempty"` + GroupByColumns []string `protobuf:"bytes,4,rep,name=group_by_columns,json=groupByColumns,proto3" json:"group_by_columns,omitempty"` + ForceCombo bool `protobuf:"varint,5,opt,name=force_combo,json=forceCombo,proto3" json:"force_combo,omitempty"` // don't use direct single-aggregate table operations even if there is only a single aggregate +} + +func (x *ComboAggregateRequest) Reset() { + *x = ComboAggregateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComboAggregateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComboAggregateRequest) ProtoMessage() {} + +func (x *ComboAggregateRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComboAggregateRequest.ProtoReflect.Descriptor instead. +func (*ComboAggregateRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23} +} + +func (x *ComboAggregateRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *ComboAggregateRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *ComboAggregateRequest) GetAggregates() []*ComboAggregateRequest_Aggregate { + if x != nil { + return x.Aggregates + } + return nil +} + +func (x *ComboAggregateRequest) GetGroupByColumns() []string { + if x != nil { + return x.GroupByColumns + } + return nil +} + +func (x *ComboAggregateRequest) GetForceCombo() bool { + if x != nil { + return x.ForceCombo + } + return false +} + +type SortDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` + IsAbsolute bool `protobuf:"varint,2,opt,name=is_absolute,json=isAbsolute,proto3" json:"is_absolute,omitempty"` + Direction SortDescriptor_SortDirection `protobuf:"varint,3,opt,name=direction,proto3,enum=io.deephaven.proto.backplane.grpc.SortDescriptor_SortDirection" json:"direction,omitempty"` +} + +func (x *SortDescriptor) Reset() { + *x = SortDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SortDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SortDescriptor) ProtoMessage() {} + +func (x *SortDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SortDescriptor.ProtoReflect.Descriptor instead. +func (*SortDescriptor) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24} +} + +func (x *SortDescriptor) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +func (x *SortDescriptor) GetIsAbsolute() bool { + if x != nil { + return x.IsAbsolute + } + return false +} + +func (x *SortDescriptor) GetDirection() SortDescriptor_SortDirection { + if x != nil { + return x.Direction + } + return SortDescriptor_UNKNOWN +} + +type SortTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + Sorts []*SortDescriptor `protobuf:"bytes,3,rep,name=sorts,proto3" json:"sorts,omitempty"` +} + +func (x *SortTableRequest) Reset() { + *x = SortTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SortTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SortTableRequest) ProtoMessage() {} + +func (x *SortTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SortTableRequest.ProtoReflect.Descriptor instead. +func (*SortTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{25} +} + +func (x *SortTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *SortTableRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *SortTableRequest) GetSorts() []*SortDescriptor { + if x != nil { + return x.Sorts + } + return nil +} + +type FilterTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + Filters []*Condition `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *FilterTableRequest) Reset() { + *x = FilterTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilterTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilterTableRequest) ProtoMessage() {} + +func (x *FilterTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilterTableRequest.ProtoReflect.Descriptor instead. +func (*FilterTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{26} +} + +func (x *FilterTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *FilterTableRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *FilterTableRequest) GetFilters() []*Condition { + if x != nil { + return x.Filters + } + return nil +} + +type Reference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` +} + +func (x *Reference) Reset() { + *x = Reference{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reference) ProtoMessage() {} + +func (x *Reference) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reference.ProtoReflect.Descriptor instead. +func (*Reference) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{27} +} + +func (x *Reference) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +type Literal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // *Literal_StringValue + // *Literal_DoubleValue + // *Literal_BoolValue + // *Literal_LongValue + // *Literal_NanoTimeValue + Value isLiteral_Value `protobuf_oneof:"value"` +} + +func (x *Literal) Reset() { + *x = Literal{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Literal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Literal) ProtoMessage() {} + +func (x *Literal) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Literal.ProtoReflect.Descriptor instead. +func (*Literal) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{28} +} + +func (m *Literal) GetValue() isLiteral_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Literal) GetStringValue() string { + if x, ok := x.GetValue().(*Literal_StringValue); ok { + return x.StringValue + } + return "" +} + +func (x *Literal) GetDoubleValue() float64 { + if x, ok := x.GetValue().(*Literal_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (x *Literal) GetBoolValue() bool { + if x, ok := x.GetValue().(*Literal_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (x *Literal) GetLongValue() int64 { + if x, ok := x.GetValue().(*Literal_LongValue); ok { + return x.LongValue + } + return 0 +} + +func (x *Literal) GetNanoTimeValue() int64 { + if x, ok := x.GetValue().(*Literal_NanoTimeValue); ok { + return x.NanoTimeValue + } + return 0 +} + +type isLiteral_Value interface { + isLiteral_Value() +} + +type Literal_StringValue struct { + StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type Literal_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,2,opt,name=double_value,json=doubleValue,proto3,oneof"` +} + +type Literal_BoolValue struct { + BoolValue bool `protobuf:"varint,3,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type Literal_LongValue struct { + LongValue int64 `protobuf:"zigzag64,4,opt,name=long_value,json=longValue,proto3,oneof"` +} + +type Literal_NanoTimeValue struct { + NanoTimeValue int64 `protobuf:"zigzag64,5,opt,name=nano_time_value,json=nanoTimeValue,proto3,oneof"` // nanos since the epoch +} + +func (*Literal_StringValue) isLiteral_Value() {} + +func (*Literal_DoubleValue) isLiteral_Value() {} + +func (*Literal_BoolValue) isLiteral_Value() {} + +func (*Literal_LongValue) isLiteral_Value() {} + +func (*Literal_NanoTimeValue) isLiteral_Value() {} + +// could also inline this to each place that uses it +type Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Data: + // *Value_Reference + // *Value_Literal + Data isValue_Data `protobuf_oneof:"data"` +} + +func (x *Value) Reset() { + *x = Value{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Value) ProtoMessage() {} + +func (x *Value) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Value.ProtoReflect.Descriptor instead. +func (*Value) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{29} +} + +func (m *Value) GetData() isValue_Data { + if m != nil { + return m.Data + } + return nil +} + +func (x *Value) GetReference() *Reference { + if x, ok := x.GetData().(*Value_Reference); ok { + return x.Reference + } + return nil +} + +func (x *Value) GetLiteral() *Literal { + if x, ok := x.GetData().(*Value_Literal); ok { + return x.Literal + } + return nil +} + +type isValue_Data interface { + isValue_Data() +} + +type Value_Reference struct { + Reference *Reference `protobuf:"bytes,1,opt,name=reference,proto3,oneof"` +} + +type Value_Literal struct { + Literal *Literal `protobuf:"bytes,2,opt,name=literal,proto3,oneof"` +} + +func (*Value_Reference) isValue_Data() {} + +func (*Value_Literal) isValue_Data() {} + +type Condition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Data: + // *Condition_And + // *Condition_Or + // *Condition_Not + // *Condition_Compare + // *Condition_In + // *Condition_Invoke + // *Condition_IsNull + // *Condition_Matches + // *Condition_Contains + // *Condition_Search + Data isCondition_Data `protobuf_oneof:"data"` +} + +func (x *Condition) Reset() { + *x = Condition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Condition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Condition) ProtoMessage() {} + +func (x *Condition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Condition.ProtoReflect.Descriptor instead. +func (*Condition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{30} +} + +func (m *Condition) GetData() isCondition_Data { + if m != nil { + return m.Data + } + return nil +} + +func (x *Condition) GetAnd() *AndCondition { + if x, ok := x.GetData().(*Condition_And); ok { + return x.And + } + return nil +} + +func (x *Condition) GetOr() *OrCondition { + if x, ok := x.GetData().(*Condition_Or); ok { + return x.Or + } + return nil +} + +func (x *Condition) GetNot() *NotCondition { + if x, ok := x.GetData().(*Condition_Not); ok { + return x.Not + } + return nil +} + +func (x *Condition) GetCompare() *CompareCondition { + if x, ok := x.GetData().(*Condition_Compare); ok { + return x.Compare + } + return nil +} + +func (x *Condition) GetIn() *InCondition { + if x, ok := x.GetData().(*Condition_In); ok { + return x.In + } + return nil +} + +func (x *Condition) GetInvoke() *InvokeCondition { + if x, ok := x.GetData().(*Condition_Invoke); ok { + return x.Invoke + } + return nil +} + +func (x *Condition) GetIsNull() *IsNullCondition { + if x, ok := x.GetData().(*Condition_IsNull); ok { + return x.IsNull + } + return nil +} + +func (x *Condition) GetMatches() *MatchesCondition { + if x, ok := x.GetData().(*Condition_Matches); ok { + return x.Matches + } + return nil +} + +func (x *Condition) GetContains() *ContainsCondition { + if x, ok := x.GetData().(*Condition_Contains); ok { + return x.Contains + } + return nil +} + +func (x *Condition) GetSearch() *SearchCondition { + if x, ok := x.GetData().(*Condition_Search); ok { + return x.Search + } + return nil +} + +type isCondition_Data interface { + isCondition_Data() +} + +type Condition_And struct { + And *AndCondition `protobuf:"bytes,1,opt,name=and,proto3,oneof"` +} + +type Condition_Or struct { + Or *OrCondition `protobuf:"bytes,2,opt,name=or,proto3,oneof"` +} + +type Condition_Not struct { + Not *NotCondition `protobuf:"bytes,3,opt,name=not,proto3,oneof"` +} + +type Condition_Compare struct { + Compare *CompareCondition `protobuf:"bytes,4,opt,name=compare,proto3,oneof"` +} + +type Condition_In struct { + In *InCondition `protobuf:"bytes,5,opt,name=in,proto3,oneof"` +} + +type Condition_Invoke struct { + Invoke *InvokeCondition `protobuf:"bytes,6,opt,name=invoke,proto3,oneof"` +} + +type Condition_IsNull struct { + IsNull *IsNullCondition `protobuf:"bytes,7,opt,name=is_null,json=isNull,proto3,oneof"` +} + +type Condition_Matches struct { + Matches *MatchesCondition `protobuf:"bytes,8,opt,name=matches,proto3,oneof"` +} + +type Condition_Contains struct { + Contains *ContainsCondition `protobuf:"bytes,9,opt,name=contains,proto3,oneof"` +} + +type Condition_Search struct { + Search *SearchCondition `protobuf:"bytes,10,opt,name=search,proto3,oneof"` +} + +func (*Condition_And) isCondition_Data() {} + +func (*Condition_Or) isCondition_Data() {} + +func (*Condition_Not) isCondition_Data() {} + +func (*Condition_Compare) isCondition_Data() {} + +func (*Condition_In) isCondition_Data() {} + +func (*Condition_Invoke) isCondition_Data() {} + +func (*Condition_IsNull) isCondition_Data() {} + +func (*Condition_Matches) isCondition_Data() {} + +func (*Condition_Contains) isCondition_Data() {} + +func (*Condition_Search) isCondition_Data() {} + +// merge AND and OR into one and give them an "operation"? +type AndCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filters []*Condition `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *AndCondition) Reset() { + *x = AndCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AndCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AndCondition) ProtoMessage() {} + +func (x *AndCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AndCondition.ProtoReflect.Descriptor instead. +func (*AndCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{31} +} + +func (x *AndCondition) GetFilters() []*Condition { + if x != nil { + return x.Filters + } + return nil +} + +type OrCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filters []*Condition `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *OrCondition) Reset() { + *x = OrCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrCondition) ProtoMessage() {} + +func (x *OrCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrCondition.ProtoReflect.Descriptor instead. +func (*OrCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{32} +} + +func (x *OrCondition) GetFilters() []*Condition { + if x != nil { + return x.Filters + } + return nil +} + +type NotCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *Condition `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *NotCondition) Reset() { + *x = NotCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotCondition) ProtoMessage() {} + +func (x *NotCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotCondition.ProtoReflect.Descriptor instead. +func (*NotCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{33} +} + +func (x *NotCondition) GetFilter() *Condition { + if x != nil { + return x.Filter + } + return nil +} + +type CompareCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Operation CompareCondition_CompareOperation `protobuf:"varint,1,opt,name=operation,proto3,enum=io.deephaven.proto.backplane.grpc.CompareCondition_CompareOperation" json:"operation,omitempty"` + CaseSensitivity CaseSensitivity `protobuf:"varint,2,opt,name=case_sensitivity,json=caseSensitivity,proto3,enum=io.deephaven.proto.backplane.grpc.CaseSensitivity" json:"case_sensitivity,omitempty"` + Lhs *Value `protobuf:"bytes,3,opt,name=lhs,proto3" json:"lhs,omitempty"` + Rhs *Value `protobuf:"bytes,4,opt,name=rhs,proto3" json:"rhs,omitempty"` +} + +func (x *CompareCondition) Reset() { + *x = CompareCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompareCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompareCondition) ProtoMessage() {} + +func (x *CompareCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompareCondition.ProtoReflect.Descriptor instead. +func (*CompareCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{34} +} + +func (x *CompareCondition) GetOperation() CompareCondition_CompareOperation { + if x != nil { + return x.Operation + } + return CompareCondition_LESS_THAN +} + +func (x *CompareCondition) GetCaseSensitivity() CaseSensitivity { + if x != nil { + return x.CaseSensitivity + } + return CaseSensitivity_MATCH_CASE +} + +func (x *CompareCondition) GetLhs() *Value { + if x != nil { + return x.Lhs + } + return nil +} + +func (x *CompareCondition) GetRhs() *Value { + if x != nil { + return x.Rhs + } + return nil +} + +type InCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target *Value `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Candidates []*Value `protobuf:"bytes,2,rep,name=candidates,proto3" json:"candidates,omitempty"` + CaseSensitivity CaseSensitivity `protobuf:"varint,3,opt,name=case_sensitivity,json=caseSensitivity,proto3,enum=io.deephaven.proto.backplane.grpc.CaseSensitivity" json:"case_sensitivity,omitempty"` + MatchType MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=io.deephaven.proto.backplane.grpc.MatchType" json:"match_type,omitempty"` +} + +func (x *InCondition) Reset() { + *x = InCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InCondition) ProtoMessage() {} + +func (x *InCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InCondition.ProtoReflect.Descriptor instead. +func (*InCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{35} +} + +func (x *InCondition) GetTarget() *Value { + if x != nil { + return x.Target + } + return nil +} + +func (x *InCondition) GetCandidates() []*Value { + if x != nil { + return x.Candidates + } + return nil +} + +func (x *InCondition) GetCaseSensitivity() CaseSensitivity { + if x != nil { + return x.CaseSensitivity + } + return CaseSensitivity_MATCH_CASE +} + +func (x *InCondition) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return MatchType_REGULAR +} + +type InvokeCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` + Target *Value `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + Arguments []*Value `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"` +} + +func (x *InvokeCondition) Reset() { + *x = InvokeCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvokeCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvokeCondition) ProtoMessage() {} + +func (x *InvokeCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InvokeCondition.ProtoReflect.Descriptor instead. +func (*InvokeCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{36} +} + +func (x *InvokeCondition) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *InvokeCondition) GetTarget() *Value { + if x != nil { + return x.Target + } + return nil +} + +func (x *InvokeCondition) GetArguments() []*Value { + if x != nil { + return x.Arguments + } + return nil +} + +type IsNullCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reference *Reference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` +} + +func (x *IsNullCondition) Reset() { + *x = IsNullCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsNullCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsNullCondition) ProtoMessage() {} + +func (x *IsNullCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsNullCondition.ProtoReflect.Descriptor instead. +func (*IsNullCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{37} +} + +func (x *IsNullCondition) GetReference() *Reference { + if x != nil { + return x.Reference + } + return nil +} + +type MatchesCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reference *Reference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` + Regex string `protobuf:"bytes,2,opt,name=regex,proto3" json:"regex,omitempty"` + CaseSensitivity CaseSensitivity `protobuf:"varint,3,opt,name=case_sensitivity,json=caseSensitivity,proto3,enum=io.deephaven.proto.backplane.grpc.CaseSensitivity" json:"case_sensitivity,omitempty"` + MatchType MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=io.deephaven.proto.backplane.grpc.MatchType" json:"match_type,omitempty"` +} + +func (x *MatchesCondition) Reset() { + *x = MatchesCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MatchesCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MatchesCondition) ProtoMessage() {} + +func (x *MatchesCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MatchesCondition.ProtoReflect.Descriptor instead. +func (*MatchesCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{38} +} + +func (x *MatchesCondition) GetReference() *Reference { + if x != nil { + return x.Reference + } + return nil +} + +func (x *MatchesCondition) GetRegex() string { + if x != nil { + return x.Regex + } + return "" +} + +func (x *MatchesCondition) GetCaseSensitivity() CaseSensitivity { + if x != nil { + return x.CaseSensitivity + } + return CaseSensitivity_MATCH_CASE +} + +func (x *MatchesCondition) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return MatchType_REGULAR +} + +type ContainsCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reference *Reference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` + SearchString string `protobuf:"bytes,2,opt,name=search_string,json=searchString,proto3" json:"search_string,omitempty"` + CaseSensitivity CaseSensitivity `protobuf:"varint,3,opt,name=case_sensitivity,json=caseSensitivity,proto3,enum=io.deephaven.proto.backplane.grpc.CaseSensitivity" json:"case_sensitivity,omitempty"` + MatchType MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=io.deephaven.proto.backplane.grpc.MatchType" json:"match_type,omitempty"` +} + +func (x *ContainsCondition) Reset() { + *x = ContainsCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainsCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainsCondition) ProtoMessage() {} + +func (x *ContainsCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainsCondition.ProtoReflect.Descriptor instead. +func (*ContainsCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{39} +} + +func (x *ContainsCondition) GetReference() *Reference { + if x != nil { + return x.Reference + } + return nil +} + +func (x *ContainsCondition) GetSearchString() string { + if x != nil { + return x.SearchString + } + return "" +} + +func (x *ContainsCondition) GetCaseSensitivity() CaseSensitivity { + if x != nil { + return x.CaseSensitivity + } + return CaseSensitivity_MATCH_CASE +} + +func (x *ContainsCondition) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return MatchType_REGULAR +} + +// search +type SearchCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SearchString string `protobuf:"bytes,1,opt,name=search_string,json=searchString,proto3" json:"search_string,omitempty"` + OptionalReferences []*Reference `protobuf:"bytes,2,rep,name=optional_references,json=optionalReferences,proto3" json:"optional_references,omitempty"` +} + +func (x *SearchCondition) Reset() { + *x = SearchCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchCondition) ProtoMessage() {} + +func (x *SearchCondition) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchCondition.ProtoReflect.Descriptor instead. +func (*SearchCondition) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{40} +} + +func (x *SearchCondition) GetSearchString() string { + if x != nil { + return x.SearchString + } + return "" +} + +func (x *SearchCondition) GetOptionalReferences() []*Reference { + if x != nil { + return x.OptionalReferences + } + return nil +} + +type FlattenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` +} + +func (x *FlattenRequest) Reset() { + *x = FlattenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FlattenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlattenRequest) ProtoMessage() {} + +func (x *FlattenRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlattenRequest.ProtoReflect.Descriptor instead. +func (*FlattenRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{41} +} + +func (x *FlattenRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *FlattenRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +type RunChartDownsampleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + PixelCount int32 `protobuf:"varint,3,opt,name=pixel_count,json=pixelCount,proto3" json:"pixel_count,omitempty"` + ZoomRange *RunChartDownsampleRequest_ZoomRange `protobuf:"bytes,4,opt,name=zoom_range,json=zoomRange,proto3" json:"zoom_range,omitempty"` + XColumnName string `protobuf:"bytes,5,opt,name=x_column_name,json=xColumnName,proto3" json:"x_column_name,omitempty"` + YColumnNames []string `protobuf:"bytes,6,rep,name=y_column_names,json=yColumnNames,proto3" json:"y_column_names,omitempty"` +} + +func (x *RunChartDownsampleRequest) Reset() { + *x = RunChartDownsampleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunChartDownsampleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunChartDownsampleRequest) ProtoMessage() {} + +func (x *RunChartDownsampleRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunChartDownsampleRequest.ProtoReflect.Descriptor instead. +func (*RunChartDownsampleRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{42} +} + +func (x *RunChartDownsampleRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *RunChartDownsampleRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *RunChartDownsampleRequest) GetPixelCount() int32 { + if x != nil { + return x.PixelCount + } + return 0 +} + +func (x *RunChartDownsampleRequest) GetZoomRange() *RunChartDownsampleRequest_ZoomRange { + if x != nil { + return x.ZoomRange + } + return nil +} + +func (x *RunChartDownsampleRequest) GetXColumnName() string { + if x != nil { + return x.XColumnName + } + return "" +} + +func (x *RunChartDownsampleRequest) GetYColumnNames() []string { + if x != nil { + return x.YColumnNames + } + return nil +} + +type CreateInputTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + // Types that are assignable to Definition: + // *CreateInputTableRequest_SourceTableId + // *CreateInputTableRequest_Schema + Definition isCreateInputTableRequest_Definition `protobuf_oneof:"definition"` + // Specifies what type of input table to create. + Kind *CreateInputTableRequest_InputTableKind `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"` +} + +func (x *CreateInputTableRequest) Reset() { + *x = CreateInputTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest) ProtoMessage() {} + +func (x *CreateInputTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43} +} + +func (x *CreateInputTableRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (m *CreateInputTableRequest) GetDefinition() isCreateInputTableRequest_Definition { + if m != nil { + return m.Definition + } + return nil +} + +func (x *CreateInputTableRequest) GetSourceTableId() *TableReference { + if x, ok := x.GetDefinition().(*CreateInputTableRequest_SourceTableId); ok { + return x.SourceTableId + } + return nil +} + +func (x *CreateInputTableRequest) GetSchema() []byte { + if x, ok := x.GetDefinition().(*CreateInputTableRequest_Schema); ok { + return x.Schema + } + return nil +} + +func (x *CreateInputTableRequest) GetKind() *CreateInputTableRequest_InputTableKind { + if x != nil { + return x.Kind + } + return nil +} + +type isCreateInputTableRequest_Definition interface { + isCreateInputTableRequest_Definition() +} + +type CreateInputTableRequest_SourceTableId struct { + // Optional, either this or schema must be specified, not both. + SourceTableId *TableReference `protobuf:"bytes,2,opt,name=source_table_id,json=sourceTableId,proto3,oneof"` +} + +type CreateInputTableRequest_Schema struct { + // Schema as described in Arrow Message.fbs::Message. Optional, either this or source_table_id must be specified. + Schema []byte `protobuf:"bytes,3,opt,name=schema,proto3,oneof"` +} + +func (*CreateInputTableRequest_SourceTableId) isCreateInputTableRequest_Definition() {} + +func (*CreateInputTableRequest_Schema) isCreateInputTableRequest_Definition() {} + +type BatchTableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ops []*BatchTableRequest_Operation `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops,omitempty"` +} + +func (x *BatchTableRequest) Reset() { + *x = BatchTableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchTableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchTableRequest) ProtoMessage() {} + +func (x *BatchTableRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchTableRequest.ProtoReflect.Descriptor instead. +func (*BatchTableRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44} +} + +func (x *BatchTableRequest) GetOps() []*BatchTableRequest_Operation { + if x != nil { + return x.Ops + } + return nil +} + +type ComboAggregateRequest_Aggregate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ComboAggregateRequest_AggType `protobuf:"varint,1,opt,name=type,proto3,enum=io.deephaven.proto.backplane.grpc.ComboAggregateRequest_AggType" json:"type,omitempty"` + MatchPairs []string `protobuf:"bytes,2,rep,name=match_pairs,json=matchPairs,proto3" json:"match_pairs,omitempty"` // used in all aggregates except countBy + ColumnName string `protobuf:"bytes,3,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` // countBy result (output) column OR weighted avg weight (input) column, otherwise unused + Percentile float64 `protobuf:"fixed64,4,opt,name=percentile,proto3" json:"percentile,omitempty"` // required by percentileBy aggregates, otherwise unused + AvgMedian bool `protobuf:"varint,5,opt,name=avg_median,json=avgMedian,proto3" json:"avg_median,omitempty"` // used in percentileBy only +} + +func (x *ComboAggregateRequest_Aggregate) Reset() { + *x = ComboAggregateRequest_Aggregate{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComboAggregateRequest_Aggregate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComboAggregateRequest_Aggregate) ProtoMessage() {} + +func (x *ComboAggregateRequest_Aggregate) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComboAggregateRequest_Aggregate.ProtoReflect.Descriptor instead. +func (*ComboAggregateRequest_Aggregate) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23, 0} +} + +func (x *ComboAggregateRequest_Aggregate) GetType() ComboAggregateRequest_AggType { + if x != nil { + return x.Type + } + return ComboAggregateRequest_SUM +} + +func (x *ComboAggregateRequest_Aggregate) GetMatchPairs() []string { + if x != nil { + return x.MatchPairs + } + return nil +} + +func (x *ComboAggregateRequest_Aggregate) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +func (x *ComboAggregateRequest_Aggregate) GetPercentile() float64 { + if x != nil { + return x.Percentile + } + return 0 +} + +func (x *ComboAggregateRequest_Aggregate) GetAvgMedian() bool { + if x != nil { + return x.AvgMedian + } + return false +} + +type RunChartDownsampleRequest_ZoomRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinDateNanos *int64 `protobuf:"varint,1,opt,name=min_date_nanos,json=minDateNanos,proto3,oneof" json:"min_date_nanos,omitempty"` + MaxDateNanos *int64 `protobuf:"varint,2,opt,name=max_date_nanos,json=maxDateNanos,proto3,oneof" json:"max_date_nanos,omitempty"` +} + +func (x *RunChartDownsampleRequest_ZoomRange) Reset() { + *x = RunChartDownsampleRequest_ZoomRange{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunChartDownsampleRequest_ZoomRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunChartDownsampleRequest_ZoomRange) ProtoMessage() {} + +func (x *RunChartDownsampleRequest_ZoomRange) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunChartDownsampleRequest_ZoomRange.ProtoReflect.Descriptor instead. +func (*RunChartDownsampleRequest_ZoomRange) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{42, 0} +} + +func (x *RunChartDownsampleRequest_ZoomRange) GetMinDateNanos() int64 { + if x != nil && x.MinDateNanos != nil { + return *x.MinDateNanos + } + return 0 +} + +func (x *RunChartDownsampleRequest_ZoomRange) GetMaxDateNanos() int64 { + if x != nil && x.MaxDateNanos != nil { + return *x.MaxDateNanos + } + return 0 +} + +type CreateInputTableRequest_InputTableKind struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ + // *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ + Kind isCreateInputTableRequest_InputTableKind_Kind `protobuf_oneof:"kind"` +} + +func (x *CreateInputTableRequest_InputTableKind) Reset() { + *x = CreateInputTableRequest_InputTableKind{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0} +} + +func (m *CreateInputTableRequest_InputTableKind) GetKind() isCreateInputTableRequest_InputTableKind_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *CreateInputTableRequest_InputTableKind) GetInMemoryAppendOnly() *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly { + if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_); ok { + return x.InMemoryAppendOnly + } + return nil +} + +func (x *CreateInputTableRequest_InputTableKind) GetInMemoryKeyBacked() *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked { + if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_); ok { + return x.InMemoryKeyBacked + } + return nil +} + +type isCreateInputTableRequest_InputTableKind_Kind interface { + isCreateInputTableRequest_InputTableKind_Kind() +} + +type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ struct { + InMemoryAppendOnly *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly `protobuf:"bytes,1,opt,name=in_memory_append_only,json=inMemoryAppendOnly,proto3,oneof"` +} + +type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ struct { + InMemoryKeyBacked *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked `protobuf:"bytes,2,opt,name=in_memory_key_backed,json=inMemoryKeyBacked,proto3,oneof"` +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_) isCreateInputTableRequest_InputTableKind_Kind() { +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_) isCreateInputTableRequest_InputTableKind_Kind() { +} + +// Creates an in-memory append-only table - rows cannot be modified or deleted. +type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Reset() { + *x = CreateInputTableRequest_InputTableKind_InMemoryAppendOnly{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[48] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryAppendOnly.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0, 0} +} + +// Creates an in-memory table that supports updates and deletes by keys. +type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyColumns []string `protobuf:"bytes,1,rep,name=key_columns,json=keyColumns,proto3" json:"key_columns,omitempty"` +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Reset() { + *x = CreateInputTableRequest_InputTableKind_InMemoryKeyBacked{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryKeyBacked.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0, 1} +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) GetKeyColumns() []string { + if x != nil { + return x.KeyColumns + } + return nil +} + +type BatchTableRequest_Operation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Op: + // *BatchTableRequest_Operation_EmptyTable + // *BatchTableRequest_Operation_TimeTable + // *BatchTableRequest_Operation_DropColumns + // *BatchTableRequest_Operation_Update + // *BatchTableRequest_Operation_LazyUpdate + // *BatchTableRequest_Operation_View + // *BatchTableRequest_Operation_UpdateView + // *BatchTableRequest_Operation_Select + // *BatchTableRequest_Operation_SelectDistinct + // *BatchTableRequest_Operation_Filter + // *BatchTableRequest_Operation_UnstructuredFilter + // *BatchTableRequest_Operation_Sort + // *BatchTableRequest_Operation_Head + // *BatchTableRequest_Operation_Tail + // *BatchTableRequest_Operation_HeadBy + // *BatchTableRequest_Operation_TailBy + // *BatchTableRequest_Operation_Ungroup + // *BatchTableRequest_Operation_Merge + // *BatchTableRequest_Operation_ComboAggregate + // *BatchTableRequest_Operation_Snapshot + // *BatchTableRequest_Operation_Flatten + // *BatchTableRequest_Operation_RunChartDownsample + // *BatchTableRequest_Operation_CrossJoin + // *BatchTableRequest_Operation_NaturalJoin + // *BatchTableRequest_Operation_ExactJoin + // *BatchTableRequest_Operation_LeftJoin + // *BatchTableRequest_Operation_AsOfJoin + // *BatchTableRequest_Operation_FetchTable + // *BatchTableRequest_Operation_FetchPandasTable + // *BatchTableRequest_Operation_ApplyPreviewColumns + // *BatchTableRequest_Operation_CreateInputTable + Op isBatchTableRequest_Operation_Op `protobuf_oneof:"op"` +} + +func (x *BatchTableRequest_Operation) Reset() { + *x = BatchTableRequest_Operation{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchTableRequest_Operation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchTableRequest_Operation) ProtoMessage() {} + +func (x *BatchTableRequest_Operation) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchTableRequest_Operation.ProtoReflect.Descriptor instead. +func (*BatchTableRequest_Operation) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44, 0} +} + +func (m *BatchTableRequest_Operation) GetOp() isBatchTableRequest_Operation_Op { + if m != nil { + return m.Op + } + return nil +} + +func (x *BatchTableRequest_Operation) GetEmptyTable() *EmptyTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_EmptyTable); ok { + return x.EmptyTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTimeTable() *TimeTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_TimeTable); ok { + return x.TimeTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetDropColumns() *DropColumnsRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_DropColumns); ok { + return x.DropColumns + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUpdate() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Update); ok { + return x.Update + } + return nil +} + +func (x *BatchTableRequest_Operation) GetLazyUpdate() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_LazyUpdate); ok { + return x.LazyUpdate + } + return nil +} + +func (x *BatchTableRequest_Operation) GetView() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_View); ok { + return x.View + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUpdateView() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_UpdateView); ok { + return x.UpdateView + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSelect() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Select); ok { + return x.Select + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSelectDistinct() *SelectDistinctRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_SelectDistinct); ok { + return x.SelectDistinct + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFilter() *FilterTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Filter); ok { + return x.Filter + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUnstructuredFilter() *UnstructuredFilterTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_UnstructuredFilter); ok { + return x.UnstructuredFilter + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSort() *SortTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Sort); ok { + return x.Sort + } + return nil +} + +func (x *BatchTableRequest_Operation) GetHead() *HeadOrTailRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Head); ok { + return x.Head + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTail() *HeadOrTailRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Tail); ok { + return x.Tail + } + return nil +} + +func (x *BatchTableRequest_Operation) GetHeadBy() *HeadOrTailByRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_HeadBy); ok { + return x.HeadBy + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTailBy() *HeadOrTailByRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_TailBy); ok { + return x.TailBy + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUngroup() *UngroupRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Ungroup); ok { + return x.Ungroup + } + return nil +} + +func (x *BatchTableRequest_Operation) GetMerge() *MergeTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Merge); ok { + return x.Merge + } + return nil +} + +func (x *BatchTableRequest_Operation) GetComboAggregate() *ComboAggregateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ComboAggregate); ok { + return x.ComboAggregate + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSnapshot() *SnapshotTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Snapshot); ok { + return x.Snapshot + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFlatten() *FlattenRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Flatten); ok { + return x.Flatten + } + return nil +} + +func (x *BatchTableRequest_Operation) GetRunChartDownsample() *RunChartDownsampleRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_RunChartDownsample); ok { + return x.RunChartDownsample + } + return nil +} + +func (x *BatchTableRequest_Operation) GetCrossJoin() *CrossJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_CrossJoin); ok { + return x.CrossJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetNaturalJoin() *NaturalJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_NaturalJoin); ok { + return x.NaturalJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetExactJoin() *ExactJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ExactJoin); ok { + return x.ExactJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetLeftJoin() *LeftJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_LeftJoin); ok { + return x.LeftJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetAsOfJoin() *AsOfJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_AsOfJoin); ok { + return x.AsOfJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFetchTable() *FetchTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchTable); ok { + return x.FetchTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFetchPandasTable() *FetchPandasTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchPandasTable); ok { + return x.FetchPandasTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetApplyPreviewColumns() *ApplyPreviewColumnsRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ApplyPreviewColumns); ok { + return x.ApplyPreviewColumns + } + return nil +} + +func (x *BatchTableRequest_Operation) GetCreateInputTable() *CreateInputTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_CreateInputTable); ok { + return x.CreateInputTable + } + return nil +} + +type isBatchTableRequest_Operation_Op interface { + isBatchTableRequest_Operation_Op() +} + +type BatchTableRequest_Operation_EmptyTable struct { + EmptyTable *EmptyTableRequest `protobuf:"bytes,1,opt,name=empty_table,json=emptyTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_TimeTable struct { + TimeTable *TimeTableRequest `protobuf:"bytes,2,opt,name=time_table,json=timeTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_DropColumns struct { + DropColumns *DropColumnsRequest `protobuf:"bytes,3,opt,name=drop_columns,json=dropColumns,proto3,oneof"` +} + +type BatchTableRequest_Operation_Update struct { + Update *SelectOrUpdateRequest `protobuf:"bytes,4,opt,name=update,proto3,oneof"` +} + +type BatchTableRequest_Operation_LazyUpdate struct { + LazyUpdate *SelectOrUpdateRequest `protobuf:"bytes,5,opt,name=lazy_update,json=lazyUpdate,proto3,oneof"` +} + +type BatchTableRequest_Operation_View struct { + View *SelectOrUpdateRequest `protobuf:"bytes,6,opt,name=view,proto3,oneof"` +} + +type BatchTableRequest_Operation_UpdateView struct { + UpdateView *SelectOrUpdateRequest `protobuf:"bytes,7,opt,name=update_view,json=updateView,proto3,oneof"` +} + +type BatchTableRequest_Operation_Select struct { + Select *SelectOrUpdateRequest `protobuf:"bytes,8,opt,name=select,proto3,oneof"` +} + +type BatchTableRequest_Operation_SelectDistinct struct { + SelectDistinct *SelectDistinctRequest `protobuf:"bytes,9,opt,name=select_distinct,json=selectDistinct,proto3,oneof"` +} + +type BatchTableRequest_Operation_Filter struct { + Filter *FilterTableRequest `protobuf:"bytes,10,opt,name=filter,proto3,oneof"` +} + +type BatchTableRequest_Operation_UnstructuredFilter struct { + UnstructuredFilter *UnstructuredFilterTableRequest `protobuf:"bytes,11,opt,name=unstructured_filter,json=unstructuredFilter,proto3,oneof"` +} + +type BatchTableRequest_Operation_Sort struct { + Sort *SortTableRequest `protobuf:"bytes,12,opt,name=sort,proto3,oneof"` +} + +type BatchTableRequest_Operation_Head struct { + Head *HeadOrTailRequest `protobuf:"bytes,13,opt,name=head,proto3,oneof"` +} + +type BatchTableRequest_Operation_Tail struct { + Tail *HeadOrTailRequest `protobuf:"bytes,14,opt,name=tail,proto3,oneof"` +} + +type BatchTableRequest_Operation_HeadBy struct { + HeadBy *HeadOrTailByRequest `protobuf:"bytes,15,opt,name=head_by,json=headBy,proto3,oneof"` +} + +type BatchTableRequest_Operation_TailBy struct { + TailBy *HeadOrTailByRequest `protobuf:"bytes,16,opt,name=tail_by,json=tailBy,proto3,oneof"` +} + +type BatchTableRequest_Operation_Ungroup struct { + Ungroup *UngroupRequest `protobuf:"bytes,17,opt,name=ungroup,proto3,oneof"` +} + +type BatchTableRequest_Operation_Merge struct { + Merge *MergeTablesRequest `protobuf:"bytes,18,opt,name=merge,proto3,oneof"` +} + +type BatchTableRequest_Operation_ComboAggregate struct { + ComboAggregate *ComboAggregateRequest `protobuf:"bytes,19,opt,name=combo_aggregate,json=comboAggregate,proto3,oneof"` +} + +type BatchTableRequest_Operation_Snapshot struct { + Snapshot *SnapshotTableRequest `protobuf:"bytes,20,opt,name=snapshot,proto3,oneof"` +} + +type BatchTableRequest_Operation_Flatten struct { + Flatten *FlattenRequest `protobuf:"bytes,21,opt,name=flatten,proto3,oneof"` +} + +type BatchTableRequest_Operation_RunChartDownsample struct { + RunChartDownsample *RunChartDownsampleRequest `protobuf:"bytes,22,opt,name=run_chart_downsample,json=runChartDownsample,proto3,oneof"` +} + +type BatchTableRequest_Operation_CrossJoin struct { + CrossJoin *CrossJoinTablesRequest `protobuf:"bytes,23,opt,name=cross_join,json=crossJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_NaturalJoin struct { + NaturalJoin *NaturalJoinTablesRequest `protobuf:"bytes,24,opt,name=natural_join,json=naturalJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_ExactJoin struct { + ExactJoin *ExactJoinTablesRequest `protobuf:"bytes,25,opt,name=exact_join,json=exactJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_LeftJoin struct { + LeftJoin *LeftJoinTablesRequest `protobuf:"bytes,26,opt,name=left_join,json=leftJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_AsOfJoin struct { + AsOfJoin *AsOfJoinTablesRequest `protobuf:"bytes,27,opt,name=as_of_join,json=asOfJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_FetchTable struct { + FetchTable *FetchTableRequest `protobuf:"bytes,28,opt,name=fetch_table,json=fetchTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_FetchPandasTable struct { + FetchPandasTable *FetchPandasTableRequest `protobuf:"bytes,29,opt,name=fetch_pandas_table,json=fetchPandasTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_ApplyPreviewColumns struct { + ApplyPreviewColumns *ApplyPreviewColumnsRequest `protobuf:"bytes,30,opt,name=apply_preview_columns,json=applyPreviewColumns,proto3,oneof"` +} + +type BatchTableRequest_Operation_CreateInputTable struct { + CreateInputTable *CreateInputTableRequest `protobuf:"bytes,31,opt,name=create_input_table,json=createInputTable,proto3,oneof"` +} + +func (*BatchTableRequest_Operation_EmptyTable) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_TimeTable) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_DropColumns) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Update) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_LazyUpdate) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_View) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_UpdateView) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Select) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_SelectDistinct) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Filter) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_UnstructuredFilter) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Sort) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Head) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Tail) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_HeadBy) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_TailBy) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Ungroup) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Merge) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_ComboAggregate) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Snapshot) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_Flatten) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_RunChartDownsample) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_CrossJoin) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_NaturalJoin) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_ExactJoin) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_LeftJoin) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_AsOfJoin) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_FetchTable) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_FetchPandasTable) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_ApplyPreviewColumns) isBatchTableRequest_Operation_Op() {} + +func (*BatchTableRequest_Operation_CreateInputTable) isBatchTableRequest_Operation_Op() {} + +var File_deephaven_proto_table_proto protoreflect.FileDescriptor + +var file_deephaven_proto_table_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, + 0x01, 0x0a, 0x0e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x43, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x48, 0x00, 0x52, 0x0b, + 0x62, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x05, 0x0a, 0x03, 0x72, + 0x65, 0x66, 0x22, 0x82, 0x02, 0x0a, 0x1d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x12, + 0x16, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, + 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x11, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, + 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x1a, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, + 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0xb1, 0x01, 0x0a, + 0x17, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, + 0x22, 0x1d, 0x0a, 0x1b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0xb2, 0x01, 0x0a, 0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x46, + 0x0a, 0x09, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x65, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x34, + 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0x73, 0x0a, 0x11, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x42, + 0x02, 0x30, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x10, 0x54, 0x69, + 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, + 0x42, 0x02, 0x30, 0x01, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4e, + 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x25, 0x0a, 0x0c, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0b, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x15, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, + 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x73, + 0x22, 0xd2, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, + 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xcf, 0x01, 0x0a, 0x12, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x1e, 0x55, 0x6e, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0xca, 0x01, 0x0a, + 0x11, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x08, 0x6e, 0x75, + 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, + 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x22, 0xff, 0x01, 0x0a, 0x13, 0x48, 0x65, + 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x08, 0x6e, 0x75, 0x6d, + 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x62, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x73, 0x22, 0xf3, 0x01, 0x0a, 0x0e, + 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x66, + 0x69, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x46, + 0x69, 0x6c, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, + 0x6f, 0x5f, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x22, 0xcd, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, + 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x22, 0xcd, 0x02, 0x0a, 0x14, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, + 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, + 0x64, 0x6f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x6f, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x22, 0xed, 0x02, 0x0a, 0x16, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, + 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x69, 0x74, + 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x18, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, + 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, + 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, + 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, + 0x22, 0xca, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, + 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, + 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, 0xc9, 0x02, + 0x0a, 0x15, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, + 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, + 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, 0x91, 0x04, 0x0a, 0x15, 0x41, 0x73, + 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, + 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, + 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, + 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, + 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x6b, 0x0a, 0x10, 0x61, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x61, 0x73, 0x4f, 0x66, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, + 0x6c, 0x65, 0x22, 0x59, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, + 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, + 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, + 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x47, + 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x03, 0x22, 0xeb, 0x05, + 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, + 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x62, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x5f, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x1a, 0xe2, + 0x01, 0x0a, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x40, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, + 0x69, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x67, 0x5f, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x76, 0x67, 0x4d, 0x65, 0x64, + 0x69, 0x61, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x41, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x07, 0x0a, 0x03, 0x53, 0x55, 0x4d, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x42, 0x53, 0x5f, + 0x53, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, + 0x12, 0x07, 0x0a, 0x03, 0x41, 0x56, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x55, + 0x4e, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x05, 0x12, + 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x06, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x49, 0x4e, + 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x58, 0x10, 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x4d, + 0x45, 0x44, 0x49, 0x41, 0x4e, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x45, 0x52, 0x43, 0x45, + 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x10, 0x0a, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x54, 0x44, 0x10, 0x0b, + 0x12, 0x07, 0x0a, 0x03, 0x56, 0x41, 0x52, 0x10, 0x0c, 0x12, 0x10, 0x0a, 0x0c, 0x57, 0x45, 0x49, + 0x47, 0x48, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x56, 0x47, 0x10, 0x0d, 0x22, 0x84, 0x02, 0x0a, 0x0e, + 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, + 0x12, 0x5d, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x51, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x17, 0x0a, + 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, 0x45, + 0x10, 0x02, 0x22, 0xf3, 0x01, 0x0a, 0x10, 0x53, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, + 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x47, 0x0a, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x52, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x12, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, + 0x2c, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xd0, 0x01, + 0x0a, 0x07, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, + 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x09, + 0x6c, 0x6f, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x6e, 0x61, 0x6e, + 0x6f, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x6e, 0x61, 0x6e, 0x6f, 0x54, 0x69, + 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0xa5, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6c, 0x69, 0x74, 0x65, + 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, + 0x74, 0x65, 0x72, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, + 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x82, 0x06, 0x0a, 0x09, 0x43, 0x6f, 0x6e, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x03, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x02, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x72, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x6f, 0x72, 0x12, 0x43, 0x0a, + 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, + 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x6e, + 0x6f, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, + 0x6f, 0x6b, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, + 0x6c, 0x6c, 0x12, 0x4f, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x56, 0x0a, + 0x0c, 0x41, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, + 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0b, 0x4f, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x54, 0x0a, 0x0c, + 0x4e, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x22, 0xd2, 0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x62, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x44, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x10, 0x63, + 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, + 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x03, 0x6c, 0x68, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x03, 0x6c, 0x68, 0x73, 0x12, 0x3a, 0x0a, 0x03, 0x72, 0x68, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x72, + 0x68, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, + 0x54, 0x48, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, + 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x10, + 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, + 0x12, 0x19, 0x0a, 0x15, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, + 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x45, + 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x54, 0x5f, 0x45, + 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x05, 0x22, 0xc5, 0x02, 0x0a, 0x0b, 0x49, 0x6e, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x61, 0x6e, + 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, + 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, + 0xb3, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x40, 0x0a, 0x06, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x46, 0x0a, + 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x5d, 0x0a, 0x0f, 0x49, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x12, 0x5d, 0x0a, 0x10, 0x63, + 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, + 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb0, 0x02, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, + 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5d, + 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, + 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, + 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, + 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, + 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x13, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x12, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x0e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, + 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x97, 0x04, + 0x0a, 0x19, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x7a, 0x6f, 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6e, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x5a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x78, + 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x78, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x24, 0x0a, 0x0e, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x8f, 0x01, 0x0a, 0x09, 0x5a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x48, + 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x48, 0x01, + 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x88, 0x01, + 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0xd1, 0x05, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x5b, 0x0a, 0x0f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x12, 0x5d, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x1a, 0x89, 0x03, 0x0a, 0x0e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x91, 0x01, 0x0a, 0x15, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x2e, + 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, + 0x6c, 0x79, 0x48, 0x00, 0x52, 0x12, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x8e, 0x01, 0x0a, 0x14, 0x69, 0x6e, 0x5f, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, + 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x64, 0x48, 0x00, 0x52, 0x11, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x1a, 0x14, 0x0a, 0x12, 0x49, 0x6e, 0x4d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x1a, + 0x34, 0x0a, 0x11, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x42, 0x0c, 0x0a, + 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf9, 0x16, 0x0a, 0x11, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x50, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, + 0x6f, 0x70, 0x73, 0x1a, 0x91, 0x16, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x74, 0x69, + 0x6d, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x5a, 0x0a, 0x0c, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x52, 0x0a, 0x06, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x5b, 0x0a, 0x0b, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0a, 0x6c, 0x61, 0x7a, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4e, 0x0a, + 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x5b, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x12, 0x52, 0x0a, 0x06, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x63, + 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, + 0x6e, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x74, 0x0a, 0x13, 0x75, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x75, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x68, 0x65, 0x61, + 0x64, 0x12, 0x4a, 0x0a, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x51, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x42, 0x79, + 0x12, 0x51, 0x0a, 0x07, 0x74, 0x61, 0x69, 0x6c, 0x5f, 0x62, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, + 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x74, 0x61, 0x69, + 0x6c, 0x42, 0x79, 0x12, 0x4d, 0x0a, 0x07, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x75, 0x6e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x65, 0x72, 0x67, + 0x65, 0x12, 0x63, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x4d, 0x0a, + 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x70, 0x0a, 0x14, + 0x72, 0x75, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, + 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x72, 0x75, 0x6e, 0x43, + 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x5a, + 0x0a, 0x0a, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x09, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x60, 0x0a, 0x0c, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x61, 0x6c, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x0b, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x5a, 0x0a, 0x0a, + 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x65, + 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x09, 0x6c, 0x65, 0x66, 0x74, + 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, + 0x6e, 0x12, 0x58, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, + 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x08, 0x61, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x66, + 0x65, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, + 0x6e, 0x64, 0x61, 0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x73, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, + 0x77, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x6a, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x2a, 0x32, 0x0a, 0x0f, 0x43, 0x61, 0x73, 0x65, 0x53, + 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, + 0x54, 0x43, 0x48, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x47, + 0x4e, 0x4f, 0x52, 0x45, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x09, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, + 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x56, 0x45, 0x52, 0x54, 0x45, + 0x44, 0x10, 0x01, 0x32, 0xce, 0x25, 0x0a, 0x0c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, + 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x98, 0x01, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3d, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x09, 0x54, + 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, + 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x4c, 0x61, 0x7a, 0x79, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, + 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, 0x12, 0x38, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x8e, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, + 0x63, 0x74, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, + 0x74, 0x69, 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x83, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9b, 0x01, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x41, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x33, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x34, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x61, 0x69, + 0x6c, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x06, + 0x48, 0x65, 0x61, 0x64, 0x42, 0x79, 0x12, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, + 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x12, 0x36, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x07, 0x55, 0x6e, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, + 0x0b, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x90, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x6f, 0x73, + 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x4e, + 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x12, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x90, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, + 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, + 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x66, 0x74, + 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, + 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, + 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x87, 0x01, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x12, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x80, 0x01, 0x0a, 0x07, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x31, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, + 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x34, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x00, 0x30, 0x01, 0x42, 0x41, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_table_proto_rawDescOnce sync.Once + file_deephaven_proto_table_proto_rawDescData = file_deephaven_proto_table_proto_rawDesc +) + +func file_deephaven_proto_table_proto_rawDescGZIP() []byte { + file_deephaven_proto_table_proto_rawDescOnce.Do(func() { + file_deephaven_proto_table_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_table_proto_rawDescData) + }) + return file_deephaven_proto_table_proto_rawDescData +} + +var file_deephaven_proto_table_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_deephaven_proto_table_proto_msgTypes = make([]protoimpl.MessageInfo, 51) +var file_deephaven_proto_table_proto_goTypes = []interface{}{ + (CaseSensitivity)(0), // 0: io.deephaven.proto.backplane.grpc.CaseSensitivity + (MatchType)(0), // 1: io.deephaven.proto.backplane.grpc.MatchType + (AsOfJoinTablesRequest_MatchRule)(0), // 2: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule + (ComboAggregateRequest_AggType)(0), // 3: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType + (SortDescriptor_SortDirection)(0), // 4: io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection + (CompareCondition_CompareOperation)(0), // 5: io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation + (*TableReference)(nil), // 6: io.deephaven.proto.backplane.grpc.TableReference + (*ExportedTableCreationResponse)(nil), // 7: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + (*FetchTableRequest)(nil), // 8: io.deephaven.proto.backplane.grpc.FetchTableRequest + (*ApplyPreviewColumnsRequest)(nil), // 9: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + (*FetchPandasTableRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + (*ExportedTableUpdatesRequest)(nil), // 11: io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest + (*ExportedTableUpdateMessage)(nil), // 12: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage + (*EmptyTableRequest)(nil), // 13: io.deephaven.proto.backplane.grpc.EmptyTableRequest + (*TimeTableRequest)(nil), // 14: io.deephaven.proto.backplane.grpc.TimeTableRequest + (*SelectOrUpdateRequest)(nil), // 15: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + (*SelectDistinctRequest)(nil), // 16: io.deephaven.proto.backplane.grpc.SelectDistinctRequest + (*DropColumnsRequest)(nil), // 17: io.deephaven.proto.backplane.grpc.DropColumnsRequest + (*UnstructuredFilterTableRequest)(nil), // 18: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + (*HeadOrTailRequest)(nil), // 19: io.deephaven.proto.backplane.grpc.HeadOrTailRequest + (*HeadOrTailByRequest)(nil), // 20: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + (*UngroupRequest)(nil), // 21: io.deephaven.proto.backplane.grpc.UngroupRequest + (*MergeTablesRequest)(nil), // 22: io.deephaven.proto.backplane.grpc.MergeTablesRequest + (*SnapshotTableRequest)(nil), // 23: io.deephaven.proto.backplane.grpc.SnapshotTableRequest + (*CrossJoinTablesRequest)(nil), // 24: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + (*NaturalJoinTablesRequest)(nil), // 25: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + (*ExactJoinTablesRequest)(nil), // 26: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + (*LeftJoinTablesRequest)(nil), // 27: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + (*AsOfJoinTablesRequest)(nil), // 28: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + (*ComboAggregateRequest)(nil), // 29: io.deephaven.proto.backplane.grpc.ComboAggregateRequest + (*SortDescriptor)(nil), // 30: io.deephaven.proto.backplane.grpc.SortDescriptor + (*SortTableRequest)(nil), // 31: io.deephaven.proto.backplane.grpc.SortTableRequest + (*FilterTableRequest)(nil), // 32: io.deephaven.proto.backplane.grpc.FilterTableRequest + (*Reference)(nil), // 33: io.deephaven.proto.backplane.grpc.Reference + (*Literal)(nil), // 34: io.deephaven.proto.backplane.grpc.Literal + (*Value)(nil), // 35: io.deephaven.proto.backplane.grpc.Value + (*Condition)(nil), // 36: io.deephaven.proto.backplane.grpc.Condition + (*AndCondition)(nil), // 37: io.deephaven.proto.backplane.grpc.AndCondition + (*OrCondition)(nil), // 38: io.deephaven.proto.backplane.grpc.OrCondition + (*NotCondition)(nil), // 39: io.deephaven.proto.backplane.grpc.NotCondition + (*CompareCondition)(nil), // 40: io.deephaven.proto.backplane.grpc.CompareCondition + (*InCondition)(nil), // 41: io.deephaven.proto.backplane.grpc.InCondition + (*InvokeCondition)(nil), // 42: io.deephaven.proto.backplane.grpc.InvokeCondition + (*IsNullCondition)(nil), // 43: io.deephaven.proto.backplane.grpc.IsNullCondition + (*MatchesCondition)(nil), // 44: io.deephaven.proto.backplane.grpc.MatchesCondition + (*ContainsCondition)(nil), // 45: io.deephaven.proto.backplane.grpc.ContainsCondition + (*SearchCondition)(nil), // 46: io.deephaven.proto.backplane.grpc.SearchCondition + (*FlattenRequest)(nil), // 47: io.deephaven.proto.backplane.grpc.FlattenRequest + (*RunChartDownsampleRequest)(nil), // 48: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + (*CreateInputTableRequest)(nil), // 49: io.deephaven.proto.backplane.grpc.CreateInputTableRequest + (*BatchTableRequest)(nil), // 50: io.deephaven.proto.backplane.grpc.BatchTableRequest + (*ComboAggregateRequest_Aggregate)(nil), // 51: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate + (*RunChartDownsampleRequest_ZoomRange)(nil), // 52: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange + (*CreateInputTableRequest_InputTableKind)(nil), // 53: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind + (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly)(nil), // 54: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly + (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked)(nil), // 55: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked + (*BatchTableRequest_Operation)(nil), // 56: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation + (*ticket.Ticket)(nil), // 57: io.deephaven.proto.backplane.grpc.Ticket +} +var file_deephaven_proto_table_proto_depIdxs = []int32{ + 57, // 0: io.deephaven.proto.backplane.grpc.TableReference.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 1: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 2: io.deephaven.proto.backplane.grpc.FetchTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 3: io.deephaven.proto.backplane.grpc.FetchTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 4: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 5: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 6: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 7: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 57, // 8: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.export_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 57, // 9: io.deephaven.proto.backplane.grpc.EmptyTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 57, // 10: io.deephaven.proto.backplane.grpc.TimeTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 57, // 11: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 12: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 13: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 14: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 15: io.deephaven.proto.backplane.grpc.DropColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 16: io.deephaven.proto.backplane.grpc.DropColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 17: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 18: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 19: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 20: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 21: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 22: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 23: io.deephaven.proto.backplane.grpc.UngroupRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 24: io.deephaven.proto.backplane.grpc.UngroupRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 25: io.deephaven.proto.backplane.grpc.MergeTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 26: io.deephaven.proto.backplane.grpc.MergeTablesRequest.source_ids:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 27: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 28: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 29: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 30: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 31: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 32: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 33: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 34: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 35: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 36: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 37: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 38: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 39: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 40: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 41: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 42: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 43: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 6, // 44: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 2, // 45: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.as_of_match_rule:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule + 57, // 46: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 47: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 51, // 48: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.aggregates:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate + 4, // 49: io.deephaven.proto.backplane.grpc.SortDescriptor.direction:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection + 57, // 50: io.deephaven.proto.backplane.grpc.SortTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 51: io.deephaven.proto.backplane.grpc.SortTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 30, // 52: io.deephaven.proto.backplane.grpc.SortTableRequest.sorts:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor + 57, // 53: io.deephaven.proto.backplane.grpc.FilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 54: io.deephaven.proto.backplane.grpc.FilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 36, // 55: io.deephaven.proto.backplane.grpc.FilterTableRequest.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 33, // 56: io.deephaven.proto.backplane.grpc.Value.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 34, // 57: io.deephaven.proto.backplane.grpc.Value.literal:type_name -> io.deephaven.proto.backplane.grpc.Literal + 37, // 58: io.deephaven.proto.backplane.grpc.Condition.and:type_name -> io.deephaven.proto.backplane.grpc.AndCondition + 38, // 59: io.deephaven.proto.backplane.grpc.Condition.or:type_name -> io.deephaven.proto.backplane.grpc.OrCondition + 39, // 60: io.deephaven.proto.backplane.grpc.Condition.not:type_name -> io.deephaven.proto.backplane.grpc.NotCondition + 40, // 61: io.deephaven.proto.backplane.grpc.Condition.compare:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition + 41, // 62: io.deephaven.proto.backplane.grpc.Condition.in:type_name -> io.deephaven.proto.backplane.grpc.InCondition + 42, // 63: io.deephaven.proto.backplane.grpc.Condition.invoke:type_name -> io.deephaven.proto.backplane.grpc.InvokeCondition + 43, // 64: io.deephaven.proto.backplane.grpc.Condition.is_null:type_name -> io.deephaven.proto.backplane.grpc.IsNullCondition + 44, // 65: io.deephaven.proto.backplane.grpc.Condition.matches:type_name -> io.deephaven.proto.backplane.grpc.MatchesCondition + 45, // 66: io.deephaven.proto.backplane.grpc.Condition.contains:type_name -> io.deephaven.proto.backplane.grpc.ContainsCondition + 46, // 67: io.deephaven.proto.backplane.grpc.Condition.search:type_name -> io.deephaven.proto.backplane.grpc.SearchCondition + 36, // 68: io.deephaven.proto.backplane.grpc.AndCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 36, // 69: io.deephaven.proto.backplane.grpc.OrCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 36, // 70: io.deephaven.proto.backplane.grpc.NotCondition.filter:type_name -> io.deephaven.proto.backplane.grpc.Condition + 5, // 71: io.deephaven.proto.backplane.grpc.CompareCondition.operation:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation + 0, // 72: io.deephaven.proto.backplane.grpc.CompareCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 35, // 73: io.deephaven.proto.backplane.grpc.CompareCondition.lhs:type_name -> io.deephaven.proto.backplane.grpc.Value + 35, // 74: io.deephaven.proto.backplane.grpc.CompareCondition.rhs:type_name -> io.deephaven.proto.backplane.grpc.Value + 35, // 75: io.deephaven.proto.backplane.grpc.InCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value + 35, // 76: io.deephaven.proto.backplane.grpc.InCondition.candidates:type_name -> io.deephaven.proto.backplane.grpc.Value + 0, // 77: io.deephaven.proto.backplane.grpc.InCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 1, // 78: io.deephaven.proto.backplane.grpc.InCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 35, // 79: io.deephaven.proto.backplane.grpc.InvokeCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value + 35, // 80: io.deephaven.proto.backplane.grpc.InvokeCondition.arguments:type_name -> io.deephaven.proto.backplane.grpc.Value + 33, // 81: io.deephaven.proto.backplane.grpc.IsNullCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 33, // 82: io.deephaven.proto.backplane.grpc.MatchesCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 0, // 83: io.deephaven.proto.backplane.grpc.MatchesCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 1, // 84: io.deephaven.proto.backplane.grpc.MatchesCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 33, // 85: io.deephaven.proto.backplane.grpc.ContainsCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 0, // 86: io.deephaven.proto.backplane.grpc.ContainsCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 1, // 87: io.deephaven.proto.backplane.grpc.ContainsCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 33, // 88: io.deephaven.proto.backplane.grpc.SearchCondition.optional_references:type_name -> io.deephaven.proto.backplane.grpc.Reference + 57, // 89: io.deephaven.proto.backplane.grpc.FlattenRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 90: io.deephaven.proto.backplane.grpc.FlattenRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 57, // 91: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 92: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 52, // 93: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.zoom_range:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange + 57, // 94: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 6, // 95: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.source_table_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 53, // 96: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.kind:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind + 56, // 97: io.deephaven.proto.backplane.grpc.BatchTableRequest.ops:type_name -> io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation + 3, // 98: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.type:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType + 54, // 99: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_append_only:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly + 55, // 100: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_key_backed:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked + 13, // 101: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.empty_table:type_name -> io.deephaven.proto.backplane.grpc.EmptyTableRequest + 14, // 102: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.time_table:type_name -> io.deephaven.proto.backplane.grpc.TimeTableRequest + 17, // 103: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.drop_columns:type_name -> io.deephaven.proto.backplane.grpc.DropColumnsRequest + 15, // 104: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 105: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.lazy_update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 106: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 107: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 108: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 16, // 109: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select_distinct:type_name -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest + 32, // 110: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.filter:type_name -> io.deephaven.proto.backplane.grpc.FilterTableRequest + 18, // 111: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.unstructured_filter:type_name -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + 31, // 112: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.sort:type_name -> io.deephaven.proto.backplane.grpc.SortTableRequest + 19, // 113: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 19, // 114: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 20, // 115: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 20, // 116: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 21, // 117: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.ungroup:type_name -> io.deephaven.proto.backplane.grpc.UngroupRequest + 22, // 118: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.merge:type_name -> io.deephaven.proto.backplane.grpc.MergeTablesRequest + 29, // 119: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.combo_aggregate:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest + 23, // 120: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.snapshot:type_name -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest + 47, // 121: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.flatten:type_name -> io.deephaven.proto.backplane.grpc.FlattenRequest + 48, // 122: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.run_chart_downsample:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + 24, // 123: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.cross_join:type_name -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + 25, // 124: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.natural_join:type_name -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + 26, // 125: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.exact_join:type_name -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + 27, // 126: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.left_join:type_name -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + 28, // 127: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.as_of_join:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + 8, // 128: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_table:type_name -> io.deephaven.proto.backplane.grpc.FetchTableRequest + 10, // 129: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_pandas_table:type_name -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + 9, // 130: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.apply_preview_columns:type_name -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + 49, // 131: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.create_input_table:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest + 57, // 132: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:input_type -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 133: io.deephaven.proto.backplane.grpc.TableService.FetchTable:input_type -> io.deephaven.proto.backplane.grpc.FetchTableRequest + 10, // 134: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:input_type -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + 9, // 135: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:input_type -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + 13, // 136: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:input_type -> io.deephaven.proto.backplane.grpc.EmptyTableRequest + 14, // 137: io.deephaven.proto.backplane.grpc.TableService.TimeTable:input_type -> io.deephaven.proto.backplane.grpc.TimeTableRequest + 17, // 138: io.deephaven.proto.backplane.grpc.TableService.DropColumns:input_type -> io.deephaven.proto.backplane.grpc.DropColumnsRequest + 15, // 139: io.deephaven.proto.backplane.grpc.TableService.Update:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 140: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 141: io.deephaven.proto.backplane.grpc.TableService.View:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 142: io.deephaven.proto.backplane.grpc.TableService.UpdateView:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 15, // 143: io.deephaven.proto.backplane.grpc.TableService.Select:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 16, // 144: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:input_type -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest + 32, // 145: io.deephaven.proto.backplane.grpc.TableService.Filter:input_type -> io.deephaven.proto.backplane.grpc.FilterTableRequest + 18, // 146: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:input_type -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + 31, // 147: io.deephaven.proto.backplane.grpc.TableService.Sort:input_type -> io.deephaven.proto.backplane.grpc.SortTableRequest + 19, // 148: io.deephaven.proto.backplane.grpc.TableService.Head:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 19, // 149: io.deephaven.proto.backplane.grpc.TableService.Tail:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 20, // 150: io.deephaven.proto.backplane.grpc.TableService.HeadBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 20, // 151: io.deephaven.proto.backplane.grpc.TableService.TailBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 21, // 152: io.deephaven.proto.backplane.grpc.TableService.Ungroup:input_type -> io.deephaven.proto.backplane.grpc.UngroupRequest + 22, // 153: io.deephaven.proto.backplane.grpc.TableService.MergeTables:input_type -> io.deephaven.proto.backplane.grpc.MergeTablesRequest + 24, // 154: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:input_type -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + 25, // 155: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:input_type -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + 26, // 156: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:input_type -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + 27, // 157: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:input_type -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + 28, // 158: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:input_type -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + 29, // 159: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:input_type -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest + 23, // 160: io.deephaven.proto.backplane.grpc.TableService.Snapshot:input_type -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest + 47, // 161: io.deephaven.proto.backplane.grpc.TableService.Flatten:input_type -> io.deephaven.proto.backplane.grpc.FlattenRequest + 48, // 162: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:input_type -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + 49, // 163: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:input_type -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest + 50, // 164: io.deephaven.proto.backplane.grpc.TableService.Batch:input_type -> io.deephaven.proto.backplane.grpc.BatchTableRequest + 11, // 165: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:input_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest + 7, // 166: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 167: io.deephaven.proto.backplane.grpc.TableService.FetchTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 168: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 169: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 170: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 171: io.deephaven.proto.backplane.grpc.TableService.TimeTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 172: io.deephaven.proto.backplane.grpc.TableService.DropColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 173: io.deephaven.proto.backplane.grpc.TableService.Update:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 174: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 175: io.deephaven.proto.backplane.grpc.TableService.View:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 176: io.deephaven.proto.backplane.grpc.TableService.UpdateView:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 177: io.deephaven.proto.backplane.grpc.TableService.Select:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 178: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 179: io.deephaven.proto.backplane.grpc.TableService.Filter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 180: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 181: io.deephaven.proto.backplane.grpc.TableService.Sort:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 182: io.deephaven.proto.backplane.grpc.TableService.Head:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 183: io.deephaven.proto.backplane.grpc.TableService.Tail:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 184: io.deephaven.proto.backplane.grpc.TableService.HeadBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 185: io.deephaven.proto.backplane.grpc.TableService.TailBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 186: io.deephaven.proto.backplane.grpc.TableService.Ungroup:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 187: io.deephaven.proto.backplane.grpc.TableService.MergeTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 188: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 189: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 190: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 191: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 192: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 193: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 194: io.deephaven.proto.backplane.grpc.TableService.Snapshot:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 195: io.deephaven.proto.backplane.grpc.TableService.Flatten:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 196: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 197: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 7, // 198: io.deephaven.proto.backplane.grpc.TableService.Batch:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 12, // 199: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage + 166, // [166:200] is the sub-list for method output_type + 132, // [132:166] is the sub-list for method input_type + 132, // [132:132] is the sub-list for extension type_name + 132, // [132:132] is the sub-list for extension extendee + 0, // [0:132] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_table_proto_init() } +func file_deephaven_proto_table_proto_init() { + if File_deephaven_proto_table_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_table_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportedTableCreationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyPreviewColumnsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchPandasTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportedTableUpdatesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportedTableUpdateMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectOrUpdateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectDistinctRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DropColumnsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnstructuredFilterTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadOrTailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadOrTailByRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UngroupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MergeTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapshotTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CrossJoinTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NaturalJoinTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExactJoinTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LeftJoinTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AsOfJoinTablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComboAggregateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SortDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SortTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilterTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Literal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Condition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AndCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompareCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvokeCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsNullCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MatchesCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainsCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FlattenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunChartDownsampleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchTableRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComboAggregateRequest_Aggregate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunChartDownsampleRequest_ZoomRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchTableRequest_Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_deephaven_proto_table_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*TableReference_Ticket)(nil), + (*TableReference_BatchOffset)(nil), + } + file_deephaven_proto_table_proto_msgTypes[28].OneofWrappers = []interface{}{ + (*Literal_StringValue)(nil), + (*Literal_DoubleValue)(nil), + (*Literal_BoolValue)(nil), + (*Literal_LongValue)(nil), + (*Literal_NanoTimeValue)(nil), + } + file_deephaven_proto_table_proto_msgTypes[29].OneofWrappers = []interface{}{ + (*Value_Reference)(nil), + (*Value_Literal)(nil), + } + file_deephaven_proto_table_proto_msgTypes[30].OneofWrappers = []interface{}{ + (*Condition_And)(nil), + (*Condition_Or)(nil), + (*Condition_Not)(nil), + (*Condition_Compare)(nil), + (*Condition_In)(nil), + (*Condition_Invoke)(nil), + (*Condition_IsNull)(nil), + (*Condition_Matches)(nil), + (*Condition_Contains)(nil), + (*Condition_Search)(nil), + } + file_deephaven_proto_table_proto_msgTypes[43].OneofWrappers = []interface{}{ + (*CreateInputTableRequest_SourceTableId)(nil), + (*CreateInputTableRequest_Schema)(nil), + } + file_deephaven_proto_table_proto_msgTypes[46].OneofWrappers = []interface{}{} + file_deephaven_proto_table_proto_msgTypes[47].OneofWrappers = []interface{}{ + (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_)(nil), + (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_)(nil), + } + file_deephaven_proto_table_proto_msgTypes[50].OneofWrappers = []interface{}{ + (*BatchTableRequest_Operation_EmptyTable)(nil), + (*BatchTableRequest_Operation_TimeTable)(nil), + (*BatchTableRequest_Operation_DropColumns)(nil), + (*BatchTableRequest_Operation_Update)(nil), + (*BatchTableRequest_Operation_LazyUpdate)(nil), + (*BatchTableRequest_Operation_View)(nil), + (*BatchTableRequest_Operation_UpdateView)(nil), + (*BatchTableRequest_Operation_Select)(nil), + (*BatchTableRequest_Operation_SelectDistinct)(nil), + (*BatchTableRequest_Operation_Filter)(nil), + (*BatchTableRequest_Operation_UnstructuredFilter)(nil), + (*BatchTableRequest_Operation_Sort)(nil), + (*BatchTableRequest_Operation_Head)(nil), + (*BatchTableRequest_Operation_Tail)(nil), + (*BatchTableRequest_Operation_HeadBy)(nil), + (*BatchTableRequest_Operation_TailBy)(nil), + (*BatchTableRequest_Operation_Ungroup)(nil), + (*BatchTableRequest_Operation_Merge)(nil), + (*BatchTableRequest_Operation_ComboAggregate)(nil), + (*BatchTableRequest_Operation_Snapshot)(nil), + (*BatchTableRequest_Operation_Flatten)(nil), + (*BatchTableRequest_Operation_RunChartDownsample)(nil), + (*BatchTableRequest_Operation_CrossJoin)(nil), + (*BatchTableRequest_Operation_NaturalJoin)(nil), + (*BatchTableRequest_Operation_ExactJoin)(nil), + (*BatchTableRequest_Operation_LeftJoin)(nil), + (*BatchTableRequest_Operation_AsOfJoin)(nil), + (*BatchTableRequest_Operation_FetchTable)(nil), + (*BatchTableRequest_Operation_FetchPandasTable)(nil), + (*BatchTableRequest_Operation_ApplyPreviewColumns)(nil), + (*BatchTableRequest_Operation_CreateInputTable)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_table_proto_rawDesc, + NumEnums: 6, + NumMessages: 51, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_table_proto_goTypes, + DependencyIndexes: file_deephaven_proto_table_proto_depIdxs, + EnumInfos: file_deephaven_proto_table_proto_enumTypes, + MessageInfos: file_deephaven_proto_table_proto_msgTypes, + }.Build() + File_deephaven_proto_table_proto = out.File + file_deephaven_proto_table_proto_rawDesc = nil + file_deephaven_proto_table_proto_goTypes = nil + file_deephaven_proto_table_proto_depIdxs = nil +} diff --git a/go/internal/proto/table/table_grpc.pb.go b/go/internal/proto/table/table_grpc.pb.go new file mode 100644 index 00000000000..d5eb9525eb2 --- /dev/null +++ b/go/internal/proto/table/table_grpc.pb.go @@ -0,0 +1,1511 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/table.proto + +package table + +import ( + context "context" + ticket "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// TableServiceClient is the client API for TableService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TableServiceClient interface { + // + // Request an ETCR for this ticket. Ticket must reference a Table. + GetExportedTableCreationResponse(ctx context.Context, in *ticket.Ticket, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Fetches a Table from an existing source ticket and exports it to the local session result ticket. + FetchTable(ctx context.Context, in *FetchTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. + FetchPandasTable(ctx context.Context, in *FetchPandasTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Create a table that has preview columns applied to an existing source table. + ApplyPreviewColumns(ctx context.Context, in *ApplyPreviewColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Create an empty table with the given column names and types. + EmptyTable(ctx context.Context, in *EmptyTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Create a time table with the given start time and period. + TimeTable(ctx context.Context, in *TimeTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Drop columns from the parent table. + DropColumns(ctx context.Context, in *DropColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the update table operation. + Update(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the lazyUpdate table operation. + LazyUpdate(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the view table operation. + View(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the updateView table operation. + UpdateView(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Select the given columns from the given table. + Select(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns a new table definition with the unique tuples of the specified columns + SelectDistinct(ctx context.Context, in *SelectDistinctRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Filter parent table with structured filters. + Filter(ctx context.Context, in *FilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Filter parent table with unstructured filters. + UnstructuredFilter(ctx context.Context, in *UnstructuredFilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Sort parent table via the provide sort descriptors. + Sort(ctx context.Context, in *SortTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Extract rows from the head of the parent table. + Head(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Extract rows from the tail of the parent table. + Tail(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Run the headBy table operation for the given group by columns on the given table. + HeadBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Run the tailBy operation for the given group by columns on the given table. + TailBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Ungroup the given columns (all columns will be ungrouped if columnsToUngroup is empty or unspecified). + Ungroup(ctx context.Context, in *UngroupRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Create a merged table from the given input tables. If a key column is provided (not null), a sorted + // merged will be performed using that column. + MergeTables(ctx context.Context, in *MergeTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of a cross join operation. Also known as the cartesian product. + CrossJoinTables(ctx context.Context, in *CrossJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of a natural join operation. + NaturalJoinTables(ctx context.Context, in *NaturalJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of an exact join operation. + ExactJoinTables(ctx context.Context, in *ExactJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of a left join operation. + LeftJoinTables(ctx context.Context, in *LeftJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of an as of join operation. + AsOfJoinTables(ctx context.Context, in *AsOfJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns the result of an aggregate table operation. + ComboAggregate(ctx context.Context, in *ComboAggregateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Snapshot rightId, triggered by leftId, and export the resulting new Table. + // The left table's change events cause a new snapshot to be taken. The result table includes a + // "snapshot key" which is a subset (possibly all) of the left table's columns. The + // remaining columns in the result table come from right table, the table being snapshotted. + Snapshot(ctx context.Context, in *SnapshotTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Returns a new table with a flattened row set. + Flatten(ctx context.Context, in *FlattenRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + //* + // Downsamples a table assume its contents will be rendered in a run chart, with each subsequent row holding a later + // X value (i.e., sorted on that column). Multiple Y columns can be specified, as can a range of values for the X + // column to support zooming in. + RunChartDownsample(ctx context.Context, in *RunChartDownsampleRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + //* + // Creates a new Table based on the provided configuration. This can be used as a regular table from the other methods + // in this interface, or can be interacted with via the InputTableService to modify its contents. + CreateInputTable(ctx context.Context, in *CreateInputTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // + // Batch a series of requests and send them all at once. This enables the user to create intermediate tables without + // requiring them to be exported and managed by the client. The server will automatically release any tables when they + // are no longer depended upon. + Batch(ctx context.Context, in *BatchTableRequest, opts ...grpc.CallOption) (TableService_BatchClient, error) + // + // Establish a stream of table updates for cheap notifications of table size updates. + // + // New streams will flush updates for all existing table exports. An export id of zero will be sent to indicate all + // exports have sent their refresh update. Table updates may be intermingled with initial refresh updates after their + // initial update had been sent. + ExportedTableUpdates(ctx context.Context, in *ExportedTableUpdatesRequest, opts ...grpc.CallOption) (TableService_ExportedTableUpdatesClient, error) +} + +type tableServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTableServiceClient(cc grpc.ClientConnInterface) TableServiceClient { + return &tableServiceClient{cc} +} + +func (c *tableServiceClient) GetExportedTableCreationResponse(ctx context.Context, in *ticket.Ticket, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/GetExportedTableCreationResponse", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) FetchTable(ctx context.Context, in *FetchTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/FetchTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) FetchPandasTable(ctx context.Context, in *FetchPandasTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/FetchPandasTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) ApplyPreviewColumns(ctx context.Context, in *ApplyPreviewColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/ApplyPreviewColumns", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) EmptyTable(ctx context.Context, in *EmptyTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/EmptyTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) TimeTable(ctx context.Context, in *TimeTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/TimeTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) DropColumns(ctx context.Context, in *DropColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/DropColumns", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Update(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Update", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) LazyUpdate(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/LazyUpdate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) View(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/View", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) UpdateView(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/UpdateView", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Select(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Select", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) SelectDistinct(ctx context.Context, in *SelectDistinctRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/SelectDistinct", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Filter(ctx context.Context, in *FilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Filter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) UnstructuredFilter(ctx context.Context, in *UnstructuredFilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/UnstructuredFilter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Sort(ctx context.Context, in *SortTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Sort", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Head(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Head", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Tail(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Tail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) HeadBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/HeadBy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) TailBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/TailBy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Ungroup(ctx context.Context, in *UngroupRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Ungroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) MergeTables(ctx context.Context, in *MergeTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/MergeTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) CrossJoinTables(ctx context.Context, in *CrossJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/CrossJoinTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) NaturalJoinTables(ctx context.Context, in *NaturalJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/NaturalJoinTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) ExactJoinTables(ctx context.Context, in *ExactJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/ExactJoinTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) LeftJoinTables(ctx context.Context, in *LeftJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/LeftJoinTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) AsOfJoinTables(ctx context.Context, in *AsOfJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/AsOfJoinTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) ComboAggregate(ctx context.Context, in *ComboAggregateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/ComboAggregate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Snapshot(ctx context.Context, in *SnapshotTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Snapshot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Flatten(ctx context.Context, in *FlattenRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/Flatten", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) RunChartDownsample(ctx context.Context, in *RunChartDownsampleRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/RunChartDownsample", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) CreateInputTable(ctx context.Context, in *CreateInputTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/CreateInputTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tableServiceClient) Batch(ctx context.Context, in *BatchTableRequest, opts ...grpc.CallOption) (TableService_BatchClient, error) { + stream, err := c.cc.NewStream(ctx, &TableService_ServiceDesc.Streams[0], "/io.deephaven.proto.backplane.grpc.TableService/Batch", opts...) + if err != nil { + return nil, err + } + x := &tableServiceBatchClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type TableService_BatchClient interface { + Recv() (*ExportedTableCreationResponse, error) + grpc.ClientStream +} + +type tableServiceBatchClient struct { + grpc.ClientStream +} + +func (x *tableServiceBatchClient) Recv() (*ExportedTableCreationResponse, error) { + m := new(ExportedTableCreationResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *tableServiceClient) ExportedTableUpdates(ctx context.Context, in *ExportedTableUpdatesRequest, opts ...grpc.CallOption) (TableService_ExportedTableUpdatesClient, error) { + stream, err := c.cc.NewStream(ctx, &TableService_ServiceDesc.Streams[1], "/io.deephaven.proto.backplane.grpc.TableService/ExportedTableUpdates", opts...) + if err != nil { + return nil, err + } + x := &tableServiceExportedTableUpdatesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type TableService_ExportedTableUpdatesClient interface { + Recv() (*ExportedTableUpdateMessage, error) + grpc.ClientStream +} + +type tableServiceExportedTableUpdatesClient struct { + grpc.ClientStream +} + +func (x *tableServiceExportedTableUpdatesClient) Recv() (*ExportedTableUpdateMessage, error) { + m := new(ExportedTableUpdateMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// TableServiceServer is the server API for TableService service. +// All implementations must embed UnimplementedTableServiceServer +// for forward compatibility +type TableServiceServer interface { + // + // Request an ETCR for this ticket. Ticket must reference a Table. + GetExportedTableCreationResponse(context.Context, *ticket.Ticket) (*ExportedTableCreationResponse, error) + // + // Fetches a Table from an existing source ticket and exports it to the local session result ticket. + FetchTable(context.Context, *FetchTableRequest) (*ExportedTableCreationResponse, error) + // + // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. + FetchPandasTable(context.Context, *FetchPandasTableRequest) (*ExportedTableCreationResponse, error) + // + // Create a table that has preview columns applied to an existing source table. + ApplyPreviewColumns(context.Context, *ApplyPreviewColumnsRequest) (*ExportedTableCreationResponse, error) + // + // Create an empty table with the given column names and types. + EmptyTable(context.Context, *EmptyTableRequest) (*ExportedTableCreationResponse, error) + // + // Create a time table with the given start time and period. + TimeTable(context.Context, *TimeTableRequest) (*ExportedTableCreationResponse, error) + // + // Drop columns from the parent table. + DropColumns(context.Context, *DropColumnsRequest) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the update table operation. + Update(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the lazyUpdate table operation. + LazyUpdate(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the view table operation. + View(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // + // Add columns to the given table using the given column specifications and the updateView table operation. + UpdateView(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // + // Select the given columns from the given table. + Select(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // + // Returns a new table definition with the unique tuples of the specified columns + SelectDistinct(context.Context, *SelectDistinctRequest) (*ExportedTableCreationResponse, error) + // + // Filter parent table with structured filters. + Filter(context.Context, *FilterTableRequest) (*ExportedTableCreationResponse, error) + // + // Filter parent table with unstructured filters. + UnstructuredFilter(context.Context, *UnstructuredFilterTableRequest) (*ExportedTableCreationResponse, error) + // + // Sort parent table via the provide sort descriptors. + Sort(context.Context, *SortTableRequest) (*ExportedTableCreationResponse, error) + // + // Extract rows from the head of the parent table. + Head(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) + // + // Extract rows from the tail of the parent table. + Tail(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) + // + // Run the headBy table operation for the given group by columns on the given table. + HeadBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) + // + // Run the tailBy operation for the given group by columns on the given table. + TailBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) + // + // Ungroup the given columns (all columns will be ungrouped if columnsToUngroup is empty or unspecified). + Ungroup(context.Context, *UngroupRequest) (*ExportedTableCreationResponse, error) + // + // Create a merged table from the given input tables. If a key column is provided (not null), a sorted + // merged will be performed using that column. + MergeTables(context.Context, *MergeTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of a cross join operation. Also known as the cartesian product. + CrossJoinTables(context.Context, *CrossJoinTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of a natural join operation. + NaturalJoinTables(context.Context, *NaturalJoinTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of an exact join operation. + ExactJoinTables(context.Context, *ExactJoinTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of a left join operation. + LeftJoinTables(context.Context, *LeftJoinTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of an as of join operation. + AsOfJoinTables(context.Context, *AsOfJoinTablesRequest) (*ExportedTableCreationResponse, error) + // + // Returns the result of an aggregate table operation. + ComboAggregate(context.Context, *ComboAggregateRequest) (*ExportedTableCreationResponse, error) + // + // Snapshot rightId, triggered by leftId, and export the resulting new Table. + // The left table's change events cause a new snapshot to be taken. The result table includes a + // "snapshot key" which is a subset (possibly all) of the left table's columns. The + // remaining columns in the result table come from right table, the table being snapshotted. + Snapshot(context.Context, *SnapshotTableRequest) (*ExportedTableCreationResponse, error) + // + // Returns a new table with a flattened row set. + Flatten(context.Context, *FlattenRequest) (*ExportedTableCreationResponse, error) + //* + // Downsamples a table assume its contents will be rendered in a run chart, with each subsequent row holding a later + // X value (i.e., sorted on that column). Multiple Y columns can be specified, as can a range of values for the X + // column to support zooming in. + RunChartDownsample(context.Context, *RunChartDownsampleRequest) (*ExportedTableCreationResponse, error) + //* + // Creates a new Table based on the provided configuration. This can be used as a regular table from the other methods + // in this interface, or can be interacted with via the InputTableService to modify its contents. + CreateInputTable(context.Context, *CreateInputTableRequest) (*ExportedTableCreationResponse, error) + // + // Batch a series of requests and send them all at once. This enables the user to create intermediate tables without + // requiring them to be exported and managed by the client. The server will automatically release any tables when they + // are no longer depended upon. + Batch(*BatchTableRequest, TableService_BatchServer) error + // + // Establish a stream of table updates for cheap notifications of table size updates. + // + // New streams will flush updates for all existing table exports. An export id of zero will be sent to indicate all + // exports have sent their refresh update. Table updates may be intermingled with initial refresh updates after their + // initial update had been sent. + ExportedTableUpdates(*ExportedTableUpdatesRequest, TableService_ExportedTableUpdatesServer) error + mustEmbedUnimplementedTableServiceServer() +} + +// UnimplementedTableServiceServer must be embedded to have forward compatible implementations. +type UnimplementedTableServiceServer struct { +} + +func (UnimplementedTableServiceServer) GetExportedTableCreationResponse(context.Context, *ticket.Ticket) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExportedTableCreationResponse not implemented") +} +func (UnimplementedTableServiceServer) FetchTable(context.Context, *FetchTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchTable not implemented") +} +func (UnimplementedTableServiceServer) FetchPandasTable(context.Context, *FetchPandasTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchPandasTable not implemented") +} +func (UnimplementedTableServiceServer) ApplyPreviewColumns(context.Context, *ApplyPreviewColumnsRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplyPreviewColumns not implemented") +} +func (UnimplementedTableServiceServer) EmptyTable(context.Context, *EmptyTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EmptyTable not implemented") +} +func (UnimplementedTableServiceServer) TimeTable(context.Context, *TimeTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeTable not implemented") +} +func (UnimplementedTableServiceServer) DropColumns(context.Context, *DropColumnsRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DropColumns not implemented") +} +func (UnimplementedTableServiceServer) Update(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedTableServiceServer) LazyUpdate(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LazyUpdate not implemented") +} +func (UnimplementedTableServiceServer) View(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method View not implemented") +} +func (UnimplementedTableServiceServer) UpdateView(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateView not implemented") +} +func (UnimplementedTableServiceServer) Select(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Select not implemented") +} +func (UnimplementedTableServiceServer) SelectDistinct(context.Context, *SelectDistinctRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SelectDistinct not implemented") +} +func (UnimplementedTableServiceServer) Filter(context.Context, *FilterTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Filter not implemented") +} +func (UnimplementedTableServiceServer) UnstructuredFilter(context.Context, *UnstructuredFilterTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnstructuredFilter not implemented") +} +func (UnimplementedTableServiceServer) Sort(context.Context, *SortTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sort not implemented") +} +func (UnimplementedTableServiceServer) Head(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Head not implemented") +} +func (UnimplementedTableServiceServer) Tail(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Tail not implemented") +} +func (UnimplementedTableServiceServer) HeadBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HeadBy not implemented") +} +func (UnimplementedTableServiceServer) TailBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TailBy not implemented") +} +func (UnimplementedTableServiceServer) Ungroup(context.Context, *UngroupRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ungroup not implemented") +} +func (UnimplementedTableServiceServer) MergeTables(context.Context, *MergeTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MergeTables not implemented") +} +func (UnimplementedTableServiceServer) CrossJoinTables(context.Context, *CrossJoinTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CrossJoinTables not implemented") +} +func (UnimplementedTableServiceServer) NaturalJoinTables(context.Context, *NaturalJoinTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NaturalJoinTables not implemented") +} +func (UnimplementedTableServiceServer) ExactJoinTables(context.Context, *ExactJoinTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExactJoinTables not implemented") +} +func (UnimplementedTableServiceServer) LeftJoinTables(context.Context, *LeftJoinTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeftJoinTables not implemented") +} +func (UnimplementedTableServiceServer) AsOfJoinTables(context.Context, *AsOfJoinTablesRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AsOfJoinTables not implemented") +} +func (UnimplementedTableServiceServer) ComboAggregate(context.Context, *ComboAggregateRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ComboAggregate not implemented") +} +func (UnimplementedTableServiceServer) Snapshot(context.Context, *SnapshotTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +} +func (UnimplementedTableServiceServer) Flatten(context.Context, *FlattenRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Flatten not implemented") +} +func (UnimplementedTableServiceServer) RunChartDownsample(context.Context, *RunChartDownsampleRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RunChartDownsample not implemented") +} +func (UnimplementedTableServiceServer) CreateInputTable(context.Context, *CreateInputTableRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateInputTable not implemented") +} +func (UnimplementedTableServiceServer) Batch(*BatchTableRequest, TableService_BatchServer) error { + return status.Errorf(codes.Unimplemented, "method Batch not implemented") +} +func (UnimplementedTableServiceServer) ExportedTableUpdates(*ExportedTableUpdatesRequest, TableService_ExportedTableUpdatesServer) error { + return status.Errorf(codes.Unimplemented, "method ExportedTableUpdates not implemented") +} +func (UnimplementedTableServiceServer) mustEmbedUnimplementedTableServiceServer() {} + +// UnsafeTableServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TableServiceServer will +// result in compilation errors. +type UnsafeTableServiceServer interface { + mustEmbedUnimplementedTableServiceServer() +} + +func RegisterTableServiceServer(s grpc.ServiceRegistrar, srv TableServiceServer) { + s.RegisterService(&TableService_ServiceDesc, srv) +} + +func _TableService_GetExportedTableCreationResponse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ticket.Ticket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).GetExportedTableCreationResponse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/GetExportedTableCreationResponse", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).GetExportedTableCreationResponse(ctx, req.(*ticket.Ticket)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_FetchTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).FetchTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/FetchTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).FetchTable(ctx, req.(*FetchTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_FetchPandasTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchPandasTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).FetchPandasTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/FetchPandasTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).FetchPandasTable(ctx, req.(*FetchPandasTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_ApplyPreviewColumns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyPreviewColumnsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).ApplyPreviewColumns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/ApplyPreviewColumns", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).ApplyPreviewColumns(ctx, req.(*ApplyPreviewColumnsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_EmptyTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).EmptyTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/EmptyTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).EmptyTable(ctx, req.(*EmptyTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_TimeTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TimeTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).TimeTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/TimeTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).TimeTable(ctx, req.(*TimeTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_DropColumns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DropColumnsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).DropColumns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/DropColumns", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).DropColumns(ctx, req.(*DropColumnsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectOrUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Update", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Update(ctx, req.(*SelectOrUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_LazyUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectOrUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).LazyUpdate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/LazyUpdate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).LazyUpdate(ctx, req.(*SelectOrUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectOrUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).View(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/View", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).View(ctx, req.(*SelectOrUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_UpdateView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectOrUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).UpdateView(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/UpdateView", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).UpdateView(ctx, req.(*SelectOrUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Select_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectOrUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Select(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Select", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Select(ctx, req.(*SelectOrUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_SelectDistinct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SelectDistinctRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).SelectDistinct(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/SelectDistinct", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).SelectDistinct(ctx, req.(*SelectDistinctRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Filter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FilterTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Filter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Filter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Filter(ctx, req.(*FilterTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_UnstructuredFilter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnstructuredFilterTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).UnstructuredFilter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/UnstructuredFilter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).UnstructuredFilter(ctx, req.(*UnstructuredFilterTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Sort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SortTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Sort(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Sort", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Sort(ctx, req.(*SortTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Head_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadOrTailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Head(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Head", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Head(ctx, req.(*HeadOrTailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Tail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadOrTailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Tail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Tail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Tail(ctx, req.(*HeadOrTailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_HeadBy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadOrTailByRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).HeadBy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/HeadBy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).HeadBy(ctx, req.(*HeadOrTailByRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_TailBy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadOrTailByRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).TailBy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/TailBy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).TailBy(ctx, req.(*HeadOrTailByRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Ungroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UngroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Ungroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Ungroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Ungroup(ctx, req.(*UngroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_MergeTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MergeTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).MergeTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/MergeTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).MergeTables(ctx, req.(*MergeTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_CrossJoinTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CrossJoinTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).CrossJoinTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/CrossJoinTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).CrossJoinTables(ctx, req.(*CrossJoinTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_NaturalJoinTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NaturalJoinTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).NaturalJoinTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/NaturalJoinTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).NaturalJoinTables(ctx, req.(*NaturalJoinTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_ExactJoinTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExactJoinTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).ExactJoinTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/ExactJoinTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).ExactJoinTables(ctx, req.(*ExactJoinTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_LeftJoinTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LeftJoinTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).LeftJoinTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/LeftJoinTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).LeftJoinTables(ctx, req.(*LeftJoinTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_AsOfJoinTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AsOfJoinTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).AsOfJoinTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/AsOfJoinTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).AsOfJoinTables(ctx, req.(*AsOfJoinTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_ComboAggregate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ComboAggregateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).ComboAggregate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/ComboAggregate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).ComboAggregate(ctx, req.(*ComboAggregateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SnapshotTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Snapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Snapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Snapshot(ctx, req.(*SnapshotTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Flatten_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FlattenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).Flatten(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/Flatten", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).Flatten(ctx, req.(*FlattenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_RunChartDownsample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunChartDownsampleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).RunChartDownsample(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/RunChartDownsample", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).RunChartDownsample(ctx, req.(*RunChartDownsampleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_CreateInputTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateInputTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).CreateInputTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/CreateInputTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).CreateInputTable(ctx, req.(*CreateInputTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TableService_Batch_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BatchTableRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TableServiceServer).Batch(m, &tableServiceBatchServer{stream}) +} + +type TableService_BatchServer interface { + Send(*ExportedTableCreationResponse) error + grpc.ServerStream +} + +type tableServiceBatchServer struct { + grpc.ServerStream +} + +func (x *tableServiceBatchServer) Send(m *ExportedTableCreationResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _TableService_ExportedTableUpdates_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ExportedTableUpdatesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TableServiceServer).ExportedTableUpdates(m, &tableServiceExportedTableUpdatesServer{stream}) +} + +type TableService_ExportedTableUpdatesServer interface { + Send(*ExportedTableUpdateMessage) error + grpc.ServerStream +} + +type tableServiceExportedTableUpdatesServer struct { + grpc.ServerStream +} + +func (x *tableServiceExportedTableUpdatesServer) Send(m *ExportedTableUpdateMessage) error { + return x.ServerStream.SendMsg(m) +} + +// TableService_ServiceDesc is the grpc.ServiceDesc for TableService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TableService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.TableService", + HandlerType: (*TableServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetExportedTableCreationResponse", + Handler: _TableService_GetExportedTableCreationResponse_Handler, + }, + { + MethodName: "FetchTable", + Handler: _TableService_FetchTable_Handler, + }, + { + MethodName: "FetchPandasTable", + Handler: _TableService_FetchPandasTable_Handler, + }, + { + MethodName: "ApplyPreviewColumns", + Handler: _TableService_ApplyPreviewColumns_Handler, + }, + { + MethodName: "EmptyTable", + Handler: _TableService_EmptyTable_Handler, + }, + { + MethodName: "TimeTable", + Handler: _TableService_TimeTable_Handler, + }, + { + MethodName: "DropColumns", + Handler: _TableService_DropColumns_Handler, + }, + { + MethodName: "Update", + Handler: _TableService_Update_Handler, + }, + { + MethodName: "LazyUpdate", + Handler: _TableService_LazyUpdate_Handler, + }, + { + MethodName: "View", + Handler: _TableService_View_Handler, + }, + { + MethodName: "UpdateView", + Handler: _TableService_UpdateView_Handler, + }, + { + MethodName: "Select", + Handler: _TableService_Select_Handler, + }, + { + MethodName: "SelectDistinct", + Handler: _TableService_SelectDistinct_Handler, + }, + { + MethodName: "Filter", + Handler: _TableService_Filter_Handler, + }, + { + MethodName: "UnstructuredFilter", + Handler: _TableService_UnstructuredFilter_Handler, + }, + { + MethodName: "Sort", + Handler: _TableService_Sort_Handler, + }, + { + MethodName: "Head", + Handler: _TableService_Head_Handler, + }, + { + MethodName: "Tail", + Handler: _TableService_Tail_Handler, + }, + { + MethodName: "HeadBy", + Handler: _TableService_HeadBy_Handler, + }, + { + MethodName: "TailBy", + Handler: _TableService_TailBy_Handler, + }, + { + MethodName: "Ungroup", + Handler: _TableService_Ungroup_Handler, + }, + { + MethodName: "MergeTables", + Handler: _TableService_MergeTables_Handler, + }, + { + MethodName: "CrossJoinTables", + Handler: _TableService_CrossJoinTables_Handler, + }, + { + MethodName: "NaturalJoinTables", + Handler: _TableService_NaturalJoinTables_Handler, + }, + { + MethodName: "ExactJoinTables", + Handler: _TableService_ExactJoinTables_Handler, + }, + { + MethodName: "LeftJoinTables", + Handler: _TableService_LeftJoinTables_Handler, + }, + { + MethodName: "AsOfJoinTables", + Handler: _TableService_AsOfJoinTables_Handler, + }, + { + MethodName: "ComboAggregate", + Handler: _TableService_ComboAggregate_Handler, + }, + { + MethodName: "Snapshot", + Handler: _TableService_Snapshot_Handler, + }, + { + MethodName: "Flatten", + Handler: _TableService_Flatten_Handler, + }, + { + MethodName: "RunChartDownsample", + Handler: _TableService_RunChartDownsample_Handler, + }, + { + MethodName: "CreateInputTable", + Handler: _TableService_CreateInputTable_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Batch", + Handler: _TableService_Batch_Handler, + ServerStreams: true, + }, + { + StreamName: "ExportedTableUpdates", + Handler: _TableService_ExportedTableUpdates_Handler, + ServerStreams: true, + }, + }, + Metadata: "deephaven/proto/table.proto", +} diff --git a/go/internal/proto/ticket/ticket.pb.go b/go/internal/proto/ticket/ticket.pb.go new file mode 100644 index 00000000000..ccdec5d69ff --- /dev/null +++ b/go/internal/proto/ticket/ticket.pb.go @@ -0,0 +1,231 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: deephaven/proto/ticket.proto + +package ticket + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// +// An opaque identifier that the service can use to retrieve a particular +// portion of a stream. +type Ticket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ticket []byte `protobuf:"bytes,1,opt,name=ticket,proto3" json:"ticket,omitempty"` +} + +func (x *Ticket) Reset() { + *x = Ticket{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_ticket_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ticket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ticket) ProtoMessage() {} + +func (x *Ticket) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_ticket_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ticket.ProtoReflect.Descriptor instead. +func (*Ticket) Descriptor() ([]byte, []int) { + return file_deephaven_proto_ticket_proto_rawDescGZIP(), []int{0} +} + +func (x *Ticket) GetTicket() []byte { + if x != nil { + return x.Ticket + } + return nil +} + +type TypedTicket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ticket *Ticket `protobuf:"bytes,1,opt,name=ticket,proto3" json:"ticket,omitempty"` + // + // The type. An empty string means that it is not known, not that the server chose to not set it. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *TypedTicket) Reset() { + *x = TypedTicket{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_ticket_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TypedTicket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypedTicket) ProtoMessage() {} + +func (x *TypedTicket) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_ticket_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypedTicket.ProtoReflect.Descriptor instead. +func (*TypedTicket) Descriptor() ([]byte, []int) { + return file_deephaven_proto_ticket_proto_rawDescGZIP(), []int{1} +} + +func (x *TypedTicket) GetTicket() *Ticket { + if x != nil { + return x.Ticket + } + return nil +} + +func (x *TypedTicket) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +var File_deephaven_proto_ticket_proto protoreflect.FileDescriptor + +var file_deephaven_proto_ticket_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x22, 0x20, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x22, 0x64, 0x0a, 0x0b, 0x54, 0x79, 0x70, 0x65, 0x64, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x42, 0x48, 0x01, 0x50, 0x01, 0x5a, + 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_ticket_proto_rawDescOnce sync.Once + file_deephaven_proto_ticket_proto_rawDescData = file_deephaven_proto_ticket_proto_rawDesc +) + +func file_deephaven_proto_ticket_proto_rawDescGZIP() []byte { + file_deephaven_proto_ticket_proto_rawDescOnce.Do(func() { + file_deephaven_proto_ticket_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_ticket_proto_rawDescData) + }) + return file_deephaven_proto_ticket_proto_rawDescData +} + +var file_deephaven_proto_ticket_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_deephaven_proto_ticket_proto_goTypes = []interface{}{ + (*Ticket)(nil), // 0: io.deephaven.proto.backplane.grpc.Ticket + (*TypedTicket)(nil), // 1: io.deephaven.proto.backplane.grpc.TypedTicket +} +var file_deephaven_proto_ticket_proto_depIdxs = []int32{ + 0, // 0: io.deephaven.proto.backplane.grpc.TypedTicket.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_ticket_proto_init() } +func file_deephaven_proto_ticket_proto_init() { + if File_deephaven_proto_ticket_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_ticket_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ticket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_ticket_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TypedTicket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_ticket_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_deephaven_proto_ticket_proto_goTypes, + DependencyIndexes: file_deephaven_proto_ticket_proto_depIdxs, + MessageInfos: file_deephaven_proto_ticket_proto_msgTypes, + }.Build() + File_deephaven_proto_ticket_proto = out.File + file_deephaven_proto_ticket_proto_rawDesc = nil + file_deephaven_proto_ticket_proto_goTypes = nil + file_deephaven_proto_ticket_proto_depIdxs = nil +} diff --git a/go/internal/test_tools/test_tools.go b/go/internal/test_tools/test_tools.go new file mode 100644 index 00000000000..46ee33dc775 --- /dev/null +++ b/go/internal/test_tools/test_tools.go @@ -0,0 +1,90 @@ +// Miscellaneous helpful functions to make testing easier with less boilerplate. +package test_tools + +import ( + "fmt" + "math/rand" + "os" + "testing" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/apache/arrow/go/v8/arrow/array" + "github.com/apache/arrow/go/v8/arrow/memory" +) + +// ExampleRecord creates an arrow Record with some arbitrary data, used for testing. +// The returned Record should be released when it is not needed anymore. +func ExampleRecord() arrow.Record { + schema := arrow.NewSchema( + []arrow.Field{ + {Name: "Ticker", Type: arrow.BinaryTypes.String}, + {Name: "Close", Type: arrow.PrimitiveTypes.Float32}, + {Name: "Volume", Type: arrow.PrimitiveTypes.Int32}, + }, + nil, + ) + + b := array.NewRecordBuilder(memory.DefaultAllocator, schema) + defer b.Release() + + b.Field(0).(*array.StringBuilder).AppendValues([]string{"XRX", "XYZZY", "IBM", "GME", "AAPL", "ZNGA", "T"}, nil) + b.Field(1).(*array.Float32Builder).AppendValues([]float32{53.8, 88.5, 38.7, 453, 26.7, 544.9, 13.4}, nil) + b.Field(2).(*array.Int32Builder).AppendValues([]int32{87000, 6060842, 138000, 138000000, 19000, 48300, 1500}, nil) + + return b.NewRecord() +} + +// RandomRecord creates an arrow record with random int32 values. +// It will have the specified number of rows and columns, each entry will be in the range [0, maxNum). +func RandomRecord(numCols int, numRows int, maxNum int) arrow.Record { + var fields []arrow.Field + for col := 0; col < numCols; col += 1 { + name := fmt.Sprintf("%c", 'a'+col) + fields = append(fields, arrow.Field{Name: name, Type: arrow.PrimitiveTypes.Int32}) + } + + schema := arrow.NewSchema(fields, nil) + + b := array.NewRecordBuilder(memory.DefaultAllocator, schema) + defer b.Release() + + for col := 0; col < numCols; col += 1 { + var arr []int32 + for row := 0; row < numRows; row += 1 { + arr = append(arr, int32(rand.Intn(maxNum))) + } + + b.Field(col).(*array.Int32Builder).AppendValues(arr, nil) + } + + return b.NewRecord() +} + +// CheckError prints the passed error and message and fails the test if the given error is not nil. +func CheckError(t *testing.T, msg string, err error) { + if err != nil { + t.Fatalf("%s error %s", msg, err.Error()) + } +} + +// GetHost returns the host to connect to for the tests. +// By default it is localhost, but can be overriden by setting the DH_HOST environment variable. +func GetHost() string { + host := os.Getenv("DH_HOST") + if host == "" { + return "localhost" + } else { + return host + } +} + +// GetPort returns the port to connect to for the tests. +// By default it is 10000, but can be overriden by setting the DH_PORT environment variable. +func GetPort() string { + port := os.Getenv("DH_PORT") + if port == "" { + return "10000" + } else { + return port + } +} diff --git a/go/pkg/client/client.go b/go/pkg/client/client.go new file mode 100644 index 00000000000..5473d6d6edd --- /dev/null +++ b/go/pkg/client/client.go @@ -0,0 +1,279 @@ +// This package allows you to interface with a Deephaven server over a network connection using Go. +// It can upload, manipulate, and download tables, among other features. +// +// To get started, use client.NewClient to connect to the server. The Client can then be used to perform operations. +// See the provided examples in the examples/ folder or the individual code documentation for more. +// +// Online docs for the client can be found at https://pkg.go.dev/github.com/deephaven/deephaven-core/go/client +// +// The Go API uses Records from the Apache Arrow package as tables. +// The docs for the Arrow package can be found at the following link: +// https://pkg.go.dev/github.com/apache/arrow/go/v8 +// +// All methods for all structs in this package are thread-safe unless otherwise specified. +package client + +import ( + "context" + "errors" + "log" + "sync" + + apppb2 "github.com/deephaven/deephaven-core/go/internal/proto/application" + consolepb2 "github.com/deephaven/deephaven-core/go/internal/proto/console" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/metadata" +) + +// ErrClosedClient is returned as an error when trying to perform a network operation on a client that has been closed. +var ErrClosedClient = errors.New("client is closed") + +// Maintains a connection to a Deephaven server. +// It can be used to run scripts, create new tables, execute queries, etc. +// Check the various methods of Client to learn more. +type Client struct { + // This lock guards isOpen. + // Other functionality does not need a lock, since the gRPC interface is already thread-safe, + // the tables array has its own lock, and the session token also has its own lock. + lock sync.Mutex + isOpen bool // False if Close has been called (i.e. the client can no longer perform operations). + + grpcChannel *grpc.ClientConn + + suppressTableLeakWarning bool // When true, this disables the TableHandle finalizer warning. + + sessionStub + consoleStub + flightStub + tableStub + inputTableStub + + appServiceClient apppb2.ApplicationServiceClient + ticketFact ticketFactory +} + +// NewClient starts a connection to a Deephaven server. +// +// The client should be closed using Close() after it is done being used. +// +// Keepalive messages are sent automatically by the client to the server at a regular interval (~30 seconds) +// so that the connection remains open. The provided context is saved and used to send keepalive messages. +// +// The option arguments can be used to specify other settings for the client. +// See the With methods (e.g. WithConsole) for details on what options are available. +func NewClient(ctx context.Context, host string, port string, options ...ClientOption) (*Client, error) { + grpcChannel, err := grpc.Dial(host+":"+port, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, err + } + + opts := newClientOptions(options...) + + client := &Client{grpcChannel: grpcChannel, isOpen: true} + + client.suppressTableLeakWarning = opts.suppressTableLeakWarning + + client.ticketFact = newTicketFactory() + + client.sessionStub, err = newSessionStub(ctx, client) + if err != nil { + client.Close() + return nil, err + } + + client.consoleStub, err = newConsoleStub(ctx, client, opts.scriptLanguage) + if err != nil { + client.Close() + return nil, err + } + + client.flightStub, err = newFlightStub(client, host, port) + if err != nil { + client.Close() + return nil, err + } + + client.tableStub = newTableStub(client) + + client.inputTableStub = newInputTableStub(client) + + client.appServiceClient = apppb2.NewApplicationServiceClient(client.grpcChannel) + + return client, nil +} + +// Closed checks if the client is closed, i.e. it can no longer perform operations on the server. +func (client *Client) Closed() bool { + client.lock.Lock() + defer client.lock.Unlock() + + return !client.isOpen +} + +// ExecSerial executes a query graph on the server and returns the resulting tables. +// +// This function makes a request for each table operation in the query graph. +// Consider using ExecBatch to batch all of the table operations into a single request, +// which can be more efficient. +// +// If this function completes successfully, +// the number of tables returned will always match the number of query nodes passed. +// The first table in the returned list corresponds to the first node argument, +// the second table in the returned list corresponds to the second node argument, +// etc. +// +// This may return a QueryError if the query is invalid. +// +// See the TableOps example and the QueryNode docs for more details on how this method should be used. +func (client *Client) ExecSerial(ctx context.Context, nodes ...QueryNode) ([]*TableHandle, error) { + return execSerial(ctx, client, nodes) +} + +// ExecBatch executes a query graph on the server and returns the resulting tables. +// +// All of the operations in the query graph will be performed in a single request, +// so ExecBatch is usually more efficient than ExecSerial. +// +// If this function completes successfully, +// the number of tables returned will always match the number of query nodes passed. +// The first table in the returned list corresponds to the first node argument, +// the second table in the returned list corresponds to the second node argument, +// etc. +// +// This may return a QueryError if the query is invalid. +// +// See the TableOps example and the QueryNode docs for more details on how this method should be used. +func (client *Client) ExecBatch(ctx context.Context, nodes ...QueryNode) ([]*TableHandle, error) { + return execBatch(client, ctx, nodes) +} + +// lockIfOpen returns true if the client is open, i.e. it can be used to perform operations. +// If this function returns true, it will acquire a lock for the client, +// which will prevent it from being closed. +func (client *Client) lockIfOpen() bool { + client.lock.Lock() + if client.isOpen { + return true + } + client.lock.Unlock() + return false +} + +// Close closes the connection to the server and frees any associated resources. +// Once this method is called, the client and any TableHandles from it cannot be used. +func (client *Client) Close() error { + if !client.lockIfOpen() { + return nil + } + defer client.lock.Unlock() + + client.isOpen = false + + client.sessionStub.Close() + + if client.grpcChannel != nil { + client.grpcChannel.Close() + client.grpcChannel = nil + } + + // This is logged because most of the time this method is used with defer, + // which will discard the error value. + err := client.flightStub.Close() + if err != nil { + log.Println("unable to close client:", err.Error()) + } + + return err +} + +// withToken attaches the current session token to a context as metadata. +func (client *Client) withToken(ctx context.Context) (context.Context, error) { + tok, err := client.getToken() + + if err != nil { + return nil, err + } + + return metadata.NewOutgoingContext(ctx, metadata.Pairs("deephaven_session_id", string(tok))), nil +} + +// RunScript executes a script on the deephaven server. +// +// The script language depends on the argument passed to WithConsole when creating the client. +// If WithConsole was not provided when creating the client, this method will return ErrNoConsole. +func (client *Client) RunScript(ctx context.Context, script string) error { + if client.consoleStub.consoleId == nil { + return ErrNoConsole + } + + ctx, err := client.consoleStub.client.withToken(ctx) + if err != nil { + return err + } + + req := consolepb2.ExecuteCommandRequest{ConsoleId: client.consoleStub.consoleId, Code: script} + _, err = client.consoleStub.stub.ExecuteCommand(ctx, &req) + if err != nil { + return err + } + + return nil +} + +// clientOptions holds a set of configurable options to use when creating a client with NewClient. +type clientOptions struct { + scriptLanguage string // The language to use for server-side scripts. Empty string means no scripts can be run. + suppressTableLeakWarning bool // When true, disables the TableHandle finalizer warning. +} + +// newClientOptions applies all of the provided options and returns the resulting struct of settings. +func newClientOptions(opts ...ClientOption) clientOptions { + options := clientOptions{} + for _, opt := range opts { + opt.apply(&options) + } + return options +} + +// A ClientOption configures some aspect of a client connection when passed to NewClient. +// See the With methods for possible client options. +type ClientOption interface { + // apply sets the relevant option in the clientOptions struct. + apply(opts *clientOptions) +} + +// A funcDialOption wraps a function that will apply a client option. +// Inspiration from the grpc-go package. +type funcDialOption struct { + f func(opts *clientOptions) +} + +func (opt funcDialOption) apply(opts *clientOptions) { + opt.f(opts) +} + +// WithConsole allows the client to run scripts on the server using the RunScript method and bind tables to variables using BindToVariable. +// +// The script language can be either "python" or "groovy", and must match the language used on the server. +func WithConsole(scriptLanguage string) ClientOption { + return funcDialOption{func(opts *clientOptions) { + opts.scriptLanguage = scriptLanguage + }} +} + +// WithNoTableLeakWarning disables the automatic TableHandle leak check. +// +// Normally, a warning is printed whenever a TableHandle is forgotten without calling Release on it, +// and a GC finalizer automatically frees the table. +// However, TableHandles are automatically released by the server whenever a client connection closes. +// So, it can be okay for short-lived clients that don't create large tables to forget their TableHandles +// and rely on them being freed when the client closes. +// +// There is no guarantee on when the GC will run, so long-lived clients that forget their TableHandles +// can end up exhausting the server's resources before any of the handles are GCed automatically. +func WithNoTableLeakWarning() ClientOption { + return funcDialOption{func(opts *clientOptions) { + opts.suppressTableLeakWarning = true + }} +} diff --git a/go/pkg/client/client_test.go b/go/pkg/client/client_test.go new file mode 100644 index 00000000000..d298cc9eb2a --- /dev/null +++ b/go/pkg/client/client_test.go @@ -0,0 +1,252 @@ +package client_test + +import ( + "context" + "testing" + "time" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +func TestConnectError(t *testing.T) { + ctx := context.Background() + + _, err := client.NewClient(ctx, "foobar", "1234") + if err == nil { + t.Fatalf("client did not fail to connect") + } +} + +func TestClosedClient(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient err %s", err.Error()) + } + + c.Close() + + _, err = c.EmptyTable(ctx, 17) + if err == nil { + t.Error("client did not close") + } + + // Multiple times should be OK + c.Close() +} + +func TestMismatchedScript(t *testing.T) { + ctx := context.Background() + + _, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("groovy")) + if err == nil { + t.Fatalf("client did not fail to connect") + } +} + +func TestEmptyTable(t *testing.T) { + var expectedRows int64 = 5 + var expectedCols int64 = 0 + + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient err %s", err.Error()) + } + defer c.Close() + + tbl, err := c.EmptyTable(ctx, expectedRows) + if err != nil { + t.Errorf("EmptyTable err %s", err.Error()) + } + + rec, err := tbl.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot err %s", err.Error()) + } + defer rec.Release() + + rows, cols := rec.NumRows(), rec.NumCols() + if rows != expectedRows || cols != expectedCols { + t.Errorf("Record had wrong size (expected %d x %d, got %d x %d)", expectedRows, expectedCols, rows, cols) + } + + err = tbl.Release(ctx) + if err != nil { + t.Errorf("Release err %s", err.Error()) + } +} + +func TestTimeTable(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient err %s", err.Error()) + } + defer c.Close() + + tbl, err := c.TimeTable(ctx, 10000000, time.Now()) + if err != nil { + t.Errorf("EmptyTable err %s", err.Error()) + } + + if tbl.IsStatic() { + t.Error("time table should not be static") + return + } + + err = tbl.Release(ctx) + if err != nil { + t.Errorf("Release err %s", err.Error()) + } +} + +func TestTableUpload(t *testing.T) { + r := test_tools.ExampleRecord() + defer r.Release() + + ctx := context.Background() + s, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient err %s", err.Error()) + return + } + defer s.Close() + + tbl, err := s.ImportTable(ctx, r) + if err != nil { + t.Errorf("ImportTable err %s", err.Error()) + return + } + + rec, err := tbl.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot err %s", err.Error()) + return + } + defer rec.Release() + + if r.NumRows() != rec.NumRows() || r.NumCols() != rec.NumCols() { + t.Log("Expected:") + t.Log(r) + t.Log("Actual:") + t.Log(rec) + t.Errorf("uploaded and snapshotted table differed (%d x %d vs %d x %d)", r.NumRows(), r.NumCols(), rec.NumRows(), rec.NumCols()) + return + } + + for col := 0; col < int(r.NumCols()); col += 1 { + expCol := r.Column(col) + actCol := rec.Column(col) + + if expCol.DataType() != actCol.DataType() { + t.Error("DataType differed", expCol.DataType(), " and ", actCol.DataType()) + } + } + + rec.Release() + err = tbl.Release(ctx) + + if err != nil { + t.Errorf("Release err %s", err.Error()) + return + } +} + +func contains(slice []string, elem string) bool { + for _, e := range slice { + if e == elem { + return true + } + } + return false +} + +// waitForTable attempts to find all of the given tables in the client's list of openable tables. +// It will check repeatedly until the timeout expires. +func waitForTable(ctx context.Context, cl *client.Client, names []string, timeout time.Duration) (bool, error) { + timer := time.After(time.Second) + for { + ok := true + for _, name := range names { + tbls, err := cl.ListOpenableTables(ctx) + if err != nil { + return false, err + } + if !contains(tbls, name) { + ok = false + } + } + if ok { + return true, nil + } + + select { + case <-timer: + return false, nil + default: + } + } +} + +func TestFieldSync(t *testing.T) { + ctx := context.Background() + + client1, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("python")) + test_tools.CheckError(t, "NewClient", err) + defer client1.Close() + + err = client1.RunScript(ctx, + ` +gotesttable1 = None +`) + test_tools.CheckError(t, "RunScript", err) + + client2, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("python")) + test_tools.CheckError(t, "NewClient", err) + defer client2.Close() + + err = client1.RunScript(ctx, + ` +from deephaven import empty_table +gotesttable1 = empty_table(10) +`) + test_tools.CheckError(t, "RunScript", err) + + ok, err := waitForTable(ctx, client2, []string{"gotesttable1"}, time.Second) + if err != nil { + t.Error("error when checking for gotesttable1:", err) + } + if !ok { + t.Error("timeout: gotesttable1 should exist") + return + } + + err = client2.RunScript(ctx, "print('hi')") + test_tools.CheckError(t, "RunScript", err) + + client1.RunScript(ctx, + ` +from deephaven import empty_table +gotesttable2 = empty_table(20) +`) + test_tools.CheckError(t, "RunScript", err) + + ok, err = waitForTable(ctx, client2, []string{"gotesttable1", "gotesttable2"}, time.Second) + if err != nil { + t.Error("error when checking for gotesttable1 and gotesttable2:", err) + } + if !ok { + t.Error("timeout: gotesttable1 and gotesttable2 should exist") + return + } + + tbl, err := client2.OpenTable(ctx, "gotesttable1") + test_tools.CheckError(t, "OpenTable", err) + err = tbl.Release(ctx) + test_tools.CheckError(t, "Release", err) +} diff --git a/go/pkg/client/console_stub.go b/go/pkg/client/console_stub.go new file mode 100644 index 00000000000..70669385fa6 --- /dev/null +++ b/go/pkg/client/console_stub.go @@ -0,0 +1,73 @@ +package client + +import ( + "context" + "errors" + + consolepb2 "github.com/deephaven/deephaven-core/go/internal/proto/console" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// ErrNoConsole is returned by +var ErrNoConsole = errors.New("the client was not started with console support (see WithConsole)") + +// consoleStub wraps gRPC calls for console.proto. +type consoleStub struct { + client *Client + + stub consolepb2.ConsoleServiceClient // The stub for console.proto gRPC requests. + + // A consoleId assigned to this client by the server. + // If it is nil, scripts cannot be run. + consoleId *ticketpb2.Ticket +} + +// newConsoleStub creates a console stub. +// +// If sessionType is non-empty, it will start a console for use with scripts. +// The sessionType determines what language the scripts will use. It can be either "python" or "groovy" and must match the server language. +func newConsoleStub(ctx context.Context, client *Client, sessionType string) (consoleStub, error) { + ctx, err := client.withToken(ctx) + if err != nil { + return consoleStub{}, err + } + + stub := consolepb2.NewConsoleServiceClient(client.grpcChannel) + + var consoleId *ticketpb2.Ticket + if sessionType != "" { + reqTicket := client.ticketFact.newTicket() + + req := consolepb2.StartConsoleRequest{ResultId: &reqTicket, SessionType: sessionType} + resp, err := stub.StartConsole(ctx, &req) + if err != nil { + return consoleStub{}, err + } + + consoleId = resp.ResultId + } + + return consoleStub{client: client, stub: stub, consoleId: consoleId}, nil +} + +// BindToVariable binds a table reference to a given name on the server so that it can be referenced by other clients or the web UI. +// +// If WithConsole was not passed when creating the client, this will return ErrNoConsole. +func (console *consoleStub) BindToVariable(ctx context.Context, name string, table *TableHandle) error { + ctx, err := console.client.withToken(ctx) + if err != nil { + return err + } + + if console.consoleId == nil { + return ErrNoConsole + } + + req := consolepb2.BindTableToVariableRequest{ConsoleId: console.consoleId, VariableName: name, TableId: table.ticket} + _, err = console.stub.BindTableToVariable(ctx, &req) + if err != nil { + return err + } + + return nil +} diff --git a/go/pkg/client/console_test.go b/go/pkg/client/console_test.go new file mode 100644 index 00000000000..99bc00230e9 --- /dev/null +++ b/go/pkg/client/console_test.go @@ -0,0 +1,58 @@ +package client_test + +import ( + "context" + "testing" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +func TestOpenTable(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("python")) + test_tools.CheckError(t, "NewClient", err) + + err = c.RunScript(ctx, + ` +from deephaven import empty_table +gotesttable = empty_table(42) +`) + test_tools.CheckError(t, "RunScript", err) + + tbl, err := c.OpenTable(ctx, "gotesttable") + test_tools.CheckError(t, "OpenTable", err) + defer tbl.Release(ctx) + + rec, err := tbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer rec.Release() + + if rec.NumCols() != 0 || rec.NumRows() != 42 { + t.Error("table had wrong size") + return + } +} + +func TestNoConsole(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + err = c.RunScript(ctx, "print('hi')") + if err != client.ErrNoConsole { + t.Error("wrong or missing RunScript error", err) + return + } + + tbl, err := c.EmptyTable(ctx, 10) + test_tools.CheckError(t, "EmptyTable", err) + + err = c.BindToVariable(ctx, "this_should_fail", tbl) + if err != client.ErrNoConsole { + t.Error("wrong or missing BindToVariable error", err) + } +} diff --git a/go/pkg/client/example_fetch_table_test.go b/go/pkg/client/example_fetch_table_test.go new file mode 100644 index 00000000000..127b2db85d4 --- /dev/null +++ b/go/pkg/client/example_fetch_table_test.go @@ -0,0 +1,66 @@ +package client_test + +import ( + "context" + "fmt" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// If you want to access tables from previous sessions or from the web UI, +// you will need to use OpenTable. +// +// This example requires a Deephaven server to connect to, so it will not work on pkg.go.dev. +func Example_fetchTable() { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + // Let's start a client connection using python as the script language ("groovy" is the other option). + // Note that the client language must match the language the server was started with. + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("python")) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return + } + + // First, let's make an empty table with ten rows. + tbl, err := cl.EmptyTable(ctx, 10) + if err != nil { + fmt.Println("error when making table:", err.Error()) + return + } + + // We can bind the table to a variable, so that it doesn't disappear when the client closes. + err = cl.BindToVariable(ctx, "my_table", tbl) + if err != nil { + fmt.Println("error when binding table:", err.Error()) + return + } + + // Now we can close the table and client locally, but the table will stick around on the server. + tbl.Release(ctx) + cl.Close() + + // Now let's make a new connection, completely unrelated to the old one. + cl, err = client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + fmt.Println("error when connecting to localhost port 10000:", err.Error()) + return + } + + // Now, we can open the table from the previous session, and it will work fine. + tbl, err = cl.OpenTable(ctx, "my_table") + if err != nil { + fmt.Println("error when opening table:", err.Error()) + } + + fmt.Println("Successfully opened the old table!") + + tbl.Release(ctx) + cl.Close() + + // Output: + // Successfully opened the old table! +} diff --git a/go/pkg/client/example_import_table_test.go b/go/pkg/client/example_import_table_test.go new file mode 100644 index 00000000000..1a6436a617f --- /dev/null +++ b/go/pkg/client/example_import_table_test.go @@ -0,0 +1,101 @@ +package client_test + +import ( + "context" + "fmt" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// This example shows off the ability to upload tables to the Deephaven server, +// perform some operations on them, +// and then download them to access the modified data. +// +// This example requires a Deephaven server to connect to, so it will not work on pkg.go.dev. +func Example_importTable() { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return + } + defer cl.Close() + + // First, we need some Arrow record we want to upload. + sampleRecord := test_tools.ExampleRecord() + // Note that Arrow records should be eventually released. + defer sampleRecord.Release() + + fmt.Println("Data Before:") + fmt.Println(sampleRecord) + + // Now we upload the record so that we can manipulate its data using the server. + // We get back a TableHandle, which is a reference to a table on the server. + table, err := cl.ImportTable(ctx, sampleRecord) + if err != nil { + fmt.Println("error when importing table:", err.Error()) + return + } + // Any tables you create should be eventually released. + defer table.Release(ctx) + + // Now we can do a bunch of operations on the table we imported, if we like... + + // Note that table operations return new tables; they don't modify old tables. + sortedTable, err := table.Sort(ctx, "Close") + if err != nil { + fmt.Println("error when sorting:", err.Error()) + return + } + defer sortedTable.Release(ctx) + filteredTable, err := sortedTable.Where(ctx, "Volume >= 20000") + if err != nil { + fmt.Println("error when filtering:", err.Error()) + return + } + defer filteredTable.Release(ctx) + + // If we want to see the data we sorted and filtered, we can snapshot the table to get a Record back. + filteredRecord, err := filteredTable.Snapshot(ctx) + if err != nil { + fmt.Println("error when filtering:", err.Error()) + return + } + defer filteredRecord.Release() + + fmt.Println("Data After:") + fmt.Println(filteredRecord) + + // Output: + // Data Before: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8 + // - Close: type=float32 + // - Volume: type=int32 + // rows: 7 + // col[0][Ticker]: ["XRX" "XYZZY" "IBM" "GME" "AAPL" "ZNGA" "T"] + // col[1][Close]: [53.8 88.5 38.7 453 26.7 544.9 13.4] + // col[2][Volume]: [87000 6060842 138000 138000000 19000 48300 1500] + // + // Data After: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "java.lang.String", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Close: type=float32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "float", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Volume: type=int32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "int", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // metadata: ["deephaven:attribute.SortedColumns": "Close=Ascending", "deephaven:attribute_type.SortedColumns": "java.lang.String", "deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute.AddOnly": "true"] + // rows: 5 + // col[0][Ticker]: ["IBM" "XRX" "XYZZY" "GME" "ZNGA"] + // col[1][Close]: [38.7 53.8 88.5 453 544.9] + // col[2][Volume]: [138000 87000 6060842 138000000 48300] +} diff --git a/go/pkg/client/example_input_table_test.go b/go/pkg/client/example_input_table_test.go new file mode 100644 index 00000000000..0f093d0c3b3 --- /dev/null +++ b/go/pkg/client/example_input_table_test.go @@ -0,0 +1,112 @@ +package client_test + +import ( + "context" + "fmt" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// This example shows how to use Input Tables. +// Input Tables make are a generic interface for streaming data from any source, +// so you can use Deephaven's streaming table processing power for anything. +// +// This example requires a Deephaven server to connect to, so it will not work on pkg.go.dev. +func Example_inputTable() { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return + } + defer cl.Close() + + // First, let's make a schema our input table is going to use. + // This describes the name and data types each of its columns will have. + schema := arrow.NewSchema( + []arrow.Field{ + {Name: "Ticker", Type: arrow.BinaryTypes.String}, + {Name: "Close", Type: arrow.PrimitiveTypes.Float32}, + {Name: "Volume", Type: arrow.PrimitiveTypes.Int32}, + }, + nil, + ) + + // Then we can actually make the input table. + // It will start empty, but we're going to add more data to it. + // This is a key-backed input table, so it will make sure the "Ticker" column stays unique. + // This is in contrast to an append-only table, which will append rows to the end of the table. + inputTable, err := cl.NewKeyBackedInputTableFromSchema(ctx, schema, "Ticker") + if err != nil { + fmt.Println("error when creating InputTable", err.Error()) + return + } + // Any tables you create should be eventually released. + defer inputTable.Release(ctx) + + // Now let's create a table derived from the input table. + // When we update the input table, this table will update too. + outputTable, err := inputTable.Where(ctx, "Close > 50.0") + if err != nil { + fmt.Println("error when filtering input table", err.Error()) + return + } + defer outputTable.Release(ctx) + + // Now, let's get some new data to add to the input table. + // We import the data so that it is available on the server. + newDataRec := test_tools.ExampleRecord() + // Note that Arrow records must be eventually released. + defer newDataRec.Release() + newDataTable, err := cl.ImportTable(ctx, newDataRec) + if err != nil { + fmt.Println("error when importing new data", err.Error()) + return + } + defer newDataTable.Release(ctx) + + // Now we can add the new data we just imported to our input table. + // Since this is a key-backed table, it will add any rows with new keys + // and replace any rows with keys that already exist. + // Since there's currently nothing in the table, + // this call will add all the rows of the new data to the input table. + err = inputTable.AddTable(ctx, newDataTable) + if err != nil { + fmt.Println("error when adding new data to table", err.Error()) + return + } + + // Now, we take a snapshot of the outputTable to see what data it currently contains. + // We should see the new rows we added, filtered by the condition we specified when creating outputTable. + outputRec, err := outputTable.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting table", err.Error()) + return + } + defer outputRec.Release() + + fmt.Println("Got the output table!") + fmt.Println(outputRec) + + // Output: + // Got the output table! + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "java.lang.String", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:inputtable.isKey": "true", "deephaven:isDateFormat": "false"] + // - Close: type=float32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "float", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:inputtable.isKey": "false", "deephaven:isDateFormat": "false"] + // - Volume: type=int32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "int", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:inputtable.isKey": "false", "deephaven:isDateFormat": "false"] + // metadata: ["deephaven:unsent.attribute.InputTable": ""] + // rows: 4 + // col[0][Ticker]: ["XRX" "XYZZY" "GME" "ZNGA"] + // col[1][Close]: [53.8 88.5 453 544.9] + // col[2][Volume]: [87000 6060842 138000000 48300] +} diff --git a/go/pkg/client/example_run_script_test.go b/go/pkg/client/example_run_script_test.go new file mode 100644 index 00000000000..0eaf699edb3 --- /dev/null +++ b/go/pkg/client/example_run_script_test.go @@ -0,0 +1,83 @@ +package client_test + +import ( + "context" + "fmt" + "time" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// This example shows how you can run a server-side script directly via the client +// and how you can use the script results in the client. +// +// This example requires a Deephaven server to connect to, so it will not work on pkg.go.dev. +func Example_runScript() { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + // Let's start a client connection using python as the script language ("groovy" is the other option). + // Note that the client language must match the language the server was started with. + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort(), client.WithConsole("python")) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return + } + defer cl.Close() + + // First, let's create a new TimeTable, starting one second ago, that gets a new row every 100 ms. + startTime := time.Now().Add(time.Duration(-1) * time.Second) + timeTable, err := cl.TimeTable(ctx, time.Duration(100)*time.Millisecond, startTime) + if err != nil { + fmt.Println("error when creating new time table:", err.Error()) + return + } + // Any tables you create should be eventually released. + defer timeTable.Release(ctx) + + // Next, let's bind the table to a variable so we can use it in the script. + // This also makes the table visible to other clients or to the web UI. + err = cl.BindToVariable(ctx, "my_example_table", timeTable) + if err != nil { + fmt.Println("error when binding table to variable:", err.Error()) + return + } + + // Now, let's run a script to do some arbitrary operations on my_example_table... + err = cl.RunScript(ctx, + ` +from deephaven.time import upper_bin +example_table_2 = my_example_table.update(["UpperBinned = upperBin(Timestamp, SECOND)"]).head(5) +`) + if err != nil { + fmt.Println("error when running script:", err.Error()) + return + } + + // Now, we can open example_table_2 to use locally. + exampleTable2, err := cl.OpenTable(ctx, "example_table_2") + if err != nil { + fmt.Println("error when opening table:", err.Error()) + return + } + // Don't forget to release it! + defer exampleTable2.Release(ctx) + + // And if we want to see what data is currently in example_table_2, we can take a snapshot. + exampleSnapshot, err := exampleTable2.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting table:", err.Error()) + return + } + // Arrow records must also be released when not used anymore. + defer exampleSnapshot.Release() + + fmt.Println("Got table snapshot!") + fmt.Printf("It has %d rows and %d columns", exampleSnapshot.NumRows(), exampleSnapshot.NumCols()) + + // Output: + // Got table snapshot! + // It has 5 rows and 2 columns +} diff --git a/go/pkg/client/example_table_ops_test.go b/go/pkg/client/example_table_ops_test.go new file mode 100644 index 00000000000..a2419f40c27 --- /dev/null +++ b/go/pkg/client/example_table_ops_test.go @@ -0,0 +1,244 @@ +package client_test + +import ( + "context" + "fmt" + + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// This example shows how to manipulate tables using the client. +// +// There are two different ways to manipulate tables: immediate table operations, and query-graph table operations. +// See the doc comments for doQueryOps and doImmediateOps for an explanation of each. +// Don't be afraid to mix and match both as the situation requires! +// +// This example requires a Deephaven server to connect to, so it will not work on pkg.go.dev. +func Example_tableOps() { + normalResult, err := doImmediateOps() + if err != nil { + fmt.Println("encountered an error:", err.Error()) + return + } + + queryResult, err := doQueryOps() + if err != nil { + fmt.Println("encountered an error:", err.Error()) + return + } + + if normalResult != queryResult { + fmt.Println("results differed!", err.Error()) + } + + fmt.Println(queryResult) + + // Output: + // Data Before: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8 + // - Close: type=float32 + // - Volume: type=int32 + // rows: 7 + // col[0][Ticker]: ["XRX" "XYZZY" "IBM" "GME" "AAPL" "ZNGA" "T"] + // col[1][Close]: [53.8 88.5 38.7 453 26.7 544.9 13.4] + // col[2][Volume]: [87000 6060842 138000 138000000 19000 48300 1500] + // + // New data: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "java.lang.String", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Close: type=float32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "float", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Volume: type=int32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "int", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // metadata: ["deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute.AddOnly": "true"] + // rows: 5 + // col[0][Ticker]: ["XRX" "IBM" "GME" "AAPL" "ZNGA"] + // col[1][Close]: [53.8 38.7 453 26.7 544.9] + // col[2][Volume]: [87000 138000 138000000 19000 48300] + // + // record: + // schema: + // fields: 4 + // - Ticker: type=utf8, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "java.lang.String", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Close: type=float32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "float", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Volume: type=int32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "int", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // - Magnitude: type=int32, nullable + // metadata: ["deephaven:isRowStyle": "false", "deephaven:type": "int", "deephaven:isNumberFormat": "false", "deephaven:isStyle": "false", "deephaven:isRollupColumn": "false", "deephaven:isDateFormat": "false"] + // rows: 5 + // col[0][Ticker]: ["XRX" "IBM" "GME" "AAPL" "ZNGA"] + // col[1][Close]: [53.8 38.7 453 26.7 544.9] + // col[2][Volume]: [87000 138000 138000000 19000 48300] + // col[3][Magnitude]: [10000 100000 100000000 10000 10000] +} + +// This function demonstrates how to use immediate table operations. +// +// Immediate table operations take in tables as inputs, and immediately return a table (or an error) as an output. +// They allow for more fine-grained error handling and debugging than query-graph table operations, at the cost of being more verbose. +func doImmediateOps() (string, error) { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return "", err + } + defer cl.Close() + + // First, let's create some example data to manipulate. + sampleRecord := test_tools.ExampleRecord() + // Note that Arrow records must eventually be released. + defer sampleRecord.Release() + + // Now we upload the record as a table on the server. + // We get back a TableHandle, which is a reference to a table on the server. + baseTable, err := cl.ImportTable(ctx, sampleRecord) + if err != nil { + fmt.Println("error when uploading table:", err.Error()) + return "", err + } + // Table handles should be released when they are no longer needed. + defer baseTable.Release(ctx) + + // Now, let's start doing table operations. + // Maybe I don't like companies whose names are too long or too short, so let's keep only the ones in the middle. + midStocks, err := baseTable.Where(ctx, "Ticker.length() == 3 || Ticker.length() == 4") + if err != nil { + fmt.Println("error when filtering table:", err.Error()) + return "", err + } + defer midStocks.Release(ctx) + + // We can also create completely new tables with the client too. + // Let's make a table whose columns are powers of ten. + powTenTable, err := cl.EmptyTable(ctx, 10) + if err != nil { + fmt.Println("error when creating an empty table:", err.Error()) + return "", err + } + defer powTenTable.Release(ctx) + powTenTable, err = powTenTable.Update(ctx, "Magnitude = (int)pow(10, ii)") + if err != nil { + fmt.Println("error when updating a table:", err.Error()) + return "", err + } + defer powTenTable.Release(ctx) + + // What if I want to bin the companies according to the magnitude of the Volume column? + // We can perform an as-of join between two tables to produce another table. + magStocks, err := midStocks. + AsOfJoin(ctx, powTenTable, []string{"Volume = Magnitude"}, nil, client.MatchRuleLessThanEqual) + if err != nil { + fmt.Println("error when doing an as-of join:", err.Error()) + return "", err + } + defer magStocks.Release(ctx) + + // Now, if we want to see the data in each of our tables, we can take snapshots. + midRecord, err := midStocks.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting:", err.Error()) + return "", err + } + defer midRecord.Release() + magRecord, err := magStocks.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting:", err.Error()) + return "", err + } + defer magRecord.Release() + + return fmt.Sprintf("Data Before:\n%s\nNew data:\n%s\n%s", sampleRecord, midRecord, magRecord), nil +} + +// This function demonstrates how to use query-graph table operations. +// +// Query-graph operations allow you to build up an arbitrary number of table operations into a single object (known as the "query graph") +// and then execute all of the table operations at once. +// This simplifies error handling, is much more concise, and can be more efficient than doing immediate table operations. +func doQueryOps() (string, error) { + // A context is used to set timeouts and deadlines for requests or cancel requests. + // If you don't have any specific requirements, context.Background() is a good default. + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + fmt.Println("error when connecting to server:", err.Error()) + return "", err + } + defer cl.Close() + + // First, let's create some example data to manipulate. + sampleRecord := test_tools.ExampleRecord() + // Note that Arrow records must eventually be released. + defer sampleRecord.Release() + + // Now we upload the record as a table on the server. + // We get back a TableHandle, which is a reference to a table on the server. + baseTable, err := cl.ImportTable(ctx, sampleRecord) + if err != nil { + fmt.Println("error when uploading table:", err.Error()) + return "", err + } + // Table handles should be released when they are no longer needed. + defer baseTable.Release(ctx) + + // Now, let's start building a query graph. + // Maybe I don't like companies whose names are too long or too short, so let's keep only the ones in the middle. + // Unlike with immediate operations, here midStocks is a QueryNode instead of an actual TableHandle. + // A QueryNode just holds a list of operations to be performed; it doesn't do anything until it's executed (see below). + midStocks := baseTable.Query(). + Where("Ticker.length() == 3 || Ticker.length() == 4") + + // We can create completely new tables in the query graph too. + // Let's make a table whose columns are powers of ten. + powTenTable := cl. + EmptyTableQuery(10). + Update("Magnitude = (int)pow(10, ii)") + + // What if I want to bin the companies according to the magnitude of the Volume column? + // Query-graph methods can take other query nodes as arguments to build up arbitrarily complicated requests, + // so we can perform an as-of join between two query nodes just fine. + magStocks := midStocks. + AsOfJoin(powTenTable, []string{"Volume = Magnitude"}, nil, client.MatchRuleLessThanEqual) + + // And now, we can execute the query graph we have built. + // This turns our QueryNodes into usable TableHandles. + tables, err := cl.ExecBatch(ctx, midStocks, magStocks) + if err != nil { + fmt.Println("error when executing query:", err.Error()) + return "", err + } + // The order of the tables in the returned list is the same as the order of the QueryNodes passed as arguments. + midTable, magTable := tables[0], tables[1] + defer midTable.Release(ctx) + defer magTable.Release(ctx) + + // Now, if we want to see the data in each of our tables, we can take snapshots. + midRecord, err := midTable.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting:", err.Error()) + return "", err + } + defer midRecord.Release() + magRecord, err := magTable.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting:", err.Error()) + return "", err + } + defer magRecord.Release() + + return fmt.Sprintf("Data Before:\n%s\nNew data:\n%s\n%s", sampleRecord, midRecord, magRecord), nil +} diff --git a/go/pkg/client/fieldmanager.go b/go/pkg/client/fieldmanager.go new file mode 100644 index 00000000000..0f7df55b537 --- /dev/null +++ b/go/pkg/client/fieldmanager.go @@ -0,0 +1,116 @@ +package client + +import ( + "context" + + apppb2 "github.com/deephaven/deephaven-core/go/internal/proto/application" +) + +// A fieldId is a unique identifier for a field on the server, +// where a "field" could be e.g. a table or a plot. +type fieldId struct { + appId string // appId is the application scope for the field. For the global scope this is "scope". + fieldName string // fieldName is the name of the field. +} + +// fieldStream wraps a ListFields request, allowing it to be easily closed +// or for its responses to be forwarded to a channel. +// It should be closed using Close() when it is no longer needed. +type fieldStream struct { + fieldsClient apppb2.ApplicationService_ListFieldsClient + cancel context.CancelFunc +} + +// newFieldStream starts a new ListFields gRPC request. +// The gRPC request can then be controlled using the other fieldStream methods. +func newFieldStream(ctx context.Context, appServiceClient apppb2.ApplicationServiceClient) (*fieldStream, error) { + ctx, cancel := context.WithCancel(ctx) + + req := apppb2.ListFieldsRequest{} + fieldsClient, err := appServiceClient.ListFields(ctx, &req) + + if err != nil { + cancel() + return nil, err + } + + fs := &fieldStream{fieldsClient: fieldsClient, cancel: cancel} + return fs, nil +} + +// FetchOnce returns the next set of changes from the ListFields request. +// If FetchOnce has not already been called on this stream, this will return immediately. +func (fs *fieldStream) FetchOnce() (*apppb2.FieldsChangeUpdate, error) { + return fs.fieldsClient.Recv() +} + +// Close closes the field stream. +// This method is NOT goroutine-safe. +func (fs *fieldStream) Close() { + if fs.cancel != nil { + fs.cancel() + fs.cancel = nil + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// getFields returns a list of all fields currently present on the server. +func (client *Client) getFields(ctx context.Context) ([]*apppb2.FieldInfo, error) { + ctx, err := client.withToken(ctx) + if err != nil { + return nil, err + } + + fs, err := newFieldStream(ctx, client.appServiceClient) + if err != nil { + return nil, err + } + // It's okay to call Close here since the fs is owned exclusively by this goroutine. + defer fs.Close() + + changes, err := fs.FetchOnce() + if err != nil { + return nil, err + } + + // This is the first response, so only the Created part matters + return changes.Created, nil +} + +// getTable returns the table with the given ID, if it is present on the server. +// If the table is not present, the returned table pointer will be nil. +// The returned table handle is not exported, so TableHandle.Release should not be called on it. +// Instead, use OpenTable or fetchTable to get an exported TableHandle that can be returned to the user. +func (client *Client) getTable(ctx context.Context, id fieldId) (*TableHandle, error) { + fields, err := client.getFields(ctx) + if err != nil { + return nil, err + } + + for _, f := range fields { + if f.ApplicationId == id.appId && f.FieldName == id.fieldName && f.TypedTicket.Type == "Table" { + return newBorrowedTableHandle(client, f.TypedTicket.Ticket, nil, 0, false), nil + } + } + + return nil, nil +} + +// ListOpenableTables returns a list of the (global) tables that can be opened with OpenTable. +// Tables bound to variables by other clients or the web UI will show up in this list, +// though it is not guaranteed how long it will take for new tables to appear. +func (client *Client) ListOpenableTables(ctx context.Context) ([]string, error) { + fields, err := client.getFields(ctx) + if err != nil { + return nil, err + } + + var tables []string + for _, id := range fields { + if id.ApplicationId == "scope" && id.TypedTicket.Type == "Table" { + tables = append(tables, id.FieldName) + } + } + return tables, nil +} diff --git a/go/pkg/client/flight_stub.go b/go/pkg/client/flight_stub.go new file mode 100644 index 00000000000..27023cc2a04 --- /dev/null +++ b/go/pkg/client/flight_stub.go @@ -0,0 +1,134 @@ +package client + +import ( + "context" + "errors" + "io" + "net" + "strconv" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/apache/arrow/go/v8/arrow/flight" + "github.com/apache/arrow/go/v8/arrow/ipc" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// flightStub wraps Arrow Flight gRPC calls. +type flightStub struct { + client *Client + + stub flight.Client // The stub for performing Arrow Flight gRPC requests. +} + +func newFlightStub(client *Client, host string, port string) (flightStub, error) { + stub, err := flight.NewClientWithMiddleware( + net.JoinHostPort(host, port), + nil, + nil, + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + return flightStub{}, err + } + + return flightStub{client: client, stub: stub}, nil +} + +// snapshotRecord downloads the data currently in the provided table and returns it as an Arrow Record. +func (fs *flightStub) snapshotRecord(ctx context.Context, ticket *ticketpb2.Ticket) (arrow.Record, error) { + ctx, err := fs.client.withToken(ctx) + if err != nil { + return nil, err + } + + fticket := &flight.Ticket{Ticket: ticket.GetTicket()} + + req, err := fs.stub.DoGet(ctx, fticket) + if err != nil { + return nil, err + } + defer req.CloseSend() + + reader, err := flight.NewRecordReader(req) + defer reader.Release() + if err != nil { + return nil, err + } + + rec1, err := reader.Read() + if err != nil { + return nil, err + } + rec1.Retain() + + rec2, err := reader.Read() + if err != io.EOF { + rec1.Release() + rec2.Release() + return nil, errors.New("multiple records retrieved during snapshot") + } + + return rec1, nil +} + +// ImportTable uploads a table to the Deephaven server. +// The table can then be manipulated and referenced using the returned TableHandle. +func (fs *flightStub) ImportTable(ctx context.Context, rec arrow.Record) (*TableHandle, error) { + ctx, err := fs.client.withToken(ctx) + if err != nil { + return nil, err + } + + doPut, err := fs.stub.DoPut(ctx) + if err != nil { + return nil, err + } + defer doPut.CloseSend() + + ticketNum := fs.client.ticketFact.nextId() + + //todo Seems like this should be a fixed size int cast here and not a generic int + descr := &flight.FlightDescriptor{Type: flight.DescriptorPATH, Path: []string{"export", strconv.Itoa(int(ticketNum))}} + + writer := flight.NewRecordWriter(doPut, ipc.WithSchema(rec.Schema())) + + writer.SetFlightDescriptor(descr) + err = writer.Write(rec) + if err != nil { + return nil, err + } + + err = writer.Close() + if err != nil { + return nil, err + } + + _, err = doPut.Recv() + if err != nil { + return nil, err + } + + ticket := fs.client.ticketFact.makeTicket(ticketNum) + + schema := rec.Schema() + + return newTableHandle(fs.client, &ticket, schema, rec.NumRows(), true), nil +} + +// Close closes the flight stub and frees any associated resources. +// The flight stub should not be used after calling this function. +// The client lock should be held when calling this function. +func (fs *flightStub) Close() error { + if fs.stub != nil { + err := fs.stub.Close() + if err != nil { + return err + } + fs.stub = nil + } + return nil +} diff --git a/go/pkg/client/inputtable_stub.go b/go/pkg/client/inputtable_stub.go new file mode 100644 index 00000000000..4a3adceffd5 --- /dev/null +++ b/go/pkg/client/inputtable_stub.go @@ -0,0 +1,183 @@ +package client + +import ( + "context" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/apache/arrow/go/v8/arrow/flight" + "github.com/apache/arrow/go/v8/arrow/memory" + inputtablepb2 "github.com/deephaven/deephaven-core/go/internal/proto/inputtable" + tablepb2 "github.com/deephaven/deephaven-core/go/internal/proto/table" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// AppendOnlyInputTable is a handle to an append-only input table on the server. +// The only difference between this handle and a normal table handle is the ability +// to add data to it using AddTable. +type AppendOnlyInputTable struct { + *TableHandle +} + +// KeyBackedInputTable is a handle to a key-backed input table on the server. +// The only difference between this handle and a normal table handle is the ability +// to add and remove data to and from it using AddTable and DeleteTable. +type KeyBackedInputTable struct { + *TableHandle +} + +// inputTableStub wraps gRPC calls for inputtable.proto. +type inputTableStub struct { + client *Client + + stub inputtablepb2.InputTableServiceClient // The stub for performing inputtable gRPC requests. +} + +func newInputTableStub(client *Client) inputTableStub { + return inputTableStub{client: client, stub: inputtablepb2.NewInputTableServiceClient(client.grpcChannel)} +} + +type inputTableKind = tablepb2.CreateInputTableRequest_InputTableKind + +// makeInputTableRequestFromSchema is just a shorthand method to construct a CreateInputTableRequest, +// since it's a very verbose process. +func makeInputTableRequestFromSchema(kind *inputTableKind, resultId *ticketpb2.Ticket, schema *arrow.Schema) *tablepb2.CreateInputTableRequest { + schemaBytes := flight.SerializeSchema(schema, memory.DefaultAllocator) + + def := &tablepb2.CreateInputTableRequest_Schema{Schema: schemaBytes} + return &tablepb2.CreateInputTableRequest{ResultId: resultId, Definition: def, Kind: kind} +} + +// makeInputTableRequestFromSchema is just a shorthand method to construct a CreateInputTableRequest, +// since it's a very verbose process. +func makeInputTableRequestFromTable(kind *inputTableKind, resultId *ticketpb2.Ticket, table *TableHandle) *tablepb2.CreateInputTableRequest { + def := &tablepb2.CreateInputTableRequest_SourceTableId{SourceTableId: &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: table.ticket}}} + return &tablepb2.CreateInputTableRequest{ResultId: resultId, Definition: def, Kind: kind} +} + +// NewAppendOnlyInputTableFromSchema creates a new append-only input table with columns according to the provided schema. +func (its *inputTableStub) NewAppendOnlyInputTableFromSchema(ctx context.Context, schema *arrow.Schema) (*AppendOnlyInputTable, error) { + kind := inputTableKind{Kind: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_{ + InMemoryAppendOnly: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryAppendOnly{}, + }} + resultId := its.client.ticketFact.newTicket() + req := makeInputTableRequestFromSchema(&kind, &resultId, schema) + newTable, err := its.client.tableStub.createInputTable(ctx, req) + if err != nil { + return nil, err + } + return &AppendOnlyInputTable{TableHandle: newTable}, nil +} + +// NewAppendOnlyInputTableFromTable creates a new append-only input table with the same columns as the provided table. +func (its *inputTableStub) NewAppendOnlyInputTableFromTable(ctx context.Context, table *TableHandle) (*AppendOnlyInputTable, error) { + if !table.IsValid() { + return nil, ErrInvalidTableHandle + } + kind := inputTableKind{Kind: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_{ + InMemoryAppendOnly: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryAppendOnly{}, + }} + resultId := its.client.ticketFact.newTicket() + req := makeInputTableRequestFromTable(&kind, &resultId, table) + newTable, err := its.client.tableStub.createInputTable(ctx, req) + if err != nil { + return nil, err + } + return &AppendOnlyInputTable{TableHandle: newTable}, nil +} + +// NewKeyBackedInputTableFromSchema creates a new key-backed input table with columns according to the provided schema. +// The columns to use as the keys are specified by keyColumns. +func (its *inputTableStub) NewKeyBackedInputTableFromSchema(ctx context.Context, schema *arrow.Schema, keyColumns ...string) (*KeyBackedInputTable, error) { + kind := inputTableKind{Kind: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_{ + InMemoryKeyBacked: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryKeyBacked{KeyColumns: keyColumns}, + }} + resultId := its.client.ticketFact.newTicket() + req := makeInputTableRequestFromSchema(&kind, &resultId, schema) + newTable, err := its.client.tableStub.createInputTable(ctx, req) + if err != nil { + return nil, err + } + return &KeyBackedInputTable{TableHandle: newTable}, nil +} + +// NewKeyBackedInputTableFromTable creates a new key-backed input table with the same columns as the provided table. +// The columns to use as the keys are specified by keyColumns. +func (its *inputTableStub) NewKeyBackedInputTableFromTable(ctx context.Context, table *TableHandle, keyColumns ...string) (*KeyBackedInputTable, error) { + if !table.IsValid() { + return nil, ErrInvalidTableHandle + } + kind := inputTableKind{Kind: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_{ + InMemoryKeyBacked: &tablepb2.CreateInputTableRequest_InputTableKind_InMemoryKeyBacked{KeyColumns: keyColumns}, + }} + resultId := its.client.ticketFact.newTicket() + req := makeInputTableRequestFromTable(&kind, &resultId, table) + newTable, err := its.client.tableStub.createInputTable(ctx, req) + if err != nil { + return nil, err + } + return &KeyBackedInputTable{TableHandle: newTable}, nil +} + +// AddTable appends data from the given table to the end of this table. +// This will automatically update all tables derived from this one. +func (th *AppendOnlyInputTable) AddTable(ctx context.Context, toAdd *TableHandle) error { + if !th.IsValid() || !toAdd.IsValid() { + return ErrInvalidTableHandle + } + return th.client.inputTableStub.addTable(ctx, th.TableHandle, toAdd) +} + +// AddTable merges the keys from the given table into this table. +// If a key does not exist in the current table, the entire row is added, +// otherwise the new data row replaces the existing key. +// This will automatically update all tables derived from this one. +func (th *KeyBackedInputTable) AddTable(ctx context.Context, toAdd *TableHandle) error { + if !th.IsValid() || !toAdd.IsValid() { + return ErrInvalidTableHandle + } + return th.client.inputTableStub.addTable(ctx, th.TableHandle, toAdd) +} + +// addTable makes the AddTableToInputTable gRPC request. +// See the docs for AddTable on each kind of table for details. +func (its *inputTableStub) addTable(ctx context.Context, inputTable *TableHandle, toAdd *TableHandle) error { + ctx, err := its.client.withToken(ctx) + if err != nil { + return err + } + + req := inputtablepb2.AddTableRequest{InputTable: inputTable.ticket, TableToAdd: toAdd.ticket} + _, err = its.stub.AddTableToInputTable(ctx, &req) + if err != nil { + return nil + } + + return nil +} + +// DeleteTable deletes the rows with the given keys from this table. +// The provided table must consist only of columns that were specified as key columns in the input table. +// This will automatically update all tables derived from this one. +func (th *KeyBackedInputTable) DeleteTable(ctx context.Context, toDelete *TableHandle) error { + if !th.IsValid() || !toDelete.IsValid() { + return ErrInvalidTableHandle + } + return th.client.inputTableStub.deleteTable(ctx, th.TableHandle, toDelete) +} + +// deleteTable makes the DeleteTableFromInputTable gRPC request. +// See the docs for DeleteTable for details. +func (its *inputTableStub) deleteTable(ctx context.Context, inputTable *TableHandle, toRemove *TableHandle) error { + ctx, err := its.client.withToken(ctx) + if err != nil { + return err + } + + req := inputtablepb2.DeleteTableRequest{InputTable: inputTable.ticket, TableToRemove: toRemove.ticket} + _, err = its.stub.DeleteTableFromInputTable(ctx, &req) + if err != nil { + return nil + } + + return nil +} diff --git a/go/pkg/client/inputtable_test.go b/go/pkg/client/inputtable_test.go new file mode 100644 index 00000000000..72a089dbedc --- /dev/null +++ b/go/pkg/client/inputtable_test.go @@ -0,0 +1,330 @@ +package client_test + +import ( + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// getDataTableSchema returns the schema for an example record. +func getDataTableSchema() *arrow.Schema { + return arrow.NewSchema( + []arrow.Field{ + {Name: "Ticker", Type: arrow.BinaryTypes.String}, + {Name: "Close", Type: arrow.PrimitiveTypes.Float32}, + {Name: "Volume", Type: arrow.PrimitiveTypes.Int32}, + }, + nil, + ) +} + +// getDataTableFirstRow imports and returns the first row of an example record. +func getDataTableFirstRow(ctx context.Context, client *client.Client) (*client.TableHandle, error) { + rec := test_tools.ExampleRecord() + defer rec.Release() + + tbl, err := client.ImportTable(ctx, rec) + if err != nil { + return nil, err + } + defer tbl.Release(ctx) + + firstPart, err := tbl.Head(ctx, 1) + if err != nil { + return nil, err + } + + return firstPart, err +} + +// getDataTableSecondPart imports and returns the first five rows of an example record. +// This intentionally overlaps with getDataTableSecondPart. +func getDataTableFirstPart(ctx context.Context, client *client.Client) (*client.TableHandle, error) { + rec := test_tools.ExampleRecord() + defer rec.Release() + + tbl, err := client.ImportTable(ctx, rec) + if err != nil { + return nil, err + } + defer tbl.Release(ctx) + + firstPart, err := tbl.Head(ctx, 5) + if err != nil { + return nil, err + } + + return firstPart, err +} + +// getDataTableSecondPart imports and returns the last five rows of an example record. +// This intentionally overlaps with getDataTableFirstPart. +func getDataTableSecondPart(ctx context.Context, client *client.Client) (*client.TableHandle, error) { + rec := test_tools.ExampleRecord() + defer rec.Release() + + tbl, err := client.ImportTable(ctx, rec) + if err != nil { + return nil, err + } + defer tbl.Release(ctx) + + secondPart, err := tbl.Tail(ctx, 5) + if err != nil { + return nil, err + } + + return secondPart, err +} + +// A checkerFunc returns nil if the given Record matches what it expects, otherwise it returns some error. +type checkerFunc func(record arrow.Record) error + +// checkTable repeatedly snapshots a table and checks it using the provided function. +// If the table still fails the check after the timeout has expired, this returns an error. +func checkTable(ctx context.Context, table *client.TableHandle, checker checkerFunc, timeout time.Duration) error { + timeoutChannel := time.After(timeout) + + var lastError error + + for { + select { + case <-timeoutChannel: + return lastError + default: + record, snapshotErr := table.Snapshot(ctx) + if snapshotErr != nil { + return snapshotErr + } + lastError = checker(record) + record.Release() + if lastError == nil { + return nil + } + } + } +} + +// addNewDataToAppend gets two (overlapping) parts of an example table and +// adds them to the provided input table. It returns records from +// a filtered version of the input table. +// It will check three records from the filtered table: +// - A snapshot before any data has been added +// - A snapshot once the first part of the data has been added +// - A snapshot after both parts of the data has been added. +// The parts overlap to check that an input table allows duplicate rows, +// and the filtered table is used to check that changes to the input table +// propogate to other tables. +func addNewDataToAppend( + ctx context.Context, cl *client.Client, tbl *client.AppendOnlyInputTable, + beforeCheck checkerFunc, midCheck checkerFunc, afterCheck checkerFunc, +) (err error) { + newData1, err := getDataTableFirstPart(ctx, cl) + if err != nil { + return + } + defer newData1.Release(ctx) + newData2, err := getDataTableSecondPart(ctx, cl) + if err != nil { + return + } + defer newData2.Release(ctx) + + output, err := tbl.Where(ctx, "Close > 30.0") + if err != nil { + return + } + + err = checkTable(ctx, output, beforeCheck, time.Second*5) + if err != nil { + return + } + + err = tbl.AddTable(ctx, newData1) + if err != nil { + return + } + + err = checkTable(ctx, output, midCheck, time.Second*5) + if err != nil { + return + } + + err = tbl.AddTable(ctx, newData2) + if err != nil { + return + } + + err = checkTable(ctx, output, afterCheck, time.Second*5) + if err != nil { + return + } + + err = output.Release(ctx) + + return +} + +func TestAppendOnlyFromSchema(t *testing.T) { + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer cl.Close() + + inputTable, err := cl.NewAppendOnlyInputTableFromSchema(ctx, getDataTableSchema()) + test_tools.CheckError(t, "NewAppendOnlyInputTableFromSchema", err) + defer inputTable.Release(ctx) + + beforeCheck := func(before arrow.Record) error { + if before.NumCols() != 3 || before.NumRows() != 0 { + return fmt.Errorf("before had wrong size %d x %d", before.NumCols(), before.NumRows()) + } + return nil + } + + midCheck := func(mid arrow.Record) error { + if mid.NumCols() != 3 || mid.NumRows() != 4 { + return fmt.Errorf("mid had wrong size %d x %d", mid.NumCols(), mid.NumRows()) + } + return nil + } + + afterCheck := func(after arrow.Record) error { + if after.NumCols() != 3 || after.NumRows() != 7 { + return fmt.Errorf("after had wrong size %d x %d", after.NumCols(), after.NumRows()) + } + return nil + } + + err = addNewDataToAppend(ctx, cl, inputTable, beforeCheck, midCheck, afterCheck) + test_tools.CheckError(t, "addNewDataToAppend", err) +} + +func TestAppendOnlyFromTable(t *testing.T) { + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer cl.Close() + + templateTbl, err := getDataTableFirstRow(ctx, cl) + test_tools.CheckError(t, "GetDataTableFirstRow", err) + defer templateTbl.Release(ctx) + + inputTable, err := cl.NewAppendOnlyInputTableFromTable(ctx, templateTbl) + test_tools.CheckError(t, "NewAppendOnlyInputTableFromSchema", err) + defer inputTable.Release(ctx) + + beforeCheck := func(before arrow.Record) error { + if before.NumCols() != 3 || before.NumRows() != 0 { + return fmt.Errorf("before had wrong size %d x %d", before.NumCols(), before.NumRows()) + } + return nil + } + + midCheck := func(mid arrow.Record) error { + if mid.NumCols() != 3 || mid.NumRows() != 4 { + return fmt.Errorf("mid had wrong size %d x %d", mid.NumCols(), mid.NumRows()) + } + return nil + } + + afterCheck := func(after arrow.Record) error { + if after.NumCols() != 3 || after.NumRows() != 7 { + return fmt.Errorf("after had wrong size %d x %d", after.NumCols(), after.NumRows()) + } + return nil + } + + err = addNewDataToAppend(ctx, cl, inputTable, beforeCheck, midCheck, afterCheck) + test_tools.CheckError(t, "addNewDataToAppend", err) +} + +func TestKeyBackedTable(t *testing.T) { + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer cl.Close() + + inputTable, err := cl.NewKeyBackedInputTableFromSchema(ctx, getDataTableSchema(), "Ticker") + test_tools.CheckError(t, "NewAppendOnlyInputTableFromSchema", err) + defer inputTable.Release(ctx) + + delData2, err := getDataTableFirstRow(ctx, cl) + test_tools.CheckError(t, "GetDataTableFirstRow", err) + defer delData2.Release(ctx) + delData, err := delData2.View(ctx, "Ticker") + test_tools.CheckError(t, "View", err) + defer delData.Release(ctx) + + newData1, err := getDataTableFirstPart(ctx, cl) + test_tools.CheckError(t, "GetDataTableFirstPart", err) + defer newData1.Release(ctx) + newData2, err := getDataTableSecondPart(ctx, cl) + test_tools.CheckError(t, "GetDataTableSecondPart", err) + defer newData2.Release(ctx) + + outputTable, err := inputTable.Where(ctx, "Close > 30.0") + test_tools.CheckError(t, "Where", err) + defer outputTable.Release(ctx) + + err = inputTable.AddTable(ctx, newData1) + test_tools.CheckError(t, "AddTable", err) + + mid1Check := func(mid1 arrow.Record) error { + if mid1.NumCols() != 3 || mid1.NumRows() != 4 { + return fmt.Errorf("mid1 had wrong size %d x %d", mid1.NumCols(), mid1.NumRows()) + } + return nil + } + err = checkTable(ctx, outputTable, mid1Check, time.Second*5) + test_tools.CheckError(t, "checkTable", err) + + err = inputTable.AddTable(ctx, newData2) + test_tools.CheckError(t, "AddTable", err) + + mid2Check := func(mid2 arrow.Record) error { + if mid2.NumCols() != 3 || mid2.NumRows() != 5 { + return fmt.Errorf("mid2 had wrong size %d x %d", mid2.NumCols(), mid2.NumRows()) + } + return nil + } + err = checkTable(ctx, outputTable, mid2Check, time.Second*5) + test_tools.CheckError(t, "checkTable", err) + + err = inputTable.DeleteTable(ctx, delData) + test_tools.CheckError(t, "DeleteTable", err) + + afterCheck := func(after arrow.Record) error { + if after.NumCols() != 3 || after.NumRows() != 4 { + return fmt.Errorf("after had wrong size %d x %d", after.NumCols(), after.NumRows()) + } + return nil + } + err = checkTable(ctx, outputTable, afterCheck, time.Second*5) + test_tools.CheckError(t, "checktable", err) +} + +func TestInvalidInputTable(t *testing.T) { + ctx := context.Background() + + cl, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer cl.Close() + + inTable := client.AppendOnlyInputTable{} + + _, err = inTable.Head(ctx, 50) + if !errors.Is(err, client.ErrInvalidTableHandle) { + t.Error("wrong or missing error", err) + return + } +} diff --git a/go/pkg/client/query.go b/go/pkg/client/query.go new file mode 100644 index 00000000000..ddb25303a38 --- /dev/null +++ b/go/pkg/client/query.go @@ -0,0 +1,1527 @@ +package client + +import ( + "bytes" + "context" + "fmt" + "sync" + "time" + + tablepb2 "github.com/deephaven/deephaven-core/go/internal/proto/table" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// A querySubError is an error when creating a table in a batched or serial query. +// Several querySubErrors may be combined into a queryError. +type querySubError struct { + serverErr error // The raw error returned by the server. + resultId *tablepb2.TableReference // The result ID of the table which caused the error. Only present for errors from batch execution. + source QueryNode // The query node that caused this error. +} + +// newQuerySubError wraps a single batch sub-error to create a single query sub-error. +// The other parameters are used to attach debugging info to the error. +// nodeTickets is a list of the tickets assigned to each exported node, returned by batch(). +// opNodes is a map from grpc op list indices to query nodes, created by newQueryError(). +// exportNodes is the list of nodes that are exported from the source query. +func newQuerySubError(subError batchSubError, nodeTickets []*ticketpb2.Ticket, opNodes map[int32]QueryNode, exportNodes []QueryNode) querySubError { + switch tblRef := subError.ResultId.Ref.(type) { + case *tablepb2.TableReference_Ticket: + if idx, ok := findTicketOutputIndex(nodeTickets, tblRef.Ticket); ok { + return querySubError{serverErr: subError.ServerErr, resultId: subError.ResultId, source: exportNodes[idx]} + } else { + return querySubError{serverErr: subError.ServerErr, resultId: subError.ResultId} + } + case *tablepb2.TableReference_BatchOffset: + if key, ok := opNodes[tblRef.BatchOffset]; ok { + return querySubError{serverErr: subError.ServerErr, resultId: subError.ResultId, source: key} + } else { + return querySubError{serverErr: subError.ServerErr, resultId: subError.ResultId} + } + default: + panic(fmt.Sprintf("unreachable table reference type %s", tblRef)) + } +} + +// A QueryError may be returned by ExecSerial or ExecBatch as the result of an invalid query. +type QueryError struct { + // Multiple tables in a query might fail, + // so each failed table gets its own querySubError. + subErrors []querySubError +} + +// newQueryError wraps a batch error with debugging info. +// nodeTickets is a list of the tickets assigned to each exported node, returned by batch(). +// nodeOps is a map from grpc op list indices to query nodes, returned by batch(). +// exportNodes is the list of nodes that are exported from the source query. +func newQueryError(err batchError, nodeTickets []*ticketpb2.Ticket, nodeOps map[QueryNode]int32, exportNodes []QueryNode) QueryError { + opNodes := make(map[int32]QueryNode) + for key, idx := range nodeOps { + opNodes[idx] = key + } + + var wrappedSubErrors []querySubError + + for _, subError := range err.subErrors { + wrappedSubError := newQuerySubError(subError, nodeTickets, opNodes, exportNodes) + wrappedSubErrors = append(wrappedSubErrors, wrappedSubError) + } + + return QueryError{subErrors: wrappedSubErrors} +} + +// Unwrap returns the first part of the query error. +func (err QueryError) Unwrap() error { + return err.subErrors[0].serverErr +} + +// Error returns detailed information about all of the sub-errors that occured inside this query error. +// Each sub-error is given a pseudo-traceback of the query operations that caused it. +func (err QueryError) Error() string { + locked := make(map[*queryBuilder]struct{}) + for _, subError := range err.subErrors { + if subError.source.builder != nil { + if _, ok := locked[subError.source.builder]; !ok { + subError.source.builder.opLock.Lock() + defer subError.source.builder.opLock.Unlock() + locked[subError.source.builder] = struct{}{} + } + } + } + + var details string + + for _, subError := range err.subErrors { + details += fmt.Sprintf("msg: %s\n", subError.serverErr) + if subError.source.builder != nil { + builder := subError.source.builder + + if builder.table != nil { + details += fmt.Sprintf(" base table: %s\n", builder.table.ticket) + } + details += " query operations:\n" + for _, op := range builder.ops[:subError.source.index+1] { + details += fmt.Sprintf(" %s\n", op) + } + } else { + details += fmt.Sprintf("no source info (ResultId is %s)\n", subError.resultId) + details += "file a bug report containing your query code and this error at https://github.com/deephaven/deephaven-core/" + } + } + return details +} + +// assert is used to report violated invariants that could only possibly occur as a result of a bad algorithm. +// There should be absolutely no way for a user or network/disk/etc problem to ever cause an assert to fail. +func assert(cond bool, msg string) { + if !cond { + panic(msg) + } +} + +type tableOp interface { + // childQueries returns the nodes that this operation depends on. + // The children must be processed first before we can process this operation. + childQueries() []QueryNode + + // makeBatchOp turns a table operation struct into an actual gRPC request operation. + // The children argument must be the returned table handles from processing each of the childQueries. + makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation + + // execSerialOp performs a table operation immediately. + // The children argument must be the returned table handles from processing each of the childQueries. + // None of the children may be released before this method returns. + execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) +} + +// A QueryNode is a pointer somewhere into a "query graph". +// A "query graph" is effectively a list of table operations that can be executed all at once. +// +// Table operations on a QueryNode return other QueryNodes. +// Several operations can be chained together to build up an entire query graph, +// which can then be executed using Client.ExecSerial or Client.ExecBatch to turn the QueryNode into a TableHandle. +// See the TableOps example for more details on how to use query-graph table operations. +// +// All QueryNode methods are goroutine-safe. +type QueryNode struct { + // -1 refers to the queryBuilder's base table + index int + builder *queryBuilder +} + +// addOp appends a new operation to the node's underlying builder, and returns a new node referring to the operation. +func (qb QueryNode) addOp(op tableOp) QueryNode { + qb.builder.opLock.Lock() + qb.builder.ops = append(qb.builder.ops, op) + result := qb.builder.curRootNode() + qb.builder.opLock.Unlock() + return result +} + +// queryBuilder is (some subgraph of) the Query DAG. +type queryBuilder struct { + table *TableHandle // This can be nil if the first operation creates a new table, e.g. client.EmptyTableQuery + + opLock sync.Mutex + ops []tableOp +} + +func (qb *queryBuilder) curRootNode() QueryNode { + return QueryNode{index: len(qb.ops) - 1, builder: qb} +} + +// batchBuilder is used to progressively create an entire batch operation. +// batchBuilder methods are not thread-safe, but batchBuilders are never shared between goroutines anyways. +type batchBuilder struct { + client *Client + + // The list of nodes that were actually requested as part of a query. + // This list is kept because we need to specifically export these nodes + // so that the user can get a TableHandle to them. + nodes []QueryNode + + // The response is returned in an arbitrary order. + // So, we have to keep track of what ticket each table gets, so we can unshuffle them. + nodeOrder []*ticketpb2.Ticket + + // This map keeps track of operators that are already in the list, to avoid duplication. + // The value is the index into the full operation list of the op's result. + finishedOps map[QueryNode]int32 + + // This is a list of all of the operations currently in the batch. + // This is what will actually end up in the gRPC request. + grpcOps []*tablepb2.BatchTableRequest_Operation + + // It is difficult to determine what queryBuilders are used ahead of time, + // so instead we lock queryBuilders as we encounter them. + // This set contains all the queryBuilders that have been locked so far. + lockedBuilders map[*queryBuilder]struct{} + + // It is difficult to determine what TableHandles are used ahead of time, + // so instead we lock handles as we encounter them. + // This set contains the handles that have been locked so far. + lockedTables map[*TableHandle]struct{} +} + +// needsExport returns the indexes in the export list of the node found +func (b *batchBuilder) needsExport(node QueryNode) []int { + var indices []int + for i, n := range b.nodes { + if n == node { + indices = append(indices, i) + } + } + return indices +} + +// unlockAll unlocks any locks that were acquired while processing nodes, +// i.e. everything in lockedBuilders and lockedTables. +func (b *batchBuilder) unlockAll() { + for builder := range b.lockedBuilders { + builder.opLock.Unlock() + } + + for table := range b.lockedTables { + table.lock.RUnlock() + } + +} + +// addGrpcOps adds any table operations needed by the node to the list, and returns a handle to the node's output table. +func (b *batchBuilder) addGrpcOps(node QueryNode) (*tablepb2.TableReference, error) { + var source *tablepb2.TableReference + + // If the op is already in the list, we don't need to do it again. + if prevIdx, skip := b.finishedOps[node]; skip { + // So just use the output of the existing occurence. + return &tablepb2.TableReference{Ref: &tablepb2.TableReference_BatchOffset{BatchOffset: prevIdx}}, nil + } + + if _, ok := b.lockedBuilders[node.builder]; !ok { + b.lockedBuilders[node.builder] = struct{}{} + node.builder.opLock.Lock() + } + + if node.index == -1 { + if _, ok := b.lockedTables[node.builder.table]; !ok { + if !node.builder.table.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + b.lockedTables[node.builder.table] = struct{}{} + } + + if node.builder.table.client != b.client { + return nil, ErrDifferentClients + } + } + + var resultId *ticketpb2.Ticket = nil + // Duplicate nodes that still need their own tickets + var extraNodes []int + if nodes := b.needsExport(node); len(nodes) > 0 { + t := b.client.ticketFact.newTicket() + resultId = &t + b.nodeOrder[nodes[0]] = resultId + + extraNodes = nodes[1:] + + if node.index == -1 { + // Even this node needs its own FetchTable request, because it's empty. + sourceId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: node.builder.table.ticket}} + t := b.client.ticketFact.newTicket() + resultId = &t + b.nodeOrder[nodes[0]] = resultId + req := tablepb2.FetchTableRequest{ResultId: resultId, SourceId: sourceId} + grpcOp := tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_FetchTable{FetchTable: &req}} + b.grpcOps = append(b.grpcOps, &grpcOp) + } + } else if node.index == -1 { + // An unexported node can just re-use the existing ticket since we don't have to worry about aliasing. + return &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: node.builder.table.ticket}}, nil + } + + // Now we actually process the node and turn it (and its children) into gRPC operations. + if node.index != -1 { + op := node.builder.ops[node.index] + + if _, ok := op.(mergeOp); ok && len(op.childQueries()) == 0 { + return nil, ErrEmptyMerge + } + + var childQueries []*tablepb2.TableReference = nil + for _, child := range op.childQueries() { + childRef, err := b.addGrpcOps(child) + if err != nil { + return nil, err + } + childQueries = append(childQueries, childRef) + } + + grpcOp := op.makeBatchOp(resultId, childQueries) + b.grpcOps = append(b.grpcOps, &grpcOp) + + b.finishedOps[node] = int32(len(b.grpcOps)) - 1 + } + + // If this node gets exported multiple times, we need to handle that. + for _, extraNode := range extraNodes { + sourceId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_BatchOffset{BatchOffset: int32(len(b.grpcOps) - 1)}} + t := b.client.ticketFact.newTicket() + resultId = &t + b.nodeOrder[extraNode] = resultId + req := tablepb2.FetchTableRequest{ResultId: resultId, SourceId: sourceId} + grpcOp := tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_FetchTable{FetchTable: &req}} + b.grpcOps = append(b.grpcOps, &grpcOp) + } + + source = &tablepb2.TableReference{Ref: &tablepb2.TableReference_BatchOffset{BatchOffset: int32(len(b.grpcOps) - 1)}} + return source, nil +} + +// getGrpcOps turns a set of query nodes into a sequence of batch operations. +// grpcOps is a list of the raw operations that can be used in the grpc request. +// nodeTickets are the tickets that each query node will be referenced by, where each index in nodeTickets matches the same index in the nodes argument. +// nodeTickets is needed so that we can match up the nodes and the tables once the request finishes. +// nodeOps is a mapping from all of the query nodes processed to the index in grpcOps that they generated. +func getGrpcOps(client *Client, nodes []QueryNode) (grpcOps []*tablepb2.BatchTableRequest_Operation, nodeTickets []*ticketpb2.Ticket, nodeOps map[QueryNode]int32, err error) { + builder := batchBuilder{ + client: client, + nodes: nodes, + nodeOrder: make([]*ticketpb2.Ticket, len(nodes)), + finishedOps: make(map[QueryNode]int32), + grpcOps: nil, + lockedBuilders: make(map[*queryBuilder]struct{}), + lockedTables: make(map[*TableHandle]struct{}), + } + defer builder.unlockAll() + + for _, node := range nodes { + _, err = builder.addGrpcOps(node) + if err != nil { + return + } + } + + grpcOps = builder.grpcOps + nodeTickets = builder.nodeOrder + nodeOps = builder.finishedOps + + return +} + +// findTableOutputIndex finds the index in the nodeTickets list of the output ticket. +// If there are no matches or multiple matches, ok is false. +func findTicketOutputIndex(nodeTickets []*ticketpb2.Ticket, tableTicket *ticketpb2.Ticket) (idx int, ok bool) { + foundMatch := false + + for i, nodeTicket := range nodeTickets { + if bytes.Equal(nodeTicket.GetTicket(), tableTicket.GetTicket()) { + if foundMatch { + // Multiple matches + return 0, false + } else { + foundMatch = true + idx = i + } + } + } + + // idx was already set in the loop if found + return idx, foundMatch +} + +// execBatch performs the Batch gRPC operation, which performs several table operations in a single request. +// It then wraps the returned tables in TableHandles and returns them in the same order as in nodes. +func execBatch(client *Client, ctx context.Context, nodes []QueryNode) ([]*TableHandle, error) { + if len(nodes) == 0 { + return nil, nil + } + + ops, nodeTickets, nodeOps, err := getGrpcOps(client, nodes) + if err != nil { + return nil, err + } + + if len(nodeTickets) != len(nodes) { + panic("wrong number of entries in nodeOrder") + } + + exportedTables, err := client.batch(ctx, ops) + if err != nil { + if err, ok := err.(batchError); ok { + return nil, newQueryError(err, nodeTickets, nodeOps, nodes) + } + + return nil, err + } + + // The tables are returned in arbitrary order, + // so we have to match the tickets in nodeOrder with the ticket for each table + // in order to determine which one is which and unshuffle them. + var output []*TableHandle + for i, ticket := range nodeTickets { + for _, tbl := range exportedTables { + if bytes.Equal(tbl.ticket.GetTicket(), ticket.GetTicket()) { + output = append(output, tbl) + } + } + + if i+1 != len(output) { + panic(fmt.Sprintf("ticket didn't match %s", ticket)) + } + } + + return output, nil +} + +func newQueryBuilder(table *TableHandle) queryBuilder { + return queryBuilder{table: table} +} + +// emptyTableOp is created by client.EmptyTableQuery(). +type emptyTableOp struct { + numRows int64 +} + +func (op emptyTableOp) childQueries() []QueryNode { + return nil +} + +func (op emptyTableOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 0, "wrong number of children for EmptyTable") + req := &tablepb2.EmptyTableRequest{ResultId: resultId, Size: op.numRows} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_EmptyTable{EmptyTable: req}} +} + +func (op emptyTableOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 0, "wrong number of children for EmptyTable") + return stub.EmptyTable(ctx, op.numRows) +} + +func (op emptyTableOp) String() string { + return fmt.Sprintf("EmptyTable(%d)", op.numRows) +} + +// timeTableOp is created by client.TimeTableQuery(). +type timeTableOp struct { + period time.Duration + startTime time.Time +} + +func (op timeTableOp) childQueries() []QueryNode { + return nil +} + +func (op timeTableOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 0, "wrong number of children for TimeTable") + req := &tablepb2.TimeTableRequest{ResultId: resultId, PeriodNanos: op.period.Nanoseconds(), StartTimeNanos: op.startTime.UnixNano()} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_TimeTable{TimeTable: req}} +} + +func (op timeTableOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 0, "wrong number of children for TimeTable") + return stub.TimeTable(ctx, op.period, op.startTime) +} + +func (op timeTableOp) String() string { + return fmt.Sprintf("TimeTable(%s, %s)", op.period, op.startTime) +} + +type dropColumnsOp struct { + child QueryNode + cols []string +} + +func (op dropColumnsOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op dropColumnsOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for DropColumns") + req := &tablepb2.DropColumnsRequest{ResultId: resultId, SourceId: children[0], ColumnNames: op.cols} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_DropColumns{DropColumns: req}} +} + +func (op dropColumnsOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for DropColumns") + return stub.dropColumns(ctx, children[0], op.cols) +} + +func (op dropColumnsOp) String() string { + return fmt.Sprintf("DropColumns(%#v)", op.cols) +} + +// DropColumns creates a table with the same number of rows as the source table but omits any columns included in the arguments. +func (qb QueryNode) DropColumns(cols ...string) QueryNode { + return qb.addOp(dropColumnsOp{child: qb, cols: cols}) +} + +type updateOp struct { + child QueryNode + formulas []string +} + +func (op updateOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op updateOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Update") + req := &tablepb2.SelectOrUpdateRequest{ResultId: resultId, SourceId: children[0], ColumnSpecs: op.formulas} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Update{Update: req}} +} + +func (op updateOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Update") + return stub.update(ctx, children[0], op.formulas) +} + +func (op updateOp) String() string { + return fmt.Sprintf("Update(%#v)", op.formulas) +} + +// Update creates a new table containing a new, in-memory column for each argument. +// The returned table also includes all the original columns from the source table. +func (qb QueryNode) Update(formulas ...string) QueryNode { + return qb.addOp(updateOp{child: qb, formulas: formulas}) +} + +type lazyUpdateOp struct { + child QueryNode + formulas []string +} + +func (op lazyUpdateOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op lazyUpdateOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for LazyUpdate") + req := &tablepb2.SelectOrUpdateRequest{ResultId: resultId, SourceId: children[0], ColumnSpecs: op.formulas} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_LazyUpdate{LazyUpdate: req}} +} + +func (op lazyUpdateOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for LazyUpdate") + return stub.lazyUpdate(ctx, children[0], op.formulas) +} + +func (op lazyUpdateOp) String() string { + return fmt.Sprintf("LazyUpdate(%#v)", op.formulas) +} + +// LazyUpdate creates a new table containing a new, cached, formula column for each argument. +// The returned table also includes all the original columns from the source table. +func (qb QueryNode) LazyUpdate(formulas ...string) QueryNode { + return qb.addOp(lazyUpdateOp{child: qb, formulas: formulas}) +} + +type viewOp struct { + child QueryNode + formulas []string +} + +func (op viewOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op viewOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for View") + req := &tablepb2.SelectOrUpdateRequest{ResultId: resultId, SourceId: children[0], ColumnSpecs: op.formulas} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_View{View: req}} +} + +func (op viewOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for View") + return stub.view(ctx, children[0], op.formulas) +} + +func (op viewOp) String() string { + return fmt.Sprintf("View(%#v)", op.formulas) +} + +// View creates a new formula table that includes one column for each argument. +// When using view, the data being requested is not stored in memory. +// Rather, a formula is stored that is used to recalculate each cell every time it is accessed. +func (qb QueryNode) View(formulas ...string) QueryNode { + return qb.addOp(viewOp{child: qb, formulas: formulas}) +} + +type updateViewOp struct { + child QueryNode + formulas []string +} + +func (op updateViewOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op updateViewOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for UpdateView") + req := &tablepb2.SelectOrUpdateRequest{ResultId: resultId, SourceId: children[0], ColumnSpecs: op.formulas} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_UpdateView{UpdateView: req}} +} + +func (op updateViewOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for UpdateView") + return stub.updateView(ctx, children[0], op.formulas) +} + +func (op updateViewOp) String() string { + return fmt.Sprintf("UpdateView(%#v)", op.formulas) +} + +// UpdateView creates a new table containing a new, formula column for each argument. +// When using UpdateView, the new columns are not stored in memory. +// Rather, a formula is stored that is used to recalculate each cell every time it is accessed. +// The returned table also includes all the original columns from the source table. +func (qb QueryNode) UpdateView(formulas ...string) QueryNode { + return qb.addOp(updateViewOp{child: qb, formulas: formulas}) +} + +type selectOp struct { + child QueryNode + formulas []string +} + +func (op selectOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op selectOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Select") + req := &tablepb2.SelectOrUpdateRequest{ResultId: resultId, SourceId: children[0], ColumnSpecs: op.formulas} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Select{Select: req}} +} + +func (op selectOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Select") + return stub.selectTbl(ctx, children[0], op.formulas) +} + +func (op selectOp) String() string { + return fmt.Sprintf("Select(%#v)", op.formulas) +} + +// Select creates a new in-memory table that includes one column for each argument. +// Any columns not specified in the arguments will not appear in the resulting table. +func (qb QueryNode) Select(formulas ...string) QueryNode { + return qb.addOp(selectOp{child: qb, formulas: formulas}) +} + +type selectDistinctOp struct { + child QueryNode + cols []string +} + +func (op selectDistinctOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op selectDistinctOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for SelectDistinct") + req := &tablepb2.SelectDistinctRequest{ResultId: resultId, SourceId: children[0], ColumnNames: op.cols} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_SelectDistinct{SelectDistinct: req}} +} + +func (op selectDistinctOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for SelectDistinct") + return stub.selectDistinct(ctx, children[0], op.cols) +} + +func (op selectDistinctOp) String() string { + return fmt.Sprintf("SelectDistinct(%#v)", op.cols) +} + +// SelectDistinct creates a new table containing all of the unique values for a set of key columns. +// When SelectDistinct is used on multiple columns, it looks for distinct sets of values in the selected columns. +func (qb QueryNode) SelectDistinct(columnNames ...string) QueryNode { + return qb.addOp(selectDistinctOp{child: qb, cols: columnNames}) +} + +// SortColumn is a pair of a column and a direction to sort it by. +type SortColumn struct { + colName string + descending bool +} + +// SortAsc specifies that a particular column should be sorted in ascending order +func SortAsc(colName string) SortColumn { + return SortColumn{colName: colName, descending: false} +} + +// SortDsc specifies that a particular column should be sorted in descending order +func SortDsc(colName string) SortColumn { + return SortColumn{colName: colName, descending: true} +} + +type sortOp struct { + child QueryNode + columns []SortColumn +} + +func (op sortOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op sortOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Sort") + + var sorts []*tablepb2.SortDescriptor + for _, col := range op.columns { + var dir tablepb2.SortDescriptor_SortDirection + if col.descending { + dir = tablepb2.SortDescriptor_DESCENDING + } else { + dir = tablepb2.SortDescriptor_ASCENDING + } + + sort := tablepb2.SortDescriptor{ColumnName: col.colName, IsAbsolute: false, Direction: dir} + sorts = append(sorts, &sort) + } + + req := &tablepb2.SortTableRequest{ResultId: resultId, SourceId: children[0], Sorts: sorts} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Sort{Sort: req}} +} + +func (op sortOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Sort") + return stub.sortBy(ctx, children[0], op.columns) +} + +func (op sortOp) String() string { + return fmt.Sprintf("SortBy(%#v)", op.columns) +} + +// Sort returns a new table with rows sorted in a smallest to largest order based on the listed column(s). +func (qb QueryNode) Sort(cols ...string) QueryNode { + var columns []SortColumn + for _, col := range cols { + columns = append(columns, SortAsc(col)) + } + return qb.SortBy(columns...) +} + +// Sort returns a new table with rows sorted in the order specified by the listed column(s). +func (qb QueryNode) SortBy(cols ...SortColumn) QueryNode { + return qb.addOp(sortOp{child: qb, columns: cols}) +} + +type filterOp struct { + child QueryNode + filters []string +} + +func (op filterOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op filterOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Filter") + req := &tablepb2.UnstructuredFilterTableRequest{ResultId: resultId, SourceId: children[0], Filters: op.filters} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_UnstructuredFilter{UnstructuredFilter: req}} +} + +func (op filterOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Filter") + return stub.where(ctx, children[0], op.filters) +} + +func (op filterOp) String() string { + return fmt.Sprintf("Where(%#v)", op.filters) +} + +// Where filters rows of data from the source table. +// It returns a new table with only the rows meeting the filter criteria of the source table. +func (qb QueryNode) Where(filters ...string) QueryNode { + return qb.addOp(filterOp{child: qb, filters: filters}) +} + +type headOrTailOp struct { + child QueryNode + numRows int64 + isTail bool +} + +func (op headOrTailOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op headOrTailOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Head or Tail") + req := &tablepb2.HeadOrTailRequest{ResultId: resultId, SourceId: children[0], NumRows: op.numRows} + + if op.isTail { + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Tail{Tail: req}} + } else { + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Head{Head: req}} + } +} + +func (op headOrTailOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Head or Tail") + return stub.headOrTail(ctx, children[0], op.numRows, !op.isTail) +} + +func (op headOrTailOp) String() string { + if op.isTail { + return fmt.Sprintf("Tail(%d)", op.numRows) + } else { + return fmt.Sprintf("Head(%d)", op.numRows) + } +} + +// Head returns a table with a specific number of rows from the beginning of the source table. +func (qb QueryNode) Head(numRows int64) QueryNode { + return qb.addOp(headOrTailOp{child: qb, numRows: numRows, isTail: false}) +} + +// Tail returns a table with a specific number of rows from the end of the source table. +func (qb QueryNode) Tail(numRows int64) QueryNode { + return qb.addOp(headOrTailOp{child: qb, numRows: numRows, isTail: true}) +} + +type headOrTailByOp struct { + child QueryNode + numRows int64 + by []string + isTail bool +} + +func (op headOrTailByOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op headOrTailByOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for HeadBy or TailBy") + + req := &tablepb2.HeadOrTailByRequest{ResultId: resultId, SourceId: children[0], NumRows: op.numRows, GroupByColumnSpecs: op.by} + + if op.isTail { + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_TailBy{TailBy: req}} + } else { + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_HeadBy{HeadBy: req}} + } +} + +func (op headOrTailByOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for HeadBy or TailBy") + return stub.headOrTailBy(ctx, children[0], op.numRows, op.by, !op.isTail) +} + +func (op headOrTailByOp) String() string { + if op.isTail { + return fmt.Sprintf("TailBy(%d, %#v)", op.numRows, op.by) + } else { + return fmt.Sprintf("HeadBy(%d, %#v)", op.numRows, op.by) + } +} + +// HeadBy returns the first numRows rows for each group. +func (qb QueryNode) HeadBy(numRows int64, columnsToGroupBy ...string) QueryNode { + return qb.addOp(headOrTailByOp{child: qb, numRows: numRows, by: columnsToGroupBy, isTail: false}) +} + +// TailBy returns the last numRows rows for each group. +func (qb QueryNode) TailBy(numRows int64, columnsToGroupBy ...string) QueryNode { + return qb.addOp(headOrTailByOp{child: qb, numRows: numRows, by: columnsToGroupBy, isTail: true}) +} + +type ungroupOp struct { + child QueryNode + colNames []string + nullFill bool +} + +func (op ungroupOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op ungroupOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for Ungroup") + req := &tablepb2.UngroupRequest{ResultId: resultId, SourceId: children[0], ColumnsToUngroup: op.colNames, NullFill: op.nullFill} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Ungroup{Ungroup: req}} +} + +func (op ungroupOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for Ungroup") + return stub.ungroup(ctx, children[0], op.colNames, op.nullFill) +} + +func (op ungroupOp) String() string { + return fmt.Sprintf("TailBy(%#v, %t)", op.colNames, op.nullFill) +} + +// Ungroup ungroups column content. It is the inverse of the GroupBy method. +// Ungroup unwraps columns containing either Deephaven arrays or Java arrays. +// nullFill indicates whether or not missing cells may be filled with null. Set it to true if you are unsure. +func (qb QueryNode) Ungroup(colsToUngroupBy []string, nullFill bool) QueryNode { + return qb.addOp(ungroupOp{child: qb, colNames: colsToUngroupBy, nullFill: nullFill}) +} + +type dedicatedAggOp struct { + child QueryNode + colNames []string + countColumn string + kind tablepb2.ComboAggregateRequest_AggType +} + +func (op dedicatedAggOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op dedicatedAggOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for dedicated aggregation") + + var agg tablepb2.ComboAggregateRequest_Aggregate + if op.kind == tablepb2.ComboAggregateRequest_COUNT && op.countColumn != "" { + agg = tablepb2.ComboAggregateRequest_Aggregate{Type: op.kind, ColumnName: op.countColumn} + } else { + agg = tablepb2.ComboAggregateRequest_Aggregate{Type: op.kind} + } + + aggs := []*tablepb2.ComboAggregateRequest_Aggregate{&agg} + + req := &tablepb2.ComboAggregateRequest{ResultId: resultId, SourceId: children[0], Aggregates: aggs, GroupByColumns: op.colNames} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_ComboAggregate{ComboAggregate: req}} +} + +func (op dedicatedAggOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for dedicated aggregation") + return stub.dedicatedAggOp(ctx, children[0], op.colNames, op.countColumn, op.kind) +} + +func (op dedicatedAggOp) String() string { + switch op.kind { + case tablepb2.ComboAggregateRequest_SUM: + return fmt.Sprintf("SumBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_ABS_SUM: + return fmt.Sprintf("AbsSumBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_GROUP: + return fmt.Sprintf("GroupBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_AVG: + return fmt.Sprintf("AvgBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_COUNT: + if op.colNames != nil { + return fmt.Sprintf("CountBy(%s, %#v)", op.countColumn, op.colNames) + } else { + return fmt.Sprintf("Count(%s)", op.countColumn) + } + case tablepb2.ComboAggregateRequest_FIRST: + return fmt.Sprintf("FirstBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_LAST: + return fmt.Sprintf("LastBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_MIN: + return fmt.Sprintf("MinBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_MAX: + return fmt.Sprintf("MaxBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_MEDIAN: + return fmt.Sprintf("MedianBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_PERCENTILE: + // There is no PercentileBy method, + // so something has gone very wrong if we get here. + panic("invalid aggregation PERCENTILE") + case tablepb2.ComboAggregateRequest_STD: + return fmt.Sprintf("StdBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_VAR: + return fmt.Sprintf("VarBy(%#v)", op.colNames) + case tablepb2.ComboAggregateRequest_WEIGHTED_AVG: + // There is no WeightedAverageBy method, + // so something has gone very wrong if we get here. + panic("invalid aggregation WEIGHTED_AVG") + default: + // This is an invalid value for the enumeration, + // so this is really really wrong. + panic(fmt.Sprintf("invalid aggregation type %d", op.kind)) + } +} + +// GroupBy groups column content into arrays. +// Columns not in the aggregation become array-type. +// If no group-by columns are given, the content of each column is grouped into its own array. +func (qb QueryNode) GroupBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_GROUP}) +} + +// FirstBy returns the first row for each group. +// If no columns are given, only the first row of the table is returned. +func (qb QueryNode) FirstBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_FIRST}) +} + +// LastBy returns the last row for each group. +// If no columns are given, only the last row of the table is returned. +func (qb QueryNode) LastBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_LAST}) +} + +// SumBy returns the total sum for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) SumBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_SUM}) +} + +// AbsSumBy returns the total sum of absolute values for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) AbsSumBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_ABS_SUM}) +} + +// AvgBy returns the average (mean) of each non-key column for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) AvgBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_AVG}) +} + +// StdBy returns the standard deviation for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) StdBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_STD}) +} + +// VarBy returns the variance for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) VarBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_VAR}) +} + +// MedianBy returns the median value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) MedianBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_MEDIAN}) +} + +// MinBy returns the minimum value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) MinBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_MIN}) +} + +// MaxBy returns the maximum value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (qb QueryNode) MaxBy(by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, kind: tablepb2.ComboAggregateRequest_MAX}) +} + +// CountBy returns the number of rows for each group. +// The count of each group is stored in a new column named after the resultCol argument. +func (qb QueryNode) CountBy(resultCol string, by ...string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, colNames: by, countColumn: resultCol, kind: tablepb2.ComboAggregateRequest_COUNT}) +} + +// Count counts the number of values in the specified column and returns it as a table with one row and one column. +func (qb QueryNode) Count(col string) QueryNode { + return qb.addOp(dedicatedAggOp{child: qb, countColumn: col, kind: tablepb2.ComboAggregateRequest_COUNT}) +} + +// aggPart is a single part of an aggregation, created by the methods on AggBuilder. +type aggPart struct { + matchPairs []string // usually the columns on which the operation is performed. + columnName string // only used for Count and WeightedAvg. + percentile float64 // only used for Percentile. + avgMedian bool // not actually used, but here in case more aggregation operations are added. + // whether this is a sum, avg, median, etc. + kind tablepb2.ComboAggregateRequest_AggType +} + +// AggBuilder is the main way to construct aggregations with multiple parts in them. +// Each one of the methods is the same as the corresponding method on a QueryNode. +// The columns to aggregate over are selected in AggBy. +type AggBuilder struct { + aggs []aggPart +} + +func NewAggBuilder() *AggBuilder { + return &AggBuilder{} +} + +func (b *AggBuilder) addAgg(part aggPart) { + b.aggs = append(b.aggs, part) +} + +// Count returns an aggregator that computes the number of elements within an aggregation group. +// The count of each group is stored in a new column named after the col argument. +func (b *AggBuilder) Count(col string) *AggBuilder { + b.addAgg(aggPart{columnName: col, kind: tablepb2.ComboAggregateRequest_COUNT}) + return b +} + +// Sum returns an aggregator that computes the total sum of values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Sum(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_SUM}) + return b +} + +// Sum creates an aggregator that computes the total sum of absolute values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) AbsSum(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_ABS_SUM}) + return b +} + +// Group creates an aggregator that computes an array of all values within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Group(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_GROUP}) + return b +} + +// Avg creates an aggregator that computes the average (mean) of values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Avg(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_AVG}) + return b +} + +// First creates an aggregator that computes the first value, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) First(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_FIRST}) + return b +} + +// Last creates an aggregator that computes the last value, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Last(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_LAST}) + return b +} + +// Min creates an aggregator that computes the minimum value, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Min(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_MIN}) + return b +} + +// Max returns an aggregator that computes the maximum value, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Max(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_MAX}) + return b +} + +// Median creates an aggregator that computes the median value, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Median(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_MEDIAN}) + return b +} + +// Percentile returns an aggregator that computes the designated percentile of values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Percentile(percentile float64, cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, percentile: percentile, kind: tablepb2.ComboAggregateRequest_PERCENTILE}) + return b +} + +// Std returns an aggregator that computes the standard deviation of values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) StdDev(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_STD}) + return b +} + +// Var returns an aggregator that computes the variance of values, within an aggregation group, for each input column. +// The source columns are specified by cols. +func (b *AggBuilder) Variance(cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, kind: tablepb2.ComboAggregateRequest_VAR}) + return b +} + +// WeightedAvg returns an aggregator that computes the weighted average of values, within an aggregation group, for each input column. +// The column to weight by is specified by weightCol. +// The source columns are specified by cols. +func (b *AggBuilder) WeightedAvg(weightCol string, cols ...string) *AggBuilder { + b.addAgg(aggPart{matchPairs: cols, columnName: weightCol, kind: tablepb2.ComboAggregateRequest_WEIGHTED_AVG}) + return b +} + +type aggByOp struct { + child QueryNode + colNames []string + aggs []aggPart +} + +func (op aggByOp) childQueries() []QueryNode { + return []QueryNode{op.child} +} + +func (op aggByOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 1, "wrong number of children for AggBy") + + var aggs []*tablepb2.ComboAggregateRequest_Aggregate + for _, agg := range op.aggs { + reqAgg := tablepb2.ComboAggregateRequest_Aggregate{Type: agg.kind, ColumnName: agg.columnName, MatchPairs: agg.matchPairs, Percentile: agg.percentile, AvgMedian: agg.avgMedian} + aggs = append(aggs, &reqAgg) + } + + req := &tablepb2.ComboAggregateRequest{ResultId: resultId, SourceId: children[0], Aggregates: aggs, GroupByColumns: op.colNames} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_ComboAggregate{ComboAggregate: req}} +} + +func (op aggByOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 1, "wrong number of children for AggBy") + return stub.aggBy(ctx, children[0], op.aggs, op.colNames) +} + +func (op aggByOp) String() string { + return fmt.Sprintf("AggBy(/* aggregation omitted */, %#v)", op.colNames) +} + +// AggBy applies a list of aggregations to table data. +// See the docs on AggBuilder for details on what each of the aggregation types do. +func (qb QueryNode) AggBy(agg *AggBuilder, columnsToGroupBy ...string) QueryNode { + aggs := make([]aggPart, len(agg.aggs)) + copy(aggs, agg.aggs) + return qb.addOp(aggByOp{child: qb, colNames: columnsToGroupBy, aggs: aggs}) +} + +// joinOpKind specifies whether a joinOp is a cross join, natural join, or exact join. +type joinOpKind int + +const ( + joinOpCross joinOpKind = iota + joinOpNatural + joinOpExact +) + +// joinOp can be either a cross join, natural join, or exact join. This is determined by the kind field. +type joinOp struct { + leftTable QueryNode + rightTable QueryNode + columnsToMatch []string + columnsToAdd []string + reserveBits int32 // only used if kind is joinOpCross + kind joinOpKind +} + +func (op joinOp) childQueries() []QueryNode { + return []QueryNode{op.leftTable, op.rightTable} +} + +func (op joinOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 2, "wrong number of children for CrossJoin, NaturalJoin, or ExactJoin") + + leftId := children[0] + rightId := children[1] + + switch op.kind { + case joinOpCross: + req := &tablepb2.CrossJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: op.columnsToMatch, ColumnsToAdd: op.columnsToAdd, ReserveBits: op.reserveBits} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_CrossJoin{CrossJoin: req}} + case joinOpNatural: + req := &tablepb2.NaturalJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: op.columnsToMatch, ColumnsToAdd: op.columnsToAdd} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_NaturalJoin{NaturalJoin: req}} + case joinOpExact: + req := &tablepb2.ExactJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: op.columnsToMatch, ColumnsToAdd: op.columnsToAdd} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_ExactJoin{ExactJoin: req}} + default: + panic("invalid join kind") + } +} + +func (op joinOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 2, "wrong number of children for CrossJoin, NaturalJoin, or ExactJoin") + + leftTbl := children[0] + rightTbl := children[1] + + switch op.kind { + case joinOpCross: + return stub.crossJoin(ctx, leftTbl, rightTbl, op.columnsToMatch, op.columnsToAdd, op.reserveBits) + case joinOpNatural: + return stub.naturalJoin(ctx, leftTbl, rightTbl, op.columnsToMatch, op.columnsToAdd) + case joinOpExact: + return stub.exactJoin(ctx, leftTbl, rightTbl, op.columnsToMatch, op.columnsToAdd) + default: + panic("invalid join kind") + } +} + +func (op joinOp) String() string { + switch op.kind { + case joinOpCross: + return fmt.Sprintf("Join(/* table omitted */, %#v, %#v, %d)", op.columnsToMatch, op.columnsToAdd, op.reserveBits) + case joinOpNatural: + return fmt.Sprintf("NaturalJoin(/* table omitted */, %#v, %#v)", op.columnsToMatch, op.columnsToAdd) + case joinOpExact: + return fmt.Sprintf("ExactJoin(/* table omitted */, %#v, %#v", op.columnsToMatch, op.columnsToAdd) + default: + panic("unreachable") + } +} + +// Join joins data from a pair of tables - a left and right table - based upon a set of match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys, and keys can be constructed from multiple values. +// +// The output table contains rows that have matching values in both tables. +// Rows that do not have matching criteria will not be included in the result. +// If there are multiple matches between a row from the left table and rows from the right table, all matching combinations will be included. +// If no match columns are specified, every combination of left and right table rows is included. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +// +// reserveBits is the number of bits of key-space to initially reserve per group. Set it to 10 if you are unsure. +func (qb QueryNode) Join(rightTable QueryNode, matchOn []string, joins []string, reserveBits int32) QueryNode { + op := joinOp{ + leftTable: qb, + rightTable: rightTable, + columnsToMatch: matchOn, + columnsToAdd: joins, + reserveBits: reserveBits, + kind: joinOpCross, + } + return qb.addOp(op) +} + +// ExactJoin joins data from a pair of tables - a left and right table - based upon a set of match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys, and keys can be constructed from multiple values. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns appended to the left table, row values equal the row values from the right table where the key values in the left and right tables are equal. +// If there are zero or multiple matches, the operation will fail. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +func (qb QueryNode) ExactJoin(rightTable QueryNode, matchOn []string, joins []string) QueryNode { + op := joinOp{ + leftTable: qb, + rightTable: rightTable, + columnsToMatch: matchOn, + columnsToAdd: joins, + kind: joinOpExact, + } + return qb.addOp(op) +} + +// NaturalJoin joins data from a pair of tables - a left and right table - based upon one or more match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns appended to the left table, row values equal the row values from the right table where the key values in the left and right tables are equal. +// If there is no matching key in the right table, appended row values are NULL. If there are multiple matches, the operation will fail. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +func (qb QueryNode) NaturalJoin(rightTable QueryNode, matchOn []string, joins []string) QueryNode { + op := joinOp{ + leftTable: qb, + rightTable: rightTable, + columnsToMatch: matchOn, + columnsToAdd: joins, + kind: joinOpNatural, + } + return qb.addOp(op) +} + +// A comparison rule for use with AsOfJoin. +// See its documentation for more details. +type MatchRule int + +const ( + MatchRuleLessThanEqual MatchRule = iota // Less-than-or-equal, used for an as-of join. + MatchRuleLessThan + MatchRuleGreaterThanEqual // Greater-than-or-equal, used for a reverse as-of join. + MatchRuleGreaterThan +) + +// toGrpcMatchRule converts one of the user-friendly match rule constants to the corresponding gRPC match rule enum variants. +func (mr MatchRule) toGrpcMatchRule() tablepb2.AsOfJoinTablesRequest_MatchRule { + switch mr { + case MatchRuleLessThanEqual: + return tablepb2.AsOfJoinTablesRequest_LESS_THAN_EQUAL + case MatchRuleLessThan: + return tablepb2.AsOfJoinTablesRequest_LESS_THAN + case MatchRuleGreaterThanEqual: + return tablepb2.AsOfJoinTablesRequest_GREATER_THAN_EQUAL + case MatchRuleGreaterThan: + return tablepb2.AsOfJoinTablesRequest_GREATER_THAN + default: + panic("invalid match rule") + } +} + +func (mr MatchRule) String() string { + if mr < 0 || mr >= 4 { + return "invalid match rule" + } else { + names := []string{"MatchRuleLessThanEqual", "MatchRuleLessThan", "MatchRuleGreaterThanEqual", "MatchRuleGreaterThan"} + return names[mr] + } +} + +type asOfJoinOp struct { + leftTable QueryNode + rightTable QueryNode + columnsToMatch []string + columnsToAdd []string + matchRule MatchRule +} + +func (op asOfJoinOp) childQueries() []QueryNode { + return []QueryNode{op.leftTable, op.rightTable} +} + +func (op asOfJoinOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == 2, "wrong number of children for AsOfJoin") + + leftId := children[0] + rightId := children[1] + matchRule := op.matchRule.toGrpcMatchRule() + + req := &tablepb2.AsOfJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: op.columnsToMatch, ColumnsToAdd: op.columnsToAdd, AsOfMatchRule: matchRule} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_AsOfJoin{AsOfJoin: req}} +} + +func (op asOfJoinOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == 2, "wrong number of children for AsOfJoin") + + leftTbl := children[0] + rightTbl := children[1] + + return stub.asOfJoin(ctx, leftTbl, rightTbl, op.columnsToMatch, op.columnsToAdd, op.matchRule) +} + +func (op asOfJoinOp) String() string { + return fmt.Sprintf("AsOfJoin(/* table omitted */, %#v, %#v, %s)", op.columnsToMatch, op.columnsToAdd, op.matchRule) +} + +// AsOfJoin joins data from a pair of tables - a left and right table - based upon one or more match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys. +// +// When using AsOfJoin, the first N-1 match columns are exactly matched. +// The last match column is used to find the key values from the right table that are closest to the values in the left table without going over the left value. +// For example, when using MatchRuleLessThanEqual, +// if the right table contains a value 5 and the left table contains values 4 and 6, the right table's 5 will be matched on the left table's 6. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns optionally appended to the left table, row values equal the row values from the right table where the keys from the left table most closely match the keys from the right table, as defined above. +// If there is no matching key in the right table, appended row values are NULL. +// +// matchColumns is the columns to match. +// +// joins is the columns to add from the right table. +// +// matchRule is the match rule for the join. +// Use MatchRuleLessThanEqual for a normal as-of join, or MatchRuleGreaterThanEqual for a reverse-as-of-join. +func (qb QueryNode) AsOfJoin(rightTable QueryNode, matchColumns []string, joins []string, matchRule MatchRule) QueryNode { + op := asOfJoinOp{ + leftTable: qb, + rightTable: rightTable, + columnsToMatch: matchColumns, + columnsToAdd: joins, + matchRule: matchRule, + } + return qb.addOp(op) +} + +type mergeOp struct { + children []QueryNode + sortBy string +} + +func (op mergeOp) childQueries() []QueryNode { + return op.children +} + +func (op mergeOp) makeBatchOp(resultId *ticketpb2.Ticket, children []*tablepb2.TableReference) tablepb2.BatchTableRequest_Operation { + assert(len(children) == len(op.children), "wrong number of children for Merge") + assert(len(children) != 0, "cannot make an empty Merge into a batch operation") + + req := &tablepb2.MergeTablesRequest{ResultId: resultId, SourceIds: children, KeyColumn: op.sortBy} + return tablepb2.BatchTableRequest_Operation{Op: &tablepb2.BatchTableRequest_Operation_Merge{Merge: req}} +} + +func (op mergeOp) execSerialOp(ctx context.Context, stub *tableStub, children []*TableHandle) (*TableHandle, error) { + assert(len(children) == len(op.children), "wrong number of children for Merge") + + if len(children) == 0 { + return nil, ErrEmptyMerge + } + + return stub.merge(ctx, op.sortBy, children) +} + +func (op mergeOp) String() string { + return fmt.Sprintf("MergeQuery(%s, /* %d tables omitted */)", op.sortBy, len(op.children)) +} + +// MergeQuery combines two or more tables into one table as part of a query. +// This essentially appends the tables on top of each other. +// +// If sortBy is provided, the resulting table will be sorted based on that column. +// +// "nil Table" nodes (i.e. QueryNodes returned from calling Query() on a nil *TableHandle) are ignored. +// +// At least one non-nil query node must be provided, otherwise an ErrEmptyMerge will be returned by ExecSerial or ExecBatch. +func MergeQuery(sortBy string, tables ...QueryNode) QueryNode { + var nonNilTables []QueryNode + for _, table := range tables { + if table.index != -1 || table.builder.table != nil { + nonNilTables = append(nonNilTables, table) + } + } + + if len(nonNilTables) == 0 { + // A merge with no tables will always error, + // but since we can't return an error from this method + // we have to let ExecSerial or ExecBatch handle the error. + emptyNode := QueryNode{builder: &queryBuilder{}} + return emptyNode.addOp(mergeOp{children: tables, sortBy: sortBy}) + } + + // Just pick an arbitrary node to add the operation to. + qb := nonNilTables[0] + + return qb.addOp(mergeOp{children: nonNilTables, sortBy: sortBy}) +} diff --git a/go/pkg/client/query_test.go b/go/pkg/client/query_test.go new file mode 100644 index 00000000000..5e6359b5e16 --- /dev/null +++ b/go/pkg/client/query_test.go @@ -0,0 +1,1153 @@ +package client_test + +import ( + "context" + "errors" + "sort" + "testing" + "time" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/apache/arrow/go/v8/arrow/array" + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +// execBatchOrSerial can be either (*client.Client).ExecBatch or (*client.Client).ExecSerial. +type execBatchOrSerial func(*client.Client, context.Context, ...client.QueryNode) ([]*client.TableHandle, error) + +func TestDagQueryBatched(t *testing.T) { + dagQuery(t, (*client.Client).ExecBatch) +} + +func TestDagQuerySerial(t *testing.T) { + dagQuery(t, (*client.Client).ExecSerial) +} + +func dagQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + rec := test_tools.ExampleRecord() + defer rec.Release() + + // Close (float32), Volume (int32), Ticker (string) + exTable, err := c.ImportTable(ctx, rec) + test_tools.CheckError(t, "ImportTable", err) + defer exTable.Release(ctx) + + // Close (float32), Volume (int32), TickerLen (int) + exLenQuery := exTable.Query(). + Update("TickerLen = Ticker.length()"). + DropColumns("Ticker") + + // Close (float32), TickerLen (int) + exCloseLenQuery := exLenQuery. + Update("TickerLen = TickerLen + Volume"). + DropColumns("Volume") + + // Close (float32), TickerLen (int) + otherQuery := c.EmptyTableQuery(5). + Update("Close = (float)(ii / 3.0)", "TickerLen = (int)(ii + 1)") + + // Close (float32), TickerLen (int) + finalQuery := client.MergeQuery("", otherQuery, exCloseLenQuery) + + tables, err := exec(c, ctx, finalQuery, otherQuery, exCloseLenQuery, exLenQuery) + test_tools.CheckError(t, "ExecBatch", err) + if len(tables) != 4 { + t.Errorf("wrong number of tables") + return + } + + finalTable, err := tables[0].Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + otherTable, err := tables[1].Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + exCloseLenTable, err := tables[2].Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + exLenTable, err := tables[3].Snapshot(ctx) + test_tools.CheckError(t, "Snapsnot", err) + + if finalTable.NumRows() != 5+7 || finalTable.NumCols() != 2 { + t.Errorf("wrong size for finalTable") + return + } + if otherTable.NumRows() != 5 || otherTable.NumCols() != 2 { + t.Errorf("wrong size for otherTable") + return + } + if exCloseLenTable.NumRows() != 7 || exCloseLenTable.NumCols() != 2 { + t.Log(exCloseLenTable) + t.Errorf("wrong size for exCloseLenTable") + return + } + if exLenTable.NumRows() != 7 || exLenTable.NumCols() != 3 { + t.Log(exLenTable) + t.Errorf("wrong size for exLenTable") + return + } + + for _, tbl := range tables { + err = tbl.Release(ctx) + test_tools.CheckError(t, "Release", err) + } +} + +func TestMergeQueryBatched(t *testing.T) { + mergeQuery(t, (*client.Client).ExecBatch) +} + +func TestMergeQuerySerial(t *testing.T) { + mergeQuery(t, (*client.Client).ExecSerial) +} + +func mergeQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + left, err := c.EmptyTable(ctx, 10) + test_tools.CheckError(t, "EmptyTable", err) + defer left.Release(ctx) + + right, err := c.EmptyTable(ctx, 5) + test_tools.CheckError(t, "EmptyTable", err) + defer right.Release(ctx) + + tables, err := exec(c, ctx, client.MergeQuery("", left.Query(), right.Query())) + test_tools.CheckError(t, "ExecBatch", err) + if len(tables) != 1 { + t.Errorf("wrong number of tables") + } + + tbl, err := tables[0].Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + + if tbl.NumRows() != 15 || tbl.NumCols() != 0 { + t.Errorf("table was wrong size") + } + + err = tables[0].Release(ctx) + test_tools.CheckError(t, "Release", err) +} + +func TestNullMergeQueryBatched(t *testing.T) { + nullMergeQuery(t, (*client.Client).ExecBatch) +} + +func TestNullMergeQuerySerial(t *testing.T) { + nullMergeQuery(t, (*client.Client).ExecSerial) +} + +func nullMergeQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + left, err := c.EmptyTable(ctx, 10) + test_tools.CheckError(t, "EmptyTable", err) + defer left.Release(ctx) + + var right *client.TableHandle + + tables, err := exec(c, ctx, client.MergeQuery("", left.Query(), right.Query())) + test_tools.CheckError(t, "ExecBatch", err) + if len(tables) != 1 { + t.Errorf("wrong number of tables") + } + + tbl, err := tables[0].Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + + if tbl.NumRows() != 10 || tbl.NumCols() != 0 { + t.Errorf("table was wrong size") + } + + err = tables[0].Release(ctx) + test_tools.CheckError(t, "Release", err) +} + +func TestExportNullTableQueryBatched(t *testing.T) { + exportNullTableQuery(t, (*client.Client).ExecBatch) +} + +func TestExportNullTableQuerySerial(t *testing.T) { + exportNullTableQuery(t, (*client.Client).ExecSerial) +} + +func exportNullTableQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + var nullTbl *client.TableHandle + + _, err = exec(c, ctx, nullTbl.Query()) + if !errors.Is(err, client.ErrInvalidTableHandle) { + t.Error("wrong or missing error:", err) + return + } +} + +func TestNullTableArgQueryBatched(t *testing.T) { + nullTableArgQuery(t, (*client.Client).ExecBatch) +} + +func TestNullTableArgQuerySerial(t *testing.T) { + nullTableArgQuery(t, (*client.Client).ExecSerial) +} + +func nullTableArgQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + var nullTbl *client.TableHandle + + query := nullTbl.Query().Update("foo = i") + + _, err = exec(c, ctx, query) + if !errors.Is(err, client.ErrInvalidTableHandle) { + t.Error("wrong or missing error:", err) + return + } +} + +func TestEmptyMergeBatched(t *testing.T) { + emptyMerge(t, (*client.Client).ExecBatch) +} + +func TestEmptyMergeSerial(t *testing.T) { + emptyMerge(t, (*client.Client).ExecSerial) +} + +func emptyMerge(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + invalidMerge := client.MergeQuery("") + + _, err = exec(c, ctx, invalidMerge) + if !errors.Is(err, client.ErrEmptyMerge) { + t.Error("empty merge returned wrong or missing error", err) + } +} + +func TestTableNotReleasedBatched(t *testing.T) { + tableNotReleasedQuery(t, (*client.Client).ExecBatch) +} + +func TestTableNotReleasedSerial(t *testing.T) { + tableNotReleasedQuery(t, (*client.Client).ExecSerial) +} + +// Tests that query operations don't accidentally release their inputs. +func tableNotReleasedQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + inTable, err := c.EmptyTable(ctx, 10) + if err != nil { + t.Errorf("EmptyTable %s", err.Error()) + } + defer inTable.Release(ctx) + + query := inTable.Query().Update("foo = i") + + outTables, err := exec(c, ctx, query) + if err != nil { + t.Errorf("exec %s", err.Error()) + } + outTable1 := outTables[0] + defer outTable1.Release(ctx) + + // If the query released its inputs, this will fail. + rec, err := inTable.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + } + defer rec.Release() +} + +func TestSeparateQueriesBatched(t *testing.T) { + separateQueries(t, (*client.Client).ExecBatch) +} + +func TestSeparateQueriesSerial(t *testing.T) { + separateQueries(t, (*client.Client).ExecSerial) +} + +func separateQueries(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + left := c.EmptyTableQuery(123) + right := c.TimeTableQuery(10000000, time.Now()) + + tables, err := c.ExecBatch(ctx, left, right) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return + } + if len(tables) != 2 { + t.Errorf("wrong number of tables") + return + } + defer tables[0].Release(ctx) + defer tables[1].Release(ctx) + + leftTbl, err := tables[0].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + rightTbl, err := tables[1].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + if leftTbl.NumCols() != 0 { + t.Errorf("wrong left table") + return + } + if rightTbl.NumCols() != 1 { + t.Errorf("wrong right table") + return + } +} + +func TestEmptyTableQueryBatched(t *testing.T) { + emptyTableQuery(t, (*client.Client).ExecBatch) +} + +func TestEmptyTableQuerySerial(t *testing.T) { + emptyTableQuery(t, (*client.Client).ExecSerial) +} + +func emptyTableQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + base := c.EmptyTableQuery(123) + + derived := base.Update("a = ii") + + tables, err := exec(c, ctx, base, derived) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return + } + if len(tables) != 2 { + t.Errorf("wrong number of tables") + return + } + + baseTbl, err := tables[0].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + derivedTbl, err := tables[1].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + if baseTbl.NumRows() != 123 || baseTbl.NumCols() != 0 { + t.Errorf("base table had wrong size") + return + } + + if derivedTbl.NumRows() != 123 || derivedTbl.NumCols() != 1 { + t.Errorf("derived table had wrong size") + return + } + + for _, tbl := range tables { + err = tbl.Release(ctx) + test_tools.CheckError(t, "Release", err) + } +} + +func TestUpdateDropQueryBatched(t *testing.T) { + updateDropQuery(t, (*client.Client).ExecBatch) +} + +func TestUpdateDropQuerySerial(t *testing.T) { + updateDropQuery(t, (*client.Client).ExecSerial) +} + +func updateDropQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + input := test_tools.ExampleRecord() + defer input.Release() + + before, err := c.ImportTable(ctx, input) + if err != nil { + t.Errorf("ImportTable %s", err.Error()) + return + } + defer before.Release(ctx) + + updateQuery := before.Query().Update("Foo = Close * 17.0", "Bar = Volume + 1") + dropQuery := updateQuery.DropColumns("Bar", "Ticker") + + tables, err := exec(c, ctx, updateQuery, dropQuery) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return + } + if len(tables) != 2 { + t.Errorf("wrong number of result tables") + return + } + + updTbl, err := tables[0].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + drpTbl, err := tables[1].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + if updTbl.NumCols() != 5 { + t.Errorf("wrong number of columns %d", updTbl.NumCols()) + } + + if drpTbl.NumCols() != 3 { + t.Errorf("wrong number of columns %d", drpTbl.NumCols()) + return + } + + col0, col1, col2 := drpTbl.ColumnName(0), drpTbl.ColumnName(1), drpTbl.ColumnName(2) + if col0 != "Close" || col1 != "Volume" || col2 != "Foo" { + t.Errorf("wrong columns %s %s %s", col0, col1, col2) + return + } + + for _, tbl := range tables { + err = tbl.Release(ctx) + test_tools.CheckError(t, "Release", err) + } +} + +func TestDuplicateQueryBatched(t *testing.T) { + duplicateQuery(t, (*client.Client).ExecBatch) +} + +func TestDuplicateQuerySerial(t *testing.T) { + duplicateQuery(t, (*client.Client).ExecSerial) +} + +func duplicateQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + return + } + defer c.Close() + + query1 := c.EmptyTableQuery(10).Update("b = ii + 2") + query2 := query1.Update("a = ii * 3") + + tables, err := exec(c, ctx, query2, query1, query2, query1) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return + } + + var records []arrow.Record + for _, tbl := range tables { + rec, err := tbl.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + defer rec.Release() + + records = append(records, rec) + } + + if records[0].NumCols() != 2 || records[2].NumCols() != 2 { + t.Errorf("query2 had wrong size") + } + + if records[1].NumCols() != 1 || records[3].NumCols() != 1 { + t.Errorf("query1 had wrong size") + } + + for _, tbl := range tables { + err = tbl.Release(ctx) + test_tools.CheckError(t, "Release", err) + } +} + +func TestInvalidTableQueryBatched(t *testing.T) { + invalidTableQuery(t, (*client.Client).ExecBatch) +} + +func TestInvalidTableQuerySerial(t *testing.T) { + invalidTableQuery(t, (*client.Client).ExecSerial) +} + +func invalidTableQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + return + } + defer c.Close() + + tbl := &client.TableHandle{} + + node1 := tbl.Query().Update("foo = i") + node2 := client.MergeQuery("", node1, node1) + + _, err = exec(c, ctx, node1) + if !errors.Is(err, client.ErrInvalidTableHandle) { + t.Errorf("query on invalid table returned wrong error %s", err) + return + } + + _, err = exec(c, ctx, node2) + if !errors.Is(err, client.ErrInvalidTableHandle) { + t.Errorf("query on invalid table returned wrong error %s", err) + return + } +} + +type queryOp func(*client.TableHandle) []client.QueryNode + +func doQueryTest(inputRec arrow.Record, t *testing.T, exec execBatchOrSerial, op queryOp) []arrow.Record { + defer inputRec.Release() + + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + input, err := c.ImportTable(ctx, inputRec) + if err != nil { + t.Errorf("ImportTable %s", err.Error()) + return nil + } + defer input.Release(ctx) + + query := op(input) + + tables, err := exec(c, ctx, query...) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return nil + } + + var recs []arrow.Record + for _, table := range tables { + rec, err := table.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return nil + } + recs = append(recs, rec) + err = table.Release(ctx) + if err != nil { + t.Errorf("Release %s", err.Error()) + return nil + } + } + + return recs +} + +func TestEmptyUpdateQueryBatched(t *testing.T) { + emptyUpdateQuery(t, (*client.Client).ExecBatch) +} + +func TestEmptyUpdateQuerySerial(t *testing.T) { + emptyUpdateQuery(t, (*client.Client).ExecSerial) +} + +func emptyUpdateQuery(t *testing.T, exec execBatchOrSerial) { + result := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().Update()} + }) + defer result[0].Release() +} + +func TestEmptyQueryBatched(t *testing.T) { + emptyQuery(t, (*client.Client).ExecBatch) +} + +func TestEmptyQuerySerial(t *testing.T) { + emptyQuery(t, (*client.Client).ExecSerial) +} + +func emptyQuery(t *testing.T, exec execBatchOrSerial) { + doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{} + }) +} + +func TestNoopQueryBatched(t *testing.T) { + noopQuery(t, (*client.Client).ExecBatch) +} + +func TestNoopQuerySerial(t *testing.T) { + noopQuery(t, (*client.Client).ExecSerial) +} + +func noopQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query()} + }) + defer results[0].Release() + + if results[0].NumCols() != 2 || results[0].NumRows() != 30 { + t.Errorf("result had wrong size") + } +} + +func TestSortQueryBatched(t *testing.T) { + sortQuery(t, (*client.Client).ExecBatch) +} + +func TestSortQuerySerial(t *testing.T) { + sortQuery(t, (*client.Client).ExecSerial) +} + +func sortQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 10, 1000), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().Sort("a"), tbl.Query().SortBy(client.SortDsc("a"))} + }) + defer results[0].Release() + defer results[1].Release() + + asc := results[0].Column(0).(*array.Int32).Int32Values() + + if !sort.SliceIsSorted(asc, func(i, j int) bool { return asc[i] < asc[j] }) { + t.Error("Slice was not sorted ascending:", asc) + return + } + + dsc := results[1].Column(0).(*array.Int32).Int32Values() + + if !sort.SliceIsSorted(dsc, func(i, j int) bool { return dsc[i] > dsc[j] }) { + t.Error("Slice was not sorted descending:", dsc) + return + } +} + +func TestHeadTailQueryBatched(t *testing.T) { + headTailQuery(t, (*client.Client).ExecBatch) +} + +func TestHeadTailQuerySerial(t *testing.T) { + headTailQuery(t, (*client.Client).ExecSerial) +} + +func headTailQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 10, 1000), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().Head(3), tbl.Query().Tail(4)} + }) + defer results[0].Release() + defer results[1].Release() + + if results[0].NumRows() != 3 { + t.Error("Head returned wrong size") + return + } + + if results[1].NumRows() != 4 { + t.Error("Tail returned wrong size") + return + } +} + +func TestSelectDistinctQueryBatched(t *testing.T) { + selectDistinctQuery(t, (*client.Client).ExecBatch) +} + +func TestSelectDistinctQuerySerial(t *testing.T) { + selectDistinctQuery(t, (*client.Client).ExecSerial) +} + +func selectDistinctQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 20, 10), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().SelectDistinct("a")} + }) + defer results[0].Release() + + if results[0].NumCols() != 1 || results[0].NumRows() > 10 { + t.Errorf("SelectDistinct had wrong size %d x %d", results[0].NumCols(), results[0].NumRows()) + return + } +} + +func TestComboAggQueryBatched(t *testing.T) { + comboAggQuery(t, (*client.Client).ExecBatch) +} + +func TestComboAggQuerySerial(t *testing.T) { + comboAggQuery(t, (*client.Client).ExecSerial) +} + +func comboAggQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(4, 20, 10), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + b := client.NewAggBuilder().Min("minB = b").Sum("sumC = c") + return []client.QueryNode{tbl.Query().AggBy(b, "a")} + }) + defer results[0].Release() + + if results[0].NumCols() != 3 || results[0].NumRows() > 10 { + t.Errorf("ComboAgg had wrong size %d x %d", results[0].NumCols(), results[0].NumRows()) + return + } +} + +func TestWhereQueryBatched(t *testing.T) { + whereQuery(t, (*client.Client).ExecBatch) +} + +func TestWhereQuerySerial(t *testing.T) { + whereQuery(t, (*client.Client).ExecSerial) +} + +func whereQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.ExampleRecord(), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().Where("Volume % 1000 != 0")} + }) + defer results[0].Release() + + if results[0].NumCols() != 3 || results[0].NumRows() != 3 { + t.Error("Where had wrong size") + return + } +} + +func TestUpdateViewSelectQueryBatched(t *testing.T) { + updateViewSelectQuery(t, (*client.Client).ExecBatch) +} + +func TestUpdateViewSelectQuerySerial(t *testing.T) { + updateViewSelectQuery(t, (*client.Client).ExecSerial) +} + +func updateViewSelectQuery(t *testing.T, exec execBatchOrSerial) { + type usvOp func(qb client.QueryNode, columns ...string) client.QueryNode + + ops := []usvOp{client.QueryNode.Update, client.QueryNode.LazyUpdate, client.QueryNode.View, client.QueryNode.UpdateView, client.QueryNode.Select} + + for _, op := range ops { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{op(tbl.Query(), "Sum = a + b", "b", "Foo = Sum % 2")} + }) + defer results[0].Release() + + if results[0].NumCols() < 3 || results[0].NumRows() != 30 { + t.Errorf("result had wrong size %d x %d", results[0].NumCols(), results[0].NumRows()) + return + } + } +} + +func TestExactJoinQueryBatched(t *testing.T) { + exactJoinQuery(t, (*client.Client).ExecBatch) +} + +func TestExactJoinQuerySerial(t *testing.T) { + exactJoinQuery(t, (*client.Client).ExecSerial) +} + +func exactJoinQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(5, 100, 50), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + query := tbl.Query().GroupBy("a").Update("b = b[0]", "c = c[0]", "d = d[0]", "e = e[0]") // Make sure the key column is only unique values + leftTable := query.DropColumns("c", "d", "e") + rightTable := query.DropColumns("b", "c") + resultTable := leftTable.ExactJoin(rightTable, []string{"a"}, []string{"d", "e"}) + return []client.QueryNode{leftTable, resultTable} + }) + defer results[0].Release() + defer results[1].Release() + + leftTable, resultTable := results[0], results[1] + if resultTable.NumCols() != 4 || resultTable.NumRows() != leftTable.NumRows() { + t.Errorf("result table had wrong size %d x %d", resultTable.NumCols(), resultTable.NumRows()) + return + } +} + +func TestNaturalJoinQueryBatched(t *testing.T) { + naturalJoinQuery(t, (*client.Client).ExecBatch) +} + +func TestNaturalJoinQuerySerial(t *testing.T) { + naturalJoinQuery(t, (*client.Client).ExecSerial) +} + +func naturalJoinQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(5, 100, 50), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + query := tbl.Query().GroupBy("a").Update("b = b[0]", "c = c[0]", "d = d[0]", "e = e[0]") // Make sure the key column is only unique values + leftTable := query.DropColumns("c", "d", "e") + rightTable := query.DropColumns("b", "c").Head(10) + resultTable := leftTable.NaturalJoin(rightTable, []string{"a"}, []string{"d", "e"}) + return []client.QueryNode{leftTable, resultTable} + }) + defer results[0].Release() + defer results[1].Release() + + leftTable, resultTable := results[0], results[1] + if resultTable.NumCols() != 4 || resultTable.NumRows() != leftTable.NumRows() { + t.Errorf("result table had wrong size %d x %d", resultTable.NumCols(), resultTable.NumRows()) + return + } +} + +func TestCrossJoinQueryBatched(t *testing.T) { + crossJoinQuery(t, (*client.Client).ExecBatch) +} + +func TestCrossJoinQuerySerial(t *testing.T) { + crossJoinQuery(t, (*client.Client).ExecSerial) +} + +func crossJoinQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(5, 100, 50), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + leftTable := tbl.Query().DropColumns("e") + rightTable := tbl.Query().Where("a % 2 > 0 && b % 3 == 1").DropColumns("b", "c", "d") + resultTbl1 := leftTable.Join(rightTable, []string{"a"}, []string{"e"}, 10) + resultTbl2 := leftTable.Join(rightTable, nil, []string{"e"}, 10) + return []client.QueryNode{leftTable, rightTable, resultTbl1, resultTbl2} + }) + defer results[0].Release() + defer results[1].Release() + defer results[2].Release() + defer results[3].Release() + + left, _, result1, result2 := results[0], results[1], results[2], results[3] + + if result1.NumRows() >= left.NumRows() { + t.Error("result1 was too large") + return + } + + if result2.NumRows() <= left.NumRows() { + t.Error("result2 was too small") + return + } +} + +func TestAsOfJoinQuery(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + startTime := time.Now().Add(time.Duration(-2) * time.Second) + + tt1 := c.TimeTableQuery(100000, startTime).Update("Col1 = i") + tt2 := c.TimeTableQuery(200000, startTime).Update("Col1 = i") + + normalTable := tt1.AsOfJoin(tt2, []string{"Col1", "Timestamp"}, nil, client.MatchRuleLessThanEqual) + reverseTable := tt1.AsOfJoin(tt2, []string{"Col1", "Timestamp"}, nil, client.MatchRuleGreaterThanEqual) + + tables, err := c.ExecBatch(ctx, tt1, normalTable, reverseTable) + if err != nil { + t.Errorf("ExecBatch %s", err.Error()) + return + } + if len(tables) != 3 { + t.Errorf("wrong number of tables") + return + } + defer tables[0].Release(ctx) + defer tables[1].Release(ctx) + defer tables[2].Release(ctx) + + ttRec, err := tables[0].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + normalRec, err := tables[1].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + reverseRec, err := tables[2].Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return + } + + if normalRec.NumRows() == 0 || normalRec.NumRows() > ttRec.NumRows() { + t.Error("record had wrong size") + return + } + + if reverseRec.NumRows() == 0 || reverseRec.NumRows() > ttRec.NumRows() { + t.Error("record had wrong size") + return + } +} + +func TestHeadByTailByQueryBatched(t *testing.T) { + headByTailByQuery(t, (*client.Client).ExecBatch) +} + +func TestHeadByTailByQuerySerial(t *testing.T) { + headByTailByQuery(t, (*client.Client).ExecSerial) +} + +func headByTailByQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(3, 10, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + query := tbl.Query() + headTbl := query.HeadBy(1, "a") + tailTbl := query.TailBy(1, "b") + return []client.QueryNode{headTbl, tailTbl} + }) + defer results[0].Release() + defer results[1].Release() + + headTbl, tailTbl := results[0], results[1] + if headTbl.NumRows() > 5 { + t.Errorf("head table had wrong size %d", headTbl.NumRows()) + return + } + if tailTbl.NumRows() > 5 { + t.Errorf("tail table had wrong size %d", tailTbl.NumRows()) + return + } +} + +func TestGroupQueryBatched(t *testing.T) { + groupQuery(t, (*client.Client).ExecBatch) +} + +func TestGroupQuerySerial(t *testing.T) { + groupQuery(t, (*client.Client).ExecSerial) +} + +func groupQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + query := tbl.Query() + oneCol := query.GroupBy("a") + bothCols := query.GroupBy() + return []client.QueryNode{oneCol, bothCols} + }) + defer results[0].Release() + defer results[1].Release() + + oneCol, bothCols := results[0], results[1] + if oneCol.NumRows() > 5 { + t.Errorf("one-column-grouped table had wrong size %d", oneCol.NumRows()) + return + } + if bothCols.NumRows() > 25 { + t.Errorf("all-grouped table had wrong size %d", bothCols.NumRows()) + return + } +} + +func TestUngroupQueryBatched(t *testing.T) { + ungroupQuery(t, (*client.Client).ExecBatch) +} + +func TestUngroupQuerySerial(t *testing.T) { + ungroupQuery(t, (*client.Client).ExecSerial) +} + +func ungroupQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + ungrouped := tbl.Query().GroupBy("a").Ungroup([]string{"b"}, false) + return []client.QueryNode{ungrouped} + }) + defer results[0].Release() + + ungrouped := results[0] + if ungrouped.NumRows() != 30 { + t.Errorf("table had wrong size %d", ungrouped.NumRows()) + return + } +} + +func TestCountByQueryBatched(t *testing.T) { + countByQuery(t, (*client.Client).ExecBatch) +} + +func TestCountByQuerySerial(t *testing.T) { + countByQuery(t, (*client.Client).ExecSerial) +} + +func countByQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + query := tbl.Query() + distinct := query.SelectDistinct("a") + counted := query.CountBy("Counted", "a") + return []client.QueryNode{distinct, counted} + }) + defer results[0].Release() + + distinct, counted := results[0], results[1] + + if distinct.NumRows() != counted.NumRows() || counted.NumCols() != 2 { + t.Errorf("table had wrong size %d x %d (expected %d by %d)", counted.NumCols(), counted.NumRows(), 3, distinct.NumRows()) + } +} + +func TestCountQueryBatched(t *testing.T) { + countQuery(t, (*client.Client).ExecBatch) +} + +func TestCountQuerySerial(t *testing.T) { + countQuery(t, (*client.Client).ExecSerial) +} + +func countQuery(t *testing.T, exec execBatchOrSerial) { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{tbl.Query().Count("a")} + }) + defer results[0].Release() + + result := results[0].Column(0).(*array.Int64).Int64Values()[0] + if result != 30 { + t.Errorf("Count returned wrong value %d", result) + return + } +} + +func TestDedicatedAggQueryBatched(t *testing.T) { + dedicatedAggQuery(t, (*client.Client).ExecBatch) +} + +func TestDedicatedAggQuerySerial(t *testing.T) { + dedicatedAggQuery(t, (*client.Client).ExecSerial) +} + +func dedicatedAggQuery(t *testing.T, exec execBatchOrSerial) { + type AggOp = func(qb client.QueryNode, by ...string) client.QueryNode + + ops := []AggOp{ + client.QueryNode.FirstBy, client.QueryNode.LastBy, client.QueryNode.SumBy, client.QueryNode.AvgBy, client.QueryNode.StdBy, + client.QueryNode.VarBy, client.QueryNode.MedianBy, client.QueryNode.MinBy, client.QueryNode.MaxBy, client.QueryNode.AbsSumBy} + + for _, op := range ops { + results := doQueryTest(test_tools.RandomRecord(2, 30, 5), t, exec, func(tbl *client.TableHandle) []client.QueryNode { + return []client.QueryNode{op(tbl.Query(), "a")} + }) + defer results[0].Release() + + if results[0].NumRows() > 5 { + t.Errorf("table had wrong size %d", results[0].NumRows()) + return + } + } +} + +func TestDifferentClientsBatched(t *testing.T) { + differentClientsQuery(t, (*client.Client).ExecBatch) +} + +func TestDifferentClientsSerial(t *testing.T) { + differentClientsQuery(t, (*client.Client).ExecSerial) +} + +func differentClientsQuery(t *testing.T, exec execBatchOrSerial) { + ctx := context.Background() + + client1, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer client1.Close() + + client2, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer client2.Close() + + table1, err := client1.EmptyTable(ctx, 5) + test_tools.CheckError(t, "EmptyTable", err) + defer table1.Release(ctx) + query1 := table1.Query() + + table2, err := client2.EmptyTable(ctx, 5) + test_tools.CheckError(t, "EmptyTable", err) + defer table2.Release(ctx) + query2 := table2.Query() + + type makeQueryOp func() client.QueryNode + + crossJoin := func() client.QueryNode { + return query1.Join(query2, nil, nil, 10) + } + exactJoin := func() client.QueryNode { + return query1.ExactJoin(query2, nil, nil) + } + naturalJoin := func() client.QueryNode { + return query1.NaturalJoin(query2, nil, nil) + } + asOfJoin := func() client.QueryNode { + return query1.AsOfJoin(query2, nil, nil, client.MatchRuleLessThanEqual) + } + merge := func() client.QueryNode { + return client.MergeQuery("", query1, query2) + } + + ops := []makeQueryOp{crossJoin, exactJoin, naturalJoin, asOfJoin, merge} + for _, op := range ops { + node := op() + _, err := exec(client1, ctx, node) + if !errors.Is(err, client.ErrDifferentClients) { + t.Errorf("missing or incorrect error %s", err) + return + } + } +} diff --git a/go/pkg/client/session_stub.go b/go/pkg/client/session_stub.go new file mode 100644 index 00000000000..33946ee3ed9 --- /dev/null +++ b/go/pkg/client/session_stub.go @@ -0,0 +1,204 @@ +package client + +import ( + "context" + "sync" + "time" + + sessionpb2 "github.com/deephaven/deephaven-core/go/internal/proto/session" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" + + "google.golang.org/grpc/metadata" +) + +// tokenResp protects the current session token (or an error in getting the session token). +type tokenResp struct { + Lock sync.Mutex + Token []byte + Error error +} + +// getToken returns the current token, or an error if an error has occurred at some point. +func (tk *tokenResp) getToken() ([]byte, error) { + tk.Lock.Lock() + defer tk.Lock.Unlock() + if tk.Error != nil { + return nil, tk.Error + } else { + token := make([]byte, len(tk.Token)) + copy(token, tk.Token) + return token, nil + } +} + +// setToken sets the session token to a new value. +func (tk *tokenResp) setToken(tok []byte) { + tk.Lock.Lock() + tk.Token = tok + tk.Lock.Unlock() +} + +// setError sets an error value for the session token. +func (tk *tokenResp) setError(err error) { + tk.Lock.Lock() + tk.Error = err + tk.Lock.Unlock() +} + +// A refresher stores the current client token and sends periodic keepalive messages to refresh the client token. +type refresher struct { + ctx context.Context + sessionStub sessionpb2.SessionServiceClient + + token *tokenResp // the actual client token, which gets periodically updated. + + cancelCh <-chan struct{} // if this channel closes, the refresher should stop. + + timeout time.Duration // time before the token should be refreshed again. +} + +// refreshLoop is an endless loop that will update the token when necessary. +// It can be canceled by closing the cancelCh channel. +func (ref *refresher) refreshLoop() { + for { + select { + case <-ref.cancelCh: + // Make sure that nobody accidentally tries + // to use a token after the client has closed. + ref.token.setError(ErrClosedClient) + return + case <-time.After(ref.timeout): + err := ref.refresh() + if err != nil { + // refresh() stores the error in the tokenResp struct, so it can be handled + // appropriately by all the client methods that need a token. + // Thus, we can discard it here. + return + } + } + } +} + +// startRefresher begins a background goroutine that continually refreshes the passed token so that it does not time out. +func startRefresher(ctx context.Context, sessionStub sessionpb2.SessionServiceClient, token *tokenResp, cancelCh <-chan struct{}) error { + handshakeReq := &sessionpb2.HandshakeRequest{AuthProtocol: 1, Payload: [](byte)("hello godeephaven")} + handshakeResp, err := sessionStub.NewSession(ctx, handshakeReq) + if err != nil { + return err + } + + ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs("deephaven_session_id", string(handshakeResp.SessionToken))) + + token.setToken(handshakeResp.SessionToken) + + timeoutMillis := handshakeResp.TokenExpirationDelayMillis / 2 + timeout := time.Duration(timeoutMillis) * time.Millisecond + + ref := refresher{ + ctx: ctx, + sessionStub: sessionStub, + + token: token, + + cancelCh: cancelCh, + + timeout: timeout, + } + + go ref.refreshLoop() + + return nil +} + +// refresh refreshes the client token. It makes a RefreshSessionToken request, +// and then updates the token struct. +func (ref *refresher) refresh() error { + oldToken, err := ref.token.getToken() + if err != nil { + return err + } + + ctx := metadata.NewOutgoingContext(ref.ctx, metadata.Pairs("deephaven_session_id", string(oldToken))) + handshakeReq := &sessionpb2.HandshakeRequest{AuthProtocol: 0, Payload: oldToken} + handshakeResp, err := ref.sessionStub.RefreshSessionToken(ctx, handshakeReq) + + if err != nil { + ref.token.setError(err) + return err + } else { + ref.token.setToken(handshakeResp.SessionToken) + } + + timeoutMillis := handshakeResp.TokenExpirationDelayMillis / 2 + ref.timeout = time.Duration(timeoutMillis) * time.Millisecond + + return nil +} + +// sessionStub wraps gRPC calls from session.proto, which includes the session/keepalive handling. +type sessionStub struct { + client *Client + stub sessionpb2.SessionServiceClient + + token *tokenResp // the client token, which is also shared with a refresher. + + cancelCh chan<- struct{} // closing this channel will stop the refresher. +} + +// Performs the first handshake to get a client token. +func newSessionStub(ctx context.Context, client *Client) (sessionStub, error) { + stub := sessionpb2.NewSessionServiceClient(client.grpcChannel) + + cancelCh := make(chan struct{}) + + tokenResp := &tokenResp{} + + err := startRefresher(ctx, stub, tokenResp, cancelCh) + if err != nil { + return sessionStub{}, err + } + + hs := sessionStub{ + client: client, + stub: stub, + + token: tokenResp, + + cancelCh: cancelCh, + } + + return hs, nil +} + +// getToken returns the current session token. +// It may return an error if there has been an error at some point in the past while refreshing the token. +func (hs *sessionStub) getToken() ([]byte, error) { + return hs.token.getToken() +} + +// release releases a table ticket to free its resources on the server. +func (hs *sessionStub) release(ctx context.Context, ticket *ticketpb2.Ticket) error { + ctx, err := hs.client.withToken(ctx) + if err != nil { + return err + } + + req := sessionpb2.ReleaseRequest{Id: ticket} + _, err = hs.stub.Release(ctx, &req) + if err != nil { + return err + } + return nil +} + +// Close closes the session stub and frees any associated resources. +// The session stub should not be used after calling this function. +// The token refresh loop will be stopped, +// and any attempts to access the session token will return an error. +// The client lock should be held when calling this function. +func (hs *sessionStub) Close() { + if hs.cancelCh != nil { + close(hs.cancelCh) + hs.cancelCh = nil + } +} diff --git a/go/pkg/client/table_stub.go b/go/pkg/client/table_stub.go new file mode 100644 index 00000000000..12a392ae73d --- /dev/null +++ b/go/pkg/client/table_stub.go @@ -0,0 +1,773 @@ +package client + +import ( + "context" + "errors" + "fmt" + "io" + "time" + + "github.com/apache/arrow/go/v8/arrow/flight" + "github.com/apache/arrow/go/v8/arrow/memory" + "google.golang.org/grpc" + + tablepb2 "github.com/deephaven/deephaven-core/go/internal/proto/table" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// A tableStub wraps table.proto gRPC requests. +type tableStub struct { + client *Client + + stub tablepb2.TableServiceClient // The stub for the table gRPC requests. +} + +// newTableStub creates a new table stub that can be used to make table gRPC requests. +func newTableStub(client *Client) tableStub { + stub := tablepb2.NewTableServiceClient(client.grpcChannel) + + return tableStub{client: client, stub: stub} +} + +// createInputTable simply wraps the CreateInputTable gRPC call and returns the resulting table. +// See inputTableStub for more details on how it is used. +func (ts *tableStub) createInputTable(ctx context.Context, req *tablepb2.CreateInputTableRequest) (*TableHandle, error) { + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + resp, err := ts.stub.CreateInputTable(ctx, req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// A batchSubError is an error when creating a table in a batch request. +// Several batchSubErrors can be combined into a batchError. +type batchSubError struct { + ServerErr error // The raw error returned by the server + ResultId *tablepb2.TableReference // The result ID of the table which caused the error +} + +// batchError is an error that might be returned by batch(). +// +// This struct is typically never displayed, and gets immediately wrapped in a QueryError. +type batchError struct { + // Since several tables in a batch might fail, a batchError is a list of individual errors, + // one for each table that failed. + subErrors []batchSubError +} + +func (err batchError) Error() string { + return fmt.Sprintf("batch error in %d tables", len(err.subErrors)) +} + +// batch executes a Batch request on the server and returns the resulting tables. +// Only the operations which were given a non-nil result ticket (the ResultId field) will be returned as tables. +// The tables will be returned in an arbitrary order. +// Each table's ticket will match exactly one result ticket in one of the operations, +// so this can be used to identify the tables and put them back in order. +// This may return a batchError. +func (ts *tableStub) batch(ctx context.Context, ops []*tablepb2.BatchTableRequest_Operation) ([]*TableHandle, error) { + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + req := tablepb2.BatchTableRequest{Ops: ops} + resp, err := ts.stub.Batch(ctx, &req) + if err != nil { + return nil, err + } + defer resp.CloseSend() + + exportedTables := []*TableHandle{} + + var batchErrors []batchSubError + + for { + created, err := resp.Recv() + if err == io.EOF { + break + } else if err != nil { + return nil, err + } + + if !created.Success { + subError := batchSubError{ + ServerErr: errors.New(created.GetErrorInfo()), + ResultId: created.ResultId, + } + batchErrors = append(batchErrors, subError) + } + + if created.Success { + if _, ok := created.ResultId.Ref.(*tablepb2.TableReference_Ticket); ok { + newTable, err := parseCreationResponse(ts.client, created) + if err != nil { + return nil, err + } + exportedTables = append(exportedTables, newTable) + } + } + } + + if len(batchErrors) > 0 { + return nil, batchError{subErrors: batchErrors} + } + + return exportedTables, nil +} + +// fetchTable exports (or re-exports) a table on the server so that it can be referred to by a new ticket. +func (ts *tableStub) fetchTable(ctx context.Context, oldTable *TableHandle) (*TableHandle, error) { + if !oldTable.IsValid() { + return nil, ErrInvalidTableHandle + } + + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + sourceId := tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: oldTable.ticket}} + resultId := ts.client.ticketFact.newTicket() + + req := tablepb2.FetchTableRequest{SourceId: &sourceId, ResultId: &resultId} + resp, err := ts.stub.FetchTable(ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// OpenTable opens a globally-scoped table with the given name on the server. +func (ts *tableStub) OpenTable(ctx context.Context, name string) (*TableHandle, error) { + fieldId := fieldId{appId: "scope", fieldName: name} + tbl, err := ts.client.getTable(ctx, fieldId) + if err != nil { + return nil, err + } + + if tbl != nil { + return ts.fetchTable(ctx, tbl) + } else { + return nil, errors.New("no table by the name " + name) + } +} + +// EmptyTableQuery is like EmptyTable, except it can be used as part of a query graph. +func (ts *tableStub) EmptyTableQuery(numRows int64) QueryNode { + qb := newQueryBuilder(nil) + qb.ops = append(qb.ops, emptyTableOp{numRows: numRows}) + return qb.curRootNode() +} + +// EmptyTable creates a new empty table in the global scope. +// +// The table will have zero columns and the specified number of rows. +func (ts *tableStub) EmptyTable(ctx context.Context, numRows int64) (*TableHandle, error) { + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + result := ts.client.ticketFact.newTicket() + + req := tablepb2.EmptyTableRequest{ResultId: &result, Size: numRows} + resp, err := ts.stub.EmptyTable(ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// TimeTableQuery is like TimeTable, except it can be used as part of a query graph. +func (ts *tableStub) TimeTableQuery(period time.Duration, startTime time.Time) QueryNode { + qb := newQueryBuilder(nil) + qb.ops = append(qb.ops, timeTableOp{period: period, startTime: startTime}) + return qb.curRootNode() +} + +// TimeTable creates a ticking time table in the global scope. +// The period is time between adding new rows to the table. +// The startTime is the time of the first row in the table. +func (ts *tableStub) TimeTable(ctx context.Context, period time.Duration, startTime time.Time) (*TableHandle, error) { + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + result := ts.client.ticketFact.newTicket() + + req := tablepb2.TimeTableRequest{ResultId: &result, PeriodNanos: period.Nanoseconds(), StartTimeNanos: startTime.UnixNano()} + resp, err := ts.stub.TimeTable(ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// parseCreationResponse turns a gRPC table creation response, which is returned by most table gRPC methods, into a usable TableHandle. +func parseCreationResponse(client *Client, resp *tablepb2.ExportedTableCreationResponse) (*TableHandle, error) { + if !resp.Success { + return nil, errors.New("server error: `" + resp.GetErrorInfo() + "`") + } + + respTicket := resp.ResultId.GetTicket() + if respTicket == nil { + return nil, errors.New("server response did not have ticket") + } + + schema, err := flight.DeserializeSchema(resp.SchemaHeader, memory.DefaultAllocator) + if err != nil { + return nil, err + } + + return newTableHandle(client, respTicket, schema, resp.Size, resp.IsStatic), nil +} + +// checkTableValidity returns an error if any of the provided tables +// are invalid or come from a different client than the tableStub. +// The tables must not be released before this method returns. +func (ts *tableStub) checkTableValidity(ctx context.Context, tables ...*TableHandle) error { + for _, table := range tables { + if !table.IsValid() { + return ErrInvalidTableHandle + } + + if table.client != ts.client { + return ErrDifferentClients + } + } + + return nil +} + +// dropColumns is a wrapper around the DropColumns gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) dropColumns(ctx context.Context, table *TableHandle, cols []string) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, table); err != nil { + return nil, err + } + + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + result := ts.client.ticketFact.newTicket() + + source := tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: table.ticket}} + + req := tablepb2.DropColumnsRequest{ResultId: &result, SourceId: &source, ColumnNames: cols} + resp, err := ts.stub.DropColumns(ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// selectOrUpdateOp is just a way to refer to one of the Update, View, UpdateView, Select, or LazyUpdate methods on the table stub. +type selectOrUpdateOp func(tablepb2.TableServiceClient, context.Context, *tablepb2.SelectOrUpdateRequest, ...grpc.CallOption) (*tablepb2.ExportedTableCreationResponse, error) + +// doSelectOrUpdate wraps Update, View, UpdateView, Select, and LazyUpdate gRPC requests. +// The table must not be released before this method returns. +func (ts *tableStub) doSelectOrUpdate(ctx context.Context, table *TableHandle, formulas []string, op selectOrUpdateOp) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, table); err != nil { + return nil, err + } + + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + result := ts.client.ticketFact.newTicket() + source := tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: table.ticket}} + + req := tablepb2.SelectOrUpdateRequest{ResultId: &result, SourceId: &source, ColumnSpecs: formulas} + resp, err := op(ts.stub, ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// update wraps the Update gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) update(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.doSelectOrUpdate(ctx, table, formulas, tablepb2.TableServiceClient.Update) +} + +// lazyUpdadte wraps the LazyUpdate gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) lazyUpdate(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.doSelectOrUpdate(ctx, table, formulas, tablepb2.TableServiceClient.LazyUpdate) +} + +// updateView wraps the UpdateView gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) updateView(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.doSelectOrUpdate(ctx, table, formulas, tablepb2.TableServiceClient.UpdateView) +} + +// view wraps the View gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) view(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.doSelectOrUpdate(ctx, table, formulas, tablepb2.TableServiceClient.View) +} + +// selectTbl wraps the Select gRPC request. +// The table must not be released before this method returns. +func (ts *tableStub) selectTbl(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.doSelectOrUpdate(ctx, table, formulas, tablepb2.TableServiceClient.Select) +} + +// makeRequest is a convenience function to perform all the boilerplate required to actually make a gRPC request. +// The op argument should simply create a request given the result and source ID and call the appropriate gRPC method. +// The table must not be released before this method returns. +func (ts *tableStub) makeRequest(ctx context.Context, table *TableHandle, op reqOp) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, table); err != nil { + return nil, err + } + + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + result := ts.client.ticketFact.newTicket() + source := tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: table.ticket}} + + resp, err := op(ctx, &result, &source) + + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +type ticket = ticketpb2.Ticket +type tblRef = tablepb2.TableReference +type tblResp = tablepb2.ExportedTableCreationResponse + +// A reqOp is a function that should perform a gRPC request. +type reqOp func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) + +// selectDistinct is a wrapper around the SelectDistinct gRPC operation. +func (ts *tableStub) selectDistinct(ctx context.Context, table *TableHandle, formulas []string) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + req := tablepb2.SelectDistinctRequest{ResultId: resultId, SourceId: sourceId, ColumnNames: formulas} + return ts.stub.SelectDistinct(ctx, &req) + }) +} + +// sortBy is a wrapper around the Sort gRPC operation. +func (ts *tableStub) sortBy(ctx context.Context, table *TableHandle, cols []SortColumn) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + var sorts []*tablepb2.SortDescriptor + for _, col := range cols { + var dir tablepb2.SortDescriptor_SortDirection + if col.descending { + dir = tablepb2.SortDescriptor_DESCENDING + } else { + dir = tablepb2.SortDescriptor_ASCENDING + } + + sort := tablepb2.SortDescriptor{ColumnName: col.colName, IsAbsolute: false, Direction: dir} + sorts = append(sorts, &sort) + } + + req := tablepb2.SortTableRequest{ResultId: resultId, SourceId: sourceId, Sorts: sorts} + return ts.stub.Sort(ctx, &req) + }) +} + +// where is a wrapper around the UnstructuredFilter gRPC operation. +func (ts *tableStub) where(ctx context.Context, table *TableHandle, filters []string) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + req := tablepb2.UnstructuredFilterTableRequest{ResultId: resultId, SourceId: sourceId, Filters: filters} + return ts.stub.UnstructuredFilter(ctx, &req) + }) +} + +// headOrTail is a wrapper around the Head and Tail gRPC operations (the isHead argument selects which one it is). +func (ts *tableStub) headOrTail(ctx context.Context, table *TableHandle, numRows int64, isHead bool) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + req := tablepb2.HeadOrTailRequest{ResultId: resultId, SourceId: sourceId, NumRows: numRows} + if isHead { + return ts.stub.Head(ctx, &req) + } else { + return ts.stub.Tail(ctx, &req) + } + }) +} + +// naturalJoin is a wrapper around the naturalJoin gRPC operation. +// The tables must not be released before this method returns. +func (ts *tableStub) naturalJoin(ctx context.Context, leftTable *TableHandle, rightTable *TableHandle, on []string, joins []string) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, leftTable, rightTable); err != nil { + return nil, err + } + + return ts.makeRequest(ctx, leftTable, func(ctx context.Context, resultId *ticket, leftId *tblRef) (*tblResp, error) { + rightId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: rightTable.ticket}} + req := tablepb2.NaturalJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: on, ColumnsToAdd: joins} + return ts.stub.NaturalJoinTables(ctx, &req) + }) +} + +// crossJoin is a wrapper around the crossJoin gRPC operation. +// The tables must not be released before this method returns. +func (ts *tableStub) crossJoin(ctx context.Context, leftTable *TableHandle, rightTable *TableHandle, on []string, joins []string, reserveBits int32) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, leftTable, rightTable); err != nil { + return nil, err + } + + return ts.makeRequest(ctx, leftTable, func(ctx context.Context, resultId *ticket, leftId *tblRef) (*tblResp, error) { + if !rightTable.IsValid() { + return nil, ErrInvalidTableHandle + } + rightId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: rightTable.ticket}} + req := tablepb2.CrossJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: on, ColumnsToAdd: joins, ReserveBits: reserveBits} + return ts.stub.CrossJoinTables(ctx, &req) + }) +} + +// exactJoin is a wrapper around the exactJoin gRPC operation. +// The tables must not be released before this method returns. +func (ts *tableStub) exactJoin(ctx context.Context, leftTable *TableHandle, rightTable *TableHandle, on []string, joins []string) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, leftTable, rightTable); err != nil { + return nil, err + } + + return ts.makeRequest(ctx, leftTable, func(ctx context.Context, resultId *ticket, leftId *tblRef) (*tblResp, error) { + if !rightTable.IsValid() { + return nil, ErrInvalidTableHandle + } + rightId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: rightTable.ticket}} + req := tablepb2.ExactJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: on, ColumnsToAdd: joins} + return ts.stub.ExactJoinTables(ctx, &req) + }) +} + +// asOfJoin is a wrapper around the asOfJoin gRPC operation. +// The tables must not be released before this method returns. +func (ts *tableStub) asOfJoin(ctx context.Context, leftTable *TableHandle, rightTable *TableHandle, on []string, joins []string, matchRule MatchRule) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, leftTable, rightTable); err != nil { + return nil, err + } + + return ts.makeRequest(ctx, leftTable, func(ctx context.Context, resultId *ticket, leftId *tblRef) (*tblResp, error) { + if !rightTable.IsValid() { + return nil, ErrInvalidTableHandle + } + rightId := &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: rightTable.ticket}} + var asOfMatchRule tablepb2.AsOfJoinTablesRequest_MatchRule + switch matchRule { + case MatchRuleLessThanEqual: + asOfMatchRule = tablepb2.AsOfJoinTablesRequest_LESS_THAN_EQUAL + case MatchRuleLessThan: + asOfMatchRule = tablepb2.AsOfJoinTablesRequest_LESS_THAN + case MatchRuleGreaterThanEqual: + asOfMatchRule = tablepb2.AsOfJoinTablesRequest_GREATER_THAN_EQUAL + case MatchRuleGreaterThan: + asOfMatchRule = tablepb2.AsOfJoinTablesRequest_GREATER_THAN + default: + panic("invalid match rule") + } + + req := tablepb2.AsOfJoinTablesRequest{ResultId: resultId, LeftId: leftId, RightId: rightId, ColumnsToMatch: on, ColumnsToAdd: joins, AsOfMatchRule: asOfMatchRule} + return ts.stub.AsOfJoinTables(ctx, &req) + }) +} + +// headOrTailBy is a wrapper around the HeadBy and TailBy gRPC operations (which one it is can be selected using isHead). +// The table must not be released before this method returns. +func (ts *tableStub) headOrTailBy(ctx context.Context, table *TableHandle, numRows int64, by []string, isHead bool) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + req := tablepb2.HeadOrTailByRequest{ResultId: resultId, SourceId: sourceId, NumRows: numRows, GroupByColumnSpecs: by} + if isHead { + return ts.stub.HeadBy(ctx, &req) + } else { + return ts.stub.TailBy(ctx, &req) + } + }) +} + +// dedicatedAggOp is actually a convenience method to perform the ComboAggregate gRPC operation with only a single aggregation. +// The table must not be released before this method returns. +func (ts *tableStub) dedicatedAggOp(ctx context.Context, table *TableHandle, by []string, countColumn string, kind tablepb2.ComboAggregateRequest_AggType) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + var agg tablepb2.ComboAggregateRequest_Aggregate + if kind == tablepb2.ComboAggregateRequest_COUNT && countColumn != "" { + agg = tablepb2.ComboAggregateRequest_Aggregate{Type: kind, ColumnName: countColumn} + } else { + agg = tablepb2.ComboAggregateRequest_Aggregate{Type: kind} + } + + aggs := []*tablepb2.ComboAggregateRequest_Aggregate{&agg} + + req := tablepb2.ComboAggregateRequest{ResultId: resultId, SourceId: sourceId, Aggregates: aggs, GroupByColumns: by} + return ts.stub.ComboAggregate(ctx, &req) + }) +} + +// ungroup is a wrapper around the Ungroup gRPC method. +// The table must not be released before this method returns. +func (ts *tableStub) ungroup(ctx context.Context, table *TableHandle, cols []string, nullFill bool) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + req := tablepb2.UngroupRequest{ResultId: resultId, SourceId: sourceId, NullFill: nullFill, ColumnsToUngroup: cols} + return ts.stub.Ungroup(ctx, &req) + }) +} + +// aggBy is a wrapper around the ComboAggregate gRPC request. +func (ts *tableStub) aggBy(ctx context.Context, table *TableHandle, aggs []aggPart, by []string) (*TableHandle, error) { + return ts.makeRequest(ctx, table, func(ctx context.Context, resultId *ticket, sourceId *tblRef) (*tblResp, error) { + var reqAggs []*tablepb2.ComboAggregateRequest_Aggregate + for _, agg := range aggs { + reqAgg := tablepb2.ComboAggregateRequest_Aggregate{Type: agg.kind, ColumnName: agg.columnName, MatchPairs: agg.matchPairs, Percentile: agg.percentile, AvgMedian: agg.avgMedian} + reqAggs = append(reqAggs, &reqAgg) + } + + req := &tablepb2.ComboAggregateRequest{ResultId: resultId, SourceId: sourceId, Aggregates: reqAggs, GroupByColumns: by} + return ts.stub.ComboAggregate(ctx, req) + }) +} + +// merge is a wrapper around the MergeTables gRPC request. +// The tables must not be released before this method returns. +func (ts *tableStub) merge(ctx context.Context, sortBy string, others []*TableHandle) (*TableHandle, error) { + if err := ts.checkTableValidity(ctx, others...); err != nil { + return nil, err + } + + if len(others) == 0 { + return nil, ErrEmptyMerge + } + + ctx, err := ts.client.withToken(ctx) + if err != nil { + return nil, err + } + + resultId := ts.client.ticketFact.newTicket() + + sourceIds := make([]*tblRef, len(others)) + for i, handle := range others { + sourceIds[i] = &tablepb2.TableReference{Ref: &tablepb2.TableReference_Ticket{Ticket: handle.ticket}} + } + + req := tablepb2.MergeTablesRequest{ResultId: &resultId, SourceIds: sourceIds, KeyColumn: sortBy} + resp, err := ts.stub.MergeTables(ctx, &req) + if err != nil { + return nil, err + } + + return parseCreationResponse(ts.client, resp) +} + +// wrapExecSerialError wraps an error caused while executing a query serially and wraps it into a QueryError. +// The source argument should be the node that caused the error. +func wrapExecSerialError(inner error, source QueryNode) QueryError { + subError := querySubError{serverErr: inner, resultId: nil, source: source} + return QueryError{subErrors: []querySubError{subError}} +} + +// serialOpsState is used to keep track of the state of a serially-executed query. +// serialOpsState methods are not thread-safe, but serialOpsStates are never shared between goroutines anyways. +type serialOpsState struct { + client *Client + + // The list of root/exported nodes. + // The tables these create will eventually be returned to the user. + exportedNodes []QueryNode + + // A map containing query nodes that have already been processed and the resulting tables. + finishedNodes map[QueryNode]*TableHandle + + // It is difficult to determine what queryBuilders are used ahead of time, + // so instead we lock queryBuilders as we encounter them. + // This set contains all the queryBuilders that have been locked so far. + lockedBuilders map[*queryBuilder]struct{} + + // It is difficult to determine what TableHandles are used ahead of time, + // so instead we lock handles as we encounter them. + // However, only TableHandles that are the root of some query node (i.e. ones that were used with the Query method) + // are actually shared, so we only lock those handles. + // This set contains the handles that have been locked so far. + lockedTables map[*TableHandle]struct{} +} + +// isExported returns true if the given node is exported, +// i.e. if it is eventually returned to the user. +func (state *serialOpsState) isExported(node QueryNode) bool { + for _, exNode := range state.exportedNodes { + if node == exNode { + return true + } + } + return false +} + +// unlockAll unlocks any locks that were acquired while processing nodes, +// i.e. everything in lockedBuilders and lockedTables. +func (state *serialOpsState) unlockAll() { + for builder := range state.lockedBuilders { + builder.opLock.Unlock() + } + + for table := range state.lockedTables { + table.lock.RUnlock() + } +} + +// processNode performs the table operations for the given node and its children and returns the resulting table. +// allowNilTables is used only for mergeOp, and allows returning a nil table reference for a node that points to a nil table. +// Normally, nil tables are treated as an error. +// +// This may return a QueryError. +func (state *serialOpsState) processNode(ctx context.Context, node QueryNode, allowNilTables bool) (*TableHandle, error) { + // If this node has already been processed, just return the old result. + if tbl, ok := state.finishedNodes[node]; ok { + return tbl, nil + } + + if _, ok := state.lockedBuilders[node.builder]; !ok { + state.lockedBuilders[node.builder] = struct{}{} + node.builder.opLock.Lock() + } + + if node.index == -1 { + oldTable := node.builder.table + + skipValidCheck := allowNilTables && node.builder.table == nil + + if skipValidCheck { + if state.isExported(node) { + // Exporting a nil table is not allowed. + return nil, ErrInvalidTableHandle + } else { + return nil, nil + } + } + + if _, ok := state.lockedTables[oldTable]; !ok { + if !oldTable.rLockIfValid() { + return nil, wrapExecSerialError(ErrInvalidTableHandle, node) + } + state.lockedTables[oldTable] = struct{}{} + } + + if oldTable.client != state.client { + return nil, wrapExecSerialError(ErrDifferentClients, node) + } + + if state.isExported(node) { + // This node is exported, so in order to avoid two having TableHandles with the same ticket we need to re-export the old table. + newTable, err := state.client.tableStub.fetchTable(ctx, oldTable) + if err != nil { + return nil, wrapExecSerialError(err, node) + } + state.finishedNodes[node] = newTable + return newTable, nil + } else { + // This node isn't exported, so it's okay to just reuse the existing table. + state.finishedNodes[node] = oldTable + return oldTable, nil + } + } + + op := node.builder.ops[node.index] + + _, childNilIsOk := op.(mergeOp) + + var children []*TableHandle + for _, childNode := range op.childQueries() { + childTbl, err := state.processNode(ctx, childNode, childNilIsOk) + if err != nil { + // This error is already wrapped + return nil, err + } + children = append(children, childTbl) + } + + // All of the children have either been locked by lockedTables, + // or are exclusively owned by this goroutine, so this method is safe. + tbl, err := op.execSerialOp(ctx, &state.client.tableStub, children) + if err != nil { + return nil, wrapExecSerialError(err, node) + } + + state.finishedNodes[node] = tbl + return tbl, nil +} + +// execSerial performs all of the table operations specified by the given nodes one-by-one. +// It then wraps the returned tables in TableHandles and returns them in the same order as in nodes. +// This may return a QueryError. +func execSerial(ctx context.Context, client *Client, nodes []QueryNode) ([]*TableHandle, error) { + state := serialOpsState{ + client: client, + exportedNodes: nodes, + finishedNodes: make(map[QueryNode]*TableHandle), + lockedBuilders: make(map[*queryBuilder]struct{}), + lockedTables: make(map[*TableHandle]struct{}), + } + + defer state.unlockAll() + + var result []*TableHandle + + // We need this to keep track of what nodes' tables we've already returned, + // to ensure we never return the same table twice. + exported := make(map[QueryNode]struct{}) + + for _, node := range nodes { + // If it's already been exported, we'll need to re-export it again manually. + if _, ok := exported[node]; ok { + // The node has already been exported. To avoid aliased TableHandles, + // we need to re-export it. + oldTable := state.finishedNodes[node] + tbl, err := client.tableStub.fetchTable(ctx, oldTable) + if err != nil { + return nil, wrapExecSerialError(err, node) + } + result = append(result, tbl) + } else { + exported[node] = struct{}{} + + tbl, err := state.processNode(ctx, node, false) + if err != nil { + // This error is already wrapped + return nil, err + } + result = append(result, tbl) + } + } + + for node, tbl := range state.finishedNodes { + // If a table comes from a node with index -1, it was passed in as an argument, so it's not ours to release. + // If a table is exported, then we want to return it, so we also shouldn't release it. + if node.index != -1 && !state.isExported(node) { + err := tbl.Release(ctx) + if err != nil { + return nil, wrapExecSerialError(err, node) + } + } + } + + assert(len(result) == len(nodes), "wrong number of tables in result") + return result, nil +} diff --git a/go/pkg/client/tablehandle.go b/go/pkg/client/tablehandle.go new file mode 100644 index 00000000000..94769a6f8a9 --- /dev/null +++ b/go/pkg/client/tablehandle.go @@ -0,0 +1,656 @@ +package client + +import ( + "context" + "errors" + "log" + "runtime" + "runtime/debug" + "sync" + + "github.com/apache/arrow/go/v8/arrow" + + tablepb2 "github.com/deephaven/deephaven-core/go/internal/proto/table" + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +// ErrInvalidTableHandle is returned by most table methods +// when called on a table handle that contains its zero value or has been already released. +var ErrInvalidTableHandle = errors.New("tried to use a nil, zero-value, or released table handle") + +// ErrDifferentClients is returned when performing a table operation +// on handles that come from different Client structs. +var ErrDifferentClients = errors.New("tried to use tables from different clients") + +// ErrEmptyMerge is returned by merge operations when all of the table arguments are nil +// (or when no table arguments are provided at all). +var ErrEmptyMerge = errors.New("no non-nil tables were provided to merge") + +// A TableHandle is a reference to a table stored on the deephaven server. +// +// It should eventually be released using Release() once it is no longer needed on the client. +// Releasing a table handle does not affect table handles derived from it. +// Once a TableHandle has been released, no other methods should be called on it. +// +// All TableHandle methods are goroutine-safe. +// +// A TableHandle's zero value acts identically to a TableHandle that has been released. +// A nil TableHandle pointer also acts like a released table with one key exception: +// The Merge and MergeQuery methods will simply ignore nil handles. +// +// See the TableOps example for more details on how to manipulate and use TableHandles. +type TableHandle struct { + client *Client + ticket *ticketpb2.Ticket // The ticket this table can be referred to by. + schema *arrow.Schema // The schema (i.e. name, type, and metadata) for this table's columns. + size int64 // The number of rows that this table has. Not meaningful if isStatic is false. + isStatic bool // False if this table is dynamic, like a streaming table or a time table. + + lock sync.RWMutex // Used to guard the state of the table handle. Table operations acquire a read lock, and releasing the table acquires a write lock. +} + +// newBorrowedTableHandle is like newTableHandle, but doesn't attach a finalizer to the handle. +// This is necessary because certain server API calls return tickets that don't need to be released by the client (e.g. ListFields). +// Such tables are only ever used internally, so the user does not need to know about this detail. +func newBorrowedTableHandle(client *Client, ticket *ticketpb2.Ticket, schema *arrow.Schema, size int64, isStatic bool) *TableHandle { + return &TableHandle{ + client: client, + ticket: ticket, + schema: schema, + size: size, + isStatic: isStatic, + } +} + +// newTableHandle returns a new table handle given information about the table, +// typically from a gRPC ExportedTableCreationResponse. +// This will also attach a finalizer to the TableHandle that will free the table automatically +// and print a warning if WithNoTableLeakWarning was not provided when creating a client. +func newTableHandle(client *Client, ticket *ticketpb2.Ticket, schema *arrow.Schema, size int64, isStatic bool) *TableHandle { + handle := newBorrowedTableHandle(client, ticket, schema, size, isStatic) + + stackTrace := string(debug.Stack()) + + runtime.SetFinalizer(handle, func(th *TableHandle) { + // Start up a new goroutine, since finalizers block the GC + // and this needs to lock a mutex and perform a network request. + go func() { + if th.wLockIfValid() { + defer th.lock.Unlock() + + // Closing a client automatically releases its TableHandles, + // so we only need to release the handle if the client is still open. + if th.client.lockIfOpen() { + defer th.client.lock.Unlock() + + _ = th.releaseLocked(context.Background()) // ignore the error here, since we can't do anything about it. + + if !client.suppressTableLeakWarning { + warningMsg := "warning: a TableHandle is being garbage collected without the Release method being called first.\n" + + "The handle will be automatically released, but this is unreliable and may lead to resource exhaustion.\n" + + "To suppress this warning, see the WithNoTableLeakWarning option when creating the client.\n" + + "stack trace of where the TableHandle was created:\n" + + stackTrace + + log.Println(warningMsg) + } + } + } + }() + }) + + return handle +} + +// IsValid returns true if the handle is valid, i.e. table operations can be performed on it. +// No methods can be called on invalid TableHandles except for Release. +func (th *TableHandle) IsValid() bool { + if th == nil { + return false + } + th.lock.RLock() + defer th.lock.RUnlock() + return th.client != nil +} + +// rLockIfValid returns true if the handle is valid, i.e. table operations can be performed on it. +// If this function returns true, it will acquire a read lock for the handle. +func (th *TableHandle) rLockIfValid() bool { + if th == nil { + return false + } + th.lock.RLock() + if th.client == nil { + th.lock.RUnlock() + return false + } + return true +} + +// wLockIfValid returns true if the handle is valid, i.e. table operations can be performed on it. +// If this function returns true, it will acquire a write lock for the handle. +func (th *TableHandle) wLockIfValid() bool { + if th == nil { + return false + } + th.lock.Lock() + if th.client == nil { + th.lock.Unlock() + return false + } + return true +} + +// IsStatic returns false for dynamic tables, like streaming tables or time tables. +func (th *TableHandle) IsStatic() bool { + // No need to lock since this is never changed + return th.isStatic +} + +// NumRows returns the number of rows in the table. +// The return value is only ok if IsStatic() is true, +// since only static tables have a fixed number of rows. +func (th *TableHandle) NumRows() (numRows int64, ok bool) { + // No need to lock since these are never changed + if th.isStatic { + return th.size, true + } else { + // Return -1 here so that it can't possibly be mistaken for a valid size + return -1, false + } +} + +// Snapshot downloads the current state of the table from the server and returns it as an Arrow Record. +// +// If a Record is returned successfully, it must be freed later with arrow.record.Release(). +func (th *TableHandle) Snapshot(ctx context.Context) (arrow.Record, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.snapshotRecord(ctx, th.ticket) +} + +// Query creates a new QueryNode based on this table. +// +// Table operations can be performed on query nodes to get more query nodes. +// The nodes can then be turned back into TableHandles using the Client.ExecSerial or Client.ExecBatch methods. +// +// See the docs for QueryNode or the TableOps example for more details on how to use query-graph operations. +func (th *TableHandle) Query() QueryNode { + // The validity check and lock will occur when the query is actually used, so they aren't handled here. + qb := newQueryBuilder(th) + return qb.curRootNode() +} + +// releaseLocked is identical to Release, except it assumes a write lock for the table is already held by the caller. +func (th *TableHandle) releaseLocked(ctx context.Context) error { + if th == nil { + return nil + } + + if th.client != nil { + err := th.client.release(ctx, th.ticket) + if err != nil { + // This is logged because most of the time this method is used with defer, + // which will discard the error value. + log.Println("unable to release table:", err.Error()) + return err + } + + th.client = nil + th.ticket = nil + th.schema = nil + } + return nil +} + +// Release releases this table handle's resources on the server. The TableHandle is no longer usable after Release is called. +// It is safe to call Release multiple times. +func (th *TableHandle) Release(ctx context.Context) error { + if th == nil { + return nil + } + + runtime.SetFinalizer(th, nil) + + th.lock.Lock() + defer th.lock.Unlock() + + return th.releaseLocked(ctx) +} + +// DropColumns creates a table with the same number of rows as the source table but omits any columns included in the arguments. +func (th *TableHandle) DropColumns(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dropColumns(ctx, th, cols) +} + +// Update creates a new table containing a new, in-memory column for each argument. +// The returned table also includes all the original columns from the source table. +func (th *TableHandle) Update(ctx context.Context, formulas ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.update(ctx, th, formulas) +} + +// LazyUpdate creates a new table containing a new, cached, formula column for each argument. +// The returned table also includes all the original columns from the source table. +func (th *TableHandle) LazyUpdate(ctx context.Context, formulas ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.lazyUpdate(ctx, th, formulas) +} + +// UpdateView creates a new table containing a new, formula column for each argument. +// When using UpdateView, the new columns are not stored in memory. +// Rather, a formula is stored that is used to recalculate each cell every time it is accessed. +// The returned table also includes all the original columns from the source table. +func (th *TableHandle) UpdateView(ctx context.Context, formulas ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.updateView(ctx, th, formulas) +} + +// View creates a new formula table that includes one column for each argument. +// When using view, the data being requested is not stored in memory. +// Rather, a formula is stored that is used to recalculate each cell every time it is accessed. +func (th *TableHandle) View(ctx context.Context, formulas ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.view(ctx, th, formulas) +} + +// Select creates a new in-memory table that includes one column for each argument. +// Any columns not specified in the arguments will not appear in the resulting table. +func (th *TableHandle) Select(ctx context.Context, formulas ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.selectTbl(ctx, th, formulas) +} + +// SelectDistinct creates a new table containing all of the unique values for a set of key columns. +// When SelectDistinct is used on multiple columns, it looks for distinct sets of values in the selected columns. +func (th *TableHandle) SelectDistinct(ctx context.Context, columns ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.selectDistinct(ctx, th, columns) +} + +// Sort returns a new table with rows sorted in a smallest to largest order based on the listed column(s). +func (th *TableHandle) Sort(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + var columns []SortColumn + for _, col := range cols { + columns = append(columns, SortAsc(col)) + } + return th.SortBy(ctx, columns...) +} + +// Sort returns a new table with rows sorted in the order specified by the listed column(s). +func (th *TableHandle) SortBy(ctx context.Context, cols ...SortColumn) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.sortBy(ctx, th, cols) +} + +// Where filters rows of data from the source table. +// It returns a new table with only the rows meeting the filter criteria of the source table. +func (th *TableHandle) Where(ctx context.Context, filters ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.where(ctx, th, filters) +} + +// Head returns a table with a specific number of rows from the beginning of the source table. +func (th *TableHandle) Head(ctx context.Context, numRows int64) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.headOrTail(ctx, th, numRows, true) +} + +// Tail returns a table with a specific number of rows from the end of the source table. +func (th *TableHandle) Tail(ctx context.Context, numRows int64) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.headOrTail(ctx, th, numRows, false) +} + +// NaturalJoin joins data from a pair of tables - a left and right table - based upon one or more match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns appended to the left table, row values equal the row values from the right table where the key values in the left and right tables are equal. +// If there is no matching key in the right table, appended row values are NULL. If there are multiple matches, the operation will fail. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +func (th *TableHandle) NaturalJoin(ctx context.Context, rightTable *TableHandle, on []string, joins []string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + if !rightTable.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer rightTable.lock.RUnlock() + + // Different-client check is done by this method. + return th.client.naturalJoin(ctx, th, rightTable, on, joins) +} + +// Join joins data from a pair of tables - a left and right table - based upon a set of match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys, and keys can be constructed from multiple values. +// +// The output table contains rows that have matching values in both tables. +// Rows that do not have matching criteria will not be included in the result. +// If there are multiple matches between a row from the left table and rows from the right table, all matching combinations will be included. +// If no match columns are specified, every combination of left and right table rows is included. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +// +// reserveBits is the number of bits of key-space to initially reserve per group. Set it to 10 if unsure. +func (th *TableHandle) Join(ctx context.Context, rightTable *TableHandle, on []string, joins []string, reserveBits int32) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + if !rightTable.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer rightTable.lock.RUnlock() + + // Different-client check is done by this method. + return th.client.crossJoin(ctx, th, rightTable, on, joins, reserveBits) +} + +// ExactJoin joins data from a pair of tables - a left and right table - based upon a set of match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys, and keys can be constructed from multiple values. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns appended to the left table, row values equal the row values from the right table where the key values in the left and right tables are equal. +// If there are zero or multiple matches, the operation will fail. +// +// matchOn is the columns to match. +// +// joins is the columns to add from the right table. +func (th *TableHandle) ExactJoin(ctx context.Context, rightTable *TableHandle, on []string, joins []string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + if !rightTable.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer rightTable.lock.RUnlock() + + // Different-client check is done by this method. + return th.client.exactJoin(ctx, th, rightTable, on, joins) +} + +// AsOfJoin joins data from a pair of tables - a left and right table - based upon one or more match columns. +// The match columns establish key identifiers in the left table that will be used to find data in the right table. +// Any data types can be chosen as keys. +// +// When using AsOfJoin, the first N-1 match columns are exactly matched. +// The last match column is used to find the key values from the right table that are closest to the values in the left table without going over the left value. +// For example, when using MatchRuleLessThanEqual, +// if the right table contains a value 5 and the left table contains values 4 and 6, the right table's 5 will be matched on the left table's 6. +// +// The output table contains all of the rows and columns of the left table plus additional columns containing data from the right table. +// For columns optionally appended to the left table, row values equal the row values from the right table where the keys from the left table most closely match the keys from the right table, as defined above. +// If there is no matching key in the right table, appended row values are NULL. +// +// matchColumns is the columns to match. +// +// joins is the columns to add from the right table. +// +// matchRule is the match rule for the join. +// Use MatchRuleLessThanEqual for a normal as-of join, or MatchRuleGreaterThanEqual for a reverse-as-of-join. +func (th *TableHandle) AsOfJoin(ctx context.Context, rightTable *TableHandle, on []string, joins []string, matchRule MatchRule) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + if !rightTable.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer rightTable.lock.RUnlock() + + // Different-client check is done by this method. + return th.client.asOfJoin(ctx, th, rightTable, on, joins, matchRule) +} + +// HeadBy returns the first numRows rows for each group. +func (th *TableHandle) HeadBy(ctx context.Context, numRows int64, columnsToGroupBy ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.headOrTailBy(ctx, th, numRows, columnsToGroupBy, true) +} + +// TailBy returns the last numRows rows for each group. +func (th *TableHandle) TailBy(ctx context.Context, numRows int64, columnsToGroupBy ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.headOrTailBy(ctx, th, numRows, columnsToGroupBy, false) +} + +// GroupBy groups column content into arrays. +// Columns not in the aggregation become array-type. +// If no group-by columns are given, the content of each column is grouped into its own array. +func (th *TableHandle) GroupBy(ctx context.Context, by ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, by, "", tablepb2.ComboAggregateRequest_GROUP) +} + +// Ungroup ungroups column content. It is the inverse of the GroupBy method. +// Ungroup unwraps columns containing either Deephaven arrays or Java arrays. +// nullFill indicates whether or not missing cells may be filled with null. Set it to true if unsure. +func (th *TableHandle) Ungroup(ctx context.Context, cols []string, nullFill bool) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.ungroup(ctx, th, cols, nullFill) +} + +// FirstBy returns the first row for each group. +// If no columns are given, only the first row of the table is returned. +func (th *TableHandle) FirstBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_FIRST) +} + +// LastBy returns the last row for each group. +// If no columns are given, only the last row of the table is returned. +func (th *TableHandle) LastBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_LAST) +} + +// SumBy returns the total sum for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) SumBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_SUM) +} + +// AbsSumBy returns the total sum of absolute values for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) AbsSumBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_ABS_SUM) +} + +// AvgBy returns the average (mean) of each non-key column for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) AvgBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_AVG) +} + +// StdBy returns the standard deviation for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) StdBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_STD) +} + +// VarBy returns the variance for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) VarBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_VAR) +} + +// MedianBy returns the median value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) MedianBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_MEDIAN) +} + +// MinBy returns the minimum value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) MinBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_MIN) +} + +// MaxBy returns the maximum value for each group. Null values are ignored. +// Columns not used in the grouping must be numeric. +func (th *TableHandle) MaxBy(ctx context.Context, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, "", tablepb2.ComboAggregateRequest_MAX) +} + +// CountBy returns the number of rows for each group. +// The count of each group is stored in a new column named after the resultCol argument. +func (th *TableHandle) CountBy(ctx context.Context, resultCol string, cols ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, cols, resultCol, tablepb2.ComboAggregateRequest_COUNT) +} + +// Count counts the number of values in the specified column and returns it as a table with one row and one column. +func (th *TableHandle) Count(ctx context.Context, col string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.dedicatedAggOp(ctx, th, nil, col, tablepb2.ComboAggregateRequest_COUNT) +} + +// AggBy applies a list of aggregations to table data. +// See the docs on AggBuilder for details on what each of the aggregation types do. +func (th *TableHandle) AggBy(ctx context.Context, agg *AggBuilder, by ...string) (*TableHandle, error) { + if !th.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer th.lock.RUnlock() + return th.client.aggBy(ctx, th, agg.aggs, by) +} + +// Merge combines two or more tables into one table. +// This essentially appends the tables on top of each other. +// +// If sortBy is provided, the resulting table will be sorted based on that column. +// +// Any nil TableHandle pointers passed in are ignored. +// At least one non-nil *TableHandle must be provided, otherwise an ErrEmptyMerge will be returned. +func Merge(ctx context.Context, sortBy string, tables ...*TableHandle) (*TableHandle, error) { + // First, remove all the nil TableHandles. + // No lock needed here since we're not using any TableHandle methods. + var usedTables []*TableHandle + for _, table := range tables { + if table != nil { + usedTables = append(usedTables, table) + } + } + + if len(usedTables) == 0 { + return nil, ErrEmptyMerge + } + + for _, table := range usedTables { + if !table.rLockIfValid() { + return nil, ErrInvalidTableHandle + } + defer table.lock.RUnlock() + } + + client := usedTables[0].client + + return client.merge(ctx, sortBy, usedTables) +} diff --git a/go/pkg/client/tablehandle_test.go b/go/pkg/client/tablehandle_test.go new file mode 100644 index 00000000000..dd5fb38c09a --- /dev/null +++ b/go/pkg/client/tablehandle_test.go @@ -0,0 +1,632 @@ +package client_test + +import ( + "context" + "errors" + "sort" + "testing" + "time" + + "github.com/apache/arrow/go/v8/arrow" + "github.com/apache/arrow/go/v8/arrow/array" + "github.com/deephaven/deephaven-core/go/internal/test_tools" + "github.com/deephaven/deephaven-core/go/pkg/client" +) + +type unaryTableOp func(context.Context, *client.TableHandle) (*client.TableHandle, error) + +func applyTableOp(input arrow.Record, t *testing.T, op unaryTableOp) arrow.Record { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + before, err := c.ImportTable(ctx, input) + if err != nil { + t.Errorf("ImportTable %s", err.Error()) + return nil + } + defer before.Release(ctx) + + after, err := op(ctx, before) + if err != nil { + t.Errorf("table operation %s", err.Error()) + return nil + } + defer after.Release(ctx) + + result, err := after.Snapshot(ctx) + if err != nil { + t.Errorf("Snapshot %s", err.Error()) + return nil + } + + return result +} + +func TestDropColumns(t *testing.T) { + result := applyTableOp(test_tools.ExampleRecord(), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.DropColumns(ctx, "Ticker", "Volume") + }) + defer result.Release() + + if result.NumCols() != 1 { + t.Errorf("wrong number of columns %d", result.NumCols()) + return + } + + if result.ColumnName(0) != "Close" { + t.Errorf("wrong column name %s", result.ColumnName(0)) + return + } +} + +func TestUpdateViewSelect(t *testing.T) { + type usvOp func(*client.TableHandle, context.Context, ...string) (*client.TableHandle, error) + + ops := []usvOp{ + (*client.TableHandle).Update, (*client.TableHandle).LazyUpdate, (*client.TableHandle).UpdateView, + (*client.TableHandle).View, (*client.TableHandle).Select, + } + + for _, op := range ops { + result := applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return op(before, ctx, "Sum = a + b", "b", "Foo = Sum % 2") + }) + defer result.Release() + + if result.NumCols() < 3 || result.NumRows() != 30 { + t.Errorf("wrong number of columns %d", result.NumCols()) + return + } + } +} + +func TestSelectDistinct(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 20, 10), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.SelectDistinct(ctx, "a") + }) + defer result.Release() + + if result.NumCols() != 1 || result.NumRows() > 10 { + t.Errorf("SelectDistinct had wrong size %d x %d", result.NumCols(), result.NumRows()) + return + } +} + +func TestWhere(t *testing.T) { + result := applyTableOp(test_tools.ExampleRecord(), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.Where(ctx, "Volume % 1000 != 0") + }) + defer result.Release() + + if result.NumCols() != 3 || result.NumRows() != 3 { + t.Errorf("Where had wrong size %d x %d", result.NumCols(), result.NumRows()) + return + } +} + +func TestSort(t *testing.T) { + asc := applyTableOp(test_tools.RandomRecord(2, 10, 1000), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.Sort(ctx, "a") + }) + defer asc.Release() + ascData := asc.Column(0).(*array.Int32).Int32Values() + if !sort.SliceIsSorted(ascData, func(i, j int) bool { return ascData[i] < ascData[j] }) { + t.Error("Slice was not sorted ascending: ", asc) + return + } + + dsc := applyTableOp(test_tools.RandomRecord(2, 10, 1000), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.SortBy(ctx, client.SortDsc("a")) + }) + defer dsc.Release() + dscData := dsc.Column(0).(*array.Int32).Int32Values() + if !sort.SliceIsSorted(dscData, func(i, j int) bool { return dscData[i] > dscData[j] }) { + t.Error("Slice was not sorted descnding: ", dsc) + return + } +} + +func TestHeadTail(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 10, 1000), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.Head(ctx, 3) + }) + if result.NumRows() != 3 { + t.Errorf("head had wrong size %d", result.NumRows()) + return + } + result.Release() + + result = applyTableOp(test_tools.RandomRecord(2, 10, 1000), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.Tail(ctx, 6) + }) + if result.NumRows() != 6 { + t.Errorf("tail had wrong size %d", result.NumRows()) + } + result.Release() +} + +func TestComboAgg(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(4, 30, 10), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + b := client.NewAggBuilder().Min("minB = b").Sum("sumC = c") + return before.AggBy(ctx, b, "a") + }) + defer result.Release() + + if result.NumCols() != 3 || result.NumRows() > 10 { + t.Errorf("AggBy had wrong size %d x %d", result.NumCols(), result.NumRows()) + return + } +} + +func TestMerge(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 30, 10), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + head, err := before.Head(ctx, 5) + if err != nil { + return nil, err + } + defer head.Release(ctx) + + return client.Merge(ctx, "a", before, head) + }) + + if result.NumRows() != 35 { + t.Errorf("Merge had wrong size") + return + } +} + +func TestMergeNull(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 30, 10), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + head, err := before.Head(ctx, 5) + if err != nil { + return nil, err + } + defer head.Release(ctx) + + return client.Merge(ctx, "a", before, head, nil) + }) + + if result.NumRows() != 35 { + t.Errorf("Merge had wrong size") + return + } +} + +func TestEmptyMerge(t *testing.T) { + ctx := context.Background() + + _, err := client.Merge(ctx, "", nil) + if !errors.Is(err, client.ErrEmptyMerge) { + t.Error("empty Merge returned wrong or missing error", err) + return + } +} + +func TestExactJoin(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + rec := test_tools.RandomRecord(5, 100, 50) + defer rec.Release() + + recTbl, err := c.ImportTable(ctx, rec) + test_tools.CheckError(t, "ImportTable", err) + defer recTbl.Release(ctx) + + tmp1, err := recTbl.GroupBy(ctx, "a") + test_tools.CheckError(t, "GroupBy", err) + defer tmp1.Release(ctx) + + base, err := tmp1.Update(ctx, "b = b[0]", "c = c[0]", "d = d[0]", "e = e[0]") + test_tools.CheckError(t, "Update", err) + defer base.Release(ctx) + + leftTbl, err := base.DropColumns(ctx, "c", "d", "e") + test_tools.CheckError(t, "DropColumns", err) + defer leftTbl.Release(ctx) + + rightTbl, err := base.DropColumns(ctx, "b", "c") + test_tools.CheckError(t, "DropColumns", err) + defer rightTbl.Release(ctx) + + resultTbl, err := leftTbl.ExactJoin(ctx, rightTbl, []string{"a"}, []string{"d", "e"}) + test_tools.CheckError(t, "ExactJoin", err) + defer resultTbl.Release(ctx) + + leftRec, err := leftTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer leftRec.Release() + + resultRec, err := resultTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer resultRec.Release() + + if resultRec.NumCols() != 4 || resultRec.NumRows() != leftRec.NumRows() { + t.Errorf("result table had wrong size %d x %d", resultRec.NumCols(), resultRec.NumRows()) + return + } +} + +func TestNaturalJoin(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + rec := test_tools.RandomRecord(5, 100, 50) + defer rec.Release() + + recTbl, err := c.ImportTable(ctx, rec) + test_tools.CheckError(t, "ImportTable", err) + defer recTbl.Release(ctx) + + tmp1, err := recTbl.GroupBy(ctx, "a") + test_tools.CheckError(t, "GroupBy", err) + defer tmp1.Release(ctx) + + base, err := tmp1.Update(ctx, "b = b[0]", "c = c[0]", "d = d[0]", "e = e[0]") + test_tools.CheckError(t, "Update", err) + defer base.Release(ctx) + + leftTbl, err := base.DropColumns(ctx, "c", "d", "e") + test_tools.CheckError(t, "DropColumns", err) + defer leftTbl.Release(ctx) + + rightTbl, err := base.DropColumns(ctx, "b", "c") + test_tools.CheckError(t, "DropColumns", err) + defer rightTbl.Release(ctx) + + resultTbl, err := leftTbl.NaturalJoin(ctx, rightTbl, []string{"a"}, []string{"d", "e"}) + test_tools.CheckError(t, "NaturalJoin", err) + defer resultTbl.Release(ctx) + + leftRec, err := leftTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer leftRec.Release() + + resultRec, err := resultTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer resultRec.Release() + + if resultRec.NumCols() != 4 || resultRec.NumRows() != leftRec.NumRows() { + t.Errorf("result table had wrong size %d x %d", resultRec.NumCols(), resultRec.NumRows()) + return + } +} + +func TestCrossJoin(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + rec := test_tools.RandomRecord(5, 100, 50) + defer rec.Release() + + recTbl, err := c.ImportTable(ctx, rec) + test_tools.CheckError(t, "ImportTable", err) + defer recTbl.Release(ctx) + + leftTbl, err := recTbl.DropColumns(ctx, "e") + test_tools.CheckError(t, "DropColumns", err) + defer leftTbl.Release(ctx) + + tmp1, err := recTbl.Where(ctx, "a % 2 > 0 && b % 3 == 1") + test_tools.CheckError(t, "Where", err) + defer tmp1.Release(ctx) + + rightTbl, err := tmp1.DropColumns(ctx, "b", "c", "d") + test_tools.CheckError(t, "DropColumns", err) + defer rightTbl.Release(ctx) + + resultTbl1, err := leftTbl.Join(ctx, rightTbl, []string{"a"}, []string{"e"}, 10) + test_tools.CheckError(t, "Join", err) + defer resultTbl1.Release(ctx) + + resultTbl2, err := leftTbl.Join(ctx, rightTbl, nil, []string{"e"}, 10) + test_tools.CheckError(t, "Join", err) + defer resultTbl2.Release(ctx) + + leftRec, err := leftTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer leftRec.Release() + + resultRec1, err := resultTbl1.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer resultRec1.Release() + + resultRec2, err := resultTbl2.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer resultRec2.Release() + + if resultRec1.NumRows() >= leftRec.NumRows() { + t.Error("resultRec1 was too large") + return + } + + if resultRec2.NumRows() <= leftRec.NumRows() { + t.Error("resultRec2 was too small") + return + } +} + +func TestAsOfJoin(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + if err != nil { + t.Fatalf("NewClient %s", err.Error()) + } + defer c.Close() + + startTime := time.Now().Add(time.Duration(-2) * time.Second) + + tmp1, err := c.TimeTable(ctx, 100000, startTime) + test_tools.CheckError(t, "TimeTable", err) + defer tmp1.Release(ctx) + + tt1, err := tmp1.Update(ctx, "Col1 = i") + test_tools.CheckError(t, "Update", err) + defer tt1.Release(ctx) + + tmp2, err := c.TimeTable(ctx, 200000, startTime) + test_tools.CheckError(t, "TimeTable", err) + defer tmp2.Release(ctx) + + tt2, err := tmp2.Update(ctx, "Col1 = i") + test_tools.CheckError(t, "Update", err) + defer tt2.Release(ctx) + + normalTbl, err := tt1.AsOfJoin(ctx, tt2, []string{"Col1", "Timestamp"}, nil, client.MatchRuleLessThanEqual) + test_tools.CheckError(t, "AsOfJoin", err) + defer normalTbl.Release(ctx) + + reverseTbl, err := tt1.AsOfJoin(ctx, tt2, []string{"Col1", "Timestamp"}, nil, client.MatchRuleGreaterThanEqual) + test_tools.CheckError(t, "AsOfJoin", err) + defer reverseTbl.Release(ctx) + + ttRec, err := tt1.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer ttRec.Release() + + normalRec, err := normalTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer normalRec.Release() + + reverseRec, err := reverseTbl.Snapshot(ctx) + test_tools.CheckError(t, "Snapshot", err) + defer reverseRec.Release() + + if normalRec.NumRows() == 0 || normalRec.NumRows() > ttRec.NumRows() { + t.Error("record had wrong size") + return + } + + if reverseRec.NumRows() == 0 || reverseRec.NumRows() > ttRec.NumRows() { + t.Error("record had wrong size") + return + } +} + +func TestHeadBy(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(3, 10, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.HeadBy(ctx, 1, "a") + }) + if result.NumRows() > 5 { + t.Error("result had too many rows") + return + } + result.Release() +} + +func TestTailBy(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(3, 10, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.TailBy(ctx, 1, "a") + }) + if result.NumRows() > 5 { + t.Errorf("result had too many rows") + } + result.Release() +} + +func TestGroupBy(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.GroupBy(ctx, "a") + }) + if result.NumRows() > 5 { + t.Errorf("one-column-grouped table had wrong size %d", result.NumRows()) + return + } + result.Release() + + result = applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.GroupBy(ctx, "a") + }) + if result.NumRows() > 25 { + t.Errorf("all-grouped table had wrong size %d", result.NumRows()) + return + } + result.Release() +} + +func TestUngroup(t *testing.T) { + result := applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + tbl, err := before.GroupBy(ctx, "a") + if err != nil { + return nil, err + } + defer tbl.Release(ctx) + return tbl.Ungroup(ctx, []string{"b"}, false) + }) + if result.NumRows() != 30 { + t.Errorf("ungrouped table had wrong size %d", result.NumRows()) + return + } + result.Release() +} + +func TestCountBy(t *testing.T) { + rec := test_tools.RandomRecord(2, 30, 5) + rec.Retain() + + distinct := applyTableOp(rec, t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.SelectDistinct(ctx, "a") + }) + defer distinct.Release() + numDistinct := distinct.NumRows() + + counted := applyTableOp(rec, t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.CountBy(ctx, "Counted", "a") + }) + defer counted.Release() + + if counted.NumRows() != numDistinct { + t.Errorf("counted had wrong size") + return + } +} + +func TestCount(t *testing.T) { + count := applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return before.Count(ctx, "b") + }) + defer count.Release() + + result := count.Column(0).(*array.Int64).Int64Values()[0] + if result != 30 { + t.Errorf("count was incorrect: %d", result) + return + } +} + +func TestDedicatedAgg(t *testing.T) { + type aggOp = func(*client.TableHandle, context.Context, ...string) (*client.TableHandle, error) + + ops := []aggOp{ + (*client.TableHandle).FirstBy, (*client.TableHandle).LastBy, (*client.TableHandle).SumBy, (*client.TableHandle).AvgBy, + (*client.TableHandle).StdBy, (*client.TableHandle).VarBy, (*client.TableHandle).MedianBy, (*client.TableHandle).MinBy, + (*client.TableHandle).MaxBy, (*client.TableHandle).AbsSumBy, + } + + for _, op := range ops { + result := applyTableOp(test_tools.RandomRecord(2, 30, 5), t, func(ctx context.Context, before *client.TableHandle) (*client.TableHandle, error) { + return op(before, ctx, "a") + }) + defer result.Release() + + if result.NumRows() > 5 { + t.Errorf("table had wrong size %d", result.NumRows()) + return + } + } +} + +func TestZeroTable(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + tbl1 := &client.TableHandle{} + tbl2, err := tbl1.Update(ctx, "foo = i") + if err == nil || !errors.Is(err, client.ErrInvalidTableHandle) { + t.Error("wrong error for updating zero table:", err.Error()) + return + } + if tbl2 != nil { + t.Errorf("returned table was not nil") + return + } + + err = tbl1.Release(ctx) + if err != nil { + t.Error("error when releasing zero table", err.Error()) + } +} + +func TestReleasedTable(t *testing.T) { + ctx := context.Background() + + c, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer c.Close() + + tbl1, err := c.EmptyTable(ctx, 10) + test_tools.CheckError(t, "EmptyTable", err) + + err = tbl1.Release(ctx) + test_tools.CheckError(t, "Release", err) + + tbl2, err := tbl1.Update(ctx, "foo = i") + if err == nil || !errors.Is(err, client.ErrInvalidTableHandle) { + t.Error("wrong error for updating released table:", err.Error()) + return + } + if tbl2 != nil { + t.Errorf("returned table was not nil") + return + } + + err = tbl1.Release(ctx) + if err != nil { + t.Error("error when releasing released table", err.Error()) + } +} + +func TestDifferentClients(t *testing.T) { + ctx := context.Background() + + client1, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer client1.Close() + + client2, err := client.NewClient(ctx, test_tools.GetHost(), test_tools.GetPort()) + test_tools.CheckError(t, "NewClient", err) + defer client2.Close() + + table1, err := client1.EmptyTable(ctx, 5) + test_tools.CheckError(t, "EmptyTable", err) + defer table1.Release(ctx) + + table2, err := client2.EmptyTable(ctx, 5) + test_tools.CheckError(t, "EmptyTable", err) + defer table2.Release(ctx) + + type makeTableOp func() (*client.TableHandle, error) + + crossJoin := func() (*client.TableHandle, error) { + return table1.Join(ctx, table2, nil, nil, 10) + } + exactJoin := func() (*client.TableHandle, error) { + return table1.ExactJoin(ctx, table2, nil, nil) + } + naturalJoin := func() (*client.TableHandle, error) { + return table1.NaturalJoin(ctx, table2, nil, nil) + } + asOfJoin := func() (*client.TableHandle, error) { + return table1.AsOfJoin(ctx, table2, nil, nil, client.MatchRuleLessThanEqual) + } + merge := func() (*client.TableHandle, error) { + return client.Merge(ctx, "", table1, table2) + } + + ops := []makeTableOp{crossJoin, exactJoin, naturalJoin, asOfJoin, merge} + for _, op := range ops { + _, err := op() + if !errors.Is(err, client.ErrDifferentClients) { + t.Errorf("missing or incorrect error %s", err) + return + } + } +} diff --git a/go/pkg/client/ticketfactory.go b/go/pkg/client/ticketfactory.go new file mode 100644 index 00000000000..11f67b91740 --- /dev/null +++ b/go/pkg/client/ticketfactory.go @@ -0,0 +1,41 @@ +package client + +import ( + "sync/atomic" + + ticketpb2 "github.com/deephaven/deephaven-core/go/internal/proto/ticket" +) + +//todo doc eveything + +type ticketFactory struct { + id int32 +} + +func newTicketFactory() ticketFactory { + return ticketFactory{} +} + +// newTicketNum returns a new ticket number that has not been used before. +func (tf *ticketFactory) nextId() int32 { + nextTicket := atomic.AddInt32(&tf.id, 1) + + if nextTicket <= 0 { + // If you ever see this panic... what are you doing? + panic("out of tickets") + } + + return nextTicket +} + +// newTicket returns a new ticket that has not used before. +func (tf *ticketFactory) newTicket() ticketpb2.Ticket { + id := tf.nextId() + return tf.makeTicket(id) +} + +// makeTicket turns a ticket ID into a ticket. +func (tf *ticketFactory) makeTicket(id int32) ticketpb2.Ticket { + bytes := []byte{'e', byte(id), byte(id >> 8), byte(id >> 16), byte(id >> 24)} + return ticketpb2.Ticket{Ticket: bytes} +} diff --git a/proto/proto-backplane-grpc/Dockerfile b/proto/proto-backplane-grpc/Dockerfile index 96b4a51271c..bbb11b6917c 100644 --- a/proto/proto-backplane-grpc/Dockerfile +++ b/proto/proto-backplane-grpc/Dockerfile @@ -1,5 +1,13 @@ +FROM deephaven/go:local-build as go-build + +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 +RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + FROM deephaven/protoc-base:local-build +COPY --from=go-build /go/bin/protoc-gen-go-grpc /opt/protoc-gen-go-grpc +COPY --from=go-build /go/bin/protoc-gen-go /opt/protoc-gen-go + COPY src/main/proto /includes COPY dependencies /dependencies @@ -8,6 +16,7 @@ RUN set -eux; \ mkdir -p /generated/java; \ mkdir -p /generated/grpc; \ mkdir -p /generated/js; \ + mkdir -p /generated/go; \ mkdir -p /generated/python; \ /opt/protoc/bin/protoc \ --plugin=protoc-gen-grpc=/opt/protoc-gen-grpc-java \ @@ -51,4 +60,20 @@ RUN set -eux; \ /includes/deephaven/proto/table.proto \ /includes/deephaven/proto/application.proto \ /includes/deephaven/proto/inputtable.proto \ + /includes/deephaven/proto/partitionedtable.proto; \ + /opt/protoc/bin/protoc \ + --plugin=protoc-gen-go=/opt/protoc-gen-go \ + --plugin=protoc-gen-go-grpc=/opt/protoc-gen-go-grpc \ + --go_out=/generated/go \ + --go-grpc_out=/generated/go \ + --go_opt=module=github.com/deephaven/deephaven-core/go \ + --go-grpc_opt=module=github.com/deephaven/deephaven-core/go \ + -I/includes \ + /includes/deephaven/proto/ticket.proto \ + /includes/deephaven/proto/console.proto \ + /includes/deephaven/proto/object.proto \ + /includes/deephaven/proto/session.proto \ + /includes/deephaven/proto/table.proto \ + /includes/deephaven/proto/application.proto \ + /includes/deephaven/proto/inputtable.proto \ /includes/deephaven/proto/partitionedtable.proto; diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index 2265429ca14..e272b4b93e3 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -7,6 +7,7 @@ plugins { } evaluationDependsOn Docker.registryProject('protoc-base') +evaluationDependsOn Docker.registryProject('go') description = 'The Deephaven proto-backplane-grpc' @@ -20,6 +21,7 @@ configurations { js {} python {} + go {} } dependencies { @@ -69,7 +71,7 @@ TaskProvider generateProtobuf = Docker.registerDockerTask(project, 'genera } // protoc-base is only provided via linux/amd64 - parentContainers = [ Docker.registryTask(project, 'protoc-base') ] + parentContainers = [ Docker.registryTask(project, 'protoc-base'), Docker.registryTask(project, 'go') ] platform = 'linux/amd64' containerOutPath = '/generated' @@ -89,6 +91,9 @@ artifacts { python(layout.buildDirectory.dir('generated/source/proto/main/python')) { builtBy generateProtobuf } + go(layout.buildDirectory.dir('generated/source/proto/main/go')) { + builtBy generateProtobuf + } } diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/application.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/application.proto index ea5d9ac37ef..4386fc870c2 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/application.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/application.proto @@ -7,6 +7,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/application"; import "deephaven/proto/ticket.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto index 377f00e94fd..11b1c9a1a17 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto @@ -7,8 +7,8 @@ package io.deephaven.proto.backplane.script.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/console"; -import "deephaven/proto/table.proto"; import "deephaven/proto/ticket.proto"; import "deephaven/proto/application.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto index 7c8a8d17d82..8abd2b39820 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto @@ -7,6 +7,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/inputtable"; import "deephaven/proto/ticket.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/object.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/object.proto index 8615ac500af..a98304c69c5 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/object.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/object.proto @@ -7,6 +7,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/object"; import "deephaven/proto/ticket.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/partitionedtable.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/partitionedtable.proto index 9b805cbce9a..1fc2d5d8b68 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/partitionedtable.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/partitionedtable.proto @@ -8,6 +8,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/partitionedtable"; import "deephaven/proto/table.proto"; import "deephaven/proto/ticket.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto index 927854b6546..b664ebcb315 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto @@ -9,6 +9,7 @@ import "deephaven/proto/ticket.proto"; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/session"; /* * User supplied Flight.Ticket(s) should begin with 'e' byte followed by an signed little-endian int. The client is only diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto index a7096a4c7ab..d5692e6a8a9 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto @@ -7,6 +7,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/table"; import "deephaven/proto/ticket.proto"; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/ticket.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/ticket.proto index c1e556a8de2..e8d4ecaa7c1 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/ticket.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/ticket.proto @@ -7,6 +7,7 @@ package io.deephaven.proto.backplane.grpc; option java_multiple_files = true; option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/ticket"; /* * This file only contains arrow's Ticket type, so that we don't need to diff --git a/py/client/build.gradle b/py/client/build.gradle index c8e5ac392cf..82efd7d77df 100644 --- a/py/client/build.gradle +++ b/py/client/build.gradle @@ -61,7 +61,7 @@ def compare = tasks.register('compareProtobuf', DiffTask) { // fail a "check" build if these are out of date tasks.getByName('quick').dependsOn(compare) -def updateProtobuf = tasks.register('updateProtobuf', Sync) { +tasks.register('updateProtobuf', Sync) { dependsOn(updatePyNamespaces) finalizedBy compare from generatedProtoDir.get().dir('pydeephaven/proto') diff --git a/py/client/pydeephaven/proto/application_pb2.py b/py/client/pydeephaven/proto/application_pb2.py index 3504f20b7b8..97aa0134969 100644 --- a/py/client/pydeephaven/proto/application_pb2.py +++ b/py/client/pydeephaven/proto/application_pb2.py @@ -15,7 +15,7 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!deephaven/proto/application.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x13\n\x11ListFieldsRequest\"\xd1\x01\n\x12\x46ieldsChangeUpdate\x12=\n\x07\x63reated\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07updated\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07removed\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\"\xb2\x01\n\tFieldInfo\x12\x44\n\x0ctyped_ticket\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12\x19\n\x11\x66ield_description\x18\x03 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t2\x93\x01\n\x12\x41pplicationService\x12}\n\nListFields\x12\x34.io.deephaven.proto.backplane.grpc.ListFieldsRequest\x1a\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!deephaven/proto/application.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x13\n\x11ListFieldsRequest\"\xd1\x01\n\x12\x46ieldsChangeUpdate\x12=\n\x07\x63reated\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07updated\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07removed\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\"\xb2\x01\n\tFieldInfo\x12\x44\n\x0ctyped_ticket\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12\x19\n\x11\x66ield_description\x18\x03 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t2\x93\x01\n\x12\x41pplicationService\x12}\n\nListFields\x12\x34.io.deephaven.proto.backplane.grpc.ListFieldsRequest\x1a\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\x00\x30\x01\x42GH\x01P\x01ZAgithub.com/deephaven/deephaven-core/go/internal/proto/applicationb\x06proto3') @@ -47,7 +47,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\001P\001' + DESCRIPTOR._serialized_options = b'H\001P\001ZAgithub.com/deephaven/deephaven-core/go/internal/proto/application' _LISTFIELDSREQUEST._serialized_start=102 _LISTFIELDSREQUEST._serialized_end=121 _FIELDSCHANGEUPDATE._serialized_start=124 diff --git a/py/client/pydeephaven/proto/console_pb2.py b/py/client/pydeephaven/proto/console_pb2.py index 5c122c646d2..7dffd7e7ae4 100644 --- a/py/client/pydeephaven/proto/console_pb2.py +++ b/py/client/pydeephaven/proto/console_pb2.py @@ -12,12 +12,11 @@ _sym_db = _symbol_database.Default() -from pydeephaven.proto import table_pb2 as deephaven_dot_proto_dot_table__pb2 from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 from pydeephaven.proto import application_pb2 as deephaven_dot_proto_dot_application__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1b\x64\x65\x65phaven/proto/table.proto\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\xff\n\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\xff\n\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/consoleb\x06proto3') @@ -391,113 +390,113 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\001P\001' + DESCRIPTOR._serialized_options = b'H\001P\001Z=github.com/deephaven/deephaven-core/go/internal/proto/console' _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._options = None _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._serialized_options = b'0\001' _LOGSUBSCRIPTIONDATA.fields_by_name['micros']._options = None _LOGSUBSCRIPTIONDATA.fields_by_name['micros']._serialized_options = b'0\001' _FIGUREDESCRIPTOR.fields_by_name['update_interval']._options = None _FIGUREDESCRIPTOR.fields_by_name['update_interval']._serialized_options = b'0\001' - _GETCONSOLETYPESREQUEST._serialized_start=169 - _GETCONSOLETYPESREQUEST._serialized_end=193 - _GETCONSOLETYPESRESPONSE._serialized_start=195 - _GETCONSOLETYPESRESPONSE._serialized_end=243 - _STARTCONSOLEREQUEST._serialized_start=245 - _STARTCONSOLEREQUEST._serialized_end=350 - _STARTCONSOLERESPONSE._serialized_start=352 - _STARTCONSOLERESPONSE._serialized_end=436 - _LOGSUBSCRIPTIONREQUEST._serialized_start=438 - _LOGSUBSCRIPTIONREQUEST._serialized_end=515 - _LOGSUBSCRIPTIONDATA._serialized_start=517 - _LOGSUBSCRIPTIONDATA._serialized_end=600 - _EXECUTECOMMANDREQUEST._serialized_start=602 - _EXECUTECOMMANDREQUEST._serialized_end=708 - _EXECUTECOMMANDRESPONSE._serialized_start=710 - _EXECUTECOMMANDRESPONSE._serialized_end=829 - _BINDTABLETOVARIABLEREQUEST._serialized_start=832 - _BINDTABLETOVARIABLEREQUEST._serialized_end=1013 - _BINDTABLETOVARIABLERESPONSE._serialized_start=1015 - _BINDTABLETOVARIABLERESPONSE._serialized_end=1044 - _CANCELCOMMANDREQUEST._serialized_start=1047 - _CANCELCOMMANDREQUEST._serialized_end=1195 - _CANCELCOMMANDRESPONSE._serialized_start=1197 - _CANCELCOMMANDRESPONSE._serialized_end=1220 - _AUTOCOMPLETEREQUEST._serialized_start=1223 - _AUTOCOMPLETEREQUEST._serialized_end=1626 - _AUTOCOMPLETERESPONSE._serialized_start=1629 - _AUTOCOMPLETERESPONSE._serialized_end=1761 - _BROWSERNEXTRESPONSE._serialized_start=1763 - _BROWSERNEXTRESPONSE._serialized_end=1784 - _OPENDOCUMENTREQUEST._serialized_start=1787 - _OPENDOCUMENTREQUEST._serialized_end=1954 - _TEXTDOCUMENTITEM._serialized_start=1956 - _TEXTDOCUMENTITEM._serialized_end=2039 - _CLOSEDOCUMENTREQUEST._serialized_start=2042 - _CLOSEDOCUMENTREQUEST._serialized_end=2225 - _CHANGEDOCUMENTREQUEST._serialized_start=2228 - _CHANGEDOCUMENTREQUEST._serialized_end=2676 - _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_start=2536 - _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_end=2676 - _DOCUMENTRANGE._serialized_start=2679 - _DOCUMENTRANGE._serialized_end=2826 - _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_start=2828 - _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_end=2891 - _POSITION._serialized_start=2893 - _POSITION._serialized_end=2936 - _GETCOMPLETIONITEMSREQUEST._serialized_start=2939 - _GETCOMPLETIONITEMSREQUEST._serialized_end=3295 - _COMPLETIONCONTEXT._serialized_start=3297 - _COMPLETIONCONTEXT._serialized_end=3365 - _GETCOMPLETIONITEMSRESPONSE._serialized_start=3368 - _GETCOMPLETIONITEMSRESPONSE._serialized_end=3506 - _COMPLETIONITEM._serialized_start=3509 - _COMPLETIONITEM._serialized_end=3912 - _TEXTEDIT._serialized_start=3914 - _TEXTEDIT._serialized_end=4010 - _FIGUREDESCRIPTOR._serialized_start=4013 - _FIGUREDESCRIPTOR._serialized_end=10226 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_start=4260 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_end=4945 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_start=4844 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_end=4935 - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_start=4948 - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_end=5586 - _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_start=5589 - _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_end=6977 - _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_start=6979 - _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_end=7079 - _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_start=7081 - _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_end=7181 - _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_start=7183 - _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_end=7277 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_start=7280 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_end=8342 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_start=8116 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_end=8158 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_start=8160 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_end=8227 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_start=8229 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_end=8295 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_start=8345 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_end=9225 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_start=8769 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_end=8814 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_start=8817 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_end=9065 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_start=9067 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_end=9120 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_start=9122 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_end=9225 - _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_start=9228 - _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_end=9410 - _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_start=9413 - _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_end=9721 - _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_start=9723 - _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_end=9822 - _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_start=9825 - _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_end=9991 - _FIGUREDESCRIPTOR_SOURCETYPE._serialized_start=9994 - _FIGUREDESCRIPTOR_SOURCETYPE._serialized_end=10204 - _CONSOLESERVICE._serialized_start=10229 - _CONSOLESERVICE._serialized_end=11636 + _GETCONSOLETYPESREQUEST._serialized_start=140 + _GETCONSOLETYPESREQUEST._serialized_end=164 + _GETCONSOLETYPESRESPONSE._serialized_start=166 + _GETCONSOLETYPESRESPONSE._serialized_end=214 + _STARTCONSOLEREQUEST._serialized_start=216 + _STARTCONSOLEREQUEST._serialized_end=321 + _STARTCONSOLERESPONSE._serialized_start=323 + _STARTCONSOLERESPONSE._serialized_end=407 + _LOGSUBSCRIPTIONREQUEST._serialized_start=409 + _LOGSUBSCRIPTIONREQUEST._serialized_end=486 + _LOGSUBSCRIPTIONDATA._serialized_start=488 + _LOGSUBSCRIPTIONDATA._serialized_end=571 + _EXECUTECOMMANDREQUEST._serialized_start=573 + _EXECUTECOMMANDREQUEST._serialized_end=679 + _EXECUTECOMMANDRESPONSE._serialized_start=681 + _EXECUTECOMMANDRESPONSE._serialized_end=800 + _BINDTABLETOVARIABLEREQUEST._serialized_start=803 + _BINDTABLETOVARIABLEREQUEST._serialized_end=984 + _BINDTABLETOVARIABLERESPONSE._serialized_start=986 + _BINDTABLETOVARIABLERESPONSE._serialized_end=1015 + _CANCELCOMMANDREQUEST._serialized_start=1018 + _CANCELCOMMANDREQUEST._serialized_end=1166 + _CANCELCOMMANDRESPONSE._serialized_start=1168 + _CANCELCOMMANDRESPONSE._serialized_end=1191 + _AUTOCOMPLETEREQUEST._serialized_start=1194 + _AUTOCOMPLETEREQUEST._serialized_end=1597 + _AUTOCOMPLETERESPONSE._serialized_start=1600 + _AUTOCOMPLETERESPONSE._serialized_end=1732 + _BROWSERNEXTRESPONSE._serialized_start=1734 + _BROWSERNEXTRESPONSE._serialized_end=1755 + _OPENDOCUMENTREQUEST._serialized_start=1758 + _OPENDOCUMENTREQUEST._serialized_end=1925 + _TEXTDOCUMENTITEM._serialized_start=1927 + _TEXTDOCUMENTITEM._serialized_end=2010 + _CLOSEDOCUMENTREQUEST._serialized_start=2013 + _CLOSEDOCUMENTREQUEST._serialized_end=2196 + _CHANGEDOCUMENTREQUEST._serialized_start=2199 + _CHANGEDOCUMENTREQUEST._serialized_end=2647 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_start=2507 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_end=2647 + _DOCUMENTRANGE._serialized_start=2650 + _DOCUMENTRANGE._serialized_end=2797 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_start=2799 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_end=2862 + _POSITION._serialized_start=2864 + _POSITION._serialized_end=2907 + _GETCOMPLETIONITEMSREQUEST._serialized_start=2910 + _GETCOMPLETIONITEMSREQUEST._serialized_end=3266 + _COMPLETIONCONTEXT._serialized_start=3268 + _COMPLETIONCONTEXT._serialized_end=3336 + _GETCOMPLETIONITEMSRESPONSE._serialized_start=3339 + _GETCOMPLETIONITEMSRESPONSE._serialized_end=3477 + _COMPLETIONITEM._serialized_start=3480 + _COMPLETIONITEM._serialized_end=3883 + _TEXTEDIT._serialized_start=3885 + _TEXTEDIT._serialized_end=3981 + _FIGUREDESCRIPTOR._serialized_start=3984 + _FIGUREDESCRIPTOR._serialized_end=10197 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_start=4231 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_end=4916 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_start=4815 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_end=4906 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_start=4919 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_end=5557 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_start=5560 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_end=6948 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_start=6950 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_end=7050 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_start=7052 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_end=7152 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_start=7154 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_end=7248 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_start=7251 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_end=8313 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_start=8087 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_end=8129 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_start=8131 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_end=8198 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_start=8200 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_end=8266 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_start=8316 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_end=9196 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_start=8740 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_end=8785 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_start=8788 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_end=9036 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_start=9038 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_end=9091 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_start=9093 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_end=9196 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_start=9199 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_end=9381 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_start=9384 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_end=9692 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_start=9694 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_end=9793 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_start=9796 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_end=9962 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_start=9965 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_end=10175 + _CONSOLESERVICE._serialized_start=10200 + _CONSOLESERVICE._serialized_end=11607 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/inputtable_pb2.py b/py/client/pydeephaven/proto/inputtable_pb2.py index 8c36c164356..400b20ca1c7 100644 --- a/py/client/pydeephaven/proto/inputtable_pb2.py +++ b/py/client/pydeephaven/proto/inputtable_pb2.py @@ -15,7 +15,7 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n deephaven/proto/inputtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x92\x01\n\x0f\x41\x64\x64TableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12?\n\x0ctable_to_add\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x12\n\x10\x41\x64\x64TableResponse\"\x98\x01\n\x12\x44\x65leteTableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x0ftable_to_remove\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x15\n\x13\x44\x65leteTableResponse2\xa6\x02\n\x11InputTableService\x12\x81\x01\n\x14\x41\x64\x64TableToInputTable\x12\x32.io.deephaven.proto.backplane.grpc.AddTableRequest\x1a\x33.io.deephaven.proto.backplane.grpc.AddTableResponse\"\x00\x12\x8c\x01\n\x19\x44\x65leteTableFromInputTable\x12\x35.io.deephaven.proto.backplane.grpc.DeleteTableRequest\x1a\x36.io.deephaven.proto.backplane.grpc.DeleteTableResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n deephaven/proto/inputtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x92\x01\n\x0f\x41\x64\x64TableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12?\n\x0ctable_to_add\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x12\n\x10\x41\x64\x64TableResponse\"\x98\x01\n\x12\x44\x65leteTableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x0ftable_to_remove\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x15\n\x13\x44\x65leteTableResponse2\xa6\x02\n\x11InputTableService\x12\x81\x01\n\x14\x41\x64\x64TableToInputTable\x12\x32.io.deephaven.proto.backplane.grpc.AddTableRequest\x1a\x33.io.deephaven.proto.backplane.grpc.AddTableResponse\"\x00\x12\x8c\x01\n\x19\x44\x65leteTableFromInputTable\x12\x35.io.deephaven.proto.backplane.grpc.DeleteTableRequest\x1a\x36.io.deephaven.proto.backplane.grpc.DeleteTableResponse\"\x00\x42\x46H\x01P\x01Z@github.com/deephaven/deephaven-core/go/internal/proto/inputtableb\x06proto3') @@ -55,7 +55,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\001P\001' + DESCRIPTOR._serialized_options = b'H\001P\001Z@github.com/deephaven/deephaven-core/go/internal/proto/inputtable' _ADDTABLEREQUEST._serialized_start=102 _ADDTABLEREQUEST._serialized_end=248 _ADDTABLERESPONSE._serialized_start=250 diff --git a/py/client/pydeephaven/proto/object_pb2.py b/py/client/pydeephaven/proto/object_pb2.py index 6ccfa855ae2..82181242185 100644 --- a/py/client/pydeephaven/proto/object_pb2.py +++ b/py/client/pydeephaven/proto/object_pb2.py @@ -15,7 +15,7 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/object.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"W\n\x12\x46\x65tchObjectRequest\x12\x41\n\tsource_id\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\"z\n\x13\x46\x65tchObjectResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12G\n\x0ftyped_export_id\x18\x03 \x03(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket2\x8f\x01\n\rObjectService\x12~\n\x0b\x46\x65tchObject\x12\x35.io.deephaven.proto.backplane.grpc.FetchObjectRequest\x1a\x36.io.deephaven.proto.backplane.grpc.FetchObjectResponse\"\x00\x42\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/object.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"W\n\x12\x46\x65tchObjectRequest\x12\x41\n\tsource_id\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\"z\n\x13\x46\x65tchObjectResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12G\n\x0ftyped_export_id\x18\x03 \x03(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket2\x8f\x01\n\rObjectService\x12~\n\x0b\x46\x65tchObject\x12\x35.io.deephaven.proto.backplane.grpc.FetchObjectRequest\x1a\x36.io.deephaven.proto.backplane.grpc.FetchObjectResponse\"\x00\x42\x42H\x01P\x01Z\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\x91\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xae\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x42\x04\n\x02op*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xce%\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x64\x65\x65phaven/proto/table.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"l\n\x0eTableReference\x12;\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketH\x00\x12\x16\n\x0c\x62\x61tch_offset\x18\x02 \x01(\x11H\x00\x42\x05\n\x03ref\"\xc6\x01\n\x1d\x45xportedTableCreationResponse\x12\x44\n\tresult_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\nerror_info\x18\x03 \x01(\t\x12\x15\n\rschema_header\x18\x04 \x01(\x0c\x12\x11\n\tis_static\x18\x05 \x01(\x08\x12\x10\n\x04size\x18\x06 \x01(\x12\x42\x02\x30\x01\"\x97\x01\n\x11\x46\x65tchTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xa0\x01\n\x1a\x41pplyPreviewColumnsRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9d\x01\n\x17\x46\x65tchPandasTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x1d\n\x1b\x45xportedTableUpdatesRequest\"\x8c\x01\n\x1a\x45xportedTableUpdateMessage\x12<\n\texport_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x1e\n\x16update_failure_message\x18\x03 \x01(\t\"c\n\x11\x45mptyTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\"\x88\x01\n\x10TimeTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x1c\n\x10start_time_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x18\n\x0cperiod_nanos\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xb1\x01\n\x15SelectOrUpdateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_specs\x18\x03 \x03(\t\"\xb1\x01\n\x15SelectDistinctRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xae\x01\n\x12\x44ropColumnsRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xb5\x01\n\x1eUnstructuredFilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07\x66ilters\x18\x03 \x03(\t\"\xad\x01\n\x11HeadOrTailRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xce\x01\n\x13HeadOrTailByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x1d\n\x15group_by_column_specs\x18\x04 \x03(\t\"\xc3\x01\n\x0eUngroupRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x11\n\tnull_fill\x18\x03 \x01(\x08\x12\x1a\n\x12\x63olumns_to_ungroup\x18\x04 \x03(\t\"\xad\x01\n\x12MergeTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x45\n\nsource_ids\x18\x02 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x12\n\nkey_column\x18\x03 \x01(\t\"\x91\x02\n\x14SnapshotTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x1b\n\x13\x64o_initial_snapshot\x18\x04 \x01(\x08\x12\x15\n\rstamp_columns\x18\x05 \x03(\t\"\xa7\x02\n\x16\x43rossJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\x14\n\x0creserve_bits\x18\x06 \x01(\x05\"\x93\x02\n\x18NaturalJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x91\x02\n\x16\x45xactJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x90\x02\n\x15LeftJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\xc9\x03\n\x15\x41sOfJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\\\n\x10\x61s_of_match_rule\x18\x07 \x01(\x0e\x32\x42.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule\"Y\n\tMatchRule\x12\x13\n\x0fLESS_THAN_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12GREATER_THAN_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\"\xfa\x04\n\x15\x43omboAggregateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12V\n\naggregates\x18\x03 \x03(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate\x12\x18\n\x10group_by_columns\x18\x04 \x03(\t\x12\x13\n\x0b\x66orce_combo\x18\x05 \x01(\x08\x1a\xad\x01\n\tAggregate\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x12\x13\n\x0b\x63olumn_name\x18\x03 \x01(\t\x12\x12\n\npercentile\x18\x04 \x01(\x01\x12\x12\n\navg_median\x18\x05 \x01(\x08\"\xa5\x01\n\x07\x41ggType\x12\x07\n\x03SUM\x10\x00\x12\x0b\n\x07\x41\x42S_SUM\x10\x01\x12\t\n\x05GROUP\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\t\n\x05\x43OUNT\x10\x04\x12\t\n\x05\x46IRST\x10\x05\x12\x08\n\x04LAST\x10\x06\x12\x07\n\x03MIN\x10\x07\x12\x07\n\x03MAX\x10\x08\x12\n\n\x06MEDIAN\x10\t\x12\x0e\n\nPERCENTILE\x10\n\x12\x07\n\x03STD\x10\x0b\x12\x07\n\x03VAR\x10\x0c\x12\x10\n\x0cWEIGHTED_AVG\x10\r\"\xe1\x01\n\x0eSortDescriptor\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\x12\x13\n\x0bis_absolute\x18\x02 \x01(\x08\x12R\n\tdirection\x18\x03 \x01(\x0e\x32?.io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection\"Q\n\rSortDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\nDESCENDING\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\r\n\tASCENDING\x10\x01\x12\x0b\n\x07REVERSE\x10\x02\"\xd8\x01\n\x10SortTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12@\n\x05sorts\x18\x03 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.SortDescriptor\"\xd7\x01\n\x12\x46ilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12=\n\x07\x66ilters\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\" \n\tReference\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\"\x91\x01\n\x07Literal\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x18\n\nlong_value\x18\x04 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1d\n\x0fnano_time_value\x18\x05 \x01(\x12\x42\x02\x30\x01H\x00\x42\x07\n\x05value\"\x91\x01\n\x05Value\x12\x41\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.ReferenceH\x00\x12=\n\x07literal\x18\x02 \x01(\x0b\x32*.io.deephaven.proto.backplane.grpc.LiteralH\x00\x42\x06\n\x04\x64\x61ta\"\xbc\x05\n\tCondition\x12>\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\x91\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xae\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x42\x04\n\x02op*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xce%\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x41H\x01P\x01Z;github.com/deephaven/deephaven-core/go/internal/proto/tableb\x06proto3') _CASESENSITIVITY = DESCRIPTOR.enum_types_by_name['CaseSensitivity'] CaseSensitivity = enum_type_wrapper.EnumTypeWrapper(_CASESENSITIVITY) @@ -450,7 +450,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\001P\001' + DESCRIPTOR._serialized_options = b'H\001P\001Z;github.com/deephaven/deephaven-core/go/internal/proto/table' _EXPORTEDTABLECREATIONRESPONSE.fields_by_name['size']._options = None _EXPORTEDTABLECREATIONRESPONSE.fields_by_name['size']._serialized_options = b'0\001' _EXPORTEDTABLEUPDATEMESSAGE.fields_by_name['size']._options = None diff --git a/py/client/pydeephaven/proto/ticket_pb2.py b/py/client/pydeephaven/proto/ticket_pb2.py index 6f5067b38ff..840a53b4ce8 100644 --- a/py/client/pydeephaven/proto/ticket_pb2.py +++ b/py/client/pydeephaven/proto/ticket_pb2.py @@ -14,7 +14,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/ticket.proto\x12!io.deephaven.proto.backplane.grpc\"\x18\n\x06Ticket\x12\x0e\n\x06ticket\x18\x01 \x01(\x0c\"V\n\x0bTypedTicket\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04type\x18\x02 \x01(\tB\x04H\x01P\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/ticket.proto\x12!io.deephaven.proto.backplane.grpc\"\x18\n\x06Ticket\x12\x0e\n\x06ticket\x18\x01 \x01(\x0c\"V\n\x0bTypedTicket\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04type\x18\x02 \x01(\tBBH\x01P\x01Z Date: Mon, 25 Jul 2022 22:23:36 -0400 Subject: [PATCH 032/215] Port DHE fix for DH-12895 (RowSetSequentialBuilder.appendRowSequence bug) to DHE. (#2682) * Port DHE fix for DH-12895 (RowSetSequentialBuilder.appendRowSequence bug) to DHE. * Spotlessfy.: * Updated QueryTable after discussion with Nate (thanks!). --- .../engine/rowset/impl/rsp/RspBitmap.java | 23 ++++++++-------- .../rowset/impl/WritableRowSetImplTest.java | 26 +++++++++++++++++++ .../engine/table/impl/QueryTable.java | 11 ++------ 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/rsp/RspBitmap.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/rsp/RspBitmap.java index 58921d468c0..42859b936a8 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/rsp/RspBitmap.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/rsp/RspBitmap.java @@ -949,21 +949,20 @@ public RspBitmap orEqualsShiftedUnsafe(final long shiftAmount, final RspBitmap o } public void appendShiftedUnsafeNoWriteCheck(final long shiftAmount, final RspArray other, final boolean acquire) { - if ((shiftAmount & BLOCK_LAST) == 0) { - if (tryAppendShiftedUnsafeNoWriteCheck(shiftAmount, other, acquire)) { - return; - } - } else if (lastValue() < other.firstValue() + shiftAmount) { - other.forEachLongRange((final long start, final long end) -> { - appendRangeUnsafeNoWriteCheck(start + shiftAmount, end + shiftAmount); - return true; - }); + if ((shiftAmount & BLOCK_LAST) == 0 && + tryAppendShiftedUnsafeNoWriteCheck(shiftAmount, other, acquire)) { return; } - throw new IllegalArgumentException( - "Cannot append rowSet with shiftAmount=" + shiftAmount + ", firstRowKey=" + other.firstValue() + - " when our lastValue=" + lastValue()); + if (lastValue() >= other.firstValue() + shiftAmount) { + throw new IllegalArgumentException( + "Cannot append rowSet with shiftAmount=" + shiftAmount + ", firstRowKey=" + other.firstValue() + + " when our lastValue=" + lastValue()); + } + other.forEachLongRange((final long start, final long end) -> { + appendRangeUnsafeNoWriteCheck(start + shiftAmount, end + shiftAmount); + return true; + }); } /** diff --git a/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/WritableRowSetImplTest.java b/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/WritableRowSetImplTest.java index d0083501199..f4fc1812cb0 100644 --- a/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/WritableRowSetImplTest.java +++ b/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/WritableRowSetImplTest.java @@ -3368,4 +3368,30 @@ public void testSubSetForPositions() { } } } + + public void testSequentialBuilderMergeSpans() { + final RowSetBuilderSequential builder1 = RowSetFactory.builderSequential(); + final long blockSize = BLOCK_SIZE; + for (int ii = 0; ii <= SortedRanges.MAX_CAPACITY * 2; ++ii) { + builder1.appendRange(ii * blockSize, ii * blockSize + 1); + } + final RowSet ix1 = builder1.build(); + + final RowSetBuilderSequential builder2 = RowSetFactory.builderSequential(); + builder2.appendRange(SortedRanges.MAX_CAPACITY * 2 * blockSize + 10, + SortedRanges.MAX_CAPACITY * 2 * blockSize + 12); + for (int ii = SortedRanges.MAX_CAPACITY * 2 + 1; ii < SortedRanges.MAX_CAPACITY * 4; ++ii) { + builder2.appendRange(ii * blockSize, ii * blockSize + 1); + } + final RowSet ix2 = builder2.build(); + + final RowSetBuilderSequential builder3 = RowSetFactory.builderSequential(); + builder3.appendRowSequence(ix1); + builder3.appendRowSequence(ix2); + final RowSet ix3 = builder3.build(); + + final RowSet ix4 = ix1.union(ix2); + assertEquals(ix3, ix4); + assertEquals(ix1.size() + ix2.size(), ix4.size()); + } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index 6a909ba8cc1..83406471d7f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -901,15 +901,8 @@ private void doRefilter(final RowSet upstreamAdded, final RowSet upstreamRemoved getRowSet().writableCast().remove(removed); // Update our rowSet and compute removals due to splatting. - if (shiftData != null) { - final WritableRowSet rowSet = getRowSet().writableCast(); - shiftData.apply((beginRange, endRange, shiftDelta) -> { - final RowSet toShift = rowSet.subSetByKeyRange(beginRange, endRange); - rowSet.removeRange(beginRange, endRange); - removed.insert(rowSet.subSetByKeyRange(beginRange + shiftDelta, endRange + shiftDelta)); - rowSet.removeRange(beginRange + shiftDelta, endRange + shiftDelta); - rowSet.insert(toShift.shift(shiftDelta)); - }); + if (shiftData != null && shiftData.nonempty()) { + shiftData.apply(getRowSet().writableCast()); } final WritableRowSet newMapping; From 300568a3cf096ebe3aaea04bb6553dffcdae2e05 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Tue, 26 Jul 2022 11:10:39 -0600 Subject: [PATCH 033/215] Wrap updateBy operation (#2653) * Wrap updateBy in Python Co-authored-by: Chip Kent <5250374+chipkent@users.noreply.github.com> --- py/server/deephaven/table.py | 74 +++++++ py/server/deephaven/table_factory.py | 7 +- py/server/deephaven/updateby.py | 280 ++++++++++++++++++++++++++ py/server/tests/test_table_factory.py | 9 + py/server/tests/test_updateby.py | 122 +++++++++++ 5 files changed, 489 insertions(+), 3 deletions(-) create mode 100644 py/server/deephaven/updateby.py create mode 100644 py/server/tests/test_updateby.py diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 2240d18e5ca..ae664c64642 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -19,6 +19,7 @@ from deephaven.filters import Filter from deephaven.jcompat import j_array_list, to_sequence, j_unary_operator, j_binary_operator from deephaven.ugp import auto_locking_op +from deephaven.updateby import UpdateByOperation # Table _JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") @@ -1389,6 +1390,30 @@ def partition_by(self, by: Union[str, Sequence[str]], drop_keys: bool = False) - except Exception as e: raise DHError(e, "failed to create a partitioned table.") from e + def update_by(self, ops: Union[UpdateByOperation, List[UpdateByOperation]], + by: Union[str, List[str]] = None) -> Table: + """Creates a table with additional columns calculated from window-based aggregations of columns in this table. + The aggregations are defined by the provided operations, which support incremental aggregations over the + corresponding rows in the this table. The aggregations will apply position or time-based windowing and + compute the results over the entire table or each row group as identified by the provided key columns. + + Args: + ops (Union[UpdateByOperation, List[UpdateByOperation]]): the update-by operation definition(s) + by (Union[str, List[str]]): the key column name(s) to group the rows of the table + + Returns: + a new Table + + Raises: + DHError + """ + try: + ops = to_sequence(ops) + by = to_sequence(by) + return Table(j_table=self.j_table.updateBy(j_array_list(ops), *by)) + except Exception as e: + raise DHError(e, "table update-by operation failed.") from e + class PartitionedTable(JObjectWrapper): """A partitioned table is a table containing tables, known as constituent tables. @@ -1777,6 +1802,7 @@ def __init__(self, j_pt_proxy): self.sanity_check_joins = self.j_pt_proxy.sanityChecksJoins() self.target = PartitionedTable(j_partitioned_table=self.j_pt_proxy.target()) + @auto_locking_op def head(self, num_rows: int) -> PartitionedTableProxy: """Applies the :meth:`~Table.head` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1796,6 +1822,7 @@ def head(self, num_rows: int) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "head operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def tail(self, num_rows: int) -> PartitionedTableProxy: """Applies the :meth:`~Table.tail` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1815,6 +1842,7 @@ def tail(self, num_rows: int) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "tail operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def reverse(self) -> PartitionedTableProxy: """Applies the :meth:`~Table.reverse` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1862,6 +1890,7 @@ def snapshot(self, source_table: Union[Table, PartitionedTableProxy], do_init: b except Exception as e: raise DHError(e, "snapshot operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def sort(self, order_by: Union[str, Sequence[str]], order: Union[SortDirection, Sequence[SortDirection]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.sort` table operation to all constituent tables of the underlying partitioned @@ -1893,6 +1922,7 @@ def sort(self, order_by: Union[str, Sequence[str]], except Exception as e: raise DHError(e, "sort operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def sort_descending(self, order_by: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.sort_descending` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -1913,6 +1943,7 @@ def sort_descending(self, order_by: Union[str, Sequence[str]]) -> PartitionedTab except Exception as e: raise DHError(e, "sort_descending operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.where` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1978,6 +2009,7 @@ def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> except Exception as e: raise DHError(e, "where_not_in operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.view` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1998,6 +2030,7 @@ def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "view operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def update_view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.update_view` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2060,6 +2093,7 @@ def select(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTable except Exception as e: raise DHError(e, "select operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.select_distinct` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2281,6 +2315,7 @@ def raj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequenc except Exception as e: raise DHError(e, "reverse as-of join operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def group_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.group_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2304,6 +2339,7 @@ def group_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProx except Exception as e: raise DHError(e, "group-by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.agg_by` table operation to all constituent tables of the underlying partitioned @@ -2328,6 +2364,7 @@ def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], except Exception as e: raise DHError(e, "agg_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.agg_all_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2352,6 +2389,7 @@ def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> except Exception as e: raise DHError(e, "agg_all_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.count_by` table operation to all constituent tables of the underlying partitioned table with the provided source table, and produces a new PartitionedTableProxy with the result tables as the @@ -2376,6 +2414,7 @@ def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> Partitione except Exception as e: raise DHError(e, "count_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def first_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.first_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2399,6 +2438,7 @@ def first_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProx except Exception as e: raise DHError(e, "first_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def last_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.last_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2422,6 +2462,7 @@ def last_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy except Exception as e: raise DHError(e, "last_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def min_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.min_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2445,6 +2486,7 @@ def min_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "min_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def max_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.max_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2468,6 +2510,7 @@ def max_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "max_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2491,6 +2534,7 @@ def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.abs_sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2514,6 +2558,7 @@ def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTablePr except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.weighted_sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2538,6 +2583,7 @@ def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Pa except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.avg_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2561,6 +2607,7 @@ def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.weighted_avg_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2585,6 +2632,7 @@ def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Pa except Exception as e: raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.median_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2608,6 +2656,7 @@ def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTablePro except Exception as e: raise DHError(e, "median_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def std_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.std_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2631,6 +2680,7 @@ def std_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: except Exception as e: raise DHError(e, "std_by operation on the PartitionedTableProxy failed.") from e + @auto_locking_op def var_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.var_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2653,3 +2703,27 @@ def var_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy()) except Exception as e: raise DHError(e, "var_by operation on the PartitionedTableProxy failed.") from e + + @auto_locking_op + def update_by(self, ops: Union[UpdateByOperation, List[UpdateByOperation]], + by: Union[str, List[str]] = None) -> PartitionedTableProxy: + """Applies the :meth:`~Table.update_by` table operation to all constituent tables of the underlying partitioned + table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying + partitioned table. + + Args: + ops (Union[UpdateByOperation, List[UpdateByOperation]]): the update-by operation definition(s) + by (Union[str, List[str]]): the key column name(s) to group the rows of the table + + Returns: + a new PartitionedTableProxy + + Raises: + DHError + """ + try: + ops = to_sequence(ops) + by = to_sequence(by) + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateBy(j_array_list(ops), *by)) + except Exception as e: + raise DHError(e, "update-by operation on the PartitionedTableProxy failed.") from e diff --git a/py/server/deephaven/table_factory.py b/py/server/deephaven/table_factory.py index 778acaba5bc..0fe6e2bb8df 100644 --- a/py/server/deephaven/table_factory.py +++ b/py/server/deephaven/table_factory.py @@ -3,7 +3,7 @@ # """ This module provides various ways to make a Deephaven table. """ -from typing import List, Dict, Any +from typing import List, Dict, Any, Union import jpy @@ -38,11 +38,12 @@ def empty_table(size: int) -> Table: raise DHError(e, "failed to create an empty table.") from e -def time_table(period: str, start_time: str = None) -> Table: +def time_table(period: Union[str, int], start_time: str = None) -> Table: """Creates a table that adds a new row on a regular interval. Args: - period (str): time interval between new row additions + period (Union[str, int]): time interval between new row additions, can be expressed as an integer in + nanoseconds or a time interval string, e.g. "00:00:00.001" start_time (str): start time for adding new rows Returns: diff --git a/py/server/deephaven/updateby.py b/py/server/deephaven/updateby.py new file mode 100644 index 00000000000..66abe07cb28 --- /dev/null +++ b/py/server/deephaven/updateby.py @@ -0,0 +1,280 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# +"""This module supports building various operations for use with the update-by Table operation.""" +from enum import Enum +from typing import Union, List + +import jpy + +from deephaven import DHError +from deephaven._wrapper import JObjectWrapper +from deephaven.jcompat import to_sequence + +_JUpdateByOperation = jpy.get_type("io.deephaven.api.updateby.UpdateByOperation") +_JBadDataBehavior = jpy.get_type("io.deephaven.api.updateby.BadDataBehavior") +_JOperationControl = jpy.get_type("io.deephaven.api.updateby.OperationControl") +_JMathContext = jpy.get_type("java.math.MathContext") +_JDateTimeUtils = jpy.get_type("io.deephaven.time.DateTimeUtils") + + +class MathContext(Enum): + """An Enum for predefined precision and rounding settings in numeric calculation.""" + UNLIMITED = _JMathContext.UNLIMITED + """unlimited precision arithmetic, rounding is half-up""" + + DECIMAL32 = _JMathContext.DECIMAL32 + """a precision setting matching the IEEE 754R Decimal32 format, 7 digits, rounding is half-even""" + + DECIMAL64 = _JMathContext.DECIMAL64 + """a precision setting matching the IEEE 754R Decimal64 format, 16 digits, rounding is half-even""" + + DECIMAL128 = _JMathContext.DECIMAL128 + """a precision setting matching the IEEE 754R Decimal128 format, 34 digits, rounding is half-even""" + + +class BadDataBehavior(Enum): + """An Enum defining ways to handle invalid data during update-by operations.""" + + RESET = _JBadDataBehavior.RESET + """Reset the state for the bucket to None when invalid data is encountered""" + + SKIP = _JBadDataBehavior.SKIP + """Skip and do not process the invalid data without changing state""" + + THROW = _JBadDataBehavior.THROW + """Throw an exception and abort processing when bad data is encountered""" + + POISON = _JBadDataBehavior.POISON + """Allow the bad data to poison the result. This is only valid for use with NaN""" + + +class OperationControl(JObjectWrapper): + """A OperationControl represents control parameters for performing operations with the table + UpdateByOperation. """ + j_object_type = _JOperationControl + + @property + def j_object(self) -> jpy.JType: + return self.j_op_control + + def __init__(self, on_null: BadDataBehavior = BadDataBehavior.SKIP, + on_nan: BadDataBehavior = BadDataBehavior.SKIP, + on_null_time: BadDataBehavior = BadDataBehavior.SKIP, + on_negative_deltatime: BadDataBehavior = BadDataBehavior.THROW, + on_zero_deltatime: BadDataBehavior = BadDataBehavior.SKIP, + big_value_context: MathContext = MathContext.DECIMAL128): + """Initializes an OperationControl for use with certain UpdateByOperation, such as EMAs. + + Args: + on_null (BadDataBehavior): the behavior for when null values are encountered, default is SKIP + on_nan (BadDataBehavior): the behavior for when NaN values are encountered, default is SKIP + on_null_time (BadDataBehavior): the behavior for when null timestamps are encountered, default is SKIP + on_negative_deltatime (BadDataBehavior): the behavior for when negative sample-to-sample time differences + are encountered, default is THROW + on_zero_deltatime (BadDataBehavior): the behavior for when zero sample-to-sample-time differences are + encountered, default is SKIP + big_value_context (MathContext): the context to use when processing arbitrary precision numeric values + (Java BigDecimal/BigInteger), default is DECIMAL128. + + Raises: + DHError + """ + try: + j_builder = _JOperationControl.builder() + self.j_op_control = (j_builder.onNullValue(on_null.value) + .onNanValue(on_nan.value) + .onNullTime(on_null_time.value) + .onNegativeDeltaTime(on_negative_deltatime.value) + .onZeroDeltaTime(on_zero_deltatime.value) + .bigValueContext(big_value_context.value).build()) + except Exception as e: + raise DHError(e, "failed to build an OperationControl object.") from e + + +class UpdateByOperation(JObjectWrapper): + """A UpdateByOperation represents an operator for the Table update-by operation.""" + + j_object_type = _JUpdateByOperation + + def __init__(self, j_updateby_op): + self.j_updateby_op = j_updateby_op + + @property + def j_object(self) -> jpy.JType: + return self.j_updateby_op + + +def ema_tick_decay(time_scale_ticks: int, cols: Union[str, List[str]], + op_control: OperationControl = None) -> UpdateByOperation: + """Creates an EMA (exponential moving average) UpdateByOperation for the supplied column names, using ticks as + the decay unit. + + The formula used is + a = e^(-1 / time_scale_ticks) + ema_next = a * ema_last + (1 - a) * value + + Args: + time_scale_ticks (int): the decay rate in ticks + cols (Union[str, List[str]]): the column(s) to be operated on, can be renaming expressions, i.e. "new_col = col" + op_control (OperationControl): defines how special cases should behave, when None, the default OperationControl + settings as specified in :meth:`~OperationControl.__init__` will be used + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + if op_control is None: + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.Ema(time_scale_ticks, *cols)) + else: + return UpdateByOperation( + j_updateby_op=_JUpdateByOperation.Ema(op_control.j_op_control, time_scale_ticks, *cols)) + except Exception as e: + raise DHError(e, "failed to create a tick-decay EMA UpdateByOperation.") from e + + +def ema_time_decay(ts_col: str, time_scale: Union[int, str], cols: Union[str, List[str]], + op_control: OperationControl = None) -> UpdateByOperation: + """Creates an EMA(exponential moving average) UpdateByOperation for the supplied column names, using time as the + decay unit. + + The formula used is + a = e^(-dt / time_scale_nanos) + ema_next = a * ema_last + (1 - a) * value + + Args: + ts_col (str): the column in the source table to use for timestamps + + time_scale (Union[int, str]): the decay rate, can be expressed as an integer in nanoseconds or a time + interval string, e.g. "00:00:00.001" + cols (Union[str, List[str]]): the column(s) to be operated on, can be renaming expressions, i.e. "new_col = col" + op_control (OperationControl): defines how special cases should behave, when None, the default OperationControl + settings as specified in :meth:`~OperationControl.__init__` will be used + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + if isinstance(time_scale, str): + time_scale = _JDateTimeUtils.expressionToNanos(time_scale) + cols = to_sequence(cols) + if op_control is None: + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.Ema(ts_col, time_scale, *cols)) + else: + return UpdateByOperation( + j_updateby_op=_JUpdateByOperation.Ema(op_control.j_op_control, ts_col, time_scale, *cols)) + except Exception as e: + raise DHError(e, "failed to create a time-decay EMA UpdateByOperation.") from e + + +def cum_sum(cols: Union[str, List[str]]) -> UpdateByOperation: + """Creates a cumulative sum UpdateByOperation for the supplied column names. + + Args: + + cols (Union[str, List[str]]): the column(s) to be operated on, can include expressions to rename the output, + i.e. "new_col = col"; when empty, update_by performs the cumulative sum operation on all the applicable + columns. + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.CumSum(cols)) + except Exception as e: + raise DHError(e, "failed to create a cumulative sum UpdateByOperation.") from e + + +def cum_prod(cols: Union[str, List[str]]) -> UpdateByOperation: + """Creates a cumulative product UpdateByOperation for the supplied column names. + + Args: + cols (Union[str, List[str]]): the column(s) to be operated on, can include expressions to rename the output, + i.e. "new_col = col"; when empty, update_by performing the cumulative product operation on all the + applicable columns. + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.CumProd(cols)) + except Exception as e: + raise DHError(e, "failed to create a cumulative product UpdateByOperation.") from e + + +def cum_min(cols: Union[str, List[str]]) -> UpdateByOperation: + """Creates a cumulative minimum UpdateByOperation for the supplied column names. + + Args: + cols (Union[str, List[str]]): the column(s) to be operated on, can include expressions to rename the output, + i.e. "new_col = col"; when empty, update_by perform the cumulative minimum operation on all the applicable + columns. + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.CumMin(cols)) + except Exception as e: + raise DHError(e, "failed to create a cumulative minimum UpdateByOperation.") from e + + +def cum_max(cols: Union[str, List[str]]) -> UpdateByOperation: + """Creates a cumulative maximum UpdateByOperation for the supplied column names. + + Args: + cols (Union[str, List[str]]): the column(s) to be operated on, can include expressions to rename the output, + i.e. "new_col = col"; when empty, update_by performs the cumulative maximum operation on all the applicable + columns. + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.CumMax(cols)) + except Exception as e: + raise DHError(e, "failed to create a cumulative maximum UpdateByOperation.") from e + + +def forward_fill(cols: Union[str, List[str]]) -> UpdateByOperation: + """Creates a forward fill UpdateByOperation for the supplied column names. Null values in the columns are + replaced by the last known non-null values. This operation is forward only. + + Args: + cols (Union[str, List[str]]): the column(s) to be operated on, can include expressions to rename the output, + i.e. "new_col = col"; when empty, update_by perform the forward fill operation on all columns. + + Returns: + an UpdateByOperation + + Raises: + DHError + """ + try: + cols = to_sequence(cols) + return UpdateByOperation(j_updateby_op=_JUpdateByOperation.Fill(cols)) + except Exception as e: + raise DHError(e, "failed to create a forward fill UpdateByOperation.") from e diff --git a/py/server/tests/test_table_factory.py b/py/server/tests/test_table_factory.py index 47dcec7464c..f4927f4c91a 100644 --- a/py/server/tests/test_table_factory.py +++ b/py/server/tests/test_table_factory.py @@ -52,6 +52,15 @@ def test_time_table(self): self.assertTrue(t.is_refreshing) self.assertEqual("2021-11-06T13:21:00.000000000 NY", t.j_table.getColumnSource("Timestamp").get(0).toString()) + t = time_table(1000_000_000) + self.assertEqual(1, len(t.columns)) + self.assertTrue(t.is_refreshing) + + t = time_table(1000_1000_1000, start_time="2021-11-06T13:21:00 NY") + self.assertEqual(1, len(t.columns)) + self.assertTrue(t.is_refreshing) + self.assertEqual("2021-11-06T13:21:00.000000000 NY", t.j_table.getColumnSource("Timestamp").get(0).toString()) + def test_time_table_error(self): with self.assertRaises(DHError) as cm: t = time_table("00:0a:01") diff --git a/py/server/tests/test_updateby.py b/py/server/tests/test_updateby.py new file mode 100644 index 00000000000..9c7f48eb9f0 --- /dev/null +++ b/py/server/tests/test_updateby.py @@ -0,0 +1,122 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# + +import unittest + +from deephaven import read_csv, time_table, ugp +from deephaven.updateby import ema_tick_decay, BadDataBehavior, MathContext, OperationControl, ema_time_decay, cum_sum, \ + cum_prod, cum_min, cum_max, forward_fill +from tests.testbase import BaseTestCase + + +class UpdateByTestCase(BaseTestCase): + def setUp(self): + self.static_table = read_csv("tests/data/test_table.csv").update("Timestamp=currentTime()") + with ugp.exclusive_lock(): + self.ticking_table = time_table("00:00:00.001").update( + ["a = i", "b = i*i % 13", "c = i * 13 % 23", "d = a + b", "e = a - b"]) + + def tearDown(self) -> None: + self.static_table = None + self.ticking_table = None + + def test_ema(self): + op_ctrl = OperationControl(on_null=BadDataBehavior.THROW, + on_null_time=BadDataBehavior.POISON, + on_nan=BadDataBehavior.RESET, + on_zero_deltatime=BadDataBehavior.SKIP, + on_negative_deltatime=BadDataBehavior.SKIP, + big_value_context=MathContext.UNLIMITED) + + ema_ops = [ema_tick_decay(time_scale_ticks=100, cols="ema_a = a"), + ema_tick_decay(time_scale_ticks=100, cols="ema_a = a", op_control=op_ctrl), + ema_time_decay(ts_col="Timestamp", time_scale=10, cols="ema_a = a"), + ema_time_decay(ts_col="Timestamp", time_scale="00:00:00.001", cols="ema_c = c", + op_control=op_ctrl), + ] + + for ema_op in ema_ops: + with self.subTest(ema_op): + for t in (self.static_table, self.ticking_table): + ema_table = t.update_by(ops=ema_op, by="b") + self.assertTrue(ema_table.is_refreshing is t.is_refreshing) + self.assertEqual(len(ema_table.columns), 1 + len(t.columns)) + with ugp.exclusive_lock(): + self.assertEqual(ema_table.size, t.size) + + def test_simple_ops(self): + op_builders = [cum_sum, cum_prod, cum_min, cum_max, forward_fill] + pairs = ["UA=a", "UB=b"] + + for op_builder in op_builders: + with self.subTest(op_builder): + for t in (self.static_table, self.ticking_table): + updateby_table = t.update_by(ops=op_builder(pairs), by="e") + self.assertTrue(updateby_table.is_refreshing is t.is_refreshing) + self.assertEqual(len(updateby_table.columns), 2 + len(t.columns)) + with ugp.exclusive_lock(): + self.assertEqual(updateby_table.size, t.size) + + def test_simple_ops_proxy(self): + op_builders = [cum_sum, cum_prod, cum_min, cum_max, forward_fill] + pairs = ["UA=a", "UB=b"] + pt_proxies = [self.static_table.partition_by("c").proxy(), + self.ticking_table.partition_by("c").proxy(), + ] + + for op_builder in op_builders: + with self.subTest(op_builder): + for pt_proxy in pt_proxies: + if pt_proxy.is_refreshing: + ugp.auto_locking = True + updateby_proxy = pt_proxy.update_by(ops=op_builder(pairs), by="e") + + self.assertTrue(updateby_proxy.is_refreshing is pt_proxy.is_refreshing) + self.assertEqual(len(updateby_proxy.target.constituent_table_columns), + 2 + len(pt_proxy.target.constituent_table_columns)) + + for ct, ub_ct in zip(pt_proxy.target.constituent_tables, updateby_proxy.target.constituent_tables): + with ugp.exclusive_lock(): + self.assertEqual(ct.size, ub_ct.size) + + if pt_proxy.is_refreshing: + ugp.auto_locking = False + + def test_ema_proxy(self): + op_ctrl = OperationControl(on_null=BadDataBehavior.THROW, + on_null_time=BadDataBehavior.POISON, + on_nan=BadDataBehavior.RESET, + on_zero_deltatime=BadDataBehavior.SKIP, + on_negative_deltatime=BadDataBehavior.SKIP, + big_value_context=MathContext.UNLIMITED) + + ema_ops = [ema_tick_decay(time_scale_ticks=100, cols="ema_a = a"), + ema_tick_decay(time_scale_ticks=100, cols="ema_a = a", op_control=op_ctrl), + ema_time_decay(ts_col="Timestamp", time_scale=10, cols="ema_a = a"), + ema_time_decay(ts_col="Timestamp", time_scale=100, cols="ema_c = c", + op_control=op_ctrl), + ] + pt_proxies = [self.static_table.partition_by("b").proxy(), + self.ticking_table.partition_by("b").proxy(), + ] + + for ema_op in ema_ops: + with self.subTest(ema_op): + for pt_proxy in pt_proxies: + if pt_proxy.is_refreshing: + ugp.auto_locking = True + + ema_proxy = pt_proxy.update_by(ema_op, by="e") + for ct, ema_ct in zip(pt_proxy.target.constituent_tables, ema_proxy.target.constituent_tables): + self.assertTrue(ema_ct.is_refreshing is ct.is_refreshing) + self.assertEqual(len(ema_ct.columns), 1 + len(ct.columns)) + with ugp.exclusive_lock(): + self.assertEqual(ct.size, ema_ct.size) + + if pt_proxy.is_refreshing: + ugp.auto_locking = True + + +if __name__ == '__main__': + unittest.main() From 56a98fca86f438749476814dd6a3ef618e787264 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 26 Jul 2022 10:15:44 -0700 Subject: [PATCH 034/215] Bump slim base image (#2684) --- docker/registry/slim-base/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index 7ab314db9aa..cb72474be62 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:2939e60d674ac0b25d28309973e7ba864effd5a9ac3cfdd40ed16b05f712b1d5 +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:2879266cccb1080e966a9a681f86b0519db86096be348b3460235fc95c4973aa From 512341d2b759a761916054bd4781236a6d1d61c1 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 26 Jul 2022 15:55:34 -0500 Subject: [PATCH 035/215] Prune dead web classes (#2666) --- .../web/shared/ast/AbstractVisitor.java | 143 -------- .../web/shared/ast/ConvertEqToIn.java | 62 ---- .../ast/ConvertInvalidInExpressions.java | 55 --- .../web/shared/ast/FilterPrinter.java | 294 --------------- .../web/shared/ast/FilterValidator.java | 342 ------------------ .../ast/FlipNonReferenceMatchExpression.java | 79 ---- .../web/shared/ast/GetTopLevelFilters.java | 30 -- .../shared/ast/MakeExpressionsNullSafe.java | 58 --- .../ast/MergeNestedBinaryOperations.java | 64 ---- .../ast/MergeRelatedSiblingExpressions.java | 95 ----- .../web/shared/ast/NormalizeNots.java | 31 -- .../web/shared/ast/ReplacingVisitor.java | 183 ---------- .../web/shared/batch/BatchTableRequest.java | 204 ----------- .../web/shared/batch/BatchTableResponse.java | 89 ----- .../web/shared/data/ColumnHolder.java | 55 --- .../deephaven/web/shared/util/ParseUtils.java | 28 -- .../ast/AbstractReplacingVisitorTest.java | 32 -- .../web/shared/ast/ConvertEqToInTest.java | 34 -- .../ast/ConvertInvalidInExpressionsTest.java | 32 -- .../web/shared/ast/FilterTestUtils.java | 130 ------- .../FlipNonReferenceMatchExpressionTest.java | 42 --- .../ast/MakeExpressionsNullSafeTest.java | 34 -- .../ast/MergeNestedBinaryOperationsTest.java | 74 ---- .../MergeRelatedSiblingExpressionsTest.java | 54 --- .../web/shared/ast/NormalizeNotsTest.java | 89 ----- 25 files changed, 2333 deletions(-) delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/AbstractVisitor.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertEqToIn.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressions.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterPrinter.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterValidator.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpression.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/GetTopLevelFilters.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafe.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperations.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressions.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/NormalizeNots.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ReplacingVisitor.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableRequest.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableResponse.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/data/ColumnHolder.java delete mode 100644 web/shared-beans/src/main/java/io/deephaven/web/shared/util/ParseUtils.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/AbstractReplacingVisitorTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertEqToInTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressionsTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FilterTestUtils.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpressionTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafeTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperationsTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressionsTest.java delete mode 100644 web/shared-beans/src/test/java/io/deephaven/web/shared/ast/NormalizeNotsTest.java diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/AbstractVisitor.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/AbstractVisitor.java deleted file mode 100644 index bf16d463249..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/AbstractVisitor.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -public class AbstractVisitor implements FilterDescriptor.Visitor { - protected void visitChildren(FilterDescriptor[] children) { - for (FilterDescriptor child : children) { - child.accept(this); - } - } - - protected void visitInvokeChildren(FilterDescriptor[] children) { - if (children.length > 0 && children[0] != null) { - children[0].accept(this); - } - for (int i = 1; i < children.length; i++) { - children[i].accept(this); - } - } - - @Override - public void onAnd(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onOr(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onNot(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onLessThan(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onGreaterThan(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onLessThanOrEqualTo(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onGreaterThanOrEqualTo(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onEqual(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onEqualIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onNotEqual(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onNotEqualIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onIn(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onInIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onNotIn(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onNotInIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onIsNull(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onInvoke(FilterDescriptor descriptor) { - visitInvokeChildren(descriptor.getChildren()); - } - - @Override - public void onLiteral(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onReference(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onContains(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onContainsIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onPattern(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onPatternIgnoreCase(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } - - @Override - public void onSearch(FilterDescriptor descriptor) { - visitChildren(descriptor.getChildren()); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertEqToIn.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertEqToIn.java deleted file mode 100644 index 4d9878c8880..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertEqToIn.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -/** - * IN-type expressions are more efficient at runtime than EQUALS, and also compile more quickly. However, they only work - * when comparing a column reference to a literal value, so this transformation looks for those and replaces the EQ-type - * node with its corresponding IN-type node. - * - * This is sort of the opposite of {@link ConvertInvalidInExpressions}, which converts EQs to INs when the types of the - * children are not appropriate for use in a MatchFilter. - * - * Has no apparent pre-requisites. - */ -public class ConvertEqToIn extends ReplacingVisitor { - public static FilterDescriptor execute(final FilterDescriptor descriptor) { - return new ConvertEqToIn().visit(descriptor); - } - - @Override - public FilterDescriptor onEqual(final FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.IN); - } - - @Override - public FilterDescriptor onEqualIgnoreCase(final FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.IN_ICASE); - } - - @Override - public FilterDescriptor onNotEqual(final FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.NOT_IN); - } - - @Override - public FilterDescriptor onNotEqualIgnoreCase(final FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.NOT_IN_ICASE); - } - - private FilterDescriptor handle(final FilterDescriptor descriptor, final FilterDescriptor.FilterOperation in) { - // if one is a reference and one is a literal, we can process it and ensure the reference is first - final FilterDescriptor first = descriptor.getChildren()[0]; - final FilterDescriptor second = descriptor.getChildren()[1]; - if (first.getOperation() == FilterDescriptor.FilterOperation.REFERENCE - && second.getOperation() == FilterDescriptor.FilterOperation.LITERAL) { - return replaceWithIn(in, first, second); - } else if (first.getOperation() == FilterDescriptor.FilterOperation.LITERAL - && second.getOperation() == FilterDescriptor.FilterOperation.REFERENCE) { - return replaceWithIn(in, second, first); - } else { - return descriptor; - } - } - - private FilterDescriptor replaceWithIn(final FilterDescriptor.FilterOperation operation, - final FilterDescriptor reference, final FilterDescriptor literal) { - return new FilterDescriptor(operation, null, null, new FilterDescriptor[] {reference, literal}); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressions.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressions.java deleted file mode 100644 index 9db556c8e7f..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressions.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -/** - * Rewrite any IN-type expression into its corresponding EQUALS if the left side is not a reference or if the right side - * does have a reference. Assumes that FlipNonReferenceMatchExpression has already been run, making this the second - * attempt to deal with these, and letting us be confident that these expressions cannot be expressed as more efficient - * "in"s. - * - * Examples: o ColumnA in 1 - left as is o ColumnA in 1, 2 - left as is o 1 in 2 - rewritten to 1 == 2. o ColumnA in - * ColumnB - rewritten to ColumnA == ColumnB - * - * Signs that visitors were mis-ordered: o 1 in ColumnA - literal on LHS should already be handled o 1 in 2, 3 - literal - * on LHS with multiple RHS values should already be handled, should have been flipped and split into individual exprs o - * ColumnA in ColumnB, 2 - column ref on RHS should already be handled - */ -public class ConvertInvalidInExpressions extends ReplacingVisitor { - public static FilterDescriptor execute(FilterDescriptor filter) { - return new ConvertInvalidInExpressions().visit(filter); - } - - @Override - public FilterDescriptor onIn(FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.EQ); - } - - private FilterDescriptor handle(FilterDescriptor descriptor, - FilterDescriptor.FilterOperation replacementOperation) { - if (descriptor.getChildren().length != 2 - || descriptor.getChildren()[0].getOperation() != descriptor.getChildren()[1].getOperation()) { - return descriptor; - } - - return new FilterDescriptor(replacementOperation, null, null, descriptor.getChildren()); - } - - @Override - public FilterDescriptor onInIgnoreCase(FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.EQ_ICASE); - } - - @Override - public FilterDescriptor onNotIn(FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.NEQ); - } - - @Override - public FilterDescriptor onNotInIgnoreCase(FilterDescriptor descriptor) { - return handle(descriptor, FilterDescriptor.FilterOperation.NEQ_ICASE); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterPrinter.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterPrinter.java deleted file mode 100644 index 4a46f1047ca..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterPrinter.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import io.deephaven.web.shared.data.FilterDescriptor.Kind; -import io.deephaven.web.shared.util.ParseUtils; - -import java.util.function.UnaryOperator; - -/** - * Prints a readable string representing this filter. Note that this is presently only suitable for debugging purposes, - * and doesn't generate something that the SelectFilterFactory can handle at this time. However, this can be used to - * produce individual java snippets of simple conditions, and is used on the JVM by the visitor that builds - * SelectFilters recursively from the filter AST. - */ -public class FilterPrinter implements FilterDescriptor.Visitor { - private final StringBuilder sb = new StringBuilder(); - private final UnaryOperator stringEscape; - - public FilterPrinter(UnaryOperator stringEscape) { - this.stringEscape = stringEscape; - } - - - public String print(FilterDescriptor descriptor) { - assert sb.length() == 0 : "sb.isEmpty()"; - descriptor.accept(this); - return sb.toString(); - } - - @Override - public void onAnd(FilterDescriptor descriptor) { - sb.append("("); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - if (i != 0) { - sb.append(" && "); - } - child.accept(this); - } - sb.append(")"); - } - - @Override - public void onOr(FilterDescriptor descriptor) { - sb.append("("); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - if (i != 0) { - sb.append(" || "); - } - child.accept(this); - } - sb.append(")"); - } - - @Override - public void onNot(FilterDescriptor descriptor) { - sb.append("!("); - assert descriptor.getChildren().length == 1; - descriptor.getChildren()[0].accept(this); - sb.append(")"); - } - - @Override - public void onLessThan(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" < "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onGreaterThan(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" > "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onLessThanOrEqualTo(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" <= "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onGreaterThanOrEqualTo(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" >= "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onEqual(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" == "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onEqualIgnoreCase(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" == (ignore case) "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onNotEqual(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" != "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onNotEqualIgnoreCase(FilterDescriptor descriptor) { - assert descriptor.getChildren().length == 2; - descriptor.getChildren()[0].accept(this); - sb.append(" != (ignore case) "); - descriptor.getChildren()[1].accept(this); - } - - @Override - public void onIn(FilterDescriptor descriptor) { - descriptor.getChildren()[0].accept(this); - sb.append(" in "); - for (int i = 1; i < descriptor.getChildren().length; i++) { - if (i != 1) { - sb.append(", "); - } - descriptor.getChildren()[i].accept(this); - } - } - - @Override - public void onInIgnoreCase(FilterDescriptor descriptor) { - descriptor.getChildren()[0].accept(this); - sb.append(" icase in "); - for (int i = 1; i < descriptor.getChildren().length; i++) { - if (i != 1) { - sb.append(", "); - } - descriptor.getChildren()[i].accept(this); - } - } - - @Override - public void onNotIn(FilterDescriptor descriptor) { - descriptor.getChildren()[0].accept(this); - sb.append(" not in "); - for (int i = 1; i < descriptor.getChildren().length; i++) { - if (i != 1) { - sb.append(", "); - } - descriptor.getChildren()[i].accept(this); - } - } - - @Override - public void onNotInIgnoreCase(FilterDescriptor descriptor) { - descriptor.getChildren()[0].accept(this); - sb.append(" icase not in "); - for (int i = 1; i < descriptor.getChildren().length; i++) { - if (i != 1) { - sb.append(", "); - } - descriptor.getChildren()[i].accept(this); - } - } - - @Override - public void onIsNull(FilterDescriptor descriptor) { - sb.append("isNull("); - assert descriptor.getChildren().length == 1; - descriptor.getChildren()[0].accept(this); - sb.append(")"); - } - - @Override - public void onInvoke(FilterDescriptor descriptor) { - assert descriptor.getChildren().length >= 1 : "expecting at least one child, even if it is a null value"; - if (descriptor.getChildren()[0] != null) { - assert descriptor.getChildren()[0].getOperation().expressionKind == Kind.Value; - descriptor.getChildren()[0].accept(this); - sb.append("."); - } - sb.append(descriptor.getValue()); - sb.append("("); - for (int i = 1; i < descriptor.getChildren().length; i++) { - if (i != 1) { - sb.append(", "); - } - descriptor.getChildren()[i].accept(this); - } - sb.append(")"); - } - - @Override - public void onLiteral(FilterDescriptor descriptor) { - // switch on type, correctly escape any string - switch (descriptor.getType()) { - case String: - sb.append(stringEscape.apply(descriptor.getValue())); - break; - case Boolean: - ParseUtils.parseBoolean(descriptor.getValue()); - sb.append(descriptor.getValue()); - break; - case Datetime: - // noinspection ResultOfMethodCallIgnored - Long.parseLong(descriptor.getValue()); - sb.append("new DateTime(").append(descriptor.getValue()).append(")"); - break; - case Long: - // noinspection ResultOfMethodCallIgnored - Long.parseLong(descriptor.getValue()); - sb.append(descriptor.getValue()); - break; - case Number: - // noinspection ResultOfMethodCallIgnored - Double.parseDouble(descriptor.getValue()); - sb.append(descriptor.getValue()); - break; - case Other: - // print as a string, not sure how to handle otherwise - sb.append(stringEscape.apply(descriptor.getValue())); - break; - } - } - - @Override - public void onReference(FilterDescriptor descriptor) { - sb.append(descriptor.getValue()); - } - - @Override - public void onContains(FilterDescriptor descriptor) { - sb.append("contains("); - FilterDescriptor col = descriptor.getChildren()[0]; - col.accept(this); - sb.append(", "); - FilterDescriptor val = descriptor.getChildren()[1]; - val.accept(this); - sb.append(")"); - } - - @Override - public void onContainsIgnoreCase(FilterDescriptor descriptor) { - sb.append("containsIgnoreCase("); - FilterDescriptor col = descriptor.getChildren()[0]; - col.accept(this); - sb.append(", "); - FilterDescriptor val = descriptor.getChildren()[1]; - val.accept(this); - sb.append(")"); - } - - @Override - public void onPattern(FilterDescriptor descriptor) { - sb.append("pattern("); - FilterDescriptor col = descriptor.getChildren()[0]; - col.accept(this); - sb.append(", "); - FilterDescriptor val = descriptor.getChildren()[1]; - val.accept(this); - sb.append(")"); - } - - @Override - public void onPatternIgnoreCase(FilterDescriptor descriptor) { - sb.append("patternIgnoreCase("); - FilterDescriptor col = descriptor.getChildren()[0]; - col.accept(this); - sb.append(", "); - FilterDescriptor val = descriptor.getChildren()[1]; - val.accept(this); - sb.append(")"); - } - - @Override - public void onSearch(FilterDescriptor descriptor) { - sb.append("searchTableColumns("); - descriptor.getChildren()[0].accept(this); - sb.append(")"); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterValidator.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterValidator.java deleted file mode 100644 index c01780c8129..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FilterValidator.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import io.deephaven.web.shared.data.FilterDescriptor.FilterOperation; -import io.deephaven.web.shared.data.FilterDescriptor.Kind; -import io.deephaven.web.shared.data.FilterDescriptor.ValueType; -import io.deephaven.web.shared.util.ParseUtils; - -import java.util.Arrays; -import java.util.Stack; -import java.util.function.BiPredicate; -import java.util.function.Predicate; - -/** - * Sanity checks a filter and its children, to confirm that each object makes sense with regard to its fields, child - * count, etc. - */ -public class FilterValidator implements FilterDescriptor.Visitor { - private Stack stack = new Stack<>(); - private final BiPredicate invokeCheck; - private final Predicate columnCheck; - - public FilterValidator(BiPredicate invokeCheck, Predicate columnCheck) { - this.invokeCheck = invokeCheck; - this.columnCheck = columnCheck; - } - - - private void check(boolean assertion, String description) { - if (!assertion) { - throw new IllegalStateException(description + " at " + stackToString()); - } - } - - private String stackToString() { - return stack.toString(); - } - - @Override - public void onAnd(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length >= 2, descriptor.getChildren().length + " > 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Condition, - child.getOperation().expressionKind + " == Condition"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onOr(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length >= 2, descriptor.getChildren().length + " > 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Condition, - child.getOperation().expressionKind + " == Condition"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onNot(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 1, descriptor.getChildren().length + " == 1"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Condition, - child.getOperation().expressionKind + " == Condition"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onLessThan(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onGreaterThan(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onLessThanOrEqualTo(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onGreaterThanOrEqualTo(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onEqual(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onEqualIgnoreCase(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onNotEqual(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onNotEqualIgnoreCase(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 2, descriptor.getChildren().length + " == 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - check(child.getOperation().expressionKind == Kind.Value, child.getOperation().expressionKind + " == Value"); - child.accept(this); - } - stack.pop(); - } - - @Override - public void onIn(FilterDescriptor descriptor) { - validateIn(descriptor); - } - - @Override - public void onInIgnoreCase(FilterDescriptor descriptor) { - validateIn(descriptor); - } - - @Override - public void onNotIn(FilterDescriptor descriptor) { - validateIn(descriptor); - } - - @Override - public void onNotInIgnoreCase(FilterDescriptor descriptor) { - validateIn(descriptor); - } - - private void validateIn(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length >= 2, descriptor.getChildren().length + " >= 2"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - child.accept(this); - } - stack.pop(); - } - - @Override - public void onIsNull(FilterDescriptor descriptor) { - stack.push(descriptor); - check(descriptor.getChildren().length == 1, descriptor.getChildren().length + " == 1"); - for (int i = 0; i < descriptor.getChildren().length; i++) { - FilterDescriptor child = descriptor.getChildren()[i]; - child.accept(this); - } - stack.pop(); - } - - @Override - public void onInvoke(FilterDescriptor descriptor) { - stack.push(descriptor); - - check(descriptor.getValue() != null, "value != null"); - - // check name+args against known whitelist - may be impl'd different on client than server - check(invokeCheck.test(descriptor.getValue(), descriptor.getChildren()), - "User filters are not permitted to use method " + descriptor.getValue()); - - check(descriptor.getChildren().length > 0, - "Invocation is poorly formed, must have at least one child representing the instance"); - - boolean isStatic = descriptor.getChildren()[0] == null; - - for (int i = 0; i < descriptor.getChildren().length; i++) { - if (i == 0 && isStatic) { - continue; - } - FilterDescriptor child = descriptor.getChildren()[i]; - check(child != null, "Invoke parameter may not be null"); - child.accept(this); - } - stack.pop(); - } - - @SuppressWarnings("ResultOfMethodCallIgnored") - @Override - public void onLiteral(FilterDescriptor descriptor) { - check(descriptor.getValue() != null, "value != null"); - check(descriptor.getType() != null, "type != null"); - - switch (descriptor.getType()) { - case String: - // no checks required - break; - case Number: - // verify it parses as a double - Double.parseDouble(descriptor.getValue()); - break; - case Boolean: - // verify it parses as a boolean - ParseUtils.parseBoolean(descriptor.getValue()); - break; - case Datetime: - case Long: - // verify it parses as a long - Long.parseLong(descriptor.getValue()); - break; - case Other: - // fail, not currently supported - throw new IllegalStateException("Not currently supported"); - } - - check(descriptor.getChildren().length == 0, descriptor.getChildren().length + " == 0"); - } - - @Override - public void onReference(FilterDescriptor descriptor) { - check(descriptor.getValue() != null, "value != null"); - - check(descriptor.getChildren().length == 0, descriptor.getChildren().length + " == 0"); - - // verify that this reference points to a column name in the current table - check(columnCheck.test(descriptor.getValue()), "Unknown column name"); - } - - @Override - public void onContains(FilterDescriptor descriptor) { - validatePatternFilter(descriptor, "Contains"); - } - - @Override - public void onContainsIgnoreCase(FilterDescriptor descriptor) { - validatePatternFilter(descriptor, "ContainsIgnoreCase"); - } - - @Override - public void onPattern(FilterDescriptor descriptor) { - validatePatternFilter(descriptor, "Pattern"); - } - - @Override - public void onPatternIgnoreCase(FilterDescriptor descriptor) { - validatePatternFilter(descriptor, "PatternIgnoreCase"); - } - - private void validatePatternFilter(FilterDescriptor descriptor, String name) { - check(descriptor.getChildren().length == 2, name + " must have one column reference and one string parameter"); - final FilterDescriptor col = descriptor.getChildren()[0]; - final FilterDescriptor param = descriptor.getChildren()[1]; - - // note that the REFERENCE/LITERAL restrictions could be relaxed - check(col != null, name + " must not be called on a null value"); - check(col.getOperation() == FilterOperation.REFERENCE, name + " can only be called on a column reference"); - onReference(col); - - check(param != null, name + " must not be passed a null parameter"); - check(param.getType() == ValueType.String && param.getOperation() == FilterOperation.LITERAL, - name + " must be given a string literal parameter"); - onLiteral(param); - } - - @Override - public void onSearch(FilterDescriptor descriptor) { - // verify we aren't nested in a NOT - if (stack.size() > 0) { - check(stack.peek().getOperation() != FilterOperation.NOT, "Not(Search) is not supported"); - } - - check(descriptor.getChildren().length >= 1, "Search must have at least one param"); - FilterDescriptor param = descriptor.getChildren()[0]; - - check(param != null, "Search must not be passed a null value"); - check(param.getType() == ValueType.String && param.getOperation() == FilterOperation.LITERAL, - "Search must be given a string literal parameter"); - onLiteral(param); - - Arrays.stream(descriptor.getChildren()).skip(1).forEach(col -> { - check(col != null, "Search column must not be null"); - check(col.getOperation() == FilterOperation.REFERENCE, "Search column must be a column reference"); - onReference(col); - }); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpression.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpression.java deleted file mode 100644 index d64deb642ac..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpression.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -/** - * Enforces that all IN-type expressions have a reference on the left side and only literals on the right side. Any - * non-reference on the left or reference on the right will trigger the entire IN-type expression being replaced with an - * OR or AND, with a sub-IN for each expression on the right side. - * - * - * Examples: o ColumnA in 1, 2, 3 - left as-is o ColumnA in 1, 2, ColumnB - rewritten as (ColumnA in 1 OR ColumnA in 2 - * OR ColumnA in ColumnB) o 1 in 3, 4, 5 - will be rewritten as (3 in 1 OR 4 in 1 OR 5 in 1). This is a silly case, but - * we're not judging. At this step. o 1 in ColumnA, 4, 5 - will be rewritten as (ColumnA in 1 OR 4 in 1 OR 5 in 1) o 1 - * in ColumnA - will be rewritten as ColumnA in 1 o ColumnA in ColumnB - will be rewritten as ColumnB in ColumnA. Note - * that like the second example, this isn't productive on its own, but as a pair with a reference on the right, it will - * be noticed by {@link ConvertInvalidInExpressions}. - * - * It is assumed that some time after this step, related "in" expressions will be merged together, and that these - * one-off expressions will get checked later. - */ -public class FlipNonReferenceMatchExpression extends ReplacingVisitor { - public static FilterDescriptor execute(final FilterDescriptor filter) { - return new FlipNonReferenceMatchExpression().visit(filter); - } - - @Override - public FilterDescriptor onIn(final FilterDescriptor descriptor) { - return handleIn(descriptor, FilterDescriptor.FilterOperation.OR); - } - - @Override - public FilterDescriptor onInIgnoreCase(final FilterDescriptor descriptor) { - return handleIn(descriptor, FilterDescriptor.FilterOperation.OR); - } - - @Override - public FilterDescriptor onNotIn(final FilterDescriptor descriptor) { - return handleIn(descriptor, FilterDescriptor.FilterOperation.AND); - } - - @Override - public FilterDescriptor onNotInIgnoreCase(final FilterDescriptor descriptor) { - return handleIn(descriptor, FilterDescriptor.FilterOperation.AND); - } - - private FilterDescriptor handleIn(final FilterDescriptor descriptor, final FilterDescriptor.FilterOperation op) { - // check each child - if we pass all checks we will give up - boolean rewrite = descriptor.getChildren()[0].getOperation() != FilterDescriptor.FilterOperation.REFERENCE; - for (int i = 1; !rewrite && i < descriptor.getChildren().length; i++) { - if (descriptor.getChildren()[i].getOperation() == FilterDescriptor.FilterOperation.REFERENCE) { - rewrite = true; - } - } - if (!rewrite) { - return descriptor; - } - final int count = descriptor.getChildren().length - 1; - - if (count == 1) { - // make a single node to replace with, just swap the order of the two children - return new FilterDescriptor(descriptor.getOperation(), null, null, - new FilterDescriptor[] {descriptor.getChildren()[1], descriptor.getChildren()[0]}); - } - - // make a AND/OR to join each of the new children with - final FilterDescriptor replacement = new FilterDescriptor(); - replacement.setOperation(op); - replacement.setChildren(new FilterDescriptor[count]); - for (int i = 0; i < count; i++) { - replacement.getChildren()[i] = new FilterDescriptor(descriptor.getOperation(), null, null, - new FilterDescriptor[] {descriptor.getChildren()[i + 1], descriptor.getChildren()[0]}); - } - - return replacement; - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/GetTopLevelFilters.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/GetTopLevelFilters.java deleted file mode 100644 index b714f9ecc1c..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/GetTopLevelFilters.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import io.deephaven.web.shared.data.FilterDescriptor.FilterOperation; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Recursively removes top-level AND operations, if any, resulting in an array of filters to run, potentially only - * containing a single filter if the top-level filter is not an AND. - * - * This can be run before the FilterPrinter to provide multiple strings to execute individually. It should be run after - * other optimizations which might merge operations, and should be run before nested Match operations are rewritten to - * invocations. - */ -public class GetTopLevelFilters { - - public static List get(FilterDescriptor descriptor) { - if (descriptor.getOperation() == FilterOperation.AND) { - return Arrays.asList(descriptor.getChildren()); - } - return Collections.singletonList(descriptor); - } - -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafe.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafe.java deleted file mode 100644 index 613d3d70669..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafe.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import io.deephaven.web.shared.data.FilterDescriptor.FilterOperation; - -/** - * Rewrites logical expressions into an actual version that does what would be expected. Right now this is just - * equalsIgnoreCase and its negation, to support null values. - */ -public class MakeExpressionsNullSafe extends ReplacingVisitor { - public static FilterDescriptor execute(FilterDescriptor descriptor) { - return new MakeExpressionsNullSafe().visit(descriptor); - } - - @Override - public FilterDescriptor onEqualIgnoreCase(FilterDescriptor descriptor) { - return rewriteEqualIgnoreCaseExpression(descriptor); - } - - @Override - public FilterDescriptor onNotEqualIgnoreCase(FilterDescriptor descriptor) { - return rewriteEqualIgnoreCaseExpression(descriptor).not(); - } - - private FilterDescriptor rewriteEqualIgnoreCaseExpression(FilterDescriptor descriptor) { - // rewriting A (is-equal-ignore-case) B - // to A == null ? B == null : A.equalsIgnoreCase(B) - // without the ternary, this is: - // (A == null && B == null) || (A != null && A.equalsIgnoreCase(B)) - FilterDescriptor lhs = descriptor.getChildren()[0]; - FilterDescriptor rhs = descriptor.getChildren()[1]; - - return node( - FilterOperation.OR, - node(FilterOperation.AND, - node(FilterOperation.IS_NULL, lhs), - node(FilterOperation.IS_NULL, rhs)), - node(FilterOperation.AND, - node(FilterOperation.NOT, - node(FilterOperation.IS_NULL, lhs)), - nodeEqIgnoreCase(FilterOperation.INVOKE, lhs, rhs))); - } - - private FilterDescriptor nodeEqIgnoreCase(FilterOperation invoke, FilterDescriptor lhs, FilterDescriptor rhs) { - FilterDescriptor node = node(invoke, lhs, rhs); - node.setValue("equalsIgnoreCase");// note that this would fail validation - return node; - } - - private FilterDescriptor node(FilterOperation op, FilterDescriptor... children) { - FilterDescriptor descriptor = new FilterDescriptor(op, null, null, children); - return descriptor; - } - -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperations.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperations.java deleted file mode 100644 index 26b64ffe019..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperations.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -import java.util.ArrayList; -import java.util.List; - -/** - * Any AND nested within another AND or OR nested within another OR should be flattened into just a single level. - * - * This should be run after NOTs are distributed (so that (A AND B AND !(C OR D)) is first normalized to (A AND B AND - * (!C AND !D))). - */ -public class MergeNestedBinaryOperations extends ReplacingVisitor { - public static FilterDescriptor execute(FilterDescriptor descriptor) { - return new MergeNestedBinaryOperations().visit(descriptor); - } - - @Override - public FilterDescriptor onAnd(FilterDescriptor descriptor) { - ArrayList topLevel = new ArrayList<>(); - handleItem(topLevel, descriptor, FilterDescriptor.FilterOperation.AND); - - if (descriptor.getChildren().length == topLevel.size()) { - // we made no changes, since any nested AND or OR must contain at least two children - return super.onAnd(descriptor); - } - - FilterDescriptor replacement = - new FilterDescriptor(descriptor.getOperation(), null, null, topLevel.toArray(new FilterDescriptor[0])); - - return super.onAnd(replacement); - } - - @Override - public FilterDescriptor onOr(FilterDescriptor descriptor) { - ArrayList topLevel = new ArrayList<>(); - handleItem(topLevel, descriptor, FilterDescriptor.FilterOperation.OR); - - if (descriptor.getChildren().length == topLevel.size()) { - // we made no changes, since any nested AND or OR must contain at least two children - return super.onOr(descriptor); - } - - FilterDescriptor replacement = - new FilterDescriptor(descriptor.getOperation(), null, null, topLevel.toArray(new FilterDescriptor[0])); - - return super.onOr(replacement); - } - - private void handleItem(List topLevel, FilterDescriptor descriptor, - FilterDescriptor.FilterOperation operation) { - if (descriptor.getOperation() == operation) { - for (FilterDescriptor child : descriptor.getChildren()) { - handleItem(topLevel, child, operation); - } - } else { - topLevel.add(descriptor); - } - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressions.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressions.java deleted file mode 100644 index f388285d615..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressions.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * If two or more IN-like expressions are in the same OR (or NOT-INs in the same AND), join them together into a single - * expression. This may change the order of expressions, but should not have side effects - execution order of null - * checks vs invoke for example, should not be affected by this. All IN expressions are moved to the front of the list. - * - * Examples: o A in 1 AND B in 2 - left as is o A not in 1 AND A not in 2 - rewritten as A not in 1, 2 o A == B OR A in - * 1 OR A == C OR A in 2 - rewritten as A in 1, 2 OR A == B OR A == C - * - * This assumes that all nested ORs and ANDs have been flattened already, NOTs normalized, and that we're happy with EQs - * vs INs and their children. - */ -public class MergeRelatedSiblingExpressions extends ReplacingVisitor { - public static FilterDescriptor execute(final FilterDescriptor filter) { - return new MergeRelatedSiblingExpressions().visit(filter); - } - - @Override - public FilterDescriptor onAnd(final FilterDescriptor descriptor) { - FilterDescriptor result = mergeChildren(descriptor, FilterDescriptor.FilterOperation.NOT_IN); - return mergeChildren(result, FilterDescriptor.FilterOperation.NOT_IN_ICASE); - } - - @Override - public FilterDescriptor onOr(final FilterDescriptor descriptor) { - FilterDescriptor result = mergeChildren(descriptor, FilterDescriptor.FilterOperation.IN); - return mergeChildren(result, FilterDescriptor.FilterOperation.IN_ICASE); - } - - private FilterDescriptor mergeChildren(FilterDescriptor descriptor, FilterDescriptor.FilterOperation op) { - // Examine each child and group by reference name and operation, - // and combine those into a single operation - final Map> collected = new LinkedHashMap<>(); - final List leftover = new ArrayList<>(); - for (final FilterDescriptor child : descriptor.getChildren()) { - if (child.getOperation() == op) { - assert child.getChildren()[0].getOperation() == FilterDescriptor.FilterOperation.REFERENCE; - collected.computeIfAbsent(child.getChildren()[0], ignore -> new LinkedHashSet<>()) - .addAll(Arrays.stream(child.getChildren()).skip(1) - .collect(Collectors.toCollection(LinkedHashSet::new))); - } else { - leftover.add(child); - } - } - - int newChildCount = leftover.size() + collected.size(); - - if (newChildCount == descriptor.getChildren().length) { - // no items can be merged, check children and move on - return visitChildren(descriptor); - } - - if (newChildCount == 1) { - assert leftover.isEmpty() - : "Must be empty since collected is non-empty since the new and old child counts differ"; - // only one expression remains from the collection work - - Map.Entry> nameAndValues = collected.entrySet().iterator().next(); - return mergedFilterDescriptor(op, nameAndValues.getKey(), nameAndValues.getValue()); - } - - FilterDescriptor[] replacementChildren = new FilterDescriptor[newChildCount]; - - // produce new IN-type expressions - int i = 0; - for (Map.Entry> nameAndValues : collected.entrySet()) { - replacementChildren[i++] = mergedFilterDescriptor(op, nameAndValues.getKey(), nameAndValues.getValue()); - } - - // copy in the remaining leftovers - for (i = collected.size(); i < newChildCount; i++) { - // check if this leftover itself can be merged, then append it - replacementChildren[i] = visit(leftover.get(i - collected.size())); - } - - return new FilterDescriptor(descriptor.getOperation(), null, null, replacementChildren); - } - - private FilterDescriptor mergedFilterDescriptor(FilterDescriptor.FilterOperation op, FilterDescriptor column, - Set values) { - return new FilterDescriptor(op, null, null, Stream.concat( - Stream.of(column), - values.stream()).toArray(FilterDescriptor[]::new)); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/NormalizeNots.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/NormalizeNots.java deleted file mode 100644 index 5024eaaf0ce..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/NormalizeNots.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -/** - * Rewrites NOT expressions, with the goal of removing as many as possible and simplifying the expression tree. This - * visitor delegates its work to {@link FilterDescriptor#not()}, which uses the following rules: - *
    - *
  • Distribute NOTs to children of AND/OR expressions, via DeMorgan's law.
  • - *
  • {@code NOT(NOT(A))} is replaced with A.
  • - *
  • Replace any operation with its opposite, if any. For example, {@code NOT(A >= B)} is replaced with {@code A < B}, - * and likewise for all the other inequality operators, {@code EQ}, and {@code IN}.
  • - *
  • Other operations {@code IS_NULL}, {@code INVOKE}, {@code SEARCH}, {@code CONTAINS} are left as-is, wrapped - * wrapped with a {@code NOT}.
  • - *
- */ -public class NormalizeNots extends ReplacingVisitor { - public static FilterDescriptor execute(FilterDescriptor descriptor) { - return new NormalizeNots().visit(descriptor); - } - - @Override - public FilterDescriptor onNot(FilterDescriptor descriptor) { - // First deal with this not, then visit its children. This way when we remove the current node, we have - // the change to remove children too, instead of rewriting other nodes twice. - return visitChildren(descriptor.getChildren()[0].not()); - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ReplacingVisitor.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ReplacingVisitor.java deleted file mode 100644 index 62935cabbc8..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/ast/ReplacingVisitor.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -public abstract class ReplacingVisitor { - - public FilterDescriptor onAnd(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onOr(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onNot(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onLessThan(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onGreaterThan(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onLessThanOrEqualTo(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onGreaterThanOrEqualTo(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onEqual(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onEqualIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onNotEqual(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onNotEqualIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onIn(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onInIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onNotIn(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onNotInIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onIsNull(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onInvoke(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onLiteral(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onReference(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onContains(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onContainsIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onPattern(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onPatternIgnoreCase(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - public FilterDescriptor onSearch(FilterDescriptor descriptor) { - return visitChildren(descriptor); - } - - protected FilterDescriptor visit(FilterDescriptor descriptor) { - switch (descriptor.getOperation()) { - case AND: - return onAnd(descriptor); - case OR: - return onOr(descriptor); - case NOT: - return onNot(descriptor); - case LT: - return onLessThan(descriptor); - case GT: - return onGreaterThan(descriptor); - case LTE: - return onLessThanOrEqualTo(descriptor); - case GTE: - return onGreaterThanOrEqualTo(descriptor); - case EQ: - return onEqual(descriptor); - case EQ_ICASE: - return onEqualIgnoreCase(descriptor); - case NEQ: - return onNotEqual(descriptor); - case NEQ_ICASE: - return onNotEqualIgnoreCase(descriptor); - case IN: - return onIn(descriptor); - case IN_ICASE: - return onInIgnoreCase(descriptor); - case NOT_IN: - return onNotIn(descriptor); - case NOT_IN_ICASE: - return onNotInIgnoreCase(descriptor); - case IS_NULL: - return onIsNull(descriptor); - case INVOKE: - return onInvoke(descriptor); - case LITERAL: - return onLiteral(descriptor); - case REFERENCE: - return onReference(descriptor); - case CONTAINS: - return onContains(descriptor); - case CONTAINS_ICASE: - return onContainsIgnoreCase(descriptor); - case MATCHES: - return onPattern(descriptor); - case MATCHES_ICASE: - return onPatternIgnoreCase(descriptor); - case SEARCH: - return onSearch(descriptor); - } - throw new IllegalStateException("Unknown operation " + descriptor.getOperation()); - } - - protected FilterDescriptor visitChildren(FilterDescriptor descriptor) { - boolean changed = false; - - FilterDescriptor[] children = new FilterDescriptor[descriptor.getChildren().length]; - for (int i = 0; i < descriptor.getChildren().length; i++) { - if (descriptor.getOperation() == FilterDescriptor.FilterOperation.INVOKE && i == 0) { - if (descriptor.getChildren()[i] == null) { - continue;// first child in an invoke may be null, if so, skip it - } - } - - children[i] = visit(descriptor.getChildren()[i]); - if (children[i] != descriptor.getChildren()[i]) { - changed = true; - } - } - - if (!changed) { - return descriptor; - } - return new FilterDescriptor(descriptor.getOperation(), descriptor.getValue(), descriptor.getType(), children); - } - -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableRequest.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableRequest.java deleted file mode 100644 index 2ed52b7ac9a..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableRequest.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.batch; - -import io.deephaven.web.shared.data.*; - -import java.io.Serializable; -import java.util.Arrays; - -/** - * A place to collect up table operations that can be batched. There are two ways to group operations, a single step can - * perform more than one operation, and multiple steps can be specified. Within a given step, the operations will be run - * in the default order and will only be exported to the client once, but by providing multiple steps any preferred - * order can be achieve, or intermediate tables can be exported to the client. - * - * This object is only meant for serialization; all brains to construct it are in the RequestBatcher class. - */ -public class BatchTableRequest implements Serializable { - - private SerializedTableOps[] ops; - - public static class SerializedTableOps implements Serializable { - - private String[] dropColumns; - private String[] viewColumns; - private HandleMapping handles; - private SortDescriptor[] sorts; - private String[] conditions; - private FilterDescriptor[] filters; - private CustomColumnDescriptor[] customColumns; - private HeadOrTailDescriptor headOrTail; - private boolean isFlat; - @Deprecated // deprecated for core#80, should be deleted in core#187 - private int updateIntervalMs; - - public String[] getDropColumns() { - return dropColumns; - } - - public void setDropColumns(String[] dropColumns) { - this.dropColumns = dropColumns; - } - - public String[] getViewColumns() { - return viewColumns; - } - - public void setViewColumns(String[] viewColumns) { - this.viewColumns = viewColumns; - } - - public SortDescriptor[] getSorts() { - return sorts; - } - - public void setSorts(SortDescriptor[] sorts) { - this.sorts = sorts; - } - - public FilterDescriptor[] getFilters() { - return filters; - } - - public void setFilters(FilterDescriptor[] filters) { - this.filters = filters; - } - - public String[] getConditions() { - return conditions; - } - - public void setConditions(String[] conditions) { - this.conditions = conditions; - } - - public CustomColumnDescriptor[] getCustomColumns() { - return customColumns; - } - - public void setCustomColumns(CustomColumnDescriptor[] customColumns) { - this.customColumns = customColumns; - } - - public HeadOrTailDescriptor getHeadOrTail() { - return headOrTail; - } - - public void setHeadOrTail(HeadOrTailDescriptor headOrTail) { - this.headOrTail = headOrTail; - } - - public HandleMapping getHandles() { - return handles; - } - - public void setHandles(HandleMapping handles) { - this.handles = handles; - } - - public void setFlat(boolean isFlat) { - this.isFlat = isFlat; - } - - @Deprecated - public int getUpdateIntervalMs() { - return updateIntervalMs; - } - - @Deprecated - public void setUpdateIntervalMs(int updateIntervalMs) { - this.updateIntervalMs = updateIntervalMs; - } - - @Override - public String toString() { - return "SerializedTableOps{" + - "handles=" + handles + - ", viewColumns=" + Arrays.toString(viewColumns) + - ", dropColumns=" + Arrays.toString(dropColumns) + - ", headOrTail=" + headOrTail + - ", sorts=" + Arrays.toString(sorts) + - ", filters=" + Arrays.toString(filters) + - ", customColumns=" + Arrays.toString(customColumns) + - ", isFlat=" + isFlat + - ", updateIntervalMs=" + updateIntervalMs + - '}'; - } - - public boolean hasDropColumns() { - return dropColumns != null && dropColumns.length > 0; - } - - public boolean hasViewColumns() { - return viewColumns != null && viewColumns.length > 0; - } - - public boolean hasCustomColumns() { - return customColumns != null && customColumns.length > 0; - } - - public boolean hasHeadOrTail() { - return headOrTail != null; - } - - /** - * @return true any time we expect to need to send a full table definition back to client (columns added or - * removed, etc). - */ - public boolean hasStructuralModification() { - return hasCustomColumns(); - } - - public boolean hasSizeModification() { - return hasFilters(); - } - - public boolean hasSorts() { - return sorts != null && sorts.length > 0; - } - - public boolean hasFilters() { - return filters != null && filters.length > 0; - } - - public boolean hasConditions() { - return conditions != null && conditions.length > 0; - } - - public boolean isFlat() { - // serves as a getter _and_ a has-changes - return isFlat; - } - - public boolean hasUpdateIntervalMs() { - return updateIntervalMs != 0; - } - - public boolean isEmpty() { - return !(hasDropColumns() || hasViewColumns() || hasHeadOrTail() - || hasSorts() || hasFilters() || hasCustomColumns() || isFlat() || hasUpdateIntervalMs()); - } - } - - public SerializedTableOps[] getOps() { - return ops; - } - - public void setOps(SerializedTableOps[] ops) { - this.ops = ops; - } - - @Override - public String toString() { - return "BatchTableRequest{" + - "ops=" + Arrays.toString(ops) + - '}'; - } - - public boolean isEmpty() { - return ops == null || ops.length == 0 || (ops.length == 1 && ops[0].getHandles() == null); - } - -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableResponse.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableResponse.java deleted file mode 100644 index 607bfd5a2e7..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/batch/BatchTableResponse.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.batch; - -import io.deephaven.web.shared.data.TableHandle; -import io.deephaven.web.shared.fu.JsFunction; - -import java.io.Serializable; -import java.util.Arrays; - -/** - * A response object for batch requests; only contains failure messages, since successful results will be pushed - * directly the client as they come in (rather than waiting until entire batch is complete). - * - * Seems like we could do {@code Callback} instead... - */ -public class BatchTableResponse implements Serializable { - // not using a constant TableHandle[0], as arrays are fully mutable in JS - private TableHandle[] success = new TableHandle[0]; - - private TableHandle[] failedTableHandles; - private String[] failureMessages; - - public TableHandle[] getSuccess() { - return success; - } - - public void setSuccess(TableHandle[] success) { - this.success = success; - } - - public TableHandle[] getFailedTableHandles() { - return failedTableHandles; - } - - public void setFailedTableHandles(TableHandle[] failedTableHandles) { - this.failedTableHandles = failedTableHandles; - } - - public String[] getFailureMessages() { - return failureMessages; - } - - public void setFailureMessages(String[] failureMessages) { - this.failureMessages = failureMessages; - } - - @Override - public String toString() { - return "BatchTableResponse{" + - "success=" + Arrays.toString(success) + - ", failedTableHandles=" + Arrays.toString(failedTableHandles) + - ", failureMessages=" + Arrays.toString(failureMessages) + - '}'; - } - - public boolean hasFailures(TableHandle handle) { - return hasFailures(handle::equals); - } - - public boolean hasFailures(JsFunction table) { - for (TableHandle handle : failedTableHandles) { - if (table.apply(handle)) { - return true; - } - } - return false; - - } - - public String getFailure(TableHandle handle) { - for (int i = 0; i < failedTableHandles.length; i++) { - if (handle.equals(failedTableHandles[i])) { - return failureMessages[i]; - } - } - return null; - } - - public void addSuccess(TableHandle newId) { - assert Arrays.stream(success).noneMatch(newId::equals); - // this is terrible and all, but we want to avoid all java collections in DTOs. - // we can have a response builder w/ a proper collection ...later. - success = Arrays.copyOf(success, success.length + 1); - - success[success.length - 1] = newId; - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/ColumnHolder.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/ColumnHolder.java deleted file mode 100644 index ff65f1e52bc..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/ColumnHolder.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.data; - -import io.deephaven.web.shared.data.columns.ColumnData; - -import java.io.Serializable; - -public class ColumnHolder implements Serializable { - private String name; - private String type; - private ColumnData columnData; - - public ColumnHolder() {} - - public ColumnHolder(String name, String type, ColumnData columnData) { - this.name = name; - this.type = type; - this.columnData = columnData; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ColumnData getColumnData() { - return columnData; - } - - public void setColumnData(ColumnData columnData) { - this.columnData = columnData; - } - - @Override - public String toString() { - return "ColumnHolder{" + - "name='" + name + '\'' + - ", type='" + type + '\'' + - ", columnData=" + columnData + - '}'; - } -} diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/util/ParseUtils.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/util/ParseUtils.java deleted file mode 100644 index f72d46fc306..00000000000 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/util/ParseUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.util; - -public class ParseUtils { - /** - * This method exists because Java's Boolean.parseBoolean is too permissive (that method maps "true" to true, any - * other string to false). - * - * @return - *
    - *
  • "true" -> true
  • - *
  • "false" -> false
  • - *
  • any other string -> exception
  • - *
  • null -> exception
  • - *
- */ - public static boolean parseBoolean(String text) { - if ("true".equalsIgnoreCase(text)) { - return true; - } - if ("false".equalsIgnoreCase(text)) { - return false; - } - throw new IllegalArgumentException("Can't parse as boolean: " + text); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/AbstractReplacingVisitorTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/AbstractReplacingVisitorTest.java deleted file mode 100644 index 47f800df77c..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/AbstractReplacingVisitorTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -public abstract class AbstractReplacingVisitorTest { - protected void assertUnchanged(String message, FilterDescriptor input) { - assertEquals(message, input, execute(input)); - } - - protected void assertFilterEquals(String message, FilterDescriptor input, FilterDescriptor output) { - - FilterDescriptor actual = execute(input); - if (!output.equals(actual)) { - fail(message + " expected: " + print(output) + " but was: " + print(actual)); - } - assertEquals(message, output, actual); - } - - private static String print(FilterDescriptor f) { - FilterPrinter p = new FilterPrinter(str -> "\"" + str + "\"");// not correct, but good enough for logging - // failures - return p.print(f); - } - - protected abstract FilterDescriptor execute(FilterDescriptor f); -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertEqToInTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertEqToInTest.java deleted file mode 100644 index 2c1b616cae3..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertEqToInTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class ConvertEqToInTest extends AbstractReplacingVisitorTest { - - @Test - public void testConvertEqToIn() { - assertFilterEquals("simple EQ", - eq("ColumnA", 1), - in("ColumnA", 1)); - - assertFilterEquals("reverse EQ", - node(FilterDescriptor.FilterOperation.EQ, literal((double) 1), reference("ColumnA")), - in("ColumnA", 1)); - - assertUnchanged("two literals", - node(FilterDescriptor.FilterOperation.EQ, literals(1, 2))); - - assertUnchanged("two references", - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB"))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return ConvertEqToIn.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressionsTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressionsTest.java deleted file mode 100644 index ceeb157bbc6..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/ConvertInvalidInExpressionsTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class ConvertInvalidInExpressionsTest extends AbstractReplacingVisitorTest { - - @Test - public void testConvertInvalidInExpressions() { - assertUnchanged("already correct", - in("ColumnA", 1)); - assertUnchanged("already correct", - in("ColumnA", 1, 2)); - - assertFilterEquals("literals on both sides", - node(FilterDescriptor.FilterOperation.IN, literals(1, 2)), - node(FilterDescriptor.FilterOperation.EQ, literals(1, 2))); - assertFilterEquals("references on both sides", - node(FilterDescriptor.FilterOperation.IN, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB"))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return ConvertInvalidInExpressions.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FilterTestUtils.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FilterTestUtils.java deleted file mode 100644 index 6c2ad42d4b0..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FilterTestUtils.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; - -import java.util.Arrays; -import java.util.stream.DoubleStream; -import java.util.stream.IntStream; -import java.util.stream.Stream; - -public class FilterTestUtils { - public static FilterDescriptor and(FilterDescriptor... filterDescriptors) { - return node(FilterDescriptor.FilterOperation.AND, filterDescriptors); - } - - public static FilterDescriptor or(FilterDescriptor... filterDescriptors) { - return node(FilterDescriptor.FilterOperation.OR, filterDescriptors); - } - - public static FilterDescriptor not(FilterDescriptor filterDescriptor) { - return node(FilterDescriptor.FilterOperation.NOT, filterDescriptor); - } - - // public static FilterDescriptor eq(String columnName, String value) { - // return node(FilterDescriptor.FilterOperation.EQ, reference(columnName), literal(value)); - // } - // public static FilterDescriptor notEq(String columnName, String value) { - // return node(FilterDescriptor.FilterOperation.NEQ, reference(columnName), literal(value)); - // } - // public static FilterDescriptor in(String columnName, String... values) { - // return node(FilterDescriptor.FilterOperation.NOT_IN, concat(reference(columnName), literals(values))); - // } - // public static FilterDescriptor notIn(String columnName, String... values) { - // return node(FilterDescriptor.FilterOperation.IN, concat(reference(columnName), literals(values))); - // } - - public static FilterDescriptor reference(String columnName) { - FilterDescriptor reference = new FilterDescriptor(); - reference.setValue(columnName); - reference.setOperation(FilterDescriptor.FilterOperation.REFERENCE); - - return reference; - } - - public static FilterDescriptor literal(String stringValue) { - FilterDescriptor literal = new FilterDescriptor(); - literal.setValue(stringValue); - literal.setType(FilterDescriptor.ValueType.String); - literal.setOperation(FilterDescriptor.FilterOperation.LITERAL); - return literal; - } - - public static FilterDescriptor[] literals(String... stringValues) { - return Stream.of(stringValues).map(FilterTestUtils::literal).toArray(FilterDescriptor[]::new); - } - - - public static FilterDescriptor eq(String columnName, int value) { - return node(FilterDescriptor.FilterOperation.EQ, reference(columnName), literal((double) value)); - } - - public static FilterDescriptor notEq(String columnName, int value) { - return node(FilterDescriptor.FilterOperation.NEQ, reference(columnName), literal((double) value)); - } - - public static FilterDescriptor in(String columnName, int... values) { - return node(FilterDescriptor.FilterOperation.IN, concat(reference(columnName), literals(values))); - } - - public static FilterDescriptor notIn(String columnName, int... values) { - return node(FilterDescriptor.FilterOperation.NOT_IN, concat(reference(columnName), literals(values))); - } - - public static FilterDescriptor literal(long longValue) { - FilterDescriptor literal = new FilterDescriptor(); - literal.setValue(String.valueOf(longValue)); - literal.setType(FilterDescriptor.ValueType.Long); - literal.setOperation(FilterDescriptor.FilterOperation.LITERAL); - return literal; - } - - public static FilterDescriptor literal(int intValue) { - return literal((double) intValue); - } - - public static FilterDescriptor literal(double doubleValue) { - return numericLiteral(String.valueOf(doubleValue)); - } - - private static FilterDescriptor numericLiteral(String numericAsString) { - FilterDescriptor literal = new FilterDescriptor(); - literal.setValue(numericAsString); - literal.setType(FilterDescriptor.ValueType.Number); - literal.setOperation(FilterDescriptor.FilterOperation.LITERAL); - return literal; - } - - public static FilterDescriptor[] literals(int... intValues) { - return IntStream.of(intValues).mapToObj(i -> literal((double) i)).toArray(FilterDescriptor[]::new); - } - - public static FilterDescriptor[] literals(double... doubleValues) { - return DoubleStream.of(doubleValues).mapToObj(FilterTestUtils::literal).toArray(FilterDescriptor[]::new); - } - - private static FilterDescriptor[] concat(FilterDescriptor first, FilterDescriptor... arr) { - return Stream.concat( - Stream.of(first), - Arrays.stream(arr)).toArray(FilterDescriptor[]::new); - } - - - public static FilterDescriptor invoke(String method, FilterDescriptor... filterDescriptors) { - FilterDescriptor descriptor = node(FilterDescriptor.FilterOperation.INVOKE, filterDescriptors); - descriptor.setValue(method); - - return descriptor; - } - - public static FilterDescriptor node(FilterDescriptor.FilterOperation op, FilterDescriptor... filterDescriptors) { - FilterDescriptor filterDescriptor = new FilterDescriptor(); - filterDescriptor.setOperation(op); - filterDescriptor.setChildren(filterDescriptors); - return filterDescriptor; - } - - -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpressionTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpressionTest.java deleted file mode 100644 index f99e7c9d186..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/FlipNonReferenceMatchExpressionTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class FlipNonReferenceMatchExpressionTest extends AbstractReplacingVisitorTest { - - @Test - public void testFlipNonReferenceMatchExpression() { - assertUnchanged("correct form", - in("ColumnA", 1, 2)); - assertUnchanged("correct form", - in("ColumnA", 1)); - - assertFilterEquals("all literals", - node(FilterDescriptor.FilterOperation.IN, literals(1, 2, 3)), - or( - node(FilterDescriptor.FilterOperation.IN, literals(2, 1)), - node(FilterDescriptor.FilterOperation.IN, literals(3, 1)))); - - assertFilterEquals("reference on right", - node(FilterDescriptor.FilterOperation.IN, literal(1), reference("ColumnA"), literal(4), literal(5)), - or( - in("ColumnA", 1), - node(FilterDescriptor.FilterOperation.IN, literal(4), literal(1)), - node(FilterDescriptor.FilterOperation.IN, literal(5), literal(1)))); - - assertFilterEquals("reference on right, no OR required", - node(FilterDescriptor.FilterOperation.IN, literal(1), reference("ColumnA")), - in("ColumnA", 1)); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return FlipNonReferenceMatchExpression.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafeTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafeTest.java deleted file mode 100644 index 8b07731e311..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MakeExpressionsNullSafeTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class MakeExpressionsNullSafeTest extends AbstractReplacingVisitorTest { - - @Test - public void testMakeExpressionsNullSafe() { - assertUnchanged("doesnt affect EQ", - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), literal("A"))); - - assertFilterEquals("add null checks when implicit invoke is needed", - node(FilterDescriptor.FilterOperation.EQ_ICASE, reference("ColumnA"), reference("ColumnB")), - or( - and( - node(FilterDescriptor.FilterOperation.IS_NULL, reference("ColumnA")), - node(FilterDescriptor.FilterOperation.IS_NULL, reference("ColumnB"))), - and( - not( - node(FilterDescriptor.FilterOperation.IS_NULL, reference("ColumnA"))), - invoke("equalsIgnoreCase", reference("ColumnA"), reference("ColumnB"))))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return MakeExpressionsNullSafe.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperationsTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperationsTest.java deleted file mode 100644 index 447d8d0fe33..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeNestedBinaryOperationsTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class MergeNestedBinaryOperationsTest extends AbstractReplacingVisitorTest { - - @Test - public void testMergeNestedBinaryOperations() { - assertUnchanged("don't merge AND and OR", - and( - or( - eq("ColumnB", 3), - eq("ColumnA", 4)), - eq("ColumnA", 1))); - assertUnchanged("don't merge AND and OR", - or( - and( - eq("ColumnB", 3), - eq("ColumnA", 4)), - eq("ColumnA", 1))); - - assertFilterEquals("merge ANDs", - and( - eq("ColumnA", 3), - and( - eq("ColumnB", 3), - eq("ColumnC", 3))), - and( - eq("ColumnA", 3), - eq("ColumnB", 3), - eq("ColumnC", 3))); - assertFilterEquals("merge ANDs", - and( - and( - eq("ColumnA", 3), - eq("ColumnB", 3)), - eq("ColumnC", 3)), - and( - eq("ColumnA", 3), - eq("ColumnB", 3), - eq("ColumnC", 3))); - assertFilterEquals("merge ORs", - or( - eq("ColumnA", 3), - or( - eq("ColumnB", 3), - eq("ColumnC", 3))), - or( - eq("ColumnA", 3), - eq("ColumnB", 3), - eq("ColumnC", 3))); - assertFilterEquals("merge ANDs", - or( - or( - eq("ColumnA", 3), - eq("ColumnB", 3)), - eq("ColumnC", 3)), - or( - eq("ColumnA", 3), - eq("ColumnB", 3), - eq("ColumnC", 3))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return MergeNestedBinaryOperations.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressionsTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressionsTest.java deleted file mode 100644 index 0d089fa8eef..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/MergeRelatedSiblingExpressionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - - -public class MergeRelatedSiblingExpressionsTest extends AbstractReplacingVisitorTest { - - @Test - public void testMergeRelatedSiblings() { - assertUnchanged("plain IN", - in("ColumnA", 1, 2)); - assertUnchanged("IN within AND", - and( - in("ColumnA", 1), - in("ColumnA", 2))); - - assertUnchanged("can't merge these siblings", - or( - in("ColumnA", 1), - eq("ColumnB", 2))); - assertUnchanged("unrelated INs", - or( - in("ColumnA", 1), - in("ColumnB", 2, 3, 4))); - - assertFilterEquals("merge NOT IN within AND, remove parent", - and( - notIn("ColumnA", 1), - notIn("ColumnA", 2)), - notIn("ColumnA", 1, 2)); - - assertFilterEquals("merge only INs in OR", - or( - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB")), - in("ColumnA", 1), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnC")), - in("ColumnA", 2)), - or( - in("ColumnA", 1, 2), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnC")))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return MergeRelatedSiblingExpressions.execute(f); - } -} diff --git a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/NormalizeNotsTest.java b/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/NormalizeNotsTest.java deleted file mode 100644 index 6b0c35238e7..00000000000 --- a/web/shared-beans/src/test/java/io/deephaven/web/shared/ast/NormalizeNotsTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.web.shared.ast; - -import io.deephaven.web.shared.data.FilterDescriptor; -import org.junit.Assert; -import org.junit.Test; - -import static io.deephaven.web.shared.ast.FilterTestUtils.*; - -public class NormalizeNotsTest extends AbstractReplacingVisitorTest { - - @Test - public void testNormalizeNots() { - // this test effectively tests FilterDescriptor.not(), but also that the visitor - // correctly calls it on the tree - assertFilterEquals("two nots around a simple expression", - not(not(invoke("foo", reference("ColumnA")))), - invoke("foo", reference("ColumnA"))); - assertFilterEquals("two nots around a simple expression", - not(not(eq("foo", 1))), - eq("foo", 1)); - - assertFilterEquals("two nots within a tree", - not(and( - not(or( - invoke("methodA", reference("ColumnA")), // invoke used since it can't be rewritten to - // handle a NOT - invoke("methodB", reference("ColumnA")))), - or( - invoke("methodC", reference("ColumnA")), - invoke("methodD", reference("ColumnA"))))), - or( - or( - invoke("methodA", reference("ColumnA")), - invoke("methodB", reference("ColumnA"))), - and( - not(invoke("methodC", reference("ColumnA"))), - not(invoke("methodD", reference("ColumnA")))))); - - assertUnchanged("other non-flippble expression", - or( - not(node(FilterDescriptor.FilterOperation.CONTAINS, reference("ColumnA"), literal("asdf"))), - not(node(FilterDescriptor.FilterOperation.IS_NULL, reference("ColumnA"))))); - - try { - execute( - not(node(FilterDescriptor.FilterOperation.SEARCH, literal("asdf")))); - Assert.fail("Expected exception"); - } catch (IllegalStateException expected) { - Assert.assertEquals("Cannot not() a search", expected.getMessage()); - } - - assertFilterEquals("flip various leaf expressions", - not(or( - node(FilterDescriptor.FilterOperation.LT, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.GT, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.LTE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.GTE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NEQ, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NEQ_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.IN, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.IN_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NOT_IN, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NOT_IN_ICASE, reference("ColumnA"), - reference("ColumnB")))), - and( - node(FilterDescriptor.FilterOperation.GTE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.LTE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.GT, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.LT, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NEQ, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NEQ_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.EQ_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NOT_IN, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.NOT_IN_ICASE, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.IN, reference("ColumnA"), reference("ColumnB")), - node(FilterDescriptor.FilterOperation.IN_ICASE, reference("ColumnA"), reference("ColumnB")))); - } - - @Override - protected FilterDescriptor execute(FilterDescriptor f) { - return NormalizeNots.execute(f); - } -} From 5239c39c205d39fcea848ce2a236e86b0828a536 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 26 Jul 2022 14:10:33 -0700 Subject: [PATCH 036/215] Use better Dockerfile layer ordering to maximize cacheability (#2683) --- go/build.gradle | 7 ++++--- py/client/build.gradle | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go/build.gradle b/go/build.gradle index c828e208456..0ed326dd7a0 100644 --- a/go/build.gradle +++ b/go/build.gradle @@ -62,15 +62,16 @@ def testGoClient = Docker.registerDockerTask(project, 'testGoClient') { } dockerfile { from('deephaven/go:local-build') - environmentVariable 'DH_HOST', deephavenDocker.containerName.get() - environmentVariable 'DH_PORT', '8080' - copyFile('.', '/project') workingDir('/project') + copyFile('go.*', '/project/') runCommand('''set -eux; \\ mkdir /out; \\ go mod download; \\ go install github.com/jstemmer/go-junit-report/v2@latest ''') + copyFile('.', '/project/') + environmentVariable 'DH_HOST', deephavenDocker.containerName.get() + environmentVariable 'DH_PORT', '8080' } containerDependencies.dependsOn = [deephavenDocker.healthyTask] containerDependencies.finalizedBy = deephavenDocker.endTask diff --git a/py/client/build.gradle b/py/client/build.gradle index 82efd7d77df..d5797cb19af 100644 --- a/py/client/build.gradle +++ b/py/client/build.gradle @@ -95,11 +95,10 @@ tasks.getByName('check').dependsOn(Docker.registerDockerTask(project, 'testPyCli runCommand '''set -eux; \\ pip3 install unittest-xml-reporting==3.0.4 pyarrow==7.0.0 protobuf==3.20.1 grpcio==1.46.0 bitstring==3.1.9 pandas==1.2.5 timeout-decorator==0.5.0;\\ mkdir -p /out/report''' - environmentVariable 'DH_HOST', deephavenDocker.containerName.get() - environmentVariable 'DH_PORT', '8080' - copyFile('project', '/project') workingDir('/project') + environmentVariable 'DH_HOST', deephavenDocker.containerName.get() + environmentVariable 'DH_PORT', '8080' } parentContainers = [ Docker.registryTask(project, 'python') ] entrypoint = ['python', '-m', 'xmlrunner', 'discover', 'tests', '-v', '-o', '/out/report'] From dcf20138bc0e1713f1d9ee411688b9d9e283e1a0 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 26 Jul 2022 14:29:56 -0700 Subject: [PATCH 037/215] Bump protoc-base image, which now includes go proto binaries (#2688) --- docker/registry/protoc-base/gradle.properties | 2 +- proto/proto-backplane-grpc/Dockerfile | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 50127784010..702c190d0a2 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:820ca8317611a0305976dda2501c4173bf6ad55faaef227323511a0ed91c820b +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:5415765f441539c5b965f4cff2af26dda6d9613d06864bce05810845e2e64840 diff --git a/proto/proto-backplane-grpc/Dockerfile b/proto/proto-backplane-grpc/Dockerfile index bbb11b6917c..18d30a53064 100644 --- a/proto/proto-backplane-grpc/Dockerfile +++ b/proto/proto-backplane-grpc/Dockerfile @@ -1,13 +1,5 @@ -FROM deephaven/go:local-build as go-build - -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 -RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 - FROM deephaven/protoc-base:local-build -COPY --from=go-build /go/bin/protoc-gen-go-grpc /opt/protoc-gen-go-grpc -COPY --from=go-build /go/bin/protoc-gen-go /opt/protoc-gen-go - COPY src/main/proto /includes COPY dependencies /dependencies From e4c46d7c58ec50780e3af308488af8b175f41c54 Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Wed, 27 Jul 2022 12:39:19 -0700 Subject: [PATCH 038/215] Implemented Open Addressing hashing in `UpdateBy` operations (#2638) * improved performance by 10-25% for bucketed `updateBy` by implementing open addressed linear probing hashing algorithm --- engine/table/build.gradle | 1 + .../engine/table/impl/BucketedUpdateBy.java | 48 +- .../deephaven/engine/table/impl/UpdateBy.java | 4 + ...rementalAsOfJoinStateManagerTypedBase.java | 2 +- .../StaticAsOfJoinStateManagerTypedBase.java | 2 +- .../impl/by/typed/TypedHasherFactory.java | 41 + ...entalNaturalJoinStateManagerTypedBase.java | 2 +- ...taticNaturalJoinStateManagerTypedBase.java | 2 +- .../hashing/AddOnlyUpdateByStateManager.java | 1294 -------------- .../IncrementalUpdateByStateManager.java | 1580 ----------------- .../hashing/TypedUpdateByFactory.java | 50 + ...Manager.java => UpdateByStateManager.java} | 32 +- .../UpdateByStateManagerTypedBase.java | 353 ++++ .../typed/open/gen/TypedHashDispatcher.java | 143 ++ .../typed/open/gen/UpdateByHasherByte.java | 223 +++ .../open/gen/UpdateByHasherByteByte.java | 245 +++ .../open/gen/UpdateByHasherByteChar.java | 249 +++ .../open/gen/UpdateByHasherByteDouble.java | 249 +++ .../open/gen/UpdateByHasherByteFloat.java | 249 +++ .../typed/open/gen/UpdateByHasherByteInt.java | 249 +++ .../open/gen/UpdateByHasherByteLong.java | 248 +++ .../open/gen/UpdateByHasherByteObject.java | 251 +++ .../open/gen/UpdateByHasherByteShort.java | 249 +++ .../typed/open/gen/UpdateByHasherChar.java | 223 +++ .../open/gen/UpdateByHasherCharByte.java | 249 +++ .../open/gen/UpdateByHasherCharChar.java | 245 +++ .../open/gen/UpdateByHasherCharDouble.java | 249 +++ .../open/gen/UpdateByHasherCharFloat.java | 249 +++ .../typed/open/gen/UpdateByHasherCharInt.java | 249 +++ .../open/gen/UpdateByHasherCharLong.java | 248 +++ .../open/gen/UpdateByHasherCharObject.java | 251 +++ .../open/gen/UpdateByHasherCharShort.java | 249 +++ .../typed/open/gen/UpdateByHasherDouble.java | 223 +++ .../open/gen/UpdateByHasherDoubleByte.java | 249 +++ .../open/gen/UpdateByHasherDoubleChar.java | 249 +++ .../open/gen/UpdateByHasherDoubleDouble.java | 245 +++ .../open/gen/UpdateByHasherDoubleFloat.java | 249 +++ .../open/gen/UpdateByHasherDoubleInt.java | 249 +++ .../open/gen/UpdateByHasherDoubleLong.java | 248 +++ .../open/gen/UpdateByHasherDoubleObject.java | 251 +++ .../open/gen/UpdateByHasherDoubleShort.java | 249 +++ .../typed/open/gen/UpdateByHasherFloat.java | 223 +++ .../open/gen/UpdateByHasherFloatByte.java | 249 +++ .../open/gen/UpdateByHasherFloatChar.java | 249 +++ .../open/gen/UpdateByHasherFloatDouble.java | 249 +++ .../open/gen/UpdateByHasherFloatFloat.java | 245 +++ .../open/gen/UpdateByHasherFloatInt.java | 249 +++ .../open/gen/UpdateByHasherFloatLong.java | 248 +++ .../open/gen/UpdateByHasherFloatObject.java | 251 +++ .../open/gen/UpdateByHasherFloatShort.java | 249 +++ .../typed/open/gen/UpdateByHasherInt.java | 222 +++ .../typed/open/gen/UpdateByHasherIntByte.java | 249 +++ .../typed/open/gen/UpdateByHasherIntChar.java | 249 +++ .../open/gen/UpdateByHasherIntDouble.java | 249 +++ .../open/gen/UpdateByHasherIntFloat.java | 249 +++ .../typed/open/gen/UpdateByHasherIntInt.java | 245 +++ .../typed/open/gen/UpdateByHasherIntLong.java | 248 +++ .../open/gen/UpdateByHasherIntObject.java | 251 +++ .../open/gen/UpdateByHasherIntShort.java | 249 +++ .../typed/open/gen/UpdateByHasherLong.java | 222 +++ .../open/gen/UpdateByHasherLongByte.java | 248 +++ .../open/gen/UpdateByHasherLongChar.java | 248 +++ .../open/gen/UpdateByHasherLongDouble.java | 248 +++ .../open/gen/UpdateByHasherLongFloat.java | 248 +++ .../typed/open/gen/UpdateByHasherLongInt.java | 248 +++ .../open/gen/UpdateByHasherLongLong.java | 244 +++ .../open/gen/UpdateByHasherLongObject.java | 250 +++ .../open/gen/UpdateByHasherLongShort.java | 248 +++ .../typed/open/gen/UpdateByHasherObject.java | 225 +++ .../open/gen/UpdateByHasherObjectByte.java | 251 +++ .../open/gen/UpdateByHasherObjectChar.java | 251 +++ .../open/gen/UpdateByHasherObjectDouble.java | 251 +++ .../open/gen/UpdateByHasherObjectFloat.java | 251 +++ .../open/gen/UpdateByHasherObjectInt.java | 251 +++ .../open/gen/UpdateByHasherObjectLong.java | 250 +++ .../open/gen/UpdateByHasherObjectObject.java | 248 +++ .../open/gen/UpdateByHasherObjectShort.java | 251 +++ .../typed/open/gen/UpdateByHasherShort.java | 223 +++ .../open/gen/UpdateByHasherShortByte.java | 249 +++ .../open/gen/UpdateByHasherShortChar.java | 249 +++ .../open/gen/UpdateByHasherShortDouble.java | 249 +++ .../open/gen/UpdateByHasherShortFloat.java | 249 +++ .../open/gen/UpdateByHasherShortInt.java | 249 +++ .../open/gen/UpdateByHasherShortLong.java | 248 +++ .../open/gen/UpdateByHasherShortObject.java | 251 +++ .../open/gen/UpdateByHasherShortShort.java | 245 +++ .../replicators/ReplicateTypedHashers.java | 2 + 87 files changed, 18352 insertions(+), 2908 deletions(-) delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/AddOnlyUpdateByStateManager.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/IncrementalUpdateByStateManager.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/TypedUpdateByFactory.java rename engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/{ChunkedUpdateByStateManager.java => UpdateByStateManager.java} (53%) create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManagerTypedBase.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/TypedHashDispatcher.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShort.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortByte.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortChar.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortDouble.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortFloat.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortInt.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortLong.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortObject.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortShort.java diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 4f70b996b8e..28fd90e22fa 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -97,6 +97,7 @@ spotless { '**/naturaljoin/typed/rightincopen/gen/*.java', '**/asofjoin/typed/rightincopen/gen/*.java', '**/asofjoin/typed/staticopen/gen/*.java', + '**/updateby/hashing/typed/open/gen/*.java', 'src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java', 'src/main/java/io/deephaven/libs/GroovyStaticImports.java', 'src/test/java/**/*Sample.java' diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java index 8c1fc20611f..1bd6653c2a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketedUpdateBy.java @@ -9,12 +9,14 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.sized.SizedIntChunk; import io.deephaven.chunk.sized.SizedLongChunk; +import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.by.ChunkedOperatorAggregationHelper; import io.deephaven.engine.table.impl.by.HashedRunFinder; +import io.deephaven.engine.table.impl.by.typed.TypedHasherFactory; import io.deephaven.engine.table.impl.sort.permute.LongPermuteKernel; import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; import io.deephaven.engine.table.impl.updateby.hashing.*; @@ -38,7 +40,7 @@ public class BucketedUpdateBy extends UpdateBy { private final ColumnSource[] keySources; /** The hash table object to store key tuples -> bucket positions */ - private ChunkedUpdateByStateManager hashTable; + private UpdateByStateManager hashTable; /** A tracker object to manage indices and updates on a per-bucket basis */ private final UpdateBySlotTracker slotTracker; @@ -106,10 +108,10 @@ private class BucketedContext implements SafeCloseable { /** The context to use when finding runs of values in buckets within a chunk of data */ final SizedSafeCloseable findCtx; - /** The {@link ChunkedUpdateByStateManager hash table} build context */ + /** The {@link UpdateByStateManager hash table} build context */ final SafeCloseable bc; - /** The {@link ChunkedUpdateByStateManager hash table} probe context */ + /** The {@link UpdateByStateManager hash table} probe context */ SafeCloseable pc; /** The index of keys that need to be revisited during the reprocess phase. */ @@ -231,8 +233,8 @@ public void close() { /** * Get (and potentially create) the probe context object for use with - * {@link ChunkedUpdateByStateManager#remove(SafeCloseable, RowSequence, ColumnSource[], WritableIntChunk)} and - * {@link ChunkedUpdateByStateManager#findModifications(SafeCloseable, RowSequence, ColumnSource[], WritableIntChunk)}. + * {@link UpdateByStateManager#remove(SafeCloseable, RowSequence, ColumnSource[], WritableIntChunk)} and + * {@link UpdateByStateManager#findModifications(SafeCloseable, RowSequence, ColumnSource[], WritableIntChunk)}. * * @return an appropriate probe context. */ @@ -416,7 +418,7 @@ private void processModifiesForChangedKeys(@NotNull final TableUpdate upstream) : modifiedPreShiftOk; hashTable.remove(getProbeContet(), modifiedPreShiftOk, keySources, localOutputPositions); - hashTable.add(bc, modifiedPostShiftOk, keySources, nextOutputPosition, postSlots); + hashTable.add(false, bc, modifiedPostShiftOk, keySources, nextOutputPosition, postSlots); modifiedPreShiftOk.fillRowKeyChunk(preShiftIndicesChunk); final LongChunk postShiftIndices; @@ -479,7 +481,7 @@ private void accumulateAdditions(@NotNull final RowSequence additions) { final WritableLongChunk localKeyIndicesChunk = keyChunk.get(); while (okIt.hasMore()) { final RowSequence chunkOk = okIt.getNextRowSequenceWithLength(chunkSize); - hashTable.add(bc, chunkOk, keySources, nextOutputPosition, localOutputPositions); + hashTable.add(false, bc, chunkOk, keySources, nextOutputPosition, localOutputPositions); final boolean permuteRequired = findRunsAndPermute(chunkOk); for (int runIdx = 0; runIdx < localRunStarts.size(); runIdx++) { @@ -849,7 +851,7 @@ private boolean findRunsAndPermute(@NotNull final RowSequence chunkOk) { * * @param added the keys added. */ - private void doAppendOnlyAdds(@NotNull final RowSet added) { + private void doAppendOnlyAdds(final boolean initialBuild, @NotNull final RowSet added) { initializeFor(added, UpdateType.Add); try (final RowSequence.Iterator okIt = added.getRowSequenceIterator()) { @@ -865,7 +867,7 @@ private void doAppendOnlyAdds(@NotNull final RowSet added) { final RowSequence chunkOk = okIt.getNextRowSequenceWithLength(chunkSize); // add the values to the hash table, and produce a chunk of the positions each added key mapped to - hashTable.add(bc, chunkOk, keySources, nextOutputPosition, localOutputPositions); + hashTable.add(initialBuild, bc, chunkOk, keySources, nextOutputPosition, localOutputPositions); setBucketCapacity(nextOutputPosition.intValue()); // Now, organize that chunk by position so we can hand them off to the operators @@ -1038,12 +1040,13 @@ public static Table compute(@NotNull final String description, @NotNull final Map> resultSources, @Nullable final WritableRowRedirection rowRedirection, @NotNull final ColumnSource[] keySources, + @NotNull final ColumnSource[] originalKeySources, @NotNull final MatchPair[] byColumns, @NotNull final UpdateByControl control) { final QueryTable result = new QueryTable(source.getRowSet(), resultSources); final boolean useGrouping = JoinControl.useGrouping(source, keySources); final BucketedUpdateBy updateBy = - new BucketedUpdateBy(ops, source, keySources, useGrouping, rowRedirection, control); + new BucketedUpdateBy(ops, source, keySources, originalKeySources, useGrouping, rowRedirection, control); updateBy.doInitialAdditions(useGrouping, byColumns); if (source.isRefreshing()) { @@ -1062,28 +1065,25 @@ public static Table compute(@NotNull final String description, private BucketedUpdateBy(@NotNull final UpdateByOperator[] operators, @NotNull final QueryTable source, @NotNull final ColumnSource[] keySources, + @NotNull final ColumnSource[] originalKeySources, final boolean useGrouping, @Nullable final WritableRowRedirection rowRedirection, @NotNull final UpdateByControl control) { super(operators, source, rowRedirection, control); this.keySources = keySources; + final int hashTableSize = control.initialHashTableSizeOrDefault(); + if (source.isRefreshing() && !source.isAddOnly()) { - final int hashTableSize = control.initialHashTableSizeOrDefault(); slotTracker = new UpdateBySlotTracker(control.chunkCapacityOrDefault()); - this.hashTable = new IncrementalUpdateByStateManager(keySources, - hashTableSize, - control.maximumLoadFactorOrDefault(), - control.targetLoadFactorOrDefault()); } else { slotTracker = null; - if (!useGrouping) { - final int hashTableSize = control.initialHashTableSizeOrDefault(); - this.hashTable = new AddOnlyUpdateByStateManager(keySources, - hashTableSize, - control.maximumLoadFactorOrDefault(), - control.targetLoadFactorOrDefault()); - } + } + if (!useGrouping) { + this.hashTable = TypedHasherFactory.make(UpdateByStateManagerTypedBase.class, + keySources, keySources, + hashTableSize, control.maximumLoadFactorOrDefault(), + control.targetLoadFactorOrDefault()); } } @@ -1132,7 +1132,7 @@ private void doInitialAdditions(final boolean useGrouping, @NotNull final MatchP processUpdateForRedirection(initialUpdate); } - ctx.doAppendOnlyAdds(source.getRowSet()); + ctx.doAppendOnlyAdds(true, source.getRowSet()); if (slotTracker != null) { // noinspection resource slotTracker.applyUpdates(RowSetShiftData.EMPTY); @@ -1232,7 +1232,7 @@ public void onUpdate(@NotNull final TableUpdate upstream) { final boolean isAppendOnly = UpdateByOperator.isAppendOnly(upstream, source.getRowSet().lastRowKeyPrev()); if (isAppendOnly) { - ctx.doAppendOnlyAdds(upstream.added()); + ctx.doAppendOnlyAdds(false, upstream.added()); } else { accumulateUpdatesByBucket(upstream, ctx); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java index b0ec513f4bb..d26522cb486 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java @@ -153,12 +153,15 @@ public static Table updateBy(@NotNull final QueryTable source, } descriptionBuilder.append(", pairs={").append(MatchPair.matchString(pairs)).append("})"); + + final List> originalKeySources = new ArrayList<>(pairs.length); final List> keySources = new ArrayList<>(pairs.length); for (final MatchPair byColumn : pairs) { if (!source.hasColumns(byColumn.rightColumn)) { problems.add(byColumn.rightColumn); continue; } + originalKeySources.add(source.getColumnSource(byColumn.rightColumn)); keySources.add(ReinterpretUtils.maybeConvertToPrimitive(source.getColumnSource(byColumn.rightColumn))); } @@ -173,6 +176,7 @@ public static Table updateBy(@NotNull final QueryTable source, resultSources, rowRedirection, keySources.toArray(ColumnSource.ZERO_LENGTH_COLUMN_SOURCE_ARRAY), + originalKeySources.toArray(ColumnSource.ZERO_LENGTH_COLUMN_SOURCE_ARRAY), pairs, control); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java index 61bd454273a..e7912328591 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java @@ -151,7 +151,7 @@ protected RightIncrementalAsOfJoinStateManagerTypedBase(ColumnSource[] tableK // endregion constructor for (int ii = 0; ii < tableKeySources.length; ++ii) { - chunkTypes[ii] = keySourcesForErrorMessages[ii].getChunkType(); + chunkTypes[ii] = tableKeySources[ii].getChunkType(); mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, tableKeySources[ii].getType(), tableKeySources[ii].getComponentType()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java index 5658ebf441a..e5344edd2c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java @@ -72,7 +72,7 @@ protected StaticAsOfJoinStateManagerTypedBase(ColumnSource[] tableKeySources, // endregion constructor for (int ii = 0; ii < tableKeySources.length; ++ii) { - chunkTypes[ii] = keySourcesForErrorMessages[ii].getChunkType(); + chunkTypes[ii] = tableKeySources[ii].getChunkType(); mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, tableKeySources[ii].getType(), tableKeySources[ii].getComponentType()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index 0a2fdd8c504..1b5a2b923fc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -27,6 +27,8 @@ import io.deephaven.engine.table.impl.naturaljoin.TypedNaturalJoinFactory; import io.deephaven.engine.table.impl.sources.*; import io.deephaven.engine.table.impl.sources.immutable.*; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import io.deephaven.engine.table.impl.updateby.hashing.TypedUpdateByFactory; import io.deephaven.util.QueryConstants; import io.deephaven.util.compare.CharComparisons; import org.apache.commons.lang3.mutable.MutableInt; @@ -323,6 +325,35 @@ public static HasherConfig hasherConfigForBase(Class baseClass) { builder.addProbe(new HasherConfig.ProbeSpec("probeRightSide", "rowState", true, TypedAsOfJoinFactory::rightIncrementalProbeDecorateRightFound, null, hashSlots, sequentialBuilders)); + } else if (baseClass.equals(UpdateByStateManagerTypedBase.class)) { + final ClassName rowKeyType = ClassName.get(RowKeys.class); + final ParameterizedTypeName chunkType = + ParameterizedTypeName.get(ClassName.get(WritableIntChunk.class), rowKeyType); + final ParameterSpec outputPositions = ParameterSpec.builder(chunkType, "outputPositions").build(); + final ParameterSpec outputPositionOffset = + ParameterSpec.builder(MutableInt.class, "outputPositionOffset").build(); + + builder.classPrefix("UpdateByHasher").packageGroup("updateby.hashing") + .packageMiddle("open") + .openAddressedAlternate(true) + .stateType(int.class).mainStateName("stateSource") + .overflowOrAlternateStateName("alternateStateSource") + .emptyStateName("EMPTY_RIGHT_VALUE") + .includeOriginalSources(true) + .supportRehash(true) + .addExtraPartialRehashParameter(outputPositions) + .moveMainFull(TypedUpdateByFactory::incrementalMoveMainFull) + .moveMainAlternate(TypedUpdateByFactory::incrementalMoveMainAlternate) + .alwaysMoveMain(true) + .rehashFullSetup(TypedUpdateByFactory::incrementalRehashSetup); + + builder.addBuild(new HasherConfig.BuildSpec("buildHashTable", "rowState", + true, true, TypedUpdateByFactory::incrementalBuildLeftFound, + TypedUpdateByFactory::incrementalBuildLeftInsert, outputPositionOffset, outputPositions)); + + builder.addProbe(new HasherConfig.ProbeSpec("probeHashTable", "rowState", + true, TypedUpdateByFactory::incrementalProbeFound, TypedUpdateByFactory::incrementalProbeMissing, + outputPositions)); } else { throw new UnsupportedOperationException("Unknown class to make: " + baseClass); } @@ -435,6 +466,16 @@ public static T make(HasherConfig hasherConfig, ColumnSource[] tableKe if (pregeneratedHasher != null) { return pregeneratedHasher; } + } else if (hasherConfig.baseClass + .equals(UpdateByStateManagerTypedBase.class)) { + // noinspection unchecked + T pregeneratedHasher = + (T) io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen.TypedHashDispatcher + .dispatch(tableKeySources, originalKeySources, tableSize, maximumLoadFactor, + targetLoadFactor); + if (pregeneratedHasher != null) { + return pregeneratedHasher; + } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java index 87a2a92c8a4..9ee256f8c6c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java @@ -66,7 +66,7 @@ protected RightIncrementalNaturalJoinStateManagerTypedBase(ColumnSource[] tab chunkTypes = new ChunkType[tableKeySources.length]; for (int ii = 0; ii < tableKeySources.length; ++ii) { - chunkTypes[ii] = keySourcesForErrorMessages[ii].getChunkType(); + chunkTypes[ii] = tableKeySources[ii].getChunkType(); mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, tableKeySources[ii].getType(), tableKeySources[ii].getComponentType()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java index c00f4a1671d..72d1e6f68e8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java @@ -62,7 +62,7 @@ protected StaticNaturalJoinStateManagerTypedBase(ColumnSource[] tableKeySourc chunkTypes = new ChunkType[tableKeySources.length]; for (int ii = 0; ii < tableKeySources.length; ++ii) { - chunkTypes[ii] = keySourcesForErrorMessages[ii].getChunkType(); + chunkTypes[ii] = tableKeySources[ii].getChunkType(); mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, tableKeySources[ii].getType(), tableKeySources[ii].getComponentType()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/AddOnlyUpdateByStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/AddOnlyUpdateByStateManager.java deleted file mode 100644 index 501aa38207a..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/AddOnlyUpdateByStateManager.java +++ /dev/null @@ -1,1294 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.updateby.hashing; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QIntChunk\E -import io.deephaven.chunk.util.hashing.IntChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QInt\E -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.util.SafeCloseable; -import io.deephaven.engine.table.impl.by.HashTableColumnSource; -import org.apache.commons.lang3.mutable.MutableInt; -import io.deephaven.engine.table.impl.HashTableAnnotations; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -public -// endregion class visibility -class AddOnlyUpdateByStateManager - // region extensions - implements ChunkedUpdateByStateManager - // endregion extensions -{ - // region constants - public static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = HashTableColumnSource.MINIMUM_OVERFLOW_HASH_SLOT; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_INT\E, @StateValueType@ from \Qint\E - private static final int EMPTY_RIGHT_VALUE = QueryConstants.NULL_INT; - - // mixin getStateValue - // region overflow pivot - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

- * - *

This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

- */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource stateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - // endregion extra variables - - // region constructor visibility - public - // endregion constructor visibility - AddOnlyUpdateByStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , double maximumLoadFactor - , double targetLoadFactor - // endregion constructor arguments - ) { - // region super - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - this.maximumLoadFactor = maximumLoadFactor; - this.targetLoadFactor = targetLoadFactor; - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - // endregion ensureOverflowCapacity - } - - // region build wrappers - - @Override - public void add(final SafeCloseable bc, - RowSequence orderedKeys, - ColumnSource[] sources, - MutableInt nextOutputPosition, - WritableIntChunk outputPositions) { - if (orderedKeys.isEmpty()) { - return; - } - buildTable((BuildContext)bc, orderedKeys, sources, nextOutputPosition, outputPositions); - } - - @Override - public SafeCloseable makeUpdateByBuildContext(ColumnSource[] buildSources, long maxSize) { - return makeBuildContext(buildSources, maxSize); - } - - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E, @WritableStateChunkName@ from \QWritableIntChunk\E - final ResettableWritableIntChunk writeThroughState = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final MutableInt outputPosition - , final WritableIntChunk outputPositions - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - outputPositions.setSize(buildIndex.intSize()); - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final int foundPosition = bc.workingStateEntries.get(ii); - outputPositions.set(ii, foundPosition); - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - final int outputPosForLocation = outputPosition.getAndIncrement(); - stateSource.set(currentHashLocation, outputPosForLocation); - outputPositions.set(firstChunkPositionForHashLocation, outputPosForLocation); - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - final int outputPositionToCopy = outputPositions.get(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - outputPositions.set(chunkPosition, outputPositionToCopy); - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final int position = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, position); - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final int outputPosForLocation = outputPosition.getAndIncrement(); - overflowStateSource.set(allocatedOverflowLocation, outputPosForLocation); - outputPositions.set(chunkPosition, outputPosForLocation); - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - final int outputPositionToCopy = outputPositions.get(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - outputPositions.set(chunkPosition, outputPositionToCopy); - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qint\E - final int stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_RIGHT_VALUE); - // region rehash move values - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QIntChunk\E - final WritableIntChunk stateChunk = WritableIntChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(stateChunk, EMPTY_RIGHT_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E - private void updateWriteThroughState(ResettableWritableIntChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = stateSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - - // region probe wrappers - // endregion probe wrappers - - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/IncrementalUpdateByStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/IncrementalUpdateByStateManager.java deleted file mode 100644 index b3566ba00ea..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/IncrementalUpdateByStateManager.java +++ /dev/null @@ -1,1580 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.updateby.hashing; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QIntChunk\E -import io.deephaven.chunk.util.hashing.IntChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QInt\E -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.engine.table.impl.by.HashTableColumnSource; -import org.apache.commons.lang3.mutable.MutableInt; -import io.deephaven.util.SafeCloseable; -import io.deephaven.engine.table.impl.HashTableAnnotations; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -public -// endregion class visibility -class IncrementalUpdateByStateManager - // region extensions - implements ChunkedUpdateByStateManager - // endregion extensions -{ - // region constants - public static final int CHUNK_SIZE = 4096; - public static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = HashTableColumnSource.MINIMUM_OVERFLOW_HASH_SLOT; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_INT\E, @StateValueType@ from \Qint\E - private static final int EMPTY_RIGHT_VALUE = QueryConstants.NULL_INT; - - // mixin getStateValue - // region overflow pivot - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

- * - *

This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

- */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource stateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - // endregion extra variables - - // region constructor visibility - public - // endregion constructor visibility - IncrementalUpdateByStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , double maximumLoadFactor - , double targetLoadFactor - // endregion constructor arguments - ) { - // region super - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - this.maximumLoadFactor = maximumLoadFactor; - this.targetLoadFactor = targetLoadFactor; - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - // endregion ensureOverflowCapacity - } - - // region build wrappers - - @Override - public void add(final SafeCloseable bc, - RowSequence orderedKeys, - ColumnSource[] sources, - MutableInt nextOutputPosition, - WritableIntChunk outputPositions) { - if (orderedKeys.isEmpty()) { - return; - } - buildTable((BuildContext)bc, orderedKeys, sources, nextOutputPosition, outputPositions); - } - - @Override - public SafeCloseable makeUpdateByBuildContext(ColumnSource[] buildSources, long maxSize) { - return makeBuildContext(buildSources, maxSize); - } - - @Override - public SafeCloseable makeUpdateByProbeContext(ColumnSource[] buildSources, long maxSize) { - return makeProbeContext(buildSources, maxSize); - } - - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final MutableInt outputPosition - , final WritableIntChunk outputPositions - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - outputPositions.setSize(buildIndex.intSize()); - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final int foundPosition = bc.workingStateEntries.get(ii); - outputPositions.set(ii, foundPosition); - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - final int outputPosForLocation = outputPosition.getAndIncrement(); - stateSource.set(currentHashLocation, outputPosForLocation); - outputPositions.set(firstChunkPositionForHashLocation, outputPosForLocation); - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - final int outputPositionToCopy = outputPositions.get(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - outputPositions.set(chunkPosition, outputPositionToCopy); - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final int position = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, position); - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final int outputPosForLocation = outputPosition.getAndIncrement(); - overflowStateSource.set(allocatedOverflowLocation, outputPosForLocation); - outputPositions.set(chunkPosition, outputPosForLocation); - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - final int outputPositionToCopy = outputPositions.get(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - outputPositions.set(chunkPosition, outputPositionToCopy); - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qint\E - final int stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_RIGHT_VALUE); - // region rehash move values - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QIntChunk\E - final WritableIntChunk stateChunk = WritableIntChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(stateChunk, EMPTY_RIGHT_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - // mixin prev - private void getPrevKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getPrevChunk(contexts[ii], rowSequence); - } - } - // endmixin prev - - // region probe wrappers - @Override - public void remove(@NotNull final SafeCloseable pc, - @NotNull final RowSequence indexToRemove, - @NotNull final ColumnSource [] sources, - @NotNull final WritableIntChunk outputPositions) { - if (indexToRemove.isEmpty()) { - outputPositions.setSize(0); - return; - } - decorationProbe((ProbeContext) pc, indexToRemove, sources, true, outputPositions); - } - - @Override - public void findModifications(@NotNull final SafeCloseable pc, - @NotNull final RowSequence modifiedIndex, - @NotNull final ColumnSource [] leftSources, - @NotNull final WritableIntChunk outputPositions) { - if (modifiedIndex.isEmpty()) { - outputPositions.setSize(0); - return; - } - decorationProbe((ProbeContext) pc, modifiedIndex, leftSources, false, outputPositions); - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - // endregion probe context constructor - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // mixin prev - , boolean usePrev - // endmixin prev - // region additional probe arguments - , WritableIntChunk outputPositions - // endregion additional probe arguments - ) { - // region probe start - outputPositions.setSize(probeIndex.intSize()); - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - // mixin prev - if (usePrev) { - getPrevKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - } else { - // endmixin prev - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - // mixin prev - } - // endmixin prev - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - stateSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(pc.workingStateEntries, EMPTY_RIGHT_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final int outputPosition = pc.workingStateEntries.get(ii); - outputPositions.set(ii, outputPosition); - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_RIGHT_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - throw new IllegalStateException("Failed to find main aggregation slot for key " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, ii)); - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - throw new IllegalStateException("Failed to find overflow aggregation slot for key " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, chunkPosition)); - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - final int outputPosition = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, outputPosition); - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/TypedUpdateByFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/TypedUpdateByFactory.java new file mode 100644 index 00000000000..8db4399576e --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/TypedUpdateByFactory.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.table.impl.updateby.hashing; + +import com.squareup.javapoet.CodeBlock; +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.engine.rowset.RowSetFactory; +import io.deephaven.engine.table.impl.by.typed.HasherConfig; +import io.deephaven.engine.table.impl.util.ChunkUtils; + +public class TypedUpdateByFactory { + public static void incrementalBuildLeftFound(HasherConfig hasherConfig, boolean alternate, + CodeBlock.Builder builder) { + builder.addStatement("// map the existing bucket to this chunk position"); + builder.addStatement("outputPositions.set(chunkPosition, rowState)"); + } + + public static void incrementalBuildLeftInsert(HasherConfig hasherConfig, CodeBlock.Builder builder) { + builder.addStatement("// create a new bucket and put it in the hash slot"); + builder.addStatement("final int outputPosForLocation = outputPositionOffset.getAndIncrement()"); + builder.addStatement("stateSource.set(tableLocation, outputPosForLocation)"); + builder.addStatement("// map the new bucket to this chunk position"); + builder.addStatement("outputPositions.set(chunkPosition, outputPosForLocation)"); + } + + public static void incrementalRehashSetup(CodeBlock.Builder builder) {} + + public static void incrementalMoveMainFull(CodeBlock.Builder builder) {} + + public static void incrementalMoveMainAlternate(CodeBlock.Builder builder) {} + + public static void incrementalProbeFound(HasherConfig hasherConfig, boolean alternate, + CodeBlock.Builder builder) { + if (!alternate) { + builder.addStatement("// map the existing bucket to this chunk position"); + builder.addStatement("outputPositions.set(chunkPosition, rowState)"); + } else { + builder.addStatement("// map the existing bucket (from alternate) to this chunk position"); + builder.addStatement("outputPositions.set(chunkPosition, rowState)"); + } + } + + public static void incrementalProbeMissing(CodeBlock.Builder builder) { + builder.addStatement("// throw exception if the bucket isn't found"); + builder.addStatement( + "throw new IllegalStateException(\"Failed to find main aggregation slot for key \" + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition)))"); + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/ChunkedUpdateByStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManager.java similarity index 53% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/ChunkedUpdateByStateManager.java rename to engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManager.java index f69277da829..575c3ad617d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/ChunkedUpdateByStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManager.java @@ -8,33 +8,53 @@ import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; +import java.util.Arrays; +import java.util.Objects; +import java.util.stream.Collectors; + /** * The basis for operators that participate in an updateBy operation. */ -public interface ChunkedUpdateByStateManager { - void add(final SafeCloseable bc, +public abstract class UpdateByStateManager { + + protected final ColumnSource[] keySourcesForErrorMessages; + + protected UpdateByStateManager(ColumnSource[] keySourcesForErrorMessages) { + this.keySourcesForErrorMessages = keySourcesForErrorMessages; + } + + // produce a pretty key for error messages + protected String extractKeyStringFromSourceTable(long leftKey) { + if (keySourcesForErrorMessages.length == 1) { + return Objects.toString(keySourcesForErrorMessages[0].get(leftKey)); + } + return "[" + Arrays.stream(keySourcesForErrorMessages).map(ls -> Objects.toString(ls.get(leftKey))).collect(Collectors.joining(", ")) + "]"; + } + + public abstract void add(final boolean initialBuild, + final SafeCloseable bc, final RowSequence orderedKeys, final ColumnSource[] sources, final MutableInt nextOutputPosition, final WritableIntChunk outputPositions); - default void remove(@NotNull final SafeCloseable pc, + public void remove(@NotNull final SafeCloseable pc, @NotNull final RowSequence indexToRemove, @NotNull final ColumnSource[] sources, @NotNull final WritableIntChunk outputPositions) { throw new UnsupportedOperationException("Remove is not supported"); } - default void findModifications(@NotNull final SafeCloseable pc, + public void findModifications(@NotNull final SafeCloseable pc, @NotNull final RowSequence modifiedIndex, @NotNull final ColumnSource [] keySources, @NotNull final WritableIntChunk outputPositions) { throw new UnsupportedOperationException("Find is not supported"); } - SafeCloseable makeUpdateByBuildContext(ColumnSource[] keySources, long updateSize); + public abstract SafeCloseable makeUpdateByBuildContext(ColumnSource[] keySources, long updateSize); - default SafeCloseable makeUpdateByProbeContext(ColumnSource[] buildSources, long maxSize) { + public SafeCloseable makeUpdateByProbeContext(ColumnSource[] buildSources, long maxSize) { throw new UnsupportedOperationException("Cannot make a probe context."); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManagerTypedBase.java new file mode 100644 index 00000000000..1701084ba1e --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/UpdateByStateManagerTypedBase.java @@ -0,0 +1,353 @@ +package io.deephaven.engine.table.impl.updateby.hashing; + +import io.deephaven.base.verify.Assert; +import io.deephaven.base.verify.Require; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.ChunkType; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.WritableColumnSource; +import io.deephaven.engine.table.impl.by.alternatingcolumnsource.AlternatingColumnSource; +import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.util.TypedHasherUtil; +import io.deephaven.util.QueryConstants; +import io.deephaven.util.SafeCloseable; +import org.apache.commons.lang3.mutable.MutableInt; +import org.jetbrains.annotations.NotNull; + +import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; +import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; + +public abstract class UpdateByStateManagerTypedBase extends UpdateByStateManager { + public static final int CHUNK_SIZE = 4096; + private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size + + public static final int EMPTY_RIGHT_VALUE = QueryConstants.NULL_INT; + + // the number of slots in our table + protected int tableSize; + + // the number of slots in our alternate table, to start with "1" is a lie, but rehashPointer is zero; so our + // location value is positive and can be compared against rehashPointer safely + protected int alternateTableSize = 1; + + // how much of the alternate sources are necessary to rehash? + protected int rehashPointer = 0; + + protected long numEntries = 0; + + // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor + // or if it falls below minimum load factor we will instead contract the table + private final double maximumLoadFactor; + + // the keys for our hash entries + protected final ChunkType[] chunkTypes; + protected WritableColumnSource[] mainKeySources; + protected WritableColumnSource[] alternateKeySources; + + protected ImmutableIntArraySource stateSource = new ImmutableIntArraySource(); + protected ImmutableIntArraySource alternateStateSource = new ImmutableIntArraySource(); + + // the mask for insertion into the main table (this is used so that we can identify whether a slot belongs to the + // main or alternate table) + protected int mainInsertMask = 0; + protected int alternateInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + + protected UpdateByStateManagerTypedBase(ColumnSource[] tableKeySources, + ColumnSource[] keySourcesForErrorMessages, int tableSize, double maximumLoadFactor) { + + super(keySourcesForErrorMessages); + + this.tableSize = tableSize; + Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); + Require.gtZero(tableSize, "tableSize"); + Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); + Require.inRange(maximumLoadFactor, 0.0, 0.95, "maximumLoadFactor"); + + mainKeySources = new WritableColumnSource[tableKeySources.length]; + alternateKeySources = new WritableColumnSource[tableKeySources.length]; + chunkTypes = new ChunkType[tableKeySources.length]; + + for (int ii = 0; ii < tableKeySources.length; ++ii) { + chunkTypes[ii] = tableKeySources[ii].getChunkType(); + mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, + tableKeySources[ii].getType(), tableKeySources[ii].getComponentType()); + } + + this.maximumLoadFactor = maximumLoadFactor; + + ensureCapacity(tableSize); + } + + private void ensureCapacity(int tableSize) { + for (WritableColumnSource mainKeySource : mainKeySources) { + mainKeySource.ensureCapacity(tableSize); + } + stateSource.ensureCapacity(tableSize); + } + + private class UpdateByBuildHandler implements TypedHasherUtil.BuildHandler { + final MutableInt nextOutputPosition; + final WritableIntChunk outputPositions; + + private UpdateByBuildHandler(MutableInt nextOutputPosition, WritableIntChunk outputPositions) { + this.nextOutputPosition = nextOutputPosition; + this.outputPositions = outputPositions; + } + + @Override + public void doBuild(RowSequence chunkOk, Chunk[] sourceKeyChunks) { + buildHashTable(chunkOk, sourceKeyChunks, nextOutputPosition, outputPositions); + } + } + + private class UpdateByProbeHandler implements TypedHasherUtil.ProbeHandler { + final WritableIntChunk outputPositions; + + private UpdateByProbeHandler(WritableIntChunk outputPositions) { + this.outputPositions = outputPositions; + } + + @Override + public void doProbe(RowSequence chunkOk, Chunk[] sourceKeyChunks) { + probeHashTable(chunkOk, sourceKeyChunks, outputPositions); + } + } + + @Override + public void add(boolean initialBuild, SafeCloseable bc, RowSequence orderedKeys, ColumnSource[] sources, + MutableInt nextOutputPosition, WritableIntChunk outputPositions) { + if (orderedKeys.isEmpty()) { + return; + } + buildTable(initialBuild, (BuildContext) bc, orderedKeys, sources, outputPositions, + new UpdateByBuildHandler(nextOutputPosition, outputPositions)); + } + + @Override + public void remove(@NotNull final SafeCloseable pc, + @NotNull final RowSequence indexToRemove, + @NotNull final ColumnSource[] sources, + @NotNull final WritableIntChunk outputPositions) { + if (indexToRemove.isEmpty()) { + outputPositions.setSize(0); + return; + } + probeTable((ProbeContext) pc, indexToRemove, true, sources, outputPositions, + new UpdateByProbeHandler(outputPositions)); + } + + @Override + public void findModifications(@NotNull final SafeCloseable pc, + @NotNull final RowSequence modifiedIndex, + @NotNull final ColumnSource[] leftSources, + @NotNull final WritableIntChunk outputPositions) { + if (modifiedIndex.isEmpty()) { + outputPositions.setSize(0); + return; + } + probeTable((ProbeContext) pc, modifiedIndex, false, leftSources, outputPositions, + new UpdateByProbeHandler(outputPositions)); + } + + public static class BuildContext extends TypedHasherUtil.BuildOrProbeContext { + private BuildContext(ColumnSource[] buildSources, int chunkSize) { + super(buildSources, chunkSize); + } + + final MutableInt rehashCredits = new MutableInt(0); + } + + public static class ProbeContext extends TypedHasherUtil.BuildOrProbeContext { + private ProbeContext(ColumnSource[] buildSources, int chunkSize) { + super(buildSources, chunkSize); + } + } + + @Override + public SafeCloseable makeUpdateByBuildContext(ColumnSource[] keySources, long updateSize) { + return new BuildContext(keySources, (int) Math.min(CHUNK_SIZE, updateSize)); + } + + @Override + public SafeCloseable makeUpdateByProbeContext(ColumnSource[] buildSources, long maxSize) { + return new ProbeContext(buildSources, (int) Math.min(maxSize, CHUNK_SIZE)); + } + + protected void newAlternate() { + alternateStateSource = stateSource; + stateSource = new ImmutableIntArraySource(); + stateSource.ensureCapacity(tableSize); + + if (mainInsertMask == 0) { + mainInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + alternateInsertMask = 0; + } else { + mainInsertMask = 0; + alternateInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + } + } + + protected void clearAlternate() { + for (int ii = 0; ii < mainKeySources.length; ++ii) { + alternateKeySources[ii] = null; + } + } + + protected void buildTable( + final boolean initialBuild, + final BuildContext bc, + final RowSequence buildRows, + final ColumnSource[] buildSources, + WritableIntChunk outputPositions, + final TypedHasherUtil.BuildHandler buildHandler) { + + outputPositions.setSize(buildRows.intSize()); + + try (final RowSequence.Iterator rsIt = buildRows.getRowSequenceIterator()) { + // noinspection unchecked + final Chunk[] sourceKeyChunks = new Chunk[buildSources.length]; + + while (rsIt.hasMore()) { + final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); + + while (doRehash(initialBuild, bc.rehashCredits, chunkOk.intSize(), outputPositions)) { + migrateFront(outputPositions); + } + + getKeyChunks(buildSources, bc.getContexts, sourceKeyChunks, chunkOk); + + buildHandler.doBuild(chunkOk, sourceKeyChunks); + + bc.resetSharedContexts(); + } + } + } + + protected void probeTable( + final ProbeContext pc, + final RowSequence probeRows, + final boolean usePrev, + final ColumnSource[] probeSources, + WritableIntChunk outputPositions, + final TypedHasherUtil.ProbeHandler handler) { + + outputPositions.setSize(probeRows.intSize()); + + try (final RowSequence.Iterator rsIt = probeRows.getRowSequenceIterator()) { + // noinspection unchecked + final Chunk[] sourceKeyChunks = new Chunk[probeSources.length]; + + while (rsIt.hasMore()) { + final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); + + if (usePrev) { + getPrevKeyChunks(probeSources, pc.getContexts, sourceKeyChunks, chunkOk); + } else { + getKeyChunks(probeSources, pc.getContexts, sourceKeyChunks, chunkOk); + } + + handler.doProbe(chunkOk, sourceKeyChunks); + + pc.resetSharedContexts(); + } + } + } + + /** + * @param fullRehash should we rehash the entire table (if false, we rehash incrementally) + * @param rehashCredits the number of entries this operation has rehashed (input/output) + * @param nextChunkSize the size of the chunk we are processing + * @return true if a front migration is required + */ + public boolean doRehash(boolean fullRehash, MutableInt rehashCredits, int nextChunkSize, + WritableIntChunk outputPositions) { + if (rehashPointer > 0) { + final int requiredRehash = nextChunkSize - rehashCredits.intValue(); + if (requiredRehash <= 0) { + return false; + } + + // before building, we need to do at least as much rehash work as we would do build work + rehashCredits.add(rehashInternalPartial(requiredRehash, outputPositions)); + if (rehashPointer == 0) { + clearAlternate(); + } + } + + int oldTableSize = tableSize; + while (rehashRequired(nextChunkSize)) { + tableSize *= 2; + + if (tableSize < 0 || tableSize > MAX_TABLE_SIZE) { + throw new UnsupportedOperationException("Hash table exceeds maximum size!"); + } + } + + if (oldTableSize == tableSize) { + return false; + } + + // we can't give the caller credit for rehashes with the old table, we need to begin migrating things again + if (rehashCredits.intValue() > 0) { + rehashCredits.setValue(0); + } + + if (fullRehash) { + // if we are doing a full rehash, we need to ditch the alternate + if (rehashPointer > 0) { + rehashInternalPartial((int) numEntries, outputPositions); + clearAlternate(); + } + + rehashInternalFull(oldTableSize); + + return false; + } + + Assert.eqZero(rehashPointer, "rehashPointer"); + + for (int ii = 0; ii < mainKeySources.length; ++ii) { + alternateKeySources[ii] = mainKeySources[ii]; + mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, + alternateKeySources[ii].getType(), alternateKeySources[ii].getComponentType()); + mainKeySources[ii].ensureCapacity(tableSize); + } + alternateTableSize = oldTableSize; + if (numEntries > 0) { + rehashPointer = alternateTableSize; + } + + newAlternate(); + + return true; + } + + public boolean rehashRequired(int nextChunkSize) { + return (numEntries + nextChunkSize) > (tableSize * maximumLoadFactor); + } + + protected int hashToTableLocation(int hash) { + return hash & (tableSize - 1); + } + + protected int hashToTableLocationAlternate(int hash) { + return hash & (alternateTableSize - 1); + } + + abstract protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions); + + abstract protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions); + + abstract protected int rehashInternalPartial(int entriesToRehash, WritableIntChunk outputPositions); + + abstract protected void migrateFront(WritableIntChunk outputPositions); + + abstract protected void rehashInternalFull(final int oldSize); +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/TypedHashDispatcher.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/TypedHashDispatcher.java new file mode 100644 index 00000000000..989176b8c14 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/TypedHashDispatcher.java @@ -0,0 +1,143 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.replicators.ReplicateTypedHashers +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import io.deephaven.chunk.ChunkType; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.util.Arrays; + +/** + * The TypedHashDispatcher returns a pre-generated and precompiled hasher instance suitable for the provided column sources, or null if there is not a precompiled hasher suitable for the specified sources. */ +public class TypedHashDispatcher { + private TypedHashDispatcher() { + // static use only + } + + public static UpdateByStateManagerTypedBase dispatch(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + final ChunkType[] chunkTypes = Arrays.stream(tableKeySources).map(ColumnSource::getChunkType).toArray(ChunkType[]::new);; + if (chunkTypes.length == 1) { + return dispatchSingle(chunkTypes[0], tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + if (chunkTypes.length == 2) { + return dispatchDouble(chunkTypes[0], chunkTypes[1], tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + return null; + } + + private static UpdateByStateManagerTypedBase dispatchSingle(ChunkType chunkType, + ColumnSource[] tableKeySources, ColumnSource[] originalTableKeySources, int tableSize, + double maximumLoadFactor, double targetLoadFactor) { + switch (chunkType) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType); + case Char: return new UpdateByHasherChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + } + + private static UpdateByStateManagerTypedBase dispatchDouble(ChunkType chunkType0, + ChunkType chunkType1, ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + switch (chunkType0) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType0); + case Char:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherCharChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherCharByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherCharShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherCharInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherCharLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherCharFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherCharDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherCharObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Byte:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherByteChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherByteByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherByteShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherByteInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherByteLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherByteFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherByteDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherByteObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Short:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherShortChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherShortByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherShortShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherShortInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherShortLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherShortFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherShortDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherShortObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Int:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherIntChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherIntByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherIntShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherIntInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherIntLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherIntFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherIntDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherIntObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Long:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherLongChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherLongByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherLongShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherLongInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherLongLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherLongFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherLongDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherLongObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Float:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherFloatChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherFloatByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherFloatShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherFloatInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherFloatLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherFloatFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherFloatDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherFloatObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Double:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherDoubleChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherDoubleByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherDoubleShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherDoubleInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherDoubleLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherDoubleFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherDoubleDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherDoubleObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + case Object:switch (chunkType1) { + default: throw new UnsupportedOperationException("Invalid chunk type for typed hashers: " + chunkType1); + case Char: return new UpdateByHasherObjectChar(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Byte: return new UpdateByHasherObjectByte(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Short: return new UpdateByHasherObjectShort(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Int: return new UpdateByHasherObjectInt(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Long: return new UpdateByHasherObjectLong(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Float: return new UpdateByHasherObjectFloat(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Double: return new UpdateByHasherObjectDouble(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + case Object: return new UpdateByHasherObjectObject(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor, targetLoadFactor); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByte.java new file mode 100644 index 00000000000..5079b8e4f46 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByte.java @@ -0,0 +1,223 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByte extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + public UpdateByHasherByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteByte.java new file mode 100644 index 00000000000..a935a6f56c8 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteByte.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteByte extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherByteByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, byte k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteChar.java new file mode 100644 index 00000000000..f71b89360df --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteChar.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.CharComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteChar extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherByteChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, char k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteDouble.java new file mode 100644 index 00000000000..0d9cf5d67ae --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteDouble.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteDouble extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherByteDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, double k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteFloat.java new file mode 100644 index 00000000000..2c3d4a136dd --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteFloat.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteFloat extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherByteFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, float k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteInt.java new file mode 100644 index 00000000000..f5708f00a62 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteInt.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteInt extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherByteInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, int k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteLong.java new file mode 100644 index 00000000000..5a1af0f7545 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteLong extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherByteLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, long k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteObject.java new file mode 100644 index 00000000000..90a28b8a59c --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteObject extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherByteObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, Object k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteShort.java new file mode 100644 index 00000000000..3d72c1e674b --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherByteShort.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherByteShort extends UpdateByStateManagerTypedBase { + private ImmutableByteArraySource mainKeySource0; + + private ImmutableByteArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherByteShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableByteArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final byte k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(byte k0, short k1) { + int hash = ByteChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final byte k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableByteArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableByteArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final byte[] destKeyArray0 = new byte[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final byte [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final byte k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherChar.java new file mode 100644 index 00000000000..51fd8d1c52d --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherChar.java @@ -0,0 +1,223 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherChar extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + public UpdateByHasherChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0) { + int hash = CharChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharByte.java new file mode 100644 index 00000000000..fd5c04771d6 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharByte.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.CharComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharByte extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherCharByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, byte k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharChar.java new file mode 100644 index 00000000000..5afc298189b --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharChar.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharChar extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherCharChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, char k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharDouble.java new file mode 100644 index 00000000000..790981dcffc --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharDouble.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharDouble extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherCharDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, double k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharFloat.java new file mode 100644 index 00000000000..66ace726db6 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharFloat.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharFloat extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherCharFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, float k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharInt.java new file mode 100644 index 00000000000..d583c1dfbed --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharInt.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharInt extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherCharInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, int k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharLong.java new file mode 100644 index 00000000000..13914f16537 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharLong extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherCharLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, long k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharObject.java new file mode 100644 index 00000000000..86940ee9c80 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharObject extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherCharObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, Object k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharShort.java new file mode 100644 index 00000000000..5d710347de2 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherCharShort.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherCharShort extends UpdateByStateManagerTypedBase { + private ImmutableCharArraySource mainKeySource0; + + private ImmutableCharArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherCharShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableCharArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final char k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(char k0, short k1) { + int hash = CharChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final char k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableCharArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableCharArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final char[] destKeyArray0 = new char[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final char [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final char k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDouble.java new file mode 100644 index 00000000000..ba2be078960 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDouble.java @@ -0,0 +1,223 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDouble extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + public UpdateByHasherDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleByte.java new file mode 100644 index 00000000000..9b53eec7461 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleByte.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleByte extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherDoubleByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, byte k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleChar.java new file mode 100644 index 00000000000..a1fb2039d0c --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleChar.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleChar extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherDoubleChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, char k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleDouble.java new file mode 100644 index 00000000000..e7882b82700 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleDouble.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleDouble extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherDoubleDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, double k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleFloat.java new file mode 100644 index 00000000000..b09d7853342 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleFloat.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleFloat extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherDoubleFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, float k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleInt.java new file mode 100644 index 00000000000..28b91a34825 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleInt.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleInt extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherDoubleInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, int k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleLong.java new file mode 100644 index 00000000000..ca2f3f8117b --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleLong extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherDoubleLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, long k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleObject.java new file mode 100644 index 00000000000..f5588056493 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleObject extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherDoubleObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, Object k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleShort.java new file mode 100644 index 00000000000..0d6618b3b93 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherDoubleShort.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherDoubleShort extends UpdateByStateManagerTypedBase { + private ImmutableDoubleArraySource mainKeySource0; + + private ImmutableDoubleArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherDoubleShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableDoubleArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final double k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(double k0, short k1) { + int hash = DoubleChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final double k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableDoubleArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableDoubleArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final double[] destKeyArray0 = new double[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final double [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final double k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloat.java new file mode 100644 index 00000000000..a02267e5c34 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloat.java @@ -0,0 +1,223 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloat extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + public UpdateByHasherFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatByte.java new file mode 100644 index 00000000000..ef091e4791d --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatByte.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatByte extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherFloatByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, byte k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatChar.java new file mode 100644 index 00000000000..26faf508ed8 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatChar.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatChar extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherFloatChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, char k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatDouble.java new file mode 100644 index 00000000000..35cfe4f84e2 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatDouble.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatDouble extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherFloatDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, double k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatFloat.java new file mode 100644 index 00000000000..4ee3f5c1844 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatFloat.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatFloat extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherFloatFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, float k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatInt.java new file mode 100644 index 00000000000..2c820ee8f09 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatInt.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatInt extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherFloatInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, int k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatLong.java new file mode 100644 index 00000000000..35368879ab5 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatLong extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherFloatLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, long k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatObject.java new file mode 100644 index 00000000000..a1d86f38343 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatObject extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherFloatObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, Object k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatShort.java new file mode 100644 index 00000000000..abfd1009c8e --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherFloatShort.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherFloatShort extends UpdateByStateManagerTypedBase { + private ImmutableFloatArraySource mainKeySource0; + + private ImmutableFloatArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherFloatShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableFloatArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final float k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(float k0, short k1) { + int hash = FloatChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final float k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableFloatArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableFloatArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final float[] destKeyArray0 = new float[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final float [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final float k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherInt.java new file mode 100644 index 00000000000..996ab8c2963 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherInt.java @@ -0,0 +1,222 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherInt extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + public UpdateByHasherInt(ColumnSource[] tableKeySources, ColumnSource[] originalTableKeySources, + int tableSize, double maximumLoadFactor, double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0) { + int hash = IntChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntByte.java new file mode 100644 index 00000000000..3d80beae193 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntByte.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntByte extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherIntByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, byte k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntChar.java new file mode 100644 index 00000000000..f3e9ec9c7a0 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntChar.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntChar extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherIntChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, char k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntDouble.java new file mode 100644 index 00000000000..7ad0ce9205d --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntDouble.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntDouble extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherIntDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, double k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntFloat.java new file mode 100644 index 00000000000..c7a624f3227 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntFloat.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntFloat extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherIntFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, float k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntInt.java new file mode 100644 index 00000000000..ac5ce3a8502 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntInt.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntInt extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherIntInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, int k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntLong.java new file mode 100644 index 00000000000..900ba42d943 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntLong extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherIntLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, long k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntObject.java new file mode 100644 index 00000000000..fce086f2836 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntObject extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherIntObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, Object k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntShort.java new file mode 100644 index 00000000000..0b172bb9eff --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherIntShort.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherIntShort extends UpdateByStateManagerTypedBase { + private ImmutableIntArraySource mainKeySource0; + + private ImmutableIntArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherIntShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableIntArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final int k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(int k0, short k1) { + int hash = IntChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final int k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableIntArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableIntArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final int[] destKeyArray0 = new int[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final int [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final int k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLong.java new file mode 100644 index 00000000000..2bd9990b1d0 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLong.java @@ -0,0 +1,222 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLong extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + public UpdateByHasherLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0) { + int hash = LongChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongByte.java new file mode 100644 index 00000000000..f095c21fbae --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongByte.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongByte extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherLongByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, byte k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongChar.java new file mode 100644 index 00000000000..62ae28312dd --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongChar.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongChar extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherLongChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, char k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongDouble.java new file mode 100644 index 00000000000..7e25d5a88df --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongDouble.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongDouble extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherLongDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, double k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongFloat.java new file mode 100644 index 00000000000..7cc464e1f01 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongFloat.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongFloat extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherLongFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, float k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongInt.java new file mode 100644 index 00000000000..86d84ad2ac3 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongInt.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongInt extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherLongInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, int k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongLong.java new file mode 100644 index 00000000000..a7721c344b4 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongLong.java @@ -0,0 +1,244 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongLong extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherLongLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, long k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongObject.java new file mode 100644 index 00000000000..30a38d74e00 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongObject.java @@ -0,0 +1,250 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongObject extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherLongObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, Object k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongShort.java new file mode 100644 index 00000000000..6d5ccb23861 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherLongShort.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherLongShort extends UpdateByStateManagerTypedBase { + private ImmutableLongArraySource mainKeySource0; + + private ImmutableLongArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherLongShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableLongArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final long k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(long k0, short k1) { + int hash = LongChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final long k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableLongArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableLongArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final long[] destKeyArray0 = new long[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final long [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final long k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObject.java new file mode 100644 index 00000000000..a3321f349b2 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObject.java @@ -0,0 +1,225 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObject extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + public UpdateByHasherObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectByte.java new file mode 100644 index 00000000000..cf8f9f3d833 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectByte.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectByte extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherObjectByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, byte k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectChar.java new file mode 100644 index 00000000000..9a3c089cfa7 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectChar.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectChar extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherObjectChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, char k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectDouble.java new file mode 100644 index 00000000000..8687d04003e --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectDouble.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectDouble extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherObjectDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, double k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectFloat.java new file mode 100644 index 00000000000..df748fcd4f3 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectFloat.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectFloat extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherObjectFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, float k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectInt.java new file mode 100644 index 00000000000..9e1bc740f8b --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectInt.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectInt extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherObjectInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, int k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectLong.java new file mode 100644 index 00000000000..efbcee4c882 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectLong.java @@ -0,0 +1,250 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectLong extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherObjectLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, long k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectObject.java new file mode 100644 index 00000000000..bd67b1cdf69 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectObject.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ObjectComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectObject extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherObjectObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, Object k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectShort.java new file mode 100644 index 00000000000..0fc81c0417c --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherObjectShort.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ObjectComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherObjectShort extends UpdateByStateManagerTypedBase { + private ImmutableObjectArraySource mainKeySource0; + + private ImmutableObjectArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherObjectShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableObjectArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final Object k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(Object k0, short k1) { + int hash = ObjectChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final Object k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + alternateKeySource0.set(locationToMigrate, null); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableObjectArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableObjectArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final Object[] destKeyArray0 = new Object[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final Object [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final Object k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShort.java new file mode 100644 index 00000000000..f17309ec5ae --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShort.java @@ -0,0 +1,223 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShort extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + public UpdateByHasherShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final int hash = hash(k0); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int hash = hash(k0); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final int hash = hash(k0); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortByte.java new file mode 100644 index 00000000000..00266870760 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortByte.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ByteComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.ByteChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ByteChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortByte extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableByteArraySource mainKeySource1; + + private ImmutableByteArraySource alternateKeySource1; + + public UpdateByHasherShortByte(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableByteArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final byte k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, byte k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = ByteChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final byte k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableByteArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableByteArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final byte[] destKeyArray1 = new byte[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final byte [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final byte k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortChar.java new file mode 100644 index 00000000000..58550cc4216 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortChar.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.CharComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.CharChunk; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.CharChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortChar extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableCharArraySource mainKeySource1; + + private ImmutableCharArraySource alternateKeySource1; + + public UpdateByHasherShortChar(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableCharArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final char k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, char k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = CharChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final char k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableCharArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableCharArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final char[] destKeyArray1 = new char[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final char [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final char k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortDouble.java new file mode 100644 index 00000000000..bf11479261f --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortDouble.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.DoubleComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.DoubleChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.DoubleChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortDouble extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableDoubleArraySource mainKeySource1; + + private ImmutableDoubleArraySource alternateKeySource1; + + public UpdateByHasherShortDouble(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableDoubleArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final double k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, double k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = DoubleChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final double k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableDoubleArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableDoubleArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final double[] destKeyArray1 = new double[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final double [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final double k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortFloat.java new file mode 100644 index 00000000000..f00f5eb7806 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortFloat.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.FloatComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.FloatChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.FloatChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortFloat extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableFloatArraySource mainKeySource1; + + private ImmutableFloatArraySource alternateKeySource1; + + public UpdateByHasherShortFloat(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableFloatArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final float k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, float k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = FloatChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final float k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableFloatArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableFloatArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final float[] destKeyArray1 = new float[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final float [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final float k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortInt.java new file mode 100644 index 00000000000..0099f0e280f --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortInt.java @@ -0,0 +1,249 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.IntComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.IntChunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.IntChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortInt extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableIntArraySource mainKeySource1; + + private ImmutableIntArraySource alternateKeySource1; + + public UpdateByHasherShortInt(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableIntArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final int k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, int k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = IntChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final int k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableIntArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableIntArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final int[] destKeyArray1 = new int[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final int [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final int k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortLong.java new file mode 100644 index 00000000000..4967985e583 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortLong.java @@ -0,0 +1,248 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.LongComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.LongChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortLong extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableLongArraySource mainKeySource1; + + private ImmutableLongArraySource alternateKeySource1; + + public UpdateByHasherShortLong(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableLongArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final long k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, long k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = LongChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final long k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableLongArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableLongArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final long[] destKeyArray1 = new long[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final long [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final long k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortObject.java new file mode 100644 index 00000000000..c05ab926337 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortObject.java @@ -0,0 +1,251 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ObjectComparisons.eq; +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ObjectChunkHasher; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Object; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortObject extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableObjectArraySource mainKeySource1; + + private ImmutableObjectArraySource alternateKeySource1; + + public UpdateByHasherShortObject(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableObjectArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final Object k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, Object k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = ObjectChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final Object k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + alternateKeySource1.set(locationToMigrate, null); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableObjectArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableObjectArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final Object[] destKeyArray1 = new Object[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final Object [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final Object k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortShort.java new file mode 100644 index 00000000000..48e5bed8e4b --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/typed/open/gen/UpdateByHasherShortShort.java @@ -0,0 +1,245 @@ +// DO NOT EDIT THIS CLASS, AUTOMATICALLY GENERATED BY io.deephaven.engine.table.impl.by.typed.TypedHasherFactory +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +// +package io.deephaven.engine.table.impl.updateby.hashing.typed.open.gen; + +import static io.deephaven.util.compare.ShortComparisons.eq; + +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.ShortChunk; +import io.deephaven.chunk.WritableIntChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.chunk.util.hashing.ShortChunkHasher; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; +import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; +import java.lang.Override; +import java.util.Arrays; +import org.apache.commons.lang3.mutable.MutableInt; + +final class UpdateByHasherShortShort extends UpdateByStateManagerTypedBase { + private ImmutableShortArraySource mainKeySource0; + + private ImmutableShortArraySource alternateKeySource0; + + private ImmutableShortArraySource mainKeySource1; + + private ImmutableShortArraySource alternateKeySource1; + + public UpdateByHasherShortShort(ColumnSource[] tableKeySources, + ColumnSource[] originalTableKeySources, int tableSize, double maximumLoadFactor, + double targetLoadFactor) { + super(tableKeySources, originalTableKeySources, tableSize, maximumLoadFactor); + this.mainKeySource0 = (ImmutableShortArraySource) super.mainKeySources[0]; + this.mainKeySource0.ensureCapacity(tableSize); + this.mainKeySource1 = (ImmutableShortArraySource) super.mainKeySources[1]; + this.mainKeySource1.ensureCapacity(tableSize); + } + + private int nextTableLocation(int tableLocation) { + return (tableLocation + 1) & (tableSize - 1); + } + + private int alternateNextTableLocation(int tableLocation) { + return (tableLocation + 1) & (alternateTableSize - 1); + } + + protected void buildHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + MutableInt outputPositionOffset, WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final int chunkSize = keyChunk0.size(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + int tableLocation = firstTableLocation; + MAIN_SEARCH: while (true) { + int rowState = stateSource.getUnsafe(tableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + int alternateTableLocation = firstAlternateTableLocation; + while (alternateTableLocation < rehashPointer) { + rowState = alternateStateSource.getUnsafe(alternateTableLocation); + if (rowState == EMPTY_RIGHT_VALUE) { + break; + } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break MAIN_SEARCH; + } else { + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + numEntries++; + mainKeySource0.set(tableLocation, k0); + mainKeySource1.set(tableLocation, k1); + // create a new bucket and put it in the hash slot; + final int outputPosForLocation = outputPositionOffset.getAndIncrement(); + stateSource.set(tableLocation, outputPosForLocation); + // map the new bucket to this chunk position; + outputPositions.set(chunkPosition, outputPosForLocation); + break; + } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + break; + } else { + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + } + } + } + + protected void probeHashTable(RowSequence rowSequence, Chunk[] sourceKeyChunks, + WritableIntChunk outputPositions) { + final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); + final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); + final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); + final int chunkSize = keyChunk0.size(); + for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { + final short k0 = keyChunk0.get(chunkPosition); + final short k1 = keyChunk1.get(chunkPosition); + final int hash = hash(k0, k1); + final int firstTableLocation = hashToTableLocation(hash); + boolean found = false; + int tableLocation = firstTableLocation; + int rowState; + while ((rowState = stateSource.getUnsafe(tableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { + // map the existing bucket to this chunk position; + outputPositions.set(chunkPosition, rowState); + found = true; + break; + } + tableLocation = nextTableLocation(tableLocation); + Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); + } + if (!found) { + final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); + boolean alternateFound = false; + if (firstAlternateTableLocation < rehashPointer) { + int alternateTableLocation = firstAlternateTableLocation; + while ((rowState = alternateStateSource.getUnsafe(alternateTableLocation)) != EMPTY_RIGHT_VALUE) { + if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { + // map the existing bucket (from alternate) to this chunk position; + outputPositions.set(chunkPosition, rowState); + alternateFound = true; + break; + } + alternateTableLocation = alternateNextTableLocation(alternateTableLocation); + Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); + } + } + if (!alternateFound) { + // throw exception if the bucket isn't found; + throw new IllegalStateException("Failed to find main aggregation slot for key " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); + } + } + } + } + + private static int hash(short k0, short k1) { + int hash = ShortChunkHasher.hashInitialSingle(k0); + hash = ShortChunkHasher.hashUpdateSingle(hash, k1); + return hash; + } + + private boolean migrateOneLocation(int locationToMigrate, + WritableIntChunk outputPositions) { + final int currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); + if (currentStateValue == EMPTY_RIGHT_VALUE) { + return false; + } + final short k0 = alternateKeySource0.getUnsafe(locationToMigrate); + final short k1 = alternateKeySource1.getUnsafe(locationToMigrate); + final int hash = hash(k0, k1); + int destinationTableLocation = hashToTableLocation(hash); + while (stateSource.getUnsafe(destinationTableLocation) != EMPTY_RIGHT_VALUE) { + destinationTableLocation = nextTableLocation(destinationTableLocation); + } + mainKeySource0.set(destinationTableLocation, k0); + mainKeySource1.set(destinationTableLocation, k1); + stateSource.set(destinationTableLocation, currentStateValue); + alternateStateSource.set(locationToMigrate, EMPTY_RIGHT_VALUE); + return true; + } + + @Override + protected int rehashInternalPartial(int entriesToRehash, + WritableIntChunk outputPositions) { + int rehashedEntries = 0; + while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { + if (migrateOneLocation(--rehashPointer, outputPositions)) { + rehashedEntries++; + } + } + return rehashedEntries; + } + + @Override + protected void newAlternate() { + super.newAlternate(); + this.mainKeySource0 = (ImmutableShortArraySource)super.mainKeySources[0]; + this.alternateKeySource0 = (ImmutableShortArraySource)super.alternateKeySources[0]; + this.mainKeySource1 = (ImmutableShortArraySource)super.mainKeySources[1]; + this.alternateKeySource1 = (ImmutableShortArraySource)super.alternateKeySources[1]; + } + + @Override + protected void clearAlternate() { + super.clearAlternate(); + this.alternateKeySource0 = null; + this.alternateKeySource1 = null; + } + + @Override + protected void migrateFront(WritableIntChunk outputPositions) { + int location = 0; + while (migrateOneLocation(location++, outputPositions)); + } + + @Override + protected void rehashInternalFull(final int oldSize) { + final short[] destKeyArray0 = new short[tableSize]; + final short[] destKeyArray1 = new short[tableSize]; + final int[] destState = new int[tableSize]; + Arrays.fill(destState, EMPTY_RIGHT_VALUE); + final short [] originalKeyArray0 = mainKeySource0.getArray(); + mainKeySource0.setArray(destKeyArray0); + final short [] originalKeyArray1 = mainKeySource1.getArray(); + mainKeySource1.setArray(destKeyArray1); + final int [] originalStateArray = stateSource.getArray(); + stateSource.setArray(destState); + for (int sourceBucket = 0; sourceBucket < oldSize; ++sourceBucket) { + final int currentStateValue = originalStateArray[sourceBucket]; + if (currentStateValue == EMPTY_RIGHT_VALUE) { + continue; + } + final short k0 = originalKeyArray0[sourceBucket]; + final short k1 = originalKeyArray1[sourceBucket]; + final int hash = hash(k0, k1); + final int firstDestinationTableLocation = hashToTableLocation(hash); + int destinationTableLocation = firstDestinationTableLocation; + while (true) { + if (destState[destinationTableLocation] == EMPTY_RIGHT_VALUE) { + destKeyArray0[destinationTableLocation] = k0; + destKeyArray1[destinationTableLocation] = k1; + destState[destinationTableLocation] = originalStateArray[sourceBucket]; + break; + } + destinationTableLocation = nextTableLocation(destinationTableLocation); + Assert.neq(destinationTableLocation, "destinationTableLocation", firstDestinationTableLocation, "firstDestinationTableLocation"); + } + } + } +} diff --git a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateTypedHashers.java b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateTypedHashers.java index 99283dd927f..614161601cc 100644 --- a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateTypedHashers.java +++ b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateTypedHashers.java @@ -20,6 +20,7 @@ import io.deephaven.engine.table.impl.by.typed.TypedHasherFactory; import io.deephaven.engine.table.impl.naturaljoin.IncrementalNaturalJoinStateManagerTypedBase; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.updateby.hashing.UpdateByStateManagerTypedBase; import org.jetbrains.annotations.NotNull; import javax.lang.model.element.Modifier; @@ -38,6 +39,7 @@ public static void main(String[] args) throws IOException { generatePackage(IncrementalNaturalJoinStateManagerTypedBase.class, false); generatePackage(StaticAsOfJoinStateManagerTypedBase.class, false); generatePackage(RightIncrementalAsOfJoinStateManagerTypedBase.class, false); + generatePackage(UpdateByStateManagerTypedBase.class, true); } private static void generatePackage(Class baseClass, boolean doDouble) throws IOException { From 70000062ae8dfa14452610d44845f680853b58d5 Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Wed, 27 Jul 2022 13:52:37 -0700 Subject: [PATCH 039/215] Removed unneeded overrides for updateBy() from SimpleSourceTable and DeferredViewTable (#2691) --- .../io/deephaven/engine/table/impl/DeferredViewTable.java | 8 -------- .../io/deephaven/engine/table/impl/SimpleSourceTable.java | 8 -------- 2 files changed, 16 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java index 91ab507d77f..4b65cd37367 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java @@ -267,14 +267,6 @@ protected Table redefine(TableDefinition newDefinitionExternal, TableDefinition return deferredViewTable; } - @Override - public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, - @NotNull final Collection byColumns) { - return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), - () -> UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control)); - } - /** * The table reference hides the table underlying table from us. */ diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java index dcd80d5eb42..d7c0924d6b6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java @@ -65,12 +65,4 @@ protected final Table redefine(TableDefinition newDefinitionExternal, TableDefin deferredViewTable.setRefreshing(isRefreshing()); return deferredViewTable; } - - @Override - public Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection ops, - @NotNull final Collection byColumns) { - return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), - () -> UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control)); - } } From 385b3fdd41277501c21a2fd06b54b7ed58561235 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Wed, 27 Jul 2022 14:55:12 -0600 Subject: [PATCH 040/215] Have a more generous timeout for test cases (#2686) to minimize the chance of having failures due to system being super busy at the time and depriving UGP cycles from runnnig --- py/server/tests/test_ugp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index ac2bb272aaf..84334edc8d7 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -66,7 +66,7 @@ def ticking_table_op_decorated(tail_size: int, period: str = "00:00:01"): t = ticking_table_op_decorated() t = ticking_table_op_decorated(5) - self.wait_ticking_table_update(t, row_count=5, timeout=5) + self.wait_ticking_table_update(t, row_count=5, timeout=10) t = ticking_table_op_decorated(10, "00:00:00.001") self.wait_ticking_table_update(t, row_count=8, timeout=5) @@ -82,7 +82,7 @@ def ticking_table_op_decorated(tail_size: int, period: str = "00:00:01"): t = ticking_table_op_decorated() t = ticking_table_op_decorated(5) - self.wait_ticking_table_update(t, row_count=5, timeout=5) + self.wait_ticking_table_update(t, row_count=5, timeout=10) t = ticking_table_op_decorated(10, "00:00:00.001") self.wait_ticking_table_update(t, row_count=8, timeout=5) From eef78dce50559c07541520e6a2f3836f97038f8b Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 27 Jul 2022 22:11:21 -0700 Subject: [PATCH 041/215] groupByColumns to ColumnName (#2662) --- .../deephaven/treetable/RollupDefinition.java | 5 +- .../treetable/RollupSnapshotImpl.java | 3 +- .../main/java/io/deephaven/plot/AxesImpl.java | 9 +- .../io/deephaven/plot/util/PlotUtils.java | 5 +- .../java/io/deephaven/engine/table/Table.java | 71 ++++---- .../engine/table/TableDefinition.java | 8 + .../engine/PercentileByBenchmark.java | 8 +- .../engine/table/impl/DeferredViewTable.java | 8 +- .../engine/table/impl/HierarchicalTable.java | 9 +- .../table/impl/MemoizedOperationKey.java | 75 ++++---- .../table/impl/PartitionAwareSourceTable.java | 13 +- .../engine/table/impl/QueryTable.java | 51 +++--- .../engine/table/impl/RollupInfo.java | 29 ++-- .../engine/table/impl/SimpleSourceTable.java | 1 + .../engine/table/impl/TableWithDefaults.java | 155 +++++++++-------- .../engine/table/impl/UncoalescedTable.java | 41 ++--- .../deephaven/engine/table/impl/UpdateBy.java | 8 +- .../table/impl/by/ApproximatePercentile.java | 6 +- .../by/ChunkedOperatorAggregationHelper.java | 30 ++-- .../PartitionedTableProxyImpl.java | 50 +++--- .../engine/table/impl/util/FreezeBy.java | 4 +- .../engine/util/TotalsTableBuilder.java | 4 +- .../table/impl/QueryTableAggregationTest.java | 160 ++++++++++-------- .../impl/updateby/TestUpdateByGeneral.java | 3 +- .../table/ParquetTableReadWriteTest.java | 4 +- .../io/deephaven/client/AggBySessionTest.java | 97 ----------- .../client/impl/BatchTableRequestBuilder.java | 2 +- .../io/deephaven/graphviz/LabelBuilder.java | 2 +- .../io/deephaven/qst/TableAdapterImpl.java | 9 +- .../qst/table/AggregateAllByTable.java | 3 +- .../io/deephaven/qst/table/ByTableBase.java | 10 +- .../qst/table/SelectDistinctTable.java | 4 +- .../io/deephaven/qst/table/TableBase.java | 66 ++++---- .../table/ops/ComboAggregateGrpcImpl.java | 28 +-- .../java/io/deephaven/api/ColumnName.java | 23 +++ .../io/deephaven/api/TableOperations.java | 44 ++--- .../deephaven/api/TableOperationsAdapter.java | 50 +++--- .../deephaven/api/agg/spec/AggSpecGroup.java | 2 - 38 files changed, 523 insertions(+), 577 deletions(-) delete mode 100644 java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java diff --git a/ClientSupport/src/main/java/io/deephaven/treetable/RollupDefinition.java b/ClientSupport/src/main/java/io/deephaven/treetable/RollupDefinition.java index c2c3b2af3ec..0b9d0e5a67d 100644 --- a/ClientSupport/src/main/java/io/deephaven/treetable/RollupDefinition.java +++ b/ClientSupport/src/main/java/io/deephaven/treetable/RollupDefinition.java @@ -4,13 +4,11 @@ package io.deephaven.treetable; import io.deephaven.UncheckedDeephavenException; -import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.AggregationDescriptions; import io.deephaven.api.agg.AggregationPairs; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.util.string.StringUtils; import java.util.*; @@ -152,8 +150,7 @@ public String getName() { * @return a rollup, as defined by this object. */ public Table applyTo(Table table) { - Table result = table.rollup(aggregations, includeConstituents, - SelectColumn.from(Selectable.from(groupByColumns))); + Table result = table.rollup(aggregations, includeConstituents, groupByColumns); if (includeDescriptions) { result = result.withColumnDescription(AggregationDescriptions.of(aggregations)); } diff --git a/ClientSupport/src/main/java/io/deephaven/treetable/RollupSnapshotImpl.java b/ClientSupport/src/main/java/io/deephaven/treetable/RollupSnapshotImpl.java index 3529cf5d037..9dcd5e5ca23 100644 --- a/ClientSupport/src/main/java/io/deephaven/treetable/RollupSnapshotImpl.java +++ b/ClientSupport/src/main/java/io/deephaven/treetable/RollupSnapshotImpl.java @@ -160,11 +160,10 @@ private HierarchicalTable applyFilters(@NotNull HierarchicalTable table) { if (filters.length == 0) { return table; } - final Table source = Require.neqNull(table.getSourceTable(), "Hierarchical source table"); final RollupInfo info = getInfo(); return (HierarchicalTable) source.where(filters).rollup(info.aggregations, - info.getLeafType() == RollupInfo.LeafType.Constituent, info.getSelectColumns()); + info.getLeafType() == RollupInfo.LeafType.Constituent, info.getGroupByColumns()); } @Override diff --git a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java index 6ad1d3f594c..e967553e79c 100644 --- a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java @@ -3,6 +3,7 @@ */ package io.deephaven.plot; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; import io.deephaven.datastructures.util.CollectionUtil; @@ -277,12 +278,10 @@ private static SelectableDataSet getAggregatedSelectableDataSet(final Selectable if (sds instanceof SelectableDataSetOneClick) { Collections.addAll(cols, ((SelectableDataSetOneClick) sds).getByColumns()); } - final Collection aggs = aggSupplier.get(); - final Collection selectableCols = Selectable.from(cols); - final SelectColumn[] gbsColumns = SelectColumn.from(selectableCols); - final Function applyAggs = t -> t.aggBy(aggs, selectableCols); - return sds.transform(MemoizedOperationKey.aggBy(aggs, gbsColumns), applyAggs); + final Collection columnNames = ColumnName.from(cols); + final Function applyAggs = t -> t.aggBy(aggs, columnNames); + return sds.transform(MemoizedOperationKey.aggBy(aggs, columnNames), applyAggs); } private static SelectableDataSet getLastBySelectableDataSet(final SelectableDataSet sds, final String... columns) { diff --git a/Plot/src/main/java/io/deephaven/plot/util/PlotUtils.java b/Plot/src/main/java/io/deephaven/plot/util/PlotUtils.java index 1c8087afe2b..5b9c5172046 100644 --- a/Plot/src/main/java/io/deephaven/plot/util/PlotUtils.java +++ b/Plot/src/main/java/io/deephaven/plot/util/PlotUtils.java @@ -3,6 +3,7 @@ */ package io.deephaven.plot.util; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; import io.deephaven.base.verify.Require; @@ -722,7 +723,7 @@ public static Table createCategoryTable(final Table t, final String[] catColumns lastColumns.removeAll(Arrays.asList(catColumns)); final Table result = t.aggBy( createCategoryAggs(AggLast(lastColumns.toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY))), - Selectable.from(catColumns)); + ColumnName.from(catColumns)); // We must explicitly copy attributes because we are doing a modified manual first/lastBy which will not // automatically do the copy. @@ -731,7 +732,7 @@ public static Table createCategoryTable(final Table t, final String[] catColumns } public static Table createCategoryHistogramTable(final Table t, final String... byColumns) { - return t.aggBy(createCategoryAggs(AggCount(IntervalXYDataSeriesArray.COUNT)), Selectable.from(byColumns)); + return t.aggBy(createCategoryAggs(AggCount(IntervalXYDataSeriesArray.COUNT)), ColumnName.from(byColumns)); } diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index 0cf7aa0336e..6605df24864 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -144,7 +144,7 @@ public interface Table extends *
  • {@link #groupBy} is unsupported *
  • {@link #aggBy} is unsupported if {@link Aggregation#AggGroup(String...)} is used *
  • {@link #partitionBy} is unsupported
  • - *
  • {@link #rollup(Collection, boolean, Selectable...) rollup()} is unsupported if + *
  • {@link #rollup(Collection, boolean, ColumnName...) rollup()} is unsupported if * {@code includeConstituents == true}
  • *
  • {@link #treeTable(String, String) treeTable()} is unsupported
  • * @@ -965,7 +965,7 @@ Table join(Table rightTable, Collection columnsToMatch, @Override @ConcurrentMethod - Table groupBy(Collection groupByColumns); + Table groupBy(Collection groupByColumns); @Override @ConcurrentMethod @@ -985,7 +985,7 @@ Table join(Table rightTable, Collection columnsToMatch, @Override @ConcurrentMethod - Table aggAllBy(AggSpec spec, Selectable... groupByColumns); + Table aggAllBy(AggSpec spec, ColumnName... groupByColumns); @Override @ConcurrentMethod @@ -1001,11 +1001,11 @@ Table join(Table rightTable, Collection columnsToMatch, @Override @ConcurrentMethod - Table aggBy(Aggregation aggregation, Collection groupByColumns); + Table aggBy(Aggregation aggregation, Collection groupByColumns); @Override @ConcurrentMethod - Table aggBy(Collection aggregations, Collection groupByColumns); + Table aggBy(Collection aggregations, Collection groupByColumns); @Override @ConcurrentMethod @@ -1030,10 +1030,10 @@ Table join(Table rightTable, Collection columnsToMatch, * * @param formulaColumn Formula applied to each column * @param columnParamName The parameter name used as a placeholder for each column - * @param groupByColumns The grouping columns as in {@link Table#groupBy(Collection)} + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy(Collection)} */ @ConcurrentMethod - Table applyToAllBy(String formulaColumn, String columnParamName, Collection groupByColumns); + Table applyToAllBy(String formulaColumn, String columnParamName, Collection groupByColumns); /** * Groups data according to groupByColumns and applies formulaColumn to each of columns not altered by the grouping @@ -1041,10 +1041,10 @@ Table join(Table rightTable, Collection columnsToMatch, * * @param formulaColumn Formula applied to each column, uses parameter each to refer to each colum it being * applied to - * @param groupByColumns The grouping columns as in {@link Table#groupBy(Collection)} + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy(Collection)} */ @ConcurrentMethod - Table applyToAllBy(String formulaColumn, Collection groupByColumns); + Table applyToAllBy(String formulaColumn, Collection groupByColumns); /** * Groups data according to groupByColumns and applies formulaColumn to each of columns not altered by the grouping @@ -1064,7 +1064,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table sumBy(Selectable... groupByColumns); + Table sumBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the sum for the rest of the fields @@ -1101,7 +1101,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table absSumBy(Selectable... groupByColumns); + Table absSumBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the sum of the absolute values for @@ -1140,7 +1140,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table avgBy(Selectable... groupByColumns); + Table avgBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the average for the rest of the @@ -1180,7 +1180,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table wavgBy(String weightColumn, Selectable... groupByColumns); + Table wavgBy(String weightColumn, ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the weighted average using @@ -1228,7 +1228,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table wsumBy(String weightColumn, Selectable... groupByColumns); + Table wsumBy(String weightColumn, ColumnName... groupByColumns); /** * Computes the weighted sum for all rows in the table using weightColumn for the rest of the fields @@ -1275,7 +1275,7 @@ Table join(Table rightTable, Collection columnsToMatch, @Override @ConcurrentMethod - Table stdBy(Selectable... groupByColumns); + Table stdBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the standard deviation for the rest @@ -1314,7 +1314,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table varBy(Selectable... groupByColumns); + Table varBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the variance for the rest of the @@ -1352,7 +1352,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table lastBy(Selectable... groupByColumns); + Table lastBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields @@ -1387,7 +1387,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table firstBy(Selectable... groupByColumns); + Table firstBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and retrieves the first for the rest of the @@ -1423,7 +1423,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table minBy(Selectable... groupByColumns); + Table minBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the min for the rest of the fields @@ -1459,7 +1459,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table maxBy(Selectable... groupByColumns); + Table maxBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the max for the rest of the fields @@ -1496,7 +1496,7 @@ Table join(Table rightTable, Collection columnsToMatch, */ @Override @ConcurrentMethod - Table medianBy(Selectable... groupByColumns); + Table medianBy(ColumnName... groupByColumns); /** * Groups the data column according to groupByColumns and computes the median for the rest of the @@ -1528,7 +1528,7 @@ Table join(Table rightTable, Collection columnsToMatch, Table medianBy(); @ConcurrentMethod - Table countBy(String countColumnName, Selectable... groupByColumns); + Table countBy(String countColumnName, ColumnName... groupByColumns); @ConcurrentMethod Table countBy(String countColumnName, String... groupByColumns); @@ -1614,11 +1614,11 @@ Table join(Table rightTable, Collection columnsToMatch, * replaced with null on each level. * * @param aggregations The aggregations to perform - * @param columns the columns to group by + * @param groupByColumns the columns to group by * @return a hierarchical table with the rollup applied */ @ConcurrentMethod - Table rollup(Collection aggregations, Collection columns); + Table rollup(Collection aggregations, Collection groupByColumns); /** * Create a rollup table. @@ -1629,12 +1629,12 @@ Table join(Table rightTable, Collection columnsToMatch, * * @param aggregations The aggregations to perform * @param includeConstituents set to true to include the constituent rows at the leaf level - * @param columns the columns to group by + * @param groupByColumns the columns to group by * @return a hierarchical table with the rollup applied */ @ConcurrentMethod Table rollup(Collection aggregations, boolean includeConstituents, - Collection columns); + Collection groupByColumns); /** * Create a rollup table. @@ -1644,11 +1644,11 @@ Table rollup(Collection aggregations, boolean includeCons * replaced with null on each level. * * @param aggregations The aggregations to perform - * @param columns the columns to group by + * @param groupByColumns the columns to group by * @return a hierarchical table with the rollup applied */ @ConcurrentMethod - Table rollup(Collection aggregations, String... columns); + Table rollup(Collection aggregations, String... groupByColumns); /** * Create a rollup table. @@ -1658,12 +1658,12 @@ Table rollup(Collection aggregations, boolean includeCons * replaced with null on each level. * * @param aggregations The aggregations to perform - * @param columns the columns to group by + * @param groupByColumns the columns to group by * @param includeConstituents set to true to include the constituent rows at the leaf level * @return a hierarchical table with the rollup applied */ @ConcurrentMethod - Table rollup(Collection aggregations, boolean includeConstituents, String... columns); + Table rollup(Collection aggregations, boolean includeConstituents, String... groupByColumns); /** * Create a rollup table. @@ -1673,11 +1673,11 @@ Table rollup(Collection aggregations, boolean includeCons * replaced with null on each level. * * @param aggregations The aggregations to perform - * @param columns the columns to group by + * @param groupByColumns the columns to group by * @return a hierarchical table with the rollup applied */ @ConcurrentMethod - Table rollup(Collection aggregations, Selectable... columns); + Table rollup(Collection aggregations, ColumnName... groupByColumns); /** * Create a rollup table. @@ -1703,7 +1703,8 @@ Table rollup(Collection aggregations, boolean includeCons Table rollup(Collection aggregations, boolean includeConstituents); @ConcurrentMethod - Table rollup(Collection aggregations, boolean includeConstituents, Selectable... columns); + Table rollup(Collection aggregations, boolean includeConstituents, + ColumnName... groupByColumns); /** * Create a hierarchical tree table. @@ -1804,7 +1805,7 @@ Table updateBy(@NotNull final UpdateByControl control, */ @ConcurrentMethod Table updateBy(@NotNull Collection operations, - @NotNull Collection byColumns); + @NotNull Collection byColumns); /** * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The @@ -1821,7 +1822,7 @@ Table updateBy(@NotNull Collection operations, @ConcurrentMethod Table updateBy(@NotNull final UpdateByControl control, @NotNull final Collection operations, - @NotNull final Collection byColumns); + @NotNull final Collection byColumns); // ----------------------------------------------------------------------------------------------------------------- // Sort Operations diff --git a/engine/api/src/main/java/io/deephaven/engine/table/TableDefinition.java b/engine/api/src/main/java/io/deephaven/engine/table/TableDefinition.java index b55a9b1aece..584c09743a1 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/TableDefinition.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/TableDefinition.java @@ -4,6 +4,7 @@ package io.deephaven.engine.table; import io.deephaven.UncheckedDeephavenException; +import io.deephaven.api.ColumnName; import io.deephaven.base.cache.OpenAddressedCanonicalizationCache; import io.deephaven.base.log.LogOutput; import io.deephaven.base.log.LogOutputAppendable; @@ -236,6 +237,13 @@ public List getColumnNames() { return getColumnStream().map(ColumnDefinition::getName).collect(Collectors.toList()); } + /** + * @return The {@link ColumnName column names} as a list in the same order as {@link #getColumns()} + */ + public List getTypedColumnNames() { + return getColumnStream().map(ColumnDefinition::getName).map(ColumnName::of).collect(Collectors.toList()); + } + /** * @return The column names as an array in the same order as {@link #getColumns()} */ diff --git a/engine/benchmark/src/benchmark/java/io/deephaven/benchmark/engine/PercentileByBenchmark.java b/engine/benchmark/src/benchmark/java/io/deephaven/benchmark/engine/PercentileByBenchmark.java index 0b8305f662e..014ff852e53 100644 --- a/engine/benchmark/src/benchmark/java/io/deephaven/benchmark/engine/PercentileByBenchmark.java +++ b/engine/benchmark/src/benchmark/java/io/deephaven/benchmark/engine/PercentileByBenchmark.java @@ -3,13 +3,10 @@ */ package io.deephaven.benchmark.engine; -import io.deephaven.api.Selectable; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.table.impl.select.SelectColumnFactory; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.benchmarking.*; @@ -200,10 +197,9 @@ public Table percentileByStatic(@NotNull final Blackhole bh) { private Function getFunction() { final Function fut; if (percentileMode.equals("normal")) { - fut = t -> t.aggAllBy(AggSpec.percentile(0.99), SelectColumn.from(Selectable.from(keyColumnNames))); + fut = t -> t.aggAllBy(AggSpec.percentile(0.99), keyColumnNames); } else if (percentileMode.equals("tdigest")) { - fut = (t) -> t.aggAllBy(AggSpec.approximatePercentile(0.99, 100.0), - SelectColumnFactory.getExpressions(keyColumnNames)); + fut = (t) -> t.aggAllBy(AggSpec.approximatePercentile(0.99, 100.0), keyColumnNames); } else { throw new IllegalArgumentException("Bad mode: " + percentileMode); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java index 4b65cd37367..e39cb49326b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.filter.Filter; import io.deephaven.api.updateby.UpdateByOperation; @@ -220,8 +221,7 @@ protected Table doCoalesce() { } @Override - public Table selectDistinct(Collection selectables) { - final SelectColumn[] columns = SelectColumn.from(selectables); + public Table selectDistinct(Collection columns) { /* If the cachedResult table has already been created, we can just use that. */ if (getCoalesced() != null) { return coalesce().selectDistinct(columns); @@ -241,7 +241,7 @@ public Table selectDistinct(Collection selectables) { } /* If the cachedResult is not yet created, we first ask for a selectDistinct cachedResult. */ - Table selectDistinct = tableReference.selectDistinct(columns); + Table selectDistinct = tableReference.selectDistinctInternal(columns); return selectDistinct == null ? coalesce().selectDistinct(columns) : selectDistinct; } @@ -332,7 +332,7 @@ public TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { * @return null if the operation can not be performed on an uninstantiated table, otherwise a new table with the * distinct values from strColumns. */ - public Table selectDistinct(SelectColumn[] columns) { + public Table selectDistinctInternal(Collection columns) { return null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java index 86088985f42..67507196fc7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.JoinMatch; import io.deephaven.api.Selectable; import io.deephaven.api.SortColumn; @@ -160,7 +161,7 @@ public Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] colu } @Override - public Table countBy(String countColumnName, Selectable... groupByColumns) { + public Table countBy(String countColumnName, ColumnName... groupByColumns) { return throwUnsupported("countBy()"); } @@ -180,13 +181,13 @@ public Table tailPct(double percent) { } @Override - public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { return throwUnsupported("aggAllBy(" + spec + ")"); } @Override public Table aggBy(Collection aggregations, - Collection groupByColumns) { + Collection groupByColumns) { return throwUnsupported("aggBy()"); } @@ -252,7 +253,7 @@ public PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames) @Override public Table rollup(Collection aggregations, boolean includeConstituents, - Selectable... columns) { + ColumnName... groupByColumns) { return throwUnsupported("rollup()"); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java index 17731e06746..9260173b844 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.agg.Aggregation; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.MatchPair; @@ -99,26 +100,18 @@ public static MemoizedOperationKey treeTable(String idColumn, String parentColum } public static MemoizedOperationKey aggBy(Collection aggregations, - SelectColumn[] groupByColumns) { - if (!isMemoizable(groupByColumns)) { - return null; - } - return new AggBy(aggregations.toArray(new Aggregation[0]), groupByColumns); + Collection groupByColumns) { + return new AggBy(new ArrayList<>(aggregations), new ArrayList<>(groupByColumns)); } - public static MemoizedOperationKey partitionBy(boolean dropKeys, SelectColumn[] groupByColumns) { - if (!isMemoizable(groupByColumns)) { - return null; - } - return new PartitionBy(dropKeys, groupByColumns); + public static MemoizedOperationKey partitionBy(boolean dropKeys, Collection groupByColumns) { + return new PartitionBy(dropKeys, new ArrayList<>(groupByColumns)); } public static MemoizedOperationKey rollup(Collection aggregations, - SelectColumn[] groupByColumns, boolean includeConstituents) { - if (!isMemoizable(groupByColumns)) { - return null; - } - return new Rollup(aggregations.toArray(new Aggregation[0]), groupByColumns, includeConstituents); + Collection groupByColumns, boolean includeConstituents) { + return new Rollup(new AggBy(new ArrayList<>(aggregations), new ArrayList<>(groupByColumns)), + includeConstituents); } private static boolean isMemoizable(SelectColumn[] selectColumn) { @@ -341,29 +334,30 @@ public int hashCode() { private static class AggBy extends AttributeAgnosticMemoizedOperationKey { - private final Aggregation[] aggregations; - private final SelectColumn[] groupByColumns; + private final List aggregations; + private final List groupByColumns; - private AggBy(Aggregation[] aggregations, SelectColumn[] groupByColumns) { + private AggBy(List aggregations, List groupByColumns) { this.aggregations = aggregations; this.groupByColumns = groupByColumns; } @Override public boolean equals(Object o) { - if (this == o) + if (this == o) { return true; - if (o == null || getClass() != o.getClass()) + } + if (o == null || getClass() != o.getClass()) { return false; - final AggBy aggBy = (AggBy) o; - return Arrays.equals(aggregations, aggBy.aggregations) && - Arrays.equals(groupByColumns, aggBy.groupByColumns); + } + AggBy aggBy = (AggBy) o; + return aggregations.equals(aggBy.aggregations) && groupByColumns.equals(aggBy.groupByColumns); } @Override public int hashCode() { - int result = Arrays.hashCode(aggregations); - result = 31 * result + Arrays.hashCode(groupByColumns); + int result = aggregations.hashCode(); + result = 31 * result + groupByColumns.hashCode(); return result; } @@ -376,28 +370,29 @@ BaseTable.CopyAttributeOperation copyType() { static class PartitionBy extends MemoizedOperationKey { private final boolean dropKeys; - private final SelectColumn[] groupByColumns; + private final List groupByColumns; - private PartitionBy(boolean dropKeys, SelectColumn[] groupByColumns) { + private PartitionBy(boolean dropKeys, List groupByColumns) { this.dropKeys = dropKeys; this.groupByColumns = groupByColumns; } @Override public boolean equals(Object o) { - if (this == o) + if (this == o) { return true; - if (o == null || getClass() != o.getClass()) + } + if (o == null || getClass() != o.getClass()) { return false; - final PartitionBy partitionBy = (PartitionBy) o; - return dropKeys == partitionBy.dropKeys && - Arrays.equals(groupByColumns, partitionBy.groupByColumns); + } + PartitionBy that = (PartitionBy) o; + return dropKeys == that.dropKeys && groupByColumns.equals(that.groupByColumns); } @Override public int hashCode() { - int result = Boolean.hashCode(dropKeys); - result = 31 * result + Arrays.hashCode(groupByColumns); + int result = (dropKeys ? 1 : 0); + result = 31 * result + groupByColumns.hashCode(); return result; } } @@ -407,9 +402,9 @@ private static class Rollup extends AttributeAgnosticMemoizedOperationKey { private final AggBy aggBy; private final boolean includeConstituents; - Rollup(Aggregation[] aggregations, SelectColumn[] groupByColumns, boolean includeConstituents) { + Rollup(AggBy aggBy, boolean includeConstituents) { this.includeConstituents = includeConstituents; - this.aggBy = new AggBy(aggregations, groupByColumns); + this.aggBy = aggBy; } @Override @@ -419,12 +414,14 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (this == o) + if (this == o) { return true; - if (o == null || getClass() != o.getClass()) + } + if (o == null || getClass() != o.getClass()) { return false; + } final Rollup rollup = (Rollup) o; - return Objects.equals(aggBy, rollup.aggBy) && includeConstituents == rollup.includeConstituents; + return includeConstituents == rollup.includeConstituents && Objects.equals(aggBy, rollup.aggBy); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java index 684ba6f09cd..dbd8f606435 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.filter.Filter; import io.deephaven.base.verify.Assert; @@ -148,7 +149,8 @@ public TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { } @Override - public Table selectDistinct(SelectColumn[] selectColumns) { + public Table selectDistinctInternal(Collection columns) { + final SelectColumn[] selectColumns = SelectColumn.from(columns); for (final SelectColumn selectColumn : selectColumns) { try { selectColumn.initDef(getDefinition().getColumnNameMap()); @@ -160,7 +162,6 @@ public Table selectDistinct(SelectColumn[] selectColumns) { return null; } } - return table.selectDistinct(selectColumns); } } @@ -317,8 +318,8 @@ public final Table where(final Collection filters) { } @Override - public final Table selectDistinct(Collection groupByColumns) { - final SelectColumn[] selectColumns = SelectColumn.from(groupByColumns); + public final Table selectDistinct(Collection columns) { + final SelectColumn[] selectColumns = SelectColumn.from(columns); for (SelectColumn selectColumn : selectColumns) { selectColumn.initDef(definition.getColumnNameMap()); if (!isValidAgainstColumnPartitionTable(selectColumn.getColumns(), selectColumn.getColumnArrays())) { @@ -355,4 +356,8 @@ private boolean isValidAgainstColumnPartitionTable(@NotNull final List c } return columnNames.stream().allMatch(partitioningColumnDefinitions::containsKey); } + + private boolean isValidAgainstColumnPartitionTable(Collection columns) { + return columns.stream().map(ColumnName::name).allMatch(partitioningColumnDefinitions::containsKey); + } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index 83406471d7f..43645615a35 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -460,10 +460,9 @@ public PartitionedTable partitionBy(final boolean dropKeys, final String... keyC if (isStream()) { throw streamUnsupported("partitionBy"); } - final SelectColumn[] groupByColumns = - Arrays.stream(keyColumnNames).map(SourceColumn::new).toArray(SelectColumn[]::new); - return memoizeResult(MemoizedOperationKey.partitionBy(dropKeys, groupByColumns), () -> { - final Table partitioned = aggBy(Partition.of(CONSTITUENT, !dropKeys), Arrays.asList(groupByColumns)); + final List columns = ColumnName.from(keyColumnNames); + return memoizeResult(MemoizedOperationKey.partitionBy(dropKeys, columns), () -> { + final Table partitioned = aggBy(Partition.of(CONSTITUENT, !dropKeys), columns); final Set keyColumnNamesSet = Arrays.stream(keyColumnNames).collect(Collectors.toCollection(LinkedHashSet::new)); final TableDefinition constituentDefinition; @@ -480,7 +479,7 @@ public PartitionedTable partitionBy(final boolean dropKeys, final String... keyC @Override public Table rollup(Collection aggregations, boolean includeConstituents, - Selectable... groupByColumns) { + ColumnName... groupByColumns) { throw new UnsupportedOperationException("rollup is not yet implemented in community"); // TODO https://github.com/deephaven/deephaven-core/issues/65): Implement rollups based on PartitionedTable /* @@ -589,7 +588,7 @@ private static String toString(Collection groupByList) { } @Override - public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { for (ColumnName name : AggSpecColumnReferences.of(spec)) { if (!hasColumns(name.name())) { throw new IllegalArgumentException( @@ -597,7 +596,7 @@ public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { + toString(Arrays.asList(groupByColumns))); } } - final List groupByList = Arrays.asList(groupByColumns); + final List groupByList = Arrays.asList(groupByColumns); final List tableColumns = definition.getColumnNames().stream().map(ColumnName::of).collect(Collectors.toList()); final Optional agg = AggregateAllByTable.singleAggregation(spec, groupByList, tableColumns); @@ -607,10 +606,9 @@ public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { } final QueryTable tableToUse = (QueryTable) AggAllByUseTable.of(this, spec); final List aggs = List.of(agg.get()); - final SelectColumn[] gbsColumns = SelectColumn.from(groupByColumns); - final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(aggs, gbsColumns); + final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(aggs, groupByList); return tableToUse.memoizeResult(aggKey, () -> { - final QueryTable result = tableToUse.aggNoMemo(AggregationProcessor.forAggregation(aggs), gbsColumns); + final QueryTable result = tableToUse.aggNoMemo(AggregationProcessor.forAggregation(aggs), groupByList); spec.walk(new AggAllByCopyAttributes(this, result)); return result; }); @@ -619,7 +617,7 @@ public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { @Override public Table aggBy( final Collection aggregations, - final Collection groupByColumns) { + final Collection groupByColumns) { if (aggregations.isEmpty()) { throw new IllegalArgumentException( "aggBy must have at least one aggregation, none specified. groupByColumns=" @@ -627,10 +625,9 @@ public Table aggBy( } final List optimized = AggregationOptimizer.of(aggregations); - final SelectColumn[] gbsColumns = SelectColumn.from(groupByColumns); - final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(optimized, gbsColumns); + final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(optimized, groupByColumns); final Table aggregationTable = - memoizeResult(aggKey, () -> aggNoMemo(AggregationProcessor.forAggregation(optimized), gbsColumns)); + memoizeResult(aggKey, () -> aggNoMemo(AggregationProcessor.forAggregation(optimized), groupByColumns)); final List optimizedOrder = AggregationPairs.outputsOf(optimized).collect(Collectors.toList()); final List userOrder = AggregationPairs.outputsOf(aggregations).collect(Collectors.toList()); @@ -640,22 +637,21 @@ public Table aggBy( // We need to re-order the result columns to match the user-provided order final List resultOrder = - Stream.concat(groupByColumns.stream().map(Selectable::newColumn), userOrder.stream()) - .collect(Collectors.toList()); + Stream.concat(groupByColumns.stream(), userOrder.stream()).collect(Collectors.toList()); return aggregationTable.view(resultOrder); } @Override - public Table countBy(String countColumnName, Selectable... groupByColumns) { + public Table countBy(String countColumnName, ColumnName... groupByColumns) { return QueryPerformanceRecorder.withNugget( "countBy(" + countColumnName + "," + Arrays.toString(groupByColumns) + ")", sizeForInstrumentation(), () -> aggBy(Aggregation.AggCount(countColumnName), Arrays.asList(groupByColumns))); } private QueryTable aggNoMemo(@NotNull final AggregationContextFactory aggregationContextFactory, - @NotNull final SelectColumn... groupByColumns) { + @NotNull final Collection groupByColumns) { final String description = "aggregation(" + aggregationContextFactory - + ", " + Arrays.toString(groupByColumns) + ")"; + + ", " + groupByColumns + ")"; return QueryPerformanceRecorder.withNugget(description, sizeForInstrumentation(), () -> ChunkedOperatorAggregationHelper.aggregation(aggregationContextFactory, this, groupByColumns)); } @@ -2858,13 +2854,18 @@ private RowSetBuilderRandom getUngroupIndex( } @Override - public Table selectDistinct(Collection groupByColumns) { - return QueryPerformanceRecorder.withNugget("selectDistinct(" + groupByColumns + ")", + public Table selectDistinct(Collection columns) { + return QueryPerformanceRecorder.withNugget("selectDistinct(" + columns + ")", sizeForInstrumentation(), () -> { - final SelectColumn[] gbsColumns = SelectColumn.from(groupByColumns); - final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(Collections.emptyList(), gbsColumns); - return memoizeResult(aggKey, () -> aggNoMemo(AggregationProcessor.forSelectDistinct(), gbsColumns)); + final Collection columnNames = ColumnName.cast(columns).orElse(null); + if (columnNames == null) { + return view(columns).selectDistinct(); + } + final MemoizedOperationKey aggKey = + MemoizedOperationKey.aggBy(Collections.emptyList(), columnNames); + return memoizeResult(aggKey, + () -> aggNoMemo(AggregationProcessor.forSelectDistinct(), columnNames)); }); } @@ -3018,7 +3019,7 @@ public R memoizeResult(MemoizedOperationKey memoKey, Supplier operation) @Override public Table updateBy(@NotNull final UpdateByControl control, @NotNull final Collection ops, - @NotNull final Collection byColumns) { + @NotNull final Collection byColumns) { return QueryPerformanceRecorder.withNugget("updateBy()", sizeForInstrumentation(), () -> UpdateBy.updateBy(this, ops, byColumns, control)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/RollupInfo.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/RollupInfo.java index c59015bc2f0..bbecf6e48f4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/RollupInfo.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/RollupInfo.java @@ -3,10 +3,10 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.AggregationPairs; import io.deephaven.engine.table.MatchPair; -import io.deephaven.engine.table.impl.select.SelectColumn; import java.util.*; import java.util.stream.Collectors; @@ -20,7 +20,7 @@ public class RollupInfo extends AbstractHierarchicalTableInfo { public final Set byColumnNames; public final transient Collection aggregations; - public final transient SelectColumn[] selectColumns; + public final transient Collection groupByColumns; /** * The type of leaf nodes the rollup has. @@ -36,20 +36,21 @@ public enum LeafType { Constituent } - public RollupInfo(Collection aggregations, SelectColumn[] selectColumns, LeafType leafType) { - this(aggregations, selectColumns, leafType, null); + public RollupInfo(Collection aggregations, Collection groupByColumns, + LeafType leafType) { + this(aggregations, groupByColumns, leafType, null); } - public RollupInfo(Collection aggregations, SelectColumn[] selectColumns, LeafType leafType, + public RollupInfo(Collection aggregations, Collection groupByColumns, + LeafType leafType, String[] columnFormats) { super(columnFormats); this.aggregations = aggregations; - this.selectColumns = selectColumns; + this.groupByColumns = groupByColumns; this.matchPairs = AggregationPairs.of(aggregations).map(MatchPair::of).collect(Collectors.toList()); this.leafType = leafType; - - final Set tempSet = Arrays.stream(selectColumns).map(SelectColumn::getName) - .collect(Collectors.toCollection(LinkedHashSet::new)); + final Set tempSet = + groupByColumns.stream().map(ColumnName::name).collect(Collectors.toCollection(LinkedHashSet::new)); this.byColumnNames = Collections.unmodifiableSet(tempSet); } @@ -58,12 +59,8 @@ public RollupInfo(Collection aggregations, SelectColumn[] * * @return a copy of selectColumns */ - public SelectColumn[] getSelectColumns() { - final SelectColumn[] copiedColumns = new SelectColumn[selectColumns.length]; - for (int ii = 0; ii < selectColumns.length; ++ii) { - copiedColumns[ii] = selectColumns[ii].copy(); - } - return copiedColumns; + public ColumnName[] getGroupByColumns() { + return groupByColumns.toArray(ColumnName[]::new); } /** @@ -80,7 +77,7 @@ public String getHierarchicalColumnName() { @Override public HierarchicalTableInfo withColumnFormats(String[] columnFormats) { - return new RollupInfo(aggregations, selectColumns, leafType, columnFormats); + return new RollupInfo(aggregations, groupByColumns, leafType, columnFormats); } public LeafType getLeafType() { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java index d7c0924d6b6..b06b38a17ac 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleSourceTable.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.table.Table; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java index cde9c0d8713..dc0bbe6784f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java @@ -31,7 +31,6 @@ import java.util.function.Function; import java.util.function.UnaryOperator; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * Sub-interface to capture default methods rom {@link Table}. @@ -40,7 +39,7 @@ public interface TableWithDefaults extends Table { Table[] ZERO_LENGTH_TABLE_ARRAY = new Table[0]; Filter[] ZERO_LENGTH_FILTER_ARRAY = new Filter[0]; - Selectable[] ZERO_LENGTH_SELECTABLE_ARRAY = new Selectable[0]; + ColumnName[] ZERO_LENGTH_COLUMNNAME_ARRAY = new ColumnName[0]; @Override default Table coalesce() { @@ -623,14 +622,14 @@ default Table join(Table rightTable, Collection columnsToMa @Override @ConcurrentMethod - default Table groupBy(Collection groupByColumns) { - return aggAllBy(AggSpec.group(), groupByColumns.toArray(Selectable[]::new)); + default Table groupBy(Collection groupByColumns) { + return aggAllBy(AggSpec.group(), groupByColumns.toArray(ColumnName[]::new)); } @Override @ConcurrentMethod default Table groupBy(String... groupByColumns) { - return groupBy(Selectable.from(groupByColumns)); + return groupBy(ColumnName.from(groupByColumns)); } @Override @@ -654,7 +653,7 @@ default Table aggAllBy(AggSpec spec, String... groupByColumns) { @Override @ConcurrentMethod default Table aggAllBy(AggSpec spec, Collection groupByColumns) { - return aggAllBy(spec, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return aggAllBy(spec, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @@ -671,14 +670,14 @@ default Table aggBy(Aggregation aggregation, String... groupByColumns) { @Override @ConcurrentMethod - default Table aggBy(Aggregation aggregation, Collection groupByColumns) { + default Table aggBy(Aggregation aggregation, Collection groupByColumns) { return aggBy(List.of(aggregation), groupByColumns); } @Override @ConcurrentMethod default Table aggBy(Collection aggregations, String... groupByColumns) { - return aggBy(aggregations, Stream.of(groupByColumns).map(Selectable::parse).collect(Collectors.toList())); + return aggBy(aggregations, ColumnName.from(groupByColumns)); } @Override @@ -699,326 +698,326 @@ default Table tailBy(long nRows, Collection groupByColumnNames) { @Override default Table applyToAllBy(String formulaColumn, String columnParamName, - Collection groupByColumns) { - return aggAllBy(AggSpec.formula(formulaColumn, columnParamName), groupByColumns.toArray(Selectable[]::new)); + Collection groupByColumns) { + return aggAllBy(AggSpec.formula(formulaColumn, columnParamName), groupByColumns.toArray(ColumnName[]::new)); } @Override @ConcurrentMethod - default Table applyToAllBy(String formulaColumn, Collection groupByColumns) { + default Table applyToAllBy(String formulaColumn, Collection groupByColumns) { return applyToAllBy(formulaColumn, "each", groupByColumns); } @Override @ConcurrentMethod default Table applyToAllBy(String formulaColumn, String... groupByColumns) { - return applyToAllBy(formulaColumn, Selectable.from(groupByColumns)); + return applyToAllBy(formulaColumn, ColumnName.from(groupByColumns)); } @Override @ConcurrentMethod - default Table sumBy(Selectable... groupByColumns) { + default Table sumBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.sum(), groupByColumns); } @Override @ConcurrentMethod default Table sumBy(String... groupByColumns) { - return sumBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table sumBy(Collection groupByColumns) { - return sumBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table sumBy() { - return sumBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return sumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table absSumBy(Selectable... groupByColumns) { + default Table absSumBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.absSum(), groupByColumns); } @Override @ConcurrentMethod default Table absSumBy(String... groupByColumns) { - return absSumBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table absSumBy(Collection groupByColumns) { - return absSumBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table absSumBy() { - return absSumBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return absSumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table avgBy(Selectable... groupByColumns) { + default Table avgBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.avg(), groupByColumns); } @Override @ConcurrentMethod default Table avgBy(String... groupByColumns) { - return avgBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table avgBy(Collection groupByColumns) { - return avgBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table avgBy() { - return avgBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return avgBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table wavgBy(String weightColumn, Selectable... groupByColumns) { + default Table wavgBy(String weightColumn, ColumnName... groupByColumns) { return aggAllBy(AggSpec.wavg(weightColumn), groupByColumns); } @Override @ConcurrentMethod default Table wavgBy(String weightColumn, String... groupByColumns) { - return wavgBy(weightColumn, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table wavgBy(String weightColumn, Collection groupByColumns) { - return wavgBy(weightColumn, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table wavgBy(String weightColumn) { - return wavgBy(weightColumn, ZERO_LENGTH_SELECTABLE_ARRAY); + return wavgBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table wsumBy(String weightColumn, Selectable... groupByColumns) { + default Table wsumBy(String weightColumn, ColumnName... groupByColumns) { return aggAllBy(AggSpec.wsum(weightColumn), groupByColumns); } @Override @ConcurrentMethod default Table wsumBy(String weightColumn) { - return wsumBy(weightColumn, ZERO_LENGTH_SELECTABLE_ARRAY); + return wsumBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod default Table wsumBy(String weightColumn, String... groupByColumns) { - return wsumBy(weightColumn, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table wsumBy(String weightColumn, Collection groupByColumns) { - return wsumBy(weightColumn, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod - default Table stdBy(Selectable... groupByColumns) { + default Table stdBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.std(), groupByColumns); } @Override @ConcurrentMethod default Table stdBy(String... groupByColumns) { - return stdBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table stdBy(Collection groupByColumns) { - return stdBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table stdBy() { - return stdBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return stdBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table varBy(Selectable... groupByColumns) { + default Table varBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.var(), groupByColumns); } @Override @ConcurrentMethod default Table varBy(String... groupByColumns) { - return varBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table varBy(Collection groupByColumns) { - return varBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table varBy() { - return varBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return varBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table lastBy(Selectable... groupByColumns) { + default Table lastBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.last(), groupByColumns); } @Override @ConcurrentMethod default Table lastBy(String... groupByColumns) { - return lastBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table lastBy(Collection groupByColumns) { - return lastBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table lastBy() { - return lastBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return lastBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table firstBy(Selectable... groupByColumns) { + default Table firstBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.first(), groupByColumns); } @Override @ConcurrentMethod default Table firstBy(String... groupByColumns) { - return firstBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table firstBy(Collection groupByColumns) { - return firstBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table firstBy() { - return firstBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return firstBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table minBy(Selectable... groupByColumns) { + default Table minBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.min(), groupByColumns); } @Override @ConcurrentMethod default Table minBy(String... groupByColumns) { - return minBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table minBy(Collection groupByColumns) { - return minBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table minBy() { - return minBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return minBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table maxBy(Selectable... groupByColumns) { + default Table maxBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.max(), groupByColumns); } @Override @ConcurrentMethod default Table maxBy(String... groupByColumns) { - return maxBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table maxBy(Collection groupByColumns) { - return maxBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table maxBy() { - return maxBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return maxBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod - default Table medianBy(Selectable... groupByColumns) { + default Table medianBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.median(), groupByColumns); } @Override @ConcurrentMethod default Table medianBy(String... groupByColumns) { - return medianBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table medianBy(Collection groupByColumns) { - return medianBy(Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table medianBy() { - return medianBy(ZERO_LENGTH_SELECTABLE_ARRAY); + return medianBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod default Table countBy(String countColumnName, String... groupByColumns) { - return countBy(countColumnName, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table countBy(String countColumnName, Collection groupByColumns) { - return countBy(countColumnName, Selectable.from(groupByColumns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table countBy(String countColumnName) { - return countBy(countColumnName, ZERO_LENGTH_SELECTABLE_ARRAY); + return countBy(countColumnName, ZERO_LENGTH_COLUMNNAME_ARRAY); } // ----------------------------------------------------------------------------------------------------------------- @@ -1070,48 +1069,48 @@ default PartitionedTable partitionBy(String... keyColumnNames) { @Override @ConcurrentMethod - default Table rollup(Collection aggregations, Collection columns) { - return rollup(aggregations, Selectable.from(columns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + default Table rollup(Collection aggregations, Collection groupByColumns) { + return rollup(aggregations, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table rollup(Collection aggregations, boolean includeConstituents, - Collection columns) { + Collection groupByColumns) { return rollup(aggregations, includeConstituents, - Selectable.from(columns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod - default Table rollup(Collection aggregations, String... columns) { - return rollup(aggregations, Selectable.from(columns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + default Table rollup(Collection aggregations, String... groupByColumns) { + return rollup(aggregations, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod default Table rollup(Collection aggregations, boolean includeConstituents, - String... columns) { + String... groupByColumns) { return rollup(aggregations, includeConstituents, - Selectable.from(columns).toArray(ZERO_LENGTH_SELECTABLE_ARRAY)); + ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod - default Table rollup(Collection aggregations, Selectable... columns) { - return rollup(aggregations, false, columns); + default Table rollup(Collection aggregations, ColumnName... groupByColumns) { + return rollup(aggregations, false, groupByColumns); } @Override @ConcurrentMethod default Table rollup(Collection aggregations) { - return rollup(aggregations, false, ZERO_LENGTH_SELECTABLE_ARRAY); + return rollup(aggregations, false, ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod default Table rollup(Collection aggregations, boolean includeConstituents) { - return rollup(aggregations, includeConstituents, ZERO_LENGTH_SELECTABLE_ARRAY); + return rollup(aggregations, includeConstituents, ZERO_LENGTH_COLUMNNAME_ARRAY); } @@ -1127,14 +1126,14 @@ default Table updateBy(@NotNull final UpdateByControl control, @ConcurrentMethod default Table updateBy(@NotNull Collection operations, - @NotNull Collection byColumns) { + @NotNull Collection byColumns) { return updateBy(UpdateByControl.defaultInstance(), operations, byColumns); } @ConcurrentMethod default Table updateBy(@NotNull final Collection operations, final String... byColumns) { - return updateBy(UpdateByControl.defaultInstance(), operations, Selectable.from(byColumns)); + return updateBy(UpdateByControl.defaultInstance(), operations, ColumnName.from(byColumns)); } @ConcurrentMethod @@ -1145,7 +1144,7 @@ default Table updateBy(@NotNull final Collection op @ConcurrentMethod default Table updateBy(@NotNull final UpdateByOperation operation, final String... byColumns) { return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), - Selectable.from(byColumns)); + ColumnName.from(byColumns)); } @ConcurrentMethod diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java index e1b41d511bc..56663b5b2b8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl; +import io.deephaven.api.ColumnName; import io.deephaven.api.JoinMatch; import io.deephaven.api.Selectable; import io.deephaven.api.SortColumn; @@ -344,20 +345,20 @@ public Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] colu @Override @ConcurrentMethod - public Table groupBy(Collection groupByColumns) { + public Table groupBy(Collection groupByColumns) { return coalesce().groupBy(groupByColumns); } @Override @ConcurrentMethod - public Table aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { return coalesce().aggAllBy(spec, groupByColumns); } @Override @ConcurrentMethod public Table aggBy(Collection aggregations, - Collection groupByColumns) { + Collection groupByColumns) { return coalesce().aggBy(aggregations, groupByColumns); } @@ -374,85 +375,85 @@ public Table tailBy(long nRows, String... groupByColumnNames) { @Override @ConcurrentMethod public Table applyToAllBy(String formulaColumn, String columnParamName, - Collection groupByColumns) { + Collection groupByColumns) { return coalesce().applyToAllBy(formulaColumn, columnParamName, groupByColumns); } @Override @ConcurrentMethod - public Table sumBy(Selectable... groupByColumns) { + public Table sumBy(ColumnName... groupByColumns) { return coalesce().sumBy(groupByColumns); } @Override @ConcurrentMethod - public Table absSumBy(Selectable... groupByColumns) { + public Table absSumBy(ColumnName... groupByColumns) { return coalesce().absSumBy(groupByColumns); } @Override @ConcurrentMethod - public Table avgBy(Selectable... groupByColumns) { + public Table avgBy(ColumnName... groupByColumns) { return coalesce().avgBy(groupByColumns); } @Override @ConcurrentMethod - public Table wavgBy(String weightColumn, Selectable... groupByColumns) { + public Table wavgBy(String weightColumn, ColumnName... groupByColumns) { return coalesce().wavgBy(weightColumn, groupByColumns); } @Override @ConcurrentMethod - public Table wsumBy(String weightColumn, Selectable... groupByColumns) { + public Table wsumBy(String weightColumn, ColumnName... groupByColumns) { return coalesce().wsumBy(weightColumn, groupByColumns); } @Override @ConcurrentMethod - public Table stdBy(Selectable... groupByColumns) { + public Table stdBy(ColumnName... groupByColumns) { return coalesce().stdBy(groupByColumns); } @Override @ConcurrentMethod - public Table varBy(Selectable... groupByColumns) { + public Table varBy(ColumnName... groupByColumns) { return coalesce().varBy(groupByColumns); } @Override @ConcurrentMethod - public Table lastBy(Selectable... groupByColumns) { + public Table lastBy(ColumnName... groupByColumns) { return coalesce().lastBy(groupByColumns); } @Override @ConcurrentMethod - public Table firstBy(Selectable... groupByColumns) { + public Table firstBy(ColumnName... groupByColumns) { return coalesce().firstBy(groupByColumns); } @Override @ConcurrentMethod - public Table minBy(Selectable... groupByColumns) { + public Table minBy(ColumnName... groupByColumns) { return coalesce().minBy(groupByColumns); } @Override @ConcurrentMethod - public Table maxBy(Selectable... groupByColumns) { + public Table maxBy(ColumnName... groupByColumns) { return coalesce().maxBy(groupByColumns); } @Override @ConcurrentMethod - public Table medianBy(Selectable... groupByColumns) { + public Table medianBy(ColumnName... groupByColumns) { return coalesce().medianBy(groupByColumns); } @Override @ConcurrentMethod - public Table countBy(String countColumnName, Selectable... groupByColumns) { + public Table countBy(String countColumnName, ColumnName... groupByColumns) { return coalesce().countBy(countColumnName, groupByColumns); } @@ -470,8 +471,8 @@ public PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames) @Override @ConcurrentMethod public Table rollup(Collection aggregations, boolean includeConstituents, - Selectable... columns) { - return coalesce().rollup(aggregations, includeConstituents, columns); + ColumnName... groupByColumns) { + return coalesce().rollup(aggregations, includeConstituents, groupByColumns); } @Override @@ -484,7 +485,7 @@ public Table treeTable(String idColumn, String parentColumn) { @ConcurrentMethod public Table updateBy(@NotNull final UpdateByControl control, @NotNull final Collection ops, - @NotNull final Collection byColumns) { + @NotNull final Collection byColumns) { return UpdateBy.updateBy((QueryTable) this.coalesce(), ops, byColumns, control); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java index d26522cb486..7a92f970842 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java @@ -1,6 +1,7 @@ package io.deephaven.engine.table.impl; import gnu.trove.map.hash.TObjectIntHashMap; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.Strings; import io.deephaven.api.updateby.UpdateByOperation; @@ -83,7 +84,7 @@ protected UpdateBy(@NotNull final UpdateByOperator[] operators, */ public static Table updateBy(@NotNull final QueryTable source, @NotNull final Collection clauses, - @NotNull final Collection byColumns, + @NotNull final Collection byColumns, @NotNull final UpdateByControl control) { WritableRowRedirection rowRedirection = null; @@ -109,10 +110,9 @@ public static Table updateBy(@NotNull final QueryTable source, } } + // TODO(deephaven-core#2693): Improve UpdateBy implementation for ColumnName // generate a MatchPair array for use by the existing algorithm - MatchPair[] pairs = byColumns.stream() - .map(s -> new MatchPair(s.newColumn().name(), Strings.of(s.expression()))) - .toArray(MatchPair[]::new); + MatchPair[] pairs = MatchPair.fromPairs(byColumns); final UpdateByOperatorFactory updateByOperatorFactory = new UpdateByOperatorFactory(source, pairs, rowRedirection, control); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ApproximatePercentile.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ApproximatePercentile.java index 2177a96838a..af4beca93e1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ApproximatePercentile.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ApproximatePercentile.java @@ -4,10 +4,10 @@ package io.deephaven.engine.table.impl.by; import com.tdunning.math.stats.TDigest; +import io.deephaven.api.ColumnName; import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpecApproximatePercentile; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.vector.ObjectVector; /** @@ -98,7 +98,7 @@ public static Table approximatePercentileBy(Table input, double percentile, Stri * @return a with the groupByColumns and double columns representing the approximate percentile for each remaining * column of the input table */ - public static Table approximatePercentileBy(Table input, double percentile, SelectColumn... groupByColumns) { + public static Table approximatePercentileBy(Table input, double percentile, ColumnName... groupByColumns) { return input.aggAllBy(AggSpecApproximatePercentile.of(percentile), groupByColumns); } @@ -113,7 +113,7 @@ public static Table approximatePercentileBy(Table input, double percentile, Sele * column of the input table */ public static Table approximatePercentileBy(Table input, double compression, double percentile, - SelectColumn... groupByColumns) { + ColumnName... groupByColumns) { return input.aggAllBy(AggSpecApproximatePercentile.of(percentile, compression), groupByColumns); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java index f7138757632..63b16cc1984 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl.by; +import io.deephaven.api.ColumnName; import io.deephaven.base.Pair; import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.Require; @@ -26,7 +27,6 @@ import io.deephaven.util.BooleanUtils; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.table.impl.TableUpdateImpl; -import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.sort.findruns.IntFindRunsKernel; import io.deephaven.engine.table.impl.sort.permute.LongPermuteKernel; import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; @@ -71,30 +71,21 @@ public class ChunkedOperatorAggregationHelper { true); public static QueryTable aggregation(AggregationContextFactory aggregationContextFactory, QueryTable queryTable, - SelectColumn[] groupByColumns) { + Collection groupByColumns) { return aggregation(AggregationControl.DEFAULT_FOR_OPERATOR, aggregationContextFactory, queryTable, groupByColumns); } @VisibleForTesting public static QueryTable aggregation(AggregationControl control, - AggregationContextFactory aggregationContextFactory, QueryTable queryTable, SelectColumn[] groupByColumns) { - final boolean viewRequired = groupByColumns.length > 0 - && Arrays.stream(groupByColumns).anyMatch(selectColumn -> !selectColumn.isRetain()); - final QueryTable withView = !viewRequired ? queryTable : (QueryTable) queryTable.updateView(groupByColumns); - - if (queryTable.hasAttribute(Table.REVERSE_LOOKUP_ATTRIBUTE)) { - withView.setAttribute(Table.REVERSE_LOOKUP_ATTRIBUTE, - queryTable.getAttribute(Table.REVERSE_LOOKUP_ATTRIBUTE)); - } - + AggregationContextFactory aggregationContextFactory, QueryTable queryTable, + Collection groupByColumns) { final Mutable resultHolder = new MutableObject<>(); - final SwapListener swapListener = - withView.createSwapListenerIfRefreshing(SwapListener::new); + final SwapListener swapListener = queryTable.createSwapListenerIfRefreshing(SwapListener::new); BaseTable.initializeWithSnapshot( - "by(" + aggregationContextFactory + ", " + Arrays.toString(groupByColumns) + ")", swapListener, + "by(" + aggregationContextFactory + ", " + groupByColumns + ")", swapListener, (usePrev, beforeClockValue) -> { - resultHolder.setValue(aggregation(control, swapListener, aggregationContextFactory, withView, + resultHolder.setValue(aggregation(control, swapListener, aggregationContextFactory, queryTable, groupByColumns, usePrev)); return true; }); @@ -102,13 +93,14 @@ public static QueryTable aggregation(AggregationControl control, } private static QueryTable aggregation(AggregationControl control, SwapListener swapListener, - AggregationContextFactory aggregationContextFactory, QueryTable withView, SelectColumn[] groupByColumns, + AggregationContextFactory aggregationContextFactory, QueryTable withView, + Collection groupByColumns, boolean usePrev) { - if (groupByColumns.length == 0) { + if (groupByColumns.isEmpty()) { return noKeyAggregation(swapListener, aggregationContextFactory, withView, usePrev); } - final String[] keyNames = Arrays.stream(groupByColumns).map(SelectColumn::getName).toArray(String[]::new); + final String[] keyNames = groupByColumns.stream().map(ColumnName::name).toArray(String[]::new); final ColumnSource[] keySources = Arrays.stream(keyNames).map(withView::getColumnSource).toArray(ColumnSource[]::new); final ColumnSource[] reinterpretedKeySources = Arrays.stream(keySources) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 01bc079b000..3fa6e360c8e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -609,7 +609,7 @@ public PartitionedTable.Proxy groupBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy groupBy(Collection groupByColumns) { + public PartitionedTable.Proxy groupBy(Collection groupByColumns) { return basicTransform(ct -> ct.groupBy(groupByColumns)); } @@ -624,7 +624,7 @@ public PartitionedTable.Proxy aggAllBy(AggSpec spec, String... groupByColumns) { } @Override - public PartitionedTable.Proxy aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public PartitionedTable.Proxy aggAllBy(AggSpec spec, ColumnName... groupByColumns) { return basicTransform(ct -> ct.aggAllBy(spec, groupByColumns)); } @@ -644,7 +644,7 @@ public PartitionedTable.Proxy aggBy(Aggregation aggregation, String... groupByCo } @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation, Collection groupByColumns) { + public PartitionedTable.Proxy aggBy(Aggregation aggregation, Collection groupByColumns) { return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); } @@ -660,7 +660,7 @@ public PartitionedTable.Proxy aggBy(Collection aggregatio @Override public PartitionedTable.Proxy aggBy(Collection aggregations, - Collection groupByColumns) { + Collection groupByColumns) { return basicTransform(ct -> ct.aggBy(aggregations, groupByColumns)); } @@ -686,7 +686,7 @@ public PartitionedTable.Proxy updateBy(Collection o @Override public PartitionedTable.Proxy updateBy(Collection operations, - Collection byColumns) { + Collection byColumns) { return basicTransform(ct -> ct.updateBy(operations, byColumns)); } @@ -698,7 +698,7 @@ public PartitionedTable.Proxy updateBy(UpdateByControl control, @Override public PartitionedTable.Proxy updateBy(UpdateByControl control, Collection operations, - Collection byColumns) { + Collection byColumns) { return basicTransform(ct -> ct.updateBy(control, operations, byColumns)); } @@ -708,18 +708,18 @@ public PartitionedTable.Proxy selectDistinct() { } @Override - public PartitionedTable.Proxy selectDistinct(String... groupByColumns) { - return basicTransform(ct -> ct.selectDistinct(groupByColumns)); + public PartitionedTable.Proxy selectDistinct(String... columns) { + return basicTransform(ct -> ct.selectDistinct(columns)); } @Override - public PartitionedTable.Proxy selectDistinct(Selectable... groupByColumns) { - return basicTransform(ct -> ct.selectDistinct(groupByColumns)); + public PartitionedTable.Proxy selectDistinct(Selectable... columns) { + return basicTransform(ct -> ct.selectDistinct(columns)); } @Override - public PartitionedTable.Proxy selectDistinct(Collection groupByColumns) { - return basicTransform(ct -> ct.selectDistinct(groupByColumns)); + public PartitionedTable.Proxy selectDistinct(Collection columns) { + return basicTransform(ct -> ct.selectDistinct(columns)); } @Override @@ -733,7 +733,7 @@ public PartitionedTable.Proxy countBy(String countColumnName, String... groupByC } @Override - public PartitionedTable.Proxy countBy(String countColumnName, Selectable... groupByColumns) { + public PartitionedTable.Proxy countBy(String countColumnName, ColumnName... groupByColumns) { return basicTransform(ct -> ct.countBy(countColumnName, groupByColumns)); } @@ -753,7 +753,7 @@ public PartitionedTable.Proxy firstBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy firstBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy firstBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.firstBy(groupByColumns)); } @@ -773,7 +773,7 @@ public PartitionedTable.Proxy lastBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy lastBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy lastBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.lastBy(groupByColumns)); } @@ -793,7 +793,7 @@ public PartitionedTable.Proxy minBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy minBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy minBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.minBy(groupByColumns)); } @@ -813,7 +813,7 @@ public PartitionedTable.Proxy maxBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy maxBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy maxBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.maxBy(groupByColumns)); } @@ -833,7 +833,7 @@ public PartitionedTable.Proxy sumBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy sumBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy sumBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.sumBy(groupByColumns)); } @@ -853,7 +853,7 @@ public PartitionedTable.Proxy avgBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy avgBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy avgBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.avgBy(groupByColumns)); } @@ -873,7 +873,7 @@ public PartitionedTable.Proxy medianBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy medianBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy medianBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.medianBy(groupByColumns)); } @@ -893,7 +893,7 @@ public PartitionedTable.Proxy stdBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy stdBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy stdBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.stdBy(groupByColumns)); } @@ -913,7 +913,7 @@ public PartitionedTable.Proxy varBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy varBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy varBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.varBy(groupByColumns)); } @@ -933,7 +933,7 @@ public PartitionedTable.Proxy absSumBy(String... groupByColumns) { } @Override - public PartitionedTable.Proxy absSumBy(Selectable... groupByColumns) { + public PartitionedTable.Proxy absSumBy(ColumnName... groupByColumns) { return basicTransform(ct -> ct.absSumBy(groupByColumns)); } @@ -953,7 +953,7 @@ public PartitionedTable.Proxy wsumBy(String weightColumn, String... groupByColum } @Override - public PartitionedTable.Proxy wsumBy(String weightColumn, Selectable... groupByColumns) { + public PartitionedTable.Proxy wsumBy(String weightColumn, ColumnName... groupByColumns) { return basicTransform(ct -> ct.wsumBy(weightColumn, groupByColumns)); } @@ -973,7 +973,7 @@ public PartitionedTable.Proxy wavgBy(String weightColumn, String... groupByColum } @Override - public PartitionedTable.Proxy wavgBy(String weightColumn, Selectable... groupByColumns) { + public PartitionedTable.Proxy wavgBy(String weightColumn, ColumnName... groupByColumns) { return basicTransform(ct -> ct.wavgBy(weightColumn, groupByColumns)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/FreezeBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/FreezeBy.java index 25362778c82..3a87078c73d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/FreezeBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/FreezeBy.java @@ -3,9 +3,9 @@ */ package io.deephaven.engine.table.impl.util; +import io.deephaven.api.ColumnName; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.select.SelectColumn; import java.util.Collection; @@ -85,7 +85,7 @@ public static Table freezeBy(Table input, Collection groupByColumns) { * * @return a copy of the input table frozen by key */ - public static Table freezeBy(Table input, SelectColumn... groupByColumns) { + public static Table freezeBy(Table input, ColumnName... groupByColumns) { return input.aggAllBy(AggSpec.freeze(), groupByColumns); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/util/TotalsTableBuilder.java b/engine/table/src/main/java/io/deephaven/engine/util/TotalsTableBuilder.java index 3180be9f867..8720d23819b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/TotalsTableBuilder.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/TotalsTableBuilder.java @@ -539,12 +539,10 @@ static Table makeTotalsTable(Table source, String aggregationDirective) { public static Table makeTotalsTable(Table source, TotalsTableBuilder builder, String... groupByColumns) { final Collection aggregations = makeAggregations(source, builder); final String[] formatSpecs = makeColumnFormats(source, builder); - - Table totalsTable = source.aggBy(aggregations, List.of(SelectColumnFactory.getExpressions(groupByColumns))); + Table totalsTable = source.aggBy(aggregations, groupByColumns); if (formatSpecs.length > 0) { totalsTable = totalsTable.formatColumns(makeColumnFormats(source, builder)); } - return totalsTable; } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java index 8d1ef353432..e4f247c628e 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java @@ -83,7 +83,7 @@ public void tearDown() throws Exception { private static AggregationContextFactory makeGroupByACF( @NotNull final Table table, @NotNull final String... groupByColumns) { return AggregationProcessor.forAggregation(List.of( - AggregateAllByTable.singleAggregation(AggSpec.group(), Selectable.from(groupByColumns), + AggregateAllByTable.singleAggregation(AggSpec.group(), ColumnName.from(groupByColumns), table.getDefinition().getColumnStream().map(ColumnDefinition::getName) .map(ColumnName::of).collect(Collectors.toList())) .orElseThrow())); @@ -121,17 +121,14 @@ private static Table individualStaticByTest(@NotNull final Table input, final Table actualKeys; final Table actual; { - final SelectColumn[] keySelectColumns = SelectColumnFactory.getExpressions(keyColumns); - final String[] keyNames = - Arrays.stream(keySelectColumns).map(SelectColumn::getName).distinct().toArray(String[]::new); final Table aggregatedInput = ChunkedOperatorAggregationHelper.aggregation( aggregationControl == null ? AggregationControl.DEFAULT : aggregationControl, makeGroupByACF(adjustedInput, keyColumns), - (QueryTable) adjustedInput, keySelectColumns); - actualKeys = keyNames.length == 0 + (QueryTable) adjustedInput, ColumnName.from(keyColumns)); + actualKeys = keyColumns.length == 0 ? aggregatedInput.dropColumns(aggregatedInput.getDefinition().getColumnNamesArray()) - : aggregatedInput.view(keyNames); - actual = aggregatedInput.sort(keyNames).ungroup(); + : aggregatedInput.view(keyColumns); + actual = aggregatedInput.sort(keyColumns).ungroup(); } assertTableEquals(expectedKeys, actualKeys); @@ -197,8 +194,9 @@ public void testStaticGroupedByWithChunks() { @Test public void testStaticNameReusingByWithChunks() { - individualStaticByTest(emptyTable(10000).update("A=i"), null, "A=Integer.toString(A % 5)", "A=A.hashCode()", - "A=A / 2"); + individualStaticByTest( + emptyTable(10000).update("A=i").updateView("A=Integer.toString(A % 5)", "A=A.hashCode()", "A=A / 2"), + null, "A"); } // endregion Static chunked groupBy() tests @@ -236,15 +234,12 @@ private IncrementalFirstStaticAfterByResultSupplier(@NotNull final AggregationCo */ @Override public final Table get() { - final SelectColumn[] keySelectColumns = SelectColumnFactory.getExpressions(columns); - final String[] keyNames = - Arrays.stream(keySelectColumns).map(SelectColumn::getName).distinct().toArray(String[]::new); if (firstTime.compareAndSet(true, false)) { return ChunkedOperatorAggregationHelper - .aggregation(control, acf, input, keySelectColumns).sort(keyNames); + .aggregation(control, acf, input, ColumnName.from(columns)).sort(columns); } return ChunkedOperatorAggregationHelper - .aggregation(control, acf, (QueryTable) input.silent(), keySelectColumns).sort(keyNames); + .aggregation(control, acf, (QueryTable) input.silent(), ColumnName.from(columns)).sort(columns); } } @@ -316,9 +311,12 @@ public boolean shouldProbeShift(long shiftSize, int numStates) { incrementalByEvalNugget(merged, "IntCol"), incrementalByEvalNugget(controlSize8, merged, "TimeCol"), incrementalByEvalNugget(controlShiftByProbing, merged, "TimeCol"), - incrementalByEvalNugget(controlSize8, merged, - "TimeCol=isNull(TimeCol) ? NULL_LONG : TimeCol.getNanos()"), - incrementalByEvalNugget(merged, "TimeCol=isNull(TimeCol) ? NULL_LONG : TimeCol.getNanos()"), + incrementalByEvalNugget(controlSize8, + (QueryTable) merged.updateView("TimeCol=isNull(TimeCol) ? NULL_LONG : TimeCol.getNanos()"), + "TimeCol"), + incrementalByEvalNugget( + (QueryTable) merged.updateView("TimeCol=isNull(TimeCol) ? NULL_LONG : TimeCol.getNanos()"), + "TimeCol"), incrementalByEvalNugget(controlSize8, merged, "StrCol", "IntCol"), incrementalByEvalNugget(merged, "StrCol", "IntCol"), @@ -463,14 +461,15 @@ public void testStaticBy() { } catch (Exception e) { TestCase.assertEquals("Invalid column name \"i\": \"i\" is a reserved keyword", e.getMessage()); } - TestCase.assertEquals(0, table.groupBy("j=i").size()); - TestCase.assertEquals(2, table.groupBy("j=i").numColumns()); - TestCase.assertEquals(int.class, table.groupBy("j=i").getColumnSource("j").getType()); + TestCase.assertEquals(0, table.updateView("j=i").groupBy("j").size()); + TestCase.assertEquals(2, table.updateView("j=i").groupBy("j").numColumns()); + TestCase.assertEquals(int.class, table.updateView("j=i").groupBy("j").getColumnSource("j").getType()); table = newTable(intCol("V", 100)); - TestCase.assertEquals(1, table.groupBy("j=i").size()); - TestCase.assertEquals(2, table.groupBy("j=i").numColumns()); - TestCase.assertEquals(int.class, table.groupBy("j=i").getDefinition().getColumn("j").getDataType()); + TestCase.assertEquals(1, table.updateView("j=i").groupBy("j").size()); + TestCase.assertEquals(2, table.updateView("j=i").groupBy("j").numColumns()); + TestCase.assertEquals(int.class, + table.updateView("j=i").groupBy("j").getDefinition().getColumn("j").getDataType()); table = TstUtils.testRefreshingTable(RowSetFactory.fromRange(0, 2).toTracking(), c("S", "c", "e", "g"), c("I", 2, 4, 6)); @@ -511,13 +510,17 @@ public void testStaticBy() { c("S", "e", "c", "g"), c("X", 4, 2, 6), c("Y", 1, 2, 3)); - TestCase.assertEquals(3, table.groupBy("Z=X+Y").size()); - TestCase.assertEquals(4, table.groupBy("Z=X+Y").numColumns()); - TestCase.assertEquals(ObjectVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("S").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("X").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Y").getDataType()); - TestCase.assertEquals(int.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Z").getDataType()); - ObjectVector sValues[] = (ObjectVector[]) table.groupBy("Z=X+Y").getColumn("S").getDirect(); + TestCase.assertEquals(3, table.updateView("Z=X+Y").groupBy("Z").size()); + TestCase.assertEquals(4, table.updateView("Z=X+Y").groupBy("Z").numColumns()); + TestCase.assertEquals(ObjectVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("S").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("X").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Y").getDataType()); + TestCase.assertEquals(int.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Z").getDataType()); + ObjectVector sValues[] = (ObjectVector[]) table.updateView("Z=X+Y").groupBy("Z").getColumn("S").getDirect(); TestCase.assertEquals(3, sValues.length); TestCase.assertEquals(1, sValues[0].size()); TestCase.assertEquals(1, sValues[1].size()); @@ -525,83 +528,104 @@ public void testStaticBy() { TestCase.assertEquals("e", sValues[0].get(0)); TestCase.assertEquals("c", sValues[1].get(0)); TestCase.assertEquals("g", sValues[2].get(0)); - TestCase.assertEquals(Arrays.asList(5, 4, 9), Arrays.asList(table.groupBy("Z=X+Y").getColumn("Z").get(0, 3))); + TestCase.assertEquals(Arrays.asList(5, 4, 9), + Arrays.asList(table.updateView("Z=X+Y").groupBy("Z").getColumn("Z").get(0, 3))); table = TstUtils.testRefreshingTable( c("S", "e", "c", "g"), c("X", 4, 2, 6), c("Y", 4, 2, 2)); - TestCase.assertEquals(2, table.groupBy("Z=X+Y").size()); - TestCase.assertEquals(4, table.groupBy("Z=X+Y").numColumns()); - TestCase.assertEquals(ObjectVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("S").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("X").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Y").getDataType()); - TestCase.assertEquals(int.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Z").getDataType()); - sValues = (ObjectVector[]) table.groupBy("Z=X+Y").getColumn("S").getDirect(); + TestCase.assertEquals(2, table.updateView("Z=X+Y").groupBy("Z").size()); + TestCase.assertEquals(4, table.updateView("Z=X+Y").groupBy("Z").numColumns()); + TestCase.assertEquals(ObjectVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("S").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("X").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Y").getDataType()); + TestCase.assertEquals(int.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Z").getDataType()); + sValues = (ObjectVector[]) table.updateView("Z=X+Y").groupBy("Z").getColumn("S").getDirect(); TestCase.assertEquals(2, sValues.length); TestCase.assertEquals(2, sValues[0].size()); TestCase.assertEquals(1, sValues[1].size()); TestCase.assertEquals("e", sValues[0].get(0)); TestCase.assertEquals("c", sValues[1].get(0)); TestCase.assertEquals("g", sValues[0].get(1)); - TestCase.assertEquals(Arrays.asList(8, 4), Arrays.asList(table.groupBy("Z=X+Y").getColumn("Z").get(0, 2))); + TestCase.assertEquals(Arrays.asList(8, 4), + Arrays.asList(table.updateView("Z=X+Y").groupBy("Z").getColumn("Z").get(0, 2))); table = TstUtils.testRefreshingTable( c("S", "e", "c", "g"), TstUtils.cG("X", 4, 2, 6), c("Y", 4, 2, 2)); - TestCase.assertEquals(2, table.groupBy("Z=X+Y").size()); - TestCase.assertEquals(4, table.groupBy("Z=X+Y").numColumns()); - TestCase.assertEquals(ObjectVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("S").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("X").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Y").getDataType()); - TestCase.assertEquals(int.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Z").getDataType()); - sValues = (ObjectVector[]) table.groupBy("Z=X+Y").getColumn("S").getDirect(); + TestCase.assertEquals(2, table.updateView("Z=X+Y").groupBy("Z").size()); + TestCase.assertEquals(4, table.updateView("Z=X+Y").groupBy("Z").numColumns()); + TestCase.assertEquals(ObjectVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("S").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("X").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Y").getDataType()); + TestCase.assertEquals(int.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Z").getDataType()); + sValues = (ObjectVector[]) table.updateView("Z=X+Y").groupBy("Z").getColumn("S").getDirect(); TestCase.assertEquals(2, sValues.length); TestCase.assertEquals(2, sValues[0].size()); TestCase.assertEquals(1, sValues[1].size()); TestCase.assertEquals("e", sValues[0].get(0)); TestCase.assertEquals("c", sValues[1].get(0)); TestCase.assertEquals("g", sValues[0].get(1)); - TestCase.assertEquals(Arrays.asList(8, 4), Arrays.asList(table.groupBy("Z=X+Y").getColumn("Z").get(0, 2))); + TestCase.assertEquals(Arrays.asList(8, 4), + Arrays.asList(table.updateView("Z=X+Y").groupBy("Z").getColumn("Z").get(0, 2))); table = TstUtils.testRefreshingTable( c("S", "e", "c", "g"), c("X", 4, 2, 6), TstUtils.cG("Y", 4, 2, 2)); - TestCase.assertEquals(2, table.groupBy("Z=X+Y").size()); - TestCase.assertEquals(4, table.groupBy("Z=X+Y").numColumns()); - TestCase.assertEquals(ObjectVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("S").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("X").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Y").getDataType()); - TestCase.assertEquals(int.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Z").getDataType()); - sValues = (ObjectVector[]) table.groupBy("Z=X+Y").getColumn("S").getDirect(); + TestCase.assertEquals(2, table.updateView("Z=X+Y").groupBy("Z").size()); + TestCase.assertEquals(4, table.updateView("Z=X+Y").groupBy("Z").numColumns()); + TestCase.assertEquals(ObjectVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("S").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("X").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Y").getDataType()); + TestCase.assertEquals(int.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Z").getDataType()); + sValues = (ObjectVector[]) table.updateView("Z=X+Y").groupBy("Z").getColumn("S").getDirect(); TestCase.assertEquals(2, sValues.length); TestCase.assertEquals(2, sValues[0].size()); TestCase.assertEquals(1, sValues[1].size()); TestCase.assertEquals("e", sValues[0].get(0)); TestCase.assertEquals("c", sValues[1].get(0)); TestCase.assertEquals("g", sValues[0].get(1)); - TestCase.assertEquals(Arrays.asList(8, 4), Arrays.asList(table.groupBy("Z=X+Y").getColumn("Z").get(0, 2))); + TestCase.assertEquals(Arrays.asList(8, 4), + Arrays.asList(table.updateView("Z=X+Y").groupBy("Z").getColumn("Z").get(0, 2))); table = TstUtils.testRefreshingTable( c("S", "e", "c", "g"), TstUtils.cG("X", 4, 2, 6), TstUtils.cG("Y", 4, 3, 2)); - TestCase.assertEquals(2, table.groupBy("Z=X+Y").size()); - TestCase.assertEquals(4, table.groupBy("Z=X+Y").numColumns()); - TestCase.assertEquals(ObjectVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("S").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("X").getDataType()); - TestCase.assertEquals(IntVector.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Y").getDataType()); - TestCase.assertEquals(int.class, table.groupBy("Z=X+Y").getDefinition().getColumn("Z").getDataType()); - sValues = (ObjectVector[]) table.groupBy("Z=X+Y").getColumn("S").getDirect(); + TestCase.assertEquals(2, table.updateView("Z=X+Y").groupBy("Z").size()); + TestCase.assertEquals(4, table.updateView("Z=X+Y").groupBy("Z").numColumns()); + TestCase.assertEquals(ObjectVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("S").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("X").getDataType()); + TestCase.assertEquals(IntVector.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Y").getDataType()); + TestCase.assertEquals(int.class, + table.updateView("Z=X+Y").groupBy("Z").getDefinition().getColumn("Z").getDataType()); + sValues = (ObjectVector[]) table.updateView("Z=X+Y").groupBy("Z").getColumn("S").getDirect(); TestCase.assertEquals(2, sValues.length); TestCase.assertEquals(2, sValues[0].size()); TestCase.assertEquals(1, sValues[1].size()); TestCase.assertEquals("e", sValues[0].get(0)); TestCase.assertEquals("c", sValues[1].get(0)); TestCase.assertEquals("g", sValues[0].get(1)); - TestCase.assertEquals(Arrays.asList(8, 5), Arrays.asList(table.groupBy("Z=X+Y").getColumn("Z").get(0, 2))); + TestCase.assertEquals(Arrays.asList(8, 5), + Arrays.asList(table.updateView("Z=X+Y").groupBy("Z").getColumn("Z").get(0, 2))); table = TstUtils.testRefreshingTable( c("S", "c", null, "g"), @@ -1194,13 +1218,13 @@ public void testApplyToAllBy() { TestCase.assertEquals(Arrays.asList(.5, .2), Arrays.asList(result.getColumn("doubleCol").get(0, 2))); TestCase.assertEquals(Arrays.asList("aa", "bc"), Arrays.asList(result.getColumn("Sym").get(0, 2))); - result = table.lastBy("Sym", "Sym1=Sym"); + result = table.updateView("Sym1=Sym").lastBy("Sym", "Sym1"); TestCase.assertEquals(result.size(), 2); TestCase.assertEquals(Arrays.asList(50, 20), Arrays.asList(result.getColumn("intCol").get(0, 2))); TestCase.assertEquals(Arrays.asList(.5, .2), Arrays.asList(result.getColumn("doubleCol").get(0, 2))); TestCase.assertEquals(Arrays.asList("aa", "bc"), Arrays.asList(result.getColumn("Sym").get(0, 2))); - result = table.lastBy("intCol", "Sym1=Sym"); + result = table.updateView("Sym1=Sym").lastBy("intCol", "Sym1"); TestCase.assertEquals(result.size(), 4); TestCase.assertEquals(Arrays.asList(10, 20, 30, 50), Arrays.asList(result.getColumn("intCol").get(0, 4))); TestCase.assertEquals(Arrays.asList(0.1, 0.2, 0.3, 0.5), @@ -1213,13 +1237,13 @@ public void testApplyToAllBy() { TestCase.assertEquals(Arrays.asList(10, 20), Arrays.asList(result.getColumn("intCol").get(0, 2))); TestCase.assertEquals(Arrays.asList(0.1, .2), Arrays.asList(result.getColumn("doubleCol").get(0, 2))); - result = table.firstBy("Sym", "Sym1=Sym"); + result = table.updateView("Sym1=Sym").firstBy("Sym", "Sym1"); TestCase.assertEquals(result.size(), 2); TestCase.assertEquals(Arrays.asList(10, 20), Arrays.asList(result.getColumn("intCol").get(0, 2))); TestCase.assertEquals(Arrays.asList(0.1, .2), Arrays.asList(result.getColumn("doubleCol").get(0, 2))); TestCase.assertEquals(Arrays.asList("aa", "bc"), Arrays.asList(result.getColumn("Sym").get(0, 2))); - result = table.firstBy("intCol", "Sym1=Sym"); + result = table.updateView("Sym1=Sym").firstBy("intCol", "Sym1"); TestCase.assertEquals(result.size(), 4); TestCase.assertEquals(Arrays.asList(10, 20, 30, 50), Arrays.asList(result.getColumn("intCol").get(0, 4))); TestCase.assertEquals(Arrays.asList(0.1, 0.2, 0.3, 0.5), diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java index 18a8715c9f0..061571aea23 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java @@ -1,5 +1,6 @@ package io.deephaven.engine.table.impl.updateby; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.updateby.BadDataBehavior; import io.deephaven.api.updateby.OperationControl; @@ -99,7 +100,7 @@ protected Table e() { .CumProd(makeOpColNames(columnNamesArray, "_prod", "Sym", "ts", "boolCol"))); final UpdateByControl control = UpdateByControl.builder().useRedirection(redirected).build(); return bucketed - ? base.updateBy(control, clauses, Selectable.from("Sym")) + ? base.updateBy(control, clauses, ColumnName.from("Sym")) : base.updateBy(control, clauses); } }, diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java index 62ca95bac39..3673c54a262 100644 --- a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java @@ -87,7 +87,7 @@ private static Table getGroupedOneColumnTable(int size) { Table t = getOneColumnTableFlat(size); QueryLibrary.importClass(ArrayStringSet.class); QueryLibrary.importClass(StringSet.class); - Table result = t.groupBy("groupKey = i % 100 + (int)(i/10)"); + Table result = t.updateView("groupKey = i % 100 + (int)(i/10)").groupBy("groupKey"); result = result.select(result.getDefinition().getColumnNames().stream() .map(name -> name.equals("groupKey") ? name : (name + " = i % 5 == 0 ? null:(i%3 == 0?" + name + ".subVector(0,0):" + name @@ -133,7 +133,7 @@ private static Table getGroupedTable(int size, boolean includeSerializable) { Table t = getTableFlat(size, includeSerializable); QueryLibrary.importClass(ArrayStringSet.class); QueryLibrary.importClass(StringSet.class); - Table result = t.groupBy("groupKey = i % 100 + (int)(i/10)"); + Table result = t.updateView("groupKey = i % 100 + (int)(i/10)").groupBy("groupKey"); result = result.select(result.getDefinition().getColumnNames().stream() .map(name -> name.equals("groupKey") ? name : (name + " = i % 5 == 0 ? null:(i%3 == 0?" + name + ".subVector(0,0):" + name diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java deleted file mode 100644 index fc8e3472b73..00000000000 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/AggBySessionTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package io.deephaven.client; - -import io.deephaven.api.agg.Aggregation; -import io.deephaven.client.impl.TableHandle; -import io.deephaven.qst.table.TableSpec; -import io.deephaven.qst.table.TimeTable; -import org.junit.Test; - -import java.time.Duration; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; - -public class AggBySessionTest extends DeephavenSessionTestBase { - - public static int myFunction() { - return 42; - } - - @Test - public void allowStaticI() throws InterruptedException, TableHandle.TableHandleException { - allow(TableSpec.empty(1), "Key = i % 2"); - } - - @Test - public void allowStaticII() throws InterruptedException, TableHandle.TableHandleException { - allow(TableSpec.empty(1), "Key = ii % 2"); - } - - @Test - public void allowTimeTableI() throws InterruptedException, TableHandle.TableHandleException { - allow(TimeTable.of(Duration.ofSeconds(1)), "Key = i % 2"); - } - - @Test - public void allowTimeTableII() throws InterruptedException, TableHandle.TableHandleException { - allow(TimeTable.of(Duration.ofSeconds(1)), "Key = ii % 2"); - } - - @Test - public void allowTickingI() throws InterruptedException, TableHandle.TableHandleException { - allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = i % 2"); - } - - @Test - public void allowTickingII() throws InterruptedException, TableHandle.TableHandleException { - allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Key = ii % 2"); - } - - @Test - public void disallowCustomFunctions() throws InterruptedException { - disallow(TableSpec.empty(1), String.format("Key = %s.myFunction()", AggBySessionTest.class.getName())); - } - - @Test - public void disallowNew() throws InterruptedException { - disallow(TableSpec.empty(1), "Key = new Object()"); - } - - @Test - public void allowPreviousColumn() throws TableHandle.TableHandleException, InterruptedException { - allow(TableSpec.empty(1), "X = 12", "Y = X + 1"); - } - - @Test - public void disallowFutureColumn() throws InterruptedException { - disallow(TableSpec.empty(1), "Y = X + 1", "X = 12"); - } - - @Test - public void allowReassignmentColumn() throws TableHandle.TableHandleException, InterruptedException { - allow(TableSpec.empty(1), "X = 12", "Y = X + 1", "X = 42"); - } - - @Test - public void disallowNonExistentColumn() throws InterruptedException { - disallow(TableSpec.empty(1), "X = 12", "Y = Z + 1"); - } - - private void allow(TableSpec parent, String... groupBys) - throws InterruptedException, TableHandle.TableHandleException { - try (final TableHandle handle = - session.batch().execute(parent.aggBy(Aggregation.AggCount("Count"), groupBys))) { - assertThat(handle.isSuccessful()).isTrue(); - } - } - - private void disallow(TableSpec parent, String... groupBys) throws InterruptedException { - try (final TableHandle handle = - session.batch().execute(parent.aggBy(Aggregation.AggCount("Count"), groupBys))) { - failBecauseExceptionWasNotThrown(TableHandle.TableHandleException.class); - } catch (TableHandle.TableHandleException e) { - // expected - } - } -} - diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java index 2c26e48ba6b..ab37bdd5ab3 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java @@ -490,7 +490,7 @@ private SelectDistinctRequest selectDistinct(SelectDistinctTable selectDistinctT SelectDistinctRequest.Builder builder = SelectDistinctRequest.newBuilder() .setResultId(ticket) .setSourceId(ref(selectDistinctTable.parent())); - for (Selectable column : selectDistinctTable.groupByColumns()) { + for (Selectable column : selectDistinctTable.columns()) { builder.addColumnNames(Strings.of(column)); } return builder.build(); diff --git a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java index 4f3195a3e34..8ec4edf649c 100644 --- a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java +++ b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java @@ -173,7 +173,7 @@ public void visit(InMemoryKeyBackedInputTable inMemoryKeyBacked) { @Override public void visit(SelectDistinctTable selectDistinctTable) { sb.append("selectDistinct("); - append(Strings::of, selectDistinctTable.groupByColumns(), sb); + append(Strings::of, selectDistinctTable.columns(), sb); sb.append(')'); } diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java index 64cc8072b85..b9b2e9b08ce 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java @@ -3,6 +3,7 @@ */ package io.deephaven.qst; +import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.TableOperations; import io.deephaven.api.agg.spec.AggSpec; @@ -239,7 +240,7 @@ public void visit(AggregateAllByTable aggAllByTable) { if (aggAllByTable.groupByColumns().isEmpty()) { addOp(aggAllByTable, parentOps(aggAllByTable).aggAllBy(spec)); } else { - final Selectable[] groupByColumns = aggAllByTable.groupByColumns().toArray(new Selectable[0]); + final ColumnName[] groupByColumns = aggAllByTable.groupByColumns().toArray(new ColumnName[0]); addOp(aggAllByTable, parentOps(aggAllByTable).aggAllBy(spec, groupByColumns)); } } @@ -266,11 +267,11 @@ public void visit(InputTable inputTable) { @Override public void visit(SelectDistinctTable selectDistinctTable) { - if (selectDistinctTable.groupByColumns().isEmpty()) { + if (selectDistinctTable.columns().isEmpty()) { addOp(selectDistinctTable, parentOps(selectDistinctTable).selectDistinct()); } else { addOp(selectDistinctTable, - parentOps(selectDistinctTable).selectDistinct(selectDistinctTable.groupByColumns())); + parentOps(selectDistinctTable).selectDistinct(selectDistinctTable.columns())); } } @@ -280,7 +281,7 @@ public void visit(CountByTable countByTable) { addOp(countByTable, parentOps(countByTable).countBy(countByTable.countName().name())); } else { addOp(countByTable, parentOps(countByTable).countBy(countByTable.countName().name(), - countByTable.groupByColumns().toArray(new Selectable[0]))); + countByTable.groupByColumns().toArray(new ColumnName[0]))); } } diff --git a/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java b/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java index 2e2eaae84f5..6a5e8c55186 100644 --- a/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java @@ -5,7 +5,6 @@ import io.deephaven.annotations.NodeStyle; import io.deephaven.api.ColumnName; -import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import org.immutables.value.Value.Immutable; @@ -34,7 +33,7 @@ public static Builder builder() { * @return the aggregation, if non-empty */ public static Optional singleAggregation( - AggSpec spec, Collection groupByColumns, + AggSpec spec, Collection groupByColumns, Collection tableColumns) { Set exclusions = AggAllByExclusions.of(spec, groupByColumns); List columnsToAgg = new ArrayList<>(tableColumns.size()); diff --git a/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java b/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java index 1c825b5974f..9ec4c94b06f 100644 --- a/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java @@ -3,7 +3,7 @@ */ package io.deephaven.qst.table; -import io.deephaven.api.Selectable; +import io.deephaven.api.ColumnName; import java.util.List; @@ -11,16 +11,16 @@ public abstract class ByTableBase extends TableBase implements SingleParentTable public abstract TableSpec parent(); - public abstract List groupByColumns(); + public abstract List groupByColumns(); interface Builder> { SELF parent(TableSpec parent); - SELF addGroupByColumns(Selectable element); + SELF addGroupByColumns(ColumnName element); - SELF addGroupByColumns(Selectable... elements); + SELF addGroupByColumns(ColumnName... elements); - SELF addAllGroupByColumns(Iterable elements); + SELF addAllGroupByColumns(Iterable elements); BY build(); } diff --git a/qst/src/main/java/io/deephaven/qst/table/SelectDistinctTable.java b/qst/src/main/java/io/deephaven/qst/table/SelectDistinctTable.java index 0baff2d7703..97a0346eed9 100644 --- a/qst/src/main/java/io/deephaven/qst/table/SelectDistinctTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/SelectDistinctTable.java @@ -8,7 +8,7 @@ @Immutable @NodeStyle -public abstract class SelectDistinctTable extends ByTableBase { +public abstract class SelectDistinctTable extends TableBase implements SelectableTable { public static Builder builder() { return ImmutableSelectDistinctTable.builder(); @@ -20,7 +20,7 @@ public final V walk(V visitor) { return visitor; } - public interface Builder extends ByTableBase.Builder { + public interface Builder extends SelectableTable.Builder { } } diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index 59b645e94da..9fc5544ef65 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -387,8 +387,8 @@ public final AggregateAllByTable groupBy(String... groupByColumns) { } @Override - public final AggregateAllByTable groupBy(Collection groupByColumns) { - return aggAllBy(AggSpec.group(), groupByColumns.toArray(new Selectable[0])); + public final AggregateAllByTable groupBy(Collection groupByColumns) { + return aggAllBy(AggSpec.group(), groupByColumns.toArray(new ColumnName[0])); } @Override @@ -402,7 +402,7 @@ public final AggregateAllByTable aggAllBy(AggSpec spec, String... groupByColumns } @Override - public final AggregateAllByTable aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public final AggregateAllByTable aggAllBy(AggSpec spec, ColumnName... groupByColumns) { return AggregateAllByTable.builder().parent(this).spec(spec).addGroupByColumns(groupByColumns).build(); } @@ -410,7 +410,7 @@ public final AggregateAllByTable aggAllBy(AggSpec spec, Selectable... groupByCol public final AggregateAllByTable aggAllBy(AggSpec spec, Collection groupByColumns) { AggregateAllByTable.Builder builder = AggregateAllByTable.builder().parent(this).spec(spec); for (String groupByColumn : groupByColumns) { - builder.addGroupByColumns(Selectable.parse(groupByColumn)); + builder.addGroupByColumns(ColumnName.of(groupByColumn)); } return builder.build(); } @@ -424,13 +424,13 @@ public final AggregationTable aggBy(Aggregation aggregation) { public final AggregationTable aggBy(Aggregation aggregation, String... groupByColumns) { final AggregationTable.Builder builder = AggregationTable.builder().parent(this); for (String groupByColumn : groupByColumns) { - builder.addGroupByColumns(Selectable.parse(groupByColumn)); + builder.addGroupByColumns(ColumnName.of(groupByColumn)); } return builder.addAggregations(aggregation).build(); } @Override - public final AggregationTable aggBy(Aggregation aggregation, Collection groupByColumns) { + public final AggregationTable aggBy(Aggregation aggregation, Collection groupByColumns) { return AggregationTable.builder().parent(this).addAllGroupByColumns(groupByColumns) .addAggregations(aggregation).build(); } @@ -444,14 +444,14 @@ public final AggregationTable aggBy(Collection aggregatio public final AggregationTable aggBy(Collection aggregations, String... groupByColumns) { final AggregationTable.Builder builder = AggregationTable.builder().parent(this); for (String groupByColumn : groupByColumns) { - builder.addGroupByColumns(Selectable.parse(groupByColumn)); + builder.addGroupByColumns(ColumnName.of(groupByColumn)); } return builder.addAllAggregations(aggregations).build(); } @Override public final AggregationTable aggBy(Collection aggregations, - Collection groupByColumns) { + Collection groupByColumns) { return AggregationTable.builder().parent(this).addAllGroupByColumns(groupByColumns) .addAllAggregations(aggregations).build(); } @@ -470,14 +470,14 @@ public final UpdateByTable updateBy(UpdateByOperation operation, String... byCol .parent(this) .addOperations(operation); for (String byColumn : byColumns) { - builder.addGroupByColumns(Selectable.parse(byColumn)); + builder.addGroupByColumns(ColumnName.of(byColumn)); } return builder.build(); } @Override public final UpdateByTable updateBy(Collection operations, - Collection byColumns) { + Collection byColumns) { return UpdateByTable.builder() .parent(this) .addAllOperations(operations) @@ -499,7 +499,7 @@ public final UpdateByTable updateBy(Collection oper .parent(this) .addAllOperations(operations); for (String byColumn : byColumns) { - builder.addGroupByColumns(Selectable.parse(byColumn)); + builder.addGroupByColumns(ColumnName.of(byColumn)); } return builder.build(); } @@ -515,7 +515,7 @@ public final UpdateByTable updateBy(UpdateByControl control, Collection operations, - Collection byColumns) { + Collection byColumns) { return UpdateByTable.builder() .parent(this) .control(control) @@ -530,22 +530,22 @@ public final SelectDistinctTable selectDistinct() { } @Override - public final SelectDistinctTable selectDistinct(String... groupByColumns) { + public final SelectDistinctTable selectDistinct(String... columns) { final SelectDistinctTable.Builder builder = SelectDistinctTable.builder().parent(this); - for (String groupByColumn : groupByColumns) { - builder.addGroupByColumns(Selectable.parse(groupByColumn)); + for (String column : columns) { + builder.addColumns(Selectable.parse(column)); } return builder.build(); } @Override - public final SelectDistinctTable selectDistinct(Selectable... groupByColumns) { - return selectDistinct(Arrays.asList(groupByColumns)); + public final SelectDistinctTable selectDistinct(Selectable... columns) { + return selectDistinct(Arrays.asList(columns)); } @Override - public final SelectDistinctTable selectDistinct(Collection groupByColumns) { - return SelectDistinctTable.builder().parent(this).addAllGroupByColumns(groupByColumns).build(); + public final SelectDistinctTable selectDistinct(Collection columns) { + return SelectDistinctTable.builder().parent(this).addAllColumns(columns).build(); } @Override @@ -559,7 +559,7 @@ public final CountByTable countBy(String countColumnName, String... groupByColum } @Override - public final CountByTable countBy(String countColumnName, Selectable... groupByColumns) { + public final CountByTable countBy(String countColumnName, ColumnName... groupByColumns) { return CountByTable.builder().parent(this).countName(ColumnName.of(countColumnName)) .addGroupByColumns(groupByColumns).build(); } @@ -568,7 +568,7 @@ public final CountByTable countBy(String countColumnName, Selectable... groupByC public final CountByTable countBy(String countColumnName, Collection groupByColumns) { CountByTable.Builder builder = CountByTable.builder().parent(this).countName(ColumnName.of(countColumnName)); for (String groupByColumn : groupByColumns) { - builder.addGroupByColumns(Selectable.parse(groupByColumn)); + builder.addGroupByColumns(ColumnName.of(groupByColumn)); } return builder.build(); } @@ -584,7 +584,7 @@ public final AggregateAllByTable firstBy(String... groupByColumns) { } @Override - public final AggregateAllByTable firstBy(Selectable... groupByColumns) { + public final AggregateAllByTable firstBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.first(), groupByColumns); } @@ -604,7 +604,7 @@ public final AggregateAllByTable lastBy(String... groupByColumns) { } @Override - public final AggregateAllByTable lastBy(Selectable... groupByColumns) { + public final AggregateAllByTable lastBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.last(), groupByColumns); } @@ -624,7 +624,7 @@ public final AggregateAllByTable minBy(String... groupByColumns) { } @Override - public final AggregateAllByTable minBy(Selectable... groupByColumns) { + public final AggregateAllByTable minBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.min(), groupByColumns); } @@ -644,7 +644,7 @@ public final AggregateAllByTable maxBy(String... groupByColumns) { } @Override - public final AggregateAllByTable maxBy(Selectable... groupByColumns) { + public final AggregateAllByTable maxBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.max(), groupByColumns); } @@ -664,7 +664,7 @@ public final AggregateAllByTable sumBy(String... groupByColumns) { } @Override - public final AggregateAllByTable sumBy(Selectable... groupByColumns) { + public final AggregateAllByTable sumBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.sum(), groupByColumns); } @@ -684,7 +684,7 @@ public final AggregateAllByTable avgBy(String... groupByColumns) { } @Override - public final AggregateAllByTable avgBy(Selectable... groupByColumns) { + public final AggregateAllByTable avgBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.avg(), groupByColumns); } @@ -704,7 +704,7 @@ public final AggregateAllByTable medianBy(String... groupByColumns) { } @Override - public final AggregateAllByTable medianBy(Selectable... groupByColumns) { + public final AggregateAllByTable medianBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.median(), groupByColumns); } @@ -724,7 +724,7 @@ public final AggregateAllByTable stdBy(String... groupByColumns) { } @Override - public final AggregateAllByTable stdBy(Selectable... groupByColumns) { + public final AggregateAllByTable stdBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.std(), groupByColumns); } @@ -744,7 +744,7 @@ public final AggregateAllByTable varBy(String... groupByColumns) { } @Override - public final AggregateAllByTable varBy(Selectable... groupByColumns) { + public final AggregateAllByTable varBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.var(), groupByColumns); } @@ -764,7 +764,7 @@ public final AggregateAllByTable absSumBy(String... groupByColumns) { } @Override - public final AggregateAllByTable absSumBy(Selectable... groupByColumns) { + public final AggregateAllByTable absSumBy(ColumnName... groupByColumns) { return aggAllBy(AggSpec.absSum(), groupByColumns); } @@ -784,7 +784,7 @@ public final AggregateAllByTable wsumBy(String weightColumn, String... groupByCo } @Override - public final AggregateAllByTable wsumBy(String weightColumn, Selectable... groupByColumns) { + public final AggregateAllByTable wsumBy(String weightColumn, ColumnName... groupByColumns) { return aggAllBy(AggSpec.wsum(weightColumn), groupByColumns); } @@ -804,7 +804,7 @@ public final AggregateAllByTable wavgBy(String weightColumn, String... groupByCo } @Override - public final AggregateAllByTable wavgBy(String weightColumn, Selectable... groupByColumns) { + public final AggregateAllByTable wavgBy(String weightColumn, ColumnName... groupByColumns) { return aggAllBy(AggSpec.wavg(weightColumn), groupByColumns); } diff --git a/server/src/main/java/io/deephaven/server/table/ops/ComboAggregateGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/ops/ComboAggregateGrpcImpl.java index c7918012ac0..1f201c7b171 100644 --- a/server/src/main/java/io/deephaven/server/table/ops/ComboAggregateGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/table/ops/ComboAggregateGrpcImpl.java @@ -4,18 +4,16 @@ package io.deephaven.server.table.ops; import com.google.rpc.Code; +import io.deephaven.api.ColumnName; import io.deephaven.api.agg.Aggregation; +import io.deephaven.api.util.NameValidator; import io.deephaven.base.verify.Assert; -import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.impl.select.SelectColumn; -import io.deephaven.engine.table.impl.select.SelectColumnFactory; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.proto.backplane.grpc.BatchTableRequest; import io.deephaven.proto.backplane.grpc.ComboAggregateRequest; import io.deephaven.server.session.SessionState; -import io.deephaven.server.table.validation.ColumnExpressionValidator; import io.grpc.StatusRuntimeException; import org.jetbrains.annotations.NotNull; @@ -45,6 +43,12 @@ public void validateRequest(ComboAggregateRequest request) throws StatusRuntimeE throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "ComboAggregateRequest incorrectly has zero aggregates provided"); } + for (String groupByColumn : request.getGroupByColumnsList()) { + if (!NameValidator.isValidColumnName(groupByColumn)) { + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, + "ComboAggregateRequest group by"); + } + } if (isSimpleAggregation(request)) { // this is a simple aggregation, make sure the user didn't mistakenly set extra properties // which would suggest they meant to set force_combo=true @@ -108,12 +112,11 @@ private boolean isSimpleAggregation(ComboAggregateRequest request) { public Table create(final ComboAggregateRequest request, final List> sourceTables) { Assert.eq(sourceTables.size(), "sourceTables.size()", 1); - final Table parent = sourceTables.get(0).get(); - final String[] groupBySpecs = request.getGroupByColumnsList().toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY); - final SelectColumn[] groupByColumns = SelectColumnFactory.getExpressions(groupBySpecs); - ColumnExpressionValidator.validateColumnExpressions(groupByColumns, groupBySpecs, parent); - + final ColumnName[] groupByColumns = request.getGroupByColumnsList() + .stream() + .map(ColumnName::of) + .toArray(ColumnName[]::new); final Table result; if (isSimpleAggregation(request)) { // This is a special case with a special operator that can be invoked right off of the table api. @@ -124,7 +127,7 @@ public Table create(final ComboAggregateRequest request, return result; } - private static Table singleAggregateHelper(final Table parent, final SelectColumn[] groupByColumns, + private static Table singleAggregateHelper(final Table parent, final ColumnName[] groupByColumns, final ComboAggregateRequest.Aggregate aggregate) { switch (aggregate.getType()) { case SUM: @@ -158,10 +161,10 @@ private static Table singleAggregateHelper(final Table parent, final SelectColum } } - private static Table comboAggregateHelper(final Table parent, final SelectColumn[] groupByColumns, + private static Table comboAggregateHelper(final Table parent, final ColumnName[] groupByColumns, final List aggregates) { final Set groupByColumnSet = - Arrays.stream(groupByColumns).map(SelectColumn::getName).collect(Collectors.toSet()); + Arrays.stream(groupByColumns).map(ColumnName::name).collect(Collectors.toSet()); final Function getPairs = agg -> getColumnPairs(parent, groupByColumnSet, agg); @@ -174,6 +177,7 @@ private static Table comboAggregateHelper(final Table parent, final SelectColumn private static String[] getColumnPairs(@NotNull final Table parent, @NotNull final Set groupByColumnSet, @NotNull final ComboAggregateRequest.Aggregate agg) { + // See io.deephaven.qst.table.AggAllByExclusions if (agg.getMatchPairsCount() == 0) { // If not specified, we apply the aggregate to all columns not "otherwise involved" return parent.getDefinition().getColumnStream() diff --git a/table-api/src/main/java/io/deephaven/api/ColumnName.java b/table-api/src/main/java/io/deephaven/api/ColumnName.java index ed8d7f41c9c..e3930ef8ecf 100644 --- a/table-api/src/main/java/io/deephaven/api/ColumnName.java +++ b/table-api/src/main/java/io/deephaven/api/ColumnName.java @@ -13,6 +13,11 @@ import org.immutables.value.Value.Parameter; import java.io.Serializable; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; /** * Represents a column name. @@ -34,6 +39,24 @@ public static ColumnName parse(String value) { return of(value.trim()); } + public static List from(String... values) { + return Arrays.stream(values).map(ColumnName::of).collect(Collectors.toList()); + } + + public static List from(Collection values) { + return values.stream().map(ColumnName::of).collect(Collectors.toList()); + } + + public static Optional> cast(Collection columns) { + for (Selectable column : columns) { + if (!(column instanceof ColumnName)) { + return Optional.empty(); + } + } + // noinspection unchecked + return Optional.of((Collection) columns); + } + /** * The column name. * diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index 9168849bd66..d796d3e5e1a 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -491,7 +491,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, TOPS groupBy(String... groupByColumns); - TOPS groupBy(Collection groupByColumns); + TOPS groupBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- @@ -499,7 +499,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, TOPS aggAllBy(AggSpec spec, String... groupByColumns); - TOPS aggAllBy(AggSpec spec, Selectable... groupByColumns); + TOPS aggAllBy(AggSpec spec, ColumnName... groupByColumns); TOPS aggAllBy(AggSpec spec, Collection groupByColumns); @@ -509,13 +509,13 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, TOPS aggBy(Aggregation aggregation, String... groupByColumns); - TOPS aggBy(Aggregation aggregation, Collection groupByColumns); + TOPS aggBy(Aggregation aggregation, Collection groupByColumns); TOPS aggBy(Collection aggregations); TOPS aggBy(Collection aggregations, String... groupByColumns); - TOPS aggBy(Collection aggregations, Collection groupByColumns); + TOPS aggBy(Collection aggregations, Collection groupByColumns); // ------------------------------------------------------------------------------------------- @@ -529,20 +529,20 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, TOPS updateBy(Collection operations, final String... byColumns); - TOPS updateBy(Collection operations, Collection byColumns); + TOPS updateBy(Collection operations, Collection byColumns); TOPS updateBy(UpdateByControl control, Collection operations, - Collection byColumns); + Collection byColumns); // ------------------------------------------------------------------------------------------- TOPS selectDistinct(); - TOPS selectDistinct(String... groupByColumns); + TOPS selectDistinct(String... columns); - TOPS selectDistinct(Selectable... groupByColumns); + TOPS selectDistinct(Selectable... columns); - TOPS selectDistinct(Collection groupByColumns); + TOPS selectDistinct(Collection columns); // ------------------------------------------------------------------------------------------- @@ -550,7 +550,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS countBy(String countColumnName, String... groupByColumns); - TOPS countBy(String countColumnName, Selectable... groupByColumns); + TOPS countBy(String countColumnName, ColumnName... groupByColumns); TOPS countBy(String countColumnName, Collection groupByColumns); @@ -560,7 +560,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS firstBy(String... groupByColumns); - TOPS firstBy(Selectable... groupByColumns); + TOPS firstBy(ColumnName... groupByColumns); TOPS firstBy(Collection groupByColumns); @@ -570,7 +570,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS lastBy(String... groupByColumns); - TOPS lastBy(Selectable... groupByColumns); + TOPS lastBy(ColumnName... groupByColumns); TOPS lastBy(Collection groupByColumns); @@ -580,7 +580,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS minBy(String... groupByColumns); - TOPS minBy(Selectable... groupByColumns); + TOPS minBy(ColumnName... groupByColumns); TOPS minBy(Collection groupByColumns); @@ -590,7 +590,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS maxBy(String... groupByColumns); - TOPS maxBy(Selectable... groupByColumns); + TOPS maxBy(ColumnName... groupByColumns); TOPS maxBy(Collection groupByColumns); @@ -600,7 +600,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS sumBy(String... groupByColumns); - TOPS sumBy(Selectable... groupByColumns); + TOPS sumBy(ColumnName... groupByColumns); TOPS sumBy(Collection groupByColumns); @@ -610,7 +610,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS avgBy(String... groupByColumns); - TOPS avgBy(Selectable... groupByColumns); + TOPS avgBy(ColumnName... groupByColumns); TOPS avgBy(Collection groupByColumns); @@ -620,7 +620,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS medianBy(String... groupByColumns); - TOPS medianBy(Selectable... groupByColumns); + TOPS medianBy(ColumnName... groupByColumns); TOPS medianBy(Collection groupByColumns); @@ -630,7 +630,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS stdBy(String... groupByColumns); - TOPS stdBy(Selectable... groupByColumns); + TOPS stdBy(ColumnName... groupByColumns); TOPS stdBy(Collection groupByColumns); @@ -640,7 +640,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS varBy(String... groupByColumns); - TOPS varBy(Selectable... groupByColumns); + TOPS varBy(ColumnName... groupByColumns); TOPS varBy(Collection groupByColumns); @@ -650,7 +650,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS absSumBy(String... groupByColumns); - TOPS absSumBy(Selectable... groupByColumns); + TOPS absSumBy(ColumnName... groupByColumns); TOPS absSumBy(Collection groupByColumns); @@ -660,7 +660,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS wsumBy(String weightColumn, String... groupByColumns); - TOPS wsumBy(String weightColumn, Selectable... groupByColumns); + TOPS wsumBy(String weightColumn, ColumnName... groupByColumns); TOPS wsumBy(String weightColumn, Collection groupByColumns); @@ -670,7 +670,7 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS wavgBy(String weightColumn, String... groupByColumns); - TOPS wavgBy(String weightColumn, Selectable... groupByColumns); + TOPS wavgBy(String weightColumn, ColumnName... groupByColumns); TOPS wavgBy(String weightColumn, Collection groupByColumns); diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java index 2c39b2d9ae5..533932dd286 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java @@ -261,7 +261,7 @@ public final TOPS_1 groupBy(String... groupByColumns) { } @Override - public final TOPS_1 groupBy(Collection groupByColumns) { + public final TOPS_1 groupBy(Collection groupByColumns) { return adapt(delegate.groupBy(groupByColumns)); } @@ -276,7 +276,7 @@ public final TOPS_1 aggAllBy(AggSpec spec, String... groupByColumns) { } @Override - public final TOPS_1 aggAllBy(AggSpec spec, Selectable... groupByColumns) { + public final TOPS_1 aggAllBy(AggSpec spec, ColumnName... groupByColumns) { return adapt(delegate.aggAllBy(spec, groupByColumns)); } @@ -296,7 +296,7 @@ public final TOPS_1 aggBy(Aggregation aggregation, String... groupByColumns) { } @Override - public final TOPS_1 aggBy(Aggregation aggregation, Collection groupByColumns) { + public final TOPS_1 aggBy(Aggregation aggregation, Collection groupByColumns) { return adapt(delegate.aggBy(aggregation, groupByColumns)); } @@ -312,7 +312,7 @@ public final TOPS_1 aggBy(Collection aggregations, String @Override public final TOPS_1 aggBy(Collection aggregations, - Collection groupByColumns) { + Collection groupByColumns) { return adapt(delegate.aggBy(aggregations, groupByColumns)); } @@ -339,7 +339,7 @@ public final TOPS_1 updateBy(Collection operations, @Override public final TOPS_1 updateBy(Collection operations, - Collection byColumns) { + Collection byColumns) { return adapt(delegate.updateBy(operations, byColumns)); } @@ -350,7 +350,7 @@ public final TOPS_1 updateBy(UpdateByControl control, Collection operations, - Collection byColumns) { + Collection byColumns) { return adapt(delegate.updateBy(control, operations, byColumns)); } @@ -360,18 +360,18 @@ public final TOPS_1 selectDistinct() { } @Override - public final TOPS_1 selectDistinct(String... groupByColumns) { - return adapt(delegate.selectDistinct(groupByColumns)); + public final TOPS_1 selectDistinct(String... columns) { + return adapt(delegate.selectDistinct(columns)); } @Override - public final TOPS_1 selectDistinct(Selectable... groupByColumns) { - return adapt(delegate.selectDistinct(groupByColumns)); + public final TOPS_1 selectDistinct(Selectable... columns) { + return adapt(delegate.selectDistinct(columns)); } @Override - public final TOPS_1 selectDistinct(Collection groupByColumns) { - return adapt(delegate.selectDistinct(groupByColumns)); + public final TOPS_1 selectDistinct(Collection columns) { + return adapt(delegate.selectDistinct(columns)); } @Override @@ -385,7 +385,7 @@ public final TOPS_1 countBy(String countColumnName, String... groupByColumns) { } @Override - public final TOPS_1 countBy(String countColumnName, Selectable... groupByColumns) { + public final TOPS_1 countBy(String countColumnName, ColumnName... groupByColumns) { return adapt(delegate.countBy(countColumnName, groupByColumns)); } @@ -405,7 +405,7 @@ public final TOPS_1 firstBy(String... groupByColumns) { } @Override - public final TOPS_1 firstBy(Selectable... groupByColumns) { + public final TOPS_1 firstBy(ColumnName... groupByColumns) { return adapt(delegate.firstBy(groupByColumns)); } @@ -425,7 +425,7 @@ public final TOPS_1 lastBy(String... groupByColumns) { } @Override - public final TOPS_1 lastBy(Selectable... groupByColumns) { + public final TOPS_1 lastBy(ColumnName... groupByColumns) { return adapt(delegate.lastBy(groupByColumns)); } @@ -445,7 +445,7 @@ public final TOPS_1 minBy(String... groupByColumns) { } @Override - public final TOPS_1 minBy(Selectable... groupByColumns) { + public final TOPS_1 minBy(ColumnName... groupByColumns) { return adapt(delegate.minBy(groupByColumns)); } @@ -465,7 +465,7 @@ public final TOPS_1 maxBy(String... groupByColumns) { } @Override - public final TOPS_1 maxBy(Selectable... groupByColumns) { + public final TOPS_1 maxBy(ColumnName... groupByColumns) { return adapt(delegate.maxBy(groupByColumns)); } @@ -485,7 +485,7 @@ public final TOPS_1 sumBy(String... groupByColumns) { } @Override - public final TOPS_1 sumBy(Selectable... groupByColumns) { + public final TOPS_1 sumBy(ColumnName... groupByColumns) { return adapt(delegate.sumBy(groupByColumns)); } @@ -505,7 +505,7 @@ public final TOPS_1 avgBy(String... groupByColumns) { } @Override - public final TOPS_1 avgBy(Selectable... groupByColumns) { + public final TOPS_1 avgBy(ColumnName... groupByColumns) { return adapt(delegate.avgBy(groupByColumns)); } @@ -525,7 +525,7 @@ public final TOPS_1 medianBy(String... groupByColumns) { } @Override - public final TOPS_1 medianBy(Selectable... groupByColumns) { + public final TOPS_1 medianBy(ColumnName... groupByColumns) { return adapt(delegate.medianBy(groupByColumns)); } @@ -545,7 +545,7 @@ public final TOPS_1 stdBy(String... groupByColumns) { } @Override - public final TOPS_1 stdBy(Selectable... groupByColumns) { + public final TOPS_1 stdBy(ColumnName... groupByColumns) { return adapt(delegate.stdBy(groupByColumns)); } @@ -565,7 +565,7 @@ public final TOPS_1 varBy(String... groupByColumns) { } @Override - public final TOPS_1 varBy(Selectable... groupByColumns) { + public final TOPS_1 varBy(ColumnName... groupByColumns) { return adapt(delegate.varBy(groupByColumns)); } @@ -585,7 +585,7 @@ public final TOPS_1 absSumBy(String... groupByColumns) { } @Override - public final TOPS_1 absSumBy(Selectable... groupByColumns) { + public final TOPS_1 absSumBy(ColumnName... groupByColumns) { return adapt(delegate.absSumBy(groupByColumns)); } @@ -605,7 +605,7 @@ public final TOPS_1 wsumBy(String weightColumn, String... groupByColumns) { } @Override - public final TOPS_1 wsumBy(String weightColumn, Selectable... groupByColumns) { + public final TOPS_1 wsumBy(String weightColumn, ColumnName... groupByColumns) { return adapt(delegate.wsumBy(weightColumn, groupByColumns)); } @@ -625,7 +625,7 @@ public final TOPS_1 wavgBy(String weightColumn, String... groupByColumns) { } @Override - public final TOPS_1 wavgBy(String weightColumn, Selectable... groupByColumns) { + public final TOPS_1 wavgBy(String weightColumn, ColumnName... groupByColumns) { return adapt(delegate.wavgBy(weightColumn, groupByColumns)); } diff --git a/table-api/src/main/java/io/deephaven/api/agg/spec/AggSpecGroup.java b/table-api/src/main/java/io/deephaven/api/agg/spec/AggSpecGroup.java index ff52882ecd1..fa9a6100f2a 100644 --- a/table-api/src/main/java/io/deephaven/api/agg/spec/AggSpecGroup.java +++ b/table-api/src/main/java/io/deephaven/api/agg/spec/AggSpecGroup.java @@ -6,8 +6,6 @@ import io.deephaven.annotations.SimpleStyle; import org.immutables.value.Value.Immutable; -import java.util.Collection; - /** * Specifies an aggregation that outputs each group of input values as a Deephaven vector (io.deephaven.vector.Vector). * From da7bd80530cd2c8005432ce6ba3d03b787143e73 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Thu, 28 Jul 2022 08:17:06 -0600 Subject: [PATCH 042/215] Use autolocking ctx manager instead of decorator (#2689) * Use autolocking ctx manager instead of decorator * Respond to review comments * Apply suggestions from code review Co-authored-by: Ryan Caudy Co-authored-by: Ryan Caudy --- py/server/deephaven/table.py | 401 ++++++++++++++------------- py/server/deephaven/table_factory.py | 10 +- py/server/deephaven/ugp.py | 21 +- 3 files changed, 225 insertions(+), 207 deletions(-) diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index ae664c64642..bd2e9ae0f46 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -18,7 +18,7 @@ from deephaven.column import Column, ColumnType from deephaven.filters import Filter from deephaven.jcompat import j_array_list, to_sequence, j_unary_operator, j_binary_operator -from deephaven.ugp import auto_locking_op +from deephaven.ugp import auto_locking_ctx from deephaven.updateby import UpdateByOperation # Table @@ -166,7 +166,6 @@ def coalesce(self) -> Table: """Returns a coalesced child table.""" return Table(j_table=self.j_table.coalesce()) - @auto_locking_op def snapshot(self, source_table: Table, do_init: bool = False, cols: Union[str, List[str]] = None) -> Table: """Produces an in-memory copy of a source table that refreshes when this table changes. @@ -186,11 +185,11 @@ def snapshot(self, source_table: Table, do_init: bool = False, cols: Union[str, """ try: cols = to_sequence(cols) - return Table(j_table=self.j_table.snapshot(source_table.j_table, do_init, *cols)) + with auto_locking_ctx(self, source_table): + return Table(j_table=self.j_table.snapshot(source_table.j_table, do_init, *cols)) except Exception as e: raise DHError(message="failed to create a snapshot table.") from e - @auto_locking_op def snapshot_history(self, source_table: Table) -> Table: """Produces an in-memory history of a source table that adds a new snapshot when this table (trigger table) changes. @@ -213,7 +212,8 @@ def snapshot_history(self, source_table: Table) -> Table: DHError """ try: - return Table(j_table=self.j_table.snapshotHistory(source_table.j_table)) + with auto_locking_ctx(self, source_table): + return Table(j_table=self.j_table.snapshotHistory(source_table.j_table)) except Exception as e: raise DHError(message="failed to create a snapshot history table.") from e @@ -297,7 +297,6 @@ def move_columns_up(self, cols: Union[str, Sequence[str]]) -> Table: except Exception as e: raise DHError(e, "table move_columns_up operation failed.") from e - @auto_locking_op def rename_columns(self, cols: Union[str, Sequence[str]]) -> Table: """The rename_columns method creates a new table with the specified columns renamed. @@ -312,11 +311,11 @@ def rename_columns(self, cols: Union[str, Sequence[str]]) -> Table: """ try: cols = to_sequence(cols) - return Table(j_table=self.j_table.renameColumns(*cols)) + with auto_locking_ctx(self): + return Table(j_table=self.j_table.renameColumns(*cols)) except Exception as e: raise DHError(e, "table rename_columns operation failed.") from e - @auto_locking_op def update(self, formulas: Union[str, Sequence[str]]) -> Table: """The update method creates a new table containing a new, in-memory column for each formula. @@ -331,11 +330,11 @@ def update(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - return Table(j_table=self.j_table.update(*formulas)) + with auto_locking_ctx(self): + return Table(j_table=self.j_table.update(*formulas)) except Exception as e: raise DHError(e, "table update operation failed.") from e - @auto_locking_op def lazy_update(self, formulas: Union[str, Sequence[str]]) -> Table: """The lazy_update method creates a new table containing a new, cached, formula column for each formula. @@ -350,7 +349,8 @@ def lazy_update(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - return Table(j_table=self.j_table.lazyUpdate(*formulas)) + with auto_locking_ctx(self): + return Table(j_table=self.j_table.lazyUpdate(*formulas)) except Exception as e: raise DHError(e, "table lazy_update operation failed.") from e @@ -390,7 +390,6 @@ def update_view(self, formulas: Union[str, Sequence[str]]) -> Table: except Exception as e: raise DHError(e, "table update_view operation failed.") from e - @auto_locking_op def select(self, formulas: Union[str, Sequence[str]] = None) -> Table: """The select method creates a new in-memory table that includes one column for each formula. If no formula is specified, all columns will be included. @@ -405,10 +404,11 @@ def select(self, formulas: Union[str, Sequence[str]] = None) -> Table: DHError """ try: - if not formulas: - return Table(j_table=self.j_table.select()) - formulas = to_sequence(formulas) - return Table(j_table=self.j_table.select(*formulas)) + with auto_locking_ctx(self): + if not formulas: + return Table(j_table=self.j_table.select()) + formulas = to_sequence(formulas) + return Table(j_table=self.j_table.select(*formulas)) except Exception as e: raise DHError(e, "table select operation failed.") from e @@ -459,7 +459,6 @@ def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = N except Exception as e: raise DHError(e, "table where operation failed.") from e - @auto_locking_op def where_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> Table: """The where_in method creates a new table containing rows from the source table, where the rows match values in the filter table. The filter is updated whenever either table changes. @@ -476,11 +475,11 @@ def where_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> Tabl """ try: cols = to_sequence(cols) - return Table(j_table=self.j_table.whereIn(filter_table.j_table, *cols)) + with auto_locking_ctx(self, filter_table): + return Table(j_table=self.j_table.whereIn(filter_table.j_table, *cols)) except Exception as e: raise DHError(e, "table where_in operation failed.") from e - @auto_locking_op def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> Table: """The where_not_in method creates a new table containing rows from the source table, where the rows do not match values in the filter table. @@ -497,7 +496,8 @@ def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> """ try: cols = to_sequence(cols) - return Table(j_table=self.j_table.whereNotIn(filter_table.j_table, *cols)) + with auto_locking_ctx(self, filter_table): + return Table(j_table=self.j_table.whereNotIn(filter_table.j_table, *cols)) except Exception as e: raise DHError(e, "table where_not_in operation failed.") from e @@ -681,7 +681,7 @@ def sort(self, order_by: Union[str, Sequence[str]], # Table operation category: Join # # region Join - @auto_locking_op + def natural_join(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None) -> Table: """The natural_join method creates a new table containing all of the rows and columns of this table, @@ -705,20 +705,20 @@ def natural_join(self, table: Table, on: Union[str, Sequence[str]], try: on = to_sequence(on) joins = to_sequence(joins) - if joins: - return Table( - j_table=self.j_table.naturalJoin( - table.j_table, ",".join(on), ",".join(joins) + with auto_locking_ctx(self, table): + if joins: + return Table( + j_table=self.j_table.naturalJoin( + table.j_table, ",".join(on), ",".join(joins) + ) + ) + else: + return Table( + j_table=self.j_table.naturalJoin(table.j_table, ",".join(on)) ) - ) - else: - return Table( - j_table=self.j_table.naturalJoin(table.j_table, ",".join(on)) - ) except Exception as e: raise DHError(e, "table natural_join operation failed.") from e - @auto_locking_op def exact_join(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None) -> Table: """The exact_join method creates a new table containing all of the rows and columns of this table plus additional columns containing data from the right table. For columns appended to the left table (joins), @@ -741,20 +741,20 @@ def exact_join(self, table: Table, on: Union[str, Sequence[str]], joins: Union[s try: on = to_sequence(on) joins = to_sequence(joins) - if joins: - return Table( - j_table=self.j_table.exactJoin( - table.j_table, ",".join(on), ",".join(joins) + with auto_locking_ctx(self, table): + if joins: + return Table( + j_table=self.j_table.exactJoin( + table.j_table, ",".join(on), ",".join(joins) + ) + ) + else: + return Table( + j_table=self.j_table.exactJoin(table.j_table, ",".join(on)) ) - ) - else: - return Table( - j_table=self.j_table.exactJoin(table.j_table, ",".join(on)) - ) except Exception as e: raise DHError(e, "table exact_join operation failed.") from e - @auto_locking_op def join(self, table: Table, on: Union[str, Sequence[str]] = None, joins: Union[str, Sequence[str]] = None) -> Table: """The join method creates a new table containing rows that have matching values in both tables. Rows that @@ -778,18 +778,18 @@ def join(self, table: Table, on: Union[str, Sequence[str]] = None, try: on = to_sequence(on) joins = to_sequence(joins) - if joins: - return Table( - j_table=self.j_table.join( - table.j_table, ",".join(on), ",".join(joins) + with auto_locking_ctx(self, table): + if joins: + return Table( + j_table=self.j_table.join( + table.j_table, ",".join(on), ",".join(joins) + ) ) - ) - else: - return Table(j_table=self.j_table.join(table.j_table, ",".join(on))) + else: + return Table(j_table=self.j_table.join(table.j_table, ",".join(on))) except Exception as e: raise DHError(e, "table join operation failed.") from e - @auto_locking_op def aj(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None, match_rule: AsOfMatchRule = AsOfMatchRule.LESS_THAN_EQUAL) -> Table: """The aj (as-of join) method creates a new table containing all of the rows and columns of the left table, @@ -819,11 +819,11 @@ def aj(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Sequ on = [_JMatchPair.of(_JPair.parse(p)) for p in on] if joins: joins = [_JMatchPair.of(_JPair.parse(p)) for p in joins] - return Table(j_table=self.j_table.aj(table.j_table, on, joins, match_rule.value)) + with auto_locking_ctx(self, table): + return Table(j_table=self.j_table.aj(table.j_table, on, joins, match_rule.value)) except Exception as e: raise DHError(e, "table as-of join operation failed.") from e - @auto_locking_op def raj(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None, match_rule: AsOfMatchRule = AsOfMatchRule.GREATER_THAN_EQUAL) -> Table: """The reverse-as-of join method creates a new table containing all of the rows and columns of the left table, @@ -856,7 +856,8 @@ def raj(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Seq on = [_JMatchPair.of(_JPair.parse(p)) for p in on] if joins: joins = [_JMatchPair.of(_JPair.parse(p)) for p in joins] - return Table(j_table=self.j_table.raj(table.j_table, on, joins, match_rule.value)) + with auto_locking_ctx(self, table): + return Table(j_table=self.j_table.raj(table.j_table, on, joins, match_rule.value)) except Exception as e: raise DHError(e, "table reverse-as-of join operation failed.") from e @@ -865,7 +866,7 @@ def raj(self, table: Table, on: Union[str, Sequence[str]], joins: Union[str, Seq # # Table operation category: Aggregation # region Aggregation - @auto_locking_op + def head_by(self, num_rows: int, by: Union[str, Sequence[str]] = None) -> Table: """The head_by method creates a new table containing the first number of rows for each group. @@ -881,11 +882,11 @@ def head_by(self, num_rows: int, by: Union[str, Sequence[str]] = None) -> Table: """ try: by = to_sequence(by) - return Table(j_table=self.j_table.headBy(num_rows, *by)) + with auto_locking_ctx(self): + return Table(j_table=self.j_table.headBy(num_rows, *by)) except Exception as e: raise DHError(e, "table head_by operation failed.") from e - @auto_locking_op def tail_by(self, num_rows: int, by: Union[str, Sequence[str]] = None) -> Table: """The tail_by method creates a new table containing the last number of rows for each group. @@ -901,7 +902,8 @@ def tail_by(self, num_rows: int, by: Union[str, Sequence[str]] = None) -> Table: """ try: by = to_sequence(by) - return Table(j_table=self.j_table.tailBy(num_rows, *by)) + with auto_locking_ctx(self): + return Table(j_table=self.j_table.tailBy(num_rows, *by)) except Exception as e: raise DHError(e, "table tail_by operation failed.") from e @@ -927,7 +929,6 @@ def group_by(self, by: Union[str, Sequence[str]] = None) -> Table: except Exception as e: raise DHError(e, "table group-by operation failed.") from e - @auto_locking_op def ungroup(self, cols: Union[str, Sequence[str]] = None) -> Table: """The ungroup method creates a new table in which array columns from the source table are unwrapped into separate rows. @@ -944,10 +945,11 @@ def ungroup(self, cols: Union[str, Sequence[str]] = None) -> Table: """ try: cols = to_sequence(cols) - if cols: - return Table(j_table=self.j_table.ungroup(*cols)) - else: - return Table(j_table=self.j_table.ungroup()) + with auto_locking_ctx(self): + if cols: + return Table(j_table=self.j_table.ungroup(*cols)) + else: + return Table(j_table=self.j_table.ungroup()) except Exception as e: raise DHError(e, "table ungroup operation failed.") from e @@ -1605,7 +1607,6 @@ def constituent_changes_permitted(self) -> bool: self._constituent_changes_permitted = self.j_partitioned_table.constituentChangesPermitted() return self._constituent_changes_permitted - @auto_locking_op def merge(self) -> Table: """Makes a new Table that contains all the rows from all the constituent tables. In the merged result, data from a constituent table is contiguous, and data from constituent tables appears in the same order the @@ -1619,7 +1620,8 @@ def merge(self) -> Table: DHError """ try: - return Table(j_table=self.j_partitioned_table.merge()) + with auto_locking_ctx(self): + return Table(j_table=self.j_partitioned_table.merge()) except Exception as e: raise DHError(e, "failed to merge all the constituent tables.") @@ -1705,7 +1707,6 @@ def constituent_tables(self) -> List[Table]: """Returns all the current constituent tables.""" return list(map(Table, self.j_partitioned_table.constituents())) - @auto_locking_op def transform(self, func: Callable[[Table], Table]) -> PartitionedTable: """Apply the provided function to all constituent Tables and produce a new PartitionedTable with the results as its constituents, with the same data for all other columns in the underlying partitioned Table. Note that @@ -1722,12 +1723,12 @@ def transform(self, func: Callable[[Table], Table]) -> PartitionedTable: """ try: j_operator = j_unary_operator(func, dtypes.from_jtype(Table.j_object_type.jclass)) - j_pt = self.j_partitioned_table.transform(j_operator) - return PartitionedTable(j_partitioned_table=j_pt) + with auto_locking_ctx(self): + j_pt = self.j_partitioned_table.transform(j_operator) + return PartitionedTable(j_partitioned_table=j_pt) except Exception as e: raise DHError(e, "failed to transform the PartitionedTable.") from e - @auto_locking_op def partitioned_transform(self, other: PartitionedTable, func: Callable[[Table, Table], Table]) -> PartitionedTable: """Join the underlying partitioned Tables from this PartitionedTable and other on the key columns, then apply the provided function to all pairs of constituent Tables with the same keys in order to produce a new @@ -1750,8 +1751,9 @@ def partitioned_transform(self, other: PartitionedTable, func: Callable[[Table, """ try: j_operator = j_binary_operator(func, dtypes.from_jtype(Table.j_object_type.jclass)) - j_pt = self.j_partitioned_table.partitionedTransform(other.j_partitioned_table, j_operator) - return PartitionedTable(j_partitioned_table=j_pt) + with auto_locking_ctx(self, other): + j_pt = self.j_partitioned_table.partitionedTransform(other.j_partitioned_table, j_operator) + return PartitionedTable(j_partitioned_table=j_pt) except Exception as e: raise DHError(e, "failed to transform the PartitionedTable with another PartitionedTable.") from e @@ -1802,7 +1804,6 @@ def __init__(self, j_pt_proxy): self.sanity_check_joins = self.j_pt_proxy.sanityChecksJoins() self.target = PartitionedTable(j_partitioned_table=self.j_pt_proxy.target()) - @auto_locking_op def head(self, num_rows: int) -> PartitionedTableProxy: """Applies the :meth:`~Table.head` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1818,11 +1819,11 @@ def head(self, num_rows: int) -> PartitionedTableProxy: DHError """ try: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.head(num_rows)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.head(num_rows)) except Exception as e: raise DHError(e, "head operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def tail(self, num_rows: int) -> PartitionedTableProxy: """Applies the :meth:`~Table.tail` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1838,11 +1839,11 @@ def tail(self, num_rows: int) -> PartitionedTableProxy: DHError """ try: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.tail(num_rows)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.tail(num_rows)) except Exception as e: raise DHError(e, "tail operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def reverse(self) -> PartitionedTableProxy: """Applies the :meth:`~Table.reverse` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1855,11 +1856,11 @@ def reverse(self) -> PartitionedTableProxy: DHError """ try: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.reverse()) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.reverse()) except Exception as e: raise DHError(e, "reverse operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def snapshot(self, source_table: Union[Table, PartitionedTableProxy], do_init: bool = False, cols: Union[str, List[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.snapshot` table operation to all constituent tables of the underlying @@ -1886,11 +1887,11 @@ def snapshot(self, source_table: Union[Table, PartitionedTableProxy], do_init: b try: cols = to_sequence(cols) table_op = jpy.cast(source_table.j_object, _JTableOperations) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.snapshot(table_op, do_init, *cols)) + with auto_locking_ctx(self, source_table): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.snapshot(table_op, do_init, *cols)) except Exception as e: raise DHError(e, "snapshot operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def sort(self, order_by: Union[str, Sequence[str]], order: Union[SortDirection, Sequence[SortDirection]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.sort` table operation to all constituent tables of the underlying partitioned @@ -1914,15 +1915,15 @@ def sort(self, order_by: Union[str, Sequence[str]], order = (SortDirection.ASCENDING,) * len(order_by) order = to_sequence(order) if len(order_by) != len(order): - raise DHError(message="The number of sort columns must be the same as the number of sort directions.") + raise ValueError("The number of sort columns must be the same as the number of sort directions.") sort_columns = [_sort_column(col, dir_) for col, dir_ in zip(order_by, order)] j_sc_list = j_array_list(sort_columns) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sort(j_sc_list)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sort(j_sc_list)) except Exception as e: raise DHError(e, "sort operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def sort_descending(self, order_by: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.sort_descending` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -1939,11 +1940,11 @@ def sort_descending(self, order_by: Union[str, Sequence[str]]) -> PartitionedTab """ try: order_by = to_sequence(order_by) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sortDescending(*order_by)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sortDescending(*order_by)) except Exception as e: raise DHError(e, "sort_descending operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.where` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -1961,11 +1962,11 @@ def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = N """ try: filters = to_sequence(filters) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.where(*filters)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.where(*filters)) except Exception as e: raise DHError(e, "where operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def where_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.where_in` table operation to all constituent tables of the underlying partitioned table with the provided filter table, and produces a new PartitionedTableProxy with the result @@ -1983,11 +1984,11 @@ def where_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> Part """ try: cols = to_sequence(cols) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereIn(filter_table.j_table, *cols)) + with auto_locking_ctx(self, filter_table): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereIn(filter_table.j_table, *cols)) except Exception as e: raise DHError(e, "where_in operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.where_not_in` table operation to all constituent tables of the underlying partitioned table with the provided filter table, and produces a new PartitionedTableProxy with the result @@ -2005,11 +2006,11 @@ def where_not_in(self, filter_table: Table, cols: Union[str, Sequence[str]]) -> """ try: cols = to_sequence(cols) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereNotIn(filter_table.j_table, *cols)) + with auto_locking_ctx(self, filter_table): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.whereNotIn(filter_table.j_table, *cols)) except Exception as e: raise DHError(e, "where_not_in operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.view` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2026,11 +2027,11 @@ def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """ try: formulas = to_sequence(formulas) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.view(*formulas)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.view(*formulas)) except Exception as e: raise DHError(e, "view operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def update_view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.update_view` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2047,11 +2048,11 @@ def update_view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTablePr """ try: formulas = to_sequence(formulas) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateView(*formulas)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateView(*formulas)) except Exception as e: raise DHError(e, "update_view operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def update(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """Applies the :meth:`~Table.update` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2068,11 +2069,11 @@ def update(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """ try: formulas = to_sequence(formulas) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.update(*formulas)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.update(*formulas)) except Exception as e: raise DHError(e, "update operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def select(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.select` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2089,11 +2090,11 @@ def select(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTable """ try: formulas = to_sequence(formulas) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.select(*formulas)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.select(*formulas)) except Exception as e: raise DHError(e, "select operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.select_distinct` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2110,11 +2111,11 @@ def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> Partiti """ try: formulas = to_sequence(formulas) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.selectDistinct(*formulas)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.selectDistinct(*formulas)) except Exception as e: raise DHError(e, "select_distinct operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def natural_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.natural_join` table operation to all constituent tables of the underlying @@ -2141,16 +2142,16 @@ def natural_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str on = to_sequence(on) joins = to_sequence(joins) table_op = jpy.cast(table.j_object, _JTableOperations) - if joins: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on), ",".join(joins))) - else: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on))) + with auto_locking_ctx(self, table): + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.naturalJoin(table_op, ",".join(on))) except Exception as e: raise DHError(e, "natural_join operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def exact_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.exact_join` table operation to all constituent tables of the underlying @@ -2177,16 +2178,16 @@ def exact_join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, on = to_sequence(on) joins = to_sequence(joins) table_op = jpy.cast(table.j_object, _JTableOperations) - if joins: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on), ",".join(joins))) - else: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on))) + with auto_locking_ctx(self, table): + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.exactJoin(table_op, ",".join(on))) except Exception as e: raise DHError(e, "exact_join operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]] = None, joins: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.join` table operation to all constituent tables of the underlying partitioned @@ -2213,16 +2214,16 @@ def join(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequen on = to_sequence(on) joins = to_sequence(joins) table_op = jpy.cast(table.j_object, _JTableOperations) - if joins: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on), ",".join(joins))) - else: - return PartitionedTableProxy( - j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on))) + with auto_locking_ctx(self, table): + if joins: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on), ",".join(joins))) + else: + return PartitionedTableProxy( + j_pt_proxy=self.j_pt_proxy.join(table_op, ",".join(on))) except Exception as e: raise DHError(e, "join operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def aj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None, match_rule: AsOfMatchRule = AsOfMatchRule.LESS_THAN_EQUAL) -> PartitionedTableProxy: @@ -2264,11 +2265,12 @@ def aj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence match_rule = _JAsOfJoinRule.LESS_THAN else: raise ValueError("invalid match_rule value") - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aj(table_op, on, joins, match_rule)) + + with auto_locking_ctx(self, table): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aj(table_op, on, joins, match_rule)) except Exception as e: raise DHError(e, "as-of join operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def raj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequence[str]], joins: Union[str, Sequence[str]] = None, match_rule: AsOfMatchRule = AsOfMatchRule.GREATER_THAN_EQUAL) -> PartitionedTableProxy: @@ -2311,11 +2313,11 @@ def raj(self, table: Union[Table, PartitionedTableProxy], on: Union[str, Sequenc else: raise ValueError("invalid match_rule value") - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.raj(table_op, on, joins, match_rule)) + with auto_locking_ctx(self, table): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.raj(table_op, on, joins, match_rule)) except Exception as e: raise DHError(e, "reverse as-of join operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def group_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.group_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2332,14 +2334,14 @@ def group_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProx """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.groupBy()) except Exception as e: raise DHError(e, "group-by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.agg_by` table operation to all constituent tables of the underlying partitioned @@ -2360,11 +2362,11 @@ def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], aggs = to_sequence(aggs) by = to_sequence(by) j_agg_list = j_array_list([agg.j_aggregation for agg in aggs]) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggBy(j_agg_list, *by)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggBy(j_agg_list, *by)) except Exception as e: raise DHError(e, "agg_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.agg_all_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2385,11 +2387,11 @@ def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> """ try: by = to_sequence(by) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggAllBy(agg.j_agg_spec, *by)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.aggAllBy(agg.j_agg_spec, *by)) except Exception as e: raise DHError(e, "agg_all_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.count_by` table operation to all constituent tables of the underlying partitioned table with the provided source table, and produces a new PartitionedTableProxy with the result tables as the @@ -2407,14 +2409,14 @@ def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> Partitione """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col, *by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col)) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.countBy(col)) except Exception as e: raise DHError(e, "count_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def first_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.first_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2431,14 +2433,14 @@ def first_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProx """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.firstBy()) except Exception as e: raise DHError(e, "first_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def last_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.last_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2455,14 +2457,14 @@ def last_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.lastBy()) except Exception as e: raise DHError(e, "last_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def min_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.min_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2479,14 +2481,14 @@ def min_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.minBy()) except Exception as e: raise DHError(e, "min_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def max_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.max_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2503,14 +2505,14 @@ def max_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.maxBy()) except Exception as e: raise DHError(e, "max_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2527,14 +2529,14 @@ def sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.sumBy()) except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.abs_sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2551,14 +2553,14 @@ def abs_sum_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTablePr """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.absSumBy()) except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.weighted_sum_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2576,14 +2578,14 @@ def weighted_sum_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Pa """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol, *by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol)) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wsumBy(wcol)) except Exception as e: raise DHError(e, "sum_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.avg_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2600,14 +2602,14 @@ def avg_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy()) except Exception as e: raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.weighted_avg_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2625,14 +2627,14 @@ def weighted_avg_by(self, wcol: str, by: Union[str, Sequence[str]] = None) -> Pa """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wavgBy(wcol, *by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(wcol)) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.wavgBy(wcol, *by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.avgBy(wcol)) except Exception as e: raise DHError(e, "avg_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.median_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its @@ -2649,14 +2651,14 @@ def median_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTablePro """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.medianBy()) except Exception as e: raise DHError(e, "median_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def std_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.std_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2673,14 +2675,14 @@ def std_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.stdBy()) except Exception as e: raise DHError(e, "std_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def var_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.var_by` table operation to all constituent tables of the underlying partitioned table, and produces a new PartitionedTableProxy with the result tables as the constituents of its underlying @@ -2697,14 +2699,14 @@ def var_by(self, by: Union[str, Sequence[str]] = None) -> PartitionedTableProxy: """ try: by = to_sequence(by) - if by: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy(*by)) - else: - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy()) + with auto_locking_ctx(self): + if by: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy(*by)) + else: + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.varBy()) except Exception as e: raise DHError(e, "var_by operation on the PartitionedTableProxy failed.") from e - @auto_locking_op def update_by(self, ops: Union[UpdateByOperation, List[UpdateByOperation]], by: Union[str, List[str]] = None) -> PartitionedTableProxy: """Applies the :meth:`~Table.update_by` table operation to all constituent tables of the underlying partitioned @@ -2724,6 +2726,7 @@ def update_by(self, ops: Union[UpdateByOperation, List[UpdateByOperation]], try: ops = to_sequence(ops) by = to_sequence(by) - return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateBy(j_array_list(ops), *by)) + with auto_locking_ctx(self): + return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateBy(j_array_list(ops), *by)) except Exception as e: raise DHError(e, "update-by operation on the PartitionedTableProxy failed.") from e diff --git a/py/server/deephaven/table_factory.py b/py/server/deephaven/table_factory.py index 0fe6e2bb8df..311ced26c23 100644 --- a/py/server/deephaven/table_factory.py +++ b/py/server/deephaven/table_factory.py @@ -13,7 +13,7 @@ from deephaven.dtypes import DType from deephaven.jcompat import to_sequence from deephaven.table import Table -from deephaven.ugp import auto_locking_op +from deephaven.ugp import auto_locking_ctx _JTableFactory = jpy.get_type("io.deephaven.engine.table.TableFactory") _JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") @@ -80,7 +80,6 @@ def new_table(cols: List[InputColumn]) -> Table: raise DHError(e, "failed to create a new time table.") from e -@auto_locking_op def merge(tables: List[Table]): """Combines two or more tables into one aggregate table. This essentially appends the tables one on top of the other. Null tables are ignored. @@ -95,12 +94,12 @@ def merge(tables: List[Table]): DHError """ try: - return Table(j_table=_JTableTools.merge([t.j_table for t in tables])) + with auto_locking_ctx(*tables): + return Table(j_table=_JTableTools.merge([t.j_table for t in tables])) except Exception as e: raise DHError(e, "merge tables operation failed.") from e -@auto_locking_op def merge_sorted(tables: List[Table], order_by: str) -> Table: """Combines two or more tables into one sorted, aggregate table. This essentially stacks the tables one on top of the other and sorts the result. Null tables are ignored. mergeSorted is more efficient than using merge @@ -117,7 +116,8 @@ def merge_sorted(tables: List[Table], order_by: str) -> Table: DHError """ try: - return Table(j_table=_JTableTools.mergeSorted(order_by, *[t.j_table for t in tables])) + with auto_locking_ctx(*tables): + return Table(j_table=_JTableTools.mergeSorted(order_by, *[t.j_table for t in tables])) except Exception as e: raise DHError(e, "merge sorted operation failed.") from e diff --git a/py/server/deephaven/ugp.py b/py/server/deephaven/ugp.py index 1dde2269c13..258869477a3 100644 --- a/py/server/deephaven/ugp.py +++ b/py/server/deephaven/ugp.py @@ -106,9 +106,9 @@ def _has_refreshing_tables(*args, **kwargs): def auto_locking_op(f: Callable) -> Callable: - """A decorator for annotating unsafe Table operations. It ensures that the decorated Table operation runs under - the UGP shared lock when ugp.auto_locking is True, the target table is refreshing, and the current thread doesn't - own any UGP locks.""" + """A decorator for annotating unsafe Table operations. It ensures that the decorated function runs under the UGP + shared lock if ugp.auto_locking is True, the target table-like object or any table-like arguments are refreshing, + and the current thread doesn't own any UGP locks.""" @wraps(f) def do_locked(*args, **kwargs): @@ -122,3 +122,18 @@ def do_locked(*args, **kwargs): return f(*args, **kwargs) return do_locked + + +@contextlib.contextmanager +def auto_locking_ctx(*args, **kwargs): + """An auto-locking aware context manager. It ensures that the enclosed code block runs under the UGP shared lock if + ugp.auto_locking is True, the target table-like object or any table-like arguments are refreshing, and the current + thread doesn't own any UGP locks.""" + if (not _has_refreshing_tables(*args, **kwargs) + or not auto_locking + or has_shared_lock() + or has_exclusive_lock()): + yield + else: + with shared_lock(): + yield From 984243121819b82394df5dedcdafc702e2328fc0 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Thu, 28 Jul 2022 12:11:51 -0400 Subject: [PATCH 043/215] Fix issue with merge of static and refreshing tables where the static table incidentally has liveness reference count zero (#2694) --- .../impl/select/analyzers/SelectColumnLayer.java | 16 +++++++++++++--- .../engine/table/impl/PartitionedTableTest.java | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java index 82e7e33f675..55249332ccd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java @@ -19,6 +19,7 @@ import io.deephaven.engine.table.impl.sources.ChunkedBackingStoreExposedWritableSource; import io.deephaven.engine.table.impl.sources.ReinterpretUtils; import io.deephaven.engine.table.impl.util.ChunkUtils; +import io.deephaven.engine.updategraph.DynamicNode; import io.deephaven.engine.updategraph.UpdateCommitterEx; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker; @@ -419,6 +420,14 @@ private Boolean doApplyUpdate(final TableUpdate upstream, final UpdateHelper hel return null; } + private static void maybeManage( + @NotNull final LivenessNode liveResultOwner, + @Nullable final LivenessReferent value) { + if (value != null && DynamicNode.notDynamicOrIsRefreshing(value)) { + liveResultOwner.manage(value); + } + } + private > CT maybeManageAdds( @NotNull final CT resultChunk, @Nullable final LivenessNode liveResultOwner) { @@ -427,7 +436,7 @@ private > CT maybeManageAdds( resultChunk.asObjectChunk().asTypedObjectChunk(); final int chunkSize = typedChunk.size(); for (int ii = 0; ii < chunkSize; ++ii) { - liveResultOwner.manage(typedChunk.get(ii)); + maybeManage(liveResultOwner, typedChunk.get(ii)); } } return resultChunk; @@ -468,7 +477,7 @@ private void handleModifyManagement( prevModifiedResults.set(ci, null); ++sameCount; } else { - liveResultOwner.manage(typedModifiedResults.get(ci)); + maybeManage(liveResultOwner, typedModifiedResults.get(ci)); } } if (prevModifiedResults.size() == sameCount) { @@ -498,7 +507,8 @@ private synchronized void unmanagePreviousValues(@NotNull final LivenessNode liv liveResultOwner.tryUnmanage(prevValueChunksToUnmanage.stream() .flatMap(pvc -> StreamSupport.stream(Spliterators.spliterator( new ObjectChunkIterator<>(pvc), pvc.size(), Spliterator.ORDERED), false)) - .filter(Objects::nonNull)); + .filter(Objects::nonNull) + .filter(DynamicNode::notDynamicOrIsRefreshing)); prevValueChunksToUnmanage.forEach(SafeCloseable::closeSingle); prevValueChunksToUnmanage.clear(); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java index 01e6ba97bd9..5c1b23b94f0 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java @@ -769,4 +769,19 @@ public void testMergeConstituentChanges() { assertTableEquals(matching, merged); } } + + public void testMergeStaticAndRefreshing() { + final Table staticTable; + try (final SafeCloseable ignored = LivenessScopeStack.open()) { + staticTable = emptyTable(100).update("II=ii"); + } + final Table refreshingTable = emptyTable(100).update("II=100 + ii"); + refreshingTable.setRefreshing(true); + final Table mergedTable = PartitionedTableFactory.ofTables(staticTable, refreshingTable).merge(); + assertTableEquals(mergedTable, emptyTable(200).update("II=ii")); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + mergedTable.getRowSet().writableCast().removeRange(0, 1); + ((BaseTable) mergedTable).notifyListeners(i(), ir(0, 1), i()); + }); + } } From bfc55c7c2fa884620be207adb91f2843a866b7d2 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 28 Jul 2022 09:15:38 -0700 Subject: [PATCH 044/215] Ensure that the server has been properly initialized before import (#2644) --- .../io/deephaven/engine/util/jpy/JpyInit.java | 18 ++++++++-- .../deephaven_server/start_jvm.py | 6 ++-- py/server/deephaven/__init__.py | 6 ++++ .../server/script_session/__init__.py | 2 -- py/server/deephaven_internal/__init__.py | 0 py/server/deephaven_internal/jvm/__init__.py | 36 +++++++++++++++++++ py/server/test_helper/__init__.py | 7 ++-- .../server/runner/DeephavenApiServer.java | 4 +-- sphinx/source/conf.py | 6 ++-- 9 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 py/server/deephaven_internal/__init__.py create mode 100644 py/server/deephaven_internal/jvm/__init__.py diff --git a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java index 52a37da9c5d..d2e388898a0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java @@ -11,6 +11,8 @@ import io.deephaven.jpy.JpyConfigFromSubprocess; import io.deephaven.jpy.JpyConfigSource; import org.jpy.PyLibInitializer; +import org.jpy.PyModule; +import org.jpy.PyObject; import java.io.IOException; import java.time.Duration; @@ -39,10 +41,10 @@ public static synchronized void init() throws IOException, InterruptedException, final JpyConfig explicitConfig = new JpyConfigLoader(Configuration.getInstance()).asJpyConfig(); if (!explicitConfig.isEmpty()) { init(new JpyConfigExt(explicitConfig)); - return; + } else { + final JpyConfigSource fromSubprocess = JpyConfigFromSubprocess.fromSubprocess(Duration.ofSeconds(10)); + init(new JpyConfigExt(fromSubprocess.asJpyConfig())); } - final JpyConfigSource fromSubprocess = JpyConfigFromSubprocess.fromSubprocess(Duration.ofSeconds(10)); - init(new JpyConfigExt(fromSubprocess.asJpyConfig())); } private static void init(JpyConfigExt jpyConfig) { @@ -51,5 +53,15 @@ private static void init(JpyConfigExt jpyConfig) { jpyConfig.initPython(); jpyConfig.startPython(); log.info().append("Started Python interpreter").endl(); + markJvmReady(); + } + + private static void markJvmReady() { + // noinspection EmptyTryBlock,unused + try ( + final PyModule deephavenJpyModule = PyModule.importModule("deephaven_internal.jvm"); + final PyObject obj = deephavenJpyModule.callMethod("ready")) { + // empty + } } } diff --git a/py/embedded-server/deephaven_server/start_jvm.py b/py/embedded-server/deephaven_server/start_jvm.py index 2728c725634..359605bf08f 100644 --- a/py/embedded-server/deephaven_server/start_jvm.py +++ b/py/embedded-server/deephaven_server/start_jvm.py @@ -4,10 +4,11 @@ import glob import itertools -import jpyutil import os import pathlib +from deephaven_internal import jvm + # TODO(deephaven-core#2592): Generalize start_jvm to work with importlib.resources def _jars_path(): @@ -90,7 +91,7 @@ def start_jvm( else: jvm_args.extend(required_jvm_args) - jpyutil.init_jvm( + jvm.init_jvm( java_home=java_home, # jvm_dll=jvm_dll, jvm_classpath=jvm_classpath, @@ -98,5 +99,6 @@ def start_jvm( jvm_options=jvm_args, # config_file=config_file, config=config) + import jpy jpy.VerboseExceptions.enabled = True diff --git a/py/server/deephaven/__init__.py b/py/server/deephaven/__init__.py index 776ebaf966b..f60aae3125e 100644 --- a/py/server/deephaven/__init__.py +++ b/py/server/deephaven/__init__.py @@ -9,6 +9,12 @@ __version__ = "0.15.0" +from deephaven_internal import jvm +try: + jvm.check_ready() +finally: + del jvm + from .dherror import DHError from .table import SortDirection, AsOfMatchRule from .csv import read as read_csv diff --git a/py/server/deephaven/server/script_session/__init__.py b/py/server/deephaven/server/script_session/__init__.py index 1d94b1559cf..2156809a4d3 100644 --- a/py/server/deephaven/server/script_session/__init__.py +++ b/py/server/deephaven/server/script_session/__init__.py @@ -6,8 +6,6 @@ from jpy import JType from deephaven._wrapper import JObjectWrapper -from deephaven.plot import Figure -import deephaven.table def create_change_list(from_snapshot, to_snapshot): diff --git a/py/server/deephaven_internal/__init__.py b/py/server/deephaven_internal/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/py/server/deephaven_internal/jvm/__init__.py b/py/server/deephaven_internal/jvm/__init__.py new file mode 100644 index 00000000000..722da5d0dc4 --- /dev/null +++ b/py/server/deephaven_internal/jvm/__init__.py @@ -0,0 +1,36 @@ +_is_ready = False + +def ready(): + """Marks the JVM as ready. Should be called by Deephaven implementation code. In the case of the Java server process, + this should be called right after Python has been initialized. In the case of the embedded Python server process, + this should be called right after the JVM has been initialized.""" + global _is_ready + _is_ready = True + +def check_ready(): + """Checks if the JVM is ready (ie, if ready() has been called). Should be called by Deephaven implementation code. + Raises an exception if the JVM is not ready.""" + # Note: we might be tempted to store the source of truth for this in Java, but we aren't able to do that. + # `import jpy` has potential side effects, and may improperly start the JVM. + global _is_ready + if not _is_ready: + raise Exception("The Deephaven Server has not been initialized. " + "Please ensure that deephaven_server.Server has been constructed before importing deephaven.") + +def preload_jvm_dll(*args, **kwargs): + """A wrapper around jpyutil.preload_jvm_dll(...).""" + import jpyutil + result = jpyutil.preload_jvm_dll(*args, **kwargs) + return result + +def init_jvm(*args, **kwargs): + """A wrapper around jpyutil.init_jvm(...). Should be called by Deephaven implementation code. + Calls ready() after jpyutil.init_jvm(...).""" + # Note: we might be able to use our own logic instead of jpyutil here in the future + import jpyutil + try: + result = jpyutil.init_jvm(*args, **kwargs) + except ImportError as e: + raise ImportError("Unable to initialize JVM, try setting the environment variable JAVA_HOME (JDK 11+ required)") from e + ready() + return result diff --git a/py/server/test_helper/__init__.py b/py/server/test_helper/__init__.py index 1954eecf73c..eb38cba25bf 100644 --- a/py/server/test_helper/__init__.py +++ b/py/server/test_helper/__init__.py @@ -10,11 +10,10 @@ from glob import glob from typing import Dict -import jpyutil - +from deephaven_internal import jvm def start_jvm(jvm_props: Dict[str, str] = None): - jpyutil.preload_jvm_dll() + jvm.preload_jvm_dll() import jpy """ This function uses the default DH property file to embed the Deephaven server and starts a Deephaven Python @@ -86,7 +85,7 @@ def start_jvm(jvm_props: Dict[str, str] = None): # Start up the JVM jpy.VerboseExceptions.enabled = True - jpyutil.init_jvm( + jvm.init_jvm( jvm_classpath=_expandWildcardsInList(jvm_classpath.split(os.path.pathsep)), jvm_properties=jvm_properties, jvm_options=jvm_options diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index aeb2d68d3e1..cb84fdbf4e1 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -12,9 +12,9 @@ import io.deephaven.engine.util.ScriptSession; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; -import io.deephaven.server.plugin.PluginRegistration; import io.deephaven.server.appmode.ApplicationInjector; import io.deephaven.server.log.LogInit; +import io.deephaven.server.plugin.PluginRegistration; import io.deephaven.server.session.SessionService; import io.deephaven.uri.resolver.UriResolver; import io.deephaven.uri.resolver.UriResolvers; @@ -108,6 +108,7 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time AbstractScriptSession.createScriptCache(); log.info().append("Initializing Script Session...").endl(); + scriptSessionProvider.get(); pluginRegistration.registerAll(); @@ -133,7 +134,6 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time log.info().append("Starting server...").endl(); server.start(); log.info().append("Server started on port ").append(server.getPort()).endl(); - return this; } diff --git a/sphinx/source/conf.py b/sphinx/source/conf.py index ef62529da9b..6e7dad44c1b 100644 --- a/sphinx/source/conf.py +++ b/sphinx/source/conf.py @@ -77,8 +77,10 @@ # up. from glob import glob import os -import jpyutil -jpyutil.init_jvm( + +from deephaven_internal import jvm + +jvm.init_jvm( jvm_classpath=glob(os.environ.get('DEEPHAVEN_CLASSPATH')), jvm_properties={ 'Configuration.rootFile': os.environ.get('DEEPHAVEN_PROPFILE') From 9c5645006982b6f5574cedae07b6a991c21de412 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 28 Jul 2022 14:37:44 -0400 Subject: [PATCH 045/215] Update Figure Generator to allow nullable parameters (#2687) - Allow parameters to be specified as nullable - For nullable parameters, don't check that they're not null when verifying --- .../plot/util/GeneratePyV2FigureAPI.java | 105 +++++++++++++----- 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java index 74a76d24728..c57916d081d 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java @@ -242,6 +242,7 @@ private static class Key implements Comparable { private final boolean isStatic; private final boolean isPublic; + public Key(final Method m) { this.name = m.getName(); this.isStatic = Modifier.isStatic(m.getModifiers()); @@ -370,24 +371,37 @@ private static class PyFunc implements Comparable { private final FunctionCallType functionCallType; private final String[] javaFuncs; private final String[] requiredParams; + private final String[] nullableParams; private final String pydoc; private final boolean generate; public PyFunc(final String name, final FunctionCallType functionCallType, final String[] javaFuncs, - final String[] requiredParams, final String pydoc, final boolean generate) { + final String[] requiredParams, final String[] nullableParams, final String pydoc, + final boolean generate) { this.name = name; this.functionCallType = functionCallType; this.javaFuncs = javaFuncs; this.requiredParams = requiredParams == null ? new String[] {} : requiredParams; + this.nullableParams = nullableParams == null ? new String[] {} : nullableParams; this.pydoc = pydoc; this.generate = generate; } + public PyFunc(final String name, final FunctionCallType functionCallType, final String[] javaFuncs, + final String[] requiredParams, final String pydoc, final boolean generate) { + this(name, functionCallType, javaFuncs, requiredParams, null, pydoc, generate); + } + public PyFunc(final String name, final FunctionCallType functionCallType, final String[] javaFuncs, final String[] requiredParams, final String pydoc) { this(name, functionCallType, javaFuncs, requiredParams, pydoc, true); } + public PyFunc(final String name, final FunctionCallType functionCallType, final String[] javaFuncs, + final String[] requiredParams, final String[] nullableParams, final String pydoc) { + this(name, functionCallType, javaFuncs, requiredParams, nullableParams, pydoc, true); + } + @Override public String toString() { return "PyFunc{" + @@ -443,12 +457,22 @@ public Map> getSignatures(final Map javaArgNames(final ArrayList s * Gets the valid Python method argument name combinations. * * @param signatures java functions with the same name. + * @param pyArgMap possible python function arguments * @return valid Java method argument name combinations. */ private static List pyArgNames(final ArrayList signatures, final Map pyArgMap) { - final Set> seen = new HashSet<>(); + return pyArgNames(signatures, pyArgMap, new String[] {}); + } + /** + * Gets the valid Python method argument name combinations. + * + * @param signatures java functions with the same name. + * @param pyArgMap possible python function arguments + * @param excludeArgs arguments to exclude from the output + * @return valid Java method argument name combinations. + */ + private static List pyArgNames(final ArrayList signatures, + final Map pyArgMap, String[] excludeArgs) { + final Set> seen = new HashSet<>(); return javaArgNames(signatures) .stream() - .map(an -> Arrays.stream(an).map(s -> pyArgMap.get(s).name).toArray(String[]::new)) + .map(an -> Arrays.stream(an).map(s -> pyArgMap.get(s).name) + .filter(s -> !Arrays.stream(excludeArgs).anyMatch(ex -> ex.equals(s))) + .toArray(String[]::new)) .filter(an -> seen.add(new HashSet<>(Arrays.asList(an)))) .sorted((first, second) -> { final int c1 = Integer.compare(first.length, second.length); @@ -766,42 +805,51 @@ private void generatePyFuncCallSingleton(final StringBuilder sb, for (final Map.Entry> entry : signatures.entrySet()) { final Key key = entry.getKey(); final ArrayList sigs = entry.getValue(); - final List argNames = pyArgNames(sigs, pyArgMap); + final List argNameList = pyArgNames(sigs, pyArgMap); + final List nonNullableArgNameList = pyArgNames(sigs, pyArgMap, nullableParams); + + if (argNameList.size() != nonNullableArgNameList.size()) { + throw new RuntimeException( + "Full argument list size " + argNameList.size() + " and non-nullable list size " + + nonNullableArgNameList.size() + " do not match for " + key); + } - for (final String[] an : argNames) { - validateArgNames(an, alreadyGenerated, signatures, pyArgMap); - final String[] quoted_an = Arrays.stream(an).map(s -> "\"" + s + "\"").toArray(String[]::new); + for (int i = 0; i < nonNullableArgNameList.size(); i++) { + final String[] argNames = argNameList.get(i); + final String[] nonNullableArgNames = nonNullableArgNameList.get(i); + validateArgNames(argNames, alreadyGenerated, signatures, pyArgMap); + final String[] quotedNonNullableArgNames = + Arrays.stream(nonNullableArgNames).map(s -> "\"" + s + "\"").toArray(String[]::new); + final boolean hasNullables = nonNullableArgNames.length < argNames.length; - if (quoted_an.length == 0) { + if (argNames.length == 0) { sb.append(INDENT) .append(INDENT) .append(isFirst ? "if" : "elif") - .append(" not non_null_args:\n") - .append(INDENT) - .append(INDENT) + .append(" not non_null_args:\n"); + } else if (hasNullables) { + sb.append(INDENT) .append(INDENT) - .append("return Figure(self.j_figure.") - .append(key.name) - .append("(") - .append(String.join(", ", an)) - .append("))\n"); + .append(isFirst ? "if" : "elif") + .append(" set({") + .append(String.join(", ", quotedNonNullableArgNames)) + .append("}).issubset(non_null_args):\n"); } else { sb.append(INDENT) .append(INDENT) .append(isFirst ? "if" : "elif") .append(" non_null_args == {") - .append(String.join(", ", quoted_an)) - .append("}:\n") - .append(INDENT) - .append(INDENT) - .append(INDENT) - .append("return Figure(self.j_figure.") - .append(key.name) - .append("(") - .append(String.join(", ", an)) - .append("))\n"); - + .append(String.join(", ", quotedNonNullableArgNames)) + .append("}:\n"); } + sb.append(INDENT) + .append(INDENT) + .append(INDENT) + .append("return Figure(self.j_figure.") + .append(key.name) + .append("(") + .append(String.join(", ", argNames)) + .append("))\n"); isFirst = false; } } @@ -824,7 +872,6 @@ private void generatePyFuncCallSingleton(final StringBuilder sb, */ private void generatePyFuncCallSequential(final StringBuilder sb, final Map> signatures, final Map pyArgMap) { - sb.append(INDENT) .append(INDENT) .append("f_called = False\n") From b07a9e2a0a7211906b8de15e948df0850615d536 Mon Sep 17 00:00:00 2001 From: SuperTails Date: Thu, 28 Jul 2022 14:36:46 -0600 Subject: [PATCH 046/215] Fix broken Go client documentation (#2696) --- go/LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++ go/NOTICE | 14 ++++ go/README.md | 24 ++++-- 3 files changed, 235 insertions(+), 5 deletions(-) create mode 100644 go/LICENSE create mode 100644 go/NOTICE diff --git a/go/LICENSE b/go/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/go/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/go/NOTICE b/go/NOTICE new file mode 100644 index 00000000000..5b988577568 --- /dev/null +++ b/go/NOTICE @@ -0,0 +1,14 @@ +Deephaven Go Client +Copyright 2022 Deephaven Data Labs + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/go/README.md b/go/README.md index 399c86500a6..05b530c4e4e 100644 --- a/go/README.md +++ b/go/README.md @@ -27,15 +27,29 @@ Examples assume the server is running on `localhost:10000` by default, but can be configured by setting the `DH_HOST` and `DH_PORT` environment variables. An example can be run using one of the following commands: ```bash -$ go test -v ./client/example_basic_query_test.go -$ go test -v ./client/example_fetch_table_test.go -$ go test -v ./client/example_import_table_test.go -$ go test -v ./client/example_input_table_test.go -$ go test -v ./client/example_run_script_test.go +$ go test -v ./pkg/client/example_table_ops_test.go +$ go test -v ./pkg/client/example_fetch_table_test.go +$ go test -v ./pkg/client/example_import_table_test.go +$ go test -v ./pkg/client/example_input_table_test.go +$ go test -v ./pkg/client/example_run_script_test.go ``` The source code is available in the directory for each example. +## Using the Client + +To add the client as a dependency to your project, run: +```bash +go get github.com/deephaven/deephaven-core/go +``` +The client package can then be imported: +```go +import ( + "github.com/deephaven/deephaven-core/go/pkg/client" +) +``` +Detailed information on how to use the client package can be found in the `pkg/client` directories of the docs. + ## Viewing Docs Online documentation for this package can be found [on this page](https://pkg.go.dev/github.com/deephaven/deephaven-core/go/). From 913ee933f10301340baae3400c97e772b98e3e61 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 28 Jul 2022 18:02:04 -0400 Subject: [PATCH 047/215] Clean up the treemap API (#2678) - Rename API from `plot_tree_map` to `plot_treemap` for consistency (treemap is one word) - Re-order params to match order of other plotting functions (series name first) - Make some parameters optional/allow parameters to be specified as nullable - For nullable parameters, don't check that they're not null when verifying --- .../util/GeneratePlottingConvenience.java | 2 +- .../plot/util/GeneratePyV2FigureAPI.java | 18 ++-- .../src/main/java/io/deephaven/plot/Axes.java | 26 +++--- .../main/java/io/deephaven/plot/AxesImpl.java | 13 ++- .../main/java/io/deephaven/plot/Figure.java | 2 +- .../java/io/deephaven/plot/FigureImpl.java | 4 +- .../deephaven/plot/PlottingConvenience.java | 6 +- ...=> CategoryTreemapDataSeriesTableMap.java} | 31 +++---- .../figure/FigureWidgetTranslator.java | 34 +++++--- py/server/deephaven/plot/figure.py | 85 ++++++++++--------- .../client/api/console/JsVariableChanges.java | 3 +- .../api/widget/plot/enums/JsSourceType.java | 1 - 12 files changed, 111 insertions(+), 114 deletions(-) rename Plot/src/main/java/io/deephaven/plot/datasets/category/{CategoryTreeMapDataSeriesTableMap.java => CategoryTreemapDataSeriesTableMap.java} (81%) diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java index 20273e98b04..d865afbc4f6 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java @@ -393,7 +393,7 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio "errorBarYBy", "catErrorBar", "catErrorBarBy", - "treeMapPlot")); + "treemapPlot")); @SuppressWarnings("unchecked") GeneratePlottingConvenience gen = new GeneratePlottingConvenience(staticImports, imports, diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java index c57916d081d..ed0f8a19a90 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePyV2FigureAPI.java @@ -1159,12 +1159,12 @@ private static Map getPyArgs() { rst.put("pointSizes", rst.get("pointSize")); rst.put("pointLabelFormat", new PyArg(84, "label_format", taStr, "point label format.", null)); rst.put("visible", new PyArg(85, "visible", taInt, "true to draw the design element; false otherwise.", null)); - rst.put("values", new PyArg(10, "values_column", taStr, "", null)); - rst.put("ids", new PyArg(10, "ids_column", taStr, "", null)); - rst.put("parents", new PyArg(10, "parents_column", taStr, "", null)); - rst.put("labels", new PyArg(10, "labels_column", taStr, "", null)); - rst.put("text", new PyArg(10, "text_column", taStr, "", null)); - rst.put("hoverText", new PyArg(10, "hover_text_column", taStr, "", null)); + rst.put("ids", new PyArg(86, "id", taStr, "column name containing IDs", null)); + rst.put("parents", new PyArg(87, "parent", taStr, "column name containing parent IDs", null)); + rst.put("values", new PyArg(88, "value", taStr, "column name containing values", null)); + rst.put("labels", new PyArg(89, "label", taStr, "column name containing labels", null)); + rst.put("hoverTexts", new PyArg(90, "hover_text", taStr, "column name containing hover text", null)); + rst.put("colors", new PyArg(91, "color", taStr, "column name containing color", null)); //////////////////////////////////////////////////////////////// @@ -1273,8 +1273,10 @@ private static List getPyFuncs() { rst.add(new PyFunc("plot_ohlc", SINGLETON, new String[] {"ohlcPlot", "ohlcPlotBy"}, new String[] {"series_name"}, "Creates an open-high-low-close plot.")); - rst.add(new PyFunc("plot_tree_map", SINGLETON, new String[] {"treeMapPlot"}, - new String[] {"t", "ids", "parents"}, "")); + rst.add(new PyFunc("plot_treemap", SINGLETON, new String[] {"treemapPlot"}, + new String[] {"series_name", "t", "id", "parent"}, + new String[] {"value", "label", "hover_text", "color"}, + "Creates a treemap. Must have only one root.")); //////////////////////////////////////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/Axes.java b/Plot/src/main/java/io/deephaven/plot/Axes.java index e4d0c4ab75c..32389ab65c1 100644 --- a/Plot/src/main/java/io/deephaven/plot/Axes.java +++ b/Plot/src/main/java/io/deephaven/plot/Axes.java @@ -1367,20 +1367,18 @@ CategoryDataSeries piePlot(final Comparable seriesName, final SelectableDataSet ////////////////////////// tree map plot ////////////////////////// /** - * Creates a treemap plot. Required columns are values, ids, and parents, the rest can be null. - * @param seriesName - * @param t - * @param values - * @param ids - * @param parents - * @param labels - * @param text - * @param color - * @param hoverText - * @return - */ - CategoryDataSeries treeMapPlot(Comparable seriesName, Table t, String values, String ids, String parents, @Nullable String labels, @Nullable String text, @Nullable String color, @Nullable String hoverText); - + * Creates a treemap plot. Required columns are ids and parents, the rest can be null. + * @param seriesName name of the created dataset + * @param t table + * @param ids column in {@code t} holding ID data + * @param parents column in {@code t} holding parent ID data + * @param values column in {@code t} holding value data + * @param labels column in {@code t} holding label data + * @param hoverTexts column in {@code t} holding hover text data + * @param colors column in {@code t} holding color data + * @return dataset created for plot + */ + CategoryDataSeries treemapPlot(Comparable seriesName, Table t, String ids, String parents, @Nullable String values, @Nullable String labels, @Nullable String hoverTexts, @Nullable String colors); ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// ////////////////////////////// TO REGENERATE RUN GenerateAxesPlotMethods ////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java index e967553e79c..f3e063e8884 100644 --- a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java @@ -255,7 +255,7 @@ private void configureOHLCPlot() { initialize(); } - private void configureTreeMapPlot() { + private void configureTreemapPlot() { this.setDimension(2); chart.setChartType(ChartType.TREEMAP); xAxis().setType(AxisImpl.Type.CATEGORY); @@ -1866,9 +1866,9 @@ public CategoryDataSeriesInternal piePlot(final Comparable seriesName, final Sel // region Tree Map - private CategoryDataSeriesInternal treeMapPlot(final CategoryDataSeriesInternal ds, final TableHandle[] tableHandles, + private CategoryDataSeriesInternal treemapPlot(final CategoryDataSeriesInternal ds, final TableHandle[] tableHandles, final SwappableTable[] swappableTables) { - configureTreeMapPlot(); + configureTreemapPlot(); if (tableHandles != null) { for (TableHandle tableHandle : tableHandles) { @@ -1888,12 +1888,11 @@ private CategoryDataSeriesInternal treeMapPlot(final CategoryDataSeriesInternal @Override - public CategoryDataSeries treeMapPlot(Comparable seriesName, Table t, String values, String ids, String parents, @Nullable String labels, @Nullable String text, @Nullable String color, @Nullable String hoverText) { - final TableHandle h = PlotUtils.createCategoryTableHandle(t, new String[] { ids }, values, parents, labels, text, color, hoverText); - return treeMapPlot(new CategoryTreeMapDataSeriesTableMap(this, dataSeries.nextId(), seriesName, h, ids, parents, labels, values, text, color, hoverText), new TableHandle[]{h}, null); + public CategoryDataSeries treemapPlot(Comparable seriesName, Table t, String ids, String parents, @Nullable String values, @Nullable String labels, @Nullable String hoverText, @Nullable String color) { + final TableHandle h = PlotUtils.createCategoryTableHandle(t, new String[] { ids }, parents, values, labels, hoverText, color); + return treemapPlot(new CategoryTreemapDataSeriesTableMap(this, dataSeries.nextId(), seriesName, h, ids, parents, values, labels, hoverText, color), new TableHandle[]{h}, null); } - // endregion ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// diff --git a/Plot/src/main/java/io/deephaven/plot/Figure.java b/Plot/src/main/java/io/deephaven/plot/Figure.java index 1f291f140a1..e57a7bd6a88 100644 --- a/Plot/src/main/java/io/deephaven/plot/Figure.java +++ b/Plot/src/main/java/io/deephaven/plot/Figure.java @@ -817,7 +817,7 @@ public interface Figure extends java.io.Serializable, io.deephaven.plot.BaseFigu @Override Figure transform( io.deephaven.plot.axistransformations.AxisTransform transform ); - @Override Figure treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ); + @Override Figure treemapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String ids, java.lang.String parents, java.lang.String values, java.lang.String labels, java.lang.String hoverTexts, java.lang.String colors ); @Override Figure twin( ); diff --git a/Plot/src/main/java/io/deephaven/plot/FigureImpl.java b/Plot/src/main/java/io/deephaven/plot/FigureImpl.java index 122c006fbe6..451116a3113 100644 --- a/Plot/src/main/java/io/deephaven/plot/FigureImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/FigureImpl.java @@ -2731,9 +2731,9 @@ private FigureImpl applyFunctionalProperties() { return make(null, axis); } - @Override public FigureImpl treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ) { + @Override public FigureImpl treemapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String ids, java.lang.String parents, java.lang.String values, java.lang.String labels, java.lang.String hoverTexts, java.lang.String colors ) { final BaseFigureImpl fc = this.figure.copy(); - final DataSeriesInternal series = (DataSeriesInternal) axes(fc).treeMapPlot( seriesName, t, values, ids, parents, labels, text, color, hoverText); + final DataSeriesInternal series = (DataSeriesInternal) axes(fc).treemapPlot( seriesName, t, ids, parents, values, labels, hoverTexts, colors); return make(series); } diff --git a/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java b/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java index 1731b336d0d..36a58b79e3a 100644 --- a/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java +++ b/Plot/src/main/java/io/deephaven/plot/PlottingConvenience.java @@ -2694,10 +2694,10 @@ public static io.deephaven.plot.Figure plotBy( java.lang.Comparable seriesName, } /** - * See {@link io.deephaven.plot.Figure#treeMapPlot} + * See {@link io.deephaven.plot.Figure#treemapPlot} **/ - public static io.deephaven.plot.Figure treeMapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String values, java.lang.String ids, java.lang.String parents, java.lang.String labels, java.lang.String text, java.lang.String color, java.lang.String hoverText ) { - return FigureFactory.figure().treeMapPlot( seriesName, t, values, ids, parents, labels, text, color, hoverText ); + public static io.deephaven.plot.Figure treemapPlot( java.lang.Comparable seriesName, io.deephaven.engine.table.Table t, java.lang.String ids, java.lang.String parents, java.lang.String values, java.lang.String labels, java.lang.String hoverTexts, java.lang.String colors ) { + return FigureFactory.figure().treemapPlot( seriesName, t, ids, parents, values, labels, hoverTexts, colors ); } } diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java b/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreemapDataSeriesTableMap.java similarity index 81% rename from Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java rename to Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreemapDataSeriesTableMap.java index 4bde81f8b3b..5cca89935a4 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreeMapDataSeriesTableMap.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/category/CategoryTreemapDataSeriesTableMap.java @@ -7,43 +7,38 @@ import java.util.Collection; -public class CategoryTreeMapDataSeriesTableMap extends AbstractTableBasedCategoryDataSeries +public class CategoryTreemapDataSeriesTableMap extends AbstractTableBasedCategoryDataSeries implements CategoryTableDataSeriesInternal, TableSnapshotSeries { private final TableHandle tableHandle; private final String idColumn; private final String parentColumn; - private final String labelColumn; private final String valueColumn; - private final String colorColumn; + private final String labelColumn; private final String hoverTextColumn; + private final String colorColumn; - private final String textColumn; - - public CategoryTreeMapDataSeriesTableMap(AxesImpl axes, int id, Comparable name, TableHandle h, String idColumn, - String parentColumn, String labelColumn, String valueColumn, String textColumn, String colorColumn, - String hoverTextColumn) { + public CategoryTreemapDataSeriesTableMap(AxesImpl axes, int id, Comparable name, TableHandle h, String idColumn, + String parentColumn, String valueColumn, String labelColumn, String hoverTextColumn, String colorColumn) { super(axes, id, name, null); this.tableHandle = h; this.idColumn = idColumn; this.parentColumn = parentColumn; - this.labelColumn = labelColumn; this.valueColumn = valueColumn; - this.textColumn = textColumn; - this.colorColumn = colorColumn; + this.labelColumn = labelColumn; this.hoverTextColumn = hoverTextColumn; + this.colorColumn = colorColumn; } - public CategoryTreeMapDataSeriesTableMap(CategoryTreeMapDataSeriesTableMap series, AxesImpl axes) { + public CategoryTreemapDataSeriesTableMap(CategoryTreemapDataSeriesTableMap series, AxesImpl axes) { super(series, axes); this.tableHandle = series.getTableHandle(); this.idColumn = series.getCategoryCol(); this.parentColumn = series.getParentColumn(); - this.labelColumn = series.getLabelColumn(); this.valueColumn = series.getValueCol(); - this.textColumn = series.getTextColumn(); - this.colorColumn = series.getColorColumn(); + this.labelColumn = series.getLabelColumn(); this.hoverTextColumn = series.getHoverTextColumn(); + this.colorColumn = series.getColorColumn(); } @Override @@ -70,10 +65,6 @@ public String getValueCol() { return valueColumn; } - public String getTextColumn() { - return textColumn; - } - public String getParentColumn() { return parentColumn; } @@ -92,7 +83,7 @@ public String getHoverTextColumn() { @Override public CategoryDataSeriesInternal copy(AxesImpl axes) { - return new CategoryTreeMapDataSeriesTableMap(this, axes); + return new CategoryTreemapDataSeriesTableMap(this, axes); } @Override diff --git a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java index e29a678dd30..c8e01e394b7 100644 --- a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java +++ b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java @@ -20,7 +20,7 @@ import io.deephaven.plot.datasets.AbstractDataSeries; import io.deephaven.plot.datasets.category.AbstractCategoryDataSeries; import io.deephaven.plot.datasets.category.CategoryDataSeriesMap; -import io.deephaven.plot.datasets.category.CategoryTreeMapDataSeriesTableMap; +import io.deephaven.plot.datasets.category.CategoryTreemapDataSeriesTableMap; import io.deephaven.plot.datasets.category.CategoryDataSeriesPartitionedTable; import io.deephaven.plot.datasets.category.CategoryDataSeriesSwappablePartitionedTable; import io.deephaven.plot.datasets.data.IndexableNumericData; @@ -355,24 +355,30 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) { makeSourceDescriptor(series.getSwappableTable(), series.getNumericCol(), numAxis == xAxis ? SourceType.X : SourceType.Y, numAxis)); - } else if (s instanceof CategoryTreeMapDataSeriesTableMap) { - CategoryTreeMapDataSeriesTableMap series = (CategoryTreeMapDataSeriesTableMap) s; + } else if (s instanceof CategoryTreemapDataSeriesTableMap) { + CategoryTreemapDataSeriesTableMap series = (CategoryTreemapDataSeriesTableMap) s; clientAxes .add(makeSourceDescriptor(series.getTableHandle(), series.getCategoryCol(), catAxis == xAxis ? SourceType.X : SourceType.Y, catAxis)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), series.getValueCol(), - numAxis == xAxis ? SourceType.X : SourceType.Y, numAxis)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), series.getParentColumn(), SourceType.PARENT, null)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), - series.getLabelColumn(), SourceType.LABEL, null)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), - series.getColorColumn(), SourceType.COLOR, null)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), - series.getHoverTextColumn(), SourceType.HOVER_TEXT, null)); - clientAxes.add(makeSourceDescriptor(series.getTableHandle(), - series.getTextColumn(), SourceType.TEXT, null)); + if (series.getValueCol() != null) { + clientAxes + .add(makeSourceDescriptor(series.getTableHandle(), series.getValueCol(), + numAxis == xAxis ? SourceType.X : SourceType.Y, numAxis)); + } + if (series.getLabelColumn() != null) { + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getLabelColumn(), SourceType.LABEL, null)); + } + if (series.getColorColumn() != null) { + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getColorColumn(), SourceType.COLOR, null)); + } + if (series.getHoverTextColumn() != null) { + clientAxes.add(makeSourceDescriptor(series.getTableHandle(), + series.getHoverTextColumn(), SourceType.HOVER_TEXT, null)); + } } else if (s instanceof CategoryDataSeriesMap) {// bar and plot from constant data errorList.add("OpenAPI presently does not support series of type " + s.getClass()); } diff --git a/py/server/deephaven/plot/figure.py b/py/server/deephaven/plot/figure.py index 338a44d3293..862913ca78b 100644 --- a/py/server/deephaven/plot/figure.py +++ b/py/server/deephaven/plot/figure.py @@ -1202,30 +1202,28 @@ def plot_pie( else: raise DHError(f"unsupported parameter combination: {non_null_args}") - def plot_tree_map( + def plot_treemap( self, + series_name: str, t: Union[Table, SelectableDataSet], - series_name: str = None, - hover_text_column: str = None, - ids_column: str = None, - labels_column: str = None, - parents_column: str = None, - text_column: str = None, - values_column: str = None, - color: Union[str, int, Color] = None, + id: str, + parent: str, + value: str = None, + label: str = None, + hover_text: str = None, + color: str = None, ) -> Figure: - """ + """Creates a treemap. Must have only one root. Args: - t (Union[Table, SelectableDataSet]): table or selectable data set (e.g. OneClick filterable table) series_name (str): name of the data series - hover_text_column (str): - ids_column (str): - labels_column (str): - parents_column (str): - text_column (str): - values_column (str): - color (Union[str, int, Color]): color + t (Union[Table, SelectableDataSet]): table or selectable data set (e.g. OneClick filterable table) + id (str): column name containing IDs + parent (str): column name containing parent IDs + value (str): column name containing values + label (str): column name containing labels + hover_text (str): column name containing hover text + color (str): column name containing color Returns: a new Figure @@ -1233,40 +1231,43 @@ def plot_tree_map( Raises: DHError """ + if not series_name: + raise DHError("required parameter is not set: series_name") if not t: raise DHError("required parameter is not set: t") + if not id: + raise DHError("required parameter is not set: id") + if not parent: + raise DHError("required parameter is not set: parent") non_null_args = set() - if t is not None: - non_null_args.add("t") - t = _convert_j("t", t, [Table, SelectableDataSet]) if series_name is not None: non_null_args.add("series_name") series_name = _convert_j("series_name", series_name, [str]) - if hover_text_column is not None: - non_null_args.add("hover_text_column") - hover_text_column = _convert_j("hover_text_column", hover_text_column, [str]) - if ids_column is not None: - non_null_args.add("ids_column") - ids_column = _convert_j("ids_column", ids_column, [str]) - if labels_column is not None: - non_null_args.add("labels_column") - labels_column = _convert_j("labels_column", labels_column, [str]) - if parents_column is not None: - non_null_args.add("parents_column") - parents_column = _convert_j("parents_column", parents_column, [str]) - if text_column is not None: - non_null_args.add("text_column") - text_column = _convert_j("text_column", text_column, [str]) - if values_column is not None: - non_null_args.add("values_column") - values_column = _convert_j("values_column", values_column, [str]) + if t is not None: + non_null_args.add("t") + t = _convert_j("t", t, [Table, SelectableDataSet]) + if id is not None: + non_null_args.add("id") + id = _convert_j("id", id, [str]) + if parent is not None: + non_null_args.add("parent") + parent = _convert_j("parent", parent, [str]) + if value is not None: + non_null_args.add("value") + value = _convert_j("value", value, [str]) + if label is not None: + non_null_args.add("label") + label = _convert_j("label", label, [str]) + if hover_text is not None: + non_null_args.add("hover_text") + hover_text = _convert_j("hover_text", hover_text, [str]) if color is not None: non_null_args.add("color") - color = _convert_j("color", color, [str, int, Color]) + color = _convert_j("color", color, [str]) - if non_null_args == {"series_name", "t", "values_column", "ids_column", "parents_column", "labels_column", "text_column", "color", "hover_text_column"}: - return Figure(self.j_figure.treeMapPlot(series_name, t, values_column, ids_column, parents_column, labels_column, text_column, color, hover_text_column)) + if set({"series_name", "t", "id", "parent"}).issubset(non_null_args): + return Figure(self.j_figure.treemapPlot(series_name, t, id, parent, value, label, hover_text, color)) else: raise DHError(f"unsupported parameter combination: {non_null_args}") diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/console/JsVariableChanges.java b/web/client-api/src/main/java/io/deephaven/web/client/api/console/JsVariableChanges.java index 6ee6b4a75a8..cf004e51902 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/console/JsVariableChanges.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/console/JsVariableChanges.java @@ -18,7 +18,8 @@ public class JsVariableChanges { PARTITIONEDTABLE = "PartitionedTable", FIGURE = "Figure", OTHERWIDGET = "OtherWidget", - PANDAS = "pandas.DataFrame"; + PANDAS = "pandas.DataFrame", + TREEMAP = "Treemap"; private final JsVariableDefinition[] created; private final JsVariableDefinition[] updated; diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java index 839a17664e7..a551bb1c691 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/enums/JsSourceType.java @@ -27,5 +27,4 @@ public class JsSourceType { public static final int COLOR = FigureDescriptor.SourceType.getCOLOR(); public static final int PARENT = FigureDescriptor.SourceType.getPARENT(); public static final int HOVER_TEXT = FigureDescriptor.SourceType.getHOVER_TEXT(); - public static final int TEXT = FigureDescriptor.SourceType.getTEXT(); } From 9d14d4672373e0e2d8ae2cb2beaf43685328ec4a Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 28 Jul 2022 17:14:32 -0700 Subject: [PATCH 048/215] Add `go mod verify` to go test (#2697) As suggested via https://github.com/docker-library/docs/tree/master/golang#start-a-go-instance-in-your-app --- go/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/go/build.gradle b/go/build.gradle index 0ed326dd7a0..8efbf7c3bf2 100644 --- a/go/build.gradle +++ b/go/build.gradle @@ -67,6 +67,7 @@ def testGoClient = Docker.registerDockerTask(project, 'testGoClient') { runCommand('''set -eux; \\ mkdir /out; \\ go mod download; \\ + go mod verify; \\ go install github.com/jstemmer/go-junit-report/v2@latest ''') copyFile('.', '/project/') From a6fa9e63b5d9fe4b456a02ca9b1cc50b2bfa5753 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 29 Jul 2022 09:08:59 -0700 Subject: [PATCH 049/215] Add note and slightly simplify TableAdapterImpl (#2698) --- .../client/impl/TableHandleManagerSerial.java | 4 +- .../io/deephaven/qst/TableAdapterImpl.java | 59 +++++++------------ .../io/deephaven/qst/TableAdapterResults.java | 19 +++--- .../qst/table/TableCreationLogicImpl.java | 2 +- 4 files changed, 30 insertions(+), 54 deletions(-) diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/TableHandleManagerSerial.java b/java-client/session/src/main/java/io/deephaven/client/impl/TableHandleManagerSerial.java index 341a04cb0d5..84591b74598 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/TableHandleManagerSerial.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/TableHandleManagerSerial.java @@ -58,7 +58,7 @@ public TableHandle execute(TableSpec table) throws TableHandleException, Interru tracker.closeAllExceptAndRemoveAll(Collections.emptySet()); throw t; } - final TableHandle out = results.map().get(table).walk(new GetOutput<>()).out(); + final TableHandle out = results.map().get(table).walk(new GetOutput<>()); tracker.closeAllExceptAndRemoveAll(Collections.singleton(out)); return out; } @@ -77,7 +77,7 @@ public List execute(Iterable tables) throws TableHandleE } final List newRefs = new ArrayList<>(); for (TableSpec table : tables) { - TableHandle handle = results.map().get(table).walk(new GetOutput<>()).out(); + TableHandle handle = results.map().get(table).walk(new GetOutput<>()); // each needs to be a newRef because the caller may double up on the same TableSpec newRefs.add(handle.newRef()); } diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java index b9b2e9b08ce..f450a6f0afe 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java @@ -4,7 +4,6 @@ package io.deephaven.qst; import io.deephaven.api.ColumnName; -import io.deephaven.api.Selectable; import io.deephaven.api.TableOperations; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.qst.TableAdapterResults.Output; @@ -50,6 +49,10 @@ class TableAdapterImpl, TABLE> implements Visitor { + // Note: instead of having the visitor recursively resolve dependencies, we are explicitly walking all nodes of the + // tree in post-order. In some sense, emulating a recursive ordering, but it explicitly solves some state management + // complexity with a recursive implementation. + static , TABLE> TableAdapterResults of( TableCreator
    creation, TableCreator.TableToOperations toOps, TableCreator.OperationsToTable toTable, Iterable tables) { @@ -88,11 +91,11 @@ private TOPS parentOps(SingleParentTable table) { } private TOPS ops(TableSpec table) { - return outputs.get(table).walk(new GetOp()).getOut(); + return outputs.get(table).walk(new GetOp()); } private TABLE table(TableSpec table) { - return outputs.get(table).walk(new GetTable()).getOut(); + return outputs.get(table).walk(new GetTable()); } private void addTable(TableSpec table, TABLE t) { @@ -306,14 +309,9 @@ private final class OutputTable implements Output { this.table = Objects.requireNonNull(table); } - TOPS toOps() { - return toOps.of(table); - } - @Override - public > V walk(V visitor) { - visitor.visit(table); - return visitor; + public > T walk(V visitor) { + return visitor.visit(table); } } @@ -324,52 +322,35 @@ private final class OutputOp implements Output { this.op = Objects.requireNonNull(op); } - TABLE toTable() { - return toTable.of(op); - } - @Override - public > V walk(V visitor) { - visitor.visit(op); - return visitor; + public > T walk(V visitor) { + return visitor.visit(op); } } - private final class GetTable implements Output.Visitor { - - private TABLE out; - - public TABLE getOut() { - return Objects.requireNonNull(out); - } + private final class GetTable implements Output.Visitor { @Override - public void visit(TOPS tops) { - out = toTable.of(tops); + public TABLE visit(TOPS tops) { + return toTable.of(tops); } @Override - public void visit(TABLE table) { - out = table; + public TABLE visit(TABLE table) { + return table; } } - private final class GetOp implements Output.Visitor { - - private TOPS out; - - public TOPS getOut() { - return Objects.requireNonNull(out); - } + private final class GetOp implements Output.Visitor { @Override - public void visit(TOPS tops) { - out = tops; + public TOPS visit(TOPS tops) { + return tops; } @Override - public void visit(TABLE table) { - out = toOps.of(table); + public TOPS visit(TABLE table) { + return toOps.of(table); } } } diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterResults.java b/qst/src/main/java/io/deephaven/qst/TableAdapterResults.java index fa6844b995b..a1fda9f5271 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterResults.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterResults.java @@ -20,12 +20,12 @@ public abstract class TableAdapterResults, TABLE> { - > V walk(V visitor); + > T walk(V visitor); - interface Visitor, TABLE> { - void visit(TOPS tops); + interface Visitor, TABLE> { + T visit(TOPS tops); - void visit(TABLE table); + T visit(TABLE table); } } @@ -34,16 +34,11 @@ interface Visitor, TABLE> { * * @param the table operations and table type */ - public static class GetOutput> implements Visitor { - private T out; - - public T out() { - return Objects.requireNonNull(out); - } + public static final class GetOutput> implements Visitor { @Override - public void visit(T t) { - out = t; + public T visit(T t) { + return t; } } } diff --git a/qst/src/main/java/io/deephaven/qst/table/TableCreationLogicImpl.java b/qst/src/main/java/io/deephaven/qst/table/TableCreationLogicImpl.java index c40ea7945db..cc25542f424 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableCreationLogicImpl.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableCreationLogicImpl.java @@ -24,6 +24,6 @@ final class TableCreationLogicImpl implements TableCreationLogic { public > T create(TableCreator creation) { // noinspection RedundantTypeArguments return TableCreator.create(creation, i -> i, i -> i, table).map().get(table) - .walk(new GetOutput<>()).out(); + .walk(new GetOutput<>()); } } From 0c7413a2e97343b26288ec8332fb52fb9b08e014 Mon Sep 17 00:00:00 2001 From: SuperTails Date: Fri, 29 Jul 2022 10:10:35 -0600 Subject: [PATCH 050/215] Minor doc fix for Go client (#2700) --- go/README.md | 2 +- go/pkg/client/client.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go/README.md b/go/README.md index 05b530c4e4e..4313c815207 100644 --- a/go/README.md +++ b/go/README.md @@ -40,7 +40,7 @@ The source code is available in the directory for each example. To add the client as a dependency to your project, run: ```bash -go get github.com/deephaven/deephaven-core/go +go get github.com/deephaven/deephaven-core/go/pkg/client ``` The client package can then be imported: ```go diff --git a/go/pkg/client/client.go b/go/pkg/client/client.go index 5473d6d6edd..b465f402434 100644 --- a/go/pkg/client/client.go +++ b/go/pkg/client/client.go @@ -4,13 +4,13 @@ // To get started, use client.NewClient to connect to the server. The Client can then be used to perform operations. // See the provided examples in the examples/ folder or the individual code documentation for more. // -// Online docs for the client can be found at https://pkg.go.dev/github.com/deephaven/deephaven-core/go/client +// Online docs for the client can be found at https://pkg.go.dev/github.com/deephaven/deephaven-core/go/pkg/client // // The Go API uses Records from the Apache Arrow package as tables. // The docs for the Arrow package can be found at the following link: // https://pkg.go.dev/github.com/apache/arrow/go/v8 // -// All methods for all structs in this package are thread-safe unless otherwise specified. +// All methods for all structs in this package are goroutine-safe unless otherwise specified. package client import ( From 12e3ddee0b383223c3a4f2c317d86146cf78b545 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 29 Jul 2022 09:12:38 -0700 Subject: [PATCH 051/215] LazyUpdateTable (#2699) Partial #711 --- .../PartitionedTableProxyImpl.java | 10 ++++++ .../client/UpdateOrSelectSessionTest.java | 7 +++- .../client/impl/BatchTableRequestBuilder.java | 6 ++++ .../io/deephaven/graphviz/LabelBuilder.java | 6 ++++ .../io/deephaven/qst/TableAdapterImpl.java | 6 ++++ .../deephaven/qst/table/LazyUpdateTable.java | 32 +++++++++++++++++++ .../deephaven/qst/table/ParentsVisitor.java | 5 +++ .../io/deephaven/qst/table/TableBase.java | 14 ++++++++ .../io/deephaven/qst/table/TableSpec.java | 2 ++ .../qst/table/TableVisitorGeneric.java | 5 +++ .../io/deephaven/api/TableOperations.java | 6 ++++ .../deephaven/api/TableOperationsAdapter.java | 10 ++++++ 12 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 qst/src/main/java/io/deephaven/qst/table/LazyUpdateTable.java diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 3fa6e360c8e..0568476fa6c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -474,6 +474,16 @@ public PartitionedTable.Proxy update(Collection columns) { return basicTransform(ct -> ct.update(columns)); } + @Override + public PartitionedTable.Proxy lazyUpdate(String... columns) { + return basicTransform(ct -> ct.lazyUpdate(columns)); + } + + @Override + public PartitionedTable.Proxy lazyUpdate(Collection columns) { + return basicTransform(ct -> ct.lazyUpdate(columns)); + } + @Override public PartitionedTable.Proxy select(String... columns) { return basicTransform(ct -> ct.select(columns)); diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java index 5a047cd5612..9a68276f66f 100644 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java @@ -51,8 +51,13 @@ public TableSpec apply(TableSpec spec, String[] formulas) { public TableSpec apply(TableSpec spec, String[] formulas) { return spec.select(formulas); } + }, + LAZY_UPDATE { + @Override + public TableSpec apply(TableSpec spec, String[] formulas) { + return spec.lazyUpdate(formulas); + } } - // TODO Lazy via TableSpec } private final UpdateOrSelect method; diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java index ab37bdd5ab3..1da15dd762e 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java @@ -76,6 +76,7 @@ import io.deephaven.qst.table.InMemoryKeyBackedInputTable; import io.deephaven.qst.table.InputTable; import io.deephaven.qst.table.JoinTable; +import io.deephaven.qst.table.LazyUpdateTable; import io.deephaven.qst.table.MergeTable; import io.deephaven.qst.table.NaturalJoinTable; import io.deephaven.qst.table.NewTable; @@ -382,6 +383,11 @@ public void visit(UpdateTable v) { out = op(Builder::setUpdate, selectOrUpdate(v, v.columns())); } + @Override + public void visit(LazyUpdateTable v) { + out = op(Builder::setLazyUpdate, selectOrUpdate(v, v.columns())); + } + @Override public void visit(SelectTable v) { out = op(Builder::setSelect, selectOrUpdate(v, v.columns())); diff --git a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java index 8ec4edf649c..f63256cfd36 100644 --- a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java +++ b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java @@ -16,6 +16,7 @@ import io.deephaven.qst.table.InputTable; import io.deephaven.qst.table.Join; import io.deephaven.qst.table.JoinTable; +import io.deephaven.qst.table.LazyUpdateTable; import io.deephaven.qst.table.NaturalJoinTable; import io.deephaven.qst.table.ReverseAsOfJoinTable; import io.deephaven.qst.table.SelectDistinctTable; @@ -127,6 +128,11 @@ public void visit(UpdateTable updateTable) { selectable("update", updateTable); } + @Override + public void visit(LazyUpdateTable lazyUpdateTable) { + selectable("lazyUpdate", lazyUpdateTable); + } + @Override public void visit(WhereTable whereTable) { sb.append("where("); diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java index f450a6f0afe..b0fa1a9efbc 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java @@ -16,6 +16,7 @@ import io.deephaven.qst.table.HeadTable; import io.deephaven.qst.table.InputTable; import io.deephaven.qst.table.JoinTable; +import io.deephaven.qst.table.LazyUpdateTable; import io.deephaven.qst.table.MergeTable; import io.deephaven.qst.table.NaturalJoinTable; import io.deephaven.qst.table.NewTable; @@ -199,6 +200,11 @@ public void visit(UpdateTable updateTable) { addOp(updateTable, parentOps(updateTable).update(updateTable.columns())); } + @Override + public void visit(LazyUpdateTable lazyUpdateTable) { + addOp(lazyUpdateTable, parentOps(lazyUpdateTable).lazyUpdate(lazyUpdateTable.columns())); + } + @Override public void visit(NaturalJoinTable naturalJoinTable) { final TOPS left = ops(naturalJoinTable.left()); diff --git a/qst/src/main/java/io/deephaven/qst/table/LazyUpdateTable.java b/qst/src/main/java/io/deephaven/qst/table/LazyUpdateTable.java new file mode 100644 index 00000000000..4264ae99293 --- /dev/null +++ b/qst/src/main/java/io/deephaven/qst/table/LazyUpdateTable.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.qst.table; + +import io.deephaven.annotations.NodeStyle; +import io.deephaven.api.TableOperations; +import org.immutables.value.Value.Immutable; + +import java.util.Collection; + +/** + * @see TableOperations#lazyUpdate(Collection) + */ +@Immutable +@NodeStyle +public abstract class LazyUpdateTable extends TableBase implements SelectableTable { + + public static Builder builder() { + return ImmutableLazyUpdateTable.builder(); + } + + @Override + public final V walk(V visitor) { + visitor.visit(this); + return visitor; + } + + public interface Builder extends SelectableTable.Builder { + + } +} diff --git a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java index ceb8ab45e5d..82e0f447b53 100644 --- a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java +++ b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java @@ -242,6 +242,11 @@ public void visit(UpdateTable updateTable) { out = single(updateTable); } + @Override + public void visit(LazyUpdateTable lazyUpdateTable) { + out = single(lazyUpdateTable); + } + @Override public void visit(AggregateAllByTable aggAllByTable) { out = single(aggAllByTable); diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index 9fc5544ef65..c2b0f93f401 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -362,6 +362,20 @@ public final UpdateTable update(Collection columns) { return UpdateTable.builder().parent(this).addAllColumns(columns).build(); } + @Override + public final LazyUpdateTable lazyUpdate(String... columns) { + final LazyUpdateTable.Builder builder = LazyUpdateTable.builder().parent(this); + for (String column : columns) { + builder.addColumns(Selectable.parse(column)); + } + return builder.build(); + } + + @Override + public final LazyUpdateTable lazyUpdate(Collection columns) { + return LazyUpdateTable.builder().parent(this).addAllColumns(columns).build(); + } + @Override public final SelectTable select(String... columns) { final SelectTable.Builder builder = SelectTable.builder().parent(this); diff --git a/qst/src/main/java/io/deephaven/qst/table/TableSpec.java b/qst/src/main/java/io/deephaven/qst/table/TableSpec.java index 2dce1a0cbe4..309ea51a63e 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableSpec.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableSpec.java @@ -142,6 +142,8 @@ interface Visitor { void visit(UpdateTable updateTable); + void visit(LazyUpdateTable lazyUpdateTable); + void visit(AggregationTable aggregationTable); void visit(AggregateAllByTable aggAllByTable); diff --git a/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java b/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java index b56c22c5115..60d52a0fe47 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java @@ -112,6 +112,11 @@ public void visit(UpdateTable updateTable) { accept(updateTable); } + @Override + public void visit(LazyUpdateTable lazyUpdateTable) { + accept(lazyUpdateTable); + } + @Override public void visit(AggregateAllByTable aggAllByTable) { accept(aggAllByTable); diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index d796d3e5e1a..8fb20074641 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -166,6 +166,12 @@ public interface TableOperations, TABL // ------------------------------------------------------------------------------------------- + TOPS lazyUpdate(String... columns); + + TOPS lazyUpdate(Collection columns); + + // ------------------------------------------------------------------------------------------- + TOPS select(String... columns); TOPS select(Collection columns); diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java index 533932dd286..632fc7f696a 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java @@ -138,6 +138,16 @@ public final TOPS_1 update(Collection columns) { return adapt(delegate.update(columns)); } + @Override + public final TOPS_1 lazyUpdate(String... columns) { + return adapt(delegate.lazyUpdate(columns)); + } + + @Override + public final TOPS_1 lazyUpdate(Collection columns) { + return adapt(delegate.lazyUpdate(columns)); + } + @Override public final TOPS_1 select(String... columns) { return adapt(delegate.select(columns)); From b9f67375dbee720e291aeeaac0728286956b86b9 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 29 Jul 2022 17:50:40 -0400 Subject: [PATCH 052/215] Web version updated to 0.15.2 (#2704) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.15.2 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 7e7cf13d5fa..b34ff3c7aa6 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.15.1 +ARG WEB_VERSION=0.15.2 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From b1ccc4669a6c89f5a8a42c18eb83c018f4ae6dfd Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 29 Jul 2022 17:56:47 -0400 Subject: [PATCH 053/215] Add heap size API to community (#2648) - Port over getWorkerHeapInfo from Enterprise - Wire up HeapInfo to JsWorkerHeapInfo - Truncate values to double before passing to JS - Only call RuntimeMemory.getInstance() once - Add web developers guide docs Cherry picked from DH-12686 Merge request https://gitlab.deephaven.io/illumon/iris/-/merge_requests/6626 --- .../table/impl/util/PerformanceQueries.java | 2 +- .../engine/table/impl/util/RuntimeMemory.java | 24 +- go/internal/proto/console/console.pb.go | 2234 +++++++++-------- go/internal/proto/console/console_grpc.pb.go | 36 + .../main/proto/deephaven/proto/console.proto | 20 + py/client/pydeephaven/proto/console_pb2.py | 216 +- .../pydeephaven/proto/console_pb2_grpc.py | 33 + .../console/ConsoleServiceGrpcImpl.java | 39 +- web/WebDevelopersGuide.md | 7 + .../web/client/api/JsWorkerHeapInfo.java | 31 + .../web/client/api/QueryConnectable.java | 14 +- .../proto/console_pb/GetHeapInfoRequest.java | 29 + .../proto/console_pb/GetHeapInfoResponse.java | 98 + .../console_pb_service/ConsoleService.java | 45 + .../ConsoleServiceClient.java | 145 ++ 15 files changed, 1808 insertions(+), 1165 deletions(-) create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkerHeapInfo.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoResponse.java diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/PerformanceQueries.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/PerformanceQueries.java index f4e191fd048..554e0112978 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/PerformanceQueries.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/PerformanceQueries.java @@ -276,7 +276,7 @@ public static float approxRatio(final long v0, final long v1) { */ @ScriptApi public static Table serverState() { - final long maxMemoryBytes = RuntimeMemory.getInstance().getMaxMemory(); + final long maxMemoryBytes = RuntimeMemory.getInstance().maxMemory(); final int maxMemoryMiB = (int) Math.ceil(maxMemoryBytes / (1024 * 1024.0)); final Table pml = TableLoggers.serverStateLog().updateView("MaxMemMiB = " + maxMemoryMiB); Table pm = pml.view( diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java index 80b6ac03b87..28b563648f0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java @@ -16,10 +16,10 @@ * Cache memory utilization. * *

    - * >Calling Runtime.getRuntime().getFreeMemory() is expensive; and we may do it a lot when we have automatically - * computed tables, such as in a partitionBy. Instead of calling the runtime directly from the performance - * instrumentation framework, we call this class's methods; which cache the result for a configurable number of - * milliseconds to avoid repeated calls that are not likely any different./p> + * >Calling Runtime.getRuntime().freeMemory() is expensive; and we may do it a lot when we have automatically computed + * tables, such as in a partitionBy. Instead of calling the runtime directly from the performance instrumentation + * framework, we call this class's methods; which cache the result for a configurable number of milliseconds to avoid + * repeated calls that are not likely any different./p> * *

    * Additionally, we log our JVM heap usage on a regular basis; to enable users to quickly examine their worker logs and @@ -188,10 +188,24 @@ public void read(final Sample buf) { } } + /** + * See {@link Runtime#freeMemory()}. + */ + public long freeMemory() { + return currSnapshot.lastFreeMemory; + } + + /** + * See {@link Runtime#totalMemory()}. + */ + public long totalMemory() { + return currSnapshot.lastTotalMemory; + } + /** * See {@link Runtime#maxMemory()}. */ - long getMaxMemory() { + public long maxMemory() { return maxMemory; } } diff --git a/go/internal/proto/console/console.pb.go b/go/internal/proto/console/console.pb.go index 4c0d1afd4c6..8e93eaa9be5 100644 --- a/go/internal/proto/console/console.pb.go +++ b/go/internal/proto/console/console.pb.go @@ -98,7 +98,7 @@ func (x FigureDescriptor_SeriesPlotStyle) Number() protoreflect.EnumNumber { // Deprecated: Use FigureDescriptor_SeriesPlotStyle.Descriptor instead. func (FigureDescriptor_SeriesPlotStyle) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 0} } type FigureDescriptor_SourceType int32 @@ -195,7 +195,7 @@ func (x FigureDescriptor_SourceType) Number() protoreflect.EnumNumber { // Deprecated: Use FigureDescriptor_SourceType.Descriptor instead. func (FigureDescriptor_SourceType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 1} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 1} } type FigureDescriptor_ChartDescriptor_ChartType int32 @@ -256,7 +256,7 @@ func (x FigureDescriptor_ChartDescriptor_ChartType) Number() protoreflect.EnumNu // Deprecated: Use FigureDescriptor_ChartDescriptor_ChartType.Descriptor instead. func (FigureDescriptor_ChartDescriptor_ChartType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 0, 0} } type FigureDescriptor_AxisDescriptor_AxisFormatType int32 @@ -302,7 +302,7 @@ func (x FigureDescriptor_AxisDescriptor_AxisFormatType) Number() protoreflect.En // Deprecated: Use FigureDescriptor_AxisDescriptor_AxisFormatType.Descriptor instead. func (FigureDescriptor_AxisDescriptor_AxisFormatType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 6, 0} } type FigureDescriptor_AxisDescriptor_AxisType int32 @@ -360,7 +360,7 @@ func (x FigureDescriptor_AxisDescriptor_AxisType) Number() protoreflect.EnumNumb // Deprecated: Use FigureDescriptor_AxisDescriptor_AxisType.Descriptor instead. func (FigureDescriptor_AxisDescriptor_AxisType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 1} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 6, 1} } type FigureDescriptor_AxisDescriptor_AxisPosition int32 @@ -415,7 +415,7 @@ func (x FigureDescriptor_AxisDescriptor_AxisPosition) Number() protoreflect.Enum // Deprecated: Use FigureDescriptor_AxisDescriptor_AxisPosition.Descriptor instead. func (FigureDescriptor_AxisDescriptor_AxisPosition) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6, 2} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 6, 2} } type FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek int32 @@ -476,7 +476,7 @@ func (x FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) Number() protoref // Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek.Descriptor instead. func (FigureDescriptor_BusinessCalendarDescriptor_DayOfWeek) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 7, 0} } type GetConsoleTypesRequest struct { @@ -666,6 +666,115 @@ func (x *StartConsoleResponse) GetResultId() *ticket.Ticket { return nil } +type GetHeapInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetHeapInfoRequest) Reset() { + *x = GetHeapInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetHeapInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHeapInfoRequest) ProtoMessage() {} + +func (x *GetHeapInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHeapInfoRequest.ProtoReflect.Descriptor instead. +func (*GetHeapInfoRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{4} +} + +type GetHeapInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Returns the maximum amount of memory that the Java virtual machine will attempt to use. + // If there is no inherent limit then the value Long.MAX_VALUE will be returned. + // the maximum amount of memory that the virtual machine will attempt to use, measured in bytes + MaxMemory int64 `protobuf:"varint,1,opt,name=max_memory,json=maxMemory,proto3" json:"max_memory,omitempty"` + // Returns the total amount of memory in the Java virtual machine. The value returned by this method may vary over time, depending on the host environment. + // Note that the amount of memory required to hold an object of any given type may be implementation-dependent. + // the total amount of memory currently available for current and future objects, measured in bytes. + TotalMemory int64 `protobuf:"varint,2,opt,name=total_memory,json=totalMemory,proto3" json:"total_memory,omitempty"` + // Returns the amount of free memory in the Java Virtual Machine. Calling the gc method may result in increasing the value returned by freeMemory. + // an approximation to the total amount of memory currently available for future allocated objects, measured in bytes. + FreeMemory int64 `protobuf:"varint,3,opt,name=free_memory,json=freeMemory,proto3" json:"free_memory,omitempty"` +} + +func (x *GetHeapInfoResponse) Reset() { + *x = GetHeapInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_console_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetHeapInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHeapInfoResponse) ProtoMessage() {} + +func (x *GetHeapInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_console_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHeapInfoResponse.ProtoReflect.Descriptor instead. +func (*GetHeapInfoResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{5} +} + +func (x *GetHeapInfoResponse) GetMaxMemory() int64 { + if x != nil { + return x.MaxMemory + } + return 0 +} + +func (x *GetHeapInfoResponse) GetTotalMemory() int64 { + if x != nil { + return x.TotalMemory + } + return 0 +} + +func (x *GetHeapInfoResponse) GetFreeMemory() int64 { + if x != nil { + return x.FreeMemory + } + return 0 +} + type LogSubscriptionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -680,7 +789,7 @@ type LogSubscriptionRequest struct { func (x *LogSubscriptionRequest) Reset() { *x = LogSubscriptionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[4] + mi := &file_deephaven_proto_console_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -693,7 +802,7 @@ func (x *LogSubscriptionRequest) String() string { func (*LogSubscriptionRequest) ProtoMessage() {} func (x *LogSubscriptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[4] + mi := &file_deephaven_proto_console_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -706,7 +815,7 @@ func (x *LogSubscriptionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogSubscriptionRequest.ProtoReflect.Descriptor instead. func (*LogSubscriptionRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{4} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{6} } func (x *LogSubscriptionRequest) GetLastSeenLogTimestamp() int64 { @@ -736,7 +845,7 @@ type LogSubscriptionData struct { func (x *LogSubscriptionData) Reset() { *x = LogSubscriptionData{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[5] + mi := &file_deephaven_proto_console_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -749,7 +858,7 @@ func (x *LogSubscriptionData) String() string { func (*LogSubscriptionData) ProtoMessage() {} func (x *LogSubscriptionData) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[5] + mi := &file_deephaven_proto_console_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -762,7 +871,7 @@ func (x *LogSubscriptionData) ProtoReflect() protoreflect.Message { // Deprecated: Use LogSubscriptionData.ProtoReflect.Descriptor instead. func (*LogSubscriptionData) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{5} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{7} } func (x *LogSubscriptionData) GetMicros() int64 { @@ -798,7 +907,7 @@ type ExecuteCommandRequest struct { func (x *ExecuteCommandRequest) Reset() { *x = ExecuteCommandRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[6] + mi := &file_deephaven_proto_console_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -811,7 +920,7 @@ func (x *ExecuteCommandRequest) String() string { func (*ExecuteCommandRequest) ProtoMessage() {} func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[6] + mi := &file_deephaven_proto_console_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -824,7 +933,7 @@ func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteCommandRequest.ProtoReflect.Descriptor instead. func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{6} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{8} } func (x *ExecuteCommandRequest) GetConsoleId() *ticket.Ticket { @@ -853,7 +962,7 @@ type ExecuteCommandResponse struct { func (x *ExecuteCommandResponse) Reset() { *x = ExecuteCommandResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[7] + mi := &file_deephaven_proto_console_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -866,7 +975,7 @@ func (x *ExecuteCommandResponse) String() string { func (*ExecuteCommandResponse) ProtoMessage() {} func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[7] + mi := &file_deephaven_proto_console_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -879,7 +988,7 @@ func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteCommandResponse.ProtoReflect.Descriptor instead. func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{7} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{9} } func (x *ExecuteCommandResponse) GetErrorMessage() string { @@ -909,7 +1018,7 @@ type BindTableToVariableRequest struct { func (x *BindTableToVariableRequest) Reset() { *x = BindTableToVariableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[8] + mi := &file_deephaven_proto_console_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -922,7 +1031,7 @@ func (x *BindTableToVariableRequest) String() string { func (*BindTableToVariableRequest) ProtoMessage() {} func (x *BindTableToVariableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[8] + mi := &file_deephaven_proto_console_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -935,7 +1044,7 @@ func (x *BindTableToVariableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BindTableToVariableRequest.ProtoReflect.Descriptor instead. func (*BindTableToVariableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{8} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{10} } func (x *BindTableToVariableRequest) GetConsoleId() *ticket.Ticket { @@ -968,7 +1077,7 @@ type BindTableToVariableResponse struct { func (x *BindTableToVariableResponse) Reset() { *x = BindTableToVariableResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[9] + mi := &file_deephaven_proto_console_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -981,7 +1090,7 @@ func (x *BindTableToVariableResponse) String() string { func (*BindTableToVariableResponse) ProtoMessage() {} func (x *BindTableToVariableResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[9] + mi := &file_deephaven_proto_console_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -994,7 +1103,7 @@ func (x *BindTableToVariableResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BindTableToVariableResponse.ProtoReflect.Descriptor instead. func (*BindTableToVariableResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{9} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{11} } type CancelCommandRequest struct { @@ -1009,7 +1118,7 @@ type CancelCommandRequest struct { func (x *CancelCommandRequest) Reset() { *x = CancelCommandRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[10] + mi := &file_deephaven_proto_console_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1022,7 +1131,7 @@ func (x *CancelCommandRequest) String() string { func (*CancelCommandRequest) ProtoMessage() {} func (x *CancelCommandRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[10] + mi := &file_deephaven_proto_console_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1035,7 +1144,7 @@ func (x *CancelCommandRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelCommandRequest.ProtoReflect.Descriptor instead. func (*CancelCommandRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{10} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{12} } func (x *CancelCommandRequest) GetConsoleId() *ticket.Ticket { @@ -1061,7 +1170,7 @@ type CancelCommandResponse struct { func (x *CancelCommandResponse) Reset() { *x = CancelCommandResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[11] + mi := &file_deephaven_proto_console_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1074,7 +1183,7 @@ func (x *CancelCommandResponse) String() string { func (*CancelCommandResponse) ProtoMessage() {} func (x *CancelCommandResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[11] + mi := &file_deephaven_proto_console_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1087,7 +1196,7 @@ func (x *CancelCommandResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelCommandResponse.ProtoReflect.Descriptor instead. func (*CancelCommandResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{11} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{13} } type AutoCompleteRequest struct { @@ -1106,7 +1215,7 @@ type AutoCompleteRequest struct { func (x *AutoCompleteRequest) Reset() { *x = AutoCompleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[12] + mi := &file_deephaven_proto_console_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1228,7 @@ func (x *AutoCompleteRequest) String() string { func (*AutoCompleteRequest) ProtoMessage() {} func (x *AutoCompleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[12] + mi := &file_deephaven_proto_console_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1132,7 +1241,7 @@ func (x *AutoCompleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoCompleteRequest.ProtoReflect.Descriptor instead. func (*AutoCompleteRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{12} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{14} } func (m *AutoCompleteRequest) GetRequest() isAutoCompleteRequest_Request { @@ -1215,7 +1324,7 @@ type AutoCompleteResponse struct { func (x *AutoCompleteResponse) Reset() { *x = AutoCompleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[13] + mi := &file_deephaven_proto_console_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1228,7 +1337,7 @@ func (x *AutoCompleteResponse) String() string { func (*AutoCompleteResponse) ProtoMessage() {} func (x *AutoCompleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[13] + mi := &file_deephaven_proto_console_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1241,7 +1350,7 @@ func (x *AutoCompleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoCompleteResponse.ProtoReflect.Descriptor instead. func (*AutoCompleteResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{13} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{15} } func (m *AutoCompleteResponse) GetResponse() isAutoCompleteResponse_Response { @@ -1277,7 +1386,7 @@ type BrowserNextResponse struct { func (x *BrowserNextResponse) Reset() { *x = BrowserNextResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[14] + mi := &file_deephaven_proto_console_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1290,7 +1399,7 @@ func (x *BrowserNextResponse) String() string { func (*BrowserNextResponse) ProtoMessage() {} func (x *BrowserNextResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[14] + mi := &file_deephaven_proto_console_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1412,7 @@ func (x *BrowserNextResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BrowserNextResponse.ProtoReflect.Descriptor instead. func (*BrowserNextResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{14} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{16} } type OpenDocumentRequest struct { @@ -1318,7 +1427,7 @@ type OpenDocumentRequest struct { func (x *OpenDocumentRequest) Reset() { *x = OpenDocumentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[15] + mi := &file_deephaven_proto_console_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1331,7 +1440,7 @@ func (x *OpenDocumentRequest) String() string { func (*OpenDocumentRequest) ProtoMessage() {} func (x *OpenDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[15] + mi := &file_deephaven_proto_console_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1344,7 +1453,7 @@ func (x *OpenDocumentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OpenDocumentRequest.ProtoReflect.Descriptor instead. func (*OpenDocumentRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{15} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{17} } func (x *OpenDocumentRequest) GetConsoleId() *ticket.Ticket { @@ -1375,7 +1484,7 @@ type TextDocumentItem struct { func (x *TextDocumentItem) Reset() { *x = TextDocumentItem{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[16] + mi := &file_deephaven_proto_console_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1388,7 +1497,7 @@ func (x *TextDocumentItem) String() string { func (*TextDocumentItem) ProtoMessage() {} func (x *TextDocumentItem) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[16] + mi := &file_deephaven_proto_console_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1401,7 +1510,7 @@ func (x *TextDocumentItem) ProtoReflect() protoreflect.Message { // Deprecated: Use TextDocumentItem.ProtoReflect.Descriptor instead. func (*TextDocumentItem) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{16} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{18} } func (x *TextDocumentItem) GetUri() string { @@ -1444,7 +1553,7 @@ type CloseDocumentRequest struct { func (x *CloseDocumentRequest) Reset() { *x = CloseDocumentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[17] + mi := &file_deephaven_proto_console_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1457,7 +1566,7 @@ func (x *CloseDocumentRequest) String() string { func (*CloseDocumentRequest) ProtoMessage() {} func (x *CloseDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[17] + mi := &file_deephaven_proto_console_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1470,7 +1579,7 @@ func (x *CloseDocumentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseDocumentRequest.ProtoReflect.Descriptor instead. func (*CloseDocumentRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{17} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{19} } func (x *CloseDocumentRequest) GetConsoleId() *ticket.Ticket { @@ -1500,7 +1609,7 @@ type ChangeDocumentRequest struct { func (x *ChangeDocumentRequest) Reset() { *x = ChangeDocumentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[18] + mi := &file_deephaven_proto_console_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1513,7 +1622,7 @@ func (x *ChangeDocumentRequest) String() string { func (*ChangeDocumentRequest) ProtoMessage() {} func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[18] + mi := &file_deephaven_proto_console_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1526,7 +1635,7 @@ func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeDocumentRequest.ProtoReflect.Descriptor instead. func (*ChangeDocumentRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{18} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{20} } func (x *ChangeDocumentRequest) GetConsoleId() *ticket.Ticket { @@ -1562,7 +1671,7 @@ type DocumentRange struct { func (x *DocumentRange) Reset() { *x = DocumentRange{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[19] + mi := &file_deephaven_proto_console_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1575,7 +1684,7 @@ func (x *DocumentRange) String() string { func (*DocumentRange) ProtoMessage() {} func (x *DocumentRange) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[19] + mi := &file_deephaven_proto_console_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1588,7 +1697,7 @@ func (x *DocumentRange) ProtoReflect() protoreflect.Message { // Deprecated: Use DocumentRange.ProtoReflect.Descriptor instead. func (*DocumentRange) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{19} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{21} } func (x *DocumentRange) GetStart() *Position { @@ -1617,7 +1726,7 @@ type VersionedTextDocumentIdentifier struct { func (x *VersionedTextDocumentIdentifier) Reset() { *x = VersionedTextDocumentIdentifier{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[20] + mi := &file_deephaven_proto_console_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1630,7 +1739,7 @@ func (x *VersionedTextDocumentIdentifier) String() string { func (*VersionedTextDocumentIdentifier) ProtoMessage() {} func (x *VersionedTextDocumentIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[20] + mi := &file_deephaven_proto_console_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1643,7 +1752,7 @@ func (x *VersionedTextDocumentIdentifier) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionedTextDocumentIdentifier.ProtoReflect.Descriptor instead. func (*VersionedTextDocumentIdentifier) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{20} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{22} } func (x *VersionedTextDocumentIdentifier) GetUri() string { @@ -1672,7 +1781,7 @@ type Position struct { func (x *Position) Reset() { *x = Position{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[21] + mi := &file_deephaven_proto_console_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1685,7 +1794,7 @@ func (x *Position) String() string { func (*Position) ProtoMessage() {} func (x *Position) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[21] + mi := &file_deephaven_proto_console_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1698,7 +1807,7 @@ func (x *Position) ProtoReflect() protoreflect.Message { // Deprecated: Use Position.ProtoReflect.Descriptor instead. func (*Position) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{21} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{23} } func (x *Position) GetLine() int32 { @@ -1730,7 +1839,7 @@ type GetCompletionItemsRequest struct { func (x *GetCompletionItemsRequest) Reset() { *x = GetCompletionItemsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[22] + mi := &file_deephaven_proto_console_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1743,7 +1852,7 @@ func (x *GetCompletionItemsRequest) String() string { func (*GetCompletionItemsRequest) ProtoMessage() {} func (x *GetCompletionItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[22] + mi := &file_deephaven_proto_console_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1756,7 +1865,7 @@ func (x *GetCompletionItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompletionItemsRequest.ProtoReflect.Descriptor instead. func (*GetCompletionItemsRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{22} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{24} } func (x *GetCompletionItemsRequest) GetConsoleId() *ticket.Ticket { @@ -1806,7 +1915,7 @@ type CompletionContext struct { func (x *CompletionContext) Reset() { *x = CompletionContext{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[23] + mi := &file_deephaven_proto_console_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1819,7 +1928,7 @@ func (x *CompletionContext) String() string { func (*CompletionContext) ProtoMessage() {} func (x *CompletionContext) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[23] + mi := &file_deephaven_proto_console_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1832,7 +1941,7 @@ func (x *CompletionContext) ProtoReflect() protoreflect.Message { // Deprecated: Use CompletionContext.ProtoReflect.Descriptor instead. func (*CompletionContext) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{23} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{25} } func (x *CompletionContext) GetTriggerKind() int32 { @@ -1862,7 +1971,7 @@ type GetCompletionItemsResponse struct { func (x *GetCompletionItemsResponse) Reset() { *x = GetCompletionItemsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[24] + mi := &file_deephaven_proto_console_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1875,7 +1984,7 @@ func (x *GetCompletionItemsResponse) String() string { func (*GetCompletionItemsResponse) ProtoMessage() {} func (x *GetCompletionItemsResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[24] + mi := &file_deephaven_proto_console_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1888,7 +1997,7 @@ func (x *GetCompletionItemsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompletionItemsResponse.ProtoReflect.Descriptor instead. func (*GetCompletionItemsResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{24} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{26} } func (x *GetCompletionItemsResponse) GetItems() []*CompletionItem { @@ -1936,7 +2045,7 @@ type CompletionItem struct { func (x *CompletionItem) Reset() { *x = CompletionItem{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[25] + mi := &file_deephaven_proto_console_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1949,7 +2058,7 @@ func (x *CompletionItem) String() string { func (*CompletionItem) ProtoMessage() {} func (x *CompletionItem) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[25] + mi := &file_deephaven_proto_console_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1962,7 +2071,7 @@ func (x *CompletionItem) ProtoReflect() protoreflect.Message { // Deprecated: Use CompletionItem.ProtoReflect.Descriptor instead. func (*CompletionItem) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{25} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27} } func (x *CompletionItem) GetStart() int32 { @@ -2075,7 +2184,7 @@ type TextEdit struct { func (x *TextEdit) Reset() { *x = TextEdit{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[26] + mi := &file_deephaven_proto_console_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2088,7 +2197,7 @@ func (x *TextEdit) String() string { func (*TextEdit) ProtoMessage() {} func (x *TextEdit) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[26] + mi := &file_deephaven_proto_console_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2101,7 +2210,7 @@ func (x *TextEdit) ProtoReflect() protoreflect.Message { // Deprecated: Use TextEdit.ProtoReflect.Descriptor instead. func (*TextEdit) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{26} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{28} } func (x *TextEdit) GetRange() *DocumentRange { @@ -2136,7 +2245,7 @@ type FigureDescriptor struct { func (x *FigureDescriptor) Reset() { *x = FigureDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[27] + mi := &file_deephaven_proto_console_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2149,7 +2258,7 @@ func (x *FigureDescriptor) String() string { func (*FigureDescriptor) ProtoMessage() {} func (x *FigureDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[27] + mi := &file_deephaven_proto_console_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2162,7 +2271,7 @@ func (x *FigureDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use FigureDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29} } func (x *FigureDescriptor) GetTitle() string { @@ -2234,7 +2343,7 @@ type ChangeDocumentRequest_TextDocumentContentChangeEvent struct { func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) Reset() { *x = ChangeDocumentRequest_TextDocumentContentChangeEvent{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[28] + mi := &file_deephaven_proto_console_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2247,7 +2356,7 @@ func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) String() string { func (*ChangeDocumentRequest_TextDocumentContentChangeEvent) ProtoMessage() {} func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[28] + mi := &file_deephaven_proto_console_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2260,7 +2369,7 @@ func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) ProtoReflect() pr // Deprecated: Use ChangeDocumentRequest_TextDocumentContentChangeEvent.ProtoReflect.Descriptor instead. func (*ChangeDocumentRequest_TextDocumentContentChangeEvent) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{18, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{20, 0} } func (x *ChangeDocumentRequest_TextDocumentContentChangeEvent) GetRange() *DocumentRange { @@ -2307,7 +2416,7 @@ type FigureDescriptor_ChartDescriptor struct { func (x *FigureDescriptor_ChartDescriptor) Reset() { *x = FigureDescriptor_ChartDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[29] + mi := &file_deephaven_proto_console_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2320,7 +2429,7 @@ func (x *FigureDescriptor_ChartDescriptor) String() string { func (*FigureDescriptor_ChartDescriptor) ProtoMessage() {} func (x *FigureDescriptor_ChartDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[29] + mi := &file_deephaven_proto_console_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2333,7 +2442,7 @@ func (x *FigureDescriptor_ChartDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use FigureDescriptor_ChartDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_ChartDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 0} } func (x *FigureDescriptor_ChartDescriptor) GetColspan() int32 { @@ -2451,7 +2560,7 @@ type FigureDescriptor_SeriesDescriptor struct { func (x *FigureDescriptor_SeriesDescriptor) Reset() { *x = FigureDescriptor_SeriesDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[30] + mi := &file_deephaven_proto_console_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2464,7 +2573,7 @@ func (x *FigureDescriptor_SeriesDescriptor) String() string { func (*FigureDescriptor_SeriesDescriptor) ProtoMessage() {} func (x *FigureDescriptor_SeriesDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[30] + mi := &file_deephaven_proto_console_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2477,7 +2586,7 @@ func (x *FigureDescriptor_SeriesDescriptor) ProtoReflect() protoreflect.Message // Deprecated: Use FigureDescriptor_SeriesDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_SeriesDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 1} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 1} } func (x *FigureDescriptor_SeriesDescriptor) GetPlotStyle() FigureDescriptor_SeriesPlotStyle { @@ -2602,7 +2711,7 @@ type FigureDescriptor_MultiSeriesDescriptor struct { func (x *FigureDescriptor_MultiSeriesDescriptor) Reset() { *x = FigureDescriptor_MultiSeriesDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[31] + mi := &file_deephaven_proto_console_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2615,7 +2724,7 @@ func (x *FigureDescriptor_MultiSeriesDescriptor) String() string { func (*FigureDescriptor_MultiSeriesDescriptor) ProtoMessage() {} func (x *FigureDescriptor_MultiSeriesDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[31] + mi := &file_deephaven_proto_console_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2628,7 +2737,7 @@ func (x *FigureDescriptor_MultiSeriesDescriptor) ProtoReflect() protoreflect.Mes // Deprecated: Use FigureDescriptor_MultiSeriesDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_MultiSeriesDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 2} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 2} } func (x *FigureDescriptor_MultiSeriesDescriptor) GetPlotStyle() FigureDescriptor_SeriesPlotStyle { @@ -2742,7 +2851,7 @@ type FigureDescriptor_StringMapWithDefault struct { func (x *FigureDescriptor_StringMapWithDefault) Reset() { *x = FigureDescriptor_StringMapWithDefault{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[32] + mi := &file_deephaven_proto_console_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2755,7 +2864,7 @@ func (x *FigureDescriptor_StringMapWithDefault) String() string { func (*FigureDescriptor_StringMapWithDefault) ProtoMessage() {} func (x *FigureDescriptor_StringMapWithDefault) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[32] + mi := &file_deephaven_proto_console_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2768,7 +2877,7 @@ func (x *FigureDescriptor_StringMapWithDefault) ProtoReflect() protoreflect.Mess // Deprecated: Use FigureDescriptor_StringMapWithDefault.ProtoReflect.Descriptor instead. func (*FigureDescriptor_StringMapWithDefault) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 3} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 3} } func (x *FigureDescriptor_StringMapWithDefault) GetDefaultString() string { @@ -2805,7 +2914,7 @@ type FigureDescriptor_DoubleMapWithDefault struct { func (x *FigureDescriptor_DoubleMapWithDefault) Reset() { *x = FigureDescriptor_DoubleMapWithDefault{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[33] + mi := &file_deephaven_proto_console_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2818,7 +2927,7 @@ func (x *FigureDescriptor_DoubleMapWithDefault) String() string { func (*FigureDescriptor_DoubleMapWithDefault) ProtoMessage() {} func (x *FigureDescriptor_DoubleMapWithDefault) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[33] + mi := &file_deephaven_proto_console_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2831,7 +2940,7 @@ func (x *FigureDescriptor_DoubleMapWithDefault) ProtoReflect() protoreflect.Mess // Deprecated: Use FigureDescriptor_DoubleMapWithDefault.ProtoReflect.Descriptor instead. func (*FigureDescriptor_DoubleMapWithDefault) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 4} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 4} } func (x *FigureDescriptor_DoubleMapWithDefault) GetDefaultDouble() float64 { @@ -2868,7 +2977,7 @@ type FigureDescriptor_BoolMapWithDefault struct { func (x *FigureDescriptor_BoolMapWithDefault) Reset() { *x = FigureDescriptor_BoolMapWithDefault{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[34] + mi := &file_deephaven_proto_console_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2881,7 +2990,7 @@ func (x *FigureDescriptor_BoolMapWithDefault) String() string { func (*FigureDescriptor_BoolMapWithDefault) ProtoMessage() {} func (x *FigureDescriptor_BoolMapWithDefault) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[34] + mi := &file_deephaven_proto_console_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2894,7 +3003,7 @@ func (x *FigureDescriptor_BoolMapWithDefault) ProtoReflect() protoreflect.Messag // Deprecated: Use FigureDescriptor_BoolMapWithDefault.ProtoReflect.Descriptor instead. func (*FigureDescriptor_BoolMapWithDefault) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 5} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 5} } func (x *FigureDescriptor_BoolMapWithDefault) GetDefaultBool() bool { @@ -2949,7 +3058,7 @@ type FigureDescriptor_AxisDescriptor struct { func (x *FigureDescriptor_AxisDescriptor) Reset() { *x = FigureDescriptor_AxisDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[35] + mi := &file_deephaven_proto_console_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2962,7 +3071,7 @@ func (x *FigureDescriptor_AxisDescriptor) String() string { func (*FigureDescriptor_AxisDescriptor) ProtoMessage() {} func (x *FigureDescriptor_AxisDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[35] + mi := &file_deephaven_proto_console_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2975,7 +3084,7 @@ func (x *FigureDescriptor_AxisDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use FigureDescriptor_AxisDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_AxisDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 6} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 6} } func (x *FigureDescriptor_AxisDescriptor) GetId() string { @@ -3140,7 +3249,7 @@ type FigureDescriptor_BusinessCalendarDescriptor struct { func (x *FigureDescriptor_BusinessCalendarDescriptor) Reset() { *x = FigureDescriptor_BusinessCalendarDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[36] + mi := &file_deephaven_proto_console_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3153,7 +3262,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor) String() string { func (*FigureDescriptor_BusinessCalendarDescriptor) ProtoMessage() {} func (x *FigureDescriptor_BusinessCalendarDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[36] + mi := &file_deephaven_proto_console_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3166,7 +3275,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor) ProtoReflect() protoreflec // Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_BusinessCalendarDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 7} } func (x *FigureDescriptor_BusinessCalendarDescriptor) GetName() string { @@ -3218,7 +3327,7 @@ type FigureDescriptor_MultiSeriesSourceDescriptor struct { func (x *FigureDescriptor_MultiSeriesSourceDescriptor) Reset() { *x = FigureDescriptor_MultiSeriesSourceDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[37] + mi := &file_deephaven_proto_console_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3231,7 +3340,7 @@ func (x *FigureDescriptor_MultiSeriesSourceDescriptor) String() string { func (*FigureDescriptor_MultiSeriesSourceDescriptor) ProtoMessage() {} func (x *FigureDescriptor_MultiSeriesSourceDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[37] + mi := &file_deephaven_proto_console_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3244,7 +3353,7 @@ func (x *FigureDescriptor_MultiSeriesSourceDescriptor) ProtoReflect() protorefle // Deprecated: Use FigureDescriptor_MultiSeriesSourceDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_MultiSeriesSourceDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 8} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 8} } func (x *FigureDescriptor_MultiSeriesSourceDescriptor) GetAxisId() string { @@ -3292,7 +3401,7 @@ type FigureDescriptor_SourceDescriptor struct { func (x *FigureDescriptor_SourceDescriptor) Reset() { *x = FigureDescriptor_SourceDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[38] + mi := &file_deephaven_proto_console_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3305,7 +3414,7 @@ func (x *FigureDescriptor_SourceDescriptor) String() string { func (*FigureDescriptor_SourceDescriptor) ProtoMessage() {} func (x *FigureDescriptor_SourceDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[38] + mi := &file_deephaven_proto_console_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3318,7 +3427,7 @@ func (x *FigureDescriptor_SourceDescriptor) ProtoReflect() protoreflect.Message // Deprecated: Use FigureDescriptor_SourceDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_SourceDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 9} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 9} } func (x *FigureDescriptor_SourceDescriptor) GetAxisId() string { @@ -3383,7 +3492,7 @@ type FigureDescriptor_OneClickDescriptor struct { func (x *FigureDescriptor_OneClickDescriptor) Reset() { *x = FigureDescriptor_OneClickDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[39] + mi := &file_deephaven_proto_console_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3396,7 +3505,7 @@ func (x *FigureDescriptor_OneClickDescriptor) String() string { func (*FigureDescriptor_OneClickDescriptor) ProtoMessage() {} func (x *FigureDescriptor_OneClickDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[39] + mi := &file_deephaven_proto_console_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3409,7 +3518,7 @@ func (x *FigureDescriptor_OneClickDescriptor) ProtoReflect() protoreflect.Messag // Deprecated: Use FigureDescriptor_OneClickDescriptor.ProtoReflect.Descriptor instead. func (*FigureDescriptor_OneClickDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 10} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 10} } func (x *FigureDescriptor_OneClickDescriptor) GetColumns() []string { @@ -3445,7 +3554,7 @@ type FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod struct { func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) Reset() { *x = FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[40] + mi := &file_deephaven_proto_console_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3458,7 +3567,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) String() st func (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) ProtoMessage() {} func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[40] + mi := &file_deephaven_proto_console_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3471,7 +3580,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) ProtoReflec // Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod.ProtoReflect.Descriptor instead. func (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 0} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 7, 0} } func (x *FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod) GetOpen() string { @@ -3500,7 +3609,7 @@ type FigureDescriptor_BusinessCalendarDescriptor_Holiday struct { func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) Reset() { *x = FigureDescriptor_BusinessCalendarDescriptor_Holiday{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[41] + mi := &file_deephaven_proto_console_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3513,7 +3622,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) String() string { func (*FigureDescriptor_BusinessCalendarDescriptor_Holiday) ProtoMessage() {} func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[41] + mi := &file_deephaven_proto_console_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3526,7 +3635,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) ProtoReflect() pro // Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_Holiday.ProtoReflect.Descriptor instead. func (*FigureDescriptor_BusinessCalendarDescriptor_Holiday) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 1} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 7, 1} } func (x *FigureDescriptor_BusinessCalendarDescriptor_Holiday) GetDate() *FigureDescriptor_BusinessCalendarDescriptor_LocalDate { @@ -3556,7 +3665,7 @@ type FigureDescriptor_BusinessCalendarDescriptor_LocalDate struct { func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) Reset() { *x = FigureDescriptor_BusinessCalendarDescriptor_LocalDate{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_console_proto_msgTypes[42] + mi := &file_deephaven_proto_console_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3569,7 +3678,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) String() string func (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate) ProtoMessage() {} func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_console_proto_msgTypes[42] + mi := &file_deephaven_proto_console_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3582,7 +3691,7 @@ func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) ProtoReflect() p // Deprecated: Use FigureDescriptor_BusinessCalendarDescriptor_LocalDate.ProtoReflect.Descriptor instead. func (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate) Descriptor() ([]byte, []int) { - return file_deephaven_proto_console_proto_rawDescGZIP(), []int{27, 7, 2} + return file_deephaven_proto_console_proto_rawDescGZIP(), []int{29, 7, 2} } func (x *FigureDescriptor_BusinessCalendarDescriptor_LocalDate) GetYear() int32 { @@ -3637,832 +3746,851 @@ var file_deephaven_proto_console_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x6b, 0x0a, 0x16, 0x4c, 0x6f, 0x67, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x39, 0x0a, 0x17, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x6c, - 0x6f, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, - 0x4c, 0x6f, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x73, 0x22, 0x6e, 0x0a, 0x13, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x06, 0x6d, - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, - 0x06, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x22, 0x7b, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, - 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, - 0x03, 0x22, 0x8e, 0x01, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x4f, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x48, 0x65, + 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x09, 0x6d, + 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, + 0x30, 0x01, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, + 0x23, 0x0a, 0x0b, 0x66, 0x72, 0x65, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0a, 0x66, 0x72, 0x65, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x6b, 0x0a, 0x16, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, + 0x0a, 0x17, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x02, 0x30, 0x01, 0x52, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x4c, 0x6f, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x73, 0x22, 0x6e, 0x0a, 0x13, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x06, 0x6d, 0x69, 0x63, 0x72, + 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x06, 0x6d, 0x69, + 0x63, 0x72, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, + 0x05, 0x22, 0x7b, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x8e, + 0x01, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x4f, + 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, + 0xd7, 0x01, 0x0a, 0x1a, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x22, 0xd7, 0x01, 0x0a, 0x1a, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x72, 0x69, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, + 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x1d, 0x0a, 0x1b, 0x42, 0x69, 0x6e, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x76, - 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x44, 0x0a, 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x1d, 0x0a, 0x1b, - 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x14, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x48, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xd4, 0x03, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x64, 0x0a, 0x0d, 0x6f, 0x70, 0x65, - 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x6a, 0x0a, 0x0f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x14, 0x67, - 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x12, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, - 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x14, 0x41, 0x75, 0x74, - 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x71, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x15, 0x0a, 0x13, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x13, 0x4f, 0x70, 0x65, 0x6e, - 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, - 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x5f, 0x0a, 0x0d, 0x74, 0x65, 0x78, - 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, - 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x74, 0x65, - 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x65, - 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, - 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, - 0xd0, 0x01, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, - 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd4, + 0x03, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x64, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, + 0x6f, 0x70, 0x65, 0x6e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6a, 0x0a, 0x0f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x67, + 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, - 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x22, 0x84, 0x04, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x0a, + 0x13, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x13, 0x4f, 0x70, 0x65, 0x6e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, + 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x5f, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x5e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x1a, 0xa6, 0x01, 0x0a, 0x1e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x65, 0x78, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x1f, 0x0a, + 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0xd0, 0x01, 0x0a, + 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, + 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x84, 0x04, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x44, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x4d, 0x0a, 0x1f, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, - 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, - 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x9b, 0x03, 0x0a, 0x19, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, - 0x12, 0x55, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, - 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x2b, - 0x0a, 0x11, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, - 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0xa5, 0x01, 0x0a, 0x1a, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x22, 0xb6, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x72, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x09, 0x74, 0x65, - 0x78, 0x74, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, + 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x5e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, - 0x74, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x73, 0x6f, 0x72, 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x54, 0x65, 0x78, - 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x66, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x73, - 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x13, 0x61, 0x64, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x73, 0x12, - 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, - 0x74, 0x65, 0x72, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x08, - 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, + 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0xa6, 0x01, + 0x0a, 0x1e, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x83, 0x3a, 0x0a, 0x10, - 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x0f, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x73, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x72, 0x6f, 0x77, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, - 0x12, 0x62, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x61, - 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x63, 0x68, - 0x61, 0x72, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0d, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0xae, 0x06, 0x0a, - 0x0f, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, - 0x77, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x6f, 0x77, - 0x73, 0x70, 0x61, 0x6e, 0x12, 0x63, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x50, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x44, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, - 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, - 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x5d, - 0x0a, 0x04, 0x61, 0x78, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x61, 0x78, 0x65, 0x73, 0x12, 0x73, 0x0a, - 0x0a, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x54, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, - 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, - 0x61, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, - 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x4c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x46, 0x6f, 0x6e, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, - 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x33, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x04, 0x69, 0x73, 0x33, 0x64, 0x22, 0x5b, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x72, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x58, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, - 0x49, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, 0x43, 0x10, 0x02, 0x12, 0x0c, - 0x0a, 0x08, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, - 0x58, 0x59, 0x5a, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, - 0x59, 0x5f, 0x33, 0x44, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, 0x45, 0x4d, 0x41, - 0x50, 0x10, 0x06, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0xb3, 0x06, - 0x0a, 0x10, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x12, 0x69, 0x0a, 0x0a, 0x70, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x4d, 0x0a, 0x1f, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x61, + 0x63, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, + 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x9b, 0x03, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x55, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, + 0x54, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x74, + 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x43, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0xa5, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, - 0x6c, 0x65, 0x52, 0x09, 0x70, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, - 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x73, - 0x68, 0x61, 0x70, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x56, 0x69, 0x73, - 0x69, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0f, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, - 0x72, 0x12, 0x31, 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, - 0x10, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, - 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x03, 0x52, 0x0f, 0x78, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, - 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x12, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, - 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x04, 0x52, 0x0f, 0x79, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, - 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x70, - 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x68, 0x61, 0x70, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x68, 0x61, - 0x70, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x48, 0x05, 0x52, - 0x09, 0x73, 0x68, 0x61, 0x70, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x70, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, - 0x68, 0x61, 0x70, 0x65, 0x12, 0x6e, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, + 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x22, 0xb6, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x65, 0x64, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, - 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, - 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, - 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x79, 0x5f, 0x74, 0x6f, - 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x0d, - 0x0a, 0x0b, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x4a, 0x04, 0x08, - 0x07, 0x10, 0x08, 0x1a, 0xa6, 0x0c, 0x0a, 0x15, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x69, 0x0a, - 0x0a, 0x70, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x08, + 0x74, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x72, 0x74, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x72, + 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x54, 0x65, 0x78, 0x74, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x12, 0x66, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x73, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x45, 0x64, 0x69, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x43, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x08, 0x54, 0x65, 0x78, + 0x74, 0x45, 0x64, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x83, 0x3a, 0x0a, 0x10, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x19, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, + 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x62, 0x0a, + 0x06, 0x63, 0x68, 0x61, 0x72, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x74, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0xae, 0x06, 0x0a, 0x0f, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x77, 0x73, 0x70, + 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x6f, 0x77, 0x73, 0x70, 0x61, + 0x6e, 0x12, 0x63, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, - 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x70, - 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x0a, - 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x70, 0x0a, 0x0b, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x72, + 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x50, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x04, 0x61, + 0x78, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x61, 0x78, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0a, 0x63, 0x68, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x54, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x74, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, + 0x6f, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x4c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, + 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x69, 0x73, 0x33, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, + 0x73, 0x33, 0x64, 0x22, 0x5b, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x06, 0x0a, 0x02, 0x58, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x49, 0x45, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, 0x43, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, + 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x59, 0x5a, + 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x33, + 0x44, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, 0x45, 0x4d, 0x41, 0x50, 0x10, 0x06, + 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0xb3, 0x06, 0x0a, 0x10, 0x53, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, + 0x69, 0x0a, 0x0a, 0x70, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, + 0x09, 0x70, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x12, 0x74, 0x0a, 0x0e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, - 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x78, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, - 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x52, 0x0f, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x12, 0x7d, 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x73, 0x68, 0x61, 0x70, + 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x48, 0x01, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, + 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x31, + 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x10, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x30, 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, + 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, + 0x0f, 0x78, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, + 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x12, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, + 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x04, 0x52, 0x0f, 0x79, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x70, + 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x48, 0x05, 0x52, 0x09, 0x73, 0x68, + 0x61, 0x70, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, + 0x61, 0x70, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x68, 0x61, 0x70, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x68, 0x61, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x61, 0x70, + 0x65, 0x12, 0x6e, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, + 0x62, 0x6c, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x5f, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x15, 0x0a, + 0x13, 0x5f, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, + 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x73, 0x68, 0x61, 0x70, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, + 0x1a, 0xa6, 0x0c, 0x0a, 0x15, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x69, 0x0a, 0x0a, 0x70, 0x6c, + 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x4a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, - 0x10, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x12, 0x7c, 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, - 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x70, 0x6c, 0x6f, 0x74, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, + 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x09, + 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x70, 0x0a, 0x0b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, + 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x72, 0x0a, 0x0d, 0x6c, + 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, + 0x74, 0x0a, 0x0e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x78, 0x0a, 0x10, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, - 0x78, 0x54, 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, - 0x7c, 0x0a, 0x12, 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, - 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, + 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, + 0x7d, 0x0a, 0x12, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, - 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x79, 0x54, - 0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x70, 0x0a, - 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, - 0x6e, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, - 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x70, 0x0a, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x7c, + 0x0a, 0x12, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x78, 0x54, 0x6f, + 0x6f, 0x6c, 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x7c, 0x0a, 0x12, + 0x79, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, + 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x79, 0x54, 0x6f, 0x6f, 0x6c, + 0x54, 0x69, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x70, 0x0a, 0x0b, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x6e, 0x0a, 0x0a, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x70, 0x0a, 0x0b, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x4f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x70, 0x65, 0x12, 0x79, + 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0e, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x70, - 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, - 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x81, 0x01, 0x0a, - 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x88, 0x01, - 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x11, 0x0a, - 0x0f, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x1a, 0x81, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, - 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x01, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, - 0x75, 0x62, 0x6c, 0x65, 0x1a, 0x79, 0x0a, 0x12, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, - 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x88, + 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x81, 0x01, 0x0a, 0x14, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x12, + 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, + 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1a, 0x81, 0x01, + 0x0a, 0x14, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, + 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0f, - 0x0a, 0x0d, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x1a, - 0xb3, 0x0a, 0x0a, 0x0e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x79, 0x0a, 0x0b, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x58, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x66, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x52, 0x2e, 0x69, 0x6f, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x11, + 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x1a, 0x79, 0x0a, 0x12, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x57, 0x69, 0x74, 0x68, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x88, 0x01, 0x01, 0x12, + 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, + 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x08, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x1a, 0xb3, 0x0a, 0x0a, + 0x0e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x79, 0x0a, 0x0b, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x58, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x66, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x52, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x72, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x1d, + 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x50, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, + 0x61, 0x78, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, + 0x6d, 0x61, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x6f, + 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, + 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x6a, 0x6f, + 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, + 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x69, 0x6e, 0x6f, + 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x17, 0x67, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, + 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x14, 0x67, 0x61, 0x70, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, + 0x6e, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x30, + 0x0a, 0x14, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x01, 0x52, 0x12, 0x6d, 0x61, + 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x28, 0x0a, 0x10, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x61, + 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x74, 0x69, 0x63, 0x6b, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, + 0x76, 0x65, 0x72, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x65, + 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x61, 0x78, + 0x69, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, + 0x41, 0x78, 0x69, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x1c, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, + 0x73, 0x5f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x55, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x72, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x46, 0x6f, 0x6e, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x46, 0x6f, 0x6e, 0x74, 0x12, - 0x2a, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, - 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, - 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, - 0x69, 0x63, 0x6b, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x54, - 0x69, 0x63, 0x6b, 0x73, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, - 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x17, 0x67, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x74, - 0x77, 0x65, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x14, 0x67, 0x61, 0x70, 0x42, 0x65, 0x74, - 0x77, 0x65, 0x65, 0x6e, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x73, 0x88, 0x01, - 0x01, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x5f, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x01, 0x52, - 0x12, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x5f, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x74, - 0x69, 0x63, 0x6b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x61, 0x78, 0x69, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x54, - 0x69, 0x6d, 0x65, 0x41, 0x78, 0x69, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x1c, 0x62, 0x75, 0x73, 0x69, - 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x55, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, - 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x1a, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, + 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x52, 0x1a, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, + 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x22, 0x2a, + 0x0a, 0x0e, 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0a, + 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x22, 0x43, 0x0a, 0x08, 0x41, 0x78, + 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, 0x12, 0x05, 0x0a, + 0x01, 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x41, 0x50, 0x45, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x41, 0x42, + 0x45, 0x4c, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x10, 0x05, 0x22, + 0x42, 0x0a, 0x0c, 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x07, 0x0a, 0x03, 0x54, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x4f, 0x54, 0x54, + 0x4f, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, 0x02, 0x12, 0x09, + 0x0a, 0x05, 0x52, 0x49, 0x47, 0x48, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, + 0x45, 0x10, 0x04, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x70, + 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x67, 0x61, 0x70, 0x5f, 0x62, + 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x63, + 0x6b, 0x73, 0x1a, 0xe2, 0x07, 0x0a, 0x1a, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x22, 0x2a, 0x0a, 0x0e, 0x41, 0x78, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, - 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x22, 0x43, 0x0a, - 0x08, 0x41, 0x78, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, - 0x12, 0x05, 0x0a, 0x01, 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x41, 0x50, 0x45, - 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, - 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x4c, 0x4f, 0x52, - 0x10, 0x05, 0x22, 0x42, 0x0a, 0x0c, 0x41, 0x78, 0x69, 0x73, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x42, - 0x4f, 0x54, 0x54, 0x4f, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, - 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47, 0x48, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, - 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x04, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x67, 0x61, - 0x70, 0x5f, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x5f, - 0x74, 0x69, 0x63, 0x6b, 0x73, 0x1a, 0xe2, 0x07, 0x0a, 0x1a, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, - 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, - 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, - 0x73, 0x73, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x5f, 0x2e, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, + 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, + 0x6e, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, + 0x64, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x5f, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, + 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x2e, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x0c, 0x62, 0x75, 0x73, + 0x69, 0x6e, 0x65, 0x73, 0x73, 0x44, 0x61, 0x79, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x62, 0x75, + 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x64, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, + 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, + 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, 0x75, 0x73, 0x69, + 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x79, 0x0a, 0x08, 0x68, + 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x5d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x0c, - 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x44, 0x61, 0x79, 0x73, 0x12, 0x8f, 0x01, 0x0a, - 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x64, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, - 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, - 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, - 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x79, - 0x0a, 0x08, 0x68, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x5d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, - 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x52, - 0x08, 0x68, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x1a, 0x3a, 0x0a, 0x0e, 0x42, 0x75, 0x73, - 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, - 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x90, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x79, 0x12, 0x73, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x5f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, - 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, - 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x65, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, - 0x65, 0x73, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x64, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, - 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, - 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, - 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x1a, 0x47, 0x0a, 0x09, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x44, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x12, - 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, - 0x79, 0x22, 0x67, 0x0a, 0x09, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x0a, - 0x0a, 0x06, 0x53, 0x55, 0x4e, 0x44, 0x41, 0x59, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, - 0x4e, 0x44, 0x41, 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x55, 0x45, 0x53, 0x44, 0x41, - 0x59, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x45, 0x44, 0x4e, 0x45, 0x53, 0x44, 0x41, 0x59, - 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x48, 0x55, 0x52, 0x53, 0x44, 0x41, 0x59, 0x10, 0x04, - 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x49, 0x44, 0x41, 0x59, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, - 0x53, 0x41, 0x54, 0x55, 0x52, 0x44, 0x41, 0x59, 0x10, 0x06, 0x1a, 0xe4, 0x01, 0x0a, 0x1b, 0x4d, - 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, - 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, - 0x73, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, - 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, - 0x65, 0x1a, 0x81, 0x03, 0x0a, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, 0x69, 0x73, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, 0x73, 0x49, 0x64, 0x12, - 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x12, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x6a, 0x0a, 0x09, 0x6f, 0x6e, 0x65, - 0x5f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x52, 0x08, 0x68, 0x6f, + 0x6c, 0x69, 0x64, 0x61, 0x79, 0x73, 0x1a, 0x3a, 0x0a, 0x0e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x1a, 0x90, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x12, 0x73, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x63, - 0x6b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x6f, 0x6e, 0x65, - 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x1a, 0x95, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, - 0x63, 0x6b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1e, 0x72, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0xa6, 0x01, - 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, - 0x65, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, - 0x41, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, - 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x52, 0x45, 0x41, 0x10, 0x03, 0x12, - 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x41, 0x52, 0x45, 0x41, 0x10, - 0x04, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x49, 0x45, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, - 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, - 0x43, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x43, 0x41, 0x54, 0x54, 0x45, 0x52, 0x10, 0x08, - 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x45, 0x50, 0x10, 0x09, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, - 0x45, 0x4d, 0x41, 0x50, 0x10, 0x0b, 0x22, 0xd2, 0x01, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, - 0x59, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x58, 0x5f, - 0x4c, 0x4f, 0x57, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x58, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, - 0x04, 0x12, 0x09, 0x0a, 0x05, 0x59, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, - 0x59, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, - 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x08, 0x12, 0x08, 0x0a, 0x04, - 0x48, 0x49, 0x47, 0x48, 0x10, 0x09, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x0a, 0x12, - 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x0b, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, - 0x41, 0x50, 0x45, 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x0d, 0x12, - 0x09, 0x0a, 0x05, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x10, 0x0e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, - 0x4c, 0x4f, 0x52, 0x10, 0x0f, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x10, - 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, - 0x11, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x12, 0x42, 0x08, 0x0a, 0x06, 0x5f, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x4a, 0x04, 0x08, 0x0c, 0x10, - 0x0d, 0x32, 0xff, 0x0a, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x69, 0x6f, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, + 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x64, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, + 0x65, 0x73, 0x73, 0x43, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0f, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x73, 0x1a, 0x47, 0x0a, 0x09, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, + 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x79, 0x22, 0x67, + 0x0a, 0x09, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x0a, 0x0a, 0x06, 0x53, + 0x55, 0x4e, 0x44, 0x41, 0x59, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, 0x4e, 0x44, 0x41, + 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x55, 0x45, 0x53, 0x44, 0x41, 0x59, 0x10, 0x02, + 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x45, 0x44, 0x4e, 0x45, 0x53, 0x44, 0x41, 0x59, 0x10, 0x03, 0x12, + 0x0c, 0x0a, 0x08, 0x54, 0x48, 0x55, 0x52, 0x53, 0x44, 0x41, 0x59, 0x10, 0x04, 0x12, 0x0a, 0x0a, + 0x06, 0x46, 0x52, 0x49, 0x44, 0x41, 0x59, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x41, 0x54, + 0x55, 0x52, 0x44, 0x41, 0x59, 0x10, 0x06, 0x1a, 0xe4, 0x01, 0x0a, 0x1b, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, 0x69, 0x73, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, 0x73, 0x49, 0x64, + 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x81, + 0x03, 0x0a, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x78, 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x78, 0x69, 0x73, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x8f, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, - 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x96, 0x01, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x54, - 0x6f, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, + 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x12, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x6a, 0x0a, 0x09, 0x6f, 0x6e, 0x65, 0x5f, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x6f, 0x6e, 0x65, 0x43, 0x6c, 0x69, + 0x63, 0x6b, 0x1a, 0x95, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1e, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x74, 0x6f, + 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x54, 0x6f, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x53, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x07, + 0x0a, 0x03, 0x42, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x43, 0x4b, + 0x45, 0x44, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4e, 0x45, + 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x52, 0x45, 0x41, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x54, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x41, 0x52, 0x45, 0x41, 0x10, 0x04, 0x12, 0x07, + 0x0a, 0x03, 0x50, 0x49, 0x45, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, + 0x47, 0x52, 0x41, 0x4d, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x48, 0x4c, 0x43, 0x10, 0x07, + 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x43, 0x41, 0x54, 0x54, 0x45, 0x52, 0x10, 0x08, 0x12, 0x08, 0x0a, + 0x04, 0x53, 0x54, 0x45, 0x50, 0x10, 0x09, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x42, 0x41, 0x52, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x45, 0x45, 0x4d, 0x41, + 0x50, 0x10, 0x0b, 0x22, 0xd2, 0x01, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x59, 0x10, 0x01, + 0x12, 0x05, 0x0a, 0x01, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x58, 0x5f, 0x4c, 0x4f, 0x57, + 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x58, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x04, 0x12, 0x09, + 0x0a, 0x05, 0x59, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x59, 0x5f, 0x48, + 0x49, 0x47, 0x48, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x07, 0x12, + 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x08, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, + 0x48, 0x10, 0x09, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x0a, 0x12, 0x09, 0x0a, 0x05, + 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x0b, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x41, 0x50, 0x45, + 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x0d, 0x12, 0x09, 0x0a, 0x05, + 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x10, 0x0e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x4c, 0x4f, 0x52, + 0x10, 0x0f, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x10, 0x10, 0x12, 0x0e, + 0x0a, 0x0a, 0x48, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x11, 0x12, 0x08, + 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x12, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x4a, 0x04, 0x08, 0x0c, 0x10, 0x0d, 0x32, 0x8e, + 0x0c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3f, 0x2e, + 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8f, 0x01, 0x0a, + 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8c, + 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa4, 0x01, 0x0a, 0x13, 0x42, 0x69, 0x6e, 0x64, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, - 0x44, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x99, - 0x01, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x4f, - 0x70, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x98, 0x01, 0x0a, 0x16, 0x4e, 0x65, 0x78, - 0x74, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x70, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x96, 0x01, + 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x54, 0x6f, 0x4c, 0x6f, 0x67, + 0x73, 0x12, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, - 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, - 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, - 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, + 0x6f, 0x67, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, + 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x12, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0xa4, 0x01, 0x0a, 0x13, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x44, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x45, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x69, 0x6e, + 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x6f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x99, 0x01, 0x0a, 0x12, 0x41, + 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, + 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, 0x6f, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x4f, 0x70, 0x65, 0x6e, 0x41, + 0x75, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, + 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, 0x6f, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x30, 0x01, 0x12, 0x98, 0x01, 0x0a, 0x16, 0x4e, 0x65, 0x78, 0x74, 0x41, 0x75, 0x74, + 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, + 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, + 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4478,7 +4606,7 @@ func file_deephaven_proto_console_proto_rawDescGZIP() []byte { } var file_deephaven_proto_console_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_deephaven_proto_console_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_deephaven_proto_console_proto_msgTypes = make([]protoimpl.MessageInfo, 45) var file_deephaven_proto_console_proto_goTypes = []interface{}{ (FigureDescriptor_SeriesPlotStyle)(0), // 0: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle (FigureDescriptor_SourceType)(0), // 1: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType @@ -4491,132 +4619,136 @@ var file_deephaven_proto_console_proto_goTypes = []interface{}{ (*GetConsoleTypesResponse)(nil), // 8: io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse (*StartConsoleRequest)(nil), // 9: io.deephaven.proto.backplane.script.grpc.StartConsoleRequest (*StartConsoleResponse)(nil), // 10: io.deephaven.proto.backplane.script.grpc.StartConsoleResponse - (*LogSubscriptionRequest)(nil), // 11: io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest - (*LogSubscriptionData)(nil), // 12: io.deephaven.proto.backplane.script.grpc.LogSubscriptionData - (*ExecuteCommandRequest)(nil), // 13: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest - (*ExecuteCommandResponse)(nil), // 14: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse - (*BindTableToVariableRequest)(nil), // 15: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest - (*BindTableToVariableResponse)(nil), // 16: io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse - (*CancelCommandRequest)(nil), // 17: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest - (*CancelCommandResponse)(nil), // 18: io.deephaven.proto.backplane.script.grpc.CancelCommandResponse - (*AutoCompleteRequest)(nil), // 19: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest - (*AutoCompleteResponse)(nil), // 20: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse - (*BrowserNextResponse)(nil), // 21: io.deephaven.proto.backplane.script.grpc.BrowserNextResponse - (*OpenDocumentRequest)(nil), // 22: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest - (*TextDocumentItem)(nil), // 23: io.deephaven.proto.backplane.script.grpc.TextDocumentItem - (*CloseDocumentRequest)(nil), // 24: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest - (*ChangeDocumentRequest)(nil), // 25: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest - (*DocumentRange)(nil), // 26: io.deephaven.proto.backplane.script.grpc.DocumentRange - (*VersionedTextDocumentIdentifier)(nil), // 27: io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier - (*Position)(nil), // 28: io.deephaven.proto.backplane.script.grpc.Position - (*GetCompletionItemsRequest)(nil), // 29: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest - (*CompletionContext)(nil), // 30: io.deephaven.proto.backplane.script.grpc.CompletionContext - (*GetCompletionItemsResponse)(nil), // 31: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse - (*CompletionItem)(nil), // 32: io.deephaven.proto.backplane.script.grpc.CompletionItem - (*TextEdit)(nil), // 33: io.deephaven.proto.backplane.script.grpc.TextEdit - (*FigureDescriptor)(nil), // 34: io.deephaven.proto.backplane.script.grpc.FigureDescriptor - (*ChangeDocumentRequest_TextDocumentContentChangeEvent)(nil), // 35: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent - (*FigureDescriptor_ChartDescriptor)(nil), // 36: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor - (*FigureDescriptor_SeriesDescriptor)(nil), // 37: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor - (*FigureDescriptor_MultiSeriesDescriptor)(nil), // 38: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor - (*FigureDescriptor_StringMapWithDefault)(nil), // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - (*FigureDescriptor_DoubleMapWithDefault)(nil), // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault - (*FigureDescriptor_BoolMapWithDefault)(nil), // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault - (*FigureDescriptor_AxisDescriptor)(nil), // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor - (*FigureDescriptor_BusinessCalendarDescriptor)(nil), // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor - (*FigureDescriptor_MultiSeriesSourceDescriptor)(nil), // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor - (*FigureDescriptor_SourceDescriptor)(nil), // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor - (*FigureDescriptor_OneClickDescriptor)(nil), // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor - (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod)(nil), // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod - (*FigureDescriptor_BusinessCalendarDescriptor_Holiday)(nil), // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday - (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate)(nil), // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate - (*ticket.Ticket)(nil), // 50: io.deephaven.proto.backplane.grpc.Ticket - (*application.FieldsChangeUpdate)(nil), // 51: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate + (*GetHeapInfoRequest)(nil), // 11: io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest + (*GetHeapInfoResponse)(nil), // 12: io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse + (*LogSubscriptionRequest)(nil), // 13: io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest + (*LogSubscriptionData)(nil), // 14: io.deephaven.proto.backplane.script.grpc.LogSubscriptionData + (*ExecuteCommandRequest)(nil), // 15: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest + (*ExecuteCommandResponse)(nil), // 16: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse + (*BindTableToVariableRequest)(nil), // 17: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest + (*BindTableToVariableResponse)(nil), // 18: io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse + (*CancelCommandRequest)(nil), // 19: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest + (*CancelCommandResponse)(nil), // 20: io.deephaven.proto.backplane.script.grpc.CancelCommandResponse + (*AutoCompleteRequest)(nil), // 21: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + (*AutoCompleteResponse)(nil), // 22: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + (*BrowserNextResponse)(nil), // 23: io.deephaven.proto.backplane.script.grpc.BrowserNextResponse + (*OpenDocumentRequest)(nil), // 24: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest + (*TextDocumentItem)(nil), // 25: io.deephaven.proto.backplane.script.grpc.TextDocumentItem + (*CloseDocumentRequest)(nil), // 26: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest + (*ChangeDocumentRequest)(nil), // 27: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest + (*DocumentRange)(nil), // 28: io.deephaven.proto.backplane.script.grpc.DocumentRange + (*VersionedTextDocumentIdentifier)(nil), // 29: io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + (*Position)(nil), // 30: io.deephaven.proto.backplane.script.grpc.Position + (*GetCompletionItemsRequest)(nil), // 31: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest + (*CompletionContext)(nil), // 32: io.deephaven.proto.backplane.script.grpc.CompletionContext + (*GetCompletionItemsResponse)(nil), // 33: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse + (*CompletionItem)(nil), // 34: io.deephaven.proto.backplane.script.grpc.CompletionItem + (*TextEdit)(nil), // 35: io.deephaven.proto.backplane.script.grpc.TextEdit + (*FigureDescriptor)(nil), // 36: io.deephaven.proto.backplane.script.grpc.FigureDescriptor + (*ChangeDocumentRequest_TextDocumentContentChangeEvent)(nil), // 37: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent + (*FigureDescriptor_ChartDescriptor)(nil), // 38: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor + (*FigureDescriptor_SeriesDescriptor)(nil), // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor + (*FigureDescriptor_MultiSeriesDescriptor)(nil), // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor + (*FigureDescriptor_StringMapWithDefault)(nil), // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + (*FigureDescriptor_DoubleMapWithDefault)(nil), // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault + (*FigureDescriptor_BoolMapWithDefault)(nil), // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + (*FigureDescriptor_AxisDescriptor)(nil), // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor + (*FigureDescriptor_BusinessCalendarDescriptor)(nil), // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor + (*FigureDescriptor_MultiSeriesSourceDescriptor)(nil), // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor + (*FigureDescriptor_SourceDescriptor)(nil), // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor + (*FigureDescriptor_OneClickDescriptor)(nil), // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor + (*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod)(nil), // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + (*FigureDescriptor_BusinessCalendarDescriptor_Holiday)(nil), // 50: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday + (*FigureDescriptor_BusinessCalendarDescriptor_LocalDate)(nil), // 51: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate + (*ticket.Ticket)(nil), // 52: io.deephaven.proto.backplane.grpc.Ticket + (*application.FieldsChangeUpdate)(nil), // 53: io.deephaven.proto.backplane.grpc.FieldsChangeUpdate } var file_deephaven_proto_console_proto_depIdxs = []int32{ - 50, // 0: io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 50, // 1: io.deephaven.proto.backplane.script.grpc.StartConsoleResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 50, // 2: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 51, // 3: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.changes:type_name -> io.deephaven.proto.backplane.grpc.FieldsChangeUpdate - 50, // 4: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 50, // 5: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.table_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 50, // 6: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 50, // 7: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.command_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 22, // 8: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.open_document:type_name -> io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest - 25, // 9: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.change_document:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest - 29, // 10: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.get_completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest - 24, // 11: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.close_document:type_name -> io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest - 31, // 12: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse - 50, // 13: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 23, // 14: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.TextDocumentItem - 50, // 15: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 27, // 16: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier - 50, // 17: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 27, // 18: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier - 35, // 19: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.content_changes:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent - 28, // 20: io.deephaven.proto.backplane.script.grpc.DocumentRange.start:type_name -> io.deephaven.proto.backplane.script.grpc.Position - 28, // 21: io.deephaven.proto.backplane.script.grpc.DocumentRange.end:type_name -> io.deephaven.proto.backplane.script.grpc.Position - 50, // 22: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 30, // 23: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.context:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionContext - 27, // 24: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier - 28, // 25: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.position:type_name -> io.deephaven.proto.backplane.script.grpc.Position - 32, // 26: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.items:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionItem - 33, // 27: io.deephaven.proto.backplane.script.grpc.CompletionItem.text_edit:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit - 33, // 28: io.deephaven.proto.backplane.script.grpc.CompletionItem.additional_text_edits:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit - 26, // 29: io.deephaven.proto.backplane.script.grpc.TextEdit.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange - 36, // 30: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.charts:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor - 26, // 31: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange - 37, // 32: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor - 38, // 33: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.multi_series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor - 42, // 34: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.axes:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor + 52, // 0: io.deephaven.proto.backplane.script.grpc.StartConsoleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 52, // 1: io.deephaven.proto.backplane.script.grpc.StartConsoleResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 52, // 2: io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 53, // 3: io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse.changes:type_name -> io.deephaven.proto.backplane.grpc.FieldsChangeUpdate + 52, // 4: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 52, // 5: io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest.table_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 52, // 6: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 52, // 7: io.deephaven.proto.backplane.script.grpc.CancelCommandRequest.command_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 24, // 8: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.open_document:type_name -> io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest + 27, // 9: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.change_document:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest + 31, // 10: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.get_completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest + 26, // 11: io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest.close_document:type_name -> io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest + 33, // 12: io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse.completion_items:type_name -> io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse + 52, // 13: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 25, // 14: io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.TextDocumentItem + 52, // 15: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 29, // 16: io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 52, // 17: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 29, // 18: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 37, // 19: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.content_changes:type_name -> io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent + 30, // 20: io.deephaven.proto.backplane.script.grpc.DocumentRange.start:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 30, // 21: io.deephaven.proto.backplane.script.grpc.DocumentRange.end:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 52, // 22: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.console_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 32, // 23: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.context:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionContext + 29, // 24: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.text_document:type_name -> io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier + 30, // 25: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest.position:type_name -> io.deephaven.proto.backplane.script.grpc.Position + 34, // 26: io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse.items:type_name -> io.deephaven.proto.backplane.script.grpc.CompletionItem + 35, // 27: io.deephaven.proto.backplane.script.grpc.CompletionItem.text_edit:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit + 35, // 28: io.deephaven.proto.backplane.script.grpc.CompletionItem.additional_text_edits:type_name -> io.deephaven.proto.backplane.script.grpc.TextEdit + 28, // 29: io.deephaven.proto.backplane.script.grpc.TextEdit.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange + 38, // 30: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.charts:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor + 28, // 31: io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent.range:type_name -> io.deephaven.proto.backplane.script.grpc.DocumentRange + 39, // 32: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor + 40, // 33: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.multi_series:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor + 44, // 34: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.axes:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor 2, // 35: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.chart_type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType 0, // 36: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.plot_style:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle - 45, // 37: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor + 47, // 37: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor 0, // 38: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.plot_style:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle - 39, // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.line_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 39, // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 41, // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.lines_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault - 41, // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.points_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault - 41, // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.gradient_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault - 39, // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label_format:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 39, // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.x_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 39, // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.y_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 39, // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 40, // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_size:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault - 39, // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_shape:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault - 44, // 50: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor + 41, // 39: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.line_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 41, // 40: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_color:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 43, // 41: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.lines_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 43, // 42: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.points_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 43, // 43: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.gradient_visible:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault + 41, // 44: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label_format:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 41, // 45: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.x_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 41, // 46: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.y_tool_tip_pattern:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 41, // 47: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_label:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 42, // 48: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_size:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault + 41, // 49: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.point_shape:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault + 46, // 50: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor.data_sources:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor 3, // 51: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.format_type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType 4, // 52: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType 5, // 53: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.position:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition - 43, // 54: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.business_calendar_descriptor:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor + 45, // 54: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.business_calendar_descriptor:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor 6, // 55: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_days:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek - 47, // 56: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod - 48, // 57: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.holidays:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday + 49, // 56: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + 50, // 57: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.holidays:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday 1, // 58: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType 1, // 59: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.type:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType - 46, // 60: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.one_click:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor - 49, // 61: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.date:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate - 47, // 62: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod + 48, // 60: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor.one_click:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor + 51, // 61: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.date:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate + 49, // 62: io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday.business_periods:type_name -> io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod 7, // 63: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes:input_type -> io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest 9, // 64: io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole:input_type -> io.deephaven.proto.backplane.script.grpc.StartConsoleRequest - 11, // 65: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:input_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest - 13, // 66: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:input_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest - 17, // 67: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:input_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandRequest - 15, // 68: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:input_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest - 19, // 69: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest - 19, // 70: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest - 19, // 71: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest - 8, // 72: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes:output_type -> io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse - 10, // 73: io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole:output_type -> io.deephaven.proto.backplane.script.grpc.StartConsoleResponse - 12, // 74: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:output_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionData - 14, // 75: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:output_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse - 18, // 76: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:output_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandResponse - 16, // 77: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:output_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse - 20, // 78: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse - 20, // 79: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse - 21, // 80: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.BrowserNextResponse - 72, // [72:81] is the sub-list for method output_type - 63, // [63:72] is the sub-list for method input_type + 11, // 65: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetHeapInfo:input_type -> io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest + 13, // 66: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:input_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest + 15, // 67: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:input_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest + 19, // 68: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:input_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandRequest + 17, // 69: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:input_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest + 21, // 70: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 21, // 71: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 21, // 72: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:input_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest + 8, // 73: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetConsoleTypes:output_type -> io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse + 10, // 74: io.deephaven.proto.backplane.script.grpc.ConsoleService.StartConsole:output_type -> io.deephaven.proto.backplane.script.grpc.StartConsoleResponse + 12, // 75: io.deephaven.proto.backplane.script.grpc.ConsoleService.GetHeapInfo:output_type -> io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse + 14, // 76: io.deephaven.proto.backplane.script.grpc.ConsoleService.SubscribeToLogs:output_type -> io.deephaven.proto.backplane.script.grpc.LogSubscriptionData + 16, // 77: io.deephaven.proto.backplane.script.grpc.ConsoleService.ExecuteCommand:output_type -> io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse + 20, // 78: io.deephaven.proto.backplane.script.grpc.ConsoleService.CancelCommand:output_type -> io.deephaven.proto.backplane.script.grpc.CancelCommandResponse + 18, // 79: io.deephaven.proto.backplane.script.grpc.ConsoleService.BindTableToVariable:output_type -> io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse + 22, // 80: io.deephaven.proto.backplane.script.grpc.ConsoleService.AutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + 22, // 81: io.deephaven.proto.backplane.script.grpc.ConsoleService.OpenAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse + 23, // 82: io.deephaven.proto.backplane.script.grpc.ConsoleService.NextAutoCompleteStream:output_type -> io.deephaven.proto.backplane.script.grpc.BrowserNextResponse + 73, // [73:83] is the sub-list for method output_type + 63, // [63:73] is the sub-list for method input_type 63, // [63:63] is the sub-list for extension type_name 63, // [63:63] is the sub-list for extension extendee 0, // [0:63] is the sub-list for field type_name @@ -4677,7 +4809,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogSubscriptionRequest); i { + switch v := v.(*GetHeapInfoRequest); i { case 0: return &v.state case 1: @@ -4689,7 +4821,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogSubscriptionData); i { + switch v := v.(*GetHeapInfoResponse); i { case 0: return &v.state case 1: @@ -4701,7 +4833,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteCommandRequest); i { + switch v := v.(*LogSubscriptionRequest); i { case 0: return &v.state case 1: @@ -4713,7 +4845,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteCommandResponse); i { + switch v := v.(*LogSubscriptionData); i { case 0: return &v.state case 1: @@ -4725,7 +4857,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindTableToVariableRequest); i { + switch v := v.(*ExecuteCommandRequest); i { case 0: return &v.state case 1: @@ -4737,7 +4869,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindTableToVariableResponse); i { + switch v := v.(*ExecuteCommandResponse); i { case 0: return &v.state case 1: @@ -4749,7 +4881,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CancelCommandRequest); i { + switch v := v.(*BindTableToVariableRequest); i { case 0: return &v.state case 1: @@ -4761,7 +4893,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CancelCommandResponse); i { + switch v := v.(*BindTableToVariableResponse); i { case 0: return &v.state case 1: @@ -4773,7 +4905,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoCompleteRequest); i { + switch v := v.(*CancelCommandRequest); i { case 0: return &v.state case 1: @@ -4785,7 +4917,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoCompleteResponse); i { + switch v := v.(*CancelCommandResponse); i { case 0: return &v.state case 1: @@ -4797,7 +4929,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BrowserNextResponse); i { + switch v := v.(*AutoCompleteRequest); i { case 0: return &v.state case 1: @@ -4809,7 +4941,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OpenDocumentRequest); i { + switch v := v.(*AutoCompleteResponse); i { case 0: return &v.state case 1: @@ -4821,7 +4953,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TextDocumentItem); i { + switch v := v.(*BrowserNextResponse); i { case 0: return &v.state case 1: @@ -4833,7 +4965,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CloseDocumentRequest); i { + switch v := v.(*OpenDocumentRequest); i { case 0: return &v.state case 1: @@ -4845,7 +4977,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeDocumentRequest); i { + switch v := v.(*TextDocumentItem); i { case 0: return &v.state case 1: @@ -4857,7 +4989,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DocumentRange); i { + switch v := v.(*CloseDocumentRequest); i { case 0: return &v.state case 1: @@ -4869,7 +5001,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionedTextDocumentIdentifier); i { + switch v := v.(*ChangeDocumentRequest); i { case 0: return &v.state case 1: @@ -4881,7 +5013,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Position); i { + switch v := v.(*DocumentRange); i { case 0: return &v.state case 1: @@ -4893,7 +5025,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCompletionItemsRequest); i { + switch v := v.(*VersionedTextDocumentIdentifier); i { case 0: return &v.state case 1: @@ -4905,7 +5037,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompletionContext); i { + switch v := v.(*Position); i { case 0: return &v.state case 1: @@ -4917,7 +5049,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCompletionItemsResponse); i { + switch v := v.(*GetCompletionItemsRequest); i { case 0: return &v.state case 1: @@ -4929,7 +5061,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompletionItem); i { + switch v := v.(*CompletionContext); i { case 0: return &v.state case 1: @@ -4941,7 +5073,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TextEdit); i { + switch v := v.(*GetCompletionItemsResponse); i { case 0: return &v.state case 1: @@ -4953,7 +5085,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor); i { + switch v := v.(*CompletionItem); i { case 0: return &v.state case 1: @@ -4965,7 +5097,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeDocumentRequest_TextDocumentContentChangeEvent); i { + switch v := v.(*TextEdit); i { case 0: return &v.state case 1: @@ -4977,7 +5109,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_ChartDescriptor); i { + switch v := v.(*FigureDescriptor); i { case 0: return &v.state case 1: @@ -4989,7 +5121,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_SeriesDescriptor); i { + switch v := v.(*ChangeDocumentRequest_TextDocumentContentChangeEvent); i { case 0: return &v.state case 1: @@ -5001,7 +5133,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_MultiSeriesDescriptor); i { + switch v := v.(*FigureDescriptor_ChartDescriptor); i { case 0: return &v.state case 1: @@ -5013,7 +5145,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_StringMapWithDefault); i { + switch v := v.(*FigureDescriptor_SeriesDescriptor); i { case 0: return &v.state case 1: @@ -5025,7 +5157,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_DoubleMapWithDefault); i { + switch v := v.(*FigureDescriptor_MultiSeriesDescriptor); i { case 0: return &v.state case 1: @@ -5037,7 +5169,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_BoolMapWithDefault); i { + switch v := v.(*FigureDescriptor_StringMapWithDefault); i { case 0: return &v.state case 1: @@ -5049,7 +5181,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_AxisDescriptor); i { + switch v := v.(*FigureDescriptor_DoubleMapWithDefault); i { case 0: return &v.state case 1: @@ -5061,7 +5193,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor); i { + switch v := v.(*FigureDescriptor_BoolMapWithDefault); i { case 0: return &v.state case 1: @@ -5073,7 +5205,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_MultiSeriesSourceDescriptor); i { + switch v := v.(*FigureDescriptor_AxisDescriptor); i { case 0: return &v.state case 1: @@ -5085,7 +5217,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_SourceDescriptor); i { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor); i { case 0: return &v.state case 1: @@ -5097,7 +5229,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_OneClickDescriptor); i { + switch v := v.(*FigureDescriptor_MultiSeriesSourceDescriptor); i { case 0: return &v.state case 1: @@ -5109,7 +5241,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod); i { + switch v := v.(*FigureDescriptor_SourceDescriptor); i { case 0: return &v.state case 1: @@ -5121,7 +5253,7 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_Holiday); i { + switch v := v.(*FigureDescriptor_OneClickDescriptor); i { case 0: return &v.state case 1: @@ -5133,6 +5265,30 @@ func file_deephaven_proto_console_proto_init() { } } file_deephaven_proto_console_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_BusinessPeriod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_Holiday); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_console_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FigureDescriptor_BusinessCalendarDescriptor_LocalDate); i { case 0: return &v.state @@ -5145,29 +5301,29 @@ func file_deephaven_proto_console_proto_init() { } } } - file_deephaven_proto_console_proto_msgTypes[12].OneofWrappers = []interface{}{ + file_deephaven_proto_console_proto_msgTypes[14].OneofWrappers = []interface{}{ (*AutoCompleteRequest_OpenDocument)(nil), (*AutoCompleteRequest_ChangeDocument)(nil), (*AutoCompleteRequest_GetCompletionItems)(nil), (*AutoCompleteRequest_CloseDocument)(nil), } - file_deephaven_proto_console_proto_msgTypes[13].OneofWrappers = []interface{}{ + file_deephaven_proto_console_proto_msgTypes[15].OneofWrappers = []interface{}{ (*AutoCompleteResponse_CompletionItems)(nil), } - file_deephaven_proto_console_proto_msgTypes[27].OneofWrappers = []interface{}{} file_deephaven_proto_console_proto_msgTypes[29].OneofWrappers = []interface{}{} - file_deephaven_proto_console_proto_msgTypes[30].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[31].OneofWrappers = []interface{}{} file_deephaven_proto_console_proto_msgTypes[32].OneofWrappers = []interface{}{} - file_deephaven_proto_console_proto_msgTypes[33].OneofWrappers = []interface{}{} file_deephaven_proto_console_proto_msgTypes[34].OneofWrappers = []interface{}{} file_deephaven_proto_console_proto_msgTypes[35].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[36].OneofWrappers = []interface{}{} + file_deephaven_proto_console_proto_msgTypes[37].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_deephaven_proto_console_proto_rawDesc, NumEnums: 7, - NumMessages: 43, + NumMessages: 45, NumExtensions: 0, NumServices: 1, }, diff --git a/go/internal/proto/console/console_grpc.pb.go b/go/internal/proto/console/console_grpc.pb.go index a301c32a60c..d757d644fbe 100644 --- a/go/internal/proto/console/console_grpc.pb.go +++ b/go/internal/proto/console/console_grpc.pb.go @@ -24,6 +24,7 @@ const _ = grpc.SupportPackageIsVersion7 type ConsoleServiceClient interface { GetConsoleTypes(ctx context.Context, in *GetConsoleTypesRequest, opts ...grpc.CallOption) (*GetConsoleTypesResponse, error) StartConsole(ctx context.Context, in *StartConsoleRequest, opts ...grpc.CallOption) (*StartConsoleResponse, error) + GetHeapInfo(ctx context.Context, in *GetHeapInfoRequest, opts ...grpc.CallOption) (*GetHeapInfoResponse, error) SubscribeToLogs(ctx context.Context, in *LogSubscriptionRequest, opts ...grpc.CallOption) (ConsoleService_SubscribeToLogsClient, error) ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) CancelCommand(ctx context.Context, in *CancelCommandRequest, opts ...grpc.CallOption) (*CancelCommandResponse, error) @@ -69,6 +70,15 @@ func (c *consoleServiceClient) StartConsole(ctx context.Context, in *StartConsol return out, nil } +func (c *consoleServiceClient) GetHeapInfo(ctx context.Context, in *GetHeapInfoRequest, opts ...grpc.CallOption) (*GetHeapInfoResponse, error) { + out := new(GetHeapInfoResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetHeapInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *consoleServiceClient) SubscribeToLogs(ctx context.Context, in *LogSubscriptionRequest, opts ...grpc.CallOption) (ConsoleService_SubscribeToLogsClient, error) { stream, err := c.cc.NewStream(ctx, &ConsoleService_ServiceDesc.Streams[0], "/io.deephaven.proto.backplane.script.grpc.ConsoleService/SubscribeToLogs", opts...) if err != nil { @@ -206,6 +216,7 @@ func (c *consoleServiceClient) NextAutoCompleteStream(ctx context.Context, in *A type ConsoleServiceServer interface { GetConsoleTypes(context.Context, *GetConsoleTypesRequest) (*GetConsoleTypesResponse, error) StartConsole(context.Context, *StartConsoleRequest) (*StartConsoleResponse, error) + GetHeapInfo(context.Context, *GetHeapInfoRequest) (*GetHeapInfoResponse, error) SubscribeToLogs(*LogSubscriptionRequest, ConsoleService_SubscribeToLogsServer) error ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error) @@ -236,6 +247,9 @@ func (UnimplementedConsoleServiceServer) GetConsoleTypes(context.Context, *GetCo func (UnimplementedConsoleServiceServer) StartConsole(context.Context, *StartConsoleRequest) (*StartConsoleResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StartConsole not implemented") } +func (UnimplementedConsoleServiceServer) GetHeapInfo(context.Context, *GetHeapInfoRequest) (*GetHeapInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHeapInfo not implemented") +} func (UnimplementedConsoleServiceServer) SubscribeToLogs(*LogSubscriptionRequest, ConsoleService_SubscribeToLogsServer) error { return status.Errorf(codes.Unimplemented, "method SubscribeToLogs not implemented") } @@ -306,6 +320,24 @@ func _ConsoleService_StartConsole_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _ConsoleService_GetHeapInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetHeapInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConsoleServiceServer).GetHeapInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetHeapInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConsoleServiceServer).GetHeapInfo(ctx, req.(*GetHeapInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ConsoleService_SubscribeToLogs_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(LogSubscriptionRequest) if err := stream.RecvMsg(m); err != nil { @@ -461,6 +493,10 @@ var ConsoleService_ServiceDesc = grpc.ServiceDesc{ MethodName: "StartConsole", Handler: _ConsoleService_StartConsole_Handler, }, + { + MethodName: "GetHeapInfo", + Handler: _ConsoleService_GetHeapInfo_Handler, + }, { MethodName: "ExecuteCommand", Handler: _ConsoleService_ExecuteCommand_Handler, diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto index 11b1c9a1a17..626f6a9c21f 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/console.proto @@ -18,6 +18,7 @@ import "deephaven/proto/application.proto"; service ConsoleService { rpc GetConsoleTypes(GetConsoleTypesRequest) returns (GetConsoleTypesResponse) {} rpc StartConsole(StartConsoleRequest) returns (StartConsoleResponse) {} + rpc GetHeapInfo(GetHeapInfoRequest) returns (GetHeapInfoResponse) {} rpc SubscribeToLogs(LogSubscriptionRequest) returns (stream LogSubscriptionData) {} @@ -61,6 +62,25 @@ message StartConsoleResponse { io.deephaven.proto.backplane.grpc.Ticket result_id = 1; } +message GetHeapInfoRequest { + // left empty for future compatibility +} +message GetHeapInfoResponse { + // Returns the maximum amount of memory that the Java virtual machine will attempt to use. + // If there is no inherent limit then the value Long.MAX_VALUE will be returned. + // the maximum amount of memory that the virtual machine will attempt to use, measured in bytes + int64 max_memory = 1 [jstype=JS_STRING]; + + // Returns the total amount of memory in the Java virtual machine. The value returned by this method may vary over time, depending on the host environment. + // Note that the amount of memory required to hold an object of any given type may be implementation-dependent. + // the total amount of memory currently available for current and future objects, measured in bytes. + int64 total_memory = 2 [jstype=JS_STRING]; + + // Returns the amount of free memory in the Java Virtual Machine. Calling the gc method may result in increasing the value returned by freeMemory. + // an approximation to the total amount of memory currently available for future allocated objects, measured in bytes. + int64 free_memory = 3 [jstype=JS_STRING]; +} + message LogSubscriptionRequest { // presently you get _all_ logs, not just your console // Ticket console_id = 1; diff --git a/py/client/pydeephaven/proto/console_pb2.py b/py/client/pydeephaven/proto/console_pb2.py index 7dffd7e7ae4..f5f4975301a 100644 --- a/py/client/pydeephaven/proto/console_pb2.py +++ b/py/client/pydeephaven/proto/console_pb2.py @@ -16,7 +16,7 @@ from pydeephaven.proto import application_pb2 as deephaven_dot_proto_dot_application__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\xff\n\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/consoleb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x14\n\x12GetHeapInfoRequest\"`\n\x13GetHeapInfoResponse\x12\x16\n\nmax_memory\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x18\n\x0ctotal_memory\x18\x02 \x01(\x03\x42\x02\x30\x01\x12\x17\n\x0b\x66ree_memory\x18\x03 \x01(\x03\x42\x02\x30\x01\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\x8e\x0c\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x8c\x01\n\x0bGetHeapInfo\x12<.io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest\x1a=.io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/consoleb\x06proto3') @@ -24,6 +24,8 @@ _GETCONSOLETYPESRESPONSE = DESCRIPTOR.message_types_by_name['GetConsoleTypesResponse'] _STARTCONSOLEREQUEST = DESCRIPTOR.message_types_by_name['StartConsoleRequest'] _STARTCONSOLERESPONSE = DESCRIPTOR.message_types_by_name['StartConsoleResponse'] +_GETHEAPINFOREQUEST = DESCRIPTOR.message_types_by_name['GetHeapInfoRequest'] +_GETHEAPINFORESPONSE = DESCRIPTOR.message_types_by_name['GetHeapInfoResponse'] _LOGSUBSCRIPTIONREQUEST = DESCRIPTOR.message_types_by_name['LogSubscriptionRequest'] _LOGSUBSCRIPTIONDATA = DESCRIPTOR.message_types_by_name['LogSubscriptionData'] _EXECUTECOMMANDREQUEST = DESCRIPTOR.message_types_by_name['ExecuteCommandRequest'] @@ -98,6 +100,20 @@ }) _sym_db.RegisterMessage(StartConsoleResponse) +GetHeapInfoRequest = _reflection.GeneratedProtocolMessageType('GetHeapInfoRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETHEAPINFOREQUEST, + '__module__' : 'pydeephaven.proto.console_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest) + }) +_sym_db.RegisterMessage(GetHeapInfoRequest) + +GetHeapInfoResponse = _reflection.GeneratedProtocolMessageType('GetHeapInfoResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETHEAPINFORESPONSE, + '__module__' : 'pydeephaven.proto.console_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse) + }) +_sym_db.RegisterMessage(GetHeapInfoResponse) + LogSubscriptionRequest = _reflection.GeneratedProtocolMessageType('LogSubscriptionRequest', (_message.Message,), { 'DESCRIPTOR' : _LOGSUBSCRIPTIONREQUEST, '__module__' : 'pydeephaven.proto.console_pb2' @@ -391,6 +407,12 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'H\001P\001Z=github.com/deephaven/deephaven-core/go/internal/proto/console' + _GETHEAPINFORESPONSE.fields_by_name['max_memory']._options = None + _GETHEAPINFORESPONSE.fields_by_name['max_memory']._serialized_options = b'0\001' + _GETHEAPINFORESPONSE.fields_by_name['total_memory']._options = None + _GETHEAPINFORESPONSE.fields_by_name['total_memory']._serialized_options = b'0\001' + _GETHEAPINFORESPONSE.fields_by_name['free_memory']._options = None + _GETHEAPINFORESPONSE.fields_by_name['free_memory']._serialized_options = b'0\001' _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._options = None _LOGSUBSCRIPTIONREQUEST.fields_by_name['last_seen_log_timestamp']._serialized_options = b'0\001' _LOGSUBSCRIPTIONDATA.fields_by_name['micros']._options = None @@ -405,98 +427,102 @@ _STARTCONSOLEREQUEST._serialized_end=321 _STARTCONSOLERESPONSE._serialized_start=323 _STARTCONSOLERESPONSE._serialized_end=407 - _LOGSUBSCRIPTIONREQUEST._serialized_start=409 - _LOGSUBSCRIPTIONREQUEST._serialized_end=486 - _LOGSUBSCRIPTIONDATA._serialized_start=488 - _LOGSUBSCRIPTIONDATA._serialized_end=571 - _EXECUTECOMMANDREQUEST._serialized_start=573 - _EXECUTECOMMANDREQUEST._serialized_end=679 - _EXECUTECOMMANDRESPONSE._serialized_start=681 - _EXECUTECOMMANDRESPONSE._serialized_end=800 - _BINDTABLETOVARIABLEREQUEST._serialized_start=803 - _BINDTABLETOVARIABLEREQUEST._serialized_end=984 - _BINDTABLETOVARIABLERESPONSE._serialized_start=986 - _BINDTABLETOVARIABLERESPONSE._serialized_end=1015 - _CANCELCOMMANDREQUEST._serialized_start=1018 - _CANCELCOMMANDREQUEST._serialized_end=1166 - _CANCELCOMMANDRESPONSE._serialized_start=1168 - _CANCELCOMMANDRESPONSE._serialized_end=1191 - _AUTOCOMPLETEREQUEST._serialized_start=1194 - _AUTOCOMPLETEREQUEST._serialized_end=1597 - _AUTOCOMPLETERESPONSE._serialized_start=1600 - _AUTOCOMPLETERESPONSE._serialized_end=1732 - _BROWSERNEXTRESPONSE._serialized_start=1734 - _BROWSERNEXTRESPONSE._serialized_end=1755 - _OPENDOCUMENTREQUEST._serialized_start=1758 - _OPENDOCUMENTREQUEST._serialized_end=1925 - _TEXTDOCUMENTITEM._serialized_start=1927 - _TEXTDOCUMENTITEM._serialized_end=2010 - _CLOSEDOCUMENTREQUEST._serialized_start=2013 - _CLOSEDOCUMENTREQUEST._serialized_end=2196 - _CHANGEDOCUMENTREQUEST._serialized_start=2199 - _CHANGEDOCUMENTREQUEST._serialized_end=2647 - _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_start=2507 - _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_end=2647 - _DOCUMENTRANGE._serialized_start=2650 - _DOCUMENTRANGE._serialized_end=2797 - _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_start=2799 - _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_end=2862 - _POSITION._serialized_start=2864 - _POSITION._serialized_end=2907 - _GETCOMPLETIONITEMSREQUEST._serialized_start=2910 - _GETCOMPLETIONITEMSREQUEST._serialized_end=3266 - _COMPLETIONCONTEXT._serialized_start=3268 - _COMPLETIONCONTEXT._serialized_end=3336 - _GETCOMPLETIONITEMSRESPONSE._serialized_start=3339 - _GETCOMPLETIONITEMSRESPONSE._serialized_end=3477 - _COMPLETIONITEM._serialized_start=3480 - _COMPLETIONITEM._serialized_end=3883 - _TEXTEDIT._serialized_start=3885 - _TEXTEDIT._serialized_end=3981 - _FIGUREDESCRIPTOR._serialized_start=3984 - _FIGUREDESCRIPTOR._serialized_end=10197 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_start=4231 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_end=4916 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_start=4815 - _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_end=4906 - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_start=4919 - _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_end=5557 - _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_start=5560 - _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_end=6948 - _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_start=6950 - _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_end=7050 - _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_start=7052 - _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_end=7152 - _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_start=7154 - _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_end=7248 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_start=7251 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_end=8313 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_start=8087 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_end=8129 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_start=8131 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_end=8198 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_start=8200 - _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_end=8266 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_start=8316 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_end=9196 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_start=8740 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_end=8785 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_start=8788 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_end=9036 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_start=9038 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_end=9091 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_start=9093 - _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_end=9196 - _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_start=9199 - _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_end=9381 - _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_start=9384 - _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_end=9692 - _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_start=9694 - _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_end=9793 - _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_start=9796 - _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_end=9962 - _FIGUREDESCRIPTOR_SOURCETYPE._serialized_start=9965 - _FIGUREDESCRIPTOR_SOURCETYPE._serialized_end=10175 - _CONSOLESERVICE._serialized_start=10200 - _CONSOLESERVICE._serialized_end=11607 + _GETHEAPINFOREQUEST._serialized_start=409 + _GETHEAPINFOREQUEST._serialized_end=429 + _GETHEAPINFORESPONSE._serialized_start=431 + _GETHEAPINFORESPONSE._serialized_end=527 + _LOGSUBSCRIPTIONREQUEST._serialized_start=529 + _LOGSUBSCRIPTIONREQUEST._serialized_end=606 + _LOGSUBSCRIPTIONDATA._serialized_start=608 + _LOGSUBSCRIPTIONDATA._serialized_end=691 + _EXECUTECOMMANDREQUEST._serialized_start=693 + _EXECUTECOMMANDREQUEST._serialized_end=799 + _EXECUTECOMMANDRESPONSE._serialized_start=801 + _EXECUTECOMMANDRESPONSE._serialized_end=920 + _BINDTABLETOVARIABLEREQUEST._serialized_start=923 + _BINDTABLETOVARIABLEREQUEST._serialized_end=1104 + _BINDTABLETOVARIABLERESPONSE._serialized_start=1106 + _BINDTABLETOVARIABLERESPONSE._serialized_end=1135 + _CANCELCOMMANDREQUEST._serialized_start=1138 + _CANCELCOMMANDREQUEST._serialized_end=1286 + _CANCELCOMMANDRESPONSE._serialized_start=1288 + _CANCELCOMMANDRESPONSE._serialized_end=1311 + _AUTOCOMPLETEREQUEST._serialized_start=1314 + _AUTOCOMPLETEREQUEST._serialized_end=1717 + _AUTOCOMPLETERESPONSE._serialized_start=1720 + _AUTOCOMPLETERESPONSE._serialized_end=1852 + _BROWSERNEXTRESPONSE._serialized_start=1854 + _BROWSERNEXTRESPONSE._serialized_end=1875 + _OPENDOCUMENTREQUEST._serialized_start=1878 + _OPENDOCUMENTREQUEST._serialized_end=2045 + _TEXTDOCUMENTITEM._serialized_start=2047 + _TEXTDOCUMENTITEM._serialized_end=2130 + _CLOSEDOCUMENTREQUEST._serialized_start=2133 + _CLOSEDOCUMENTREQUEST._serialized_end=2316 + _CHANGEDOCUMENTREQUEST._serialized_start=2319 + _CHANGEDOCUMENTREQUEST._serialized_end=2767 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_start=2627 + _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT._serialized_end=2767 + _DOCUMENTRANGE._serialized_start=2770 + _DOCUMENTRANGE._serialized_end=2917 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_start=2919 + _VERSIONEDTEXTDOCUMENTIDENTIFIER._serialized_end=2982 + _POSITION._serialized_start=2984 + _POSITION._serialized_end=3027 + _GETCOMPLETIONITEMSREQUEST._serialized_start=3030 + _GETCOMPLETIONITEMSREQUEST._serialized_end=3386 + _COMPLETIONCONTEXT._serialized_start=3388 + _COMPLETIONCONTEXT._serialized_end=3456 + _GETCOMPLETIONITEMSRESPONSE._serialized_start=3459 + _GETCOMPLETIONITEMSRESPONSE._serialized_end=3597 + _COMPLETIONITEM._serialized_start=3600 + _COMPLETIONITEM._serialized_end=4003 + _TEXTEDIT._serialized_start=4005 + _TEXTEDIT._serialized_end=4101 + _FIGUREDESCRIPTOR._serialized_start=4104 + _FIGUREDESCRIPTOR._serialized_end=10317 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_start=4351 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR._serialized_end=5036 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_start=4935 + _FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE._serialized_end=5026 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_start=5039 + _FIGUREDESCRIPTOR_SERIESDESCRIPTOR._serialized_end=5677 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_start=5680 + _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR._serialized_end=7068 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_start=7070 + _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT._serialized_end=7170 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_start=7172 + _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT._serialized_end=7272 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_start=7274 + _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT._serialized_end=7368 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_start=7371 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR._serialized_end=8433 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_start=8207 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE._serialized_end=8249 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_start=8251 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE._serialized_end=8318 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_start=8320 + _FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION._serialized_end=8386 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_start=8436 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR._serialized_end=9316 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_start=8860 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD._serialized_end=8905 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_start=8908 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY._serialized_end=9156 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_start=9158 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE._serialized_end=9211 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_start=9213 + _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK._serialized_end=9316 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_start=9319 + _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR._serialized_end=9501 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_start=9504 + _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR._serialized_end=9812 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_start=9814 + _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR._serialized_end=9913 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_start=9916 + _FIGUREDESCRIPTOR_SERIESPLOTSTYLE._serialized_end=10082 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_start=10085 + _FIGUREDESCRIPTOR_SOURCETYPE._serialized_end=10295 + _CONSOLESERVICE._serialized_start=10320 + _CONSOLESERVICE._serialized_end=11870 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/console_pb2_grpc.py b/py/client/pydeephaven/proto/console_pb2_grpc.py index 6b87dbc4aad..6b6c77084ce 100644 --- a/py/client/pydeephaven/proto/console_pb2_grpc.py +++ b/py/client/pydeephaven/proto/console_pb2_grpc.py @@ -26,6 +26,11 @@ def __init__(self, channel): request_serializer=deephaven_dot_proto_dot_console__pb2.StartConsoleRequest.SerializeToString, response_deserializer=deephaven_dot_proto_dot_console__pb2.StartConsoleResponse.FromString, ) + self.GetHeapInfo = channel.unary_unary( + '/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetHeapInfo', + request_serializer=deephaven_dot_proto_dot_console__pb2.GetHeapInfoRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_console__pb2.GetHeapInfoResponse.FromString, + ) self.SubscribeToLogs = channel.unary_stream( '/io.deephaven.proto.backplane.script.grpc.ConsoleService/SubscribeToLogs', request_serializer=deephaven_dot_proto_dot_console__pb2.LogSubscriptionRequest.SerializeToString, @@ -80,6 +85,12 @@ def StartConsole(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetHeapInfo(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def SubscribeToLogs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -145,6 +156,11 @@ def add_ConsoleServiceServicer_to_server(servicer, server): request_deserializer=deephaven_dot_proto_dot_console__pb2.StartConsoleRequest.FromString, response_serializer=deephaven_dot_proto_dot_console__pb2.StartConsoleResponse.SerializeToString, ), + 'GetHeapInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetHeapInfo, + request_deserializer=deephaven_dot_proto_dot_console__pb2.GetHeapInfoRequest.FromString, + response_serializer=deephaven_dot_proto_dot_console__pb2.GetHeapInfoResponse.SerializeToString, + ), 'SubscribeToLogs': grpc.unary_stream_rpc_method_handler( servicer.SubscribeToLogs, request_deserializer=deephaven_dot_proto_dot_console__pb2.LogSubscriptionRequest.FromString, @@ -226,6 +242,23 @@ def StartConsole(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def GetHeapInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.script.grpc.ConsoleService/GetHeapInfo', + deephaven_dot_proto_dot_console__pb2.GetHeapInfoRequest.SerializeToString, + deephaven_dot_proto_dot_console__pb2.GetHeapInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def SubscribeToLogs(request, target, diff --git a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java index 533339a18ae..0fb213470d6 100644 --- a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java @@ -6,6 +6,7 @@ import com.google.rpc.Code; import io.deephaven.configuration.Configuration; import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.util.RuntimeMemory; import io.deephaven.engine.updategraph.DynamicNode; import io.deephaven.engine.util.DelegatingScriptSession; import io.deephaven.engine.util.ScriptSession; @@ -26,28 +27,7 @@ import io.deephaven.proto.backplane.grpc.FieldsChangeUpdate; import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.proto.backplane.grpc.TypedTicket; -import io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest; -import io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse; -import io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest; -import io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse; -import io.deephaven.proto.backplane.script.grpc.CancelCommandRequest; -import io.deephaven.proto.backplane.script.grpc.CancelCommandResponse; -import io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest; -import io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest; -import io.deephaven.proto.backplane.script.grpc.CompletionItem; -import io.deephaven.proto.backplane.script.grpc.ConsoleServiceGrpc; -import io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest; -import io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse; -import io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest; -import io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse; -import io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest; -import io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse; -import io.deephaven.proto.backplane.script.grpc.LogSubscriptionData; -import io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest; -import io.deephaven.proto.backplane.script.grpc.StartConsoleRequest; -import io.deephaven.proto.backplane.script.grpc.StartConsoleResponse; -import io.deephaven.proto.backplane.script.grpc.TextDocumentItem; -import io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier; +import io.deephaven.proto.backplane.script.grpc.*; import io.deephaven.server.session.SessionCloseableObserver; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; @@ -200,6 +180,21 @@ public void executeCommand(ExecuteCommandRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + final RuntimeMemory runtimeMemory = RuntimeMemory.getInstance(); + final GetHeapInfoResponse infoResponse = GetHeapInfoResponse.newBuilder() + .setTotalMemory(runtimeMemory.totalMemory()) + .setFreeMemory(runtimeMemory.freeMemory()) + .setMaxMemory(runtimeMemory.maxMemory()) + .build(); + + responseObserver.onNext(infoResponse); + responseObserver.onCompleted(); + }); + } + private static FieldInfo makeVariableDefinition(Map.Entry entry) { return makeVariableDefinition(entry.getKey(), entry.getValue()); } diff --git a/web/WebDevelopersGuide.md b/web/WebDevelopersGuide.md index 439181fe371..6625ecc648b 100644 --- a/web/WebDevelopersGuide.md +++ b/web/WebDevelopersGuide.md @@ -1022,6 +1022,8 @@ This enum describes the name of each supported operation/aggregation type when c ###### Methods * `addEventListener(String eventType, Function eventListener)` + * `getConsoleTypes():String[]` - Retrieve the available console types for this worker. + * `getHeapInfo():HeapInfo` - Retrieve the current heap info for this worker. * `removeEventListener(String eventType, Function eventListener)` * `onLogMessage(Function logHandler):Function` * `startSession(String scriptLanguage):Promise` @@ -1188,6 +1190,11 @@ as needed. * `VariableDefinition created` * `VariableDefinition updated` * `VariableDefinition removed` + +##### Class `HeapInfo` + * `Number maximumHeapSize` - Maximum heap size of this worker. + * `Number freeMemory` - Free memory of this worker. + * `Number totalHeapSize` - Total heap size available for this worker. --> #### The `dh.plot` namespace: diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkerHeapInfo.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkerHeapInfo.java new file mode 100644 index 00000000000..df0fb41d5db --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkerHeapInfo.java @@ -0,0 +1,31 @@ +package io.deephaven.web.client.api; + +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetHeapInfoResponse; +import jsinterop.annotations.JsProperty; + +public class JsWorkerHeapInfo { + private long maximumHeapSize; + private long freeMemory; + private long totalHeapSize; + + public JsWorkerHeapInfo(GetHeapInfoResponse heapInfo) { + this.maximumHeapSize = Long.parseLong(heapInfo.getMaxMemory()); + this.freeMemory = Long.parseLong(heapInfo.getFreeMemory()); + this.totalHeapSize = Long.parseLong(heapInfo.getTotalMemory()); + } + + @JsProperty + public double getMaximumHeapSize() { + return maximumHeapSize; + } + + @JsProperty + public double getFreeMemory() { + return freeMemory; + } + + @JsProperty + public double getTotalHeapSize() { + return totalHeapSize; + } +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java index b45edc3e361..e375b59293c 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java @@ -9,10 +9,8 @@ import elemental2.dom.DomGlobal; import elemental2.promise.Promise; import io.deephaven.ide.shared.IdeSession; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.*; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.Ticket; -import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesRequest; -import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesResponse; -import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.StartConsoleRequest; import io.deephaven.web.client.api.barrage.stream.ResponseStreamWrapper; import io.deephaven.web.client.fu.CancellablePromise; import io.deephaven.web.client.fu.JsLog; @@ -206,6 +204,16 @@ public Promise> getConsoleTypes() { return promise.then(result -> Promise.resolve(result.getConsoleTypesList())); } + @JsMethod + public Promise getWorkerHeapInfo() { + Promise promise = Callbacks.grpcUnaryPromise(callback -> { + GetHeapInfoRequest request = new GetHeapInfoRequest(); + connection.get().consoleServiceClient().getHeapInfo(request, connection.get().metadata(), + callback::apply); + }); + + return promise.then(result -> Promise.resolve(new JsWorkerHeapInfo(result))); + } public void connected() { if (closed) { diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoRequest.java new file mode 100644 index 00000000000..5bfc01da00c --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoRequest.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2022-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.console_pb.GetHeapInfoRequest", + namespace = JsPackage.GLOBAL) +public class GetHeapInfoRequest { + public static native GetHeapInfoRequest deserializeBinary(Uint8Array bytes); + + public static native GetHeapInfoRequest deserializeBinaryFromReader( + GetHeapInfoRequest message, Object reader); + + public static native void serializeBinaryToWriter(GetHeapInfoRequest message, Object writer); + + public static native Object toObject(boolean includeInstance, GetHeapInfoRequest msg); + + public native Uint8Array serializeBinary(); + + public native Object toObject(); + + public native Object toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoResponse.java new file mode 100644 index 00000000000..9bdc61dd1cb --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb/GetHeapInfoResponse.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2022-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.console_pb.GetHeapInfoResponse", + namespace = JsPackage.GLOBAL) +public class GetHeapInfoResponse { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static GetHeapInfoResponse.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getFreeMemory(); + + @JsProperty + String getMaxMemory(); + + @JsProperty + String getTotalMemory(); + + @JsProperty + void setFreeMemory(String freeMemory); + + @JsProperty + void setMaxMemory(String maxMemory); + + @JsProperty + void setTotalMemory(String totalMemory); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static GetHeapInfoResponse.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getFreeMemory(); + + @JsProperty + String getMaxMemory(); + + @JsProperty + String getTotalMemory(); + + @JsProperty + void setFreeMemory(String freeMemory); + + @JsProperty + void setMaxMemory(String maxMemory); + + @JsProperty + void setTotalMemory(String totalMemory); + } + + public static native GetHeapInfoResponse deserializeBinary(Uint8Array bytes); + + public static native GetHeapInfoResponse deserializeBinaryFromReader( + GetHeapInfoResponse message, Object reader); + + public static native void serializeBinaryToWriter(GetHeapInfoResponse message, Object writer); + + public static native GetHeapInfoResponse.ToObjectReturnType toObject( + boolean includeInstance, GetHeapInfoResponse msg); + + public native String getFreeMemory(); + + public native String getMaxMemory(); + + public native String getTotalMemory(); + + public native Uint8Array serializeBinary(); + + public native void setFreeMemory(String value); + + public native void setMaxMemory(String value); + + public native void setTotalMemory(String value); + + public native GetHeapInfoResponse.ToObjectReturnType0 toObject(); + + public native GetHeapInfoResponse.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleService.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleService.java index eb98e653778..19fba352238 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleService.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleService.java @@ -235,6 +235,50 @@ static ConsoleService.GetConsoleTypesType create() { void setService(Object service); } + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetHeapInfoType { + @JsOverlay + static ConsoleService.GetHeapInfoType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) public interface NextAutoCompleteStreamType { @JsOverlay @@ -416,6 +460,7 @@ static ConsoleService.SubscribeToLogsType create() { public static ConsoleService.CancelCommandType CancelCommand; public static ConsoleService.ExecuteCommandType ExecuteCommand; public static ConsoleService.GetConsoleTypesType GetConsoleTypes; + public static ConsoleService.GetHeapInfoType GetHeapInfo; public static ConsoleService.NextAutoCompleteStreamType NextAutoCompleteStream; public static ConsoleService.OpenAutoCompleteStreamType OpenAutoCompleteStream; public static ConsoleService.StartConsoleType StartConsole; diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleServiceClient.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleServiceClient.java index 292d342ac85..d6ce3a304bd 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleServiceClient.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/console_pb_service/ConsoleServiceClient.java @@ -15,6 +15,8 @@ import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.ExecuteCommandResponse; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesRequest; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetHeapInfoRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetHeapInfoResponse; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.LogSubscriptionData; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.LogSubscriptionRequest; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.StartConsoleRequest; @@ -404,6 +406,97 @@ default boolean isGetConsoleTypesMetadata_or_callbackFn() { } } + @JsFunction + public interface GetHeapInfoCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static ConsoleServiceClient.GetHeapInfoCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(ConsoleServiceClient.GetHeapInfoCallbackFn.P0Type p0, GetHeapInfoResponse p1); + } + + @JsFunction + public interface GetHeapInfoMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn.P0Type p0, GetHeapInfoResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetHeapInfoMetadata_or_callbackUnionType { + @JsOverlay + static ConsoleServiceClient.GetHeapInfoMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn asGetHeapInfoMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isGetHeapInfoMetadata_or_callbackFn() { + return (Object) this instanceof ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn; + } + } + @JsFunction public interface NextAutoCompleteStreamCallbackFn { @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) @@ -807,6 +900,58 @@ public native UnaryResponse getConsoleTypes( GetConsoleTypesRequest requestMessage, ConsoleServiceClient.GetConsoleTypesMetadata_or_callbackUnionType metadata_or_callback); + @JsOverlay + public final UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, + BrowserHeaders metadata_or_callback, + ConsoleServiceClient.GetHeapInfoCallbackFn callback) { + return getHeapInfo( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, BrowserHeaders metadata_or_callback) { + return getHeapInfo( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, + ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn metadata_or_callback, + ConsoleServiceClient.GetHeapInfoCallbackFn callback) { + return getHeapInfo( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, + ConsoleServiceClient.GetHeapInfoMetadata_or_callbackFn metadata_or_callback) { + return getHeapInfo( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, + ConsoleServiceClient.GetHeapInfoMetadata_or_callbackUnionType metadata_or_callback, + ConsoleServiceClient.GetHeapInfoCallbackFn callback); + + public native UnaryResponse getHeapInfo( + GetHeapInfoRequest requestMessage, + ConsoleServiceClient.GetHeapInfoMetadata_or_callbackUnionType metadata_or_callback); + @JsOverlay public final UnaryResponse nextAutoCompleteStream( AutoCompleteRequest requestMessage, From 5d8b081211e49ea0da0cdaab1e9f5734fee61187 Mon Sep 17 00:00:00 2001 From: Matthew Runyon Date: Fri, 29 Jul 2022 17:35:41 -0500 Subject: [PATCH 054/215] Add LayoutHint column grouping API (#2348) * Refactor LayoutHintBuilder.atEnd to atBack * Java API for column groups * Add column grouping to JS API * Add remaining group methods for java API * Add Python API for column groups * Add JS API for column groups * Add python test Co-authored-by: mikebender Co-authored-by: Colin Alworth --- .../engine/util/LayoutHintBuilder.java | 168 ++++++++++++++++-- py/server/deephaven/table.py | 22 ++- py/server/tests/test_table.py | 17 +- .../web/client/api/JsLayoutHints.java | 51 ++++++ 4 files changed, 242 insertions(+), 16 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/util/LayoutHintBuilder.java b/engine/table/src/main/java/io/deephaven/engine/util/LayoutHintBuilder.java index 68eb0202736..cb0ec9c6cc3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/LayoutHintBuilder.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/LayoutHintBuilder.java @@ -6,6 +6,7 @@ import io.deephaven.base.StringUtils; import io.deephaven.engine.table.Table; import io.deephaven.api.util.NameValidator; +import io.deephaven.gui.color.Color; import io.deephaven.util.annotations.ScriptApi; import org.jetbrains.annotations.NotNull; @@ -30,6 +31,8 @@ public class LayoutHintBuilder { private Set alwaysSubscribedCols; private Set groupableColumns; + private Map columnGroups; + /** * Helper class to maintain sub-properties for auto filter columns */ @@ -52,7 +55,7 @@ private static class AutoFilterData { * @return a string of the format column(:param&value)+ */ @NotNull - String forBuilder() { + String serialize() { if (fetchSize > 0) { return column + ":" + AFD_FETCH_PARAM + "&" + fetchSize; } @@ -61,7 +64,7 @@ String forBuilder() { } /** - * Convert a string of the format defined by {@link #forBuilder()} into a proper AutoFilterData object + * Convert a string of the format defined by {@link #serialize()} into a proper AutoFilterData object * * @param string the string to parse * @return an AutoFilterData instance @@ -108,9 +111,69 @@ static AutoFilterData fromString(String string) { } } + private static class ColumnGroup { + + private final String name; + private final List children; + private final Color color; + + public ColumnGroup(String name, List children, Color color) { + NameValidator.validateColumnName(name); + children.forEach(c -> NameValidator.validateColumnName(c)); + + this.name = name; + this.children = children; + this.color = color; + } + + @NotNull + public String serialize() { + StringBuilder sb = new StringBuilder("name:").append(name); + + sb.append("::children:"); + boolean first = true; + for (String child : children) { + if (!first) { + sb.append(","); + } + first = false; + sb.append(child); + } + if (color != null) { + sb.append("::color:#") + .append(Integer.toHexString(color.javaColor().getRGB()).substring(2)); + } + return sb.toString(); + } + + /** + * Convert a string of the format defined by {@link #serialize()} into a proper ColumnGroup object + * + * @param string the string to parse + * @return a ColumnGroup instance + */ + @NotNull + public static ColumnGroup fromString(String string) { + final Map options = Arrays.stream(string.split("::")) + .map(option -> option.split(":")) + .collect(Collectors.toMap(parts -> parts[0], parts -> parts.length == 2 ? parts[1] : null)); + + final String name = options.get("name"); + final List children = Arrays.asList(options.get("children").split(",")); + final String color = options.get("color"); + + if (color == null) { + return new ColumnGroup(name, children, null); + } + + return new ColumnGroup(name, children, new Color(color)); + } + } + private LayoutHintBuilder() {} // region Builder Methods + /** * Create a LayoutHintBuilder from the specified parameter string. * @@ -136,7 +199,7 @@ public static LayoutHintBuilder fromString(String attrs) { final String endStr = options.get("back"); if (endStr != null && !endStr.isEmpty()) { - lhb.atEnd(endStr.split(",")); + lhb.atBack(endStr.split(",")); } final String hideStr = options.get("hide"); @@ -169,6 +232,14 @@ public static LayoutHintBuilder fromString(String attrs) { lhb.groupableColumns(groupableColumns); } + final String columnGroupsStr = options.get("columnGroups"); + if (columnGroupsStr != null && !columnGroupsStr.isEmpty()) { + Arrays.stream(columnGroupsStr.split("\\|")) + .filter(s -> s != null && !s.isEmpty()) + .map(ColumnGroup::fromString) + .forEach(lhb::addColumnGroupData); + } + return lhb; } @@ -218,11 +289,11 @@ public LayoutHintBuilder atFront(Collection cols) { } /** - * @see LayoutHintBuilder#atEnd(Collection) + * @see LayoutHintBuilder#atBack(Collection) */ @ScriptApi - public LayoutHintBuilder atEnd(String... cols) { - return atEnd(cols == null ? null : Arrays.asList(cols)); + public LayoutHintBuilder atBack(String... cols) { + return atBack(cols == null ? null : Arrays.asList(cols)); } /** @@ -232,7 +303,7 @@ public LayoutHintBuilder atEnd(String... cols) { * @return this LayoutHintBuilder */ @ScriptApi - public LayoutHintBuilder atEnd(Collection cols) { + public LayoutHintBuilder atBack(Collection cols) { if (cols == null || cols.isEmpty()) { backCols = null; return this; @@ -281,6 +352,56 @@ public LayoutHintBuilder hide(Collection cols) { return this; } + /** + * @see LayoutHintBuilder#columnGroup(String, List, Color) + */ + @ScriptApi + public LayoutHintBuilder columnGroup(String name, List children) { + return columnGroup(name, children, (Color) null); + } + + /** + * @see LayoutHintBuilder#columnGroup(String, List, Color) + */ + @ScriptApi + public LayoutHintBuilder columnGroup(String name, List children, String color) { + if (color == null || color.length() == 0) { + return columnGroup(name, children, (Color) null); + } + return columnGroup(name, children, new Color(color)); + } + + /** + * Create a named group of columns in the UI + * + * @param name the column group name. Must be a valid Deephaven column name + * @param children the columns and other groups belonging to this group + * @param color the background color for the group in the UI + * @return this LayoutHintBuilder + */ + @ScriptApi + public LayoutHintBuilder columnGroup(String name, List children, Color color) { + if (columnGroups == null) { + columnGroups = new LinkedHashMap<>(); + } + + if (children.isEmpty()) { + columnGroups.remove(name); + } else { + columnGroups.put(name, new ColumnGroup(name, children, color)); + } + + return this; + } + + private void addColumnGroupData(ColumnGroup group) { + if (columnGroups == null) { + columnGroups = new LinkedHashMap<>(); + } + + columnGroups.put(group.name, group); + } + /** * @see LayoutHintBuilder#autoFilter(Collection) */ @@ -464,7 +585,7 @@ public String build() { if (autoFilterCols != null && !autoFilterCols.isEmpty()) { sb.append("autofilter=").append( - StringUtils.joinStrings(autoFilterCols.values().stream().map(AutoFilterData::forBuilder), ",")) + StringUtils.joinStrings(autoFilterCols.values().stream().map(AutoFilterData::serialize), ",")) .append(';'); } @@ -480,12 +601,19 @@ public String build() { sb.append("groupable=").append(String.join(",", groupableColumns)).append(';'); } + if (columnGroups != null && !columnGroups.isEmpty()) { + sb.append("columnGroups="); + String groupStrings = + columnGroups.values().stream().map(ColumnGroup::serialize).collect(Collectors.joining("|")); + sb.append(groupStrings).append(';'); + } + return sb.toString(); } /** * Helper method for building and {@link Table#setLayoutHints(String) applying} layout hints to a {@link Table}. - * + * * @param table The source {@link Table} * @return {@code table.setLayoutHints(build())} */ @@ -495,6 +623,7 @@ public Table applyToTable(@NotNull final Table table) { } // region Getters + /** * Check if saved layouts should be allowed. * @@ -516,7 +645,7 @@ public boolean areSavedLayoutsAllowed() { /** * Get the ordered set of columns that should be displayed as the last N columns. * - * @return an ordfered set of columns to display at the end. + * @return an ordered set of columns to display at the end. */ public @NotNull Set getBackCols() { return backCols == null ? Collections.emptySet() : Collections.unmodifiableSet(backCols); @@ -582,5 +711,24 @@ public int getAutoFilterFetchSize(String column) { public @NotNull Set getGroupableColumns() { return groupableColumns == null ? Collections.emptySet() : Collections.unmodifiableSet(groupableColumns); } + + /** + * Get the map of column groups for the UI. + * + * @return the map of column groups + */ + public @NotNull Map getColumnGroups() { + return columnGroups == null ? Collections.emptyMap() : Collections.unmodifiableMap(columnGroups); + } + + /** + * Get the column group for the specified name. + * + * @param name the name of the column group + * @return the column group if it exists + */ + public @NotNull ColumnGroup getColumnGroup(String name) { + return columnGroups == null ? null : columnGroups.get(name); + } // endregion } diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index bd2e9ae0f46..e7f4285bdd2 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -1335,15 +1335,22 @@ def format_row_where(self, cond: str, formula: str) -> Table: raise DHError(e, "failed to color format rows conditionally.") from e def layout_hints(self, front: Union[str, List[str]] = None, back: Union[str, List[str]] = None, - freeze: Union[str, List[str]] = None, hide: Union[str, List[str]] = None) -> Table: + freeze: Union[str, List[str]] = None, hide: Union[str, List[str]] = None, + column_groups: List[dict] = None) -> Table: """ Sets layout hints on the Table Args: - front (Union[str, List[str]]): the columns to show at the front - back (Union[str, List[str]]): the columns to show at the back + front (Union[str, List[str]]): the columns to show at the front. + back (Union[str, List[str]]): the columns to show at the back. freeze (Union[str, List[str]]): the columns to freeze to the front. These will not be affected by horizontal scrolling. - hide (Union[str, List[str]]): the columns to hide + hide (Union[str, List[str]]): the columns to hide. + column_groups (List[Dict]): A list of dicts specifying which columns should be grouped in the UI + The dicts can specify the following: + + name (str): The group name + children (List[str]): The + color (Optional[str]): The hex color string or Deephaven color name Returns: a new table with the layout hints set @@ -1358,13 +1365,18 @@ def layout_hints(self, front: Union[str, List[str]] = None, back: Union[str, Lis _j_layout_hint_builder.atFront(to_sequence(front)) if back is not None: - _j_layout_hint_builder.atEnd(to_sequence(back)) + _j_layout_hint_builder.atBack(to_sequence(back)) if freeze is not None: _j_layout_hint_builder.freeze(to_sequence(freeze)) if hide is not None: _j_layout_hint_builder.hide(to_sequence(hide)) + + if column_groups is not None: + for group in column_groups: + _j_layout_hint_builder.columnGroup(group.get("name"), j_array_list(group.get("children")), + group.get("color", "")) except Exception as e: raise DHError(e, "failed to create layout hints") from e diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 6248b402274..12a67e65294 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -525,7 +525,22 @@ def test_format_row_where(self): self.assertIsNotNone(t) def test_layout_hints(self): - t = self.test_table.layout_hints(front="d", back="b", freeze="c", hide="d") + t = self.test_table.layout_hints(front="d", back="b", freeze="c", hide="d", column_groups=[ + { + "name": "Group1", + "children": ["a", "b"] + }, + { + "name": "Group2", + "children": ["c", "d"], + "color": "#123456" + }, + { + "name": "Group3", + "children": ["e", "f"], + "color": "RED" + } + ]) self.assertIsNotNone(t) t = self.test_table.layout_hints(front=["d", "e"], back=["a", "b"], freeze=["c"], hide=["d"]) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsLayoutHints.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsLayoutHints.java index 1ce3cf8568c..983aabdba35 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsLayoutHints.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsLayoutHints.java @@ -5,11 +5,46 @@ import elemental2.core.JsObject; import jsinterop.annotations.JsProperty; + import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class JsLayoutHints { + private class ColumnGroup { + @JsProperty + public String name; + @JsProperty + public String[] children; + @JsProperty + public String color; + + public ColumnGroup(String groupStr) { + if (groupStr == null || groupStr.isEmpty()) { + return; + } + + final Map options = Arrays.stream(groupStr.split("::")) + .map(option -> option.split(":")) + .collect(Collectors.toMap(parts -> parts[0], parts -> parts.length == 2 ? parts[1] : "")); + + final String nameStr = options.get("name"); + if (nameStr != null && !nameStr.isEmpty()) { + name = nameStr; + } + + final String childrenStr = options.get("children"); + if (childrenStr != null && !childrenStr.isEmpty()) { + children = JsObject.freeze(childrenStr.split(",")); + } + + final String colorStr = options.get("color"); + if (colorStr != null && !colorStr.isEmpty()) { + color = colorStr; + } + } + } private boolean savedLayoutsAllowed = true; private String[] frontColumns; @@ -17,6 +52,8 @@ public class JsLayoutHints { private String[] hiddenColumns; private String[] frozenColumns; + private ColumnGroup[] columnGroups; + public JsLayoutHints parse(String hints) { if (hints == null || hints.isEmpty()) { return this; @@ -51,6 +88,15 @@ public JsLayoutHints parse(String hints) { frozenColumns = JsObject.freeze(freezeStr.split(",")); } + final String groupsStr = options.get("columnGroups"); + if (groupsStr != null && !groupsStr.isEmpty()) { + ColumnGroup[] groups = + Arrays.stream(groupsStr.split("\\|")).map(ColumnGroup::new).map(JsObject::freeze) + .toArray(ColumnGroup[]::new); + + columnGroups = JsObject.freeze(groups); + } + return this; } @@ -78,4 +124,9 @@ public String[] getHiddenColumns() { public String[] getFrozenColumns() { return frozenColumns; } + + @JsProperty + public ColumnGroup[] getColumnGroups() { + return columnGroups; + } } From 4f60dad5acfa965837f1bcda015315a5a1d6ee41 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 1 Aug 2022 07:14:35 -0700 Subject: [PATCH 055/215] Bump protoc and python base images (#2707) --- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 702c190d0a2..7943dcf7763 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:5415765f441539c5b965f4cff2af26dda6d9613d06864bce05810845e2e64840 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:aba4a855dfd723f6e68fd57b7d7b7289f5edeaafb30e71943e8e4d51517aa8b1 diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index f785c789d24..42900dab302 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:7f9798664c8b1cdaccc19f1b90105a27db736c861c8184198dc7a8c01f82ccec +deephaven.registry.imageId=python@sha256:c9d3b36fb3d635c4691f1f2f97dc140ecdaf0506b1e40d57cc8abd2e487570d3 From f4df3386eaa7084f60af6b376315cc932d4d526c Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 1 Aug 2022 09:40:41 -0700 Subject: [PATCH 056/215] Upgrade gradle (#2672) --- Base/build.gradle | 16 +++-- BenchmarkSupport/BenchmarkSupport.gradle | 21 +++--- ClientSupport/ClientSupport.gradle | 21 +++--- CompilerTools/CompilerTools.gradle | 12 ++-- Configuration/build.gradle | 11 +++- Container/build.gradle | 2 +- DHProcess/build.gradle | 2 +- DataStructures/build.gradle | 3 +- FishUtil/build.gradle | 12 +++- Generators/Generators.gradle | 24 +++---- IO/build.gradle | 11 +++- Integrations/build.gradle | 65 +++++-------------- ModelFarm/ModelFarm.gradle | 21 +++--- Net/build.gradle | 10 ++- Numerics/Numerics.gradle | 12 ++-- Plot/Plot.gradle | 21 +++--- Stats/build.gradle | 12 +++- TableLogger/TableLogger.gradle | 9 +-- Util/Util.gradle | 9 +-- buildSrc/build.gradle | 10 +-- buildSrc/src/main/groovy/Classpaths.groovy | 48 +++++++------- ...eephaven.java-classpath-conventions.gradle | 3 +- .../io.deephaven.java-test-conventions.gradle | 1 + .../tools/docker/Architecture.groovy | 6 ++ codegen/build.gradle | 4 +- engine/api/build.gradle | 17 +++-- engine/benchmark/build.gradle | 6 +- engine/chunk/build.gradle | 3 +- engine/function/build.gradle | 11 ++-- engine/rowset/build.gradle | 11 +++- engine/stringset/build.gradle | 1 + engine/table/build.gradle | 62 ++++++++++-------- engine/time/build.gradle | 12 ++-- engine/tuple/build.gradle | 9 +-- engine/updategraph/build.gradle | 8 ++- engine/vector/build.gradle | 9 ++- extensions/barrage/build.gradle | 7 +- extensions/csv/build.gradle | 7 +- extensions/kafka/build.gradle | 7 +- extensions/parquet/base/build.gradle | 6 +- extensions/parquet/table/build.gradle | 19 ++++-- extensions/suanshu/build.gradle | 2 +- gradle/web-client.gradle | 6 +- gradle/web-gwt-test.gradle | 3 +- gradle/wrapper/gradle-wrapper.properties | 4 +- java-client/barrage/build.gradle | 5 +- java-client/session/build.gradle | 2 +- log-factory/build.gradle | 2 +- open-api/lang-parser/lang-parser.gradle | 8 +-- open-api/lang-tools/lang-tools.gradle | 27 ++++---- proto/proto-backplane-grpc/build.gradle | 2 +- py/jpy-ext/build.gradle | 8 ++- py/jpy-integration/build.gradle | 24 ++++--- python-engine-test/build.gradle | 26 ++++---- replication/reflective/build.gradle | 14 ++-- replication/static/build.gradle | 8 ++- server/build.gradle | 10 ++- server/test/build.gradle | 3 +- web/client-api/client-api.gradle | 13 ++-- web/client-backplane/client-backplane.gradle | 8 +-- web/client-ide/client-ide.gradle | 4 +- web/shared-beans/shared-beans.gradle | 15 +++-- 62 files changed, 430 insertions(+), 325 deletions(-) diff --git a/Base/build.gradle b/Base/build.gradle index 939b658c61c..daad29b1518 100644 --- a/Base/build.gradle +++ b/Base/build.gradle @@ -1,16 +1,18 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } dependencies { - compile depTrove3, depAnnotations, depCommonsCompress + implementation depTrove3 + compileOnlyApi depAnnotations + implementation depCommonsLang3 - compile depCommonsLang3 + api 'io.deephaven:hash:0.1.0' - compile 'io.deephaven:hash:0.1.0' - - Classpaths.inheritJUnitClassic(project, true, 'testCompile') + Classpaths.inheritJUnitClassic(project, 'testImplementation') + Classpaths.inheritJMock(project, 'testImplementation') } sourceSets { @@ -33,9 +35,9 @@ task jarTests(type: Jar, dependsOn: testClasses) { } configurations { tests { - extendsFrom testRuntime + } } artifacts { tests jarTests -} \ No newline at end of file +} diff --git a/BenchmarkSupport/BenchmarkSupport.gradle b/BenchmarkSupport/BenchmarkSupport.gradle index 1859dcceaaa..90ec8662c29 100644 --- a/BenchmarkSupport/BenchmarkSupport.gradle +++ b/BenchmarkSupport/BenchmarkSupport.gradle @@ -3,11 +3,11 @@ plugins { } configurations { - compile.extendsFrom dhBenchmarkSupport + implementation.extendsFrom dhBenchmarkSupport - testCompile.extendsFrom fishIoTest + testImplementation.extendsFrom fishIoTest - testRuntime.extendsFrom fishDataGenerator + testRuntimeOnly.extendsFrom fishDataGenerator } sourceSets { @@ -27,14 +27,17 @@ sourceSets { } dependencies { - compile project(':engine-table'), - project(':extensions-parquet-table'), - 'org.openjdk.jmh:jmh-core:1.20' + implementation project(':engine-table') + implementation project(':extensions-parquet-table') + implementation project(':Configuration') + implementation 'org.openjdk.jmh:jmh-core:1.20' - testCompile TestTools.projectDependency(project, 'Util'), - TestTools.projectDependency(project, 'engine-table') + testImplementation TestTools.projectDependency(project, 'Util') + testImplementation TestTools.projectDependency(project, 'engine-table') - testRuntime project(path: ':configs'), project(path: ':test-configs'), project(':Numerics') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') + testRuntimeOnly project(':Numerics') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/ClientSupport/ClientSupport.gradle b/ClientSupport/ClientSupport.gradle index 7f92f5b2e0d..a04b76ff33a 100644 --- a/ClientSupport/ClientSupport.gradle +++ b/ClientSupport/ClientSupport.gradle @@ -3,20 +3,23 @@ plugins { } configurations { - compile.extendsFrom dhConsole + implementation.extendsFrom dhConsole } dependencies { - compile project(':engine-table'), - project(':engine-function') + implementation project(':engine-table') + implementation project(':engine-function') + implementation project(':log-factory') + implementation project(':Configuration') + implementation depCommonsLang3 - testCompile TestTools.projectDependency(project, 'Base'), - TestTools.projectDependency(project, 'engine-table'), - project(':extensions-csv') + testImplementation TestTools.projectDependency(project, 'Base') + testImplementation TestTools.projectDependency(project, 'engine-table') + testImplementation project(':extensions-csv') - testRuntimeOnly project(':log-to-slf4j'), - project(path: ':configs'), - project(path: ':test-configs') + testRuntimeOnly project(':log-to-slf4j') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') } diff --git a/CompilerTools/CompilerTools.gradle b/CompilerTools/CompilerTools.gradle index 468e44d2005..3a89df3dc00 100644 --- a/CompilerTools/CompilerTools.gradle +++ b/CompilerTools/CompilerTools.gradle @@ -3,13 +3,17 @@ plugins { } configurations { - compile.extendsFrom fishConfig, commonsLang3 - testCompile.extendsFrom fishIoTest + implementation.extendsFrom fishConfig, commonsLang3 + testImplementation.extendsFrom fishIoTest } dependencies { - compile project(':Util') - testRuntime project(path: ':configs'), project(path: ':test-configs') + implementation project(':Util') + implementation project(':log-factory') + Classpaths.inheritCommonsText(project, 'implementation') + + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/Configuration/build.gradle b/Configuration/build.gradle index c01be382aad..19ce7c547f2 100644 --- a/Configuration/build.gradle +++ b/Configuration/build.gradle @@ -3,12 +3,17 @@ plugins { } dependencies { - compile project(':Base'), project(':DataStructures'), project(':IO'), project(':log-factory'), depCommonsLang3 - Classpaths.inheritJUnitClassic(project, true, 'testCompile') + implementation project(':Base') + implementation project(':DataStructures') + implementation project(':IO') + implementation project(':log-factory') + implementation depCommonsLang3 + Classpaths.inheritJUnitClassic(project, 'testImplementation') + Classpaths.inheritJMock(project, 'testImplementation') Classpaths.inheritAutoService(project) - testCompile project(path: ':Base', configuration: 'tests') + testImplementation project(path: ':Base', configuration: 'tests') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/Container/build.gradle b/Container/build.gradle index e6d301d3f79..1c3a342402e 100644 --- a/Container/build.gradle +++ b/Container/build.gradle @@ -4,5 +4,5 @@ plugins { } dependencies { - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') } \ No newline at end of file diff --git a/DHProcess/build.gradle b/DHProcess/build.gradle index 04cbc962836..70d36dd9ff4 100644 --- a/DHProcess/build.gradle +++ b/DHProcess/build.gradle @@ -8,7 +8,7 @@ dependencies { annotationProcessor 'org.immutables:value:2.8.1' compileOnly 'org.immutables:value-annotations:2.8.1' - compile ('com.github.oshi:oshi-core:5.8.3') { + implementation ('com.github.oshi:oshi-core:5.8.3') { because 'it is able to greatly simplify collection of system information' } } diff --git a/DataStructures/build.gradle b/DataStructures/build.gradle index bfbf70a3309..d7a32981b69 100644 --- a/DataStructures/build.gradle +++ b/DataStructures/build.gradle @@ -1,7 +1,8 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } dependencies { - compile project(':Base') + implementation project(':Base') } diff --git a/FishUtil/build.gradle b/FishUtil/build.gradle index 230d8ec1800..c0a793b6ec7 100644 --- a/FishUtil/build.gradle +++ b/FishUtil/build.gradle @@ -1,10 +1,16 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } dependencies { - compile project(':Base'), project(':DataStructures'), project(':IO'), project(':Configuration'), project(':log-factory') - compile depCommonsEmail, depCommonsNet + implementation project(':Base') + implementation project(':DataStructures') + implementation project(':IO') + implementation project(':Configuration') + implementation project(':log-factory') + implementation depCommonsEmail + implementation depCommonsNet - testCompile project(path: ':Base', configuration: 'tests') + testImplementation project(path: ':Base', configuration: 'tests') } \ No newline at end of file diff --git a/Generators/Generators.gradle b/Generators/Generators.gradle index eea9f3b1482..1c64962fd30 100644 --- a/Generators/Generators.gradle +++ b/Generators/Generators.gradle @@ -6,30 +6,30 @@ plugins { evaluationDependsOn Docker.registryProject('python') configurations { - compile.extendsFrom fishConfig, jdom - testCompile.extendsFrom fishBaseTest + implementation.extendsFrom fishConfig, jdom + testImplementation.extendsFrom fishBaseTest combinedJavadoc } dependencies { - compile project(':engine-table'), - project(':Plot'), - project(':extensions-csv'), - project(':extensions-kafka'), - project(':extensions-parquet-table') + implementation project(':engine-table') + implementation project(':Plot') + implementation project(':extensions-csv') + implementation project(':extensions-kafka') + implementation project(':extensions-parquet-table') Classpaths.inheritGroovy(project, 'groovy', 'implementation') Classpaths.inheritGroovy(project, 'groovy-json', 'implementation') - runtime project(path: ':configs'), - project(path: ':test-configs'), - project(':extensions-kafka') + runtimeOnly project(path: ':configs') + runtimeOnly project(path: ':test-configs') + runtimeOnly project(':extensions-kafka') runtimeOnly project(':log-to-slf4j') Classpaths.inheritLogbackClassic(project) - testRuntime project(path: ':configs'), - project(path: ':test-configs') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') combinedJavadoc project(path: ':combined-javadoc', targetConfiguration: 'combinedJavadoc') } diff --git a/IO/build.gradle b/IO/build.gradle index dd8e9564eba..4610cfd22dd 100644 --- a/IO/build.gradle +++ b/IO/build.gradle @@ -3,8 +3,13 @@ plugins { } dependencies { - compile project(':Base'), project(':SevenZip'), depCommonsCodec - testCompile project(path: ':Base', configuration: 'tests') + implementation project(':Base') + implementation project(':SevenZip') + implementation depCommonsCodec + implementation depCommonsCompress + testImplementation project(path: ':Base', configuration: 'tests') + Classpaths.inheritJUnitClassic(project, 'testImplementation') + Classpaths.inheritJMock(project, 'testImplementation') } sourceSets { @@ -27,7 +32,7 @@ task jarTests(type: Jar, dependsOn: testClasses) { } configurations { tests { - extendsFrom testRuntime + } } artifacts { diff --git a/Integrations/build.gradle b/Integrations/build.gradle index b1575a4fd31..ac4ec50aa37 100644 --- a/Integrations/build.gradle +++ b/Integrations/build.gradle @@ -2,70 +2,39 @@ plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.project.register' id 'com.avast.gradle.docker-compose' - id 'idea' } evaluationDependsOn ':docker-server' configurations { - compile.extendsFrom dhIntegrations - testCompile.extendsFrom fishBaseTest + implementation.extendsFrom dhIntegrations + testImplementation.extendsFrom fishBaseTest } dependencies { - compile project(':engine-table') - compile project(':plugin') + implementation project(':engine-table') + implementation project(':plugin') + implementation project(':Configuration') + implementation project(':log-factory') + testRuntimeOnly project(':log-to-slf4j') // add configs, and some runtime dependencies to test classpaths - testRuntime project(':configs'), - project(':test-configs'), - // need these projects so session default imports / generated type wrappers resolve correctly - project(':Numerics'), - project(':Plot'), - project(':extensions-kafka'), - project(':extensions-parquet-table') + testRuntimeOnly project(':configs') + testRuntimeOnly project(':test-configs') + // need these projects so session default imports / generated type wrappers resolve correctly + testRuntimeOnly project(':Numerics') + testRuntimeOnly project(':Plot') + testRuntimeOnly project(':extensions-kafka') + testRuntimeOnly project(':extensions-parquet-table') } sourceSets { - main { - java { - srcDir 'src/main/java' - } - // For gradle, we _probably_ do not want to put r into the jar, - // and definitely do not want to put in python, which is delivered as a wheel. - // This used to be `resources.srcDirs '.'` with inclusions for 'r' and 'python' - // We can't use srcDirs '.' and expect IntelliJ to like it, so we'll just remove - // the sourceSet resources entirely, and then manually staple r into the jar - // until we can verify that it is safe to remove (and then we'll just remove the jar {} block below) - resources.srcDirs = ['src/main/resources'] - } test { - java.srcDirs = ['src/test/java'] - resources.srcDirs = ['test_python', 'src/test/resources'] - } -} - -// Even though we don't want gradle to treat these directories as resources (for jar packing), -// we do want IntelliJ to treat them as resources in IDE. -idea { - module { - resourceDirs += [file('r'), file('python')] - testResourceDirs += [file('python/test')] - } -} - -// This wiring is probably not needed. -// It only exists to maintain legacy jar structure -// (we changed the sourceSets.main.resources srcDirs, -// which affects where files would normally be packed into the jar). -// TODO: verify nobody pulls r from the Integrations jar, then delete this) -(tasks.jar as Jar).configure { - Jar j -> - j.from('r') { - CopySpec c-> - c.into 'r' + resources { + srcDirs += ['test_python'] } + } } JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention diff --git a/ModelFarm/ModelFarm.gradle b/ModelFarm/ModelFarm.gradle index de26ae8bd16..fcb613a1970 100644 --- a/ModelFarm/ModelFarm.gradle +++ b/ModelFarm/ModelFarm.gradle @@ -4,22 +4,27 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } configurations { - testCompile.extendsFrom fishBaseTest + testImplementation.extendsFrom fishBaseTest } dependencies { - compile project(':engine-table') + api project(':engine-table') + api project(':engine-time') - runtime project(':configs') + implementation project(':Configuration') + implementation project(':log-factory') - testCompile TestTools.projectDependency(project, 'engine-table') - testRuntime project(':Numerics') + runtimeOnly project(':configs') - testRuntimeOnly project(':log-to-slf4j'), - project(path: ':configs'), - project(path: ':test-configs') + testImplementation TestTools.projectDependency(project, 'engine-table') + testRuntimeOnly project(':Numerics') + + testRuntimeOnly project(':log-to-slf4j') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') } diff --git a/Net/build.gradle b/Net/build.gradle index 800e73f2d9f..0fe27c5bf83 100644 --- a/Net/build.gradle +++ b/Net/build.gradle @@ -3,10 +3,14 @@ plugins { } dependencies { - compile project(':Base'), project(':DataStructures'), project(':IO'), project(':Configuration'), - project(':FishUtil') + implementation project(':Base') + implementation project(':DataStructures') + implementation project(':IO') + implementation project(':Configuration') + implementation project(':FishUtil') + implementation project(':log-factory') - testCompile project(path: ':Base', configuration: 'tests') + testImplementation project(path: ':Base', configuration: 'tests') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/Numerics/Numerics.gradle b/Numerics/Numerics.gradle index 8282a67aadf..9e95a25aa46 100644 --- a/Numerics/Numerics.gradle +++ b/Numerics/Numerics.gradle @@ -1,15 +1,17 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } configurations { - compile.extendsFrom dhNumerics - testCompile.extendsFrom fishBaseTest + implementation.extendsFrom dhNumerics + testImplementation.extendsFrom fishBaseTest } dependencies { - compile project(':engine-table'), - project(':engine-function') + api project(':engine-time') + implementation project(':engine-function') - testRuntime project(path: ':configs'), project(path: ':test-configs') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') } diff --git a/Plot/Plot.gradle b/Plot/Plot.gradle index cf60e96b57c..3037e66ba6a 100644 --- a/Plot/Plot.gradle +++ b/Plot/Plot.gradle @@ -1,18 +1,21 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } configurations { - compile.extendsFrom dhPlot + implementation.extendsFrom dhPlot - testCompile.extendsFrom fishIoTest + testImplementation.extendsFrom fishIoTest } dependencies { - compile project(':engine-table'), - project(':engine-function'), - project(':engine-tuple') + api project(':engine-api') + implementation project(':engine-table') + implementation project(':engine-function') + implementation project(':engine-tuple') + implementation project(':log-factory') Classpaths.inheritGroovy(project, 'groovy', 'implementation') Classpaths.inheritGroovy(project, 'groovy-json', 'implementation') @@ -22,10 +25,12 @@ dependencies { implementation 'com.google.guava:guava:19.0' - testCompile TestTools.projectDependency(project, 'Util'), - TestTools.projectDependency(project, 'engine-table') + testImplementation TestTools.projectDependency(project, 'Util') + testImplementation TestTools.projectDependency(project, 'engine-table') - testRuntime project(path: ':configs'), project(path: ':test-configs'), project(':Numerics') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') + testRuntimeOnly project(':Numerics') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/Stats/build.gradle b/Stats/build.gradle index a274e4f0f0e..e7a4b21e674 100644 --- a/Stats/build.gradle +++ b/Stats/build.gradle @@ -3,14 +3,20 @@ plugins { } dependencies { - implementation project(':Base'), project(':DataStructures'), project(':IO'), project(':Configuration'), project(':FishUtil'), - project(':Net') + implementation project(':Base') + implementation project(':DataStructures') + implementation project(':IO') + implementation project(':Configuration') + implementation project(':FishUtil') + implementation project(':Net') + implementation project(':log-factory') compileOnly 'com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0' - testCompile project(path: ':Base', configuration: 'tests') + testImplementation project(path: ':Base', configuration: 'tests') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') + Classpaths.inheritJUnitClassic(project, 'testImplementation') } test { diff --git a/TableLogger/TableLogger.gradle b/TableLogger/TableLogger.gradle index 219cc9914ae..411b1b752d0 100644 --- a/TableLogger/TableLogger.gradle +++ b/TableLogger/TableLogger.gradle @@ -3,13 +3,14 @@ plugins { } configurations { - compile.extendsFrom fishUtil, fishData - testCompile.extendsFrom fishDataTest + implementation.extendsFrom fishUtil, fishData + testImplementation.extendsFrom fishDataTest } dependencies { - compile project(':Util') - testRuntime project(path: ':configs'), project(path: ':test-configs') + implementation project(':Util') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') runtimeOnly project(path: ':configs') diff --git a/Util/Util.gradle b/Util/Util.gradle index 39752c62f02..c8aa28c90c8 100644 --- a/Util/Util.gradle +++ b/Util/Util.gradle @@ -3,14 +3,15 @@ plugins { } configurations { - compile.extendsFrom configurations.dhUtil, commonsLang3 - testCompile.extendsFrom fishBaseTest + implementation.extendsFrom configurations.dhUtil, commonsLang3 + testImplementation.extendsFrom fishBaseTest } dependencies { - compile project(':log-factory') + implementation project(':log-factory') - testRuntime project(path: ':configs'), project(path: ':test-configs') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 5882dd0bf5b..0821a180e7e 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -17,25 +17,25 @@ repositories { } dependencies { - compile('de.esoco.gwt:gwt-gradle-plugin:1.1.1') { + implementation('de.esoco.gwt:gwt-gradle-plugin:1.1.1') { exclude group: 'org.codehaus.groovy' because('needed for GwtTools') } - compile('com.bmuschko:gradle-docker-plugin:7.1.0') { + implementation('com.bmuschko:gradle-docker-plugin:7.1.0') { because('needed by plugin com.bmuschko.docker-remote-api') } - compile ('com.avast.gradle:gradle-docker-compose-plugin:0.14.9') { + implementation('com.avast.gradle:gradle-docker-compose-plugin:0.14.9') { because('needed by plugin com.avast.gradle.docker-compose') } - compile('com.diffplug.spotless:spotless-plugin-gradle:5.14.2') { + implementation('com.diffplug.spotless:spotless-plugin-gradle:5.14.2') { because('needed by plugin java-coding-conventions') } // TODO(deephaven-core#1997): Remove license-gradle-plugin - compile('gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0') { + implementation('gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1') { because('needed by plugin java-header-conventions') } } diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 042efd5f7a0..a1f2470bd02 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -136,11 +136,7 @@ class Classpaths { new DefaultExternalModuleDependency(group, name, version) } - static Configuration compile(Project p) { - p.configurations.findByName('api') ?: p.configurations.getByName('compile') - } - - static void inheritGwt(Project p, String name = 'gwt-user', String configName = 'compileOnly') { + static void inheritGwt(Project p, String name, String configName) { Configuration config = p.configurations.getByName(configName) if (addDependency(config, GWT_GROUP, name, GWT_VERSION)) { // when we add gwt-dev, lets also force asm version, just to be safe. @@ -152,32 +148,32 @@ class Classpaths { } } - static void inheritJavaParser(Project p, String name = JAVA_PARSER_NAME) { - Configuration compile = compile p - addDependency compile, JAVA_PARSER_GROUP, name, JAVA_PARSER_VERSION + static void inheritJavaParser(Project p, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency config, JAVA_PARSER_GROUP, JAVA_PARSER_NAME, JAVA_PARSER_VERSION } - static void inheritJavaxAnnotations(Project p) { - Configuration compile = compile p - addDependency compile, JAVAX_ANNOTATIONS_GROUP, JAVAX_ANNOTATIONS_NAME, JAVAX_ANNOTATIONS_VERSION + static void inheritJavaxAnnotations(Project p, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency config, JAVAX_ANNOTATIONS_GROUP, JAVAX_ANNOTATIONS_NAME, JAVAX_ANNOTATIONS_VERSION } - static void inheritJsInterop(Project p, String name = 'base') { - Configuration compile = compile p - addDependency compile, JS_INTEROP_GROUP, name, + static void inheritJsInterop(Project p, String name, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency config, JS_INTEROP_GROUP, name, // google is annoying, and have different versions released for the same groupId // :base: is the only one that is different, so we'll use it in the ternary. name == 'base'? '1.0.0' : JS_INTEROP_VERSION } - static void inheritElemental(Project p, String name = 'elemental2-core') { - Configuration compile = compile p - addDependency compile, ELEMENTAL_GROUP, name, ELEMENTAL_VERSION + static void inheritElemental(Project p, String name, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency config, ELEMENTAL_GROUP, name, ELEMENTAL_VERSION } - static void inheritCommonsText(Project p) { - Configuration compile = compile p - addDependency compile, COMMONS_GROUP, 'commons-text', "1.6", { + static void inheritCommonsText(Project p, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency config, COMMONS_GROUP, 'commons-text', "1.6", { // commons-text depends on commons-lang3; sadly, our version of lang3 is so old, // there is no version of commons-text which depends on it. So, we just exclude it. // we only want some small, self-contained classes in commons-text anyway. @@ -220,13 +216,15 @@ class Classpaths { p.getDependencies().add('compileOnly', p.project(':util-immutables')) } - static void inheritJUnitClassic(Project p, boolean includeJMock = false, String configName = JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME) { + static void inheritJUnitClassic(Project p, String configName) { Configuration config = p.configurations.getByName(configName) addDependency(config, JUNIT_CLASSIC_GROUP, JUNIT_CLASSIC_NAME, JUNIT_CLASSIC_VERSION) - if (includeJMock) { - addDependency(config, JMOCK_GROUP, JMOCK_JUNIT_NAME, JMOCK_VERSION) - addDependency(config, JMOCK_GROUP, JMOCK_IMPORSTERS_NAME, JMOCK_VERSION) - } + } + + static void inheritJMock(Project p, String configName) { + Configuration config = p.configurations.getByName(configName) + addDependency(config, JMOCK_GROUP, JMOCK_JUNIT_NAME, JMOCK_VERSION) + addDependency(config, JMOCK_GROUP, JMOCK_IMPORSTERS_NAME, JMOCK_VERSION) } static void inheritJUnitPlatform(Project p, String configName = JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME) { diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index 1009b42115b..5e37ea490bb 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -62,7 +62,8 @@ dependencies { mockrunner 'com.mockrunner:mockrunner-jdbc:1.0.4' commonsCsv 'org.apache.commons:commons-csv:1.4' - Classpaths.inheritJUnitClassic(project, true, 'junit') + Classpaths.inheritJUnitClassic(project, 'junit') + Classpaths.inheritJMock(project, 'junit') // Now, all the various fish libs we depend on, with inherited dependencies matching // the actual dependencies used in fishlib... if we were strongly coupled, we could skip diff --git a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle index cf9a659eea3..9684a2eb297 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle @@ -18,6 +18,7 @@ configurations { } artifacts { + testOutput jar testOutput testJar archives testJar } diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/Architecture.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/Architecture.groovy index 0611f3c07d8..139a84a33d8 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/docker/Architecture.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/Architecture.groovy @@ -17,10 +17,16 @@ enum Architecture { static Architecture fromHost() { String archName = DefaultNativePlatform.host().getArchitecture().getName() + // See org.gradle.nativeplatform.platform.internal.Architectures for constants switch (archName) { case "x86-64": + case "x86_64": + case "amd64": + case "x64": return AMD64 + case "aarch64": case "arm-v8": + case "arm64": return ARM64 default: throw new IllegalStateException("Unable to determine proper docker architecture for " + archName) diff --git a/codegen/build.gradle b/codegen/build.gradle index 34c5867ecd7..f1e4c38a25e 100644 --- a/codegen/build.gradle +++ b/codegen/build.gradle @@ -8,5 +8,5 @@ description 'Codegen: Code generation utilities' dependencies { implementation 'org.freemarker:freemarker:2.3.31' - Classpaths.inheritJUnitClassic(project) -} + Classpaths.inheritJUnitClassic(project, 'testImplementation') +} \ No newline at end of file diff --git a/engine/api/build.gradle b/engine/api/build.gradle index 4016873ebce..e64d05182be 100644 --- a/engine/api/build.gradle +++ b/engine/api/build.gradle @@ -6,12 +6,15 @@ plugins { description 'Engine API: Engine API module, suitable as a compile-time dependency for most queries' dependencies { - api project(':qst'), - project(':engine-chunk'), - project(':engine-vector'), - project(':engine-time'), - project(':engine-updategraph'), - project(':engine-rowset') + api project(':qst') + api project(':engine-chunk') + api project(':engine-vector') + api project(':engine-time') + api project(':engine-updategraph') + api project(':engine-rowset') + + implementation project(':DataStructures') + implementation depTrove3 Classpaths.inheritImmutables(project) @@ -21,7 +24,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') } spotless { diff --git a/engine/benchmark/build.gradle b/engine/benchmark/build.gradle index 495eefb9d63..a9789b5feed 100644 --- a/engine/benchmark/build.gradle +++ b/engine/benchmark/build.gradle @@ -21,10 +21,10 @@ dependencies { TestTools.projectDependency(project, 'engine-table') testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.21' + testCompileOnly 'org.openjdk.jmh:jmh-generator-annprocess:1.21' - testRuntime project(path: ':configs'), - project(path: ':test-configs'), - 'org.openjdk.jmh:jmh-generator-annprocess:1.21' + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') } spotless { diff --git a/engine/chunk/build.gradle b/engine/chunk/build.gradle index 905369651d3..e99450acc9f 100644 --- a/engine/chunk/build.gradle +++ b/engine/chunk/build.gradle @@ -7,8 +7,9 @@ description 'Engine Chunks: Array-like data structures for dense, efficient data dependencies { api project(':Util') + implementation project(':Base') - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/function/build.gradle b/engine/function/build.gradle index abe33c8df91..8e227386241 100644 --- a/engine/function/build.gradle +++ b/engine/function/build.gradle @@ -7,15 +7,18 @@ description 'Engine Functions: Libraries for use in query expressions' configurations { primitiveCodegen - testCompile.extendsFrom junit + testImplementation.extendsFrom junit } dependencies { primitiveCodegen project(':codegen') - api 'net.sf.trove4j:trove4j:3.0.3', - project(':Util'), - project(':engine-vector') + api 'net.sf.trove4j:trove4j:3.0.3' + api project(':Util') + api project(':engine-vector') + + implementation project(':Base') + implementation depCommonsLang3 testImplementation TestTools.projectDependency(project, 'Base') } diff --git a/engine/rowset/build.gradle b/engine/rowset/build.gradle index 5e11d45cff9..53f847590b8 100644 --- a/engine/rowset/build.gradle +++ b/engine/rowset/build.gradle @@ -7,13 +7,18 @@ description 'Engine RowSets: Data structures for working with row keys' dependencies { api project(':engine-chunk') + api project(':Base') - implementation project(':Container'), - project(':engine-updategraph') + implementation project(':Container') + implementation project(':engine-updategraph') + implementation project(':Configuration') + implementation depCommonsLang3 + implementation depTrove3 compileOnly 'com.google.code.findbugs:jsr305:3.0.2' + compileOnly depAnnotations - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/stringset/build.gradle b/engine/stringset/build.gradle index 8945a2cfa4d..73e59389ce8 100644 --- a/engine/stringset/build.gradle +++ b/engine/stringset/build.gradle @@ -7,4 +7,5 @@ description 'Engine StringSet: Data structure support for efficient storage of s dependencies { api project(':DataStructures') + implementation project(':Base') } diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 28fd90e22fa..084816e387b 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -23,26 +23,35 @@ sourceSets { } dependencies { - api project(':Util'), - project(':TableLogger'), - project(':engine-stringset'), - project(':engine-base'), - project(':deephaven-jpy-ext'), - project(':hotspot') - - implementation project(':CompilerTools'), - project(':DHProcess'), - project(':engine-function'), - project(':engine-tuple'), - 'com.github.f4b6a3:uuid-creator:3.6.0', - 'com.tdunning:t-digest:3.2', - 'com.squareup:javapoet:1.9.0' + api project(':Util') + api project(':TableLogger') + api project(':engine-stringset') + api project(':engine-base') + api project(':deephaven-jpy-ext') + api project(':hotspot') + api project(':IO') + + implementation project(':CompilerTools') + implementation project(':DHProcess') + implementation project(':engine-function') + implementation project(':engine-tuple') + implementation project(':Configuration') + implementation project(':log-factory') + implementation project(':Stats') + implementation project(':Net') + implementation project(':FishUtil') + + implementation 'com.github.f4b6a3:uuid-creator:3.6.0' + implementation 'com.tdunning:t-digest:3.2' + implementation 'com.squareup:javapoet:1.9.0' implementation project(':plugin') + implementation depCommonsLang3 + Classpaths.inheritCommonsText(project, 'implementation') Classpaths.inheritGroovy(project, 'groovy', 'implementation') Classpaths.inheritGroovy(project, 'groovy-json', 'implementation') - Classpaths.inheritJavaParser(project) + Classpaths.inheritJavaParser(project, 'implementation') Classpaths.inheritAutoService(project) Classpaths.inheritImmutables(project) @@ -53,17 +62,18 @@ dependencies { implementation 'com.google.guava:guava:19.0' - testImplementation TestTools.projectDependency(project, 'Base'), - TestTools.projectDependency(project, 'Util'), - TestTools.projectDependency(project, 'engine-chunk'), - TestTools.projectDependency(project, 'engine-rowset'), - TestTools.projectDependency(project, 'Numerics'), - project(':Base'), - project(':BenchmarkSupport'), - project(':extensions-csv'), - project(':extensions-parquet-table') - - Classpaths.inheritJUnitClassic(project) + testImplementation TestTools.projectDependency(project, 'Base') + testImplementation TestTools.projectDependency(project, 'Util') + testImplementation TestTools.projectDependency(project, 'engine-chunk') + testImplementation TestTools.projectDependency(project, 'engine-rowset') + testImplementation TestTools.projectDependency(project, 'Numerics') + testImplementation project(':Base') + testImplementation project(':BenchmarkSupport') + testImplementation project(':extensions-csv') + testImplementation project(':extensions-parquet-table') + testImplementation project(':Numerics') + + Classpaths.inheritJUnitClassic(project, 'testImplementation') Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) diff --git a/engine/time/build.gradle b/engine/time/build.gradle index 0cea6ec5119..ba28e1a0fae 100644 --- a/engine/time/build.gradle +++ b/engine/time/build.gradle @@ -6,15 +6,19 @@ plugins { description 'Engine Time: Types and libraries for working with instants, periods, and calendars' configurations { - testCompile.extendsFrom junit + testImplementation.extendsFrom junit } dependencies { - api project(':Base'), - project(':Util'), - 'joda-time:joda-time:2.10' + api project(':Base') + api project(':Util') + api 'joda-time:joda-time:2.10' implementation project(':engine-function') + implementation project(':Configuration') + implementation project(':log-factory') + implementation project(':FishUtil') + implementation depJdom2 testImplementation TestTools.projectDependency(project, 'Base') diff --git a/engine/tuple/build.gradle b/engine/tuple/build.gradle index 867e454a2ec..707af1b5a4b 100644 --- a/engine/tuple/build.gradle +++ b/engine/tuple/build.gradle @@ -6,11 +6,12 @@ plugins { description 'Engine Tuples: Value sequences for use in aggregations, joins, and indexing' dependencies { - api 'net.sf.trove4j:trove4j:3.0.3', - project(':Util'), - project(':engine-time') + api 'net.sf.trove4j:trove4j:3.0.3' + api project(':Util') + api project(':engine-time') + implementation project(':DataStructures') - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') } spotless { diff --git a/engine/updategraph/build.gradle b/engine/updategraph/build.gradle index ed750ce26e1..820d483337f 100644 --- a/engine/updategraph/build.gradle +++ b/engine/updategraph/build.gradle @@ -10,10 +10,16 @@ dependencies { implementation project(':engine-chunk') implementation project(':hotspot') + implementation project(':log-factory') + implementation project(':Configuration') + implementation project(':Net') + implementation project(':FishUtil') + implementation depCommonsLang3 compileOnly 'com.google.code.findbugs:jsr305:3.0.2' + compileOnly depAnnotations - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/engine/vector/build.gradle b/engine/vector/build.gradle index d6910f71417..1d42a50cfc5 100644 --- a/engine/vector/build.gradle +++ b/engine/vector/build.gradle @@ -6,10 +6,13 @@ plugins { description 'Engine Vectors: Array-like data structures for in-place data access' dependencies { - api project(':Util'), - project(':qst') + api project(':Util') + api project(':qst') + implementation project(':Base') - Classpaths.inheritJUnitClassic(project) + compileOnly depAnnotations + + Classpaths.inheritJUnitClassic(project, 'testImplementation') } spotless { diff --git a/extensions/barrage/build.gradle b/extensions/barrage/build.gradle index 4318b5c412d..4ec49b289c9 100644 --- a/extensions/barrage/build.gradle +++ b/extensions/barrage/build.gradle @@ -4,8 +4,8 @@ plugins { } configurations { - compile.extendsFrom irisDb - testCompile.extendsFrom irisDbTest + implementation.extendsFrom irisDb + testImplementation.extendsFrom irisDbTest } description = 'An extension integrating Barrage with Deephaven\'s Table Model' @@ -13,6 +13,9 @@ description = 'An extension integrating Barrage with Deephaven\'s Table Model' dependencies { implementation project(':Base') implementation project(':Util') + implementation project(':Configuration') + implementation depCommonsLang3 + api project(':engine-table') implementation project(':proto:proto-backplane-grpc-flight') implementation project(':log-factory') diff --git a/extensions/csv/build.gradle b/extensions/csv/build.gradle index 2b4e650e46f..d6b7c0cc3c8 100644 --- a/extensions/csv/build.gradle +++ b/extensions/csv/build.gradle @@ -10,8 +10,9 @@ dependencies { api 'io.deephaven:deephaven-csv:0.7.0' runtimeOnly 'io.deephaven:deephaven-csv-fast-double-parser:0.7.0' - implementation project(':engine-table'), - project(':engine-base') + implementation project(':engine-table') + implementation project(':engine-base') + implementation depTrove3 Classpaths.inheritImmutables(project) @@ -21,7 +22,7 @@ dependencies { testImplementation TestTools.projectDependency(project, 'engine-table'), TestTools.projectDependency(project, 'engine-base') - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/extensions/kafka/build.gradle b/extensions/kafka/build.gradle index 5c894a6a519..ed0e5e40d15 100644 --- a/extensions/kafka/build.gradle +++ b/extensions/kafka/build.gradle @@ -16,10 +16,15 @@ dependencies { api 'org.apache.kafka:kafka-clients:7.1.1-ccs' api 'io.confluent:kafka-avro-serializer:7.1.1' + implementation project(':Configuration') + implementation project(':log-factory') + implementation depTrove3 + implementation depCommonsLang3 + Classpaths.inheritImmutables(project) testImplementation TestTools.projectDependency(project, 'engine-table') - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/extensions/parquet/base/build.gradle b/extensions/parquet/base/build.gradle index 75734a11a1f..82099cf0676 100644 --- a/extensions/parquet/base/build.gradle +++ b/extensions/parquet/base/build.gradle @@ -9,10 +9,12 @@ dependencies { api project(':ParquetHadoop') implementation project(':extensions-parquet-compression') - + implementation project(':Base') implementation project(':Util') + implementation depCommonsIo - Classpaths.inheritJUnitClassic(project) + compileOnly depAnnotations + Classpaths.inheritJUnitClassic(project, 'testImplementation') } spotless { diff --git a/extensions/parquet/table/build.gradle b/extensions/parquet/table/build.gradle index ce8ecb887b9..cdf608f8723 100644 --- a/extensions/parquet/table/build.gradle +++ b/extensions/parquet/table/build.gradle @@ -15,13 +15,18 @@ sourceSets { } dependencies { - api project(':engine-api'), - project(':engine-stringset') + api project(':engine-api') + api project(':engine-stringset') - implementation project(':extensions-parquet-base'), - project(':engine-base'), - project(':engine-table'), - project(':extensions-csv') + implementation project(':extensions-parquet-base') + implementation project(':engine-base') + implementation project(':engine-table') + implementation project(':extensions-csv') + implementation project(':log-factory') + implementation project(':Configuration') + implementation depCommonsLang3 + + Classpaths.inheritCommonsText(project, 'implementation') Classpaths.inheritJacksonPlatform(project) implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml' @@ -32,7 +37,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' testImplementation TestTools.projectDependency(project, 'engine-table') - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testRuntimeOnly project(':log-to-slf4j'), project(path: ':configs'), diff --git a/extensions/suanshu/build.gradle b/extensions/suanshu/build.gradle index 18161487b43..f476a0c99df 100644 --- a/extensions/suanshu/build.gradle +++ b/extensions/suanshu/build.gradle @@ -4,7 +4,7 @@ plugins { } configurations { - testCompile.extendsFrom fishBaseTest + testImplementation.extendsFrom fishBaseTest } dependencies { diff --git a/gradle/web-client.gradle b/gradle/web-client.gradle index 4ba056daeb2..6f909db8d0c 100644 --- a/gradle/web-client.gradle +++ b/gradle/web-client.gradle @@ -3,6 +3,6 @@ apply from: "$rootDir/gradle/web-common.gradle" // To perform production compile: gw gCo (./gradlew gwtCompile) // To start the dev server: gw gCS (./gradlew gwtCodeServer) -Classpaths.inheritGwt project -Classpaths.inheritGwt project, 'gwt-user', 'testCompile' -Classpaths.inheritGwt project, 'gwt-dev', 'testCompile' +Classpaths.inheritGwt project, 'gwt-user', 'compileOnly' +Classpaths.inheritGwt project, 'gwt-user', 'testImplementation' +Classpaths.inheritGwt project, 'gwt-dev', 'testImplementation' diff --git a/gradle/web-gwt-test.gradle b/gradle/web-gwt-test.gradle index f5e07f46b8d..cb941530adc 100644 --- a/gradle/web-gwt-test.gradle +++ b/gradle/web-gwt-test.gradle @@ -1,6 +1,6 @@ configurations { - testCompile.extendsFrom junit + testImplementation.extendsFrom junit } // for now, all gwt testing will be manual, since we need to have full @@ -21,7 +21,6 @@ task 'gwtTest', type: Test, { 'dhTestServer': testServer ] t.include '**/*TestSuite.class' - t.logging.level = 'INFO' t.useJUnit() t.maxHeapSize = '2G' t.scanForTestClasses = false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index af18bba73bf..68ced1c29a1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip -distributionSha256Sum=b13f5d97f08000996bf12d9dd70af3f2c6b694c2c663ab1b545e9695562ad1ee +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java-client/barrage/build.gradle b/java-client/barrage/build.gradle index 7db97ef76de..4e9289efc00 100644 --- a/java-client/barrage/build.gradle +++ b/java-client/barrage/build.gradle @@ -4,8 +4,8 @@ plugins { } configurations { - compile.extendsFrom irisDb - testCompile.extendsFrom irisDbTest + implementation.extendsFrom irisDb + testImplementation.extendsFrom irisDbTest } description = 'The Deephaven Barrage Client' @@ -13,6 +13,7 @@ description = 'The Deephaven Barrage Client' dependencies { api project(':java-client-flight') api project(':extensions-barrage') + implementation project(':log-factory') compileOnly 'javax.inject:javax.inject:1' diff --git a/java-client/session/build.gradle b/java-client/session/build.gradle index 778c0e5427b..beaf3451531 100644 --- a/java-client/session/build.gradle +++ b/java-client/session/build.gradle @@ -30,7 +30,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine' - Classpaths.inheritJUnitClassic(project) + Classpaths.inheritJUnitClassic(project, 'testImplementation') testImplementation 'io.grpc:grpc-testing' Classpaths.inheritAssertJ(project) diff --git a/log-factory/build.gradle b/log-factory/build.gradle index e2d114da2a9..9a3cdb9d750 100644 --- a/log-factory/build.gradle +++ b/log-factory/build.gradle @@ -4,7 +4,7 @@ plugins { } configurations { - compile.extendsFrom fishIo + api.extendsFrom fishIo } dependencies { diff --git a/open-api/lang-parser/lang-parser.gradle b/open-api/lang-parser/lang-parser.gradle index 84bb663237c..8baf8dc5632 100644 --- a/open-api/lang-parser/lang-parser.gradle +++ b/open-api/lang-parser/lang-parser.gradle @@ -10,11 +10,11 @@ plugins { apply from: "$rootDir/gradle/web-common.gradle" dependencies { - compile project(':open-api-shared-fu') - compile project(':log-factory') - compile project(':proto:proto-backplane-grpc') + api project(':open-api-shared-fu') + implementation project(':log-factory') + api project(':proto:proto-backplane-grpc') } -Classpaths.inheritJavaParser project +Classpaths.inheritJavaParser(project, 'implementation') // All javacc plugin configuration disabled to avoid weird IntelliJ breakage // when we try to manually patch the plugin. Will reinstate once upstream diff --git a/open-api/lang-tools/lang-tools.gradle b/open-api/lang-tools/lang-tools.gradle index b209e18ca7a..0ea6b84920b 100644 --- a/open-api/lang-tools/lang-tools.gradle +++ b/open-api/lang-tools/lang-tools.gradle @@ -1,34 +1,35 @@ plugins { id 'groovy' id 'io.deephaven.project.register' + id 'java-library' } apply from: "$rootDir/gradle/web-common.gradle" -Classpaths.inheritCommonsText(project) +Classpaths.inheritCommonsText(project, 'implementation') dependencies { - compile project(':open-api-lang-parser') - - compile project(':engine-table'), - project(':engine-function'), - project(':IO') + implementation project(':open-api-lang-parser') + implementation project(':engine-table') + implementation project(':engine-function') + implementation project(':IO') + implementation project(':log-factory') testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' Classpaths.inheritJUnitPlatform(project) testImplementation 'org.junit.jupiter:junit-jupiter' - Classpaths.inheritGroovy(project, 'groovy', 'testCompile') - Classpaths.inheritGroovy(project, 'groovy-templates', 'testCompile') + Classpaths.inheritGroovy(project, 'groovy', 'testImplementation') + Classpaths.inheritGroovy(project, 'groovy-templates', 'testImplementation') - testCompile TestTools.projectDependency(project, 'engine-table') - testRuntime project(':configs') - testRuntime project(':test-configs') - testRuntime(project(':Numerics')) + testImplementation TestTools.projectDependency(project, 'engine-table') + testRuntimeOnly project(':configs') + testRuntimeOnly project(':test-configs') + testRuntimeOnly project(':Numerics') // intellij can be dumb and leave out our resources directory (sometimes)... // Do not cargo-cult this unless you have similar issues - testRuntime files('build/resources/main') + testRuntimeOnly files('build/resources/main') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index e272b4b93e3..ed87e89e1fc 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -17,7 +17,7 @@ configurations { } // automatically pick up the standard junit version - testCompile.extendsFrom junit + testImplementation.extendsFrom junit js {} python {} diff --git a/py/jpy-ext/build.gradle b/py/jpy-ext/build.gradle index 4926daa5971..e29f359a67a 100644 --- a/py/jpy-ext/build.gradle +++ b/py/jpy-ext/build.gradle @@ -12,13 +12,15 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } configurations { - compile.extendsFrom fishBase + implementation.extendsFrom fishBase } dependencies { - compile 'org.jpyconsortium:jpy:0.11.0' - compile project(':deephaven-jpy-config') + api 'org.jpyconsortium:jpy:0.11.0' + api project(':deephaven-jpy-config') + api project(':Base') } diff --git a/py/jpy-integration/build.gradle b/py/jpy-integration/build.gradle index fdde087ffc2..b5ce5723deb 100644 --- a/py/jpy-integration/build.gradle +++ b/py/jpy-integration/build.gradle @@ -24,6 +24,8 @@ sourceSets { resources { srcDirs = ['src/javaToPython/python'] } + compileClasspath += sourceSets.test.output + runtimeClasspath += sourceSets.test.output } pythonToJava { @@ -33,24 +35,28 @@ sourceSets { resources { srcDirs = ['src/pythonToJava/python'] } + compileClasspath += sourceSets.test.output + runtimeClasspath += sourceSets.test.output } } configurations { - testCompile.extendsFrom junit + javaToPythonJar - javaToPythonCompile.extendsFrom testCompile - pythonToJavaCompile.extendsFrom testCompile + testImplementation.extendsFrom junit - javaToPythonRuntime.extendsFrom testRuntime - pythonToJavaRuntime.extendsFrom testRuntime + javaToPythonImplementation.extendsFrom testImplementation + pythonToJavaImplementation.extendsFrom testImplementation + + javaToPythonRuntimeOnly.extendsFrom testRuntimeOnly + pythonToJavaRuntimeOnly.extendsFrom testRuntimeOnly } dependencies { // todo: consider running tests where JPY is *not* on the classpath, which is a completely acceptable use case - testCompile project(':deephaven-jpy-ext') - javaToPythonCompile sourceSets.test.output - pythonToJavaCompile sourceSets.test.output + testImplementation project(':deephaven-jpy-ext') + javaToPythonImplementation sourceSets.test.output + pythonToJavaImplementation sourceSets.test.output } test { @@ -65,7 +71,7 @@ task javaToPythonJar(type: Jar) { // And then we need to attach it to the appropriate configuration artifacts { - javaToPythonRuntime tasks.javaToPythonJar + javaToPythonJar tasks.javaToPythonJar } // must be explicit about marking these as test source directories in IntelliJ when not delegating builds to gradle diff --git a/python-engine-test/build.gradle b/python-engine-test/build.gradle index ae346e5e34b..3d64c3b822a 100644 --- a/python-engine-test/build.gradle +++ b/python-engine-test/build.gradle @@ -6,7 +6,7 @@ plugins { evaluationDependsOn ':docker-runtime-base' // runtimeBase configurations { - testCompile.extendsFrom fishIoTest + testImplementation.extendsFrom fishIoTest } test { @@ -15,27 +15,27 @@ test { } dependencies { - testCompile project(':CompilerTools'), - project(':engine-table'), - project(':Integrations'), - TestTools.projectDependency(project, 'engine-table') + testImplementation project(':CompilerTools') + testImplementation project(':engine-table') + testImplementation project(':Integrations') + testImplementation TestTools.projectDependency(project, 'engine-table') // This allows us to access jpy-integration javaToPython code around setting up python // for testing purposes - testCompile project.dependencies.project([ + testImplementation project.dependencies.project([ path: ':jpy-integration', - configuration: 'javaToPythonRuntime' + configuration: 'javaToPythonJar' ]) // needed for access to dh-tests.prop - testRuntime project(path: ':test-configs'), - project(path: ':configs'), - project(':Integrations'), - project(':engine-table') + testRuntimeOnly project(path: ':test-configs') + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(':Integrations') + testRuntimeOnly project(':engine-table') // todo: IDO-322 (io.deephaven.numerics.suanshu.SuanShuIntegration) - testRuntime project(':Numerics') - testRuntime project(':extensions-suanshu') + testRuntimeOnly project(':Numerics') + testRuntimeOnly project(':extensions-suanshu') } def gradleWrapper = tasks.register("dockerGradleInit", Wrapper.class) { wrapper -> diff --git a/replication/reflective/build.gradle b/replication/reflective/build.gradle index 5bca45d1d3d..3be3b465a72 100644 --- a/replication/reflective/build.gradle +++ b/replication/reflective/build.gradle @@ -6,13 +6,15 @@ plugins { description 'Reflective Replicators: Source code generators and replicators with compile-time dependencies on their inputs' dependencies { - implementation project(':replication-util'), - project(':engine-table'), - 'com.squareup:javapoet:1.9.0' + implementation project(':replication-util') + implementation project(':engine-table') + implementation 'com.squareup:javapoet:1.9.0' + implementation depTrove3 + implementation depCommonsIo - runtimeOnly project(':log-to-slf4j'), - project(path: ':configs'), - project(path: ':test-configs') + runtimeOnly project(':log-to-slf4j') + runtimeOnly project(path: ':configs') + runtimeOnly project(path: ':test-configs') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'runtimeOnly') } diff --git a/replication/static/build.gradle b/replication/static/build.gradle index 538f5c34d6f..fa0a48531f3 100644 --- a/replication/static/build.gradle +++ b/replication/static/build.gradle @@ -6,9 +6,11 @@ plugins { description 'Static Replicators: Source code generators and replicators with no compile-time dependency on their inputs' dependencies { - implementation project(':Util'), - project(':replication-util'), - 'commons-io:commons-io:2.5' + implementation project(':Util') + implementation project(':Base') + implementation project(':replication-util') + implementation depTrove3 + implementation depCommonsIo } // These replicators do not require any manual fix-up and may be run without supervision diff --git a/server/build.gradle b/server/build.gradle index 5363e44c9e0..cc245a6a801 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -10,6 +10,12 @@ dependencies { implementation project(':extensions-jdbc') implementation project(':Util'); implementation project(':Integrations') + implementation project(':FishUtil') + implementation depCommonsLang3 + Classpaths.inheritCommonsText(project, 'implementation') + + Classpaths.inheritJavaParser(project, 'implementation') + implementation project(':open-api-lang-parser') api(project(':java-client-barrage-dagger')) { because 'downstream dagger compile, see deephaven-core#1722' @@ -18,7 +24,9 @@ dependencies { implementation project(':proto:proto-backplane-grpc-flight') implementation project(':open-api-lang-tools') - implementation project(':log-factory') + api(project(':log-factory')) { + because 'downstream dagger compile, see deephaven-core#1722' + } Classpaths.inheritSlf4j(project, 'jul-to-slf4j', 'implementation') api(project(':application-mode')) { because 'downstream dagger compile, see deephaven-core#1722' diff --git a/server/test/build.gradle b/server/test/build.gradle index 2cc7215e05d..d504f26b071 100644 --- a/server/test/build.gradle +++ b/server/test/build.gradle @@ -11,12 +11,13 @@ dependencies { implementation project(':proto:proto-backplane-grpc-flight') implementation project(':extensions-barrage') implementation project(':test-configs') + implementation depCommonsLang3 Classpaths.inheritArrow(project, 'flight-core', 'implementation') Classpaths.inheritDagger(project) // Classpaths.inheritJUnitPlatform(project, 'api') - Classpaths.inheritJUnitClassic(project, false, 'implementation') + Classpaths.inheritJUnitClassic(project, 'implementation') } \ No newline at end of file diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index ee83350017a..ad13c9bb99c 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -1,18 +1,19 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } apply from: "$rootDir/gradle/web-client.gradle" dependencies { - compile project(':web-shared-beans') - compile project(':web-client-backplane') + api project(':web-shared-beans') + implementation project(':web-client-backplane') - compile 'com.vertispan.nio:gwt-nio:1.0-alpha-1' + api 'com.vertispan.nio:gwt-nio:1.0-alpha-1' } -Classpaths.inheritElemental project, 'elemental2-core' -Classpaths.inheritElemental project, 'elemental2-promise' -Classpaths.inheritElemental project, 'elemental2-dom' +Classpaths.inheritElemental(project, 'elemental2-core', 'api') +Classpaths.inheritElemental(project, 'elemental2-promise', 'api') +Classpaths.inheritElemental(project, 'elemental2-dom', 'api') GwtTools.gwtLib project diff --git a/web/client-backplane/client-backplane.gradle b/web/client-backplane/client-backplane.gradle index 6731349a18a..789e55560d8 100644 --- a/web/client-backplane/client-backplane.gradle +++ b/web/client-backplane/client-backplane.gradle @@ -8,7 +8,7 @@ evaluationDependsOn ':proto:proto-backplane-grpc' apply from: "$rootDir/gradle/web-common.gradle" GwtTools.gwtLib project -Classpaths.inheritJsInterop project -Classpaths.inheritJsInterop project, 'jsinterop-annotations' -Classpaths.inheritElemental project -Classpaths.inheritElemental project, 'elemental2-promise' \ No newline at end of file +Classpaths.inheritJsInterop(project, 'base', 'implementation') +Classpaths.inheritJsInterop(project, 'jsinterop-annotations', 'compileOnly') +Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') +Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') \ No newline at end of file diff --git a/web/client-ide/client-ide.gradle b/web/client-ide/client-ide.gradle index 44990698850..d02c52f48bb 100644 --- a/web/client-ide/client-ide.gradle +++ b/web/client-ide/client-ide.gradle @@ -12,8 +12,8 @@ configurations { } dependencies { - compile project(':web-client-api') - compile project(':open-api-lang-parser') + implementation project(':web-client-api') + implementation project(':open-api-lang-parser') js project(path: ':proto:raw-js-openapi', configuration: 'js') } diff --git a/web/shared-beans/shared-beans.gradle b/web/shared-beans/shared-beans.gradle index 72f937808ce..a2fe2cd9ac5 100644 --- a/web/shared-beans/shared-beans.gradle +++ b/web/shared-beans/shared-beans.gradle @@ -1,5 +1,6 @@ plugins { id 'io.deephaven.project.register' + id 'java-library' } apply from: "$rootDir/gradle/web-common.gradle" @@ -7,19 +8,19 @@ apply from: "$rootDir/gradle/web-common.gradle" GwtTools.gwtLib project configurations { - testCompile.extendsFrom junit + testImplementation.extendsFrom junit } dependencies { - compile project(':open-api-shared-fu') + api project(':open-api-shared-fu') - testCompile 'com.google.guava:guava:19.0' + testImplementation 'com.google.guava:guava:19.0' } // non-transitive dependency -Classpaths.inheritGwt project +Classpaths.inheritGwt project, 'gwt-user', 'compileOnly' // upgrade inherited dependencies to become transitive -Classpaths.inheritJsInterop project, 'jsinterop-annotations' -Classpaths.inheritJavaxAnnotations project -Classpaths.inheritElemental project, 'elemental2-core' +Classpaths.inheritJsInterop(project, 'jsinterop-annotations', 'compileOnly') +Classpaths.inheritJavaxAnnotations(project, 'compileOnly') +Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') From 1f7da539e841da8ece0ed97f00f078da733e955f Mon Sep 17 00:00:00 2001 From: SuperTails Date: Mon, 1 Aug 2022 16:38:50 -0600 Subject: [PATCH 057/215] Fixed a race condition in one of the examples (#2706) --- go/pkg/client/example_input_table_test.go | 45 ++++++++++++++++++----- go/pkg/client/flight_stub.go | 2 +- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/go/pkg/client/example_input_table_test.go b/go/pkg/client/example_input_table_test.go index 0f093d0c3b3..1b2bfd9f7aa 100644 --- a/go/pkg/client/example_input_table_test.go +++ b/go/pkg/client/example_input_table_test.go @@ -3,6 +3,7 @@ package client_test import ( "context" "fmt" + "time" "github.com/apache/arrow/go/v8/arrow" "github.com/deephaven/deephaven-core/go/internal/test_tools" @@ -81,17 +82,41 @@ func Example_inputTable() { return } - // Now, we take a snapshot of the outputTable to see what data it currently contains. - // We should see the new rows we added, filtered by the condition we specified when creating outputTable. - outputRec, err := outputTable.Snapshot(ctx) - if err != nil { - fmt.Println("error when snapshotting table", err.Error()) - return - } - defer outputRec.Release() + // Changes made to an input table may not propogate to other tables immediately. + // Thus, we need to check the output in a loop to see if our output table has updated. + // In a future version of the API, streaming table updates will make this kind of check unnecessary. + timeout := time.After(time.Second * 5) + for { + // If this loop is still running after five seconds, + // it will terminate because of this timer. + select { + case <-timeout: + fmt.Println("the output table did not update in time") + return + default: + } - fmt.Println("Got the output table!") - fmt.Println(outputRec) + // Now, we take a snapshot of the outputTable to see what data it currently contains. + // We should see the new rows we added, filtered by the condition we specified when creating outputTable. + // However, we might just see an empty table if the new rows haven't been processed yet. + outputRec, err := outputTable.Snapshot(ctx) + if err != nil { + fmt.Println("error when snapshotting table", err.Error()) + return + } + + if outputRec.NumRows() == 0 { + // The new rows we added haven't propogated to the output table yet. + // We just discard this record and snapshot again. + outputRec.Release() + continue + } + + fmt.Println("Got the output table!") + fmt.Println(outputRec) + outputRec.Release() + break + } // Output: // Got the output table! diff --git a/go/pkg/client/flight_stub.go b/go/pkg/client/flight_stub.go index 27023cc2a04..c2eb98fdf00 100644 --- a/go/pkg/client/flight_stub.go +++ b/go/pkg/client/flight_stub.go @@ -54,10 +54,10 @@ func (fs *flightStub) snapshotRecord(ctx context.Context, ticket *ticketpb2.Tick defer req.CloseSend() reader, err := flight.NewRecordReader(req) - defer reader.Release() if err != nil { return nil, err } + defer reader.Release() rec1, err := reader.Read() if err != nil { From 1205dce94efbbf42243a0cd108de1a31c8d10e0a Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Tue, 2 Aug 2022 12:23:42 -0400 Subject: [PATCH 058/215] Move the "flatbuffers" library to a "private" namespace and create (#2708) the namespace alias "flatbuffers". The advantage of this approach is that the calling code doesn't know any better and can just access it as "flatbuffers". --- .../deephaven/flatbuf/Barrage_generated.h | 438 +++++++++--------- .../client/subscription/index_decoder.h | 2 - .../third_party/flatbuffers/allocator.h | 5 + .../client/third_party/flatbuffers/array.h | 5 + .../client/third_party/flatbuffers/base.h | 8 +- .../client/third_party/flatbuffers/buffer.h | 4 + .../third_party/flatbuffers/buffer_ref.h | 4 + .../flatbuffers/default_allocator.h | 4 + .../third_party/flatbuffers/detached_buffer.h | 4 + .../flatbuffers/flatbuffer_builder.h | 6 +- .../third_party/flatbuffers/flatbuffers.h | 4 + .../third_party/flatbuffers/stl_emulation.h | 4 + .../client/third_party/flatbuffers/string.h | 4 + .../client/third_party/flatbuffers/struct.h | 4 + .../client/third_party/flatbuffers/table.h | 4 + .../client/third_party/flatbuffers/util.h | 4 + .../client/third_party/flatbuffers/vector.h | 4 + .../third_party/flatbuffers/vector_downward.h | 4 + .../client/third_party/flatbuffers/verifier.h | 4 + 19 files changed, 292 insertions(+), 224 deletions(-) diff --git a/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h b/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h index 847ef655f13..c93ea9082ad 100644 --- a/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h +++ b/cpp-client/deephaven/client/flatbuf/deephaven/flatbuf/Barrage_generated.h @@ -97,7 +97,7 @@ inline const char * const *EnumNamesBarrageMessageType() { } inline const char *EnumNameBarrageMessageType(BarrageMessageType e) { - if (::deephaven::third_party::flatbuffers::IsOutRange(e, BarrageMessageType_None, BarrageMessageType_BarragePublicationRequest)) return ""; + if (flatbuffers::IsOutRange(e, BarrageMessageType_None, BarrageMessageType_BarragePublicationRequest)) return ""; const size_t index = static_cast(e); return EnumNamesBarrageMessageType()[index]; } @@ -134,13 +134,13 @@ inline const char * const *EnumNamesColumnConversionMode() { } inline const char *EnumNameColumnConversionMode(ColumnConversionMode e) { - if (::deephaven::third_party::flatbuffers::IsOutRange(e, ColumnConversionMode_Stringify, ColumnConversionMode_ThrowError)) return ""; + if (flatbuffers::IsOutRange(e, ColumnConversionMode_Stringify, ColumnConversionMode_ThrowError)) return ""; const size_t index = static_cast(e) - static_cast(ColumnConversionMode_Stringify); return EnumNamesColumnConversionMode()[index]; } /// The message wrapper used for all barrage app_metadata fields. -struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageMessageWrapperBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MAGIC = 4, @@ -157,10 +157,10 @@ struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private ::deephaven::thir return static_cast(GetField(VT_MSG_TYPE, 0)); } /// The msg payload. - const ::deephaven::third_party::flatbuffers::Vector *msg_payload() const { - return GetPointer *>(VT_MSG_PAYLOAD); + const flatbuffers::Vector *msg_payload() const { + return GetPointer *>(VT_MSG_PAYLOAD); } - bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_MAGIC, 4) && VerifyField(verifier, VT_MSG_TYPE, 1) && @@ -172,33 +172,33 @@ struct BarrageMessageWrapper FLATBUFFERS_FINAL_CLASS : private ::deephaven::thir struct BarrageMessageWrapperBuilder { typedef BarrageMessageWrapper Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_magic(uint32_t magic) { fbb_.AddElement(BarrageMessageWrapper::VT_MAGIC, magic, 0); } void add_msg_type(io::deephaven::barrage::flatbuf::BarrageMessageType msg_type) { fbb_.AddElement(BarrageMessageWrapper::VT_MSG_TYPE, static_cast(msg_type), 0); } - void add_msg_payload(::deephaven::third_party::flatbuffers::Offset<::deephaven::third_party::flatbuffers::Vector> msg_payload) { + void add_msg_payload(flatbuffers::Offset> msg_payload) { fbb_.AddOffset(BarrageMessageWrapper::VT_MSG_PAYLOAD, msg_payload); } - explicit BarrageMessageWrapperBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageMessageWrapperBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageMessageWrapper( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageMessageWrapper( + flatbuffers::FlatBufferBuilder &_fbb, uint32_t magic = 0, io::deephaven::barrage::flatbuf::BarrageMessageType msg_type = io::deephaven::barrage::flatbuf::BarrageMessageType_None, - ::deephaven::third_party::flatbuffers::Offset<::deephaven::third_party::flatbuffers::Vector> msg_payload = 0) { + flatbuffers::Offset> msg_payload = 0) { BarrageMessageWrapperBuilder builder_(_fbb); builder_.add_msg_payload(msg_payload); builder_.add_magic(magic); @@ -206,8 +206,8 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageMessageWrapperDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageMessageWrapperDirect( + flatbuffers::FlatBufferBuilder &_fbb, uint32_t magic = 0, io::deephaven::barrage::flatbuf::BarrageMessageType msg_type = io::deephaven::barrage::flatbuf::BarrageMessageType_None, const std::vector *msg_payload = nullptr) { @@ -220,7 +220,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea } /// Establish a new session. -struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef NewSessionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_PROTOCOL_VERSION = 4, @@ -231,10 +231,10 @@ struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_pa return GetField(VT_PROTOCOL_VERSION, 0); } /// Arbitrary auth/handshake info. - const ::deephaven::third_party::flatbuffers::Vector *payload() const { - return GetPointer *>(VT_PAYLOAD); + const flatbuffers::Vector *payload() const { + return GetPointer *>(VT_PAYLOAD); } - bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_PROTOCOL_VERSION, 4) && VerifyOffset(verifier, VT_PAYLOAD) && @@ -245,37 +245,37 @@ struct NewSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_pa struct NewSessionRequestBuilder { typedef NewSessionRequest Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_protocol_version(uint32_t protocol_version) { fbb_.AddElement(NewSessionRequest::VT_PROTOCOL_VERSION, protocol_version, 0); } - void add_payload(::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> payload) { + void add_payload(flatbuffers::Offset> payload) { fbb_.AddOffset(NewSessionRequest::VT_PAYLOAD, payload); } - explicit NewSessionRequestBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit NewSessionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateNewSessionRequest( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateNewSessionRequest( + flatbuffers::FlatBufferBuilder &_fbb, uint32_t protocol_version = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> payload = 0) { + flatbuffers::Offset> payload = 0) { NewSessionRequestBuilder builder_(_fbb); builder_.add_payload(payload); builder_.add_protocol_version(protocol_version); return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateNewSessionRequestDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateNewSessionRequestDirect( + flatbuffers::FlatBufferBuilder &_fbb, uint32_t protocol_version = 0, const std::vector *payload = nullptr) { auto payload__ = payload ? _fbb.CreateVector(*payload) : 0; @@ -286,16 +286,16 @@ inline ::deephaven::third_party::flatbuffers::Offset CreateNe } /// Refresh the provided session. -struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef RefreshSessionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SESSION = 4 }; /// this session token is only required if it is the first request of a handshake rpc stream - const ::deephaven::third_party::flatbuffers::Vector *session() const { - return GetPointer *>(VT_SESSION); + const flatbuffers::Vector *session() const { + return GetPointer *>(VT_SESSION); } - bool Verify(::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_SESSION) && verifier.VerifyVector(session()) && @@ -305,32 +305,32 @@ struct RefreshSessionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::thir struct RefreshSessionRequestBuilder { typedef RefreshSessionRequest Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_session (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_session(flatbuffers::Offset> session) { fbb_.AddOffset(RefreshSessionRequest::VT_SESSION, session); } - explicit RefreshSessionRequestBuilder(::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit RefreshSessionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateRefreshSessionRequest( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session = 0) { +inline flatbuffers::Offset CreateRefreshSessionRequest( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> session = 0) { RefreshSessionRequestBuilder builder_(_fbb); builder_.add_session(session); return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateRefreshSessionRequestDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateRefreshSessionRequestDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *session = nullptr) { auto session__ = session ? _fbb.CreateVector(*session) : 0; return io::deephaven::barrage::flatbuf::CreateRefreshSessionRequest( @@ -339,7 +339,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea } /// Information about the current session state. -struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef SessionInfoResponseBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_METADATA_HEADER = 4, @@ -347,18 +347,18 @@ struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_ VT_TOKEN_REFRESH_DEADLINE_MS = 8 }; /// this is the metadata header to identify this session with future requests; it must be lower-case and remain static for the life of the session - const ::deephaven::third_party::flatbuffers::Vector *metadata_header() const { - return GetPointer *>(VT_METADATA_HEADER); + const flatbuffers::Vector *metadata_header() const { + return GetPointer *>(VT_METADATA_HEADER); } /// this is the session_token; note that it may rotate - const ::deephaven::third_party::flatbuffers::Vector *session_token() const { - return GetPointer *>(VT_SESSION_TOKEN); + const flatbuffers::Vector *session_token() const { + return GetPointer *>(VT_SESSION_TOKEN); } /// a suggested time for the user to refresh the session if they do not do so earlier; value is denoted in milliseconds since epoch int64_t token_refresh_deadline_ms() const { return GetField(VT_TOKEN_REFRESH_DEADLINE_MS, 0); } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_METADATA_HEADER) && verifier.VerifyVector(metadata_header()) && @@ -371,32 +371,32 @@ struct SessionInfoResponse FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_ struct SessionInfoResponseBuilder { typedef SessionInfoResponse Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_metadata_header (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> metadata_header) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_metadata_header(flatbuffers::Offset> metadata_header) { fbb_.AddOffset(SessionInfoResponse::VT_METADATA_HEADER, metadata_header); } - void add_session_token (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session_token) { + void add_session_token(flatbuffers::Offset> session_token) { fbb_.AddOffset(SessionInfoResponse::VT_SESSION_TOKEN, session_token); } void add_token_refresh_deadline_ms(int64_t token_refresh_deadline_ms) { fbb_.AddElement(SessionInfoResponse::VT_TOKEN_REFRESH_DEADLINE_MS, token_refresh_deadline_ms, 0); } - explicit SessionInfoResponseBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit SessionInfoResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateSessionInfoResponse( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> metadata_header = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> session_token = 0, +inline flatbuffers::Offset CreateSessionInfoResponse( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> metadata_header = 0, + flatbuffers::Offset> session_token = 0, int64_t token_refresh_deadline_ms = 0) { SessionInfoResponseBuilder builder_(_fbb); builder_.add_token_refresh_deadline_ms(token_refresh_deadline_ms); @@ -405,8 +405,8 @@ inline ::deephaven::third_party::flatbuffers::Offset Create return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateSessionInfoResponseDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateSessionInfoResponseDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *metadata_header = nullptr, const std::vector *session_token = nullptr, int64_t token_refresh_deadline_ms = 0) { @@ -419,7 +419,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Create token_refresh_deadline_ms); } -struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageSubscriptionOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_COLUMN_CONVERSION_MODE = 4, @@ -449,7 +449,7 @@ struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven: int32_t batch_size() const { return GetField(VT_BATCH_SIZE, 0); } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && @@ -461,8 +461,8 @@ struct BarrageSubscriptionOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven: struct BarrageSubscriptionOptionsBuilder { typedef BarrageSubscriptionOptions Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_column_conversion_mode(io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode) { fbb_.AddElement(BarrageSubscriptionOptions::VT_COLUMN_CONVERSION_MODE, static_cast(column_conversion_mode), 1); } @@ -475,19 +475,19 @@ struct BarrageSubscriptionOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSubscriptionOptions::VT_BATCH_SIZE, batch_size, 0); } - explicit BarrageSubscriptionOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSubscriptionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionOptions( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageSubscriptionOptions( + flatbuffers::FlatBufferBuilder &_fbb, io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, int32_t min_update_interval_ms = 0, @@ -501,7 +501,7 @@ inline ::deephaven::third_party::flatbuffers::Offset } /// Describes the subscription the client would like to acquire. -struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageSubscriptionRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, @@ -511,16 +511,16 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven: VT_REVERSE_VIEWPORT = 12 }; /// Ticket for the source data set. - const ::deephaven::third_party::flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// The bitset of columns to subscribe. If not provided then all columns are subscribed. - const ::deephaven::third_party::flatbuffers::Vector *columns() const { - return GetPointer *>(VT_COLUMNS); + const flatbuffers::Vector *columns() const { + return GetPointer *>(VT_COLUMNS); } /// This is an encoded and compressed RowSet in position-space to subscribe to. - const ::deephaven::third_party::flatbuffers::Vector *viewport() const { - return GetPointer *>(VT_VIEWPORT); + const flatbuffers::Vector *viewport() const { + return GetPointer *>(VT_VIEWPORT); } /// Options to configure your subscription. const io::deephaven::barrage::flatbuf::BarrageSubscriptionOptions *subscription_options() const { @@ -531,7 +531,7 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven: bool reverse_viewport() const { return GetField(VT_REVERSE_VIEWPORT, 0) != 0; } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -548,40 +548,40 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven: struct BarrageSubscriptionRequestBuilder { typedef BarrageSubscriptionRequest Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_ticket(flatbuffers::Offset> ticket) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_TICKET, ticket); } - void add_columns (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns) { + void add_columns(flatbuffers::Offset> columns) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_COLUMNS, columns); } - void add_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport) { + void add_viewport(flatbuffers::Offset> viewport) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_VIEWPORT, viewport); } - void add_subscription_options (::deephaven::third_party::flatbuffers::Offset subscription_options) { + void add_subscription_options(flatbuffers::Offset subscription_options) { fbb_.AddOffset(BarrageSubscriptionRequest::VT_SUBSCRIPTION_OPTIONS, subscription_options); } void add_reverse_viewport(bool reverse_viewport) { fbb_.AddElement(BarrageSubscriptionRequest::VT_REVERSE_VIEWPORT, static_cast(reverse_viewport), 0); } - explicit BarrageSubscriptionRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSubscriptionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionRequest( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport = 0, - ::deephaven::third_party::flatbuffers::Offset subscription_options = 0, +inline flatbuffers::Offset CreateBarrageSubscriptionRequest( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> ticket = 0, + flatbuffers::Offset> columns = 0, + flatbuffers::Offset> viewport = 0, + flatbuffers::Offset subscription_options = 0, bool reverse_viewport = false) { BarrageSubscriptionRequestBuilder builder_(_fbb); builder_.add_subscription_options(subscription_options); @@ -592,12 +592,12 @@ inline ::deephaven::third_party::flatbuffers::Offset return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSubscriptionRequestDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageSubscriptionRequestDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, const std::vector *columns = nullptr, const std::vector *viewport = nullptr, - ::deephaven::third_party::flatbuffers::Offset subscription_options = 0, + flatbuffers::Offset subscription_options = 0, bool reverse_viewport = false) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; auto columns__ = columns ? _fbb.CreateVector(*columns) : 0; @@ -611,7 +611,7 @@ inline ::deephaven::third_party::flatbuffers::Offset reverse_viewport); } -struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageSnapshotOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_COLUMN_CONVERSION_MODE = 4, @@ -633,7 +633,7 @@ struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::thi int32_t batch_size() const { return GetField(VT_BATCH_SIZE, 0); } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && @@ -644,8 +644,8 @@ struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::thi struct BarrageSnapshotOptionsBuilder { typedef BarrageSnapshotOptions Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_column_conversion_mode(io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode) { fbb_.AddElement(BarrageSnapshotOptions::VT_COLUMN_CONVERSION_MODE, static_cast(column_conversion_mode), 1); } @@ -655,19 +655,19 @@ struct BarrageSnapshotOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSnapshotOptions::VT_BATCH_SIZE, batch_size, 0); } - explicit BarrageSnapshotOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSnapshotOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotOptions( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageSnapshotOptions( + flatbuffers::FlatBufferBuilder &_fbb, io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, int32_t batch_size = 0) { @@ -679,7 +679,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Cre } /// Describes the snapshot the client would like to acquire. -struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageSnapshotRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, @@ -689,17 +689,17 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::thi VT_REVERSE_VIEWPORT = 12 }; /// Ticket for the source data set. - const ::deephaven::third_party::flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// The bitset of columns to request. If not provided then all columns are requested. - const ::deephaven::third_party::flatbuffers::Vector *columns() const { - return GetPointer *>(VT_COLUMNS); + const flatbuffers::Vector *columns() const { + return GetPointer *>(VT_COLUMNS); } /// This is an encoded and compressed RowSet in position-space to subscribe to. If not provided then the entire /// table is requested. - const ::deephaven::third_party::flatbuffers::Vector *viewport() const { - return GetPointer *>(VT_VIEWPORT); + const flatbuffers::Vector *viewport() const { + return GetPointer *>(VT_VIEWPORT); } /// Options to configure your subscription. const io::deephaven::barrage::flatbuf::BarrageSnapshotOptions *snapshot_options() const { @@ -710,7 +710,7 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::thi bool reverse_viewport() const { return GetField(VT_REVERSE_VIEWPORT, 0) != 0; } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -727,40 +727,40 @@ struct BarrageSnapshotRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::thi struct BarrageSnapshotRequestBuilder { typedef BarrageSnapshotRequest Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_ticket(flatbuffers::Offset> ticket) { fbb_.AddOffset(BarrageSnapshotRequest::VT_TICKET, ticket); } - void add_columns (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns) { + void add_columns(flatbuffers::Offset> columns) { fbb_.AddOffset(BarrageSnapshotRequest::VT_COLUMNS, columns); } - void add_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport) { + void add_viewport(flatbuffers::Offset> viewport) { fbb_.AddOffset(BarrageSnapshotRequest::VT_VIEWPORT, viewport); } - void add_snapshot_options (::deephaven::third_party::flatbuffers::Offset snapshot_options) { + void add_snapshot_options(flatbuffers::Offset snapshot_options) { fbb_.AddOffset(BarrageSnapshotRequest::VT_SNAPSHOT_OPTIONS, snapshot_options); } void add_reverse_viewport(bool reverse_viewport) { fbb_.AddElement(BarrageSnapshotRequest::VT_REVERSE_VIEWPORT, static_cast(reverse_viewport), 0); } - explicit BarrageSnapshotRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageSnapshotRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotRequest( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> columns = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> viewport = 0, - ::deephaven::third_party::flatbuffers::Offset snapshot_options = 0, +inline flatbuffers::Offset CreateBarrageSnapshotRequest( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> ticket = 0, + flatbuffers::Offset> columns = 0, + flatbuffers::Offset> viewport = 0, + flatbuffers::Offset snapshot_options = 0, bool reverse_viewport = false) { BarrageSnapshotRequestBuilder builder_(_fbb); builder_.add_snapshot_options(snapshot_options); @@ -771,12 +771,12 @@ inline ::deephaven::third_party::flatbuffers::Offset Cre return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageSnapshotRequestDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageSnapshotRequestDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, const std::vector *columns = nullptr, const std::vector *viewport = nullptr, - ::deephaven::third_party::flatbuffers::Offset snapshot_options = 0, + flatbuffers::Offset snapshot_options = 0, bool reverse_viewport = false) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; auto columns__ = columns ? _fbb.CreateVector(*columns) : 0; @@ -790,7 +790,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Cre reverse_viewport); } -struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarragePublicationOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_USE_DEEPHAVEN_NULLS = 4 @@ -800,7 +800,7 @@ struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven:: bool use_deephaven_nulls() const { return GetField(VT_USE_DEEPHAVEN_NULLS, 0) != 0; } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && verifier.EndTable(); @@ -809,24 +809,24 @@ struct BarragePublicationOptions FLATBUFFERS_FINAL_CLASS : private ::deephaven:: struct BarragePublicationOptionsBuilder { typedef BarragePublicationOptions Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_use_deephaven_nulls(bool use_deephaven_nulls) { fbb_.AddElement(BarragePublicationOptions::VT_USE_DEEPHAVEN_NULLS, static_cast(use_deephaven_nulls), 0); } - explicit BarragePublicationOptionsBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarragePublicationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationOptions( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarragePublicationOptions( + flatbuffers::FlatBufferBuilder &_fbb, bool use_deephaven_nulls = false) { BarragePublicationOptionsBuilder builder_(_fbb); builder_.add_use_deephaven_nulls(use_deephaven_nulls); @@ -836,21 +836,21 @@ inline ::deephaven::third_party::flatbuffers::Offset /// Describes the table update stream the client would like to push to. This is similar to a DoPut but the client /// will send BarrageUpdateMetadata to explicitly describe the row key space. The updates sent adhere to the table /// update model semantics; thus BarragePublication enables the client to upload a ticking table. -struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarragePublicationRequestBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TICKET = 4, VT_PUBLISH_OPTIONS = 6 }; /// The destination Ticket. - const ::deephaven::third_party::flatbuffers::Vector *ticket() const { - return GetPointer *>(VT_TICKET); + const flatbuffers::Vector *ticket() const { + return GetPointer *>(VT_TICKET); } /// Options to configure your request. const io::deephaven::barrage::flatbuf::BarragePublicationOptions *publish_options() const { return GetPointer(VT_PUBLISH_OPTIONS); } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TICKET) && verifier.VerifyVector(ticket()) && @@ -862,39 +862,39 @@ struct BarragePublicationRequest FLATBUFFERS_FINAL_CLASS : private ::deephaven:: struct BarragePublicationRequestBuilder { typedef BarragePublicationRequest Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_ticket (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_ticket(flatbuffers::Offset> ticket) { fbb_.AddOffset(BarragePublicationRequest::VT_TICKET, ticket); } - void add_publish_options (::deephaven::third_party::flatbuffers::Offset publish_options) { + void add_publish_options(flatbuffers::Offset publish_options) { fbb_.AddOffset(BarragePublicationRequest::VT_PUBLISH_OPTIONS, publish_options); } - explicit BarragePublicationRequestBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarragePublicationRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationRequest( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> ticket = 0, - ::deephaven::third_party::flatbuffers::Offset publish_options = 0) { +inline flatbuffers::Offset CreateBarragePublicationRequest( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> ticket = 0, + flatbuffers::Offset publish_options = 0) { BarragePublicationRequestBuilder builder_(_fbb); builder_.add_publish_options(publish_options); builder_.add_ticket(ticket); return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarragePublicationRequestDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarragePublicationRequestDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *ticket = nullptr, - ::deephaven::third_party::flatbuffers::Offset publish_options = 0) { + flatbuffers::Offset publish_options = 0) { auto ticket__ = ticket ? _fbb.CreateVector(*ticket) : 0; return io::deephaven::barrage::flatbuf::CreateBarragePublicationRequest( _fbb, @@ -903,17 +903,17 @@ inline ::deephaven::third_party::flatbuffers::Offset } /// Holds all of the index data structures for the column being modified. -struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageModColumnMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MODIFIED_ROWS = 4 }; /// This is an encoded and compressed RowSet for this column (within the viewport) that were modified. /// There is no notification for modifications outside of the viewport. - const ::deephaven::third_party::flatbuffers::Vector *modified_rows() const { - return GetPointer *>(VT_MODIFIED_ROWS); + const flatbuffers::Vector *modified_rows() const { + return GetPointer *>(VT_MODIFIED_ROWS); } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MODIFIED_ROWS) && verifier.VerifyVector(modified_rows()) && @@ -923,32 +923,32 @@ struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::t struct BarrageModColumnMetadataBuilder { typedef BarrageModColumnMetadata Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; - void add_modified_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> modified_rows) { + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_modified_rows(flatbuffers::Offset> modified_rows) { fbb_.AddOffset(BarrageModColumnMetadata::VT_MODIFIED_ROWS, modified_rows); } - explicit BarrageModColumnMetadataBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageModColumnMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageModColumnMetadata( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> modified_rows = 0) { +inline flatbuffers::Offset CreateBarrageModColumnMetadata( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> modified_rows = 0) { BarrageModColumnMetadataBuilder builder_(_fbb); builder_.add_modified_rows(modified_rows); return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageModColumnMetadataDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageModColumnMetadataDirect( + flatbuffers::FlatBufferBuilder &_fbb, const std::vector *modified_rows = nullptr) { auto modified_rows__ = modified_rows ? _fbb.CreateVector(*modified_rows) : 0; return io::deephaven::barrage::flatbuf::CreateBarrageModColumnMetadata( @@ -958,7 +958,7 @@ inline ::deephaven::third_party::flatbuffers::Offset C /// A data header describing the shared memory layout of a "record" or "row" /// batch for a ticking barrage table. -struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::third_party::flatbuffers::Table { +struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageUpdateMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NUM_ADD_BATCHES = 4, @@ -998,41 +998,41 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::thir } /// If this is a snapshot and the subscription is a viewport, then the effectively subscribed viewport /// will be included in the payload. It is an encoded and compressed RowSet. - const ::deephaven::third_party::flatbuffers::Vector *effective_viewport() const { - return GetPointer *>(VT_EFFECTIVE_VIEWPORT); + const flatbuffers::Vector *effective_viewport() const { + return GetPointer *>(VT_EFFECTIVE_VIEWPORT); } /// If this is a snapshot, then the effectively subscribed column set will be included in the payload. - const ::deephaven::third_party::flatbuffers::Vector *effective_column_set() const { - return GetPointer *>(VT_EFFECTIVE_COLUMN_SET); + const flatbuffers::Vector *effective_column_set() const { + return GetPointer *>(VT_EFFECTIVE_COLUMN_SET); } /// This is an encoded and compressed RowSet that was added in this update. - const ::deephaven::third_party::flatbuffers::Vector *added_rows() const { - return GetPointer *>(VT_ADDED_ROWS); + const flatbuffers::Vector *added_rows() const { + return GetPointer *>(VT_ADDED_ROWS); } /// This is an encoded and compressed RowSet that was removed in this update. - const ::deephaven::third_party::flatbuffers::Vector *removed_rows() const { - return GetPointer *>(VT_REMOVED_ROWS); + const flatbuffers::Vector *removed_rows() const { + return GetPointer *>(VT_REMOVED_ROWS); } /// This is an encoded and compressed IndexShiftData describing how the keyspace of unmodified rows changed. - const ::deephaven::third_party::flatbuffers::Vector *shift_data() const { - return GetPointer *>(VT_SHIFT_DATA); + const flatbuffers::Vector *shift_data() const { + return GetPointer *>(VT_SHIFT_DATA); } /// This is an encoded and compressed RowSet that was included with this update. /// (the server may include rows not in addedRows if this is a viewport subscription to refresh /// unmodified rows that were scoped into view) - const ::deephaven::third_party::flatbuffers::Vector *added_rows_included() const { - return GetPointer *>(VT_ADDED_ROWS_INCLUDED); + const flatbuffers::Vector *added_rows_included() const { + return GetPointer *>(VT_ADDED_ROWS_INCLUDED); } /// The list of modified column data are in the same order as the field nodes on the schema. - const ::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset> *mod_column_nodes() const { - return GetPointer> *>(VT_MOD_COLUMN_NODES); + const flatbuffers::Vector> *mod_column_nodes() const { + return GetPointer> *>(VT_MOD_COLUMN_NODES); } /// When this is set the viewport RowSet will be inverted against the length of the table. That is to say /// every position value is converted from `i` to `n - i - 1` if the table has `n` rows. bool effective_reverse_viewport() const { return GetField(VT_EFFECTIVE_REVERSE_VIEWPORT, 0) != 0; } - bool Verify (::deephaven::third_party::flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_NUM_ADD_BATCHES, 2) && VerifyField(verifier, VT_NUM_MOD_BATCHES, 2) && @@ -1061,8 +1061,8 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private ::deephaven::thir struct BarrageUpdateMetadataBuilder { typedef BarrageUpdateMetadata Table; - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &fbb_; - ::deephaven::third_party::flatbuffers::uoffset_t start_; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; void add_num_add_batches(uint16_t num_add_batches) { fbb_.AddElement(BarrageUpdateMetadata::VT_NUM_ADD_BATCHES, num_add_batches, 0); } @@ -1078,55 +1078,55 @@ struct BarrageUpdateMetadataBuilder { void add_is_snapshot(bool is_snapshot) { fbb_.AddElement(BarrageUpdateMetadata::VT_IS_SNAPSHOT, static_cast(is_snapshot), 0); } - void add_effective_viewport (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_viewport) { + void add_effective_viewport(flatbuffers::Offset> effective_viewport) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_VIEWPORT, effective_viewport); } - void add_effective_column_set (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_column_set) { + void add_effective_column_set(flatbuffers::Offset> effective_column_set) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_COLUMN_SET, effective_column_set); } - void add_added_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows) { + void add_added_rows(flatbuffers::Offset> added_rows) { fbb_.AddOffset(BarrageUpdateMetadata::VT_ADDED_ROWS, added_rows); } - void add_removed_rows (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> removed_rows) { + void add_removed_rows(flatbuffers::Offset> removed_rows) { fbb_.AddOffset(BarrageUpdateMetadata::VT_REMOVED_ROWS, removed_rows); } - void add_shift_data (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> shift_data) { + void add_shift_data(flatbuffers::Offset> shift_data) { fbb_.AddOffset(BarrageUpdateMetadata::VT_SHIFT_DATA, shift_data); } - void add_added_rows_included (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows_included) { + void add_added_rows_included(flatbuffers::Offset> added_rows_included) { fbb_.AddOffset(BarrageUpdateMetadata::VT_ADDED_ROWS_INCLUDED, added_rows_included); } - void add_mod_column_nodes (::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset>> mod_column_nodes) { + void add_mod_column_nodes(flatbuffers::Offset>> mod_column_nodes) { fbb_.AddOffset(BarrageUpdateMetadata::VT_MOD_COLUMN_NODES, mod_column_nodes); } void add_effective_reverse_viewport(bool effective_reverse_viewport) { fbb_.AddElement(BarrageUpdateMetadata::VT_EFFECTIVE_REVERSE_VIEWPORT, static_cast(effective_reverse_viewport), 0); } - explicit BarrageUpdateMetadataBuilder (::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb) + explicit BarrageUpdateMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ::deephaven::third_party::flatbuffers::Offset Finish() { + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = ::deephaven::third_party::flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageUpdateMetadata( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageUpdateMetadata( + flatbuffers::FlatBufferBuilder &_fbb, uint16_t num_add_batches = 0, uint16_t num_mod_batches = 0, int64_t first_seq = 0, int64_t last_seq = 0, bool is_snapshot = false, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_viewport = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> effective_column_set = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> removed_rows = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> shift_data = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector> added_rows_included = 0, - ::deephaven::third_party::flatbuffers::Offset <::deephaven::third_party::flatbuffers::Vector <::deephaven::third_party::flatbuffers::Offset>> mod_column_nodes = 0, + flatbuffers::Offset> effective_viewport = 0, + flatbuffers::Offset> effective_column_set = 0, + flatbuffers::Offset> added_rows = 0, + flatbuffers::Offset> removed_rows = 0, + flatbuffers::Offset> shift_data = 0, + flatbuffers::Offset> added_rows_included = 0, + flatbuffers::Offset>> mod_column_nodes = 0, bool effective_reverse_viewport = false) { BarrageUpdateMetadataBuilder builder_(_fbb); builder_.add_last_seq(last_seq); @@ -1145,8 +1145,8 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea return builder_.Finish(); } -inline ::deephaven::third_party::flatbuffers::Offset CreateBarrageUpdateMetadataDirect( - ::deephaven::third_party::flatbuffers::FlatBufferBuilder &_fbb, +inline flatbuffers::Offset CreateBarrageUpdateMetadataDirect( + flatbuffers::FlatBufferBuilder &_fbb, uint16_t num_add_batches = 0, uint16_t num_mod_batches = 0, int64_t first_seq = 0, @@ -1158,7 +1158,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea const std::vector *removed_rows = nullptr, const std::vector *shift_data = nullptr, const std::vector *added_rows_included = nullptr, - const std::vector <::deephaven::third_party::flatbuffers::Offset> *mod_column_nodes = nullptr, + const std::vector> *mod_column_nodes = nullptr, bool effective_reverse_viewport = false) { auto effective_viewport__ = effective_viewport ? _fbb.CreateVector(*effective_viewport) : 0; auto effective_column_set__ = effective_column_set ? _fbb.CreateVector(*effective_column_set) : 0; @@ -1166,7 +1166,7 @@ inline ::deephaven::third_party::flatbuffers::Offset Crea auto removed_rows__ = removed_rows ? _fbb.CreateVector(*removed_rows) : 0; auto shift_data__ = shift_data ? _fbb.CreateVector(*shift_data) : 0; auto added_rows_included__ = added_rows_included ? _fbb.CreateVector(*added_rows_included) : 0; - auto mod_column_nodes__ = mod_column_nodes ? _fbb.CreateVector <::deephaven::third_party::flatbuffers::Offset>(*mod_column_nodes) : 0; + auto mod_column_nodes__ = mod_column_nodes ? _fbb.CreateVector>(*mod_column_nodes) : 0; return io::deephaven::barrage::flatbuf::CreateBarrageUpdateMetadata( _fbb, num_add_batches, diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h index b87035dc212..5709404f6ab 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/index_decoder.h @@ -7,8 +7,6 @@ #include #include "deephaven/client/container/row_sequence.h" -namespace flatbuffers = deephaven::third_party::flatbuffers; - namespace deephaven::client::subscription { constexpr const uint32_t deephavenMagicNumber = 0x6E687064U; diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h index 108f628d55e..5cffbd789f7 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h @@ -19,6 +19,11 @@ #include "flatbuffers/base.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; + namespace deephaven::third_party::flatbuffers { // Allocator interface. This is flatbuffers-specific and meant only for diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/array.h b/cpp-client/deephaven/client/third_party/flatbuffers/array.h index fb4863ceb51..e6506d591f1 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/array.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/array.h @@ -21,6 +21,11 @@ #include "flatbuffers/stl_emulation.h" #include "flatbuffers/vector.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; + namespace deephaven::third_party::flatbuffers { // This is used as a helper type for accessing arrays. diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/base.h b/cpp-client/deephaven/client/third_party/flatbuffers/base.h index 08b6af45370..534aa7161f7 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/base.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/base.h @@ -143,6 +143,10 @@ #define FLATBUFFERS_VERSION_REVISION 6 #define FLATBUFFERS_STRING_EXPAND(X) #X #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // Returns version as string "MAJOR.MINOR.REVISION". const char* FLATBUFFERS_VERSION(); @@ -154,7 +158,7 @@ namespace deephaven::third_party::flatbuffers { #define FLATBUFFERS_FINAL_CLASS final #define FLATBUFFERS_OVERRIDE override #define FLATBUFFERS_EXPLICIT_CPP11 explicit - #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : ::deephaven::third_party::flatbuffers::voffset_t + #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : flatbuffers::voffset_t #else #define FLATBUFFERS_FINAL_CLASS #define FLATBUFFERS_OVERRIDE @@ -326,7 +330,7 @@ typedef uint16_t voffset_t; typedef uintmax_t largest_scalar_t; // In 32bits, this evaluates to 2GB - 1 -#define FLATBUFFERS_MAX_BUFFER_SIZE ((1ULL << (sizeof(::deephaven::third_party::flatbuffers::soffset_t) * 8 - 1)) - 1) +#define FLATBUFFERS_MAX_BUFFER_SIZE ((1ULL << (sizeof(::flatbuffers::soffset_t) * 8 - 1)) - 1) // We support aligning the contents of buffers up to this size. #define FLATBUFFERS_MAX_ALIGNMENT 16 diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h index a0c2c76d818..d848509358b 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h @@ -19,6 +19,10 @@ #include "flatbuffers/base.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // Wrapper for uoffset_t to allow safe template specialization. diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h b/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h index 8f1b7b9bd49..a8d56017619 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h @@ -20,6 +20,10 @@ #include "flatbuffers/base.h" #include "flatbuffers/verifier.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // Convenient way to bundle a buffer and its length, to pass it around diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h index a567367677f..3b66f2a89d9 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h @@ -20,6 +20,10 @@ #include "flatbuffers/allocator.h" #include "flatbuffers/base.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // DefaultAllocator uses new/delete to allocate memory regions diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h index 6d878c53e93..bc10d7550a6 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h @@ -21,6 +21,10 @@ #include "flatbuffers/base.h" #include "flatbuffers/default_allocator.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // DetachedBuffer is a finished flatbuffer memory region, detached from its diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h index 430bc788ff7..fc23ef4e236 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h @@ -33,6 +33,10 @@ #include "flatbuffers/vector_downward.h" #include "flatbuffers/verifier.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // Converts a Field ID to a virtual table offset. @@ -1087,7 +1091,7 @@ class FlatBufferBuilder { /// @brief The length of a FlatBuffer file header. static const size_t kFileIdentifierLength = - ::deephaven::third_party::flatbuffers::kFileIdentifierLength; + ::flatbuffers::kFileIdentifierLength; protected: // You shouldn't really be copying instances of this class. diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h index d4f96801a86..48e58e6220e 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h @@ -33,6 +33,10 @@ #include "flatbuffers/vector_downward.h" #include "flatbuffers/verifier.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h b/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h index 11607a45be1..21f85d9b1be 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h @@ -56,6 +56,10 @@ #endif // defined(FLATBUFFERS_USE_STD_SPAN) // This header provides backwards compatibility for older versions of the STL. +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { #if defined(FLATBUFFERS_TEMPLATES_ALIASES) diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/string.h b/cpp-client/deephaven/client/third_party/flatbuffers/string.h index 8f2ff715b4b..2144a8e4748 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/string.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/string.h @@ -20,6 +20,10 @@ #include "flatbuffers/base.h" #include "flatbuffers/vector.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { struct String : public Vector { diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/struct.h b/cpp-client/deephaven/client/third_party/flatbuffers/struct.h index 1725b7151f2..916cee82f23 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/struct.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/struct.h @@ -19,6 +19,10 @@ #include "flatbuffers/base.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // "structs" are flat structures that do not have an offset table, thus diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/table.h b/cpp-client/deephaven/client/third_party/flatbuffers/table.h index 40a50221138..9ae42e1006b 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/table.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/table.h @@ -20,6 +20,10 @@ #include "flatbuffers/base.h" #include "flatbuffers/verifier.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // "tables" use an offset table (possibly shared) that allows fields to be diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/util.h b/cpp-client/deephaven/client/third_party/flatbuffers/util.h index 200f27a3eba..4ea15ac09fe 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/util.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/util.h @@ -33,6 +33,10 @@ #include +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // @locale-independent functions for ASCII characters set. diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector.h b/cpp-client/deephaven/client/third_party/flatbuffers/vector.h index d15c232127d..0d76b1603e9 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/vector.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/vector.h @@ -20,6 +20,10 @@ #include "flatbuffers/base.h" #include "flatbuffers/buffer.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { struct String; diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h b/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h index 7d719ced46d..f4de2b8c6cd 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h @@ -21,6 +21,10 @@ #include "flatbuffers/default_allocator.h" #include "flatbuffers/detached_buffer.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // This is a minimal replication of std::vector functionality, diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h b/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h index 1c170bd1077..3aec8ef7612 100644 --- a/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h +++ b/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h @@ -21,6 +21,10 @@ #include "flatbuffers/util.h" #include "flatbuffers/vector.h" +// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict +// with the flatbuffers namespace compiled into Arrow. +namespace deephaven::third_party::flatbuffers {} +namespace flatbuffers = deephaven::third_party::flatbuffers; namespace deephaven::third_party::flatbuffers { // Helper class to verify the integrity of a FlatBuffer From 8f754d15e208a4e0965e13c6543d0e37b3365bc2 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 2 Aug 2022 20:42:57 -0700 Subject: [PATCH 059/215] Bump to next version 0.16.0 (#2710) --- .github/workflows/build-ci.yml | 12 ++++++------ .../groovy/io.deephaven.common-conventions.gradle | 2 +- py/client/README.md | 2 +- py/client/pydeephaven/__init__.py | 2 +- py/client/setup.py | 2 +- py/server/deephaven/__init__.py | 2 +- server/jetty-app/README.md | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index c2eff49b35a..5bbb421b7bb 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -57,7 +57,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Docker meta server nltk @@ -71,7 +71,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Docker meta server pytorch @@ -85,7 +85,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Docker meta server sklearn @@ -99,7 +99,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Docker meta server tensorflow @@ -113,7 +113,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Docker meta server slim @@ -127,7 +127,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx diff --git a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle index df05ff667f1..80036eec3b1 100644 --- a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle @@ -4,7 +4,7 @@ plugins { } group = 'io.deephaven' -version = '0.15.0' +version = '0.16.0' if (!name.startsWith('deephaven-')) { archivesBaseName = "deephaven-${name}" diff --git a/py/client/README.md b/py/client/README.md index efd795101ef..c4ef5199f0a 100644 --- a/py/client/README.md +++ b/py/client/README.md @@ -35,7 +35,7 @@ $ python3 -m examples.demo_asof_join ``` ## Install ``` shell -$ pip3 install dist/pydeephaven-0.15.0-py3-none-any.whl +$ pip3 install dist/pydeephaven-0.16.0-py3-none-any.whl ``` ## Quick start diff --git a/py/client/pydeephaven/__init__.py b/py/client/pydeephaven/__init__.py index eae0facaf70..002cab8ddbc 100644 --- a/py/client/pydeephaven/__init__.py +++ b/py/client/pydeephaven/__init__.py @@ -30,4 +30,4 @@ from .constants import SortDirection, MatchRule from .query import Query -__version__ = "0.15.0" +__version__ = "0.16.0" diff --git a/py/client/setup.py b/py/client/setup.py index 389bf984c03..8a59d44288c 100644 --- a/py/client/setup.py +++ b/py/client/setup.py @@ -12,7 +12,7 @@ setup( name='pydeephaven', - version='0.15.0', + version='0.16.0', description='The Deephaven Python Client', long_description=README, long_description_content_type="text/markdown", diff --git a/py/server/deephaven/__init__.py b/py/server/deephaven/__init__.py index f60aae3125e..113f3ad7473 100644 --- a/py/server/deephaven/__init__.py +++ b/py/server/deephaven/__init__.py @@ -7,7 +7,7 @@ """ -__version__ = "0.15.0" +__version__ = "0.16.0" from deephaven_internal import jvm try: diff --git a/server/jetty-app/README.md b/server/jetty-app/README.md index bcb48491482..cfe7c35a388 100644 --- a/server/jetty-app/README.md +++ b/server/jetty-app/README.md @@ -24,17 +24,17 @@ be sure to first set `PYTHON_CONFIGURE_OPTS="--enabled-shared"`. ```shell $ python -m pip install --upgrade pip # First upgrade pip $ pip install wheel - $ export DEEPHAVEN_VERSION=0.15.0 # this should match the current version of your git repo + $ export DEEPHAVEN_VERSION=0.16.0 # this should match the current version of your git repo $ cd py/jpy $ export JAVA_HOME=/path/to/your/java/home # Customize this to fit your computer $ python setup.py bdist_wheel - $ pip install dist/deephaven_jpy-0.15.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform + $ pip install dist/deephaven_jpy-0.16.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform $ cd - $ cd Integrations/python $ python setup.py bdist_wheel - $ pip install dist/deephaven-0.15.0-py2.py3-none-any.whl + $ pip install dist/deephaven-0.16.0-py2.py3-none-any.whl $ cd - ``` From fb16821bc733b807973a4eeb342af7d9f4388a00 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 3 Aug 2022 09:23:31 -0700 Subject: [PATCH 060/215] Bump base images (#2709) --- docker/registry/go/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python-dev-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/slim-base/gradle.properties | 2 +- docker/registry/tensorflow-base/gradle.properties | 2 +- docker/server/src/main/server-nltk/requirements.txt | 6 +++--- .../server/src/main/server-pytorch/requirements.txt | 9 +++++---- .../server/src/main/server-sklearn/requirements.txt | 4 ++-- .../src/main/server-tensorflow/requirements.txt | 11 ++++++----- docker/server/src/main/server/requirements.txt | 4 ++-- go/internal/proto/application/application.pb.go | 2 +- go/internal/proto/console/console.pb.go | 2 +- go/internal/proto/inputtable/inputtable.pb.go | 2 +- go/internal/proto/object/object.pb.go | 2 +- .../proto/partitionedtable/partitionedtable.pb.go | 2 +- go/internal/proto/session/session.pb.go | 2 +- go/internal/proto/table/table.pb.go | 2 +- go/internal/proto/ticket/ticket.pb.go | 2 +- 24 files changed, 37 insertions(+), 35 deletions(-) diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties index 849cac8b49d..bb715ab9709 100644 --- a/docker/registry/go/gradle.properties +++ b/docker/registry/go/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=golang:1 -deephaven.registry.imageId=golang@sha256:9349ed889adb906efa5ebc06485fe1b6a12fb265a01c9266a137bb1352565560 +deephaven.registry.imageId=golang@sha256:538867fdf0bc58fe1b2e3b831c9e8c68e09c2a016ebfe240b8c14fca4284543b diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index 5e687bd621e..da2c35cd71d 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:426cb67547a0c6e8ac6dc3f3e7eddcdfa67adbb70a07bfc12f7439f41994f9e1 +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:f9f41e37bbaf98bbfcb7d5241d207b23df38c699df14c3753c280472a4dc46e4 diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index 9d16b4dfd03..bc1f1ad347b 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:a086a11f7780399837ea0465ac8a8e8f14f2b66fe5a110fe0c24644d53a103c5 +deephaven.registry.imageId=node@sha256:f327dab66058ad14f8bf3af97e871923307072e56dfdd48837f86b1b66a0b177 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 7943dcf7763..dec14b26955 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:aba4a855dfd723f6e68fd57b7d7b7289f5edeaafb30e71943e8e4d51517aa8b1 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:023505b4916e684c5ffea47ac420cd8fa4d89095fa6168b11b839cc2c2b380eb diff --git a/docker/registry/python-dev-base/gradle.properties b/docker/registry/python-dev-base/gradle.properties index 65fdf0aa774..c32681b7b98 100644 --- a/docker/registry/python-dev-base/gradle.properties +++ b/docker/registry/python-dev-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/python-dev-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:b4e20062c47609a8cb309b39120c27c8b9e6f57705e703c9a0bffc431dd930e5 +deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:693944fc2b52a476387232c784a8d902d75714ea0ceef678ab2c180f6fb0df2c diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index 42900dab302..a052deb37aa 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:c9d3b36fb3d635c4691f1f2f97dc140ecdaf0506b1e40d57cc8abd2e487570d3 +deephaven.registry.imageId=python@sha256:243d808efa708d54e461742bee944c17a586042488e98403ebf13b18e7a1bea1 diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index 1140afef1a7..2da38b671b5 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:80f9dfca3c1e62a10620e72836bd3b64040227071245a74af28496eb3060a2ea +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:73e6b9a1d8ae1b0a23f0972b385543123fef4e756338972ada21c440d636df4b diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index 240b07056b3..2744b9f820e 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:3055424dd6202b7866283e1e3e450096fb0f10fc5773f5d42fb514ee377b00ef +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:6beff88aa1fcd462c6523926b09da1fd12112e9006b60ab1317938583c9ab0e8 diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index bf61bf4f010..1877b7a2859 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:71b49ab3c915f6a8bee860bebbdbda4e195b22f983fabd2a4d4736636600c1c5 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:4dc470bfedc389589510f8120bb464ff38a6a924ee190dff1fc961c7c54d6b65 diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index cb72474be62..018fccd71d8 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:2879266cccb1080e966a9a681f86b0519db86096be348b3460235fc95c4973aa +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:a7b08b7de1f3ca89dca7008e416871c33386afc25138d3f0d4715d50573d73ac diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index e2fc6ce0320..736c65a61e9 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:079891f41c08de846b3572304b372f969a3d20ec5ef0a45d8ee9781a8a7afc58 +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:573446ca74ba701f3a8013a8af8b42239559237f7f442915e8d3aaa5bef8e88f diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk/requirements.txt index f12a5d343b6..c15fec7e95a 100644 --- a/docker/server/src/main/server-nltk/requirements.txt +++ b/docker/server/src/main/server-nltk/requirements.txt @@ -3,14 +3,14 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 joblib==1.1.0 jpy==0.11.0 -llvmlite==0.38.1 +llvmlite==0.39.0 nltk==3.6.7 -numba==0.55.2 +numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.1 -regex==2022.7.9 +regex==2022.7.25 six==1.16.0 tqdm==4.64.0 typing_extensions==4.3.0 diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch/requirements.txt index e11eb2c73bf..70071cef78d 100644 --- a/docker/server/src/main/server-pytorch/requirements.txt +++ b/docker/server/src/main/server-pytorch/requirements.txt @@ -9,9 +9,10 @@ grpcio==1.47.0 idna==3.3 importlib-metadata==4.12.0 jpy==0.11.0 -llvmlite==0.38.1 +llvmlite==0.39.0 Markdown==3.4.1 -numba==0.55.2 +MarkupSafe==2.1.1 +numba==0.56.0 numpy==1.21.6 oauthlib==3.2.0 pandas==1.3.5 @@ -29,6 +30,6 @@ tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 torch==1.10.2 typing_extensions==4.3.0 -urllib3==1.26.10 -Werkzeug==2.1.2 +urllib3==1.26.11 +Werkzeug==2.2.1 zipp==3.8.1 diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn/requirements.txt index c5627377c9c..30f6783b03d 100644 --- a/docker/server/src/main/server-sklearn/requirements.txt +++ b/docker/server/src/main/server-sklearn/requirements.txt @@ -2,8 +2,8 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 joblib==1.1.0 jpy==0.11.0 -llvmlite==0.38.1 -numba==0.55.2 +llvmlite==0.39.0 +numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow/requirements.txt index 1d9c082c5e0..34bddbadd03 100644 --- a/docker/server/src/main/server-tensorflow/requirements.txt +++ b/docker/server/src/main/server-tensorflow/requirements.txt @@ -16,10 +16,11 @@ importlib-metadata==4.12.0 jpy==0.11.0 keras==2.7.0 Keras-Preprocessing==1.1.2 -libclang==14.0.1 -llvmlite==0.38.1 +libclang==14.0.6 +llvmlite==0.39.0 Markdown==3.4.1 -numba==0.55.2 +MarkupSafe==2.1.1 +numba==0.56.0 numpy==1.21.6 oauthlib==3.2.0 opt-einsum==3.3.0 @@ -41,7 +42,7 @@ tensorflow-estimator==2.7.0 tensorflow-io-gcs-filesystem==0.26.0 termcolor==1.1.0 typing_extensions==4.3.0 -urllib3==1.26.10 -Werkzeug==2.1.2 +urllib3==1.26.11 +Werkzeug==2.2.1 wrapt==1.14.1 zipp==3.8.1 diff --git a/docker/server/src/main/server/requirements.txt b/docker/server/src/main/server/requirements.txt index 67263717353..4348b50d9e9 100644 --- a/docker/server/src/main/server/requirements.txt +++ b/docker/server/src/main/server/requirements.txt @@ -1,8 +1,8 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 jpy==0.11.0 -llvmlite==0.38.1 -numba==0.55.2 +llvmlite==0.39.0 +numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 diff --git a/go/internal/proto/application/application.pb.go b/go/internal/proto/application/application.pb.go index debf7307af3..7695d792617 100644 --- a/go/internal/proto/application/application.pb.go +++ b/go/internal/proto/application/application.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/application.proto diff --git a/go/internal/proto/console/console.pb.go b/go/internal/proto/console/console.pb.go index 8e93eaa9be5..78c38314f1b 100644 --- a/go/internal/proto/console/console.pb.go +++ b/go/internal/proto/console/console.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/console.proto diff --git a/go/internal/proto/inputtable/inputtable.pb.go b/go/internal/proto/inputtable/inputtable.pb.go index 417f734b3de..71de33f5720 100644 --- a/go/internal/proto/inputtable/inputtable.pb.go +++ b/go/internal/proto/inputtable/inputtable.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/inputtable.proto diff --git a/go/internal/proto/object/object.pb.go b/go/internal/proto/object/object.pb.go index f4316089e54..730f3d275d4 100644 --- a/go/internal/proto/object/object.pb.go +++ b/go/internal/proto/object/object.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/object.proto diff --git a/go/internal/proto/partitionedtable/partitionedtable.pb.go b/go/internal/proto/partitionedtable/partitionedtable.pb.go index 8ac9b13e287..acd73e47a95 100644 --- a/go/internal/proto/partitionedtable/partitionedtable.pb.go +++ b/go/internal/proto/partitionedtable/partitionedtable.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/partitionedtable.proto diff --git a/go/internal/proto/session/session.pb.go b/go/internal/proto/session/session.pb.go index 74847a3b946..58ae9c1ee25 100644 --- a/go/internal/proto/session/session.pb.go +++ b/go/internal/proto/session/session.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/session.proto diff --git a/go/internal/proto/table/table.pb.go b/go/internal/proto/table/table.pb.go index 62de901dabc..ac72857ca7d 100644 --- a/go/internal/proto/table/table.pb.go +++ b/go/internal/proto/table/table.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/table.proto diff --git a/go/internal/proto/ticket/ticket.pb.go b/go/internal/proto/ticket/ticket.pb.go index ccdec5d69ff..692f8798833 100644 --- a/go/internal/proto/ticket/ticket.pb.go +++ b/go/internal/proto/ticket/ticket.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.17.3 // source: deephaven/proto/ticket.proto From cdf665abffe65213048f5d9281df0fbe6a13d96c Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Mon, 8 Aug 2022 11:45:28 -0400 Subject: [PATCH 061/215] Update web version to v0.15.4 (#2711) https://github.com/deephaven/web-client-ui/releases/tag/v0.15.4 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index b34ff3c7aa6..2bb5c7b4224 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.15.2 +ARG WEB_VERSION=0.15.4 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 3c52a531ef328d61da13190c5c7972d744395a5a Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Mon, 8 Aug 2022 16:04:21 -0400 Subject: [PATCH 062/215] Eliminate a race that could cause BaseArrayBackedMutableTable.waitForSequence to hang when there are concurrent updates (#2722) --- .../util/BaseArrayBackedMutableTable.java | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java index 5473a32870c..f95eb21bc5e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java @@ -27,23 +27,32 @@ import java.io.IOException; import java.util.*; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; abstract class BaseArrayBackedMutableTable extends UpdatableTable { private static final Object[] BOOLEAN_ENUM_ARRAY = new Object[] {true, false, null}; - private final List pendingChanges = Collections.synchronizedList(new ArrayList<>()); - private final AtomicLong nextSequence = new AtomicLong(0); - private final AtomicLong processedSequence = new AtomicLong(0); + /** + * Queue of pending changes. Only synchronized access is permitted. + */ + private final List pendingChanges = new ArrayList<>(); + /** The most recently enqueue change sequence. Only accessed under the monitor lock for {@code pendingChanges}. */ + private long enqueuedSequence = 0L; + /** + * The most recently processed change sequence. Only written under both the monitor lock for + * {@code pendingChanges} and from an update thread. Only read under either the UPG's exclusive lock or the + * monitor lock on {@code pendingChanges}. + */ + private long processedSequence = 0L; + private final Map enumValues; private String description = getDefaultDescription(); private Runnable onPendingChange = () -> UpdateGraphProcessor.DEFAULT.requestRefresh(); long nextRow = 0; - private long pendingProcessed = NULL_NOTIFICATION_STEP; + private long pendingProcessed = -1L; public BaseArrayBackedMutableTable(TrackingRowSet rowSet, Map> nameToColumnSource, Map enumValues, ProcessPendingUpdater processPendingUpdater) { @@ -136,8 +145,8 @@ private void processPending(RowSetChangeRecorder rowSetChangeRecorder) { public void run() { super.run(); synchronized (pendingChanges) { - processedSequence.set(pendingProcessed); - pendingProcessed = NULL_NOTIFICATION_STEP; + processedSequence = pendingProcessed; + pendingProcessed = -1L; pendingChanges.notifyAll(); } } @@ -172,10 +181,11 @@ private final class PendingChange { String error; private PendingChange(Table table, boolean delete, boolean allowEdits) { + Assert.holdsLock(pendingChanges, "pendingChanges"); this.table = table; this.delete = delete; this.allowEdits = allowEdits; - this.sequence = nextSequence.incrementAndGet(); + this.sequence = ++enqueuedSequence; } } @@ -222,8 +232,12 @@ private PendingChange enqueueAddition(Table newData, boolean allowEdits) { validateAddOrModify(newData); // we want to get a clean copy of the table; that can not change out from under us or result in long reads // during our UGP run - final PendingChange pendingChange = new PendingChange(doSnap(newData), false, allowEdits); - pendingChanges.add(pendingChange); + final Table newDataSnapshot = doSnap(newData); + final PendingChange pendingChange; + synchronized (pendingChanges) { + pendingChange = new PendingChange(newDataSnapshot, false, allowEdits); + pendingChanges.add(pendingChange); + } onPendingChange.run(); return pendingChange; } @@ -243,10 +257,14 @@ private Table doSnap(Table newData) { } @Override - public void delete(Table table, TrackingRowSet rowSet) throws IOException { + public void delete(Table table, TrackingRowSet rowsToDelete) throws IOException { validateDelete(table); - final PendingChange pendingChange = new PendingChange(doSnap(table, rowSet), true, false); - pendingChanges.add(pendingChange); + final Table oldDataSnapshot = doSnap(table, rowsToDelete); + final PendingChange pendingChange; + synchronized (pendingChanges) { + pendingChange = new PendingChange(oldDataSnapshot, true, false); + pendingChanges.add(pendingChange); + } onPendingChange.run(); waitForSequence(pendingChange.sequence); @@ -264,7 +282,7 @@ void waitForSequence(long sequence) { if (UpdateGraphProcessor.DEFAULT.exclusiveLock().isHeldByCurrentThread()) { // We're holding the lock. currentTable had better be refreshing. Wait on its UGP condition // in order to allow updates. - while (processedSequence.longValue() < sequence) { + while (processedSequence < sequence) { try { BaseArrayBackedMutableTable.this.awaitUpdate(); } catch (InterruptedException ignored) { @@ -273,7 +291,7 @@ void waitForSequence(long sequence) { } else { // we are not holding the lock, so should wait for the next run synchronized (pendingChanges) { - while (processedSequence.longValue() < sequence) { + while (processedSequence < sequence) { try { pendingChanges.wait(); } catch (InterruptedException ignored) { From b71c9fbebe56879103aa20f9a98c06de6f118a04 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Tue, 9 Aug 2022 12:41:09 -0400 Subject: [PATCH 063/215] Preserve empty and key initializer table support for aggregations (#2719) * Add preserveEmpty and initialGroups to aggBy in TableOperations and QST, implemented in Table * Fix missing @ConcurrentMethod annotations in PartitionedTable * Delete legacy hash tables for aggregation * Delete legacy hash table replication code for updateBy * Remove option to disable bitmap builder for modifies in aggregation * Refactor row counting for incremental state managers to rely on an operator that implements StateChangeRecorder * New partitionedAggBy helper method in Table * Resurrect unit tests that used TableMap.populateKeys * Make it so ephemeral column source groups are actually cacheable until RowSet change --- .../main/java/io/deephaven/plot/AxesImpl.java | 2 +- .../deephaven/engine/table/ColumnSource.java | 5 - .../engine/table/PartitionedTable.java | 13 + .../java/io/deephaven/engine/table/Table.java | 42 +- .../table/impl/AbstractColumnSource.java | 15 + .../engine/table/impl/GroupingUtils.java | 23 + .../engine/table/impl/HierarchicalTable.java | 13 +- .../table/impl/MemoizedOperationKey.java | 57 +- .../engine/table/impl/QueryTable.java | 66 +- .../engine/table/impl/TableWithDefaults.java | 24 +- .../engine/table/impl/UncoalescedTable.java | 102 +- .../table/impl/by/AggregationContext.java | 14 + .../impl/by/AggregationContextFactory.java | 5 +- .../table/impl/by/AggregationControl.java | 11 +- .../table/impl/by/AggregationProcessor.java | 52 +- ...BaseAddOnlyFirstOrLastChunkedOperator.java | 5 +- .../BaseStreamFirstOrLastChunkedOperator.java | 4 +- .../impl/by/BasicStateChangeRecorder.java | 48 + .../by/ChunkedOperatorAggregationHelper.java | 491 +++-- .../impl/by/CountAggregationOperator.java | 77 +- .../impl/by/FirstOrLastChunkedOperator.java | 19 +- .../table/impl/by/FormulaChunkedOperator.java | 18 +- .../table/impl/by/GroupByChunkedOperator.java | 19 +- ...hunkedOperatorAggregationStateManager.java | 1791 ----------------- ...regationStateManagerOpenAddressedBase.java | 106 +- ...ratorAggregationStateManagerTypedBase.java | 194 +- ...mentalOperatorAggregationStateManager.java | 11 +- .../impl/by/NoopStateChangeRecorder.java | 18 + .../by/OperatorAggregationStateManager.java | 2 + ...tateManagerOpenAddressedAlternateBase.java | 36 +- ...regationStateManagerOpenAddressedBase.java | 5 + ...ratorAggregationStateManagerTypedBase.java | 5 + .../by/SortedFirstOrLastChunkedOperator.java | 11 +- .../table/impl/by/StateChangeRecorder.java | 24 + ...hunkedOperatorAggregationStateManager.java | 1414 ------------- .../by/typed/TypedAggregationFactory.java | 32 - .../impl/by/typed/TypedHasherFactory.java | 27 +- .../gen/IncrementalAggOpenHasherByte.java | 114 +- .../gen/IncrementalAggOpenHasherByteByte.java | 119 +- .../gen/IncrementalAggOpenHasherByteChar.java | 119 +- .../IncrementalAggOpenHasherByteDouble.java | 119 +- .../IncrementalAggOpenHasherByteFloat.java | 119 +- .../gen/IncrementalAggOpenHasherByteInt.java | 119 +- .../gen/IncrementalAggOpenHasherByteLong.java | 119 +- .../IncrementalAggOpenHasherByteObject.java | 119 +- .../IncrementalAggOpenHasherByteShort.java | 119 +- .../gen/IncrementalAggOpenHasherChar.java | 114 +- .../gen/IncrementalAggOpenHasherCharByte.java | 119 +- .../gen/IncrementalAggOpenHasherCharChar.java | 119 +- .../IncrementalAggOpenHasherCharDouble.java | 119 +- .../IncrementalAggOpenHasherCharFloat.java | 119 +- .../gen/IncrementalAggOpenHasherCharInt.java | 119 +- .../gen/IncrementalAggOpenHasherCharLong.java | 119 +- .../IncrementalAggOpenHasherCharObject.java | 119 +- .../IncrementalAggOpenHasherCharShort.java | 119 +- .../gen/IncrementalAggOpenHasherDouble.java | 114 +- .../IncrementalAggOpenHasherDoubleByte.java | 119 +- .../IncrementalAggOpenHasherDoubleChar.java | 119 +- .../IncrementalAggOpenHasherDoubleDouble.java | 119 +- .../IncrementalAggOpenHasherDoubleFloat.java | 119 +- .../IncrementalAggOpenHasherDoubleInt.java | 119 +- .../IncrementalAggOpenHasherDoubleLong.java | 119 +- .../IncrementalAggOpenHasherDoubleObject.java | 119 +- .../IncrementalAggOpenHasherDoubleShort.java | 119 +- .../gen/IncrementalAggOpenHasherFloat.java | 114 +- .../IncrementalAggOpenHasherFloatByte.java | 119 +- .../IncrementalAggOpenHasherFloatChar.java | 119 +- .../IncrementalAggOpenHasherFloatDouble.java | 119 +- .../IncrementalAggOpenHasherFloatFloat.java | 119 +- .../gen/IncrementalAggOpenHasherFloatInt.java | 119 +- .../IncrementalAggOpenHasherFloatLong.java | 119 +- .../IncrementalAggOpenHasherFloatObject.java | 119 +- .../IncrementalAggOpenHasherFloatShort.java | 119 +- .../gen/IncrementalAggOpenHasherInt.java | 114 +- .../gen/IncrementalAggOpenHasherIntByte.java | 119 +- .../gen/IncrementalAggOpenHasherIntChar.java | 119 +- .../IncrementalAggOpenHasherIntDouble.java | 119 +- .../gen/IncrementalAggOpenHasherIntFloat.java | 119 +- .../gen/IncrementalAggOpenHasherIntInt.java | 119 +- .../gen/IncrementalAggOpenHasherIntLong.java | 119 +- .../IncrementalAggOpenHasherIntObject.java | 119 +- .../gen/IncrementalAggOpenHasherIntShort.java | 119 +- .../gen/IncrementalAggOpenHasherLong.java | 114 +- .../gen/IncrementalAggOpenHasherLongByte.java | 119 +- .../gen/IncrementalAggOpenHasherLongChar.java | 119 +- .../IncrementalAggOpenHasherLongDouble.java | 119 +- .../IncrementalAggOpenHasherLongFloat.java | 119 +- .../gen/IncrementalAggOpenHasherLongInt.java | 119 +- .../gen/IncrementalAggOpenHasherLongLong.java | 119 +- .../IncrementalAggOpenHasherLongObject.java | 119 +- .../IncrementalAggOpenHasherLongShort.java | 119 +- .../gen/IncrementalAggOpenHasherObject.java | 114 +- .../IncrementalAggOpenHasherObjectByte.java | 119 +- .../IncrementalAggOpenHasherObjectChar.java | 119 +- .../IncrementalAggOpenHasherObjectDouble.java | 119 +- .../IncrementalAggOpenHasherObjectFloat.java | 119 +- .../IncrementalAggOpenHasherObjectInt.java | 119 +- .../IncrementalAggOpenHasherObjectLong.java | 119 +- .../IncrementalAggOpenHasherObjectObject.java | 119 +- .../IncrementalAggOpenHasherObjectShort.java | 119 +- .../gen/IncrementalAggOpenHasherShort.java | 114 +- .../IncrementalAggOpenHasherShortByte.java | 119 +- .../IncrementalAggOpenHasherShortChar.java | 119 +- .../IncrementalAggOpenHasherShortDouble.java | 119 +- .../IncrementalAggOpenHasherShortFloat.java | 119 +- .../gen/IncrementalAggOpenHasherShortInt.java | 119 +- .../IncrementalAggOpenHasherShortLong.java | 119 +- .../IncrementalAggOpenHasherShortObject.java | 119 +- .../IncrementalAggOpenHasherShortShort.java | 119 +- .../partitioned/PartitionedTableImpl.java | 13 + .../PartitionedTableProxyImpl.java | 22 +- .../table/impl/PartitionedTableTest.java | 75 +- .../table/impl/QueryTableAggregationTest.java | 129 +- .../engine/table/impl/TestPartitionBy.java | 29 +- .../client/impl/BatchTableRequestBuilder.java | 4 + .../io/deephaven/qst/TableAdapterImpl.java | 6 +- .../qst/table/AggregateAllByTable.java | 2 +- .../deephaven/qst/table/AggregationTable.java | 24 + .../io/deephaven/qst/table/ByTableBase.java | 2 +- .../io/deephaven/qst/table/CountByTable.java | 2 +- .../deephaven/qst/table/ParentsVisitor.java | 6 +- .../io/deephaven/qst/table/TableBase.java | 30 +- .../io/deephaven/qst/table/UpdateByTable.java | 2 +- .../replicators/ReplicateHashTable.java | 21 - .../io/deephaven/api/TableOperations.java | 93 +- .../deephaven/api/TableOperationsAdapter.java | 22 +- 126 files changed, 1434 insertions(+), 12377 deletions(-) create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/BasicStateChangeRecorder.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManager.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/NoopStateChangeRecorder.java create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/StateChangeRecorder.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/StaticChunkedOperatorAggregationStateManager.java diff --git a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java index f3e063e8884..9d7b70d8df7 100644 --- a/Plot/src/main/java/io/deephaven/plot/AxesImpl.java +++ b/Plot/src/main/java/io/deephaven/plot/AxesImpl.java @@ -281,7 +281,7 @@ private static SelectableDataSet getAggregatedSelectableDataSet(final Selectable final Collection aggs = aggSupplier.get(); final Collection columnNames = ColumnName.from(cols); final Function applyAggs = t -> t.aggBy(aggs, columnNames); - return sds.transform(MemoizedOperationKey.aggBy(aggs, columnNames), applyAggs); + return sds.transform(MemoizedOperationKey.aggBy(aggs, false, null, columnNames), applyAggs); } private static SelectableDataSet getLastBySelectableDataSet(final SelectableDataSet sds, final String... columns) { diff --git a/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java b/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java index 0793f4a8305..351d3667fae 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java @@ -110,11 +110,6 @@ default void releaseCachedResources() { ColumnSource reinterpret( @NotNull final Class alternateDataType) throws IllegalArgumentException; - @Override - default List getColumnSources() { - return Collections.singletonList(this); - } - @Override default T createTuple(final long rowKey) { return get(rowKey); diff --git a/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java b/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java index 882aee45f49..6d78dfa0e3f 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java @@ -9,6 +9,7 @@ import io.deephaven.base.log.LogOutputAppendable; import io.deephaven.engine.liveness.LivenessNode; import io.deephaven.engine.liveness.LivenessReferent; +import io.deephaven.engine.updategraph.ConcurrentMethod; import io.deephaven.util.annotations.FinalDefault; import org.jetbrains.annotations.NotNull; @@ -62,6 +63,7 @@ interface Proxy extends TableOperations> { * * @return The underlying {@link Table partitioned table} */ + @ConcurrentMethod Table table(); /** @@ -70,6 +72,7 @@ interface Proxy extends TableOperations> { * * @return The key column names */ + @ConcurrentMethod Set keyColumnNames(); /** @@ -82,6 +85,7 @@ interface Proxy extends TableOperations> { * * @return Whether the keys in the underlying partitioned table are unique */ + @ConcurrentMethod boolean uniqueKeys(); /** @@ -89,6 +93,7 @@ interface Proxy extends TableOperations> { * * @return The constituent column name */ + @ConcurrentMethod String constituentColumnName(); /** @@ -98,6 +103,7 @@ interface Proxy extends TableOperations> { * * @return The constituent definition */ + @ConcurrentMethod TableDefinition constituentDefinition(); /** @@ -115,6 +121,7 @@ interface Proxy extends TableOperations> { * * @return Whether the constituents of the underlying partitioned table can change */ + @ConcurrentMethod boolean constituentChangesPermitted(); /** @@ -125,6 +132,7 @@ interface Proxy extends TableOperations> { * @see #proxy(boolean, boolean) */ @FinalDefault + @ConcurrentMethod default Proxy proxy() { return proxy(true, true); } @@ -147,6 +155,7 @@ default Proxy proxy() { * @return A proxy that allows {@link TableOperations table operations} to be applied to the constituent tables of * this PartitionedTable */ + @ConcurrentMethod Proxy proxy(boolean requireMatchingKeys, boolean sanityCheckJoinOperations); /** @@ -169,6 +178,7 @@ default Proxy proxy() { * @param filters The filters to apply. Must not reference the constituent column. * @return The filtered PartitionedTable */ + @ConcurrentMethod PartitionedTable filter(Collection filters); /** @@ -180,6 +190,7 @@ default Proxy proxy() { * @param sortColumns The columns to sort by. Must not reference the constituent column. * @return The sorted PartitionedTable */ + @ConcurrentMethod PartitionedTable sort(Collection sortColumns); /** @@ -242,6 +253,7 @@ PartitionedTable partitionedTransform( * @return The {@link Table constituent} at the single row in {@link #table()} matching the {@code keyColumnValues}, * or {@code null} if no matches were found */ + @ConcurrentMethod Table constituentFor(@NotNull Object... keyColumnValues); /** @@ -255,5 +267,6 @@ PartitionedTable partitionedTransform( * * @return An array of all current {@link Table constituents} */ + @ConcurrentMethod Table[] constituents(); } diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index 6605df24864..d8ff5cec549 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -142,8 +142,10 @@ public interface Table extends * all rows: *

      *
    1. {@link #groupBy} is unsupported - *
    2. {@link #aggBy} is unsupported if {@link Aggregation#AggGroup(String...)} is used *
    3. {@link #partitionBy} is unsupported
    4. + *
    5. {@link #partitionedAggBy(Collection, boolean, Table, String...) partitionedAggBy} is unsupported
    6. + *
    7. {@link #aggBy} is unsupported if either of {@link io.deephaven.api.agg.spec.AggSpecGroup group} or + * {@link io.deephaven.api.agg.Partition partition} are used
    8. *
    9. {@link #rollup(Collection, boolean, ColumnName...) rollup()} is unsupported if * {@code includeConstituents == true}
    10. *
    11. {@link #treeTable(String, String) treeTable()} is unsupported
    12. @@ -995,6 +997,14 @@ Table join(Table rightTable, Collection columnsToMatch, @ConcurrentMethod Table aggBy(Aggregation aggregation); + @Override + @ConcurrentMethod + Table aggBy(Collection aggregations); + + @Override + @ConcurrentMethod + Table aggBy(Collection aggregations, boolean preserveEmpty); + @Override @ConcurrentMethod Table aggBy(Aggregation aggregation, String... groupByColumns); @@ -1005,15 +1015,16 @@ Table join(Table rightTable, Collection columnsToMatch, @Override @ConcurrentMethod - Table aggBy(Collection aggregations, Collection groupByColumns); + Table aggBy(Collection aggregations, String... groupByColumns); @Override @ConcurrentMethod - Table aggBy(Collection aggregations, String... groupByColumns); + Table aggBy(Collection aggregations, Collection groupByColumns); @Override @ConcurrentMethod - Table aggBy(Collection aggregations); + Table aggBy(Collection aggregations, boolean preserveEmpty, Table initialGroups, + Collection groupByColumns); Table headBy(long nRows, Collection groupByColumnNames); @@ -1602,6 +1613,29 @@ Table join(Table rightTable, Collection columnsToMatch, @ConcurrentMethod PartitionedTable partitionBy(String... keyColumnNames); + /** + * Convenience method that performs an {@link #aggBy(Collection, boolean, Table, Collection)} and wraps the result + * in a {@link PartitionedTable}. If {@code aggregations} does not include a {@link io.deephaven.api.agg.Partition + * partition}, one will be added automatically with the default constituent column name and behavior used in + * {@link #partitionBy(String...)}. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @param preserveEmpty Whether to keep result rows for groups that are initially empty or become empty as a result + * of updates. Each aggregation operator defines its own value for empty groups. + * @param initialGroups A table whose distinct combinations of values for the {@code groupByColumns} should be used + * to create an initial set of aggregation groups. All other columns are ignored. This is useful in + * combination with {@code preserveEmpty == true} to ensure that particular groups appear in the result + * table, or with {@code preserveEmpty == false} to control the encounter order for a collection of groups + * and thus their relative order in the result. Changes to {@code initialGroups} are not expected or handled; + * if {@code initialGroups} is a refreshing table, only its contents at instantiation time will be used. If + * {@code initialGroups == null}, the result will be the same as if a table with no rows was supplied. + * @param keyColumnNames The names of the key columns to aggregate by + * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} + */ + @ConcurrentMethod + PartitionedTable partitionedAggBy(Collection aggregations, boolean preserveEmpty, + Table initialGroups, String... keyColumnNames); + // ----------------------------------------------------------------------------------------------------------------- // Hierarchical table operations (rollup and treeTable). // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/AbstractColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/AbstractColumnSource.java index d1e4e51e8b6..d1626313b8d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/AbstractColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/AbstractColumnSource.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; public abstract class AbstractColumnSource implements @@ -42,6 +43,7 @@ public abstract class AbstractColumnSource implements protected final Class componentType; protected volatile Map groupToRange; + protected volatile List rowSetIndexerKey; protected AbstractColumnSource(@NotNull final Class type) { this(type, Object.class); @@ -102,6 +104,19 @@ public ColumnSource getPrevSource() { return new PrevColumnSource<>(this); } + @Override + public List getColumnSources() { + List localRowSetIndexerKey; + if ((localRowSetIndexerKey = rowSetIndexerKey) == null) { + synchronized (this) { + if ((localRowSetIndexerKey = rowSetIndexerKey) == null) { + rowSetIndexerKey = localRowSetIndexerKey = Collections.singletonList(this); + } + } + } + return localRowSetIndexerKey; + } + @Override public Map getGroupToRange() { return groupToRange; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/GroupingUtils.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/GroupingUtils.java index 209e2cf25d0..b38d0cf2389 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/GroupingUtils.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/GroupingUtils.java @@ -10,8 +10,10 @@ import io.deephaven.engine.rowset.TrackingWritableRowSet; import io.deephaven.engine.rowset.WritableRowSet; import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.WritableColumnSource; import io.deephaven.engine.table.impl.indexer.RowSetIndexer; import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; +import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; @@ -158,4 +160,25 @@ public static Pair, ObjectArraySource(resultKeyColumnSource, resultIndexColumnSource); } + + /** + * Convert a group-to-RowSet map to a flat, immutable, in-memory column of keys. + * + * @param originalKeyColumnSource The key column source whose contents are reflected by the group-to-RowSet map + * (used for typing, only) + * @param groupToRowSet The group-to-RowSet map to convert + * @return A flat, immutable, in-memory column of keys + */ + public static WritableColumnSource groupingKeysToImmutableFlatSource( + @NotNull final ColumnSource originalKeyColumnSource, + @NotNull final Map groupToRowSet) { + final WritableColumnSource destination = InMemoryColumnSource.makeImmutableSource( + originalKeyColumnSource.getType(), originalKeyColumnSource.getComponentType()); + destination.ensureCapacity(groupToRowSet.size()); + int ri = 0; + for (final TYPE key : groupToRowSet.keySet()) { + destination.set(ri++, key); + } + return destination; + } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java index 67507196fc7..145a27fda7e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java @@ -160,11 +160,6 @@ public Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] colu return throwUnsupported("join()"); } - @Override - public Table countBy(String countColumnName, ColumnName... groupByColumns) { - return throwUnsupported("countBy()"); - } - @Override public Table ungroup(boolean nullFill, String... columnsToUngroup) { return throwUnsupported("ungroup()"); @@ -186,7 +181,7 @@ public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { } @Override - public Table aggBy(Collection aggregations, + public Table aggBy(Collection aggregations, boolean preserveEmpty, Table initialGroups, Collection groupByColumns) { return throwUnsupported("aggBy()"); } @@ -251,6 +246,12 @@ public PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames) return throwUnsupported("partitionBy()"); } + @Override + public PartitionedTable partitionedAggBy(Collection aggregations, boolean preserveEmpty, + Table initialGroups, String... keyColumnNames) { + return throwUnsupported("partitionedAggBy()"); + } + @Override public Table rollup(Collection aggregations, boolean includeConstituents, ColumnName... groupByColumns) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java index 9260173b844..884897dd3ec 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/MemoizedOperationKey.java @@ -99,9 +99,12 @@ public static MemoizedOperationKey treeTable(String idColumn, String parentColum return new TreeTable(idColumn, parentColumn); } - public static MemoizedOperationKey aggBy(Collection aggregations, + public static MemoizedOperationKey aggBy( + Collection aggregations, + boolean preserveEmpty, + Table initialGroups, Collection groupByColumns) { - return new AggBy(new ArrayList<>(aggregations), new ArrayList<>(groupByColumns)); + return new AggBy(new ArrayList<>(aggregations), preserveEmpty, initialGroups, new ArrayList<>(groupByColumns)); } public static MemoizedOperationKey partitionBy(boolean dropKeys, Collection groupByColumns) { @@ -110,7 +113,7 @@ public static MemoizedOperationKey partitionBy(boolean dropKeys, Collection aggregations, Collection groupByColumns, boolean includeConstituents) { - return new Rollup(new AggBy(new ArrayList<>(aggregations), new ArrayList<>(groupByColumns)), + return new Rollup(new AggBy(new ArrayList<>(aggregations), false, null, new ArrayList<>(groupByColumns)), includeConstituents); } @@ -335,11 +338,27 @@ public int hashCode() { private static class AggBy extends AttributeAgnosticMemoizedOperationKey { private final List aggregations; + private final boolean preserveEmpty; + private final WeakReference
    initialGroups; private final List groupByColumns; - private AggBy(List aggregations, List groupByColumns) { + private final int cachedHashCode; + + private AggBy( + List aggregations, + boolean preserveEmpty, + Table initialGroups, + List groupByColumns) { this.aggregations = aggregations; + this.preserveEmpty = preserveEmpty; + this.initialGroups = initialGroups == null ? null : new WeakReference<>(initialGroups); this.groupByColumns = groupByColumns; + + int hash = aggregations.hashCode(); + hash = 31 * hash + Boolean.hashCode(preserveEmpty); + hash = 31 * hash + System.identityHashCode(initialGroups); + hash = 31 * hash + groupByColumns.hashCode(); + this.cachedHashCode = hash; } @Override @@ -351,14 +370,15 @@ public boolean equals(Object o) { return false; } AggBy aggBy = (AggBy) o; - return aggregations.equals(aggBy.aggregations) && groupByColumns.equals(aggBy.groupByColumns); + return aggregations.equals(aggBy.aggregations) + && preserveEmpty == aggBy.preserveEmpty + && equalWeakRefsByReferentIdentity(initialGroups, aggBy.initialGroups) + && groupByColumns.equals(aggBy.groupByColumns); } @Override public int hashCode() { - int result = aggregations.hashCode(); - result = 31 * result + groupByColumns.hashCode(); - return result; + return cachedHashCode; } @Override @@ -530,11 +550,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; final CrossJoin crossJoin = (CrossJoin) o; - final Table rTable = rightTableCandidate.get(); - final Table oTable = crossJoin.rightTableCandidate.get(); - if (rTable == null || oTable == null) - return false; - return rTable == oTable && + return equalWeakRefsByReferentIdentity(rightTableCandidate, crossJoin.rightTableCandidate) && numRightBitsToReserve == crossJoin.numRightBitsToReserve && Arrays.equals(columnsToMatch, crossJoin.columnsToMatch) && Arrays.equals(columnsToAdd, crossJoin.columnsToAdd); @@ -555,4 +571,19 @@ public static CrossJoin crossJoin(final Table rightTableCandidate, final MatchPa final MatchPair[] columnsToAdd, final int numRightBitsToReserve) { return new CrossJoin(rightTableCandidate, columnsToMatch, columnsToAdd, numRightBitsToReserve); } + + private static boolean equalWeakRefsByReferentIdentity(final WeakReference r1, final WeakReference r2) { + if (r1 == r2) { + return true; + } + if (r1 == null || r2 == null) { + return false; + } + final Object t1 = r1.get(); + final Object t2 = r2.get(); + if (t1 == null || t2 == null) { + return false; + } + return t1 == t2; + } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index 43645615a35..d30bd7c66c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -477,6 +477,35 @@ public PartitionedTable partitionBy(final boolean dropKeys, final String... keyC }); } + @Override + public PartitionedTable partitionedAggBy(final Collection aggregations, + final boolean preserveEmpty, @Nullable final Table initialGroups, final String... keyColumnNames) { + if (isStream()) { + throw streamUnsupported("partitionedAggBy"); + } + final Optional includedPartition = aggregations.stream() + .filter(agg -> agg instanceof Partition) + .map(agg -> (Partition) agg) + .findFirst(); + final Partition partition = includedPartition.orElseGet(() -> Partition.of(CONSTITUENT)); + final Collection aggregationsToUse = includedPartition.isPresent() + ? aggregations + : Stream.concat(aggregations.stream(), Stream.of(partition)).collect(Collectors.toList()); + final Table aggregated = + aggBy(aggregationsToUse, preserveEmpty, initialGroups, ColumnName.from(keyColumnNames)); + final Set keyColumnNamesSet = + Arrays.stream(keyColumnNames).collect(Collectors.toCollection(LinkedHashSet::new)); + final TableDefinition constituentDefinition; + if (partition.includeGroupByColumns()) { + constituentDefinition = definition; + } else { + constituentDefinition = TableDefinition.of(definition.getColumnStream() + .filter(cd -> !keyColumnNamesSet.contains(cd.getName())).toArray(ColumnDefinition[]::new)); + } + return new PartitionedTableImpl(aggregated, keyColumnNamesSet, true, partition.column().name(), + constituentDefinition, isRefreshing(), false); + } + @Override public Table rollup(Collection aggregations, boolean includeConstituents, ColumnName... groupByColumns) { @@ -597,8 +626,7 @@ public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { } } final List groupByList = Arrays.asList(groupByColumns); - final List tableColumns = - definition.getColumnNames().stream().map(ColumnName::of).collect(Collectors.toList()); + final List tableColumns = definition.getTypedColumnNames(); final Optional agg = AggregateAllByTable.singleAggregation(spec, groupByList, tableColumns); if (agg.isEmpty()) { throw new IllegalArgumentException( @@ -606,9 +634,10 @@ public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { } final QueryTable tableToUse = (QueryTable) AggAllByUseTable.of(this, spec); final List aggs = List.of(agg.get()); - final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(aggs, groupByList); + final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(aggs, false, null, groupByList); return tableToUse.memoizeResult(aggKey, () -> { - final QueryTable result = tableToUse.aggNoMemo(AggregationProcessor.forAggregation(aggs), groupByList); + final QueryTable result = + tableToUse.aggNoMemo(AggregationProcessor.forAggregation(aggs), false, null, groupByList); spec.walk(new AggAllByCopyAttributes(this, result)); return result; }); @@ -617,17 +646,19 @@ public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { @Override public Table aggBy( final Collection aggregations, + final boolean preserveEmpty, + final Table initialGroups, final Collection groupByColumns) { if (aggregations.isEmpty()) { throw new IllegalArgumentException( "aggBy must have at least one aggregation, none specified. groupByColumns=" + toString(groupByColumns)); } - final List optimized = AggregationOptimizer.of(aggregations); - final MemoizedOperationKey aggKey = MemoizedOperationKey.aggBy(optimized, groupByColumns); - final Table aggregationTable = - memoizeResult(aggKey, () -> aggNoMemo(AggregationProcessor.forAggregation(optimized), groupByColumns)); + final MemoizedOperationKey aggKey = + MemoizedOperationKey.aggBy(optimized, preserveEmpty, initialGroups, groupByColumns); + final Table aggregationTable = memoizeResult(aggKey, () -> aggNoMemo( + AggregationProcessor.forAggregation(optimized), preserveEmpty, initialGroups, groupByColumns)); final List optimizedOrder = AggregationPairs.outputsOf(optimized).collect(Collectors.toList()); final List userOrder = AggregationPairs.outputsOf(aggregations).collect(Collectors.toList()); @@ -641,19 +672,16 @@ public Table aggBy( return aggregationTable.view(resultOrder); } - @Override - public Table countBy(String countColumnName, ColumnName... groupByColumns) { - return QueryPerformanceRecorder.withNugget( - "countBy(" + countColumnName + "," + Arrays.toString(groupByColumns) + ")", sizeForInstrumentation(), - () -> aggBy(Aggregation.AggCount(countColumnName), Arrays.asList(groupByColumns))); - } - - private QueryTable aggNoMemo(@NotNull final AggregationContextFactory aggregationContextFactory, + private QueryTable aggNoMemo( + @NotNull final AggregationContextFactory aggregationContextFactory, + final boolean preserveEmpty, + @Nullable final Table initialGroups, @NotNull final Collection groupByColumns) { final String description = "aggregation(" + aggregationContextFactory + ", " + groupByColumns + ")"; return QueryPerformanceRecorder.withNugget(description, sizeForInstrumentation(), - () -> ChunkedOperatorAggregationHelper.aggregation(aggregationContextFactory, this, groupByColumns)); + () -> ChunkedOperatorAggregationHelper.aggregation( + aggregationContextFactory, this, preserveEmpty, initialGroups, groupByColumns)); } private static UnsupportedOperationException streamUnsupported(@NotNull final String operationName) { @@ -2863,9 +2891,9 @@ public Table selectDistinct(Collection columns) { return view(columns).selectDistinct(); } final MemoizedOperationKey aggKey = - MemoizedOperationKey.aggBy(Collections.emptyList(), columnNames); + MemoizedOperationKey.aggBy(Collections.emptyList(), false, null, columnNames); return memoizeResult(aggKey, - () -> aggNoMemo(AggregationProcessor.forSelectDistinct(), columnNames)); + () -> aggNoMemo(AggregationProcessor.forSelectDistinct(), false, null, columnNames)); }); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java index dc0bbe6784f..5c25019800e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java @@ -662,6 +662,18 @@ default Table aggBy(Aggregation aggregation) { return aggBy(List.of(aggregation)); } + @Override + @ConcurrentMethod + default Table aggBy(Collection aggregations) { + return aggBy(aggregations, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default Table aggBy(Collection aggregations, boolean preserveEmpty) { + return aggBy(aggregations, preserveEmpty, null, Collections.emptyList()); + } + @Override @ConcurrentMethod default Table aggBy(Aggregation aggregation, String... groupByColumns) { @@ -682,8 +694,9 @@ default Table aggBy(Collection aggregations, String... gr @Override @ConcurrentMethod - default Table aggBy(Collection aggregations) { - return aggBy(aggregations, Collections.emptyList()); + default Table aggBy(Collection aggregations, + Collection groupByColumns) { + return aggBy(aggregations, false, null, groupByColumns); } @Override @@ -697,6 +710,7 @@ default Table tailBy(long nRows, Collection groupByColumnNames) { } @Override + @ConcurrentMethod default Table applyToAllBy(String formulaColumn, String columnParamName, Collection groupByColumns) { return aggAllBy(AggSpec.formula(formulaColumn, columnParamName), groupByColumns.toArray(ColumnName[]::new)); @@ -1002,6 +1016,12 @@ default Table medianBy() { return medianBy(ZERO_LENGTH_COLUMNNAME_ARRAY); } + @Override + @ConcurrentMethod + default Table countBy(String countColumnName, ColumnName... groupByColumns) { + return aggBy(Aggregation.AggCount(countColumnName), Arrays.asList(groupByColumns)); + } + @Override @ConcurrentMethod default Table countBy(String countColumnName, String... groupByColumns) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java index 56663b5b2b8..b98c9f15557 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java @@ -343,12 +343,6 @@ public Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] colu return coalesce().join(rightTable, columnsToMatch, columnsToAdd, numRightBitsToReserve); } - @Override - @ConcurrentMethod - public Table groupBy(Collection groupByColumns) { - return coalesce().groupBy(groupByColumns); - } - @Override @ConcurrentMethod public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { @@ -357,9 +351,9 @@ public Table aggAllBy(AggSpec spec, ColumnName... groupByColumns) { @Override @ConcurrentMethod - public Table aggBy(Collection aggregations, + public Table aggBy(Collection aggregations, boolean preserveEmpty, Table initialGroups, Collection groupByColumns) { - return coalesce().aggBy(aggregations, groupByColumns); + return coalesce().aggBy(aggregations, preserveEmpty, initialGroups, groupByColumns); } @Override @@ -372,91 +366,6 @@ public Table tailBy(long nRows, String... groupByColumnNames) { return coalesce().tailBy(nRows, groupByColumnNames); } - @Override - @ConcurrentMethod - public Table applyToAllBy(String formulaColumn, String columnParamName, - Collection groupByColumns) { - return coalesce().applyToAllBy(formulaColumn, columnParamName, groupByColumns); - } - - @Override - @ConcurrentMethod - public Table sumBy(ColumnName... groupByColumns) { - return coalesce().sumBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table absSumBy(ColumnName... groupByColumns) { - return coalesce().absSumBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table avgBy(ColumnName... groupByColumns) { - return coalesce().avgBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table wavgBy(String weightColumn, ColumnName... groupByColumns) { - return coalesce().wavgBy(weightColumn, groupByColumns); - } - - @Override - @ConcurrentMethod - public Table wsumBy(String weightColumn, ColumnName... groupByColumns) { - return coalesce().wsumBy(weightColumn, groupByColumns); - } - - @Override - @ConcurrentMethod - public Table stdBy(ColumnName... groupByColumns) { - return coalesce().stdBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table varBy(ColumnName... groupByColumns) { - return coalesce().varBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table lastBy(ColumnName... groupByColumns) { - return coalesce().lastBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table firstBy(ColumnName... groupByColumns) { - return coalesce().firstBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table minBy(ColumnName... groupByColumns) { - return coalesce().minBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table maxBy(ColumnName... groupByColumns) { - return coalesce().maxBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table medianBy(ColumnName... groupByColumns) { - return coalesce().medianBy(groupByColumns); - } - - @Override - @ConcurrentMethod - public Table countBy(String countColumnName, ColumnName... groupByColumns) { - return coalesce().countBy(countColumnName, groupByColumns); - } - @Override public Table ungroup(boolean nullFill, String... columnsToUngroup) { return coalesce().ungroup(nullFill, columnsToUngroup); @@ -468,6 +377,13 @@ public PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames) return coalesce().partitionBy(dropKeys, keyColumnNames); } + @Override + @ConcurrentMethod + public PartitionedTable partitionedAggBy(Collection aggregations, boolean preserveEmpty, + Table initialGroups, String... keyColumnNames) { + return coalesce().partitionedAggBy(aggregations, preserveEmpty, initialGroups, keyColumnNames); + } + @Override @ConcurrentMethod public Table rollup(Collection aggregations, boolean includeConstituents, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java index 5a52d0b9137..683a46afce9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.table.impl.by; +import io.deephaven.base.verify.Assert; import io.deephaven.engine.liveness.LivenessReferent; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.TableUpdateImpl; @@ -175,6 +176,19 @@ void startTrackingPrevValues() { } } + /** + * Get any single {@link StateChangeRecorder} present in the {@code operators} array. + * + * @return Any single {@link StateChangeRecorder} present in the {@code operators} array + * @throws io.deephaven.base.verify.AssertionFailure If there is no state change recorder present + */ + StateChangeRecorder getStateChangeRecorder() { + return (StateChangeRecorder) Arrays.stream(operators) + .filter(op -> op instanceof StateChangeRecorder) + .findAny() + .orElseThrow(Assert::statementNeverExecuted); + } + /** * The helper passes in the result column source map, which contains the key columns if any. The context is * responsible for filling in the columns generated by the operators or transformations. diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContextFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContextFactory.java index 9c549639c31..207b0b7706f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContextFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContextFactory.java @@ -16,8 +16,11 @@ public interface AggregationContextFactory { * Make an {@link AggregationContext} for this aggregation. * * @param table The source {@link Table} to aggregate + * @param requireStateChangeRecorder Whether the resulting context is required to have an operator that extends + * {@link StateChangeRecorder} * @param groupByColumns The key column names * @return A new or safely reusable {@link AggregationContext} */ - AggregationContext makeAggregationContext(@NotNull Table table, @NotNull String... groupByColumns); + AggregationContext makeAggregationContext( + @NotNull Table table, boolean requireStateChangeRecorder, @NotNull String... groupByColumns); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationControl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationControl.java index a8d90fbcc1d..aafb062e870 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationControl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationControl.java @@ -15,6 +15,11 @@ @VisibleForTesting public class AggregationControl { + private static final int CHUNK_SIZE = ChunkedOperatorAggregationHelper.CHUNK_SIZE; + private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; + private static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; + private static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; + public static final AggregationControl DEFAULT = new AggregationControl(); public static final AggregationControl DEFAULT_FOR_OPERATOR = new AggregationControl() { @Override @@ -25,15 +30,15 @@ public boolean considerGrouping(@NotNull Table table, @NotNull ColumnSource[] public int initialHashTableSize(@NotNull final Table inputTable) { // TODO: This approach relies on rehash. Maybe we should consider sampling instead. - return IncrementalChunkedOperatorAggregationStateManager.MINIMUM_INITIAL_HASH_SIZE; + return MINIMUM_INITIAL_HASH_SIZE; } public double getTargetLoadFactor() { - return IncrementalChunkedOperatorAggregationStateManager.DEFAULT_TARGET_LOAD_FACTOR; + return DEFAULT_TARGET_LOAD_FACTOR; } public double getMaximumLoadFactor() { - return IncrementalChunkedOperatorAggregationStateManager.DEFAULT_MAX_LOAD_FACTOR; + return DEFAULT_MAX_LOAD_FACTOR; } public boolean considerGrouping(@NotNull final Table inputTable, @NotNull final ColumnSource[] sources) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationProcessor.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationProcessor.java index 8494dd4a0bc..39427a84a73 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationProcessor.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationProcessor.java @@ -273,17 +273,19 @@ public String toString() { // ----------------------------------------------------------------------------------------------------------------- @Override - public AggregationContext makeAggregationContext(@NotNull final Table table, + public AggregationContext makeAggregationContext( + @NotNull final Table table, + final boolean requireStateChangeRecorder, @NotNull final String... groupByColumnNames) { switch (type) { case NORMAL: - return new NormalConverter(table, groupByColumnNames).build(); + return new NormalConverter(table, requireStateChangeRecorder, groupByColumnNames).build(); case ROLLUP_BASE: - return new RollupBaseConverter(table, groupByColumnNames).build(); + return new RollupBaseConverter(table, requireStateChangeRecorder, groupByColumnNames).build(); case ROLLUP_REAGGREGATED: - return new RollupReaggregatedConverter(table, groupByColumnNames).build(); + return new RollupReaggregatedConverter(table, requireStateChangeRecorder, groupByColumnNames).build(); case SELECT_DISTINCT: - return makeEmptyAggregationContext(); + return makeEmptyAggregationContext(requireStateChangeRecorder); default: throw new UnsupportedOperationException("Unsupported type " + type); } @@ -300,6 +302,7 @@ public AggregationContext makeAggregationContext(@NotNull final Table table, private abstract class Converter implements Aggregation.Visitor, AggSpec.Visitor { final QueryTable table; + private final boolean requireStateChangeRecorder; final String[] groupByColumnNames; final boolean isAddOnly; @@ -315,8 +318,12 @@ private abstract class Converter implements Aggregation.Visitor, AggSpec.Visitor int trackedFirstOrLastIndex = -1; boolean partitionFound; - private Converter(@NotNull final Table table, @NotNull final String... groupByColumnNames) { + private Converter( + @NotNull final Table table, + final boolean requireStateChangeRecorder, + @NotNull final String... groupByColumnNames) { this.table = (QueryTable) table.coalesce(); + this.requireStateChangeRecorder = requireStateChangeRecorder; this.groupByColumnNames = groupByColumnNames; isAddOnly = this.table.isAddOnly(); isStream = this.table.isStream(); @@ -335,6 +342,9 @@ final void walkAllAggregations() { @NotNull final AggregationContext makeAggregationContext() { + if (requireStateChangeRecorder && operators.stream().noneMatch(op -> op instanceof StateChangeRecorder)) { + addNoInputOperator(new CountAggregationOperator(null)); + } // noinspection unchecked return new AggregationContext( operators.toArray(IterativeChunkedAggregationOperator[]::new), @@ -642,8 +652,11 @@ final void addWeightedAvgOrSumOperator(@NotNull final String weightName, final b */ private final class NormalConverter extends Converter { - private NormalConverter(@NotNull final Table table, @NotNull final String... groupByColumnNames) { - super(table, groupByColumnNames); + private NormalConverter( + @NotNull final Table table, + final boolean requireStateChangeRecorder, + @NotNull final String... groupByColumnNames) { + super(table, requireStateChangeRecorder, groupByColumnNames); } // ------------------------------------------------------------------------------------------------------------- @@ -896,8 +909,11 @@ private final class RollupBaseConverter extends Converter private int nextColumnIdentifier = 0; - private RollupBaseConverter(@NotNull final Table table, @NotNull final String... groupByColumnNames) { - super(table, groupByColumnNames); + private RollupBaseConverter( + @NotNull final Table table, + final boolean requireStateChangeRecorder, + @NotNull final String... groupByColumnNames) { + super(table, requireStateChangeRecorder, groupByColumnNames); } @Override @@ -1034,8 +1050,11 @@ private final class RollupReaggregatedConverter extends Converter private int nextColumnIdentifier = 0; - private RollupReaggregatedConverter(@NotNull final Table table, @NotNull final String... groupByColumnNames) { - super(table, groupByColumnNames); + private RollupReaggregatedConverter( + @NotNull final Table table, + final boolean requireStateChangeRecorder, + @NotNull final String... groupByColumnNames) { + super(table, requireStateChangeRecorder, groupByColumnNames); } // ------------------------------------------------------------------------------------------------------------- @@ -1327,7 +1346,14 @@ private OP_TYPE getAndAddB // Basic Helpers // ----------------------------------------------------------------------------------------------------------------- - private static AggregationContext makeEmptyAggregationContext() { + private static AggregationContext makeEmptyAggregationContext(final boolean requireStateChangeRecorder) { + if (requireStateChangeRecorder) { + // noinspection unchecked + return new AggregationContext( + new IterativeChunkedAggregationOperator[] {new CountAggregationOperator(null)}, + new String[][] {ZERO_LENGTH_STRING_ARRAY}, + new ChunkSource.WithPrev[] {null}); + } // noinspection unchecked return new AggregationContext( ZERO_LENGTH_ITERATIVE_CHUNKED_AGGREGATION_OPERATOR_ARRAY, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseAddOnlyFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseAddOnlyFirstOrLastChunkedOperator.java index f6fc5fcac4f..b1c88357e58 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseAddOnlyFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseAddOnlyFirstOrLastChunkedOperator.java @@ -18,7 +18,10 @@ import java.util.LinkedHashMap; import java.util.Map; -abstract class BaseAddOnlyFirstOrLastChunkedOperator implements IterativeChunkedAggregationOperator { +abstract class BaseAddOnlyFirstOrLastChunkedOperator + extends NoopStateChangeRecorder // We can never empty or reincarnate states since we're add-only + implements IterativeChunkedAggregationOperator { + final boolean isFirst; final LongArraySource redirections; private final LongColumnSourceWritableRowRedirection rowRedirection; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java index 49c3b435037..e19e0e6759d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java @@ -22,7 +22,9 @@ /** * Base class with shared boilerplate for {@link StreamFirstChunkedOperator} and {@link StreamLastChunkedOperator}. */ -public abstract class BaseStreamFirstOrLastChunkedOperator implements IterativeChunkedAggregationOperator { +public abstract class BaseStreamFirstOrLastChunkedOperator + extends NoopStateChangeRecorder // We can never empty or reincarnate states since we ignore removes + implements IterativeChunkedAggregationOperator { protected static final int COPY_CHUNK_SIZE = ArrayBackedColumnSource.BLOCK_SIZE; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BasicStateChangeRecorder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BasicStateChangeRecorder.java new file mode 100644 index 00000000000..4b50e7238d0 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BasicStateChangeRecorder.java @@ -0,0 +1,48 @@ +package io.deephaven.engine.table.impl.by; + +import java.util.function.LongConsumer; + +/** + * Re-usable support for recording reincarnated and emptied states in incremental aggregation processing. + */ +class BasicStateChangeRecorder implements StateChangeRecorder { + + private LongConsumer reincarnatedDestinationCallback; + private LongConsumer emptiedDestinationCallback; + + @Override + public final void startRecording( + final LongConsumer reincarnatedDestinationCallback, + final LongConsumer emptiedDestinationCallback) { + this.reincarnatedDestinationCallback = reincarnatedDestinationCallback; + this.emptiedDestinationCallback = emptiedDestinationCallback; + } + + @Override + public final void finishRecording() { + reincarnatedDestinationCallback = null; + emptiedDestinationCallback = null; + } + + /** + * Record a reincarnated {@code destination}. + * + * @param destination The destination slot that has been reincarnated + */ + final void onReincarnated(final long destination) { + if (reincarnatedDestinationCallback != null) { + reincarnatedDestinationCallback.accept(destination); + } + } + + /** + * Record an emptied {@code destination}. + * + * @param destination The destination slot that has been emptied + */ + final void onEmptied(final long destination) { + if (emptiedDestinationCallback != null) { + emptiedDestinationCallback.accept(destination); + } + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java index 63b16cc1984..97b4826d52e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java @@ -22,6 +22,7 @@ import io.deephaven.engine.table.impl.indexer.RowSetIndexer; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.engine.table.impl.remote.ConstructSnapshot; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.util.BooleanUtils; @@ -47,6 +48,8 @@ import java.util.*; import java.util.function.Consumer; +import java.util.function.LongFunction; +import java.util.function.Supplier; import java.util.function.UnaryOperator; @SuppressWarnings("rawtypes") @@ -58,65 +61,101 @@ public class ChunkedOperatorAggregationHelper { Configuration.getInstance().getBooleanWithDefault("ChunkedOperatorAggregationHelper.skipRunFind", false); static final boolean HASHED_RUN_FIND = Configuration.getInstance().getBooleanWithDefault("ChunkedOperatorAggregationHelper.hashedRunFind", true); - static boolean USE_TYPED_STATE_MANAGER = - Configuration.getInstance().getBooleanWithDefault("ChunkedOperatorAggregationHelper.useTypedStateManager", - false); static boolean USE_OPEN_ADDRESSED_STATE_MANAGER = Configuration.getInstance().getBooleanWithDefault( "ChunkedOperatorAggregationHelper.useOpenAddressedStateManager", true); - static boolean USE_BITMAP_MODIFIED_STATES_BUILDER = - Configuration.getInstance().getBooleanWithDefault( - "ChunkedOperatorAggregationHelper.useBitmapModifiedStatesBuilder", - true); - public static QueryTable aggregation(AggregationContextFactory aggregationContextFactory, QueryTable queryTable, - Collection groupByColumns) { - return aggregation(AggregationControl.DEFAULT_FOR_OPERATOR, aggregationContextFactory, queryTable, - groupByColumns); + public static QueryTable aggregation( + @NotNull final AggregationContextFactory aggregationContextFactory, + @NotNull final QueryTable input, + final boolean preserveEmpty, + @Nullable final Table initialKeys, + @NotNull final Collection groupByColumns) { + return aggregation(AggregationControl.DEFAULT_FOR_OPERATOR, + aggregationContextFactory, input, preserveEmpty, initialKeys, groupByColumns); } @VisibleForTesting - public static QueryTable aggregation(AggregationControl control, - AggregationContextFactory aggregationContextFactory, QueryTable queryTable, - Collection groupByColumns) { + public static QueryTable aggregation( + @NotNull final AggregationControl control, + @NotNull final AggregationContextFactory aggregationContextFactory, + @NotNull final QueryTable input, + final boolean preserveEmpty, + @Nullable final Table initialKeys, + @NotNull final Collection groupByColumns) { + final String[] keyNames = groupByColumns.stream().map(ColumnName::name).toArray(String[]::new); + if (!input.hasColumns(keyNames)) { + throw new IllegalArgumentException("aggregation: not all group-by columns " + Arrays.toString(keyNames) + + " are present in input table with columns " + + Arrays.toString(input.getDefinition().getColumnNamesArray())); + } + if (initialKeys != null) { + if (keyNames.length == 0) { + throw new IllegalArgumentException( + "aggregation: initial groups must not be specified if no group-by columns are specified"); + } + if (!initialKeys.hasColumns(keyNames)) { + throw new IllegalArgumentException("aggregation: not all group-by columns " + Arrays.toString(keyNames) + + " are present in initial groups table with columns " + + Arrays.toString(initialKeys.getDefinition().getColumnNamesArray())); + } + for (final String keyName : keyNames) { + final ColumnDefinition inputDef = input.getDefinition().getColumn(keyName); + final ColumnDefinition initialKeysDef = initialKeys.getDefinition().getColumn(keyName); + if (!inputDef.isCompatible(initialKeysDef)) { + throw new IllegalArgumentException( + "aggregation: column definition mismatch between input table and initial groups table for " + + keyName + " input has " + inputDef.describeForCompatibility() + + ", initial groups has " + initialKeysDef.describeForCompatibility()); + } + } + } final Mutable resultHolder = new MutableObject<>(); - final SwapListener swapListener = queryTable.createSwapListenerIfRefreshing(SwapListener::new); + final SwapListener swapListener = input.createSwapListenerIfRefreshing(SwapListener::new); BaseTable.initializeWithSnapshot( "by(" + aggregationContextFactory + ", " + groupByColumns + ")", swapListener, (usePrev, beforeClockValue) -> { - resultHolder.setValue(aggregation(control, swapListener, aggregationContextFactory, queryTable, - groupByColumns, usePrev)); + resultHolder.setValue(aggregation(control, swapListener, aggregationContextFactory, + input, preserveEmpty, initialKeys, keyNames, usePrev)); return true; }); return resultHolder.getValue(); } - private static QueryTable aggregation(AggregationControl control, SwapListener swapListener, - AggregationContextFactory aggregationContextFactory, QueryTable withView, - Collection groupByColumns, - boolean usePrev) { - if (groupByColumns.isEmpty()) { - return noKeyAggregation(swapListener, aggregationContextFactory, withView, usePrev); + private static QueryTable aggregation( + @NotNull final AggregationControl control, + @Nullable final SwapListener swapListener, + @NotNull final AggregationContextFactory aggregationContextFactory, + @NotNull final QueryTable input, + final boolean preserveEmpty, + @Nullable final Table initialKeys, + @NotNull final String[] keyNames, + final boolean usePrev) { + if (keyNames.length == 0) { + // This should be checked before this method is called, but let's verify here in case an additional + // entry point is added incautiously. + Assert.eqNull(initialKeys, "initialKeys"); + return noKeyAggregation(swapListener, aggregationContextFactory, input, preserveEmpty, usePrev); } - final String[] keyNames = groupByColumns.stream().map(ColumnName::name).toArray(String[]::new); final ColumnSource[] keySources = - Arrays.stream(keyNames).map(withView::getColumnSource).toArray(ColumnSource[]::new); + Arrays.stream(keyNames).map(input::getColumnSource).toArray(ColumnSource[]::new); final ColumnSource[] reinterpretedKeySources = Arrays.stream(keySources) .map(ReinterpretUtils::maybeConvertToPrimitive).toArray(ColumnSource[]::new); - final AggregationContext ac = aggregationContextFactory.makeAggregationContext(withView, keyNames); + final AggregationContext ac = aggregationContextFactory.makeAggregationContext( + input, input.isRefreshing() && !preserveEmpty, keyNames); final PermuteKernel[] permuteKernels = ac.makePermuteKernels(); final boolean useGrouping; - if (control.considerGrouping(withView, keySources)) { + if (control.considerGrouping(input, keySources)) { Assert.eq(keySources.length, "keySources.length", 1); - final boolean hasGrouping = RowSetIndexer.of(withView.getRowSet()).hasGrouping(keySources[0]); - if (!withView.isRefreshing() && hasGrouping) { - return staticGroupedAggregation(withView, keyNames[0], keySources[0], ac); + final boolean hasGrouping = RowSetIndexer.of(input.getRowSet()).hasGrouping(keySources[0]); + if (!input.isRefreshing() && hasGrouping && initialKeys == null) { + return staticGroupedAggregation(input, keyNames[0], keySources[0], ac); } // we have no hasPrevGrouping method useGrouping = !usePrev && hasGrouping && Arrays.equals(reinterpretedKeySources, keySources); @@ -124,54 +163,25 @@ private static QueryTable aggregation(AggregationControl control, SwapListener s useGrouping = false; } + final MutableInt outputPosition = new MutableInt(); + final Supplier stateManagerSupplier = + () -> makeStateManager(control, input, keySources, reinterpretedKeySources, ac); final OperatorAggregationStateManager stateManager; - final IncrementalOperatorAggregationStateManager incrementalStateManager; - if (withView.isRefreshing()) { - if (USE_OPEN_ADDRESSED_STATE_MANAGER) { - stateManager = incrementalStateManager = TypedHasherFactory.make( - IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.class, - reinterpretedKeySources, - keySources, control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } else if (USE_TYPED_STATE_MANAGER) { - stateManager = incrementalStateManager = TypedHasherFactory.make( - IncrementalChunkedOperatorAggregationStateManagerTypedBase.class, reinterpretedKeySources, - keySources, control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } else { - stateManager = incrementalStateManager = new IncrementalChunkedOperatorAggregationStateManager( - reinterpretedKeySources, control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } + if (initialKeys == null) { + stateManager = stateManagerSupplier.get(); } else { - if (USE_OPEN_ADDRESSED_STATE_MANAGER) { - stateManager = TypedHasherFactory.make( - StaticChunkedOperatorAggregationStateManagerOpenAddressedBase.class, reinterpretedKeySources, - keySources, control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } else if (USE_TYPED_STATE_MANAGER) { - stateManager = TypedHasherFactory.make( - StaticChunkedOperatorAggregationStateManagerTypedBase.class, reinterpretedKeySources, - keySources, control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } else { - stateManager = new StaticChunkedOperatorAggregationStateManager(reinterpretedKeySources, - control.initialHashTableSize(withView), control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); - } - incrementalStateManager = null; + stateManager = initialKeyTableAddition(control, initialKeys, keyNames, ac, outputPosition, + stateManagerSupplier); } - setReverseLookupFunction(keySources, ac, stateManager); - - final MutableInt outputPosition = new MutableInt(); + final RowSetBuilderRandom initialRowsBuilder = + initialKeys != null && !preserveEmpty ? new BitmapRandomBuilder(stateManager.maxTableSize() - 1) : null; if (useGrouping) { - // This must be incremental, otherwise we would have done this earlier - initialGroupedKeyAddition(withView, reinterpretedKeySources, ac, incrementalStateManager, outputPosition, - usePrev); + initialGroupedKeyAddition(input, reinterpretedKeySources, ac, stateManager, outputPosition, + initialRowsBuilder, usePrev); } else { - initialBucketedKeyAddition(withView, reinterpretedKeySources, ac, permuteKernels, stateManager, - outputPosition, usePrev); + initialBucketedKeyAddition(input, reinterpretedKeySources, ac, permuteKernels, stateManager, + outputPosition, initialRowsBuilder, usePrev); } // Construct and return result table @@ -181,7 +191,7 @@ private static QueryTable aggregation(AggregationControl control, SwapListener s // Gather the result key columns final ColumnSource[] keyColumnsRaw = new ColumnSource[keyHashTableSources.length]; final ArrayBackedColumnSource[] keyColumnsCopied = - withView.isRefreshing() ? new ArrayBackedColumnSource[keyHashTableSources.length] : null; + input.isRefreshing() ? new ArrayBackedColumnSource[keyHashTableSources.length] : null; for (int kci = 0; kci < keyHashTableSources.length; ++kci) { ColumnSource resultKeyColumnSource = keyHashTableSources[kci]; if (keySources[kci] != reinterpretedKeySources[kci]) { @@ -189,7 +199,7 @@ private static QueryTable aggregation(AggregationControl control, SwapListener s ReinterpretUtils.convertToOriginal(keySources[kci].getType(), resultKeyColumnSource); } keyColumnsRaw[kci] = resultKeyColumnSource; - if (withView.isRefreshing()) { + if (input.isRefreshing()) { // noinspection ConstantConditions,unchecked keyColumnsCopied[kci] = ArrayBackedColumnSource.getMemoryColumnSource(outputPosition.intValue(), keyColumnsRaw[kci].getType()); @@ -200,9 +210,10 @@ private static QueryTable aggregation(AggregationControl control, SwapListener s } ac.getResultColumns(resultColumnSourceMap); - final TrackingWritableRowSet resultRowSet = - RowSetFactory.flat(outputPosition.intValue()).toTracking(); - if (withView.isRefreshing()) { + final TrackingWritableRowSet resultRowSet = (initialRowsBuilder == null + ? RowSetFactory.flat(outputPosition.intValue()) + : initialRowsBuilder.build()).toTracking(); + if (input.isRefreshing()) { copyKeyColumns(keyColumnsRaw, keyColumnsCopied, resultRowSet); } @@ -210,24 +221,29 @@ private static QueryTable aggregation(AggregationControl control, SwapListener s final QueryTable result = new QueryTable(resultRowSet, resultColumnSourceMap); ac.propagateInitialStateToOperators(result); - if (withView.isRefreshing()) { + if (input.isRefreshing()) { assert keyColumnsCopied != null; ac.startTrackingPrevValues(); + final IncrementalOperatorAggregationStateManager incrementalStateManager = + (IncrementalOperatorAggregationStateManager) stateManager; incrementalStateManager.startTrackingPrevValues(); - final boolean isStream = withView.isStream(); + final boolean isStream = input.isStream(); final TableUpdateListener listener = - new BaseTable.ListenerImpl("by(" + aggregationContextFactory + ")", withView, result) { + new BaseTable.ListenerImpl("by(" + aggregationContextFactory + ")", input, result) { @ReferentialIntegrity final SwapListener swapListenerHardReference = swapListener; - final ModifiedColumnSet keysUpstreamModifiedColumnSet = withView.newModifiedColumnSet(keyNames); + final ModifiedColumnSet keysUpstreamModifiedColumnSet = input.newModifiedColumnSet(keyNames); final ModifiedColumnSet[] operatorInputModifiedColumnSets = - ac.getInputModifiedColumnSets(withView); + ac.getInputModifiedColumnSets(input); final UnaryOperator[] resultModifiedColumnSetFactories = ac.initializeRefreshing(result, this); + final StateChangeRecorder stateChangeRecorder = + preserveEmpty ? null : ac.getStateChangeRecorder(); + @Override public void onUpdate(@NotNull final TableUpdate upstream) { incrementalStateManager.beginUpdateCycle(); @@ -239,9 +255,9 @@ public void onUpdate(@NotNull final TableUpdate upstream) { final TableUpdate downstream; try (final KeyedUpdateContext kuc = new KeyedUpdateContext(ac, incrementalStateManager, reinterpretedKeySources, permuteKernels, keysUpstreamModifiedColumnSet, - operatorInputModifiedColumnSets, - upstreamToUse, outputPosition)) { - downstream = kuc.computeDownstreamIndicesAndCopyKeys(withView.getRowSet(), + operatorInputModifiedColumnSets, stateChangeRecorder, upstreamToUse, + outputPosition)) { + downstream = kuc.computeDownstreamIndicesAndCopyKeys(input.getRowSet(), keyColumnsRaw, keyColumnsCopied, result.getModifiedColumnSetForUpdates(), resultModifiedColumnSetFactories); @@ -276,6 +292,41 @@ public void onFailureInternal(@NotNull final Throwable originalException, Entry return ac.transformResult(result); } + private static OperatorAggregationStateManager makeStateManager( + @NotNull final AggregationControl control, @NotNull final QueryTable input, + @NotNull final ColumnSource[] keySources, @NotNull final ColumnSource[] reinterpretedKeySources, + @NotNull final AggregationContext ac) { + final OperatorAggregationStateManager stateManager; + if (input.isRefreshing()) { + if (USE_OPEN_ADDRESSED_STATE_MANAGER) { + stateManager = TypedHasherFactory.make( + IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.class, + reinterpretedKeySources, + keySources, control.initialHashTableSize(input), control.getMaximumLoadFactor(), + control.getTargetLoadFactor()); + } else { + stateManager = TypedHasherFactory.make( + IncrementalChunkedOperatorAggregationStateManagerTypedBase.class, reinterpretedKeySources, + keySources, control.initialHashTableSize(input), control.getMaximumLoadFactor(), + control.getTargetLoadFactor()); + } + } else { + if (USE_OPEN_ADDRESSED_STATE_MANAGER) { + stateManager = TypedHasherFactory.make( + StaticChunkedOperatorAggregationStateManagerOpenAddressedBase.class, reinterpretedKeySources, + keySources, control.initialHashTableSize(input), control.getMaximumLoadFactor(), + control.getTargetLoadFactor()); + } else { + stateManager = TypedHasherFactory.make( + StaticChunkedOperatorAggregationStateManagerTypedBase.class, reinterpretedKeySources, + keySources, control.initialHashTableSize(input), control.getMaximumLoadFactor(), + control.getTargetLoadFactor()); + } + } + setReverseLookupFunction(keySources, ac, stateManager); + return stateManager; + } + private static TableUpdate adjustForStreaming(@NotNull final TableUpdate upstream) { // Streaming aggregations never have modifies or shifts from their parent: Assert.assertion(upstream.modified().isEmpty() && upstream.shifted().empty(), @@ -335,6 +386,7 @@ private static class KeyedUpdateContext implements SafeCloseable { private final IncrementalOperatorAggregationStateManager incrementalStateManager; private final ColumnSource[] reinterpretedKeySources; private final PermuteKernel[] permuteKernels; + private final StateChangeRecorder stateChangeRecorder; private final TableUpdate upstream; // Not to be mutated private final MutableInt outputPosition; @@ -344,9 +396,9 @@ private static class KeyedUpdateContext implements SafeCloseable { private final boolean processShifts; private final OperatorDivision od; + private final RowSetBuilderRandom reincarnatedStatesBuilder; private final RowSetBuilderRandom emptiedStatesBuilder; private final RowSetBuilderRandom modifiedStatesBuilder; - private final RowSetBuilderRandom reincarnatedStatesBuilder; private final boolean[] modifiedOperators; private final SafeCloseableList toClose; @@ -382,11 +434,9 @@ private static class KeyedUpdateContext implements SafeCloseable { private final SafeCloseable bc; private final int buildChunkSize; - private final WritableIntChunk reincarnatedSlots; private final SafeCloseable pc; private final int probeChunkSize; - private final WritableIntChunk emptiedSlots; private KeyedUpdateContext(@NotNull final AggregationContext ac, @NotNull final IncrementalOperatorAggregationStateManager incrementalStateManager, @@ -394,12 +444,14 @@ private KeyedUpdateContext(@NotNull final AggregationContext ac, @NotNull final PermuteKernel[] permuteKernels, @NotNull final ModifiedColumnSet keysUpstreamModifiedColumnSet, @NotNull final ModifiedColumnSet[] operatorInputUpstreamModifiedColumnSets, + @Nullable final StateChangeRecorder stateChangeRecorder, @NotNull final TableUpdate upstream, @NotNull final MutableInt outputPosition) { this.ac = ac; this.incrementalStateManager = incrementalStateManager; this.reinterpretedKeySources = reinterpretedKeySources; this.permuteKernels = permuteKernels; + this.stateChangeRecorder = stateChangeRecorder; this.upstream = upstream; this.outputPosition = outputPosition; @@ -425,13 +477,15 @@ private KeyedUpdateContext(@NotNull final AggregationContext ac, probeChunkSize = chunkSize(probeSize); final int chunkSize = Math.max(buildChunkSize, probeChunkSize); - emptiedStatesBuilder = RowSetFactory.builderRandom(); - if (USE_BITMAP_MODIFIED_STATES_BUILDER) { - modifiedStatesBuilder = new BitmapRandomBuilder(outputPosition.intValue()); + if (stateChangeRecorder != null) { + reincarnatedStatesBuilder = RowSetFactory.builderRandom(); + emptiedStatesBuilder = RowSetFactory.builderRandom(); + stateChangeRecorder.startRecording(reincarnatedStatesBuilder::addKey, emptiedStatesBuilder::addKey); } else { - modifiedStatesBuilder = RowSetFactory.builderRandom(); + reincarnatedStatesBuilder = new EmptyRandomBuilder(); + emptiedStatesBuilder = new EmptyRandomBuilder(); } - reincarnatedStatesBuilder = RowSetFactory.builderRandom(); + modifiedStatesBuilder = new BitmapRandomBuilder(outputPosition.intValue()); modifiedOperators = new boolean[ac.size()]; toClose = new SafeCloseableList(); @@ -487,21 +541,14 @@ private KeyedUpdateContext(@NotNull final AggregationContext ac, if (buildSize > 0) { bc = toClose.add( incrementalStateManager.makeAggregationStateBuildContext(reinterpretedKeySources, buildSize)); - reincarnatedSlots = toClose.add(WritableIntChunk.makeWritableChunk(buildChunkSize)); } else { bc = null; - reincarnatedSlots = null; } if (probeSize > 0) { pc = toClose.add(incrementalStateManager.makeProbeContext(reinterpretedKeySources, probeSize)); } else { pc = null; } - if (upstream.removed().isNonempty() || keysModified) { - emptiedSlots = toClose.add(WritableIntChunk.makeWritableChunk(probeChunkSize)); - } else { - emptiedSlots = null; - } } @Override @@ -607,10 +654,13 @@ private TableUpdate computeDownstreamIndicesAndCopyKeys( doInserts(upstream.added(), true); } + if (stateChangeRecorder != null) { + stateChangeRecorder.finishRecording(); + } final TableUpdateImpl downstream = new TableUpdateImpl(); downstream.shifted = RowSetShiftData.EMPTY; - try (final RowSet newStates = makeNewStatesIndex(previousLastState, outputPosition.intValue() - 1)) { + try (final RowSet newStates = makeNewStatesRowSet(previousLastState, outputPosition.intValue() - 1)) { downstream.added = reincarnatedStatesBuilder.build(); downstream.removed = emptiedStatesBuilder.build(); @@ -649,10 +699,7 @@ private void doRemoves(@NotNull final RowSequence keyIndicesToRemove) { } private void doRemovesForChunk(@NotNull final RowSequence keyIndicesToRemoveChunk) { - - incrementalStateManager.remove(pc, keyIndicesToRemoveChunk, reinterpretedKeySources, slots, emptiedSlots); - emptiedStatesBuilder.addRowKeysChunk(emptiedSlots); - + incrementalStateManager.remove(pc, keyIndicesToRemoveChunk, reinterpretedKeySources, slots); propagateRemovesToOperators(keyIndicesToRemoveChunk, slots); } @@ -722,13 +769,11 @@ private void doInserts(@NotNull final RowSequence keyIndicesToInsert, final bool private void doInsertsForChunk(@NotNull final RowSequence keyIndicesToInsertChunk, final boolean addToStateManager) { if (addToStateManager) { - incrementalStateManager.addForUpdate(bc, keyIndicesToInsertChunk, reinterpretedKeySources, - outputPosition, slots, reincarnatedSlots); - reincarnatedStatesBuilder.addRowKeysChunk(reincarnatedSlots); + incrementalStateManager.add(bc, keyIndicesToInsertChunk, reinterpretedKeySources, outputPosition, + slots); } else { incrementalStateManager.findModifications(pc, keyIndicesToInsertChunk, reinterpretedKeySources, slots); } - propagateInsertsToOperators(keyIndicesToInsertChunk, slots); } @@ -1120,12 +1165,9 @@ private ModifySplitResult splitKeyModificationsAndDoKeyChangeRemoves() { shifted ? modifiedPostShiftIterator.getNextRowSequenceWithLength(CHUNK_SIZE) : modifiedPreShiftChunk; - incrementalStateManager.remove(pc, modifiedPreShiftChunk, reinterpretedKeySources, slots, - emptiedSlots); - emptiedStatesBuilder.addRowKeysChunk(emptiedSlots); - incrementalStateManager.addForUpdate(bc, modifiedPostShiftChunk, reinterpretedKeySources, - outputPosition, postSlots, reincarnatedSlots); - reincarnatedStatesBuilder.addRowKeysChunk(reincarnatedSlots); + incrementalStateManager.remove(pc, modifiedPreShiftChunk, reinterpretedKeySources, slots); + incrementalStateManager.add(bc, modifiedPostShiftChunk, reinterpretedKeySources, outputPosition, + postSlots); final LongChunk preShiftIndices = modifiedPreShiftChunk.asRowKeyChunk(); final LongChunk postShiftIndices = @@ -1547,7 +1589,7 @@ private static QueryTable staticGroupedAggregation(QueryTable withView, String k resultColumnSourceMap.put(keyName, groupKeyIndexTable.first); ac.getResultColumns(resultColumnSourceMap); - doGroupedAddition(ac, groupKeyIndexTable, responsiveGroups); + doGroupedAddition(ac, groupKeyIndexTable.second::get, responsiveGroups, CHUNK_SIZE); final QueryTable result = new QueryTable(RowSetFactory.flat(responsiveGroups).toTracking(), resultColumnSourceMap); @@ -1559,8 +1601,11 @@ private static QueryTable staticGroupedAggregation(QueryTable withView, String k return ac.transformResult(result); } - private static void doGroupedAddition(AggregationContext ac, - Pair> groupKeyIndexTable, int responsiveGroups) { + private static void doGroupedAddition( + @NotNull final AggregationContext ac, + @NotNull final LongFunction groupIndexToRowSet, + final int responsiveGroups, + final int chunkSize) { final boolean indicesRequired = ac.requiresIndices(); final ColumnSource.GetContext[] getContexts = new ColumnSource.GetContext[ac.size()]; @@ -1570,31 +1615,28 @@ private static void doGroupedAddition(AggregationContext ac, final SafeCloseable ignored2 = new SafeCloseableArray<>(operatorContexts); final SharedContext sharedContext = SharedContext.makeSharedContext()) { ac.ensureCapacity(responsiveGroups); - // we don't know how many things are in the groups, so we have to allocate a large chunk - ac.initializeGetContexts(sharedContext, getContexts, CHUNK_SIZE); - ac.initializeSingletonContexts(operatorContexts, CHUNK_SIZE); + ac.initializeGetContexts(sharedContext, getContexts, chunkSize); + ac.initializeSingletonContexts(operatorContexts, chunkSize); final boolean unchunked = !ac.requiresInputs() && ac.unchunkedIndices(); if (unchunked) { for (int ii = 0; ii < responsiveGroups; ++ii) { - final RowSet rowSet = groupKeyIndexTable.second.get(ii); + final RowSet rowSet = groupIndexToRowSet.apply(ii); for (int oi = 0; oi < ac.size(); ++oi) { ac.operators[oi].addRowSet(operatorContexts[oi], rowSet, ii); } } } else { + // noinspection unchecked + final Chunk[] workingChunks = new Chunk[ac.size()]; for (int ii = 0; ii < responsiveGroups; ++ii) { - final RowSet rowSet = groupKeyIndexTable.second.get(ii); - // noinspection ConstantConditions + final RowSet rowSet = groupIndexToRowSet.apply(ii); try (final RowSequence.Iterator rsIt = rowSet.getRowSequenceIterator()) { - // noinspection unchecked - final Chunk[] workingChunks = new Chunk[ac.size()]; - - while (rsIt.hasMore()) { - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(CHUNK_SIZE); - final int chunkSize = chunkOk.intSize(); + do { + final RowSequence chunkRows = rsIt.getNextRowSequenceWithLength(chunkSize); + final int chunkRowsSize = chunkRows.intSize(); final LongChunk keyIndices = - indicesRequired ? chunkOk.asRowKeyChunk() : null; + indicesRequired ? chunkRows.asRowKeyChunk() : null; sharedContext.reset(); Arrays.fill(workingChunks, null); @@ -1603,24 +1645,113 @@ private static void doGroupedAddition(AggregationContext ac, final int inputSlot = ac.inputSlot(oi); if (inputSlot == oi) { workingChunks[inputSlot] = ac.inputColumns[oi] == null ? null - : ac.inputColumns[oi].getChunk(getContexts[oi], chunkOk); + : ac.inputColumns[oi].getChunk(getContexts[oi], chunkRows); } - ac.operators[oi].addChunk(operatorContexts[oi], chunkSize, + ac.operators[oi].addChunk(operatorContexts[oi], chunkRowsSize, inputSlot < 0 ? null : workingChunks[inputSlot], keyIndices, ii); } - } + } while (rsIt.hasMore()); } } } } } - private static void initialBucketedKeyAddition(QueryTable withView, + private static OperatorAggregationStateManager initialKeyTableAddition( + @NotNull final AggregationControl control, + @NotNull final Table initialKeys, + @NotNull final String[] keyColumnNames, + @NotNull final AggregationContext ac, + @NotNull final MutableInt outputPosition, + @NotNull final Supplier stateManagerSupplier) { + // This logic is duplicative of the logic in the main aggregation function, but it's hard to consolidate + // further. A better strategy might be to do a selectDistinct first, but that would result in more hash table + // inserts. + final ColumnSource[] keySources = Arrays.stream(keyColumnNames) + .map(initialKeys::getColumnSource) + .toArray(ColumnSource[]::new); + final ColumnSource[] reinterpretedKeySources = Arrays.stream(keyColumnNames) + .map(initialKeys::getColumnSource) + .map(ReinterpretUtils::maybeConvertToPrimitive) + .toArray(ColumnSource[]::new); + final boolean useGroupingAllowed = control.considerGrouping(initialKeys, keySources) + && keySources.length == 1 + && reinterpretedKeySources[0] == keySources[0]; + + final OperatorAggregationStateManager stateManager; + if (initialKeys.isRefreshing()) { + final MutableObject stateManagerHolder = new MutableObject<>(); + ConstructSnapshot.callDataSnapshotFunction( + "InitialKeyTableSnapshot-" + System.identityHashCode(initialKeys) + ": ", + ConstructSnapshot.makeSnapshotControl(false, true, (NotificationStepSource) initialKeys), + (final boolean usePrev, final long beforeClockValue) -> { + stateManagerHolder.setValue(makeInitializedStateManager(initialKeys, reinterpretedKeySources, + ac, outputPosition, stateManagerSupplier, useGroupingAllowed, usePrev)); + return true; + }); + stateManager = stateManagerHolder.getValue(); + } else { + stateManager = makeInitializedStateManager(initialKeys, reinterpretedKeySources, + ac, outputPosition, stateManagerSupplier, useGroupingAllowed, false); + } + try (final RowSet empty = RowSetFactory.empty()) { + doGroupedAddition(ac, gi -> empty, outputPosition.intValue(), 0); + } + return stateManager; + } + + private static OperatorAggregationStateManager makeInitializedStateManager( + @NotNull final Table initialKeys, + @NotNull ColumnSource[] reinterpretedKeySources, + @NotNull final AggregationContext ac, + @NotNull final MutableInt outputPosition, + @NotNull final Supplier stateManagerSupplier, + final boolean useGroupingAllowed, + final boolean usePrev) { + outputPosition.setValue(0); + final OperatorAggregationStateManager stateManager = stateManagerSupplier.get(); + + final ColumnSource[] keyColumnsToInsert; + final boolean closeRowsToInsert; + final RowSequence rowsToInsert; + final RowSetIndexer groupingIndexer = useGroupingAllowed && (!initialKeys.isRefreshing() || !usePrev) + ? RowSetIndexer.of(initialKeys.getRowSet()) + : null; + if (groupingIndexer != null && groupingIndexer.hasGrouping(reinterpretedKeySources[0])) { + final ColumnSource groupedSource = reinterpretedKeySources[0]; + final Map grouping = groupingIndexer.getGrouping(groupedSource); + // noinspection unchecked + keyColumnsToInsert = new ColumnSource[] { + GroupingUtils.groupingKeysToImmutableFlatSource(groupedSource, grouping)}; + closeRowsToInsert = true; + // noinspection resource + rowsToInsert = RowSequenceFactory.forRange(0, grouping.size() - 1); + } else { + keyColumnsToInsert = reinterpretedKeySources; + closeRowsToInsert = usePrev; + rowsToInsert = usePrev ? initialKeys.getRowSet().copyPrev() : initialKeys.getRowSet(); + } + + final int chunkSize = chunkSize(rowsToInsert.size()); + try (final SafeCloseable ignored = closeRowsToInsert ? rowsToInsert : null; + final SafeCloseable bc = stateManager.makeAggregationStateBuildContext(keyColumnsToInsert, chunkSize); + final RowSequence.Iterator rowsIterator = rowsToInsert.getRowSequenceIterator(); + final WritableIntChunk outputPositions = WritableIntChunk.makeWritableChunk(chunkSize)) { + while (rowsIterator.hasMore()) { + final RowSequence chunkRows = rowsIterator.getNextRowSequenceWithLength(chunkSize); + stateManager.add(bc, chunkRows, keyColumnsToInsert, outputPosition, outputPositions); + } + } + return stateManager; + } + + private static void initialBucketedKeyAddition(QueryTable input, ColumnSource[] reinterpretedKeySources, AggregationContext ac, PermuteKernel[] permuteKernels, OperatorAggregationStateManager stateManager, MutableInt outputPosition, + RowSetBuilderRandom initialRowsBuilder, boolean usePrev) { final boolean findRuns = ac.requiresRunFinds(SKIP_RUN_FIND); @@ -1639,7 +1770,7 @@ private static void initialBucketedKeyAddition(QueryTable withView, buildSources = reinterpretedKeySources; } - final RowSet rowSet = usePrev ? withView.getRowSet().copyPrev() : withView.getRowSet(); + final RowSet rowSet = usePrev ? input.getRowSet().copyPrev() : input.getRowSet(); if (rowSet.isEmpty()) { return; @@ -1677,6 +1808,9 @@ private static void initialBucketedKeyAddition(QueryTable withView, sharedContext.reset(); stateManager.add(bc, chunkOk, buildSources, outputPosition, outputPositions); + if (initialRowsBuilder != null) { + initialRowsBuilder.addRowKeysChunk(outputPositions); + } ac.ensureCapacity(outputPosition.intValue()); @@ -1714,14 +1848,15 @@ private static void initialBucketedKeyAddition(QueryTable withView, } } - private static void initialGroupedKeyAddition(QueryTable withView, + private static void initialGroupedKeyAddition(QueryTable input, ColumnSource[] reinterpretedKeySources, AggregationContext ac, - IncrementalOperatorAggregationStateManager stateManager, + OperatorAggregationStateManager stateManager, MutableInt outputPosition, + RowSetBuilderRandom initialRowsBuilder, boolean usePrev) { final Pair> groupKeyIndexTable; - final RowSetIndexer indexer = RowSetIndexer.of(withView.getRowSet()); + final RowSetIndexer indexer = RowSetIndexer.of(input.getRowSet()); final Map grouping = usePrev ? indexer.getPrevGrouping(reinterpretedKeySources[0]) : indexer.getGrouping(reinterpretedKeySources[0]); // noinspection unchecked @@ -1746,22 +1881,18 @@ private static void initialGroupedKeyAddition(QueryTable withView, while (rsIt.hasMore()) { final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(CHUNK_SIZE); stateManager.add(bc, chunkOk, groupedFlatKeySource, outputPosition, outputPositions); + if (initialRowsBuilder != null) { + initialRowsBuilder.addRowKeysChunk(outputPositions); + } } Assert.eq(outputPosition.intValue(), "outputPosition.intValue()", responsiveGroups, "responsiveGroups"); } - for (int ii = 0; ii < responsiveGroups; ++ii) { - // noinspection ConstantConditions - final long groupSize = groupKeyIndexTable.second.get(ii).size(); - stateManager.setRowSize(ii, groupSize); - } - - doGroupedAddition(ac, groupKeyIndexTable, responsiveGroups); + doGroupedAddition(ac, groupKeyIndexTable.second::get, responsiveGroups, CHUNK_SIZE); } - private static RowSet makeNewStatesIndex(final int first, final int last) { - return first > last ? RowSetFactory.empty() - : RowSetFactory.fromRange(first, last); + private static RowSet makeNewStatesRowSet(final int first, final int last) { + return first > last ? RowSetFactory.empty() : RowSetFactory.fromRange(first, last); } private static void copyKeyColumns(ColumnSource[] keyColumnsRaw, WritableColumnSource[] keyColumnsCopied, @@ -1794,10 +1925,14 @@ private static void copyKeyColumns(ColumnSource[] keyColumnsRaw, WritableColu } } - private static QueryTable noKeyAggregation(SwapListener swapListener, - AggregationContextFactory aggregationContextFactory, QueryTable table, boolean usePrev) { + private static QueryTable noKeyAggregation( + @Nullable final SwapListener swapListener, + @NotNull final AggregationContextFactory aggregationContextFactory, + @NotNull final QueryTable table, + final boolean preserveEmpty, + final boolean usePrev) { - final AggregationContext ac = aggregationContextFactory.makeAggregationContext(table); + final AggregationContext ac = aggregationContextFactory.makeAggregationContext(table, false); final Map> resultColumnSourceMap = new LinkedHashMap<>(); ac.getResultColumns(resultColumnSourceMap); @@ -1815,7 +1950,7 @@ private static QueryTable noKeyAggregation(SwapListener swapListener, final int initialResultSize; try (final SafeCloseable ignored1 = new SafeCloseableArray<>(opContexts); final SafeCloseable ignored2 = usePrev ? rowSet : null) { - initialResultSize = rowSet.size() == 0 ? 0 : 1; + initialResultSize = preserveEmpty || rowSet.size() != 0 ? 1 : 0; ac.initializeSingletonContexts(opContexts, rowSet.size()); doNoKeyAddition(rowSet, ac, opContexts, allColumns, usePrev, allColumns); } @@ -1932,7 +2067,8 @@ private void processNoKeyUpdate(@NotNull final TableUpdate upstream) { modifiedOperators); } - final int newResultSize = (!isStream || lastSize == 0) && table.size() == 0 ? 0 : 1; + final int newResultSize = + preserveEmpty || (isStream && lastSize != 0) || table.size() != 0 ? 1 : 0; final TableUpdateImpl downstream = new TableUpdateImpl(); downstream.shifted = RowSetShiftData.EMPTY; if ((lastSize == 0 && newResultSize == 1)) { @@ -1958,7 +2094,7 @@ private void processNoKeyUpdate(@NotNull final TableUpdate upstream) { final int newStatesCreated = Math.max(statesCreated, newResultSize); try (final RowSet newStates = - makeNewStatesIndex(statesCreated, newStatesCreated - 1)) { + makeNewStatesRowSet(statesCreated, newStatesCreated - 1)) { ac.propagateChangesToOperators(downstream, newStates); } statesCreated = newStatesCreated; @@ -2237,6 +2373,30 @@ public static int chunkSize(long size) { return (int) Math.min(size, CHUNK_SIZE); } + /** + * {@link RowSetBuilderRandom} that ignores added keys and always {@link RowSetBuilderRandom#build() builds} an + * {@link RowSetFactory#empty() empty} result. + */ + private static class EmptyRandomBuilder implements RowSetBuilderRandom { + + @Override + public WritableRowSet build() { + return RowSetFactory.empty(); + } + + @Override + public void addKey(long rowKey) { + // This class expects to never process any adds. + throw new UnsupportedOperationException(); + } + + @Override + public void addRange(final long firstRowKey, final long lastRowKey) { + // This class expects to never process any adds. + throw new UnsupportedOperationException(); + } + } + /** * The output RowSet of an aggregation is fairly special. It is always from zero to the number of output rows, and * while modifying states we randomly add rows to it, potentially touching the same state many times. The normal @@ -2253,9 +2413,25 @@ public static int chunkSize(long size) { * for the builder to the maximum output position without loss of fidelity. */ private static class BitmapRandomBuilder implements RowSetBuilderRandom { + + /** + * An upper bound on {@code lastUsed}. That is, the highest bit index that may be used in {@code bitset}. + */ final int maxKey; + + /** + * The lowest set bit index in {@code bitset}. + */ int firstUsed = Integer.MAX_VALUE; + + /** + * The highest set bit index in {@code bitset}. + */ int lastUsed = -1; + + /** + * The bitset itself. + */ long[] bitset; private BitmapRandomBuilder(int maxKey) { @@ -2285,7 +2461,7 @@ public WritableRowSet build() { } @Override - public void addKey(long rowKey) { + public void addKey(final long rowKey) { if (rowKey >= maxKey) { return; } @@ -2303,7 +2479,8 @@ public void addKey(long rowKey) { } @Override - public void addRange(long firstRowKey, long lastRowKey) { + public void addRange(final long firstRowKey, final long lastRowKey) { + // This class is used only with aggregation state managers, which never call addRange. throw new UnsupportedOperationException(); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CountAggregationOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CountAggregationOperator.java index f87968b38e8..6481d112a59 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CountAggregationOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CountAggregationOperator.java @@ -6,24 +6,49 @@ import io.deephaven.chunk.attributes.ChunkLengths; import io.deephaven.chunk.attributes.ChunkPositions; import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.util.NullSafeAddition; +import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.chunk.*; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.Map; -class CountAggregationOperator implements IterativeChunkedAggregationOperator { +class CountAggregationOperator extends BasicStateChangeRecorder implements IterativeChunkedAggregationOperator { + private final String resultName; private final LongArraySource countColumnSource; - CountAggregationOperator(String resultName) { + /** + * Construct a count aggregation operator. + * + * @param resultName The name of the result column if this operator should expose its results, else {@code null} + */ + CountAggregationOperator(@Nullable final String resultName) { this.resultName = resultName; this.countColumnSource = new LongArraySource(); } + private boolean exposesResult() { + return resultName != null; + } + + private void recordAdd(final long destination, final long rowsAdded) { + final long oldCount = countColumnSource.getAndAddUnsafe(destination, rowsAdded); + if (oldCount == 0) { + onReincarnated(destination); + } + } + + private void recordRemove(final long destination, final long rowsRemoved) { + final long oldCount = countColumnSource.getAndAddUnsafe(destination, -rowsRemoved); + if (oldCount == rowsRemoved) { + onEmptied(destination); + } + } + @Override public void addChunk(BucketedContext context, Chunk values, LongChunk inputRowKeys, IntChunk destinations, @@ -32,10 +57,12 @@ public void addChunk(BucketedContext context, Chunk values, for (int ii = 0; ii < startPositions.size(); ++ii) { final int startPosition = startPositions.get(ii); final long destination = destinations.get(startPosition); - final long newCount = length.get(ii); - countColumnSource.getAndAddUnsafe(destination, newCount); + final long rowsAdded = length.get(ii); + recordAdd(destination, rowsAdded); + } + if (exposesResult()) { + stateModified.fillWithValue(0, startPositions.size(), true); } - stateModified.fillWithValue(0, startPositions.size(), true); } @Override @@ -46,23 +73,39 @@ public void removeChunk(BucketedContext context, Chunk values, for (int ii = 0; ii < startPositions.size(); ++ii) { final int startPosition = startPositions.get(ii); final long destination = destinations.get(startPosition); - final long newCount = length.get(ii); - countColumnSource.getAndAddUnsafe(destination, -newCount); + final long rowsRemoved = length.get(ii); + recordRemove(destination, rowsRemoved); + } + if (exposesResult()) { + stateModified.fillWithValue(0, startPositions.size(), true); } - stateModified.fillWithValue(0, startPositions.size(), true); } @Override public boolean addChunk(SingletonContext context, int chunkSize, Chunk values, LongChunk inputRowKeys, long destination) { - countColumnSource.getAndAddUnsafe(destination, chunkSize); + recordAdd(destination, chunkSize); return true; } @Override public boolean removeChunk(SingletonContext context, int chunkSize, Chunk values, LongChunk inputRowKeys, long destination) { - countColumnSource.getAndAddUnsafe(destination, -chunkSize); + recordRemove(destination, chunkSize); + return true; + } + + @Override + public boolean unchunkedRowSet() { + // Optimize initial grouped addition by accepting un-chunked row sets in lieu of iterative calls to + // addChunk with null values and null inputRowKeys. + // NB: Count is unusual in allowing this while returning false for requiresRowKeys(). + return true; + } + + @Override + public boolean addRowSet(SingletonContext context, RowSet rowSet, long destination) { + recordAdd(destination, rowSet.size()); return true; } @@ -71,13 +114,15 @@ public void modifyChunk(BucketedContext context, Chunk previou Chunk newValues, LongChunk postShiftRowKeys, IntChunk destinations, IntChunk startPositions, IntChunk length, WritableBooleanChunk stateModified) { - stateModified.fillWithValue(0, startPositions.size(), false); + // We have no inputs, so we should never get here. + throw new IllegalStateException(); } @Override public boolean modifyChunk(SingletonContext context, int chunkSize, Chunk previousValues, Chunk newValues, LongChunk postShiftRowKeys, long destination) { - return false; + // We have no inputs, so we should never get here. + throw new IllegalStateException(); } @Override @@ -87,11 +132,13 @@ public void ensureCapacity(long tableSize) { @Override public Map> getResultColumns() { - return Collections.singletonMap(resultName, countColumnSource); + return exposesResult() ? Collections.singletonMap(resultName, countColumnSource) : Collections.emptyMap(); } @Override public void startTrackingPrevValues() { - countColumnSource.startTrackingPrevValues(); + if (exposesResult()) { + countColumnSource.startTrackingPrevValues(); + } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FirstOrLastChunkedOperator.java index d697820c0df..2769566928d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FirstOrLastChunkedOperator.java @@ -24,7 +24,10 @@ import java.util.LinkedHashMap; import java.util.Map; -public class FirstOrLastChunkedOperator implements IterativeChunkedAggregationOperator { +public class FirstOrLastChunkedOperator + extends BasicStateChangeRecorder + implements IterativeChunkedAggregationOperator { + private final boolean isFirst; private final LongArraySource redirections; private final ObjectArraySource rowSets; @@ -202,7 +205,12 @@ private boolean hasRedirection(LongChunk indices, long redire private boolean addChunk(LongChunk indices, int start, int length, long destination) { final WritableRowSet rowSet = rowSetForSlot(destination); + + final boolean wasEmpty = rowSet.isEmpty(); rowSet.insert(indices, start, length); + if (wasEmpty && rowSet.isNonempty()) { + onReincarnated(destination); + } return updateRedirections(destination, rowSet); } @@ -214,7 +222,11 @@ public boolean addRowSet(SingletonContext context, RowSet addRowSet, long destin } final WritableRowSet rowSet = rowSetForSlot(destination); + final boolean wasEmpty = rowSet.isEmpty(); rowSet.insert(addRowSet); + if (wasEmpty && rowSet.isNonempty()) { + onReincarnated(destination); + } return updateRedirections(destination, rowSet); } @@ -229,7 +241,12 @@ private WritableRowSet rowSetForSlot(long destination) { private boolean removeChunk(LongChunk indices, int start, int length, long destination) { final WritableRowSet rowSet = rowSetForSlot(destination); + + final boolean wasNonEmpty = rowSet.isNonempty(); rowSet.remove(indices, start, length); + if (wasNonEmpty && rowSet.isEmpty()) { + onEmptied(destination); + } return updateRedirections(destination, rowSet); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java index 915e498fc78..edf352154c2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java @@ -28,6 +28,7 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; +import java.util.function.LongConsumer; import java.util.function.UnaryOperator; import static io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource.BLOCK_SIZE; @@ -35,7 +36,7 @@ /** * An {@link IterativeChunkedAggregationOperator} used in the implementation of {@link Table#applyToAllBy}. */ -class FormulaChunkedOperator implements IterativeChunkedAggregationOperator { +class FormulaChunkedOperator implements StateChangeRecorder, IterativeChunkedAggregationOperator { private final GroupByChunkedOperator groupBy; private final boolean delegateToBy; @@ -100,6 +101,16 @@ class FormulaChunkedOperator implements IterativeChunkedAggregationOperator { } } + @Override + public void startRecording(LongConsumer reincarnatedDestinationCallback, LongConsumer emptiedDestinationCallback) { + groupBy.startRecording(reincarnatedDestinationCallback, emptiedDestinationCallback); + } + + @Override + public void finishRecording() { + groupBy.finishRecording(); + } + @Override public void addChunk(final BucketedContext bucketedContext, final Chunk values, @NotNull final LongChunk inputRowKeys, @@ -336,10 +347,7 @@ public void propagateUpdates(@NotNull final TableUpdate downstream, modifiesToProcess ? makeModifiedColumnsMask(resultModifiedColumnSet) : null; final boolean[] columnsToFillMask = addsToProcess ? makeAllColumnsMask() : removesToProcess ? makeObjectOrModifiedColumnsMask(resultModifiedColumnSet) : modifiedColumnsMask; - final boolean[] columnsToGetMask = addsToProcess ? columnsToFillMask /* - * This is the result of - * makeAllColumnsMask() on the line above - */ : modifiedColumnsMask; + final boolean[] columnsToGetMask = addsToProcess ? columnsToFillMask : modifiedColumnsMask; try (final DataCopyContext dataCopyContext = new DataCopyContext(columnsToFillMask, columnsToGetMask)) { if (removesToProcess) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java index 5ad50c23703..eed663374c5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java @@ -33,7 +33,9 @@ * An {@link IterativeChunkedAggregationOperator} used in the implementation of {@link Table#groupBy}, * {@link io.deephaven.api.agg.spec.AggSpecGroup}, and {@link io.deephaven.api.agg.Aggregation#AggGroup(String...)}. */ -public final class GroupByChunkedOperator implements IterativeChunkedAggregationOperator { +public final class GroupByChunkedOperator + extends BasicStateChangeRecorder + implements IterativeChunkedAggregationOperator { private final QueryTable inputTable; private final boolean registeredWithHelper; @@ -213,17 +215,30 @@ public boolean modifyRowKeys(final SingletonContext context, @NotNull final Long private void addChunk(@NotNull final LongChunk indices, final int start, final int length, final long destination) { final WritableRowSet rowSet = rowSetForSlot(destination); + final boolean wasEmpty = rowSet.isEmpty(); rowSet.insert(indices, start, length); + if (wasEmpty && rowSet.isNonempty()) { + onReincarnated(destination); + } } private void addRowsToSlot(@NotNull final RowSet addRowSet, final long destination) { - rowSetForSlot(destination).insert(addRowSet); + final WritableRowSet rowSet = rowSetForSlot(destination); + final boolean wasEmpty = rowSet.isEmpty(); + rowSet.insert(addRowSet); + if (wasEmpty && rowSet.isNonempty()) { + onReincarnated(destination); + } } private void removeChunk(@NotNull final LongChunk indices, final int start, final int length, final long destination) { final WritableRowSet rowSet = rowSetForSlot(destination); + final boolean wasNonEmpty = rowSet.isNonempty(); rowSet.remove(indices, start, length); + if (wasNonEmpty && rowSet.isEmpty()) { + onEmptied(destination); + } } private void doShift(@NotNull final LongChunk preShiftIndices, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManager.java deleted file mode 100644 index 4bfd834bdd7..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManager.java +++ /dev/null @@ -1,1791 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.by; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QIntChunk\E -import io.deephaven.chunk.util.hashing.IntChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QInt\E -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.engine.table.impl.HashTableAnnotations; -import io.deephaven.util.SafeCloseable; -import org.apache.commons.lang3.mutable.MutableInt; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -public -// endregion class visibility -class IncrementalChunkedOperatorAggregationStateManager - // region extensions - implements IncrementalOperatorAggregationStateManager - // endregion extensions -{ - // region constants - public static final int CHUNK_SIZE = ChunkedOperatorAggregationHelper.CHUNK_SIZE; - public static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = HashTableColumnSource.MINIMUM_OVERFLOW_HASH_SLOT; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_INT\E, @StateValueType@ from \Qint\E - private static final int EMPTY_RIGHT_VALUE = QueryConstants.NULL_INT; - - // mixin getStateValue - // region overflow pivot - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

    When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

    - * - *

    This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

    - */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource stateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - // in position space - private final LongArraySource rowCountSource = new LongArraySource(); - - private final IntegerArraySource outputPositionToHashSlot = new IntegerArraySource(); - private final WritableRowRedirection resultIndexToHashSlot = new IntColumnSourceWritableRowRedirection(outputPositionToHashSlot); - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - IncrementalChunkedOperatorAggregationStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , double maximumLoadFactor - , double targetLoadFactor - // endregion constructor arguments - ) { - // region super - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - this.maximumLoadFactor = maximumLoadFactor; - this.targetLoadFactor = targetLoadFactor; - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - // endregion ensureOverflowCapacity - } - - // region build wrappers - @Override - public void beginUpdateCycle() { - } - - @Override - public void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, MutableInt nextOutputPosition, WritableIntChunk outputPositions) { - if (rowSequence.isEmpty()) { - return; - } - buildTable((BuildContext) bc, rowSequence, sources, nextOutputPosition, outputPositions, null); - } - - @Override - public void addForUpdate(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, MutableInt nextOutputPosition, WritableIntChunk outputPositions, WritableIntChunk reincarnatedPositions) { - if (rowSequence.isEmpty()) { - return; - } - buildTable((BuildContext) bc, rowSequence, sources, nextOutputPosition, outputPositions, reincarnatedPositions); - } - - @Override - public BuildContext makeAggregationStateBuildContext(ColumnSource[] buildSources, long maxSize) { - return makeBuildContext(buildSources, maxSize); - } - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E, @WritableStateChunkName@ from \QWritableIntChunk\E - final ResettableWritableIntChunk writeThroughState = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - final WritableIntChunk duplicatePositions; - final WritableLongChunk addedSlotsByPosition; - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - duplicatePositions = WritableIntChunk.makeWritableChunk(chunkSize * 2); - addedSlotsByPosition = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - duplicatePositions.close(); - addedSlotsByPosition.close(); - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final MutableInt nextOutputPosition - , final WritableIntChunk outputPositions - , @Nullable final WritableIntChunk reincarnatedPositions - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - - outputPositions.setSize(buildIndex.intSize()); - int maxAddedPosition = -1; - bc.addedSlotsByPosition.setSize(outputPositions.size()); - bc.addedSlotsByPosition.fillWithValue(0, bc.addedSlotsByPosition.size(), RowSequence.NULL_ROW_KEY); - bc.duplicatePositions.setSize(0); - - if (reincarnatedPositions != null) { - reincarnatedPositions.setSize(0); - } - - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - rowCountSource.ensureCapacity(nextOutputPosition.intValue() + chunkOk.size()); - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final int foundPosition = bc.workingStateEntries.get(ii); - outputPositions.set(ii, foundPosition); - - final long oldRowCount = rowCountSource.getUnsafe(foundPosition); - Assert.geqZero(oldRowCount, "oldRowCount"); - if (reincarnatedPositions != null && oldRowCount == 0) { - reincarnatedPositions.add(foundPosition); - } - rowCountSource.set(foundPosition, oldRowCount + 1); - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - stateSource.set(currentHashLocation, chunkPositionToPendingState(firstChunkPositionForHashLocation)); - - bc.addedSlotsByPosition.set(firstChunkPositionForHashLocation, currentHashLocation); - maxAddedPosition = Math.max(maxAddedPosition, firstChunkPositionForHashLocation); - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - bc.duplicatePositions.add(chunkPosition); - bc.duplicatePositions.add(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final int position = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, position); - - final long oldRowCount = rowCountSource.getUnsafe(position); - Assert.geqZero(oldRowCount, "oldRowCount"); - if (reincarnatedPositions != null && oldRowCount == 0) { - reincarnatedPositions.add(position); - } - rowCountSource.set(position, oldRowCount + 1); - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - overflowStateSource.set(allocatedOverflowLocation, chunkPositionToPendingState(chunkPosition)); - bc.addedSlotsByPosition.set(chunkPosition, overflowLocationToHashLocation(allocatedOverflowLocation)); - maxAddedPosition = Math.max(maxAddedPosition, chunkPosition); - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - bc.duplicatePositions.add(chunkPosition); - bc.duplicatePositions.add(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - outputPositionToHashSlot.ensureCapacity(nextOutputPosition.intValue() + maxAddedPosition + 1); - for (int ii = 0; ii <= maxAddedPosition; ++ii) { - final long longSlot = bc.addedSlotsByPosition.get(ii); - if (longSlot != RowSequence.NULL_ROW_KEY) { - final int intSlot = (int) longSlot; - - outputPositions.set(ii, nextOutputPosition.intValue()); - if (isOverflowLocation(intSlot)) { - overflowStateSource.set(hashLocationToOverflowLocation(intSlot), nextOutputPosition.intValue()); - } else { - stateSource.set(intSlot, nextOutputPosition.intValue()); - } - rowCountSource.set(nextOutputPosition.intValue(), 1L); - - outputPositionToHashSlot.set(nextOutputPosition.intValue(), intSlot); - nextOutputPosition.increment(); - } - } - - for (int ii = 0; ii < bc.duplicatePositions.size(); ii += 2) { - final int position = outputPositions.get(bc.duplicatePositions.get(ii + 1)); - outputPositions.set(bc.duplicatePositions.get(ii), position); - rowCountSource.set(position, rowCountSource.getUnsafe(position) + 1L); - } - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qint\E - final int stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_RIGHT_VALUE); - // region rehash move values - if (isPendingState(stateValueToMove)) { - bc.addedSlotsByPosition.set(pendingStateToChunkPosition(stateValueToMove), newHashLocation); - } else { - outputPositionToHashSlot.set(stateValueToMove, (int) newHashLocation); - } - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - final long overflowLocation = bc.overflowLocationsAsKeyIndices.get(ii); - final int positionForSlot = overflowStateSource.getUnsafe(overflowLocation); - if (isPendingState(positionForSlot)) { - bc.addedSlotsByPosition.set(pendingStateToChunkPosition(positionForSlot), tableLocation); - } else { - outputPositionToHashSlot.set(positionForSlot, (int) tableLocation); - } - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QIntChunk\E - final WritableIntChunk stateChunk = WritableIntChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(stateChunk, EMPTY_RIGHT_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E - private void updateWriteThroughState(ResettableWritableIntChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = stateSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - // mixin prev - private void getPrevKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getPrevChunk(contexts[ii], rowSequence); - } - } - // endmixin prev - - // region probe wrappers - @Override - public void remove(final SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, WritableIntChunk outputPositions, WritableIntChunk emptiedPositions) { - if (rowSequence.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, rowSequence, sources, true, true, outputPositions, emptiedPositions); - } - - @Override - public void findModifications(final SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, WritableIntChunk outputPositions) { - if (rowSequence.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, rowSequence, sources, false, false, outputPositions, null); - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - // endregion probe context constructor - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // mixin prev - , boolean usePrev - // endmixin prev - // region additional probe arguments - , boolean remove - , WritableIntChunk outputPositions - , WritableIntChunk emptiedPositions - // endregion additional probe arguments - ) { - // region probe start - outputPositions.setSize(probeIndex.intSize()); - if (remove) { - emptiedPositions.setSize(0); - } - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - // mixin prev - if (usePrev) { - getPrevKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - } else { - // endmixin prev - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - // mixin prev - } - // endmixin prev - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - stateSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(pc.workingStateEntries, EMPTY_RIGHT_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final long tableLocation = pc.tableLocationsChunk.get(ii); - final int outputPosition = pc.workingStateEntries.get(ii); - outputPositions.set(ii, outputPosition); - if (remove) { - // decrement the row count - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount - 1); - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_RIGHT_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - throw new IllegalStateException("Failed to find main aggregation slot for key " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, ii)); - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - throw new IllegalStateException("Failed to find overflow aggregation slot for key " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, chunkPosition)); - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - final int outputPosition = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, outputPosition); - if (remove) { - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount - 1); - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - @Override - public ColumnSource[] getKeyHashTableSources() { - final ColumnSource[] keyHashTableSources = new ColumnSource[keyColumnCount]; - for (int kci = 0; kci < keyColumnCount; ++kci) { - // noinspection unchecked - keyHashTableSources[kci] = new RedirectedColumnSource(resultIndexToHashSlot, new HashTableColumnSource(keySources[kci], overflowKeySources[kci])); - } - return keyHashTableSources; - } - - @Override - public int findPositionForKey(Object key) { - int hash; - if (chunkHashers.length == 1) { - hash = chunkHashers[0].hashInitial(key); - } else { - final Object [] values = (Object[])key; - hash = chunkHashers[0].hashInitial(values[0]); - for (int ii = 1; ii < chunkHashers.length; ++ii) { - hash = chunkHashers[ii].hashUpdate(hash, values[ii]); - } - } - - final int location = hashToTableLocation(tableHashPivot, hash); - - final int positionValue = stateSource.getUnsafe(location); - if (positionValue == EMPTY_RIGHT_VALUE) { - return -1; - } - - if (checkKeyEquality(keySources, key, location)) { - return positionValue; - } - - int overflowLocation = overflowLocationSource.getUnsafe(location); - while (overflowLocation != QueryConstants.NULL_INT) { - if (checkKeyEquality(overflowKeySources, key, overflowLocation)) { - return overflowStateSource.getUnsafe(overflowLocation); - } - overflowLocation = overflowOverflowLocationSource.getUnsafe(overflowLocation); - } - - return -1; - } - - private boolean checkKeyEquality(ArrayBackedColumnSource[] keySources, Object key, int location) { - if (keySources.length == 1) { - return Objects.equals(key, keySources[0].get(location)); - } - final Object [] keyValues = (Object[]) key; - for (int ii = 0; ii < keySources.length; ++ii) { - if (!Objects.equals(keyValues[ii], keySources[ii].get(location))) { - return false; - } - } - return true; - } - - @Override - public void startTrackingPrevValues() { - resultIndexToHashSlot.startTrackingPrevValues(); - } - - @Override - public void setRowSize(int outputPosition, long size) { - rowCountSource.set(outputPosition, size); - } - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - private static int overflowLocationToHashLocation(final int overflowSlot) { - return HashTableColumnSource.overflowLocationToHashLocation(overflowSlot); - } - - private static int hashLocationToOverflowLocation(final int hashLocation) { - return HashTableColumnSource.hashLocationToOverflowLocation(hashLocation); - } - - private static boolean isOverflowLocation(final long slot) { - return HashTableColumnSource.isOverflowLocation(slot); - } - - private static int chunkPositionToPendingState(final int position) { - return -position - 1; - } - - private static int pendingStateToChunkPosition(final int pendingState) { - return -pendingState - 1; - } - - private static boolean isPendingState(final int position) { - return position < 0; - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.java index ff4b059500e..8c6f5fd55a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.java @@ -11,7 +11,6 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.alternatingcolumnsource.AlternatingColumnSource; import io.deephaven.engine.table.impl.sources.IntegerArraySource; -import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.RedirectedColumnSource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; import io.deephaven.engine.table.impl.util.IntColumnSourceWritableRowRedirection; @@ -20,39 +19,47 @@ import io.deephaven.util.QueryConstants; import io.deephaven.util.SafeCloseable; import org.apache.commons.lang3.mutable.MutableInt; +import org.jetbrains.annotations.NotNull; public abstract class IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase extends OperatorAggregationStateManagerOpenAddressedAlternateBase implements IncrementalOperatorAggregationStateManager { - // our state value used when nothing is there + + /** Our state value used when nothing is there. */ protected static final int EMPTY_OUTPUT_POSITION = QueryConstants.NULL_INT; - // the state value for the bucket, parallel to mainKeySources (the state is an output row key for the aggregation) + /** + * The state value for the bucket, parallel to mainKeySources (the state is an output row key for the aggregation). + */ protected ImmutableIntArraySource mainOutputPosition = new ImmutableIntArraySource(); - // the state value for the bucket, parallel to alternateKeySources (the state is an output row key for the - // aggregation) + /** + * The state value for the bucket, parallel to alternateKeySources (the state is an output row key for the + * aggregation). + */ protected ImmutableIntArraySource alternateOutputPosition; - // used as a row redirection for the output key sources, updated using the mainInsertMask to identify the main vs. - // alternate values + /** + * Used as a row redirection for the output key sources, updated using the mainInsertMask to identify the main vs. + * alternate values. + */ protected final IntegerArraySource outputPositionToHashSlot = new IntegerArraySource(); - // how many values are in each state, addressed by output row key - protected final LongArraySource rowCountSource = new LongArraySource(); - - // state variables that exist as part of the update + /** State variables that exist as part of the update. */ protected MutableInt nextOutputPosition; protected WritableIntChunk outputPositions; - // output alternating column sources + /** Output alternating column sources. */ protected AlternatingColumnSource[] alternatingColumnSources; - // the mask for insertion into the main table (this tells our alternating column sources which of the two sources - // to access for a given key) + /** + * The mask for insertion into the main table (this tells our alternating column sources which of the two sources to + * access for a given key). + */ protected int mainInsertMask = 0; - protected IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase(ColumnSource[] tableKeySources, + protected IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase( + ColumnSource[] tableKeySources, int tableSize, double maximumLoadFactor) { super(tableKeySources, tableSize, maximumLoadFactor); @@ -93,15 +100,19 @@ public SafeCloseable makeAggregationStateBuildContext(ColumnSource[] buildSou } @Override - public void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, - MutableInt nextOutputPosition, WritableIntChunk outputPositions) { + public void add( + @NotNull final SafeCloseable bc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final MutableInt nextOutputPosition, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); if (rowSequence.isEmpty()) { return; } this.nextOutputPosition = nextOutputPosition; this.outputPositions = outputPositions; - buildTable((BuildContext) bc, rowSequence, sources, true, this::build); + buildTable((BuildContext) bc, rowSequence, sources, this::build); this.outputPositions = null; this.nextOutputPosition = null; } @@ -109,7 +120,6 @@ public void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource @Override public void onNextChunk(int size) { outputPositionToHashSlot.ensureCapacity(nextOutputPosition.intValue() + size, false); - rowCountSource.ensureCapacity(nextOutputPosition.intValue() + size, false); } @Override @@ -138,71 +148,47 @@ public ColumnSource[] getKeyHashTableSources() { @Override public void beginUpdateCycle() { - // at the beginning of the update cycle, we always want to do some rehash work so that we can eventually ditch - // the alternate table + // Once we're past initial state processing, we want to rehash incrementally. + fullRehash = false; + // At the beginning of the update cycle, we always want to do some rehash work so that we can eventually ditch + // the alternate table. if (rehashPointer > 0) { rehashInternalPartial(CHUNK_SIZE); } } - @Override - public void addForUpdate(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, - MutableInt nextOutputPosition, WritableIntChunk outputPositions, - final WritableIntChunk reincarnatedPositions) { - outputPositions.setSize(rowSequence.intSize()); - reincarnatedPositions.setSize(0); - if (rowSequence.isEmpty()) { - return; - } - this.nextOutputPosition = nextOutputPosition; - this.outputPositions = outputPositions; - buildTable((BuildContext) bc, rowSequence, sources, false, - ((chunkOk, sourceKeyChunks) -> buildForUpdate(chunkOk, sourceKeyChunks, reincarnatedPositions))); - this.outputPositions = null; - this.nextOutputPosition = null; - } - - protected abstract void buildForUpdate(RowSequence chunkOk, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions); + protected abstract void probe(RowSequence chunkOk, Chunk[] sourceKeyChunks); @Override - public void remove(final SafeCloseable pc, RowSequence rowSequence, ColumnSource[] sources, - WritableIntChunk outputPositions, final WritableIntChunk emptiedPositions) { + public void remove( + @NotNull final SafeCloseable pc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); - emptiedPositions.setSize(0); if (rowSequence.isEmpty()) { return; } this.outputPositions = outputPositions; - probeTable((ProbeContext) pc, rowSequence, true, sources, - (chunkOk, sourceKeyChunks) -> IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.this - .doRemoveProbe(chunkOk, sourceKeyChunks, emptiedPositions)); + probeTable((ProbeContext) pc, rowSequence, true, sources, this::probe); this.outputPositions = null; } - protected abstract void doRemoveProbe(RowSequence chunkOk, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions); - @Override - public void findModifications(final SafeCloseable pc, RowSequence rowSequence, ColumnSource[] sources, - WritableIntChunk outputPositions) { + public void findModifications( + @NotNull final SafeCloseable pc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); if (rowSequence.isEmpty()) { return; } this.outputPositions = outputPositions; - probeTable((ProbeContext) pc, rowSequence, false, sources, - IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase.this::doModifyProbe); + probeTable((ProbeContext) pc, rowSequence, false, sources, this::probe); this.outputPositions = null; } - protected abstract void doModifyProbe(RowSequence chunkOk, Chunk[] sourceKeyChunks); - @Override public void startTrackingPrevValues() {} - - @Override - public void setRowSize(int outputPosition, long size) { - rowCountSource.set(outputPosition, size); - } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerTypedBase.java index f923e32e346..f6ce5d37929 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManagerTypedBase.java @@ -3,13 +3,11 @@ */ package io.deephaven.engine.table.impl.by; -import io.deephaven.base.verify.Assert; import io.deephaven.chunk.WritableIntChunk; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.sources.IntegerArraySource; -import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.RedirectedColumnSource; import io.deephaven.engine.table.impl.util.IntColumnSourceWritableRowRedirection; import io.deephaven.engine.table.impl.util.RowRedirection; @@ -18,6 +16,7 @@ import io.deephaven.util.QueryConstants; import io.deephaven.util.SafeCloseable; import org.apache.commons.lang3.mutable.MutableInt; +import org.jetbrains.annotations.NotNull; /** * Incremental aggregation state manager that is extended by code generated typed hashers. @@ -38,12 +37,8 @@ public abstract class IncrementalChunkedOperatorAggregationStateManagerTypedBase // used as a row redirection for the output key sources private final IntegerArraySource outputPositionToHashSlot = new IntegerArraySource(); - // how many values are in each state, addressed by output row key - private final LongArraySource rowCountSource = new LongArraySource(); - - // handlers for use during updates - private final AddInitialHandler addInitialHandler = new AddInitialHandler(); - private final AddUpdateHandler addUpdateHandler = new AddUpdateHandler(); + // handlers for use during initialization and updates + private final AddHandler addHandler = new AddHandler(); private final RemoveHandler removeHandler = new RemoveHandler(); private final ModifyHandler modifyHandler = new ModifyHandler(); @@ -59,15 +54,19 @@ public SafeCloseable makeAggregationStateBuildContext(ColumnSource[] buildSou } @Override - public void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, - MutableInt nextOutputPosition, WritableIntChunk outputPositions) { + public void add( + @NotNull final SafeCloseable bc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final MutableInt nextOutputPosition, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); if (rowSequence.isEmpty()) { return; } - addInitialHandler.reset(nextOutputPosition, outputPositions); - buildTable(addInitialHandler, (BuildContext) bc, rowSequence, sources); - addInitialHandler.reset(); + addHandler.reset(nextOutputPosition, outputPositions); + buildTable(addHandler, (BuildContext) bc, rowSequence, sources); + addHandler.reset(); } @Override @@ -90,42 +89,26 @@ public void startTrackingPrevValues() {} public void beginUpdateCycle() {} @Override - public void setRowSize(int outputPosition, long size) { - rowCountSource.set(outputPosition, size); - } - - @Override - public void addForUpdate(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, - MutableInt nextOutputPosition, WritableIntChunk outputPositions, - WritableIntChunk reincarnatedPositions) { - outputPositions.setSize(rowSequence.intSize()); - reincarnatedPositions.setSize(0); - if (rowSequence.isEmpty()) { - return; - } - addUpdateHandler.reset(nextOutputPosition, outputPositions, reincarnatedPositions); - buildTable(addUpdateHandler, (BuildContext) bc, - rowSequence, sources); - addUpdateHandler.reset(); - } - - @Override - public void remove(final SafeCloseable pc, RowSequence rowSequence, ColumnSource[] sources, - WritableIntChunk outputPositions, WritableIntChunk emptiedPositions) { + public void remove( + @NotNull final SafeCloseable pc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); - emptiedPositions.setSize(0); if (rowSequence.isEmpty()) { return; } - removeHandler.reset(outputPositions, emptiedPositions); - probeTable(removeHandler, (ProbeContext) pc, rowSequence, true, - sources); + removeHandler.reset(outputPositions); + probeTable(removeHandler, (ProbeContext) pc, rowSequence, true, sources); removeHandler.reset(); } @Override - public void findModifications(final SafeCloseable pc, RowSequence rowSequence, ColumnSource[] sources, - WritableIntChunk outputPositions) { + public void findModifications( + @NotNull final SafeCloseable pc, + @NotNull final RowSequence rowSequence, + @NotNull final ColumnSource[] sources, + @NotNull final WritableIntChunk outputPositions) { outputPositions.setSize(rowSequence.intSize()); if (rowSequence.isEmpty()) { return; @@ -136,20 +119,23 @@ public void findModifications(final SafeCloseable pc, RowSequence rowSequence, C } @Override - protected void ensureMainState(int tableSize) { + protected void ensureMainState(final int tableSize) { mainOutputPosition.ensureCapacity(tableSize); } @Override - protected void ensureOverflowState(int newCapacity) { + protected void ensureOverflowState(final int newCapacity) { overflowOutputPosition.ensureCapacity(newCapacity); } - private abstract class AddHandler extends HashHandler.BuildHandler { + private class AddHandler extends HashHandler.BuildHandler { + MutableInt outputPosition; WritableIntChunk outputPositions; - void reset(MutableInt nextOutputPosition, WritableIntChunk outputPositions) { + void reset( + @NotNull final MutableInt nextOutputPosition, + @NotNull final WritableIntChunk outputPositions) { this.outputPosition = nextOutputPosition; this.outputPositions = outputPositions; } @@ -160,159 +146,89 @@ void reset() { } @Override - public void doMainInsert(int tableLocation, int chunkPosition) { + public void doMainInsert(final int tableLocation, final int chunkPosition) { final int nextOutputPosition = outputPosition.getAndIncrement(); outputPositions.set(chunkPosition, nextOutputPosition); mainOutputPosition.set(tableLocation, nextOutputPosition); outputPositionToHashSlot.set(nextOutputPosition, tableLocation); - rowCountSource.set(nextOutputPosition, 1L); } @Override - public void doMoveMain(int oldTableLocation, int newTableLocation) { + public void doMainFound(final int tableLocation, final int chunkPosition) { + final int outputPosition = mainOutputPosition.getUnsafe(tableLocation); + outputPositions.set(chunkPosition, outputPosition); + } + + @Override + public void doMoveMain(final int oldTableLocation, final int newTableLocation) { final int outputPosition = mainOutputPosition.getUnsafe(newTableLocation); outputPositionToHashSlot.set(outputPosition, newTableLocation); } @Override - public void doPromoteOverflow(int overflowLocation, int mainInsertLocation) { + public void doPromoteOverflow(final int overflowLocation, final int mainInsertLocation) { outputPositionToHashSlot.set(mainOutputPosition.getUnsafe(mainInsertLocation), mainInsertLocation); } @Override - public void onNextChunk(int size) { + public void onNextChunk(final int size) { outputPositionToHashSlot.ensureCapacity(outputPosition.intValue() + size); - rowCountSource.ensureCapacity(outputPosition.intValue() + size); } @Override - public void doOverflowInsert(int overflowLocation, int chunkPosition) { + public void doOverflowInsert(final int overflowLocation, final int chunkPosition) { final int nextOutputPosition = outputPosition.getAndIncrement(); outputPositions.set(chunkPosition, nextOutputPosition); overflowOutputPosition.set(overflowLocation, nextOutputPosition); outputPositionToHashSlot.set(nextOutputPosition, HashTableColumnSource.overflowLocationToHashLocation(overflowLocation)); - rowCountSource.set(nextOutputPosition, 1L); - } - } - - class AddInitialHandler extends AddHandler { - @Override - public void doMainFound(int tableLocation, int chunkPosition) { - final int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - outputPositions.set(chunkPosition, outputPosition); - - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - rowCountSource.set(outputPosition, oldRowCount + 1); } @Override - public void doOverflowFound(int overflowLocation, int chunkPosition) { + public void doOverflowFound(final int overflowLocation, final int chunkPosition) { final int outputPosition = overflowOutputPosition.getUnsafe(overflowLocation); outputPositions.set(chunkPosition, outputPosition); - - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - rowCountSource.set(outputPosition, oldRowCount + 1); - } - } - - class AddUpdateHandler extends AddHandler { - private WritableIntChunk reincarnatedPositions; - - public void reset(MutableInt nextOutputPosition, WritableIntChunk outputPositions, - WritableIntChunk reincarnatedPositions) { - super.reset(nextOutputPosition, outputPositions); - this.reincarnatedPositions = reincarnatedPositions; - } - - void reset() { - super.reset(); - reincarnatedPositions = null; - } - - @Override - public void doMainFound(int tableLocation, int chunkPosition) { - final int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - outputPositions.set(chunkPosition, outputPosition); - - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.geqZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount + 1); - } - - @Override - public void doOverflowFound(int overflowLocation, int chunkPosition) { - final int outputPosition = overflowOutputPosition.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, outputPosition); - - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.geqZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount + 1); } } class RemoveHandler extends HashHandler.ProbeHandler { + private WritableIntChunk outputPositions; - private WritableIntChunk emptiedPositions; - public void reset(WritableIntChunk outputPositions, WritableIntChunk emptiedPositions) { + public void reset(@NotNull final WritableIntChunk outputPositions) { this.outputPositions = outputPositions; - this.emptiedPositions = emptiedPositions; } public void reset() { this.outputPositions = null; - this.emptiedPositions = null; } @Override - public void doMainFound(int tableLocation, int chunkPosition) { + public void doMainFound(final int tableLocation, final int chunkPosition) { final int outputPosition = mainOutputPosition.getUnsafe(tableLocation); outputPositions.set(chunkPosition, outputPosition); - - // decrement the row count - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount - 1); } @Override - public void doOverflowFound(int overflowLocation, int chunkPosition) { + public void doOverflowFound(final int overflowLocation, final int chunkPosition) { final int outputPosition = overflowOutputPosition.getUnsafe(overflowLocation); outputPositions.set(chunkPosition, outputPosition); - - final long oldRowCount = rowCountSource.getUnsafe(outputPosition); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - rowCountSource.set(outputPosition, oldRowCount - 1); } @Override - public void onNextChunk(int size) {} + public void onNextChunk(final int size) {} @Override - public void doMissing(int chunkPosition) { + public void doMissing(final int chunkPosition) { throw new IllegalStateException(); } } class ModifyHandler extends HashHandler.ProbeHandler { + private WritableIntChunk outputPositions; - public void reset(WritableIntChunk outputPositions) { + public void reset(@NotNull final WritableIntChunk outputPositions) { this.outputPositions = outputPositions; } @@ -321,22 +237,22 @@ public void reset() { } @Override - public void doMainFound(int tableLocation, int chunkPosition) { + public void doMainFound(final int tableLocation, final int chunkPosition) { final int outputPosition = mainOutputPosition.getUnsafe(tableLocation); outputPositions.set(chunkPosition, outputPosition); } @Override - public void doOverflowFound(int overflowLocation, int chunkPosition) { + public void doOverflowFound(final int overflowLocation, final int chunkPosition) { final int outputPosition = overflowOutputPosition.getUnsafe(overflowLocation); outputPositions.set(chunkPosition, outputPosition); } @Override - public void onNextChunk(int size) {} + public void onNextChunk(final int size) {} @Override - public void doMissing(int chunkPosition) { + public void doMissing(final int chunkPosition) { throw new IllegalStateException(); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalOperatorAggregationStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalOperatorAggregationStateManager.java index 350c8dc1c2b..366e46214cb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalOperatorAggregationStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalOperatorAggregationStateManager.java @@ -8,7 +8,6 @@ import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.util.SafeCloseable; -import org.apache.commons.lang3.mutable.MutableInt; /** * Interface for ChunkedOperatorAggregationHelper to process incremental updates. @@ -25,11 +24,9 @@ public interface IncrementalOperatorAggregationStateManager extends OperatorAggr void startTrackingPrevValues(); - void setRowSize(int outputPosition, long size); + void remove(SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, + WritableIntChunk outputPositions); - void addForUpdate(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, MutableInt nextOutputPosition, WritableIntChunk outputPositions, WritableIntChunk reincarnatedPositions); - - void remove(final SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, WritableIntChunk outputPositions, WritableIntChunk emptiedPositions); - - void findModifications(final SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, WritableIntChunk outputPositions); + void findModifications(SafeCloseable pc, RowSequence rowSequence, ColumnSource [] sources, + WritableIntChunk outputPositions); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/NoopStateChangeRecorder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/NoopStateChangeRecorder.java new file mode 100644 index 00000000000..ca0ba2a349f --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/NoopStateChangeRecorder.java @@ -0,0 +1,18 @@ +package io.deephaven.engine.table.impl.by; + +import java.util.function.LongConsumer; + +/** + * Re-usable support for not recording reincarnated and emptied states in incremental aggregation processing, + * for operators that never process any removes. + */ +class NoopStateChangeRecorder implements StateChangeRecorder { + + @Override + public final void startRecording( + final LongConsumer reincarnatedDestinationCallback, + final LongConsumer emptiedDestinationCallback) {} + + @Override + public final void finishRecording() {} +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManager.java index a6853eb3973..a41ff6edcd4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManager.java @@ -12,6 +12,8 @@ interface OperatorAggregationStateManager { + int maxTableSize(); + SafeCloseable makeAggregationStateBuildContext(ColumnSource[] buildSources, long maxSize); void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, MutableInt nextOutputPosition, WritableIntChunk outputPositions); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedAlternateBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedAlternateBase.java index 230c95d7041..9ee4eac83b8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedAlternateBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedAlternateBase.java @@ -14,32 +14,39 @@ import org.apache.commons.lang3.mutable.MutableInt; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.*; -import static io.deephaven.util.SafeCloseable.closeArray; public abstract class OperatorAggregationStateManagerOpenAddressedAlternateBase implements OperatorAggregationStateManager { public static final int CHUNK_SIZE = ChunkedOperatorAggregationHelper.CHUNK_SIZE; private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size - // the number of slots in our table + /** The number of slots in our table. */ protected int tableSize; - // the number of slots in our alternate table, to start with "1" is a lie, but rehashPointer is zero; so our - // location value is positive and can be compared against rehashPointer safely + + /** + * The number of slots in our alternate table, to start with "1" is a lie, but rehashPointer is zero; so our + * location value is positive and can be compared against rehashPointer safely + */ protected int alternateTableSize = 1; - // how much of the alternate sources are necessary to rehash? + /** Should we rehash the entire table fully ({@code true}) or incrementally ({@code false})? */ + protected boolean fullRehash = true; + + /** How much of the alternate sources are necessary to rehash? */ protected int rehashPointer = 0; protected long numEntries = 0; - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table + /** + * The table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor or if + * it falls below minimum load factor we will instead contract the table. + */ private final double maximumLoadFactor; - // the keys for our hash entries + /** The keys for our hash entries. */ protected final WritableColumnSource[] mainKeySources; - // the keys for our hash entries, for the old alternative smaller table + /** The keys for our hash entries, for the old alternative smaller table. */ protected final ColumnSource[] alternateKeySources; protected OperatorAggregationStateManagerOpenAddressedAlternateBase(ColumnSource[] tableKeySources, @@ -61,6 +68,11 @@ protected OperatorAggregationStateManagerOpenAddressedAlternateBase(ColumnSource this.maximumLoadFactor = maximumLoadFactor; } + @Override + public final int maxTableSize() { + return Math.toIntExact(MAX_TABLE_SIZE); + } + protected abstract void build(RowSequence rowSequence, Chunk[] sourceKeyChunks); public static class BuildContext extends BuildOrProbeContext { @@ -85,7 +97,6 @@ protected void buildTable( final BuildContext bc, final RowSequence buildRows, final ColumnSource[] buildSources, - final boolean fullRehash, final BuildHandler buildHandler) { try (final RowSequence.Iterator rsIt = buildRows.getRowSequenceIterator()) { // noinspection unchecked @@ -95,7 +106,7 @@ protected void buildTable( final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); final int nextChunkSize = chunkOk.intSize(); onNextChunk(nextChunkSize); - while (doRehash(fullRehash, bc.rehashCredits, nextChunkSize)) { + while (doRehash(bc.rehashCredits, nextChunkSize)) { migrateFront(); } @@ -152,12 +163,11 @@ public interface BuildHandler { } /** - * @param fullRehash should we rehash the entire table (if false, we rehash incrementally) * @param rehashCredits the number of entries this operation has rehashed (input/output) * @param nextChunkSize the size of the chunk we are processing * @return true if a front migration is required */ - public boolean doRehash(boolean fullRehash, MutableInt rehashCredits, int nextChunkSize) { + public boolean doRehash(MutableInt rehashCredits, int nextChunkSize) { if (rehashPointer > 0) { final int requiredRehash = nextChunkSize - rehashCredits.intValue(); if (requiredRehash <= 0) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedBase.java index 0cb7b3bcc99..aa363f5fe02 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerOpenAddressedBase.java @@ -48,6 +48,11 @@ protected OperatorAggregationStateManagerOpenAddressedBase(ColumnSource[] tab this.maximumLoadFactor = maximumLoadFactor; } + @Override + public final int maxTableSize() { + return Math.toIntExact(MAX_TABLE_SIZE); + } + protected abstract void build(RowSequence rowSequence, Chunk[] sourceKeyChunks); BuildContext makeBuildContext(ColumnSource[] buildSources, long maxSize) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerTypedBase.java index 211249f3944..125572d1796 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/OperatorAggregationStateManagerTypedBase.java @@ -20,6 +20,11 @@ public abstract class OperatorAggregationStateManagerTypedBase public static final int CHUNK_SIZE = ChunkedOperatorAggregationHelper.CHUNK_SIZE; private static final long MAX_TABLE_SIZE = HashTableColumnSource.MINIMUM_OVERFLOW_HASH_SLOT; + @Override + public final int maxTableSize() { + return Math.toIntExact(MAX_TABLE_SIZE); + } + // the number of slots in our table private int tableSize; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/SortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/SortedFirstOrLastChunkedOperator.java index d3520401a1b..daa30528726 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/SortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/SortedFirstOrLastChunkedOperator.java @@ -6,6 +6,7 @@ import io.deephaven.chunk.attributes.ChunkLengths; import io.deephaven.chunk.attributes.ChunkPositions; import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.table.impl.SortingOrder; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.MatchPair; @@ -26,7 +27,9 @@ import java.util.Map; import java.util.function.Supplier; -public class SortedFirstOrLastChunkedOperator implements IterativeChunkedAggregationOperator { +public class SortedFirstOrLastChunkedOperator + extends BasicStateChangeRecorder + implements IterativeChunkedAggregationOperator { private final ChunkType chunkType; private final boolean isFirst; private final Supplier ssaFactory; @@ -416,6 +419,9 @@ private boolean addSortedChunk(Chunk values, LongChunk indices, ssa.insert(values, indices); final long newValue = isFirst ? ssa.getFirst() : ssa.getLast(); final long oldValue = redirections.getAndSetUnsafe(destination, newValue); + if (oldValue == RowSequence.NULL_ROW_KEY && newValue != RowSequence.NULL_ROW_KEY) { + onReincarnated(destination); + } return oldValue != newValue; } @@ -432,6 +438,9 @@ private boolean removeSortedChunk(Chunk values, LongChunk indic ssa.remove(values, indices); final long newValue = isFirst ? ssa.getFirst() : ssa.getLast(); final long oldValue = redirections.getAndSetUnsafe(destination, newValue); + if (oldValue != RowSequence.NULL_ROW_KEY && newValue == RowSequence.NULL_ROW_KEY) { + onEmptied(destination); + } return oldValue != newValue; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StateChangeRecorder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StateChangeRecorder.java new file mode 100644 index 00000000000..7e55434ba74 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StateChangeRecorder.java @@ -0,0 +1,24 @@ +package io.deephaven.engine.table.impl.by; + +import java.util.function.LongConsumer; + +/** + * Interface for recording reincarnated and emptied states in incremental aggregation processing. + */ +interface StateChangeRecorder { + + /** + * Set {@link LongConsumer callbacks} that should be used to record destinations that have transitioned from empty + * to non-empty ({@code reincarnatedDestinationCallback}) or non-empty to empty + * ({@code emptiedDestinationCallback}). + * + * @param reincarnatedDestinationCallback Consumer for destinations that have gone from empty to non-empty + * @param emptiedDestinationCallback Consumer for destinations that have gone from non-empty to empty + */ + void startRecording(LongConsumer reincarnatedDestinationCallback, LongConsumer emptiedDestinationCallback); + + /** + * Remove callbacks and stop state change recording. + */ + void finishRecording(); +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StaticChunkedOperatorAggregationStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StaticChunkedOperatorAggregationStateManager.java deleted file mode 100644 index 7f6f1f7352a..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StaticChunkedOperatorAggregationStateManager.java +++ /dev/null @@ -1,1414 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.by; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QIntChunk\E -import io.deephaven.chunk.util.hashing.IntChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QInt\E -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.engine.table.impl.HashTableAnnotations; -import io.deephaven.util.SafeCloseable; -import org.apache.commons.lang3.mutable.MutableInt; - -import java.util.Objects; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -public -// endregion class visibility -class StaticChunkedOperatorAggregationStateManager - // region extensions - implements OperatorAggregationStateManager - // endregion extensions -{ - // region constants - public static final int CHUNK_SIZE = ChunkedOperatorAggregationHelper.CHUNK_SIZE; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = HashTableColumnSource.MINIMUM_OVERFLOW_HASH_SLOT; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_INT\E, @StateValueType@ from \Qint\E - private static final int EMPTY_RIGHT_VALUE = QueryConstants.NULL_INT; - - // mixin getStateValue - // region overflow pivot - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

    When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

    - * - *

    This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

    - */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource stateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QIntegerArraySource\E - private final IntegerArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QIntegerArraySource()\E - = new IntegerArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - private final IntegerArraySource outputPositionToHashSlot = new IntegerArraySource(); - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - StaticChunkedOperatorAggregationStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , double maximumLoadFactor - , double targetLoadFactor - // endregion constructor arguments - ) { - // region super - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - this.maximumLoadFactor = maximumLoadFactor; - this.targetLoadFactor = targetLoadFactor; - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - // endregion ensureOverflowCapacity - } - - // region build wrappers - - @Override - public void add(final SafeCloseable bc, RowSequence rowSequence, ColumnSource[] sources, MutableInt nextOutputPosition, WritableIntChunk outputPositions) { - if (rowSequence.isEmpty()) { - return; - } - buildTable((BuildContext)bc, rowSequence, sources, nextOutputPosition, outputPositions); - } - - @Override - public SafeCloseable makeAggregationStateBuildContext(ColumnSource[] buildSources, long maxSize) { - return makeBuildContext(buildSources, maxSize); - } - - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableIntChunk\E - final WritableIntChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E, @WritableStateChunkName@ from \QWritableIntChunk\E - final ResettableWritableIntChunk writeThroughState = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - final WritableIntChunk duplicatePositions; - final WritableLongChunk addedSlotsByPosition; - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - duplicatePositions = WritableIntChunk.makeWritableChunk(chunkSize * 2); - addedSlotsByPosition = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableIntChunk\E - workingStateEntries = WritableIntChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - duplicatePositions.close(); - addedSlotsByPosition.close(); - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final MutableInt outputPosition - , final WritableIntChunk outputPositions - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - outputPositions.setSize(buildIndex.intSize()); - int maxAddedPosition = -1; - bc.addedSlotsByPosition.setSize(outputPositions.size()); - bc.addedSlotsByPosition.fillWithValue(0, bc.addedSlotsByPosition.size(), RowSequence.NULL_ROW_KEY); - bc.duplicatePositions.setSize(0); - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - outputPositions.set(ii, bc.workingStateEntries.get(ii)); - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - stateSource.set(currentHashLocation, chunkPositionToPendingState(firstChunkPositionForHashLocation)); - bc.addedSlotsByPosition.set(firstChunkPositionForHashLocation, currentHashLocation); - maxAddedPosition = Math.max(maxAddedPosition, firstChunkPositionForHashLocation); - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - bc.duplicatePositions.add(chunkPosition); - bc.duplicatePositions.add(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final int position = overflowStateSource.getUnsafe(overflowLocation); - outputPositions.set(chunkPosition, position); - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - overflowStateSource.set(allocatedOverflowLocation, chunkPositionToPendingState(chunkPosition)); - bc.addedSlotsByPosition.set(chunkPosition, overflowLocationToHashLocation(allocatedOverflowLocation)); - maxAddedPosition = Math.max(maxAddedPosition, chunkPosition); - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - bc.duplicatePositions.add(chunkPosition); - bc.duplicatePositions.add(bc.chunkPositionsToCheckForEquality.get(ii * 2)); - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - outputPositionToHashSlot.ensureCapacity(outputPosition.intValue() + maxAddedPosition + 1); - for (int ii = 0; ii <= maxAddedPosition; ++ii) { - final long longSlot = bc.addedSlotsByPosition.get(ii); - if (longSlot != RowSequence.NULL_ROW_KEY) { - final int intSlot = (int) longSlot; - - outputPositions.set(ii, outputPosition.intValue()); - if (isOverflowLocation(intSlot)) { - overflowStateSource.set(hashLocationToOverflowLocation(intSlot), outputPosition.intValue()); - } else { - stateSource.set(intSlot, outputPosition.intValue()); - } - - outputPositionToHashSlot.set(outputPosition.intValue(), intSlot); - outputPosition.increment(); - } - } - - for (int ii = 0; ii < bc.duplicatePositions.size(); ii += 2) { - outputPositions.set(bc.duplicatePositions.get(ii), outputPositions.get(bc.duplicatePositions.get(ii + 1))); - } - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qint\E - final int stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_RIGHT_VALUE); - // region rehash move values - if (isPendingState(stateValueToMove)) { - bc.addedSlotsByPosition.set(pendingStateToChunkPosition(stateValueToMove), newHashLocation); - } else { - outputPositionToHashSlot.set(stateValueToMove, (int) newHashLocation); - } - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - final long overflowLocation = bc.overflowLocationsAsKeyIndices.get(ii); - final int positionForSlot = overflowStateSource.getUnsafe(overflowLocation); - if (isPendingState(positionForSlot)) { - bc.addedSlotsByPosition.set(pendingStateToChunkPosition(positionForSlot), tableLocation); - } else { - outputPositionToHashSlot.set(positionForSlot, (int) tableLocation); - } - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QInt\E - IntPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QIntChunk\E - final WritableIntChunk stateChunk = WritableIntChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QIntChunk\E - IntChunkEquals.notEqual(stateChunk, EMPTY_RIGHT_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableIntChunk\E - private void updateWriteThroughState(ResettableWritableIntChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = stateSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - - // region probe wrappers - // endregion probe wrappers - - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - @Override - public ColumnSource[] getKeyHashTableSources() { - final WritableRowRedirection resultIndexToHashSlot = new IntColumnSourceWritableRowRedirection(outputPositionToHashSlot); - final ColumnSource[] keyHashTableSources = new ColumnSource[keyColumnCount]; - for (int kci = 0; kci < keyColumnCount; ++kci) { - // noinspection unchecked - keyHashTableSources[kci] = new RedirectedColumnSource(resultIndexToHashSlot, new HashTableColumnSource(keySources[kci], overflowKeySources[kci])); - } - return keyHashTableSources; - } - - @Override - public int findPositionForKey(Object key) { - int hash; - if (chunkHashers.length == 1) { - hash = chunkHashers[0].hashInitial(key); - } else { - final Object [] values = (Object[])key; - hash = chunkHashers[0].hashInitial(values[0]); - for (int ii = 1; ii < chunkHashers.length; ++ii) { - hash = chunkHashers[ii].hashUpdate(hash, values[ii]); - } - } - - final int location = hashToTableLocation(tableHashPivot, hash); - - final int positionValue = stateSource.getUnsafe(location); - if (positionValue == EMPTY_RIGHT_VALUE) { - return -1; - } - - if (checkKeyEquality(keySources, key, location)) { - return positionValue; - } - - int overflowLocation = overflowLocationSource.getUnsafe(location); - while (overflowLocation != QueryConstants.NULL_INT) { - if (checkKeyEquality(overflowKeySources, key, overflowLocation)) { - return overflowStateSource.getUnsafe(overflowLocation); - } - overflowLocation = overflowOverflowLocationSource.getUnsafe(overflowLocation); - } - - return -1; - } - - private boolean checkKeyEquality(ArrayBackedColumnSource[] keySources, Object key, int location) { - if (keySources.length == 1) { - return Objects.equals(key, keySources[0].get(location)); - } - final Object [] keyValues = (Object[]) key; - for (int ii = 0; ii < keySources.length; ++ii) { - if (!Objects.equals(keyValues[ii], keySources[ii].get(location))) { - return false; - } - } - return true; - } - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - private static int overflowLocationToHashLocation(final int overflowSlot) { - return HashTableColumnSource.overflowLocationToHashLocation(overflowSlot); - } - - private static int hashLocationToOverflowLocation(final int hashLocation) { - return HashTableColumnSource.hashLocationToOverflowLocation(hashLocation); - } - - private static boolean isOverflowLocation(final long slot) { - return HashTableColumnSource.isOverflowLocation(slot); - } - - private static int chunkPositionToPendingState(final int position) { - return -position - 1; - } - - private static int pendingStateToChunkPosition(final int pendingState) { - return -pendingState - 1; - } - - private static boolean isPendingState(final int position) { - return position < 0; - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedAggregationFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedAggregationFactory.java index 7f01f9f7433..691d321b617 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedAggregationFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedAggregationFactory.java @@ -24,23 +24,12 @@ public static void buildInsert(HasherConfig hasherConfig, CodeBlock.Builder b public static void buildInsertIncremental(HasherConfig hasherConfig, CodeBlock.Builder builder) { buildInsertCommon(hasherConfig, builder); builder.addStatement("outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation)"); - builder.addStatement("rowCountSource.set(outputPosition, 1L)"); } public static void probeFound(HasherConfig hasherConfig, boolean alternate, CodeBlock.Builder builder) { builder.addStatement("outputPositions.set(chunkPosition, outputPosition)"); } - public static void removeProbeFound(HasherConfig hasherConfig, boolean alternate, CodeBlock.Builder builder) { - probeFound(hasherConfig, alternate, builder); - - builder.addStatement("final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1)"); - builder.addStatement("Assert.gtZero(oldRowCount, \"oldRowCount\")"); - builder.beginControlFlow("if (oldRowCount == 1)"); - builder.addStatement("emptiedPositions.add(outputPosition)"); - builder.endControlFlow(); - } - public static void probeMissing(CodeBlock.Builder builder) { builder.addStatement("throw new IllegalStateException($S)", "Missing value in probe"); } @@ -49,26 +38,6 @@ static void buildFound(HasherConfig hasherConfig, boolean alternate, CodeBloc builder.addStatement("outputPositions.set(chunkPosition, outputPosition)"); } - private static void buildFoundIncremental(HasherConfig hasherConfig, boolean alternate, - CodeBlock.Builder builder) { - buildFound(hasherConfig, alternate, builder); - builder.addStatement("final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1)"); - } - - static void buildFoundIncrementalInitial(HasherConfig hasherConfig, boolean alternate, - CodeBlock.Builder builder) { - buildFoundIncremental(hasherConfig, alternate, builder); - builder.addStatement("Assert.gtZero(oldRowCount, \"oldRowCount\")"); - } - - static void buildFoundIncrementalUpdate(HasherConfig hasherConfig, boolean alternate, - CodeBlock.Builder builder) { - buildFoundIncremental(hasherConfig, alternate, builder); - builder.beginControlFlow("if (oldRowCount == 0)"); - builder.addStatement("reincarnatedPositions.add(outputPosition)"); - builder.endControlFlow(); - } - private static void buildInsertCommon(HasherConfig hasherConfig, CodeBlock.Builder builder) { builder.addStatement("outputPosition = nextOutputPosition.getAndIncrement()"); builder.addStatement("outputPositions.set(chunkPosition, outputPosition)"); @@ -84,7 +53,6 @@ static void incAggMoveMain(CodeBlock.Builder builder) { "outputPositionToHashSlot.set(currentStateValue, mainInsertMask | destinationTableLocation)"); } - @NotNull public static MethodSpec createFindPositionForKey(HasherConfig hasherConfig, ChunkType[] chunkTypes) { MethodSpec.Builder builder = MethodSpec.methodBuilder("findPositionForKey").addParameter(Object.class, "key") diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index 1b5a2b923fc..568a1fafa69 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -33,6 +33,7 @@ import io.deephaven.util.compare.CharComparisons; import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.lang.model.element.Modifier; import java.lang.reflect.Constructor; @@ -103,26 +104,12 @@ public static HasherConfig hasherConfigForBase(Class baseClass) { final ClassName rowKeyType = ClassName.get(RowKeys.class); final ParameterizedTypeName emptiedChunkType = ParameterizedTypeName.get(ClassName.get(WritableIntChunk.class), rowKeyType); - final ParameterSpec emptiedPositions = ParameterSpec.builder(emptiedChunkType, "emptiedPositions").build(); - - builder.addProbe(new HasherConfig.ProbeSpec("doRemoveProbe", "outputPosition", - false, TypedAggregationFactory::removeProbeFound, - TypedAggregationFactory::probeMissing, emptiedPositions)); - builder.addProbe( - new HasherConfig.ProbeSpec("doModifyProbe", "outputPosition", false, - TypedAggregationFactory::probeFound, - TypedAggregationFactory::probeMissing)); - - builder.addBuild(new HasherConfig.BuildSpec("build", "outputPosition", - false, true, TypedAggregationFactory::buildFoundIncrementalInitial, - TypedAggregationFactory::buildInsertIncremental)); - - final ParameterSpec reincarnatedPositions = - ParameterSpec.builder(emptiedChunkType, "reincarnatedPositions").build(); - builder.addBuild( - new HasherConfig.BuildSpec("buildForUpdate", "outputPosition", - false, true, TypedAggregationFactory::buildFoundIncrementalUpdate, - TypedAggregationFactory::buildInsertIncremental, reincarnatedPositions)); + + builder.addProbe(new HasherConfig.ProbeSpec("probe", "outputPosition", false, + TypedAggregationFactory::probeFound, TypedAggregationFactory::probeMissing)); + + builder.addBuild(new HasherConfig.BuildSpec("build", "outputPosition", false, true, + TypedAggregationFactory::buildFound, TypedAggregationFactory::buildInsertIncremental)); } else if (baseClass.equals(StaticNaturalJoinStateManagerTypedBase.class)) { builder.classPrefix("StaticNaturalJoinHasher").packageGroup("naturaljoin").packageMiddle("staticopen") .openAddressedAlternate(false) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByte.java index bc4c0f565b2..0772e8a5449 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByte.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteByte.java index 1ea8ac77e74..c9637a4a7f8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteByte.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteChar.java index 69e94a90fba..d9d6223de90 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteDouble.java index a90f731a86a..3a38c6910e0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteFloat.java index 44fee989c10..f477593cca0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteInt.java index 59ac60ae777..eef7cdf9c56 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteLong.java index fe5a66637e8..e536d3eab3f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteObject.java index dbc5d3bf827..90dbe74a612 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteShort.java index 7cdbc12d496..fce710276e6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherByteShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final byte k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherChar.java index 20006a40075..c6a700f87f1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherChar.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharByte.java index e2aceb4357a..b2cbeb6bee0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharChar.java index 7ec6794d9ba..9ec16557224 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharChar.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharDouble.java index 7dd950b04b0..fffc1c78feb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharFloat.java index c8e528daa09..7f4af99aba3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharInt.java index e6b6a59d6a3..87c979d9ce1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharLong.java index 9f04e78011c..c3a1e72fd28 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharObject.java index dd53f5ddee3..6cbad7f82c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharShort.java index e04759ff361..359b266903a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherCharShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final char k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDouble.java index eb4d5483050..46864f2dcea 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDouble.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleByte.java index d70b4e92115..06f5e3805d2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleChar.java index c81731a084f..a3bda5b4b14 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleDouble.java index f2b9ea9cf75..3757bee8d05 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleDouble.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleFloat.java index c919606b9bf..292002a0fd0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleInt.java index d9e0e7b8c31..421e64894a5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleLong.java index a9789c2d1fd..774955e030c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleObject.java index e248f9f610c..25e726ee4ea 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleShort.java index 2dff13acb00..f3cd7ff5fea 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherDoubleShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final double k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloat.java index dc4368157a5..c3a4d449aaf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloat.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatByte.java index 0480e438a9f..32d1fade69a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatChar.java index a92c4c32175..0eb07bbccfc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatDouble.java index 318efd597db..5b7433a582e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatFloat.java index 7482d58bfab..bfe3296ac80 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatFloat.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatInt.java index e50486c8f0f..f1aae7905bb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatLong.java index f8366f8d604..409ce852d53 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatObject.java index 81b2b58fb4b..79d3a3d507c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatShort.java index b7f6ce2929e..b0fe924f800 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherFloatShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final float k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherInt.java index 304edb41516..bd028c56dab 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherInt.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntByte.java index ed9d33ba88c..5f121014049 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntChar.java index 8ddede36862..7afb789f677 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntDouble.java index a96c7f15c93..03be2c51c3e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntFloat.java index 624b42f23ec..0b25e88f31f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntInt.java index 0826da629b6..5e60c7f1588 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntInt.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntLong.java index 167d7d304bb..1e688aa87aa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntObject.java index 4b8b7040c7e..d4d73ebe543 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntShort.java index 196d13a2147..4506fd94e30 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherIntShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final int k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLong.java index 83e035ee197..666d1013c61 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLong.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongByte.java index cedc112f9f8..f0209a0650f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongChar.java index 765fc1c8f83..0748d2cc334 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongDouble.java index 9ce9b0d095d..81535ad0839 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongFloat.java index c296d811623..bf3a0e482aa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongInt.java index d4695e75e4d..a023272c293 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongLong.java index 7b2c7b08832..c8cac1c977f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongLong.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongObject.java index e2361ecbda8..13499ea8da0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongShort.java index 8472b0ea0a4..315cfc0d7ff 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherLongShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final long k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObject.java index 5614939eb1f..40df04f989c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObject.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; @@ -60,8 +58,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -74,12 +70,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -89,112 +82,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectByte.java index 6b6c9f046fd..6fefe2ed297 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectChar.java index eab30e68083..4c716646748 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectDouble.java index 92c1549bedd..4c6a5382a11 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectFloat.java index d269e2d2fe8..67a132cce1b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectInt.java index 06e999e4e0a..dc087128109 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectLong.java index 4d3c1901d65..d329413349e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectObject.java index b107b9e0acf..0c49e5cb3ba 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectObject.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; @@ -68,8 +66,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -83,12 +79,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -98,117 +91,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectShort.java index 4fe37e65490..0e66907078b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherObjectShort.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final Object k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShort.java index 266d7ad6332..807e9bb5cb3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShort.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; @@ -62,8 +60,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -76,12 +72,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,112 +84,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final int hash = hash(k0); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortByte.java index 3d8f4edde1c..c0f6a93e26c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortByte.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.ByteChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ByteChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final byte k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final ByteChunk keyChunk1 = sourceKeyChunks[1].asByteChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortChar.java index 3dcf5680485..8df06410271 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortChar.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.CharChunk; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final char k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final CharChunk keyChunk1 = sourceKeyChunks[1].asCharChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortDouble.java index 94645069ac1..f08dbc36e8f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortDouble.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.DoubleChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.DoubleChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final double k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final DoubleChunk keyChunk1 = sourceKeyChunks[1].asDoubleChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortFloat.java index 4d478cbd3ed..976f1ec9298 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortFloat.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.FloatChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.FloatChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final float k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final FloatChunk keyChunk1 = sourceKeyChunks[1].asFloatChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortInt.java index 2c980d20a13..cfe361c9e11 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortInt.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.IntChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.IntChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final int k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final IntChunk keyChunk1 = sourceKeyChunks[1].asIntChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortLong.java index bb1af7d7034..528067cee79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortLong.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.LongChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.LongChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -75,8 +73,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -90,12 +86,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -105,117 +98,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final long k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final LongChunk keyChunk1 = sourceKeyChunks[1].asLongChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortObject.java index 06f966caffb..00cbe84fd4e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortObject.java @@ -10,12 +10,10 @@ import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ObjectChunkHasher; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; @@ -74,8 +72,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -89,12 +85,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -104,117 +97,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final Object k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final ObjectChunk keyChunk1 = sourceKeyChunks[1].asObjectChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortShort.java index 689294ffd97..805d7e72c6b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/incopenagg/gen/IncrementalAggOpenHasherShortShort.java @@ -8,11 +8,9 @@ import io.deephaven.base.verify.Assert; import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ShortChunk; -import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.ShortChunkHasher; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase; import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; @@ -70,8 +68,6 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break MAIN_SEARCH; } else { alternateTableLocation = alternateNextTableLocation(alternateTableLocation); @@ -85,12 +81,9 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { outputPositions.set(chunkPosition, outputPosition); mainOutputPosition.set(tableLocation, outputPosition); outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - Assert.gtZero(oldRowCount, "oldRowCount"); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -100,117 +93,7 @@ protected void build(RowSequence rowSequence, Chunk[] sourceKeyChunks) { } } - protected void buildForUpdate(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk reincarnatedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - int tableLocation = firstTableLocation; - MAIN_SEARCH: while (true) { - int outputPosition = mainOutputPosition.getUnsafe(tableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - int alternateTableLocation = firstAlternateTableLocation; - while (alternateTableLocation < rehashPointer) { - outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation); - if (outputPosition == EMPTY_OUTPUT_POSITION) { - break; - } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break MAIN_SEARCH; - } else { - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - numEntries++; - mainKeySource0.set(tableLocation, k0); - mainKeySource1.set(tableLocation, k1); - outputPosition = nextOutputPosition.getAndIncrement(); - outputPositions.set(chunkPosition, outputPosition); - mainOutputPosition.set(tableLocation, outputPosition); - outputPositionToHashSlot.set(outputPosition, mainInsertMask | tableLocation); - rowCountSource.set(outputPosition, 1L); - break; - } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, 1); - if (oldRowCount == 0) { - reincarnatedPositions.add(outputPosition); - } - break; - } else { - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - } - } - } - - protected void doRemoveProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks, - WritableIntChunk emptiedPositions) { - final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); - final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); - final int chunkSize = keyChunk0.size(); - for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { - final short k0 = keyChunk0.get(chunkPosition); - final short k1 = keyChunk1.get(chunkPosition); - final int hash = hash(k0, k1); - final int firstTableLocation = hashToTableLocation(hash); - boolean found = false; - int tableLocation = firstTableLocation; - int outputPosition; - while ((outputPosition = mainOutputPosition.getUnsafe(tableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(mainKeySource0.getUnsafe(tableLocation), k0) && eq(mainKeySource1.getUnsafe(tableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - found = true; - break; - } - tableLocation = nextTableLocation(tableLocation); - Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); - } - if (!found) { - final int firstAlternateTableLocation = hashToTableLocationAlternate(hash); - boolean alternateFound = false; - if (firstAlternateTableLocation < rehashPointer) { - int alternateTableLocation = firstAlternateTableLocation; - while ((outputPosition = alternateOutputPosition.getUnsafe(alternateTableLocation)) != EMPTY_OUTPUT_POSITION) { - if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0) && eq(alternateKeySource1.getUnsafe(alternateTableLocation), k1)) { - outputPositions.set(chunkPosition, outputPosition); - final long oldRowCount = rowCountSource.getAndAddUnsafe(outputPosition, -1); - Assert.gtZero(oldRowCount, "oldRowCount"); - if (oldRowCount == 1) { - emptiedPositions.add(outputPosition); - } - alternateFound = true; - break; - } - alternateTableLocation = alternateNextTableLocation(alternateTableLocation); - Assert.neq(alternateTableLocation, "alternateTableLocation", firstAlternateTableLocation, "firstAlternateTableLocation"); - } - } - if (!alternateFound) { - throw new IllegalStateException("Missing value in probe"); - } - } - } - } - - protected void doModifyProbe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { + protected void probe(RowSequence rowSequence, Chunk[] sourceKeyChunks) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final ShortChunk keyChunk1 = sourceKeyChunks[1].asShortChunk(); final int chunkSize = keyChunk0.size(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java index fa2ca627268..e054cd2f56e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java @@ -25,6 +25,7 @@ import io.deephaven.engine.table.impl.sources.NullValueColumnSource; import io.deephaven.engine.table.impl.sources.UnionSourceManager; import io.deephaven.engine.table.iterators.ObjectColumnIterator; +import io.deephaven.engine.updategraph.ConcurrentMethod; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.util.SafeCloseable; import org.apache.commons.lang3.mutable.MutableInt; @@ -93,36 +94,43 @@ public String toString() { return "PartitionedTable for " + table.getDescription(); } + @ConcurrentMethod @Override public Table table() { return table; } + @ConcurrentMethod @Override public Set keyColumnNames() { return keyColumnNames; } + @ConcurrentMethod @Override public boolean uniqueKeys() { return uniqueKeys; } + @ConcurrentMethod @Override public String constituentColumnName() { return constituentColumnName; } + @ConcurrentMethod @Override public TableDefinition constituentDefinition() { return constituentDefinition; } + @ConcurrentMethod @Override public boolean constituentChangesPermitted() { return constituentChangesPermitted; } + @ConcurrentMethod @Override public PartitionedTable.Proxy proxy(final boolean requireMatchingKeys, final boolean sanityCheckJoinOperations) { return PartitionedTableProxyImpl.of(this, requireMatchingKeys, sanityCheckJoinOperations); @@ -187,6 +195,7 @@ private Map computeSharedAttributes(@NotNull final Iterator filters) { final WhereFilter[] whereFilters = WhereFilter.from(filters); @@ -208,6 +217,7 @@ public PartitionedTableImpl filter(@NotNull final Collection f false); } + @ConcurrentMethod @Override public PartitionedTable sort(@NotNull final Collection sortColumns) { final boolean invalidSortColumn = sortColumns.stream() @@ -227,6 +237,7 @@ public PartitionedTable sort(@NotNull final Collection sortColumns) false); } + @ConcurrentMethod @Override public PartitionedTableImpl transform(@NotNull final UnaryOperator
    transformer) { final Table resultTable; @@ -302,6 +313,7 @@ public PartitionedTableImpl partitionedTransform( // TODO (https://github.com/deephaven/deephaven-core/issues/2368): Consider adding transformWithKeys support + @ConcurrentMethod @Override public Table constituentFor(@NotNull final Object... keyColumnValues) { if (keyColumnValues.length != keyColumnNames.size()) { @@ -334,6 +346,7 @@ public Table constituentFor(@NotNull final Object... keyColumnValues) { } } + @ConcurrentMethod @Override public Table[] constituents() { final LivenessManager enclosingLivenessManager = LivenessScopeStack.peek(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 0568476fa6c..914d877cef9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -649,18 +649,23 @@ public PartitionedTable.Proxy aggBy(Aggregation aggregation) { } @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation, String... groupByColumns) { - return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); + public PartitionedTable.Proxy aggBy(Collection aggregations) { + return basicTransform(ct -> ct.aggBy(aggregations)); } @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation, Collection groupByColumns) { + public PartitionedTable.Proxy aggBy(Collection aggregations, boolean preserveEmpty) { + return basicTransform(ct -> ct.aggBy(aggregations, preserveEmpty)); + } + + @Override + public PartitionedTable.Proxy aggBy(Aggregation aggregation, String... groupByColumns) { return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); } @Override - public PartitionedTable.Proxy aggBy(Collection aggregations) { - return basicTransform(ct -> ct.aggBy(aggregations)); + public PartitionedTable.Proxy aggBy(Aggregation aggregation, Collection groupByColumns) { + return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); } @Override @@ -674,6 +679,13 @@ public PartitionedTable.Proxy aggBy(Collection aggregatio return basicTransform(ct -> ct.aggBy(aggregations, groupByColumns)); } + @Override + public PartitionedTable.Proxy aggBy(Collection aggregations, boolean preserveEmpty, + TableOperations initialGroups, Collection groupByColumns) { + return complexTransform(initialGroups, (ct, ot) -> ct.aggBy(aggregations, preserveEmpty, ot, groupByColumns), + null); + } + @Override public PartitionedTable.Proxy updateBy(UpdateByOperation operation) { return basicTransform(ct -> ct.updateBy(operation)); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java index 5c1b23b94f0..632541f4ef0 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java @@ -32,6 +32,7 @@ import java.util.*; import java.util.function.Function; +import java.util.stream.IntStream; import java.util.stream.LongStream; import org.apache.commons.lang3.mutable.MutableLong; @@ -89,29 +90,35 @@ public void testMergeSimple() { } public void testMergePopulate() { - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-implement once populate keys is replaced - /* - * final QueryTable queryTable = TstUtils.testRefreshingTable(i(1, 2, 4, 6).toTracking(), c("Sym", "aa", "bb", - * "aa", "bb"), c("intCol", 10, 20, 40, 60), c("doubleCol", 0.1, 0.2, 0.4, 0.6)); - * - * final Table withK = queryTable.update("K=k"); - * - * final PartitionedTable partitionedTable = withK.partitionBy("Sym"); partitionedTable.populateKeys("cc", - * "dd"); - * - * final Table merged = partitionedTable.merge(); final Table mergedByK = merged.sort("K"); - * - * if (printTableUpdates) { TableTools.show(withK); TableTools.show(mergedByK); } - * - * assertEquals("", TableTools.diff(mergedByK, withK, 10)); - * - * UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { addToTable(queryTable, i(3, 9), c("Sym", "cc", - * "cc"), c("intCol", 30, 90), c("doubleCol", 2.3, 2.9)); queryTable.notifyListeners(i(3, 9), i(), i()); }); - * - * if (printTableUpdates) { TableTools.show(withK); TableTools.show(mergedByK); } - * - * assertEquals("", TableTools.diff(mergedByK, withK, 10)); - */ + final QueryTable queryTable = TstUtils.testRefreshingTable(i(1, 2, 4, 6).toTracking(), + c("Sym", "aa", "bb", "aa", "bb"), c("intCol", 10, 20, 40, 60), c("doubleCol", 0.1, 0.2, 0.4, 0.6)); + + final Table withK = queryTable.update("K=k"); + + final QueryTable keyTable = TstUtils.testTable(c("Sym", "cc", "dd")); + final PartitionedTable partitionedTable = withK.partitionedAggBy(List.of(), true, keyTable, "Sym"); + + final Table merged = partitionedTable.merge(); + final Table mergedByK = merged.sort("K"); + + if (printTableUpdates) { + TableTools.show(withK); + TableTools.show(mergedByK); + } + + assertEquals("", TableTools.diff(mergedByK, withK, 10)); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + addToTable(queryTable, i(3, 9), c("Sym", "cc", "cc"), c("intCol", 30, 90), c("doubleCol", 2.3, 2.9)); + queryTable.notifyListeners(i(3, 9), i(), i()); + }); + + if (printTableUpdates) { + TableTools.show(withK); + TableTools.show(mergedByK); + } + + assertEquals("", TableTools.diff(mergedByK, withK, 10)); } public void testMergeIncremental() { @@ -133,16 +140,18 @@ private void testMergeIncremental(int seed) { new TstUtils.IntGenerator(0, 20), new TstUtils.DoubleGenerator(0, 100))); - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-add key initialization final EvalNugget en[] = new EvalNugget[] { new EvalNugget() { public Table e() { - return table.partitionBy("Sym").merge().sort("Sym"); + return table.partitionedAggBy(List.of(), true, testTable(c("Sym", syms)), "Sym") + .merge().sort("Sym"); } }, new EvalNugget() { public Table e() { - return table.partitionBy("intCol").merge().sort("intCol"); + return table.partitionedAggBy(List.of(), true, + testTable(intCol("intCol", IntStream.rangeClosed(0, 20).toArray())), "intCol") + .merge().sort("intCol"); } }, }; @@ -195,21 +204,19 @@ public void testProxy() { new TstUtils.SetGenerator<>("aa", "bb", "cc", "dd"), new TstUtils.IntGenerator(100, 200))); - final PartitionedTable leftPT = withK.partitionBy("Sym"); - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-add key initialization - // leftPT.populateKeys("aa", "bb", "cc", "dd"); + final PartitionedTable leftPT = + withK.partitionedAggBy(List.of(), true, testTable(c("Sym", "aa", "bb", "cc", "dd")), "Sym"); final PartitionedTable.Proxy leftProxy = leftPT.proxy(false, false); - final PartitionedTable rightPT = rightTable.partitionBy("Sym"); - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-add key initialization - // rightPT.populateKeys("aa", "bb", "cc", "dd"); + final PartitionedTable rightPT = + rightTable.partitionedAggBy(List.of(), true, testTable(c("Sym", "aa", "bb", "cc", "dd")), "Sym"); final PartitionedTable.Proxy rightProxy = rightPT.proxy(false, false); final EvalNuggetInterface[] en = new EvalNuggetInterface[] { new EvalNugget() { public Table e() { - return table.update("K=Indices").partitionBy("Sym") - // .populateKeys("aa", "bb", "cc", "dd") + return table.update("K=Indices") + .partitionedAggBy(List.of(), true, testTable(c("Sym", "aa", "bb", "cc", "dd")), "Sym") .proxy(false, false) .update("K2=Indices*2") .select("K", "K2", "Half=doubleCol/2", "Sq=doubleCol*doubleCol", diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java index e4f247c628e..dae6a527b27 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java @@ -6,11 +6,13 @@ import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; +import io.deephaven.api.agg.Count; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.rowset.RowSetShiftData; +import io.deephaven.engine.rowset.TrackingWritableRowSet; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.indexer.RowSetIndexer; import io.deephaven.qst.table.AggregateAllByTable; @@ -62,6 +64,7 @@ import static io.deephaven.api.agg.spec.AggSpec.percentile; import static io.deephaven.engine.util.TableTools.*; import static io.deephaven.engine.table.impl.TstUtils.*; +import static io.deephaven.util.QueryConstants.*; @Category(OutOfBandTest.class) public class QueryTableAggregationTest { @@ -124,7 +127,7 @@ private static Table individualStaticByTest(@NotNull final Table input, final Table aggregatedInput = ChunkedOperatorAggregationHelper.aggregation( aggregationControl == null ? AggregationControl.DEFAULT : aggregationControl, makeGroupByACF(adjustedInput, keyColumns), - (QueryTable) adjustedInput, ColumnName.from(keyColumns)); + (QueryTable) adjustedInput, false, null, ColumnName.from(keyColumns)); actualKeys = keyColumns.length == 0 ? aggregatedInput.dropColumns(aggregatedInput.getDefinition().getColumnNamesArray()) : aggregatedInput.view(keyColumns); @@ -236,10 +239,11 @@ private IncrementalFirstStaticAfterByResultSupplier(@NotNull final AggregationCo public final Table get() { if (firstTime.compareAndSet(true, false)) { return ChunkedOperatorAggregationHelper - .aggregation(control, acf, input, ColumnName.from(columns)).sort(columns); + .aggregation(control, acf, input, false, null, ColumnName.from(columns)).sort(columns); } return ChunkedOperatorAggregationHelper - .aggregation(control, acf, (QueryTable) input.silent(), ColumnName.from(columns)).sort(columns); + .aggregation(control, acf, (QueryTable) input.silent(), false, null, ColumnName.from(columns)) + .sort(columns); } } @@ -1687,7 +1691,7 @@ public void testAbsSumBySimple() { BigInteger expected = BigInteger.valueOf(6); TestCase.assertEquals(expected, absSum); TestCase.assertEquals(expected.doubleValue(), absSumDouble); - TestCase.assertEquals(QueryConstants.NULL_LONG, result.getColumn("BoolCol").getLong(0)); + TestCase.assertEquals(NULL_LONG, result.getColumn("BoolCol").getLong(0)); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { TstUtils.addToTable(table, i(8), col("BigI", BigInteger.valueOf(5)), col("DoubleCol", 5.0), @@ -1766,14 +1770,14 @@ public void testAbsSumBySimple() { @Test public void testAbsSumByNull() { final QueryTable table = TstUtils.testRefreshingTable(i(2).toTracking(), - intCol("IntCol", QueryConstants.NULL_INT), + intCol("IntCol", NULL_INT), floatCol("FloatCol", QueryConstants.NULL_FLOAT)); final Table result = table.absSumBy(); TableTools.show(result); TestCase.assertEquals(1, result.size()); long absSum = result.getColumn("IntCol").getLong(0); - TestCase.assertEquals(QueryConstants.NULL_LONG, absSum); + TestCase.assertEquals(NULL_LONG, absSum); float absSumF = result.getColumn("FloatCol").getFloat(0); TestCase.assertEquals(QueryConstants.NULL_FLOAT, absSumF); @@ -1794,14 +1798,14 @@ public void testAbsSumByNull() { show(result); absSum = result.getColumn("IntCol").getLong(0); absSumF = result.getColumn("FloatCol").getFloat(0); - TestCase.assertEquals(QueryConstants.NULL_LONG, absSum); + TestCase.assertEquals(NULL_LONG, absSum); TestCase.assertEquals(QueryConstants.NULL_FLOAT, absSumF); } @Test public void testAvgInfinities() { final QueryTable table = TstUtils.testRefreshingTable(i(2).toTracking(), - intCol("IntCol", QueryConstants.NULL_INT), + intCol("IntCol", NULL_INT), floatCol("FloatCol", QueryConstants.NULL_FLOAT)); final Table result = table.avgBy(); @@ -1879,7 +1883,7 @@ public void testAvgInfinities() { @Test public void testVarInfinities() { final QueryTable table = TstUtils.testRefreshingTable(i(2).toTracking(), - intCol("IntCol", QueryConstants.NULL_INT), + intCol("IntCol", NULL_INT), floatCol("FloatCol", QueryConstants.NULL_FLOAT)); final Table result = table.varBy(); @@ -3585,4 +3589,111 @@ public void testIds7553() { final Table prevResult = prevTableColumnSources(result); assertTableEquals(result, prevResult); } + + @Test + public void testInitialGroupsOrdering() { + // Tests bucketed addition for static tables and static initial groups + + final Table data = testTable(c("S", "A", "B", "C", "D"), c("I", 10, 20, 30, 40)); + final Table distinct = data.selectDistinct(); + assertTableEquals(data, distinct); + + final Table reversed = data.reverse(); + final Table initializedDistinct = + data.aggBy(List.of(Count.of("C")), false, reversed, ColumnName.from("S", "I")).dropColumns("C"); + assertTableEquals(reversed, initializedDistinct); + } + + @Test + public void testInitialGroupsWithGrouping() { + // Tests grouped addition for static tables and static initial groups + + final Table data = testTable(c("S", "A", "A", "B", "B"), c("I", 10, 20, 30, 40)); + final RowSetIndexer dataIndexer = RowSetIndexer.of(data.getRowSet()); + dataIndexer.getGrouping(data.getColumnSource("S")); + final Table distinct = data.selectDistinct("S"); + assertTableEquals(testTable(c("S", "A", "B")), distinct); + + final Table reversed = data.reverse(); + final RowSetIndexer reversedIndexer = RowSetIndexer.of(reversed.getRowSet()); + reversedIndexer.getGrouping(reversed.getColumnSource("S")); + final Table initializedDistinct = + data.aggBy(List.of(Count.of("C")), false, reversed, ColumnName.from("S")).dropColumns("C"); + assertTableEquals(testTable(c("S", "B", "A")), initializedDistinct); + } + + @Test + public void testInitialGroupsRefreshing() { + // Tests bucketed addition for refreshing tables and refreshing initial groups + + final Collection aggs = List.of( + AggCount("Count"), + AggSum("SumI=I"), + AggMax("MaxI=I"), + AggMin("MinI=I"), + AggGroup("GroupS=S")); + + final TrackingWritableRowSet inputRows = ir(0, 9).toTracking(); + final QueryTable input = testRefreshingTable(inputRows, + c("S", "A", "B", "C", "D", "E", "F", "G", "H", "I", "K"), + c("C", 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E'), + c("I", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); + inputRows.removeRange(0, 8); + + final Table initialKeys = testRefreshingTable(c("C", 'A', 'B', 'C', 'D', 'E')); + + final Table aggregated = input.aggBy(aggs, true, initialKeys, ColumnName.from("C")); + final Table initialState = emptyTable(0).snapshot(aggregated); + TestCase.assertEquals(5, aggregated.size()); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + inputRows.insertRange(0, 8); + input.notifyListeners(ir(0, 8), i(), i()); + }); + TestCase.assertEquals(5, aggregated.size()); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + inputRows.removeRange(0, 8); + input.notifyListeners(i(), ir(0, 8), i()); + }); + TestCase.assertEquals(5, aggregated.size()); + + assertTableEquals(initialState, aggregated); + } + + @Test + public void testPreserveEmptyNoKey() { + final Collection aggs = List.of( + AggCount("Count"), + AggSum("SumI=I"), + AggMax("MaxI=I"), + AggMin("MinI=I")); + + final Table expectedEmpty = testTable( + c("Count", 0L), c("SumI", NULL_LONG_BOXED), c("MaxI", NULL_INT_BOXED), c("MinI", NULL_INT_BOXED)); + + final TrackingWritableRowSet inputRows = ir(0, 9).toTracking(); + final QueryTable input = testRefreshingTable(inputRows, + c("S", "A", "B", "C", "D", "E", "F", "G", "H", "I", "K"), + c("C", 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E'), + c("I", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); + inputRows.removeRange(0, 9); + + final Table aggregated = input.aggBy(aggs, true); + TestCase.assertEquals(1, aggregated.size()); + assertTableEquals(expectedEmpty, aggregated); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + inputRows.insertRange(0, 9); + input.notifyListeners(ir(0, 9), i(), i()); + }); + TestCase.assertEquals(1, aggregated.size()); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + inputRows.removeRange(0, 9); + input.notifyListeners(i(), ir(0, 9), i()); + }); + TestCase.assertEquals(1, aggregated.size()); + assertTableEquals(expectedEmpty, aggregated); + } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionBy.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionBy.java index 5db9d072370..ff1bae7034d 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionBy.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionBy.java @@ -441,23 +441,24 @@ public void testReleaseRaceRollup() { } public void testPopulateKeysStatic() { - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-implement once populate keys is replaced - /* - * final Table table = emptyTable(1).update("USym=`AAPL`", "Value=1"); final PartitionedTable map = - * table.partitionBy("USym"); map.populateKeys("SPY"); System.out.println(Arrays.toString(map.getKeySet())); - * assertEquals(map.getKeySet(), new String[] {"AAPL", "SPY"}); assertFalse(((TableMapImpl) - * map).isRefreshing()); - */ + testPopulateKeys(false); } public void testPopulateKeysRefreshing() { - // TODO (https://github.com/deephaven/deephaven-core/issues/2416): Re-implement once populate keys is replaced - /* - * final Table table = emptyTable(1).update("USym=`AAPL`", "Value=1"); ((BaseTable) table).setRefreshing(true); - * final TableMap map = table.partitionBy("USym"); map.populateKeys("SPY"); - * System.out.println(Arrays.toString(map.getKeySet())); assertEquals(map.getKeySet(), new String[] {"AAPL", - * "SPY"}); assertTrue(((TableMapImpl) map).isRefreshing()); - */ + testPopulateKeys(true); + } + + private void testPopulateKeys(final boolean refreshing) { + final Table table = emptyTable(1).update("USym=`AAPL`", "Value=1"); + if (refreshing) { + table.setRefreshing(true); + } + final PartitionedTable pt = table.partitionedAggBy(List.of(), true, testTable(c("USym", "SPY")), "USym"); + final String keyColumnName = pt.keyColumnNames().stream().findFirst().get(); + final String[] keys = (String[]) pt.table().getColumn(keyColumnName).getDirect(); + System.out.println(Arrays.toString(keys)); + assertEquals(keys, new String[] {"SPY", "AAPL"}); + assertEquals(pt.table().isRefreshing(), refreshing); } public void testPartitionByWithShifts() { diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java index 1da15dd762e..8a7f91ab76c 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java @@ -400,6 +400,10 @@ public void visit(AggregateAllByTable aggAllByTable) { @Override public void visit(AggregationTable aggregationTable) { + if (aggregationTable.preserveEmpty() || aggregationTable.initialGroups().isPresent()) { + throw new UnsupportedOperationException( + "TODO(deephaven-core#991): TableService aggregation coverage, https://github.com/deephaven/deephaven-core/issues/991"); + } out = op(Builder::setComboAggregate, aggBy(aggregationTable)); } diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java index b0fa1a9efbc..b9eff7fbc46 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java @@ -257,9 +257,11 @@ public void visit(AggregateAllByTable aggAllByTable) { @Override public void visit(AggregationTable aggregationTable) { if (aggregationTable.groupByColumns().isEmpty()) { - addOp(aggregationTable, parentOps(aggregationTable).aggBy(aggregationTable.aggregations())); + addOp(aggregationTable, ops(aggregationTable.parent()).aggBy(aggregationTable.aggregations(), + aggregationTable.preserveEmpty())); } else { - addOp(aggregationTable, parentOps(aggregationTable).aggBy(aggregationTable.aggregations(), + addOp(aggregationTable, ops(aggregationTable.parent()).aggBy(aggregationTable.aggregations(), + aggregationTable.preserveEmpty(), aggregationTable.initialGroups().map(this::table).orElse(null), aggregationTable.groupByColumns())); } } diff --git a/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java b/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java index 6a5e8c55186..135a2467e43 100644 --- a/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/AggregateAllByTable.java @@ -17,7 +17,7 @@ @Immutable @NodeStyle -public abstract class AggregateAllByTable extends ByTableBase { +public abstract class AggregateAllByTable extends ByTableBase implements SingleParentTable { public static Builder builder() { return ImmutableAggregateAllByTable.builder(); diff --git a/qst/src/main/java/io/deephaven/qst/table/AggregationTable.java b/qst/src/main/java/io/deephaven/qst/table/AggregationTable.java index ddaddcd9e81..6f8fb8feefe 100644 --- a/qst/src/main/java/io/deephaven/qst/table/AggregationTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/AggregationTable.java @@ -5,11 +5,13 @@ import io.deephaven.annotations.NodeStyle; import io.deephaven.api.agg.Aggregation; +import org.immutables.value.Value; import org.immutables.value.Value.Check; import org.immutables.value.Value.Immutable; import java.util.Collection; import java.util.List; +import java.util.Optional; /** * @see io.deephaven.api.TableOperations#aggBy(Collection, Collection) @@ -24,6 +26,13 @@ public static Builder builder() { public abstract List aggregations(); + @Value.Default + public boolean preserveEmpty() { + return false; + } + + public abstract Optional initialGroups(); + @Override public final V walk(V visitor) { visitor.visit(this); @@ -37,11 +46,26 @@ final void checkNumAggs() { } } + @Check + final void checkInitialGroups() { + if (groupByColumns().isEmpty() && initialGroups().isPresent()) { + throw new IllegalArgumentException("InitialGroups must not be set if GroupByColumns is empty"); + } + } + + public interface Builder extends ByTableBase.Builder { Builder addAggregations(Aggregation element); Builder addAggregations(Aggregation... elements); Builder addAllAggregations(Iterable elements); + + Builder preserveEmpty(boolean preserveEmpty); + + Builder initialGroups(TableSpec initialGroups); + + Builder initialGroups( + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") Optional initialGroups); } } diff --git a/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java b/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java index 9ec4c94b06f..8333be7eac6 100644 --- a/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/ByTableBase.java @@ -7,7 +7,7 @@ import java.util.List; -public abstract class ByTableBase extends TableBase implements SingleParentTable { +public abstract class ByTableBase extends TableBase { public abstract TableSpec parent(); diff --git a/qst/src/main/java/io/deephaven/qst/table/CountByTable.java b/qst/src/main/java/io/deephaven/qst/table/CountByTable.java index aedae251aad..17e256fb1cd 100644 --- a/qst/src/main/java/io/deephaven/qst/table/CountByTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/CountByTable.java @@ -9,7 +9,7 @@ @Immutable @NodeStyle -public abstract class CountByTable extends ByTableBase { +public abstract class CountByTable extends ByTableBase implements SingleParentTable { public static Builder builder() { return ImmutableCountByTable.builder(); diff --git a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java index 82e0f447b53..f6d455d7cad 100644 --- a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java +++ b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java @@ -254,7 +254,11 @@ public void visit(AggregateAllByTable aggAllByTable) { @Override public void visit(AggregationTable aggregationTable) { - out = single(aggregationTable); + if (aggregationTable.initialGroups().isPresent()) { + out = Stream.of(aggregationTable.initialGroups().get(), aggregationTable.parent()); + } else { + out = Stream.of(aggregationTable.parent()); + } } @Override diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index c2b0f93f401..b70c5ed9981 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Optional; import java.util.stream.Collectors; public abstract class TableBase implements TableSpec { @@ -434,6 +435,19 @@ public final AggregationTable aggBy(Aggregation aggregation) { return AggregationTable.builder().parent(this).addAggregations(aggregation).build(); } + @Override + public final AggregationTable aggBy(Collection aggregations) { + return AggregationTable.builder().parent(this).addAllAggregations(aggregations).build(); + } + + @Override + public TableSpec aggBy(Collection aggregations, boolean preserveEmpty) { + return AggregationTable.builder().parent(this) + .addAllAggregations(aggregations) + .preserveEmpty(preserveEmpty) + .build(); + } + @Override public final AggregationTable aggBy(Aggregation aggregation, String... groupByColumns) { final AggregationTable.Builder builder = AggregationTable.builder().parent(this); @@ -449,11 +463,6 @@ public final AggregationTable aggBy(Aggregation aggregation, Collection aggregations) { - return AggregationTable.builder().parent(this).addAllAggregations(aggregations).build(); - } - @Override public final AggregationTable aggBy(Collection aggregations, String... groupByColumns) { final AggregationTable.Builder builder = AggregationTable.builder().parent(this); @@ -470,6 +479,17 @@ public final AggregationTable aggBy(Collection aggregatio .addAllAggregations(aggregations).build(); } + @Override + public TableSpec aggBy(Collection aggregations, boolean preserveEmpty, + TableSpec initialGroups, Collection groupByColumns) { + return AggregationTable.builder().parent(this) + .addAllGroupByColumns(groupByColumns) + .addAllAggregations(aggregations) + .preserveEmpty(preserveEmpty) + .initialGroups(Optional.ofNullable(initialGroups)) + .build(); + } + @Override public final UpdateByTable updateBy(UpdateByOperation operation) { return UpdateByTable.builder() diff --git a/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java b/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java index cca47da33af..309bfe46242 100644 --- a/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java +++ b/qst/src/main/java/io/deephaven/qst/table/UpdateByTable.java @@ -14,7 +14,7 @@ @Immutable @NodeStyle -public abstract class UpdateByTable extends ByTableBase { +public abstract class UpdateByTable extends ByTableBase implements SingleParentTable { public static Builder builder() { return ImmutableUpdateByTable.builder(); diff --git a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java index 33f0578c8f9..9be1b0d6c4b 100644 --- a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java +++ b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java @@ -117,27 +117,6 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", "engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedCrossJoinStateManager.java", allowMissingDestinations, Arrays.asList("dumpTable", "prev")); - - // Incremental NJ -> Static Operator Aggregations - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/by/StaticChunkedOperatorAggregationStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "prev", "decorationProbe")); - // Incremental NJ -> Incremental Operator Aggregations - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/by/IncrementalChunkedOperatorAggregationStateManager.java", - allowMissingDestinations, Collections.singletonList("dumpTable")); - - // Incremental NJ -> AddOnly updateBy - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/AddOnlyUpdateByStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "prev", "decorationProbe")); - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/hashing/IncrementalUpdateByStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "allowUpdateWriteThroughState")); } private static class RegionedFile { diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index 8fb20074641..c64cf5452e4 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -511,18 +511,107 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, // ------------------------------------------------------------------------------------------- + /** + * Produce an aggregated result by grouping all rows from {@code this} into a single group of rows and applying + * {@code aggregation} to the result. The result table will have one row if {@code this} has one or more rows, or + * else zero rows. + * + * @param aggregation The {@link Aggregation aggregation} to apply + * @return A new table aggregating the rows of {@code this} + */ TOPS aggBy(Aggregation aggregation); + /** + * Produce an aggregated result by grouping all rows from {@code this} into a single group of rows and applying + * {@code aggregations} to the result. The result table will have one row if {@code this} has one or more rows, or + * else zero rows. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @return A new table aggregating the rows of {@code this} + */ + TOPS aggBy(Collection aggregations); + + /** + * Produce an aggregated result by grouping all rows from {@code this} into a single group of rows and applying + * {@code aggregations} to the result. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @param preserveEmpty If {@code preserveEmpty == true}, the result table will always have one row. Otherwise, the + * result table will have one row if {@code this} has one or more rows, or else zero rows. + * @return A new table aggregating the rows of {@code this} + */ + TOPS aggBy(Collection aggregations, boolean preserveEmpty); + + /** + * Produce an aggregated result by grouping {@code this} according to the {@code groupByColumns} and applying + * {@code aggregation} to each resulting group of rows. The result table will have one row per group, ordered by the + * encounter order within {@code this}, thereby ensuring that the row key for a given group never changes. + * Groups that become empty will be removed from the result. + * + * @param aggregation The {@link Aggregation aggregation} to apply + * @param groupByColumns The columns to group by + * @return A new table aggregating the rows of {@code this} + */ TOPS aggBy(Aggregation aggregation, String... groupByColumns); + /** + * Produce an aggregated result by grouping {@code this} according to the {@code groupByColumns} and applying + * {@code aggregation} to each resulting group of rows. The result table will have one row per group, ordered by the + * encounter order within {@code this}, thereby ensuring that the row key for a given group never changes. + * Groups that become empty will be removed from the result. + * + * @param aggregation The {@link Aggregation aggregation} to apply + * @param groupByColumns The {@link ColumnName columns} to group by + * @return A new table aggregating the rows of {@code this} + */ TOPS aggBy(Aggregation aggregation, Collection groupByColumns); - TOPS aggBy(Collection aggregations); - + /** + * Produce an aggregated result by grouping {@code this} according to the {@code groupByColumns} and applying + * {@code aggregations} to each resulting group of rows. The result table will have one row per group, ordered by + * the encounter order within {@code this}, thereby ensuring that the row key for a given group never + * changes. Groups that become empty will be removed from the result. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @param groupByColumns The columns to group by + * @return A new table aggregating the rows of {@code this} + */ TOPS aggBy(Collection aggregations, String... groupByColumns); + /** + * Produce an aggregated result by grouping {@code this} according to the {@code groupByColumns} and applying + * {@code aggregations} to each resulting group of rows. The result table will have one row per group, ordered by + * the encounter order within {@code this}, thereby ensuring that the row key for a given group never + * changes. Groups that become empty will be removed from the result. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @param groupByColumns The {@link ColumnName columns} to group by + * @return A new table aggregating the rows of {@code this} + */ TOPS aggBy(Collection aggregations, Collection groupByColumns); + /** + * Produce an aggregated result by grouping {@code this} according to the {@code groupByColumns} and applying + * {@code aggregations} to each resulting group of rows. The result table will have one row per group, ordered by + * the encounter order within {@code this}, thereby ensuring that the row key for a given group never + * changes. + * + * @param aggregations The {@link Aggregation aggregations} to apply + * @param preserveEmpty Whether to keep result rows for groups that are initially empty or become empty as a result + * of updates. Each aggregation operator defines its own value for empty groups. + * @param initialGroups A table whose distinct combinations of values for the {@code groupByColumns} should be used + * to create an initial set of aggregation groups. All other columns are ignored. This is useful in + * combination with {@code preserveEmpty == true} to ensure that particular groups appear in the result + * table, or with {@code preserveEmpty == false} to control the encounter order for a collection of groups + * and thus their relative order in the result. Changes to {@code initialGroups} are not expected or handled; + * if {@code initialGroups} is a refreshing table, only its contents at instantiation time will be used. If + * {@code initialGroups == null}, the result will be the same as if a table with no rows was supplied. + * @param groupByColumns The {@link ColumnName columns} to group by + * @return A new table aggregating the rows of {@code this} + */ + TOPS aggBy(Collection aggregations, boolean preserveEmpty, TABLE initialGroups, + Collection groupByColumns); + // ------------------------------------------------------------------------------------------- TOPS updateBy(UpdateByOperation operation); diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java index 632fc7f696a..40e4a9973d5 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java @@ -301,18 +301,23 @@ public final TOPS_1 aggBy(Aggregation aggregation) { } @Override - public final TOPS_1 aggBy(Aggregation aggregation, String... groupByColumns) { - return adapt(delegate.aggBy(aggregation, groupByColumns)); + public final TOPS_1 aggBy(Collection aggregations) { + return adapt(delegate.aggBy(aggregations)); } @Override - public final TOPS_1 aggBy(Aggregation aggregation, Collection groupByColumns) { + public TOPS_1 aggBy(Collection aggregations, boolean preserveEmpty) { + return adapt(delegate.aggBy(aggregations, preserveEmpty)); + } + + @Override + public final TOPS_1 aggBy(Aggregation aggregation, String... groupByColumns) { return adapt(delegate.aggBy(aggregation, groupByColumns)); } @Override - public final TOPS_1 aggBy(Collection aggregations) { - return adapt(delegate.aggBy(aggregations)); + public final TOPS_1 aggBy(Aggregation aggregation, Collection groupByColumns) { + return adapt(delegate.aggBy(aggregation, groupByColumns)); } @Override @@ -364,6 +369,13 @@ public final TOPS_1 updateBy(UpdateByControl control, Collection aggregations, boolean preserveEmpty, TABLE_1 initialGroups, + Collection groupByColumns) { + return adapt(delegate.aggBy(aggregations, preserveEmpty, initialGroups == null ? null : adapt(initialGroups), + groupByColumns)); + } + @Override public final TOPS_1 selectDistinct() { return adapt(delegate.selectDistinct()); From 8b9532c45ad90e86b7aabeef5a3acd0dd265d28b Mon Sep 17 00:00:00 2001 From: SuperTails Date: Wed, 10 Aug 2022 14:05:53 -0600 Subject: [PATCH 064/215] Remove explicit field syncing from Python client (#2716) --- py/client/pydeephaven/session.py | 127 ++++++-------------------- py/client/tests/test_console.py | 5 + py/client/tests/test_multi_session.py | 6 +- 3 files changed, 36 insertions(+), 102 deletions(-) diff --git a/py/client/pydeephaven/session.py b/py/client/pydeephaven/session.py index 2a430b531ac..5c59baa0849 100644 --- a/py/client/pydeephaven/session.py +++ b/py/client/pydeephaven/session.py @@ -22,10 +22,6 @@ from pydeephaven.query import Query from pydeephaven.table import Table -NO_SYNC = 0 -SYNC_ONCE = 1 -SYNC_REPEATED = 2 - class Session: """ A Session object represents a connection to the Deephaven data server. It contains a number of convenience methods for asking the server to create tables, import Arrow data into tables, merge tables, run Python scripts, and @@ -39,7 +35,7 @@ class Session: is_alive (bool): check if the session is still alive (may refresh the session) """ - def __init__(self, host: str = None, port: int = None, never_timeout: bool = True, session_type: str = 'python', sync_fields: int = NO_SYNC): + def __init__(self, host: str = None, port: int = None, never_timeout: bool = True, session_type: str = 'python'): """ Initialize a Session object that connects to the Deephaven server Args: @@ -47,13 +43,7 @@ def __init__(self, host: str = None, port: int = None, never_timeout: bool = Tru port (int): the port number that Deephaven server is listening on, default is 10000 never_timeout (bool, optional): never allow the session to timeout, default is True session_type (str, optional): the Deephaven session type. Defaults to 'python' - sync_fields (int, optional): equivalent to calling `Session.sync_fields()` (see below), default is NO_SYNC - Sync Options: - session.NO_SYNC: does not check for existing tables on the server - session.SYNC_ONCE: equivalent to `Session.sync_fields(repeating=False)` - session.SYNC_REPEATED: equivalent to `Session.sync_fields(repeating=True)` - Raises: DHError """ @@ -69,9 +59,6 @@ def __init__(self, host: str = None, port: int = None, never_timeout: bool = Tru if not port: self.port = int(os.environ.get("DH_PORT", 10000)) - if sync_fields not in (NO_SYNC, SYNC_ONCE, SYNC_REPEATED): - raise DHError("invalid sync_fields setting") - self.is_connected = False self.session_token = None self.grpc_channel = None @@ -84,10 +71,6 @@ def __init__(self, host: str = None, port: int = None, never_timeout: bool = Tru self._never_timeout = never_timeout self._keep_alive_timer = None self._session_type = session_type - self._sync_fields = sync_fields - self._list_fields = None - self._field_update_thread = None - self._fields = {} self._connect() @@ -102,7 +85,8 @@ def __exit__(self, exc_type, exc_val, exc_tb): @property def tables(self): with self._r_lock: - return [nm for sc, nm in self._fields if sc == 'scope' and self._fields[(sc, nm)][0] == 'Table'] + fields = self._fetch_fields() + return [field.field_name for field in fields if field.application_id == 'scope' and field.typed_ticket.type == 'Table'] @property def grpc_metadata(self): @@ -154,53 +138,19 @@ def get_ticket(self): return self._last_ticket - def sync_fields(self, repeating: bool): - """ Check for fields that have been added/deleted by other sessions and add them to the local list + def _fetch_fields(self): + """ Returns a list of available fields on the server. - This will start a new background thread when `repeating=True`. - - Args: - repeating (bool): Continue to check in the background for new/updated tables - Raises: DHError """ with self._r_lock: - if self._list_fields is not None: - return - - self._list_fields = self.app_service.list_fields() - self._parse_fields_change(next(self._list_fields)) - if repeating: - self._field_update_thread = threading.Thread(target=self._update_fields) - self._field_update_thread.daemon = True - self._field_update_thread.start() - else: - if not self._list_fields.cancel(): - raise DHError("could not cancel ListFields subscription") - self._list_fields = None - - def _update_fields(self): - """ Constant loop that checks for any server-side field changes and adds them to the local list """ - try: - while True: - fields_change = next(self._list_fields) - with self._r_lock: - self._parse_fields_change(fields_change) - except Exception as e: - if isinstance(e, grpc.Future): - pass - else: - raise e + list_fields = self.app_service.list_fields() + resp = next(list_fields) + if not list_fields.cancel(): + raise DHError("could not cancel ListFields subscription") + return resp.created if resp.created else [] - def _cancel_update_fields(self): - with self._r_lock: - if self._field_update_thread is not None: - self._list_fields.cancel() - self._field_update_thread.join() - self._list_fields = None - self._field_update_thread = None - def _connect(self): with self._r_lock: self.grpc_channel, self.session_token, self._timeout = self.session_service.connect() @@ -209,11 +159,6 @@ def _connect(self): if self._never_timeout: self._keep_alive() - if self._sync_fields == SYNC_ONCE: - self.sync_fields(repeating=False) - elif self._sync_fields == SYNC_REPEATED: - self.sync_fields(repeating=True) - def _keep_alive(self): if self._keep_alive_timer: self._refresh_token() @@ -252,7 +197,6 @@ def close(self) -> None: """ with self._r_lock: if self.is_connected: - self._cancel_update_fields() self.session_service.close() self.grpc_channel.close() self.is_connected = False @@ -262,24 +206,6 @@ def close(self) -> None: def release(self, ticket): self.session_service.release(ticket) - def _parse_fields_change(self, fields_change): - if fields_change.created: - for t in fields_change.created: - t_type = None if t.typed_ticket.type == '' else t.typed_ticket.type - self._fields[(t.application_id, t.field_name)] = (t_type, Table(session=self, ticket=t.typed_ticket.ticket)) - - if fields_change.updated: - for t in fields_change.updated: - t_type = None if t.typed_ticket.type == '' else t.typed_ticket.type - self._fields[(t.application_id, t.field_name)] = (t_type, Table(session=self, ticket=t.typed_ticket.ticket)) - - if fields_change.removed: - for t in fields_change.removed: - self._fields.pop((t.application_id, t.field_name), None) - - def _parse_script_response(self, response): - self._parse_fields_change(response.changes) - # convenience/factory methods def run_script(self, script: str) -> None: """ Run the supplied Python script on the server. @@ -292,17 +218,9 @@ def run_script(self, script: str) -> None: """ with self._r_lock: - if self._sync_fields == SYNC_REPEATED: - self._cancel_update_fields() - response = self.console_service.run_script(script) - - if self._sync_fields == SYNC_REPEATED: - self._fields = {} - self._parse_script_response(response) - self.sync_fields(repeating=True) - else: - self._parse_script_response(response) + if response.error_message != '': + raise DHError("could not run script: " + response.error_message) def open_table(self, name: str) -> Table: """ Open a table in the global scope with the given name on the server. @@ -317,10 +235,23 @@ def open_table(self, name: str) -> Table: DHError """ with self._r_lock: - if name not in self.tables: - raise DHError(f"no table by the name {name}") - table_op = FetchTableOp() - return self.table_service.grpc_table_op(self._fields[('scope', name)][1], table_op) + ticket = ticket_pb2.Ticket(ticket=f's/{name}'.encode(encoding='ascii')) + + faketable = Table(session=self, ticket=ticket) + + try: + table_op = FetchTableOp() + return self.table_service.grpc_table_op(faketable, table_op) + except Exception as e: + if isinstance(e.__cause__, grpc.RpcError): + if e.__cause__.code() == grpc.StatusCode.INVALID_ARGUMENT: + raise DHError(f"no table by the name {name}") from None + raise e + finally: + # Explicitly close the table without releasing it (because it isn't ours) + faketable.ticket = None + faketable.schema = None + def bind_table(self, name: str, table: Table) -> None: """ Bind a table to the given name on the server so that it can be referenced by that name. diff --git a/py/client/tests/test_console.py b/py/client/tests/test_console.py index aa902faceae..3fccaac4174 100644 --- a/py/client/tests/test_console.py +++ b/py/client/tests/test_console.py @@ -6,6 +6,7 @@ from pyarrow import csv +from pydeephaven import DHError from tests.testbase import BaseTestCase @@ -48,3 +49,7 @@ def vectorized_func(x, y): pa_table = self.session.open_table('demo_table').snapshot() df = pa_table.to_pandas() self.assertEquals(1000, len(df.index)) + + def test_open_invalid_table(self): + with self.assertRaises(DHError): + self.session.open_table('thistablereallyreallydoesnotexist') diff --git a/py/client/tests/test_multi_session.py b/py/client/tests/test_multi_session.py index 4936b78929c..f33b4ac9346 100644 --- a/py/client/tests/test_multi_session.py +++ b/py/client/tests/test_multi_session.py @@ -5,7 +5,6 @@ from pydeephaven import Session -from pydeephaven.session import SYNC_ONCE, SYNC_REPEATED from tests.testbase import BaseTestCase import timeout_decorator @@ -19,12 +18,11 @@ def test_persistent_tables(self): t = session1.empty_table(10) session1.bind_table('t', t) - - with Session(sync_fields=SYNC_ONCE) as session2: + with Session() as session2: self.assertIn('t', session2.tables) def test_shared_tables(self): - session1 = Session(sync_fields=SYNC_REPEATED) + session1 = Session() session1.run_script('t = None') session2 = Session() From d30624190a26e0a8380702759b819914ad070762 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 11 Aug 2022 09:05:12 -0700 Subject: [PATCH 065/215] Bump protoc-base (#2729) --- docker/registry/protoc-base/gradle.properties | 2 +- .../proto/application/application.pb.go | 2 - .../proto/application/application_grpc.pb.go | 18 +++-- go/internal/proto/console/console.pb.go | 5 +- go/internal/proto/console/console_grpc.pb.go | 6 -- .../proto/inputtable/inputtable_grpc.pb.go | 4 -- .../partitionedtable/partitionedtable.pb.go | 1 - .../partitionedtable_grpc.pb.go | 6 -- go/internal/proto/session/session.pb.go | 10 --- go/internal/proto/session/session_grpc.pb.go | 14 ---- go/internal/proto/table/table.pb.go | 7 ++ go/internal/proto/table/table_grpc.pb.go | 72 ++----------------- go/internal/proto/ticket/ticket.pb.go | 2 - 13 files changed, 24 insertions(+), 125 deletions(-) diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index dec14b26955..3053b3b945d 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:023505b4916e684c5ffea47ac420cd8fa4d89095fa6168b11b839cc2c2b380eb +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:0ec55a0c037dcad5055089a10e96c878e1eb3de1e81a99a5ff2c8ee81e6baf11 diff --git a/go/internal/proto/application/application.pb.go b/go/internal/proto/application/application.pb.go index 7695d792617..8a89b137df3 100644 --- a/go/internal/proto/application/application.pb.go +++ b/go/internal/proto/application/application.pb.go @@ -62,7 +62,6 @@ func (*ListFieldsRequest) Descriptor() ([]byte, []int) { return file_deephaven_proto_application_proto_rawDescGZIP(), []int{0} } -// // Represents a batch of fields. type FieldsChangeUpdate struct { state protoimpl.MessageState @@ -127,7 +126,6 @@ func (x *FieldsChangeUpdate) GetRemoved() []*FieldInfo { return nil } -// // A lightweight object describing the exposed field. type FieldInfo struct { state protoimpl.MessageState diff --git a/go/internal/proto/application/application_grpc.pb.go b/go/internal/proto/application/application_grpc.pb.go index ffe92a1f241..9aa019a5772 100644 --- a/go/internal/proto/application/application_grpc.pb.go +++ b/go/internal/proto/application/application_grpc.pb.go @@ -22,13 +22,12 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ApplicationServiceClient interface { - // // Request the list of the fields exposed via the worker. // - // - The first received message contains all fields that are currently available - // on the worker. None of these fields will be RemovedFields. - // - Subsequent messages modify the existing state. Fields are identified by - // their ticket and may be replaced or removed. + // - The first received message contains all fields that are currently available + // on the worker. None of these fields will be RemovedFields. + // - Subsequent messages modify the existing state. Fields are identified by + // their ticket and may be replaced or removed. ListFields(ctx context.Context, in *ListFieldsRequest, opts ...grpc.CallOption) (ApplicationService_ListFieldsClient, error) } @@ -76,13 +75,12 @@ func (x *applicationServiceListFieldsClient) Recv() (*FieldsChangeUpdate, error) // All implementations must embed UnimplementedApplicationServiceServer // for forward compatibility type ApplicationServiceServer interface { - // // Request the list of the fields exposed via the worker. // - // - The first received message contains all fields that are currently available - // on the worker. None of these fields will be RemovedFields. - // - Subsequent messages modify the existing state. Fields are identified by - // their ticket and may be replaced or removed. + // - The first received message contains all fields that are currently available + // on the worker. None of these fields will be RemovedFields. + // - Subsequent messages modify the existing state. Fields are identified by + // their ticket and may be replaced or removed. ListFields(*ListFieldsRequest, ApplicationService_ListFieldsServer) error mustEmbedUnimplementedApplicationServiceServer() } diff --git a/go/internal/proto/console/console.pb.go b/go/internal/proto/console/console.pb.go index 78c38314f1b..bab22bf3e60 100644 --- a/go/internal/proto/console/console.pb.go +++ b/go/internal/proto/console/console.pb.go @@ -781,7 +781,8 @@ type LogSubscriptionRequest struct { unknownFields protoimpl.UnknownFields // presently you get _all_ logs, not just your console - // Ticket console_id = 1; + // + // Ticket console_id = 1; LastSeenLogTimestamp int64 `protobuf:"varint,1,opt,name=last_seen_log_timestamp,json=lastSeenLogTimestamp,proto3" json:"last_seen_log_timestamp,omitempty"` Levels []string `protobuf:"bytes,2,rep,name=levels,proto3" json:"levels,omitempty"` } @@ -1205,6 +1206,7 @@ type AutoCompleteRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Request: + // // *AutoCompleteRequest_OpenDocument // *AutoCompleteRequest_ChangeDocument // *AutoCompleteRequest_GetCompletionItems @@ -1317,6 +1319,7 @@ type AutoCompleteResponse struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Response: + // // *AutoCompleteResponse_CompletionItems Response isAutoCompleteResponse_Response `protobuf_oneof:"response"` } diff --git a/go/internal/proto/console/console_grpc.pb.go b/go/internal/proto/console/console_grpc.pb.go index d757d644fbe..71b395a8f4f 100644 --- a/go/internal/proto/console/console_grpc.pb.go +++ b/go/internal/proto/console/console_grpc.pb.go @@ -29,17 +29,14 @@ type ConsoleServiceClient interface { ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) CancelCommand(ctx context.Context, in *CancelCommandRequest, opts ...grpc.CallOption) (*CancelCommandResponse, error) BindTableToVariable(ctx context.Context, in *BindTableToVariableRequest, opts ...grpc.CallOption) (*BindTableToVariableResponse, error) - // // Starts a stream for autocomplete on the current session. More than one console, // more than one document can be edited at a time using this, and they can separately // be closed as well. A given document should only be edited within one stream at a // time. AutoCompleteStream(ctx context.Context, opts ...grpc.CallOption) (ConsoleService_AutoCompleteStreamClient, error) - // // Half of the browser-based (browser's can't do bidirectional streams without websockets) // implementation for AutoCompleteStream. OpenAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (ConsoleService_OpenAutoCompleteStreamClient, error) - // // Other half of the browser-based implementation for AutoCompleteStream. NextAutoCompleteStream(ctx context.Context, in *AutoCompleteRequest, opts ...grpc.CallOption) (*BrowserNextResponse, error) } @@ -221,17 +218,14 @@ type ConsoleServiceServer interface { ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error) BindTableToVariable(context.Context, *BindTableToVariableRequest) (*BindTableToVariableResponse, error) - // // Starts a stream for autocomplete on the current session. More than one console, // more than one document can be edited at a time using this, and they can separately // be closed as well. A given document should only be edited within one stream at a // time. AutoCompleteStream(ConsoleService_AutoCompleteStreamServer) error - // // Half of the browser-based (browser's can't do bidirectional streams without websockets) // implementation for AutoCompleteStream. OpenAutoCompleteStream(*AutoCompleteRequest, ConsoleService_OpenAutoCompleteStreamServer) error - // // Other half of the browser-based implementation for AutoCompleteStream. NextAutoCompleteStream(context.Context, *AutoCompleteRequest) (*BrowserNextResponse, error) mustEmbedUnimplementedConsoleServiceServer() diff --git a/go/internal/proto/inputtable/inputtable_grpc.pb.go b/go/internal/proto/inputtable/inputtable_grpc.pb.go index a902ce38907..be36f2b4dec 100644 --- a/go/internal/proto/inputtable/inputtable_grpc.pb.go +++ b/go/internal/proto/inputtable/inputtable_grpc.pb.go @@ -22,11 +22,9 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InputTableServiceClient interface { - // // Adds the provided table to the specified input table. The new data to add must only have // columns (name, types, and order) which match the given input table's columns. AddTableToInputTable(ctx context.Context, in *AddTableRequest, opts ...grpc.CallOption) (*AddTableResponse, error) - // // Removes the provided table from the specified input tables. The tables indicating which rows // to remove are expected to only have columns that match the key columns of the input table. DeleteTableFromInputTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*DeleteTableResponse, error) @@ -62,11 +60,9 @@ func (c *inputTableServiceClient) DeleteTableFromInputTable(ctx context.Context, // All implementations must embed UnimplementedInputTableServiceServer // for forward compatibility type InputTableServiceServer interface { - // // Adds the provided table to the specified input table. The new data to add must only have // columns (name, types, and order) which match the given input table's columns. AddTableToInputTable(context.Context, *AddTableRequest) (*AddTableResponse, error) - // // Removes the provided table from the specified input tables. The tables indicating which rows // to remove are expected to only have columns that match the key columns of the input table. DeleteTableFromInputTable(context.Context, *DeleteTableRequest) (*DeleteTableResponse, error) diff --git a/go/internal/proto/partitionedtable/partitionedtable.pb.go b/go/internal/proto/partitionedtable/partitionedtable.pb.go index acd73e47a95..56f0dcb7d5f 100644 --- a/go/internal/proto/partitionedtable/partitionedtable.pb.go +++ b/go/internal/proto/partitionedtable/partitionedtable.pb.go @@ -257,7 +257,6 @@ func (x *GetTableRequest) GetResultId() *ticket.Ticket { return nil } -// // A message that describes a partitioned table, able to be sent as a plugin object to a client. // This object will also come with a ticket to the underlying table that can be used to get the // constituent tables by key. diff --git a/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go b/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go index 1e79d61bc67..ba4b22d3bc1 100644 --- a/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go +++ b/go/internal/proto/partitionedtable/partitionedtable_grpc.pb.go @@ -23,14 +23,11 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type PartitionedTableServiceClient interface { - // // Transforms a table into a partitioned table, consisting of many separate table, each individually // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. PartitionBy(ctx context.Context, in *PartitionByRequest, opts ...grpc.CallOption) (*PartitionByResponse, error) - // // Given a partitioned table, returns a table with the contents of all of the constituent tables. Merge(ctx context.Context, in *MergeRequest, opts ...grpc.CallOption) (*table.ExportedTableCreationResponse, error) - // // Given a partitioned table and a row described by another table's contents, returns a table // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If // more than one is present, FAILED_PRECONDITION will be sent in response. @@ -85,14 +82,11 @@ func (c *partitionedTableServiceClient) GetTable(ctx context.Context, in *GetTab // All implementations must embed UnimplementedPartitionedTableServiceServer // for forward compatibility type PartitionedTableServiceServer interface { - // // Transforms a table into a partitioned table, consisting of many separate table, each individually // addressable. The result will be a FetchObjectResponse populated with a PartitionedTable. PartitionBy(context.Context, *PartitionByRequest) (*PartitionByResponse, error) - // // Given a partitioned table, returns a table with the contents of all of the constituent tables. Merge(context.Context, *MergeRequest) (*table.ExportedTableCreationResponse, error) - // // Given a partitioned table and a row described by another table's contents, returns a table // that matched that row, if any. If none is present, NOT_FOUND will be sent in response. If // more than one is present, FAILED_PRECONDITION will be sent in response. diff --git a/go/internal/proto/session/session.pb.go b/go/internal/proto/session/session.pb.go index 58ae9c1ee25..96f5b4a6425 100644 --- a/go/internal/proto/session/session.pb.go +++ b/go/internal/proto/session/session.pb.go @@ -103,21 +103,18 @@ func (ExportNotification_State) EnumDescriptor() ([]byte, []int) { return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8, 0} } -// // The request that a client provides to a server on handshake. type HandshakeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // // A defined protocol version. // // Deephaven's OSS protocols are as follows: // - protocol = 0: most recent HandshakeResponse payload // - protocol = 1: payload is BasicAuth AuthProtocol int32 `protobuf:"zigzag32,1,opt,name=auth_protocol,json=authProtocol,proto3" json:"auth_protocol,omitempty"` - // // Arbitrary auth/handshake info. Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` } @@ -168,7 +165,6 @@ func (x *HandshakeRequest) GetPayload() []byte { return nil } -// // Servers respond with information needed to make subsequent requests tied to this session. // The session token should be refreshed prior to the deadline, which is represented as milliseconds since the // epoch. Clients are encouraged to use the expiration delay and cookie deadline to determine a good time to refresh. @@ -177,16 +173,12 @@ type HandshakeResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // // The metadata header to identify the session. This value is static and defined via configuration. MetadataHeader []byte `protobuf:"bytes,1,opt,name=metadata_header,json=metadataHeader,proto3" json:"metadata_header,omitempty"` - // // Arbitrary session_token to assign to the value to the provided metadata header. SessionToken []byte `protobuf:"bytes,2,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` - // // When this session_token will be considered invalid by the server. TokenDeadlineTimeMillis int64 `protobuf:"zigzag64,3,opt,name=token_deadline_time_millis,json=tokenDeadlineTimeMillis,proto3" json:"token_deadline_time_millis,omitempty"` - // // The length of time that this token was intended to live. Note that `refreshSessionToken` may return the // existing token to reduce overhead and to prevent denial-of-service caused by refreshing too frequently. TokenExpirationDelayMillis int64 `protobuf:"zigzag64,4,opt,name=token_expiration_delay_millis,json=tokenExpirationDelayMillis,proto3" json:"token_expiration_delay_millis,omitempty"` @@ -513,10 +505,8 @@ type ExportNotification struct { Ticket *ticket.Ticket `protobuf:"bytes,1,opt,name=ticket,proto3" json:"ticket,omitempty"` ExportState ExportNotification_State `protobuf:"varint,2,opt,name=export_state,json=exportState,proto3,enum=io.deephaven.proto.backplane.grpc.ExportNotification_State" json:"export_state,omitempty"` - // // any errors will include an id that can be used to find details of the error in the logs Context string `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"` - // // will be set to an identifier of the dependency that cascaded the error if applicable DependentHandle string `protobuf:"bytes,4,opt,name=dependent_handle,json=dependentHandle,proto3" json:"dependent_handle,omitempty"` } diff --git a/go/internal/proto/session/session_grpc.pb.go b/go/internal/proto/session/session_grpc.pb.go index 09351a70d93..575b5df7574 100644 --- a/go/internal/proto/session/session_grpc.pb.go +++ b/go/internal/proto/session/session_grpc.pb.go @@ -22,36 +22,29 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SessionServiceClient interface { - // // Handshake between client and server to create a new session. The response includes a metadata header name and the // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. NewSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) - // // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated // token that should replace the existing token for subsequent requests. RefreshSessionToken(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) - // // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all // unreleased exports will be automatically released. CloseSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*CloseSessionResponse, error) - // // Attempts to release an export by its ticket. Returns true if an existing export was found. It is the client's // responsibility to release all resources they no longer want the server to hold on to. Proactively cancels work; do // not release a ticket that is needed by dependent work that has not yet finished // (i.e. the dependencies that are staying around should first be in EXPORTED state). Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error) - // // Makes a copy from a source ticket to a client managed result ticket. The source ticket does not need to be // a client managed ticket. ExportFromTicket(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportResponse, error) - // // Establish a stream to manage all session exports, including those lost due to partially complete rpc calls. // // New streams will flush notifications for all un-released exports, prior to seeing any new or updated exports // for all live exports. After the refresh of existing state, subscribers will receive notifications of new and // updated exports. An export id of zero will be sent to indicate all pre-existing exports have been sent. ExportNotifications(ctx context.Context, in *ExportNotificationRequest, opts ...grpc.CallOption) (SessionService_ExportNotificationsClient, error) - // // Receive a best-effort message on-exit indicating why this server is exiting. Reception of this message cannot be // guaranteed. TerminationNotification(ctx context.Context, in *TerminationNotificationRequest, opts ...grpc.CallOption) (*TerminationNotificationResponse, error) @@ -155,36 +148,29 @@ func (c *sessionServiceClient) TerminationNotification(ctx context.Context, in * // All implementations must embed UnimplementedSessionServiceServer // for forward compatibility type SessionServiceServer interface { - // // Handshake between client and server to create a new session. The response includes a metadata header name and the // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. NewSession(context.Context, *HandshakeRequest) (*HandshakeResponse, error) - // // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated // token that should replace the existing token for subsequent requests. RefreshSessionToken(context.Context, *HandshakeRequest) (*HandshakeResponse, error) - // // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all // unreleased exports will be automatically released. CloseSession(context.Context, *HandshakeRequest) (*CloseSessionResponse, error) - // // Attempts to release an export by its ticket. Returns true if an existing export was found. It is the client's // responsibility to release all resources they no longer want the server to hold on to. Proactively cancels work; do // not release a ticket that is needed by dependent work that has not yet finished // (i.e. the dependencies that are staying around should first be in EXPORTED state). Release(context.Context, *ReleaseRequest) (*ReleaseResponse, error) - // // Makes a copy from a source ticket to a client managed result ticket. The source ticket does not need to be // a client managed ticket. ExportFromTicket(context.Context, *ExportRequest) (*ExportResponse, error) - // // Establish a stream to manage all session exports, including those lost due to partially complete rpc calls. // // New streams will flush notifications for all un-released exports, prior to seeing any new or updated exports // for all live exports. After the refresh of existing state, subscribers will receive notifications of new and // updated exports. An export id of zero will be sent to indicate all pre-existing exports have been sent. ExportNotifications(*ExportNotificationRequest, SessionService_ExportNotificationsServer) error - // // Receive a best-effort message on-exit indicating why this server is exiting. Reception of this message cannot be // guaranteed. TerminationNotification(context.Context, *TerminationNotificationRequest) (*TerminationNotificationResponse, error) diff --git a/go/internal/proto/table/table.pb.go b/go/internal/proto/table/table.pb.go index ac72857ca7d..770007947a8 100644 --- a/go/internal/proto/table/table.pb.go +++ b/go/internal/proto/table/table.pb.go @@ -366,6 +366,7 @@ type TableReference struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Ref: + // // *TableReference_Ticket // *TableReference_BatchOffset Ref isTableReference_Ref `protobuf_oneof:"ref"` @@ -2256,6 +2257,7 @@ type Literal struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Value: + // // *Literal_StringValue // *Literal_DoubleValue // *Literal_BoolValue @@ -2379,6 +2381,7 @@ type Value struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Data: + // // *Value_Reference // *Value_Literal Data isValue_Data `protobuf_oneof:"data"` @@ -2459,6 +2462,7 @@ type Condition struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Data: + // // *Condition_And // *Condition_Or // *Condition_Not @@ -3386,6 +3390,7 @@ type CreateInputTableRequest struct { ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` // Types that are assignable to Definition: + // // *CreateInputTableRequest_SourceTableId // *CreateInputTableRequest_Schema Definition isCreateInputTableRequest_Definition `protobuf_oneof:"definition"` @@ -3665,6 +3670,7 @@ type CreateInputTableRequest_InputTableKind struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Kind: + // // *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ // *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ Kind isCreateInputTableRequest_InputTableKind_Kind `protobuf_oneof:"kind"` @@ -3834,6 +3840,7 @@ type BatchTableRequest_Operation struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Op: + // // *BatchTableRequest_Operation_EmptyTable // *BatchTableRequest_Operation_TimeTable // *BatchTableRequest_Operation_DropColumns diff --git a/go/internal/proto/table/table_grpc.pb.go b/go/internal/proto/table/table_grpc.pb.go index d5eb9525eb2..f1fa830c237 100644 --- a/go/internal/proto/table/table_grpc.pb.go +++ b/go/internal/proto/table/table_grpc.pb.go @@ -23,115 +23,83 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TableServiceClient interface { - // // Request an ETCR for this ticket. Ticket must reference a Table. GetExportedTableCreationResponse(ctx context.Context, in *ticket.Ticket, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Fetches a Table from an existing source ticket and exports it to the local session result ticket. FetchTable(ctx context.Context, in *FetchTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. FetchPandasTable(ctx context.Context, in *FetchPandasTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Create a table that has preview columns applied to an existing source table. ApplyPreviewColumns(ctx context.Context, in *ApplyPreviewColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Create an empty table with the given column names and types. EmptyTable(ctx context.Context, in *EmptyTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Create a time table with the given start time and period. TimeTable(ctx context.Context, in *TimeTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Drop columns from the parent table. DropColumns(ctx context.Context, in *DropColumnsRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the update table operation. Update(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the lazyUpdate table operation. LazyUpdate(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the view table operation. View(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the updateView table operation. UpdateView(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Select the given columns from the given table. Select(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns a new table definition with the unique tuples of the specified columns SelectDistinct(ctx context.Context, in *SelectDistinctRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Filter parent table with structured filters. Filter(ctx context.Context, in *FilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Filter parent table with unstructured filters. UnstructuredFilter(ctx context.Context, in *UnstructuredFilterTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Sort parent table via the provide sort descriptors. Sort(ctx context.Context, in *SortTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Extract rows from the head of the parent table. Head(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Extract rows from the tail of the parent table. Tail(ctx context.Context, in *HeadOrTailRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Run the headBy table operation for the given group by columns on the given table. HeadBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Run the tailBy operation for the given group by columns on the given table. TailBy(ctx context.Context, in *HeadOrTailByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Ungroup the given columns (all columns will be ungrouped if columnsToUngroup is empty or unspecified). Ungroup(ctx context.Context, in *UngroupRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Create a merged table from the given input tables. If a key column is provided (not null), a sorted // merged will be performed using that column. MergeTables(ctx context.Context, in *MergeTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of a cross join operation. Also known as the cartesian product. CrossJoinTables(ctx context.Context, in *CrossJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of a natural join operation. NaturalJoinTables(ctx context.Context, in *NaturalJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of an exact join operation. ExactJoinTables(ctx context.Context, in *ExactJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of a left join operation. LeftJoinTables(ctx context.Context, in *LeftJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of an as of join operation. AsOfJoinTables(ctx context.Context, in *AsOfJoinTablesRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns the result of an aggregate table operation. ComboAggregate(ctx context.Context, in *ComboAggregateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Snapshot rightId, triggered by leftId, and export the resulting new Table. // The left table's change events cause a new snapshot to be taken. The result table includes a // "snapshot key" which is a subset (possibly all) of the left table's columns. The // remaining columns in the result table come from right table, the table being snapshotted. Snapshot(ctx context.Context, in *SnapshotTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Returns a new table with a flattened row set. Flatten(ctx context.Context, in *FlattenRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - //* + // * // Downsamples a table assume its contents will be rendered in a run chart, with each subsequent row holding a later // X value (i.e., sorted on that column). Multiple Y columns can be specified, as can a range of values for the X // column to support zooming in. RunChartDownsample(ctx context.Context, in *RunChartDownsampleRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - //* + // * // Creates a new Table based on the provided configuration. This can be used as a regular table from the other methods // in this interface, or can be interacted with via the InputTableService to modify its contents. CreateInputTable(ctx context.Context, in *CreateInputTableRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) - // // Batch a series of requests and send them all at once. This enables the user to create intermediate tables without // requiring them to be exported and managed by the client. The server will automatically release any tables when they // are no longer depended upon. Batch(ctx context.Context, in *BatchTableRequest, opts ...grpc.CallOption) (TableService_BatchClient, error) - // // Establish a stream of table updates for cheap notifications of table size updates. // // New streams will flush updates for all existing table exports. An export id of zero will be sent to indicate all @@ -504,115 +472,83 @@ func (x *tableServiceExportedTableUpdatesClient) Recv() (*ExportedTableUpdateMes // All implementations must embed UnimplementedTableServiceServer // for forward compatibility type TableServiceServer interface { - // // Request an ETCR for this ticket. Ticket must reference a Table. GetExportedTableCreationResponse(context.Context, *ticket.Ticket) (*ExportedTableCreationResponse, error) - // // Fetches a Table from an existing source ticket and exports it to the local session result ticket. FetchTable(context.Context, *FetchTableRequest) (*ExportedTableCreationResponse, error) - // // Fetches a pandas table from an existing source ticket and exports it to the local session result ticket. FetchPandasTable(context.Context, *FetchPandasTableRequest) (*ExportedTableCreationResponse, error) - // // Create a table that has preview columns applied to an existing source table. ApplyPreviewColumns(context.Context, *ApplyPreviewColumnsRequest) (*ExportedTableCreationResponse, error) - // // Create an empty table with the given column names and types. EmptyTable(context.Context, *EmptyTableRequest) (*ExportedTableCreationResponse, error) - // // Create a time table with the given start time and period. TimeTable(context.Context, *TimeTableRequest) (*ExportedTableCreationResponse, error) - // // Drop columns from the parent table. DropColumns(context.Context, *DropColumnsRequest) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the update table operation. Update(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the lazyUpdate table operation. LazyUpdate(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the view table operation. View(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) - // // Add columns to the given table using the given column specifications and the updateView table operation. UpdateView(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) - // // Select the given columns from the given table. Select(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) - // // Returns a new table definition with the unique tuples of the specified columns SelectDistinct(context.Context, *SelectDistinctRequest) (*ExportedTableCreationResponse, error) - // // Filter parent table with structured filters. Filter(context.Context, *FilterTableRequest) (*ExportedTableCreationResponse, error) - // // Filter parent table with unstructured filters. UnstructuredFilter(context.Context, *UnstructuredFilterTableRequest) (*ExportedTableCreationResponse, error) - // // Sort parent table via the provide sort descriptors. Sort(context.Context, *SortTableRequest) (*ExportedTableCreationResponse, error) - // // Extract rows from the head of the parent table. Head(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) - // // Extract rows from the tail of the parent table. Tail(context.Context, *HeadOrTailRequest) (*ExportedTableCreationResponse, error) - // // Run the headBy table operation for the given group by columns on the given table. HeadBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) - // // Run the tailBy operation for the given group by columns on the given table. TailBy(context.Context, *HeadOrTailByRequest) (*ExportedTableCreationResponse, error) - // // Ungroup the given columns (all columns will be ungrouped if columnsToUngroup is empty or unspecified). Ungroup(context.Context, *UngroupRequest) (*ExportedTableCreationResponse, error) - // // Create a merged table from the given input tables. If a key column is provided (not null), a sorted // merged will be performed using that column. MergeTables(context.Context, *MergeTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of a cross join operation. Also known as the cartesian product. CrossJoinTables(context.Context, *CrossJoinTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of a natural join operation. NaturalJoinTables(context.Context, *NaturalJoinTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of an exact join operation. ExactJoinTables(context.Context, *ExactJoinTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of a left join operation. LeftJoinTables(context.Context, *LeftJoinTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of an as of join operation. AsOfJoinTables(context.Context, *AsOfJoinTablesRequest) (*ExportedTableCreationResponse, error) - // // Returns the result of an aggregate table operation. ComboAggregate(context.Context, *ComboAggregateRequest) (*ExportedTableCreationResponse, error) - // // Snapshot rightId, triggered by leftId, and export the resulting new Table. // The left table's change events cause a new snapshot to be taken. The result table includes a // "snapshot key" which is a subset (possibly all) of the left table's columns. The // remaining columns in the result table come from right table, the table being snapshotted. Snapshot(context.Context, *SnapshotTableRequest) (*ExportedTableCreationResponse, error) - // // Returns a new table with a flattened row set. Flatten(context.Context, *FlattenRequest) (*ExportedTableCreationResponse, error) - //* + // * // Downsamples a table assume its contents will be rendered in a run chart, with each subsequent row holding a later // X value (i.e., sorted on that column). Multiple Y columns can be specified, as can a range of values for the X // column to support zooming in. RunChartDownsample(context.Context, *RunChartDownsampleRequest) (*ExportedTableCreationResponse, error) - //* + // * // Creates a new Table based on the provided configuration. This can be used as a regular table from the other methods // in this interface, or can be interacted with via the InputTableService to modify its contents. CreateInputTable(context.Context, *CreateInputTableRequest) (*ExportedTableCreationResponse, error) - // // Batch a series of requests and send them all at once. This enables the user to create intermediate tables without // requiring them to be exported and managed by the client. The server will automatically release any tables when they // are no longer depended upon. Batch(*BatchTableRequest, TableService_BatchServer) error - // // Establish a stream of table updates for cheap notifications of table size updates. // // New streams will flush updates for all existing table exports. An export id of zero will be sent to indicate all diff --git a/go/internal/proto/ticket/ticket.pb.go b/go/internal/proto/ticket/ticket.pb.go index 692f8798833..e6da0c390e1 100644 --- a/go/internal/proto/ticket/ticket.pb.go +++ b/go/internal/proto/ticket/ticket.pb.go @@ -23,7 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// // An opaque identifier that the service can use to retrieve a particular // portion of a stream. type Ticket struct { @@ -79,7 +78,6 @@ type TypedTicket struct { unknownFields protoimpl.UnknownFields Ticket *Ticket `protobuf:"bytes,1,opt,name=ticket,proto3" json:"ticket,omitempty"` - // // The type. An empty string means that it is not known, not that the server chose to not set it. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` } From 955a46e1c672a6a5e25431ad3c4a8b2ec913890a Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Fri, 12 Aug 2022 17:32:30 -0400 Subject: [PATCH 066/215] isNormal was replaced with isFinite (#2728) --- web/WebDevelopersGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/WebDevelopersGuide.md b/web/WebDevelopersGuide.md index 6625ecc648b..cdad4488ff5 100644 --- a/web/WebDevelopersGuide.md +++ b/web/WebDevelopersGuide.md @@ -610,7 +610,7 @@ These instances are immutable - all operations that compose them to build bigger third. * `isInf` - Returns true if the given number is "infinity". * `isNaN` - Returns true if the given number is "not a number". - * `isNormal` - Returns true if the given number is not null, is not infinity, and is not "not a number". + * `isFinite` - Returns true if the given number is not null, is not infinity, and is not "not a number". * `startsWith` - Returns true if the first string starts with the second string. * `endsWith` - Returns true if the first string ends with the second string. * `matches` - Returns true if the first string argument matches the second string used as a Java regular expression. From b0a2cdea88ff5d11311c6da957f4f90dafddfe5e Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 16 Aug 2022 14:46:40 -0700 Subject: [PATCH 067/215] Make jpy related jars java 8 compatible. (#2736) --- .../io/deephaven/engine/util/jpy/JpyInit.java | 2 +- py/jpy-config/gradle.properties | 1 + .../jpy/JpyConfigFromSubprocess.java | 23 +++++++++- py/jpy-ext/build.gradle | 5 --- py/jpy-ext/gradle.properties | 1 + .../java/io/deephaven/jpy/JpyConfigExt.java | 42 ++++++++++++------- 6 files changed, 50 insertions(+), 24 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java index d2e388898a0..533f33d1778 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/jpy/JpyInit.java @@ -48,7 +48,7 @@ public static synchronized void init() throws IOException, InterruptedException, } private static void init(JpyConfigExt jpyConfig) { - log.info().append("Loaded jpy config ").append(jpyConfig).endl(); + log.info().append("Loaded jpy config ").append(jpyConfig.toString()).endl(); log.info().append("Starting Python interpreter").endl(); jpyConfig.initPython(); jpyConfig.startPython(); diff --git a/py/jpy-config/gradle.properties b/py/jpy-config/gradle.properties index c186bbfdde1..9e8588f2620 100644 --- a/py/jpy-config/gradle.properties +++ b/py/jpy-config/gradle.properties @@ -1 +1,2 @@ io.deephaven.project.ProjectType=JAVA_PUBLIC +languageLevel=8 diff --git a/py/jpy-config/src/main/java/io/deephaven/jpy/JpyConfigFromSubprocess.java b/py/jpy-config/src/main/java/io/deephaven/jpy/JpyConfigFromSubprocess.java index 7107a5a41c6..1b753d30180 100644 --- a/py/jpy-config/src/main/java/io/deephaven/jpy/JpyConfigFromSubprocess.java +++ b/py/jpy-config/src/main/java/io/deephaven/jpy/JpyConfigFromSubprocess.java @@ -5,6 +5,7 @@ import io.deephaven.jpy.JpyConfigSource.FromProperties; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -89,7 +90,7 @@ private static Properties properties(String pythonName, Duration timeout) } // We need to also close the stream to let python know it can start processing script try (OutputStream out = process.getOutputStream()) { - in.transferTo(out); + transferTo(in, out); } catch (Throwable t) { process.destroy(); throw t; @@ -105,7 +106,7 @@ private static Properties properties(String pythonName, Duration timeout) } final int exitValue = process.exitValue(); if (exitValue != 0) { - final String error = new String(process.getErrorStream().readAllBytes(), StandardCharsets.UTF_8); + final String error = readAllBytes(process.getErrorStream()); if (error.contains("ModuleNotFoundError: No module named 'jpyutil'")) { throw new IllegalStateException( String.format("A Deephaven python environment has not been configured for '%s'. " + @@ -119,4 +120,22 @@ private static Properties properties(String pythonName, Duration timeout) properties.load(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8)); return properties; } + + private static void transferTo(InputStream in, OutputStream out) throws IOException { + // Requires language level > 8 + // in.transferTo(out); + byte[] buffer = new byte[8192]; + int read; + while ((read = in.read(buffer, 0, buffer.length)) != -1) { + out.write(buffer, 0, read); + } + } + + private static String readAllBytes(InputStream in) throws IOException { + // Requires language level > 8 + // return new String(in.readAllBytes(), StandardCharsets.UTF_8); + ByteArrayOutputStream out = new ByteArrayOutputStream(8192); + transferTo(in, out); + return out.toString("UTF-8"); + } } diff --git a/py/jpy-ext/build.gradle b/py/jpy-ext/build.gradle index e29f359a67a..52552b83c82 100644 --- a/py/jpy-ext/build.gradle +++ b/py/jpy-ext/build.gradle @@ -15,12 +15,7 @@ plugins { id 'java-library' } -configurations { - implementation.extendsFrom fishBase -} - dependencies { api 'org.jpyconsortium:jpy:0.11.0' api project(':deephaven-jpy-config') - api project(':Base') } diff --git a/py/jpy-ext/gradle.properties b/py/jpy-ext/gradle.properties index c186bbfdde1..9e8588f2620 100644 --- a/py/jpy-ext/gradle.properties +++ b/py/jpy-ext/gradle.properties @@ -1 +1,2 @@ io.deephaven.project.ProjectType=JAVA_PUBLIC +languageLevel=8 diff --git a/py/jpy-ext/src/main/java/io/deephaven/jpy/JpyConfigExt.java b/py/jpy-ext/src/main/java/io/deephaven/jpy/JpyConfigExt.java index 916cf59eee6..c860899b019 100644 --- a/py/jpy-ext/src/main/java/io/deephaven/jpy/JpyConfigExt.java +++ b/py/jpy-ext/src/main/java/io/deephaven/jpy/JpyConfigExt.java @@ -3,8 +3,6 @@ */ package io.deephaven.jpy; -import io.deephaven.base.log.LogOutput; -import io.deephaven.base.log.LogOutputAppendable; import io.deephaven.jpy.JpyConfig.Flag; import java.nio.file.Path; import java.time.Duration; @@ -13,7 +11,7 @@ import org.jpy.PyLib; import org.jpy.PyLibInitializer; -public class JpyConfigExt implements LogOutputAppendable { +public class JpyConfigExt { private final JpyConfig config; private boolean initialized; @@ -30,20 +28,20 @@ private static String safeToString(Path path) { /** * Equivalent to {@code logOutput.append(safeToString(path))} */ - private static void format(LogOutput logOutput, Path path) { + private static void format(StringBuilder logOutput, Path path) { logOutput.append(safeToString(path)); } /** * Appends each item from {@code collection} to the {@code logOutput}, separated by a comma */ - private static void format(LogOutput logOutput, Collection collection) { + private static void format(StringBuilder logOutput, Collection collection) { boolean first = true; for (T item : collection) { if (!first) { - logOutput = logOutput.append(','); + logOutput.append(','); } - logOutput = logOutput.append(item.toString()); + logOutput.append(item.toString()); first = false; } } @@ -105,15 +103,27 @@ public void stopPython(Duration cleanupTimeout) { } } + public void append(StringBuilder logOutput) { + logOutput.append("flags="); + format(logOutput, config.getFlags()); + logOutput.append(",programName="); + format(logOutput, config.getProgramName().orElse(null)); + logOutput.append(",pythonHome="); + format(logOutput, config.getPythonHome().orElse(null)); + logOutput.append(",pythonLib="); + format(logOutput, config.getPythonLib().orElse(null)); + logOutput.append(",jpyLib="); + format(logOutput, config.getJpyLib().orElse(null)); + logOutput.append(",jdlLib="); + format(logOutput, config.getJdlLib().orElse(null)); + logOutput.append(",extras="); + format(logOutput, config.getExtraPaths()); + } + @Override - public LogOutput append(LogOutput logOutput) { - return logOutput - .append("flags=").append(JpyConfigExt::format, config.getFlags()) - .append(",programName=").append(JpyConfigExt::format, config.getProgramName().orElse(null)) - .append(",pythonHome=").append(JpyConfigExt::format, config.getPythonHome().orElse(null)) - .append(",pythonLib=").append(JpyConfigExt::format, config.getPythonLib().orElse(null)) - .append(",jpyLib=").append(JpyConfigExt::format, config.getJpyLib().orElse(null)) - .append(",jdlLib=").append(JpyConfigExt::format, config.getJdlLib().orElse(null)) - .append(",extras=").append(JpyConfigExt::format, config.getExtraPaths()); + public final String toString() { + StringBuilder sb = new StringBuilder(); + append(sb); + return sb.toString(); } } From 4380ee69d0ca7532aad6aaaf6b5cfee445afc2c5 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 19 Aug 2022 16:33:03 -0400 Subject: [PATCH 068/215] Update web version 0.15.5 (#2745) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.15.5 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 2bb5c7b4224..421f9fb09ad 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.15.4 +ARG WEB_VERSION=0.15.5 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 7f3fae7f140d842ac5b4e9a441100e8939719db2 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Fri, 19 Aug 2022 18:25:21 -0400 Subject: [PATCH 069/215] Don't submit parallel initialization jobs from the parallel initialization thread pool. Don't allow FORCE_PARALLEL_SELECT_AND_UPDATE to break the query engine. (#2747) --- .../table/impl/OperationInitializationThreadPool.java | 10 +++++++++- .../io/deephaven/engine/table/impl/QueryTable.java | 6 ++++-- .../engine/table/impl/SelectOrUpdateListener.java | 5 +++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/OperationInitializationThreadPool.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/OperationInitializationThreadPool.java index 4dc5984c865..19661d23609 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/OperationInitializationThreadPool.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/OperationInitializationThreadPool.java @@ -12,9 +12,16 @@ import java.util.concurrent.Executors; public class OperationInitializationThreadPool { - public final static int NUM_THREADS = + + public static final int NUM_THREADS = Configuration.getInstance().getIntegerWithDefault("OperationInitializationThreadPool.threads", 1); + private static final ThreadLocal isInitializationThread = ThreadLocal.withInitial(() -> false); + + public static boolean isInitializationThread() { + return isInitializationThread.get(); + } + public final static ExecutorService executorService; static { final ThreadGroup threadGroup = new ThreadGroup("OperationInitializationThreadPool"); @@ -24,6 +31,7 @@ public class OperationInitializationThreadPool { @Override public Thread newThread(@NotNull Runnable r) { return super.newThread(() -> { + isInitializationThread.set(true); MultiChunkPool.enableDedicatedPoolForThisThread(); r.run(); }); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index d30bd7c66c7..f0b724c28c2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -1254,8 +1254,10 @@ private Table selectOrUpdate(Flavor flavor, final SelectColumn... selectColumns) final CompletableFuture waitForResult = new CompletableFuture<>(); final SelectAndViewAnalyzer.JobScheduler jobScheduler; - if (QueryTable.FORCE_PARALLEL_SELECT_AND_UPDATE || (QueryTable.ENABLE_PARALLEL_SELECT_AND_UPDATE - && OperationInitializationThreadPool.NUM_THREADS > 1) + if ((QueryTable.FORCE_PARALLEL_SELECT_AND_UPDATE || + (QueryTable.ENABLE_PARALLEL_SELECT_AND_UPDATE + && OperationInitializationThreadPool.NUM_THREADS > 1)) + && !OperationInitializationThreadPool.isInitializationThread() && analyzer.allowCrossColumnParallelization()) { jobScheduler = new SelectAndViewAnalyzer.OperationInitializationPoolJobScheduler(); } else { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java index e69b3a3f02d..bf192620e75 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java @@ -58,8 +58,9 @@ class SelectOrUpdateListener extends BaseTable.ListenerImpl { transformer = parent.newModifiedColumnSetTransformer(parentNames, mcss); this.analyzer = analyzer; this.enableParallelUpdate = - QueryTable.FORCE_PARALLEL_SELECT_AND_UPDATE || (QueryTable.ENABLE_PARALLEL_SELECT_AND_UPDATE - && UpdateGraphProcessor.DEFAULT.getUpdateThreads() > 1) + (QueryTable.FORCE_PARALLEL_SELECT_AND_UPDATE || + (QueryTable.ENABLE_PARALLEL_SELECT_AND_UPDATE + && UpdateGraphProcessor.DEFAULT.getUpdateThreads() > 1)) && analyzer.allowCrossColumnParallelization(); analyzer.setAllNewColumns(allNewColumns); } From 17c8137547ee9ea851cbd21fff4d0d8e8c1bf6ca Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Fri, 19 Aug 2022 16:28:42 -0600 Subject: [PATCH 070/215] Make Python local and global scopes available for query formulas (#2422) * Combine global and local scopes and use it for query scope --- .../python/PythonDeephavenSession.java | 17 ++- .../engine/util/AbstractScriptSession.java | 4 + .../io/deephaven/engine/util/PythonScope.java | 19 ++- .../engine/util/PythonScopeJpyImpl.java | 42 +++++- py/server/deephaven/table.py | 73 +++++++-- py/server/tests/test_pandas.py | 4 +- py/server/tests/test_partitioned_table.py | 4 +- py/server/tests/test_pt_proxy.py | 36 ++++- py/server/tests/test_table.py | 142 +++++++++++++++++- sphinx/source/conf.py | 21 ++- 10 files changed, 325 insertions(+), 37 deletions(-) diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java index 7071875889e..9862802a8cf 100644 --- a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java +++ b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java @@ -49,7 +49,7 @@ /** * A ScriptSession that uses a JPy cpython interpreter internally. - * + *

    * This is used for applications or the console; Python code running remotely uses WorkerPythonEnvironment for it's * supporting structures. */ @@ -178,6 +178,17 @@ public T getVariable(String name, T defaultValue) { .orElse(defaultValue); } + public void pushScope(PyObject pydict) { + if (!pydict.isDict()) { + throw new IllegalArgumentException("Expect a Python dict but got a" + pydict.repr()); + } + scope.pushScope(pydict); + } + + public void popScope() { + scope.popScope(); + } + @Override protected void evaluate(String command, String scriptName) { log.info().append("Evaluating command: " + command).endl(); @@ -218,7 +229,7 @@ protected PythonSnapshot emptySnapshot() { @Override protected PythonSnapshot takeSnapshot() { - return new PythonSnapshot(scope.globals().copy()); + return new PythonSnapshot(scope.mainGlobals().copy()); } @Override @@ -273,7 +284,7 @@ public boolean hasVariableName(String name) { @Override public synchronized void setVariable(String name, @Nullable Object newValue) { try (PythonSnapshot fromSnapshot = takeSnapshot()) { - final PyDictWrapper globals = scope.globals(); + final PyDictWrapper globals = scope.mainGlobals(); if (newValue == null) { try { globals.delItem(name); diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java index 9910e60e5c3..b9a001f05ce 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java @@ -325,6 +325,10 @@ private ScriptSessionQueryScope(ScriptSession scriptSession) { public void putObjectFields(Object object) { throw new UnsupportedOperationException(); } + + public ScriptSession scriptSession() { + return scriptSession; + } } public static class UnsynchronizedScriptSessionQueryScope extends ScriptSessionQueryScope { diff --git a/engine/table/src/main/java/io/deephaven/engine/util/PythonScope.java b/engine/table/src/main/java/io/deephaven/engine/util/PythonScope.java index e3f6dd981e8..ac1f4010fa2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/PythonScope.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/PythonScope.java @@ -4,6 +4,7 @@ package io.deephaven.engine.util; import org.jpy.PyDictWrapper; +import org.jpy.PyObject; import java.util.AbstractMap.SimpleImmutableEntry; import java.util.Collection; @@ -169,5 +170,21 @@ default Map getEntriesMap() { */ } - public PyDictWrapper globals(); + /** + * @return the Python's __main__ module namespace + */ + public PyDictWrapper mainGlobals(); + + /** + * Push the provided Python scope into the thread scope stack for subsequent operations on Tables + * + * @param pydict a Python dictionary representing the current scope under which the Python code in running, it is + * the combination of module globals and function locals + */ + void pushScope(PyObject pydict); + + /** + * Pop the last Python scope pushed by {@link #pushScope(PyObject pydict)} from the thread scope stack + */ + void popScope(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/util/PythonScopeJpyImpl.java b/engine/table/src/main/java/io/deephaven/engine/util/PythonScopeJpyImpl.java index fe643a533d8..ff2d094077e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/PythonScopeJpyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/PythonScopeJpyImpl.java @@ -14,6 +14,8 @@ public class PythonScopeJpyImpl implements PythonScope { private final PyDictWrapper dict; + + private static final ThreadLocal> threadScopeStack = new ThreadLocal<>(); private static final PyObject NUMBA_VECTORIZED_FUNC_TYPE = getNumbaVectorizedFuncType(); // this assumes that the Python interpreter won't be re-initialized during a session, if this turns out to be a @@ -34,26 +36,35 @@ public PythonScopeJpyImpl(PyDictWrapper dict) { this.dict = dict; } + private PyDictWrapper currentScope() { + Deque scopeStack = threadScopeStack.get(); + if (scopeStack == null || scopeStack.isEmpty()) { + return this.dict; + } else { + return scopeStack.peek(); + } + } + @Override public Optional getValueRaw(String name) { // note: we *may* be returning Optional.of(None) // None is a valid PyObject, and can be in scope - return Optional.ofNullable(dict.get(name)); + return Optional.ofNullable(currentScope().get(name)); } @Override public Stream getKeysRaw() { - return dict.keySet().stream(); + return currentScope().keySet().stream(); } @Override public Stream> getEntriesRaw() { - return dict.entrySet().stream(); + return currentScope().entrySet().stream(); } @Override public boolean containsKey(String name) { - return dict.containsKey(name); + return currentScope().containsKey(name); } @Override @@ -197,7 +208,28 @@ public static Object convert(PyObject pyObject) { } } - public PyDictWrapper globals() { + public PyDictWrapper mainGlobals() { return dict; } + + @Override + public void pushScope(PyObject pydict) { + Deque scopeStack = threadScopeStack.get(); + if (scopeStack == null) { + scopeStack = new ArrayDeque<>(); + threadScopeStack.set(scopeStack); + } + scopeStack.push(pydict.asDict()); + } + + @Override + public void popScope() { + Deque scopeStack = threadScopeStack.get(); + if (scopeStack != null) { + PyDictWrapper pydict = scopeStack.pop(); + pydict.close(); + } else { + throw new IllegalStateException("The thread scope stack is empty."); + } + } } diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index e7f4285bdd2..25f37b8c232 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -7,6 +7,8 @@ from __future__ import annotations +import contextlib +import inspect from enum import Enum, auto from typing import Union, Sequence, List, Any, Optional, Callable @@ -43,6 +45,40 @@ _JReverseAsOfJoinRule = jpy.get_type("io.deephaven.api.ReverseAsOfJoinRule") _JTableOperations = jpy.get_type("io.deephaven.api.TableOperations") +# Dynamic Query Scope +_JQueryScope = jpy.get_type("io.deephaven.engine.table.lang.QueryScope") +_JUnsynchronizedScriptSessionQueryScope = jpy.get_type( + "io.deephaven.engine.util.AbstractScriptSession$UnsynchronizedScriptSessionQueryScope") +_JPythonScriptSession = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession") +_j_script_session = jpy.cast(_JQueryScope.getScope(), _JUnsynchronizedScriptSessionQueryScope).scriptSession() +_j_py_script_session = jpy.cast(_j_script_session, _JPythonScriptSession) + + +@contextlib.contextmanager +def _query_scope_ctx(): + """A context manager to set/unset query scope based on the scope of the most immediate caller code that invokes + Table operations.""" + + # locate the innermost Deephaven frame (i.e. any of the table operation methods that use this context manager) + outer_frames = inspect.getouterframes(inspect.currentframe())[1:] + for i, (frame, filename, *_) in enumerate(outer_frames): + if filename and filename == __file__: + break + + # combine the immediate caller's globals and locals into a single dict and use it as the query scope + if len(outer_frames) > i + 2: + caller_frame, *_ = outer_frames[i + 1] + scope_dict = caller_frame.f_globals.copy() + scope_dict.update(caller_frame.f_locals) + try: + _j_py_script_session.pushScope(scope_dict) + yield + finally: + _j_py_script_session.popScope() + else: + # in the __main__ module, use the default main global scope + yield + class SortDirection(Enum): """An enum defining the sorting orders.""" @@ -330,7 +366,7 @@ def update(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return Table(j_table=self.j_table.update(*formulas)) except Exception as e: raise DHError(e, "table update operation failed.") from e @@ -349,7 +385,7 @@ def lazy_update(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return Table(j_table=self.j_table.lazyUpdate(*formulas)) except Exception as e: raise DHError(e, "table lazy_update operation failed.") from e @@ -368,7 +404,8 @@ def view(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - return Table(j_table=self.j_table.view(*formulas)) + with _query_scope_ctx(): + return Table(j_table=self.j_table.view(*formulas)) except Exception as e: raise DHError(e, "table view operation failed.") from e @@ -386,7 +423,8 @@ def update_view(self, formulas: Union[str, Sequence[str]]) -> Table: """ try: formulas = to_sequence(formulas) - return Table(j_table=self.j_table.updateView(*formulas)) + with _query_scope_ctx(): + return Table(j_table=self.j_table.updateView(*formulas)) except Exception as e: raise DHError(e, "table update_view operation failed.") from e @@ -404,7 +442,7 @@ def select(self, formulas: Union[str, Sequence[str]] = None) -> Table: DHError """ try: - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): if not formulas: return Table(j_table=self.j_table.select()) formulas = to_sequence(formulas) @@ -428,7 +466,8 @@ def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> Table: """ try: formulas = to_sequence(formulas) - return Table(j_table=self.j_table.selectDistinct(*formulas)) + with _query_scope_ctx(): + return Table(j_table=self.j_table.selectDistinct(*formulas)) except Exception as e: raise DHError(e, "table select_distinct operation failed.") from e @@ -455,7 +494,8 @@ def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = N """ try: filters = to_sequence(filters) - return Table(j_table=self.j_table.where(*filters)) + with _query_scope_ctx(): + return Table(j_table=self.j_table.where(*filters)) except Exception as e: raise DHError(e, "table where operation failed.") from e @@ -516,9 +556,10 @@ def where_one_of(self, filters: Union[str, Sequence[str]] = None) -> Table: """ try: filters = to_sequence(filters) - return Table( - j_table=self.j_table.where(_JFilterOr.of(_JFilter.from_(*filters))) - ) + with _query_scope_ctx(): + return Table( + j_table=self.j_table.where(_JFilterOr.of(_JFilter.from_(*filters))) + ) except Exception as e: raise DHError(e, "table where_one_of operation failed.") from e @@ -1974,7 +2015,7 @@ def where(self, filters: Union[str, Filter, Sequence[str], Sequence[Filter]] = N """ try: filters = to_sequence(filters) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.where(*filters)) except Exception as e: raise DHError(e, "where operation on the PartitionedTableProxy failed.") from e @@ -2039,7 +2080,7 @@ def view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.view(*formulas)) except Exception as e: raise DHError(e, "view operation on the PartitionedTableProxy failed.") from e @@ -2060,7 +2101,7 @@ def update_view(self, formulas: Union[str, Sequence[str]]) -> PartitionedTablePr """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.updateView(*formulas)) except Exception as e: raise DHError(e, "update_view operation on the PartitionedTableProxy failed.") from e @@ -2081,7 +2122,7 @@ def update(self, formulas: Union[str, Sequence[str]]) -> PartitionedTableProxy: """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.update(*formulas)) except Exception as e: raise DHError(e, "update operation on the PartitionedTableProxy failed.") from e @@ -2102,7 +2143,7 @@ def select(self, formulas: Union[str, Sequence[str]] = None) -> PartitionedTable """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.select(*formulas)) except Exception as e: raise DHError(e, "select operation on the PartitionedTableProxy failed.") from e @@ -2123,7 +2164,7 @@ def select_distinct(self, formulas: Union[str, Sequence[str]] = None) -> Partiti """ try: formulas = to_sequence(formulas) - with auto_locking_ctx(self): + with _query_scope_ctx(), auto_locking_ctx(self): return PartitionedTableProxy(j_pt_proxy=self.j_pt_proxy.selectDistinct(*formulas)) except Exception as e: raise DHError(e, "select_distinct operation on the PartitionedTableProxy failed.") from e diff --git a/py/server/tests/test_pandas.py b/py/server/tests/test_pandas.py index ec9456e9b93..009623fad1a 100644 --- a/py/server/tests/test_pandas.py +++ b/py/server/tests/test_pandas.py @@ -11,7 +11,7 @@ from deephaven import dtypes, new_table, DHError from deephaven.column import byte_col, char_col, short_col, bool_col, int_col, long_col, float_col, double_col, \ string_col, datetime_col, pyobj_col, jobj_col -from deephaven.constants import NULL_LONG, NULL_BYTE, NULL_SHORT, NULL_INT +from deephaven.constants import NULL_LONG, NULL_SHORT, NULL_INT, NULL_BYTE from deephaven.jcompat import j_array_list from deephaven.pandas import to_pandas, to_table from deephaven.time import to_datetime @@ -116,7 +116,7 @@ def test_to_table_boolean_with_none(self): input_cols = [bool_col(name="Boolean", data=[True, None])] table_with_null_bool = new_table(cols=input_cols) prepared_table = table_with_null_bool.update( - formulas=["Boolean = isNull(Boolean) ? NULL_BYTE : (Boolean == true ? 1: 0)"]) + formulas=["Boolean = isNull(Boolean) ? (byte)NULL_BYTE : (Boolean == true ? 1: 0)"]) df = to_pandas(prepared_table) table_from_df = to_table(df) self.assert_table_equals(table_from_df, prepared_table) diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index 286a5df736d..8a8a58bf0d4 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -34,7 +34,7 @@ def apply(self, t: Table, ot: Table) -> Table: class PartitionedTableTestCase(BaseTestCase): def setUp(self): - self.test_table = read_csv("tests/data/test_table.csv") + self.test_table = read_csv("tests/data/test_table.csv").tail(num_rows=100) self.partitioned_table = self.test_table.partition_by(by=["c", "e"]) def tearDown(self): @@ -92,7 +92,7 @@ def test_sort(self): self.assertIn("Unsupported sort on constituent column", str(cm.exception)) def test_get_constituent(self): - keys = [917, 167] + keys = [967, 203] self.assertIsNotNone(self.partitioned_table.get_constituent(keys)) from deephaven.column import string_col, int_col, double_col diff --git a/py/server/tests/test_pt_proxy.py b/py/server/tests/test_pt_proxy.py index 6629a714440..0be79dcfe22 100644 --- a/py/server/tests/test_pt_proxy.py +++ b/py/server/tests/test_pt_proxy.py @@ -13,7 +13,7 @@ class PartitionedTableProxyTestCase(BaseTestCase): def setUp(self): - self.test_table = read_csv("tests/data/test_table.csv") + self.test_table = read_csv("tests/data/test_table.csv").tail(num_rows=100) self.partitioned_table = self.test_table.partition_by(by=["c"]) self.pt_proxy = self.partitioned_table.proxy() @@ -318,6 +318,40 @@ def test_agg_all_by(self): for gct in agg_pt_proxy.target.constituent_tables: self.assertGreaterEqual(gct.size, 1) + def test_query_scope(self): + + nonlocal_str = "nonlocal str" + closure_str = "closure str" + + def inner_func(arg: str): + def local_fn() -> str: + return "local str" + + # Note, need to bring a nonlocal_str into the local scope before it can be used in formulas + nonlocal nonlocal_str + a_number = 20002 + + local_int = 101 + formulas = ["Col1 = local_fn()", + "Col2 = global_fn()", + "Col3 = nonlocal_str", + "Col4 = arg", + "Col5 = local_int", + "Col6 = global_int", + "Col7 = a_number", + ] + + return self.pt_proxy.update(formulas) + + self.assertIsNotNone(inner_func("param str")) + + +def global_fn() -> str: + return "global str" + + +global_int = 1001 +a_number = 10001 if __name__ == '__main__': unittest.main() diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 12a67e65294..34e1aabe8a7 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -3,10 +3,13 @@ # import unittest +from types import SimpleNamespace +from typing import List, Any -from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule +from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule, time_table from deephaven.agg import sum_, weighted_avg, avg, pct, group, count_, first, last, max_, median, min_, std, abs_sum, \ var, formula, partition +from deephaven.pandas import to_pandas from deephaven.table import Table from tests.testbase import BaseTestCase @@ -560,6 +563,143 @@ def test_layout_hints(self): self.assertTrue(cm.exception.root_cause) self.assertIn("RuntimeError", cm.exception.compact_traceback) + def verify_table_data(self, t: Table, expected: List[Any], assert_not_in: bool = False): + t_data = to_pandas(t).values.flatten() + for s in expected: + if assert_not_in: + self.assertNotIn(s, t_data) + else: + self.assertIn(s, t_data) + + def test_update_LEG_closure(self): + nonlocal_str = "nonlocal str" + closure_str = "closure str" + + def inner_func(arg: str): + def local_fn() -> str: + return "local str" + + # Note, need to bring a nonlocal_str into the local scope before it can be used in formulas + nonlocal nonlocal_str + a_number = 20002 + + local_int = 101 + with self.subTest("LEG"): + t = empty_table(1) + formulas = ["Col1 = local_fn()", + "Col2 = global_fn()", + "Col3 = nonlocal_str", + "Col4 = arg", + "Col5 = local_int", + "Col6 = global_int", + "Col7 = a_number", + ] + + rt = t.update(formulas) + column_data = ["local str", "global str", "nonlocal str", arg, 101, 1001, 20002] + self.verify_table_data(rt, column_data) + + with self.subTest("Closure"): + def closure_fn() -> str: + return closure_str + + formulas = ["Col1 = closure_fn()"] + rt = t.update(formulas) + self.verify_table_data(rt, ["closure str"]) + nonlocal closure_str + closure_str = "closure str2" + rt = t.update(formulas) + self.verify_table_data(rt, ["closure str2"]) + + with self.subTest("Changing scope"): + x = 1 + rt = empty_table(1).update("X = x") + self.verify_table_data(rt, [1]) + x = 2 + rt = rt.update(formulas="Y = x") + self.verify_table_data(rt, [1, 2]) + + inner_func("param str") + + def test_nested_scopes(self): + def inner_func(p) -> str: + t = empty_table(1).update("X = p * 10") + return t.to_string().split()[2] + + t = empty_table(1).update("X = i").update("TableString = inner_func(X + 10)") + self.assertIn("100", t.to_string()) + + def test_scope_comprehensions(self): + with self.subTest("List comprehension"): + t = empty_table(1) + a_list = range(3) + rt_list = [t.update(formulas=["X=a", "Y=a*10"]) for a in a_list] + for i, rt in enumerate(rt_list): + self.verify_table_data(rt, [i, i * 10]) + + with self.subTest("Set comprehension"): + rt_set = {(a, t.update(formulas=["X=a", "Y=a*10"])) for a in a_list} + for i, rt in rt_set: + self.verify_table_data(rt, [i, i * 10]) + + with self.subTest("Dict comprehension"): + a_dict = {"k1": 101, "k2": 202} + rt_dict = {k: t.update(formulas=["X=v", "Y=v*10"]) for k, v in a_dict.items()} + for k, rt in rt_dict.items(): + v = a_dict[k] + self.verify_table_data(rt, [v, v * 10]) + + def test_scope_lambda(self): + t = empty_table(1) + lambda_fn = lambda x: t.update(formulas=["X = x", "Y = x * 10"]) + rt = lambda_fn(10) + self.verify_table_data(rt, [10, 10 * 10]) + + @classmethod + def update_in_class_method(cls, arg1, arg2) -> Table: + return empty_table(1).update(formulas=["X = arg1", "Y = arg2"]) + + @staticmethod + def update_in_static_method(arg1, arg2) -> Table: + return empty_table(1).update(formulas=["X = arg1", "Y = arg2"]) + + def test_decorated_methods(self): + rt = self.update_in_class_method("101", "202") + self.verify_table_data(rt, ["101", "202"]) + + rt = self.update_in_static_method(101, 202) + self.verify_table_data(rt, [101, 202]) + + def test_ticking_table_scope(self): + from deephaven import ugp + x = 1 + with ugp.shared_lock(): + rt = time_table("00:00:01").update("X = x") + self.wait_ticking_table_update(rt, row_count=1, timeout=5) + self.verify_table_data(rt, [1]) + for i in range(2, 5): + x = i + self.wait_ticking_table_update(rt, row_count=i, timeout=5) + self.verify_table_data(rt, list(range(2, 5)), assert_not_in=True) + + x = SimpleNamespace() + x.v = 1 + with ugp.shared_lock(): + rt = time_table("00:00:01").update("X = x.v").drop_columns("Timestamp") + self.wait_ticking_table_update(rt, row_count=1, timeout=5) + + for i in range(2, 5): + x.v = i + self.wait_ticking_table_update(rt, row_count=i, timeout=5) + self.verify_table_data(rt, list(range(1, 5))) + + +def global_fn() -> str: + return "global str" + + +global_int = 1001 +a_number = 10001 if __name__ == "__main__": unittest.main() diff --git a/sphinx/source/conf.py b/sphinx/source/conf.py index 6e7dad44c1b..58f908e123a 100644 --- a/sphinx/source/conf.py +++ b/sphinx/source/conf.py @@ -78,21 +78,30 @@ from glob import glob import os -from deephaven_internal import jvm +workspace = os.environ.get('DEEPHAVEN_WORKSPACE', '.') +devroot = os.environ.get('DEEPHAVEN_DEVROOT', '.') +propfile = os.environ.get('DEEPHAVEN_PROPFILE', 'dh-defaults.prop') +jvm_properties = { + 'Configuration.rootFile': propfile, + 'devroot': os.path.realpath(devroot), + 'workspace': os.path.realpath(workspace), + } +from deephaven_internal import jvm jvm.init_jvm( jvm_classpath=glob(os.environ.get('DEEPHAVEN_CLASSPATH')), - jvm_properties={ - 'Configuration.rootFile': os.environ.get('DEEPHAVEN_PROPFILE') - } + jvm_properties=jvm_properties, ) -import deephaven import jpy +py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals() +py_dh_session = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession")(py_scope_jpy) +jpy.get_type("io.deephaven.engine.table.lang.QueryScope").setScope(py_dh_session.newQueryScope()) + +import deephaven docs_title = "Deephaven python modules." package_roots = [jpy, deephaven] package_excludes = ['._'] import dh_sphinx dh_sphinx.gen_sphinx_modules(docs_title, package_roots, package_excludes) - From 8a5b4947fc29da0edfcdf4ab25afe8e3fd0e3dfe Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Mon, 22 Aug 2022 13:33:43 -0600 Subject: [PATCH 071/215] ExecutionContext: record state of globals before deferring work (#2539) The QueryScope, QueryLibrary, CompilerTools were merged into a new package `io.deephaven.engine.context` and are bundled as a distinct artifact `engine-context`. By default the ThreadLocal is "poisoned" to prevent accidental use of this state in unexpected contexts. The session's execution context will be installed from all entry points to the gRPC API as well as scripts run in a deephaven script session. To use elsewhere it is encouraged to capture the least state needed and pass the new ExecutionContext to use on another thread or during a deferred task. WhereFilters and SelectColumns will be initialized immediately and copies will retain details instead of needing to reevaluate in deferred contexts. This commit introduces `TableOperationsDefaults` which lifts many default `TableOperations` implementations from `TableDefaults`. This helps reinforce consistency in other implementations of TableOperations. The QueryLanguageParser can now deduce the return type of a generic method if it is fixed due to inheritance rules (both via interfaces and parent classes). --- .../java/io/deephaven/base/StringUtils.java | 6 - .../benchmarking/BenchmarkTools.java | 4 +- .../generator/ColumnGenerator.java | 4 +- .../impl/AbstractBenchmarkTable.java | 2 +- .../treetable/TreeSnapshotQuery.java | 2 +- .../treetable/SnapshotStateTest.java | 9 - .../treetable/TreeSnapshotQueryTest.java | 30 - CompilerTools/CompilerTools.gradle | 20 - .../python/PythonDeephavenSession.java | 26 +- .../io/deephaven/modelfarm/TestModelFarm.java | 20 + .../modelfarm/util/TestModelFarmUtils.java | 20 + ...SwappableTableBasedCategoryDataSeries.java | 6 +- .../AbstractTableBasedCategoryDataSeries.java | 6 +- ...ractPartitionedTableHandleMultiSeries.java | 6 +- .../AbstractSwappableMultiSeries.java | 6 +- .../xy/XYDataSeriesSwappableTableArray.java | 10 +- .../datasets/xy/XYDataSeriesTableArray.java | 9 +- .../io/deephaven/plot/util/PlotUtils.java | 2 +- .../io/deephaven/plot/TestSeriesLocation.java | 20 +- .../plot/composite/TestScatterPlotMatrix.java | 14 +- ...ryDataSeriesSwappablePartitionedTable.java | 14 +- .../datasets/ohlc/TestOHLCDataSeries.java | 28 +- .../datasets/xy/TestAbstractXYDataSeries.java | 34 +- .../datasets/xy/TestXYDataSeriesArray.java | 28 +- .../plot/example_plots/OHLCPlotBy.java | 2 +- ...NoExecutionContextRegisteredException.java | 13 + engine/api/build.gradle | 3 +- .../engine/table/PartitionedTable.java | 67 +- .../java/io/deephaven/engine/table/Table.java | 1026 ++--------------- .../engine/table/lang/QueryLibrary.java | 155 --- .../engine/table/lang/QueryLibraryTest.java | 49 - engine/context/build.gradle | 31 + .../context}/gradle.properties | 0 .../engine/context}/CompilerTools.java | 281 ++--- .../engine/context/EmptyQueryScope.java | 48 + .../engine/context/ExecutionContext.java | 303 +++++ .../context/PoisonedCompilerToolsContext.java | 54 + .../engine/context/PoisonedQueryLibrary.java | 59 + .../engine/context/PoisonedQueryScope.java | 57 + .../engine/context/QueryLibrary.java | 111 ++ .../engine/context}/QueryLibraryImports.java | 2 +- .../context}/QueryLibraryImportsImpl.java | 2 +- .../QueryLibraryImportsServiceLoader.java | 2 +- .../deephaven/engine/context}/QueryScope.java | 102 +- .../engine/context}/QueryScopeParam.java | 2 +- .../engine/context/QueryLibraryTest.java | 58 + .../engine/context}/TestCompilerTools.java | 20 +- engine/table/build.gradle | 2 +- .../engine/table/impl/BaseTable.java | 2 +- .../engine/table/impl/DeferredViewTable.java | 31 +- .../impl/InstrumentedTableListenerBase.java | 13 + .../engine/table/impl/MergedListener.java | 8 + .../table/impl/PartitionAwareSourceTable.java | 4 +- .../engine/table/impl/QueryTable.java | 2 +- .../engine/table/impl/SwapListenerBase.java | 11 +- ...leWithDefaults.java => TableDefaults.java} | 712 ++---------- .../engine/table/impl/UncoalescedTable.java | 4 +- .../deephaven/engine/table/impl/UpdateBy.java | 8 +- .../table/impl/UpdateByOperatorFactory.java | 18 +- .../impl/by/typed/TypedHasherFactory.java | 2 +- .../table/impl/lang/QueryLanguageParser.java | 67 +- .../BiTableTransformationColumn.java | 22 +- .../partitioned/PartitionedTableImpl.java | 20 +- .../PartitionedTableProxyImpl.java | 572 +-------- .../TableTransformationColumn.java | 21 +- .../impl/select/AbstractConditionFilter.java | 25 +- .../impl/select/AbstractFormulaColumn.java | 77 +- .../table/impl/select/AjMatchPairFactory.java | 110 -- .../AutoTuningIncrementalReleaseFilter.java | 18 +- .../select/BaseIncrementalReleaseFilter.java | 7 +- .../table/impl/select/ByteRangeFilter.java | 5 +- .../table/impl/select/CharRangeFilter.java | 5 +- .../impl/select/ComparableRangeFilter.java | 6 +- .../table/impl/select/ConditionFilter.java | 44 +- .../table/impl/select/ConjunctiveFilter.java | 3 +- .../impl/select/DateTimeRangeFilter.java | 6 +- .../table/impl/select/DhFormulaColumn.java | 121 +- .../table/impl/select/DisjunctiveFilter.java | 3 +- .../table/impl/select/DoubleRangeFilter.java | 5 +- .../table/impl/select/FloatRangeFilter.java | 5 +- .../table/impl/select/FormulaColumn.java | 3 - .../impl/select/IncrementalReleaseFilter.java | 5 - .../table/impl/select/IntRangeFilter.java | 5 +- .../table/impl/select/LongRangeFilter.java | 5 +- .../engine/table/impl/select/MatchFilter.java | 90 +- .../table/impl/select/MatchPairFactory.java | 6 +- .../table/impl/select/PatternFilter.java | 22 +- .../impl/select/QueryScopeParamTypeUtil.java | 2 +- .../engine/table/impl/select/RegexFilter.java | 4 +- .../impl/select/RollingReleaseFilter.java | 12 +- .../table/impl/select/SelectColumn.java | 7 + .../impl/select/SelectColumnFactory.java | 6 +- .../table/impl/select/ShortRangeFilter.java | 5 +- .../SingleSidedComparableRangeFilter.java | 6 +- .../impl/select/StringContainsFilter.java | 5 +- .../table/impl/select/SwitchColumn.java | 6 +- .../table/impl/select/TimeSeriesFilter.java | 13 +- .../engine/table/impl/select/WhereFilter.java | 10 +- .../table/impl/select/WhereFilterFactory.java | 8 +- .../impl/select/WouldMatchPairFactory.java | 6 +- .../analyzers/SelectAndViewAnalyzer.java | 32 +- .../select/analyzers/SelectColumnLayer.java | 16 +- .../impl/select/codegen/FormulaAnalyzer.java | 52 +- .../select/codegen/JavaKernelBuilder.java | 8 +- .../impl/select/formula/FormulaFactory.java | 7 +- .../select/formula/FormulaKernelFactory.java | 2 +- .../select/python/FormulaColumnPython.java | 44 +- .../sort/partition/BytePartitionKernel.java | 31 +- .../sort/partition/CharPartitionKernel.java | 31 +- .../sort/partition/DoublePartitionKernel.java | 31 +- .../sort/partition/FloatPartitionKernel.java | 31 +- .../sort/partition/IntPartitionKernel.java | 31 +- .../sort/partition/LongPartitionKernel.java | 31 +- .../sort/partition/ObjectPartitionKernel.java | 31 +- .../sort/partition/ShortPartitionKernel.java | 31 +- .../impl/sources/UnionSourceManager.java | 5 +- .../impl/updateby/ema/ByteEMAOperator.java | 2 +- .../impl/updateby/ema/IntEMAOperator.java | 2 +- .../impl/updateby/ema/LongEMAOperator.java | 2 +- .../table/impl/util/CumulativeUtil.java | 16 +- .../QueryLibraryImportsConfiguration.java | 2 +- .../impl/QueryLibraryImportsDefaults.java | 4 +- .../engine/util/AbstractScriptSession.java | 77 +- .../engine/util/DelegatingScriptSession.java | 8 +- .../engine/util/DynamicCompileUtils.java | 2 +- .../engine/util/GroovyDeephavenSession.java | 21 +- .../util/NoLanguageDeephavenSession.java | 4 +- .../deephaven/engine/util/ScriptSession.java | 9 +- .../io/deephaven/engine/util/TableTools.java | 2 +- .../engine/util/TableToolsMergeHelper.java | 2 - .../engine/liveness/TestLiveness.java | 5 + .../engine/table/impl/FuzzerTest.java | 8 +- .../table/impl/MultiColumnSortTest.java | 14 +- .../table/impl/PartitionedTableTest.java | 88 +- .../table/impl/QueryTableAggregationTest.java | 2 +- .../engine/table/impl/QueryTableAjTest.java | 27 +- .../table/impl/QueryTableHugeSortTest.java | 2 +- .../engine/table/impl/QueryTableJoinTest.java | 2 +- .../impl/QueryTableSelectUpdateBigTest.java | 27 - .../impl/QueryTableSelectUpdateTest.java | 6 +- .../engine/table/impl/QueryTableSortTest.java | 2 +- ...QueryTableStaticNaturalJoinRandomTest.java | 6 +- .../engine/table/impl/QueryTableTest.java | 3 +- .../table/impl/QueryTableWhereTest.java | 2 +- .../table/impl/RefreshingTableTestCase.java | 22 +- .../impl/StreamTableAggregationTest.java | 14 +- .../table/impl/StreamTableOperationsTest.java | 16 +- .../engine/table/impl/TestAggBy.java | 4 +- .../table/impl/TestAggregatedSelect.java | 5 + .../table/impl/TestBigDecimalColumns.java | 4 + .../table/impl/TestBigIntegerColumns.java | 4 + .../impl/TestConcurrentInstantiation.java | 214 ++-- .../impl/TestDownsampledWhereFilter.java | 16 + .../engine/table/impl/TestMoveColumns.java | 23 +- .../table/impl/TestPartitioningColumns.java | 5 + .../impl/TestSelectPreserveGrouping.java | 2 +- .../engine/table/impl/TestSharedContext.java | 5 + .../deephaven/engine/table/impl/TestSort.java | 7 +- .../impl/TestSortIncrementalPerformance.java | 2 +- .../engine/table/impl/TestSourceSink.java | 53 +- .../deephaven/engine/table/impl/TstUtils.java | 6 + .../impl/lang/TestQueryLanguageParser.java | 56 + .../locations/impl/TestGroupingProviders.java | 12 +- .../impl/select/FilterKernelArraySample.java | 2 +- .../table/impl/select/FilterKernelSample.java | 2 +- .../impl/select/FormulaKernelSample.java | 4 +- .../table/impl/select/FormulaSample.java | 4 +- .../table/impl/select/FormulaTestUtil.java | 12 +- .../impl/select/MatchPairFactoryTest.java | 3 +- .../select/TestConditionFilterGeneration.java | 28 +- .../table/impl/select/TestFormulaColumn.java | 10 +- .../select/TestFormulaColumnGeneration.java | 16 +- .../impl/select/TestWhereFilterFactory.java | 11 + .../impl/select/WhereFilterFactoryTest.java | 5 +- .../timsort/BaseTestByteTimSortKernel.java | 29 + .../timsort/BaseTestCharTimSortKernel.java | 29 + .../timsort/BaseTestDoubleTimSortKernel.java | 29 + .../timsort/BaseTestFloatTimSortKernel.java | 29 + .../timsort/BaseTestIntTimSortKernel.java | 29 + .../timsort/BaseTestLongTimSortKernel.java | 29 + .../timsort/BaseTestObjectTimSortKernel.java | 29 + .../timsort/BaseTestShortTimSortKernel.java | 29 + .../impl/sort/timsort/TestTimSortKernel.java | 65 +- .../impl/sources/TestBooleanArraySource.java | 245 ++-- .../impl/sources/TestByteArraySource.java | 257 ++--- .../sources/TestCharacterArraySource.java | 257 ++--- .../impl/sources/TestDoubleArraySource.java | 257 ++--- .../impl/sources/TestFloatArraySource.java | 257 ++--- .../impl/sources/TestIntegerArraySource.java | 257 ++--- .../impl/sources/TestLongArraySource.java | 257 ++--- .../impl/sources/TestObjectArraySource.java | 257 ++--- .../impl/sources/TestShortArraySource.java | 257 ++--- .../TestChunkedRegionedOperations.java | 36 +- .../regioned/TestObjectVectorUngroup.java | 5 + .../table/impl/updateby/TestCumProd.java | 4 +- .../table/impl/updateby/TestCumSum.java | 4 +- .../engine/table/impl/updateby/TestEma.java | 48 +- .../table/impl/updateby/TestForwardFill.java | 2 +- .../impl/updateby/TestUpdateByGeneral.java | 7 +- .../table/impl/util/CumulativeUtilTest.java | 15 + .../impl/util/TestColumnsToRowsTransform.java | 2 +- .../engine/table/impl/util/TestFreezeBy.java | 2 +- .../impl/util/TestRedirectedColumnSource.java | 2 +- .../util/TestCalendarMethodsFromTable.java | 12 +- .../deephaven/engine/util/TestColorUtil.java | 18 +- .../util/TestCompileSimpleFunction.java | 16 + .../deephaven/engine/util/TestTableTools.java | 7 +- .../scripts/TestGroovyDeephavenSession.java | 2 +- .../deephaven/test/junit4/EngineCleanup.java | 6 + engine/updategraph/build.gradle | 1 + .../updategraph/EmptyErrorNotification.java | 2 - .../engine/updategraph/EmptyNotification.java | 6 + .../updategraph/NotificationAdapter.java | 6 + .../engine/updategraph/NotificationQueue.java | 20 +- .../updategraph/TerminalNotification.java | 7 + .../updategraph/UpdateGraphProcessor.java | 12 +- .../engine/updategraph/WaitNotification.java | 6 + .../extensions/ClassGraphExtension.java | 2 +- .../BrotliParquetTableReadWriteTest.java | 9 +- .../table/ParquetTableReadWriteTest.java | 23 +- .../parquet/table/TestParquetGrouping.java | 16 +- .../parquet/table/TestParquetTools.java | 43 +- .../numerics/suanshu/SuanShuIntegration.java | 2 +- .../client/DeephavenFlightSessionTest.java | 9 +- .../DeephavenFlightSessionTestBase.java | 5 + .../lang/completion/ChunkerCompleter.java | 2 +- .../lang/completion/CompletionLookups.java | 11 +- .../ChunkerCompletionHandlerTest.groovy | 17 +- ...lumnExpressionCompletionHandlerTest.groovy | 18 +- .../python/server/EmbeddedServer.java | 13 +- py/server/deephaven/learn/__init__.py | 4 +- py/server/deephaven/query_library.py | 10 +- py/server/deephaven/table.py | 17 +- py/server/test_helper/__init__.py | 2 +- py/server/tests/test_ugp.py | 11 + python-engine-test/build.gradle | 2 +- .../impl/select/PythonMatchFilterTest.java | 3 +- .../impl/select/TestConditionFilter.java | 19 +- .../engine/util/WorkerPythonEnvironment.java | 2 +- .../io/deephaven/qst/table/TableBase.java | 28 +- .../qst/examples/EmployeesExample.java | 1 + .../server/jetty/JettyServerComponent.java | 4 + .../server/netty/NettyServerComponent.java | 6 +- .../console/ConsoleServiceGrpcImpl.java | 5 +- .../groovy/GroovyConsoleSessionModule.java | 2 +- .../python/PythonConsoleSessionModule.java | 2 +- ...avenApiServerInProcessGroovyComponent.java | 44 + ...venApiServerInProcessPythonComponent.java} | 6 +- .../runner/DeephavenApiServerModule.java | 13 +- .../server/session/SessionState.java | 13 +- .../server/table/ops/JoinTablesGrpcImpl.java | 2 +- .../ApplicationServiceGrpcImplTest.java | 5 +- .../server/appmode/ApplicationTest.java | 4 +- .../runner/DeephavenApiServerTestBase.java | 5 +- .../server/session/SessionServiceTest.java | 6 +- .../server/session/SessionStateTest.java | 5 +- .../table/ExportTableUpdateListenerTest.java | 3 +- .../test/FlightMessageRoundTripTest.java | 3 + settings.gradle | 4 +- sphinx/source/conf.py | 2 +- .../io/deephaven/api/TableOperations.java | 475 ++++++++ .../api/TableOperationsDefaults.java | 697 +++++++++++ .../AbstractExpressionFactory.java | 2 +- .../api/expression/AsOfJoinMatchFactory.java | 163 +++ .../api/expression}/ExpressionException.java | 8 +- .../api/expression}/ExpressionFactory.java | 2 +- .../api/expression}/ExpressionParser.java | 8 +- .../expression}/SelectFactoryConstants.java | 2 +- .../deephaven/api/util}/ConcurrentMethod.java | 4 +- 269 files changed, 5843 insertions(+), 5053 deletions(-) delete mode 100644 CompilerTools/CompilerTools.gradle create mode 100644 Util/src/main/java/io/deephaven/util/NoExecutionContextRegisteredException.java delete mode 100644 engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibrary.java delete mode 100644 engine/api/src/test/java/io/deephaven/engine/table/lang/QueryLibraryTest.java create mode 100644 engine/context/build.gradle rename {CompilerTools => engine/context}/gradle.properties (100%) rename {CompilerTools/src/main/java/io/deephaven/compilertools => engine/context/src/main/java/io/deephaven/engine/context}/CompilerTools.java (83%) create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/EmptyQueryScope.java create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java create mode 100644 engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java rename engine/{api/src/main/java/io/deephaven/engine/table/lang => context/src/main/java/io/deephaven/engine/context}/QueryLibraryImports.java (95%) rename engine/{api/src/main/java/io/deephaven/engine/table/lang => context/src/main/java/io/deephaven/engine/context}/QueryLibraryImportsImpl.java (95%) rename engine/{api/src/main/java/io/deephaven/engine/table/lang => context/src/main/java/io/deephaven/engine/context}/QueryLibraryImportsServiceLoader.java (96%) rename engine/{api/src/main/java/io/deephaven/engine/table/lang => context/src/main/java/io/deephaven/engine/context}/QueryScope.java (79%) rename engine/{api/src/main/java/io/deephaven/engine/table/lang => context/src/main/java/io/deephaven/engine/context}/QueryScopeParam.java (92%) create mode 100644 engine/context/src/test/java/io/deephaven/engine/context/QueryLibraryTest.java rename {CompilerTools/src/test/java/io/deephaven/compilertools => engine/context/src/test/java/io/deephaven/engine/context}/TestCompilerTools.java (94%) rename engine/table/src/main/java/io/deephaven/engine/table/impl/{TableWithDefaults.java => TableDefaults.java} (53%) delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/select/AjMatchPairFactory.java create mode 100644 server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java rename server/src/main/java/io/deephaven/server/runner/{DeephavenApiServerInProcessComponent.java => DeephavenApiServerInProcessPythonComponent.java} (81%) create mode 100644 table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java rename {engine/table/src/main/java/io/deephaven/engine/util => table-api/src/main/java/io/deephaven/api/expression}/AbstractExpressionFactory.java (90%) create mode 100644 table-api/src/main/java/io/deephaven/api/expression/AsOfJoinMatchFactory.java rename {engine/api/src/main/java/io/deephaven/engine/exceptions => table-api/src/main/java/io/deephaven/api/expression}/ExpressionException.java (80%) rename {engine/table/src/main/java/io/deephaven/engine/util => table-api/src/main/java/io/deephaven/api/expression}/ExpressionFactory.java (87%) rename {engine/table/src/main/java/io/deephaven/engine/util => table-api/src/main/java/io/deephaven/api/expression}/ExpressionParser.java (90%) rename {engine/table/src/main/java/io/deephaven/engine/table/impl/select => table-api/src/main/java/io/deephaven/api/expression}/SelectFactoryConstants.java (98%) rename {engine/updategraph/src/main/java/io/deephaven/engine/updategraph => table-api/src/main/java/io/deephaven/api/util}/ConcurrentMethod.java (82%) diff --git a/Base/src/main/java/io/deephaven/base/StringUtils.java b/Base/src/main/java/io/deephaven/base/StringUtils.java index 411dec08e5d..900be0f2466 100644 --- a/Base/src/main/java/io/deephaven/base/StringUtils.java +++ b/Base/src/main/java/io/deephaven/base/StringUtils.java @@ -177,10 +177,4 @@ public static String pad(String s, int length, char padChar) { return buf.toString(); } - - public static Collection splitToCollection(String string) { - return string.trim().isEmpty() ? Collections.emptyList() - : Arrays.stream(string.split(",")).map(String::trim).filter(s -> !s.isEmpty()) - .collect(Collectors.toList()); - } } diff --git a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/BenchmarkTools.java b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/BenchmarkTools.java index 317586b9e48..a81a9b62999 100644 --- a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/BenchmarkTools.java +++ b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/BenchmarkTools.java @@ -5,10 +5,10 @@ import io.deephaven.base.StringUtils; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryScope; import io.deephaven.time.DateTime; import io.deephaven.util.annotations.ScriptApi; import io.deephaven.benchmarking.generator.*; @@ -300,7 +300,7 @@ public static Table applySparsity(Table table, int size, int sparsity, long seed throw new IllegalStateException("Sparsity must be in the range of 1 through 100"); } Random random = new Random(seed); - QueryScope.getScope().putParam("__random__", random); + ExecutionContext.getContext().getQueryScope().putParam("__random__", random); return table.where("__random__.nextInt(100) < " + sparsity).head(size); } diff --git a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/generator/ColumnGenerator.java b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/generator/ColumnGenerator.java index e40e2f7c649..5670385e882 100644 --- a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/generator/ColumnGenerator.java +++ b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/generator/ColumnGenerator.java @@ -6,7 +6,7 @@ import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.benchmarking.generator.random.ExtendedRandom; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; /** * An interface that defines a class which will create Columns for a {@link io.deephaven.benchmarking.BenchmarkTable} @@ -22,7 +22,7 @@ public interface ColumnGenerator { /** * Initialize any internal state with the specified RNG - * + * * @param random the RNG to use. */ void init(ExtendedRandom random); diff --git a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/impl/AbstractBenchmarkTable.java b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/impl/AbstractBenchmarkTable.java index 513d03e4ee0..1c7b6d6cc14 100644 --- a/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/impl/AbstractBenchmarkTable.java +++ b/BenchmarkSupport/src/main/java/io/deephaven/benchmarking/impl/AbstractBenchmarkTable.java @@ -4,7 +4,7 @@ package io.deephaven.benchmarking.impl; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.benchmarking.BenchmarkTable; import io.deephaven.benchmarking.generator.ColumnGenerator; import io.deephaven.benchmarking.generator.random.ExtendedRandom; diff --git a/ClientSupport/src/main/java/io/deephaven/treetable/TreeSnapshotQuery.java b/ClientSupport/src/main/java/io/deephaven/treetable/TreeSnapshotQuery.java index b92fe150173..81d58b52f1b 100644 --- a/ClientSupport/src/main/java/io/deephaven/treetable/TreeSnapshotQuery.java +++ b/ClientSupport/src/main/java/io/deephaven/treetable/TreeSnapshotQuery.java @@ -6,7 +6,7 @@ import io.deephaven.base.formatters.FormatBitSet; import io.deephaven.base.verify.Assert; import io.deephaven.engine.table.Table; -import io.deephaven.engine.updategraph.ConcurrentMethod; +import io.deephaven.api.util.ConcurrentMethod; import io.deephaven.engine.table.impl.HierarchicalTable; import io.deephaven.engine.table.impl.HierarchicalTableInfo; import io.deephaven.engine.table.impl.RollupInfo; diff --git a/ClientSupport/src/test/java/io/deephaven/treetable/SnapshotStateTest.java b/ClientSupport/src/test/java/io/deephaven/treetable/SnapshotStateTest.java index fd8ae1e594d..2ea12f94569 100644 --- a/ClientSupport/src/test/java/io/deephaven/treetable/SnapshotStateTest.java +++ b/ClientSupport/src/test/java/io/deephaven/treetable/SnapshotStateTest.java @@ -3,20 +3,11 @@ */ package io.deephaven.treetable; -import io.deephaven.csv.CsvTools; -import io.deephaven.csv.util.CsvReaderException; -import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.util.TableTools; -import io.deephaven.engine.table.impl.BaseTable; -import io.deephaven.engine.table.impl.HierarchicalTable; import io.deephaven.engine.table.impl.QueryTableTestBase; -import org.junit.Test; import java.util.*; import static io.deephaven.engine.util.TableTools.emptyTable; -import static io.deephaven.treetable.TreeTableConstants.ROOT_TABLE_KEY; public class SnapshotStateTest extends QueryTableTestBase { diff --git a/ClientSupport/src/test/java/io/deephaven/treetable/TreeSnapshotQueryTest.java b/ClientSupport/src/test/java/io/deephaven/treetable/TreeSnapshotQueryTest.java index 4a3c82f1746..02572abf8b5 100644 --- a/ClientSupport/src/test/java/io/deephaven/treetable/TreeSnapshotQueryTest.java +++ b/ClientSupport/src/test/java/io/deephaven/treetable/TreeSnapshotQueryTest.java @@ -3,42 +3,12 @@ */ package io.deephaven.treetable; -import io.deephaven.base.Pair; -import io.deephaven.csv.CsvTools; -import io.deephaven.csv.util.CsvReaderException; -import io.deephaven.datastructures.util.SmartKey; -import io.deephaven.engine.table.ColumnDefinition; -import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.TableMap; -import io.deephaven.engine.table.impl.select.WhereFilterFactory; -import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.*; -import io.deephaven.engine.table.impl.select.WhereFilter; -import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.updategraph.LogicalClock; -import io.deephaven.table.sort.SortDirective; -import io.deephaven.util.annotations.ReflexiveUse; -import gnu.trove.map.TIntObjectMap; -import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.map.hash.TObjectIntHashMap; import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Function; -import java.util.stream.Collectors; -import static io.deephaven.engine.table.impl.TstUtils.*; import static io.deephaven.engine.util.TableTools.emptyTable; -import static io.deephaven.treetable.TreeTableConstants.*; import static org.junit.Assert.assertArrayEquals; -import static io.deephaven.api.agg.Aggregation.AggLast; -import static io.deephaven.api.agg.Aggregation.AggSum; public class TreeSnapshotQueryTest extends QueryTableTestBase { diff --git a/CompilerTools/CompilerTools.gradle b/CompilerTools/CompilerTools.gradle deleted file mode 100644 index 3a89df3dc00..00000000000 --- a/CompilerTools/CompilerTools.gradle +++ /dev/null @@ -1,20 +0,0 @@ -plugins { - id 'io.deephaven.project.register' -} - -configurations { - implementation.extendsFrom fishConfig, commonsLang3 - testImplementation.extendsFrom fishIoTest -} - -dependencies { - implementation project(':Util') - implementation project(':log-factory') - Classpaths.inheritCommonsText(project, 'implementation') - - testRuntimeOnly project(path: ':configs') - testRuntimeOnly project(path: ':test-configs') - - testRuntimeOnly project(':log-to-slf4j') - Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') -} diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java index 9862802a8cf..51797293178 100644 --- a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java +++ b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java @@ -7,8 +7,8 @@ import io.deephaven.base.verify.Assert; import io.deephaven.configuration.Configuration; import io.deephaven.engine.exceptions.CancellationException; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryLibrary; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.AbstractScriptSession; import io.deephaven.engine.util.PythonEvaluator; @@ -75,20 +75,22 @@ public class PythonDeephavenSession extends AbstractScriptSession scope) { - super(NoOp.INSTANCE, null, false); + super(NoOp.INSTANCE, null); this.scope = (PythonScope) scope; this.module = null; this.evaluator = null; diff --git a/ModelFarm/src/test/java/io/deephaven/modelfarm/TestModelFarm.java b/ModelFarm/src/test/java/io/deephaven/modelfarm/TestModelFarm.java index c2eed5df9e1..d24733a96aa 100644 --- a/ModelFarm/src/test/java/io/deephaven/modelfarm/TestModelFarm.java +++ b/ModelFarm/src/test/java/io/deephaven/modelfarm/TestModelFarm.java @@ -5,12 +5,16 @@ import io.deephaven.base.verify.Require; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.ColumnSource; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.NotNull; +import org.junit.After; +import org.junit.Before; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -24,6 +28,22 @@ public class TestModelFarm extends TestCase { Configuration.getInstance().getIntegerWithDefault("TestModelFarm.testShutdownTimeoutSecs", 1); private final int nModelFarmThreadsDefault = 8; + private SafeCloseable executionContext; + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @After + @Override + public void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } + /** * Ensure that the ModelFarm terminates immediately if it is shut down while not busy with an empty queue. */ diff --git a/ModelFarm/src/test/java/io/deephaven/modelfarm/util/TestModelFarmUtils.java b/ModelFarm/src/test/java/io/deephaven/modelfarm/util/TestModelFarmUtils.java index f3cf8ed8f6f..eb6958d322a 100644 --- a/ModelFarm/src/test/java/io/deephaven/modelfarm/util/TestModelFarmUtils.java +++ b/ModelFarm/src/test/java/io/deephaven/modelfarm/util/TestModelFarmUtils.java @@ -5,14 +5,34 @@ import io.deephaven.base.testing.BaseArrayTestCase; import io.deephaven.base.verify.RequirementFailure; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; import io.deephaven.time.DateTimeUtils; +import io.deephaven.util.SafeCloseable; import io.deephaven.vector.*; import io.deephaven.time.DateTime; import io.deephaven.engine.util.TableTools; +import org.junit.After; +import org.junit.Before; public class TestModelFarmUtils extends BaseArrayTestCase { + private SafeCloseable executionContext; + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @After + @Override + public void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } + public void testRequireTable() { final Table t = TableTools.emptyTable(5).updateView("A=(int)i", "B=(long)i", "C=(double)i"); diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractSwappableTableBasedCategoryDataSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractSwappableTableBasedCategoryDataSeries.java index 8f825760644..c74a44242a9 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractSwappableTableBasedCategoryDataSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractSwappableTableBasedCategoryDataSeries.java @@ -3,6 +3,7 @@ */ package io.deephaven.plot.datasets.category; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.datasets.ColumnNameConstants; import io.deephaven.plot.datasets.data.AssociativeDataSwappableTable; @@ -10,8 +11,7 @@ import io.deephaven.plot.util.functions.FigureImplFunction; import io.deephaven.plot.util.tables.SwappableTable; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.gui.color.Paint; import io.deephaven.gui.shape.NamedShape; import io.deephaven.gui.shape.Shape; @@ -146,7 +146,7 @@ protected Function constructPartitionedTableFromFunction(fi final String queryFunction = columnName + "Function"; return t -> { QueryScope.addParam(queryFunction, function); - QueryLibrary.importClass(resultClass); + ExecutionContext.getContext().getQueryLibrary().importClass(resultClass); return t.update(columnName + " = (" + resultClass.getSimpleName() + ") " + queryFunction + ".apply(" + onColumn + ")"); }; diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractTableBasedCategoryDataSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractTableBasedCategoryDataSeries.java index 403b61f2eaf..5ebecf59034 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractTableBasedCategoryDataSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/category/AbstractTableBasedCategoryDataSeries.java @@ -3,13 +3,13 @@ */ package io.deephaven.plot.datasets.category; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.datasets.ColumnNameConstants; import io.deephaven.plot.util.ArgumentValidations; import io.deephaven.plot.util.functions.FigureImplFunction; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.gui.color.Paint; import java.util.function.Function; @@ -94,7 +94,7 @@ protected Table constructTableFromFunction(final Table t, final Function< ArgumentValidations.assertNotNull(function, "function", getPlotInfo()); final String queryFunction = columnName + "Function"; QueryScope.addParam(queryFunction, function); - QueryLibrary.importClass(resultClass); + ExecutionContext.getContext().getQueryLibrary().importClass(resultClass); return t.update( columnName + " = (" + resultClass.getSimpleName() + ") " + queryFunction + ".apply(" + onColumn + ")"); } diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractPartitionedTableHandleMultiSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractPartitionedTableHandleMultiSeries.java index 3359dc1a2ca..26212a5698b 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractPartitionedTableHandleMultiSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractPartitionedTableHandleMultiSeries.java @@ -3,12 +3,12 @@ */ package io.deephaven.plot.datasets.multiseries; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.datasets.DataSeriesInternal; import io.deephaven.plot.util.ArgumentValidations; import io.deephaven.plot.util.tables.TableBackedPartitionedTableHandle; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.table.PartitionedTable; import java.util.Arrays; @@ -90,7 +90,7 @@ public TableBackedPartitionedTableHandle getPartitionedTableHandle() { public void applyTransform(final String columnName, final String update, final Class[] classesToImport, final Map params, boolean columnTypesPreserved) { ArgumentValidations.assertNull(partitionedTable, "partitionedTable must be null", getPlotInfo()); - Arrays.stream(classesToImport).forEach(QueryLibrary::importClass); + Arrays.stream(classesToImport).forEach(aClass -> ExecutionContext.getContext().getQueryLibrary().importClass(aClass)); params.forEach(QueryScope::addParam); partitionedTableHandle.addColumn(columnName); diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractSwappableMultiSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractSwappableMultiSeries.java index bfebd2aec38..3aba9cfb061 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractSwappableMultiSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/AbstractSwappableMultiSeries.java @@ -3,14 +3,14 @@ */ package io.deephaven.plot.datasets.multiseries; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.datasets.DataSeriesInternal; import io.deephaven.plot.util.ArgumentValidations; import io.deephaven.plot.util.tables.SwappableTable; import io.deephaven.plot.util.tables.TableHandle; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.table.PartitionedTable; import java.util.*; @@ -121,7 +121,7 @@ public void applyTransform(final String columnName, final String update, final C ArgumentValidations.assertNull(partitionedTable, "partitionedTable must be null", getPlotInfo()); swappableTable.addColumn(columnName); final Function tableTransform = t -> { - Arrays.stream(classesToImport).forEach(QueryLibrary::importClass); + Arrays.stream(classesToImport).forEach(aClass -> ExecutionContext.getContext().getQueryLibrary().importClass(aClass)); params.forEach(QueryScope::addParam); return t.update(update); }; diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesSwappableTableArray.java b/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesSwappableTableArray.java index 45880fa98cc..f4b59379834 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesSwappableTableArray.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesSwappableTableArray.java @@ -3,19 +3,15 @@ */ package io.deephaven.plot.datasets.xy; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.TableSnapshotSeries; -import io.deephaven.plot.datasets.ColumnNameConstants; -import io.deephaven.plot.datasets.data.IndexableDataSwappableTable; import io.deephaven.plot.datasets.data.IndexableNumericDataSwappableTable; import io.deephaven.plot.errors.PlotInfo; import io.deephaven.plot.util.ArgumentValidations; -import io.deephaven.plot.util.functions.FigureImplFunction; import io.deephaven.plot.util.tables.SwappableTable; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; -import io.deephaven.gui.color.Paint; +import io.deephaven.engine.context.QueryScope; import java.util.function.Function; @@ -55,7 +51,7 @@ private Function constructPartitionedTableFromFunction(fina final String queryFunction = columnName + "Function"; return t -> { QueryScope.addParam(queryFunction, function); - QueryLibrary.importClass(resultClass); + ExecutionContext.getContext().getQueryLibrary().importClass(resultClass); return t.update(columnName + " = (" + resultClass.getSimpleName() + ") " + queryFunction + ".apply(" + onColumn + ")"); }; diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesTableArray.java b/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesTableArray.java index 68d41fce6f6..cb5b454fd12 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesTableArray.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/xy/XYDataSeriesTableArray.java @@ -3,18 +3,15 @@ */ package io.deephaven.plot.datasets.xy; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.plot.AxesImpl; import io.deephaven.plot.SeriesInternal; -import io.deephaven.plot.datasets.ColumnNameConstants; import io.deephaven.plot.datasets.data.IndexableNumericDataTable; import io.deephaven.plot.errors.PlotInfo; import io.deephaven.plot.util.ArgumentValidations; -import io.deephaven.plot.util.functions.FigureImplFunction; import io.deephaven.plot.util.tables.TableHandle; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; -import io.deephaven.gui.color.Paint; +import io.deephaven.engine.context.QueryScope; import java.util.function.Function; @@ -51,7 +48,7 @@ private Table constructTableFromFunction(final Table t, final Function> { + interface Proxy extends TableOperationsDefaults> { /** * Get the PartitionedTable instance underlying this proxy. @@ -164,7 +166,7 @@ default Proxy proxy() { * columns not in the {@link #constituentDefinition() constituent definition}, those columns will be ignored. If * constituent tables are missing columns in the constituent definition, the corresponding output rows will be * {@code null}. - * + * * @return A merged representation of the constituent tables */ Table merge(); @@ -186,7 +188,7 @@ default Proxy proxy() { * Make a new PartitionedTable from the result of applying {@code sortColumns} to the underlying partitioned table. *

    * {@code sortColumns} must not reference the constituent column. - * + * * @param sortColumns The columns to sort by. Must not reference the constituent column. * @return The sorted PartitionedTable */ @@ -198,13 +200,31 @@ default Proxy proxy() { * Apply {@code transformer} to all constituent {@link Table tables}, and produce a new PartitionedTable containing * the results. *

    + * + * @apiNote {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for an + * empty input table. It is required to install an ExecutionContext to access any + * QueryLibrary/QueryScope/CompilerContext functionality from the {@code transformer}. + * + * @param transformer The {@link UnaryOperator} to apply to all constituent {@link Table tables} + * @return The new PartitionedTable containing the resulting constituents + */ + default PartitionedTable transform(@NotNull UnaryOperator

    transformer) { + return transform(ExecutionContext.getContextToRecord(), transformer); + } + + /** + *

    + * Apply {@code transformer} to all constituent {@link Table tables}, and produce a new PartitionedTable containing + * the results. The {@code transformer} will be invoked in the provided ExecutionContext. + *

    * {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for an empty * input table. * + * @param executionContext The ExecutionContext to use for the {@code transformer} * @param transformer The {@link UnaryOperator} to apply to all constituent {@link Table tables} * @return The new PartitionedTable containing the resulting constituents */ - PartitionedTable transform(@NotNull UnaryOperator

    transformer); + PartitionedTable transform(ExecutionContext executionContext, @NotNull UnaryOperator
    transformer); /** *

    @@ -222,15 +242,50 @@ default Proxy proxy() { * {@link ColumnSource#getType() data type} and {@link ColumnSource#getComponentType() component type}. * *

    + * + * @apiNote {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for + * empty input tables. It is required to install an ExecutionContext to access any + * QueryLibrary/QueryScope/CompilerContext functionality from the {@code transformer}. + * + * @param other The other PartitionedTable to find constituents in + * @param transformer The {@link BinaryOperator} to apply to all pairs of constituent {@link Table tables} + * @return The new PartitionedTable containing the resulting constituents + */ + default PartitionedTable partitionedTransform( + @NotNull PartitionedTable other, + @NotNull BinaryOperator

    transformer) { + return partitionedTransform(other, ExecutionContext.getContextToRecord(), transformer); + } + + /** + *

    + * Apply {@code transformer} to all constituent {@link Table tables} found in {@code this} and {@code other} with + * the same key column values, and produce a new PartitionedTable containing the results. The {@code transformer} + * will be invoked in the provided ExecutionContext. + *

    + * Note that {@code other}'s key columns must match {@code this} PartitionedTable's key columns. Two matching + * mechanisms are supported, and will be attempted in the order listed: + *

      + *
    1. Match by column name. Both PartitionedTables must have all the same {@link #keyColumnNames() key column + * names}. Like-named columns must have the same {@link ColumnSource#getType() data type} and + * {@link ColumnSource#getComponentType() component type}.
    2. + *
    3. Match by column order. Both PartitionedTables must have their matchable columns in the same order within + * their {@link #keyColumnNames() key column names}. Like-positioned columns must have the same + * {@link ColumnSource#getType() data type} and {@link ColumnSource#getComponentType() component type}.
    4. + *
    + *

    * {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for empty input - * tables. + * tables. It is required to install an ExecutionContext to access any QueryLibrary/QueryScope/CompilerContext + * functionality from the {@code transformer}. * * @param other The other PartitionedTable to find constituents in + * @param executionContext The ExecutionContext to use for the {@code transformer} * @param transformer The {@link BinaryOperator} to apply to all pairs of constituent {@link Table tables} * @return The new PartitionedTable containing the resulting constituents */ PartitionedTable partitionedTransform( @NotNull PartitionedTable other, + ExecutionContext executionContext, @NotNull BinaryOperator

    transformer); /** diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index d8ff5cec549..b049cc86322 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -5,14 +5,11 @@ import io.deephaven.api.*; import io.deephaven.api.agg.Aggregation; -import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByOperation; -import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.liveness.LivenessNode; import io.deephaven.engine.rowset.TrackingRowSet; import io.deephaven.engine.table.iterators.*; -import io.deephaven.engine.updategraph.ConcurrentMethod; +import io.deephaven.api.util.ConcurrentMethod; import io.deephaven.engine.updategraph.DynamicNode; import io.deephaven.engine.updategraph.NotificationQueue; import io.deephaven.engine.util.systemicmarking.SystemicObject; @@ -330,17 +327,9 @@ public interface Table extends // Filter Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - @ConcurrentMethod - Table where(Collection filters); - @ConcurrentMethod Table where(Filter... filters); - @Override - @ConcurrentMethod - Table where(String... filters); - /** * A table operation that applies the supplied predicate to each row in the table and produces columns containing * the pass/fail result of the predicate application. This is similar to {@link #where(String...)} except that @@ -354,96 +343,24 @@ public interface Table extends @ConcurrentMethod Table wouldMatch(String... expressions); - @Override - Table whereIn(Table rightTable, Collection columnsToMatch); - - Table whereIn(Table rightTable, String... columnsToMatch); - - @Override - Table whereNotIn(Table rightTable, Collection columnsToMatch); - - Table whereNotIn(Table rightTable, String... columnsToMatch); - // ----------------------------------------------------------------------------------------------------------------- // Column Selection Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - Table select(Collection columns); - Table select(Selectable... columns); - @Override - Table select(String... columns); - Table select(); - @ConcurrentMethod - Table selectDistinct(Collection columns); - - @ConcurrentMethod - Table selectDistinct(Selectable... columns); - - @ConcurrentMethod - Table selectDistinct(String... columns); - - @ConcurrentMethod - Table selectDistinct(); - - @Override - Table update(Collection newColumns); - Table update(Selectable... newColumns); - @Override - Table update(String... newColumns); - - /** - * Compute column formulas on demand. - * - *

    - * Lazy update defers computation until required for a set of values, and caches the results for a set of input - * values. This uses less RAM than an update statement when you have a smaller set of unique values. Less - * computation than an updateView is needed, because the results are saved in a cache. - *

    - * - *

    - * If you have many unique values, you should instead use an update statement, which will have more memory efficient - * structures. Values are never removed from the lazyUpdate cache, so it should be used judiciously on a ticking - * table. - *

    - * - * @param newColumns the columns to add - * @return a new Table with the columns added; to be computed on demand - */ - Table lazyUpdate(Collection newColumns); - Table lazyUpdate(Selectable... newColumns); - Table lazyUpdate(String... newColumns); - - @Override - @ConcurrentMethod - Table view(Collection columns); - @ConcurrentMethod Table view(Selectable... columns); - @Override - @ConcurrentMethod - Table view(String... columns); - - @Override - @ConcurrentMethod - Table updateView(Collection newColumns); - @ConcurrentMethod Table updateView(Selectable... newColumns); - @Override - @ConcurrentMethod - Table updateView(String... newColumns); - @ConcurrentMethod Table dropColumns(Collection columnNames); @@ -530,12 +447,6 @@ public interface Table extends // Slice Operations // ----------------------------------------------------------------------------------------------------------------- - @ConcurrentMethod - Table head(long size); - - @ConcurrentMethod - Table tail(long size); - /** * Extracts a subset of a table by row position. *

    @@ -578,16 +489,6 @@ public interface Table extends Table exactJoin(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd); - @Override - Table exactJoin(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd); - - @Override - Table exactJoin(Table rightTable, String columnsToMatch, String columnsToAdd); - - @Override - Table exactJoin(Table rightTable, String columnsToMatch); - /** * Rules for the inexact matching performed on the final column to match by in {@link #aj} and {@link #raj}. */ @@ -645,14 +546,6 @@ public static AsOfMatchRule of(ReverseAsOfJoinRule rule) { */ Table aj(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd); - @Override - Table aj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd); - - @Override - Table aj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd, AsOfJoinRule asOfJoinRule); - /** * Looks up the columns in the rightTable that meet the match conditions in the columnsToMatch list. Matching is * done exactly for the first n-1 columns and via a binary search for the last match pair. The columns of the @@ -665,12 +558,6 @@ Table aj(Table rightTable, Collection columnsToMatch, */ Table aj(Table rightTable, Collection columnsToMatch); - @Override - Table aj(Table rightTable, String columnsToMatch, String columnsToAdd); - - @Override - Table aj(Table rightTable, String columnsToMatch); - /** * Just like .aj(), but the matching on the last column is in reverse order, so that you find the row after the * given timestamp instead of the row before. @@ -707,14 +594,6 @@ Table aj(Table rightTable, Collection columnsToMatch, */ Table raj(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd); - @Override - Table raj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd); - - @Override - Table raj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd, ReverseAsOfJoinRule reverseAsOfJoinRule); - /** * Just like .aj(), but the matching on the last column is in reverse order, so that you find the row after the * given timestamp instead of the row before. @@ -730,40 +609,8 @@ Table raj(Table rightTable, Collection columnsToMatch, */ Table raj(Table rightTable, Collection columnsToMatch); - /** - * Just like .aj(), but the matching on the last column is in reverse order, so that you find the row after the - * given timestamp instead of the row before. - *

    - * Looks up the columns in the rightTable that meet the match conditions in the columnsToMatch list. Matching is - * done exactly for the first n-1 columns and via a binary search for the last match pair. The columns of the - * original table are returned intact, together with the columns from rightTable defined in a comma separated list - * "columnsToAdd" - * - * @param rightTable The right side table on the join. - * @param columnsToMatch A comma separated list of match conditions ("leftColumn=rightColumn" or - * "columnFoundInBoth") - * @param columnsToAdd A comma separated list with the columns from the left side that need to be added to the right - * side as a result of the match. - * @return a new table joined according to the specification in columnsToMatch and columnsToAdd - */ - @Override - Table raj(Table rightTable, String columnsToMatch, String columnsToAdd); - - @Override - Table raj(Table rightTable, String columnsToMatch); - Table naturalJoin(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd); - @Override - Table naturalJoin(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd); - - @Override - Table naturalJoin(Table rightTable, String columnsToMatch, String columnsToAdd); - - @Override - Table naturalJoin(Table rightTable, String columnsToMatch); - /** * Perform a cross join with the right table. *

    @@ -819,9 +666,6 @@ Table naturalJoin(Table rightTable, Collection columnsToMat */ Table join(Table rightTable, int numRightBitsToReserve); - @Override - Table join(Table rightTable, String columnsToMatch); - /** * Perform a cross join with the right table. *

    @@ -854,9 +698,6 @@ Table naturalJoin(Table rightTable, Collection columnsToMat */ Table join(Table rightTable, String columnsToMatch, int numRightBitsToReserve); - @Override - Table join(Table rightTable, String columnsToMatch, String columnsToAdd); - /** * Perform a cross join with the right table. *

    @@ -953,79 +794,10 @@ Table naturalJoin(Table rightTable, Collection columnsToMat */ Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd, int numRightBitsToReserve); - @Override - Table join(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd); - - @Override - Table join(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd, int numRightBitsToReserve); - // ----------------------------------------------------------------------------------------------------------------- // Aggregation Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - @ConcurrentMethod - Table groupBy(Collection groupByColumns); - - @Override - @ConcurrentMethod - Table groupBy(String... groupByColumns); - - @Override - @ConcurrentMethod - Table groupBy(); - - @Override - @ConcurrentMethod - Table aggAllBy(AggSpec spec); - - @Override - @ConcurrentMethod - Table aggAllBy(AggSpec spec, String... groupByColumns); - - @Override - @ConcurrentMethod - Table aggAllBy(AggSpec spec, ColumnName... groupByColumns); - - @Override - @ConcurrentMethod - Table aggAllBy(AggSpec spec, Collection groupByColumns); - - @Override - @ConcurrentMethod - Table aggBy(Aggregation aggregation); - - @Override - @ConcurrentMethod - Table aggBy(Collection aggregations); - - @Override - @ConcurrentMethod - Table aggBy(Collection aggregations, boolean preserveEmpty); - - @Override - @ConcurrentMethod - Table aggBy(Aggregation aggregation, String... groupByColumns); - - @Override - @ConcurrentMethod - Table aggBy(Aggregation aggregation, Collection groupByColumns); - - @Override - @ConcurrentMethod - Table aggBy(Collection aggregations, String... groupByColumns); - - @Override - @ConcurrentMethod - Table aggBy(Collection aggregations, Collection groupByColumns); - - @Override - @ConcurrentMethod - Table aggBy(Collection aggregations, boolean preserveEmpty, Table initialGroups, - Collection groupByColumns); - Table headBy(long nRows, Collection groupByColumnNames); Table headBy(long nRows, String... groupByColumnNames); @@ -1069,617 +841,134 @@ Table aggBy(Collection aggregations, boolean preserveEmpt Table applyToAllBy(String formulaColumn, String... groupByColumns); /** - * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * If this table is a stream table, i.e. it has {@link #STREAM_TABLE_ATTRIBUTE} set to {@code true}, return a child + * without the attribute, restoring standard semantics for aggregation operations. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @return A non-stream child table, or this table if it is not a stream table */ - @Override @ConcurrentMethod - Table sumBy(ColumnName... groupByColumns); + Table dropStream(); + + // ----------------------------------------------------------------------------------------------------------------- + // Disaggregation Operations + // ----------------------------------------------------------------------------------------------------------------- /** - * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * Ungroups a table by converting arrays into columns. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with + * null values. If set to false, then all arrays should be the same length. + * @param columnsToUngroup the columns to ungroup + * @return the ungrouped table */ - @Override - @ConcurrentMethod - Table sumBy(String... groupByColumns); + Table ungroup(boolean nullFill, String... columnsToUngroup); + + Table ungroup(String... columnsToUngroup); + + Table ungroupAllBut(String... columnsNotToUngroup); + + Table ungroup(); + + Table ungroup(boolean nullFill); + + // ----------------------------------------------------------------------------------------------------------------- + // PartitionBy Operations + // ----------------------------------------------------------------------------------------------------------------- /** - * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * Create a {@link PartitionedTable} from this table, partitioned according to the specified key columns. + *

    + * The underlying partitioned table backing the result contains each row in {@code this} table in exactly one of the + * result's constituent tables. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @param dropKeys Whether to drop key columns in the output constituent tables + * @param keyColumnNames The name of the key columns to partition by + * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} */ - @Override @ConcurrentMethod - Table sumBy(Collection groupByColumns); + PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames); /** - * Produces a single row table with the sum of each column. + * Equivalent to {@code partitionBy(false, keyColumnNames)} + *

    + * Create a {@link PartitionedTable} from this table, partitioned according to the specified key columns. Key + * columns are never dropped from the output constituent tables. *

    - * When the input table is empty, zero output rows are produced. + * The underlying partitioned table backing the result contains each row in {@code this} table in exactly one of the + * result's constituent tables. + * + * @param keyColumnNames The name of the key columns to partition by + * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} */ - @Override @ConcurrentMethod - Table sumBy(); + PartitionedTable partitionBy(String... keyColumnNames); /** - * Groups the data column according to groupByColumns and computes the sum of the absolute values for - * the rest of the fields + * Convenience method that performs an {@link #aggBy} and wraps the result in a {@link PartitionedTable}. If + * {@code aggregations} does not include a {@link io.deephaven.api.agg.Partition partition}, one will be added + * automatically with the default constituent column name and behavior used in {@link #partitionBy(String...)}. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @param aggregations The {@link Aggregation aggregations} to apply + * @param preserveEmpty Whether to keep result rows for groups that are initially empty or become empty as a result + * of updates. Each aggregation operator defines its own value for empty groups. + * @param initialGroups A table whose distinct combinations of values for the {@code groupByColumns} should be used + * to create an initial set of aggregation groups. All other columns are ignored. This is useful in + * combination with {@code preserveEmpty == true} to ensure that particular groups appear in the result + * table, or with {@code preserveEmpty == false} to control the encounter order for a collection of groups + * and thus their relative order in the result. Changes to {@code initialGroups} are not expected or handled; + * if {@code initialGroups} is a refreshing table, only its contents at instantiation time will be used. If + * {@code initialGroups == null}, the result will be the same as if a table with no rows was supplied. + * @param keyColumnNames The names of the key columns to aggregate by + * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} */ - @Override @ConcurrentMethod - Table absSumBy(ColumnName... groupByColumns); + PartitionedTable partitionedAggBy(Collection aggregations, boolean preserveEmpty, + Table initialGroups, String... keyColumnNames); + + // ----------------------------------------------------------------------------------------------------------------- + // Hierarchical table operations (rollup and treeTable). + // ----------------------------------------------------------------------------------------------------------------- /** - * Groups the data column according to groupByColumns and computes the sum of the absolute values for - * the rest of the fields + * Create a rollup table. + *

    + * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates + * using one less aggregation column on each level. The column that is no longer part of the aggregation key is + * replaced with null on each level. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @param aggregations The aggregations to perform + * @param groupByColumns the columns to group by + * @return a hierarchical table with the rollup applied */ - @Override @ConcurrentMethod - Table absSumBy(String... groupByColumns); + Table rollup(Collection aggregations, Collection groupByColumns); /** - * Groups the data column according to groupByColumns and computes the sum of the absolute values for - * the rest of the fields + * Create a rollup table. + *

    + * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates + * using one less aggregation column on each level. The column that is no longer part of the aggregation key is + * replaced with null on each level. * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} + * @param aggregations The aggregations to perform + * @param includeConstituents set to true to include the constituent rows at the leaf level + * @param groupByColumns the columns to group by + * @return a hierarchical table with the rollup applied */ - @Override @ConcurrentMethod - Table absSumBy(Collection groupByColumns); + Table rollup(Collection aggregations, boolean includeConstituents, + Collection groupByColumns); /** - * Produces a single row table with the absolute sum of each column. + * Create a rollup table. *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table absSumBy(); - - /** - * Groups the data column according to groupByColumns and computes the average for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table avgBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the average for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table avgBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the average for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table avgBy(Collection groupByColumns); - - /** - * Produces a single row table with the average of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table avgBy(); - - /** - * Groups the data column according to groupByColumns and computes the weighted average using - * weightColumn for the rest of the fields - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wavgBy(String weightColumn, ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the weighted average using - * weightColumn for the rest of the fields - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wavgBy(String weightColumn, String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the weighted average using - * weightColumn for the rest of the fields - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wavgBy(String weightColumn, Collection groupByColumns); - - /** - * Produces a single row table with the weighted average using weightColumn for the rest of the fields - *

    - * When the input table is empty, zero output rows are produced. - * - * @param weightColumn the column to use for the weight - */ - @Override - @ConcurrentMethod - Table wavgBy(String weightColumn); - - /** - * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn - * for the rest of the fields - *

    - * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an - * integral type, all integral input columns will have long results and all floating point input columns will have - * double results. - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wsumBy(String weightColumn, ColumnName... groupByColumns); - - /** - * Computes the weighted sum for all rows in the table using weightColumn for the rest of the fields - *

    - * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an - * integral type, all integral input columns will have long results and all floating point input columns will have - * double results. - * - * @param weightColumn the column to use for the weight - */ - @Override - @ConcurrentMethod - Table wsumBy(String weightColumn); - - /** - * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn - * for the rest of the fields - *

    - * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an - * integral type, all integral input columns will have long results and all floating point input columns will have - * double results. - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wsumBy(String weightColumn, String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn - * for the rest of the fields - *

    - * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an - * integral type, all integral input columns will have long results and all floating point input columns will have - * double results. - * - * @param weightColumn the column to use for the weight - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table wsumBy(String weightColumn, Collection groupByColumns); - - @Override - @ConcurrentMethod - Table stdBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the standard deviation for the rest - * of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table stdBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the standard deviation for the rest - * of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table stdBy(Collection groupByColumns); - - /** - * Produces a single row table with the standard deviation of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table stdBy(); - - /** - * Groups the data column according to groupByColumns and computes the variance for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table varBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the variance for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table varBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the variance for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table varBy(Collection groupByColumns); - - /** - * Produces a single row table with the variance of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table varBy(); - - /** - * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table lastBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table lastBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table lastBy(Collection groupByColumns); - - /** - * Returns the last row of the given table. - */ - @Override - @ConcurrentMethod - Table lastBy(); - - /** - * Groups the data column according to groupByColumns and retrieves the first for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table firstBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and retrieves the first for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table firstBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and retrieves the first for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table firstBy(Collection groupByColumns); - - /** - * Returns the first row of the given table. - */ - @Override - @ConcurrentMethod - Table firstBy(); - - /** - * Groups the data column according to groupByColumns and computes the min for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table minBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the min for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table minBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the min for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} - */ - @Override - @ConcurrentMethod - Table minBy(Collection groupByColumns); - - /** - * Produces a single row table with the minimum of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table minBy(); - - /** - * Groups the data column according to groupByColumns and computes the max for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table maxBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the max for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table maxBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the max for the rest of the fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table maxBy(Collection groupByColumns); - - /** - * Produces a single row table with the maximum of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table maxBy(); - - /** - * Groups the data column according to groupByColumns and computes the median for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table medianBy(ColumnName... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the median for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table medianBy(String... groupByColumns); - - /** - * Groups the data column according to groupByColumns and computes the median for the rest of the - * fields - * - * @param groupByColumns The grouping columns as in {@link Table#groupBy} } - */ - @Override - @ConcurrentMethod - Table medianBy(Collection groupByColumns); - - /** - * Produces a single row table with the median of each column. - *

    - * When the input table is empty, zero output rows are produced. - */ - @Override - @ConcurrentMethod - Table medianBy(); - - @ConcurrentMethod - Table countBy(String countColumnName, ColumnName... groupByColumns); - - @ConcurrentMethod - Table countBy(String countColumnName, String... groupByColumns); - - @ConcurrentMethod - Table countBy(String countColumnName, Collection groupByColumns); - - @ConcurrentMethod - Table countBy(String countColumnName); - - /** - * If this table is a stream table, i.e. it has {@link #STREAM_TABLE_ATTRIBUTE} set to {@code true}, return a child - * without the attribute, restoring standard semantics for aggregation operations. - * - * @return A non-stream child table, or this table if it is not a stream table - */ - @ConcurrentMethod - Table dropStream(); - - // ----------------------------------------------------------------------------------------------------------------- - // Disaggregation Operations - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Ungroups a table by converting arrays into columns. - * - * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with - * null values. If set to false, then all arrays should be the same length. - * @param columnsToUngroup the columns to ungroup - * @return the ungrouped table - */ - Table ungroup(boolean nullFill, String... columnsToUngroup); - - Table ungroup(String... columnsToUngroup); - - Table ungroupAllBut(String... columnsNotToUngroup); - - Table ungroup(); - - Table ungroup(boolean nullFill); - - // ----------------------------------------------------------------------------------------------------------------- - // PartitionBy Operations - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Create a {@link PartitionedTable} from this table, partitioned according to the specified key columns. - *

    - * The underlying partitioned table backing the result contains each row in {@code this} table in exactly one of the - * result's constituent tables. - * - * @param dropKeys Whether to drop key columns in the output constituent tables - * @param keyColumnNames The name of the key columns to partition by - * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} - */ - @ConcurrentMethod - PartitionedTable partitionBy(boolean dropKeys, String... keyColumnNames); - - /** - * Equivalent to {@code partitionBy(false, keyColumnNames)} - *

    - * Create a {@link PartitionedTable} from this table, partitioned according to the specified key columns. Key - * columns are never dropped from the output constituent tables. - *

    - * The underlying partitioned table backing the result contains each row in {@code this} table in exactly one of the - * result's constituent tables. - * - * @param keyColumnNames The name of the key columns to partition by - * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} - */ - @ConcurrentMethod - PartitionedTable partitionBy(String... keyColumnNames); - - /** - * Convenience method that performs an {@link #aggBy(Collection, boolean, Table, Collection)} and wraps the result - * in a {@link PartitionedTable}. If {@code aggregations} does not include a {@link io.deephaven.api.agg.Partition - * partition}, one will be added automatically with the default constituent column name and behavior used in - * {@link #partitionBy(String...)}. - * - * @param aggregations The {@link Aggregation aggregations} to apply - * @param preserveEmpty Whether to keep result rows for groups that are initially empty or become empty as a result - * of updates. Each aggregation operator defines its own value for empty groups. - * @param initialGroups A table whose distinct combinations of values for the {@code groupByColumns} should be used - * to create an initial set of aggregation groups. All other columns are ignored. This is useful in - * combination with {@code preserveEmpty == true} to ensure that particular groups appear in the result - * table, or with {@code preserveEmpty == false} to control the encounter order for a collection of groups - * and thus their relative order in the result. Changes to {@code initialGroups} are not expected or handled; - * if {@code initialGroups} is a refreshing table, only its contents at instantiation time will be used. If - * {@code initialGroups == null}, the result will be the same as if a table with no rows was supplied. - * @param keyColumnNames The names of the key columns to aggregate by - * @return A {@link PartitionedTable} keyed by {@code keyColumnNames} - */ - @ConcurrentMethod - PartitionedTable partitionedAggBy(Collection aggregations, boolean preserveEmpty, - Table initialGroups, String... keyColumnNames); - - // ----------------------------------------------------------------------------------------------------------------- - // Hierarchical table operations (rollup and treeTable). - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Create a rollup table. - *

    - * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates - * using one less aggregation column on each level. The column that is no longer part of the aggregation key is - * replaced with null on each level. - * - * @param aggregations The aggregations to perform - * @param groupByColumns the columns to group by - * @return a hierarchical table with the rollup applied - */ - @ConcurrentMethod - Table rollup(Collection aggregations, Collection groupByColumns); - - /** - * Create a rollup table. - *

    - * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates - * using one less aggregation column on each level. The column that is no longer part of the aggregation key is - * replaced with null on each level. - * - * @param aggregations The aggregations to perform - * @param includeConstituents set to true to include the constituent rows at the leaf level - * @param groupByColumns the columns to group by - * @return a hierarchical table with the rollup applied - */ - @ConcurrentMethod - Table rollup(Collection aggregations, boolean includeConstituents, - Collection groupByColumns); - - /** - * Create a rollup table. - *

    - * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates - * using one less aggregation column on each level. The column that is no longer part of the aggregation key is - * replaced with null on each level. - * - * @param aggregations The aggregations to perform - * @param groupByColumns the columns to group by - * @return a hierarchical table with the rollup applied + * A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates + * using one less aggregation column on each level. The column that is no longer part of the aggregation key is + * replaced with null on each level. + * + * @param aggregations The aggregations to perform + * @param groupByColumns the columns to group by + * @return a hierarchical table with the rollup applied */ @ConcurrentMethod Table rollup(Collection aggregations, String... groupByColumns); @@ -1756,128 +1045,10 @@ Table rollup(Collection aggregations, boolean includeCons @ConcurrentMethod Table treeTable(String idColumn, String parentColumn); - // ----------------------------------------------------------------------------------------------------------------- - // UpdateBy Operations - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * over the entire table. - * - * @param operation the operation to apply to the table. - * @return a table with the same rowset, with the specified operation applied to the entire table - */ - @ConcurrentMethod - Table updateBy(@NotNull final UpdateByOperation operation); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * over the entire table. - * - * @param operations the operations to apply to the table. - * @return a table with the same rowset, with the specified operations applied to the entire table. - */ - @ConcurrentMethod - Table updateBy(@NotNull final Collection operations); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * over the entire table. - * - * @param control the {@link UpdateByControl control} to use when updating the table. - * @param operations the operations to apply to the table. - * @return a table with the same rowset, with the specified operations applied to the entire table - */ - @ConcurrentMethod - Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * for the row group (as determined by the {@code byColumns}). - * - * @param operation the operation to apply to the table. - * @param byColumns the columns to group by before applying. - * @return a table with the same rowSet, with the specified operation applied to each group defined by the - * {@code byColumns} - */ - @ConcurrentMethod - Table updateBy(@NotNull final UpdateByOperation operation, final String... byColumns); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * for the row group (as determined by the {@code byColumns}). - * - * @param operations the operations to apply to the table. - * @param byColumns the columns to group by before applying. - * @return a table with the same rowSet, with the specified operations applied to each group defined by the - * {@code byColumns} - */ - @ConcurrentMethod - Table updateBy(@NotNull final Collection operations, final String... byColumns); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * for the row group (as determined by the {@code byColumns}). - * - * @param operations the operations to apply to the table. - * @param byColumns the columns to group by before applying. - * @return a table with the same rowSet, with the specified operations applied to each group defined by the - * {@code byColumns} - */ - @ConcurrentMethod - Table updateBy(@NotNull Collection operations, - @NotNull Collection byColumns); - - /** - * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The - * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding - * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results - * for the row group (as determined by the {@code byColumns}). - * - * @param control the {@link UpdateByControl control} to use when updating the table. - * @param operations the operations to apply to the table. - * @param byColumns the columns to group by before applying. - * @return a table with the same rowSet, with the specified operations applied to each group defined by the - * {@code byColumns} - */ - @ConcurrentMethod - Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations, - @NotNull final Collection byColumns); - // ----------------------------------------------------------------------------------------------------------------- // Sort Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - @ConcurrentMethod - Table sort(String... columnsToSortBy); - - @Override - @ConcurrentMethod - Table sortDescending(String... columnsToSortBy); - - @Override - @ConcurrentMethod - Table sort(Collection columnsToSortBy); - - @Override - @ConcurrentMethod - Table reverse(); - /** *

    * Disallow sorting on all but the specified columns. @@ -1913,21 +1084,12 @@ Table updateBy(@NotNull final UpdateByControl control, // Snapshot Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - Table snapshot(Table baseTable, boolean doInitialSnapshot, String... stampColumns); - - @Override - Table snapshot(Table baseTable, String... stampColumns); - Table snapshotIncremental(Table rightTable, boolean doInitialSnapshot, String... stampColumns); Table snapshotIncremental(Table rightTable, String... stampColumns); Table snapshotHistory(Table rightTable); - @Override - Table snapshot(Table baseTable, boolean doInitialSnapshot, Collection stampColumns); - // ----------------------------------------------------------------------------------------------------------------- // Merge Operations // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibrary.java b/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibrary.java deleted file mode 100644 index 6d34eef967f..00000000000 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibrary.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.lang; - -import com.github.f4b6a3.uuid.UuidCreator; -import io.deephaven.util.annotations.VisibleForTesting; - -import java.util.*; -import java.util.concurrent.ConcurrentSkipListMap; - -public class QueryLibrary { - - private static final QueryLibraryImports IMPORTS_INSTANCE = QueryLibraryImports.copyFromServiceLoader(); - - private final Map packageImports; - private final Map> classImports; - private final Map> staticImports; - private String versionString; - - private QueryLibrary(QueryLibraryImports imports) { - packageImports = new ConcurrentSkipListMap<>(); - for (Package p : imports.packages()) { - packageImports.put(p.getName(), p); - } - classImports = new ConcurrentSkipListMap<>(); - for (Class c : imports.classes()) { - classImports.put(c.getCanonicalName(), c); - } - staticImports = new ConcurrentSkipListMap<>(); - for (Class c : imports.statics()) { - staticImports.put(c.getCanonicalName(), c); - } - updateVersionString(); - } - - private static volatile QueryLibrary defaultLibrary = null; - private final static ThreadLocal currLibrary = - ThreadLocal.withInitial(QueryLibrary::getDefaultLibrary); - - private static QueryLibrary getDefaultLibrary() { - if (defaultLibrary == null) { - synchronized (QueryLibrary.class) { - if (defaultLibrary == null) { - defaultLibrary = makeNewLibrary(); - } - } - } - return defaultLibrary; - } - - /** - * Sets the default library. - * - * @param library the script session's query library - * @throws IllegalStateException if default library is already set - * @throws NullPointerException if library is null - */ - public static synchronized void setDefaultLibrary(final QueryLibrary library) { - if (defaultLibrary != null) { - throw new IllegalStateException( - "It's too late to set default library; it's already set to: " + defaultLibrary); - } - defaultLibrary = Objects.requireNonNull(library); - } - - public void updateVersionString() { - versionString = UuidCreator.toString(UuidCreator.getRandomBased()); - } - - public static QueryLibrary makeNewLibrary() { - return new QueryLibrary(IMPORTS_INSTANCE); - } - - @VisibleForTesting - public static QueryLibrary makeNewLibrary(String libraryVersion) { - final QueryLibrary ql = new QueryLibrary(IMPORTS_INSTANCE); - ql.versionString = libraryVersion; - return ql; - } - - public static void resetLibrary() { - setLibrary(makeNewLibrary()); - } - - public static void setLibrary(QueryLibrary library) { - currLibrary.set(library); - } - - public static QueryLibrary getLibrary() { - return currLibrary.get(); - } - - public static void importPackage(Package aPackage) { - // Any dynamically-added package, class, or static import may alter the meaning of the Java code - // we are compiling. So when this happens, we dynamically generate a new globally-unique version string. - final QueryLibrary lql = currLibrary.get(); - final Package previous = lql.packageImports.put(aPackage.getName(), aPackage); - if (aPackage != previous) { - lql.updateVersionString(); - } - } - - public static void importClass(Class aClass) { - // Any dynamically-added package, class, or static import may alter the meaning of the Java code - // we are compiling. So when this happens, we dynamically generate a new globally-unique version string. - final QueryLibrary lql = currLibrary.get(); - final Class previous = lql.classImports.put(aClass.getCanonicalName(), aClass); - if (aClass != previous) { - lql.updateVersionString(); - } - } - - public static void importStatic(Class aClass) { - // Any dynamically-added package, class, or static import may alter the meaning of the Java code - // we are compiling. So when this happens, we dynamically generate a new globally-unique version string. - final QueryLibrary lql = currLibrary.get(); - final Class previous = lql.staticImports.put(aClass.getCanonicalName(), aClass); - if (aClass != previous) { - lql.updateVersionString(); - } - } - - public static Collection getImportStrings() { - final List imports = new ArrayList<>(); - final QueryLibrary lql = currLibrary.get(); - imports.add("// QueryLibrary internal version number: " + lql.versionString); - for (final Package packageImport : lql.packageImports.values()) { - imports.add("import " + packageImport.getName() + ".*;"); - } - for (final Class classImport : lql.classImports.values()) { - if (classImport.getDeclaringClass() != null) { - imports.add("import static " + classImport.getCanonicalName() + ";"); - } else if (!lql.packageImports.containsKey(classImport.getPackage().getName())) { - imports.add("import " + classImport.getName() + ";"); - } - } - for (final Class staticImport : lql.staticImports.values()) { - imports.add("import static " + staticImport.getCanonicalName() + ".*;"); - } - return imports; - } - - public static Collection getPackageImports() { - return Collections.unmodifiableCollection(currLibrary.get().packageImports.values()); - } - - public static Collection> getClassImports() { - return Collections.unmodifiableCollection(currLibrary.get().classImports.values()); - } - - public static Collection> getStaticImports() { - return Collections.unmodifiableCollection(currLibrary.get().staticImports.values()); - } -} diff --git a/engine/api/src/test/java/io/deephaven/engine/table/lang/QueryLibraryTest.java b/engine/api/src/test/java/io/deephaven/engine/table/lang/QueryLibraryTest.java deleted file mode 100644 index fce3518334f..00000000000 --- a/engine/api/src/test/java/io/deephaven/engine/table/lang/QueryLibraryTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.lang; - -import junit.framework.TestCase; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedDeque; - -public class QueryLibraryTest { - @Before - public void setUp() throws Exception { - QueryLibrary.resetLibrary(); - } - - @After - public void tearDown() throws Exception { - QueryLibrary.resetLibrary(); - } - - @Test - public void testImportClass() { - TestCase.assertFalse( - QueryLibrary.getImportStrings().contains("import java.util.concurrent.ConcurrentLinkedDeque;")); - QueryLibrary.importClass(ConcurrentLinkedDeque.class); - TestCase.assertTrue( - QueryLibrary.getImportStrings().contains("import java.util.concurrent.ConcurrentLinkedDeque;")); - } - - @Test - public void testPackageClass() { - TestCase.assertFalse(QueryLibrary.getImportStrings().contains("import java.util.concurrent.*;")); - QueryLibrary.importPackage(Package.getPackage("java.util.concurrent")); - TestCase.assertTrue(QueryLibrary.getImportStrings().contains("import java.util.concurrent.*;")); - } - - @Test - public void testImportStatic() { - TestCase.assertFalse( - QueryLibrary.getImportStrings().contains("import static java.util.concurrent.ConcurrentHashMap.*;")); - QueryLibrary.importStatic(ConcurrentHashMap.class); - TestCase.assertTrue( - QueryLibrary.getImportStrings().contains("import static java.util.concurrent.ConcurrentHashMap.*;")); - } -} diff --git a/engine/context/build.gradle b/engine/context/build.gradle new file mode 100644 index 00000000000..d6716f5eec2 --- /dev/null +++ b/engine/context/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + +description 'Engine Context: QueryScope, QueryLibrary and CompilerTools via ExecutionContext' + +configurations { + testCompile.extendsFrom junit +} + +dependencies { + implementation project(':Configuration') + implementation project(':DataStructures') + implementation project(':log-factory') + implementation project(':Util') + implementation project(':engine-time') + implementation project(':table-api') + implementation project(':IO') + + implementation 'com.github.f4b6a3:uuid-creator:3.6.0' + + Classpaths.inheritCommonsText(project, 'implementation') + + testImplementation TestTools.projectDependency(project, 'Base') + + testRuntimeOnly project(':log-to-slf4j'), + project(path: ':configs'), + project(path: ':test-configs') + Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') +} diff --git a/CompilerTools/gradle.properties b/engine/context/gradle.properties similarity index 100% rename from CompilerTools/gradle.properties rename to engine/context/gradle.properties diff --git a/CompilerTools/src/main/java/io/deephaven/compilertools/CompilerTools.java b/engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java similarity index 83% rename from CompilerTools/src/main/java/io/deephaven/compilertools/CompilerTools.java rename to engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java index b93a23ba893..919dacc8588 100644 --- a/CompilerTools/src/main/java/io/deephaven/compilertools/CompilerTools.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java @@ -1,8 +1,9 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.compilertools; +package io.deephaven.engine.context; +import io.deephaven.UncheckedDeephavenException; import io.deephaven.base.FileUtils; import io.deephaven.base.Pair; import io.deephaven.configuration.Configuration; @@ -15,7 +16,6 @@ import javax.tools.*; import java.io.*; -import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.net.MalformedURLException; import java.net.URI; @@ -30,8 +30,9 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.function.Function; import java.util.function.Supplier; import java.util.jar.Attributes; import java.util.jar.Manifest; @@ -146,12 +147,68 @@ public static void writeClass(final File destinationDirectory, final String clas public static final String FORMULA_PREFIX = "io.deephaven.temp"; public static final String DYNAMIC_GROOVY_CLASS_PREFIX = "io.deephaven.dynamic"; - public static class Context { - private final Hashtable>> knownClasses = new Hashtable<>(); + public interface Context { + Map>> getKnownClasses(); + + ClassLoader getClassLoaderForFormula(Map> parameterClasses); + + File getClassDestination(); + + File getFakeClassDestination(); + + String getClassPath(); + + void setParentClassLoader(ClassLoader parentClassLoader); + } + + public static Context newContext(File cacheDirectory, ClassLoader classLoader) { + return new CompilerTools.ContextImpl(cacheDirectory, classLoader, true); + } + + private static class ContextImpl implements Context { + private final Map>> knownClasses = new HashMap<>(); String[] dynamicPatterns = new String[] {DYNAMIC_GROOVY_CLASS_PREFIX, FORMULA_PREFIX}; - private ClassLoader getClassLoaderForFormula(final Map> parameterClasses) { + private final File classDestination; + private final boolean isCacheDirectory; + private final Set additionalClassLocations; + private volatile WritableURLClassLoader ucl; + + private ContextImpl(File classDestination) { + this(classDestination, Context.class.getClassLoader(), false); + } + + private ContextImpl(File classDestination, ClassLoader parentClassLoader, boolean isCacheDirectory) { + this.classDestination = classDestination; + this.isCacheDirectory = isCacheDirectory; + ensureDirectories(this.classDestination, () -> "Failed to create missing class destination directory " + + classDestination.getAbsolutePath()); + additionalClassLocations = new LinkedHashSet<>(); + + URL[] urls = new URL[1]; + try { + urls[0] = (classDestination.toURI().toURL()); + } catch (MalformedURLException e) { + throw new RuntimeException("", e); + } + // We should be able to create this class loader, even if this is invoked from external code + // that does not have sufficient security permissions. + this.ucl = doPrivileged((PrivilegedAction) () -> new WritableURLClassLoader(urls, + parentClassLoader)); + + if (isCacheDirectory) { + addClassSource(classDestination); + } + } + + @Override + public Map>> getKnownClasses() { + return knownClasses; + } + + @Override + public ClassLoader getClassLoaderForFormula(final Map> parameterClasses) { // We should always be able to get our own class loader, even if this is invoked from external code // that doesn't have security permissions to make ITS own class loader. return doPrivileged((PrivilegedAction) () -> new URLClassLoader(ucl.getURLs(), ucl) { @@ -272,32 +329,6 @@ public synchronized void addURL(URL url) { } } - private final File classDestination; - private final Set additionalClassLocations; - private volatile WritableURLClassLoader ucl; - - public Context(File classDestination) { - this(classDestination, Context.class.getClassLoader()); - } - - public Context(File classDestination, ClassLoader parentClassLoader) { - this.classDestination = classDestination; - ensureDirectories(this.classDestination, () -> "Failed to create missing class destination directory " + - classDestination.getAbsolutePath()); - additionalClassLocations = new LinkedHashSet<>(); - - URL[] urls = new URL[1]; - try { - urls[0] = (classDestination.toURI().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException("", e); - } - // We should be able to create this class loader, even if this is invoked from external code - // that does not have sufficient security permissions. - this.ucl = doPrivileged((PrivilegedAction) () -> new WritableURLClassLoader(urls, - parentClassLoader)); - } - protected void addClassSource(File classSourceDirectory) { synchronized (additionalClassLocations) { if (additionalClassLocations.contains(classSourceDirectory)) { @@ -319,10 +350,11 @@ public File getFakeClassDestination() { // We don't want the regular runtime class loader to find them, because then they get "stuck" in there // even if the class itself changes, and we can't forget it. So instead we use a single-use class loader // for each formula, that will always read the class from disk. - return null; + return isCacheDirectory ? classDestination : null; } - private File getClassDestination() { + @Override + public File getClassDestination() { return classDestination; } @@ -354,63 +386,13 @@ public void cleanup() { } } - private static volatile Context defaultContext = null; - - private static Context getDefaultContext() { - if (defaultContext == null) { - synchronized (CompilerTools.class) { - if (defaultContext == null) { - defaultContext = new Context(new File(Configuration.getInstance().getWorkspacePath() + - File.separator + "cache" + File.separator + "classes")); - } - } - } - return defaultContext; - } - - /** - * Sets the default context. - * - * @param context the script session's compiler context - * @throws IllegalStateException if default context is already set - * @throws NullPointerException if context is null - */ - public static synchronized void setDefaultContext(final Context context) { - if (defaultContext != null) { - throw new IllegalStateException( - "It's too late to set default context; it's already set to: " + defaultContext); - } - defaultContext = Objects.requireNonNull(context); - } - - private static final ThreadLocal currContext = ThreadLocal.withInitial(CompilerTools::getDefaultContext); - - public static void resetContext() { - setContext(new Context(new File(Configuration.getInstance().getWorkspacePath() + File.separator + "cache" - + File.separator + "classes"))); - } - - public static void setContext(@Nullable Context context) { - if (context == null) { - currContext.remove(); - } else { - currContext.set(context); - } + static Context createContextForUnitTests() { + return new ContextImpl(new File(Configuration.getInstance().getWorkspacePath() + + File.separator + "cache" + File.separator + "classes")); } public static Context getContext() { - return currContext.get(); - } - - public static RETURN_TYPE doWithContext(@NotNull final Context context, - @NotNull final Supplier action) { - final Context originalContext = getContext(); - try { - setContext(context); - return action.get(); - } finally { - setContext(originalContext); - } + return ExecutionContext.getContext().getCompilerContext(); } private static boolean logEnabled = Configuration.getInstance().getBoolean("CompilerTools.logEnabledDefault"); @@ -443,32 +425,36 @@ public static Class compile(@NotNull final String className, @NotNull final String packageNameRoot, @Nullable final StringBuilder codeLog, @NotNull final Map> parameterClasses) { - SimplePromise> promise; + CompletableFuture> promise; final boolean promiseAlreadyMade; final Context context = getContext(); synchronized (context) { - promise = context.knownClasses.get(classBody); + promise = context.getKnownClasses().get(classBody); if (promise != null) { promiseAlreadyMade = true; } else { - promise = new SimplePromise<>(); - context.knownClasses.put(classBody, promise); + promise = new CompletableFuture<>(); + context.getKnownClasses().put(classBody, promise); promiseAlreadyMade = false; } } // Someone else has already made the promise. I'll just wait for the answer. if (promiseAlreadyMade) { - return promise.getResult(); + try { + return promise.get(); + } catch (InterruptedException | ExecutionException error) { + throw new UncheckedDeephavenException(error); + } } // It's my job to fulfill the promise try { return compileHelper(className, classBody, packageNameRoot, codeLog, parameterClasses, context); } catch (RuntimeException e) { - promise.setException(e); + promise.completeExceptionally(e); throw e; } } @@ -538,18 +524,18 @@ private static Class compileHelper(@NotNull final String className, // member of the class we just loaded. This should be easier on the garbage collector because we are // replacing a calculated value with a classloaded value and so in effect we are "canonicalizing" the // string. This is important because these long strings stay in knownClasses forever. - SimplePromise> p = context.knownClasses.remove(identifyingFieldValue); + CompletableFuture> p = context.getKnownClasses().remove(identifyingFieldValue); if (p == null) { // If we encountered a different class than the one we're looking for, make a fresh promise and // immediately fulfill it. This is for the purpose of populating the cache in case someone comes // looking for that class later. Rationale: we already did all the classloading work; no point in // throwing it away now, even though this is not the class we're looking for. - p = new SimplePromise<>(); + p = new CompletableFuture<>(); } - context.knownClasses.put(identifyingFieldValue, p); + context.getKnownClasses().put(identifyingFieldValue, p); // It's also possible that some other code has already fulfilled this promise with exactly the same // class. That's ok though: the promise code does not reject multiple sets to the identical value. - p.setResultFriendly(result); + p.complete(result); } // If the class we found was indeed the class we were looking for, then return it @@ -865,7 +851,7 @@ public static Pair tryCompile(File basePath, Collection j /** * Retrieve the java class path from our existing Java class path, and IntelliJ/TeamCity environment variables. - * + * * @return */ public static String getJavaClassPath() { @@ -936,101 +922,4 @@ public static String getJavaClassPath() { } return javaClasspath; } - - private static class SimplePromise { - private R result; - private RuntimeException exception; - - public synchronized R getResult() { - while (true) { - if (result != null) { - return result; - } - if (exception != null) { - throw exception; - } - try { - wait(); - } catch (InterruptedException ie) { - throw new IllegalStateException("Interrupted while waiting", ie); - } - } - } - - public synchronized void setResultFriendly(R newResult) { - if (newResult == null) { - throw new IllegalStateException("null result not allowed"); - } - // We are "friendly" in the sense that we don't reject multiple sets to the same value. - if (result == newResult) { - return; - } - checkState(); - result = newResult; - notifyAll(); - } - - public synchronized void setException(RuntimeException newException) { - if (newException == null) { - throw new IllegalStateException("null exception not allowed"); - } - checkState(); - exception = newException; - notifyAll(); - } - - private void checkState() { - if (result != null || exception != null) { - throw new IllegalStateException("State is already set"); - } - } - } - - public static void main(String[] args) { - final String sillyFuncFormat = String.join("\n", - " public int sillyFunc%d() {", - " final String temp0 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp1 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp2 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp3 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp4 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp5 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp6 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp7 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp8 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " final String temp9 = \"ᵈᵉᵉᵖʰᵃᵛᵉⁿ__½¼⅒___\uD83D\uDC96___0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\";", - " return temp0.length() + temp1.length() + temp2.length() + temp3.length() + temp4.length() + temp5.length() + temp6.length() + temp7.length() + temp8.length() + temp9.length();", - " }"); - - final StringBuilder sb = new StringBuilder(); - sb.append(String.join("\n", - "public class $CLASSNAME$ implements java.util.function.Function {", - " private final int n;", - " public $CLASSNAME$(int n) {", - " this.n = n;", - " }", - " public Integer apply(Integer v) {", - " return n + v;", - " }")); - for (int ii = 0; ii < 100; ++ii) { - sb.append("\n"); - sb.append(String.format(sillyFuncFormat, ii)); - } - sb.append("\n}"); - final String programText = sb.toString(); - System.out.println(programText); - - StringBuilder codeLog = new StringBuilder(); - try { - final Class clazz = compile("Test", programText, "com.deephaven.test", codeLog, Collections.emptyMap()); - final Constructor constructor = clazz.getConstructor(int.class); - Function obj = (Function) constructor.newInstance(17); - final int result = obj.apply(5); - if (result != 22) { - throw new Exception(String.format("Expected 22, got %d", result)); - } - } catch (Exception e) { - System.out.printf("sad: %s%n", e); - } - } } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/EmptyQueryScope.java b/engine/context/src/main/java/io/deephaven/engine/context/EmptyQueryScope.java new file mode 100644 index 00000000000..f382e9b7d5f --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/EmptyQueryScope.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import java.util.Collections; +import java.util.Set; + +public class EmptyQueryScope extends QueryScope { + public final static EmptyQueryScope INSTANCE = new EmptyQueryScope(); + + private EmptyQueryScope() {} + + @Override + public Set getParamNames() { + return Collections.emptySet(); + } + + @Override + public boolean hasParamName(String name) { + return false; + } + + @Override + protected QueryScopeParam createParam(String name) throws MissingVariableException { + throw new MissingVariableException("Missing variable " + name); + } + + @Override + public T readParamValue(String name) throws MissingVariableException { + throw new MissingVariableException("Missing variable " + name); + } + + @Override + public T readParamValue(String name, T defaultValue) { + return defaultValue; + } + + @Override + public void putParam(String name, T value) { + throw new IllegalStateException("EmptyQueryScope cannot create parameters"); + } + + @Override + public void putObjectFields(Object object) { + throw new IllegalStateException("EmptyQueryScope cannot create parameters"); + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java new file mode 100644 index 00000000000..f2122dfc4da --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import io.deephaven.util.SafeCloseable; +import io.deephaven.util.annotations.ScriptApi; +import io.deephaven.util.annotations.VisibleForTesting; + +import java.util.Arrays; +import java.util.function.Supplier; + +public class ExecutionContext { + + public static final ExecutionContext[] ZERO_LENGTH_EXECUTION_CONTEXT_ARRAY = new ExecutionContext[0]; + + public static Builder newBuilder() { + return new Builder(); + } + + public static ExecutionContext makeSystemicExecutionContext() { + final ExecutionContext context = getContext(); + if (context.isSystemic) { + return context; + } + return ExecutionContext.newBuilder() + .captureQueryScope() + .captureQueryLibrary() + .captureCompilerContext() + .markSystemic() + .build(); + } + + @VisibleForTesting + public static ExecutionContext createForUnitTests() { + return newBuilder() + .markSystemic() + .newQueryScope() + .newQueryLibrary() + .setCompilerContext(CompilerTools.createContextForUnitTests()) + .build(); + } + + // ----------------------------------------------------------------------------------------------------------------- + // ThreadLocal Management + // ----------------------------------------------------------------------------------------------------------------- + + private static volatile ExecutionContext defaultContext = null; + + private static ExecutionContext getDefaultContext() { + ExecutionContext localContext; + if ((localContext = defaultContext) == null) { + synchronized (ExecutionContext.class) { + if ((localContext = defaultContext) == null) { + localContext = defaultContext = newBuilder().markSystemic().build(); + } + } + } + return localContext; + } + + private static final ThreadLocal currentContext = + ThreadLocal.withInitial(ExecutionContext::getDefaultContext); + + /** + * @return an object representing the current execution context or null if the current context is systemic + */ + public static ExecutionContext getContextToRecord() { + final ExecutionContext ctxt = currentContext.get(); + if (ctxt.isSystemic) { + return null; + } + return ctxt; + } + + /** + * @return an object representing the current execution context + */ + public static ExecutionContext getContext() { + return currentContext.get(); + } + + /** + * Installs the executionContext to be used for the current thread. + */ + static void setContext(final ExecutionContext context) { + currentContext.set(context); + } + + // ----------------------------------------------------------------------------------------------------------------- + // ExecutionContext Implementation + // ----------------------------------------------------------------------------------------------------------------- + + /** True if this execution context is supplied by the system and not the user. */ + private final boolean isSystemic; + + private final QueryLibrary queryLibrary; + private final QueryScope queryScope; + private final CompilerTools.Context compilerContext; + + private ExecutionContext( + final boolean isSystemic, + final QueryLibrary queryLibrary, + final QueryScope queryScope, + final CompilerTools.Context compilerContext) { + this.isSystemic = isSystemic; + this.queryLibrary = queryLibrary; + this.queryScope = queryScope; + this.compilerContext = compilerContext; + } + + /** + * Execute runnable within this execution context. + */ + public void apply(Runnable runnable) { + apply(() -> { + runnable.run(); + return null; + }); + } + + /** + * Executes supplier within this execution context. + */ + public T apply(Supplier supplier) { + try (SafeCloseable ignored = open()) { + // actually evaluate the script + return supplier.get(); + } + } + + /** + * Installs the executionContext and returns a function that will restore the original executionContext. + * + * @return a closeable to cleanup the execution context + */ + public SafeCloseable open() { + // save the current context + final ExecutionContext oldExecutionContext = currentContext.get(); + + ExecutionContext.setContext(this); + + return () -> { + // restore the old context + ExecutionContext.setContext(oldExecutionContext); + }; + } + + public QueryLibrary getQueryLibrary() { + return queryLibrary; + } + + public QueryScope getQueryScope() { + return queryScope; + } + + public CompilerTools.Context getCompilerContext() { + return compilerContext; + } + + @SuppressWarnings("unused") + public static class Builder { + private boolean isSystemic = false; + + private QueryLibrary queryLibrary = PoisonedQueryLibrary.INSTANCE; + private QueryScope queryScope = PoisonedQueryScope.INSTANCE; + private CompilerTools.Context compilerContext = PoisonedCompilerToolsContext.INSTANCE; + + /** + * A systemic execution context is one that is supplied by the system and not the user. A systemic context will + * not be recorded when work is deferred. + */ + @ScriptApi + public Builder markSystemic() { + isSystemic = true; + return this; + } + + /** + * Instantiate an empty query library. + */ + @ScriptApi + public Builder newQueryLibrary() { + queryLibrary = QueryLibrary.makeNewLibrary(); + return this; + } + + /** + * Instantiate an empty query library using the provided libraryVersion. This is useful for testing. + */ + @ScriptApi + public Builder newQueryLibrary(String libraryVersion) { + queryLibrary = QueryLibrary.makeNewLibrary(libraryVersion); + return this; + } + + /** + * Use the provided QueryLibrary. + */ + @ScriptApi + public Builder setQueryLibrary(final QueryLibrary queryLibrary) { + this.queryLibrary = queryLibrary; + return this; + } + + /** + * Use the current ExecutionContext's QueryLibrary instance. + */ + @ScriptApi + public Builder captureQueryLibrary() { + queryLibrary = currentContext.get().getQueryLibrary(); + return this; + } + + /** + * Use the provided CompilerTools.Context. + */ + @ScriptApi + public Builder setCompilerContext(final CompilerTools.Context compilerContext) { + this.compilerContext = compilerContext; + return this; + } + + /** + * Use the current ExecutionContext's CompilerTools.Context instance. + */ + @ScriptApi + public Builder captureCompilerContext() { + compilerContext = currentContext.get().getCompilerContext(); + return this; + } + + /** + * Use a query scope that is immutably empty. + */ + @ScriptApi + public Builder emptyQueryScope() { + this.queryScope = EmptyQueryScope.INSTANCE; + return this; + } + + /** + * Instantiate a new query scope. + */ + @ScriptApi + public Builder newQueryScope() { + this.queryScope = new QueryScope.StandaloneImpl(); + return this; + } + + /** + * Use the provided QueryScope. + */ + @ScriptApi + public Builder setQueryScope(final QueryScope queryScope) { + this.queryScope = queryScope; + return this; + } + + /** + * Use the current ExecutionContext's QueryScope instance. + *

    + * + * @apiNote This captures a reference to the current, likely mutable, query scope state. Future changes to the + * query scope may cause deferred operations to fail. Additionally, there is risk of GC leakage should + * the query scope be otherwise unreachable. + */ + @ScriptApi + public Builder captureQueryScope() { + this.queryScope = currentContext.get().getQueryScope(); + return this; + } + + /** + * Instantiate a new QueryScope and initialize with values from the current ExecutionContext. + * + * @param vars the variable names to copy from the current ExecutionContext's QueryScope + */ + @ScriptApi + public Builder captureQueryScopeVars(String... vars) { + if (vars.length == 0) { + return newQueryScope(); + } + + this.queryScope = new QueryScope.StandaloneImpl(); + + final QueryScopeParam[] params = getContext().getQueryScope().getParams(Arrays.asList(vars)); + for (final QueryScopeParam param : params) { + this.queryScope.putParam(param.getName(), param.getValue()); + } + + return this; + } + + /** + * @return the newly instantiated ExecutionContext + */ + @ScriptApi + public ExecutionContext build() { + return new ExecutionContext(isSystemic, queryLibrary, queryScope, compilerContext); + } + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java new file mode 100644 index 00000000000..fb3c094bf63 --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.deephaven.util.NoExecutionContextRegisteredException; + +import java.io.File; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class PoisonedCompilerToolsContext implements CompilerTools.Context { + private static final Logger logger = LoggerFactory.getLogger(PoisonedCompilerToolsContext.class); + public static final PoisonedCompilerToolsContext INSTANCE = new PoisonedCompilerToolsContext(); + + private PoisonedCompilerToolsContext() {} + + private T fail() { + logger.error().append("No ExecutionContext provided; cannot use CompilerTools").endl(); + throw new NoExecutionContextRegisteredException(); + } + + @Override + public Map>> getKnownClasses() { + return fail(); + } + + @Override + public ClassLoader getClassLoaderForFormula(Map> parameterClasses) { + return fail(); + } + + @Override + public File getClassDestination() { + return fail(); + } + + @Override + public String getClassPath() { + return fail(); + } + + @Override + public File getFakeClassDestination() { + return fail(); + } + + @Override + public void setParentClassLoader(ClassLoader parentClassLoader) { + fail(); + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java new file mode 100644 index 00000000000..4040a6e04a9 --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java @@ -0,0 +1,59 @@ +package io.deephaven.engine.context; + +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.deephaven.util.NoExecutionContextRegisteredException; + +import java.util.Collection; + +public class PoisonedQueryLibrary extends QueryLibrary { + private static final Logger logger = LoggerFactory.getLogger(PoisonedQueryScope.class); + public static final PoisonedQueryLibrary INSTANCE = new PoisonedQueryLibrary(); + + private PoisonedQueryLibrary() {} + + private T fail() { + logger.error().append("No ExecutionContext provided; cannot use QueryLibrary").endl(); + throw new NoExecutionContextRegisteredException(); + } + + @Override + public void updateVersionString() { + fail(); + } + + @Override + public Collection getImportStrings() { + return fail(); + } + + @Override + public Collection getPackageImports() { + return fail(); + } + + @Override + public Collection> getClassImports() { + return fail(); + } + + @Override + public Collection> getStaticImports() { + return fail(); + } + + @Override + public void importPackage(Package aPackage) { + fail(); + } + + @Override + public void importClass(Class aClass) { + fail(); + } + + @Override + public void importStatic(Class aClass) { + fail(); + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java new file mode 100644 index 00000000000..309dc154577 --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.deephaven.util.NoExecutionContextRegisteredException; + +import java.util.Set; + +public class PoisonedQueryScope extends QueryScope { + private static final Logger logger = LoggerFactory.getLogger(PoisonedQueryScope.class); + public static final PoisonedQueryScope INSTANCE = new PoisonedQueryScope(); + + private PoisonedQueryScope() {} + + private T fail() { + logger.error().append("No ExecutionContext provided; cannot use QueryScope").endl(); + throw new NoExecutionContextRegisteredException(); + } + + @Override + public Set getParamNames() { + return fail(); + } + + @Override + public boolean hasParamName(String name) { + return fail(); + } + + @Override + protected QueryScopeParam createParam(String name) throws MissingVariableException { + return fail(); + } + + @Override + public T readParamValue(String name) throws MissingVariableException { + return fail(); + } + + @Override + public T readParamValue(String name, T defaultValue) { + return fail(); + } + + @Override + public void putParam(String name, T value) { + fail(); + } + + @Override + public void putObjectFields(Object object) { + fail(); + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java new file mode 100644 index 00000000000..724cd0011e0 --- /dev/null +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import com.github.f4b6a3.uuid.UuidCreator; + +import java.util.*; +import java.util.concurrent.ConcurrentSkipListMap; + +public class QueryLibrary { + private static final QueryLibraryImports IMPORTS_INSTANCE = QueryLibraryImports.copyFromServiceLoader(); + + static QueryLibrary makeNewLibrary() { + return new QueryLibrary(IMPORTS_INSTANCE); + } + + static QueryLibrary makeNewLibrary(String libraryVersion) { + final QueryLibrary ql = makeNewLibrary(); + ql.versionString = libraryVersion; + return ql; + } + + // Any dynamically-added package, class, or static import may alter the meaning of the Java code + // we are compiling. So when this happens, we dynamically generate a new globally-unique version string. + private String versionString; + + private final Map packageImports; + private final Map> classImports; + private final Map> staticImports; + + /** package-private constructor for {@link io.deephaven.engine.context.PoisonedQueryLibrary} */ + QueryLibrary() { + packageImports = null; + classImports = null; + staticImports = null; + } + + private QueryLibrary(QueryLibraryImports imports) { + packageImports = new ConcurrentSkipListMap<>(); + for (Package p : imports.packages()) { + packageImports.put(p.getName(), p); + } + classImports = new ConcurrentSkipListMap<>(); + for (Class c : imports.classes()) { + classImports.put(c.getCanonicalName(), c); + } + staticImports = new ConcurrentSkipListMap<>(); + for (Class c : imports.statics()) { + staticImports.put(c.getCanonicalName(), c); + } + updateVersionString(); + } + + public Collection> getClassImports() { + return Collections.unmodifiableCollection(classImports.values()); + } + + public Collection> getStaticImports() { + return Collections.unmodifiableCollection(staticImports.values()); + } + + public Collection getPackageImports() { + return Collections.unmodifiableCollection(packageImports.values()); + } + + public void importPackage(Package aPackage) { + final Package previous = packageImports.put(aPackage.getName(), aPackage); + if (aPackage != previous) { + updateVersionString(); + } + } + + public void importClass(Class aClass) { + final Class previous = classImports.put(aClass.getName(), aClass); + if (aClass != previous) { + updateVersionString(); + } + } + + public void importStatic(Class aClass) { + final Class previous = staticImports.put(aClass.getCanonicalName(), aClass); + if (aClass != previous) { + updateVersionString(); + } + } + + public Collection getImportStrings() { + final List imports = new ArrayList<>(); + + imports.add("// QueryLibrary internal version number: " + versionString); + for (final Package packageImport : packageImports.values()) { + imports.add("import " + packageImport.getName() + ".*;"); + } + for (final Class classImport : classImports.values()) { + if (classImport.getDeclaringClass() != null) { + imports.add("import static " + classImport.getCanonicalName() + ";"); + } else if (!packageImports.containsKey(classImport.getPackage().getName())) { + imports.add("import " + classImport.getName() + ";"); + } + } + for (final Class staticImport : staticImports.values()) { + imports.add("import static " + staticImport.getCanonicalName() + ".*;"); + } + return imports; + } + + public void updateVersionString() { + versionString = UuidCreator.toString(UuidCreator.getRandomBased()); + } +} diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImports.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImports.java similarity index 95% rename from engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImports.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImports.java index 6308e7468e2..b78aa738e7f 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImports.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImports.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.lang; +package io.deephaven.engine.context; import java.util.Collections; import java.util.LinkedHashSet; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsImpl.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsImpl.java similarity index 95% rename from engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsImpl.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsImpl.java index 8e181d87187..c7b6650abfe 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsImpl.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsImpl.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.lang; +package io.deephaven.engine.context; import java.util.Objects; import java.util.Set; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsServiceLoader.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsServiceLoader.java similarity index 96% rename from engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsServiceLoader.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsServiceLoader.java index ce487437b95..15f5e191be7 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryLibraryImportsServiceLoader.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibraryImportsServiceLoader.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.lang; +package io.deephaven.engine.context; import java.util.LinkedHashSet; import java.util.ServiceLoader; diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScope.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryScope.java similarity index 79% rename from engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScope.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryScope.java index 698ea1a7145..5a5ba5f61ac 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScope.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryScope.java @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.lang; +package io.deephaven.engine.context; -import io.deephaven.base.CompareUtils; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.Period; @@ -23,62 +22,6 @@ */ public abstract class QueryScope implements LogOutputAppendable { - // ----------------------------------------------------------------------------------------------------------------- - // ThreadLocal Management - // ----------------------------------------------------------------------------------------------------------------- - - private static volatile QueryScope defaultScope = null; - private static final ThreadLocal currentScope = ThreadLocal.withInitial(QueryScope::getDefaultScope); - - private static QueryScope getDefaultScope() { - if (defaultScope == null) { - synchronized (QueryScope.class) { - if (defaultScope == null) { - defaultScope = new StandaloneImpl(); - } - } - } - return defaultScope; - } - - /** - * Sets the default scope. - * - * @param scope the script session's query scope - * @throws IllegalStateException if default scope is already set - * @throws NullPointerException if scope is null - */ - public static synchronized void setDefaultScope(final QueryScope scope) { - if (defaultScope != null) { - throw new IllegalStateException("It's too late to set default scope; it's already set to: " + defaultScope); - } - defaultScope = Objects.requireNonNull(scope); - } - - /** - * Sets the default {@link QueryScope} to be used in the current context. By default there is a - * {@link StandaloneImpl} created by the static initializer and set as the defaultInstance. The method allows the - * use of a new or separate instance as the default instance for static methods. - * - * @param queryScope {@link QueryScope} to set as the new default instance; null clears the scope. - */ - public static synchronized void setScope(final QueryScope queryScope) { - if (queryScope == null) { - currentScope.remove(); - } else { - currentScope.set(queryScope); - } - } - - /** - * Retrieve the default {@link QueryScope} instance which will be used by static methods. - * - * @return {@link QueryScope} - */ - public static QueryScope getScope() { - return currentScope.get(); - } - /** * Adds a parameter to the default instance {@link QueryScope}, or updates the value of an existing parameter. * @@ -87,7 +30,7 @@ public static QueryScope getScope() { * @param type of the parameter/value. */ public static void addParam(final String name, final T value) { - getScope().putParam(name, value); + ExecutionContext.getContext().getQueryScope().putParam(name, value); } /** @@ -96,7 +39,7 @@ public static void addParam(final String name, final T value) { * @param object object whose fields will be added. */ public static void addObjectFields(final Object object) { - getScope().putObjectFields(object); + ExecutionContext.getContext().getQueryScope().putObjectFields(object); } /** @@ -108,20 +51,13 @@ public static void addObjectFields(final Object object) { * @throws MissingVariableException variable name is not defined. */ public static T getParamValue(final String name) throws MissingVariableException { - return getScope().readParamValue(name); + return ExecutionContext.getContext().getQueryScope().readParamValue(name); } // ----------------------------------------------------------------------------------------------------------------- // Implementation // ----------------------------------------------------------------------------------------------------------------- - /** - * Parameter name for the query name. - */ - public static final String QUERY_NAME_PARAM_NAME = "__QUERY_NAME__"; - - private volatile String queryNameValue; - /** * A type of RuntimeException thrown when a variable referenced within the {@link QueryScope} is not defined or, * more likely, has not been added to the scope. @@ -143,7 +79,7 @@ private MissingVariableException(final Throwable cause) { /** * Apply conversions to certain scope variable values. - * + * * @param value value * @return value, or an appropriately converted substitute. */ @@ -218,7 +154,7 @@ public final QueryScopeParam[] getParams(final Collection names) throws /** * Get a QueryScopeParam by name. - * + * * @param name parameter name * @return newly-constructed QueryScopeParam (name + value-snapshot pair). * @throws QueryScope.MissingVariableException If any of the named scope variables does not exist. @@ -259,32 +195,6 @@ public final QueryScopeParam[] getParams(final Collection names) throws */ public abstract void putObjectFields(final Object object); - // ----------------------------------------------------------------------------------------------------------------- - // Accessors for "special" scope variables - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Gets the query name. - * - * @return query name. - */ - public final String getQueryName() { - return queryNameValue; - } - - /** - * Sets the query name. - * - * @param queryName query name. - */ - public void setQueryName(String queryName) { - if (CompareUtils.equals(queryName, queryNameValue)) { - return; - } - putParam(QUERY_NAME_PARAM_NAME, queryName); - queryNameValue = queryName; - } - // ----------------------------------------------------------------------------------------------------------------- // LogOutputAppendable implementation // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScopeParam.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryScopeParam.java similarity index 92% rename from engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScopeParam.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryScopeParam.java index aff9c6c72d5..55c311a526c 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/lang/QueryScopeParam.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryScopeParam.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.lang; +package io.deephaven.engine.context; public class QueryScopeParam { diff --git a/engine/context/src/test/java/io/deephaven/engine/context/QueryLibraryTest.java b/engine/context/src/test/java/io/deephaven/engine/context/QueryLibraryTest.java new file mode 100644 index 00000000000..e4494278678 --- /dev/null +++ b/engine/context/src/test/java/io/deephaven/engine/context/QueryLibraryTest.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.context; + +import io.deephaven.util.SafeCloseable; +import junit.framework.TestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedDeque; + +public class QueryLibraryTest { + private SafeCloseable executionContext; + + @Before + public void setUp() { + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @After + public void tearDown() { + executionContext.close(); + } + + @Test + public void testImportClass() { + TestCase.assertFalse( + ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import java.util.concurrent.ConcurrentLinkedDeque;")); + ExecutionContext.getContext().getQueryLibrary().importClass(ConcurrentLinkedDeque.class); + TestCase.assertTrue( + ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import java.util.concurrent.ConcurrentLinkedDeque;")); + } + + @Test + public void testPackageClass() { + TestCase.assertFalse(ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import java.util.concurrent.*;")); + ExecutionContext.getContext().getQueryLibrary().importPackage(Package.getPackage("java.util.concurrent")); + TestCase.assertTrue(ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import java.util.concurrent.*;")); + } + + @Test + public void testImportStatic() { + TestCase.assertFalse( + ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import static java.util.concurrent.ConcurrentHashMap.*;")); + ExecutionContext.getContext().getQueryLibrary().importStatic(ConcurrentHashMap.class); + TestCase.assertTrue( + ExecutionContext.getContext().getQueryLibrary().getImportStrings() + .contains("import static java.util.concurrent.ConcurrentHashMap.*;")); + } +} diff --git a/CompilerTools/src/test/java/io/deephaven/compilertools/TestCompilerTools.java b/engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java similarity index 94% rename from CompilerTools/src/test/java/io/deephaven/compilertools/TestCompilerTools.java rename to engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java index 603315ced6d..f43ac9b6d08 100644 --- a/CompilerTools/src/test/java/io/deephaven/compilertools/TestCompilerTools.java +++ b/engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java @@ -1,9 +1,12 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.compilertools; +package io.deephaven.engine.context; import io.deephaven.configuration.Configuration; +import io.deephaven.util.SafeCloseable; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import java.lang.reflect.Method; @@ -48,6 +51,18 @@ public class TestCompilerTools { CLASS_CODE = testClassCode1.toString(); } + private SafeCloseable executionContext; + + @Before + public void setUp() { + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @After + public void tearDown() { + executionContext.close(); + } + @Test public void testParallelCompile() throws Throwable { // Load Configuration to avoid all that time @@ -81,9 +96,12 @@ public void testParallelCompile() throws Throwable { final String className = "TestClass" + startTimeOffset + NUM_COMPILE_TESTS; System.out.println(printMillis(System.currentTimeMillis()) + ": starting test with class " + className); // We don't want to create the threads until the compile is mostly complete + + final ExecutionContext context = ExecutionContext.getContext(); for (int i = 0; i < NUM_THREADS; i++) { final int fi = i; // For the lambda threads[i] = new Thread(() -> { + context.open(); try { final long delay = fi == 0 ? 0 : fi * WAIT_BETWEEN_THREAD_START_MILLIS + waitStartMillis; final long startTime = System.currentTimeMillis(); diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 084816e387b..879be96a368 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -27,11 +27,11 @@ dependencies { api project(':TableLogger') api project(':engine-stringset') api project(':engine-base') + api project(':engine-context') api project(':deephaven-jpy-ext') api project(':hotspot') api project(':IO') - implementation project(':CompilerTools') implementation project(':DHProcess') implementation project(':engine-function') implementation project(':engine-tuple') diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java index cedbdfac199..19a06dfb268 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java @@ -56,7 +56,7 @@ * Base abstract class all standard table implementations. */ public abstract class BaseTable extends LivenessArtifact - implements TableWithDefaults, NotificationStepReceiver, NotificationStepSource { + implements TableDefaults, NotificationStepReceiver, NotificationStepSource { private static final long serialVersionUID = 1L; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java index e39cb49326b..a052accd486 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java @@ -3,16 +3,12 @@ */ package io.deephaven.engine.table.impl; -import io.deephaven.api.ColumnName; import io.deephaven.api.Selectable; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByOperation; -import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.base.reference.SimpleReference; import io.deephaven.base.verify.Assert; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.*; -import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.util.QueryConstants; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.liveness.LivenessReferent; @@ -45,12 +41,15 @@ public DeferredViewTable(@NotNull final TableDefinition definition, deferredDropColumns == null ? CollectionUtil.ZERO_LENGTH_STRING_ARRAY : deferredDropColumns; this.deferredViewColumns = deferredViewColumns == null ? SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY : deferredViewColumns; + final TableDefinition parentDefinition = tableReference.getDefinition(); + for (final SelectColumn sc : this.deferredViewColumns) { + sc.initDef(parentDefinition.getColumnNameMap()); + } this.deferredFilters = deferredFilters == null ? WhereFilter.ZERO_LENGTH_SELECT_FILTER_ARRAY : deferredFilters; - if (deferredFilters != null) { - for (final WhereFilter sf : deferredFilters) { - if (sf instanceof LivenessReferent) { - manage((LivenessReferent) sf); - } + for (final WhereFilter sf : this.deferredFilters) { + sf.init(parentDefinition); + if (sf instanceof LivenessReferent) { + manage((LivenessReferent) sf); } } @@ -71,7 +70,11 @@ public DeferredViewTable(@NotNull final TableDefinition definition, @Override public Table where(Collection filters) { - return getResultTableWithWhere(WhereFilter.from(filters)); + WhereFilter[] whereFilters = WhereFilter.from(filters); + for (WhereFilter filter : whereFilters) { + filter.init(definition); + } + return getResultTableWithWhere(whereFilters); } private Table getResultTableWithWhere(WhereFilter... whereFilters) { @@ -101,8 +104,7 @@ private Table getResultTableWithWhere(WhereFilter... whereFilters) { localResult = ((DeferredViewTable) localResult) .getResultTableWithWhere(tableAndRemainingFilters.remainingFilters); } else { - localResult = localResult.where(Arrays.stream(tableAndRemainingFilters.remainingFilters) - .map(WhereFilter::copy).toArray(WhereFilter[]::new)); + localResult = localResult.where(WhereFilter.copyFrom(tableAndRemainingFilters.remainingFilters)); } localResult = applyDeferredViews(localResult); @@ -124,8 +126,7 @@ private Table applyDeferredViews(Table result) { result = result.dropColumns(deferredDropColumns); } if (deferredViewColumns.length > 0) { - result = result - .view(Arrays.stream(deferredViewColumns).map(SelectColumn::copy).toArray(SelectColumn[]::new)); + result = result.view(SelectColumn.copyFrom(deferredViewColumns)); } return result; } @@ -320,7 +321,7 @@ public TableAndRemainingFilters(Table table, WhereFilter[] remainingFilters) { * @param whereFilters filters to maybe apply before returning the table * @return the instantiated table and a set of filters that were not applied. */ - public TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { + protected TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { return new TableAndRemainingFilters(get(), whereFilters); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java index 3985bcfffc3..c45a6ccd41f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java @@ -7,6 +7,7 @@ import io.deephaven.base.log.LogOutputAppendable; import io.deephaven.base.verify.Assert; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.exceptions.UncheckedTableException; import io.deephaven.engine.table.TableListener; import io.deephaven.engine.table.TableUpdate; @@ -53,6 +54,8 @@ public abstract class InstrumentedTableListenerBase extends LivenessArtifact private volatile long lastCompletedStep = NotificationStepReceiver.NULL_NOTIFICATION_STEP; private volatile long lastEnqueuedStep = NotificationStepReceiver.NULL_NOTIFICATION_STEP; + protected final ExecutionContext executionContext = ExecutionContext.getContextToRecord(); + InstrumentedTableListenerBase(@Nullable String description, boolean terminalListener) { this.entry = UpdatePerformanceTracker.getInstance().getEntry(description); this.terminalListener = terminalListener; @@ -207,6 +210,11 @@ public LogOutput append(LogOutput output) { return output.append("ErrorNotification{").append("originalException=") .append(originalException.getMessage()).append(", sourceEntry=").append(sourceEntry).append("}"); } + + @Override + public ExecutionContext getExecutionContext() { + return executionContext; + } } protected abstract class NotificationBase extends AbstractNotification implements LogOutputAppendable { @@ -252,6 +260,11 @@ public final boolean canExecute(final long step) { return InstrumentedTableListenerBase.this.canExecute(step); } + @Override + public ExecutionContext getExecutionContext() { + return executionContext; + } + void doRun(final Runnable invokeOnUpdate) { try { doRunInternal(invokeOnUpdate); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java index ae680226b71..2c5d4db79d1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java @@ -9,6 +9,7 @@ import io.deephaven.engine.table.TableListener; import io.deephaven.engine.table.impl.perf.PerformanceEntry; import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.engine.updategraph.NotificationQueue; @@ -48,6 +49,8 @@ public abstract class MergedListener extends LivenessArtifact implements Notific private Throwable upstreamError; private TableListener.Entry errorSourceEntry; + private final ExecutionContext executionContext = ExecutionContext.getContextToRecord(); + protected MergedListener( Iterable recorders, Iterable dependencies, @@ -276,5 +279,10 @@ public LogOutput append(LogOutput logOutput) { public boolean canExecute(final long step) { return MergedListener.this.canExecute(step); } + + @Override + public ExecutionContext getExecutionContext() { + return executionContext; + } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java index dbd8f606435..3c122f66620 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/PartitionAwareSourceTable.java @@ -109,7 +109,7 @@ private PartitionAwareQueryTableReference(PartitionAwareSourceTable table) { } @Override - public TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { + protected TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { ArrayList partitionFilters = new ArrayList<>(); ArrayList groupFilters = new ArrayList<>(); ArrayList otherFilters = new ArrayList<>(); @@ -119,7 +119,7 @@ public TableAndRemainingFilters getWithWhere(WhereFilter... whereFilters) { groupingColumns.stream().map(ColumnDefinition::getName).collect(Collectors.toSet()); for (WhereFilter filter : whereFilters) { - filter.init(table.definition); + // note: our filters are already initialized List columns = filter.getColumns(); if (filter instanceof ReindexingFilter) { otherFilters.add(filter); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index f0b724c28c2..50413177869 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -1218,7 +1218,7 @@ public Table update(final Collection newColumns) { * DO NOT USE -- this API is in flux and may change or disappear in the future. */ public SelectValidationResult validateSelect(final SelectColumn... selectColumns) { - final SelectColumn[] clones = Arrays.stream(selectColumns).map(SelectColumn::copy).toArray(SelectColumn[]::new); + final SelectColumn[] clones = SelectColumn.copyFrom(selectColumns); SelectAndViewAnalyzer analyzer = SelectAndViewAnalyzer.create(SelectAndViewAnalyzer.Mode.SELECT_STATIC, columns, rowSet, getModifiedColumnSetForUpdates(), true, clones); return new SelectValidationResult(analyzer, clones); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SwapListenerBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SwapListenerBase.java index 6f999115fa7..577283c1ea5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SwapListenerBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SwapListenerBase.java @@ -5,7 +5,7 @@ import io.deephaven.base.log.LogOutput; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.table.ShiftObliviousListener; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.TableListener; import io.deephaven.engine.updategraph.*; import io.deephaven.internal.log.LoggerFactory; @@ -161,7 +161,7 @@ boolean isInInitialNotificationWindow() { /** * Set the listener that will eventually become the listener, if we have a successful swap. - * + * * @param listener The listener that we will eventually forward all updates to * @param resultTable The table that will result from this operation */ @@ -223,12 +223,17 @@ public void run() { .append(System.identityHashCode(SwapListenerBase.this)) .append(", clock=") .append(LogicalClock.DEFAULT.currentStep()).endl(); - notification.run(); + notification.runInContext(); log.info().append("SwapListener: Complete notification ") .append(System.identityHashCode(sourceTable)) .append(" swap=") .append(System.identityHashCode(SwapListenerBase.this)).endl(); } + + @Override + public ExecutionContext getExecutionContext() { + return null; + } }; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java similarity index 53% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java rename to engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java index 5c25019800e..ced7a4bbb73 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableWithDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java @@ -7,19 +7,15 @@ import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; import io.deephaven.api.filter.Filter; -import io.deephaven.api.updateby.UpdateByOperation; -import io.deephaven.api.updateby.UpdateByControl; -import io.deephaven.base.Pair; -import io.deephaven.base.StringUtils; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.lang.QueryLanguageParser; import io.deephaven.engine.table.iterators.*; -import io.deephaven.engine.table.impl.select.AjMatchPairFactory; +import io.deephaven.api.expression.AsOfJoinMatchFactory; import io.deephaven.engine.table.impl.select.MatchPairFactory; import io.deephaven.engine.table.impl.select.WouldMatchPairFactory; import io.deephaven.engine.util.TableTools; -import io.deephaven.engine.updategraph.ConcurrentMethod; +import io.deephaven.api.util.ConcurrentMethod; import io.deephaven.engine.table.impl.perf.QueryPerformanceNugget; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.engine.util.ColumnFormattingValues; @@ -35,11 +31,9 @@ /** * Sub-interface to capture default methods rom {@link Table}. */ -public interface TableWithDefaults extends Table { +public interface TableDefaults extends Table, TableOperationsDefaults { Table[] ZERO_LENGTH_TABLE_ARRAY = new Table[0]; - Filter[] ZERO_LENGTH_FILTER_ARRAY = new Filter[0]; - ColumnName[] ZERO_LENGTH_COLUMNNAME_ARRAY = new ColumnName[0]; @Override default Table coalesce() { @@ -55,6 +49,7 @@ default Table coalesce() { @Override @ConcurrentMethod + @FinalDefault default Table getMeta() { List columnNames = new ArrayList<>(); List columnDataTypes = new ArrayList<>(); @@ -90,6 +85,7 @@ default int numColumns() { @Override @ConcurrentMethod + @FinalDefault default boolean hasColumns(final String... columnNames) { if (columnNames == null) { throw new IllegalArgumentException("columnNames cannot be null!"); @@ -99,6 +95,7 @@ default boolean hasColumns(final String... columnNames) { @Override @ConcurrentMethod + @FinalDefault default boolean hasColumns(Collection columnNames) { if (columnNames == null) { throw new IllegalArgumentException("columnNames cannot be null!"); @@ -112,6 +109,7 @@ default long sizeForInstrumentation() { } @Override + @FinalDefault default boolean isEmpty() { return size() == 0; } @@ -122,6 +120,7 @@ default boolean isEmpty() { @Override @ConcurrentMethod + @FinalDefault default Map getAttributes() { return getAttributes(Collections.emptySet()); } @@ -131,6 +130,7 @@ default Map getAttributes() { // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default ColumnSource getColumnSource(String sourceName, Class clazz) { @SuppressWarnings("rawtypes") ColumnSource rawColumnSource = getColumnSource(sourceName); @@ -148,6 +148,7 @@ default DataColumn[] getColumns() { } @Override + @FinalDefault default DataColumn getColumn(final int columnIndex) { return getColumn(this.getDefinition().getColumns().get(columnIndex).getName()); } @@ -177,6 +178,7 @@ default ShortColumnIterator shortColumnIterator(@NotNull final String columnName } @Override + @FinalDefault default IntegerColumnIterator integerColumnIterator(@NotNull final String columnName) { return new IntegerColumnIterator(this, columnName); } @@ -207,119 +209,75 @@ default ObjectColumnIterator objectColumnIterator(@NotNul @Override @ConcurrentMethod + @FinalDefault default Table where(Filter... filters) { return where(List.of(filters)); } @Override @ConcurrentMethod - default Table where(String... filters) { - return where(Filter.from(filters)); - } - - @Override - @ConcurrentMethod + @FinalDefault default Table wouldMatch(String... expressions) { return wouldMatch(WouldMatchPairFactory.getExpressions(expressions)); } - @Override - default Table whereIn(Table rightTable, String... columnsToMatch) { - return whereIn(rightTable, JoinMatch.from(columnsToMatch)); - } - - @Override - default Table whereNotIn(Table rightTable, String... columnsToMatch) { - return whereNotIn(rightTable, JoinMatch.from(columnsToMatch)); - } - // ----------------------------------------------------------------------------------------------------------------- // Column Selection Operations // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default Table select(Selectable... columns) { return select(List.of(columns)); } @Override - default Table select(String... columns) { - return select(Selectable.from(columns)); - } - - @Override + @FinalDefault default Table select() { return select(getDefinition().getColumnNamesArray()); } @Override @ConcurrentMethod - default Table selectDistinct(Selectable... columns) { - return selectDistinct(List.of(columns)); - } - - @Override - @ConcurrentMethod - default Table selectDistinct(String... columns) { - return selectDistinct(Selectable.from(columns)); - } - - @Override - @ConcurrentMethod + @FinalDefault default Table selectDistinct() { return selectDistinct(getDefinition().getColumnNamesArray()); } @Override + @FinalDefault default Table update(Selectable... newColumns) { return update(List.of(newColumns)); } @Override - default Table update(String... newColumns) { - return update(Selectable.from((newColumns))); - } - - @Override + @FinalDefault default Table lazyUpdate(Selectable... newColumns) { return lazyUpdate(List.of(newColumns)); } @Override - default Table lazyUpdate(String... newColumns) { - return lazyUpdate(Selectable.from((newColumns))); - } - - @Override + @FinalDefault default Table view(Selectable... columns) { return view(List.of(columns)); } @Override - @ConcurrentMethod - default Table view(String... columns) { - return view(Selectable.from(columns)); - } - - @Override + @FinalDefault default Table updateView(Selectable... newColumns) { return updateView(List.of(newColumns)); } @Override @ConcurrentMethod - default Table updateView(String... newColumns) { - return updateView(Selectable.from((newColumns))); - } - - @Override - @ConcurrentMethod + @FinalDefault default Table dropColumns(Collection columnNames) { return dropColumns(columnNames.toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY)); } @Override @ConcurrentMethod + @FinalDefault default Table dropColumnFormats() { String[] columnAry = getDefinition().getColumnStream() .map(ColumnDefinition::getName) @@ -335,16 +293,19 @@ default Table dropColumnFormats() { } @Override + @FinalDefault default Table renameColumns(Collection columns) { return renameColumns(MatchPairFactory.getExpressions(columns)); } @Override + @FinalDefault default Table renameColumns(String... columns) { return renameColumns(MatchPairFactory.getExpressions(columns)); } @Override + @FinalDefault default Table renameAllColumns(UnaryOperator renameFunction) { return renameColumns(getDefinition().getColumnStream().map(ColumnDefinition::getName) .map(n -> new MatchPair(renameFunction.apply(n), n)).toArray(MatchPair[]::new)); @@ -352,12 +313,14 @@ default Table renameAllColumns(UnaryOperator renameFunction) { @Override @ConcurrentMethod + @FinalDefault default Table formatRowWhere(String condition, String formula) { return formatColumnWhere(ColumnFormattingValues.ROW_FORMAT_NAME, condition, formula); } @Override @ConcurrentMethod + @FinalDefault default Table formatColumnWhere(String columnName, String condition, String formula) { return formatColumns( columnName + " = (" + condition + ") ? io.deephaven.engine.util.ColorUtil.toLong(" + formula @@ -366,24 +329,28 @@ default Table formatColumnWhere(String columnName, String condition, String form @Override @ConcurrentMethod + @FinalDefault default Table moveColumnsUp(String... columnsToMove) { return moveColumns(0, columnsToMove); } @Override @ConcurrentMethod + @FinalDefault default Table moveColumnsDown(String... columnsToMove) { return moveColumns(numColumns() - columnsToMove.length, true, columnsToMove); } @Override @ConcurrentMethod + @FinalDefault default Table moveColumns(int index, String... columnsToMove) { return moveColumns(index, false, columnsToMove); } @Override @ConcurrentMethod + @FinalDefault default Table dateTimeColumnAsNanos(String columnName) { return dateTimeColumnAsNanos(columnName, columnName); } @@ -393,6 +360,7 @@ default Table dateTimeColumnAsNanos(String columnName) { // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default Table exactJoin(Table rightTable, Collection columnsToMatch, Collection columnsToAdd) { return exactJoin( @@ -402,37 +370,13 @@ default Table exactJoin(Table rightTable, Collection column } @Override - default Table exactJoin(Table rightTable, String columnsToMatch, String columnsToAdd) { - return exactJoin( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd))); - } - - @Override - default Table exactJoin(Table rightTable, String columnsToMatch) { - return exactJoin( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY); - } - - - @Override + @FinalDefault default Table aj(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd) { return aj(rightTable, columnsToMatch, columnsToAdd, AsOfMatchRule.LESS_THAN_EQUAL); } @Override - default Table aj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd) { - return aj( - rightTable, - MatchPair.fromMatches(columnsToMatch), - MatchPair.fromAddition(columnsToAdd)); - } - - @Override + @FinalDefault default Table aj(Table rightTable, Collection columnsToMatch, Collection columnsToAdd, AsOfJoinRule asOfJoinRule) { return aj( @@ -443,47 +387,24 @@ default Table aj(Table rightTable, Collection columnsToMatc } @Override + @FinalDefault default Table aj(Table rightTable, Collection columnsToMatch) { - Pair expressions = AjMatchPairFactory.getExpressions(false, columnsToMatch); + AsOfJoinMatchFactory.AsOfJoinResult result = AsOfJoinMatchFactory.getAjExpressions(columnsToMatch); return aj( rightTable, - expressions.getFirst(), + MatchPair.fromMatches(List.of(result.matches)), MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY, - expressions.getSecond()); + AsOfMatchRule.of(result.rule)); } @Override - default Table aj(Table rightTable, String columnsToMatch, String columnsToAdd) { - Pair expressions = - AjMatchPairFactory.getExpressions(false, StringUtils.splitToCollection(columnsToMatch)); - return aj( - rightTable, - expressions.getFirst(), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd)), - expressions.getSecond()); - } - - @Override - default Table aj(Table rightTable, String columnsToMatch) { - return aj(rightTable, StringUtils.splitToCollection(columnsToMatch)); - } - - - @Override + @FinalDefault default Table raj(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd) { return raj(rightTable, columnsToMatch, columnsToAdd, AsOfMatchRule.GREATER_THAN_EQUAL); } @Override - default Table raj(Table rightTable, Collection columnsToMatch, - Collection columnsToAdd) { - return raj( - rightTable, - MatchPair.fromMatches(columnsToMatch), - MatchPair.fromAddition(columnsToAdd)); - } - - @Override + @FinalDefault default Table raj(Table rightTable, Collection columnsToMatch, Collection columnsToAdd, ReverseAsOfJoinRule reverseAsOfJoinRule) { return raj( @@ -494,32 +415,18 @@ default Table raj(Table rightTable, Collection columnsToMat } @Override + @FinalDefault default Table raj(Table rightTable, Collection columnsToMatch) { - Pair expressions = AjMatchPairFactory.getExpressions(true, columnsToMatch); + AsOfJoinMatchFactory.ReverseAsOfJoinResult result = AsOfJoinMatchFactory.getRajExpressions(columnsToMatch); return raj( rightTable, - expressions.getFirst(), + MatchPair.fromMatches(List.of(result.matches)), MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY, - expressions.getSecond()); - } - - @Override - default Table raj(Table rightTable, String columnsToMatch, String columnsToAdd) { - Pair expressions = - AjMatchPairFactory.getExpressions(true, StringUtils.splitToCollection(columnsToMatch)); - return raj( - rightTable, - expressions.getFirst(), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd)), - expressions.getSecond()); - } - - @Override - default Table raj(Table rightTable, String columnsToMatch) { - return raj(rightTable, StringUtils.splitToCollection(columnsToMatch)); + AsOfMatchRule.of(result.rule)); } @Override + @FinalDefault default Table naturalJoin(Table rightTable, Collection columnsToMatch, Collection columnsToAdd) { return naturalJoin( @@ -529,22 +436,7 @@ default Table naturalJoin(Table rightTable, Collection colu } @Override - default Table naturalJoin(Table rightTable, String columnsToMatch, String columnsToAdd) { - return naturalJoin( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd))); - } - - @Override - default Table naturalJoin(Table rightTable, String columnsToMatch) { - return naturalJoin( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY); - } - - @Override + @FinalDefault default Table join(Table rightTable) { return join( rightTable, @@ -553,50 +445,39 @@ default Table join(Table rightTable) { } @Override + @FinalDefault default Table join(Table rightTable, int numRightBitsToReserve) { return join(rightTable, Collections.emptyList(), Collections.emptyList(), numRightBitsToReserve); } @Override - default Table join(Table rightTable, String columnsToMatch) { - return join( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY); - } - - @Override + @FinalDefault default Table join(Table rightTable, String columnsToMatch, int numRightBitsToReserve) { return join( rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), + MatchPairFactory.getExpressions(TableOperationsDefaults.splitToCollection(columnsToMatch)), MatchPair.ZERO_LENGTH_MATCH_PAIR_ARRAY, numRightBitsToReserve); } @Override - default Table join(Table rightTable, String columnsToMatch, String columnsToAdd) { - return join( - rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd))); - } - - @Override + @FinalDefault default Table join(Table rightTable, String columnsToMatch, String columnsToAdd, int numRightBitsToReserve) { return join( rightTable, - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToMatch)), - MatchPairFactory.getExpressions(StringUtils.splitToCollection(columnsToAdd)), + MatchPairFactory.getExpressions(TableOperationsDefaults.splitToCollection(columnsToMatch)), + MatchPairFactory.getExpressions(TableOperationsDefaults.splitToCollection(columnsToAdd)), numRightBitsToReserve); } @Override + @FinalDefault default Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] columnsToAdd) { return join(rightTable, columnsToMatch, columnsToAdd, CrossJoinHelper.DEFAULT_NUM_RIGHT_BITS_TO_RESERVE); } @Override + @FinalDefault default Table join(Table rightTable, Collection columnsToMatch, Collection columnsToAdd) { return join( @@ -606,6 +487,7 @@ default Table join(Table rightTable, Collection columnsToMa } @Override + @FinalDefault default Table join(Table rightTable, Collection columnsToMatch, Collection columnsToAdd, int numRightBitsToReserve) { return join( @@ -619,98 +501,21 @@ default Table join(Table rightTable, Collection columnsToMa // Aggregation Operations // ----------------------------------------------------------------------------------------------------------------- - - @Override - @ConcurrentMethod - default Table groupBy(Collection groupByColumns) { - return aggAllBy(AggSpec.group(), groupByColumns.toArray(ColumnName[]::new)); - } - - @Override - @ConcurrentMethod - default Table groupBy(String... groupByColumns) { - return groupBy(ColumnName.from(groupByColumns)); - } - - @Override - @ConcurrentMethod - default Table groupBy() { - return groupBy(Collections.emptyList()); - } - - @Override - @ConcurrentMethod - default Table aggAllBy(AggSpec spec) { - return aggAllBy(spec, Collections.emptyList()); - } - - @Override - @ConcurrentMethod - default Table aggAllBy(AggSpec spec, String... groupByColumns) { - return aggAllBy(spec, List.of(groupByColumns)); - } - - @Override - @ConcurrentMethod - default Table aggAllBy(AggSpec spec, Collection groupByColumns) { - return aggAllBy(spec, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table aggBy(Aggregation aggregation) { - return aggBy(List.of(aggregation)); - } - - @Override - @ConcurrentMethod - default Table aggBy(Collection aggregations) { - return aggBy(aggregations, Collections.emptyList()); - } - - @Override - @ConcurrentMethod - default Table aggBy(Collection aggregations, boolean preserveEmpty) { - return aggBy(aggregations, preserveEmpty, null, Collections.emptyList()); - } - - @Override - @ConcurrentMethod - default Table aggBy(Aggregation aggregation, String... groupByColumns) { - return aggBy(List.of(aggregation), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table aggBy(Aggregation aggregation, Collection groupByColumns) { - return aggBy(List.of(aggregation), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table aggBy(Collection aggregations, String... groupByColumns) { - return aggBy(aggregations, ColumnName.from(groupByColumns)); - } - - @Override - @ConcurrentMethod - default Table aggBy(Collection aggregations, - Collection groupByColumns) { - return aggBy(aggregations, false, null, groupByColumns); - } - @Override + @FinalDefault default Table headBy(long nRows, Collection groupByColumnNames) { return headBy(nRows, groupByColumnNames.toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY)); } @Override + @FinalDefault default Table tailBy(long nRows, Collection groupByColumnNames) { return tailBy(nRows, groupByColumnNames.toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY)); } @Override @ConcurrentMethod + @FinalDefault default Table applyToAllBy(String formulaColumn, String columnParamName, Collection groupByColumns) { return aggAllBy(AggSpec.formula(formulaColumn, columnParamName), groupByColumns.toArray(ColumnName[]::new)); @@ -718,338 +523,30 @@ default Table applyToAllBy(String formulaColumn, String columnParamName, @Override @ConcurrentMethod + @FinalDefault default Table applyToAllBy(String formulaColumn, Collection groupByColumns) { return applyToAllBy(formulaColumn, "each", groupByColumns); } @Override @ConcurrentMethod + @FinalDefault default Table applyToAllBy(String formulaColumn, String... groupByColumns) { return applyToAllBy(formulaColumn, ColumnName.from(groupByColumns)); } - @Override - @ConcurrentMethod - default Table sumBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.sum(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table sumBy(String... groupByColumns) { - return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table sumBy(Collection groupByColumns) { - return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table sumBy() { - return sumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table absSumBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.absSum(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table absSumBy(String... groupByColumns) { - return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table absSumBy(Collection groupByColumns) { - return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table absSumBy() { - return absSumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table avgBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.avg(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table avgBy(String... groupByColumns) { - return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table avgBy(Collection groupByColumns) { - return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table avgBy() { - return avgBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table wavgBy(String weightColumn, ColumnName... groupByColumns) { - return aggAllBy(AggSpec.wavg(weightColumn), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table wavgBy(String weightColumn, String... groupByColumns) { - return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table wavgBy(String weightColumn, Collection groupByColumns) { - return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table wavgBy(String weightColumn) { - return wavgBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table wsumBy(String weightColumn, ColumnName... groupByColumns) { - return aggAllBy(AggSpec.wsum(weightColumn), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table wsumBy(String weightColumn) { - return wsumBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table wsumBy(String weightColumn, String... groupByColumns) { - return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table wsumBy(String weightColumn, Collection groupByColumns) { - return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table stdBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.std(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table stdBy(String... groupByColumns) { - return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table stdBy(Collection groupByColumns) { - return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table stdBy() { - return stdBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table varBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.var(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table varBy(String... groupByColumns) { - return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table varBy(Collection groupByColumns) { - return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table varBy() { - return varBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table lastBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.last(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table lastBy(String... groupByColumns) { - return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table lastBy(Collection groupByColumns) { - return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table lastBy() { - return lastBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table firstBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.first(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table firstBy(String... groupByColumns) { - return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table firstBy(Collection groupByColumns) { - return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table firstBy() { - return firstBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table minBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.min(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table minBy(String... groupByColumns) { - return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table minBy(Collection groupByColumns) { - return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table minBy() { - return minBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table maxBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.max(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table maxBy(String... groupByColumns) { - return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table maxBy(Collection groupByColumns) { - return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table maxBy() { - return maxBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table medianBy(ColumnName... groupByColumns) { - return aggAllBy(AggSpec.median(), groupByColumns); - } - - @Override - @ConcurrentMethod - default Table medianBy(String... groupByColumns) { - return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table medianBy(Collection groupByColumns) { - return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table medianBy() { - return medianBy(ZERO_LENGTH_COLUMNNAME_ARRAY); - } - - @Override - @ConcurrentMethod - default Table countBy(String countColumnName, ColumnName... groupByColumns) { - return aggBy(Aggregation.AggCount(countColumnName), Arrays.asList(groupByColumns)); - } - - @Override - @ConcurrentMethod - default Table countBy(String countColumnName, String... groupByColumns) { - return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table countBy(String countColumnName, Collection groupByColumns) { - return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); - } - - @Override - @ConcurrentMethod - default Table countBy(String countColumnName) { - return countBy(countColumnName, ZERO_LENGTH_COLUMNNAME_ARRAY); - } - // ----------------------------------------------------------------------------------------------------------------- // Disaggregation Operations // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default Table ungroup(String... columnsToUngroup) { return ungroup(false, columnsToUngroup); } @Override + @FinalDefault default Table ungroupAllBut(String... columnsNotToUngroup) { final Set columnsNotToUnwrapSet = Arrays.stream(columnsNotToUngroup).collect(Collectors.toSet()); return ungroup(getDefinition().getColumnStream() @@ -1059,6 +556,7 @@ default Table ungroupAllBut(String... columnsNotToUngroup) { } @Override + @FinalDefault default Table ungroup() { return ungroup(getDefinition().getColumnStream() .filter(c -> c.getDataType().isArray() || QueryLanguageParser.isTypedVector(c.getDataType())) @@ -1066,6 +564,7 @@ default Table ungroup() { } @Override + @FinalDefault default Table ungroup(boolean nullFill) { return ungroup(nullFill, getDefinition().getColumnStream() @@ -1079,6 +578,7 @@ default Table ungroup(boolean nullFill) { @Override @ConcurrentMethod + @FinalDefault default PartitionedTable partitionBy(String... keyColumnNames) { return partitionBy(false, keyColumnNames); } @@ -1089,12 +589,14 @@ default PartitionedTable partitionBy(String... keyColumnNames) { @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, Collection groupByColumns) { return rollup(aggregations, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, boolean includeConstituents, Collection groupByColumns) { return rollup(aggregations, includeConstituents, @@ -1103,12 +605,14 @@ default Table rollup(Collection aggregations, boolean inc @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, String... groupByColumns) { return rollup(aggregations, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); } @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, boolean includeConstituents, String... groupByColumns) { return rollup(aggregations, includeConstituents, @@ -1117,105 +621,41 @@ default Table rollup(Collection aggregations, boolean inc @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, ColumnName... groupByColumns) { return rollup(aggregations, false, groupByColumns); } @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations) { return rollup(aggregations, false, ZERO_LENGTH_COLUMNNAME_ARRAY); } @Override @ConcurrentMethod + @FinalDefault default Table rollup(Collection aggregations, boolean includeConstituents) { return rollup(aggregations, includeConstituents, ZERO_LENGTH_COLUMNNAME_ARRAY); } - - // ----------------------------------------------------------------------------------------------------------------- - // UpdateBy Operations - // ----------------------------------------------------------------------------------------------------------------- - - @ConcurrentMethod - default Table updateBy(@NotNull final UpdateByControl control, - @NotNull final Collection operations) { - return updateBy(control, operations, Collections.emptyList()); - } - - @ConcurrentMethod - default Table updateBy(@NotNull Collection operations, - @NotNull Collection byColumns) { - return updateBy(UpdateByControl.defaultInstance(), operations, byColumns); - } - - @ConcurrentMethod - default Table updateBy(@NotNull final Collection operations, - final String... byColumns) { - return updateBy(UpdateByControl.defaultInstance(), operations, ColumnName.from(byColumns)); - } - - @ConcurrentMethod - default Table updateBy(@NotNull final Collection operations) { - return updateBy(UpdateByControl.defaultInstance(), operations, Collections.emptyList()); - } - - @ConcurrentMethod - default Table updateBy(@NotNull final UpdateByOperation operation, final String... byColumns) { - return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), - ColumnName.from(byColumns)); - } - - @ConcurrentMethod - default Table updateBy(@NotNull final UpdateByOperation operation) { - return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), - Collections.emptyList()); - } - - // ----------------------------------------------------------------------------------------------------------------- - // Sort Operations - // ----------------------------------------------------------------------------------------------------------------- - - @Override - @ConcurrentMethod - default Table sort(String... columnsToSortBy) { - return sort(Arrays.stream(columnsToSortBy) - .map(ColumnName::of).map(SortColumn::asc).collect(Collectors.toList())); - } - - @Override - @ConcurrentMethod - default Table sortDescending(String... columnsToSortBy) { - return sort(Arrays.stream(columnsToSortBy) - .map(ColumnName::of).map(SortColumn::desc).collect(Collectors.toList())); - } - // ----------------------------------------------------------------------------------------------------------------- // Snapshot Operations // ----------------------------------------------------------------------------------------------------------------- @Override - default Table snapshot(Table baseTable, String... stampColumns) { - return snapshot(baseTable, true, stampColumns); - } - - @Override + @FinalDefault default Table snapshotIncremental(Table rightTable, String... stampColumns) { return snapshotIncremental(rightTable, false, stampColumns); } - @Override - default Table snapshot(Table baseTable, boolean doInitialSnapshot, Collection stampColumns) { - return snapshot(baseTable, doInitialSnapshot, - stampColumns.stream().map(ColumnName::name).toArray(String[]::new)); - } - // ----------------------------------------------------------------------------------------------------------------- // Merge Operations // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default Table mergeBefore(final Table... others) { final List

    tables = new ArrayList<>(others.length + 1); tables.add(this); @@ -1224,6 +664,7 @@ default Table mergeBefore(final Table... others) { } @Override + @FinalDefault default Table mergeAfter(final Table... others) { final List
    tables = new ArrayList<>(others.length + 1); tables.addAll(List.of(others)); @@ -1248,6 +689,7 @@ default R apply(Function function) { @Override @ConcurrentMethod + @FinalDefault default Table withColumnDescription(String column, String description) { return withColumnDescription(Collections.singletonMap(column, description)); } @@ -1257,6 +699,7 @@ default Table withColumnDescription(String column, String description) { // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default void close() { releaseCachedResources(); } @@ -1269,6 +712,7 @@ default void releaseCachedResources() {} // ----------------------------------------------------------------------------------------------------------------- @Override + @FinalDefault default void listenForUpdates(ShiftObliviousListener listener) { listenForUpdates(listener, false); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java index b98c9f15557..9269a89dc61 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java @@ -17,7 +17,7 @@ import io.deephaven.engine.rowset.TrackingRowSet; import io.deephaven.engine.table.*; import io.deephaven.engine.table.iterators.*; -import io.deephaven.engine.updategraph.ConcurrentMethod; +import io.deephaven.api.util.ConcurrentMethod; import io.deephaven.util.QueryConstants; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,7 +31,7 @@ * Abstract class for uncoalesced tables. These tables have deferred work that must be done before data can be operated * on. */ -public abstract class UncoalescedTable extends BaseTable implements TableWithDefaults { +public abstract class UncoalescedTable extends BaseTable { private final Object coalescingLock = new Object(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java index 7a92f970842..8852b623dec 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateBy.java @@ -2,8 +2,6 @@ import gnu.trove.map.hash.TObjectIntHashMap; import io.deephaven.api.ColumnName; -import io.deephaven.api.Selectable; -import io.deephaven.api.Strings; import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.chunk.Chunk; @@ -27,7 +25,7 @@ import static io.deephaven.engine.rowset.RowSequence.NULL_ROW_KEY; /** - * The core of the {@link TableWithDefaults#updateBy(UpdateByControl, Collection, Collection)} operation. + * The core of the {@link Table#updateBy(UpdateByControl, Collection, Collection)} operation. */ public abstract class UpdateBy { protected final ChunkSource.WithPrev[] inputSources; @@ -75,11 +73,11 @@ protected UpdateBy(@NotNull final UpdateByOperator[] operators, /** * Apply the specified operations to each group of rows in the source table and produce a result table with the same * index as the source with each operator applied. - * + * * @param source the source to apply to. * @param clauses the operations to apply. * @param byColumns the columns to group by before applying operations - * + * * @return a new table with the same index as the source with all the operations applied. */ public static Table updateBy(@NotNull final QueryTable source, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java index 429cf2644d5..07620f6bc13 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UpdateByOperatorFactory.java @@ -34,14 +34,14 @@ * {@link UpdateBy} can use to produce a result. */ public class UpdateByOperatorFactory { - private final TableWithDefaults source; + private final TableDefaults source; private final MatchPair[] groupByColumns; @Nullable private final WritableRowRedirection rowRedirection; @NotNull private final UpdateByControl control; - public UpdateByOperatorFactory(@NotNull final TableWithDefaults source, + public UpdateByOperatorFactory(@NotNull final TableDefaults source, @NotNull final MatchPair[] groupByColumns, @Nullable final WritableRowRedirection rowRedirection, @NotNull final UpdateByControl control) { @@ -132,7 +132,7 @@ private class OperationVisitor implements UpdateBySpec.Visitor, UpdateByOp /** * Check if the supplied type is one of the supported time types. - * + * * @param type the type * @return true if the type is one of the useable time types */ @@ -207,7 +207,7 @@ public Void visit(CumProdSpec p) { @SuppressWarnings("unchecked") private UpdateByOperator makeEmaOperator(@NotNull final MatchPair pair, - @NotNull final TableWithDefaults source, + @NotNull final TableDefaults source, @Nullable final LongRecordingUpdateByOperator recorder, @NotNull final EmaSpec ema) { // noinspection rawtypes @@ -253,7 +253,7 @@ private UpdateByOperator makeEmaOperator(@NotNull final MatchPair pair, throw new IllegalArgumentException("Can not perform EMA on type " + csType); } - private LongRecordingUpdateByOperator makeLongRecordingOperator(TableWithDefaults source, String colName) { + private LongRecordingUpdateByOperator makeLongRecordingOperator(TableDefaults source, String colName) { final ColumnSource columnSource = source.getColumnSource(colName); final Class colType = columnSource.getType(); if (colType != long.class && @@ -270,7 +270,7 @@ private LongRecordingUpdateByOperator makeLongRecordingOperator(TableWithDefault return new LongRecordingUpdateByOperator(colName, inputColumns, columnSource); } - private UpdateByOperator makeCumProdOperator(MatchPair fc, TableWithDefaults source) { + private UpdateByOperator makeCumProdOperator(MatchPair fc, TableDefaults source) { final Class csType = source.getColumnSource(fc.rightColumn).getType(); if (csType == byte.class || csType == Byte.class) { return new ByteCumProdOperator(fc, rowRedirection); @@ -293,7 +293,7 @@ private UpdateByOperator makeCumProdOperator(MatchPair fc, TableWithDefaults sou throw new IllegalArgumentException("Can not perform Cumulative Min/Max on type " + csType); } - private UpdateByOperator makeCumMinMaxOperator(MatchPair fc, TableWithDefaults source, boolean isMax) { + private UpdateByOperator makeCumMinMaxOperator(MatchPair fc, TableDefaults source, boolean isMax) { final ColumnSource columnSource = source.getColumnSource(fc.rightColumn); final Class csType = columnSource.getType(); if (csType == byte.class || csType == Byte.class) { @@ -316,7 +316,7 @@ private UpdateByOperator makeCumMinMaxOperator(MatchPair fc, TableWithDefaults s throw new IllegalArgumentException("Can not perform Cumulative Min/Max on type " + csType); } - private UpdateByOperator makeCumSumOperator(MatchPair fc, TableWithDefaults source) { + private UpdateByOperator makeCumSumOperator(MatchPair fc, TableDefaults source) { final Class csType = source.getColumnSource(fc.rightColumn).getType(); if (csType == Boolean.class || csType == boolean.class) { return new ByteCumSumOperator(fc, rowRedirection, NULL_BOOLEAN_AS_BYTE); @@ -341,7 +341,7 @@ private UpdateByOperator makeCumSumOperator(MatchPair fc, TableWithDefaults sour throw new IllegalArgumentException("Can not perform Cumulative Sum on type " + csType); } - private UpdateByOperator makeForwardFillOperator(MatchPair fc, TableWithDefaults source) { + private UpdateByOperator makeForwardFillOperator(MatchPair fc, TableDefaults source) { final ColumnSource columnSource = source.getColumnSource(fc.rightColumn); final Class csType = columnSource.getType(); if (csType == char.class || csType == Character.class) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index 568a1fafa69..1025d408ab5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -10,7 +10,7 @@ import io.deephaven.chunk.*; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; -import io.deephaven.compilertools.CompilerTools; +import io.deephaven.engine.context.CompilerTools; import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/lang/QueryLanguageParser.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/lang/QueryLanguageParser.java index e388c03ab87..6bab15b8804 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/lang/QueryLanguageParser.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/lang/QueryLanguageParser.java @@ -6,9 +6,10 @@ import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.Require; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.table.lang.QueryScopeParam; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.vector.*; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.vector.Vector; import io.deephaven.util.type.TypeUtils; import com.github.javaparser.ast.*; @@ -430,21 +431,23 @@ private Class getMethodReturnType(Class scope, String methodName, Class return getMethod(scope, methodName, paramTypes, parameterizedTypes).getReturnType(); } - private Class calculateMethodReturnTypeUsingGenerics(Method method, Class[] paramTypes, - Class[][] parameterizedTypes) { - Type genericReturnType = method.getGenericReturnType(); + private Class calculateMethodReturnTypeUsingGenerics( + Class scope, Method method, Class[] paramTypes, Class[][] parameterizedTypes) { + Type methodReturnType = method.getGenericReturnType(); int arrayDimensions = 0; - while (genericReturnType instanceof GenericArrayType) { - genericReturnType = ((GenericArrayType) genericReturnType).getGenericComponentType(); + while (methodReturnType instanceof GenericArrayType) { + methodReturnType = ((GenericArrayType) methodReturnType).getGenericComponentType(); arrayDimensions++; } - if (!(genericReturnType instanceof TypeVariable)) { + if (!(methodReturnType instanceof TypeVariable)) { return method.getReturnType(); } + final TypeVariable genericReturnType = (TypeVariable) methodReturnType; + // check for the generic type in a param Type[] genericParameterTypes = method.getGenericParameterTypes(); @@ -480,7 +483,49 @@ private Class calculateMethodReturnTypeUsingGenerics(Method method, Class[ } } - return method.getReturnType(); + // check if inheritance fixes the generic type + final Class fixedGenericType = extractGenericType(scope, method, genericReturnType); + return fixedGenericType != null ? fixedGenericType : method.getReturnType(); + } + + private Class extractGenericType(final Type type, final Method method, final TypeVariable genericReturnType) { + final Class clazz; + if (type instanceof ParameterizedType) { + final ParameterizedType parameterizedType = (ParameterizedType) type; + final Type rawType = parameterizedType.getRawType(); + if (!(rawType instanceof Class)) { + return null; + } + clazz = (Class) rawType; + + // check if this parameterized type matches the method's declaring class, then return the fixed type + if (method.getDeclaringClass().equals(rawType)) { + final Type[] typeArguments = parameterizedType.getActualTypeArguments(); + final TypeVariable[] typeParameters = clazz.getTypeParameters(); + for (int ii = 0; ii < typeParameters.length; ++ii) { + if (typeParameters[ii].getName().equals(genericReturnType.getName()) + && typeArguments[ii] instanceof Class) { + return (Class) typeArguments[ii]; + } + } + } + } else if (type instanceof Class) { + clazz = (Class) type; + } else { + return null; + } + + // check for generic interfaces + for (final Type superInterfaceType : clazz.getGenericInterfaces()) { + final Class returnType = extractGenericType(superInterfaceType, method, genericReturnType); + if (returnType != null) { + return returnType; + } + } + + // check super type + final Type superType = clazz.getGenericSuperclass(); + return (superType != null) ? extractGenericType(superType, method, genericReturnType) : null; } @SuppressWarnings({"ConstantConditions"}) @@ -1690,7 +1735,7 @@ public Class visit(MethodCallExpr n, VisitArgs printer) { printArguments(expressions, printer); } - return calculateMethodReturnTypeUsingGenerics(method, expressionTypes, parameterizedTypes); + return calculateMethodReturnTypeUsingGenerics(scope, method, expressionTypes, parameterizedTypes); } private void checkPyNumbaVectorizedFunc(MethodCallExpr n, Expression[] expressions, Class[] expressionTypes) { @@ -1703,7 +1748,7 @@ private void checkPyNumbaVectorizedFunc(MethodCallExpr n, Expression[] expressio } }); - final QueryScope queryScope = QueryScope.getScope(); + final QueryScope queryScope = ExecutionContext.getContext().getQueryScope(); for (QueryScopeParam param : queryScope.getParams(queryScope.getParamNames())) { if (param.getName().equals(n.getNameAsString())) { NumbaCallableWrapper numbaCallableWrapper = (NumbaCallableWrapper) param.getValue(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java index 24323e5f22a..4fcc375c25e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java @@ -14,6 +14,8 @@ import io.deephaven.engine.table.impl.select.Formula; import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.sources.ViewColumnSource; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; import java.util.List; @@ -29,6 +31,7 @@ class BiTableTransformationColumn extends BaseTableTransformationColumn { private final String inputOutputColumnName; private final String secondInputColumnName; private final BinaryOperator
    transformer; + private final ExecutionContext executionContext; private ColumnSource
    inputColumnSource1; private ColumnSource
    inputColumnSource2; @@ -36,9 +39,11 @@ class BiTableTransformationColumn extends BaseTableTransformationColumn { BiTableTransformationColumn( @NotNull final String inputOutputColumnName, @NotNull final String secondInputColumnName, + final ExecutionContext executionContext, @NotNull final BinaryOperator
    transformer) { this.inputOutputColumnName = inputOutputColumnName; this.secondInputColumnName = secondInputColumnName; + this.executionContext = executionContext; this.transformer = transformer; } @@ -76,7 +81,8 @@ public String getName() { @Override public SelectColumn copy() { - return new BiTableTransformationColumn(inputOutputColumnName, secondInputColumnName, transformer); + return new BiTableTransformationColumn(inputOutputColumnName, secondInputColumnName, + executionContext, transformer); } private final class OutputFormulaFillContext implements Formula.FillContext { @@ -104,12 +110,16 @@ private OutputFormula() { @Override public Object get(final long rowKey) { - return transformer.apply(inputColumnSource1.get(rowKey), inputColumnSource2.get(rowKey)); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + return transformer.apply(inputColumnSource1.get(rowKey), inputColumnSource2.get(rowKey)); + } } @Override public Object getPrev(final long rowKey) { - return transformer.apply(inputColumnSource1.getPrev(rowKey), inputColumnSource2.getPrev(rowKey)); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + return transformer.apply(inputColumnSource1.getPrev(rowKey), inputColumnSource2.getPrev(rowKey)); + } } @Override @@ -153,8 +163,10 @@ private void transformAndFill( final WritableObjectChunk typedDestination = destination.asWritableObjectChunk(); final int size = source1.size(); typedDestination.setSize(size); - for (int ii = 0; ii < size; ++ii) { - typedDestination.set(ii, transformer.apply(source1.get(ii), source2.get(ii))); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + for (int ii = 0; ii < size; ++ii) { + typedDestination.set(ii, transformer.apply(source1.get(ii), source2.get(ii))); + } } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java index e054cd2f56e..615dc0f4a1d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableImpl.java @@ -5,9 +5,11 @@ import io.deephaven.api.SortColumn; import io.deephaven.api.filter.Filter; +import io.deephaven.api.util.ConcurrentMethod; import io.deephaven.base.Pair; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.Liveness; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.liveness.LivenessManager; @@ -25,7 +27,6 @@ import io.deephaven.engine.table.impl.sources.NullValueColumnSource; import io.deephaven.engine.table.impl.sources.UnionSourceManager; import io.deephaven.engine.table.iterators.ObjectColumnIterator; -import io.deephaven.engine.updategraph.ConcurrentMethod; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.util.SafeCloseable; import org.apache.commons.lang3.mutable.MutableInt; @@ -239,13 +240,17 @@ public PartitionedTable sort(@NotNull final Collection sortColumns) @ConcurrentMethod @Override - public PartitionedTableImpl transform(@NotNull final UnaryOperator
    transformer) { + public PartitionedTableImpl transform(final ExecutionContext executionContext, + @NotNull final UnaryOperator
    transformer) { final Table resultTable; final TableDefinition resultConstituentDefinition; final LivenessManager enclosingScope = LivenessScopeStack.peek(); - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored1 = executionContext == null ? null : executionContext.open(); + final SafeCloseable ignored2 = LivenessScopeStack.open()) { + // Perform the transformation - resultTable = table.update(new TableTransformationColumn(constituentColumnName, transformer)); + resultTable = table.update(new TableTransformationColumn( + constituentColumnName, executionContext, transformer)); enclosingScope.manage(resultTable); // Make sure we have a valid result constituent definition @@ -268,6 +273,7 @@ public PartitionedTableImpl transform(@NotNull final UnaryOperator
    transf @Override public PartitionedTableImpl partitionedTransform( @NotNull final PartitionedTable other, + final ExecutionContext executionContext, @NotNull final BinaryOperator
    transformer) { // Check safety before doing any extra work if (table.isRefreshing() || other.table().isRefreshing()) { @@ -280,7 +286,8 @@ public PartitionedTableImpl partitionedTransform( final Table resultTable; final TableDefinition resultConstituentDefinition; final LivenessManager enclosingScope = LivenessScopeStack.peek(); - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored1 = executionContext == null ? null : executionContext.open(); + final SafeCloseable ignored2 = LivenessScopeStack.open()) { // Perform the transformation final MatchPair[] joinAdditions = new MatchPair[] {new MatchPair(RHS_CONSTITUENT, other.constituentColumnName())}; @@ -289,7 +296,8 @@ public PartitionedTableImpl partitionedTransform( .where(new MatchFilter(Inverted, RHS_CONSTITUENT, (Object) null)) : table.join(other.table(), joinPairs, joinAdditions); resultTable = joined - .update(new BiTableTransformationColumn(constituentColumnName, RHS_CONSTITUENT, transformer)) + .update(new BiTableTransformationColumn( + constituentColumnName, RHS_CONSTITUENT, executionContext, transformer)) .dropColumns(RHS_CONSTITUENT); enclosingScope.manage(resultTable); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 914d877cef9..8e3bfaa21e2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -10,13 +10,17 @@ import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.liveness.LivenessArtifact; +import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.TableDefinition; import io.deephaven.engine.table.TableUpdate; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.table.impl.select.MatchFilter; +import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.select.SourceColumn; +import io.deephaven.engine.table.impl.select.WhereFilter; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.TableTools; import org.jetbrains.annotations.NotNull; @@ -125,7 +129,7 @@ public boolean sanityChecksJoins() { private PartitionedTable.Proxy basicTransform(@NotNull final UnaryOperator
    transformer) { return new PartitionedTableProxyImpl( - target.transform(transformer), + target.transform(null, transformer), requireMatchingKeys, sanityCheckJoins); } @@ -140,7 +144,7 @@ private PartitionedTable.Proxy complexTransform( UpdateGraphProcessor.DEFAULT.checkInitiateTableOperation(); } return new PartitionedTableProxyImpl( - target.transform(ct -> transformer.apply(ct, otherTable)), + target.transform(null, ct -> transformer.apply(ct, otherTable)), requireMatchingKeys, sanityCheckJoins); } @@ -169,7 +173,7 @@ private PartitionedTable.Proxy complexTransform( final PartitionedTable rhsToUse = maybeRewrap(validatedRhsTable, otherTarget); return new PartitionedTableProxyImpl( - lhsToUse.partitionedTransform(rhsToUse, transformer), + lhsToUse.partitionedTransform(rhsToUse, null, transformer), requireMatchingKeys, sanityCheckJoins); } @@ -177,23 +181,6 @@ private PartitionedTable.Proxy complexTransform( + ", expected Table or PartitionedTable.Proxy"); } - private static List splitToJoinMatches(@NotNull final String columnsToMatch) { - if (columnsToMatch.trim().isEmpty()) { - return Collections.emptyList(); - } - return Arrays.stream(columnsToMatch.split(",")).map(String::trim).filter(ctm -> !ctm.isEmpty()) - .map(JoinMatch::parse).collect(Collectors.toList()); - } - - private static List splitToExactMatches(@NotNull final String columnsToMatch) { - if (columnsToMatch.trim().isEmpty()) { - return Collections.emptyList(); - } - final String[] split = Arrays.stream(columnsToMatch.split(",")).map(String::trim).filter(ctm -> !ctm.isEmpty()) - .toArray(String[]::new); - return Arrays.stream(split).limit(split.length - 1).map(JoinMatch::parse).collect(Collectors.toList()); - } - /** * Struct to pair a {@code validation} with a {@code table} whose updates dictate when the validation needs to run. */ @@ -333,7 +320,7 @@ private static DependentValidation nonOverlappingJoinKeysValidation( // NB: At the moment, we are assuming that constituents appear only once per partitioned table in scenarios // where overlapping join keys are concerning. final AtomicLong sequenceCounter = new AtomicLong(0); - final PartitionedTable stamped = input.transform(table -> table + final PartitionedTable stamped = input.transform(null, table -> table .updateView(new LongConstantColumn(ENCLOSING_CONSTITUENT.name(), sequenceCounter.getAndIncrement()))); final Table merged = stamped.merge(); final Table mergedWithUniqueAgg = merged.aggAllBy(AggSpec.unique(), joinKeyColumnNames); @@ -379,51 +366,25 @@ public PartitionedTable.Proxy reverse() { return basicTransform(Table::reverse); } - @Override - public PartitionedTable.Proxy snapshot(TableOperations baseTable, String... stampColumns) { - return complexTransform(baseTable, (ct, ot) -> ct.snapshot(ot, stampColumns), null); - } - @Override public PartitionedTable.Proxy snapshot(TableOperations baseTable, boolean doInitialSnapshot, String... stampColumns) { return complexTransform(baseTable, (ct, ot) -> ct.snapshot(ot, doInitialSnapshot, stampColumns), null); } - @Override - public PartitionedTable.Proxy snapshot(TableOperations baseTable, boolean doInitialSnapshot, - Collection stampColumns) { - return complexTransform(baseTable, (ct, ot) -> ct.snapshot(ot, doInitialSnapshot, stampColumns), null); - } - - @Override - public PartitionedTable.Proxy sort(String... columnsToSortBy) { - return basicTransform(ct -> ct.sort(columnsToSortBy)); - } - - @Override - public PartitionedTable.Proxy sortDescending(String... columnsToSortBy) { - return basicTransform(ct -> ct.sortDescending(columnsToSortBy)); - } - @Override public PartitionedTable.Proxy sort(Collection columnsToSortBy) { return basicTransform(ct -> ct.sort(columnsToSortBy)); } - @Override - public PartitionedTable.Proxy where(String... filters) { - return basicTransform(ct -> ct.where(filters)); - } - @Override public PartitionedTable.Proxy where(Collection filters) { - return basicTransform(ct -> ct.where(filters)); - } - - @Override - public PartitionedTable.Proxy whereIn(TableOperations rightTable, String... columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.whereIn(ot, columnsToMatch), JoinMatch.from(columnsToMatch)); + final WhereFilter[] whereFilters = WhereFilter.from(filters); + final TableDefinition definition = target.constituentDefinition(); + for (WhereFilter filter : whereFilters) { + filter.init(definition); + } + return basicTransform(ct -> ct.where(WhereFilter.copyFrom(whereFilters))); } @Override @@ -432,79 +393,50 @@ public PartitionedTable.Proxy whereIn(TableOperations rightTable, return complexTransform(rightTable, (ct, ot) -> ct.whereIn(ot, columnsToMatch), columnsToMatch); } - @Override - public PartitionedTable.Proxy whereNotIn(TableOperations rightTable, String... columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.whereNotIn(ot, columnsToMatch), - JoinMatch.from(columnsToMatch)); - } - @Override public PartitionedTable.Proxy whereNotIn(TableOperations rightTable, Collection columnsToMatch) { return complexTransform(rightTable, (ct, ot) -> ct.whereNotIn(ot, columnsToMatch), columnsToMatch); } - @Override - public PartitionedTable.Proxy view(String... columns) { - return basicTransform(ct -> ct.view(columns)); + @NotNull + private SelectColumn[] toSelectColumns(Collection columns) { + final SelectColumn[] selectColumns = SelectColumn.from(columns); + Map> targetColumnMap = target.constituentDefinition().getColumnNameMap(); + for (SelectColumn column : selectColumns) { + column.initDef(targetColumnMap); + } + return selectColumns; } @Override public PartitionedTable.Proxy view(Collection columns) { - return basicTransform(ct -> ct.view(columns)); - } - - @Override - public PartitionedTable.Proxy updateView(String... columns) { - return basicTransform(ct -> ct.updateView(columns)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.view(SelectColumn.copyFrom(selectColumns))); } @Override public PartitionedTable.Proxy updateView(Collection columns) { - return basicTransform(ct -> ct.updateView(columns)); - } - - @Override - public PartitionedTable.Proxy update(String... columns) { - return basicTransform(ct -> ct.update(columns)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.updateView(SelectColumn.copyFrom(selectColumns))); } @Override public PartitionedTable.Proxy update(Collection columns) { - return basicTransform(ct -> ct.update(columns)); - } - - @Override - public PartitionedTable.Proxy lazyUpdate(String... columns) { - return basicTransform(ct -> ct.lazyUpdate(columns)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.update(SelectColumn.copyFrom(selectColumns))); } @Override public PartitionedTable.Proxy lazyUpdate(Collection columns) { - return basicTransform(ct -> ct.lazyUpdate(columns)); - } - - @Override - public PartitionedTable.Proxy select(String... columns) { - return basicTransform(ct -> ct.select(columns)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.lazyUpdate(SelectColumn.copyFrom(selectColumns))); } @Override public PartitionedTable.Proxy select(Collection columns) { - return basicTransform(ct -> ct.select(columns)); - } - - @Override - public PartitionedTable.Proxy naturalJoin(TableOperations rightTable, String columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.naturalJoin(ot, columnsToMatch), - splitToJoinMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy naturalJoin(TableOperations rightTable, String columnsToMatch, - String columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.naturalJoin(ot, columnsToMatch, columnsToAdd), - splitToJoinMatches(columnsToMatch)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.select(SelectColumn.copyFrom(selectColumns))); } @Override @@ -514,19 +446,6 @@ public PartitionedTable.Proxy naturalJoin(TableOperations rightTable, columnsToMatch); } - @Override - public PartitionedTable.Proxy exactJoin(TableOperations rightTable, String columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.exactJoin(ot, columnsToMatch), - splitToJoinMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy exactJoin(TableOperations rightTable, String columnsToMatch, - String columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.exactJoin(ot, columnsToMatch, columnsToAdd), - splitToJoinMatches(columnsToMatch)); - } - @Override public PartitionedTable.Proxy exactJoin(TableOperations rightTable, Collection columnsToMatch, @@ -534,22 +453,10 @@ public PartitionedTable.Proxy exactJoin(TableOperations rightTable, return complexTransform(rightTable, (ct, ot) -> ct.exactJoin(ot, columnsToMatch, columnsToAdd), columnsToMatch); } - @Override - public PartitionedTable.Proxy join(TableOperations rightTable, String columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.join(ot, columnsToMatch), - splitToJoinMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy join(TableOperations rightTable, String columnsToMatch, String columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.join(ot, columnsToMatch, columnsToAdd), - splitToJoinMatches(columnsToMatch)); - } - @Override public PartitionedTable.Proxy join(TableOperations rightTable, Collection columnsToMatch, Collection columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.join(ot, columnsToMatch, columnsToAdd), columnsToMatch); + return join(rightTable, columnsToMatch, columnsToAdd, CrossJoinHelper.DEFAULT_NUM_RIGHT_BITS_TO_RESERVE); } @Override @@ -559,78 +466,18 @@ public PartitionedTable.Proxy join(TableOperations rightTable, Collection< columnsToMatch); } - @Override - public PartitionedTable.Proxy aj(TableOperations rightTable, String columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.aj(ot, columnsToMatch), splitToExactMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy aj(TableOperations rightTable, String columnsToMatch, String columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.aj(ot, columnsToMatch, columnsToAdd), - splitToExactMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy aj(TableOperations rightTable, Collection columnsToMatch, - Collection columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.aj(ot, columnsToMatch, columnsToAdd), columnsToMatch); - } - @Override public PartitionedTable.Proxy aj(TableOperations rightTable, Collection columnsToMatch, Collection columnsToAdd, AsOfJoinRule asOfJoinRule) { return complexTransform(rightTable, (ct, ot) -> ct.aj(ot, columnsToMatch, columnsToAdd, asOfJoinRule), - columnsToMatch); - } - - @Override - public PartitionedTable.Proxy raj(TableOperations rightTable, String columnsToMatch) { - return complexTransform(rightTable, (ct, ot) -> ct.raj(ot, columnsToMatch), - splitToExactMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy raj(TableOperations rightTable, String columnsToMatch, String columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.raj(ot, columnsToMatch, columnsToAdd), - splitToExactMatches(columnsToMatch)); - } - - @Override - public PartitionedTable.Proxy raj(TableOperations rightTable, Collection columnsToMatch, - Collection columnsToAdd) { - return complexTransform(rightTable, (ct, ot) -> ct.raj(ot, columnsToMatch, columnsToAdd), columnsToMatch); + columnsToMatch.stream().limit(columnsToMatch.size() - 1).collect(Collectors.toList())); } @Override public PartitionedTable.Proxy raj(TableOperations rightTable, Collection columnsToMatch, Collection columnsToAdd, ReverseAsOfJoinRule reverseAsOfJoinRule) { return complexTransform(rightTable, (ct, ot) -> ct.raj(ot, columnsToMatch, columnsToAdd, reverseAsOfJoinRule), - columnsToMatch); - } - - @Override - public PartitionedTable.Proxy groupBy() { - return basicTransform(Table::groupBy); - } - - @Override - public PartitionedTable.Proxy groupBy(String... groupByColumns) { - return basicTransform(ct -> ct.groupBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy groupBy(Collection groupByColumns) { - return basicTransform(ct -> ct.groupBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy aggAllBy(AggSpec spec) { - return basicTransform(ct -> ct.aggAllBy(spec)); - } - - @Override - public PartitionedTable.Proxy aggAllBy(AggSpec spec, String... groupByColumns) { - return basicTransform(ct -> ct.aggAllBy(spec, groupByColumns)); + columnsToMatch.stream().limit(columnsToMatch.size() - 1).collect(Collectors.toList())); } @Override @@ -638,86 +485,16 @@ public PartitionedTable.Proxy aggAllBy(AggSpec spec, ColumnName... groupByColumn return basicTransform(ct -> ct.aggAllBy(spec, groupByColumns)); } - @Override - public PartitionedTable.Proxy aggAllBy(AggSpec spec, Collection groupByColumns) { - return basicTransform(ct -> ct.aggAllBy(spec, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation) { - return basicTransform(ct -> ct.aggBy(aggregation)); - } - - @Override - public PartitionedTable.Proxy aggBy(Collection aggregations) { - return basicTransform(ct -> ct.aggBy(aggregations)); - } - - @Override - public PartitionedTable.Proxy aggBy(Collection aggregations, boolean preserveEmpty) { - return basicTransform(ct -> ct.aggBy(aggregations, preserveEmpty)); - } - - @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation, String... groupByColumns) { - return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy aggBy(Aggregation aggregation, Collection groupByColumns) { - return basicTransform(ct -> ct.aggBy(aggregation, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy aggBy(Collection aggregations, String... groupByColumns) { - return basicTransform(ct -> ct.aggBy(aggregations, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy aggBy(Collection aggregations, - Collection groupByColumns) { - return basicTransform(ct -> ct.aggBy(aggregations, groupByColumns)); - } - @Override public PartitionedTable.Proxy aggBy(Collection aggregations, boolean preserveEmpty, TableOperations initialGroups, Collection groupByColumns) { + if (initialGroups == null) { + return basicTransform(ct -> ct.aggBy(aggregations, preserveEmpty, null, groupByColumns)); + } return complexTransform(initialGroups, (ct, ot) -> ct.aggBy(aggregations, preserveEmpty, ot, groupByColumns), null); } - @Override - public PartitionedTable.Proxy updateBy(UpdateByOperation operation) { - return basicTransform(ct -> ct.updateBy(operation)); - } - - @Override - public PartitionedTable.Proxy updateBy(UpdateByOperation operation, String... byColumns) { - return basicTransform(ct -> ct.updateBy(operation, byColumns)); - } - - @Override - public PartitionedTable.Proxy updateBy(Collection operations) { - return basicTransform(ct -> ct.updateBy(operations)); - } - - @Override - public PartitionedTable.Proxy updateBy(Collection operations, String... byColumns) { - return basicTransform(ct -> ct.updateBy(operations, byColumns)); - } - - @Override - public PartitionedTable.Proxy updateBy(Collection operations, - Collection byColumns) { - return basicTransform(ct -> ct.updateBy(operations, byColumns)); - } - - @Override - public PartitionedTable.Proxy updateBy(UpdateByControl control, - Collection operations) { - return basicTransform(ct -> ct.updateBy(control, operations)); - } - @Override public PartitionedTable.Proxy updateBy(UpdateByControl control, Collection operations, Collection byColumns) { @@ -729,279 +506,10 @@ public PartitionedTable.Proxy selectDistinct() { return basicTransform(Table::selectDistinct); } - @Override - public PartitionedTable.Proxy selectDistinct(String... columns) { - return basicTransform(ct -> ct.selectDistinct(columns)); - } - - @Override - public PartitionedTable.Proxy selectDistinct(Selectable... columns) { - return basicTransform(ct -> ct.selectDistinct(columns)); - } - @Override public PartitionedTable.Proxy selectDistinct(Collection columns) { - return basicTransform(ct -> ct.selectDistinct(columns)); - } - - @Override - public PartitionedTable.Proxy countBy(String countColumnName) { - return basicTransform(ct -> ct.countBy(countColumnName)); - } - - @Override - public PartitionedTable.Proxy countBy(String countColumnName, String... groupByColumns) { - return basicTransform(ct -> ct.countBy(countColumnName, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy countBy(String countColumnName, ColumnName... groupByColumns) { - return basicTransform(ct -> ct.countBy(countColumnName, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy countBy(String countColumnName, Collection groupByColumns) { - return basicTransform(ct -> ct.countBy(countColumnName, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy firstBy() { - return basicTransform(Table::firstBy); - } - - @Override - public PartitionedTable.Proxy firstBy(String... groupByColumns) { - return basicTransform(ct -> ct.firstBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy firstBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.firstBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy firstBy(Collection groupByColumns) { - return basicTransform(ct -> ct.firstBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy lastBy() { - return basicTransform(Table::lastBy); - } - - @Override - public PartitionedTable.Proxy lastBy(String... groupByColumns) { - return basicTransform(ct -> ct.lastBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy lastBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.lastBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy lastBy(Collection groupByColumns) { - return basicTransform(ct -> ct.lastBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy minBy() { - return basicTransform(Table::minBy); - } - - @Override - public PartitionedTable.Proxy minBy(String... groupByColumns) { - return basicTransform(ct -> ct.minBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy minBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.minBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy minBy(Collection groupByColumns) { - return basicTransform(ct -> ct.minBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy maxBy() { - return basicTransform(Table::maxBy); - } - - @Override - public PartitionedTable.Proxy maxBy(String... groupByColumns) { - return basicTransform(ct -> ct.maxBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy maxBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.maxBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy maxBy(Collection groupByColumns) { - return basicTransform(ct -> ct.maxBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy sumBy() { - return basicTransform(Table::sumBy); - } - - @Override - public PartitionedTable.Proxy sumBy(String... groupByColumns) { - return basicTransform(ct -> ct.sumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy sumBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.sumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy sumBy(Collection groupByColumns) { - return basicTransform(ct -> ct.sumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy avgBy() { - return basicTransform(Table::avgBy); - } - - @Override - public PartitionedTable.Proxy avgBy(String... groupByColumns) { - return basicTransform(ct -> ct.avgBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy avgBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.avgBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy avgBy(Collection groupByColumns) { - return basicTransform(ct -> ct.avgBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy medianBy() { - return basicTransform(Table::medianBy); - } - - @Override - public PartitionedTable.Proxy medianBy(String... groupByColumns) { - return basicTransform(ct -> ct.medianBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy medianBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.medianBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy medianBy(Collection groupByColumns) { - return basicTransform(ct -> ct.medianBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy stdBy() { - return basicTransform(Table::stdBy); - } - - @Override - public PartitionedTable.Proxy stdBy(String... groupByColumns) { - return basicTransform(ct -> ct.stdBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy stdBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.stdBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy stdBy(Collection groupByColumns) { - return basicTransform(ct -> ct.stdBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy varBy() { - return basicTransform(Table::varBy); - } - - @Override - public PartitionedTable.Proxy varBy(String... groupByColumns) { - return basicTransform(ct -> ct.varBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy varBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.varBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy varBy(Collection groupByColumns) { - return basicTransform(ct -> ct.varBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy absSumBy() { - return basicTransform(Table::absSumBy); - } - - @Override - public PartitionedTable.Proxy absSumBy(String... groupByColumns) { - return basicTransform(ct -> ct.absSumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy absSumBy(ColumnName... groupByColumns) { - return basicTransform(ct -> ct.absSumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy absSumBy(Collection groupByColumns) { - return basicTransform(ct -> ct.absSumBy(groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wsumBy(String weightColumn) { - return basicTransform(ct -> ct.wsumBy(weightColumn)); - } - - @Override - public PartitionedTable.Proxy wsumBy(String weightColumn, String... groupByColumns) { - return basicTransform(ct -> ct.wsumBy(weightColumn, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wsumBy(String weightColumn, ColumnName... groupByColumns) { - return basicTransform(ct -> ct.wsumBy(weightColumn, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wsumBy(String weightColumn, Collection groupByColumns) { - return basicTransform(ct -> ct.wsumBy(weightColumn, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wavgBy(String weightColumn) { - return basicTransform(ct -> ct.wavgBy(weightColumn)); - } - - @Override - public PartitionedTable.Proxy wavgBy(String weightColumn, String... groupByColumns) { - return basicTransform(ct -> ct.wavgBy(weightColumn, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wavgBy(String weightColumn, ColumnName... groupByColumns) { - return basicTransform(ct -> ct.wavgBy(weightColumn, groupByColumns)); - } - - @Override - public PartitionedTable.Proxy wavgBy(String weightColumn, Collection groupByColumns) { - return basicTransform(ct -> ct.wavgBy(weightColumn, groupByColumns)); + final SelectColumn[] selectColumns = toSelectColumns(columns); + return basicTransform(ct -> ct.selectDistinct(SelectColumn.copyFrom(selectColumns))); } // endregion TableOperations Implementation diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java index e9aac68b322..ea01fe4b043 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java @@ -8,12 +8,14 @@ import io.deephaven.chunk.WritableChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.TrackingRowSet; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.select.Formula; import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.sources.ViewColumnSource; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; import java.util.List; @@ -29,13 +31,16 @@ public class TableTransformationColumn extends BaseTableTransformationColumn { private final String inputOutputColumnName; private final Function transformer; + private final ExecutionContext executionContext; private ColumnSource
    inputColumnSource; public TableTransformationColumn( @NotNull final String inputOutputColumnName, + final ExecutionContext executionContext, @NotNull final Function transformer) { this.inputOutputColumnName = inputOutputColumnName; + this.executionContext = executionContext; this.transformer = transformer; } @@ -71,7 +76,7 @@ public String getName() { @Override public SelectColumn copy() { - return new TableTransformationColumn(inputOutputColumnName, transformer); + return new TableTransformationColumn(inputOutputColumnName, executionContext, transformer); } private final class OutputFormulaFillContext implements Formula.FillContext { @@ -96,12 +101,16 @@ private OutputFormula() { @Override public Object get(final long rowKey) { - return transformer.apply(inputColumnSource.get(rowKey)); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + return transformer.apply(inputColumnSource.get(rowKey)); + } } @Override public Object getPrev(final long rowKey) { - return transformer.apply(inputColumnSource.getPrev(rowKey)); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + return transformer.apply(inputColumnSource.getPrev(rowKey)); + } } @Override @@ -140,8 +149,10 @@ private void transformAndFill( final WritableObjectChunk typedDestination = destination.asWritableObjectChunk(); final int size = source.size(); typedDestination.setSize(size); - for (int ii = 0; ii < size; ++ii) { - typedDestination.set(ii, transformer.apply(source.get(ii))); + try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) { + for (int ii = 0; ii < size; ++ii) { + typedDestination.set(ii, transformer.apply(source.get(ii))); + } } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractConditionFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractConditionFilter.java index fe2461c5e10..157f1ca1590 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractConditionFilter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractConditionFilter.java @@ -4,17 +4,17 @@ package io.deephaven.engine.table.impl.select; import io.deephaven.UncheckedDeephavenException; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.rowset.WritableRowSet; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; import io.deephaven.engine.table.impl.lang.QueryLanguageParser; -import io.deephaven.engine.table.lang.QueryScopeParam; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.time.DateTimeUtils; import io.deephaven.vector.ObjectVector; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.table.impl.select.python.DeephavenCompatibleFunction; import io.deephaven.engine.rowset.RowSet; import io.deephaven.io.logger.Logger; @@ -87,7 +87,7 @@ public synchronized void init(TableDefinition tableDefinition) { try { final Map> possibleParams = new HashMap<>(); - final QueryScope queryScope = QueryScope.getScope(); + final QueryScope queryScope = ExecutionContext.getContext().getQueryScope(); for (QueryScopeParam param : queryScope.getParams(queryScope.getParamNames())) { possibleParams.put(param.getName(), param); possibleVariables.put(param.getName(), QueryScopeParamTypeUtil.getDeclaredClass(param.getValue())); @@ -129,8 +129,9 @@ public synchronized void init(TableDefinition tableDefinition) { final QueryLanguageParser.Result result = new QueryLanguageParser(timeConversionResult.getConvertedFormula(), - QueryLibrary.getPackageImports(), QueryLibrary.getClassImports(), - QueryLibrary.getStaticImports(), + ExecutionContext.getContext().getQueryLibrary().getPackageImports(), + ExecutionContext.getContext().getQueryLibrary().getClassImports(), + ExecutionContext.getContext().getQueryLibrary().getStaticImports(), possibleVariables, possibleVariableParameterizedTypes, unboxArguments).getResult(); log.debug("Expression (after language conversion) : " + result.getConvertedExpression()); @@ -247,6 +248,18 @@ public void setRecomputeListener(RecomputeListener listener) {} @Override public abstract AbstractConditionFilter copy(); + protected void onCopy(final AbstractConditionFilter copy) { + if (initialized) { + copy.initialized = true; + copy.usedColumns = usedColumns; + copy.usedColumnArrays = usedColumnArrays; + copy.usesI = usesI; + copy.usesII = usesII; + copy.usesK = usesK; + copy.params = params; + } + } + @Override public String toString() { return formula; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java index 85fad1c895c..4929050eac8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java @@ -6,9 +6,10 @@ import io.deephaven.base.verify.Require; import io.deephaven.configuration.Configuration; import io.deephaven.engine.table.*; -import io.deephaven.engine.table.lang.QueryScopeParam; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryScope; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.vector.Vector; -import io.deephaven.engine.table.lang.QueryScope; import io.deephaven.engine.table.impl.vector.*; import io.deephaven.engine.table.impl.select.formula.*; import io.deephaven.engine.table.impl.sources.*; @@ -23,6 +24,7 @@ import java.net.URL; import java.security.*; import java.util.*; +import java.util.function.Consumer; /** * A SelectColumn that implements a formula computed from the existing columns in the table and a query scope. @@ -30,9 +32,6 @@ public abstract class AbstractFormulaColumn implements FormulaColumn { private static final Logger log = LoggerFactory.getLogger(AbstractFormulaColumn.class); - private final boolean useKernelFormulas; - - private static final boolean ALLOW_UNSAFE_REFRESHING_FORMULAS = Configuration.getInstance() .getBooleanForClassWithDefault(AbstractFormulaColumn.class, "allowUnsafeRefreshingFormulas", false); @@ -42,11 +41,11 @@ public abstract class AbstractFormulaColumn implements FormulaColumn { @NotNull protected final String columnName; - private FormulaFactory formulaFactory; + protected FormulaFactory formulaFactory; private Formula formula; - protected List userParams; protected QueryScopeParam[] params; protected Map> columnSources; + protected Map> columnDefinitions; private TrackingRowSet rowSet; protected Class returnedType; public static final String COLUMN_SUFFIX = "_"; @@ -62,12 +61,10 @@ public abstract class AbstractFormulaColumn implements FormulaColumn { * * @param columnName the result column name * @param formulaString the formula string to be parsed by the QueryLanguageParser - * @param useKernelFormulas */ - protected AbstractFormulaColumn(String columnName, String formulaString, boolean useKernelFormulas) { + protected AbstractFormulaColumn(String columnName, String formulaString) { this.formulaString = Require.neqNull(formulaString, "formulaString"); this.columnName = NameValidator.validateColumnName(columnName); - this.useKernelFormulas = useKernelFormulas; } @Override @@ -92,15 +89,16 @@ public List initInputs(TrackingRowSet rowSet, Map> columnDefinitionMap, Set variablesUsed) { + columnDefinitions = columnDefinitionMap; + final Map> possibleParams = new HashMap<>(); - final QueryScope queryScope = QueryScope.getScope(); + final QueryScope queryScope = ExecutionContext.getContext().getQueryScope(); for (QueryScopeParam param : queryScope.getParams(queryScope.getParamNames())) { possibleParams.put(param.getName(), param); } final List> paramsList = new ArrayList<>(); usedColumns = new ArrayList<>(); - userParams = new ArrayList<>(); usedColumnArrays = new ArrayList<>(); for (String variable : variablesUsed) { if (variable.equals("i")) { @@ -109,31 +107,46 @@ protected void applyUsedVariables(Map> columnDefinit usesII = true; } else if (variable.equals("k")) { usesK = true; - } else if (columnDefinitionMap.get(variable) != null) { + } else if (columnDefinitions.get(variable) != null) { usedColumns.add(variable); } else { String strippedColumnName = variable.substring(0, Math.max(0, variable.length() - COLUMN_SUFFIX.length())); - if (variable.endsWith(COLUMN_SUFFIX) && columnDefinitionMap.get(strippedColumnName) != null) { + if (variable.endsWith(COLUMN_SUFFIX) && columnDefinitions.get(strippedColumnName) != null) { usedColumnArrays.add(strippedColumnName); } else if (possibleParams.containsKey(variable)) { paramsList.add(possibleParams.get(variable)); - userParams.add(variable); } } } params = paramsList.toArray(QueryScopeParam.ZERO_LENGTH_PARAM_ARRAY); - for (QueryScopeParam param : paramsList) { - try { - // noinspection ResultOfMethodCallIgnored, we only care that we can get the value here not what it is - param.getValue(); - } catch (RuntimeException e) { - throw new RuntimeException("Error retrieving " + param.getName(), e); - } - } } + protected void onCopy(final AbstractFormulaColumn copy) { + copy.formulaFactory = formulaFactory; + copy.columnDefinitions = columnDefinitions; + copy.params = params; + copy.usedColumns = usedColumns; + copy.usedColumnArrays = usedColumnArrays; + copy.usesI = usesI; + copy.usesII = usesII; + copy.usesK = usesK; + } + + protected void validateColumnDefinition(Map> columnDefinitionMap) { + final Consumer validateColumn = name -> { + final ColumnDefinition newDef = columnDefinitionMap.get(name); + final ColumnDefinition origDef = columnDefinitions.get(name); + if (!origDef.isCompatible(newDef)) { + throw new IllegalStateException("initDef must be idempotent but column '" + name + "' changed from " + + origDef.describeForCompatibility() + " to " + newDef.describeForCompatibility()); + } + }; + + usedColumns.forEach(validateColumn); + usedColumnArrays.forEach(validateColumn); + } @Override public List getColumns() { @@ -221,17 +234,10 @@ private ColumnSource getViewColumnSource(boolean lazy) { private Formula getFormula(boolean initLazyMap, Map> columnsToData, QueryScopeParam... params) { - if (formulaFactory == null) { - formulaFactory = useKernelFormulas ? createKernelFormulaFactory() : createFormulaFactory(); - } formula = formulaFactory.createFormula(rowSet, initLazyMap, columnsToData, params); return formula; } - protected FormulaFactory createFormulaFactory() { - throw new UnsupportedOperationException(); - } - @SuppressWarnings("unchecked") private static Vector makeAppropriateVectorWrapper(ColumnSource cs, RowSet rowSet) { final Class type = cs.getType(); @@ -262,8 +268,7 @@ private static Vector makeAppropriateVectorWrapper(ColumnSource cs, RowSet return new ObjectVectorColumnWrapper<>((ColumnSource) cs, rowSet); } - private FormulaFactory createKernelFormulaFactory() { - final FormulaKernelFactory formulaKernelFactory = getFormulaKernelFactory(); + protected FormulaFactory createKernelFormulaFactory(final FormulaKernelFactory formulaKernelFactory) { final FormulaSourceDescriptor sd = getSourceDescriptor(); return (rowSet, lazy, columnsToData, params) -> { @@ -287,8 +292,6 @@ private FormulaFactory createKernelFormulaFactory() { protected abstract FormulaSourceDescriptor getSourceDescriptor(); - protected abstract FormulaKernelFactory getFormulaKernelFactory(); - @Override public String getName() { return columnName; @@ -331,16 +334,16 @@ static class ColumnArrayParameter { final Class dataType; final Class vectorType; final String vectorTypeString; - final ColumnSource columnSource; + final ColumnDefinition columnDefinition; public ColumnArrayParameter(String name, String bareName, Class dataType, Class vectorType, - String vectorTypeString, ColumnSource columnSource) { + String vectorTypeString, ColumnDefinition columnDefinition) { this.name = name; this.bareName = bareName; this.dataType = dataType; this.vectorType = vectorType; this.vectorTypeString = vectorTypeString; - this.columnSource = columnSource; + this.columnDefinition = columnDefinition; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AjMatchPairFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AjMatchPairFactory.java deleted file mode 100644 index 165b9c1bbc8..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AjMatchPairFactory.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.select; - -import io.deephaven.base.Pair; -import io.deephaven.engine.table.MatchPair; -import io.deephaven.engine.table.Table; -import io.deephaven.engine.util.AbstractExpressionFactory; -import io.deephaven.engine.util.ExpressionParser; - -import java.util.Collection; -import java.util.regex.Matcher; - -import static io.deephaven.engine.table.impl.select.SelectFactoryConstants.*; - -/** - * MatchPair Factory that accepts final value of either =, <=, or <, > >= and returns a Pair<MatchPair, - * Table.AsOfMatchRule>. - */ -public class AjMatchPairFactory { - private enum AsOfMatchRule { - Equal, Less_Than, Less_Than_Equal, Greater_Than, Greater_Than_Equal; - - Table.AsOfMatchRule toTableMatchRule(boolean reverse) { - switch (this) { - case Equal: - return reverse ? Table.AsOfMatchRule.GREATER_THAN_EQUAL : Table.AsOfMatchRule.LESS_THAN_EQUAL; - case Less_Than: - return Table.AsOfMatchRule.LESS_THAN; - case Less_Than_Equal: - return Table.AsOfMatchRule.LESS_THAN_EQUAL; - case Greater_Than: - return Table.AsOfMatchRule.GREATER_THAN; - case Greater_Than_Equal: - return Table.AsOfMatchRule.GREATER_THAN_EQUAL; - } - throw new IllegalArgumentException(); - } - } - - private static final ExpressionParser> finalColumnParser = new ExpressionParser<>(); - static { - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - String columnName = matcher.group(1); - return new Pair<>(new MatchPair(columnName, columnName), AsOfMatchRule.Equal); - } - }); - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")\\s*==?\\s*(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - return new Pair<>(new MatchPair(matcher.group(1), matcher.group(2)), AsOfMatchRule.Equal); - } - }); - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")\\s*<=\\s*(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - return new Pair<>(new MatchPair(matcher.group(1), matcher.group(2)), AsOfMatchRule.Less_Than_Equal); - } - }); - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")\\s*<\\s*(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - return new Pair<>(new MatchPair(matcher.group(1), matcher.group(2)), AsOfMatchRule.Less_Than); - } - }); - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")\\s*>=\\s*(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - return new Pair<>(new MatchPair(matcher.group(1), matcher.group(2)), AsOfMatchRule.Greater_Than_Equal); - } - }); - finalColumnParser.registerFactory(new AbstractExpressionFactory>( - START_PTRN + "(" + ID_PTRN + ")\\s*>\\s*(" + ID_PTRN + ")" + END_PTRN) { - @Override - public Pair getExpression(String expression, Matcher matcher, Object... args) { - return new Pair<>(new MatchPair(matcher.group(1), matcher.group(2)), AsOfMatchRule.Greater_Than); - } - }); - } - - public static Pair getExpression(boolean reverse, String match) { - Pair parse = finalColumnParser.parse(match); - return new Pair<>(parse.first, parse.second.toTableMatchRule(reverse)); - } - - @SuppressWarnings("WeakerAccess") - public static Pair getExpressions(boolean reverse, String... matches) { - MatchPair[] result = new MatchPair[matches.length]; - for (int ii = 0; ii < matches.length - 1; ++ii) { - result[ii] = MatchPairFactory.getExpression(matches[ii]); - } - - Pair finalColumn = getExpression(reverse, matches[matches.length - 1]); - result[matches.length - 1] = finalColumn.first; - - return new Pair<>(result, finalColumn.second); - } - - public static Pair getExpressions(boolean reverse, Collection matches) { - return getExpressions(reverse, matches.toArray(new String[matches.size()])); - } -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AutoTuningIncrementalReleaseFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AutoTuningIncrementalReleaseFilter.java index f23ee103255..883e52637c0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AutoTuningIncrementalReleaseFilter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AutoTuningIncrementalReleaseFilter.java @@ -39,7 +39,7 @@ * The AutotuningIncrementalReleaseFilter can be used to benchmark how many rows of data a query can process. In its * simplest form we can measure how many rows a lastBy statement can process. For example: *

    - * + * *
      * import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter
      *
    @@ -48,21 +48,21 @@
      * quotesFiltered = quotes.where(filter)
      * currentQuote = quotesFiltered.lastBy("LocalCodeStr").update("Mid=(Bid + Ask)/2")
      * 
    - * + * * Produces a currentQuote table, and you can view the Log tab to determine how many rows per second were processed. The * summary is sent to the WARN level: - * + * *
      * 12:55:49.985 WARN Completed release 6.97 seconds, rows=19630961, rows/second=2,817,053.86
      * 
    - * + * * If verbose mode is enabled, progress is displayed for each cycle at the INFO level. *

    * *

    * You may specify a StreamLoggerImpl() to send the data to STDOUT, as follows: *

    - * + * *
      * import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter
      *
    @@ -84,7 +84,7 @@
      * is not possible to differentiate which table is contributing more to the query's load without examining the
      * performance tables. You may need to adjust the initial size parameters so that one table does not complete processing
      * before another.
    - * 
    + *
      * 
      * import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter
      *
    @@ -291,10 +291,4 @@ void onReleaseAll() {
             releasedAll = true;
             super.onReleaseAll();
         }
    -
    -    @Override
    -    public AutoTuningIncrementalReleaseFilter copy() {
    -        return new AutoTuningIncrementalReleaseFilter(getInitialSize(), initialRelease, targetFactor, verbose,
    -                timeProvider);
    -    }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/BaseIncrementalReleaseFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/BaseIncrementalReleaseFilter.java
    index 49449a26a42..1d02f95f4e2 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/BaseIncrementalReleaseFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/BaseIncrementalReleaseFilter.java
    @@ -162,7 +162,7 @@ public void waitForCompletion(long timeoutMillis) throws InterruptedException {
     
         /**
          * How many nanos between the first release event and the final release event?
    -     * 
    +     *
          * @return nano duration of this filter, or NULL_LONG if the filter is not completed
          */
         @ScriptApi
    @@ -210,7 +210,10 @@ public void setRecomputeListener(RecomputeListener listener) {
         }
     
         @Override
    -    abstract public BaseIncrementalReleaseFilter copy();
    +    public BaseIncrementalReleaseFilter copy() {
    +        throw new UnsupportedOperationException(getClass().getName() + " does not support automatic copy() due to " +
    +                "usage incompatibilities (internally-created instances cannot be start()ed)");
    +    }
     
         @Override
         public boolean isRefreshing() {
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ByteRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ByteRangeFilter.java
    index 4c615fb444d..578303b6baa 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ByteRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ByteRangeFilter.java
    @@ -76,7 +76,10 @@ ChunkFilter initChunkFilter() {
     
         @Override
         public ByteRangeFilter copy() {
    -        return new ByteRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final ByteRangeFilter copy = new ByteRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/CharRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/CharRangeFilter.java
    index c0de246df32..191da56953e 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/CharRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/CharRangeFilter.java
    @@ -71,7 +71,10 @@ ChunkFilter initChunkFilter() {
     
         @Override
         public CharRangeFilter copy() {
    -        return new CharRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final CharRangeFilter copy = new CharRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ComparableRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ComparableRangeFilter.java
    index ef952508c2c..84e0a12b69d 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ComparableRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ComparableRangeFilter.java
    @@ -76,7 +76,11 @@ public static ChunkFilter makeComparableChunkFilter(Comparable lower, Comparable
     
         @Override
         public WhereFilter copy() {
    -        return new ComparableRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final ComparableRangeFilter copy =
    +                new ComparableRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java
    index 3c275c4e379..fbeb6ed341f 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java
    @@ -5,7 +5,8 @@
     
     import io.deephaven.base.Pair;
     import io.deephaven.chunk.attributes.Any;
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.rowset.RowSetFactory;
     import io.deephaven.engine.table.Context;
     import io.deephaven.engine.table.SharedContext;
    @@ -15,8 +16,7 @@
     import io.deephaven.engine.table.TableDefinition;
     import io.deephaven.engine.table.impl.lang.QueryLanguageParser;
     import io.deephaven.engine.table.impl.util.codegen.CodeGenerator;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceNugget;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder;
    @@ -49,6 +49,7 @@ public class ConditionFilter extends AbstractConditionFilter {
         private List> usedInputs; // that is columns and special variables
         private String classBody;
         private Filter filter = null;
    +    private boolean filterValidForCopy = true;
     
         private ConditionFilter(@NotNull String formula) {
             super(formula, false);
    @@ -419,8 +420,11 @@ private StringBuilder getClassBody(TableDefinition tableDefinition, DateTimeUtil
                 usedInputs.add(new Pair<>("k", long.class));
             }
             final StringBuilder classBody = new StringBuilder();
    -        classBody.append(CodeGenerator.create(QueryLibrary.getImportStrings().toArray()).build()).append(
    -                "\n\npublic class $CLASSNAME$ implements ")
    +        classBody
    +                .append(CodeGenerator
    +                        .create(ExecutionContext.getContext().getQueryLibrary().getImportStrings().toArray()).build())
    +                .append(
    +                        "\n\npublic class $CLASSNAME$ implements ")
                     .append(FilterKernel.class.getCanonicalName()).append("{\n");
             classBody.append("\n").append(timeConversionResult.getInstanceVariablesString()).append("\n");
             final Indenter indenter = new Indenter();
    @@ -547,14 +551,16 @@ private StringBuilder getClassBody(TableDefinition tableDefinition, DateTimeUtil
         @Override
         protected Filter getFilter(Table table, RowSet fullSet)
                 throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    -        if (filter != null) {
    -            return filter;
    -        }
    -        final FilterKernel filterKernel = (FilterKernel) filterKernelClass
    -                .getConstructor(Table.class, RowSet.class, QueryScopeParam[].class)
    -                .newInstance(table, fullSet, (Object) params);
    -        final String[] columnNames = usedInputs.stream().map(p -> p.first).toArray(String[]::new);
    -        return new ChunkFilter(filterKernel, columnNames, CHUNK_SIZE);
    +        if (filter == null) {
    +            final FilterKernel filterKernel = (FilterKernel) filterKernelClass
    +                    .getConstructor(Table.class, RowSet.class, QueryScopeParam[].class)
    +                    .newInstance(table, fullSet, (Object) params);
    +            final String[] columnNames = usedInputs.stream().map(p -> p.first).toArray(String[]::new);
    +            filter = new ChunkFilter(filterKernel, columnNames, CHUNK_SIZE);
    +            // note this filter is not valid for use in other contexts, as it captures references from the source table
    +            filterValidForCopy = false;
    +        }
    +        return filter;
         }
     
         @Override
    @@ -564,7 +570,17 @@ protected void setFilter(Filter filter) {
     
         @Override
         public ConditionFilter copy() {
    -        return new ConditionFilter(formula, outerToInnerNames);
    +        final ConditionFilter copy = new ConditionFilter(formula, outerToInnerNames);
    +        onCopy(copy);
    +        if (initialized) {
    +            copy.filterKernelClass = filterKernelClass;
    +            copy.usedInputs = usedInputs;
    +            copy.classBody = classBody;
    +            if (filterValidForCopy) {
    +                copy.filter = filter;
    +            }
    +        }
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConjunctiveFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConjunctiveFilter.java
    index 6bac81514fc..ffac6de0568 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConjunctiveFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConjunctiveFilter.java
    @@ -56,8 +56,7 @@ public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, bool
     
         @Override
         public ConjunctiveFilter copy() {
    -        return new ConjunctiveFilter(
    -                Arrays.stream(getComponentFilters()).map(WhereFilter::copy).toArray(WhereFilter[]::new));
    +        return new ConjunctiveFilter(WhereFilter.copyFrom(getComponentFilters()));
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DateTimeRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DateTimeRangeFilter.java
    index fc6f01624aa..6eb683797c3 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DateTimeRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DateTimeRangeFilter.java
    @@ -53,7 +53,11 @@ public void init(TableDefinition tableDefinition) {
     
         @Override
         public DateTimeRangeFilter copy() {
    -        return new DateTimeRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final DateTimeRangeFilter copy =
    +                new DateTimeRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java
    index 5d2c84efcbf..dd1fe98b2d9 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java
    @@ -4,7 +4,8 @@
     package io.deephaven.engine.table.impl.select;
     
     import io.deephaven.configuration.Configuration;
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.table.ColumnDefinition;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.impl.lang.QueryLanguageParser;
    @@ -12,9 +13,7 @@
     import io.deephaven.engine.util.PythonScopeJpyImpl;
     import io.deephaven.time.DateTime;
     import io.deephaven.vector.ObjectVector;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceNugget;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder;
    @@ -65,8 +64,6 @@ public class DhFormulaColumn extends AbstractFormulaColumn {
                 Configuration.getInstance().getBooleanWithDefault("FormulaColumn.useKernelFormulasProperty", false);
     
         private FormulaAnalyzer.Result analyzedFormula;
    -    private String timeInstanceVariables;
    -    private Map> timeNewVariables = null;
     
         public FormulaColumnPython getFormulaColumnPython() {
             return formulaColumnPython;
    @@ -83,7 +80,7 @@ public FormulaColumnPython getFormulaColumnPython() {
          * @param formulaString the formula string to be parsed by the QueryLanguageParser
          */
         DhFormulaColumn(String columnName, String formulaString) {
    -        super(columnName, formulaString, useKernelFormulasProperty);
    +        super(columnName, formulaString);
         }
     
         /**
    @@ -111,22 +108,22 @@ private static  void addIfNotNull(List list, T item) {
             }
         }
     
    -    private static String columnSourceGetMethodReturnType(ColumnSource cs) {
    +    private static String columnSourceGetMethodReturnType(ColumnDefinition cd) {
             final StringBuilder sb = new StringBuilder();
    -        Class columnType = cs.getType();
    +        Class columnType = cd.getDataType();
             if (columnType == boolean.class) {
                 columnType = Boolean.class;
             }
             sb.append(columnType.getCanonicalName());
    -        final Class componentType = cs.getComponentType();
    +        final Class componentType = cd.getComponentType();
             if (componentType != null && !componentType.isPrimitive() && columnType.getTypeParameters().length == 1) {
                 sb.append("<").append(componentType.getCanonicalName()).append(">");
             }
             return sb.toString();
         }
     
    -    private static Map makeNameToRichTypeDict(final String[] names,
    -            final Map> columnSources) {
    +    private static Map makeNameToRichTypeDict(
    +            final String[] names, final Map> columnDefinitions) {
             final Map result = new HashMap<>();
             for (final String s : names) {
                 final RichType richType;
    @@ -135,8 +132,8 @@ private static Map makeNameToRichTypeDict(final String[] names
                 } else if (s.equals("ii") || s.equals("k")) {
                     richType = RichType.createNonGeneric(long.class);
                 } else {
    -                final ColumnSource cs = columnSources.get(s);
    -                Class columnType = cs.getType();
    +                final ColumnDefinition cs = columnDefinitions.get(s);
    +                Class columnType = cs.getDataType();
                     if (columnType == boolean.class) {
                         columnType = Boolean.class;
                     }
    @@ -154,11 +151,11 @@ private static Map makeNameToRichTypeDict(final String[] names
         }
     
         private static Map> makeNameToTypeDict(final String[] names,
    -            final Map> columnSources) {
    +            final Map> columnDefinitions) {
             final Map> result = new HashMap<>();
             for (final String s : names) {
    -            final ColumnSource cs = columnSources.get(s);
    -            result.put(s, cs.getType());
    +            final ColumnDefinition cd = columnDefinitions.get(s);
    +            result.put(s, cd.getDataType());
             }
             return result;
         }
    @@ -183,13 +180,19 @@ public static Class getVectorType(Class declaredType) {
     
         @Override
         public List initDef(Map> columnDefinitionMap) {
    +        if (formulaFactory != null) {
    +            validateColumnDefinition(columnDefinitionMap);
    +            return formulaColumnPython != null ? formulaColumnPython.usedColumns : usedColumns;
    +        }
    +
             try {
    -            analyzedFormula = FormulaAnalyzer.analyze(formulaString, columnDefinitionMap, timeNewVariables);
                 final DateTimeUtils.Result timeConversionResult = DateTimeUtils.convertExpression(formulaString);
                 final QueryLanguageParser.Result result = FormulaAnalyzer.getCompiledFormula(columnDefinitionMap,
    -                    timeConversionResult, timeNewVariables);
    +                    timeConversionResult);
    +            analyzedFormula = FormulaAnalyzer.analyze(formulaString, columnDefinitionMap,
    +                    timeConversionResult, result);
     
    -            log.debug().append("Expression (after language conversion) : ").append(result.getConvertedExpression())
    +            log.debug().append("Expression (after language conversion) : ").append(analyzedFormula.cookedFormulaString)
                         .endl();
     
                 applyUsedVariables(columnDefinitionMap, result.getVariablesUsed());
    @@ -197,15 +200,7 @@ public List initDef(Map> columnDefinitionMap
                 if (returnedType == boolean.class) {
                     returnedType = Boolean.class;
                 }
    -            // The first time we do an initDef, we allow the formulaString to be transformed by DateTimeUtils,
    -            // possibly with the side effect of creating 'timeInstanceVariables' and 'timeNewVariables'.
    -            // However, we should not do this on subsequent calls because the answer is not expected to
    -            // change further, and we don't want to overwrite our 'timeInstanceVariables'.
    -            if (timeNewVariables == null) {
    -                formulaString = result.getConvertedExpression();
    -                timeInstanceVariables = timeConversionResult.getInstanceVariablesString();
    -                timeNewVariables = timeConversionResult.getNewVariables();
    -            }
    +            formulaString = result.getConvertedExpression();
             } catch (Exception e) {
                 throw new FormulaCompilationException("Formula compilation error for: " + formulaString, e);
             }
    @@ -220,28 +215,27 @@ public List initDef(Map> columnDefinitionMap
                                     numbaCallableWrapper.getReturnType(), this.analyzedFormula.sourceDescriptor.sources,
                                     true));
                     formulaColumnPython.initDef(columnDefinitionMap);
    -                return formulaColumnPython.usedColumns;
    +                break;
                 }
             }
     
    -        return usedColumns;
    +        formulaFactory = useKernelFormulasProperty
    +                ? createKernelFormulaFactory(getFormulaKernelFactory())
    +                : createFormulaFactory();
    +        return formulaColumnPython != null ? formulaColumnPython.usedColumns : usedColumns;
         }
     
         @NotNull
         String generateClassBody() {
    -        if (params == null) {
    -            params = QueryScope.getScope().getParams(userParams);
    -        }
    -
             final TypeAnalyzer ta = TypeAnalyzer.create(returnedType);
     
             final CodeGenerator g = CodeGenerator.create(
    -                CodeGenerator.create(QueryLibrary.getImportStrings().toArray()), "",
    +                CodeGenerator.create(ExecutionContext.getContext().getQueryLibrary().getImportStrings().toArray()), "",
                     "public class $CLASSNAME$ extends [[FORMULA_CLASS_NAME]]", CodeGenerator.block(
                             generateFormulaFactoryLambda(), "",
                             CodeGenerator.repeated("instanceVar", "private final [[TYPE]] [[NAME]];"),
                             "private final Map [[LAZY_RESULT_CACHE_NAME]];",
    -                        timeInstanceVariables, "",
    +                        analyzedFormula.timeInstanceVariables, "",
                             generateConstructor(), "",
                             generateAppropriateGetMethod(ta, false), "",
                             generateAppropriateGetMethod(ta, true), "",
    @@ -318,7 +312,7 @@ private CodeGenerator generateConstructor() {
                         fc.replace("COLUMN_ARRAY_NAME", ac.name);
                         fc.replace("COLUMN_NAME", ac.bareName);
     
    -                    final String vtp = getVectorType(ac.columnSource.getType()).getCanonicalName().replace(
    +                    final String vtp = getVectorType(ac.columnDefinition.getDataType()).getCanonicalName().replace(
                                 "io.deephaven.vector",
                                 "io.deephaven.engine.table.impl.vector");
                         fc.replace("VECTOR_TYPE_PREFIX", vtp);
    @@ -528,7 +522,7 @@ private CodeGenerator generateFillChunk(boolean usePrev) {
                         final CodeGenerator getChunks = g.instantiateNewRepeated("getChunks");
                         getChunks.replace("COL_SOURCE_NAME", cs.name);
                         getChunks.replace("GET_CURR_OR_PREV_CHUNK", usePrev ? "getPrevChunk" : "getChunk");
    -                    final TypeAnalyzer tm = TypeAnalyzer.create(cs.columnSource.getType());
    +                    final TypeAnalyzer tm = TypeAnalyzer.create(cs.columnDefinition.getDataType());
                         getChunks.replace("CHUNK_TYPE", tm.readChunkVariableType);
                         getChunks.replace("AS_CHUNK_METHOD", tm.asReadChunkMethodName);
                         return "__chunk__col__" + cs.name;
    @@ -590,7 +584,7 @@ private CodeGenerator generateFillChunkHelper(TypeAnalyzer ta) {
             final List chunkArgs = visitFormulaParameters(null,
                     cs -> {
                         final String name = "__chunk__col__" + cs.name;
    -                    final TypeAnalyzer t2 = TypeAnalyzer.create(cs.columnSource.getType());
    +                    final TypeAnalyzer t2 = TypeAnalyzer.create(cs.columnDefinition.getDataType());
                         return t2.readChunkVariableType + " " + name;
                     },
                     null,
    @@ -651,26 +645,26 @@ private  List visitFormulaParameters(
     
             if (columnSourceLambda != null) {
                 for (String usedColumn : usedColumns) {
    -                final ColumnSource cs = columnSources.get(usedColumn);
    -                final String columnSourceGetType = columnSourceGetMethodReturnType(cs);
    -                final Class csType = cs.getType();
    +                final ColumnDefinition cd = columnDefinitions.get(usedColumn);
    +                final String columnSourceGetType = columnSourceGetMethodReturnType(cd);
    +                final Class csType = cd.getDataType();
                     final String csTypeString = COLUMN_SOURCE_CLASSNAME + '<'
    -                        + io.deephaven.util.type.TypeUtils.getBoxedType(cs.getType()).getCanonicalName() + '>';
    +                        + io.deephaven.util.type.TypeUtils.getBoxedType(csType).getCanonicalName() + '>';
                     final ColumnSourceParameter csp = new ColumnSourceParameter(usedColumn, csType, columnSourceGetType,
    -                        cs, csTypeString);
    +                        cd, csTypeString);
                     addIfNotNull(results, columnSourceLambda.apply(csp));
                 }
             }
     
             if (columnArrayLambda != null) {
                 for (String uca : usedColumnArrays) {
    -                final ColumnSource cs = columnSources.get(uca);
    -                final Class dataType = cs.getType();
    +                final ColumnDefinition cd = columnDefinitions.get(uca);
    +                final Class dataType = cd.getDataType();
                     final Class vectorType = getVectorType(dataType);
                     final String vectorTypeAsString = vectorType.getCanonicalName() +
                             (TypeUtils.isConvertibleToPrimitive(dataType) ? "" : "<" + dataType.getCanonicalName() + ">");
                     final ColumnArrayParameter cap = new ColumnArrayParameter(uca + COLUMN_SUFFIX, uca,
    -                        dataType, vectorType, vectorTypeAsString, cs);
    +                        dataType, vectorType, vectorTypeAsString, cd);
                     addIfNotNull(results, columnArrayLambda.apply(cap));
                 }
             }
    @@ -698,8 +692,8 @@ protected FormulaKernelFactory getFormulaKernelFactory() {
         private JavaKernelBuilder.Result invokeKernelBuilder() {
             final FormulaAnalyzer.Result af = analyzedFormula;
             final FormulaSourceDescriptor sd = af.sourceDescriptor;
    -        final Map columnDict = makeNameToRichTypeDict(sd.sources, columnSources);
    -        final Map> arrayDict = makeNameToTypeDict(sd.arrays, columnSources);
    +        final Map columnDict = makeNameToRichTypeDict(sd.sources, columnDefinitions);
    +        final Map> arrayDict = makeNameToTypeDict(sd.arrays, columnDefinitions);
             final Map> allParamDict = new HashMap<>();
             for (final QueryScopeParam param : params) {
                 allParamDict.put(param.getName(), QueryScopeParamTypeUtil.getDeclaredClass(param.getValue()));
    @@ -722,10 +716,17 @@ String generateKernelClassBody() {
     
         @Override
         public SelectColumn copy() {
    -        return new DhFormulaColumn(columnName, formulaString);
    +        final DhFormulaColumn copy = new DhFormulaColumn(columnName, formulaString);
    +        if (formulaFactory != null) {
    +            copy.analyzedFormula = analyzedFormula;
    +            copy.returnedType = returnedType;
    +            copy.formulaColumnPython = formulaColumnPython;
    +            onCopy(copy);
    +        }
    +        return copy;
         }
     
    -    protected FormulaFactory createFormulaFactory() {
    +    private FormulaFactory createFormulaFactory() {
             final String classBody = generateClassBody();
             final String what = "Compile regular formula: " + formulaString;
             final Class clazz = compileFormula(what, classBody, "Formula");
    @@ -752,12 +753,12 @@ private Class compileFormula(final String what, final String classBody, final
                 visitFormulaParameters(null,
                         csp -> {
                             addParamClass.accept(csp.type);
    -                        addParamClass.accept(csp.columnSource.getComponentType());
    +                        addParamClass.accept(csp.columnDefinition.getComponentType());
                             return null;
                         },
                         cap -> {
                             addParamClass.accept(cap.dataType);
    -                        addParamClass.accept(cap.columnSource.getComponentType());
    +                        addParamClass.accept(cap.columnDefinition.getComponentType());
                             return null;
                         },
                         p -> {
    @@ -790,20 +791,20 @@ private static class ColumnSourceParameter {
             final String name;
             final Class type;
             final String typeString;
    -        final ColumnSource columnSource;
    +        final ColumnDefinition columnDefinition;
             final String columnSourceGetTypeString;
     
    -        public ColumnSourceParameter(String name, Class type, String typeString, ColumnSource columnSource,
    -                String columnSourceGetTypeString) {
    +        public ColumnSourceParameter(String name, Class type, String typeString,
    +                ColumnDefinition columnDefinition, String columnSourceGetTypeString) {
                 this.name = name;
                 this.type = type;
                 this.typeString = typeString;
    -            this.columnSource = columnSource;
    +            this.columnDefinition = columnDefinition;
                 this.columnSourceGetTypeString = columnSourceGetTypeString;
             }
     
             String makeGetExpression(boolean usePrev) {
    -            return String.format("%s.%s(k)", name, getGetterName(columnSource.getType(), usePrev));
    +            return String.format("%s.%s(k)", name, getGetterName(columnDefinition.getDataType(), usePrev));
             }
         }
     
    @@ -849,7 +850,7 @@ private static boolean isPythonType(QueryScopeParam param) {
             }
     
             // beyond the immutable types, we must assume that anything coming from Python is python
    -        return QueryScope.getScope() instanceof PythonScope;
    +        return ExecutionContext.getContext().getQueryScope() instanceof PythonScope;
         }
     
         private boolean isUsedColumnStateless(String columnName) {
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DisjunctiveFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DisjunctiveFilter.java
    index d638a643dde..cc9aaa1506d 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DisjunctiveFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DisjunctiveFilter.java
    @@ -70,8 +70,7 @@ public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, bool
     
         @Override
         public DisjunctiveFilter copy() {
    -        return new DisjunctiveFilter(
    -                Arrays.stream(getComponentFilters()).map(WhereFilter::copy).toArray(WhereFilter[]::new));
    +        return new DisjunctiveFilter(WhereFilter.copyFrom(getComponentFilters()));
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DoubleRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DoubleRangeFilter.java
    index f9eef797fcb..d1067f0cc67 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DoubleRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DoubleRangeFilter.java
    @@ -78,7 +78,10 @@ public void init(TableDefinition tableDefinition) {
     
         @Override
         public DoubleRangeFilter copy() {
    -        return new DoubleRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final DoubleRangeFilter copy = new DoubleRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FloatRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FloatRangeFilter.java
    index 7720c732692..924d7a7e975 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FloatRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FloatRangeFilter.java
    @@ -73,7 +73,10 @@ public void init(TableDefinition tableDefinition) {
     
         @Override
         public FloatRangeFilter copy() {
    -        return new FloatRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final FloatRangeFilter copy = new FloatRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FormulaColumn.java
    index e8535f2d8a1..306e4199942 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FormulaColumn.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FormulaColumn.java
    @@ -3,9 +3,6 @@
      */
     package io.deephaven.engine.table.impl.select;
     
    -import io.deephaven.engine.table.ColumnSource;
    -import io.deephaven.engine.table.WritableColumnSource;
    -
     public interface FormulaColumn extends SelectColumn {
     
         static FormulaColumn createFormulaColumn(String columnName, String formulaString,
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IncrementalReleaseFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IncrementalReleaseFilter.java
    index 555082deedb..9ac06007c8e 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IncrementalReleaseFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IncrementalReleaseFilter.java
    @@ -24,9 +24,4 @@ public IncrementalReleaseFilter(long initialSize, long sizeIncrement) {
         long getSizeIncrement() {
             return sizeIncrement;
         }
    -
    -    @Override
    -    public IncrementalReleaseFilter copy() {
    -        return new IncrementalReleaseFilter(getInitialSize(), sizeIncrement);
    -    }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IntRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IntRangeFilter.java
    index 1d711b7dd03..70dc62dde40 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IntRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/IntRangeFilter.java
    @@ -76,7 +76,10 @@ ChunkFilter initChunkFilter() {
     
         @Override
         public IntRangeFilter copy() {
    -        return new IntRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final IntRangeFilter copy = new IntRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/LongRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/LongRangeFilter.java
    index dff29ad35d7..51814b517ae 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/LongRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/LongRangeFilter.java
    @@ -76,7 +76,10 @@ ChunkFilter initChunkFilter() {
     
         @Override
         public LongRangeFilter copy() {
    -        return new LongRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final LongRangeFilter copy = new LongRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchFilter.java
    index 193fb0befc6..362797b13d5 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchFilter.java
    @@ -4,12 +4,13 @@
     package io.deephaven.engine.table.impl.select;
     
     import io.deephaven.base.string.cache.CompressedString;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.rowset.WritableRowSet;
     import io.deephaven.engine.table.ColumnDefinition;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.TableDefinition;
     import io.deephaven.engine.table.impl.preview.DisplayWrapper;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.util.type.ArrayTypeUtils;
     import io.deephaven.time.DateTime;
    @@ -102,50 +103,48 @@ public List getColumnArrays() {
         }
     
         @Override
    -    public void init(TableDefinition tableDefinition) {
    -        synchronized (this) {
    -            if (initialized || strValues == null) {
    -                return;
    -            }
    -            ColumnDefinition column = tableDefinition.getColumn(columnName);
    -            if (column == null) {
    -                throw new RuntimeException("Column \"" + columnName
    -                        + "\" doesn't exist in this table, available columns: " + tableDefinition.getColumnNames());
    -            }
    -            final List valueList = new ArrayList<>();
    -            final QueryScope queryScope = QueryScope.getScope();
    -            final ColumnTypeConvertor convertor =
    -                    ColumnTypeConvertorFactory.getConvertor(column.getDataType(), column.getName());
    -            for (int valIdx = 0; valIdx < strValues.length; ++valIdx) {
    -                if (queryScope.hasParamName(strValues[valIdx])) {
    -                    Object paramValue = queryScope.readParamValue(strValues[valIdx]);
    -                    if (paramValue != null && paramValue.getClass().isArray()) {
    -                        ArrayTypeUtils.ArrayAccessor accessor = ArrayTypeUtils.getArrayAccessor(paramValue);
    -                        for (int ai = 0; ai < accessor.length(); ++ai) {
    -                            valueList.add(convertor.convertParamValue(accessor.get(ai)));
    -                        }
    -                    } else if (paramValue != null && Collection.class.isAssignableFrom(paramValue.getClass())) {
    -                        for (final Object paramValueMember : (Collection) paramValue) {
    -                            valueList.add(convertor.convertParamValue(paramValueMember));
    -                        }
    -                    } else {
    -                        valueList.add(convertor.convertParamValue(paramValue));
    +    public synchronized void init(TableDefinition tableDefinition) {
    +        if (initialized || strValues == null) {
    +            return;
    +        }
    +        ColumnDefinition column = tableDefinition.getColumn(columnName);
    +        if (column == null) {
    +            throw new RuntimeException("Column \"" + columnName
    +                    + "\" doesn't exist in this table, available columns: " + tableDefinition.getColumnNames());
    +        }
    +        final List valueList = new ArrayList<>();
    +        final QueryScope queryScope = ExecutionContext.getContext().getQueryScope();
    +        final ColumnTypeConvertor convertor =
    +                ColumnTypeConvertorFactory.getConvertor(column.getDataType(), column.getName());
    +        for (String strValue : strValues) {
    +            if (queryScope.hasParamName(strValue)) {
    +                Object paramValue = queryScope.readParamValue(strValue);
    +                if (paramValue != null && paramValue.getClass().isArray()) {
    +                    ArrayTypeUtils.ArrayAccessor accessor = ArrayTypeUtils.getArrayAccessor(paramValue);
    +                    for (int ai = 0; ai < accessor.length(); ++ai) {
    +                        valueList.add(convertor.convertParamValue(accessor.get(ai)));
                         }
    -                } else {
    -                    Object convertedValue;
    -                    try {
    -                        convertedValue = convertor.convertStringLiteral(strValues[valIdx]);
    -                    } catch (Throwable t) {
    -                        throw new IllegalArgumentException("Failed to convert literal value <" + strValues[valIdx] +
    -                                "> for column \"" + columnName + "\" of type " + column.getDataType().getName(), t);
    +                } else if (paramValue != null && Collection.class.isAssignableFrom(paramValue.getClass())) {
    +                    for (final Object paramValueMember : (Collection) paramValue) {
    +                        valueList.add(convertor.convertParamValue(paramValueMember));
                         }
    -                    valueList.add(convertedValue);
    +                } else {
    +                    valueList.add(convertor.convertParamValue(paramValue));
    +                }
    +            } else {
    +                Object convertedValue;
    +                try {
    +                    convertedValue = convertor.convertStringLiteral(strValue);
    +                } catch (Throwable t) {
    +                    throw new IllegalArgumentException("Failed to convert literal value <" + strValue +
    +                            "> for column \"" + columnName + "\" of type " + column.getDataType().getName(), t);
                     }
    +                valueList.add(convertedValue);
                 }
    -            // values = (Object[])ArrayTypeUtils.toArray(valueList, TypeUtils.getBoxedType(theColumn.getDataType()));
    -            values = valueList.toArray();
    -            initialized = true;
             }
    +        // values = (Object[])ArrayTypeUtils.toArray(valueList, TypeUtils.getBoxedType(theColumn.getDataType()));
    +        values = valueList.toArray();
    +        initialized = true;
         }
     
         @Override
    @@ -414,12 +413,17 @@ public boolean canMemoize() {
     
         @Override
         public WhereFilter copy() {
    +        final MatchFilter copy;
             if (strValues != null) {
    -            return new MatchFilter(caseInsensitive ? CaseSensitivity.IgnoreCase : CaseSensitivity.MatchCase,
    +            copy = new MatchFilter(caseInsensitive ? CaseSensitivity.IgnoreCase : CaseSensitivity.MatchCase,
                         getMatchType(), columnName, strValues);
             } else {
    -            return new MatchFilter(getMatchType(), columnName, values);
    -
    +            copy = new MatchFilter(getMatchType(), columnName, values);
    +        }
    +        if (initialized) {
    +            copy.initialized = true;
    +            copy.values = values;
             }
    +        return copy;
         }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchPairFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchPairFactory.java
    index 55220d3b277..e29be53e558 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchPairFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MatchPairFactory.java
    @@ -4,13 +4,13 @@
     package io.deephaven.engine.table.impl.select;
     
     import io.deephaven.engine.table.MatchPair;
    -import io.deephaven.engine.util.ExpressionParser;
    -import io.deephaven.engine.util.AbstractExpressionFactory;
    +import io.deephaven.api.expression.ExpressionParser;
    +import io.deephaven.api.expression.AbstractExpressionFactory;
     
     import java.util.Collection;
     import java.util.regex.Matcher;
     
    -import static io.deephaven.engine.table.impl.select.SelectFactoryConstants.*;
    +import static io.deephaven.api.expression.SelectFactoryConstants.*;
     
     /**
      * Parses strings of the form "Column" or "Column1=Column2" into a MatchPair (or array of them).
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/PatternFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/PatternFilter.java
    index 467eedd94f2..666b50cbb75 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/PatternFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/PatternFilter.java
    @@ -76,19 +76,17 @@ public List getColumnArrays() {
         }
     
         @Override
    -    public void init(TableDefinition tableDefinition) {
    -        synchronized (this) {
    -            if (pattern != null) {
    -                return;
    -            }
    -
    -            final ColumnDefinition column = tableDefinition.getColumn(columnName);
    -            if (column == null) {
    -                throw new RuntimeException("Column \"" + columnName
    -                        + "\" doesn't exist in this table, available columns: " + tableDefinition.getColumnNames());
    -            }
    -            pattern = compile(value, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0);
    +    public synchronized void init(TableDefinition tableDefinition) {
    +        if (pattern != null) {
    +            return;
             }
    +
    +        final ColumnDefinition column = tableDefinition.getColumn(columnName);
    +        if (column == null) {
    +            throw new RuntimeException("Column \"" + columnName
    +                    + "\" doesn't exist in this table, available columns: " + tableDefinition.getColumnNames());
    +        }
    +        pattern = compile(value, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0);
         }
     
         protected abstract Pattern compile(String value, int flags);
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java
    index 536ed8d1551..c1a25668420 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java
    @@ -4,7 +4,7 @@
     package io.deephaven.engine.table.impl.select;
     
     import groovy.lang.Closure;
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
     import io.deephaven.util.type.TypeUtils;
     
     import java.lang.reflect.Modifier;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RegexFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RegexFilter.java
    index 39669a77a72..11513dd3943 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RegexFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RegexFilter.java
    @@ -50,6 +50,8 @@ public String toString() {
     
         @Override
         public RegexFilter copy() {
    -        return new RegexFilter(getCaseSensitivity(), getMatchType(), columnName, value);
    +        final RegexFilter copy = new RegexFilter(getCaseSensitivity(), getMatchType(), columnName, value);
    +        copy.pattern = pattern;
    +        return copy;
         }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RollingReleaseFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RollingReleaseFilter.java
    index b3705fa744d..26921494034 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RollingReleaseFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/RollingReleaseFilter.java
    @@ -3,6 +3,7 @@
      */
     package io.deephaven.engine.table.impl.select;
     
    +import io.deephaven.base.verify.Assert;
     import io.deephaven.engine.rowset.TrackingWritableRowSet;
     import io.deephaven.engine.rowset.WritableRowSet;
     import io.deephaven.engine.table.Table;
    @@ -24,8 +25,6 @@ public class RollingReleaseFilter extends WhereFilterLivenessArtifactImpl implem
         private RecomputeListener listener;
         private boolean releaseMoreEntries = false;
     
    -    transient private boolean addedToUpdateGraphProcessor = false;
    -
         public RollingReleaseFilter(long workingSize, long rollingSize) {
             this.workingSize = workingSize;
             this.rollingSize = rollingSize;
    @@ -42,12 +41,7 @@ public List getColumnArrays() {
         }
     
         @Override
    -    public void init(TableDefinition tableDefinition) {
    -        if (!addedToUpdateGraphProcessor) {
    -            UpdateGraphProcessor.DEFAULT.addSource(this);
    -            addedToUpdateGraphProcessor = true;
    -        }
    -    }
    +    public void init(TableDefinition tableDefinition) {}
     
         @Override
         public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, boolean usePrev) {
    @@ -82,8 +76,10 @@ public boolean isSimpleFilter() {
     
         @Override
         public void setRecomputeListener(RecomputeListener listener) {
    +        Assert.eqNull(this.listener, "this.listener");
             this.listener = listener;
             listener.setIsRefreshing(true);
    +        UpdateGraphProcessor.DEFAULT.addSource(this);
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java
    index d32d292b373..f1aec384ff6 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java
    @@ -34,6 +34,10 @@ static SelectColumn[] from(Collection selectables) {
             return selectables.stream().map(SelectColumn::of).toArray(SelectColumn[]::new);
         }
     
    +    static SelectColumn[] copyFrom(SelectColumn[] selectColumns) {
    +        return Arrays.stream(selectColumns).map(SelectColumn::copy).toArray(SelectColumn[]::new);
    +    }
    +
         /**
          * Convenient static final instance of a zero length Array of SelectColumns for use in toArray calls.
          */
    @@ -64,6 +68,9 @@ static SelectColumn[] from(Collection selectables) {
          * @param columnDefinitionMap the starting set of column definitions
          *
          * @return a list of columns on which the result of this is dependent
    +     * @apiNote Any {@link io.deephaven.engine.context.QueryLibrary}, {@link io.deephaven.engine.context.QueryScope}, or
    +     *          {@link io.deephaven.engine.context.CompilerTools} usage needs to be resolved within initDef.
    +     *          Implementations must be idempotent.
          */
         List initDef(Map> columnDefinitionMap);
     
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumnFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumnFactory.java
    index b21396d5068..bb8d99ab57b 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumnFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumnFactory.java
    @@ -4,8 +4,8 @@
     package io.deephaven.engine.table.impl.select;
     
     import io.deephaven.base.Pair;
    -import io.deephaven.engine.util.AbstractExpressionFactory;
    -import io.deephaven.engine.util.ExpressionParser;
    +import io.deephaven.api.expression.AbstractExpressionFactory;
    +import io.deephaven.api.expression.ExpressionParser;
     import io.deephaven.engine.util.ColumnFormattingValues;
     
     import java.util.Arrays;
    @@ -13,7 +13,7 @@
     import java.util.regex.Matcher;
     import java.util.regex.Pattern;
     
    -import static io.deephaven.engine.table.impl.select.SelectFactoryConstants.*;
    +import static io.deephaven.api.expression.SelectFactoryConstants.*;
     
     /**
      * A factory to create {@link SelectColumn}s from an input expression.
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ShortRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ShortRangeFilter.java
    index 051c1435eba..ed78f79291e 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ShortRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ShortRangeFilter.java
    @@ -76,7 +76,10 @@ ChunkFilter initChunkFilter() {
     
         @Override
         public ShortRangeFilter copy() {
    -        return new ShortRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        final ShortRangeFilter copy = new ShortRangeFilter(columnName, lower, upper, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SingleSidedComparableRangeFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SingleSidedComparableRangeFilter.java
    index 374846e6bc9..23357437a6b 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SingleSidedComparableRangeFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SingleSidedComparableRangeFilter.java
    @@ -68,7 +68,11 @@ public static ChunkFilter makeComparableChunkFilter(Comparable pivot, boolean
     
         @Override
         public WhereFilter copy() {
    -        return new SingleSidedComparableRangeFilter(columnName, pivot, lowerInclusive, upperInclusive);
    +        final SingleSidedComparableRangeFilter copy =
    +                new SingleSidedComparableRangeFilter(columnName, pivot, lowerInclusive, upperInclusive);
    +        copy.chunkFilter = chunkFilter;
    +        copy.longFilter = longFilter;
    +        return copy;
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/StringContainsFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/StringContainsFilter.java
    index 58b33b109f0..6ff0f826ff4 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/StringContainsFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/StringContainsFilter.java
    @@ -103,6 +103,9 @@ public String toString() {
     
         @Override
         public StringContainsFilter copy() {
    -        return new StringContainsFilter(getCaseSensitivity(), getMatchType(), columnName, values);
    +        final StringContainsFilter copy =
    +                new StringContainsFilter(getCaseSensitivity(), getMatchType(), columnName, values);
    +        copy.pattern = pattern;
    +        return copy;
         }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java
    index 1022bd34c76..4dbb903d1c8 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SwitchColumn.java
    @@ -148,6 +148,10 @@ public boolean isStateless() {
     
         @Override
         public SwitchColumn copy() {
    -        return new SwitchColumn(columnName, expression, parser);
    +        final SwitchColumn switchColumn = new SwitchColumn(columnName, expression, parser);
    +        if (realColumn != null) {
    +            switchColumn.realColumn = realColumn.copy();
    +        }
    +        return switchColumn;
         }
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/TimeSeriesFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/TimeSeriesFilter.java
    index 0740e7f1cb4..c06445a0e79 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/TimeSeriesFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/TimeSeriesFilter.java
    @@ -8,6 +8,7 @@
     
     package io.deephaven.engine.table.impl.select;
     
    +import io.deephaven.base.verify.Assert;
     import io.deephaven.base.verify.Require;
     import io.deephaven.engine.rowset.WritableRowSet;
     import io.deephaven.engine.rowset.RowSet;
    @@ -30,7 +31,6 @@ public class TimeSeriesFilter extends WhereFilterLivenessArtifactImpl implements
         protected final String columnName;
         protected final long nanos;
         private RecomputeListener listener;
    -    transient private boolean initialized = false;
     
         @SuppressWarnings("UnusedDeclaration")
         public TimeSeriesFilter(String columnName, String period) {
    @@ -54,14 +54,7 @@ public List getColumnArrays() {
         }
     
         @Override
    -    public void init(TableDefinition tableDefinition) {
    -        if (initialized) {
    -            return;
    -        }
    -
    -        UpdateGraphProcessor.DEFAULT.addSource(this);
    -        initialized = true;
    -    }
    +    public void init(TableDefinition tableDefinition) {}
     
         @Override
         public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, boolean usePrev) {
    @@ -101,8 +94,10 @@ public boolean isSimpleFilter() {
     
         @Override
         public void setRecomputeListener(RecomputeListener listener) {
    +        Assert.eqNull(this.listener, "this.listener");
             this.listener = listener;
             listener.setIsRefreshing(true);
    +        UpdateGraphProcessor.DEFAULT.addSource(this);
         }
     
         @Override
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java
    index ecb336d272c..38a349cf544 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java
    @@ -17,6 +17,7 @@
     import io.deephaven.engine.rowset.RowSet;
     import org.jetbrains.annotations.NotNull;
     
    +import java.util.Arrays;
     import java.util.Collection;
     import java.util.List;
     import java.util.Objects;
    @@ -44,6 +45,10 @@ static WhereFilter[] fromInverted(Collection filters) {
             return filters.stream().map(WhereFilter::ofInverted).toArray(WhereFilter[]::new);
         }
     
    +    static WhereFilter[] copyFrom(WhereFilter[] filters) {
    +        return Arrays.stream(filters).map(WhereFilter::copy).toArray(WhereFilter[]::new);
    +    }
    +
         /**
          * Users of WhereFilter may implement this interface if they must react to the filter fundamentally changing.
          *
    @@ -99,8 +104,11 @@ interface RecomputeListener {
     
         /**
          * Initialize this select filter given the table definition
    -     * 
    +     *
          * @param tableDefinition the definition of the table that will be filtered
    +     * @apiNote Any {@link io.deephaven.engine.context.QueryLibrary}, {@link io.deephaven.engine.context.QueryScope}, or
    +     *          {@link io.deephaven.engine.context.CompilerTools} usage needs to be resolved within init.
    +     *          Implementations must be idempotent.
          */
         void init(TableDefinition tableDefinition);
     
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilterFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilterFactory.java
    index b3d92ec0ee2..2bc95bccc5e 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilterFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilterFactory.java
    @@ -6,10 +6,10 @@
     import io.deephaven.base.Pair;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.impl.RollupInfo;
    -import io.deephaven.engine.table.lang.QueryScope;
    -import io.deephaven.engine.util.AbstractExpressionFactory;
    +import io.deephaven.engine.context.QueryScope;
    +import io.deephaven.api.expression.AbstractExpressionFactory;
     import io.deephaven.engine.util.ColumnFormattingValues;
    -import io.deephaven.engine.util.ExpressionParser;
    +import io.deephaven.api.expression.ExpressionParser;
     import io.deephaven.engine.util.string.StringUtils;
     import io.deephaven.gui.table.QuickFilterMode;
     import io.deephaven.internal.log.LoggerFactory;
    @@ -29,7 +29,7 @@
     import java.util.stream.Collectors;
     import java.util.stream.Stream;
     
    -import static io.deephaven.engine.table.impl.select.SelectFactoryConstants.*;
    +import static io.deephaven.api.expression.SelectFactoryConstants.*;
     
     /**
      * Given a user's filter string produce an appropriate WhereFilter instance.
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WouldMatchPairFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WouldMatchPairFactory.java
    index 44cf0173545..578a0044acf 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WouldMatchPairFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WouldMatchPairFactory.java
    @@ -4,15 +4,15 @@
     package io.deephaven.engine.table.impl.select;
     
     import io.deephaven.engine.table.WouldMatchPair;
    -import io.deephaven.engine.util.AbstractExpressionFactory;
    -import io.deephaven.engine.util.ExpressionParser;
    +import io.deephaven.api.expression.AbstractExpressionFactory;
    +import io.deephaven.api.expression.ExpressionParser;
     
     import java.util.Arrays;
     import java.util.Collection;
     import java.util.regex.Matcher;
     import java.util.stream.Stream;
     
    -import static io.deephaven.engine.table.impl.select.SelectFactoryConstants.*;
    +import static io.deephaven.api.expression.SelectFactoryConstants.*;
     
     /**
      * Parses strings of the form "Column1=expression" into a {@link WouldMatchPair} (or array of them).
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java
    index 1f0a1f78c07..45a51dc78b6 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java
    @@ -25,6 +25,7 @@
     import io.deephaven.engine.table.impl.util.WritableRowRedirection;
     import io.deephaven.engine.updategraph.AbstractNotification;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.io.log.impl.LogOutputStringImpl;
     import io.deephaven.util.SafeCloseable;
     import io.deephaven.util.SafeCloseablePair;
    @@ -497,11 +498,16 @@ public interface JobScheduler {
             /**
              * Cause runnable to be executed.
              *
    +         * @param executionContext the execution context to run it under
              * @param runnable the runnable to execute
              * @param description a description for logging
              * @param onError a routine to call if an exception occurs while running runnable
              */
    -        void submit(Runnable runnable, final LogOutputAppendable description, final Consumer onError);
    +        void submit(
    +                ExecutionContext executionContext,
    +                Runnable runnable,
    +                final LogOutputAppendable description,
    +                final Consumer onError);
     
             /**
              * The performance statistics of all runnables that have been completed off-thread, or null if it was executed
    @@ -520,7 +526,10 @@ public static class UpdateGraphProcessorJobScheduler implements SelectAndViewAna
             final BasePerformanceEntry accumulatedBaseEntry = new BasePerformanceEntry();
     
             @Override
    -        public void submit(final Runnable runnable, final LogOutputAppendable description,
    +        public void submit(
    +                final ExecutionContext executionContext,
    +                final Runnable runnable,
    +                final LogOutputAppendable description,
                     final Consumer onError) {
                 UpdateGraphProcessor.DEFAULT.addNotification(new AbstractNotification(false) {
                     @Override
    @@ -552,6 +561,11 @@ public LogOutput append(LogOutput output) {
                         return output.append("{Notification(").append(System.identityHashCode(this)).append(" for ")
                                 .append(description).append("}");
                     }
    +
    +                @Override
    +                public ExecutionContext getExecutionContext() {
    +                    return executionContext;
    +                }
                 });
             }
     
    @@ -570,12 +584,15 @@ public static class OperationInitializationPoolJobScheduler implements SelectAnd
             final BasePerformanceEntry accumulatedBaseEntry = new BasePerformanceEntry();
     
             @Override
    -        public void submit(final Runnable runnable, final LogOutputAppendable description,
    +        public void submit(
    +                final ExecutionContext executionContext,
    +                final Runnable runnable,
    +                final LogOutputAppendable description,
                     final Consumer onError) {
                 OperationInitializationThreadPool.executorService.submit(() -> {
                     final BasePerformanceEntry basePerformanceEntry = new BasePerformanceEntry();
                     basePerformanceEntry.onBaseEntryStart();
    -                try {
    +                try (final SafeCloseable ignored = executionContext == null ? null : executionContext.open()) {
                         runnable.run();
                     } catch (Exception e) {
                         onError.accept(e);
    @@ -606,9 +623,12 @@ public static class ImmediateJobScheduler implements SelectAndViewAnalyzer.JobSc
             public static final ImmediateJobScheduler INSTANCE = new ImmediateJobScheduler();
     
             @Override
    -        public void submit(final Runnable runnable, final LogOutputAppendable description,
    +        public void submit(
    +                final ExecutionContext executionContext,
    +                final Runnable runnable,
    +                final LogOutputAppendable description,
                     final Consumer onError) {
    -            try {
    +            try (SafeCloseable ignored = executionContext != null ? executionContext.open() : null) {
                     runnable.run();
                 } catch (Exception e) {
                     onError.accept(e);
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java
    index 55249332ccd..74bac2e3042 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java
    @@ -8,6 +8,7 @@
     import io.deephaven.chunk.*;
     import io.deephaven.chunk.attributes.Values;
     import io.deephaven.chunk.util.ObjectChunkIterator;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.liveness.LivenessNode;
     import io.deephaven.engine.liveness.LivenessReferent;
     import io.deephaven.engine.rowset.*;
    @@ -41,6 +42,12 @@ final public class SelectColumnLayer extends SelectOrViewColumnLayer {
          * The same reference as super.columnSource, but as a WritableColumnSource and maybe reinterpretted
          */
         private final WritableColumnSource writableSource;
    +
    +    /**
    +     * The execution context the select column layer was constructed in
    +     */
    +    private final ExecutionContext executionContext;
    +
         /**
          * Our parent row set, used for ensuring capacity.
          */
    @@ -71,6 +78,7 @@ final public class SelectColumnLayer extends SelectOrViewColumnLayer {
             this.parentRowSet = parentRowSet;
             this.writableSource = (WritableColumnSource) ReinterpretUtils.maybeConvertToPrimitive(ws);
             this.isRedirected = isRedirected;
    +        this.executionContext = ExecutionContext.getContextToRecord();
     
             dependencyBitSet = new BitSet();
             Arrays.stream(deps).mapToInt(inner::getLayerIndexFor).forEach(dependencyBitSet::set);
    @@ -173,11 +181,14 @@ public void onAllRequiredColumnsCompleted() {
                                     throw new IllegalStateException();
                                 }
     
    -                            jobScheduler.submit(() -> prepareParallelUpdate(jobScheduler, upstream, toClear, helper,
    -                                    liveResultOwner, onCompletion, this::onError, updates),
    +                            jobScheduler.submit(
    +                                    executionContext,
    +                                    () -> prepareParallelUpdate(jobScheduler, upstream, toClear, helper,
    +                                            liveResultOwner, onCompletion, this::onError, updates),
                                         SelectColumnLayer.this, this::onError);
                             } else {
                                 jobScheduler.submit(
    +                                    executionContext,
                                         () -> doSerialApplyUpdate(upstream, toClear, helper, liveResultOwner, onCompletion),
                                         SelectColumnLayer.this, this::onError);
                             }
    @@ -205,6 +216,7 @@ private void prepareParallelUpdate(final JobScheduler jobScheduler, final TableU
             for (TableUpdate splitUpdate : splitUpdates) {
                 final long fdest = destinationOffset;
                 jobScheduler.submit(
    +                    executionContext,
                         () -> doParallelApplyUpdate(splitUpdate, toClear, helper, liveResultOwner, onCompletion,
                                 checkTableOperations, divisions, fdest),
                         SelectColumnLayer.this, onError);
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/FormulaAnalyzer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/FormulaAnalyzer.java
    index f13af60541c..08f13198bb4 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/FormulaAnalyzer.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/FormulaAnalyzer.java
    @@ -4,14 +4,14 @@
     package io.deephaven.engine.table.impl.select.codegen;
     
     import io.deephaven.datastructures.util.CollectionUtil;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.table.ColumnDefinition;
     import io.deephaven.engine.table.impl.lang.QueryLanguageParser;
     import io.deephaven.engine.table.impl.select.QueryScopeParamTypeUtil;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.vector.ObjectVector;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.table.impl.select.DhFormulaColumn;
     import io.deephaven.engine.table.impl.select.FormulaCompilationException;
     import io.deephaven.engine.table.impl.select.formula.FormulaSourceDescriptor;
    @@ -29,33 +29,21 @@ public class FormulaAnalyzer {
     
         public static Result analyze(final String rawFormulaString,
                 final Map> columnDefinitionMap,
    -            Map> otherVariables) {
    -        try {
    -            return analyzeHelper(rawFormulaString, columnDefinitionMap, otherVariables);
    -        } catch (Exception e) {
    -            throw new FormulaCompilationException("Formula compilation error for: " + rawFormulaString, e);
    -        }
    -    }
    -
    -    private static Result analyzeHelper(final String rawFormulaString,
    -            final Map> columnDefinitionMap,
    -            Map> otherVariables) throws Exception {
    +            final DateTimeUtils.Result timeConversionResult,
    +            final QueryLanguageParser.Result queryLanguageResult) throws Exception {
             final Map> possibleParams = new HashMap<>();
    -        final QueryScope queryScope = QueryScope.getScope();
    +        final QueryScope queryScope = ExecutionContext.getContext().getQueryScope();
             for (QueryScopeParam param : queryScope.getParams(queryScope.getParamNames())) {
                 possibleParams.put(param.getName(), param);
             }
     
    -        final DateTimeUtils.Result timeConversionResult = DateTimeUtils.convertExpression(rawFormulaString);
    -        final QueryLanguageParser.Result result = getCompiledFormula(columnDefinitionMap, timeConversionResult,
    -                otherVariables);
    -
    -        log.debug().append("Expression (after language conversion) : ").append(result.getConvertedExpression()).endl();
    +        log.debug().append("Expression (after language conversion) : ")
    +                .append(queryLanguageResult.getConvertedExpression()).endl();
     
             final List usedColumns = new ArrayList<>();
             final List userParams = new ArrayList<>();
             final List usedColumnArrays = new ArrayList<>();
    -        for (String variable : result.getVariablesUsed()) {
    +        for (String variable : queryLanguageResult.getVariablesUsed()) {
                 final String colSuffix = DhFormulaColumn.COLUMN_SUFFIX;
                 final String bareName;
                 if (variable.equals("i") || variable.equals("ii") || variable.equals("k")) {
    @@ -70,11 +58,11 @@ private static Result analyzeHelper(final String rawFormulaString,
                     userParams.add(variable);
                 }
             }
    -        Class returnedType = result.getType();
    +        Class returnedType = queryLanguageResult.getType();
             if (returnedType == boolean.class) {
                 returnedType = Boolean.class;
             }
    -        final String cookedFormulaString = result.getConvertedExpression();
    +        final String cookedFormulaString = queryLanguageResult.getConvertedExpression();
             final String timeInstanceVariables = timeConversionResult.getInstanceVariablesString();
             return new Result(returnedType,
                     usedColumns.toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY),
    @@ -84,8 +72,7 @@ private static Result analyzeHelper(final String rawFormulaString,
         }
     
         public static QueryLanguageParser.Result getCompiledFormula(Map> availableColumns,
    -            DateTimeUtils.Result timeConversionResult,
    -            Map> otherVariables) throws Exception {
    +            DateTimeUtils.Result timeConversionResult) throws Exception {
             final Map> possibleVariables = new HashMap<>();
             possibleVariables.put("i", int.class);
             possibleVariables.put("ii", long.class);
    @@ -105,7 +92,8 @@ public static QueryLanguageParser.Result getCompiledFormula(Map param : queryScope.getParams(queryScope.getParamNames())) {
                 possibleVariables.put(param.getName(), QueryScopeParamTypeUtil.getDeclaredClass(param.getValue()));
     
    @@ -133,15 +121,15 @@ public static QueryLanguageParser.Result getCompiledFormula(Map> classImports = new HashSet<>(QueryLibrary.getClassImports());
    +        final Set> classImports =
    +                new HashSet<>(context.getQueryLibrary().getClassImports());
             classImports.add(TrackingWritableRowSet.class);
             classImports.add(WritableColumnSource.class);
    -        return new QueryLanguageParser(timeConversionResult.getConvertedFormula(), QueryLibrary.getPackageImports(),
    -                classImports, QueryLibrary.getStaticImports(), possibleVariables, possibleVariableParameterizedTypes)
    +        return new QueryLanguageParser(timeConversionResult.getConvertedFormula(),
    +                context.getQueryLibrary().getPackageImports(),
    +                classImports, context.getQueryLibrary().getStaticImports(), possibleVariables,
    +                possibleVariableParameterizedTypes)
                             .getResult();
         }
     
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java
    index 2654a1b7581..f650ec164c8 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java
    @@ -3,10 +3,10 @@
      */
     package io.deephaven.engine.table.impl.select.codegen;
     
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.vector.Vector;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceNugget;
     import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder;
     import io.deephaven.engine.table.impl.select.Formula;
    @@ -82,7 +82,7 @@ private String generateKernelClassBody() {
             final TypeAnalyzer ta = TypeAnalyzer.create(returnedType);
     
             final CodeGenerator g = CodeGenerator.create(
    -                CodeGenerator.create(QueryLibrary.getImportStrings().toArray()), "",
    +                CodeGenerator.create(ExecutionContext.getContext().getQueryLibrary().getImportStrings().toArray()), "",
                     "public class $CLASSNAME$ implements [[FORMULA_KERNEL_INTERFACE_CANONICAL]]", CodeGenerator.block(
                             generateFactoryLambda(), "",
                             CodeGenerator.repeated("instanceVar", "private final [[TYPE]] [[NAME]];"),
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaFactory.java
    index 6f9c740cc5c..8ca2cecb9b3 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaFactory.java
    @@ -3,14 +3,17 @@
      */
     package io.deephaven.engine.table.impl.select.formula;
     
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.engine.table.impl.select.Formula;
     import io.deephaven.engine.table.ColumnSource;
     import io.deephaven.engine.rowset.TrackingRowSet;
    +import io.deephaven.engine.context.ExecutionContext;
     
     import java.util.Map;
     
     public interface FormulaFactory {
    -    Formula createFormula(TrackingRowSet rowSet, boolean initLazyMap, Map columnsToData,
    +    Formula createFormula(
    +            TrackingRowSet rowSet,
    +            boolean initLazyMap, Map columnsToData,
                 QueryScopeParam... params);
     }
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaKernelFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaKernelFactory.java
    index 4e6568e1903..0a152dda5a2 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaKernelFactory.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/formula/FormulaKernelFactory.java
    @@ -3,7 +3,7 @@
      */
     package io.deephaven.engine.table.impl.select.formula;
     
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.vector.Vector;
     
     public interface FormulaKernelFactory {
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/python/FormulaColumnPython.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/python/FormulaColumnPython.java
    index fa58076f481..6a7ec5dd81d 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/python/FormulaColumnPython.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/python/FormulaColumnPython.java
    @@ -4,7 +4,7 @@
     package io.deephaven.engine.table.impl.select.python;
     
     import io.deephaven.engine.table.ColumnDefinition;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.vector.Vector;
     import io.deephaven.engine.table.impl.select.AbstractFormulaColumn;
     import io.deephaven.engine.table.impl.select.SelectColumn;
    @@ -32,33 +32,22 @@ public static FormulaColumnPython create(String columnName,
     
         private final io.deephaven.engine.table.impl.select.python.DeephavenCompatibleFunction dcf;
     
    -    private boolean initialized;
    -
         private FormulaColumnPython(String columnName,
                 io.deephaven.engine.table.impl.select.python.DeephavenCompatibleFunction dcf) {
    -        super(columnName, "", true);
    +        super(columnName, "");
             this.dcf = Objects.requireNonNull(dcf);
         }
     
    -    private void initFromDef(Map> columnNameMap) {
    -        if (initialized) {
    -            throw new IllegalStateException("Already initialized");
    -        }
    -        returnedType = dcf.getReturnedType();
    -        this.initialized = true;
    -    }
    -
    -    @Override
    -    protected final FormulaKernelFactory getFormulaKernelFactory() {
    -        return this;
    -    }
    -
         @Override
    -    public final List initDef(Map> columnNameMap) {
    -        if (!initialized) {
    -            initFromDef(columnNameMap);
    -            applyUsedVariables(columnNameMap, new LinkedHashSet<>(dcf.getColumnNames()));
    +    public final List initDef(Map> columnDefinitionMap) {
    +        if (formulaFactory != null) {
    +            validateColumnDefinition(columnDefinitionMap);
    +        } else {
    +            returnedType = dcf.getReturnedType();
    +            applyUsedVariables(columnDefinitionMap, new LinkedHashSet<>(dcf.getColumnNames()));
    +            formulaFactory = createKernelFormulaFactory(this);
             }
    +
             return usedColumns;
         }
     
    @@ -75,9 +64,6 @@ public boolean preventsParallelization() {
     
         @Override
         protected final FormulaSourceDescriptor getSourceDescriptor() {
    -        if (!initialized) {
    -            throw new IllegalStateException("Must be initialized first");
    -        }
             return new FormulaSourceDescriptor(
                     returnedType,
                     dcf.getColumnNames().toArray(new String[0]),
    @@ -87,12 +73,18 @@ protected final FormulaSourceDescriptor getSourceDescriptor() {
     
         @Override
         public final SelectColumn copy() {
    -        return new FormulaColumnPython(columnName, dcf);
    +        final FormulaColumnPython copy = new FormulaColumnPython(columnName, dcf);
    +        if (formulaFactory != null) {
    +            // copy all initDef state
    +            copy.returnedType = returnedType;
    +            onCopy(copy);
    +        }
    +        return copy;
         }
     
         @Override
         public final FormulaKernel createInstance(Vector[] arrays, QueryScopeParam[] params) {
    -        if (!initialized) {
    +        if (formulaFactory == null) {
                 throw new IllegalStateException("Must be initialized first");
             }
             return dcf.toFormulaKernel();
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/BytePartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/BytePartitionKernel.java
    index c8c79602f7c..aac401aeac3 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/BytePartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/BytePartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class BytePartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public ByteLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new ByteLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(ByteLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(byte last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableByteChunk tempPivotValues = WritableByteChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableByteChunk tempPivotValues = WritableByteChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/CharPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/CharPartitionKernel.java
    index 4ec1515f995..37498a9caa8 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/CharPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/CharPartitionKernel.java
    @@ -13,11 +13,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class CharPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -72,6 +73,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public CharLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new CharLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(CharLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(char last) {
    @@ -84,18 +94,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableCharChunk tempPivotValues = WritableCharChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableCharChunk tempPivotValues = WritableCharChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/DoublePartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/DoublePartitionKernel.java
    index fd4cc484f45..a59f0f4acea 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/DoublePartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/DoublePartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class DoublePartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public DoubleLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new DoubleLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(DoubleLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(double last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableDoubleChunk tempPivotValues = WritableDoubleChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableDoubleChunk tempPivotValues = WritableDoubleChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/FloatPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/FloatPartitionKernel.java
    index b29675bb303..76aa7a2a8cf 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/FloatPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/FloatPartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class FloatPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public FloatLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new FloatLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(FloatLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(float last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableFloatChunk tempPivotValues = WritableFloatChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableFloatChunk tempPivotValues = WritableFloatChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/IntPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/IntPartitionKernel.java
    index 0af432c466c..3d2b21b126f 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/IntPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/IntPartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class IntPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public IntLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new IntLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(IntLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(int last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableIntChunk tempPivotValues = WritableIntChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableIntChunk tempPivotValues = WritableIntChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/LongPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/LongPartitionKernel.java
    index b70bbcf2e99..3f5e290b23a 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/LongPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/LongPartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class LongPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public LongLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new LongLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(LongLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(long last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableLongChunk tempPivotValues = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableLongChunk tempPivotValues = WritableLongChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ObjectPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ObjectPartitionKernel.java
    index 7c530a5dd62..23fd81669d0 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ObjectPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ObjectPartitionKernel.java
    @@ -20,11 +20,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class ObjectPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -79,6 +80,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public ObjectLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new ObjectLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(ObjectLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(Object last) {
    @@ -91,18 +101,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableObjectChunk tempPivotValues = WritableObjectChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableObjectChunk tempPivotValues = WritableObjectChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ShortPartitionKernel.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ShortPartitionKernel.java
    index ab5faf56335..0a1eadbd9de 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ShortPartitionKernel.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sort/partition/ShortPartitionKernel.java
    @@ -18,11 +18,12 @@
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
    +import io.deephaven.util.SafeCloseable;
     
     import java.util.stream.IntStream;
     
     public class ShortPartitionKernel {
    -    public static class PartitionKernelContext {
    +    public static class PartitionKernelContext implements SafeCloseable {
             // during the actual partition operation, we stick the new keys in here; when we exceed chunksize afterwards,
             // we can pass the entire chunk value to the builder; which then makes the virtual call to build it all at once
             private final WritableLongChunk[] accumulatedKeys;
    @@ -77,6 +78,15 @@ public RowSet[] getPartitions(boolean resetBuilders) {
             public ShortLongTuple [] getPivots() {
                 return IntStream.range(0, pivotValues.size()).mapToObj(ii -> new ShortLongTuple(pivotValues.get(ii), pivotKeys.get(ii))).toArray(ShortLongTuple[]::new);
             }
    +
    +        @Override
    +        public void close() {
    +            for (WritableLongChunk chunk : accumulatedKeys) {
    +                chunk.close();
    +            }
    +            pivotValues.close();
    +            pivotKeys.close();
    +        }
         }
     
     //    private static String format(short last) {
    @@ -89,18 +99,19 @@ public RowSet[] getPartitions(boolean resetBuilders) {
         public static PartitionKernelContext createContext(RowSet rowSet, ColumnSource columnSource, int chunkSize, int nPartitions, boolean preserveEquality) {
             final PartitionKernelContext context = new PartitionKernelContext(chunkSize, nPartitions, preserveEquality);
     
    -        final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    -        final WritableShortChunk tempPivotValues = WritableShortChunk.makeWritableChunk(nPartitions * 3);
    +        try (final WritableLongChunk tempPivotKeys = WritableLongChunk.makeWritableChunk(nPartitions * 3);
    +             final WritableShortChunk tempPivotValues = WritableShortChunk.makeWritableChunk(nPartitions * 3)) {
     
    -        samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
    +            samplePivots(rowSet, nPartitions, tempPivotKeys, tempPivotValues, columnSource);
     
    -        // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    -        for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    -            context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    -            context.pivotValues.set(ii, tempPivotValues.get(ii));
    -        }
    +            // copy from the oversized chunk, which was used for sorting into the chunk which we will use for our binary searches
    +            for (int ii = 0; ii < tempPivotKeys.size(); ++ii) {
    +                context.pivotKeys.set(ii, tempPivotKeys.get(ii));
    +                context.pivotValues.set(ii, tempPivotValues.get(ii));
    +            }
     
    -        return context;
    +            return context;
    +        }
         }
     
         // the sample pivots function could be smarter; in that if we are reading a block, there is a strong argument to
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionSourceManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionSourceManager.java
    index b0de15962d3..06e01e5f512 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionSourceManager.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionSourceManager.java
    @@ -65,7 +65,10 @@ public UnionSourceManager(@NotNull final PartitionedTable partitionedTable) {
             columnNames = partitionedTable.constituentDefinition().getColumnNamesArray();
     
             final Table coalescedPartitions = partitionedTable.table().coalesce().select(
    -                new TableTransformationColumn(partitionedTable.constituentColumnName(), Table::coalesce));
    +                new TableTransformationColumn(
    +                        partitionedTable.constituentColumnName(),
    +                        null,
    +                        Table::coalesce));
             constituentRows = coalescedPartitions.getRowSet();
             constituentTables = coalescedPartitions.getColumnSource(partitionedTable.constituentColumnName());
     
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java
    index 4067dad979c..f8ac5847f43 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/ByteEMAOperator.java
    @@ -5,12 +5,12 @@
      */
     package io.deephaven.engine.table.impl.updateby.ema;
     
    +import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.chunk.Chunk;
     import io.deephaven.chunk.ByteChunk;
     import io.deephaven.chunk.WritableDoubleChunk;
     import io.deephaven.chunk.attributes.Values;
     import io.deephaven.engine.table.ColumnSource;
    -import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.engine.table.MatchPair;
     import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator;
     import io.deephaven.engine.table.impl.util.RowRedirection;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java
    index 5f391dde775..87620966e84 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/IntEMAOperator.java
    @@ -5,12 +5,12 @@
      */
     package io.deephaven.engine.table.impl.updateby.ema;
     
    +import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.chunk.Chunk;
     import io.deephaven.chunk.IntChunk;
     import io.deephaven.chunk.WritableDoubleChunk;
     import io.deephaven.chunk.attributes.Values;
     import io.deephaven.engine.table.ColumnSource;
    -import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.engine.table.MatchPair;
     import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator;
     import io.deephaven.engine.table.impl.util.RowRedirection;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java
    index d0e35e2dba0..c183adf706c 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/updateby/ema/LongEMAOperator.java
    @@ -5,12 +5,12 @@
      */
     package io.deephaven.engine.table.impl.updateby.ema;
     
    +import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.chunk.Chunk;
     import io.deephaven.chunk.LongChunk;
     import io.deephaven.chunk.WritableDoubleChunk;
     import io.deephaven.chunk.attributes.Values;
     import io.deephaven.engine.table.ColumnSource;
    -import io.deephaven.api.updateby.OperationControl;
     import io.deephaven.engine.table.MatchPair;
     import io.deephaven.engine.table.impl.updateby.internal.LongRecordingUpdateByOperator;
     import io.deephaven.engine.table.impl.util.RowRedirection;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/CumulativeUtil.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/CumulativeUtil.java
    index 5cb5ac45348..539f746cdd7 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/CumulativeUtil.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/CumulativeUtil.java
    @@ -4,7 +4,7 @@
     package io.deephaven.engine.table.impl.util;
     
     import io.deephaven.engine.table.Table;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.util.TableTools;
     import gnu.trove.impl.Constants;
     import gnu.trove.map.hash.TObjectDoubleHashMap;
    @@ -64,7 +64,7 @@ public boolean shouldKeep(Object key, double val) {
         /**
          * General purpose core method for executing running and cumulative aggregations. Used by helper methods which
          * provide template formulae for specific types of aggregations.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the aggregation.
          * @param key Nullable string key to use to access the cached previous row value within the {@link CumulativeHelper}
          *        map. Note that a non-null literal key must be enclosed in backticks since it will be used in a formula.
    @@ -88,7 +88,7 @@ public static Table accumulate(Table t, String key, double startValue, String ne
     
         /**
          * Executes a cumulative aggregation of the minimum value so far for a formula.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the aggregation.
          * @param newCol The name of the aggregation column to add to the table.
          * @param formula A formula for the source value on which to calculate a running minimum. This can be as simple as
    @@ -102,7 +102,7 @@ public static Table cumMin(Table t, String newCol, String formula) {
     
         /**
          * Executes a cumulative sum aggregation far for a formula.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the aggregation.
          * @param key Nullable string key to use to access the cached previous row value within the {@link CumulativeHelper}
          *        map. Note that a non-null literal key must be enclosed in backticks since it will be used in a formula.
    @@ -120,7 +120,7 @@ public static Table cumSum(Table t, String key, String newCol, String formula) {
     
         /**
          * Executes a cumulative sum aggregation far for a formula.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the aggregation.
          * @param newCol The name of the aggregation column to add to the table.
          * @param formula A formula for the source value on which to calculate a running sum. This can be as simple as the
    @@ -134,7 +134,7 @@ public static Table cumSum(Table t, String newCol, String formula) {
     
         /**
          * Executes a rolling sum aggregation far for a formula.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the aggregation.
          * @param windowSize The number of rows to include in the rolling sum window.
          * @param newCol The name of the aggregation column to add to the table.
    @@ -150,7 +150,7 @@ public static Table rollingSum(Table t, int windowSize, String newCol, String fo
     
         /**
          * Returns only rows for which the selected column value is different from the value in the previous row.
    -     * 
    +     *
          * @param t The {@link Table} to use as input to the method.
          * @param key Nullable string key to use to access the cached previous row value within the {@link CumulativeHelper}
          *        map. Note that a non-null literal key must be enclosed in backticks since it will be used in a formula.
    @@ -167,7 +167,7 @@ public static Table filterChanged(Table t, String key, String col) {
     
         /**
          * main method to show examples of use of this class' methods.
    -     * 
    +     *
          * @param args Not used
          * @throws IOException
          */
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsConfiguration.java b/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsConfiguration.java
    index 3bc0b6ff450..2670f0b9c98 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsConfiguration.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsConfiguration.java
    @@ -5,7 +5,7 @@
     
     import com.google.auto.service.AutoService;
     import io.deephaven.configuration.Configuration;
    -import io.deephaven.engine.table.lang.QueryLibraryImports;
    +import io.deephaven.engine.context.QueryLibraryImports;
     import io.deephaven.engine.util.ClassList;
     import java.io.IOException;
     import java.util.HashSet;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsDefaults.java
    index a6507c9735a..2865ac047ad 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsDefaults.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/table/lang/impl/QueryLibraryImportsDefaults.java
    @@ -40,8 +40,8 @@
     import io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils;
     import io.deephaven.engine.table.impl.select.ConditionFilter;
     import io.deephaven.engine.table.impl.verify.TableAssertions;
    -import io.deephaven.engine.table.lang.QueryLibraryImports;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryLibraryImports;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.engine.util.ColorUtilImpl;
     import io.deephaven.function.Basic;
     import io.deephaven.function.BinSearch;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java
    index b9a001f05ce..c2afafea72a 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java
    @@ -7,15 +7,16 @@
     import io.deephaven.UncheckedDeephavenException;
     import io.deephaven.api.util.NameValidator;
     import io.deephaven.base.FileUtils;
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.liveness.LivenessScope;
     import io.deephaven.engine.liveness.LivenessScopeStack;
     import io.deephaven.engine.table.PartitionedTable;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.TableDefinition;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScope;
    -import io.deephaven.engine.table.lang.QueryScopeParam;
    +import io.deephaven.engine.context.QueryLibrary;
    +import io.deephaven.engine.context.QueryScope;
    +import io.deephaven.engine.context.QueryScopeParam;
     import io.deephaven.plugin.type.ObjectType;
     import io.deephaven.plugin.type.ObjectTypeLookup;
     import io.deephaven.util.SafeCloseable;
    @@ -59,15 +60,12 @@ private static void createOrClearDirectory(final File directory) {
     
         private final File classCacheDirectory;
     
    -    protected final QueryScope queryScope;
    -    protected final QueryLibrary queryLibrary;
    -    protected final CompilerTools.Context compilerContext;
    +    protected final ExecutionContext executionContext;
     
         private final ObjectTypeLookup objectTypeLookup;
         private final Listener changeListener;
     
    -    protected AbstractScriptSession(ObjectTypeLookup objectTypeLookup, @Nullable Listener changeListener,
    -            boolean isDefaultScriptSession) {
    +    protected AbstractScriptSession(ObjectTypeLookup objectTypeLookup, @Nullable Listener changeListener) {
             this.objectTypeLookup = objectTypeLookup;
             this.changeListener = changeListener;
     
    @@ -76,30 +74,21 @@ protected AbstractScriptSession(ObjectTypeLookup objectTypeLookup, @Nullable Lis
             classCacheDirectory = CLASS_CACHE_LOCATION.resolve(UuidCreator.toString(scriptCacheId)).toFile();
             createOrClearDirectory(classCacheDirectory);
     
    -        queryScope = newQueryScope();
    -        queryLibrary = QueryLibrary.makeNewLibrary();
    +        final QueryScope queryScope = newQueryScope();
    +        final CompilerTools.Context compilerContext =
    +                CompilerTools.newContext(classCacheDirectory, getClass().getClassLoader());
     
    -        compilerContext = new CompilerTools.Context(classCacheDirectory, getClass().getClassLoader()) {
    -            {
    -                addClassSource(getFakeClassDestination());
    -            }
    -
    -            @Override
    -            public File getFakeClassDestination() {
    -                return classCacheDirectory;
    -            }
    -
    -            @Override
    -            public String getClassPath() {
    -                return classCacheDirectory.getAbsolutePath() + File.pathSeparatorChar + super.getClassPath();
    -            }
    -        };
    +        executionContext = ExecutionContext.newBuilder()
    +                .markSystemic()
    +                .newQueryLibrary()
    +                .setQueryScope(queryScope)
    +                .setCompilerContext(compilerContext)
    +                .build();
    +    }
     
    -        if (isDefaultScriptSession) {
    -            CompilerTools.setDefaultContext(compilerContext);
    -            QueryScope.setDefaultScope(queryScope);
    -            QueryLibrary.setDefaultLibrary(queryLibrary);
    -        }
    +    @Override
    +    public ExecutionContext getExecutionContext() {
    +        return executionContext;
         }
     
         protected synchronized void publishInitial() {
    @@ -147,30 +136,16 @@ protected Changes applyDiff(S from, S to, RuntimeException e) {
         public synchronized final Changes evaluateScript(final String script, final @Nullable String scriptName) {
             RuntimeException evaluateErr = null;
             final Changes diff;
    -        try (S fromSnapshot = takeSnapshot()) {
    -
    -            // store pointers to exist query scope static variables
    -            final QueryLibrary prevQueryLibrary = QueryLibrary.getLibrary();
    -            final CompilerTools.Context prevCompilerContext = CompilerTools.getContext();
    -            final QueryScope prevQueryScope = QueryScope.getScope();
    -
    -            // retain any objects which are created in the executed code, we'll release them when the script session
    -            // closes
    -            try (final SafeCloseable ignored = LivenessScopeStack.open(this, false)) {
    -                // point query scope static state to our session's state
    -                QueryScope.setScope(queryScope);
    -                CompilerTools.setContext(compilerContext);
    -                QueryLibrary.setLibrary(queryLibrary);
    +        // retain any objects which are created in the executed code, we'll release them when the script session
    +        // closes
    +        try (S fromSnapshot = takeSnapshot();
    +                final SafeCloseable ignored = LivenessScopeStack.open(this, false)) {
     
    +            try {
                     // actually evaluate the script
    -                evaluate(script, scriptName);
    +                executionContext.apply(() -> evaluate(script, scriptName));
                 } catch (final RuntimeException err) {
                     evaluateErr = err;
    -            } finally {
    -                // restore pointers to query scope static variables
    -                QueryScope.setScope(prevQueryScope);
    -                CompilerTools.setContext(prevCompilerContext);
    -                QueryLibrary.setLibrary(prevQueryLibrary);
                 }
     
                 try (S toSnapshot = takeSnapshot()) {
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/DelegatingScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/DelegatingScriptSession.java
    index 3a00397f4d0..5a1c41c097f 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/DelegatingScriptSession.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/DelegatingScriptSession.java
    @@ -3,10 +3,11 @@
      */
     package io.deephaven.engine.util;
     
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.liveness.LivenessReferent;
     import io.deephaven.engine.util.scripts.ScriptPathLoader;
     import io.deephaven.engine.util.scripts.ScriptPathLoaderState;
    +import io.deephaven.engine.context.ExecutionContext;
     import org.jetbrains.annotations.NotNull;
     import org.jetbrains.annotations.Nullable;
     
    @@ -55,6 +56,11 @@ private Changes contextualizeChanges(final Changes diff) {
             return diff;
         }
     
    +    @Override
    +    public ExecutionContext getExecutionContext() {
    +        return delegate.getExecutionContext();
    +    }
    +
         @Override
         public SnapshotScope snapshot(@Nullable SnapshotScope previousIfPresent) {
             return delegate.snapshot(previousIfPresent);
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java b/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java
    index c9b8d39c7f1..b9e79e81865 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java
    @@ -3,7 +3,7 @@
      */
     package io.deephaven.engine.util;
     
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
     
     import java.util.*;
     import java.util.function.Supplier;
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java
    index ebad91480bd..814cd175363 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java
    @@ -11,11 +11,11 @@
     import io.deephaven.base.FileUtils;
     import io.deephaven.base.Pair;
     import io.deephaven.base.StringUtils;
    -import io.deephaven.compilertools.CompilerTools;
    +import io.deephaven.engine.context.CompilerTools;
     import io.deephaven.configuration.Configuration;
     import io.deephaven.engine.exceptions.CancellationException;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.api.util.NameValidator;
     import io.deephaven.engine.util.GroovyDeephavenSession.GroovySnapshot;
     import io.deephaven.engine.util.scripts.ScriptPathLoader;
    @@ -126,21 +126,22 @@ private String getNextScriptClassName() {
     
         public GroovyDeephavenSession(ObjectTypeLookup objectTypeLookup, final RunScripts runScripts)
                 throws IOException {
    -        this(objectTypeLookup, null, runScripts, false);
    +        this(objectTypeLookup, null, runScripts);
         }
     
         public GroovyDeephavenSession(
    -            ObjectTypeLookup objectTypeLookup, @Nullable final Listener changeListener,
    -            final RunScripts runScripts, boolean isDefaultScriptSession)
    +            ObjectTypeLookup objectTypeLookup,
    +            @Nullable final Listener changeListener,
    +            final RunScripts runScripts)
                 throws IOException {
    -        super(objectTypeLookup, changeListener, isDefaultScriptSession);
    +        super(objectTypeLookup, changeListener);
     
             this.scriptFinder = new ScriptFinder(DEFAULT_SCRIPT_PATH);
     
             groovyShell.setVariable("__groovySession", this);
             groovyShell.setVariable("DB_SCRIPT_PATH", DEFAULT_SCRIPT_PATH);
     
    -        compilerContext.setParentClassLoader(getShell().getClassLoader());
    +        executionContext.getCompilerContext().setParentClassLoader(getShell().getClassLoader());
     
             publishInitial();
     
    @@ -531,8 +532,8 @@ private Pair fullCommand(String command) {
                     "import static io.deephaven.base.string.cache.CompressedString.compress;\n" +
                     "import org.joda.time.LocalTime;\n" +
                     "import io.deephaven.time.Period;\n" +
    -                "import io.deephaven.engine.table.lang.QueryScopeParam;\n" +
    -                "import io.deephaven.engine.table.lang.QueryScope;\n" +
    +                "import io.deephaven.engine.context.QueryScopeParam;\n" +
    +                "import io.deephaven.engine.context.QueryScope;\n" +
                     "import java.util.*;\n" +
                     "import java.lang.*;\n" +
                     "import static io.deephaven.util.QueryConstants.*;\n" +
    @@ -596,7 +597,7 @@ && isAnInteger(aClass.getName().substring(SCRIPT_PREFIX.length()))) {
                     // only increment QueryLibrary version if some dynamic class overrides an existing class
                     if (!dynamicClasses.add(entry.getKey()) && !notifiedQueryLibrary) {
                         notifiedQueryLibrary = true;
    -                    queryLibrary.updateVersionString();
    +                    executionContext.getQueryLibrary().updateVersionString();
                     }
     
                     try {
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/NoLanguageDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/NoLanguageDeephavenSession.java
    index 517a1685ae4..18cf66dfa4d 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/NoLanguageDeephavenSession.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/NoLanguageDeephavenSession.java
    @@ -3,7 +3,7 @@
      */
     package io.deephaven.engine.util;
     
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.util.scripts.ScriptPathLoader;
     import io.deephaven.engine.util.scripts.ScriptPathLoaderState;
     import org.jetbrains.annotations.NotNull;
    @@ -30,7 +30,7 @@ public NoLanguageDeephavenSession() {
         }
     
         public NoLanguageDeephavenSession(final String scriptType) {
    -        super(null, null, false);
    +        super(null, null);
     
             this.scriptType = scriptType;
             variables = new LinkedHashMap<>();
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/ScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/ScriptSession.java
    index 1303dc6cba1..a5aa198e4b2 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/ScriptSession.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/ScriptSession.java
    @@ -3,7 +3,8 @@
      */
     package io.deephaven.engine.util;
     
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.ExecutionContext;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.liveness.LivenessNode;
     import io.deephaven.engine.liveness.ReleasableLivenessManager;
     import io.deephaven.engine.util.scripts.ScriptPathLoader;
    @@ -55,6 +56,12 @@ public interface ScriptSession extends ReleasableLivenessManager, LivenessNode {
          */
         VariableProvider getVariableProvider();
     
    +    /**
    +     * Obtain an {@link ExecutionContext} instance for the current script session. This is the execution context that is
    +     * used when executing scripts.
    +     */
    +    ExecutionContext getExecutionContext();
    +
         class Changes {
             public RuntimeException error = null;
     
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/TableTools.java b/engine/table/src/main/java/io/deephaven/engine/util/TableTools.java
    index 79766b5cc2d..4409567c07d 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/TableTools.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/TableTools.java
    @@ -46,7 +46,7 @@
     import java.util.stream.Collectors;
     import java.util.stream.Stream;
     
    -import static io.deephaven.engine.table.impl.TableWithDefaults.ZERO_LENGTH_TABLE_ARRAY;
    +import static io.deephaven.engine.table.impl.TableDefaults.ZERO_LENGTH_TABLE_ARRAY;
     
     /**
      * Tools for working with tables. This includes methods to examine tables, combine them, convert them to and from CSV
    diff --git a/engine/table/src/main/java/io/deephaven/engine/util/TableToolsMergeHelper.java b/engine/table/src/main/java/io/deephaven/engine/util/TableToolsMergeHelper.java
    index ebd22810376..fd611fbb0e8 100644
    --- a/engine/table/src/main/java/io/deephaven/engine/util/TableToolsMergeHelper.java
    +++ b/engine/table/src/main/java/io/deephaven/engine/util/TableToolsMergeHelper.java
    @@ -13,8 +13,6 @@
     import java.util.*;
     import java.util.stream.Stream;
     
    -import static io.deephaven.engine.table.impl.TableWithDefaults.ZERO_LENGTH_TABLE_ARRAY;
    -
     /**
      * Helper for coalescing and de-unioning tables prior to a merge. Only for engine-internal usage.
      */
    diff --git a/engine/table/src/test/java/io/deephaven/engine/liveness/TestLiveness.java b/engine/table/src/test/java/io/deephaven/engine/liveness/TestLiveness.java
    index 781bb90a18b..dd5069215fa 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/liveness/TestLiveness.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/liveness/TestLiveness.java
    @@ -3,10 +3,12 @@
      */
     package io.deephaven.engine.liveness;
     
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.table.impl.TstUtils;
    +import io.deephaven.util.SafeCloseable;
     import org.junit.After;
     import org.junit.Before;
     import org.junit.Test;
    @@ -18,6 +20,7 @@ public class TestLiveness {
     
         private boolean oldCheckUgp;
         private LivenessScope scope;
    +    private SafeCloseable executionContext;
     
         @Before
         public void setUp() throws Exception {
    @@ -26,6 +29,7 @@ public void setUp() throws Exception {
             oldCheckUgp = UpdateGraphProcessor.DEFAULT.setCheckTableOperations(false);
             scope = new LivenessScope();
             LivenessScopeStack.push(scope);
    +        executionContext = ExecutionContext.createForUnitTests().open();
         }
     
         @After
    @@ -34,6 +38,7 @@ public void tearDown() throws Exception {
             scope.release();
             UpdateGraphProcessor.DEFAULT.setCheckTableOperations(oldCheckUgp);
             UpdateGraphProcessor.DEFAULT.resetForUnitTests(true);
    +        executionContext.close();
         }
     
         @Test
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java
    index 1002504964c..7a801288e20 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java
    @@ -7,10 +7,11 @@
     import io.deephaven.configuration.Configuration;
     import io.deephaven.engine.table.PartitionedTable;
     import io.deephaven.engine.table.Table;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.plugin.type.ObjectTypeLookup.NoOp;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.time.DateTime;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.util.GroovyDeephavenSession;
    @@ -97,7 +98,7 @@ private GroovyDeephavenSession getGroovySession() throws IOException {
     
         private GroovyDeephavenSession getGroovySession(@Nullable TimeProvider timeProvider) throws IOException {
             final GroovyDeephavenSession session = new GroovyDeephavenSession(NoOp.INSTANCE, RunScripts.serviceLoader());
    -        QueryScope.setScope(session.newQueryScope());
    +        session.getExecutionContext().open();
             return session;
         }
     
    @@ -335,6 +336,7 @@ private void validateBindingTables(GroovyDeephavenSession session, Map hardReferences) {
    +        final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext();
             // noinspection unchecked
             session.getBinding().getVariables().forEach((k, v) -> {
                 if (v instanceof PartitionedTable) {
    @@ -342,7 +344,7 @@ private void validateBindingPartitionedTableConstituents(
                     if (!partitionedTable.table().isRefreshing()) {
                         return;
                     }
    -                final PartitionedTable validated = partitionedTable.transform(table -> {
    +                final PartitionedTable validated = partitionedTable.transform(executionContext, table -> {
                         final String description = k.toString() + "_" + System.identityHashCode(table);
                         final QueryTable coalesced = (QueryTable) table.coalesce();
                         addValidator(hardReferences, description, coalesced);
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/MultiColumnSortTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/MultiColumnSortTest.java
    index 78446d036a0..4be4000450b 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/MultiColumnSortTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/MultiColumnSortTest.java
    @@ -7,6 +7,7 @@
     import io.deephaven.api.SortColumn;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    +import io.deephaven.test.junit4.EngineCleanup;
     import io.deephaven.test.types.SerialTest;
     import io.deephaven.benchmarking.BenchmarkTable;
     import io.deephaven.benchmarking.BenchmarkTableBuilder;
    @@ -15,6 +16,7 @@
     import junit.framework.TestCase;
     import org.junit.After;
     import org.junit.Before;
    +import org.junit.Rule;
     import org.junit.Test;
     import org.junit.experimental.categories.Category;
     
    @@ -26,16 +28,8 @@
     
     @Category(SerialTest.class)
     public class MultiColumnSortTest {
    -    @Before
    -    public void setUp() {
    -        UpdateGraphProcessor.DEFAULT.enableUnitTestMode();
    -        UpdateGraphProcessor.DEFAULT.resetForUnitTests(false);
    -    }
    -
    -    @After
    -    public void teardown() {
    -        UpdateGraphProcessor.DEFAULT.resetForUnitTests(true);
    -    }
    +    @Rule
    +    public EngineCleanup framework = new EngineCleanup();
     
         @Test
         public void testMultiColumnSort() {
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java
    index 632541f4ef0..b01e68201b0 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java
    @@ -9,19 +9,19 @@
     import io.deephaven.base.verify.Assert;
     import io.deephaven.configuration.Configuration;
     import io.deephaven.datastructures.util.CollectionUtil;
    +import io.deephaven.engine.context.ExecutionContext;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetFactory;
     import io.deephaven.engine.rowset.RowSetShiftData;
     import io.deephaven.engine.table.ModifiedColumnSet;
     import io.deephaven.engine.table.PartitionedTable;
     import io.deephaven.engine.table.PartitionedTableFactory;
    -import io.deephaven.engine.table.lang.QueryLibrary;
     import io.deephaven.io.logger.StreamLoggerImpl;
     import io.deephaven.test.types.OutOfBandTest;
     import io.deephaven.util.process.ProcessEnvironment;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
     import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.liveness.LivenessScopeStack;
    @@ -244,6 +244,7 @@ public void testTransformPartitionedTableThenMerge() {
     
             final PartitionedTable partitionedTable = sourceTable.partitionBy("Key");
     
    +        final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext();
             final EvalNuggetInterface[] en = new EvalNuggetInterface[] {
                     new EvalNugget() {
                         @Override
    @@ -255,7 +256,7 @@ protected Table e() {
                         @Override
                         protected Table e() {
                             return partitionedTable
    -                                .transform(
    +                                .transform(executionContext,
                                             t -> t.update("K2=Key * 2").update("K3=Key + K2").update("K5 = K3 + K2"))
                                     .merge().sort("Key");
                         }
    @@ -264,7 +265,7 @@ protected Table e() {
                         @Override
                         protected Table e() {
                             return partitionedTable
    -                                .partitionedTransform(partitionedTable,
    +                                .partitionedTransform(partitionedTable, executionContext,
                                             (l, r) -> l.naturalJoin(r.lastBy("Key"), "Key", "Sentinel2=Sentinel"))
                                     .merge().sort("Key");
                         }
    @@ -461,9 +462,14 @@ public void testCrossDependencies() {
             pauseHelper.release();
             pauseHelper2.release();
     
    +        final ExecutionContext executionContext = ExecutionContext.newBuilder()
    +                .captureQueryScopeVars("pauseHelper2")
    +                .captureQueryLibrary()
    +                .captureCompilerContext()
    +                .build();
             final PartitionedTable result2 =
                     sourceTable2.update("SlowItDown=pauseHelper.pauseValue(k)").partitionBy("USym2")
    -                        .transform(t -> t.update("SlowItDown2=pauseHelper2.pauseValue(2 * k)"));
    +                        .transform(executionContext, t -> t.update("SlowItDown2=pauseHelper2.pauseValue(2 * k)"));
     
             // pauseHelper.pause();
             pauseHelper2.pause();
    @@ -543,8 +549,13 @@ public void testCrossDependencies2() {
     
             pauseHelper.release();
     
    +        final ExecutionContext executionContext = ExecutionContext.newBuilder()
    +                .captureQueryScopeVars("pauseHelper")
    +                .captureQueryLibrary()
    +                .captureCompilerContext()
    +                .build();
             final PartitionedTable result2 = sourceTable2.partitionBy("USym2")
    -                .transform(t -> t.update("SlowItDown2=pauseHelper.pauseValue(2 * k)"));
    +                .transform(executionContext, t -> t.update("SlowItDown2=pauseHelper.pauseValue(2 * k)"));
     
             final PartitionedTable joined = result.partitionedTransform(result2, (l, r) -> {
                 System.out.println("Doing naturalJoin");
    @@ -739,9 +750,17 @@ public void testMergeConstituentChanges() {
     
             final MutableLong step = new MutableLong(0);
             QueryScope.addParam("step", step);
    -        QueryLibrary.importStatic(TableTools.class);
    -        final Table underlying = base.update(
    -                "Constituent=emptyTable(1000 * step.longValue()).update(\"JJ=ii * \" + II + \" * step.longValue()\")");
    +        ExecutionContext.getContext().getQueryLibrary().importStatic(TableTools.class);
    +
    +        final Table underlying;
    +        try (final SafeCloseable ignored = ExecutionContext.newBuilder()
    +                .captureQueryLibrary()
    +                .captureCompilerContext()
    +                .captureQueryScope()
    +                .build().open()) {
    +            underlying = base.update(
    +                    "Constituent=emptyTable(1000 * step.longValue()).update(\"JJ=ii * \" + II + \" * step.longValue()\")");
    +        }
     
             final PartitionedTable partitioned = PartitionedTableFactory.of(underlying);
             final Table merged = partitioned.merge();
    @@ -791,4 +810,55 @@ public void testMergeStaticAndRefreshing() {
                 ((BaseTable) mergedTable).notifyListeners(i(), ir(0, 1), i());
             });
         }
    +
    +    private EvalNugget newExecutionContextNugget(
    +            QueryTable table, Function op) {
    +        return new EvalNugget() {
    +            @Override
    +            protected Table e() {
    +                // note we cannot reuse the execution context and remove the values as the table is built each iteration
    +                try (final SafeCloseable ignored = ExecutionContext.newBuilder()
    +                        .captureCompilerContext()
    +                        .captureQueryLibrary()
    +                        .newQueryScope()
    +                        .build().open()) {
    +                    ;
    +                    ExecutionContext.getContext().getQueryScope().putParam("queryScopeVar", "queryScopeValue");
    +                    ExecutionContext.getContext().getQueryScope().putParam("queryScopeFilter", 50000);
    +
    +                    final PartitionedTable.Proxy proxy = table.partitionedAggBy(List.of(), true, null, "intCol")
    +                            .proxy(false, false);
    +                    final Table result = op.apply(proxy).target().merge().sort("intCol");
    +
    +                    ExecutionContext.getContext().getQueryScope().putParam("queryScopeVar", null);
    +                    ExecutionContext.getContext().getQueryScope().putParam("queryScopeFilter", null);
    +                    return result;
    +                }
    +            }
    +        };
    +    }
    +
    +    public void testExecutionContext() {
    +        final Random random = new Random(0);
    +
    +        final int size = 100;
    +
    +        final TstUtils.ColumnInfo[] columnInfo;
    +        final QueryTable table = getTable(size, random,
    +                columnInfo = initColumnInfos(new String[] {"intCol", "indices"},
    +                        new TstUtils.IntGenerator(0, 100000),
    +                        new TstUtils.SortedLongGenerator(0, Long.MAX_VALUE - 1)));
    +
    +        final EvalNuggetInterface[] en = new EvalNuggetInterface[] {
    +                newExecutionContextNugget(table, src -> src.update("K = queryScopeVar")),
    +                newExecutionContextNugget(table, src -> src.updateView("K = queryScopeVar")),
    +                newExecutionContextNugget(table, src -> src.select("K = queryScopeVar", "indices", "intCol")),
    +                newExecutionContextNugget(table, src -> src.view("K = queryScopeVar", "indices", "intCol")),
    +                newExecutionContextNugget(table, src -> src.where("intCol > queryScopeFilter")),
    +        };
    +
    +        for (int i = 0; i < 100; i++) {
    +            simulateShiftAwareStep(size, random, table, columnInfo, en);
    +        }
    +    }
     }
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java
    index dae6a527b27..0be36b3ba74 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java
    @@ -23,7 +23,7 @@
     import io.deephaven.vector.IntVector;
     import io.deephaven.vector.ObjectVector;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.table.impl.select.SelectColumnFactory;
     import io.deephaven.time.DateTime;
     import io.deephaven.engine.liveness.LivenessScope;
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java
    index 1ada2eadfe3..a7f13f36573 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java
    @@ -5,6 +5,7 @@
     
     import io.deephaven.base.testing.BaseArrayTestCase;
     import io.deephaven.datastructures.util.CollectionUtil;
    +import io.deephaven.engine.table.MatchPair;
     import io.deephaven.engine.table.PartitionedTable;
     import io.deephaven.engine.table.iterators.ObjectColumnIterator;
     import io.deephaven.time.DateTimeUtils;
    @@ -12,9 +13,9 @@
     import io.deephaven.io.logger.Logger;
     import io.deephaven.io.logger.StreamLoggerImpl;
     import io.deephaven.engine.table.Table;
    -import io.deephaven.engine.table.impl.select.AjMatchPairFactory;
    +import io.deephaven.api.expression.AsOfJoinMatchFactory;
     import io.deephaven.engine.table.impl.select.MatchPairFactory;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.time.DateTime;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.liveness.LivenessScopeStack;
    @@ -29,6 +30,7 @@
     
     import java.util.Arrays;
     import java.util.Collections;
    +import java.util.List;
     import java.util.Random;
     import java.util.Set;
     import java.util.stream.Collectors;
    @@ -38,6 +40,7 @@
     import org.junit.Test;
     import org.junit.experimental.categories.Category;
     
    +import static io.deephaven.api.TableOperationsDefaults.splitToCollection;
     import static io.deephaven.engine.util.TableTools.*;
     import static io.deephaven.engine.table.impl.QueryTableTestBase.intColumn;
     import static io.deephaven.engine.table.impl.TstUtils.*;
    @@ -936,7 +939,8 @@ private void testAjRandomIncrementalWithInitial(int seed, int leftNodeSize, int
                                             SortingOrder.Ascending, false)),
                                     // < aj
                                     EvalNugget.from(() -> AsOfJoinHelper.asOfJoin(control, leftTable, rightSorted,
    -                                        AjMatchPairFactory.getExpressions(false, "LeftStamp raj
                                             EvalNugget.from(() -> AsOfJoinHelper.asOfJoin(control, leftTable, rightReversed,
    -                                                AjMatchPairFactory.getExpressions(true, "LeftStamp>RightStamp").first,
    +                                                MatchPair.fromMatches(List.of(AsOfJoinMatchFactory
    +                                                        .getRajExpressions("LeftStamp>RightStamp").matches)),
                                                     MatchPairFactory.getExpressions("RightStamp", "RightSentinel"),
                                                     SortingOrder.Descending, true)))),
                     !withBuckets ? Stream.empty()
    @@ -964,8 +969,8 @@ private void testAjRandomIncrementalWithInitial(int seed, int leftNodeSize, int
                                             SortingOrder.Ascending, false)),
                                     // < aj, with a bucket
                                     EvalNugget.from(() -> AsOfJoinHelper.asOfJoin(control, leftTable, rightSorted,
    -                                        AjMatchPairFactory.getExpressions(false, "Bucket",
    -                                                "LeftStamp raj, with a bucket
                                     EvalNugget.from(() -> AsOfJoinHelper.asOfJoin(control, leftTable, rightReversed,
    -                                        AjMatchPairFactory.getExpressions(true, "Bucket", "LeftStamp>RightStamp").first,
    +                                        MatchPair.fromMatches(List.of(AsOfJoinMatchFactory.getRajExpressions("Bucket",
    +                                                "LeftStamp>RightStamp").matches)),
                                             MatchPairFactory.getExpressions("RightStamp", "RightSentinel"),
                                             SortingOrder.Descending, true))))
                     .toArray(EvalNuggetInterface[]::new);
    @@ -1018,10 +1024,13 @@ private void doInitialAjComparison(QueryTable leftTable, QueryTable rightTable,
                 TableTools.showWithRowSet(staticResult);
             }
     
    +        MatchPair[] matches = MatchPair.fromMatches(List.of(reverse
    +                ? AsOfJoinMatchFactory.getRajExpressions(splitToCollection(columnsToMatch)).matches
    +                : AsOfJoinMatchFactory.getAjExpressions(splitToCollection(columnsToMatch)).matches));
    +
             try (final SafeCloseable ignored = LivenessScopeStack.open()) {
                 final Table refreshingResult = AsOfJoinHelper.asOfJoin(control, leftTable,
    -                    reverse ? ((QueryTable) rightTable.reverse()) : rightTable,
    -                    AjMatchPairFactory.getExpressions(reverse, columnsToMatch.split(",")).first,
    +                    reverse ? ((QueryTable) rightTable.reverse()) : rightTable, matches,
                         MatchPairFactory.getExpressions("RightStamp", "RightSentinel"),
                         reverse ? SortingOrder.Descending : SortingOrder.Ascending, disallowMatch);
     
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableHugeSortTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableHugeSortTest.java
    index 820cf325a1d..7682f48058a 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableHugeSortTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableHugeSortTest.java
    @@ -4,7 +4,7 @@
     package io.deephaven.engine.table.impl;
     
     import io.deephaven.engine.table.Table;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetFactory;
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableJoinTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableJoinTest.java
    index 82aaeaff545..8cc2028571b 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableJoinTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableJoinTest.java
    @@ -9,7 +9,7 @@
     import io.deephaven.vector.ObjectVector;
     import io.deephaven.vector.DoubleVector;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.util.type.ArrayTypeUtils;
     import io.deephaven.test.junit4.EngineCleanup;
     import io.deephaven.test.types.OutOfBandTest;
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateBigTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateBigTest.java
    index 479e3f84c58..1f1ba7ea040 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateBigTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateBigTest.java
    @@ -3,40 +3,13 @@
      */
     package io.deephaven.engine.table.impl;
     
    -import io.deephaven.base.testing.BaseArrayTestCase;
    -import io.deephaven.configuration.Configuration;
    -import io.deephaven.engine.liveness.LivenessScope;
    -import io.deephaven.engine.liveness.LivenessScopeStack;
    -import io.deephaven.engine.rowset.RowSet;
    -import io.deephaven.engine.rowset.RowSetBuilderSequential;
    -import io.deephaven.engine.rowset.RowSetFactory;
    -import io.deephaven.engine.rowset.WritableRowSet;
    -import io.deephaven.engine.table.ColumnSource;
    -import io.deephaven.engine.table.ShiftObliviousListener;
     import io.deephaven.engine.table.Table;
    -import io.deephaven.engine.table.impl.QueryTableTestBase.ListenerWithGlobals;
    -import io.deephaven.engine.table.impl.QueryTableTestBase.TableComparator;
    -import io.deephaven.engine.table.impl.select.DhFormulaColumn;
    -import io.deephaven.engine.table.impl.select.FormulaCompilationException;
    -import io.deephaven.engine.table.impl.sources.LongSparseArraySource;
    -import io.deephaven.engine.table.impl.util.RuntimeMemory;
    -import io.deephaven.engine.table.lang.QueryLibrary;
    -import io.deephaven.engine.table.lang.QueryScope;
    -import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.util.TableTools;
     import io.deephaven.test.junit4.EngineCleanup;
     import io.deephaven.test.types.OutOfBandTest;
    -import io.deephaven.util.SafeCloseable;
    -import junit.framework.TestCase;
    -import org.apache.commons.lang3.mutable.MutableInt;
    -import org.junit.Assert;
     import org.junit.Rule;
     import org.junit.Test;
     import org.junit.experimental.categories.Category;
     
    -import java.util.*;
    -import java.util.function.Supplier;
    -
     import static io.deephaven.engine.table.impl.TstUtils.*;
     import static io.deephaven.engine.util.TableTools.*;
     
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateTest.java
    index d02139c1cdf..e90892b3920 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSelectUpdateTest.java
    @@ -5,15 +5,15 @@
     
     import io.deephaven.base.testing.BaseArrayTestCase;
     import io.deephaven.configuration.Configuration;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.rowset.WritableRowSet;
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.engine.rowset.RowSetBuilderSequential;
     import io.deephaven.engine.rowset.RowSetFactory;
     import io.deephaven.engine.table.ShiftObliviousListener;
     import io.deephaven.engine.table.Table;
    -import io.deephaven.engine.table.lang.QueryLibrary;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.liveness.LivenessScope;
     import io.deephaven.engine.liveness.LivenessScopeStack;
    @@ -227,7 +227,7 @@ public void testLazyUpdate() {
                 return;
             }
     
    -        QueryLibrary.importStatic(QueryTableSelectUpdateTest.class);
    +        ExecutionContext.getContext().getQueryLibrary().importStatic(QueryTableSelectUpdateTest.class);
     
             QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("A", 1, 2, 3));
             table = (QueryTable) table
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSortTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSortTest.java
    index 79a8e6a8670..26d571dfb3b 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSortTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableSortTest.java
    @@ -15,7 +15,7 @@
     import io.deephaven.engine.table.TableDefinition;
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.time.DateTime;
     import io.deephaven.parquet.table.ParquetTools;
     import io.deephaven.engine.util.TableTools;
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java
    index 922a0156173..085ccbe52cd 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java
    @@ -3,14 +3,14 @@
      */
     package io.deephaven.engine.table.impl;
     
    -import io.deephaven.base.StringUtils;
    +import io.deephaven.api.TableOperationsDefaults;
     import io.deephaven.datastructures.util.CollectionUtil;
     import io.deephaven.engine.rowset.RowSet;
     import io.deephaven.io.logger.Logger;
     import io.deephaven.io.logger.StreamLoggerImpl;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.impl.select.MatchPairFactory;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.table.ColumnSource;
     import gnu.trove.map.TByteIntMap;
    @@ -205,7 +205,7 @@ private static void testNaturalJoinRandomStatic(int seed, int leftSize, int righ
                 joined = leftJoinTable.naturalJoin(rightJoinTable, matchKeys, "RightSentinel");
             } else {
                 joined = NaturalJoinHelper.naturalJoin((QueryTable) leftJoinTable, (QueryTable) rightJoinTable,
    -                    MatchPairFactory.getExpressions(StringUtils.splitToCollection(matchKeys)),
    +                    MatchPairFactory.getExpressions(TableOperationsDefaults.splitToCollection(matchKeys)),
                         MatchPairFactory.getExpressions("RightSentinel"), false, control);
             }
     
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java
    index c0227003ded..30953692f26 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java
    @@ -25,7 +25,7 @@
     import io.deephaven.vector.*;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
     import io.deephaven.engine.table.impl.select.MatchPairFactory;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.engine.table.impl.select.SelectColumnFactory;
     import io.deephaven.engine.table.impl.select.WhereFilterFactory;
     import io.deephaven.time.DateTime;
    @@ -345,7 +345,6 @@ public Table e() {
         }
     
         public void testView() {
    -        QueryScope.setScope(new QueryScope.StandaloneImpl());
             QueryScope.addParam("indexMinEdge", 2.0);
             QueryScope.addParam("IsIndex", true);
             QueryScope.addParam("MEF", 1.0);
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableWhereTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableWhereTest.java
    index 83863f450ad..ef5e2ce25bb 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableWhereTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableWhereTest.java
    @@ -17,7 +17,7 @@
     import io.deephaven.time.DateTimeUtils;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
     import io.deephaven.engine.table.impl.select.MatchPairFactory;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
     import io.deephaven.time.DateTime;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.table.impl.verify.TableAssertions;
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java
    index 30e38b935e0..a3d6bb2574d 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java
    @@ -4,16 +4,16 @@
     package io.deephaven.engine.table.impl;
     
     import io.deephaven.base.testing.BaseArrayTestCase;
    -import io.deephaven.compilertools.CompilerTools;
    -import io.deephaven.configuration.Configuration;
     import io.deephaven.chunk.util.pools.ChunkPoolReleaseTracking;
    -import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker;
    -import io.deephaven.engine.table.lang.QueryScope;
    -import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker;
    +import io.deephaven.configuration.Configuration;
    +import io.deephaven.engine.context.CompilerTools;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.liveness.LivenessScope;
     import io.deephaven.engine.liveness.LivenessScopeStack;
    +import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker;
     import io.deephaven.engine.table.impl.util.AsyncClientErrorNotifier;
    +import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    +import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker;
     import io.deephaven.util.ExceptionDetails;
     import io.deephaven.util.SafeCloseable;
     import junit.framework.TestCase;
    @@ -37,9 +37,9 @@ abstract public class RefreshingTableTestCase extends BaseArrayTestCase implemen
         private UpdateErrorReporter oldReporter;
         private boolean expectError = false;
         private SafeCloseable livenessScopeCloseable;
    -    private QueryScope originalQueryScope;
         private boolean oldLogEnabled;
         private boolean oldCheckLtm;
    +    private SafeCloseable executionContext;
     
         List errors;
     
    @@ -58,7 +58,9 @@ protected void setUp() throws Exception {
             oldReporter = AsyncClientErrorNotifier.setReporter(this);
             errors = null;
             livenessScopeCloseable = LivenessScopeStack.open(new LivenessScope(true), true);
    -        originalQueryScope = QueryScope.getScope();
    +
    +        // initialize the unit test's execution context
    +        executionContext = ExecutionContext.createForUnitTests().open();
     
             oldLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING);
             oldCheckLtm = UpdateGraphProcessor.DEFAULT.setCheckTableOperations(false);
    @@ -72,7 +74,9 @@ protected void tearDown() throws Exception {
             UpdateGraphProcessor.DEFAULT.setCheckTableOperations(oldCheckLtm);
             CompilerTools.setLogEnabled(oldLogEnabled);
     
    -        QueryScope.setScope(originalQueryScope);
    +        // reset the execution context
    +        executionContext.close();
    +
             livenessScopeCloseable.close();
             AsyncClientErrorNotifier.setReporter(oldReporter);
             QueryTable.setMemoizeResults(oldMemoize);
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableAggregationTest.java
    index 89ab34971a8..47722c4a2c3 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableAggregationTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableAggregationTest.java
    @@ -20,6 +20,7 @@
     import junit.framework.ComparisonFailure;
     import junit.framework.TestCase;
     import org.jetbrains.annotations.NotNull;
    +import org.junit.Before;
     import org.junit.Rule;
     import org.junit.Test;
     
    @@ -41,10 +42,15 @@ public class StreamTableAggregationTest {
         @Rule
         public final EngineCleanup base = new EngineCleanup();
     
    -    private final Table source = TableCreatorImpl.create(EmptyTable.of(INPUT_SIZE)
    -            .update("Sym = Long.toString(ii % 1000) + `_Sym`")
    -            .update("Price = ii / 100 - (ii % 100)")
    -            .update("Size = (long) (ii / 50 - (ii % 50))"));
    +    private Table source;
    +
    +    @Before
    +    public void setUp() {
    +        source = TableCreatorImpl.create(EmptyTable.of(INPUT_SIZE)
    +                .update("Sym = Long.toString(ii % 1000) + `_Sym`")
    +                .update("Price = ii / 100 - (ii % 100)")
    +                .update("Size = (long) (ii / 50 - (ii % 50))"));
    +    }
     
         /**
          * Execute a table operator ending in an aggregation.
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableOperationsTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableOperationsTest.java
    index e6fc0ff9ee6..c6cca6d9220 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableOperationsTest.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/StreamTableOperationsTest.java
    @@ -19,6 +19,7 @@
     import junit.framework.ComparisonFailure;
     import junit.framework.TestCase;
     import org.jetbrains.annotations.NotNull;
    +import org.junit.Before;
     import org.junit.Rule;
     import org.junit.Test;
     
    @@ -36,15 +37,20 @@
     public class StreamTableOperationsTest {
     
         @Rule
    -    public EngineCleanup base = new EngineCleanup();
    +    public final EngineCleanup framework = new EngineCleanup();
     
         private static final long INPUT_SIZE = 100_000L;
         private static final long MAX_RANDOM_ITERATION_SIZE = 10_000;
     
    -    private final Table source = TableCreatorImpl.create(EmptyTable.of(INPUT_SIZE)
    -            .update("Sym = Long.toString(ii % 1000) + `_Sym`")
    -            .update("Price = ii / 100 - (ii % 100)")
    -            .update("Size = (long) (ii / 50 - (ii % 50))"));
    +    private Table source;
    +
    +    @Before
    +    public void setUp() {
    +        source = TableCreatorImpl.create(EmptyTable.of(INPUT_SIZE)
    +                .update("Sym = Long.toString(ii % 1000) + `_Sym`")
    +                .update("Price = ii / 100 - (ii % 100)")
    +                .update("Size = (long) (ii / 50 - (ii % 50))"));
    +    }
     
         /**
          * Execute a table operator.
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java
    index 340ece85e2a..b3748e3e0a3 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java
    @@ -9,10 +9,10 @@
     import gnu.trove.set.hash.TIntHashSet;
     import io.deephaven.api.agg.Aggregation;
     import io.deephaven.api.agg.spec.AggSpec;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.table.DataColumn;
     import io.deephaven.engine.table.Table;
     import io.deephaven.vector.CharVector;
    -import io.deephaven.engine.table.lang.QueryLibrary;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
     import io.deephaven.time.DateTime;
     import io.deephaven.engine.rowset.RowSet;
    @@ -190,7 +190,7 @@ private void testComboByIncremental(final String ctxt, final int size) {
                                     new TstUtils.SetGenerator<>(10.1, 20.1, 30.1),
                                     new TstUtils.SetGenerator<>(10.1, 20.1, 30.1, QueryConstants.NULL_DOUBLE)));
     
    -        QueryLibrary.importClass(TestAggBy.class);
    +        ExecutionContext.getContext().getQueryLibrary().importClass(TestAggBy.class);
     
             String[] groupByColumns = new String[0];
             EvalNuggetInterface[] en = new EvalNuggetInterface[] {
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggregatedSelect.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggregatedSelect.java
    index 9d2655970f9..d8b4f8aa667 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggregatedSelect.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggregatedSelect.java
    @@ -8,6 +8,8 @@
     import io.deephaven.engine.table.DataColumn;
     import io.deephaven.engine.table.Table;
     import io.deephaven.engine.table.TableDefinition;
    +import io.deephaven.engine.context.ExecutionContext;
    +import io.deephaven.util.SafeCloseable;
     import io.deephaven.vector.Vector;
     import io.deephaven.util.type.ArrayTypeUtils;
     import io.deephaven.engine.util.TableTools;
    @@ -28,9 +30,11 @@ public TestAggregatedSelect() {
         }
     
         private static File tableDirectory;
    +    private SafeCloseable executionContext;
     
         @Before
         public void setUp() {
    +        executionContext = ExecutionContext.createForUnitTests().open();
             try {
                 tableDirectory = Files.createTempDirectory("TestAggregatedSelect").toFile();
             } catch (IOException e) {
    @@ -40,6 +44,7 @@ public void setUp() {
     
         @After
         public void tearDown() {
    +        executionContext.close();
             FileUtils.deleteRecursivelyOnNFS(tableDirectory);
         }
     
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigDecimalColumns.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigDecimalColumns.java
    index 7c57f1a7237..6e17ea26545 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigDecimalColumns.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigDecimalColumns.java
    @@ -10,12 +10,16 @@
     import static io.deephaven.engine.table.impl.TstUtils.assertTableEquals;
     import static io.deephaven.engine.util.TableTools.*;
     
    +import io.deephaven.test.junit4.EngineCleanup;
    +import org.junit.Rule;
     import org.junit.Test;
     
     import java.math.BigDecimal;
     import java.math.RoundingMode;
     
     public class TestBigDecimalColumns {
    +    @Rule
    +    public final EngineCleanup base = new EngineCleanup();
     
         private static BigDecimal atScale(final double v, final int scale) {
             return BigDecimal.valueOf(v).setScale(scale, RoundingMode.HALF_UP);
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigIntegerColumns.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigIntegerColumns.java
    index f9a45deab24..6b0dd7b839a 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigIntegerColumns.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestBigIntegerColumns.java
    @@ -10,6 +10,8 @@
     import static io.deephaven.engine.table.impl.TstUtils.assertTableEquals;
     import static io.deephaven.engine.util.TableTools.*;
     
    +import io.deephaven.test.junit4.EngineCleanup;
    +import org.junit.Rule;
     import org.junit.Test;
     
     import java.math.BigDecimal;
    @@ -17,6 +19,8 @@
     import java.math.RoundingMode;
     
     public class TestBigIntegerColumns {
    +    @Rule
    +    public final EngineCleanup base = new EngineCleanup();
     
         private static BigDecimal atScale(final double v, final int scale) {
             return BigDecimal.valueOf(v).setScale(scale, RoundingMode.HALF_UP);
    diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java
    index 9ab018b0f86..b0f5c118125 100644
    --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java
    +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java
    @@ -10,9 +10,9 @@
     import io.deephaven.engine.rowset.RowSetShiftData;
     import io.deephaven.engine.table.*;
     import io.deephaven.engine.table.impl.select.*;
    -import io.deephaven.engine.table.lang.QueryLibrary;
     import io.deephaven.engine.updategraph.UpdateGraphProcessor;
    -import io.deephaven.engine.table.lang.QueryScope;
    +import io.deephaven.engine.context.QueryScope;
    +import io.deephaven.engine.context.ExecutionContext;
     import io.deephaven.engine.util.TableDiff;
     import io.deephaven.engine.util.TableTools;
     import io.deephaven.engine.liveness.LivenessScopeStack;
    @@ -49,8 +49,35 @@
     
     @Category(OutOfBandTest.class)
     public class TestConcurrentInstantiation extends QueryTableTestBase {
    -    private final ExecutorService pool = Executors.newFixedThreadPool(1);
    -    private final ExecutorService dualPool = Executors.newFixedThreadPool(2);
    +    private static final int TIMEOUT_LENGTH = 5;
    +    private static final TimeUnit TIMEOUT_UNIT = TimeUnit.MINUTES;
    +
    +    private ExecutorService pool;
    +    private ExecutorService dualPool;
    +
    +    @Override
    +    protected void setUp() throws Exception {
    +        super.setUp();
    +        final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext();
    +        final ThreadFactory threadFactory = runnable -> {
    +            Thread thread = new Thread(() -> {
    +                try (final SafeCloseable ignored = executionContext.open()) {
    +                    runnable.run();
    +                }
    +            });
    +            thread.setDaemon(true);
    +            return thread;
    +        };
    +        pool = Executors.newFixedThreadPool(1, threadFactory);
    +        dualPool = Executors.newFixedThreadPool(2, threadFactory);
    +    }
    +
    +    @Override
    +    protected void tearDown() throws Exception {
    +        super.tearDown();
    +        pool.shutdown();
    +        dualPool.shutdown();
    +    }
     
         public void testTreeTableFilter() throws ExecutionException, InterruptedException {
             // TODO (https://github.com/deephaven/deephaven-core/issues/64): Delete this, uncomment and fix the rest
    @@ -71,14 +98,14 @@ public void testTreeTableFilter() throws ExecutionException, InterruptedExceptio
             // () -> TreeTableFilter.rawFilterTree(treed, "Sentinel in 4, 6, 9, 11, 12, 13, 14, 15");
             //
             // UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
    -        // final Table rawSorted = pool.submit(callable).get();
    +        // final Table rawSorted = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
             // TableTools.show(rawSorted);
             //
             // assertTrue(Arrays.equals(new int[] {1, 3, 4, 6, 9}, (int[]) rawSorted.getColumn("Sentinel").getDirect()));
             //
             // TstUtils.addToTable(source, i(10), c("Sentinel", 11),
             // c("Parent", 2));
    -        // final Table table2 = pool.submit(callable).get();
    +        // final Table table2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
             // assertEquals(TableTools.diff(rawSorted, table2, 20), "");
             //
             // source.notifyListeners(i(10), i(), i());
    @@ -87,7 +114,7 @@ public void testTreeTableFilter() throws ExecutionException, InterruptedExceptio
             // assertEquals(TableTools.diff(rawSorted, table2, 20), "");
             //
             // UpdateGraphProcessor.DEFAULT.completeCycleForUnitTests();
    -        // final Table table3 = future3.get();
    +        // final Table table3 = future3.get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
             //
             // assertEquals(TableTools.diff(rawSorted, table2, 20), "");
             // assertEquals(TableTools.diff(table2, table3, 20), "");
    @@ -95,7 +122,7 @@ public void testTreeTableFilter() throws ExecutionException, InterruptedExceptio
             // UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
             // TstUtils.addToTable(source, i(11), c("Sentinel", 12), c("Parent", 10));
             //
    -        // final Table table4 = pool.submit(callable).get();
    +        // final Table table4 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
             // assertEquals(TableTools.diff(rawSorted, table2, 20), "");
             // assertEquals(TableTools.diff(table2, table3, 20), "");
             // assertEquals(TableTools.diff(table3, table4, 20), "");
    @@ -111,7 +138,7 @@ public void testTreeTableFilter() throws ExecutionException, InterruptedExceptio
         }
     
     
    -    public void testFlatten() throws ExecutionException, InterruptedException {
    +    public void testFlatten() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"));
             final Table tableStart = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
    @@ -119,21 +146,21 @@ public void testFlatten() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table flat = pool.submit(table::flatten).get();
    +        final Table flat = pool.submit(table::flatten).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(flat, table, 10), "");
             TestCase.assertEquals(TableTools.diff(flat, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"));
     
    -        final Table flat2 = pool.submit(table::flatten).get();
    +        final Table flat2 = pool.submit(table::flatten).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(prevTable(flat), tableStart);
             TstUtils.assertTableEquals(prevTable(flat2), tableStart);
     
             table.notifyListeners(i(3), i(), i());
     
    -        final Table flat3 = pool.submit(table::flatten).get();
    +        final Table flat3 = pool.submit(table::flatten).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(prevTable(flat), tableStart);
             TstUtils.assertTableEquals(prevTable(flat2), tableStart);
    @@ -145,7 +172,7 @@ public void testFlatten() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(table, flat3);
         }
     
    -    public void testUpdateView() throws ExecutionException, InterruptedException {
    +    public void testUpdateView() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"));
             final Table tableStart =
    @@ -158,20 +185,20 @@ public void testUpdateView() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table updateView1 = pool.submit(callable).get();
    +        final Table updateView1 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(updateView1, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"));
     
    -        final Table updateView2 = pool.submit(callable).get();
    +        final Table updateView2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(updateView1));
             TstUtils.assertTableEquals(tableStart, prevTable(updateView2));
     
             table.notifyListeners(i(3), i(), i());
     
    -        final Table updateView3 = pool.submit(callable).get();
    +        final Table updateView3 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(updateView1));
             TstUtils.assertTableEquals(tableStart, prevTable(updateView2));
    @@ -183,7 +210,7 @@ public void testUpdateView() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(tableUpdate, updateView3);
         }
     
    -    public void testView() throws ExecutionException, InterruptedException {
    +    public void testView() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"));
             final Table tableStart = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
    @@ -195,20 +222,20 @@ public void testView() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table updateView1 = pool.submit(callable).get();
    +        final Table updateView1 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(updateView1, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"));
     
    -        final Table updateView2 = pool.submit(callable).get();
    +        final Table updateView2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(updateView1));
             TstUtils.assertTableEquals(tableStart, prevTable(updateView2));
     
             table.notifyListeners(i(3), i(), i());
     
    -        final Table updateView3 = pool.submit(callable).get();
    +        final Table updateView3 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(updateView1));
             TstUtils.assertTableEquals(tableStart, prevTable(updateView2));
    @@ -220,7 +247,7 @@ public void testView() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(tableUpdate, updateView3);
         }
     
    -    public void testDropColumns() throws ExecutionException, InterruptedException {
    +    public void testDropColumns() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table =
                     TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                             c("x", 1, 2, 3), c("y", "a", "b", "c"), c("z", 4, 8, 12));
    @@ -233,20 +260,20 @@ public void testDropColumns() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table dropColumns1 = pool.submit(callable).get();
    +        final Table dropColumns1 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(dropColumns1, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"), c("z", 16));
     
    -        final Table dropColumns2 = pool.submit(callable).get();
    +        final Table dropColumns2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(dropColumns1));
             TstUtils.assertTableEquals(tableStart, prevTable(dropColumns2));
     
             table.notifyListeners(i(3), i(), i());
     
    -        final Table dropColumns3 = pool.submit(callable).get();
    +        final Table dropColumns3 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(dropColumns1));
             TstUtils.assertTableEquals(tableStart, prevTable(dropColumns2));
    @@ -258,7 +285,7 @@ public void testDropColumns() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(tableUpdate, dropColumns3);
         }
     
    -    public void testWhere() throws ExecutionException, InterruptedException {
    +    public void testWhere() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"), c("z", true, false, true));
             final Table tableStart =
    @@ -269,20 +296,20 @@ public void testWhere() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table filter1 = pool.submit(() -> table.where("z")).get();
    +        final Table filter1 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(filter1, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"), c("z", true));
     
    -        final Table filter2 = pool.submit(() -> table.where("z")).get();
    +        final Table filter2 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(filter1));
             TstUtils.assertTableEquals(tableStart, prevTable(filter2));
     
             table.notifyListeners(i(3), i(), i());
     
    -        final Table filter3 = pool.submit(() -> table.where("z")).get();
    +        final Table filter3 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(filter1));
             TstUtils.assertTableEquals(tableStart, prevTable(filter2));
    @@ -294,7 +321,7 @@ public void testWhere() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(tableUpdate, filter3);
         }
     
    -    public void testWhere2() throws ExecutionException, InterruptedException {
    +    public void testWhere2() throws ExecutionException, InterruptedException, TimeoutException {
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"), c("z", true, false, true));
             final Table tableStart = TstUtils.testRefreshingTable(i(2, 6).toTracking(),
    @@ -304,20 +331,20 @@ public void testWhere2() throws ExecutionException, InterruptedException {
     
             UpdateGraphProcessor.DEFAULT.startCycleForUnitTests();
     
    -        final Table filter1 = pool.submit(() -> table.where("z")).get();
    +        final Table filter1 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TestCase.assertEquals(TableTools.diff(filter1, tableStart, 10), "");
     
             TstUtils.addToTable(table, i(2, 3), c("x", 1, 4), c("y", "a", "d"), c("z", false, true));
     
    -        final Table filter2 = pool.submit(() -> table.where("z")).get();
    +        final Table filter2 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(filter1));
             TstUtils.assertTableEquals(tableStart, prevTable(filter2));
     
             table.notifyListeners(i(3), i(), i(2));
     
    -        final Table filter3 = pool.submit(() -> table.where("z")).get();
    +        final Table filter3 = pool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT);
     
             TstUtils.assertTableEquals(tableStart, prevTable(filter1));
             TstUtils.assertTableEquals(tableStart, prevTable(filter2));
    @@ -334,7 +361,7 @@ public void testWhere2() throws ExecutionException, InterruptedException {
             TstUtils.assertTableEquals(testUpdate, filter3);
         }
     
    -    public void testWhereDynamic() throws ExecutionException, InterruptedException {
    +    public void testWhereDynamic() throws ExecutionException, InterruptedException, TimeoutException {
     
             final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(),
                     c("x", 1, 2, 3), c("y", "a", "b", "c"), c("z", true, false, true));
    @@ -351,25 +378,25 @@ public void testWhereDynamic() throws ExecutionException, InterruptedException {
     
             final Future
    future1 = dualPool.submit(() -> table.where(filter)); try { - future1.get(1000, TimeUnit.MILLISECONDS); + future1.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); fail("Filtering should be blocked on UGP"); } catch (TimeoutException ignored) { } TstUtils.addToTable(table, i(2, 3), c("x", 1, 4), c("y", "a", "d"), c("z", false, true)); - final Table filter2 = dualPool.submit(() -> table.where("z")).get(); + final Table filter2 = dualPool.submit(() -> table.where("z")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); assertTableEquals(tableStart, prevTable(filter2)); table.notifyListeners(i(3), i(), i(2)); UpdateGraphProcessor.DEFAULT.completeCycleForUnitTests(); - final Table filter1 = future1.get(); + final Table filter1 = future1.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(testUpdate, filter1); TstUtils.assertTableEquals(filter2, filter1); } - public void testSort() throws ExecutionException, InterruptedException { + public void testSort() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("x", 1, 2, 3), c("y", "a", "b", "c")); final Table tableStart = TstUtils.testRefreshingTable(i(1, 2, 3).toTracking(), @@ -379,20 +406,20 @@ public void testSort() throws ExecutionException, InterruptedException { UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); - final Table sort1 = pool.submit(() -> table.sortDescending("x")).get(); + final Table sort1 = pool.submit(() -> table.sortDescending("x")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(TableTools.diff(sort1, tableStart, 10), ""); TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d")); - final Table sort2 = pool.submit(() -> table.sortDescending("x")).get(); + final Table sort2 = pool.submit(() -> table.sortDescending("x")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(sort1)); TstUtils.assertTableEquals(tableStart, prevTable(sort2)); table.notifyListeners(i(3), i(), i()); - final Table sort3 = pool.submit(() -> table.sortDescending("x")).get(); + final Table sort3 = pool.submit(() -> table.sortDescending("x")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(sort1)); TstUtils.assertTableEquals(tableStart, prevTable(sort2)); @@ -404,7 +431,7 @@ public void testSort() throws ExecutionException, InterruptedException { TstUtils.assertTableEquals(tableUpdate, sort3); } - public void testReverse() throws ExecutionException, InterruptedException { + public void testReverse() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("x", 1, 2, 3), c("y", "a", "b", "c")); final Table tableStart = TstUtils.testRefreshingTable(i(1, 2, 3).toTracking(), @@ -418,20 +445,20 @@ public void testReverse() throws ExecutionException, InterruptedException { UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); - final Table reverse1 = pool.submit(table::reverse).get(); + final Table reverse1 = pool.submit(table::reverse).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(TableTools.diff(reverse1, tableStart, 10), ""); TstUtils.addToTable(table, i(8), c("x", 4), c("y", "d")); - final Table reverse2 = pool.submit(table::reverse).get(); + final Table reverse2 = pool.submit(table::reverse).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(reverse1)); TstUtils.assertTableEquals(tableStart, prevTable(reverse2)); table.notifyListeners(i(8), i(), i()); - final Table reverse3 = pool.submit(table::reverse).get(); + final Table reverse3 = pool.submit(table::reverse).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(reverse1)); TstUtils.assertTableEquals(tableStart, prevTable(reverse2)); @@ -466,7 +493,7 @@ public void testReverse() throws ExecutionException, InterruptedException { } - public void testSortOfPartitionBy() throws ExecutionException, InterruptedException { + public void testSortOfPartitionBy() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("x", 1, 2, 3), c("y", "a", "a", "a")); final PartitionedTable pt = table.partitionBy("y"); @@ -488,8 +515,8 @@ public void testSortOfPartitionBy() throws ExecutionException, InterruptedExcept TableTools.show(tableA); TableTools.show(tableD); - final Table sortA = pool.submit(() -> tableA.sort("x")).get(); - final Table sortD = pool.submit(() -> tableD.sort("x")).get(); + final Table sortA = pool.submit(() -> tableA.sort("x")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); + final Table sortD = pool.submit(() -> tableD.sort("x")).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TableTools.show(sortA); TableTools.show(sortD); @@ -500,7 +527,7 @@ public void testSortOfPartitionBy() throws ExecutionException, InterruptedExcept } - public void testChain() throws ExecutionException, InterruptedException { + public void testChain() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("x", 1, 2, 3), c("y", "a", "b", "c"), c("z", true, false, true)); final Table tableStart = TstUtils.testRefreshingTable(i(1, 3).toTracking(), @@ -513,20 +540,20 @@ public void testChain() throws ExecutionException, InterruptedException { UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); - final Table chain1 = pool.submit(callable).get(); + final Table chain1 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(TableTools.diff(chain1, tableStart, 10), ""); TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"), c("z", true)); - final Table chain2 = pool.submit(callable).get(); + final Table chain2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(chain1)); TstUtils.assertTableEquals(tableStart, prevTable(chain2)); table.notifyListeners(i(3), i(), i()); - final Table chain3 = pool.submit(callable).get(); + final Table chain3 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); showWithRowSet(chain3); @@ -540,14 +567,15 @@ public void testChain() throws ExecutionException, InterruptedException { TstUtils.assertTableEquals(tableUpdate, chain3); } - public void testReverseLookupListener() throws ExecutionException, InterruptedException { + public void testReverseLookupListener() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), c("x", 1, 2, 3), c("y", "a", "b", "c")); UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); final ReverseLookupListener rll = - pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")).get(); + pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")) + .get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(rll.get(1), 2); TestCase.assertEquals(rll.get(2), 4); @@ -557,7 +585,8 @@ public void testReverseLookupListener() throws ExecutionException, InterruptedEx TstUtils.addToTable(table, i(4), c("x", 4), c("y", "d")); final ReverseLookupListener rll2 = - pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")).get(); + pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")) + .get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(rll2.get(1), 2); TestCase.assertEquals(rll2.get(2), 4); @@ -567,7 +596,8 @@ public void testReverseLookupListener() throws ExecutionException, InterruptedEx table.notifyListeners(i(), i(), i(4)); final ReverseLookupListener rll3 = - pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")).get(); + pool.submit(() -> ReverseLookupListener.makeReverseLookupListenerWithSnapshot(table, "x")) + .get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(rll3.get(1), 2); TestCase.assertEquals(rll3.get(2), rll.getNoEntryValue()); @@ -722,14 +752,14 @@ private void testIterative(List> transformations, int see final List
    beforeStartFirstHalf = new ArrayList<>(splitCallables.size()); for (Pair, Function> splitCallable : splitCallables) { - beforeStartFirstHalf.add(pool.submit(splitCallable.first).get()); + beforeStartFirstHalf.add(pool.submit(splitCallable.first).get(TIMEOUT_LENGTH, TIMEOUT_UNIT)); } UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); if (beforeUpdate) { // before we update the underlying data - final Table chain1 = pool.submit(complete).get(); + final Table chain1 = pool.submit(complete).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); chain1.setAttribute("Step", i); chain1.setAttribute("Type", "beforeUpdate"); results.add(chain1); @@ -740,7 +770,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeStartFirstHalf.get(fSplitIndex))).get(); + .apply(beforeStartFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeUpdateSplit"); beforeStartAndBeforeUpdateSplitResults.add(splitResult); @@ -750,14 +780,14 @@ private void testIterative(List> transformations, int see final List
    beforeUpdateFirstHalf = new ArrayList<>(splitCallables.size()); for (Pair, Function> splitCallable : splitCallables) { - beforeUpdateFirstHalf.add(pool.submit(splitCallable.first).get()); + beforeUpdateFirstHalf.add(pool.submit(splitCallable.first).get(TIMEOUT_LENGTH, TIMEOUT_UNIT)); } final RowSet[] updates = GenerateTableUpdates.computeTableUpdates(size, random, table, columnInfos); if (beforeNotify) { // after we update the underlying data, but before we notify - final Table chain2 = pool.submit(complete).get(); + final Table chain2 = pool.submit(complete).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); chain2.setAttribute("Step", i); chain2.setAttribute("Type", "beforeNotify"); results.add(chain2); @@ -768,7 +798,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(); + .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeAndAfterUpdateSplit"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -782,7 +812,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeStartFirstHalf.get(fSplitIndex))).get(); + .apply(beforeStartFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeStartAndAfterUpdate"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -793,7 +823,7 @@ private void testIterative(List> transformations, int see final List
    beforeNotifyFirstHalf = new ArrayList<>(splitCallables.size()); for (Pair, Function> splitCallable : splitCallables) { - beforeNotifyFirstHalf.add(pool.submit(splitCallable.first).get()); + beforeNotifyFirstHalf.add(pool.submit(splitCallable.first).get(TIMEOUT_LENGTH, TIMEOUT_UNIT)); } table.notifyListeners(updates[0], updates[1], updates[2]); @@ -803,7 +833,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeNotifyFirstHalf.get(fSplitIndex))).get(); + .apply(beforeNotifyFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeAndAfterNotify"); beforeAndAfterNotifySplitResults.add(splitResult); @@ -816,7 +846,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeStartFirstHalf.get(fSplitIndex))).get(); + .apply(beforeStartFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeStartAndAfterNotify"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -830,7 +860,7 @@ private void testIterative(List> transformations, int see for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(); + .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeUpdateAndAfterNotify"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -842,13 +872,13 @@ private void testIterative(List> transformations, int see final List
    beforeCycleFirstHalf = new ArrayList<>(splitCallables.size()); if (beforeAndAfterCycle) { for (Pair, Function> splitCallable : splitCallables) { - beforeCycleFirstHalf.add(pool.submit(splitCallable.first).get()); + beforeCycleFirstHalf.add(pool.submit(splitCallable.first).get(TIMEOUT_LENGTH, TIMEOUT_UNIT)); } } if (beforeNotify) { // after notification, on the same cycle - final Table chain3 = pool.submit(complete).get(); + final Table chain3 = pool.submit(complete).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); chain3.setAttribute("Step", i); chain3.setAttribute("Type", "beforeNotify"); results.add(chain3); @@ -878,7 +908,7 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeStartFirstHalf.get(fSplitIndex))).get(); + .apply(beforeStartFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeStartAndAfterCycle"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -903,7 +933,7 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(); + .apply(beforeUpdateFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeUpdateAndAfterCycle"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -928,7 +958,7 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeNotifyFirstHalf.get(fSplitIndex))).get(); + .apply(beforeNotifyFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeNotifyAndAfterCycle"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -955,7 +985,7 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { for (int splitIndex = 0; splitIndex < splitCallables.size(); ++splitIndex) { final int fSplitIndex = splitIndex; final Table splitResult = pool.submit(() -> splitCallables.get(fSplitIndex).second - .apply(beforeCycleFirstHalf.get(fSplitIndex))).get(); + .apply(beforeCycleFirstHalf.get(fSplitIndex))).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); splitResult.setAttribute("Step", i); splitResult.setAttribute("Type", "beforeAndAfterCycle"); splitResult.setAttribute("SplitIndex", splitIndex); @@ -1004,7 +1034,7 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { } } - public void testSelectDistinct() throws ExecutionException, InterruptedException { + public void testSelectDistinct() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6, 8).toTracking(), c("y", "a", "b", "a", "c")); final Table expected1 = newTable(c("y", "a", "b", "c")); @@ -1015,7 +1045,7 @@ public void testSelectDistinct() throws ExecutionException, InterruptedException final Callable
    callable = () -> table.selectDistinct("y"); - final Table distinct1 = pool.submit(callable).get(); + final Table distinct1 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(expected1, distinct1); @@ -1023,14 +1053,14 @@ public void testSelectDistinct() throws ExecutionException, InterruptedException TstUtils.assertTableEquals(expected1, distinct1); - final Table distinct2 = pool.submit(callable).get(); + final Table distinct2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(expected1, distinct2); TstUtils.assertTableEquals(expected1, prevTable(distinct2)); table.notifyListeners(i(3), i(), i()); - final Table distinct3 = pool.submit(callable).get(); + final Table distinct3 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(expected1, prevTable(distinct1)); TstUtils.assertTableEquals(expected1, prevTable(distinct2)); @@ -1084,7 +1114,7 @@ void waitForInvocation(int count, int timeoutMillis) throws InterruptedException } } - public void testSelectDistinctReset() throws ExecutionException, InterruptedException { + public void testSelectDistinctReset() throws ExecutionException, InterruptedException, TimeoutException { final BarrierFunction barrierFunction = new BarrierFunction(); QueryScope.addParam("barrierFunction", barrierFunction); @@ -1109,7 +1139,7 @@ public void testSelectDistinctReset() throws ExecutionException, InterruptedExce UpdateGraphProcessor.DEFAULT.completeCycleForUnitTests(); - final Table distinct1 = future1.get(); + final Table distinct1 = future1.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(expected1, distinct1); } finally { QueryScope.addParam("barrierFunction", null); @@ -1208,7 +1238,7 @@ private void testByConcurrent(Function function, boolean hasKeys, final Callable
    callable; final Table slowed; if (withReset) { - QueryLibrary.importStatic(TestConcurrentInstantiation.class); + ExecutionContext.getContext().getQueryLibrary().importStatic(TestConcurrentInstantiation.class); slowed = table.updateView("KeyColumn=barrierFunction.apply(KeyColumn)"); callable = () -> { @@ -1240,7 +1270,7 @@ private void testByConcurrent(Function function, boolean hasKeys, if (withReset) { barrierFunction.waitForInvocation(2, 5000); } - result1 = future1.get(); + result1 = future1.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Result 1"); TableTools.show(result1); @@ -1262,7 +1292,7 @@ private void testByConcurrent(Function function, boolean hasKeys, TstUtils.assertTableEquals(expected1, prevResult1a, TableDiff.DiffItems.DoublesExact); - final Table result2 = pool.submit(callable).get(); + final Table result2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Result 2"); TableTools.show(result2); @@ -1289,7 +1319,7 @@ private void testByConcurrent(Function function, boolean hasKeys, UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); } } - final Table result3 = future3.get(); + final Table result3 = future3.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Prev Result 1"); final Table prevResult1b = prevTable(result1); @@ -1340,7 +1370,7 @@ private void testPartitionByConcurrent(boolean withReset) throws Exception { final Callable callable; final Table slowed; if (withReset) { - QueryLibrary.importStatic(TestConcurrentInstantiation.class); + ExecutionContext.getContext().getQueryLibrary().importStatic(TestConcurrentInstantiation.class); slowed = table.updateView("KeyColumn=identitySleep(KeyColumn)"); callable = () -> slowed.partitionBy("KeyColumn"); @@ -1364,7 +1394,7 @@ private void testPartitionByConcurrent(boolean withReset) throws Exception { if (withReset) { SleepUtil.sleep(25); } - result1 = future1.get(); + result1 = future1.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Result 1"); final Table result1a = result1.constituentFor("a"); @@ -1383,7 +1413,7 @@ private void testPartitionByConcurrent(boolean withReset) throws Exception { doByConcurrentAdditions(table, false); doByConcurrentModifications(table, false); - final PartitionedTable result2 = pool.submit(callable).get(); + final PartitionedTable result2 = pool.submit(callable).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Result 2"); final Table result2a = result2.constituentFor("a"); @@ -1406,7 +1436,7 @@ private void testPartitionByConcurrent(boolean withReset) throws Exception { UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); } } - final PartitionedTable result3 = future3.get(); + final PartitionedTable result3 = future3.get(TIMEOUT_LENGTH, TIMEOUT_UNIT); System.out.println("Result 3"); final Table result3a = result3.constituentFor("a"); @@ -1502,7 +1532,7 @@ private void doByConcurrentAdditions(QueryTable table, boolean haveBigNumerics) TstUtils.addToTable(table, i(5, 9), columnHolders.toArray(ColumnHolder.ZERO_LENGTH_COLUMN_HOLDER_ARRAY)); } - public void testConstructSnapshotException() throws ExecutionException, InterruptedException { + public void testConstructSnapshotException() throws ExecutionException, InterruptedException, TimeoutException { final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6, 8).toTracking(), c("y", "a", "b", "c", "d")); @@ -1549,12 +1579,12 @@ public void testConstructSnapshotException() throws ExecutionException, Interrup UpdateGraphProcessor.DEFAULT.completeCycleForUnitTests(); // now get the answer - final String[] answer = future.get(); + final String[] answer = future.get(5000, TimeUnit.MILLISECONDS); assertEquals(Arrays.asList("a", "b", "c", "d", "e"), Arrays.asList(answer)); } - public void testStaticSnapshot() throws ExecutionException, InterruptedException { + public void testStaticSnapshot() throws ExecutionException, InterruptedException, TimeoutException { final Table emptyTable = TableTools.emptyTable(0); final QueryTable table = TstUtils.testRefreshingTable(i(2, 4, 6).toTracking(), @@ -1565,20 +1595,20 @@ public void testStaticSnapshot() throws ExecutionException, InterruptedException UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); - final Table snap1 = pool.submit(() -> emptyTable.snapshot(table)).get(); + final Table snap1 = pool.submit(() -> emptyTable.snapshot(table)).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TestCase.assertEquals(TableTools.diff(snap1, tableStart, 10), ""); TstUtils.addToTable(table, i(3), c("x", 4), c("y", "d"), c("z", true)); - final Table snap2 = pool.submit(() -> emptyTable.snapshot(table)).get(); + final Table snap2 = pool.submit(() -> emptyTable.snapshot(table)).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(snap1)); TstUtils.assertTableEquals(tableStart, prevTable(snap2)); table.notifyListeners(i(3), i(), i()); - final Table snap3 = pool.submit(() -> emptyTable.snapshot(table)).get(); + final Table snap3 = pool.submit(() -> emptyTable.snapshot(table)).get(TIMEOUT_LENGTH, TIMEOUT_UNIT); TstUtils.assertTableEquals(tableStart, prevTable(snap1)); TstUtils.assertTableEquals(tableStart, prevTable(snap2)); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestDownsampledWhereFilter.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestDownsampledWhereFilter.java index 6ac8875301a..8225c408ead 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestDownsampledWhereFilter.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestDownsampledWhereFilter.java @@ -4,10 +4,14 @@ package io.deephaven.engine.table.impl; import io.deephaven.engine.table.Table; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.select.DownsampledWhereFilter; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import java.io.IOException; @@ -18,6 +22,18 @@ import static io.deephaven.engine.table.impl.TstUtils.*; public class TestDownsampledWhereFilter { + private SafeCloseable executionContext; + + @Before + public void setUp() throws Exception { + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @After + public void tearDown() throws Exception { + executionContext.close(); + } + @Test public void testDownsampledWhere() throws IOException { Random random = new Random(42); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestMoveColumns.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestMoveColumns.java index c63127d7720..a62a98cdcf9 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestMoveColumns.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestMoveColumns.java @@ -4,14 +4,33 @@ package io.deephaven.engine.table.impl; import io.deephaven.engine.table.Table; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.util.TableTools; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import java.util.stream.Collectors; public class TestMoveColumns extends TestCase { - private static final Table table = TableTools.emptyTable(1).update("a=1", "b=2", "c=3", "d=4", "e=5"); - private static final int numCols = table.numColumns(); + + private Table table; + private int numCols; + + private SafeCloseable executionContext; + + @Override + protected void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + table = TableTools.emptyTable(1).update("a=1", "b=2", "c=3", "d=4", "e=5"); + numCols = table.numColumns(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } public void testMoveColumns() { // Basic moving diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitioningColumns.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitioningColumns.java index 4bbd11db173..f5c4fd0d1b5 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitioningColumns.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitioningColumns.java @@ -7,6 +7,7 @@ import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; +import io.deephaven.test.junit4.EngineCleanup; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.table.impl.locations.ColumnLocation; @@ -21,6 +22,7 @@ import io.deephaven.engine.rowset.RowSetFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.junit.Rule; import org.junit.Test; import java.util.LinkedHashMap; @@ -34,6 +36,9 @@ */ public class TestPartitioningColumns { + @Rule + public final EngineCleanup base = new EngineCleanup(); + @Test public void testEverything() { final Table input = newTable( diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSelectPreserveGrouping.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSelectPreserveGrouping.java index 5e49cf21eff..8f5a03e6707 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSelectPreserveGrouping.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSelectPreserveGrouping.java @@ -8,7 +8,7 @@ import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; import io.deephaven.engine.table.impl.indexer.RowSetIndexer; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.parquet.table.ParquetTools; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.ColumnSource; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSharedContext.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSharedContext.java index 41945931de5..83f3dcf9df8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSharedContext.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSharedContext.java @@ -9,6 +9,8 @@ import io.deephaven.engine.table.SharedContext; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.test.junit4.EngineCleanup; +import org.junit.Rule; import org.junit.Test; import java.util.Random; @@ -19,6 +21,9 @@ public class TestSharedContext { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private static final class TestSharedContextKey implements SharedContext.Key { } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java index 6d889812df7..67c3d70b30c 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java @@ -4,12 +4,13 @@ package io.deephaven.engine.table.impl; import io.deephaven.base.testing.BaseArrayTestCase; -import io.deephaven.compilertools.CompilerTools; +import io.deephaven.engine.context.CompilerTools; import io.deephaven.configuration.Configuration; import io.deephaven.engine.exceptions.NotSortableException; import io.deephaven.engine.table.DataColumn; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.time.DateTime; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.test.types.OutOfBandTest; @@ -24,6 +25,7 @@ import java.util.Map; import java.util.function.BiFunction; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; import org.junit.experimental.categories.Category; @@ -35,6 +37,7 @@ public class TestSort extends BaseArrayTestCase { private boolean lastMemoize = false; private boolean oldCompilerToolsLogEnabled; + private SafeCloseable executionContext; @Override protected void setUp() throws Exception { @@ -43,6 +46,7 @@ protected void setUp() throws Exception { UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); lastMemoize = QueryTable.setMemoizeResults(false); oldCompilerToolsLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING); + executionContext = ExecutionContext.createForUnitTests().open(); } @Override @@ -51,6 +55,7 @@ protected void tearDown() throws Exception { CompilerTools.setLogEnabled(oldCompilerToolsLogEnabled); QueryTable.setMemoizeResults(lastMemoize); UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); + executionContext.close(); } @FunctionalInterface diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSortIncrementalPerformance.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSortIncrementalPerformance.java index 9126ea1ef8f..9d4e7ab02b9 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSortIncrementalPerformance.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSortIncrementalPerformance.java @@ -6,7 +6,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.select.IncrementalReleaseFilter; import io.deephaven.test.junit4.EngineCleanup; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSourceSink.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSourceSink.java index 5f981db1b3a..33fc594206b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSourceSink.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSourceSink.java @@ -29,37 +29,38 @@ public static void runTests(ChunkType chunkType, IntFunction makeSink final RandomResetter randomResetter = RandomResetter.makeRandomResetter(chunkType); final Random rng = new Random(120108951); - final ResettableWritableChunk chunkA = containerType.makeResettableWritableChunk(); - final ResettableWritableChunk chunkB = containerType.makeResettableWritableChunk(); - randomResetter.resetWithRandomValues(rng, chunkA, chunkSize); - randomResetter.resetWithRandomValues(rng, chunkB, chunkSize); - - final RowSequence keysA = - RowSequenceFactory.wrapKeyRangesChunkAsRowSequence(LongChunk.chunkWrap(new long[] {0, chunkSize - 1})); - final RowSequence keysB = RowSequenceFactory - .wrapKeyRangesChunkAsRowSequence(LongChunk.chunkWrap(new long[] {2 * chunkSize, 3 * chunkSize - 1})); - - final ChunkSink.FillFromContext fromContext = sink.makeFillFromContext(chunkSize); - sink.fillFromChunk(fromContext, chunkA, keysA); - sink.fillFromChunk(fromContext, chunkB, keysB); - - // Get the whole thing back as one big chunk - final RowSequence keysAll = - RowSequenceFactory + try (final ResettableWritableChunk chunkA = containerType.makeResettableWritableChunk(); + final ResettableWritableChunk chunkB = containerType.makeResettableWritableChunk(); + final WritableChunk chunkNull = containerType.makeWritableChunk(chunkSize); + final RowSequence keysAll = RowSequenceFactory .wrapKeyRangesChunkAsRowSequence(LongChunk.chunkWrap(new long[] {0, 4 * chunkSize - 1})); - final ChunkSource.GetContext getContext = sink.makeGetContext(totalSize); + final ChunkSource.GetContext getContext = sink.makeGetContext(totalSize)) { + chunkNull.fillWithNullValue(0, chunkSize); + + randomResetter.resetWithRandomValues(rng, chunkA, chunkSize); + randomResetter.resetWithRandomValues(rng, chunkB, chunkSize); - final Chunk valuesAll = sink.getChunk(getContext, keysAll); + try (final RowSequence keysA = + RowSequenceFactory + .wrapKeyRangesChunkAsRowSequence(LongChunk.chunkWrap(new long[] {0, chunkSize - 1})); + final RowSequence keysB = RowSequenceFactory + .wrapKeyRangesChunkAsRowSequence( + LongChunk.chunkWrap(new long[] {2 * chunkSize, 3 * chunkSize - 1})); + final ChunkSink.FillFromContext fromContext = sink.makeFillFromContext(chunkSize)) { + sink.fillFromChunk(fromContext, chunkA, keysA); + sink.fillFromChunk(fromContext, chunkB, keysB); + } - final WritableChunk chunkNull = containerType.makeWritableChunk(chunkSize); - chunkNull.fillWithNullValue(0, chunkSize); + // Get the whole thing back as one big chunk + final Chunk valuesAll = sink.getChunk(getContext, keysAll); - final ChunkEquals ce = ChunkEquals.makeEqual(containerType); + final ChunkEquals ce = ChunkEquals.makeEqual(containerType); - equalsHelper("first chunk", ce, chunkA, valuesAll, 0, chunkSize - 1); - equalsHelper("second chunk", ce, chunkNull, valuesAll, chunkSize, 2 * chunkSize - 1); - equalsHelper("third chunk", ce, chunkB, valuesAll, 2 * chunkSize, 3 * chunkSize - 1); - equalsHelper("fourth chunk", ce, chunkNull, valuesAll, 3 * chunkSize, 4 * chunkSize - 1); + equalsHelper("first chunk", ce, chunkA, valuesAll, 0, chunkSize - 1); + equalsHelper("second chunk", ce, chunkNull, valuesAll, chunkSize, 2 * chunkSize - 1); + equalsHelper("third chunk", ce, chunkB, valuesAll, 2 * chunkSize, 3 * chunkSize - 1); + equalsHelper("fourth chunk", ce, chunkNull, valuesAll, 3 * chunkSize, 4 * chunkSize - 1); + } } private static void equalsHelper(String what, final ChunkEquals ce, final Chunk expected, diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TstUtils.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TstUtils.java index 77948a75acd..dfc44b6a341 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TstUtils.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TstUtils.java @@ -13,6 +13,7 @@ import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.rowset.impl.RowSetTstUtils; import io.deephaven.engine.table.ElementSource; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.stringset.HashStringSet; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.Table; @@ -2145,6 +2146,11 @@ public void assertInvoked() { public void assertNotInvoked() { TestCase.assertFalse(invoked); } + + @Override + public ExecutionContext getExecutionContext() { + return null; + } } public static class TstErrorNotification extends TstNotification implements NotificationQueue.ErrorNotification { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/lang/TestQueryLanguageParser.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/lang/TestQueryLanguageParser.java index ffc09b92060..6ee4bdf7684 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/lang/TestQueryLanguageParser.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/lang/TestQueryLanguageParser.java @@ -119,6 +119,8 @@ public void setUp() throws Exception { variables.put("ExampleQuantity4", double.class); variables.put("ExampleStr", String.class); + variables.put("genericSub", TestGenericSub.class); + variableParameterizedTypes = new HashMap<>(); variableParameterizedTypes.put("myArrayList", new Class[] {Long.class}); variableParameterizedTypes.put("myHashMap", new Class[] {Integer.class, Double.class}); @@ -2187,6 +2189,60 @@ public void testInvalidExpr() throws Exception { check(expression, "greaterEquals(23, plus(System.currentTimeMillis(), 12))", boolean.class, new String[0]); } + public static class TestGenericResult1 { + } + public static class TestGenericResult2 { + } + public static class TestGenericResult3 { + } + public static class TestGenericResult4 { + } + public static class TestGenericResult5 { + } + public interface TestGenericInterfaceSuper { + default T getFromInterfaceSuper() { + return null; + } + } + public interface TestGenericInterfaceForSuper { + default T getFromInterfaceForSuper() { + return null; + } + } + public interface TestGenericInterfaceSub extends TestGenericInterfaceSuper { + default T getFromInterfaceSub() { + return null; + } + } + public interface TestGenericInterfaceSibling { + default T getFromInterfaceSibling() { + return null; + } + } + public static abstract class TestGenericSuper implements TestGenericInterfaceForSuper { + public T getFromSuper() { + return null; + } + } + public static class TestGenericSub extends TestGenericSuper + implements TestGenericInterfaceSub, TestGenericInterfaceSibling { + } + + public void testGenericReturnTypeResolution() throws Exception { + final String[] resultVarsUsed = new String[] {"genericSub"}; + + String expression = "genericSub.getFromInterfaceSuper()"; + check(expression, expression, TestGenericResult1.class, resultVarsUsed); + expression = "genericSub.getFromInterfaceForSuper()"; + check(expression, expression, TestGenericResult2.class, resultVarsUsed); + expression = "genericSub.getFromSuper()"; + check(expression, expression, TestGenericResult3.class, resultVarsUsed); + expression = "genericSub.getFromInterfaceSub()"; + check(expression, expression, TestGenericResult4.class, resultVarsUsed); + expression = "genericSub.getFromInterfaceSibling()"; + check(expression, expression, TestGenericResult5.class, resultVarsUsed); + } + @SuppressWarnings("SameParameterValue") private void expectFailure(String expression, Class resultType) throws Exception { try { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/locations/impl/TestGroupingProviders.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/locations/impl/TestGroupingProviders.java index e5e8e70565f..c6fbace2764 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/locations/impl/TestGroupingProviders.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/locations/impl/TestGroupingProviders.java @@ -8,16 +8,17 @@ import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryLibrary; import io.deephaven.parquet.table.ParquetTools; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.util.file.TrackedFileHandleFactory; import io.deephaven.engine.table.impl.TstUtils; import io.deephaven.parquet.table.layout.DeephavenNestedPartitionLayout; import io.deephaven.parquet.table.ParquetInstructions; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.io.File; @@ -35,6 +36,9 @@ */ public class TestGroupingProviders { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private File dataDirectory; @Before @@ -45,8 +49,6 @@ public void setUp() throws Exception { @After public void tearDown() throws Exception { - QueryLibrary.resetLibrary(); - if (dataDirectory.exists()) { TrackedFileHandleFactory.getInstance().closeAll(); int tries = 0; @@ -77,7 +79,9 @@ public void testParallelMissingGroups() { private void doTest(final boolean missingGroups) { final Table raw = TableTools.emptyTable(26 * 10 * 1000).update("Part=String.format(`%04d`, (long)(ii/1000))", "Sym=(char)('A' + ii % 26)", "Other=ii"); - final Table[] partitions = raw.partitionBy("Part").transform(rp -> rp.groupBy("Sym").ungroup()).constituents(); + final Table[] partitions = raw.partitionBy("Part") + .transform(null, rp -> rp.groupBy("Sym").ungroup()) + .constituents(); if (!missingGroups) { // Create a pair of partitions without the grouping column diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelArraySample.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelArraySample.java index ecfebefeba1..dc9577e3922 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelArraySample.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelArraySample.java @@ -23,6 +23,7 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetBuilderRandom; @@ -36,7 +37,6 @@ import io.deephaven.engine.table.DataColumn; import io.deephaven.engine.table.Table; import static io.deephaven.engine.table.impl.select.ConditionFilter.FilterKernel; -import io.deephaven.engine.table.lang.QueryScopeParam; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.Period; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelSample.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelSample.java index 85629c04af2..1177765bd5b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelSample.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FilterKernelSample.java @@ -23,6 +23,7 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetBuilderRandom; @@ -36,7 +37,6 @@ import io.deephaven.engine.table.DataColumn; import io.deephaven.engine.table.Table; import static io.deephaven.engine.table.impl.select.ConditionFilter.FilterKernel; -import io.deephaven.engine.table.lang.QueryScopeParam; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.Period; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaKernelSample.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaKernelSample.java index 697fff50cd6..2b145639a98 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaKernelSample.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaKernelSample.java @@ -23,6 +23,7 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetBuilderRandom; @@ -36,7 +37,6 @@ import io.deephaven.engine.table.DataColumn; import io.deephaven.engine.table.Table; import static io.deephaven.engine.table.impl.select.ConditionFilter.FilterKernel; -import io.deephaven.engine.table.lang.QueryScopeParam; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.Period; @@ -73,7 +73,7 @@ public class FormulaKernelSample implements io.deephaven.engine.table.impl.selec private final java.lang.Integer q; public FormulaKernelSample(io.deephaven.vector.Vector[] __vectors, - io.deephaven.engine.table.lang.QueryScopeParam[] __params) { + io.deephaven.engine.context.QueryScopeParam[] __params) { II_ = (io.deephaven.vector.LongVector)__vectors[0]; q = (java.lang.Integer)__params[0].getValue(); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaSample.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaSample.java index 32f35ff4957..cbba0a320e7 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaSample.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaSample.java @@ -23,6 +23,7 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; +import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetBuilderRandom; @@ -36,7 +37,6 @@ import io.deephaven.engine.table.DataColumn; import io.deephaven.engine.table.Table; import static io.deephaven.engine.table.impl.select.ConditionFilter.FilterKernel; -import io.deephaven.engine.table.lang.QueryScopeParam; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.Period; @@ -79,7 +79,7 @@ public class FormulaSample extends io.deephaven.engine.table.impl.select.Formula public FormulaSample(final TrackingRowSet __rowSet, final boolean __lazy, final java.util.Map __columnsToData, - final io.deephaven.engine.table.lang.QueryScopeParam... __params) { + final io.deephaven.engine.context.QueryScopeParam... __params) { super(__rowSet); II = __columnsToData.get("II"); I = __columnsToData.get("I"); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaTestUtil.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaTestUtil.java index d7add1d3191..8d393f8a568 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaTestUtil.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/FormulaTestUtil.java @@ -4,13 +4,13 @@ package io.deephaven.engine.table.impl.select; import io.deephaven.base.verify.Assert; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; import io.deephaven.vector.ByteVectorDirect; import io.deephaven.vector.ObjectVector; import io.deephaven.vector.ObjectVectorDirect; import io.deephaven.vector.IntVectorDirect; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.util.type.ArrayTypeUtils; import io.deephaven.util.QueryConstants; import io.deephaven.engine.util.TableTools; @@ -100,12 +100,12 @@ static boolean involvesExceptionType(Throwable t, Class exc } static void setUpQueryLibrary() { - QueryLibrary.importPackage(Package.getPackage("java.util.concurrent")); + ExecutionContext.getContext().getQueryLibrary().importPackage(Package.getPackage("java.util.concurrent")); - QueryLibrary.importClass(Calendar.class); - QueryLibrary.importClass(ArrayTypeUtils.class); + ExecutionContext.getContext().getQueryLibrary().importClass(Calendar.class); + ExecutionContext.getContext().getQueryLibrary().importClass(ArrayTypeUtils.class); - QueryLibrary.importStatic(FormulaTestUtil.class); + ExecutionContext.getContext().getQueryLibrary().importStatic(FormulaTestUtil.class); } static void setUpQueryScope() { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/MatchPairFactoryTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/MatchPairFactoryTest.java index 49b3e76790b..3a247571358 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/MatchPairFactoryTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/MatchPairFactoryTest.java @@ -3,9 +3,8 @@ */ package io.deephaven.engine.table.impl.select; -import io.deephaven.engine.exceptions.ExpressionException; +import io.deephaven.api.expression.ExpressionException; import io.deephaven.engine.table.MatchPair; -import io.deephaven.engine.table.impl.select.MatchPairFactory; import junit.framework.TestCase; public class MatchPairFactoryTest extends TestCase { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java index 838fedce76a..05fd0dea8d7 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java @@ -3,28 +3,34 @@ */ package io.deephaven.engine.table.impl.select; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.util.ModelFileGenerator; +import io.deephaven.test.junit4.EngineCleanup; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; -import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.io.FileNotFoundException; import java.io.IOException; public class TestConditionFilterGeneration { + @Rule + public final EngineCleanup base = new EngineCleanup(); + + private SafeCloseable executionContext; + @Before public void setUp() { - QueryLibrary.setLibrary(QueryLibrary.makeNewLibrary("DEFAULT")); - } + executionContext = ExecutionContext.newBuilder() + .newQueryLibrary("DEFAULT") + .captureCompilerContext() + .captureQueryScope() + .build().open(); - @After - public void tearDown() { - QueryLibrary.resetLibrary(); } // @Test @@ -49,9 +55,9 @@ public void validateArrayFile() throws IOException { @NotNull private static String getClassDefString() { - QueryScope.getScope().putParam("p1", 10); - QueryScope.getScope().putParam("p2", (float) 10); - QueryScope.getScope().putParam("p3", "10"); + ExecutionContext.getContext().getQueryScope().putParam("p1", 10); + ExecutionContext.getContext().getQueryScope().putParam("p2", (float) 10); + ExecutionContext.getContext().getQueryScope().putParam("p3", "10"); final Table t = TableTools.emptyTable(10).select("v1 = (short)1", "v2 = 1.1"); final ConditionFilter conditionFilter = diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java index bca23767f08..6daf482aa16 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java @@ -10,8 +10,8 @@ import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils; import io.deephaven.engine.table.impl.lang.QueryLanguageParser.QueryLanguageParseException; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryLibrary; +import io.deephaven.engine.context.QueryScope; import io.deephaven.time.DateTime; import io.deephaven.engine.table.impl.util.codegen.TypeAnalyzer; import io.deephaven.test.junit4.EngineCleanup; @@ -51,10 +51,6 @@ public static Collection data() { private final boolean useKernelFormulas; private boolean kernelFormulasSavedValue; - static { - setUpQueryScope(); - } - public TestFormulaColumn(boolean useKernelFormulas) { this.useKernelFormulas = useKernelFormulas; testDataTable = getTestDataTable(); @@ -69,12 +65,12 @@ public void setUp() throws Exception { kernelFormulasSavedValue = DhFormulaColumn.useKernelFormulasProperty; DhFormulaColumn.useKernelFormulasProperty = useKernelFormulas; + setUpQueryScope(); setUpQueryLibrary(); } @After public void tearDown() throws Exception { - QueryLibrary.resetLibrary(); DhFormulaColumn.useKernelFormulasProperty = kernelFormulasSavedValue; } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java index c2ab1a30c11..28190f20058 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java @@ -3,12 +3,14 @@ */ package io.deephaven.engine.table.impl.select; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryLibrary; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.util.ModelFileGenerator; import io.deephaven.test.junit4.EngineCleanup; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; import org.junit.After; import org.junit.Before; @@ -40,14 +42,20 @@ public void generateFiles() throws FileNotFoundException { @Rule public final EngineCleanup base = new EngineCleanup(); + private SafeCloseable executionContext; + @Before public void setUp() { - QueryLibrary.setLibrary(QueryLibrary.makeNewLibrary("DEFAULT")); + executionContext = ExecutionContext.newBuilder() + .newQueryLibrary("DEFAULT") + .captureCompilerContext() + .captureQueryScope() + .build().open(); } @After public void tearDown() { - QueryLibrary.resetLibrary(); + executionContext.close(); } @Test diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestWhereFilterFactory.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestWhereFilterFactory.java index e61f4521fd3..1fa4a491c7c 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestWhereFilterFactory.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestWhereFilterFactory.java @@ -4,9 +4,11 @@ package io.deephaven.engine.table.impl.select; import io.deephaven.engine.table.Table; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.rowset.RowSet; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import java.util.ArrayList; @@ -14,6 +16,8 @@ public class TestWhereFilterFactory extends TestCase { + private SafeCloseable executionContext; + private static final String STRING_COLUMN = "Strings"; private static final String INTEGER_COLUMN = "Integers"; private static final String FLOAT_COLUMN = "Floats"; @@ -34,6 +38,7 @@ public class TestWhereFilterFactory extends TestCase { @Override protected void setUp() throws Exception { super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); table = TableTools.newTable( TableTools.col(STRING_COLUMN, NORMAL_STRING, NEEDS_ESCAPE, NO_COMMAS_A, NO_COMMAS_B, WITH_COMMAS_A, WITH_COMMAS_B), @@ -42,6 +47,12 @@ protected void setUp() throws Exception { TableTools.col(BOOLEAN_COLUMN, true, false, true, false, true, false)); } + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } + public void testColumnNameInValueNormal() { String value = runSimpleFilterExpresion(" in ", NORMAL_STRING); assertEquals(NORMAL_STRING, value); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/WhereFilterFactoryTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/WhereFilterFactoryTest.java index 69c108abf8b..9353d7a3f45 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/WhereFilterFactoryTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/WhereFilterFactoryTest.java @@ -5,7 +5,7 @@ import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.table.impl.RefreshingTableTestCase; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; @@ -35,8 +35,6 @@ public void testSourceColumn() { } public void testInComplex() { - QueryScope.setScope(new QueryScope.StandaloneImpl()); - assertEquals(MatchFilter.class, WhereFilterFactory.getExpression("Opra in opra1, opra2, opra3").getClass()); QueryScope.addParam("pmExpiry", "World"); assertEquals(MatchFilter.class, WhereFilterFactory.getExpression("amExpiry = pmExpiry").getClass()); @@ -69,7 +67,6 @@ public void testInComplex() { } public void testCharMatch() { - QueryScope.setScope(new QueryScope.StandaloneImpl()); QueryScope.addParam("theChar", 'C'); final Table tt = TableTools.newTable(TableTools.charCol("AChar", 'A', 'B', 'C', '\0', '\'')); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestByteTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestByteTimSortKernel.java index 93441e90896..6cf53653c82 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestByteTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestByteTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, byteChunk, rowKeys); } + + @Override + public void close() { + super.close(); + byteChunk.close(); + context.close(); + } } public static class BytePartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class ByteMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareByteChunks(List javaTuples, WritableByteChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestCharTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestCharTimSortKernel.java index 90cc9583ff9..36382ba1d36 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestCharTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestCharTimSortKernel.java @@ -64,6 +64,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, charChunk, rowKeys); } + + @Override + public void close() { + super.close(); + charChunk.close(); + context.close(); + } } public static class CharPartitionKernelStuff extends PartitionKernelStuff { @@ -114,6 +121,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class CharMergeStuff extends MergeStuff { @@ -237,6 +252,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareCharChunks(List javaTuples, WritableCharChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestDoubleTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestDoubleTimSortKernel.java index b131c2de4f8..250844c652b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestDoubleTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestDoubleTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, doubleChunk, rowKeys); } + + @Override + public void close() { + super.close(); + doubleChunk.close(); + context.close(); + } } public static class DoublePartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class DoubleMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareDoubleChunks(List javaTuples, WritableDoubleChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestFloatTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestFloatTimSortKernel.java index 10bd943b777..dcad7d108c8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestFloatTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestFloatTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, floatChunk, rowKeys); } + + @Override + public void close() { + super.close(); + floatChunk.close(); + context.close(); + } } public static class FloatPartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class FloatMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareFloatChunks(List javaTuples, WritableFloatChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestIntTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestIntTimSortKernel.java index 8a64dd9dc7b..47003edf7f9 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestIntTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestIntTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, intChunk, rowKeys); } + + @Override + public void close() { + super.close(); + intChunk.close(); + context.close(); + } } public static class IntPartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class IntMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareIntChunks(List javaTuples, WritableIntChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestLongTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestLongTimSortKernel.java index 18c9857a854..c968cdc6410 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestLongTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestLongTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, longChunk, rowKeys); } + + @Override + public void close() { + super.close(); + longChunk.close(); + context.close(); + } } public static class LongPartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class LongMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareLongChunks(List javaTuples, WritableLongChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java index 7c00ac0d4cc..55c89ba5b69 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestObjectTimSortKernel.java @@ -73,6 +73,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, ObjectChunk, rowKeys); } + + @Override + public void close() { + super.close(); + ObjectChunk.close(); + context.close(); + } } public static class ObjectPartitionKernelStuff extends PartitionKernelStuff { @@ -118,6 +125,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class ObjectMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareObjectChunks(List javaTuples, WritableObjectChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestShortTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestShortTimSortKernel.java index 6d3900515fc..4c298977def 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestShortTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/BaseTestShortTimSortKernel.java @@ -69,6 +69,13 @@ public void run() { void check(List expected) { verify(expected.size(), expected, shortChunk, rowKeys); } + + @Override + public void close() { + super.close(); + shortChunk.close(); + context.close(); + } } public static class ShortPartitionKernelStuff extends PartitionKernelStuff { @@ -119,6 +126,14 @@ public void run() { void check(List expected) { verifyPartition(context, rowSet, expected.size(), expected, valuesChunk, rowKeys, columnSource); } + + @Override + public void close() { + super.close(); + valuesChunk.close(); + context.close(); + rowSet.close(); + } } public static class ShortMergeStuff extends MergeStuff { @@ -242,6 +257,20 @@ public void run() { void check(List expected) { verify(expected.size(), expected, primaryChunk, secondaryChunk, rowKeys); } + + @Override + public void close() { + super.close(); + primaryChunk.close(); + secondaryChunk.close(); + secondaryChunkPermuted.close(); + sortIndexContext.close(); + indicesToFetch.close(); + originalPositions.close(); + context.close(); + secondarySortContext.close(); + secondaryColumnSourceContext.close(); + } } static private void prepareShortChunks(List javaTuples, WritableShortChunk valueChunk, WritableLongChunk rowKeys) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/TestTimSortKernel.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/TestTimSortKernel.java index e6a3753d1c5..d57891407af 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/TestTimSortKernel.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sort/timsort/TestTimSortKernel.java @@ -12,7 +12,10 @@ import io.deephaven.engine.rowset.impl.PerfStats; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; +import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.Nullable; +import org.junit.Rule; import java.util.Comparator; import java.util.List; @@ -31,6 +34,9 @@ public abstract class TestTimSortKernel { private static final int PERFORMANCE_SEEDS = 10; private static final int CORRECTNESS_SEEDS = 10; + @Rule + public final EngineCleanup framework = new EngineCleanup(); + @FunctionalInterface public interface GenerateTupleList { List generate(Random random, int size); @@ -48,7 +54,7 @@ abstract static class MergeStuff { abstract void run(); } - abstract static class SortKernelStuff { + abstract static class SortKernelStuff implements SafeCloseable { final WritableLongChunk rowKeys; SortKernelStuff(int size) { @@ -58,9 +64,14 @@ abstract static class SortKernelStuff { abstract void run(); abstract void check(List expected); + + @Override + public void close() { + rowKeys.close(); + } } - abstract static class PartitionKernelStuff { + abstract static class PartitionKernelStuff implements SafeCloseable { final WritableLongChunk rowKeys; PartitionKernelStuff(int size) { @@ -70,6 +81,11 @@ abstract static class PartitionKernelStuff { abstract void run(); abstract void check(List expected); + + @Override + public void close() { + rowKeys.close(); + } } abstract static class SortMultiKernelStuff extends SortKernelStuff { @@ -95,6 +111,15 @@ abstract static class SortMultiKernelStuff extends SortKernelStuff { abstract void run(); abstract void check(List expected); + + @Override + public void close() { + super.close(); + offsets.close(); + lengths.close(); + offsetsOut.close(); + lengthsOut.close(); + } } void performanceTest(GenerateTupleList generateValues, @@ -157,12 +182,11 @@ void correctnessTest(int size, GenerateTupleList tupleListGenerator, Comp final List javaTuples = tupleListGenerator.generate(random, size); - final SortKernelStuff sortStuff = prepareFunction.apply(javaTuples); - - javaTuples.sort(comparator); - sortStuff.run(); - - sortStuff.check(javaTuples); + try (final SortKernelStuff sortStuff = prepareFunction.apply(javaTuples)) { + javaTuples.sort(comparator); + sortStuff.run(); + sortStuff.check(javaTuples); + } } } @@ -187,12 +211,11 @@ void partitionCorrectnessTest(int dataSize, int chunkSize, int nPartitions, } final RowSet rowSet = builder.build(); - final PartitionKernelStuff partitionStuff = - prepareFunction.apply(javaTuples, rowSet, chunkSize, nPartitions, false); - - partitionStuff.run(); - - partitionStuff.check(javaTuples); + try (final PartitionKernelStuff partitionStuff = + prepareFunction.apply(javaTuples, rowSet, chunkSize, nPartitions, false)) { + partitionStuff.run(); + partitionStuff.check(javaTuples); + } } } @@ -204,15 +227,15 @@ void multiCorrectnessTest(int size, GenerateTupleList tupleListGenerator, final List javaTuples = tupleListGenerator.generate(random, size); - final SortKernelStuff sortStuff = prepareFunction.apply(javaTuples); - - // System.out.println("Prior to sort: " + javaTuples); - sortStuff.run(); + try (final SortKernelStuff sortStuff = prepareFunction.apply(javaTuples)) { + // System.out.println("Prior to sort: " + javaTuples); + sortStuff.run(); - javaTuples.sort(comparator); - // System.out.println("After sort: " + javaTuples); + javaTuples.sort(comparator); + // System.out.println("After sort: " + javaTuples); - sortStuff.check(javaTuples); + sortStuff.check(javaTuples); + } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestBooleanArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestBooleanArraySource.java index 9bcf18f2f75..6a4022ee181 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestBooleanArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestBooleanArraySource.java @@ -27,9 +27,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -42,6 +44,9 @@ import static junit.framework.TestCase.*; public class TestBooleanArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private BooleanArraySource forArray(byte[] values) { final BooleanArraySource source = new BooleanArraySource(); source.ensureCapacity(values.length); @@ -59,17 +64,6 @@ private void updateFromArray(BooleanArraySource dest, byte[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(byte[] values, byte[] newValues, int chunkSize, RowSet rowSet) { final BooleanArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -90,51 +84,53 @@ private void testGetChunkGeneric(byte[] values, byte[] newValues, int chunkSize, } private void validateValues(int chunkSize, byte[] values, RowSet rowSet, BooleanArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getBoolean(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getBoolean(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + // endregion samecheck } - // region samecheck - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, byte[] values, RowSet rowSet, BooleanArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getPrevChunk(context, okChunk).asObjectChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevBoolean(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getPrevChunk(context, okChunk).asObjectChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevBoolean(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -177,21 +173,22 @@ private void testGetChunkGenericLazy(byte[] values, int chunkSize, RowSet rowSet oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getBoolean(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getBoolean(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -287,45 +284,47 @@ private void testFillChunkGeneric(byte[] values, byte[] newValues, int chunkSize } private void validateValuesWithFill(int chunkSize, byte[] values, RowSet rowSet, BooleanArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getBoolean(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getBoolean(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, byte[] values, RowSet rowSet, BooleanArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevBoolean(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevBoolean(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -389,23 +388,24 @@ private void testFillChunkLazyGeneric(byte[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getBoolean(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getBoolean(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -503,22 +503,19 @@ public void confirmAliasingForbidden() { // super hack final byte[] peekedBlock = (byte[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestByteArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestByteArraySource.java index 65327c06790..0f3d2c04df5 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestByteArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestByteArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestByteArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private ByteArraySource forArray(byte[] values) { final ByteArraySource source = new ByteArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(ByteArraySource dest, byte[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(byte[] values, byte[] newValues, int chunkSize, RowSet rowSet) { final ByteArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(byte[] values, byte[] newValues, int chunkSize, } private void validateValues(int chunkSize, byte[] values, RowSet rowSet, ByteArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ByteChunk chunk = source.getChunk(context, okChunk).asByteChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getByte(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / ByteArraySource.BLOCK_SIZE != (ranges.get(1) / ByteArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ByteChunk chunk = source.getChunk(context, okChunk).asByteChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getByte(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / ByteArraySource.BLOCK_SIZE != (ranges.get(1) / ByteArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, byte[] values, RowSet rowSet, ByteArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ByteChunk chunk = source.getPrevChunk(context, okChunk).asByteChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevByte(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ByteChunk chunk = source.getPrevChunk(context, okChunk).asByteChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevByte(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(byte[] values, int chunkSize, RowSet rowSet oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ByteChunk chunk = source.getChunk(context, okChunk).asByteChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getByte(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ByteChunk chunk = source.getChunk(context, okChunk).asByteChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getByte(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(byte[] values, byte[] newValues, int chunkSize } private void validateValuesWithFill(int chunkSize, byte[] values, RowSet rowSet, ByteArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getByte(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getByte(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, byte[] values, RowSet rowSet, ByteArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevByte(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevByte(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(byte[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getByte(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableByteChunk chunk = WritableByteChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getByte(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final byte[] peekedBlock = (byte[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestCharacterArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestCharacterArraySource.java index 344ef062972..c142a01d3da 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestCharacterArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestCharacterArraySource.java @@ -17,9 +17,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -32,6 +34,9 @@ import static junit.framework.TestCase.*; public class TestCharacterArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private CharacterArraySource forArray(char[] values) { final CharacterArraySource source = new CharacterArraySource(); source.ensureCapacity(values.length); @@ -49,17 +54,6 @@ private void updateFromArray(CharacterArraySource dest, char[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(char[] values, char[] newValues, int chunkSize, RowSet rowSet) { final CharacterArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -80,58 +74,60 @@ private void testGetChunkGeneric(char[] values, char[] newValues, int chunkSize, } private void validateValues(int chunkSize, char[] values, RowSet rowSet, CharacterArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final CharChunk chunk = source.getChunk(context, okChunk).asCharChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getChar(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / CharacterArraySource.BLOCK_SIZE != (ranges.get(1) / CharacterArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final CharChunk chunk = source.getChunk(context, okChunk).asCharChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getChar(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / CharacterArraySource.BLOCK_SIZE != (ranges.get(1) / CharacterArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, char[] values, RowSet rowSet, CharacterArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final CharChunk chunk = source.getPrevChunk(context, okChunk).asCharChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevChar(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final CharChunk chunk = source.getPrevChunk(context, okChunk).asCharChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevChar(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -174,21 +170,22 @@ private void testGetChunkGenericLazy(char[] values, int chunkSize, RowSet rowSet oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final CharChunk chunk = source.getChunk(context, okChunk).asCharChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getChar(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final CharChunk chunk = source.getChunk(context, okChunk).asCharChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getChar(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -284,45 +281,47 @@ private void testFillChunkGeneric(char[] values, char[] newValues, int chunkSize } private void validateValuesWithFill(int chunkSize, char[] values, RowSet rowSet, CharacterArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getChar(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getChar(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, char[] values, RowSet rowSet, CharacterArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevChar(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevChar(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -386,23 +385,24 @@ private void testFillChunkLazyGeneric(char[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getChar(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableCharChunk chunk = WritableCharChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getChar(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -500,22 +500,19 @@ public void confirmAliasingForbidden() { // super hack final char[] peekedBlock = (char[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestDoubleArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestDoubleArraySource.java index 13b1f95893e..4117d435ab2 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestDoubleArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestDoubleArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestDoubleArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private DoubleArraySource forArray(double[] values) { final DoubleArraySource source = new DoubleArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(DoubleArraySource dest, double[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(double[] values, double[] newValues, int chunkSize, RowSet rowSet) { final DoubleArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(double[] values, double[] newValues, int chunkS } private void validateValues(int chunkSize, double[] values, RowSet rowSet, DoubleArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final DoubleChunk chunk = source.getChunk(context, okChunk).asDoubleChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getDouble(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / DoubleArraySource.BLOCK_SIZE != (ranges.get(1) / DoubleArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final DoubleChunk chunk = source.getChunk(context, okChunk).asDoubleChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getDouble(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / DoubleArraySource.BLOCK_SIZE != (ranges.get(1) / DoubleArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, double[] values, RowSet rowSet, DoubleArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final DoubleChunk chunk = source.getPrevChunk(context, okChunk).asDoubleChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevDouble(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final DoubleChunk chunk = source.getPrevChunk(context, okChunk).asDoubleChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevDouble(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(double[] values, int chunkSize, RowSet rowS oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final DoubleChunk chunk = source.getChunk(context, okChunk).asDoubleChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getDouble(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final DoubleChunk chunk = source.getChunk(context, okChunk).asDoubleChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getDouble(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(double[] values, double[] newValues, int chunk } private void validateValuesWithFill(int chunkSize, double[] values, RowSet rowSet, DoubleArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getDouble(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getDouble(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, double[] values, RowSet rowSet, DoubleArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevDouble(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevDouble(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(double[] values, int chunkSize, RowSet row oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getDouble(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableDoubleChunk chunk = WritableDoubleChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getDouble(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final double[] peekedBlock = (double[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestFloatArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestFloatArraySource.java index 6f3559ac5b4..3fa77255602 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestFloatArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestFloatArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestFloatArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private FloatArraySource forArray(float[] values) { final FloatArraySource source = new FloatArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(FloatArraySource dest, float[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(float[] values, float[] newValues, int chunkSize, RowSet rowSet) { final FloatArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(float[] values, float[] newValues, int chunkSiz } private void validateValues(int chunkSize, float[] values, RowSet rowSet, FloatArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final FloatChunk chunk = source.getChunk(context, okChunk).asFloatChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getFloat(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / FloatArraySource.BLOCK_SIZE != (ranges.get(1) / FloatArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final FloatChunk chunk = source.getChunk(context, okChunk).asFloatChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getFloat(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / FloatArraySource.BLOCK_SIZE != (ranges.get(1) / FloatArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, float[] values, RowSet rowSet, FloatArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final FloatChunk chunk = source.getPrevChunk(context, okChunk).asFloatChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevFloat(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final FloatChunk chunk = source.getPrevChunk(context, okChunk).asFloatChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevFloat(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(float[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final FloatChunk chunk = source.getChunk(context, okChunk).asFloatChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getFloat(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final FloatChunk chunk = source.getChunk(context, okChunk).asFloatChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getFloat(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(float[] values, float[] newValues, int chunkSi } private void validateValuesWithFill(int chunkSize, float[] values, RowSet rowSet, FloatArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getFloat(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getFloat(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, float[] values, RowSet rowSet, FloatArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevFloat(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevFloat(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(float[] values, int chunkSize, RowSet rowS oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getFloat(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableFloatChunk chunk = WritableFloatChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getFloat(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final float[] peekedBlock = (float[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestIntegerArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestIntegerArraySource.java index 870812e5047..4ccf8164f3d 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestIntegerArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestIntegerArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestIntegerArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private IntegerArraySource forArray(int[] values) { final IntegerArraySource source = new IntegerArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(IntegerArraySource dest, int[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(int[] values, int[] newValues, int chunkSize, RowSet rowSet) { final IntegerArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(int[] values, int[] newValues, int chunkSize, R } private void validateValues(int chunkSize, int[] values, RowSet rowSet, IntegerArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final IntChunk chunk = source.getChunk(context, okChunk).asIntChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getInt(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / IntegerArraySource.BLOCK_SIZE != (ranges.get(1) / IntegerArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final IntChunk chunk = source.getChunk(context, okChunk).asIntChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getInt(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / IntegerArraySource.BLOCK_SIZE != (ranges.get(1) / IntegerArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, int[] values, RowSet rowSet, IntegerArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final IntChunk chunk = source.getPrevChunk(context, okChunk).asIntChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevInt(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final IntChunk chunk = source.getPrevChunk(context, okChunk).asIntChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevInt(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(int[] values, int chunkSize, RowSet rowSet) oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final IntChunk chunk = source.getChunk(context, okChunk).asIntChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getInt(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final IntChunk chunk = source.getChunk(context, okChunk).asIntChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getInt(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(int[] values, int[] newValues, int chunkSize, } private void validateValuesWithFill(int chunkSize, int[] values, RowSet rowSet, IntegerArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getInt(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getInt(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, int[] values, RowSet rowSet, IntegerArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevInt(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevInt(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(int[] values, int chunkSize, RowSet rowSet oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getInt(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableIntChunk chunk = WritableIntChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getInt(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final int[] peekedBlock = (int[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestLongArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestLongArraySource.java index a8857dd74d1..15dcdbc7cbb 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestLongArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestLongArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestLongArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private LongArraySource forArray(long[] values) { final LongArraySource source = new LongArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(LongArraySource dest, long[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(long[] values, long[] newValues, int chunkSize, RowSet rowSet) { final LongArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(long[] values, long[] newValues, int chunkSize, } private void validateValues(int chunkSize, long[] values, RowSet rowSet, LongArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final LongChunk chunk = source.getChunk(context, okChunk).asLongChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getLong(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / LongArraySource.BLOCK_SIZE != (ranges.get(1) / LongArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final LongChunk chunk = source.getChunk(context, okChunk).asLongChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getLong(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / LongArraySource.BLOCK_SIZE != (ranges.get(1) / LongArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, long[] values, RowSet rowSet, LongArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final LongChunk chunk = source.getPrevChunk(context, okChunk).asLongChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevLong(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final LongChunk chunk = source.getPrevChunk(context, okChunk).asLongChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevLong(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(long[] values, int chunkSize, RowSet rowSet oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final LongChunk chunk = source.getChunk(context, okChunk).asLongChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getLong(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final LongChunk chunk = source.getChunk(context, okChunk).asLongChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getLong(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(long[] values, long[] newValues, int chunkSize } private void validateValuesWithFill(int chunkSize, long[] values, RowSet rowSet, LongArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getLong(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getLong(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, long[] values, RowSet rowSet, LongArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevLong(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevLong(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(long[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getLong(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableLongChunk chunk = WritableLongChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getLong(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final long[] peekedBlock = (long[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestObjectArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestObjectArraySource.java index 02443d88c79..6fc60dae0f1 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestObjectArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestObjectArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -36,6 +38,9 @@ import static junit.framework.TestCase.*; public class TestObjectArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private ObjectArraySource forArray(Object[] values) { final ObjectArraySource source = new ObjectArraySource<>(String.class); source.ensureCapacity(values.length); @@ -53,17 +58,6 @@ private void updateFromArray(ObjectArraySource dest, Object[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(Object[] values, Object[] newValues, int chunkSize, RowSet rowSet) { final ObjectArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -84,58 +78,60 @@ private void testGetChunkGeneric(Object[] values, Object[] newValues, int chunkS } private void validateValues(int chunkSize, Object[] values, RowSet rowSet, ObjectArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.get(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / ObjectArraySource.BLOCK_SIZE != (ranges.get(1) / ObjectArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.get(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / ObjectArraySource.BLOCK_SIZE != (ranges.get(1) / ObjectArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, Object[] values, RowSet rowSet, ObjectArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getPrevChunk(context, okChunk).asObjectChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrev(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getPrevChunk(context, okChunk).asObjectChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrev(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -178,21 +174,22 @@ private void testGetChunkGenericLazy(Object[] values, int chunkSize, RowSet rowS oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.get(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ObjectChunk chunk = source.getChunk(context, okChunk).asObjectChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.get(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -288,45 +285,47 @@ private void testFillChunkGeneric(Object[] values, Object[] newValues, int chunk } private void validateValuesWithFill(int chunkSize, Object[] values, RowSet rowSet, ObjectArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.get(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.get(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, Object[] values, RowSet rowSet, ObjectArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrev(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrev(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -390,23 +389,24 @@ private void testFillChunkLazyGeneric(Object[] values, int chunkSize, RowSet row oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.get(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableObjectChunk chunk = WritableObjectChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.get(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -504,22 +504,19 @@ public void confirmAliasingForbidden() { // super hack final Object[] peekedBlock = (Object[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestShortArraySource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestShortArraySource.java index c4abe293a82..10d9b4516bc 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestShortArraySource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/TestShortArraySource.java @@ -22,9 +22,11 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.testutil.Shuffle; import io.deephaven.engine.rowset.chunkattributes.RowKeys; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.util.HashMap; @@ -37,6 +39,9 @@ import static junit.framework.TestCase.*; public class TestShortArraySource { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private ShortArraySource forArray(short[] values) { final ShortArraySource source = new ShortArraySource(); source.ensureCapacity(values.length); @@ -54,17 +59,6 @@ private void updateFromArray(ShortArraySource dest, short[] values) { } } - @Before - public void setUp() throws Exception { - UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); - } - - @After - public void tearDown() throws Exception { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); - } - private void testGetChunkGeneric(short[] values, short[] newValues, int chunkSize, RowSet rowSet) { final ShortArraySource source; UpdateGraphProcessor.DEFAULT.startCycleForUnitTests(); @@ -85,58 +79,60 @@ private void testGetChunkGeneric(short[] values, short[] newValues, int chunkSiz } private void validateValues(int chunkSize, short[] values, RowSet rowSet, ShortArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ShortChunk chunk = source.getChunk(context, okChunk).asShortChunk(); - assertTrue(chunk.size() <= chunkSize); - if (rsIterator.hasMore()) { - assertEquals(chunkSize, chunk.size()); - } - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource("idx=" + idx + ", i=" + i, source.getShort(idx), chunk.get(i)); - checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); - pos++; - } - // region samecheck - final LongChunk ranges = okChunk.asRowKeyRangesChunk(); - if (ranges.size() > 2 || ranges.get(0) / ShortArraySource.BLOCK_SIZE != (ranges.get(1) / ShortArraySource.BLOCK_SIZE)) { - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ShortChunk chunk = source.getChunk(context, okChunk).asShortChunk(); + assertTrue(chunk.size() <= chunkSize); + if (rsIterator.hasMore()) { + assertEquals(chunkSize, chunk.size()); + } + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource("idx=" + idx + ", i=" + i, source.getShort(idx), chunk.get(i)); + checkFromValues("idx=" + idx + ", i=" + i, values[(int) idx], chunk.get(i)); + pos++; + } + // region samecheck + final LongChunk ranges = okChunk.asRowKeyRangesChunk(); + if (ranges.size() > 2 || ranges.get(0) / ShortArraySource.BLOCK_SIZE != (ranges.get(1) / ShortArraySource.BLOCK_SIZE)) { + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); - } else { - assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } else { + assertTrue(DefaultGetContext.isMyResettableChunk(context, chunk)); + } + // endregion samecheck } - // endregion samecheck + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValues(int chunkSize, short[] values, RowSet rowSet, ShortArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ShortChunk chunk = source.getPrevChunk(context, okChunk).asShortChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevShort(idx), chunk.get(i)); - checkFromValues(values[(int) idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ShortChunk chunk = source.getPrevChunk(context, okChunk).asShortChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevShort(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } + assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); } - assertTrue(DefaultGetContext.isMyWritableChunk(context, chunk)); + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -179,21 +175,22 @@ private void testGetChunkGenericLazy(short[] values, int chunkSize, RowSet rowSe oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ChunkSource.GetContext context = source.makeGetContext(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - final ShortChunk chunk = source.getChunk(context, okChunk).asShortChunk(); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - assertEquals(chunk.get(i), source.getShort(it.nextLong())); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ChunkSource.GetContext context = source.makeGetContext(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + final ShortChunk chunk = source.getChunk(context, okChunk).asShortChunk(); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + assertEquals(chunk.get(i), source.getShort(it.nextLong())); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazy @@ -289,45 +286,47 @@ private void testFillChunkGeneric(short[] values, short[] newValues, int chunkSi } private void validateValuesWithFill(int chunkSize, short[] values, RowSet rowSet, ShortArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getShort(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getShort(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } private void validatePrevValuesWithFill(int chunkSize, short[] values, RowSet rowSet, ShortArraySource source) { - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillPrevChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - checkFromSource(source.getPrevShort(idx), chunk.get(i)); - checkFromValues(values[(int)idx], chunk.get(i)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillPrevChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + checkFromSource(source.getPrevShort(idx), chunk.get(i)); + checkFromValues(values[(int) idx], chunk.get(i)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } @Test @@ -391,23 +390,24 @@ private void testFillChunkLazyGeneric(short[] values, int chunkSize, RowSet rowS oneAndOnly.put("origin", sourceOrigin); formulaColumn.initInputs(fullRange, oneAndOnly); final ColumnSource source = formulaColumn.getDataView(); - final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); - final RowSet.Iterator it = rowSet.iterator(); - final ColumnSource.FillContext context = source.makeFillContext(chunkSize); - final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize); - long pos = 0; - while (it.hasNext()) { - assertTrue(rsIterator.hasMore()); - final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); - source.fillChunk(context, chunk, okChunk); - for (int i = 0; i < chunk.size(); i++) { - assertTrue(it.hasNext()); - final long idx = it.nextLong(); - assertEquals(chunk.get(i), source.getShort(idx)); - pos++; + try (final RowSequence.Iterator rsIterator = rowSet.getRowSequenceIterator(); + final RowSet.Iterator it = rowSet.iterator(); + final ColumnSource.FillContext context = source.makeFillContext(chunkSize); + final WritableShortChunk chunk = WritableShortChunk.makeWritableChunk(chunkSize)) { + long pos = 0; + while (it.hasNext()) { + assertTrue(rsIterator.hasMore()); + final RowSequence okChunk = rsIterator.getNextRowSequenceWithLength(chunkSize); + source.fillChunk(context, chunk, okChunk); + for (int i = 0; i < chunk.size(); i++) { + assertTrue(it.hasNext()); + final long idx = it.nextLong(); + assertEquals(chunk.get(i), source.getShort(idx)); + pos++; + } } + assertEquals(pos, rowSet.size()); } - assertEquals(pos, rowSet.size()); } // endregion lazygeneric @@ -505,22 +505,19 @@ public void confirmAliasingForbidden() { // super hack final short[] peekedBlock = (short[])source.getBlock(0); - try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd)) { - try (RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1)) { - try (ChunkSource.GetContext srcContext = source.makeGetContext(arraySize)) { - try (ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { - Chunk chunk = source.getChunk(srcContext, srcKeys); - if (chunk.isAlias(peekedBlock)) { - // If the ArraySource gives out aliases of its blocks, then it should throw when we try to - // fill from that aliased chunk - try { - source.fillFromChunk(destContext, chunk, destKeys); - TestCase.fail(); - } catch (UnsupportedOperationException uoe) { - // Expected - } - } - } + try (RowSet srcKeys = RowSetFactory.fromRange(rangeStart, rangeEnd); + RowSet destKeys = RowSetFactory.fromRange(rangeStart + 1, rangeEnd + 1); + ChunkSource.GetContext srcContext = source.makeGetContext(arraySize); + ChunkSink.FillFromContext destContext = source.makeFillFromContext(arraySize)) { + Chunk chunk = source.getChunk(srcContext, srcKeys); + if (chunk.isAlias(peekedBlock)) { + // If the ArraySource gives out aliases of its blocks, then it should throw when we try to + // fill from that aliased chunk + try { + source.fillFromChunk(destContext, chunk, destKeys); + TestCase.fail(); + } catch (UnsupportedOperationException uoe) { + // Expected } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestChunkedRegionedOperations.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestChunkedRegionedOperations.java index 6810e045521..d5a5c027e78 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestChunkedRegionedOperations.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestChunkedRegionedOperations.java @@ -5,11 +5,12 @@ import io.deephaven.base.FileUtils; import io.deephaven.datastructures.util.CollectionUtil; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.*; import io.deephaven.stringset.ArrayStringSet; -import io.deephaven.engine.table.lang.QueryLibrary; import io.deephaven.stringset.StringSet; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; +import io.deephaven.test.junit4.EngineCleanup; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.parquet.table.ParquetTools; @@ -31,6 +32,7 @@ import org.jetbrains.annotations.NotNull; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.io.*; @@ -55,10 +57,12 @@ @Category(OutOfBandTest.class) public class TestChunkedRegionedOperations { + @Rule + public final EngineCleanup framework = new EngineCleanup(); + private static final long TABLE_SIZE = 100_000; private static final long STRIPE_SIZE = TABLE_SIZE / 10; - private QueryScope originalScope; private File dataDirectory; private Table expected; @@ -127,24 +131,19 @@ public void readExternal(@NotNull final ObjectInput in) throws IOException { @Before public void setUp() throws Exception { - originalScope = QueryScope.getScope(); - final QueryScope queryScope = new QueryScope.StandaloneImpl(); - Arrays.stream(originalScope.getParams(originalScope.getParamNames())) - .forEach(p -> queryScope.putParam(p.getName(), p.getValue())); + final QueryScope queryScope = ExecutionContext.getContext().getQueryScope(); queryScope.putParam("nowNanos", DateTimeUtils.currentTime().getNanos()); queryScope.putParam("letters", IntStream.range('A', 'A' + 64).mapToObj(c -> new String(new char[] {(char) c})).toArray(String[]::new)); queryScope.putParam("emptySymbolSet", new ArrayStringSet()); queryScope.putParam("stripeSize", STRIPE_SIZE); - QueryScope.setScope(queryScope); - QueryLibrary.resetLibrary(); - QueryLibrary.importClass(BigInteger.class); - QueryLibrary.importClass(StringSet.class); - QueryLibrary.importClass(ArrayStringSet.class); - QueryLibrary.importClass(SimpleSerializable.class); - QueryLibrary.importClass(SimpleExternalizable.class); - QueryLibrary.importStatic(BooleanUtils.class); + ExecutionContext.getContext().getQueryLibrary().importClass(BigInteger.class); + ExecutionContext.getContext().getQueryLibrary().importClass(StringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(ArrayStringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SimpleSerializable.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SimpleExternalizable.class); + ExecutionContext.getContext().getQueryLibrary().importStatic(BooleanUtils.class); final TableDefinition definition = TableDefinition.of( ColumnDefinition.ofLong("II"), @@ -284,9 +283,6 @@ public void tearDown() throws Exception { actual.releaseCachedResources(); } - QueryScope.setScope(originalScope); - QueryLibrary.resetLibrary(); - if (dataDirectory.exists()) { TrackedFileHandleFactory.getInstance().closeAll(); int tries = 0; @@ -322,10 +318,10 @@ private static void assertChunkWiseEquals(@NotNull final Table expected, @NotNul // noinspection unchecked final WritableChunk[] expectedChunks = Arrays.stream(chunkTypes) - .map(ct -> ct.makeWritableChunk(chunkCapacity)).toArray(WritableChunk[]::new); + .map(ct -> closeables.add(ct.makeWritableChunk(chunkCapacity))).toArray(WritableChunk[]::new); // noinspection unchecked final WritableChunk[] actualChunks = Arrays.stream(chunkTypes) - .map(ct -> ct.makeWritableChunk(chunkCapacity)).toArray(WritableChunk[]::new); + .map(ct -> closeables.add(ct.makeWritableChunk(chunkCapacity))).toArray(WritableChunk[]::new); final ColumnSource[] expectedSources = expected.getColumnSources().toArray(ColumnSource.ZERO_LENGTH_COLUMN_SOURCE_ARRAY); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestObjectVectorUngroup.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestObjectVectorUngroup.java index 35b0f27246c..6f02c36c37f 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestObjectVectorUngroup.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/sources/regioned/TestObjectVectorUngroup.java @@ -5,11 +5,13 @@ import io.deephaven.base.FileUtils; import io.deephaven.engine.table.Table; +import io.deephaven.test.junit4.EngineCleanup; import io.deephaven.vector.ObjectVector; import io.deephaven.parquet.table.ParquetTools; import io.deephaven.engine.util.TableTools; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.io.File; @@ -21,6 +23,9 @@ public class TestObjectVectorUngroup { + @Rule + public final EngineCleanup base = new EngineCleanup(); + private static File dataDirectory; @Before diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java index 9fa7acfed28..ff9f819122b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumProd.java @@ -50,12 +50,12 @@ public void testStaticZeroKey() { @Test public void testNullOnBucketChange() throws IOException { - final TableWithDefaults t = testTable(stringCol("Sym", "A", "A", "B", "B"), + final TableDefaults t = testTable(stringCol("Sym", "A", "A", "B", "B"), byteCol("ByteVal", (byte) 1, (byte) 2, NULL_BYTE, (byte) 3), shortCol("ShortVal", (short) 1, (short) 2, NULL_SHORT, (short) 3), intCol("IntVal", 1, 2, NULL_INT, 3)); - final TableWithDefaults expected = testTable(stringCol("Sym", "A", "A", "B", "B"), + final TableDefaults expected = testTable(stringCol("Sym", "A", "A", "B", "B"), byteCol("ByteVal", (byte) 1, (byte) 2, NULL_BYTE, (byte) 3), shortCol("ShortVal", (short) 1, (short) 2, NULL_SHORT, (short) 3), intCol("IntVal", 1, 2, NULL_INT, 3), diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java index 4f980c6a918..94c668821e3 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestCumSum.java @@ -50,12 +50,12 @@ public void testStaticZeroKey() { @Test public void testNullOnBucketChange() throws IOException { - final TableWithDefaults t = testTable(stringCol("Sym", "A", "A", "B", "B"), + final TableDefaults t = testTable(stringCol("Sym", "A", "A", "B", "B"), byteCol("ByteVal", (byte) 1, (byte) 2, NULL_BYTE, (byte) 3), shortCol("ShortVal", (short) 1, (short) 2, NULL_SHORT, (short) 3), intCol("IntVal", 1, 2, NULL_INT, 3)); - final TableWithDefaults expected = testTable(stringCol("Sym", "A", "A", "B", "B"), + final TableDefaults expected = testTable(stringCol("Sym", "A", "A", "B", "B"), byteCol("ByteVal", (byte) 1, (byte) 2, NULL_BYTE, (byte) 3), shortCol("ShortVal", (short) 1, (short) 2, NULL_SHORT, (short) 3), intCol("IntVal", 1, 2, NULL_INT, 3), diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java index 47b67ca78db..cbe223ec305 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestEma.java @@ -7,11 +7,11 @@ import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.EvalNugget; import io.deephaven.engine.table.impl.QueryTable; -import io.deephaven.engine.table.impl.TableWithDefaults; +import io.deephaven.engine.table.impl.TableDefaults; import io.deephaven.engine.table.impl.TstUtils; import io.deephaven.engine.table.impl.locations.TableDataException; import io.deephaven.engine.table.impl.util.ColumnHolder; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.TableDiff; import io.deephaven.engine.util.string.StringUtils; @@ -55,8 +55,8 @@ public void testStaticZeroKey() { .onNullValue(BadDataBehavior.RESET) .onNanValue(BadDataBehavior.RESET).build(); - computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, skipControl); - computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, resetControl); + computeEma((TableDefaults) t.dropColumns("ts"), null, 100, skipControl); + computeEma((TableDefaults) t.dropColumns("ts"), null, 100, resetControl); computeEma(t, "ts", 10 * MINUTE, skipControl); computeEma(t, "ts", 10 * MINUTE, resetControl); @@ -76,7 +76,7 @@ public void testStaticGroupedBucketed() { } private void doTestStaticBucketed(boolean grouped) { - final TableWithDefaults t = createTestTable(100000, true, grouped, false, 0x31313131, + final TableDefaults t = createTestTable(100000, true, grouped, false, 0x31313131, new String[] {"ts"}, new TstUtils.Generator[] {new TstUtils.SortedDateTimeGenerator( convertDateTime("2022-03-09T09:00:00.000 NY"), convertDateTime("2022-03-09T16:30:00.000 NY"))}).t; @@ -88,8 +88,8 @@ private void doTestStaticBucketed(boolean grouped) { final OperationControl resetControl = OperationControl.builder() .onNullValue(BadDataBehavior.RESET) .onNanValue(BadDataBehavior.RESET).build(); - computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, skipControl, "Sym"); - computeEma((TableWithDefaults) t.dropColumns("ts"), null, 100, resetControl, "Sym"); + computeEma((TableDefaults) t.dropColumns("ts"), null, 100, skipControl, "Sym"); + computeEma((TableDefaults) t.dropColumns("ts"), null, 100, resetControl, "Sym"); computeEma(t, "ts", 10 * MINUTE, skipControl, "Sym"); computeEma(t, "ts", 10 * MINUTE, resetControl, "Sym"); @@ -100,7 +100,7 @@ public void testThrowBehaviors() { final OperationControl throwControl = OperationControl.builder() .onNullValue(BadDataBehavior.THROW).build(); - final TableWithDefaults bytes = testTable(RowSetFactory.flat(4).toTracking(), + final TableDefaults bytes = testTable(RowSetFactory.flat(4).toTracking(), byteCol("col", (byte) 0, (byte) 1, NULL_BYTE, (byte) 3)); assertThrows(TableDataException.class, @@ -110,25 +110,25 @@ public void testThrowBehaviors() { assertThrows(TableDataException.class, () -> bytes.updateBy(UpdateByOperation.Ema(throwControl, 10))); - TableWithDefaults shorts = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults shorts = testTable(RowSetFactory.flat(4).toTracking(), shortCol("col", (short) 0, (short) 1, NULL_SHORT, (short) 3)); assertThrows(TableDataException.class, () -> shorts.updateBy(UpdateByOperation.Ema(throwControl, 10))); - TableWithDefaults ints = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults ints = testTable(RowSetFactory.flat(4).toTracking(), intCol("col", 0, 1, NULL_INT, 3)); assertThrows(TableDataException.class, () -> ints.updateBy(UpdateByOperation.Ema(throwControl, 10))); - TableWithDefaults longs = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults longs = testTable(RowSetFactory.flat(4).toTracking(), longCol("col", 0, 1, NULL_LONG, 3)); assertThrows(TableDataException.class, () -> longs.updateBy(UpdateByOperation.Ema(throwControl, 10))); - TableWithDefaults floats = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults floats = testTable(RowSetFactory.flat(4).toTracking(), floatCol("col", 0, 1, NULL_FLOAT, Float.NaN)); assertThrows(TableDataException.class, @@ -143,7 +143,7 @@ public void testThrowBehaviors() { 10)), "Encountered NaN value during EMA processing"); - TableWithDefaults doubles = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults doubles = testTable(RowSetFactory.flat(4).toTracking(), doubleCol("col", 0, 1, NULL_DOUBLE, Double.NaN)); assertThrows(TableDataException.class, @@ -159,13 +159,13 @@ public void testThrowBehaviors() { "Encountered NaN value during EMA processing"); - TableWithDefaults bi = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults bi = testTable(RowSetFactory.flat(4).toTracking(), col("col", BigInteger.valueOf(0), BigInteger.valueOf(1), null, BigInteger.valueOf(3))); assertThrows(TableDataException.class, () -> bi.updateBy(UpdateByOperation.Ema(throwControl, 10))); - TableWithDefaults bd = testTable(RowSetFactory.flat(4).toTracking(), + TableDefaults bd = testTable(RowSetFactory.flat(4).toTracking(), col("col", BigDecimal.valueOf(0), BigDecimal.valueOf(1), null, BigDecimal.valueOf(3))); assertThrows(TableDataException.class, @@ -222,7 +222,7 @@ public void testTimeThrowBehaviors() { BigDecimal.valueOf(4)))); } - private void testThrowsInternal(TableWithDefaults table) { + private void testThrowsInternal(TableDefaults table) { assertThrows(TableDataException.class, () -> table.updateBy(UpdateByOperation.Ema( OperationControl.builder().build(), "ts", 100)), @@ -290,7 +290,7 @@ public void testResetBehavior() { .onNanValue(BadDataBehavior.RESET) .build(); - TableWithDefaults input = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, Double.NaN, 1)); + TableDefaults input = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, Double.NaN, 1)); Table result = input.updateBy(UpdateByOperation.Ema(resetControl, 100)); expected = testTable(RowSetFactory.flat(3).toTracking(), doubleCol("col", 0, NULL_DOUBLE, 1)); assertTableEquals(expected, result); @@ -307,7 +307,7 @@ private void testResetBehaviorInternal(Table expected, final ColumnHolder ts, fi .onZeroDeltaTime(BadDataBehavior.RESET) .build(); - TableWithDefaults input = testTable(RowSetFactory.flat(6).toTracking(), ts, col); + TableDefaults input = testTable(RowSetFactory.flat(6).toTracking(), ts, col); final Table result = input.updateBy(UpdateByOperation.Ema(resetControl, "ts", 1_000_000_000)); assertTableEquals(expected, result); } @@ -322,7 +322,7 @@ public void testPoison() { Table expected = testTable(RowSetFactory.flat(5).toTracking(), doubleCol("col", 0, Double.NaN, NULL_DOUBLE, Double.NaN, Double.NaN)); - TableWithDefaults input = testTable(RowSetFactory.flat(5).toTracking(), + TableDefaults input = testTable(RowSetFactory.flat(5).toTracking(), doubleCol("col", 0, Double.NaN, NULL_DOUBLE, Double.NaN, 4)); assertTableEquals(expected, input.updateBy(UpdateByOperation.Ema(nanCtl, 10))); input = testTable(RowSetFactory.flat(5).toTracking(), floatCol("col", 0, Float.NaN, NULL_FLOAT, Float.NaN, 4)); @@ -415,9 +415,9 @@ protected Table e() { new EvalNugget() { @Override protected Table e() { - TableWithDefaults base = timeResult.t; + TableDefaults base = timeResult.t; if (!appendOnly) { - base = (TableWithDefaults) base.sort("ts"); + base = (TableDefaults) base.sort("ts"); } return bucketed ? base.updateBy(UpdateByOperation.Ema(skipControl, "ts", 10 * MINUTE), "Sym") @@ -427,9 +427,9 @@ protected Table e() { new EvalNugget() { @Override protected Table e() { - TableWithDefaults base = timeResult.t; + TableDefaults base = timeResult.t; if (!appendOnly) { - base = (TableWithDefaults) base.sort("ts"); + base = (TableDefaults) base.sort("ts"); } return bucketed ? base.updateBy(UpdateByOperation.Ema(resetControl, "ts", 10 * MINUTE), "Sym") @@ -461,7 +461,7 @@ protected Table e() { // endregion - private void computeEma(TableWithDefaults source, + private void computeEma(TableDefaults source, final String tsCol, long scale, OperationControl control, diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java index 6b7cb692f80..6389929ae8f 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestForwardFill.java @@ -264,7 +264,7 @@ public Table e() { }, new EvalNugget() { public Table e() { - return ((TableWithDefaults) queryTable.sort("intCol")).updateBy(UpdateByOperation.Fill()); + return ((TableDefaults) queryTable.sort("intCol")).updateBy(UpdateByOperation.Fill()); } }, }; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java index 061571aea23..c573aea9788 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/updateby/TestUpdateByGeneral.java @@ -1,13 +1,12 @@ package io.deephaven.engine.table.impl.updateby; import io.deephaven.api.ColumnName; -import io.deephaven.api.Selectable; import io.deephaven.api.updateby.BadDataBehavior; import io.deephaven.api.updateby.OperationControl; import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.EvalNugget; -import io.deephaven.engine.table.impl.TableWithDefaults; +import io.deephaven.engine.table.impl.TableDefaults; import io.deephaven.engine.table.impl.TstUtils; import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.updategraph.UpdateGraphProcessor; @@ -83,9 +82,9 @@ private void doTestTicking(boolean redirected, boolean bucketed, boolean appendO @Override protected Table e() { - TableWithDefaults base = result.t; + TableDefaults base = result.t; if (!appendOnly) { - base = (TableWithDefaults) base.sort("ts"); + base = (TableDefaults) base.sort("ts"); } final String[] columnNamesArray = base.getDefinition().getColumnNamesArray(); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/CumulativeUtilTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/CumulativeUtilTest.java index 802695c8398..ad11913253f 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/CumulativeUtilTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/CumulativeUtilTest.java @@ -5,10 +5,25 @@ import io.deephaven.base.testing.BaseArrayTestCase; import io.deephaven.engine.table.Table; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.util.QueryConstants; import io.deephaven.engine.util.TableTools; +import io.deephaven.util.SafeCloseable; public class CumulativeUtilTest extends BaseArrayTestCase { + private SafeCloseable executionContext; + + @Override + protected void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } public void testCumSum() { final Table t = TableTools.emptyTable(10).updateView("Row = i"); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestColumnsToRowsTransform.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestColumnsToRowsTransform.java index 524e65edcec..2b1f7e18072 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestColumnsToRowsTransform.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestColumnsToRowsTransform.java @@ -8,7 +8,7 @@ import io.deephaven.engine.table.SharedContext; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.*; import io.deephaven.engine.table.iterators.IntegerColumnIterator; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestFreezeBy.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestFreezeBy.java index 9c63ce663a5..63912b0e60d 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestFreezeBy.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestFreezeBy.java @@ -7,7 +7,7 @@ import io.deephaven.engine.table.Table; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.time.DateTime; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.*; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestRedirectedColumnSource.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestRedirectedColumnSource.java index c3a618b3b67..da63e0809bb 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestRedirectedColumnSource.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/TestRedirectedColumnSource.java @@ -7,7 +7,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.sources.RedirectedColumnSource; import io.deephaven.util.BooleanUtils; diff --git a/engine/table/src/test/java/io/deephaven/engine/util/TestCalendarMethodsFromTable.java b/engine/table/src/test/java/io/deephaven/engine/util/TestCalendarMethodsFromTable.java index 2a0f8ce0825..d934c1d700e 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/TestCalendarMethodsFromTable.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/TestCalendarMethodsFromTable.java @@ -4,9 +4,9 @@ package io.deephaven.engine.util; import io.deephaven.base.testing.BaseArrayTestCase; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibrary; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; import io.deephaven.time.calendar.BusinessCalendar; @@ -49,8 +49,8 @@ protected void tearDown() throws Exception { // test to make sure these methods work inside the query strings // previous clash with DateTimeUtils public void testCalendarMethodsTable() { - if (!QueryLibrary.getStaticImports().contains(StaticCalendarMethods.class)) { - QueryLibrary.importStatic(StaticCalendarMethods.class); + if (!ExecutionContext.getContext().getQueryLibrary().getStaticImports().contains(StaticCalendarMethods.class)) { + ExecutionContext.getContext().getQueryLibrary().importStatic(StaticCalendarMethods.class); } QueryScope.addParam("time1", time1); QueryScope.addParam("time2", time2); @@ -120,8 +120,8 @@ public void testCalendarMethodsTable() { public void testBusinessCalendarMethodsTable() { - if (!QueryLibrary.getStaticImports().contains(StaticCalendarMethods.class)) { - QueryLibrary.importStatic(StaticCalendarMethods.class); + if (!ExecutionContext.getContext().getQueryLibrary().getStaticImports().contains(StaticCalendarMethods.class)) { + ExecutionContext.getContext().getQueryLibrary().importStatic(StaticCalendarMethods.class); } final LocalDate localDate = LocalDate.now(); QueryScope.addParam("localDate", localDate); diff --git a/engine/table/src/test/java/io/deephaven/engine/util/TestColorUtil.java b/engine/table/src/test/java/io/deephaven/engine/util/TestColorUtil.java index f4af99b1234..9286961023b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/TestColorUtil.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/TestColorUtil.java @@ -4,16 +4,32 @@ package io.deephaven.engine.util; import io.deephaven.base.testing.BaseArrayTestCase; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.gui.color.Color; import io.deephaven.engine.table.Table; import io.deephaven.util.QueryConstants; +import io.deephaven.util.SafeCloseable; import static io.deephaven.gui.color.Color.*; public class TestColorUtil extends BaseArrayTestCase { private final int size = 10; - private final Table t1 = TableTools.emptyTable(size).updateView("X = i", "Y = 2*i"); + private SafeCloseable executionContext; + private Table t1; + + @Override + protected void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + t1 = TableTools.emptyTable(size).updateView("X = i", "Y = 2*i"); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } public void testRowFormatWhereNew() { testRowFormatWhere(t1.formatRowWhere("X > 5", "ALICEBLUE"), ALICEBLUE); diff --git a/engine/table/src/test/java/io/deephaven/engine/util/TestCompileSimpleFunction.java b/engine/table/src/test/java/io/deephaven/engine/util/TestCompileSimpleFunction.java index 3799df04d94..dbdd6928fda 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/TestCompileSimpleFunction.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/TestCompileSimpleFunction.java @@ -3,12 +3,28 @@ */ package io.deephaven.engine.util; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.time.DateTimeUtils; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import java.util.Collections; public class TestCompileSimpleFunction extends TestCase { + private SafeCloseable executionContext; + + @Override + protected void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } + public void testString() { String res = DynamicCompileUtils.compileSimpleFunction(String.class, "return \"Hello, world\"").get(); TestCase.assertEquals("Hello, world", res); diff --git a/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java b/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java index 3d1faa4f2fa..67eff6709c8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java @@ -5,8 +5,9 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.configuration.Configuration; -import io.deephaven.compilertools.CompilerTools; +import io.deephaven.engine.context.CompilerTools; import io.deephaven.datastructures.util.CollectionUtil; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.rowset.RowSetShiftData; @@ -26,6 +27,7 @@ import io.deephaven.test.types.OutOfBandTest; import io.deephaven.util.ExceptionDetails; import io.deephaven.util.QueryConstants; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import org.junit.*; @@ -55,6 +57,7 @@ public class TestTableTools extends TestCase implements UpdateErrorReporter { private boolean oldLogEnabled; private LivenessScope scope; + private SafeCloseable executionContext; private Table table1; private Table table2; @@ -71,6 +74,7 @@ public void setUp() throws Exception { UpdatePerformanceTracker.getInstance().enableUnitTestMode(); scope = new LivenessScope(); + executionContext = ExecutionContext.createForUnitTests().open(); LivenessScopeStack.push(scope); oldReporter = AsyncClientErrorNotifier.setReporter(this); @@ -92,6 +96,7 @@ public void tearDown() throws Exception { LivenessScopeStack.pop(scope); scope.release(); + executionContext.close(); CompilerTools.setLogEnabled(oldLogEnabled); UpdateGraphProcessor.DEFAULT.setCheckTableOperations(oldCheckUgp); AsyncClientErrorNotifier.setReporter(oldReporter); diff --git a/engine/table/src/test/java/io/deephaven/engine/util/scripts/TestGroovyDeephavenSession.java b/engine/table/src/test/java/io/deephaven/engine/util/scripts/TestGroovyDeephavenSession.java index 01fe5b259b8..b5dfd803acd 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/scripts/TestGroovyDeephavenSession.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/scripts/TestGroovyDeephavenSession.java @@ -27,7 +27,7 @@ public class TestGroovyDeephavenSession { public void setup() throws IOException { livenessScope = new LivenessScope(); LivenessScopeStack.push(livenessScope); - session = new GroovyDeephavenSession(NoOp.INSTANCE, null, GroovyDeephavenSession.RunScripts.none(), false); + session = new GroovyDeephavenSession(NoOp.INSTANCE, null, GroovyDeephavenSession.RunScripts.none()); } @After diff --git a/engine/table/src/test/java/io/deephaven/test/junit4/EngineCleanup.java b/engine/table/src/test/java/io/deephaven/test/junit4/EngineCleanup.java index cdf9fc51f31..ee31b161af4 100644 --- a/engine/table/src/test/java/io/deephaven/test/junit4/EngineCleanup.java +++ b/engine/table/src/test/java/io/deephaven/test/junit4/EngineCleanup.java @@ -3,8 +3,10 @@ */ package io.deephaven.test.junit4; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.impl.QueryTableTestBase; import io.deephaven.engine.table.impl.RefreshingTableTestCase; +import io.deephaven.util.SafeCloseable; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; @@ -15,14 +17,18 @@ * instead create a {@code @Rule public final EngineCleanup field = new EngineCleanup();}. */ public class EngineCleanup extends QueryTableTestBase implements TestRule { + private SafeCloseable executionContext; + @Override public void setUp() throws Exception { super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); } @Override public void tearDown() throws Exception { super.tearDown(); + executionContext.close(); } // We use this class as a field in JUnit 4 tests which should not extend TestCase. This method is a no-op test diff --git a/engine/updategraph/build.gradle b/engine/updategraph/build.gradle index 820d483337f..752c7361c7e 100644 --- a/engine/updategraph/build.gradle +++ b/engine/updategraph/build.gradle @@ -9,6 +9,7 @@ dependencies { api project(':qst') implementation project(':engine-chunk') + implementation project(':engine-context') implementation project(':hotspot') implementation project(':log-factory') implementation project(':Configuration') diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyErrorNotification.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyErrorNotification.java index 85f1450fff9..88d414e6b02 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyErrorNotification.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyErrorNotification.java @@ -3,8 +3,6 @@ */ package io.deephaven.engine.updategraph; -import io.deephaven.base.log.LogOutput; - /** * A {@link NotificationQueue.ErrorNotification} that does not actually notify anything. */ diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyNotification.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyNotification.java index bc1c87aeb63..1afa6c95ec3 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyNotification.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/EmptyNotification.java @@ -4,6 +4,7 @@ package io.deephaven.engine.updategraph; import io.deephaven.base.log.LogOutput; +import io.deephaven.engine.context.ExecutionContext; /** * A {@link NotificationQueue.Notification} that does not actually notify anything. @@ -32,4 +33,9 @@ public LogOutput append(LogOutput logOutput) { @Override public final void run() {} + + @Override + public ExecutionContext getExecutionContext() { + return null; + } } diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationAdapter.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationAdapter.java index 5175c7579fb..8030984956a 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationAdapter.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationAdapter.java @@ -4,6 +4,7 @@ package io.deephaven.engine.updategraph; import io.deephaven.base.log.LogOutput; +import io.deephaven.engine.context.ExecutionContext; import org.jetbrains.annotations.NotNull; /** @@ -33,4 +34,9 @@ public boolean canExecute(final long step) { public void run() { wrapped.run(); } + + @Override + public ExecutionContext getExecutionContext() { + return wrapped.getExecutionContext(); + } } diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationQueue.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationQueue.java index 91528aa709b..36236c84838 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationQueue.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/NotificationQueue.java @@ -4,6 +4,7 @@ package io.deephaven.engine.updategraph; import io.deephaven.base.log.LogOutputAppendable; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.util.datastructures.linked.IntrusiveDoublyLinkedNode; import org.jetbrains.annotations.NotNull; @@ -20,7 +21,7 @@ interface Notification extends Runnable, LogOutputAppendable, IntrusiveDoublyLin * Terminal notifications guarantee that they will not queue additional notifications or mutate data structures * that should result in additional notifications. They are in turn guaranteed to be called after all * non-terminal notifications for a given cycle through the notification queue. - * + * * @return True iff this notification is terminal. */ boolean isTerminal(); @@ -42,6 +43,23 @@ interface Notification extends Runnable, LogOutputAppendable, IntrusiveDoublyLin * @return true if this notification can be executed, false if it has unmet dependencies */ boolean canExecute(long step); + + /** + * @return the execution context this notification should be run under + */ + ExecutionContext getExecutionContext(); + + /** + * Run under the execution context. + */ + default void runInContext() { + ExecutionContext executionContext = getExecutionContext(); + if (executionContext != null) { + executionContext.apply(this); + } else { + this.run(); + } + } } /** diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/TerminalNotification.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/TerminalNotification.java index 7a8bdfdddda..fbd483654c9 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/TerminalNotification.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/TerminalNotification.java @@ -3,6 +3,8 @@ */ package io.deephaven.engine.updategraph; +import io.deephaven.engine.context.ExecutionContext; + public abstract class TerminalNotification extends AbstractNotification { protected TerminalNotification() { @@ -13,4 +15,9 @@ protected TerminalNotification() { public boolean canExecute(final long step) { throw new UnsupportedOperationException("Terminal notifications do not have dependency information."); } + + @Override + public ExecutionContext getExecutionContext() { + return null; + } } diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/UpdateGraphProcessor.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/UpdateGraphProcessor.java index bf0c4e83735..6ab155cb2bc 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/UpdateGraphProcessor.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/UpdateGraphProcessor.java @@ -11,6 +11,7 @@ import io.deephaven.base.verify.Require; import io.deephaven.configuration.Configuration; import io.deephaven.chunk.util.pools.MultiChunkPool; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessManager; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.liveness.LivenessScopeStack; @@ -496,7 +497,7 @@ public void doUnchecked(Runnable runnable) { /** * Should this thread check table operations for safety with respect to the update lock? - * + * * @return if we should check table operations. */ public boolean getCheckTableOperations() { @@ -1288,7 +1289,7 @@ private void runNotification(@NotNull final Notification notification) { } try (final SafeCloseable ignored = scope == null ? null : LivenessScopeStack.open(scope, releaseScopeOnClose)) { - notification.run(); + notification.runInContext(); logDependencies().append(Thread.currentThread().getName()).append(": Completed ").append(notification) .endl(); } catch (final Exception e) { @@ -1742,6 +1743,8 @@ private static final class UpdateSourceRefreshNotification extends AbstractNotif private final WeakReference updateSourceRef; + private final ExecutionContext executionContext = ExecutionContext.getContextToRecord(); + private UpdateSourceRefreshNotification(@NotNull final Runnable updateSource) { super(false); updateSourceRef = new WeakReference<>(updateSource); @@ -1777,6 +1780,11 @@ public Runnable get() { public void clear() { updateSourceRef.clear(); } + + @Override + public ExecutionContext getExecutionContext() { + return executionContext; + } } public LogEntry logDependencies() { diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/WaitNotification.java b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/WaitNotification.java index ea9dcf86568..fe11e956213 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/WaitNotification.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/WaitNotification.java @@ -5,6 +5,7 @@ import io.deephaven.UncheckedDeephavenException; import io.deephaven.base.log.LogOutput; +import io.deephaven.engine.context.ExecutionContext; import org.jetbrains.annotations.NotNull; import java.util.Arrays; @@ -44,6 +45,11 @@ public LogOutput append(LogOutput logOutput) { .append(LogOutput.APPENDABLE_COLLECTION_FORMATTER, Arrays.asList(dependencies)); } + @Override + public ExecutionContext getExecutionContext() { + return null; + } + @Override public void run() { fired = true; diff --git a/extensions/classgraph/src/main/java/io/deephaven/extensions/ClassGraphExtension.java b/extensions/classgraph/src/main/java/io/deephaven/extensions/ClassGraphExtension.java index f1d27f6e17c..9e345ff7145 100644 --- a/extensions/classgraph/src/main/java/io/deephaven/extensions/ClassGraphExtension.java +++ b/extensions/classgraph/src/main/java/io/deephaven/extensions/ClassGraphExtension.java @@ -5,7 +5,7 @@ import com.google.auto.service.AutoService; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryLibraryImports; +import io.deephaven.engine.context.QueryLibraryImports; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.util.GroovyDeephavenSession.InitScript; import io.deephaven.util.QueryConstants; diff --git a/extensions/parquet/table/src/brotliTest/java/io/deephaven/parquet/table/BrotliParquetTableReadWriteTest.java b/extensions/parquet/table/src/brotliTest/java/io/deephaven/parquet/table/BrotliParquetTableReadWriteTest.java index bce5f32026a..74120c980c6 100644 --- a/extensions/parquet/table/src/brotliTest/java/io/deephaven/parquet/table/BrotliParquetTableReadWriteTest.java +++ b/extensions/parquet/table/src/brotliTest/java/io/deephaven/parquet/table/BrotliParquetTableReadWriteTest.java @@ -5,12 +5,14 @@ import io.deephaven.api.Selectable; import io.deephaven.base.FileUtils; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.TstUtils; -import io.deephaven.engine.table.lang.QueryLibrary; import io.deephaven.engine.util.TableTools; +import io.deephaven.test.junit4.EngineCleanup; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import java.io.File; @@ -26,6 +28,9 @@ public class BrotliParquetTableReadWriteTest { private static File rootFile; + @Rule + public final EngineCleanup framework = new EngineCleanup(); + @Before public void setUp() { rootFile = new File(ROOT_FILENAME); @@ -42,7 +47,7 @@ public void tearDown() { } private static Table getTableFlat(int size, boolean includeSerializable) { - QueryLibrary.importClass(SomeSillyTest.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SomeSillyTest.class); ArrayList columns = new ArrayList<>(Arrays.asList("someStringColumn = i % 10 == 0?null:(`` + (i % 101))", "nonNullString = `` + (i % 60)", diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java index 3673c54a262..15a27e90dae 100644 --- a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/ParquetTableReadWriteTest.java @@ -5,20 +5,22 @@ import io.deephaven.api.Selectable; import io.deephaven.base.FileUtils; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.stringset.ArrayStringSet; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryLibrary; import io.deephaven.stringset.StringSet; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.TstUtils; +import io.deephaven.test.junit4.EngineCleanup; import io.deephaven.test.types.OutOfBandTest; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; import java.io.File; @@ -37,6 +39,9 @@ public class ParquetTableReadWriteTest { private static File rootFile; + @Rule + public final EngineCleanup framework = new EngineCleanup(); + @Before public void setUp() { rootFile = new File(ROOT_FILENAME); @@ -53,7 +58,7 @@ public void tearDown() { } private static Table getTableFlat(int size, boolean includeSerializable) { - QueryLibrary.importClass(SomeSillyTest.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SomeSillyTest.class); ArrayList columns = new ArrayList<>(Arrays.asList("someStringColumn = i % 10 == 0?null:(`` + (i % 101))", "nonNullString = `` + (i % 60)", @@ -77,7 +82,7 @@ private static Table getTableFlat(int size, boolean includeSerializable) { } private static Table getOneColumnTableFlat(int size) { - QueryLibrary.importClass(SomeSillyTest.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SomeSillyTest.class); return TableTools.emptyTable(size).select( // "someBoolColumn = i % 3 == 0?true:i%3 == 1?false:null" "someIntColumn = i % 3 == 0 ? null:i"); @@ -85,8 +90,8 @@ private static Table getOneColumnTableFlat(int size) { private static Table getGroupedOneColumnTable(int size) { Table t = getOneColumnTableFlat(size); - QueryLibrary.importClass(ArrayStringSet.class); - QueryLibrary.importClass(StringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(ArrayStringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(StringSet.class); Table result = t.updateView("groupKey = i % 100 + (int)(i/10)").groupBy("groupKey"); result = result.select(result.getDefinition().getColumnNames().stream() .map(name -> name.equals("groupKey") ? name @@ -121,7 +126,7 @@ public boolean equals(Object obj) { } private static Table getEmptyArray(int size) { - QueryLibrary.importClass(SomeSillyTest.class); + ExecutionContext.getContext().getQueryLibrary().importClass(SomeSillyTest.class); return TableTools.emptyTable(size).select( "someEmptyString = new String[0]", "someEmptyInt = new int[0]", @@ -131,8 +136,8 @@ private static Table getEmptyArray(int size) { private static Table getGroupedTable(int size, boolean includeSerializable) { Table t = getTableFlat(size, includeSerializable); - QueryLibrary.importClass(ArrayStringSet.class); - QueryLibrary.importClass(StringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(ArrayStringSet.class); + ExecutionContext.getContext().getQueryLibrary().importClass(StringSet.class); Table result = t.updateView("groupKey = i % 100 + (int)(i/10)").groupBy("groupKey"); result = result.select(result.getDefinition().getColumnNames().stream() .map(name -> name.equals("groupKey") ? name @@ -246,7 +251,7 @@ public void groupingByStringKey() { @Test public void groupingByBigInt() { - QueryLibrary.importClass(BigInteger.class); + ExecutionContext.getContext().getQueryLibrary().importClass(BigInteger.class); final TableDefinition definition = TableDefinition.of( ColumnDefinition.ofInt("someInt"), ColumnDefinition.fromGenericType("someBigInt", BigInteger.class).withGrouping()); diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetGrouping.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetGrouping.java index 1f46de65990..df50b68fd69 100644 --- a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetGrouping.java +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetGrouping.java @@ -4,12 +4,13 @@ package io.deephaven.parquet.table; import io.deephaven.base.FileUtils; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.rowset.RowSetFactory; -import io.deephaven.parquet.table.ParquetTools; +import io.deephaven.util.SafeCloseable; import junit.framework.TestCase; import java.io.File; @@ -18,6 +19,19 @@ import java.util.Map; public class TestParquetGrouping extends TestCase { + private SafeCloseable executionContext; + + @Override + protected void setUp() throws Exception { + super.setUp(); + executionContext = ExecutionContext.createForUnitTests().open(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + executionContext.close(); + } public void testOverflow() throws IOException { // TODO: Figure out why this is called testOverflow diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java index 02fd4803c74..c1e703e8137 100644 --- a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java @@ -6,12 +6,12 @@ import io.deephaven.UncheckedDeephavenException; import io.deephaven.base.FileUtils; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.stringset.HashStringSet; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; import io.deephaven.parquet.table.layout.ParquetKeyValuePartitionedLayout; -import io.deephaven.engine.table.lang.QueryLibrary; import io.deephaven.stringset.StringSet; import io.deephaven.engine.util.TestTableTools; import io.deephaven.engine.updategraph.UpdateGraphProcessor; @@ -19,6 +19,7 @@ import io.deephaven.engine.table.impl.TstUtils; import io.deephaven.engine.table.impl.locations.TableDataException; import io.deephaven.engine.util.TableTools; +import io.deephaven.test.junit4.EngineCleanup; import junit.framework.TestCase; import org.junit.*; @@ -38,6 +39,10 @@ * Tests for {@link ParquetTools}. */ public class TestParquetTools { + + @Rule + public final EngineCleanup framework = new EngineCleanup(); + private final static String testRoot = Configuration.getInstance().getWorkspacePath() + File.separator + "TestParquetTools"; private final static File testRootFile = new File(testRoot); @@ -79,23 +84,19 @@ public void setUp() { @After public void tearDown() { - try { - if (testRootFile.exists()) { - int tries = 0; - boolean success = false; - do { - try { - FileUtils.deleteRecursively(testRootFile); - success = true; - } catch (Exception e) { - System.gc(); - tries++; - } - } while (!success && tries < 10); - TestCase.assertTrue(success); - } - } finally { - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); + if (testRootFile.exists()) { + int tries = 0; + boolean success = false; + do { + try { + FileUtils.deleteRecursively(testRootFile); + success = true; + } catch (Exception e) { + System.gc(); + tries++; + } + } while (!success && tries < 10); + TestCase.assertTrue(success); } } @@ -133,9 +134,9 @@ public void testWriteTable() { TestTableTools.tableRangesAreEqual(table1, result, 0, 0, table1.size()); result.close(); - QueryLibrary.importClass(TestEnum.class); - QueryLibrary.importClass(HashStringSet.class); - QueryLibrary.importStatic(this.getClass()); + ExecutionContext.getContext().getQueryLibrary().importClass(TestEnum.class); + ExecutionContext.getContext().getQueryLibrary().importClass(HashStringSet.class); + ExecutionContext.getContext().getQueryLibrary().importStatic(this.getClass()); Table test = TableTools.emptyTable(10).select("enumC=TestEnum.values()[i]", "enumSet=newSet(" + "toS(enumC_[(i + 9) % 10])," + "toS(enumC_[i])," + diff --git a/extensions/suanshu/src/main/java/io/deephaven/numerics/suanshu/SuanShuIntegration.java b/extensions/suanshu/src/main/java/io/deephaven/numerics/suanshu/SuanShuIntegration.java index 7a205cce8e4..01678e53a93 100644 --- a/extensions/suanshu/src/main/java/io/deephaven/numerics/suanshu/SuanShuIntegration.java +++ b/extensions/suanshu/src/main/java/io/deephaven/numerics/suanshu/SuanShuIntegration.java @@ -5,7 +5,7 @@ import com.google.auto.service.AutoService; import io.deephaven.base.verify.Require; -import io.deephaven.engine.table.lang.QueryLibraryImports; +import io.deephaven.engine.context.QueryLibraryImports; import io.deephaven.vector.*; import io.deephaven.engine.util.GroovyDeephavenSession; import com.numericalmethod.suanshu.matrix.MatrixAccessException; diff --git a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java index 8b2da2e2d81..f44d6101573 100644 --- a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java +++ b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java @@ -16,6 +16,7 @@ import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.FieldType; import org.apache.arrow.vector.types.pojo.Schema; +import org.junit.Assert; import org.junit.Test; import java.time.Instant; @@ -43,13 +44,13 @@ public void getSchema() throws Exception { @Test public void getStream() throws Exception { final TableSpec table = i32768(TableCreatorImpl.INSTANCE); - try ( - final TableHandle handle = flightSession.session().execute(table); + try (final TableHandle handle = flightSession.session().execute(table); final FlightStream stream = flightSession.stream(handle)) { - System.out.println(stream.getSchema()); + int numRows = 0; while (stream.next()) { - System.out.println(stream.getRoot().contentToTSVString()); + numRows += stream.getRoot().getRowCount(); } + Assert.assertEquals(32768, numRows); } } diff --git a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTestBase.java b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTestBase.java index b648f5b6993..d08d76e0fee 100644 --- a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTestBase.java +++ b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTestBase.java @@ -6,11 +6,13 @@ import io.deephaven.client.impl.DaggerDeephavenFlightRoot; import io.deephaven.client.impl.FlightSession; import io.deephaven.server.runner.DeephavenApiServerTestBase; +import io.deephaven.test.junit4.EngineCleanup; import io.grpc.ManagedChannel; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -22,6 +24,9 @@ public abstract class DeephavenFlightSessionTestBase extends DeephavenApiServerT ScheduledExecutorService sessionScheduler; FlightSession flightSession; + @Rule + public final EngineCleanup framework = new EngineCleanup(); + @Override @Before public void setUp() throws Exception { diff --git a/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/ChunkerCompleter.java b/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/ChunkerCompleter.java index 13b158ba882..f30fdc3a04d 100644 --- a/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/ChunkerCompleter.java +++ b/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/ChunkerCompleter.java @@ -6,7 +6,7 @@ import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryScope.MissingVariableException; +import io.deephaven.engine.context.QueryScope.MissingVariableException; import io.deephaven.time.DateTime; import io.deephaven.engine.util.VariableProvider; import io.deephaven.io.logger.Logger; diff --git a/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/CompletionLookups.java b/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/CompletionLookups.java index 3d58a78e2a5..2597dc8c9e5 100644 --- a/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/CompletionLookups.java +++ b/open-api/lang-tools/src/main/java/io/deephaven/lang/completion/CompletionLookups.java @@ -4,8 +4,9 @@ package io.deephaven.lang.completion; import io.deephaven.base.Lazy; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.table.lang.QueryLibrary; +import io.deephaven.engine.context.QueryLibrary; import io.deephaven.engine.util.ScriptSession; import java.util.Collection; @@ -24,16 +25,12 @@ public class CompletionLookups { private static final WeakHashMap lookups = new WeakHashMap<>(); - private final Lazy ql; private final Lazy>> statics; private final Map referencedTables; public CompletionLookups() { - ql = new Lazy<>(QueryLibrary::getLibrary); - statics = new Lazy<>(() -> { - ql.get(); - return QueryLibrary.getStaticImports(); - }); + final QueryLibrary ql = ExecutionContext.getContext().getQueryLibrary(); + statics = new Lazy<>(ql::getStaticImports); referencedTables = new ConcurrentHashMap<>(); // This can be slow, so lets start it on a background thread right away. diff --git a/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ChunkerCompletionHandlerTest.groovy b/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ChunkerCompletionHandlerTest.groovy index 5d726550597..8b0f647087b 100644 --- a/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ChunkerCompletionHandlerTest.groovy +++ b/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ChunkerCompletionHandlerTest.groovy @@ -1,14 +1,15 @@ package io.deephaven.lang.completion -import io.deephaven.engine.table.ColumnDefinition +import io.deephaven.engine.context.ExecutionContext +import io.deephaven.engine.table.Table import io.deephaven.engine.table.TableDefinition import io.deephaven.engine.util.VariableProvider import io.deephaven.internal.log.LoggerFactory import io.deephaven.io.logger.Logger +import io.deephaven.lang.parse.CompletionParser import io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent import io.deephaven.proto.backplane.script.grpc.CompletionItem -import io.deephaven.engine.table.Table -import io.deephaven.lang.parse.CompletionParser +import io.deephaven.util.SafeCloseable import spock.lang.Specification import spock.lang.Unroll @@ -33,6 +34,16 @@ class ChunkerCompletionHandlerTest extends Specification implements ChunkerCompl return result.build() } + private SafeCloseable executionContext; + + void setup() { + executionContext = ExecutionContext.createForUnitTests().open(); + } + + void cleanup() { + executionContext.close(); + } + @Override Specification getSpec() { return this diff --git a/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ColumnExpressionCompletionHandlerTest.groovy b/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ColumnExpressionCompletionHandlerTest.groovy index c44eb49d49c..f3534626a9d 100644 --- a/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ColumnExpressionCompletionHandlerTest.groovy +++ b/open-api/lang-tools/src/test/groovy/io/deephaven/lang/completion/ColumnExpressionCompletionHandlerTest.groovy @@ -1,13 +1,15 @@ package io.deephaven.lang.completion +import io.deephaven.engine.context.ExecutionContext +import io.deephaven.engine.table.Table +import io.deephaven.engine.table.TableDefinition import io.deephaven.engine.util.VariableProvider import io.deephaven.internal.log.LoggerFactory import io.deephaven.io.logger.Logger +import io.deephaven.lang.parse.CompletionParser import io.deephaven.proto.backplane.script.grpc.CompletionItem -import io.deephaven.engine.table.Table -import io.deephaven.engine.table.TableDefinition import io.deephaven.time.DateTime -import io.deephaven.lang.parse.CompletionParser +import io.deephaven.util.SafeCloseable import spock.lang.Specification import spock.lang.Unroll @@ -17,6 +19,16 @@ class ColumnExpressionCompletionHandlerTest extends Specification implements Chu return """u = ${methodName}.update('$columnName = $completion""" } + private SafeCloseable executionContext; + + void setup() { + executionContext = ExecutionContext.createForUnitTests().open(); + } + + void cleanup() { + executionContext.close(); + } + @Unroll def "Completion at #position should find typesafe column completion for partially completed column expressions"(int position, Set completions) { given: diff --git a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java index e86af6297ed..5083c33d54b 100644 --- a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java +++ b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java @@ -7,6 +7,8 @@ import dagger.Component; import io.deephaven.configuration.Configuration; import io.deephaven.engine.util.ScriptSession; +import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; +import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeModule; import io.deephaven.server.healthcheck.HealthCheckModule; import io.deephaven.server.jetty.JettyConfig; @@ -35,7 +37,9 @@ public class EmbeddedServer { PythonGlobalScopeModule.class, HealthCheckModule.class, PythonPluginsRegistration.Module.class, - JettyServerModule.class + JettyServerModule.class, + PythonConsoleSessionModule.class, + GroovyConsoleSessionModule.class, }) public interface PythonServerComponent extends DeephavenApiServerComponent { @Component.Builder @@ -76,8 +80,13 @@ public EmbeddedServer(String host, Integer port, PyObject dict) throws IOExcepti public void start() throws Exception { server.run(); - checkGlobals(scriptSession.get(), null); + + final ScriptSession scriptSession = this.scriptSession.get(); + checkGlobals(scriptSession, null); System.out.println("Server started on port " + server.server().getPort()); + + // We need to open the systemic execution context to permanently install the contexts for this thread. + scriptSession.getExecutionContext().open(); } private void checkGlobals(ScriptSession scriptSession, @Nullable ScriptSession.SnapshotScope lastSnapshot) { diff --git a/py/server/deephaven/learn/__init__.py b/py/server/deephaven/learn/__init__.py index a9b2d4f5585..aeea0853a1c 100644 --- a/py/server/deephaven/learn/__init__.py +++ b/py/server/deephaven/learn/__init__.py @@ -139,7 +139,7 @@ def learn(table: Table = None, model_func: Callable = None, inputs: List[Input] # TODO: When ticket #1072 is resolved, the following code should be replaced with # Globals["__computer"] = _Computer_(table, model_func, [input.input for input in inputs], batch_size) # and remove from globals at the end of function - (jpy.get_type("io.deephaven.engine.table.lang.QueryScope") + (jpy.get_type("io.deephaven.engine.context.QueryScope") .addParam("__computer", _JLearnComputer(table.j_table, model_func, [input_.input for input_ in inputs], batch_size))) @@ -152,7 +152,7 @@ def learn(table: Table = None, model_func: Callable = None, inputs: List[Input] # TODO: Similarly at resolution of #1072, replace the following code with # Globals["__scatterer"] = __scatterer # and remove from Globals at end of function - jpy.get_type("io.deephaven.engine.table.lang.QueryScope").addParam("__scatterer", __scatterer) + jpy.get_type("io.deephaven.engine.context.QueryScope").addParam("__scatterer", __scatterer) return (table .update(formulas=[f"{future_offset} = __computer.compute(k)", ]) diff --git a/py/server/deephaven/query_library.py b/py/server/deephaven/query_library.py index ae9ceb733a4..4b753f56f90 100644 --- a/py/server/deephaven/query_library.py +++ b/py/server/deephaven/query_library.py @@ -10,7 +10,7 @@ from deephaven import DHError _JPackage = jpy.get_type("java.lang.Package") -_JQueryLibrary = jpy.get_type("io.deephaven.engine.table.lang.QueryLibrary") +_JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") _JClass = jpy.get_type("java.lang.Class") @@ -26,7 +26,7 @@ def import_class(name: str) -> None: """ try: j_class = _JClass.forName(name) - _JQueryLibrary.importClass(j_class) + _JExecutionContext.getContext().getQueryLibrary().importClass(j_class) except Exception as e: raise DHError(e, "failed to add the Java class to the Query Library.") from e @@ -44,7 +44,7 @@ def import_static(name: str) -> None: """ try: j_class = _JClass.forName(name) - _JQueryLibrary.importStatic(j_class) + _JExecutionContext.getContext().getQueryLibrary().importStatic(j_class) except Exception as e: raise DHError(e, "failed to add the static members of the Java class to the Query Library.") from e @@ -62,7 +62,7 @@ def import_package(name: str) -> None: """ try: j_package = _JPackage.getPackage(name) - _JQueryLibrary.importPackage(j_package) + _JExecutionContext.getContext().getQueryLibrary().importPackage(j_package) except Exception as e: raise DHError(e, "failed to add the Java package into to the Query Library.") from e @@ -73,4 +73,4 @@ def imports() -> List[str]: Returns: a list of strings """ - return list(_JQueryLibrary.getImportStrings().toArray())[1:] + return list(_JExecutionContext.getContext().getQueryLibrary().getImportStrings().toArray())[1:] diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 25f37b8c232..90500110290 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -46,11 +46,12 @@ _JTableOperations = jpy.get_type("io.deephaven.api.TableOperations") # Dynamic Query Scope -_JQueryScope = jpy.get_type("io.deephaven.engine.table.lang.QueryScope") +_JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") +_JQueryScope = jpy.get_type("io.deephaven.engine.context.QueryScope") _JUnsynchronizedScriptSessionQueryScope = jpy.get_type( "io.deephaven.engine.util.AbstractScriptSession$UnsynchronizedScriptSessionQueryScope") _JPythonScriptSession = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession") -_j_script_session = jpy.cast(_JQueryScope.getScope(), _JUnsynchronizedScriptSessionQueryScope).scriptSession() +_j_script_session = jpy.cast(_JExecutionContext.getContext().getQueryScope(), _JUnsynchronizedScriptSessionQueryScope).scriptSession() _j_py_script_session = jpy.cast(_j_script_session, _JPythonScriptSession) @@ -128,7 +129,9 @@ class Table(JObjectWrapper): j_object_type = jpy.get_type("io.deephaven.engine.table.Table") def __init__(self, j_table: jpy.JType): - self.j_table = j_table + self.j_table = jpy.cast(j_table, self.j_object_type) + if self.j_table is None: + raise DHError("j_table type is not io.deephaven.engine.table.Table") self._definition = self.j_table.getDefinition() self._schema = None self._is_refreshing = None @@ -975,7 +978,7 @@ def ungroup(self, cols: Union[str, Sequence[str]] = None) -> Table: separate rows. Args: - cols (Union[str, Sequence[str]], optional): the name(s) of the array column(s), if None, all array columns + cols (Union[str, Sequence[str]], optional): the name(s) of the array column(s), if None, all array columns will be ungrouped, default is None Returns: @@ -1818,9 +1821,9 @@ def proxy(self, require_matching_keys: bool = True, sanity_check_joins: bool = T require_matching_keys (bool): whether to ensure that both partitioned tables have all the same keys present when an operation uses this PartitionedTable and another PartitionedTable as inputs for a :meth:`~PartitionedTable.partitioned_transform`, default is True - sanity_check_joins (bool): whether to check that for proxied join operations, a given join key only occurs - in exactly one constituent table of the underlying partitioned table. If the other table argument is also a - PartitionedTableProxy, its constituents will also be subjected to this constraint. + sanity_check_joins (bool): whether to check that for proxied join operations, a given join key only occurs + in exactly one constituent table of the underlying partitioned table. If the other table argument is also a + PartitionedTableProxy, its constituents will also be subjected to this constraint. """ return PartitionedTableProxy( j_pt_proxy=self.j_partitioned_table.proxy(require_matching_keys, sanity_check_joins)) diff --git a/py/server/test_helper/__init__.py b/py/server/test_helper/__init__.py index eb38cba25bf..28bebf10d94 100644 --- a/py/server/test_helper/__init__.py +++ b/py/server/test_helper/__init__.py @@ -94,7 +94,7 @@ def start_jvm(jvm_props: Dict[str, str] = None): # Set up a Deephaven Python session py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals() py_dh_session = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession")(py_scope_jpy) - jpy.get_type("io.deephaven.engine.table.lang.QueryScope").setScope(py_dh_session.newQueryScope()) + py_dh_session.getExecutionContext().open() def _expandWildcardsInList(elements): diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index 84334edc8d7..033721ecb7d 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -2,6 +2,7 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # +import jpy import unittest from deephaven import time_table, DHError, merge, merge_sorted @@ -206,6 +207,14 @@ def test_auto_locking_partitioned_table(self): test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) pt = test_table.partition_by(by="Y") + _ExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + _context = _ExecutionContext.newBuilder() \ + .captureCompilerContext() \ + .captureQueryLibrary() \ + .emptyQueryScope() \ + .build() \ + .open() + with self.subTest("Merge"): ugp.auto_locking = False with self.assertRaises(DHError) as cm: @@ -233,6 +242,8 @@ def test_auto_locking_partitioned_table(self): ugp.auto_locking = True pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) + _context.close() + def test_auto_locking_table_factory(self): with ugp.shared_lock(): test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) diff --git a/python-engine-test/build.gradle b/python-engine-test/build.gradle index 3d64c3b822a..64398e5d655 100644 --- a/python-engine-test/build.gradle +++ b/python-engine-test/build.gradle @@ -15,7 +15,7 @@ test { } dependencies { - testImplementation project(':CompilerTools') + testImplementation project(':engine-context') testImplementation project(':engine-table') testImplementation project(':Integrations') testImplementation TestTools.projectDependency(project, 'engine-table') diff --git a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/PythonMatchFilterTest.java b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/PythonMatchFilterTest.java index 68d5b445e23..0ae82bdfc38 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/PythonMatchFilterTest.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/PythonMatchFilterTest.java @@ -6,7 +6,7 @@ import static org.junit.Assert.assertEquals; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import io.deephaven.io.log.LogLevel; import io.deephaven.io.logger.StreamLoggerImpl; import io.deephaven.util.process.ProcessEnvironment; @@ -14,7 +14,6 @@ import io.deephaven.engine.util.WorkerPythonEnvironment; import io.deephaven.jpy.PythonTest; -import java.util.Collections; import java.util.List; import org.junit.Before; diff --git a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java index e610889f94c..bf989294696 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java @@ -5,6 +5,7 @@ import io.deephaven.base.verify.Require; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils; import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.RowSetBuilderSequential; @@ -12,10 +13,10 @@ import io.deephaven.io.log.LogLevel; import io.deephaven.io.logger.StreamLoggerImpl; import io.deephaven.util.process.ProcessEnvironment; -import io.deephaven.compilertools.CompilerTools; +import io.deephaven.engine.context.CompilerTools; import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.lang.QueryScopeParam; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScopeParam; +import io.deephaven.engine.context.QueryScope; import io.deephaven.integrations.python.PythonDeephavenSession; import io.deephaven.engine.util.PythonScopeJpyImpl; import io.deephaven.engine.table.ColumnSource; @@ -369,12 +370,14 @@ private void check(String expression, Predicate> testPredica validate(expression, keepRowSet, dropRowSet, FormulaParserConfiguration.Deephaven); } if (testPython) { - QueryScope currentScope = QueryScope.getScope(); + ExecutionContext currentContext = ExecutionContext.getContext(); + QueryScope currentScope = currentContext.getQueryScope(); try { if (pythonScope == null) { - pythonScope = new PythonDeephavenSession(new PythonScopeJpyImpl(getMainGlobals().asDict())) - .newQueryScope(); - QueryScope.setScope(pythonScope); + final ExecutionContext context = new PythonDeephavenSession(new PythonScopeJpyImpl( + getMainGlobals().asDict())).getExecutionContext(); + pythonScope = context.getQueryScope(); + context.open(); } for (QueryScopeParam param : currentScope.getParams(currentScope.getParamNames())) { pythonScope.putParam(param.getName(), param.getValue()); @@ -382,7 +385,7 @@ private void check(String expression, Predicate> testPredica expression = expression.replaceAll("true", "True").replaceAll("false", "False"); validate(expression, keepRowSet, dropRowSet, FormulaParserConfiguration.Numba); } finally { - QueryScope.setScope(currentScope); + currentContext.open(); } } diff --git a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java index 2148577fa19..db506c45bb1 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java @@ -11,7 +11,7 @@ import io.deephaven.integrations.python.PythonLogAdapter; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; -import io.deephaven.engine.table.lang.QueryScope; +import io.deephaven.engine.context.QueryScope; import org.jpy.PyObject; import java.io.FileNotFoundException; diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index b70c5ed9981..fa69b5cc99a 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -13,6 +13,7 @@ import io.deephaven.api.SortColumn; import io.deephaven.api.agg.Aggregation; import io.deephaven.api.agg.spec.AggSpec; +import io.deephaven.api.expression.AsOfJoinMatchFactory; import io.deephaven.api.filter.Filter; import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; @@ -24,6 +25,8 @@ import java.util.Optional; import java.util.stream.Collectors; +import static io.deephaven.api.TableOperationsDefaults.splitToCollection; + public abstract class TableBase implements TableSpec { // Note: method implementations should use the static constructors, or builder patterns, for the @@ -245,9 +248,10 @@ public final JoinTable join(TableSpec rightTable, String columnsToMatch, String @Override public final AsOfJoinTable aj(TableSpec rightTable, String columnsToMatch) { AsOfJoinTable.Builder builder = AsOfJoinTable.builder().left(this).right(rightTable); - for (String match : split(columnsToMatch)) { - builder.addMatches(JoinMatch.parse(match)); - } + AsOfJoinMatchFactory.AsOfJoinResult result = + AsOfJoinMatchFactory.getAjExpressions(splitToCollection(columnsToMatch)); + builder.addMatches(result.matches); + builder.rule(result.rule); return builder.build(); } @@ -255,9 +259,10 @@ public final AsOfJoinTable aj(TableSpec rightTable, String columnsToMatch) { public final AsOfJoinTable aj(TableSpec rightTable, String columnsToMatch, String columnsToAdd) { AsOfJoinTable.Builder builder = AsOfJoinTable.builder().left(this).right(rightTable); - for (String match : split(columnsToMatch)) { - builder.addMatches(JoinMatch.parse(match)); - } + AsOfJoinMatchFactory.AsOfJoinResult result = + AsOfJoinMatchFactory.getAjExpressions(splitToCollection(columnsToMatch)); + builder.addMatches(result.matches); + builder.rule(result.rule); for (String addition : split(columnsToAdd)) { builder.addAdditions(JoinAddition.parse(addition)); } @@ -284,6 +289,10 @@ public final AsOfJoinTable aj(TableSpec rightTable, public final ReverseAsOfJoinTable raj(TableSpec rightTable, String columnsToMatch) { ReverseAsOfJoinTable.Builder builder = ReverseAsOfJoinTable.builder().left(this).right(rightTable); + AsOfJoinMatchFactory.ReverseAsOfJoinResult result = + AsOfJoinMatchFactory.getRajExpressions(splitToCollection(columnsToMatch)); + builder.addMatches(result.matches); + builder.rule(result.rule); for (String match : split(columnsToMatch)) { builder.addMatches(JoinMatch.parse(match)); } @@ -295,9 +304,10 @@ public final ReverseAsOfJoinTable raj(TableSpec rightTable, String columnsToMatc String columnsToAdd) { ReverseAsOfJoinTable.Builder builder = ReverseAsOfJoinTable.builder().left(this).right(rightTable); - for (String match : split(columnsToMatch)) { - builder.addMatches(JoinMatch.parse(match)); - } + AsOfJoinMatchFactory.ReverseAsOfJoinResult result = + AsOfJoinMatchFactory.getRajExpressions(splitToCollection(columnsToMatch)); + builder.addMatches(result.matches); + builder.rule(result.rule); for (String addition : split(columnsToAdd)) { builder.addAdditions(JoinAddition.parse(addition)); } diff --git a/qst/src/test/java/io/deephaven/qst/examples/EmployeesExample.java b/qst/src/test/java/io/deephaven/qst/examples/EmployeesExample.java index 028d387a940..d055c19135a 100644 --- a/qst/src/test/java/io/deephaven/qst/examples/EmployeesExample.java +++ b/qst/src/test/java/io/deephaven/qst/examples/EmployeesExample.java @@ -6,6 +6,7 @@ import io.deephaven.qst.table.JoinTable; import io.deephaven.qst.table.NewTable; import io.deephaven.qst.column.header.ColumnHeader; +import io.deephaven.qst.table.TableSpec; public class EmployeesExample { diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java index 32d6a469239..8f69e50618b 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java @@ -5,6 +5,8 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; +import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.deephaven.server.healthcheck.HealthCheckModule; import io.deephaven.server.plugin.python.PythonPluginsRegistration; @@ -22,6 +24,8 @@ HealthCheckModule.class, PythonPluginsRegistration.Module.class, JettyServerModule.class, + PythonConsoleSessionModule.class, + GroovyConsoleSessionModule.class, }) public interface JettyServerComponent extends DeephavenApiServerComponent { @Component.Builder diff --git a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java index e4fdae5b295..392916cd630 100644 --- a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java +++ b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java @@ -5,6 +5,8 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; +import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.deephaven.server.healthcheck.HealthCheckModule; import io.deephaven.server.plugin.python.PythonPluginsRegistration; @@ -21,7 +23,9 @@ PythonGlobalScopeCopyModule.class, HealthCheckModule.class, PythonPluginsRegistration.Module.class, - NettyServerModule.class + NettyServerModule.class, + PythonConsoleSessionModule.class, + GroovyConsoleSessionModule.class, }) public interface NettyServerComponent extends DeephavenApiServerComponent { @Component.Builder diff --git a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java index 0fb213470d6..4721023eef0 100644 --- a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java @@ -33,6 +33,7 @@ import io.deephaven.server.session.SessionState; import io.deephaven.server.session.SessionState.ExportBuilder; import io.deephaven.server.session.TicketRouter; +import io.deephaven.util.SafeCloseable; import io.grpc.stub.StreamObserver; import javax.inject.Inject; @@ -334,9 +335,9 @@ public void onCompleted() { private void getCompletionItems(GetCompletionItemsRequest request, SessionState.ExportObject exportedConsole, CompletionParser parser, StreamObserver responseObserver) { - try { + final ScriptSession scriptSession = exportedConsole.get(); + try (final SafeCloseable ignored = scriptSession.getExecutionContext().open()) { final VersionedTextDocumentIdentifier doc = request.getTextDocument(); - ScriptSession scriptSession = exportedConsole.get(); final VariableProvider vars = scriptSession.getVariableProvider(); final CompletionLookups h = CompletionLookups.preload(scriptSession); // The only stateful part of a completer is the CompletionLookups, which are already once-per-session-cached diff --git a/server/src/main/java/io/deephaven/server/console/groovy/GroovyConsoleSessionModule.java b/server/src/main/java/io/deephaven/server/console/groovy/GroovyConsoleSessionModule.java index 58d7a075ed8..c37cef12010 100644 --- a/server/src/main/java/io/deephaven/server/console/groovy/GroovyConsoleSessionModule.java +++ b/server/src/main/java/io/deephaven/server/console/groovy/GroovyConsoleSessionModule.java @@ -28,7 +28,7 @@ ScriptSession bindScriptSession(final GroovyDeephavenSession groovySession) { GroovyDeephavenSession bindGroovySession(ObjectTypeLookup lookup, final ScriptSession.Listener listener, final RunScripts runScripts) { try { - return new GroovyDeephavenSession(lookup, listener, runScripts, true); + return new GroovyDeephavenSession(lookup, listener, runScripts); } catch (final IOException e) { throw new UncheckedIOException(e); } diff --git a/server/src/main/java/io/deephaven/server/console/python/PythonConsoleSessionModule.java b/server/src/main/java/io/deephaven/server/console/python/PythonConsoleSessionModule.java index b1afdb2d7c6..af3c334f9f3 100644 --- a/server/src/main/java/io/deephaven/server/console/python/PythonConsoleSessionModule.java +++ b/server/src/main/java/io/deephaven/server/console/python/PythonConsoleSessionModule.java @@ -28,7 +28,7 @@ ScriptSession bindScriptSession(PythonDeephavenSession pythonSession) { PythonDeephavenSession bindPythonSession(ObjectTypeLookup lookup, final ScriptSession.Listener listener, PythonEvaluatorJpy pythonEvaluator) { try { - return new PythonDeephavenSession(lookup, listener, true, true, pythonEvaluator); + return new PythonDeephavenSession(lookup, listener, true, pythonEvaluator); } catch (IOException e) { throw new UncheckedIOException("Unable to run python startup scripts", e); } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java new file mode 100644 index 00000000000..0f6e8b9eafd --- /dev/null +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.server.runner; + +import dagger.BindsInstance; +import dagger.Component; +import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; +import io.grpc.ManagedChannelBuilder; + +import javax.inject.Named; +import javax.inject.Singleton; +import java.io.PrintStream; + +@Singleton +@Component(modules = { + DeephavenApiServerModule.class, + GroovyConsoleSessionModule.class, + ServerBuilderInProcessModule.class +}) +public interface DeephavenApiServerInProcessGroovyComponent { + + DeephavenApiServer getServer(); + + ManagedChannelBuilder channelBuilder(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder withSchedulerPoolSize(@Named("scheduler.poolSize") int numThreads); + + @BindsInstance + Builder withSessionTokenExpireTmMs(@Named("session.tokenExpireMs") long tokenExpireMs); + + @BindsInstance + Builder withOut(@Named("out") PrintStream out); + + @BindsInstance + Builder withErr(@Named("err") PrintStream err); + + DeephavenApiServerInProcessGroovyComponent build(); + } +} diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java similarity index 81% rename from server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessComponent.java rename to server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java index 13417f9a58a..a8854915dc0 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessComponent.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java @@ -5,6 +5,7 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.grpc.ManagedChannelBuilder; @@ -15,10 +16,11 @@ @Singleton @Component(modules = { DeephavenApiServerModule.class, + PythonConsoleSessionModule.class, PythonGlobalScopeCopyModule.class, ServerBuilderInProcessModule.class }) -public interface DeephavenApiServerInProcessComponent { +public interface DeephavenApiServerInProcessPythonComponent { DeephavenApiServer getServer(); @@ -39,6 +41,6 @@ interface Builder { @BindsInstance Builder withErr(@Named("err") PrintStream err); - DeephavenApiServerInProcessComponent build(); + DeephavenApiServerInProcessPythonComponent build(); } } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java index d7b5380a0f1..f75d8b2f1f4 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java @@ -63,8 +63,6 @@ ObjectServiceModule.class, PluginsModule.class, PartitionedTableServiceModule.class, - GroovyConsoleSessionModule.class, - PythonConsoleSessionModule.class }) public class DeephavenApiServerModule { @@ -89,7 +87,16 @@ public static AppMode provideAppMode() { @Provides @Singleton public ScriptSession provideScriptSession(Map> scriptTypes) { - String scriptSessionType = Configuration.getInstance().getStringWithDefault("deephaven.console.type", "python"); + final String DEEPHAVEN_CONSOLE_TYPE = "deephaven.console.type"; + boolean configuredConsole = Configuration.getInstance().hasProperty(DEEPHAVEN_CONSOLE_TYPE); + + if (!configuredConsole && scriptTypes.size() == 1) { + // if there is only one; use it + return scriptTypes.values().iterator().next().get(); + } + + // otherwise, assume we want python... + String scriptSessionType = Configuration.getInstance().getStringWithDefault(DEEPHAVEN_CONSOLE_TYPE, "python"); if (!scriptTypes.containsKey(scriptSessionType)) { throw new IllegalArgumentException("Console type not found: " + scriptSessionType); } diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index 79e0acd92cb..d76c44fb6fb 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -21,6 +21,7 @@ import io.deephaven.engine.tablelogger.QueryOperationPerformanceLogLogger; import io.deephaven.engine.tablelogger.QueryPerformanceLogLogger; import io.deephaven.engine.updategraph.DynamicNode; +import io.deephaven.engine.util.ScriptSession; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.hash.KeyedIntObjectHash; import io.deephaven.hash.KeyedIntObjectHashMap; @@ -33,6 +34,7 @@ import io.deephaven.proto.flight.util.FlightExportTicketHelper; import io.deephaven.proto.util.ExportTicketHelper; import io.deephaven.server.util.Scheduler; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.util.SafeCloseable; import io.deephaven.util.annotations.VisibleForTesting; import io.deephaven.util.auth.AuthContext; @@ -44,6 +46,7 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import javax.inject.Provider; import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; @@ -129,12 +132,17 @@ public static ExportObject wrapAsExport(final T export) { private final SimpleReferenceManager> onCloseCallbacks = new SimpleReferenceManager<>(WeakSimpleReference::new, false); + private final ExecutionContext executionContext; + @AssistedInject - public SessionState(final Scheduler scheduler, @Assisted final AuthContext authContext) { + public SessionState(final Scheduler scheduler, + final Provider scriptSessionProvider, + @Assisted final AuthContext authContext) { this.sessionId = UuidCreator.toString(UuidCreator.getRandomBased()); this.logPrefix = "SessionState{" + sessionId + "}: "; this.scheduler = scheduler; this.authContext = authContext; + this.executionContext = scriptSessionProvider.get().getExecutionContext(); log.info().append(logPrefix).append("session initialized").endl(); } @@ -837,7 +845,8 @@ private void doExport() { boolean shouldLog = false; int evaluationNumber = -1; QueryProcessingResults queryProcessingResults = null; - try (final AutoCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored1 = LivenessScopeStack.open(); + final SafeCloseable ignored2 = session.executionContext.open()) { queryProcessingResults = new QueryProcessingResults( QueryPerformanceRecorder.getInstance()); diff --git a/server/src/main/java/io/deephaven/server/table/ops/JoinTablesGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/ops/JoinTablesGrpcImpl.java index f045ce3c144..c9fe740f922 100644 --- a/server/src/main/java/io/deephaven/server/table/ops/JoinTablesGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/table/ops/JoinTablesGrpcImpl.java @@ -6,7 +6,7 @@ import com.google.common.collect.Lists; import com.google.rpc.Code; import io.deephaven.base.verify.Assert; -import io.deephaven.engine.exceptions.ExpressionException; +import io.deephaven.api.expression.ExpressionException; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.select.MatchPairFactory; diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java index 560d68625af..2897c832150 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java @@ -39,8 +39,9 @@ public class ApplicationServiceGrpcImplTest { public void setup() { livenessScope = LivenessScopeStack.open(); scheduler = new TestControlledScheduler(); - sessionService = - new SessionService(scheduler, authContext -> new SessionState(scheduler, authContext), TOKEN_EXPIRE_MS); + sessionService = new SessionService(scheduler, + authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), + TOKEN_EXPIRE_MS); applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(AppMode.HYBRID, scheduler, sessionService, new TypeLookup(ObjectTypeLookup.NoOp.INSTANCE)); } diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationTest.java index b074916258f..ae51bc04166 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationTest.java @@ -49,7 +49,7 @@ public void app00() { @Test public void app01() throws IOException { - session = new GroovyDeephavenSession(NoOp.INSTANCE, null, GroovyDeephavenSession.RunScripts.none(), false); + session = new GroovyDeephavenSession(NoOp.INSTANCE, null, GroovyDeephavenSession.RunScripts.none()); ApplicationState app = ApplicationFactory.create(ApplicationConfigs.testAppDir(), ApplicationConfigs.app01(), session, new NoopStateListener()); assertThat(app.name()).isEqualTo("My Groovy Application"); @@ -61,7 +61,7 @@ public void app01() throws IOException { @Test @Ignore("TODO: deephaven-core#1741 python test needs to run in a container") public void app02() throws IOException, InterruptedException, TimeoutException { - session = new PythonDeephavenSession(NoOp.INSTANCE, null, false, false, PythonEvaluatorJpy.withGlobalCopy()); + session = new PythonDeephavenSession(NoOp.INSTANCE, null, false, PythonEvaluatorJpy.withGlobalCopy()); ApplicationState app = ApplicationFactory.create(ApplicationConfigs.testAppDir(), ApplicationConfigs.app02(), session, new NoopStateListener()); assertThat(app.name()).isEqualTo("My Python Application"); diff --git a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java index 9463b56b8fe..427e4c7418d 100644 --- a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java +++ b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java @@ -27,7 +27,7 @@ public abstract class DeephavenApiServerTestBase { @Rule public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); - private DeephavenApiServerInProcessComponent serverComponent; + private DeephavenApiServerInProcessGroovyComponent serverComponent; private LogBuffer logBuffer; private DeephavenApiServer server; private SafeCloseable scopeCloseable; @@ -40,7 +40,7 @@ public void setUp() throws Exception { logBuffer = new LogBuffer(128); LogBufferGlobal.setInstance(logBuffer); - serverComponent = DaggerDeephavenApiServerInProcessComponent + serverComponent = DaggerDeephavenApiServerInProcessGroovyComponent .builder() .withSchedulerPoolSize(4) .withSessionTokenExpireTmMs(sessionTokenExpireTmMs()) @@ -63,7 +63,6 @@ public void tearDown() throws Exception { server.server().join(); } finally { LogBufferGlobal.clear(logBuffer); - UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); } } diff --git a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java index 28f59fbf2bf..7997bdd3e19 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java @@ -5,6 +5,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.engine.liveness.LivenessScopeStack; +import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.server.util.TestControlledScheduler; import io.deephaven.util.SafeCloseable; import io.deephaven.util.auth.AuthContext; @@ -25,8 +26,9 @@ public class SessionServiceTest { public void setup() { livenessScope = LivenessScopeStack.open(); scheduler = new TestControlledScheduler(); - sessionService = - new SessionService(scheduler, authContext -> new SessionState(scheduler, authContext), TOKEN_EXPIRE_MS); + sessionService = new SessionService(scheduler, + authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), + TOKEN_EXPIRE_MS); } @After diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index 1e4c7980079..a21f0dcddff 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -5,6 +5,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.AssertionFailure; +import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.proto.util.ExportTicketHelper; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.liveness.LivenessArtifact; @@ -58,7 +59,7 @@ public void setup() { livenessScope = new LivenessScope(); LivenessScopeStack.push(livenessScope); scheduler = new TestControlledScheduler(); - session = new SessionState(scheduler, AUTH_CONTEXT); + session = new SessionState(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); session.initializeExpiration(new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), session)); nextExportId = 1; @@ -634,7 +635,7 @@ public void testCannotOutOfOrderServerExports() { @Test public void testVerifyExpirationSession() { - final SessionState session = new SessionState(scheduler, AUTH_CONTEXT); + final SessionState session = new SessionState(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); final SessionService.TokenExpiration expiration = new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), session); diff --git a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java index 5f4f4e693d1..0134a7bd7a1 100644 --- a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java +++ b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java @@ -6,6 +6,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.engine.table.impl.TableUpdateImpl; import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker; import io.deephaven.engine.liveness.LivenessScopeStack; @@ -339,7 +340,7 @@ private void expectNoMessage() { public class TestSessionState extends SessionState { public TestSessionState() { - super(scheduler, AUTH_CONTEXT); + super(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); initializeExpiration(new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), this)); } diff --git a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java index 2c60ce6d9a6..d31b3743efe 100644 --- a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java +++ b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java @@ -142,6 +142,7 @@ public interface TestComponent { private UUID sessionToken; private SessionState currentSession; private AbstractScriptSession scriptSession; + private SafeCloseable executionContext; @Before public void setup() throws IOException { @@ -153,6 +154,7 @@ public void setup() throws IOException { scriptSession = component.scriptSession(); sessionService = component.sessionService(); + executionContext = scriptSession.getExecutionContext().open(); client = FlightClient.builder().location(Location.forGrpcInsecure("localhost", actualPort)) .allocator(new RootAllocator()).intercept(info -> new FlightClientMiddleware() { @@ -190,6 +192,7 @@ public void onCallCompleted(CallStatus status) {} public void teardown() { sessionService.closeAllSessions(); scriptSession.release(); + executionContext.close(); channel.shutdown(); try { diff --git a/settings.gradle b/settings.gradle index 1696cea9483..2985969e0c8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,7 +11,6 @@ String[] mods = [ 'Numerics', 'TableLogger', 'Plot', - 'CompilerTools', 'Generators', 'Integrations', 'ModelFarm', @@ -156,6 +155,9 @@ project(':replication-reflective').projectDir = file('replication/reflective') include(':engine-chunk') project(':engine-chunk').projectDir = file('engine/chunk') +include(':engine-context') +project(':engine-context').projectDir = file('engine/context') + include(':engine-vector') project(':engine-vector').projectDir = file('engine/vector') diff --git a/sphinx/source/conf.py b/sphinx/source/conf.py index 58f908e123a..aad195d1d48 100644 --- a/sphinx/source/conf.py +++ b/sphinx/source/conf.py @@ -96,7 +96,7 @@ import jpy py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals() py_dh_session = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession")(py_scope_jpy) -jpy.get_type("io.deephaven.engine.table.lang.QueryScope").setScope(py_dh_session.newQueryScope()) +py_dh_session.getExecutionContext().open() import deephaven docs_title = "Deephaven python modules." diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index c64cf5452e4..8956d5ea02a 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -8,6 +8,7 @@ import io.deephaven.api.filter.Filter; import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.api.util.ConcurrentMethod; import java.util.Collection; @@ -21,12 +22,15 @@ public interface TableOperations, TABL // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS head(long size); + @ConcurrentMethod TOPS tail(long size); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS reverse(); // ------------------------------------------------------------------------------------------- @@ -80,16 +84,21 @@ public interface TableOperations, TABL // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS sort(String... columnsToSortBy); + @ConcurrentMethod TOPS sortDescending(String... columnsToSortBy); + @ConcurrentMethod TOPS sort(Collection columnsToSortBy); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS where(String... filters); + @ConcurrentMethod TOPS where(Collection filters); // ------------------------------------------------------------------------------------------- @@ -148,14 +157,18 @@ public interface TableOperations, TABL // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS view(String... columns); + @ConcurrentMethod TOPS view(Collection columns); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS updateView(String... columns); + @ConcurrentMethod TOPS updateView(Collection columns); // ------------------------------------------------------------------------------------------- @@ -166,8 +179,35 @@ public interface TableOperations, TABL // ------------------------------------------------------------------------------------------- + /** + * Compute column formulas on demand. + * + *

    + * Delegates to {@link #lazyUpdate(Collection)}. + * + * @param columns the columns to add + * @return a new Table with the columns added; to be computed on demand + */ TOPS lazyUpdate(String... columns); + /** + * Compute column formulas on demand. + * + *

    + * Lazy update defers computation until required for a set of values, and caches the results for a set of input + * values. This uses less RAM than an update statement when you have a smaller set of unique values. Less + * computation than an updateView is needed, because the results are saved in a cache. + *

    + * + *

    + * If you have many unique values, you should instead use an update statement, which will have more memory efficient + * structures. Values are never removed from the lazyUpdate cache, so it should be used judiciously on a ticking + * table. + *

    + * + * @param columns the columns to add + * @return a new Table with the columns added; to be computed on demand + */ TOPS lazyUpdate(Collection columns); // ------------------------------------------------------------------------------------------- @@ -493,20 +533,27 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS groupBy(); + @ConcurrentMethod TOPS groupBy(String... groupByColumns); + @ConcurrentMethod TOPS groupBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS aggAllBy(AggSpec spec); + @ConcurrentMethod TOPS aggAllBy(AggSpec spec, String... groupByColumns); + @ConcurrentMethod TOPS aggAllBy(AggSpec spec, ColumnName... groupByColumns); + @ConcurrentMethod TOPS aggAllBy(AggSpec spec, Collection groupByColumns); // ------------------------------------------------------------------------------------------- @@ -519,6 +566,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param aggregation The {@link Aggregation aggregation} to apply * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Aggregation aggregation); /** @@ -529,6 +577,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param aggregations The {@link Aggregation aggregations} to apply * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Collection aggregations); /** @@ -540,6 +589,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * result table will have one row if {@code this} has one or more rows, or else zero rows. * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Collection aggregations, boolean preserveEmpty); /** @@ -552,6 +602,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param groupByColumns The columns to group by * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Aggregation aggregation, String... groupByColumns); /** @@ -564,6 +615,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param groupByColumns The {@link ColumnName columns} to group by * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Aggregation aggregation, Collection groupByColumns); /** @@ -576,6 +628,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param groupByColumns The columns to group by * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Collection aggregations, String... groupByColumns); /** @@ -588,6 +641,7 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param groupByColumns The {@link ColumnName columns} to group by * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Collection aggregations, Collection groupByColumns); /** @@ -609,164 +663,585 @@ TOPS raj(TABLE rightTable, Collection columnsToMatch, * @param groupByColumns The {@link ColumnName columns} to group by * @return A new table aggregating the rows of {@code this} */ + @ConcurrentMethod TOPS aggBy(Collection aggregations, boolean preserveEmpty, TABLE initialGroups, Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. + * + * @param operation the operation to apply to the table. + * @return a table with the same rowset, with the specified operation applied to the entire table + */ + @ConcurrentMethod TOPS updateBy(UpdateByOperation operation); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. + * + * @param operations the operations to apply to the table. + * @return a table with the same rowset, with the specified operations applied to the entire table. + */ + @ConcurrentMethod TOPS updateBy(Collection operations); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * over the entire table. + * + * @param control the {@link UpdateByControl control} to use when updating the table. + * @param operations the operations to apply to the table. + * @return a table with the same rowset, with the specified operations applied to the entire table + */ + @ConcurrentMethod TOPS updateBy(UpdateByControl control, Collection operations); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). + * + * @param operation the operation to apply to the table. + * @param byColumns the columns to group by before applying. + * @return a table with the same rowSet, with the specified operation applied to each group defined by the + * {@code byColumns} + */ + @ConcurrentMethod TOPS updateBy(UpdateByOperation operation, final String... byColumns); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). + * + * @param operations the operations to apply to the table. + * @param byColumns the columns to group by before applying. + * @return a table with the same rowSet, with the specified operations applied to each group defined by the + * {@code byColumns} + */ + @ConcurrentMethod TOPS updateBy(Collection operations, final String... byColumns); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). + * + * @param operations the operations to apply to the table. + * @param byColumns the columns to group by before applying. + * @return a table with the same rowSet, with the specified operations applied to each group defined by the + * {@code byColumns} + */ + @ConcurrentMethod TOPS updateBy(Collection operations, Collection byColumns); + /** + * Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The + * aggregations are defined by the {@code operations}, which support incremental aggregation over the corresponding + * rows in the parent table. The aggregations will apply position or time-based windowing and compute the results + * for the row group (as determined by the {@code byColumns}). + * + * @param control the {@link UpdateByControl control} to use when updating the table. + * @param operations the operations to apply to the table. + * @param byColumns the columns to group by before applying. + * @return a table with the same rowSet, with the specified operations applied to each group defined by the + * {@code byColumns} + */ + @ConcurrentMethod TOPS updateBy(UpdateByControl control, Collection operations, Collection byColumns); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS selectDistinct(); + @ConcurrentMethod TOPS selectDistinct(String... columns); + @ConcurrentMethod TOPS selectDistinct(Selectable... columns); + @ConcurrentMethod TOPS selectDistinct(Collection columns); // ------------------------------------------------------------------------------------------- + @ConcurrentMethod TOPS countBy(String countColumnName); + @ConcurrentMethod TOPS countBy(String countColumnName, String... groupByColumns); + @ConcurrentMethod TOPS countBy(String countColumnName, ColumnName... groupByColumns); + @ConcurrentMethod TOPS countBy(String countColumnName, Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Returns the first row of the given table. + */ + @ConcurrentMethod TOPS firstBy(); + /** + * Groups the data column according to groupByColumns and retrieves the first for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS firstBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and retrieves the first for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS firstBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and retrieves the first for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS firstBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Returns the last row of the given table. + */ + @ConcurrentMethod TOPS lastBy(); + /** + * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS lastBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS lastBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and retrieves the last for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS lastBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the minimum of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS minBy(); + /** + * Groups the data column according to groupByColumns and computes the min for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS minBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the min for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS minBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the min for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS minBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the maximum of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS maxBy(); + /** + * Groups the data column according to groupByColumns and computes the max for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS maxBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the max for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS maxBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the max for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS maxBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the sum of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS sumBy(); + /** + * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS sumBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS sumBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the sum for the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS sumBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the average of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS avgBy(); + /** + * Groups the data column according to groupByColumns and computes the average for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS avgBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the average for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS avgBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the average for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS avgBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the median of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS medianBy(); + /** + * Groups the data column according to groupByColumns and computes the median for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS medianBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the median for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS medianBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the median for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} } + */ + @ConcurrentMethod TOPS medianBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the standard deviation of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS stdBy(); + /** + * Groups the data column according to groupByColumns and computes the standard deviation for the rest + * of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS stdBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the standard deviation for the rest + * of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS stdBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the standard deviation for the rest + * of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS stdBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the variance of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS varBy(); + /** + * Groups the data column according to groupByColumns and computes the variance for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS varBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the variance for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS varBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the variance for the rest of the + * fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS varBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the absolute sum of each column. + *

    + * When the input table is empty, zero output rows are produced. + */ + @ConcurrentMethod TOPS absSumBy(); + /** + * Groups the data column according to groupByColumns and computes the sum of the absolute values for + * the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS absSumBy(String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the sum of the absolute values for + * the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS absSumBy(ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the sum of the absolute values for + * the rest of the fields + * + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS absSumBy(Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Computes the weighted sum for all rows in the table using weightColumn for the rest of the fields + *

    + * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an + * integral type, all integral input columns will have long results and all floating point input columns will have + * double results. + * + * @param weightColumn the column to use for the weight + */ + @ConcurrentMethod TOPS wsumBy(String weightColumn); + /** + * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn + * for the rest of the fields + *

    + * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an + * integral type, all integral input columns will have long results and all floating point input columns will have + * double results. + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wsumBy(String weightColumn, String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn + * for the rest of the fields + *

    + * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an + * integral type, all integral input columns will have long results and all floating point input columns will have + * double results. + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wsumBy(String weightColumn, ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the weighted sum using weightColumn + * for the rest of the fields + *

    + * If the weight column is a floating point type, all result columns will be doubles. If the weight column is an + * integral type, all integral input columns will have long results and all floating point input columns will have + * double results. + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wsumBy(String weightColumn, Collection groupByColumns); // ------------------------------------------------------------------------------------------- + /** + * Produces a single row table with the weighted average using weightColumn for the rest of the fields + *

    + * When the input table is empty, zero output rows are produced. + * + * @param weightColumn the column to use for the weight + */ + @ConcurrentMethod TOPS wavgBy(String weightColumn); + /** + * Groups the data column according to groupByColumns and computes the weighted average using + * weightColumn for the rest of the fields + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wavgBy(String weightColumn, String... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the weighted average using + * weightColumn for the rest of the fields + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wavgBy(String weightColumn, ColumnName... groupByColumns); + /** + * Groups the data column according to groupByColumns and computes the weighted average using + * weightColumn for the rest of the fields + * + * @param weightColumn the column to use for the weight + * @param groupByColumns The grouping columns as in {@link TableOperations#groupBy} + */ + @ConcurrentMethod TOPS wavgBy(String weightColumn, Collection groupByColumns); // ------------------------------------------------------------------------------------------- diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java b/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java new file mode 100644 index 00000000000..cf5913b8309 --- /dev/null +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java @@ -0,0 +1,697 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.api; + +import io.deephaven.api.agg.Aggregation; +import io.deephaven.api.agg.spec.AggSpec; +import io.deephaven.api.expression.AsOfJoinMatchFactory; +import io.deephaven.api.filter.Filter; +import io.deephaven.api.updateby.UpdateByOperation; +import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.api.util.ConcurrentMethod; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Sub-interface to capture default methods rom {@link TABLE}. + */ +public interface TableOperationsDefaults, TABLE> + extends TableOperations { + + Filter[] ZERO_LENGTH_FILTER_ARRAY = new Filter[0]; + ColumnName[] ZERO_LENGTH_COLUMNNAME_ARRAY = new ColumnName[0]; + + // ----------------------------------------------------------------------------------------------------------------- + // Snapshot Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS snapshot(TABLE baseTable, String... stampColumns) { + return snapshot(baseTable, true, stampColumns); + } + + @Override + default TOPS snapshot(TABLE baseTable, boolean doInitialSnapshot, Collection stampColumns) { + return snapshot(baseTable, doInitialSnapshot, + stampColumns.stream().map(ColumnName::name).toArray(String[]::new)); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Sort Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS sort(String... columnsToSortBy) { + return sort(Arrays.stream(columnsToSortBy) + .map(ColumnName::of).map(SortColumn::asc).collect(Collectors.toList())); + } + + @Override + @ConcurrentMethod + default TOPS sortDescending(String... columnsToSortBy) { + return sort(Arrays.stream(columnsToSortBy) + .map(ColumnName::of).map(SortColumn::desc).collect(Collectors.toList())); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Filter Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS where(String... filters) { + return where(Filter.from(filters)); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS whereIn(TABLE rightTable, String... columnsToMatch) { + return whereIn(rightTable, JoinMatch.from(columnsToMatch)); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS whereNotIn(TABLE rightTable, String... columnsToMatch) { + return whereNotIn(rightTable, JoinMatch.from(columnsToMatch)); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Column Selection Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS view(String... columns) { + return view(Selectable.from(columns)); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS updateView(String... newColumns) { + return updateView(Selectable.from((newColumns))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS update(String... newColumns) { + return update(Selectable.from((newColumns))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS lazyUpdate(String... newColumns) { + return lazyUpdate(Selectable.from((newColumns))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS select(String... columns) { + return select(Selectable.from(columns)); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Join Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS naturalJoin(TABLE rightTable, String columnsToMatch) { + return naturalJoin(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), Collections.emptyList()); + } + + @Override + default TOPS naturalJoin(TABLE rightTable, String columnsToMatch, String columnsToAdd) { + return naturalJoin(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), + JoinAddition.from(splitToCollection(columnsToAdd))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS exactJoin(TABLE rightTable, String columnsToMatch) { + return exactJoin(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), Collections.emptyList()); + } + + + @Override + default TOPS exactJoin(TABLE rightTable, String columnsToMatch, String columnsToAdd) { + return exactJoin(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), + JoinAddition.from(TableOperationsDefaults.splitToCollection(columnsToAdd))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS join(TABLE rightTable, String columnsToMatch) { + return join(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), Collections.emptyList()); + } + + @Override + default TOPS join(TABLE rightTable, String columnsToMatch, String columnsToAdd) { + return join(rightTable, JoinMatch.from(splitToCollection(columnsToMatch)), + JoinAddition.from(TableOperationsDefaults.splitToCollection(columnsToAdd))); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS aj(TABLE rightTable, String columnsToMatch) { + final AsOfJoinMatchFactory.AsOfJoinResult result = + AsOfJoinMatchFactory.getAjExpressions(splitToCollection(columnsToMatch)); + return aj(rightTable, Arrays.asList(result.matches), Collections.emptyList(), result.rule); + } + + @Override + default TOPS aj(TABLE rightTable, String columnsToMatch, String columnsToAdd) { + final AsOfJoinMatchFactory.AsOfJoinResult result = + AsOfJoinMatchFactory.getAjExpressions(splitToCollection(columnsToMatch)); + return aj(rightTable, Arrays.asList(result.matches), JoinAddition.from(splitToCollection(columnsToAdd)), + result.rule); + } + + @Override + default TOPS aj(TABLE rightTable, Collection columnsToMatch, + Collection columnsToAdd) { + return aj(rightTable, columnsToMatch, columnsToAdd, AsOfJoinRule.LESS_THAN_EQUAL); + } + + // ----------------------------------------------------------------------------------------------------------------- + + @Override + default TOPS raj(TABLE rightTable, String columnsToMatch) { + final AsOfJoinMatchFactory.ReverseAsOfJoinResult result = + AsOfJoinMatchFactory.getRajExpressions(splitToCollection(columnsToMatch)); + return raj(rightTable, Arrays.asList(result.matches), Collections.emptyList(), result.rule); + } + + @Override + default TOPS raj(TABLE rightTable, String columnsToMatch, String columnsToAdd) { + final AsOfJoinMatchFactory.ReverseAsOfJoinResult result = + AsOfJoinMatchFactory.getRajExpressions(splitToCollection(columnsToMatch)); + return raj(rightTable, Arrays.asList(result.matches), JoinAddition.from(splitToCollection(columnsToAdd)), + result.rule); + } + + @Override + default TOPS raj(TABLE rightTable, Collection columnsToMatch, + Collection columnsToAdd) { + return raj(rightTable, columnsToMatch, columnsToAdd, ReverseAsOfJoinRule.GREATER_THAN_EQUAL); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Aggregation Operations + // ----------------------------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS groupBy() { + return groupBy(Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS groupBy(String... groupByColumns) { + return groupBy(ColumnName.from(groupByColumns)); + } + + @Override + @ConcurrentMethod + default TOPS groupBy(Collection groupByColumns) { + return aggAllBy(AggSpec.group(), groupByColumns.toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS aggAllBy(AggSpec spec) { + return aggAllBy(spec, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS aggAllBy(AggSpec spec, String... groupByColumns) { + return aggAllBy(spec, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS aggAllBy(AggSpec spec, Collection groupByColumns) { + return aggAllBy(spec, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS aggBy(Aggregation aggregation) { + return aggBy(Collections.singletonList(aggregation)); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Collection aggregations) { + return aggBy(aggregations, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Collection aggregations, boolean preserveEmpty) { + return aggBy(aggregations, preserveEmpty, null, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Aggregation aggregation, String... groupByColumns) { + return aggBy(Collections.singletonList(aggregation), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Aggregation aggregation, Collection groupByColumns) { + return aggBy(Collections.singletonList(aggregation), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Collection aggregations, String... groupByColumns) { + return aggBy(aggregations, ColumnName.from(groupByColumns)); + } + + @Override + @ConcurrentMethod + default TOPS aggBy(Collection aggregations, + Collection groupByColumns) { + return aggBy(aggregations, false, null, groupByColumns); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS updateBy(final UpdateByOperation operation) { + return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), + Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS updateBy(final Collection operations) { + return updateBy(UpdateByControl.defaultInstance(), operations, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS updateBy(final UpdateByControl control, final Collection operations) { + return updateBy(control, operations, Collections.emptyList()); + } + + @Override + @ConcurrentMethod + default TOPS updateBy(final UpdateByOperation operation, final String... byColumns) { + return updateBy(UpdateByControl.defaultInstance(), Collections.singletonList(operation), + ColumnName.from(byColumns)); + } + + @Override + @ConcurrentMethod + default TOPS updateBy(final Collection operations, final String... byColumns) { + return updateBy(UpdateByControl.defaultInstance(), operations, ColumnName.from(byColumns)); + } + + @Override + @ConcurrentMethod + default TOPS updateBy(Collection operations, + Collection byColumns) { + return updateBy(UpdateByControl.defaultInstance(), operations, byColumns); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS selectDistinct(String... columns) { + return selectDistinct(Selectable.from(columns)); + } + + @Override + @ConcurrentMethod + default TOPS selectDistinct(Selectable... columns) { + return selectDistinct(Arrays.asList(columns)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS countBy(String countColumnName) { + return countBy(countColumnName, ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS countBy(String countColumnName, String... groupByColumns) { + return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS countBy(String countColumnName, ColumnName... groupByColumns) { + return aggBy(Aggregation.AggCount(countColumnName), Arrays.asList(groupByColumns)); + } + + @Override + @ConcurrentMethod + default TOPS countBy(String countColumnName, Collection groupByColumns) { + return countBy(countColumnName, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS firstBy() { + return firstBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS firstBy(String... groupByColumns) { + return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS firstBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.first(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS firstBy(Collection groupByColumns) { + return firstBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS lastBy() { + return lastBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS lastBy(String... groupByColumns) { + return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS lastBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.last(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS lastBy(Collection groupByColumns) { + return lastBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS minBy() { + return minBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS minBy(String... groupByColumns) { + return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS minBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.min(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS minBy(Collection groupByColumns) { + return minBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS maxBy() { + return maxBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS maxBy(String... groupByColumns) { + return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS maxBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.max(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS maxBy(Collection groupByColumns) { + return maxBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS sumBy() { + return sumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS sumBy(String... groupByColumns) { + return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS sumBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.sum(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS sumBy(Collection groupByColumns) { + return sumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS avgBy() { + return avgBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS avgBy(String... groupByColumns) { + return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS avgBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.avg(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS avgBy(Collection groupByColumns) { + return avgBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS medianBy() { + return medianBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS medianBy(String... groupByColumns) { + return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS medianBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.median(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS medianBy(Collection groupByColumns) { + return medianBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS stdBy() { + return stdBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS stdBy(String... groupByColumns) { + return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS stdBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.std(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS stdBy(Collection groupByColumns) { + return stdBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS varBy() { + return varBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS varBy(String... groupByColumns) { + return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS varBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.var(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS varBy(Collection groupByColumns) { + return varBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS absSumBy() { + return absSumBy(ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS absSumBy(String... groupByColumns) { + return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS absSumBy(ColumnName... groupByColumns) { + return aggAllBy(AggSpec.absSum(), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS absSumBy(Collection groupByColumns) { + return absSumBy(ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS wsumBy(String weightColumn) { + return wsumBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS wsumBy(String weightColumn, String... groupByColumns) { + return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS wsumBy(String weightColumn, ColumnName... groupByColumns) { + return aggAllBy(AggSpec.wsum(weightColumn), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS wsumBy(String weightColumn, Collection groupByColumns) { + return wsumBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + @Override + @ConcurrentMethod + default TOPS wavgBy(String weightColumn) { + return wavgBy(weightColumn, ZERO_LENGTH_COLUMNNAME_ARRAY); + } + + @Override + @ConcurrentMethod + default TOPS wavgBy(String weightColumn, String... groupByColumns) { + return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + @Override + @ConcurrentMethod + default TOPS wavgBy(String weightColumn, ColumnName... groupByColumns) { + return aggAllBy(AggSpec.wavg(weightColumn), groupByColumns); + } + + @Override + @ConcurrentMethod + default TOPS wavgBy(String weightColumn, Collection groupByColumns) { + return wavgBy(weightColumn, ColumnName.from(groupByColumns).toArray(ZERO_LENGTH_COLUMNNAME_ARRAY)); + } + + // ------------------------------------------------------------------------------------------- + + static Collection splitToCollection(String string) { + return string.trim().isEmpty() ? Collections.emptyList() + : Arrays.stream(string.split(",")).map(String::trim).filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractExpressionFactory.java b/table-api/src/main/java/io/deephaven/api/expression/AbstractExpressionFactory.java similarity index 90% rename from engine/table/src/main/java/io/deephaven/engine/util/AbstractExpressionFactory.java rename to table-api/src/main/java/io/deephaven/api/expression/AbstractExpressionFactory.java index 41ef2465feb..d7d9a31e838 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractExpressionFactory.java +++ b/table-api/src/main/java/io/deephaven/api/expression/AbstractExpressionFactory.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.util; +package io.deephaven.api.expression; public abstract class AbstractExpressionFactory implements ExpressionFactory { private final String pattern; diff --git a/table-api/src/main/java/io/deephaven/api/expression/AsOfJoinMatchFactory.java b/table-api/src/main/java/io/deephaven/api/expression/AsOfJoinMatchFactory.java new file mode 100644 index 00000000000..60fe547da91 --- /dev/null +++ b/table-api/src/main/java/io/deephaven/api/expression/AsOfJoinMatchFactory.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.api.expression; + +import io.deephaven.api.AsOfJoinRule; +import io.deephaven.api.ColumnName; +import io.deephaven.api.JoinMatch; +import io.deephaven.api.ReverseAsOfJoinRule; + +import java.util.Collection; +import java.util.function.BiFunction; +import java.util.regex.Matcher; + +/** + * {@link JoinMatch} Factory that accepts final value of either =, <=, or <, > >= and returns a JoinMatch[] + * and either an {@link AsOfJoinRule} or a {@link ReverseAsOfJoinRule}. + */ +public class AsOfJoinMatchFactory { + public static class AsOfJoinResult { + public final JoinMatch[] matches; + public final AsOfJoinRule rule; + + private AsOfJoinResult(JoinMatch[] matches, AsOfJoinRule rule) { + this.matches = matches; + this.rule = rule; + } + + private AsOfJoinResult(JoinMatch match, AsOfJoinRule rule) { + this.matches = new JoinMatch[] {match}; + this.rule = rule; + } + } + + public static class ReverseAsOfJoinResult { + public final JoinMatch[] matches; + public final ReverseAsOfJoinRule rule; + + private ReverseAsOfJoinResult(JoinMatch[] matches, ReverseAsOfJoinRule rule) { + this.matches = matches; + this.rule = rule; + } + + private ReverseAsOfJoinResult(JoinMatch match, ReverseAsOfJoinRule rule) { + this.matches = new JoinMatch[] {match}; + this.rule = rule; + } + } + + private static final ExpressionParser asOfJoinParser = new ExpressionParser<>(); + private static final ExpressionParser reverseAsOfJoinParser = new ExpressionParser<>(); + static { + registerEqualFactories(asOfJoinParser, AsOfJoinRule.LESS_THAN_EQUAL, AsOfJoinResult::new); + asOfJoinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")\\s*<=\\s*(" + + SelectFactoryConstants.ID_PTRN + ")" + SelectFactoryConstants.END_PTRN) { + @Override + public AsOfJoinResult getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName firstColumn = ColumnName.of(matcher.group(1)); + final ColumnName secondColumn = ColumnName.of(matcher.group(2)); + return new AsOfJoinResult(JoinMatch.of(firstColumn, secondColumn), AsOfJoinRule.LESS_THAN_EQUAL); + } + }); + asOfJoinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")\\s*<\\s*(" + + SelectFactoryConstants.ID_PTRN + ")" + SelectFactoryConstants.END_PTRN) { + @Override + public AsOfJoinResult getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName firstColumn = ColumnName.of(matcher.group(1)); + final ColumnName secondColumn = ColumnName.of(matcher.group(2)); + return new AsOfJoinResult(JoinMatch.of(firstColumn, secondColumn), AsOfJoinRule.LESS_THAN); + } + }); + + registerEqualFactories(reverseAsOfJoinParser, ReverseAsOfJoinRule.GREATER_THAN_EQUAL, + ReverseAsOfJoinResult::new); + reverseAsOfJoinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")\\s*>=\\s*(" + + SelectFactoryConstants.ID_PTRN + ")" + SelectFactoryConstants.END_PTRN) { + @Override + public ReverseAsOfJoinResult getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName firstColumn = ColumnName.of(matcher.group(1)); + final ColumnName secondColumn = ColumnName.of(matcher.group(2)); + return new ReverseAsOfJoinResult(JoinMatch.of(firstColumn, secondColumn), + ReverseAsOfJoinRule.GREATER_THAN_EQUAL); + } + }); + reverseAsOfJoinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")\\s*>\\s*(" + + SelectFactoryConstants.ID_PTRN + ")" + SelectFactoryConstants.END_PTRN) { + @Override + public ReverseAsOfJoinResult getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName firstColumn = ColumnName.of(matcher.group(1)); + final ColumnName secondColumn = ColumnName.of(matcher.group(2)); + return new ReverseAsOfJoinResult(JoinMatch.of(firstColumn, secondColumn), + ReverseAsOfJoinRule.GREATER_THAN); + } + }); + } + + private static void registerEqualFactories( + ExpressionParser joinParser, R rule, BiFunction factory) { + joinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")" + + SelectFactoryConstants.END_PTRN) { + @Override + public T getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName column = ColumnName.of(matcher.group(1)); + return factory.apply(JoinMatch.of(column, column), rule); + } + }); + joinParser.registerFactory(new AbstractExpressionFactory( + SelectFactoryConstants.START_PTRN + "(" + SelectFactoryConstants.ID_PTRN + ")\\s*==?\\s*(" + + SelectFactoryConstants.ID_PTRN + ")" + SelectFactoryConstants.END_PTRN) { + @Override + public T getExpression(String expression, Matcher matcher, Object... args) { + final ColumnName firstColumn = ColumnName.of(matcher.group(1)); + final ColumnName secondColumn = ColumnName.of(matcher.group(2)); + return factory.apply(JoinMatch.of(firstColumn, secondColumn), rule); + } + }); + } + + public static AsOfJoinResult getAjExpression(String match) { + return asOfJoinParser.parse(match); + } + + public static AsOfJoinResult getAjExpressions(String... matches) { + JoinMatch[] result = new JoinMatch[matches.length]; + for (int ii = 0; ii < matches.length - 1; ++ii) { + result[ii] = JoinMatch.parse(matches[ii]); + } + + final AsOfJoinResult finalColumn = getAjExpression(matches[matches.length - 1]); + result[matches.length - 1] = finalColumn.matches[0]; + + return new AsOfJoinResult(result, finalColumn.rule); + } + + public static AsOfJoinResult getAjExpressions(Collection matches) { + return getAjExpressions(matches.toArray(new String[0])); + } + + public static ReverseAsOfJoinResult getRajExpression(String match) { + return reverseAsOfJoinParser.parse(match); + } + + public static ReverseAsOfJoinResult getRajExpressions(String... matches) { + JoinMatch[] result = new JoinMatch[matches.length]; + for (int ii = 0; ii < matches.length - 1; ++ii) { + result[ii] = JoinMatch.parse(matches[ii]); + } + + final ReverseAsOfJoinResult finalColumn = getRajExpression(matches[matches.length - 1]); + result[matches.length - 1] = finalColumn.matches[0]; + + return new ReverseAsOfJoinResult(result, finalColumn.rule); + } + + public static ReverseAsOfJoinResult getRajExpressions(Collection matches) { + return getRajExpressions(matches.toArray(new String[0])); + } +} diff --git a/engine/api/src/main/java/io/deephaven/engine/exceptions/ExpressionException.java b/table-api/src/main/java/io/deephaven/api/expression/ExpressionException.java similarity index 80% rename from engine/api/src/main/java/io/deephaven/engine/exceptions/ExpressionException.java rename to table-api/src/main/java/io/deephaven/api/expression/ExpressionException.java index 7c7b3fd2502..3142044e8a0 100644 --- a/engine/api/src/main/java/io/deephaven/engine/exceptions/ExpressionException.java +++ b/table-api/src/main/java/io/deephaven/api/expression/ExpressionException.java @@ -1,14 +1,14 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.exceptions; +package io.deephaven.api.expression; /** * An unchecked exception indicating a problem with a parsed expression, for example in - * {@link io.deephaven.engine.table.Table#where(String...)} or - * {@link io.deephaven.engine.table.Table#update(String...)}. + * {@link io.deephaven.api.TableOperations#where(String...)} or + * {@link io.deephaven.api.TableOperations#update(String...)}. */ -public class ExpressionException extends UncheckedTableException { +public class ExpressionException extends RuntimeException { final String problemExpression; diff --git a/engine/table/src/main/java/io/deephaven/engine/util/ExpressionFactory.java b/table-api/src/main/java/io/deephaven/api/expression/ExpressionFactory.java similarity index 87% rename from engine/table/src/main/java/io/deephaven/engine/util/ExpressionFactory.java rename to table-api/src/main/java/io/deephaven/api/expression/ExpressionFactory.java index 21e867795ca..a2557f38c79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/ExpressionFactory.java +++ b/table-api/src/main/java/io/deephaven/api/expression/ExpressionFactory.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.util; +package io.deephaven.api.expression; import java.util.regex.Matcher; diff --git a/engine/table/src/main/java/io/deephaven/engine/util/ExpressionParser.java b/table-api/src/main/java/io/deephaven/api/expression/ExpressionParser.java similarity index 90% rename from engine/table/src/main/java/io/deephaven/engine/util/ExpressionParser.java rename to table-api/src/main/java/io/deephaven/api/expression/ExpressionParser.java index 892f4e76971..78335c7f872 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/ExpressionParser.java +++ b/table-api/src/main/java/io/deephaven/api/expression/ExpressionParser.java @@ -1,10 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.util; - -import io.deephaven.engine.exceptions.ExpressionException; -import org.jetbrains.annotations.NotNull; +package io.deephaven.api.expression; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -18,7 +15,7 @@ * @param The expected type of the parsed expression */ public class ExpressionParser { - private Map> expressions = new LinkedHashMap<>(); + private final Map> expressions = new LinkedHashMap<>(); /** * Attempt to process the expression using the {@link #registerFactory(ExpressionFactory) configured} @@ -29,7 +26,6 @@ public class ExpressionParser { * * @throws ExpressionException if there is a problem parsing the expression, or no parsers accepted the expression. */ - @NotNull public TYPE parse(String expression, Object... args) { Throwable creationException = null; for (Map.Entry> patternExpressionFactoryEntry : expressions.entrySet()) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectFactoryConstants.java b/table-api/src/main/java/io/deephaven/api/expression/SelectFactoryConstants.java similarity index 98% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectFactoryConstants.java rename to table-api/src/main/java/io/deephaven/api/expression/SelectFactoryConstants.java index e93001ed8ff..117324b7016 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectFactoryConstants.java +++ b/table-api/src/main/java/io/deephaven/api/expression/SelectFactoryConstants.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.impl.select; +package io.deephaven.api.expression; /** * A set of constants used to build consistent patterns to process query parameters. diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/ConcurrentMethod.java b/table-api/src/main/java/io/deephaven/api/util/ConcurrentMethod.java similarity index 82% rename from engine/updategraph/src/main/java/io/deephaven/engine/updategraph/ConcurrentMethod.java rename to table-api/src/main/java/io/deephaven/api/util/ConcurrentMethod.java index 3e54bb90496..e22e7a2131f 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/updategraph/ConcurrentMethod.java +++ b/table-api/src/main/java/io/deephaven/api/util/ConcurrentMethod.java @@ -1,12 +1,12 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.updategraph; +package io.deephaven.api.util; import java.lang.annotation.*; /** - * Indicates that the annotated method should be executed concurrently with respect to the {@link UpdateGraphProcessor} + * Indicates that the annotated method should be executed concurrently with respect to the {@code UpdateGraphProcessor} * (UGP). Concurrent execution will not acquire the UGP lock before invocation, and will be run concurrently with other * annotated methods whenever possible. */ From 8f8941bf54414871f6a270bf398481f2972fe77c Mon Sep 17 00:00:00 2001 From: Cristian Ferretti <37232625+jcferretti@users.noreply.github.com> Date: Tue, 23 Aug 2022 13:58:34 -0400 Subject: [PATCH 072/215] Support reading Kafka JSON composite fields as string. Fixes #2751 (#2752) --- .../main/java/io/deephaven/kafka/ingest/JsonNodeUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeUtil.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeUtil.java index 4845aafc729..645f71abfeb 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeUtil.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeUtil.java @@ -545,7 +545,10 @@ public static String getString(@NotNull final JsonNode node, @NotNull final Json */ @Nullable public static String getString(final JsonNode node) { - return isNullOrMissingField(node) ? null : node.asText(); + if (isNullOrMissingField(node)) { + return null; + } + return node.isValueNode() ? node.asText() : node.toString(); } /** From 7b21ff257f225887fd93c12496e7cf4f773071dc Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Tue, 23 Aug 2022 12:34:18 -0700 Subject: [PATCH 073/215] Optimize snapshots for large tables (#2365) --- .../table/impl/remote/ConstructSnapshot.java | 11 +- extensions/barrage/build.gradle | 2 +- .../barrage/BarrageSnapshotOptions.java | 16 +- .../barrage/BarrageSubscriptionOptions.java | 16 +- .../barrage/table/BarrageRedirectedTable.java | 4 +- .../barrage/table/BarrageStreamTable.java | 4 +- .../barrage/table/BarrageTable.java | 43 +++- .../barrage/util/StreamReaderOptions.java | 2 + .../client/examples/SnapshotExampleBase.java | 50 +++- .../client/examples/SubscribeExampleBase.java | 33 +-- .../client/impl/BarrageSnapshotImpl.java | 49 ++-- .../client/impl/BarrageSubscription.java | 68 ++++++ .../client/impl/BarrageSubscriptionImpl.java | 85 +++++-- java-client/flight-examples/build.gradle | 2 +- .../deephaven/client/examples/DoExchange.java | 3 +- .../src/main/resources/dh-defaults.prop | 1 + .../src/main/resources/dh-tests.prop | 9 + proto/package-lock.json | 14 +- proto/package.json | 2 +- proto/proto-backplane-grpc/build.gradle | 4 +- .../server/arrow/ArrowFlightUtil.java | 218 +++++++++++++++--- .../server/arrow/FlightServiceGrpcImpl.java | 61 +---- .../barrage/BarrageMessageProducer.java | 8 +- .../barrage/BarrageStreamGenerator.java | 50 ++-- .../server/uri/BarrageTableResolver.java | 34 +-- .../barrage/BarrageMessageRoundTripTest.java | 3 +- .../barrage/BarrageStreamTableTest.java | 2 +- .../test/FlightMessageRoundTripTest.java | 3 +- .../web/client/api/WorkerConnection.java | 2 +- .../TableViewportSubscription.java | 2 +- .../flatbuf/BarrageSnapshotOptions.java | 7 +- .../flatbuf/BarrageSubscriptionOptions.java | 7 +- .../flatbuf/BarrageUpdateMetadata.java | 16 +- 33 files changed, 610 insertions(+), 221 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java index 27933ddadf4..57fe2ad23e3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java @@ -539,8 +539,8 @@ public static BarrageMessage constructBackplaneSnapshot(final Object logIdentity public static BarrageMessage constructBackplaneSnapshotInPositionSpace(final Object logIdentityObject, final BaseTable table, @Nullable final BitSet columnsToSerialize, - @Nullable final RowSet positionsToSnapshot, - @Nullable final RowSet reversePositionsToSnapshot) { + @Nullable final RowSequence positionsToSnapshot, + @Nullable final RowSequence reversePositionsToSnapshot) { return constructBackplaneSnapshotInPositionSpace(logIdentityObject, table, columnsToSerialize, positionsToSnapshot, reversePositionsToSnapshot, makeSnapshotControl(false, table.isRefreshing(), table)); @@ -553,15 +553,16 @@ public static BarrageMessage constructBackplaneSnapshotInPositionSpace(final Obj * @param logIdentityObject An object used to prepend to log rows. * @param table the table to snapshot. * @param columnsToSerialize A {@link BitSet} of columns to include, null for all - * @param positionsToSnapshot A RowSet of positions within the table to include, null for all + * @param positionsToSnapshot A RowSequence of positions within the table to include, null for all + * @param reversePositionsToSnapshot A RowSequence of reverse positions within the table to include, null for all * @param control A {@link SnapshotControl} to define the parameters and consistency for this snapshot * @return a snapshot of the entire base table. */ public static BarrageMessage constructBackplaneSnapshotInPositionSpace(final Object logIdentityObject, @NotNull final BaseTable table, @Nullable final BitSet columnsToSerialize, - @Nullable final RowSet positionsToSnapshot, - @Nullable final RowSet reversePositionsToSnapshot, + @Nullable final RowSequence positionsToSnapshot, + @Nullable final RowSequence reversePositionsToSnapshot, @NotNull final SnapshotControl control) { final BarrageMessage snapshot = new BarrageMessage(); diff --git a/extensions/barrage/build.gradle b/extensions/barrage/build.gradle index 4ec49b289c9..cc7385612e4 100644 --- a/extensions/barrage/build.gradle +++ b/extensions/barrage/build.gradle @@ -19,7 +19,7 @@ dependencies { api project(':engine-table') implementation project(':proto:proto-backplane-grpc-flight') implementation project(':log-factory') - api 'io.deephaven.barrage:barrage-format:0.4.1' + api 'io.deephaven.barrage:barrage-format:0.5.0' implementation 'org.hdrhistogram:HdrHistogram:2.1.12' Classpaths.inheritFlatbuffer(project, 'implementation') diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSnapshotOptions.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSnapshotOptions.java index 422919c1382..1184ae7aa74 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSnapshotOptions.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSnapshotOptions.java @@ -26,6 +26,7 @@ public static BarrageSnapshotOptions of(final io.deephaven.barrage.flatbuf.Barra .useDeephavenNulls(options.useDeephavenNulls()) .columnConversionMode(ColumnConversionMode.conversionModeFbToEnum(mode)) .batchSize(options.batchSize()) + .maxMessageSize(options.maxMessageSize()) .build(); } @@ -47,11 +48,21 @@ public boolean useDeephavenNulls() { /** * @return the preferred batch size if specified */ + @Override @Default public int batchSize() { return 0; } + /** + * @return the maximum GRPC message size if specified + */ + @Override + @Default + public int maxMessageSize() { + return 0; + } + @Override @Default public ColumnConversionMode columnConversionMode() { @@ -61,7 +72,8 @@ public ColumnConversionMode columnConversionMode() { public int appendTo(FlatBufferBuilder builder) { return io.deephaven.barrage.flatbuf.BarrageSnapshotOptions.createBarrageSnapshotOptions( builder, ColumnConversionMode.conversionModeEnumToFb(columnConversionMode()), useDeephavenNulls(), - batchSize()); + batchSize(), + maxMessageSize()); } public interface Builder { @@ -72,6 +84,8 @@ public interface Builder { Builder batchSize(int batchSize); + Builder maxMessageSize(int messageSize); + BarrageSnapshotOptions build(); } } diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSubscriptionOptions.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSubscriptionOptions.java index 0a021d5b65c..3b04835b952 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSubscriptionOptions.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/BarrageSubscriptionOptions.java @@ -28,6 +28,7 @@ public static BarrageSubscriptionOptions of(final io.deephaven.barrage.flatbuf.B .columnConversionMode(ColumnConversionMode.conversionModeFbToEnum(mode)) .minUpdateIntervalMs(options.minUpdateIntervalMs()) .batchSize(options.batchSize()) + .maxMessageSize(options.maxMessageSize()) .build(); } @@ -72,11 +73,21 @@ public int minUpdateIntervalMs() { /** * @return the preferred batch size if specified */ + @Override @Default public int batchSize() { return 0; } + /** + * @return the preferred maximum GRPC message size if specified + */ + @Override + @Default + public int maxMessageSize() { + return 0; + } + @Override @Default public ColumnConversionMode columnConversionMode() { @@ -87,7 +98,8 @@ public int appendTo(FlatBufferBuilder builder) { return io.deephaven.barrage.flatbuf.BarrageSubscriptionOptions.createBarrageSubscriptionOptions( builder, ColumnConversionMode.conversionModeEnumToFb(columnConversionMode()), useDeephavenNulls(), minUpdateIntervalMs(), - batchSize()); + batchSize(), + maxMessageSize()); } public interface Builder { @@ -100,6 +112,8 @@ public interface Builder { Builder batchSize(int batchSize); + Builder maxMessageSize(int messageSize); + BarrageSubscriptionOptions build(); } } diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java index 263a2d44c8b..c68faeeb3ce 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java @@ -55,8 +55,8 @@ protected BarrageRedirectedTable(final UpdateSourceRegistrar registrar, final WritableColumnSource[] writableSources, final WritableRowRedirection rowRedirection, final Map attributes, - final boolean isViewPort) { - super(registrar, notificationQueue, executorService, columns, writableSources, attributes, isViewPort); + final long initialViewPortRows) { + super(registrar, notificationQueue, executorService, columns, writableSources, attributes, initialViewPortRows); this.rowRedirection = rowRedirection; } diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageStreamTable.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageStreamTable.java index 34300503c3f..d01b06a3e98 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageStreamTable.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageStreamTable.java @@ -47,8 +47,8 @@ protected BarrageStreamTable(final UpdateSourceRegistrar registrar, final LinkedHashMap> columns, final WritableColumnSource[] writableSources, final Map attributes, - final boolean isViewPort) { - super(registrar, notificationQueue, executorService, columns, writableSources, attributes, isViewPort); + final long initialViewPortRows) { + super(registrar, notificationQueue, executorService, columns, writableSources, attributes, initialViewPortRows); } private void processUpdate(final BarrageMessage update) { diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java index 9a855a60985..fb9e4a054ed 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java @@ -10,10 +10,10 @@ import io.deephaven.chunk.ChunkType; import io.deephaven.chunk.util.pools.ChunkPoolConstants; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.rowset.RowSet; -import io.deephaven.engine.rowset.RowSetFactory; +import io.deephaven.engine.rowset.*; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.QueryTable; +import io.deephaven.engine.table.impl.TableUpdateImpl; import io.deephaven.engine.table.impl.perf.PerformanceEntry; import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker; import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; @@ -36,6 +36,7 @@ import io.deephaven.time.DateTime; import io.deephaven.util.annotations.InternalUseOnly; import org.HdrHistogram.Histogram; +import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -99,6 +100,10 @@ public abstract class BarrageTable extends QueryTable implements BarrageMessage. protected boolean serverReverseViewport; protected BitSet serverColumns; + /** the size of the initial viewport requested from the server (-1 implies full subscription) */ + private long initialSnapshotViewportRowCount; + /** have we completed the initial snapshot */ + private boolean initialSnapshotReceived; /** synchronize access to pendingUpdates */ private final Object pendingUpdatesLock = new Object(); @@ -126,7 +131,7 @@ protected BarrageTable(final UpdateSourceRegistrar registrar, final LinkedHashMap> columns, final WritableColumnSource[] writableSources, final Map attributes, - final boolean isViewPort) { + final long initialViewPortRows) { super(RowSetFactory.empty().toTracking(), columns); attributes.entrySet().stream() .filter(e -> !e.getKey().equals(Table.SYSTEMIC_TABLE_ATTRIBUTE)) @@ -146,11 +151,12 @@ protected BarrageTable(final UpdateSourceRegistrar registrar, this.refreshEntry = UpdatePerformanceTracker.getInstance().getEntry( "BarrageTable(" + System.identityHashCode(this) + (stats != null ? ") " + stats.tableKey : ")")); - if (isViewPort) { - serverViewport = RowSetFactory.empty(); - } else { + if (initialViewPortRows == -1) { serverViewport = null; + } else { + serverViewport = RowSetFactory.empty(); } + this.initialSnapshotViewportRowCount = initialViewPortRows; this.destSources = new WritableColumnSource[writableSources.length]; for (int ii = 0; ii < writableSources.length; ++ii) { @@ -203,6 +209,10 @@ public BitSet getServerColumns() { return serverColumns; } + public void setInitialSnapshotViewportRowCount(long rowCount) { + initialSnapshotViewportRowCount = rowCount; + } + /** * Invoke sealTable to prevent further updates from being processed and to mark this source table as static. * @@ -218,6 +228,7 @@ public synchronized void sealTable(final Runnable onSealRunnable, final Runnable sealed = true; this.onSealRunnable = onSealRunnable; this.onSealFailure = onSealFailure; + doWakeup(); } @@ -293,6 +304,13 @@ private synchronized void realRefresh() { } if (sealed) { + // remove all unpopulated rows from viewport snapshots + if (this.serverViewport != null) { + WritableRowSet currentRowSet = getRowSet().writableCast(); + try (final RowSet populated = currentRowSet.subSetForPositions(serverViewport, serverReverseViewport)) { + currentRowSet.retain(populated); + } + } if (onSealRunnable != null) { onSealRunnable.run(); } @@ -343,7 +361,7 @@ private void enqueueError(final Throwable e) { * @param executorService an executor service used to flush stats * @param tableDefinition the table definition * @param attributes Key-Value pairs of attributes to forward to the QueryTable's metadata - * @param isViewPort true if the table will be a viewport. + * @param initialViewPortRows the number of rows in the intial viewport (-1 if the table will be a full sub) * * @return a properly initialized {@link BarrageTable} */ @@ -352,9 +370,9 @@ public static BarrageTable make( @Nullable final ScheduledExecutorService executorService, final TableDefinition tableDefinition, final Map attributes, - final boolean isViewPort) { + final long initialViewPortRows) { return make(UpdateGraphProcessor.DEFAULT, UpdateGraphProcessor.DEFAULT, executorService, tableDefinition, - attributes, isViewPort); + attributes, initialViewPortRows); } @VisibleForTesting @@ -364,7 +382,7 @@ public static BarrageTable make( @Nullable final ScheduledExecutorService executor, final TableDefinition tableDefinition, final Map attributes, - final boolean isViewPort) { + final long initialViewPortRows) { final List> columns = tableDefinition.getColumns(); final WritableColumnSource[] writableSources = new WritableColumnSource[columns.size()]; @@ -374,14 +392,15 @@ public static BarrageTable make( if (isStreamTable instanceof Boolean && (Boolean) isStreamTable) { final LinkedHashMap> finalColumns = makeColumns(columns, writableSources); table = new BarrageStreamTable( - registrar, queue, executor, finalColumns, writableSources, attributes, isViewPort); + registrar, queue, executor, finalColumns, writableSources, attributes, initialViewPortRows); } else { final WritableRowRedirection rowRedirection = new LongColumnSourceWritableRowRedirection(new LongSparseArraySource()); final LinkedHashMap> finalColumns = makeColumns(columns, writableSources, rowRedirection); table = new BarrageRedirectedTable( - registrar, queue, executor, finalColumns, writableSources, rowRedirection, attributes, isViewPort); + registrar, queue, executor, finalColumns, writableSources, rowRedirection, attributes, + initialViewPortRows); } // Even if this source table will eventually be static, the data isn't here already. Static tables need to diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/StreamReaderOptions.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/StreamReaderOptions.java index d061f5ac747..7e9eab410f7 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/StreamReaderOptions.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/StreamReaderOptions.java @@ -11,4 +11,6 @@ public interface StreamReaderOptions { ColumnConversionMode columnConversionMode(); int batchSize(); + + int maxMessageSize(); } diff --git a/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SnapshotExampleBase.java b/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SnapshotExampleBase.java index acffaaf40c5..07d159ada69 100644 --- a/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SnapshotExampleBase.java +++ b/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SnapshotExampleBase.java @@ -8,6 +8,7 @@ import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.util.TableTools; import io.deephaven.extensions.barrage.BarrageSnapshotOptions; +import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; import io.deephaven.extensions.barrage.table.BarrageTable; import io.deephaven.qst.TableCreationLogic; import picocli.CommandLine; @@ -41,18 +42,24 @@ protected void execute(final BarrageSession client) throws Exception { try (final TableHandle handle = manager.executeLogic(logic()); final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting all rows, all columns"); + // expect this to block until all reading complete final BarrageTable table = snapshot.entireTable(); System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #2 - reading all columns, but only subset of rows starting with 0 try (final TableHandle handle = manager.executeLogic(logic()); final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting rows 0-5, all columns"); + // expect this to block until all reading complete final RowSet viewport = RowSetFactory.fromRange(0, 5); // range inclusive final BarrageTable table = snapshot.partialTable(viewport, null); @@ -60,12 +67,16 @@ protected void execute(final BarrageSession client) throws Exception { System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #3 - reading all columns, but only subset of rows starting at >0 try (final TableHandle handle = manager.executeLogic(logic()); final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting rows 6-10, all columns"); + // expect this to block until all reading complete final RowSet viewport = RowSetFactory.fromRange(6, 10); // range inclusive final BarrageTable table = snapshot.partialTable(viewport, null); @@ -73,12 +84,16 @@ protected void execute(final BarrageSession client) throws Exception { System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #4 - reading some columns but all rows try (final TableHandle handle = manager.executeLogic(logic()); final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting all rows, columns 0-1"); + // expect this to block until all reading complete final BitSet columns = new BitSet(); columns.set(0, 2); // range not inclusive (sets bits 0-1) @@ -88,12 +103,16 @@ protected void execute(final BarrageSession client) throws Exception { System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #5 - reading some columns and only some rows try (final TableHandle handle = manager.executeLogic(logic()); final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting rows 100-150, columns 0-1"); + // expect this to block until all reading complete final RowSet viewport = RowSetFactory.fromRange(100, 150); // range inclusive final BitSet columns = new BitSet(); @@ -104,6 +123,8 @@ protected void execute(final BarrageSession client) throws Exception { System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #6 - reverse viewport, all columns @@ -112,20 +133,25 @@ protected void execute(final BarrageSession client) throws Exception { final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting rows from end 0-4, all columns"); + // expect this to block until all reading complete final BarrageTable table = snapshot.partialTable(viewport, null, true); System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); } // example #7 - reverse viewport, some columns try (final TableHandle handle = manager.executeLogic(logic()); final RowSet viewport = RowSetFactory.flat(5); // range inclusive - final BarrageSnapshot snapshot = client.snapshot(handle, options)) { + System.out.println("Requesting rows from end 0-4, columns 0-1"); + final BitSet columns = new BitSet(); columns.set(0, 2); // range not inclusive (sets bits 0-1) @@ -135,6 +161,28 @@ protected void execute(final BarrageSession client) throws Exception { System.out.println("Table info: rows = " + table.size() + ", cols = " + table.numColumns()); TableTools.show(table); + System.out.println(""); + System.out.println(""); + } + + // Example #8 - full snapshot (through BarrageSubscriptionRequest) + // This is an example of the most efficient way to retrieve a consistent snapshot of a Deephaven table. Using + // `snapshotPartialTable()` or `snapshotEntireTable()` will internally create a subscription and retrieve rows + // from the server until a consistent view of the desired rows is established. Then the subscription will be + // terminated and the table returned to the user. + final BarrageSubscriptionOptions subOptions = BarrageSubscriptionOptions.builder().build(); + + try (final TableHandle handle = manager.executeLogic(logic()); + final BarrageSubscription subscription = client.subscribe(handle, subOptions)) { + + System.out.println("Snapshot created"); + + final BarrageTable table = subscription.snapshotEntireTable(); + + System.out.println( + "Table info: rows = " + table.size() + ", cols = " + table.getColumns().length); + TableTools.show(table); + System.out.println(""); } System.out.println("End of Snapshot examples"); diff --git a/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SubscribeExampleBase.java b/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SubscribeExampleBase.java index 9df224eb9f5..1e0ef71af44 100644 --- a/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SubscribeExampleBase.java +++ b/java-client/barrage-examples/src/main/java/io/deephaven/client/examples/SubscribeExampleBase.java @@ -11,6 +11,7 @@ import io.deephaven.engine.table.TableUpdate; import io.deephaven.engine.table.TableUpdateListener; import io.deephaven.engine.table.impl.InstrumentedTableUpdateListener; +import io.deephaven.engine.util.TableTools; import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; import io.deephaven.extensions.barrage.table.BarrageTable; import io.deephaven.qst.TableCreationLogic; @@ -47,31 +48,37 @@ protected void execute(final BarrageSession client) throws Exception { final BarrageSubscriptionOptions options = BarrageSubscriptionOptions.builder().build(); - final TableHandleManager manager = mode == null ? client.session() + final CountDownLatch countDownLatch = new CountDownLatch(1); + final TableHandleManager subscriptionManager = mode == null ? client.session() : mode.batch ? client.session().batch() : client.session().serial(); - try (final TableHandle handle = manager.executeLogic(logic()); + try (final TableHandle handle = subscriptionManager.executeLogic(logic()); final BarrageSubscription subscription = client.subscribe(handle, options)) { - final BarrageTable table; + final BarrageTable subscriptionTable; if (headerSize > 0) { - // create a table subscription with forward viewport of the specified size - table = subscription.partialTable(RowSetFactory.flat(headerSize), null, false); + // create a Table subscription with forward viewport of the specified size + subscriptionTable = subscription.partialTable(RowSetFactory.flat(headerSize), null, false); } else if (tailSize > 0) { - // create a table subscription with reverse viewport of the specified size - table = subscription.partialTable(RowSetFactory.flat(tailSize), null, true); + // create a Table subscription with reverse viewport of the specified size + subscriptionTable = subscription.partialTable(RowSetFactory.flat(tailSize), null, true); } else { - // create a table subscription of the entire table - table = subscription.entireTable(); + // create a Table subscription of the entire Table + subscriptionTable = subscription.entireTable(); } - final CountDownLatch countDownLatch = new CountDownLatch(1); + System.out.println("Subscription established"); + System.out.println("Table info: rows = " + subscriptionTable.size() + ", cols = " + + subscriptionTable.getColumns().length); + TableTools.show(subscriptionTable); + System.out.println(""); - table.listenForUpdates(listener = new InstrumentedTableUpdateListener("example-listener") { + subscriptionTable.listenForUpdates(listener = new InstrumentedTableUpdateListener("example-listener") { @ReferentialIntegrity - final BarrageTable tableRef = table; + final BarrageTable tableRef = subscriptionTable; { - // Maintain a liveness ownership relationship with table for the lifetime of the listener + // Maintain a liveness ownership relationship with subscriptionTable for the lifetime of the + // listener manage(tableRef); } diff --git a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSnapshotImpl.java b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSnapshotImpl.java index 28038e114a1..c1b98dbf4b9 100644 --- a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSnapshotImpl.java +++ b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSnapshotImpl.java @@ -21,6 +21,7 @@ import io.deephaven.extensions.barrage.util.*; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; +import io.deephaven.tablelogger.Row; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Context; @@ -51,9 +52,9 @@ public class BarrageSnapshotImpl extends ReferenceCountedLivenessNode implements private volatile BitSet expectedColumns; - private volatile Condition sealedCondition; - private volatile boolean sealed = false; - private volatile Throwable exceptionWhileSealing = null; + private volatile Condition completedCondition; + private volatile boolean completed = false; + private volatile Throwable exceptionWhileCompleting = null; private volatile boolean connected = true; @@ -78,7 +79,7 @@ public BarrageSnapshotImpl( final BarrageUtil.ConvertedArrowSchema schema = BarrageUtil.convertArrowSchema(tableHandle.response()); final TableDefinition tableDefinition = schema.tableDef; - resultTable = BarrageTable.make(executorService, tableDefinition, schema.attributes, false); + resultTable = BarrageTable.make(executorService, tableDefinition, schema.attributes, -1); resultTable.addParentReference(this); final MethodDescriptor snapshotDescriptor = @@ -105,6 +106,8 @@ public BarrageSnapshotImpl( } private class DoExchangeObserver implements ClientResponseObserver { + private long rowsReceived = 0L; + @Override public void beforeStart(final ClientCallStreamObserver requestStream) { requestStream.disableAutoInboundFlowControl(); @@ -126,8 +129,13 @@ public void onNext(final BarrageMessage barrageMessage) { // override server-supplied data and regenerate flattened rowsets barrageMessage.rowsAdded.close(); barrageMessage.rowsIncluded.close(); - barrageMessage.rowsAdded = RowSetFactory.flat(resultSize); + barrageMessage.rowsAdded = RowSetFactory.fromRange(rowsReceived, rowsReceived + resultSize - 1); barrageMessage.rowsIncluded = barrageMessage.rowsAdded.copy(); + try (final RowSet ignored = barrageMessage.snapshotRowSet) { + barrageMessage.snapshotRowSet = null; + } + + rowsReceived += resultSize; listener.handleBarrageMessage(barrageMessage); } @@ -180,7 +188,7 @@ public synchronized BarrageTable partialTable(RowSet viewport, BitSet columns, b prevUsed = true; if (UpdateGraphProcessor.DEFAULT.exclusiveLock().isHeldByCurrentThread()) { - sealedCondition = UpdateGraphProcessor.DEFAULT.exclusiveLock().newCondition(); + completedCondition = UpdateGraphProcessor.DEFAULT.exclusiveLock().newCondition(); } if (!connected) { @@ -190,26 +198,29 @@ public synchronized BarrageTable partialTable(RowSet viewport, BitSet columns, b // store this for streamreader parser expectedColumns = columns; + // update the viewport size for initial snapshot completion + resultTable.setInitialSnapshotViewportRowCount(viewport == null ? -1 : viewport.size()); + // Send the snapshot request: observer.onNext(FlightData.newBuilder() .setAppMetadata(ByteStringAccess.wrap(makeRequestInternal(viewport, columns, reverseViewport, options))) .build()); - observer.onCompleted(); - - while (!sealed && exceptionWhileSealing == null) { + while (!completed && exceptionWhileCompleting == null) { // handle the condition where this function may have the exclusive lock - if (sealedCondition != null) { - sealedCondition.await(); + if (completedCondition != null) { + completedCondition.await(); } else { wait(); // barragesnapshotimpl lock } } - if (exceptionWhileSealing == null) { + observer.onCompleted(); + + if (exceptionWhileCompleting == null) { return resultTable; } else { - throw new UncheckedDeephavenException("Error while handling snapshot:", exceptionWhileSealing); + throw new UncheckedDeephavenException("Error while handling snapshot:", exceptionWhileCompleting); } } @@ -225,18 +236,18 @@ private void handleDisconnect() { } resultTable.sealTable(() -> { - sealed = true; - if (sealedCondition != null) { - UpdateGraphProcessor.DEFAULT.requestSignal(sealedCondition); + completed = true; + if (completedCondition != null) { + UpdateGraphProcessor.DEFAULT.requestSignal(completedCondition); } else { synchronized (BarrageSnapshotImpl.this) { BarrageSnapshotImpl.this.notifyAll(); } } }, () -> { - exceptionWhileSealing = new Exception(); - if (sealedCondition != null) { - UpdateGraphProcessor.DEFAULT.requestSignal(sealedCondition); + exceptionWhileCompleting = new Exception(); + if (completedCondition != null) { + UpdateGraphProcessor.DEFAULT.requestSignal(completedCondition); } else { synchronized (BarrageSnapshotImpl.this) { BarrageSnapshotImpl.this.notifyAll(); diff --git a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscription.java b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscription.java index a571ce0afc5..88d769a9c7e 100644 --- a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscription.java +++ b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscription.java @@ -45,6 +45,14 @@ BarrageSubscription subscribe(TableSpec tableSpec, BarrageSubscriptionOptions op */ boolean isCompleted(); + /** + * This call will return the number of rows received by the subscription handler. This is the sum of all the + * `rowsIncluded` in the BarrageMessages + * + * @return number of rows received by the subscription handler + */ + long getRowsReceived(); + /** * Request a full subscription of the data and populate a {@link BarrageTable} with the incrementally updating data * that is received. This call will block until all rows for the subscribed table are available. @@ -102,4 +110,64 @@ BarrageSubscription subscribe(TableSpec tableSpec, BarrageSubscriptionOptions op BarrageTable partialTable(RowSet viewport, BitSet columns, boolean reverseViewport, boolean blockUntilComplete) throws InterruptedException; + /** + * Request a full snapshot of the data and populate a {@link BarrageTable} with the incrementally updating data that + * is received. This call will block until all rows for the subscribed table are available. + * + * @return the {@code BarrageTable} + */ + BarrageTable snapshotEntireTable() throws InterruptedException; + + /** + * Request a full snapshot of the data and populate a {@link BarrageTable} with the incrementally updating data that + * is received. + * + * @param blockUntilComplete block execution until all rows for the subscribed table are available + * + * @return the {@code BarrageTable} + */ + BarrageTable snapshotEntireTable(boolean blockUntilComplete) throws InterruptedException; + + /** + * Request a partial snapshot of the data limited by viewport or column set and populate a {@link BarrageTable} with + * the data that is received. This call will block until the subscribed table viewport is satisfied. + * + * @param viewport the position-space viewport to use for the subscription + * @param columns the columns to include in the subscription + * + * @return the {@code BarrageTable} + */ + BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns) throws InterruptedException; + + /** + * Request a partial snapshot of the data limited by viewport or column set and populate a {@link BarrageTable} with + * the data that is received. Allows the viewport to be reversed. This call will block until the subscribed table + * viewport is satisfied. + * + * @param viewport the position-space viewport to use for the subscription + * @param columns the columns to include in the subscription + * @param reverseViewport Whether to treat {@code posRowSet} as offsets from {@link #size()} rather than {@code 0} + * + * @return the {@code BarrageTable} + */ + BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns, boolean reverseViewport) + throws InterruptedException; + + /** + * Request a snapshot of the data limited by viewport or column set and populate a {@link BarrageTable} with the + * data that is received. Allows the viewport to be reversed. + * + * @param viewport the position-space viewport to use for the subscription + * @param columns the columns to include in the subscription + * @param reverseViewport Whether to treat {@code posRowSet} as offsets from {@link #size()} rather than {@code 0} + * @param blockUntilComplete block execution until the subscribed table viewport is satisfied + * + * @return the {@code BarrageTable} + */ + BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns, boolean reverseViewport, + boolean blockUntilComplete) + throws InterruptedException; + + @Override + void close(); } diff --git a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscriptionImpl.java b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscriptionImpl.java index 5d02e9aacbb..7e16306341f 100644 --- a/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscriptionImpl.java +++ b/java-client/barrage/src/main/java/io/deephaven/client/impl/BarrageSubscriptionImpl.java @@ -54,11 +54,13 @@ public class BarrageSubscriptionImpl extends ReferenceCountedLivenessNode implem private volatile Condition completedCondition; private volatile boolean completed = false; + private volatile long rowsReceived = 0L; private volatile Throwable exceptionWhileCompleting = null; private InstrumentedTableUpdateListener listener = null; private boolean subscribed = false; private volatile boolean connected = true; + private boolean isSnapshot = false; /** * Represents a BarrageSubscription. @@ -79,7 +81,7 @@ public BarrageSubscriptionImpl( final BarrageUtil.ConvertedArrowSchema schema = BarrageUtil.convertArrowSchema(tableHandle.response()); final TableDefinition tableDefinition = schema.tableDef; - resultTable = BarrageTable.make(executorService, tableDefinition, schema.attributes, false); + resultTable = BarrageTable.make(executorService, tableDefinition, schema.attributes, -1); resultTable.addParentReference(this); final MethodDescriptor subscribeDescriptor = @@ -121,6 +123,9 @@ public void onNext(final BarrageMessage barrageMessage) { if (!connected || listener == null) { return; } + + rowsReceived += barrageMessage.rowsIncluded.size(); + listener.handleBarrageMessage(barrageMessage); } } @@ -150,6 +155,11 @@ public boolean isCompleted() { return completed; } + @Override + public long getRowsReceived() { + return rowsReceived; + } + @Override public BarrageTable entireTable() throws InterruptedException { return entireTable(true); @@ -192,6 +202,9 @@ public synchronized BarrageTable partialTable(RowSet viewport, BitSet columns, b completedCondition = UpdateGraphProcessor.DEFAULT.exclusiveLock().newCondition(); } + // update the viewport size for initial snapshot completion + resultTable.setInitialSnapshotViewportRowCount(viewport == null ? -1 : viewport.size()); + // Send the initial subscription: observer.onNext(FlightData.newBuilder() .setAppMetadata( @@ -215,23 +228,27 @@ protected void onFailureInternal(final Throwable originalException, final Entry @Override public void onUpdate(final TableUpdate upstream) { + boolean isComplete = false; + // test to see if the viewport matches the requested if (viewport == null && resultTable.getServerViewport() == null) { - completed = true; + isComplete = true; } else if (viewport != null && resultTable.getServerViewport() != null && reverseViewport == resultTable.getServerReverseViewport()) { - completed = viewport.subsetOf(resultTable.getServerViewport()); - } else { - completed = false; + isComplete = viewport.subsetOf(resultTable.getServerViewport()); } - if (completed) { - if (completedCondition != null) { - UpdateGraphProcessor.DEFAULT.requestSignal(completedCondition); + if (isComplete) { + if (isSnapshot) { + resultTable.sealTable(() -> { + // signal that we are closing the connection + observer.onCompleted(); + signalCompletion(); + }, () -> { + exceptionWhileCompleting = new Exception(); + }); } else { - synchronized (BarrageSubscriptionImpl.this) { - BarrageSubscriptionImpl.this.notifyAll(); - } + signalCompletion(); } // no longer need to listen for completion @@ -262,6 +279,45 @@ public void onUpdate(final TableUpdate upstream) { } } + private void signalCompletion() { + completed = true; + if (completedCondition != null) { + UpdateGraphProcessor.DEFAULT.requestSignal(completedCondition); + } else { + synchronized (BarrageSubscriptionImpl.this) { + BarrageSubscriptionImpl.this.notifyAll(); + } + } + } + + @Override + public BarrageTable snapshotEntireTable() throws InterruptedException { + return snapshotEntireTable(true); + } + + @Override + public BarrageTable snapshotEntireTable(boolean blockUntilComplete) throws InterruptedException { + return snapshotPartialTable(null, null, false, blockUntilComplete); + } + + @Override + public BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns) throws InterruptedException { + return snapshotPartialTable(viewport, columns, false, true); + } + + @Override + public BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns, boolean reverseViewport) + throws InterruptedException { + return snapshotPartialTable(viewport, columns, reverseViewport, true); + } + + @Override + public synchronized BarrageTable snapshotPartialTable(RowSet viewport, BitSet columns, boolean reverseViewport, + boolean blockUntilComplete) throws InterruptedException { + isSnapshot = true; + return partialTable(viewport, columns, reverseViewport, blockUntilComplete); + } + @Override protected void destroy() { super.destroy(); @@ -272,7 +328,10 @@ private void handleDisconnect() { if (!connected) { return; } - log.error().append(this).append(": unexpectedly closed by other host").endl(); + // log an error only when doing a true subscription (not snapshot) + if (!isSnapshot) { + log.error().append(this).append(": unexpectedly closed by other host").endl(); + } cleanup(); } @@ -281,7 +340,7 @@ public synchronized void close() { if (!connected) { return; } - observer.onCompleted(); + GrpcUtil.safelyExecute(observer::onCompleted); cleanup(); } diff --git a/java-client/flight-examples/build.gradle b/java-client/flight-examples/build.gradle index 692d0066aba..38a5c974eb4 100644 --- a/java-client/flight-examples/build.gradle +++ b/java-client/flight-examples/build.gradle @@ -7,7 +7,7 @@ dependencies { implementation project(':java-client-flight-dagger') implementation project(':java-client-example-utilities') - implementation "io.deephaven.barrage:barrage-format:0.4.0" + implementation "io.deephaven.barrage:barrage-format:0.5.0" Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) diff --git a/java-client/flight-examples/src/main/java/io/deephaven/client/examples/DoExchange.java b/java-client/flight-examples/src/main/java/io/deephaven/client/examples/DoExchange.java index 228e9126a91..767fe8525cc 100644 --- a/java-client/flight-examples/src/main/java/io/deephaven/client/examples/DoExchange.java +++ b/java-client/flight-examples/src/main/java/io/deephaven/client/examples/DoExchange.java @@ -43,9 +43,10 @@ protected void execute(FlightSession flight) throws Exception { // inner metadata for the snapshot request final FlatBufferBuilder metadata = new FlatBufferBuilder(); + // you can use 0 for batch size and max message size to use server-side defaults int optOffset = BarrageSnapshotOptions.createBarrageSnapshotOptions(metadata, ColumnConversionMode.Stringify, - false, 1000); + false, 0, 0); final int ticOffset = BarrageSnapshotRequest.createTicketVector(metadata, diff --git a/props/configs/src/main/resources/dh-defaults.prop b/props/configs/src/main/resources/dh-defaults.prop index 2dc2704d82f..0b76987dac1 100644 --- a/props/configs/src/main/resources/dh-defaults.prop +++ b/props/configs/src/main/resources/dh-defaults.prop @@ -50,3 +50,4 @@ server.timezone=America/New_York default.processEnvironmentFactory=io.deephaven.util.process.DefaultProcessEnvironment$Factory OperationInitializationThreadPool.threads=1 + diff --git a/props/test-configs/src/main/resources/dh-tests.prop b/props/test-configs/src/main/resources/dh-tests.prop index 945bbe0680d..3001014dc3c 100644 --- a/props/test-configs/src/main/resources/dh-tests.prop +++ b/props/test-configs/src/main/resources/dh-tests.prop @@ -96,3 +96,12 @@ Liveness.cleanupLogEnabled=false # Force more parallelism QueryTable.minimumParallelSelectRows=1024 + +BarrageMessageProducer.subscriptionGrowthEnabled=true +BarrageMessageProducer.targetSnapshotPercentage=0.1 +BarrageMessageProducer.minSnapshotCellCount=50 +BarrageMessageProducer.maxSnapshotCellCount=50 +BarrageStreamGenerator.batchSize=4 + +#BarrageTable.debug=true +#BarrageMessageProducer.debug=true \ No newline at end of file diff --git a/proto/package-lock.json b/proto/package-lock.json index e242d5e9e0a..a3252d5ddfd 100644 --- a/proto/package-lock.json +++ b/proto/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@deephaven/barrage": "0.4.0", + "@deephaven/barrage": "0.5.0", "@improbable-eng/grpc-web": "^0.14.0", "apache-arrow": "7.0.0", "flatbuffers": "1.12.0", @@ -22,9 +22,9 @@ } }, "node_modules/@deephaven/barrage": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@deephaven/barrage/-/barrage-0.4.0.tgz", - "integrity": "sha512-RzlIdEiJzf6hbIq/20UBt07Ohu1cnJicyUygabbO+U1KqJ07M7FU9nm0g0bJNYmI9g1FuJ3lLJPDbHEQ5gcVZg==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@deephaven/barrage/-/barrage-0.5.0.tgz", + "integrity": "sha512-vJOMBvav0rbvr1zvQ8vgrGBwupYVLHhZXTJJz42e5KmXmum0WxHvAZCsyY9dCuT/PUJ6/KsJdqx5oDoyMgZKHQ==", "dependencies": { "flatbuffers": "^1.12.0" }, @@ -1940,9 +1940,9 @@ }, "dependencies": { "@deephaven/barrage": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@deephaven/barrage/-/barrage-0.4.0.tgz", - "integrity": "sha512-RzlIdEiJzf6hbIq/20UBt07Ohu1cnJicyUygabbO+U1KqJ07M7FU9nm0g0bJNYmI9g1FuJ3lLJPDbHEQ5gcVZg==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@deephaven/barrage/-/barrage-0.5.0.tgz", + "integrity": "sha512-vJOMBvav0rbvr1zvQ8vgrGBwupYVLHhZXTJJz42e5KmXmum0WxHvAZCsyY9dCuT/PUJ6/KsJdqx5oDoyMgZKHQ==", "requires": { "flatbuffers": "^1.12.0" } diff --git a/proto/package.json b/proto/package.json index ffa20867187..d692205c2f2 100644 --- a/proto/package.json +++ b/proto/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@deephaven/barrage": "0.4.0", + "@deephaven/barrage": "0.5.0", "@improbable-eng/grpc-web": "^0.14.0", "apache-arrow": "7.0.0", "flatbuffers": "1.12.0", diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index ed87e89e1fc..769bd169b1b 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -44,8 +44,8 @@ dependencies { // technically we should have a runtime dependency on barrage-core, but instead we are regenerating // the same output that it contains, and we have declared the correct dependencies as necessary - // compile 'io.deephaven.barrage:barrage-core:0.4.0' - download 'io.deephaven.barrage:barrage-core:0.4.0' + // compile 'io.deephaven.barrage:barrage-core:0.5.0' + download 'io.deephaven.barrage:barrage-core:0.5.0' Classpaths.inheritArrow(project, 'flight-core', 'download') } diff --git a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java index 9cf6ce230a7..2ef650569d5 100644 --- a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java +++ b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java @@ -17,14 +17,13 @@ import io.deephaven.chunk.ChunkType; import io.deephaven.configuration.Configuration; import io.deephaven.engine.liveness.SingletonLivenessManager; -import io.deephaven.engine.rowset.RowSet; -import io.deephaven.engine.rowset.RowSetFactory; -import io.deephaven.engine.rowset.RowSetShiftData; +import io.deephaven.engine.rowset.*; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.BaseTable; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.remote.ConstructSnapshot; import io.deephaven.engine.table.impl.util.BarrageMessage; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.extensions.barrage.BarragePerformanceLog; import io.deephaven.extensions.barrage.BarrageSnapshotOptions; import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; @@ -60,6 +59,9 @@ import java.util.concurrent.ScheduledExecutorService; import static io.deephaven.extensions.barrage.util.BarrageProtoUtil.DEFAULT_SER_OPTIONS; +import static io.deephaven.server.arrow.FlightServiceGrpcImpl.DEFAULT_SNAPSHOT_DESER_OPTIONS; +import static io.deephaven.server.barrage.BarrageMessageProducer.*; +import static io.deephaven.server.barrage.BarrageMessageProducer.TARGET_SNAPSHOT_PERCENTAGE; public class ArrowFlightUtil { private static final Logger log = LoggerFactory.getLogger(ArrowFlightUtil.class); @@ -69,6 +71,185 @@ public class ArrowFlightUtil { static final BarrageMessage.ModColumnData[] ZERO_MOD_COLUMNS = new BarrageMessage.ModColumnData[0]; + public static void DoGetCustom(@Nullable final ScheduledExecutorService executorService, + final SessionState session, + final TicketRouter ticketRouter, + final Flight.Ticket request, + final StreamObserver observer) { + + final SessionState.ExportObject export = + ticketRouter.resolve(session, request, "request"); + + final BarragePerformanceLog.SnapshotMetricsHelper metrics = + new BarragePerformanceLog.SnapshotMetricsHelper(); + + final long queueStartTm = System.nanoTime(); + session.nonExport() + .require(export) + .onError(observer) + .submit(() -> { + metrics.queueNanos = System.nanoTime() - queueStartTm; + final BaseTable table = export.get(); + metrics.tableId = Integer.toHexString(System.identityHashCode(table)); + metrics.tableKey = BarragePerformanceLog.getKeyFor(table); + + // create an adapter for the response observer + final StreamObserver listener = + ArrowModule.provideListenerAdapter().adapt(observer); + + // Send Schema wrapped in Message + final FlatBufferBuilder builder = new FlatBufferBuilder(); + final int schemaOffset = BarrageUtil.makeSchemaPayload(builder, table.getDefinition(), + table.getAttributes()); + builder.finish(MessageHelper.wrapInMessage(builder, schemaOffset, + org.apache.arrow.flatbuf.MessageHeader.Schema)); + final ByteBuffer serializedMessage = builder.dataBuffer(); + + // leverage the stream generator SchemaView constructor + final BarrageStreamGenerator.SchemaView schemaView = + new BarrageStreamGenerator.SchemaView(serializedMessage); + + // push the schema to the listener + listener.onNext(schemaView); + + // shared code between `DoGet` and `BarrageSnapshotRequest` + createAndSendSnapshot(table, null, null, false, DEFAULT_SNAPSHOT_DESER_OPTIONS, listener, metrics); + + listener.onCompleted(); + }); + } + + + private static void createAndSendStaticSnapshot(BaseTable table, BitSet columns, RowSet viewport, + boolean reverseViewport, BarrageSnapshotOptions snapshotRequestOptions, + StreamObserver listener, BarragePerformanceLog.SnapshotMetricsHelper metrics) { + // start with small value and grow + long snapshotTargetCellCount = MIN_SNAPSHOT_CELL_COUNT; + double snapshotNanosPerCell = 0.0; + + final long columnCount = + Math.max(1, columns != null ? columns.cardinality() : table.getDefinition().getColumns().size()); + + try (final WritableRowSet snapshotViewport = RowSetFactory.empty(); + final WritableRowSet targetViewport = RowSetFactory.empty()) { + // compute the target viewport + if (viewport == null) { + targetViewport.insertRange(0, table.size() - 1); + } else if (!reverseViewport) { + targetViewport.insert(viewport); + } else { + // compute the forward version of the reverse viewport + try (final RowSet rowKeys = table.getRowSet().subSetForReversePositions(viewport); + final RowSet inverted = table.getRowSet().invert(rowKeys)) { + targetViewport.insert(inverted); + } + } + + try (final RowSequence.Iterator rsIt = targetViewport.getRowSequenceIterator()) { + while (rsIt.hasMore()) { + // compute the next range to snapshot + final long cellCount = + Math.max(MIN_SNAPSHOT_CELL_COUNT, + Math.min(snapshotTargetCellCount, MAX_SNAPSHOT_CELL_COUNT)); + + final RowSequence snapshotPartialViewport = rsIt.getNextRowSequenceWithLength(cellCount); + // add these ranges to the running total + snapshotPartialViewport.forEachRowKeyRange((start, end) -> { + snapshotViewport.insertRange(start, end); + return true; + }); + + // grab the snapshot and measure elapsed time for next projections + long start = System.nanoTime(); + final BarrageMessage msg = + ConstructSnapshot.constructBackplaneSnapshotInPositionSpace(log, table, + columns, snapshotPartialViewport, null); + msg.modColumnData = ZERO_MOD_COLUMNS; // no mod column data for DoGet + long elapsed = System.nanoTime() - start; + // accumulate snapshot time in the metrics + metrics.snapshotNanos += elapsed; + + // send out the data. Note that although a `BarrageUpdateMetaData` object will + // be provided with each unique snapshot, vanilla Flight clients will ignore + // these and see only an incoming stream of batches + try (final BarrageStreamGenerator bsg = new BarrageStreamGenerator(msg, metrics)) { + if (rsIt.hasMore()) { + listener.onNext(bsg.getSnapshotView(snapshotRequestOptions, + snapshotViewport, false, + msg.rowsIncluded, columns)); + } else { + listener.onNext(bsg.getSnapshotView(snapshotRequestOptions, + viewport, reverseViewport, + msg.rowsIncluded, columns)); + } + } + + if (msg.rowsIncluded.size() > 0) { + // very simplistic logic to take the last snapshot and extrapolate max + // number of rows that will not exceed the target UGP processing time + // percentage + long targetNanos = (long) (TARGET_SNAPSHOT_PERCENTAGE + * UpdateGraphProcessor.DEFAULT.getTargetCycleDurationMillis() + * 1000000); + + long nanosPerCell = elapsed / (msg.rowsIncluded.size() * columnCount); + + // apply an exponential moving average to filter the data + if (snapshotNanosPerCell == 0) { + snapshotNanosPerCell = nanosPerCell; // initialize to first value + } else { + // EMA smoothing factor is 0.1 (N = 10) + snapshotNanosPerCell = + (snapshotNanosPerCell * 0.9) + (nanosPerCell * 0.1); + } + + snapshotTargetCellCount = + (long) (targetNanos / Math.max(1, snapshotNanosPerCell)); + } + } + } + } + } + + private static void createAndSendSnapshot(BaseTable table, BitSet columns, RowSet viewport, boolean reverseViewport, + BarrageSnapshotOptions snapshotRequestOptions, StreamObserver listener, + BarragePerformanceLog.SnapshotMetricsHelper metrics) { + + // if the table is static and a full snapshot is requested, we can make and send multiple + // snapshots to save memory and operate more efficiently + if (!table.isRefreshing()) { + createAndSendStaticSnapshot(table, columns, viewport, reverseViewport, snapshotRequestOptions, listener, + metrics); + return; + } + + // otherwise snapshot the entire request and send to the client + final BarrageMessage msg; + + final long snapshotStartTm = System.nanoTime(); + if (reverseViewport) { + msg = ConstructSnapshot.constructBackplaneSnapshotInPositionSpace(log, table, + columns, null, viewport); + } else { + msg = ConstructSnapshot.constructBackplaneSnapshotInPositionSpace(log, table, + columns, viewport, null); + } + metrics.snapshotNanos = System.nanoTime() - snapshotStartTm; + + msg.modColumnData = ZERO_MOD_COLUMNS; // no mod column data + + // translate the viewport to keyspace and make the call + try (final BarrageStreamGenerator bsg = new BarrageStreamGenerator(msg, metrics); + final RowSet keySpaceViewport = + viewport != null + ? msg.rowsAdded.subSetForPositions(viewport, reverseViewport) + : null) { + listener.onNext( + bsg.getSnapshotView(snapshotRequestOptions, viewport, + reverseViewport, keySpaceViewport, columns)); + } + } + /** * This is a stateful observer; a DoPut stream begins with its schema. */ @@ -276,7 +457,7 @@ private void parseSchema(final Schema header) { } final BarrageUtil.ConvertedArrowSchema result = BarrageUtil.convertArrowSchema(header); - resultTable = BarrageTable.make(executorService, result.tableDef, result.attributes, false); + resultTable = BarrageTable.make(executorService, result.tableDef, result.attributes, -1); columnConversionFactors = result.conversionFactors; columnChunkTypes = resultTable.getWireChunkTypes(); columnTypes = resultTable.getWireTypes(); @@ -532,29 +713,9 @@ public void handleMessage(BarrageProtoUtil.MessageInfo message) { final boolean reverseViewport = snapshotRequest.reverseViewport(); - // get ourselves some data (reversing viewport as instructed) - final long snapshotStartTm = System.nanoTime(); - final BarrageMessage msg; - if (reverseViewport) { - msg = ConstructSnapshot.constructBackplaneSnapshotInPositionSpace(this, table, - columns, null, viewport); - } else { - msg = ConstructSnapshot.constructBackplaneSnapshotInPositionSpace(this, table, - columns, viewport, null); - } - metrics.snapshotNanos = System.nanoTime() - snapshotStartTm; - msg.modColumnData = ZERO_MOD_COLUMNS; // no mod column data - - // translate the viewport to keyspace and make the call - try (final BarrageStreamGenerator bsg = new BarrageStreamGenerator(msg, metrics); - final RowSet keySpaceViewport = - hasViewport - ? msg.rowsAdded.subSetForPositions(viewport, reverseViewport) - : null) { - listener.onNext( - bsg.getSnapshotView(snapshotOptAdapter.adapt(snapshotRequest), viewport, - reverseViewport, keySpaceViewport, columns)); - } + // leverage common code for `DoGet` and `BarrageSnapshotOptions` + createAndSendSnapshot(table, columns, viewport, reverseViewport, + snapshotOptAdapter.adapt(snapshotRequest), listener, metrics); listener.onCompleted(); }); @@ -719,6 +880,8 @@ public synchronized void close() { if (bmp != null) { bmp.removeSubscription(listener); bmp = null; + } else { + GrpcUtil.safelyExecuteLocked(listener, listener::onCompleted); } if (preExportSubscriptions != null) { @@ -726,6 +889,5 @@ public synchronized void close() { } } } - } } diff --git a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java index bf5aca994fb..b901a1a1df6 100644 --- a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java @@ -3,20 +3,16 @@ */ package io.deephaven.server.arrow; -import com.google.flatbuffers.FlatBufferBuilder; import com.google.rpc.Code; import io.deephaven.engine.table.impl.BaseTable; import io.deephaven.engine.table.impl.remote.ConstructSnapshot; import io.deephaven.engine.table.impl.util.BarrageMessage; import io.deephaven.extensions.barrage.BarragePerformanceLog; import io.deephaven.extensions.barrage.BarrageSnapshotOptions; -import io.deephaven.extensions.barrage.util.BarrageUtil; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.proto.backplane.grpc.ExportNotification; -import io.deephaven.proto.flight.util.MessageHelper; -import io.deephaven.server.barrage.BarrageStreamGenerator; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; import io.deephaven.server.session.TicketRouter; @@ -28,11 +24,8 @@ import javax.inject.Inject; import javax.inject.Singleton; import java.io.InputStream; -import java.nio.ByteBuffer; import java.util.concurrent.ScheduledExecutorService; -import static io.deephaven.server.arrow.ArrowFlightUtil.ZERO_MOD_COLUMNS; - @Singleton public class FlightServiceGrpcImpl extends FlightServiceGrpc.FlightServiceImplBase { static final BarrageSnapshotOptions DEFAULT_SNAPSHOT_DESER_OPTIONS = @@ -148,57 +141,9 @@ public void getSchema(final Flight.FlightDescriptor request, } public void doGetCustom(final Flight.Ticket request, final StreamObserver responseObserver) { - GrpcUtil.rpcWrapper(log, responseObserver, () -> { - final SessionState session = sessionService.getCurrentSession(); - final SessionState.ExportObject export = - ticketRouter.resolve(session, request, "request"); - - final long queueStartTm = System.nanoTime(); - final BarragePerformanceLog.SnapshotMetricsHelper metrics = - new BarragePerformanceLog.SnapshotMetricsHelper(); - - session.nonExport() - .require(export) - .onError(responseObserver) - .submit(() -> { - metrics.queueNanos = System.nanoTime() - queueStartTm; - final BaseTable table = export.get(); - metrics.tableId = Integer.toHexString(System.identityHashCode(table)); - metrics.tableKey = BarragePerformanceLog.getKeyFor(table); - - // create an adapter for the response observer - final StreamObserver listener = - ArrowModule.provideListenerAdapter().adapt(responseObserver); - - // Send Schema wrapped in Message - final FlatBufferBuilder builder = new FlatBufferBuilder(); - final int schemaOffset = BarrageUtil.makeSchemaPayload(builder, table.getDefinition(), - table.getAttributes()); - builder.finish(MessageHelper.wrapInMessage(builder, schemaOffset, - org.apache.arrow.flatbuf.MessageHeader.Schema)); - final ByteBuffer serializedMessage = builder.dataBuffer(); - - // leverage the stream generator SchemaView constructor - final BarrageStreamGenerator.SchemaView schemaView = - new BarrageStreamGenerator.SchemaView(serializedMessage); - - // push the schema to the listener - listener.onNext(schemaView); - - // get ourselves some data! - final long snapshotStartTm = System.nanoTime(); - final BarrageMessage msg = ConstructSnapshot.constructBackplaneSnapshot(this, table); - msg.modColumnData = ZERO_MOD_COLUMNS; // actually no mod column data for DoGet - metrics.snapshotNanos = System.nanoTime() - snapshotStartTm; - - // translate the viewport to keyspace and make the call - try (final BarrageStreamGenerator bsg = new BarrageStreamGenerator(msg, metrics)) { - listener.onNext(bsg.getSnapshotView(DEFAULT_SNAPSHOT_DESER_OPTIONS)); - } - - listener.onCompleted(); - }); - }); + GrpcUtil.rpcWrapper(log, responseObserver, + () -> ArrowFlightUtil.DoGetCustom(executorService, sessionService.getCurrentSession(), + ticketRouter, request, responseObserver)); } /** diff --git a/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java b/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java index 4641efa48b1..27b622bae9a 100644 --- a/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java +++ b/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java @@ -92,18 +92,18 @@ public class BarrageMessageProducer extends LivenessArtifact private static final Logger log = LoggerFactory.getLogger(BarrageMessageProducer.class); - private static final boolean SUBSCRIPTION_GROWTH_ENABLED = + public static final boolean SUBSCRIPTION_GROWTH_ENABLED = Configuration.getInstance().getBooleanForClassWithDefault(BarrageMessageProducer.class, "subscriptionGrowthEnabled", false); - private static final double TARGET_SNAPSHOT_PERCENTAGE = + public static final double TARGET_SNAPSHOT_PERCENTAGE = Configuration.getInstance().getDoubleForClassWithDefault(BarrageMessageProducer.class, "targetSnapshotPercentage", 0.25); - private static final long MIN_SNAPSHOT_CELL_COUNT = + public static final long MIN_SNAPSHOT_CELL_COUNT = Configuration.getInstance().getLongForClassWithDefault(BarrageMessageProducer.class, "minSnapshotCellCount", 50000); - private static final long MAX_SNAPSHOT_CELL_COUNT = + public static final long MAX_SNAPSHOT_CELL_COUNT = Configuration.getInstance().getLongForClassWithDefault(BarrageMessageProducer.class, "maxSnapshotCellCount", Long.MAX_VALUE); diff --git a/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java b/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java index 79c09ba356b..2de5ca76aab 100644 --- a/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java +++ b/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java @@ -85,6 +85,8 @@ public interface View { StreamReaderOptions options(); + int clientMaxMessageSize(); + RowSet addRowOffsets(); RowSet modRowOffsets(int col); @@ -339,7 +341,7 @@ public SubView(final BarrageStreamGenerator generator, } else if (!generator.rowsAdded.original.equals(generator.rowsIncluded.original)) { // there are scoped rows included in the chunks that need to be removed addRowKeys = generator.rowsAdded.original.copy(); - addRowOffsets = generator.rowsIncluded.original.invert(generator.rowsAdded.original); + addRowOffsets = generator.rowsIncluded.original.invert(addRowKeys); } else { addRowKeys = generator.rowsAdded.original.copy(); addRowOffsets = RowSetFactory.flat(generator.rowsAdded.original.size()); @@ -396,6 +398,11 @@ private int batchSize() { return batchSize; } + @Override + public int clientMaxMessageSize() { + return options.maxMessageSize(); + } + @Override public boolean isViewport() { return viewport != null; @@ -455,6 +462,7 @@ public static class SnapshotView implements View { public final RowSet keyspaceViewport; public final BitSet subscribedColumns; public final long numAddRows; + public final RowSet addRowKeys; public final RowSet addRowOffsets; public SnapshotView(final BarrageStreamGenerator generator, @@ -473,14 +481,13 @@ public SnapshotView(final BarrageStreamGenerator generator, // precompute add row offsets if (keyspaceViewport != null) { - try (WritableRowSet intersect = keyspaceViewport.intersect(generator.rowsIncluded.original)) { - addRowOffsets = generator.rowsIncluded.original.invert(intersect); - } + addRowKeys = keyspaceViewport.intersect(generator.rowsIncluded.original); + addRowOffsets = generator.rowsIncluded.original.invert(addRowKeys); } else { - addRowOffsets = RowSetFactory.flat(generator.rowsAdded.original.size()); + addRowKeys = generator.rowsAdded.original.copy(); + addRowOffsets = RowSetFactory.flat(addRowKeys.size()); } - // require a batch to at least send the metadata numAddRows = addRowOffsets.size(); } @@ -503,6 +510,7 @@ public void forEachStream(Consumer visitor) throws IOException { bytesWritten); } addRowOffsets.close(); + addRowKeys.close(); generator.writeConsumer.onWrite(bytesWritten.longValue(), System.nanoTime() - startTm); } @@ -514,6 +522,11 @@ private int batchSize() { return batchSize; } + @Override + public int clientMaxMessageSize() { + return options.maxMessageSize(); + } + @Override public boolean isViewport() { return viewport != null; @@ -560,6 +573,11 @@ public StreamReaderOptions options() { return null; } + @Override + public int clientMaxMessageSize() { + return 0; + } + @Override public RowSet addRowOffsets() { return null; @@ -720,6 +738,10 @@ private void processBatches(Consumer visitor, final View view, int batchSize = DEFAULT_INITIAL_BATCH_SIZE; + // allow the client to override the default message size + final int maxMessageSize = + view.clientMaxMessageSize() > 0 ? view.clientMaxMessageSize() : DEFAULT_MESSAGE_SIZE_LIMIT; + // TODO: remove this when JS API can accept multiple batches boolean sendAllowed = numRows <= batchSize; @@ -731,7 +753,7 @@ private void processBatches(Consumer visitor, final View view, // treat this as a hard limit, exceeding fails a client or w2w (unless we are sending a single // row then we must send and let it potentially fail) - if (sendAllowed && (bytesToWrite < DEFAULT_MESSAGE_SIZE_LIMIT || batchSize == 1)) { + if (sendAllowed && (bytesToWrite < maxMessageSize || batchSize == 1)) { // let's write the data visitor.accept(is); @@ -747,7 +769,7 @@ private void processBatches(Consumer visitor, final View view, // recompute the batch limit for the next message int bytesPerRow = bytesToWrite / actualBatchSize.intValue(); if (bytesPerRow > 0) { - int rowLimit = DEFAULT_MESSAGE_SIZE_LIMIT / bytesPerRow; + int rowLimit = maxMessageSize / bytesPerRow; // add some margin for abnormal cell contents batchSize = Math.min(maxBatchSize, Math.max(1, (int) ((double) rowLimit * 0.9))); @@ -928,10 +950,6 @@ private ByteBuffer getSubscriptionMetadata(final SubView view) throws IOExceptio final int nodesOffset = metadata.endVector(); BarrageUpdateMetadata.startBarrageUpdateMetadata(metadata); - BarrageUpdateMetadata.addNumAddBatches(metadata, LongSizedDataStructure.intSize("BarrageStreamGenerator", - (view.numAddRows + view.batchSize() - 1) / view.batchSize())); - BarrageUpdateMetadata.addNumModBatches(metadata, LongSizedDataStructure.intSize("BarrageStreamGenerator", - (view.numModRows + view.batchSize() - 1) / view.batchSize())); BarrageUpdateMetadata.addIsSnapshot(metadata, isSnapshot); BarrageUpdateMetadata.addFirstSeq(metadata, firstSeq); BarrageUpdateMetadata.addLastSeq(metadata, lastSeq); @@ -978,14 +996,12 @@ private ByteBuffer getSnapshotMetadata(final SnapshotView view) throws IOExcepti // Added Chunk Data: int addedRowsIncludedOffset = 0; - if (view.isViewport()) { - addedRowsIncludedOffset = rowsIncluded.addToFlatBuffer(view.keyspaceViewport, metadata); + // don't send `rowsIncluded` when identical to `rowsAdded`, client will infer they are the same + if (isSnapshot || !view.addRowKeys.equals(rowsAdded.original)) { + addedRowsIncludedOffset = rowsIncluded.addToFlatBuffer(view.addRowKeys, metadata); } BarrageUpdateMetadata.startBarrageUpdateMetadata(metadata); - BarrageUpdateMetadata.addNumAddBatches(metadata, LongSizedDataStructure.intSize("BarrageStreamGenerator", - (view.numAddRows + view.batchSize() - 1) / view.batchSize())); - BarrageUpdateMetadata.addNumModBatches(metadata, 0); BarrageUpdateMetadata.addIsSnapshot(metadata, isSnapshot); BarrageUpdateMetadata.addFirstSeq(metadata, firstSeq); BarrageUpdateMetadata.addLastSeq(metadata, lastSeq); diff --git a/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java b/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java index 9f698c5ada5..76e9f0a13c9 100644 --- a/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java +++ b/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java @@ -190,8 +190,13 @@ public Table subscribe(DeephavenTarget target, TableSpec table, BarrageSubscript return sub.partialTable(viewport, columns, reverseViewport); } + /// NOTE: the following snapshot functions use the `BarrageSubscription` snapshot functions which leverage + /// `BarrageSubscriptionRequest` and row deltas to remain consistent while the snapshot is being created. + /// This is the most efficient way (for both server and client) to collect a consistent snapshot of a refreshing + /// table. + /** - * Create a full snapshot of the remote URI. Uses {@link #SNAP_OPTIONS}. + * Create a full snapshot of the remote URI. Uses {@link #SUB_OPTIONS}. * * @param remoteUri the remote URI * @return the table to snapshot @@ -199,18 +204,18 @@ public Table subscribe(DeephavenTarget target, TableSpec table, BarrageSubscript public Table snapshot(RemoteUri remoteUri) throws InterruptedException, TableHandleException { final DeephavenTarget target = remoteUri.target(); final TableSpec table = RemoteResolver.of(remoteUri); - return snapshot(target, table, SNAP_OPTIONS); + return snapshot(target, table, SUB_OPTIONS); } /** - * Create a full snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SNAP_OPTIONS}. + * Create a full snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SUB_OPTIONS}. * * @param targetUri the target URI * @param table the table spec * @return the table to snapshot */ public Table snapshot(String targetUri, TableSpec table) throws TableHandleException, InterruptedException { - return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SNAP_OPTIONS); + return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SUB_OPTIONS); } /** @@ -221,16 +226,16 @@ public Table snapshot(String targetUri, TableSpec table) throws TableHandleExcep * @param options the options * @return the table to snapshot */ - public Table snapshot(DeephavenTarget target, TableSpec table, BarrageSnapshotOptions options) + public Table snapshot(DeephavenTarget target, TableSpec table, BarrageSubscriptionOptions options) throws TableHandleException, InterruptedException { final BarrageSession session = session(target); - try (final BarrageSnapshot snap = session.snapshot(table, options)) { - return snap.entireTable(); + try (final BarrageSubscription sub = session.subscribe(table, options)) { + return sub.snapshotEntireTable(); } } /** - * Create a partial table snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SNAP_OPTIONS}. + * Create a partial table snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SUB_OPTIONS}. * * @param targetUri the target URI * @param table the table spec @@ -240,11 +245,11 @@ public Table snapshot(DeephavenTarget target, TableSpec table, BarrageSnapshotOp */ public Table snapshot(String targetUri, TableSpec table, RowSet viewport, BitSet columns) throws TableHandleException, InterruptedException { - return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SNAP_OPTIONS, viewport, columns, false); + return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SUB_OPTIONS, viewport, columns, false); } /** - * Create a partial table snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SNAP_OPTIONS}. + * Create a partial table snapshot to the {@code table} via the {@code targetUri}. Uses {@link #SUB_OPTIONS}. * * @param targetUri the target URI * @param table the table spec @@ -255,7 +260,7 @@ public Table snapshot(String targetUri, TableSpec table, RowSet viewport, BitSet */ public Table snapshot(String targetUri, TableSpec table, RowSet viewport, BitSet columns, boolean reverseViewport) throws TableHandleException, InterruptedException { - return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SNAP_OPTIONS, viewport, columns, + return snapshot(DeephavenTarget.of(URI.create(targetUri)), table, SUB_OPTIONS, viewport, columns, reverseViewport); } @@ -270,16 +275,15 @@ public Table snapshot(String targetUri, TableSpec table, RowSet viewport, BitSet * @param reverseViewport Whether to treat {@code viewport} as offsets from {@link #size()} rather than {@code 0} * @return the table to snapshot */ - public Table snapshot(DeephavenTarget target, TableSpec table, BarrageSnapshotOptions options, RowSet viewport, + public Table snapshot(DeephavenTarget target, TableSpec table, BarrageSubscriptionOptions options, RowSet viewport, BitSet columns, boolean reverseViewport) throws TableHandleException, InterruptedException { final BarrageSession session = session(target); - try (final BarrageSnapshot snap = session.snapshot(table, options)) { - return snap.partialTable(viewport, columns, reverseViewport); + try (final BarrageSubscription sub = session.subscribe(table, options)) { + return sub.snapshotPartialTable(viewport, columns, reverseViewport); } } - private BarrageSession session(DeephavenTarget target) { // TODO (deephaven-core#1482): BarrageTableResolver cleanup return sessions.computeIfAbsent(target, this::newSession); diff --git a/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java b/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java index 1223387f54c..26e09215fb8 100644 --- a/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java +++ b/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java @@ -189,7 +189,8 @@ private class RemoteClient { this.barrageMessageProducer = barrageMessageProducer; this.barrageTable = BarrageTable.make(updateSourceCombiner, UpdateGraphProcessor.DEFAULT, - null, barrageMessageProducer.getTableDefinition(), new HashMap<>(), viewport != null); + null, barrageMessageProducer.getTableDefinition(), new HashMap<>(), + viewport == null ? -1 : viewport.size()); final BarrageSubscriptionOptions options = BarrageSubscriptionOptions.builder() .useDeephavenNulls(useDeephavenNulls) diff --git a/server/src/test/java/io/deephaven/server/barrage/BarrageStreamTableTest.java b/server/src/test/java/io/deephaven/server/barrage/BarrageStreamTableTest.java index 281dfcfc906..788bb2a82bc 100644 --- a/server/src/test/java/io/deephaven/server/barrage/BarrageStreamTableTest.java +++ b/server/src/test/java/io/deephaven/server/barrage/BarrageStreamTableTest.java @@ -189,7 +189,7 @@ private class RemoteClient { final Schema flatbufSchema = SchemaHelper.flatbufSchema(schemaBytes.asReadOnlyByteBuffer()); final BarrageUtil.ConvertedArrowSchema schema = BarrageUtil.convertArrowSchema(flatbufSchema); this.barrageTable = BarrageTable.make(updateSourceCombiner, UpdateGraphProcessor.DEFAULT, - null, schema.tableDef, schema.attributes, viewport != null); + null, schema.tableDef, schema.attributes, viewport == null ? -1 : viewport.size()); final BarrageSubscriptionOptions options = BarrageSubscriptionOptions.builder() .useDeephavenNulls(useDeephavenNulls) diff --git a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java index d31b3743efe..565e6df9ece 100644 --- a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java +++ b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java @@ -425,9 +425,10 @@ public void testDoExchangeSnapshot() throws Exception { final FlatBufferBuilder metadata = new FlatBufferBuilder(); + // use 0 for batch size and max message size to use server-side defaults int optOffset = BarrageSnapshotOptions.createBarrageSnapshotOptions(metadata, ColumnConversionMode.Stringify, - false, 1000); + false, 0, 0); final int ticOffset = BarrageSnapshotRequest.createTicketVector(metadata, diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index 33ed0a264e9..02c089cb08c 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -1242,7 +1242,7 @@ private void flush() { // TODO #188 support minUpdateIntervalMs double serializationOptionsOffset = BarrageSubscriptionOptions .createBarrageSubscriptionOptions(subscriptionReq, ColumnConversionMode.Stringify, true, 1000, - 0); + 0, 0); double tableTicketOffset = BarrageSubscriptionRequest.createTicketVector(subscriptionReq, state.getHandle().getTicket()); BarrageSubscriptionRequest.startBarrageSubscriptionRequest(subscriptionReq); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java index 160ec44dd7d..723f04bbbf3 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java @@ -295,7 +295,7 @@ public Promise snapshot(JsRangeSet rows, Column[] columns) { double viewportOffset = BarrageSubscriptionRequest.createViewportVector(doGetRequest, serializeRanges( Collections.singleton(rows.getRange()))); double serializationOptionsOffset = BarrageSnapshotOptions - .createBarrageSnapshotOptions(doGetRequest, ColumnConversionMode.Stringify, true, 0); + .createBarrageSnapshotOptions(doGetRequest, ColumnConversionMode.Stringify, true, 0, 0); double tableTicketOffset = BarrageSubscriptionRequest.createTicketVector(doGetRequest, state.getHandle().getTicket()); BarrageSnapshotRequest.startBarrageSnapshotRequest(doGetRequest); diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java index 6d52014c52b..fe95e3a0822 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java @@ -18,13 +18,16 @@ public class BarrageSnapshotOptions { public static native void addColumnConversionMode( Builder builder, int columnConversionMode); + public static native void addMaxMessageSize(Builder builder, double maxMessageSize); + public static native void addUseDeephavenNulls(Builder builder, boolean useDeephavenNulls); public static native double createBarrageSnapshotOptions( Builder builder, int columnConversionMode, boolean useDeephavenNulls, - double batchSize); + double batchSize, + double maxMessageSize); public static native double endBarrageSnapshotOptions(Builder builder); @@ -50,5 +53,7 @@ public static native BarrageSnapshotOptions getSizePrefixedRootAsBarrageSnapshot public native int columnConversionMode(); + public native double maxMessageSize(); + public native boolean useDeephavenNulls(); } diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java index 29e8a704124..1747c78c637 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java @@ -18,6 +18,8 @@ public class BarrageSubscriptionOptions { public static native void addColumnConversionMode( Builder builder, int columnConversionMode); + public static native void addMaxMessageSize(Builder builder, double maxMessageSize); + public static native void addMinUpdateIntervalMs(Builder builder, double minUpdateIntervalMs); public static native void addUseDeephavenNulls(Builder builder, boolean useDeephavenNulls); @@ -27,7 +29,8 @@ public static native double createBarrageSubscriptionOptions( int columnConversionMode, boolean useDeephavenNulls, double minUpdateIntervalMs, - double batchSize); + double batchSize, + double maxMessageSize); public static native double endBarrageSubscriptionOptions(Builder builder); @@ -54,6 +57,8 @@ public static native BarrageSubscriptionOptions getSizePrefixedRootAsBarrageSubs public native int columnConversionMode(); + public native double maxMessageSize(); + public native double minUpdateIntervalMs(); public native boolean useDeephavenNulls(); diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java index 55e45e87fae..5b5d05938ea 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/barrage/flatbuf/barrage_generated/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java @@ -253,6 +253,9 @@ default boolean isUint8Array() { public static native void addEffectiveColumnSet(Builder builder, double effectiveColumnSetOffset); + public static native void addEffectiveReverseViewport( + Builder builder, boolean effectiveReverseViewport); + public static native void addEffectiveViewport(Builder builder, double effectiveViewportOffset); public static native void addFirstSeq(Builder builder, Long firstSeq); @@ -263,10 +266,6 @@ default boolean isUint8Array() { public static native void addModColumnNodes(Builder builder, double modColumnNodesOffset); - public static native void addNumAddBatches(Builder builder, double numAddBatches); - - public static native void addNumModBatches(Builder builder, double numModBatches); - public static native void addRemovedRows(Builder builder, double removedRowsOffset); public static native void addShiftData(Builder builder, double shiftDataOffset); @@ -338,12 +337,11 @@ public static final double createAddedRowsVector(Builder builder, double[] data) public static native double createBarrageUpdateMetadata( Builder builder, - double numAddBatches, - double numModBatches, Long firstSeq, Long lastSeq, boolean isSnapshot, double effectiveViewportOffset, + boolean effectiveReverseViewport, double effectiveColumnSetOffset, double addedRowsOffset, double removedRowsOffset, @@ -543,6 +541,8 @@ public static native BarrageUpdateMetadata getSizePrefixedRootAsBarrageUpdateMet public native double effectiveColumnSetLength(); + public native boolean effectiveReverseViewport(); + public native double effectiveViewport(double index); public native Int8Array effectiveViewportArray(); @@ -561,10 +561,6 @@ public static native BarrageUpdateMetadata getSizePrefixedRootAsBarrageUpdateMet public native double modColumnNodesLength(); - public native double numAddBatches(); - - public native double numModBatches(); - public native double removedRows(double index); public native Int8Array removedRowsArray(); From 3d69931da9fa8390993e8e4feb07ef1e7f9e3f4b Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 23 Aug 2022 13:17:52 -0700 Subject: [PATCH 074/215] Bump node and python registry images (#2750) --- docker/registry/node/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index bc1f1ad347b..4f12eb57b93 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:f327dab66058ad14f8bf3af97e871923307072e56dfdd48837f86b1b66a0b177 +deephaven.registry.imageId=node@sha256:4d6ebb12739acf0caec74996e6a83eada4716c32e4cde758b736325f4d1a9db8 diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index a052deb37aa..558e7a96a76 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:243d808efa708d54e461742bee944c17a586042488e98403ebf13b18e7a1bea1 +deephaven.registry.imageId=python@sha256:37c909c5c8ae3ec62d06ac89f4e3630b27ea09a13e2a13894df0cc70a9649323 From 898ef05fe0983e511c44504161c7ad24d2d273d5 Mon Sep 17 00:00:00 2001 From: Cristian Ferretti <37232625+jcferretti@users.noreply.github.com> Date: Tue, 23 Aug 2022 18:35:49 -0400 Subject: [PATCH 075/215] Support reading composite Kafka JSON fields as a JsonNode. Fixes #2754. (#2755) * Support reading composite Kafka JSON fields as a JsonNode (jackson) object. Fixes #2754. * Spotlessfy. * Followup to review comments. --- .../kafka/ingest/JsonNodeChunkAdapter.java | 6 ++-- .../ingest/JsonNodeJsonNodeFieldCopier.java | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeJsonNodeFieldCopier.java diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeChunkAdapter.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeChunkAdapter.java index ec2fd8a3fe1..7ffd41e0d63 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeChunkAdapter.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeChunkAdapter.java @@ -65,9 +65,11 @@ private static FieldCopier makeFieldCopier( case Object: if (dataType == String.class) { return new JsonNodeStringFieldCopier(fieldName); - } else { - throw new UncheckedDeephavenException("Raw objects not supported for JSON"); } + if (dataType.isAssignableFrom(com.fasterxml.jackson.databind.JsonNode.class)) { + return new JsonNodeJsonNodeFieldCopier(fieldName); + } + throw new UncheckedDeephavenException("Type " + dataType.getSimpleName() + " not supported for JSON"); } throw new IllegalArgumentException("Can not convert field of type " + dataType); } diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeJsonNodeFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeJsonNodeFieldCopier.java new file mode 100644 index 00000000000..5bcabe10f51 --- /dev/null +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/JsonNodeJsonNodeFieldCopier.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.kafka.ingest; + +import com.fasterxml.jackson.core.JsonPointer; +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableChunk; +import io.deephaven.chunk.WritableObjectChunk; +import com.fasterxml.jackson.databind.JsonNode; +import io.deephaven.chunk.attributes.Values; + +public class JsonNodeJsonNodeFieldCopier implements FieldCopier { + private final JsonPointer fieldPointer; + + public JsonNodeJsonNodeFieldCopier(final String fieldPointerStr) { + this.fieldPointer = JsonPointer.compile(fieldPointerStr); + } + + @Override + public void copyField( + final ObjectChunk inputChunk, + final WritableChunk publisherChunk, + final int sourceOffset, + final int destOffset, + final int length) { + final WritableObjectChunk output = publisherChunk.asWritableObjectChunk(); + for (int ii = 0; ii < length; ++ii) { + final JsonNode baseNode = (JsonNode) inputChunk.get(ii + sourceOffset); + final JsonNode node = (baseNode == null) ? null : baseNode.at(fieldPointer); + output.set(ii + destOffset, node); + } + } +} From 964d64d858a5b6c6233c3b9e4529e13c32ce5b99 Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Tue, 23 Aug 2022 15:46:48 -0700 Subject: [PATCH 076/215] Improve `SortedRanges` iterator performance through caching (#2748) * cache computed value for upcoming call * Added test cases and bug fixes to SortedRanges * renamed cachedNextValue to nextValue --- .../impl/sortedranges/SortedRanges.java | 44 ++++++++++++++----- .../impl/sortedranges/SortedRangesTest.java | 39 +++++++++++++--- 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRanges.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRanges.java index 81d25a8befb..6bf94271cb7 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRanges.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRanges.java @@ -458,6 +458,7 @@ public final boolean forEachLong(final LongAbortableConsumer lac) { private static final class Iterator implements RowSet.Iterator { private int nextRangeIdx = 0; + private long nextValue; private long rangeCurr = -1; private long rangeEnd = -1; private SortedRanges sar; @@ -469,6 +470,8 @@ private Iterator(final SortedRanges sar) { } sar.acquire(); this.sar = sar; + // preload the cached value for the first call, reload after every change to `nextRangeIdx` + nextValue = sar.unpackedGet(nextRangeIdx); } @Override @@ -485,18 +488,21 @@ public boolean hasNext() { } private void nextRange() { - rangeCurr = sar.unpackedGet(nextRangeIdx); + rangeCurr = nextValue; if (++nextRangeIdx == sar.count) { rangeEnd = rangeCurr; close(); return; } - final long after = sar.unpackedGet(nextRangeIdx); - if (after < 0) { - rangeEnd = -after; + // this is the "hot" path for which we are optimizing + nextValue = sar.unpackedGet(nextRangeIdx); + if (nextValue < 0) { + rangeEnd = -nextValue; ++nextRangeIdx; if (nextRangeIdx == sar.count) { close(); + } else { + nextValue = sar.unpackedGet(nextRangeIdx); } } else { rangeEnd = rangeCurr; @@ -518,6 +524,7 @@ public final RowSet.Iterator getIterator() { private static class RangeIteratorBase { protected int nextRangeIdx = 0; + protected long nextValue; protected long currRangeStart = -1; protected long currRangeEnd = -1; protected SortedRanges sar; @@ -529,21 +536,25 @@ protected RangeIteratorBase(final SortedRanges sar) { } sar.acquire(); this.sar = sar; + nextValue = sar.unpackedGet(nextRangeIdx); } protected final void nextRange() { - currRangeStart = sar.unpackedGet(nextRangeIdx); + currRangeStart = nextValue; if (++nextRangeIdx == sar.count) { currRangeEnd = currRangeStart; closeImpl(); return; } - final long after = sar.unpackedGet(nextRangeIdx); - if (after < 0) { - currRangeEnd = -after; + // this is the "hot" path for which we are optimizing + nextValue = sar.unpackedGet(nextRangeIdx); + if (nextValue < 0) { + currRangeEnd = -nextValue; ++nextRangeIdx; if (nextRangeIdx == sar.count) { closeImpl(); + } else { + nextValue = sar.unpackedGet(nextRangeIdx); } return; } @@ -590,14 +601,18 @@ public final boolean advanceImpl(final long v) { nextRangeIdx = sar.count; return true; } - final long after = sar.unpackedGet(p); - if (after < 0) { - currRangeEnd = -after; + nextValue = sar.unpackedGet(p); + if (nextValue < 0) { + currRangeEnd = -nextValue; nextRangeIdx = p + 1; + if (nextRangeIdx < sar.count) { + nextValue = sar.unpackedGet(nextRangeIdx); + } return true; } currRangeEnd = currRangeStart; nextRangeIdx = p; + nextValue = sar.unpackedGet(nextRangeIdx); return true; } @@ -793,6 +808,9 @@ public long binarySearchValue(final RowSet.TargetComparator comp, final int dir) if (neg) { currRangeStart = currRangeEnd = -data; nextRangeIdx = i + 1; + if (nextRangeIdx < sar.count) { + nextValue = sar.unpackedGet(nextRangeIdx); + } return currRangeStart; } final int next = i + 1; @@ -809,10 +827,14 @@ public long binarySearchValue(final RowSet.TargetComparator comp, final int dir) (final long v) -> comp.compareTargetTo(v, dir)); currRangeEnd = -nextData; nextRangeIdx = next + 1; + if (nextRangeIdx < sar.count) { + nextValue = sar.unpackedGet(nextRangeIdx); + } return currRangeStart; } currRangeStart = currRangeEnd = data; nextRangeIdx = next; + nextValue = sar.unpackedGet(nextRangeIdx); return currRangeStart; } } diff --git a/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRangesTest.java b/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRangesTest.java index 56d855a3765..1e51eae82fc 100644 --- a/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRangesTest.java +++ b/engine/rowset/src/test/java/io/deephaven/engine/rowset/impl/sortedranges/SortedRangesTest.java @@ -1079,15 +1079,42 @@ public void testSearchIteratorBinarySearch() { @Test public void testSearchIteratorBinarySearchCases() { SortedRanges sar = new SortedRangesLong(2); + + // search for last when single value is final entry sar.appendRange(4, 10); sar.append(25); sar.append(32); - final RowSet.SearchIterator sit = sar.getSearchIterator(); - final long v = sar.last(); - final RowSet.TargetComparator comp = - (final long key, final int dir) -> Long.signum(dir * (v - key)); - final long r = sit.binarySearchValue(comp, 1); - assertEquals(v, r); + try (final RowSet.SearchIterator sit = sar.getSearchIterator()) { + final long v = sar.last(); + final RowSet.TargetComparator comp = + (final long key, final int dir) -> Long.signum(dir * (v - key)); + final long r = sit.binarySearchValue(comp, 1); + assertEquals(v, r); + } + + // search for last when a range is the final entry + sar.clear(); + sar.appendRange(4, 10); + sar.appendRange(25, 32); + try (final RowSet.SearchIterator sit = sar.getSearchIterator()) { + final long v = sar.last(); + final RowSet.TargetComparator comp = + (final long key, final int dir) -> Long.signum(dir * (v - key)); + final long r = sit.binarySearchValue(comp, 1); + assertEquals(v, r); + } + + // search for value in the final range when a range is the final entry + sar.clear(); + sar.appendRange(4, 10); + sar.appendRange(25, 32); + try (final RowSet.SearchIterator sit = sar.getSearchIterator()) { + final long v = sar.last() - 1; + final RowSet.TargetComparator comp = + (final long key, final int dir) -> Long.signum(dir * (v - key)); + final long r = sit.binarySearchValue(comp, 1); + assertEquals(v, r); + } } @Test From da9da877e77c675eb91da0b29e77877a28930a64 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Wed, 24 Aug 2022 11:30:58 -0600 Subject: [PATCH 077/215] fix deephaven learn issue with query param scoping (#2757) --- py/server/deephaven/learn/__init__.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/py/server/deephaven/learn/__init__.py b/py/server/deephaven/learn/__init__.py index aeea0853a1c..dbaa2c9e42c 100644 --- a/py/server/deephaven/learn/__init__.py +++ b/py/server/deephaven/learn/__init__.py @@ -136,23 +136,14 @@ def learn(table: Table = None, model_func: Callable = None, inputs: List[Input] if batch_size is None: raise ValueError("Batch size cannot be inferred. Please specify a batch size.") - # TODO: When ticket #1072 is resolved, the following code should be replaced with - # Globals["__computer"] = _Computer_(table, model_func, [input.input for input in inputs], batch_size) - # and remove from globals at the end of function - (jpy.get_type("io.deephaven.engine.context.QueryScope") - .addParam("__computer", _JLearnComputer(table.j_table, model_func, - [input_.input for input_ in inputs], - batch_size))) + __computer = _JLearnComputer(table.j_table, model_func, + [input_.input for input_ in inputs], batch_size) future_offset = _create_non_conflicting_col_name(table, "__FutureOffset") clean = _create_non_conflicting_col_name(table, "__CleanComputer") if outputs is not None: __scatterer = _JLearnScatterer([output.output for output in outputs]) - # TODO: Similarly at resolution of #1072, replace the following code with - # Globals["__scatterer"] = __scatterer - # and remove from Globals at end of function - jpy.get_type("io.deephaven.engine.context.QueryScope").addParam("__scatterer", __scatterer) return (table .update(formulas=[f"{future_offset} = __computer.compute(k)", ]) From a8deba0b613551fa20a11b6b77e2e6776c702f3b Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 25 Aug 2022 09:56:08 -0400 Subject: [PATCH 078/215] Change Bootstrap.log to System.out instead of System.err (#2743) - Change Bootstrap.log to System.out instead of System.err - There are just info messages, they are not errors so they should not be output to System.err - Remove unnecessary '%n' as well --- .../src/main/java/io/deephaven/internal/log/Bootstrap.java | 2 +- server/src/main/java/io/deephaven/server/runner/Main.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/log-factory/src/main/java/io/deephaven/internal/log/Bootstrap.java b/log-factory/src/main/java/io/deephaven/internal/log/Bootstrap.java index 3c05aaabfba..18545d68e1a 100644 --- a/log-factory/src/main/java/io/deephaven/internal/log/Bootstrap.java +++ b/log-factory/src/main/java/io/deephaven/internal/log/Bootstrap.java @@ -11,7 +11,7 @@ private static boolean isEnabled() { public static void log(Class source, String message) { if (isEnabled()) { - System.err.printf("# %s: %s%n", source.getName(), message); + System.out.printf("# %s: %s%n", source.getName(), message); } } } diff --git a/server/src/main/java/io/deephaven/server/runner/Main.java b/server/src/main/java/io/deephaven/server/runner/Main.java index a437d5eef74..eb52f2c7528 100644 --- a/server/src/main/java/io/deephaven/server/runner/Main.java +++ b/server/src/main/java/io/deephaven/server/runner/Main.java @@ -34,10 +34,10 @@ private static void bootstrapSystemProperties(String[] args) throws IOException if (args.length == 0) { try (final InputStream in = Main.class.getResourceAsStream("/bootstrap.properties")) { if (in != null) { - System.out.println("# Bootstrapping from resource '/bootstrap.properties'%n"); + System.out.println("# Bootstrapping from resource '/bootstrap.properties'"); System.getProperties().load(in); } else { - System.out.println("# No resource '/bootstrap.properties' found, skipping bootstrapping%n"); + System.out.println("# No resource '/bootstrap.properties' found, skipping bootstrapping"); } } } else { From 5b4ceb02bd5560b5950437ce57d6904152f46bf5 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 25 Aug 2022 09:22:29 -0700 Subject: [PATCH 079/215] Use Sample for getHeapInfo (#2759) Change semantics, ensuring getHeapInfo triggers new snapshot if necessary --- .../engine/table/impl/util/RuntimeMemory.java | 39 ++++++++++--------- .../console/ConsoleServiceGrpcImpl.java | 8 ++-- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java index 28b563648f0..c2f82968d30 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/RuntimeMemory.java @@ -68,6 +68,13 @@ private static class Snapshot { * The approximated total time of GC collections since program start, in milliseconds. */ long totalCollectionTimeMs; + + private void readInto(Sample buf) { + buf.freeMemory = lastFreeMemory; + buf.totalMemory = lastTotalMemory; + buf.totalCollections = totalCollections; + buf.totalCollectionTimeMs = totalCollectionTimeMs; + } } private volatile Snapshot currSnapshot; @@ -108,19 +115,21 @@ public static RuntimeMemory getInstance() { public static class Sample { /** - * What is the last free memory value we retrieved from the Runtime. + * What is the last free memory value we retrieved from the {@link Runtime#freeMemory()}. */ public long freeMemory; /** - * What is the last total memory value we retrieved from the Runtime. + * What is the last total memory value we retrieved from the {@link Runtime#totalMemory()}. */ public long totalMemory; /** - * The total number of GC collections since program start. + * The total number of GC collections since program start. The sum of + * {@link GarbageCollectorMXBean#getCollectionCount()}. */ public long totalCollections; /** - * The approximated total time of GC collections since program start, in milliseconds. + * The approximated total time of GC collections since program start, in milliseconds. The sum of the + * {@link GarbageCollectorMXBean#getCollectionTime()}. */ public long totalCollectionTimeMs; @@ -145,7 +154,7 @@ void copy(final Sample s) { } /** - * Read last collected samples. + * Read last collected samples. Triggers a new snapshot if the last snapshot is older than {@code cacheInterval}. * * @param buf a user provided buffer object to store the samples. */ @@ -172,10 +181,7 @@ public void read(final Sample buf) { } } } - buf.freeMemory = snapshot.lastFreeMemory; - buf.totalMemory = snapshot.lastTotalMemory; - buf.totalCollections = snapshot.totalCollections; - buf.totalCollectionTimeMs = snapshot.totalCollectionTimeMs; + snapshot.readInto(buf); if (logInterval > 0 && now >= snapshot.nextLog) { synchronized (this) { if (now >= currSnapshot.nextLog) { @@ -189,17 +195,12 @@ public void read(final Sample buf) { } /** - * See {@link Runtime#freeMemory()}. - */ - public long freeMemory() { - return currSnapshot.lastFreeMemory; - } - - /** - * See {@link Runtime#totalMemory()}. + * Read last collected samples. + * + * @param buf a user provided buffer object to store the samples. */ - public long totalMemory() { - return currSnapshot.lastTotalMemory; + public void readOnly(final Sample buf) { + currSnapshot.readInto(buf); } /** diff --git a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java index 4721023eef0..5a72c2e698a 100644 --- a/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/console/ConsoleServiceGrpcImpl.java @@ -7,6 +7,7 @@ import io.deephaven.configuration.Configuration; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.impl.util.RuntimeMemory; +import io.deephaven.engine.table.impl.util.RuntimeMemory.Sample; import io.deephaven.engine.updategraph.DynamicNode; import io.deephaven.engine.util.DelegatingScriptSession; import io.deephaven.engine.util.ScriptSession; @@ -185,12 +186,13 @@ public void executeCommand(ExecuteCommandRequest request, StreamObserver responseObserver) { GrpcUtil.rpcWrapper(log, responseObserver, () -> { final RuntimeMemory runtimeMemory = RuntimeMemory.getInstance(); + final Sample sample = new Sample(); + runtimeMemory.read(sample); final GetHeapInfoResponse infoResponse = GetHeapInfoResponse.newBuilder() - .setTotalMemory(runtimeMemory.totalMemory()) - .setFreeMemory(runtimeMemory.freeMemory()) + .setTotalMemory(sample.totalMemory) + .setFreeMemory(sample.freeMemory) .setMaxMemory(runtimeMemory.maxMemory()) .build(); - responseObserver.onNext(infoResponse); responseObserver.onCompleted(); }); From d35a5e2ad17b8d29fe88f1d1ac48f01e91dd0237 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 26 Aug 2022 14:38:14 -0400 Subject: [PATCH 080/215] Update web to v0.15.6 (#2762) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.15.6 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 421f9fb09ad..63e8e9752e2 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.15.5 +ARG WEB_VERSION=0.15.6 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 1d2721e322bc0c220af8e384ed825632d4ca063d Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 29 Aug 2022 07:21:27 -0700 Subject: [PATCH 081/215] Add server configuration for mTLS authentication (#2548) Co-authored-by: Colin Alworth --- grpc-java/grpc-mtls/LICENSE | 202 ++++++++++++++++++ grpc-java/grpc-mtls/NOTICE | 14 ++ grpc-java/grpc-mtls/build.gradle | 10 + grpc-java/grpc-mtls/gradle.properties | 1 + ...tractMtlsClientCertificateInterceptor.java | 32 +++ .../io/deephaven/grpc/MTlsCertificate.java | 68 ++++++ .../io/grpc/servlet/jakarta/GrpcServlet.java | 7 + .../grpc/servlet/jakarta/ServletAdapter.java | 20 +- .../deephaven/client/impl/ClientConfig.java | 9 +- server/build.gradle | 2 + server/dev-certs/README.md | 108 +++++++++- server/dev-certs/ca.crt | 29 ++- server/dev-certs/ca.key | 28 +++ server/dev-certs/client-mtls.json | 17 ++ server/dev-certs/client.chain.crt | 39 ++++ server/dev-certs/client.crt | 19 ++ server/dev-certs/client.key | 28 +++ server/dev-certs/client.p12 | Bin 0 -> 3411 bytes server/dev-certs/key.pem | 16 -- server/dev-certs/server.chain.crt | 37 ++++ server/dev-certs/server.crt | 17 ++ server/dev-certs/server.key | 28 +++ server/jetty-app/README.md | 67 +++++- server/jetty-app/build.gradle | 14 +- server/jetty/build.gradle | 2 + .../server/jetty/JettyBackedGrpcServer.java | 4 +- .../server/jetty/JettyCertInterceptor.java | 19 ++ .../server/jetty/JettyServerModule.java | 3 + server/netty-app/README.md | 67 +++++- server/netty-app/build.gradle | 14 +- server/netty/build.gradle | 2 + .../server/netty/NettyServerModule.java | 5 +- .../auth/TrivialAuthContextProvider.java | 2 +- .../deephaven/server/config/ServerConfig.java | 11 +- .../runner/DeephavenApiConfigModule.java | 18 ++ .../java/io/deephaven/server/runner/Main.java | 87 ++++++-- .../runner/NettyServerBuilderModule.java | 19 -- .../runner/ServerBuilderInProcessModule.java | 8 +- .../server/uri/BarrageTableResolver.java | 9 +- settings.gradle | 1 + ssl/config/build.gradle | 4 + .../io/deephaven/ssl/config/SSLConfig.java | 47 ++-- .../java/io/deephaven/ssl/config/Trust.java | 4 + .../io/deephaven/ssl/config/TrustAll.java | 12 +- .../io/deephaven/ssl/config/TrustBase.java | 20 ++ .../ssl/config/TrustCertificates.java | 2 +- .../io/deephaven/ssl/config/TrustJdk.java | 2 +- .../io/deephaven/ssl/config/TrustList.java | 18 +- .../deephaven/ssl/config/TrustProperties.java | 2 +- .../io/deephaven/ssl/config/TrustStore.java | 2 +- .../io/deephaven/ssl/config/TrustSystem.java | 2 +- .../deephaven/ssl/config/SSLConfigTest.java | 12 +- .../config/client-authentication-needed.json | 8 +- .../config/client-authentication-wanted.json | 8 +- .../ssl/config/default-explicit.json | 2 +- .../ssl/config/impl/KickstartUtils.java | 28 +-- 56 files changed, 1113 insertions(+), 143 deletions(-) create mode 100644 grpc-java/grpc-mtls/LICENSE create mode 100644 grpc-java/grpc-mtls/NOTICE create mode 100644 grpc-java/grpc-mtls/build.gradle create mode 100644 grpc-java/grpc-mtls/gradle.properties create mode 100644 grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/AbstractMtlsClientCertificateInterceptor.java create mode 100644 grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/MTlsCertificate.java create mode 100644 server/dev-certs/ca.key create mode 100644 server/dev-certs/client-mtls.json create mode 100644 server/dev-certs/client.chain.crt create mode 100644 server/dev-certs/client.crt create mode 100644 server/dev-certs/client.key create mode 100644 server/dev-certs/client.p12 delete mode 100644 server/dev-certs/key.pem create mode 100644 server/dev-certs/server.chain.crt create mode 100644 server/dev-certs/server.crt create mode 100644 server/dev-certs/server.key create mode 100644 server/jetty/src/main/java/io/deephaven/server/jetty/JettyCertInterceptor.java delete mode 100644 server/src/main/java/io/deephaven/server/runner/NettyServerBuilderModule.java create mode 100644 ssl/config/src/main/java/io/deephaven/ssl/config/TrustBase.java diff --git a/grpc-java/grpc-mtls/LICENSE b/grpc-java/grpc-mtls/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/grpc-java/grpc-mtls/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/grpc-java/grpc-mtls/NOTICE b/grpc-java/grpc-mtls/NOTICE new file mode 100644 index 00000000000..79bf942062a --- /dev/null +++ b/grpc-java/grpc-mtls/NOTICE @@ -0,0 +1,14 @@ +Deephaven grpc-mtls +Copyright 2022 Deephaven Data Labs + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/grpc-java/grpc-mtls/build.gradle b/grpc-java/grpc-mtls/build.gradle new file mode 100644 index 00000000000..2863d36bce9 --- /dev/null +++ b/grpc-java/grpc-mtls/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} +description = 'Utility project to make x509 client cert available in grpc calls on the server' + +dependencies { + Classpaths.inheritGrpcPlatform(project) + implementation 'io.grpc:grpc-core' +} diff --git a/grpc-java/grpc-mtls/gradle.properties b/grpc-java/grpc-mtls/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/grpc-java/grpc-mtls/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/AbstractMtlsClientCertificateInterceptor.java b/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/AbstractMtlsClientCertificateInterceptor.java new file mode 100644 index 00000000000..0a5d5bd2752 --- /dev/null +++ b/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/AbstractMtlsClientCertificateInterceptor.java @@ -0,0 +1,32 @@ +package io.deephaven.grpc; + +import io.grpc.Context; +import io.grpc.Contexts; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; + +import java.security.cert.X509Certificate; +import java.util.List; +import java.util.Optional; + +/** + * Base class for server implementations to offer their own hook to read the current certificates + */ +public abstract class AbstractMtlsClientCertificateInterceptor implements ServerInterceptor { + @Override + public ServerCall.Listener interceptCall(ServerCall call, Metadata headers, + ServerCallHandler next) { + return getTransportCertificates(call) + .map(x509Certificates -> Contexts.interceptCall( + Context.current().withValue(MTlsCertificate.CLIENT_CERTIFICATES, x509Certificates), + call, + headers, + next)) + .orElseGet(() -> next.startCall(call, headers)); + } + + protected abstract Optional> getTransportCertificates( + ServerCall call); +} diff --git a/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/MTlsCertificate.java b/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/MTlsCertificate.java new file mode 100644 index 00000000000..84898a46a0d --- /dev/null +++ b/grpc-java/grpc-mtls/src/main/java/io/deephaven/grpc/MTlsCertificate.java @@ -0,0 +1,68 @@ +package io.deephaven.grpc; + +import io.grpc.Context; +import io.grpc.Grpc; +import io.grpc.ServerCall; +import io.grpc.ServerInterceptor; + +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLSession; +import java.io.ByteArrayInputStream; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Provides access to the Context key to read the current client cert, if any. + */ +public class MTlsCertificate { + private static final Logger logger = Logger.getLogger(MTlsCertificate.class.getName()); + + public static final Context.Key> CLIENT_CERTIFICATES = + Context.key("mtls-client-certificates"); + + /** + * Default implementation for use with Grpc's own TRANSPORT_ATTR_SSL_SESSION, to easily convert to non-deprecated + * x509 certs. + */ + public final static ServerInterceptor DEFAULT_INTERCEPTOR = new AbstractMtlsClientCertificateInterceptor() { + @Override + protected Optional> getTransportCertificates(ServerCall call) { + SSLSession sslSession = call.getAttributes().get(Grpc.TRANSPORT_ATTR_SSL_SESSION); + if (sslSession == null) { + return Optional.empty(); + } + try { + Certificate[] javaxCerts = sslSession.getPeerCertificates(); + if (javaxCerts == null || javaxCerts.length == 0) { + return Optional.empty(); + } + + int length = javaxCerts.length; + List javaCerts = new ArrayList<>(length); + + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + for (Certificate javaxCert : javaxCerts) { + byte[] bytes = javaxCert.getEncoded(); + ByteArrayInputStream stream = new ByteArrayInputStream(bytes); + javaCerts.add((X509Certificate) cf.generateCertificate(stream)); + } + + return Optional.of(Collections.unmodifiableList(javaCerts)); + } catch (SSLPeerUnverifiedException pue) { + return Optional.empty(); + } catch (CertificateException e) { + logger.log(Level.WARNING, "Unable to read X509CertChain due to certificate exception", e); + return Optional.empty(); + } + } + }; +} diff --git a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/GrpcServlet.java b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/GrpcServlet.java index 642064dae7d..89b518112a9 100644 --- a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/GrpcServlet.java +++ b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/GrpcServlet.java @@ -14,13 +14,16 @@ package io.grpc.servlet.jakarta; import com.google.common.annotations.VisibleForTesting; +import io.grpc.Attributes; import io.grpc.BindableService; import io.grpc.ExperimentalApi; +import io.grpc.Grpc; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; +import java.security.cert.X509Certificate; import java.util.List; /** @@ -33,6 +36,10 @@ */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/5066") public class GrpcServlet extends HttpServlet { + @Grpc.TransportAttr + public static final Attributes.Key> MTLS_CERTIFICATE_KEY = + Attributes.Key.create("dh-mtls-peer-certificate-chain"); + private static final long serialVersionUID = 1L; private final ServletAdapter servletAdapter; diff --git a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java index f52afb0fd3f..a29fb747709 100644 --- a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java +++ b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java @@ -39,6 +39,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; +import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; @@ -150,17 +151,22 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx StatsTraceContext statsTraceCtx = StatsTraceContext.newServerContext(streamTracerFactories, method, headers); + Attributes.Builder attrBuilder = attributes.toBuilder() + .set( + Grpc.TRANSPORT_ATTR_REMOTE_ADDR, + new InetSocketAddress(req.getRemoteHost(), req.getRemotePort())) + .set( + Grpc.TRANSPORT_ATTR_LOCAL_ADDR, + new InetSocketAddress(req.getLocalAddr(), req.getLocalPort())); + X509Certificate[] mTlsCert = (X509Certificate[]) req.getAttribute("jakarta.servlet.request.X509Certificate"); + if (mTlsCert != null) { + attrBuilder.set(GrpcServlet.MTLS_CERTIFICATE_KEY, Arrays.asList(mTlsCert)); + } ServletServerStream stream = new ServletServerStream( asyncCtx, statsTraceCtx, maxInboundMessageSize, - attributes.toBuilder() - .set( - Grpc.TRANSPORT_ATTR_REMOTE_ADDR, - new InetSocketAddress(req.getRemoteHost(), req.getRemotePort())) - .set( - Grpc.TRANSPORT_ATTR_LOCAL_ADDR, - new InetSocketAddress(req.getLocalAddr(), req.getLocalPort())) + attrBuilder .build(), getAuthority(req), logId); diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/ClientConfig.java b/java-client/session/src/main/java/io/deephaven/client/impl/ClientConfig.java index 6265996bc50..69abc34fd1c 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/ClientConfig.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/ClientConfig.java @@ -31,7 +31,7 @@ public static Builder builder() { public abstract DeephavenTarget target(); /** - * The SSL configuration. + * The SSL configuration. Only relevant if {@link #target()} is secure. */ public abstract Optional ssl(); @@ -48,13 +48,6 @@ public int maxInboundMessageSize() { return DEFAULT_MAX_INBOUND_MESSAGE_SIZE; } - @Check - final void checkSslStatus() { - if (!target().isSecure() && ssl().isPresent()) { - throw new IllegalArgumentException("target() is trying to connect via plaintext, but ssl() is present"); - } - } - public interface Builder { Builder target(DeephavenTarget target); diff --git a/server/build.gradle b/server/build.gradle index cc245a6a801..a3bec8d2e0c 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -76,6 +76,8 @@ dependencies { because 'downstream dagger compile, see deephaven-core#1722' } + implementation project(':grpc-java:grpc-mtls') + testImplementation 'io.grpc:grpc-testing' testImplementation project(':proto:proto-backplane-grpc') diff --git a/server/dev-certs/README.md b/server/dev-certs/README.md index d58c19bb08e..1fcb45adec5 100644 --- a/server/dev-certs/README.md +++ b/server/dev-certs/README.md @@ -2,13 +2,13 @@ This are *self-signed* certificates for *local* development purposes. -Generated with the command: +Self-signed certificates can be generated for server identification with the command: ```shell -openssl req -x509 -nodes -subj '/CN=localhost' -newkey rsa:1024 -keyout key.pem -out ca.crt -sha256 -days 3650 +openssl req -x509 -nodes -subj '/CN=localhost' -newkey rsa:1024 -keyout server.key -out server.crt -sha256 -days 3650 ``` -The respective servers can be started up locally with these certs via: +The respective servers can be started up with development certificates via: ```shell ./gradlew server-netty-app:run -Pgroovy -PdevCerts @@ -18,9 +18,109 @@ The respective servers can be started up locally with these certs via: ./gradlew server-jetty-app:run -Pgroovy -PdevCerts ``` -From the java client examples, the CA certificate can be referenced via: +The jetty server will be accessible via https at [https://localhost:8443/ide/](https://localhost:8443/ide/). You'll need +to add the appropriate self-signed certificates to the browser, or proceed past a self-signed warning. + +From the java client examples, the server can be connected to via: ```shell ./gradlew java-client-session-examples:installDist ./java-client/session-examples/build/install/java-client-session-examples/bin/ --target dh://localhost:8443 --ssl server/dev-certs/client.json --groovy ``` + +## mTLS + +Mutual TLS is authentication in both directions between servers and clients. + +The respective servers can be started up with development certificates and mTLS via: + +```shell +./gradlew server-netty-app:run -Pgroovy -PdevMTLS +``` + +```shell +./gradlew server-jetty-app:run -Pgroovy -PdevMTLS +``` + +Note: it is not possible to start with mTLS, but not certificates. + +The jetty server will be accessible via https at [https://localhost:8443/ide/](https://localhost:8443/ide/). You'll need +to import the client.p12 into your browser for mTLS to pass the proper identity information to the server. The +configuration here uses the password `secret`. + +From the java client examples, the mTLS configuration can be referenced via: + +```shell +./gradlew java-client-session-examples:installDist +./java-client/session-examples/build/install/java-client-session-examples/bin/connect-check --target dh://localhost:8443 --ssl server/dev-certs/client-mtls.json +``` +## Configuration + +The following are examples of how the keys and certificates in dev-certs was generated. + +### CA + +```shell +openssl genpkey -algorithm RSA -out ca.key + +openssl req \ + -new \ + -x509 \ + -nodes \ + -days 3650 \ + -subj '/CN=deephaven-localhost-testing-ca' \ + -key ca.key \ + -out ca.crt +``` + +### Server + +```shell +openssl genpkey -algorithm RSA -out server.key + +openssl req \ + -new \ + -key server.key \ + -subj '/CN=localhost' \ + -out server.csr + +openssl x509 \ + -req \ + -in server.csr \ + -CA ca.crt \ + -CAkey ca.key \ + -CAcreateserial \ + -days 3650 \ + -out server.crt + +rm server.csr + +cat server.crt ca.crt > server.chain.crt +``` + +### Client + +```shell +openssl genpkey -algorithm RSA -out client.key + +openssl req \ + -new \ + -key client.key \ + -subj '/CN=insert-name-here/UID=1234/emailAddress=user@deephaven.io/O=my-company' \ + -out client.csr + +openssl x509 \ + -req \ + -in client.csr \ + -CA ca.crt \ + -CAkey ca.key \ + -CAcreateserial \ + -days 3650 \ + -out client.crt + +rm client.csr + +cat client.crt ca.crt > client.chain.crt + +openssl pkcs12 -export -in client.chain.crt -inkey client.key -out client.p12 -passout pass:secret +``` diff --git a/server/dev-certs/ca.crt b/server/dev-certs/ca.crt index 20560f44759..e9149b6217b 100644 --- a/server/dev-certs/ca.crt +++ b/server/dev-certs/ca.crt @@ -1,13 +1,20 @@ -----BEGIN CERTIFICATE----- -MIICBDCCAW2gAwIBAgIUZ3hGyC5n+cDPWk8NEKTW/5pQ4SwwDQYJKoZIhvcNAQEL -BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIyMDUxNjIyMDgzMloXDTMyMDUx -MzIyMDgzMlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQC/RzrY6koB1Fh9SNXsRZLbL8pfT9+dEa3gwKl2rG/SCJeOgYJG -wpRJuStECroCTJBTi+96NudY+WEYb8OzX8hlWpLp7lXVk+94Di9Gm5OfuFcMmJlw -emjKURafWhd5KsEmqmOrG45hfEe9H3YLA+QtjQE6qCUzHLRGTOtywPjV8wIDAQAB -o1MwUTAdBgNVHQ4EFgQUB9xVxeeR3SZ2SxUeIbuDWINGnTwwHwYDVR0jBBgwFoAU -B9xVxeeR3SZ2SxUeIbuDWINGnTwwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B -AQsFAAOBgQBnNYBj0K6M6DhdJSBmcFturuVgWKYk8ws++r+gFH8ZunwTU2ewtocz -szcjUfmOqvSMPMQxLy7xfd5/bUaappweFWtU3LDviFEGWUDgJ8KTtNmrMDE5fQhF -gGcau+08bnQJlIiqlsL+LM0LZDwYmTssaAH/MFdpbrJnBIr5NES35Q== +MIIDMzCCAhugAwIBAgIURTZ8mjnT9vkj+m0RYAxvoIETccgwDQYJKoZIhvcNAQEL +BQAwKTEnMCUGA1UEAwweZGVlcGhhdmVuLWxvY2FsaG9zdC10ZXN0aW5nLWNhMB4X +DTIyMDYxNTIyMTUwMVoXDTMyMDYxMjIyMTUwMVowKTEnMCUGA1UEAwweZGVlcGhh +dmVuLWxvY2FsaG9zdC10ZXN0aW5nLWNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLDoDpV8C0rbGH6SdhaH5mjnWUjGguR0RbFI+unNWLlPoKeqYOuU +14hZ0fFvPdYNc3mv7lDnfgCNsknaRpgCu8pRD36WeWn/3zmnp0WHeXnNYOsj8Zl4 +mFUMphssqBRUCbfU0KoHyfsEV4vjuH0/bUCAi0XyMiChXyX2YFaTBt2nW/nLgy+P +WXZbymv8GyW5FzL7ku/RcSLYPpagOe1B11i3nCYjQrS8i2WYuZNwbgMnnNK9gIoU +lF+d+fu9Bw9u80DX/HK4X4wOC6zuwlx34w2Eo5IymdRzhjaexaavEtCZSigOQ3zA +CiX7S+n5ROoyX0gb/6nqjptJVZ9NB3NGMQIDAQABo1MwUTAdBgNVHQ4EFgQUB8zS +XhDdPBvOo566PIDVnLA86mkwHwYDVR0jBBgwFoAUB8zSXhDdPBvOo566PIDVnLA8 +6mkwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEANnSJo523NPmX +n74jfzN9z+e256SsIsqI6OjrA38TV62Q3sebl8vABA/Mcukg2MOEN0mqinim35AZ +4i/zmMtn2Cn0FepnvPQ3WXzhD2DASUhwbF2KYzWLweGTdNzfGqes5vH2u7HTdixX +OvAIgwnVYmXJwqfCqiY0oVMaubDqbjGHKcQPppgS2HkF5kEUkj0n6yZxuL5gTx7d +bo7R/lA6Bk8+oKzB2QfHbv9XvF25I9Y0EOPDgPfOM4PiRDPFVMw6c/eZOor5hhR3 +yKWHw5RoA3+6+/jkmt3gXsNwiFfB/04XQlnN1PDojRstMwquGzRSlSJs+7zs2K9C +zifKG9FU0g== -----END CERTIFICATE----- diff --git a/server/dev-certs/ca.key b/server/dev-certs/ca.key new file mode 100644 index 00000000000..a6544037788 --- /dev/null +++ b/server/dev-certs/ca.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEsOgOlXwLStsY +fpJ2FofmaOdZSMaC5HRFsUj66c1YuU+gp6pg65TXiFnR8W891g1zea/uUOd+AI2y +SdpGmAK7ylEPfpZ5af/fOaenRYd5ec1g6yPxmXiYVQymGyyoFFQJt9TQqgfJ+wRX +i+O4fT9tQICLRfIyIKFfJfZgVpMG3adb+cuDL49ZdlvKa/wbJbkXMvuS79FxItg+ +lqA57UHXWLecJiNCtLyLZZi5k3BuAyec0r2AihSUX535+70HD27zQNf8crhfjA4L +rO7CXHfjDYSjkjKZ1HOGNp7Fpq8S0JlKKA5DfMAKJftL6flE6jJfSBv/qeqOm0lV +n00Hc0YxAgMBAAECggEAfoyr4aZAFyvkZ5AYP64jZhWctA9k2ZaPUL/OCtIe8rTY +DK+TqaQpMbtivvct8YUlRmTG0vhu2N0WTd3CeKUZLSXwnZ1+x0NyA3ee7LqJfZjm +kTL4/1sVAj3GU6EsTEA4CcCjRlX/iO7eTk2NCIhdJLfZfMJWH/ZqnUNZj4ZkNoeH +xC43xeGMuZn9esI2pmFYywRMv2cL1E0I2dGnf1VuPmwN7GpV/iBMD2EpEn3ndMHB +aNQeOEUYspb8fGPgr8yxzqjGH0PokQ0k7CTl0yVMw271wV1dBh3qAl81815qDTra +VB/mIBU8gCcvtqsz32QJp/FST8NY6T1gHwrDyAqHmQKBgQD6fQeOUOo1VTd8iNXC +zwpX9fkwn1oKBpZ9Z53hea2kGD5l6DfgCJjAZysp4eTcNZQFxyoFQbKTkEpXTUXF +LhHARgQZd+dINs6zlv8JhGAMFrd1947KIlfag6pYNd5luE2VkYuB5DtnPRoofR2d +CuSoaVYtmaGjCchUiq6GbS5l1wKBgQDJBNfROYxhqMvT38ftNXkvZFe/7Y0vzyGg +p2HXrGoIT1E5sb5VcBrtaiY/2muTuxFXtQ8yJ1aOmvSU/D3rx6rZQ6rAGJXuJMuM +ThRUZOhyfxNBGQJ1ZtJPi9LPMo/y7O64lvN/x8s1h99Sc1LJUsGk2CQ2M9+x8bQ3 +H+VnygkjNwKBgArmjgGfe9G+V5/PxJ2prOWPCr0W8jAlgT8L108MoIXXmD+PD39s +YFlfI/26mt8KZdqqhCWeaksJqHKMJlEiZBtd8Ke7FBGMcQpXs9mSLSvZgTpc/5XE +UNZtjGgyT+9VSesMXmnUqNEhU5YXe8Ztxu2dR+bMHMCfmFw1fMrUzYQZAoGBAJ1q +LntIXpdHcL5tOomWW1zybgj9RJfQ01uUV/llqe7x9gCBITSUwnFys5tDNwUL8+vD +/K9gwNaRn8Bfuzm9NRxIchlV52sC42bu6dqg3qpyuqg6poM7Tqw+KYpZ5QHt6o8g +nnRNB+PWj9poNsczCDNHkyvi+WTGi0KztpjNTNSHAoGANBOGDjMfZtEfuFK9LMR0 +dajNlmyDZth7RnlJSA64ySpmPG+YyOVkoPL/0UKPqVTW+RFt6hhTzlsG2/1vbtBA +bD2MPywXIYIg1ldanFTflTEBC303K3Ns9vN9ex5ABAM7ZY6hzjvEvcsNZZz0Z/sg +qhfIlOVsBEiYLk5xlPYjvaQ= +-----END PRIVATE KEY----- diff --git a/server/dev-certs/client-mtls.json b/server/dev-certs/client-mtls.json new file mode 100644 index 00000000000..9ef769687ab --- /dev/null +++ b/server/dev-certs/client-mtls.json @@ -0,0 +1,17 @@ +{ + "trust": { + "type": "certs", + "path": "server/dev-certs/ca.crt" + }, + "identity": { + "type": "privatekey", + "certChainPath": "server/dev-certs/client.chain.crt", + "privateKeyPath": "server/dev-certs/client.key" + }, + "protocols": { + "type": "modern" + }, + "ciphers": { + "type": "modern" + } +} \ No newline at end of file diff --git a/server/dev-certs/client.chain.crt b/server/dev-certs/client.chain.crt new file mode 100644 index 00000000000..ecc3b1d3eee --- /dev/null +++ b/server/dev-certs/client.chain.crt @@ -0,0 +1,39 @@ +-----BEGIN CERTIFICATE----- +MIIDGDCCAgACFF0jg/VIBSTnfzLEXvSOAv5ovocFMA0GCSqGSIb3DQEBCwUAMCkx +JzAlBgNVBAMMHmRlZXBoYXZlbi1sb2NhbGhvc3QtdGVzdGluZy1jYTAeFw0yMjA4 +MDExODEyMTNaFw0zMjA3MjkxODEyMTNaMGgxGTAXBgNVBAMMEGluc2VydC1uYW1l +LWhlcmUxFDASBgoJkiaJk/IsZAEBDAQxMjM0MSAwHgYJKoZIhvcNAQkBFhF1c2Vy +QGRlZXBoYXZlbi5pbzETMBEGA1UECgwKbXktY29tcGFueTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALJBL+/inrRWKFLuUvRe7jcXLp7HQkmUYtIWsh2V +xN454EofknCc4oKt2HoTrotCbgYXiRwkU7f1t7j/9LfOO186AERFbQ+U0w1iacIO +EOT9+tAu0WAQL9Vxsgp+HJ/VSCMMCmgUwsK5DOSmKwUDLN8qCpcI32vhYwknwWUi +kr/CwZaHH6u4+GH4uIvGSdTYzwXP47CG6bkgJ91fy0061BYRAe59eMolwftWvIL1 +cqMyLCyxf1UZVP5f1BvnSp2twUeCPNjylI2yDUQjvnh4JywQIFbbmvNQDdh+inam +dN8jIzgWyqaSc7hjAiO+ZVFsiqrPlnRrSkMHf/zcv/A6WBECAwEAATANBgkqhkiG +9w0BAQsFAAOCAQEADF9pW71S13uFsQnsSnZemfZyCCtHA+YWX9pthUYAceNjKaSy +ZJIF6za9anoHsJALaBA22OnL/aWIbGR09/PTAlvxegSp8osxM+78AFycm80yWgq2 +WwVR5MrHP+ZrIcU2pJO7n9WJcVow+2Hs70eCDepHNTjEpAhU5nwBTmGbqXhFK910 +VgTxd25myswkuZ+yGpZmp9/d70v8h0BsiRFyJChYHnU82bS78iM6KMdv225Pr/Gb +WETlUQdFV+16l8/5jGmopOEgTlYkSXNnj4TijQmSXypFlaCPF+xG1KugbUW8b3L8 +Vx+SKflI1OzodSmZu1msVgSPerKVCYI67ZO4iQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDMzCCAhugAwIBAgIURTZ8mjnT9vkj+m0RYAxvoIETccgwDQYJKoZIhvcNAQEL +BQAwKTEnMCUGA1UEAwweZGVlcGhhdmVuLWxvY2FsaG9zdC10ZXN0aW5nLWNhMB4X +DTIyMDYxNTIyMTUwMVoXDTMyMDYxMjIyMTUwMVowKTEnMCUGA1UEAwweZGVlcGhh +dmVuLWxvY2FsaG9zdC10ZXN0aW5nLWNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLDoDpV8C0rbGH6SdhaH5mjnWUjGguR0RbFI+unNWLlPoKeqYOuU +14hZ0fFvPdYNc3mv7lDnfgCNsknaRpgCu8pRD36WeWn/3zmnp0WHeXnNYOsj8Zl4 +mFUMphssqBRUCbfU0KoHyfsEV4vjuH0/bUCAi0XyMiChXyX2YFaTBt2nW/nLgy+P +WXZbymv8GyW5FzL7ku/RcSLYPpagOe1B11i3nCYjQrS8i2WYuZNwbgMnnNK9gIoU +lF+d+fu9Bw9u80DX/HK4X4wOC6zuwlx34w2Eo5IymdRzhjaexaavEtCZSigOQ3zA +CiX7S+n5ROoyX0gb/6nqjptJVZ9NB3NGMQIDAQABo1MwUTAdBgNVHQ4EFgQUB8zS +XhDdPBvOo566PIDVnLA86mkwHwYDVR0jBBgwFoAUB8zSXhDdPBvOo566PIDVnLA8 +6mkwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEANnSJo523NPmX +n74jfzN9z+e256SsIsqI6OjrA38TV62Q3sebl8vABA/Mcukg2MOEN0mqinim35AZ +4i/zmMtn2Cn0FepnvPQ3WXzhD2DASUhwbF2KYzWLweGTdNzfGqes5vH2u7HTdixX +OvAIgwnVYmXJwqfCqiY0oVMaubDqbjGHKcQPppgS2HkF5kEUkj0n6yZxuL5gTx7d +bo7R/lA6Bk8+oKzB2QfHbv9XvF25I9Y0EOPDgPfOM4PiRDPFVMw6c/eZOor5hhR3 +yKWHw5RoA3+6+/jkmt3gXsNwiFfB/04XQlnN1PDojRstMwquGzRSlSJs+7zs2K9C +zifKG9FU0g== +-----END CERTIFICATE----- diff --git a/server/dev-certs/client.crt b/server/dev-certs/client.crt new file mode 100644 index 00000000000..8fc06ffd277 --- /dev/null +++ b/server/dev-certs/client.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDGDCCAgACFF0jg/VIBSTnfzLEXvSOAv5ovocFMA0GCSqGSIb3DQEBCwUAMCkx +JzAlBgNVBAMMHmRlZXBoYXZlbi1sb2NhbGhvc3QtdGVzdGluZy1jYTAeFw0yMjA4 +MDExODEyMTNaFw0zMjA3MjkxODEyMTNaMGgxGTAXBgNVBAMMEGluc2VydC1uYW1l +LWhlcmUxFDASBgoJkiaJk/IsZAEBDAQxMjM0MSAwHgYJKoZIhvcNAQkBFhF1c2Vy +QGRlZXBoYXZlbi5pbzETMBEGA1UECgwKbXktY29tcGFueTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALJBL+/inrRWKFLuUvRe7jcXLp7HQkmUYtIWsh2V +xN454EofknCc4oKt2HoTrotCbgYXiRwkU7f1t7j/9LfOO186AERFbQ+U0w1iacIO +EOT9+tAu0WAQL9Vxsgp+HJ/VSCMMCmgUwsK5DOSmKwUDLN8qCpcI32vhYwknwWUi +kr/CwZaHH6u4+GH4uIvGSdTYzwXP47CG6bkgJ91fy0061BYRAe59eMolwftWvIL1 +cqMyLCyxf1UZVP5f1BvnSp2twUeCPNjylI2yDUQjvnh4JywQIFbbmvNQDdh+inam +dN8jIzgWyqaSc7hjAiO+ZVFsiqrPlnRrSkMHf/zcv/A6WBECAwEAATANBgkqhkiG +9w0BAQsFAAOCAQEADF9pW71S13uFsQnsSnZemfZyCCtHA+YWX9pthUYAceNjKaSy +ZJIF6za9anoHsJALaBA22OnL/aWIbGR09/PTAlvxegSp8osxM+78AFycm80yWgq2 +WwVR5MrHP+ZrIcU2pJO7n9WJcVow+2Hs70eCDepHNTjEpAhU5nwBTmGbqXhFK910 +VgTxd25myswkuZ+yGpZmp9/d70v8h0BsiRFyJChYHnU82bS78iM6KMdv225Pr/Gb +WETlUQdFV+16l8/5jGmopOEgTlYkSXNnj4TijQmSXypFlaCPF+xG1KugbUW8b3L8 +Vx+SKflI1OzodSmZu1msVgSPerKVCYI67ZO4iQ== +-----END CERTIFICATE----- diff --git a/server/dev-certs/client.key b/server/dev-certs/client.key new file mode 100644 index 00000000000..ce7182d5c96 --- /dev/null +++ b/server/dev-certs/client.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCyQS/v4p60VihS +7lL0Xu43Fy6ex0JJlGLSFrIdlcTeOeBKH5JwnOKCrdh6E66LQm4GF4kcJFO39be4 +//S3zjtfOgBERW0PlNMNYmnCDhDk/frQLtFgEC/VcbIKfhyf1UgjDApoFMLCuQzk +pisFAyzfKgqXCN9r4WMJJ8FlIpK/wsGWhx+ruPhh+LiLxknU2M8Fz+Owhum5ICfd +X8tNOtQWEQHufXjKJcH7VryC9XKjMiwssX9VGVT+X9Qb50qdrcFHgjzY8pSNsg1E +I754eCcsECBW25rzUA3Yfop2pnTfIyM4FsqmknO4YwIjvmVRbIqqz5Z0a0pDB3/8 +3L/wOlgRAgMBAAECggEARSzpBoYCoudgpLZaOP1yIqz7aaDYR6evJeqq2rJZgQgi +04EnGk631JDUlqN2tBJmkjSl/+bVGmngD4o9FOuSvOTMX7I1nbtaoDIV6rn8snEh +2ZKhrE770TBbMJk6UIi7guZUT4nm/xxDNaSKw1o1GrG9BFnsIniIL3BfK/lby9CJ +7EWWupT0hL7Zfmx/iqswqWSdHFe4TLX1HTJ+Si3FmNUzQMmVfChOgdD02IAsjlt+ +n+kCzbwZc/nc9R/nShjVAtJsLTw+SGigrXa5YIWASFeGz5PTlUtGb5u39p8HEpCZ +Yxm8W3xwQeQKCUMVcF8m4ymB/zQMmsHQ6S8mHQFCcQKBgQDZ88sDEaYTEZYokJZk +7XmZp/UKhaoJyNfGkjnt4IZI9ovE+Lefv5q7ChNgyMLXcHoNnshvSd0db+rymWEH +T5zd1pyoKaIdYVZqWGjolUUsBpeNEjLOmGipsNC4k9/rDaD64iI1qw0+N+8osssX +aEZXgtjDcgUyvGk1UZbvrR3jbQKBgQDRX1HmGslgCZ6kV15WZHh9dgo2VeznJCsr +1+PUTGI/tIEe0tYpWP8367PD1PZKzvKmv62/pFW93KIlmBi5ZTIVexvs4jO7n490 +HVRRfcnwEM7gcMp3XpbeX5otDqRMTRkSkRcFpS3cm8xG5vqqVD3umxTHL2RP7Ptc +tOo+Qhc8tQKBgQCPYoa9VyAFzX0W5MA8V8q23rsjl/nchAgId+yqZRqS57fd9q5+ +5wO5ZxCGjK06JKH3Ue2U4WgZVKahwWwG7kZJ30Wij/k6EO5T+iPSV1lxdEjBoyZP +qg65DDzUIVyfe5DbXGebHRQSSaQKB0368TvNmKRYOCvZTAB+9lUxCpfuJQKBgQDI +y2W8DIx8Mj2W1sN+jzSO/hmlKprcwe81SQMSo37GIdKDQShq1xNNChuJAECEVhyY +ltOHK4+fWm2XKFrt0oNJ3ptVf0ql8cyeS1KGJOD5/uSokwNZn7mI4p71/0jKdFZL +XCJ8I4HsRO6QQQy9NbV/k/NFY8oMbPZUXp0XwEKQ0QKBgQDBL1NojykN7Au/uk80 +r1K+ScZPEpo3MgCwlMTX7zOTpX8QTiRKlvymAfF3jsBpI+PSh5SVUQ1uNRrD7GFR +SNWrgswwY+MQAqU/6u3WfVblTb1y9nvFrG03oQmVv0sUf2VmHeIZMlbabHzArfoO +YXJQf6pKow6LAa096myUw8Vt5w== +-----END PRIVATE KEY----- diff --git a/server/dev-certs/client.p12 b/server/dev-certs/client.p12 new file mode 100644 index 0000000000000000000000000000000000000000..901e8a32f5af8b1b31b4d28d00191b08cf7a1f7f GIT binary patch literal 3411 zcmai%XEYlQ_s1n-CN`yZTNG7dw?^$1V#F>%?Y-3|V%DZsjoP(Wt=6Vgg{oCstFdC! znAP(1IsgCp{a!vV?z!iFzvrI&?)y0xil)#30tlgK3L;`M{uuR`a|!?npa=~)1EC>5 zp=ihf6is6NuSHyhCei;Z{aqsX+tmMc08rz91|kY549fTK2!XPKNUIee13A`t(||xy z0w{!-^#85_$%qJ`Y{X<%G3o$2LJ)u-L~ZTD2m_BAOQ;+LF??oODnOx$SDVJt`peRpkRqQdL7=&0SPalayoZ!c=F(QvP5Ofsl&#akl~IMH|rpsd^h&+bYL*&1pt;`v#px0r;+^;L#`k3T^J z0!$<6Hd4>_(FR6O;J%sEVV(BM;W^&J0lAl#h%nbT5$Va*bX^y8p&w_BmYE`=gMYIZ zc_NZxYBy4u%gMx1d<{AlR1jYM*-#PF=p(1Mq4BzkUbrE-iLn9oMs&>TLAK4wjiRu% zNyPE_(L8LpS(0~hI(WsiGVa~Ai97DcuHeo6s0i(1w|RR#Ieb#`%(!!0%4_}#>If{` z!MS;ZKV&IRxGgP}x05SiFhPfup`a!0R9H6<=>>?O4&bNh2w@cpk&XovwfRM5&D{FK zI>y7A8IcsnP%08&IzU(M`oPQhJ-KTM$9kcP?Ecd;)n6EgyN4E-MZ3BgjJ82BW_aWN$-90_gh1oGL`+G)YoKkl@4X7zbQb|4eBjYfgRrK9$ zA1EUg`Q7S6&-rdylflkKY?f{nL}y8mEq^gLNMMY4qDi=y($s#{#D2FFpd%1nrEJ0u zp*5jC+Z1gK8xs`p9p3)==wsi|f)=(zMdap!h^FUPb*xqk2Hb)7be6Z=amvXgkg25`}LzMx3PhV?nlgU z{loeDLGEkE%MtO9Vc{l+!fH7!ppS&6ue!o`8kg9o-qKq9En(| zhaJ1^T>c+&4`*pO#do5~Qqq6oyoLNkd(HBx1c?~E#H~Y`8wQUPxw%BA5a=vrxpy)T zEN5dve`Rls_YR5GFK7Lj$JN5`w61?9fJqZ>PPew;4=H%*qcEzw=AZW$G2Trfl#=pM zGDr{F6L~6w@43s`y!wLHQv$toWfbr5V&3r{m)w(n%{j!D`GIt4g-xv5O4WSbJS&w& z@4a5tbT~frw!e2Z!LgN8nsrr3*uD*Q>UlegbWR!u&=+3}OX5drzEQA0?l!zbpztcD zqL+CKCTxwj*!nt>R2e^2Qg&^`wDySWs>zbZz=)#*JFU0S9LZQ1i;gk`9*sBh)^B=J z-7{iQO1!ozZd)xW#0ILDmQ&W`V_Rfp{0Lxj{DVntKZxc~Pn-##4pljW-kRz9`>DH@ zr1D8f2ZG}d4%g}gFhYsh4ph5%yn{wf=Y+hkiaVJB%O8N60E_19@N9nA&XEh)XxvLm zTqf3U!~=dg!>(%8u!^5d&Hmb$#GSoo_Za2;d?ld9>y6sQGcXO87LF7w$&hyTDyqu| z!bakPHHBkdgq)y$KvqTSQnHaR4#x651wudm;S=xps+-br6n(O#8s9}-_q}_M)m=#T z=_@Zbemie&*}Jo$_bz>cVG%$+UvC_;OBXTu#wm4So5jMU3kj3b&VMmmmM^e(?#^f& zL4Dzi;708{9_t<~kzEBpdu&SlaysBv=foBW((Ap}lHj>=wqm*QM*;1H12E+_932z* zL?kv!!;WF0f<=DwicR=D%P|WQ3zuXzo#-DK!m<;lDBrZp_)Drm(@8h*+{ZfZ@m~Ve z$U-(Y{w#L=0Y!!CQt;GS^IRgIOHMFN)n}3`_ilt|{bdC`Z_B<-Ofsq-I39#f{=gs- z?);s87>KJmZR>j%3bs}=9-|VI8kHLKVcB_8Yp3aIKg@b-bYJC0exP$wN#~r$0FvNH zKdyIT2$fCE?4UC4rj}Dt?yt;!v%w|`%R&X=2ymG$`I@Yvo?$M_1FjagCIObsfkmgGyp z*-83mpgJE4{m$YGhHL+~ZA#-CDmx(L_=I@bbR^Ch`NJiM;;G zZhy;(82tZihL8h*e@)@P;=}(1+@DnM5D2~0u>T2Msw$Mr@A6oTywy#gmAzXQ2o0KG zsCgMSvG*xsfO1|$V+(Cxo-UAaRzpSC3e(Z*TmNdEw3s9CZS@aCpz1 zJ9AeDoc&qb@@@s*w^uI=lCem^dH;4>?*&|;Pb!Z-$so{6>t&Y zDoJ=_=`+->(SfejUw9-Ti*UZcROgjFyC=%iq7>Xm}`svjBWE}%t=YQ zD1s85y|=hEA72wKoV_7*6!!tgq+&sfj! z2`z8flX(UQ%V4tf?O+q+nN8z-a8J)1?H5xD!;q-N-Y*Dd&qX?kLhkr{`I&s^`BRxa zmGRLyB}4AAio5-9?hBeGE~chA?z_^(vuoZ?Mn+G=-Uy%>f0RWFn>mIx?yLHHsws>+wH=Hki!#yb9Jp}L$_CZ7)Jw)=hx~ET*}V2 z$H{5Ksesqf`9in(Qmzs}2i&Op&t-O}HPDY2KZ`UMyeM?t+O=oZur&8}c(8r?t-ljuU1uH;Yd6EP>}18$fy501(%Hqk8AX~| zJJXYHb zNFUOC-Z83-5Djd`h2gHIva*xjDp7j(EEjy+-i6mc$tb%o4LEhF%H67`)|Ukro$5TU zJIU{(J?g4Ws{LK(3}S|j#`}q6qw1SFQbfOT@fq()J=;B6imKQ%_NAtKtGv6OS9`l< z!d!g6AD;Wba31tivH<$vAv^jU?&a9P6V%r&Yl+bAl@%w#(*DtJh#Xv!c>lf_sbzY- zh&aRs?R1wiw7m3Jq%t~dp9x}#7Whr!SV5b@Ub)fo&`B>M@T-J#82PM>6+Dx6Kx-Tw zIKlLOo^-1E)>Q$+Swk4u#StGS6B5um_9c8z?R+7F&o&N&nrP?klMP|2I*Tq{M){YU zTVG0NcnH@8o7Z+(mnC0O!OzTa;caAzzB}7FiS00O#bx)Rwl~6u_LKa?QZ1-Rjza|# z`3%CKRMF?;M>DfP{QO6ELH~lD`2Dn&;e;hb;#O%(dUsYSQX3Vd5Y`Jv8GaOmN|Y(6 zaVVQM+p3!UwpK!r2H))%Cmer5b45IEHr+h4b#}d89kAtW{Q|&p$o5?%Gj0G@ZAy36 zMt)VEY^#7XDUkATXTeYWPM?bNS&d>~H!c>OA7gkNULnj4z4uSRk}(M10?~7v1=U(e zTb#^s7xruSi=*!!UhP+=&=Kko<-KturIq+E}`%?*ld+YG1AAo!(!4JDGndiik| aj@xTZEalDq29X-^mPi6h; Optional> getTransportCertificates(ServerCall call) { + return Optional.ofNullable(call.getAttributes().get(GrpcServlet.MTLS_CERTIFICATE_KEY)); + } +} diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerModule.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerModule.java index a5bb4eede42..2475fc38562 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerModule.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerModule.java @@ -37,6 +37,9 @@ static ServletAdapter provideGrpcServletAdapter( serverBuilder.maxInboundMessageSize(maxMessageSize); serverBuilder.directExecutor(); + + serverBuilder.intercept(new JettyCertInterceptor()); + return serverBuilder.buildServletAdapter(); } } diff --git a/server/netty-app/README.md b/server/netty-app/README.md index 65ea47a3339..532cbcc5703 100644 --- a/server/netty-app/README.md +++ b/server/netty-app/README.md @@ -53,6 +53,67 @@ To bring up a SSL-enabled server on port 8443 with a development key and certifi ./gradlew server-netty-app:run -Pgroovy -PdevCerts ``` -SSL configuration can be applied manually with the properties "ssl.identity.type", "ssl.identity.certChainPath", and -"ssl.identity.privateKeyPath". See the javadocs on `io.deephaven.server.netty.NettyConfig` and -`io.deephaven.server.runner.Main.parseSSLConfig` for more information. +SSL configuration can be applied manually with the properties "ssl.identity.type", "ssl.identity.certChainPath", +"ssl.identity.privateKeyPath", "ssl.trust.type", and "ssl.trust.path". Furthermore, outbound Deephaven-to-Deephaven +connections can be explicitly configured separately if desired, with the same properties prefixed with "outbound.". +See the javadocs on `io.deephaven.server.netty.NettyConfig` and `io.deephaven.server.runner.Main.parseSSLConfig` for +more information. + +### SSL examples + +#### Simple + +```properties +ssl.identity.type=privatekey +ssl.identity.certChainPath=server.chain.crt +ssl.identity.privateKeyPath=server.key +``` + +This is a common setup where the server specifies a private key and certificate chain. The certificate can be signed +either by a public CA or an internal CA. + +#### Intranet + +```properties +ssl.identity.type=privatekey +ssl.identity.certChainPath=server.chain.crt +ssl.identity.privateKeyPath=server.key +ssl.trust.type=certs +ssl.trust.path=ca.crt +``` + +This is a common intranet setup where the server additionally specifies a trust certificate. Most often, this will be a +pattern used by organizations with an internal CA. + +Outbound initiated Deephaven-to-Deephaven connections will trust other servers that can be verified via ca.crt or the +JDK trust stores. + +#### Zero-trust / Mutual TLS + +```properties +ssl.identity.type=privatekey +ssl.identity.certChainPath=server.chain.crt +ssl.identity.privateKeyPath=server.key +ssl.trust.type=certs +ssl.trust.path=ca.crt +ssl.clientAuthentication=NEEDED +``` + +This is a setup where the server additionally specifies that mutual TLS is required. This may be used to publicly expose +a server without the need to setup a VPN, or for high security intranet needs. + +Inbound connections need to be verifiable via ca.crt. Outbound initiated Deephaven-to-Deephaven connections will trust +other servers that can be verified via ca.crt or the JDK trust stores. + +#### Outbound + +```properties +outbound.ssl.identity.type=privatekey +outbound.ssl.identity.certChainPath=outbound-identity.chain.crt +outbound.ssl.identity.privateKeyPath=outbound-identity.key +outbound.ssl.trust.type=certs +outbound.ssl.trust.path=outbound-ca.crt +``` + +In all of the above cases, the outbound Deephaven-to-Deephaven connections can be configured separately from the +server's inbound configuration. diff --git a/server/netty-app/build.gradle b/server/netty-app/build.gradle index b1ed410e697..0df87ce4857 100644 --- a/server/netty-app/build.gradle +++ b/server/netty-app/build.gradle @@ -41,12 +41,20 @@ if (!hasProperty('excludeHotspotImpl')) { extraJvmArgs += ['--add-opens', 'java.management/sun.management=ALL-UNNAMED'] } -if (hasProperty('devCerts')) { +if (hasProperty('devCerts') || hasProperty('devMTLS')) { extraJvmArgs += [ '-Dhttp.port=8443', '-Dssl.identity.type=privatekey', - '-Dssl.identity.certChainPath=../dev-certs/ca.crt', - '-Dssl.identity.privateKeyPath=../dev-certs/key.pem'] + '-Dssl.identity.certChainPath=../dev-certs/server.chain.crt', + '-Dssl.identity.privateKeyPath=../dev-certs/server.key', + ] + if (hasProperty('devMTLS')) { + extraJvmArgs += [ + '-Dssl.trust.type=certs', + '-Dssl.trust.path=../dev-certs/ca.crt', + '-Dssl.clientAuthentication=NEEDED', + ] + } } if (hasProperty('debug')) { diff --git a/server/netty/build.gradle b/server/netty/build.gradle index b978b40ca76..20864ade011 100644 --- a/server/netty/build.gradle +++ b/server/netty/build.gradle @@ -19,6 +19,8 @@ dependencies { implementation project(':ssl-kickstart') Classpaths.inheritSSLContext(project, 'sslcontext-kickstart-for-netty') + implementation project(':grpc-java:grpc-mtls') + testImplementation project(':server-test') testRuntimeOnly project(':log-to-slf4j') diff --git a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java index 922936acdb3..51e95cebc1c 100644 --- a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java +++ b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java @@ -7,11 +7,9 @@ import dagger.Module; import dagger.Provides; import io.deephaven.UncheckedDeephavenException; +import io.deephaven.grpc.MTlsCertificate; import io.deephaven.server.config.ServerConfig; import io.deephaven.server.runner.GrpcServer; -import io.deephaven.ssl.config.CiphersJdk; -import io.deephaven.ssl.config.Protocols; -import io.deephaven.ssl.config.ProtocolsJdk; import io.deephaven.ssl.config.SSLConfig; import io.deephaven.ssl.config.TrustJdk; import io.deephaven.ssl.config.impl.KickstartUtils; @@ -49,6 +47,7 @@ static GrpcServer serverBuilder( } services.forEach(serverBuilder::addService); interceptors.forEach(serverBuilder::intercept); + serverBuilder.intercept(MTlsCertificate.DEFAULT_INTERCEPTOR); serverBuilder.maxInboundMessageSize(serverConfig.maxInboundMessageSize()); if (serverConfig.ssl().isPresent()) { final SSLConfig ssl = serverConfig.ssl().get().orTrust(TrustJdk.of()); diff --git a/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java b/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java index 23d4619ba9f..40fcf1d7847 100644 --- a/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java +++ b/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java @@ -9,6 +9,7 @@ import javax.inject.Inject; public class TrivialAuthContextProvider implements AuthContextProvider { + @Inject() public TrivialAuthContextProvider() {} @@ -22,7 +23,6 @@ public AuthContext authenticate(final long protocolVersion, final ByteString pay if (!supportsProtocol(protocolVersion)) { return null; } - return new AuthContext.SuperUser(); } } diff --git a/server/src/main/java/io/deephaven/server/config/ServerConfig.java b/server/src/main/java/io/deephaven/server/config/ServerConfig.java index 4cb7dd6f68a..9db2b3a4467 100644 --- a/server/src/main/java/io/deephaven/server/config/ServerConfig.java +++ b/server/src/main/java/io/deephaven/server/config/ServerConfig.java @@ -62,7 +62,8 @@ public interface ServerConfig { * *

    * - * Also parses {@link Main#parseSSLConfig(Configuration)} into {@link Builder#ssl(SSLConfig)}. + * Also parses {@link Main#parseSSLConfig(Configuration)} into {@link Builder#ssl(SSLConfig)} and + * {@link Main#parseOutboundSSLConfig(Configuration)} into {@link Builder#outboundSsl(SSLConfig)}. * * @param builder the builder * @param config the configuration @@ -92,6 +93,7 @@ static > B buildFromConfig(B builder, Configuration conf builder.maxInboundMessageSize(maxInboundMessageSize); } Main.parseSSLConfig(config).ifPresent(builder::ssl); + Main.parseOutboundSSLConfig(config).ifPresent(builder::outboundSsl); return builder; } @@ -111,6 +113,11 @@ static > B buildFromConfig(B builder, Configuration conf */ Optional ssl(); + /** + * The optional outbound SSL configuration. + */ + Optional outboundSsl(); + /** * The token expiration. Defaults to {@value DEFAULT_TOKEN_EXPIRE_MIN} minutes. */ @@ -142,6 +149,8 @@ interface Builder> { B ssl(SSLConfig ssl); + B outboundSsl(SSLConfig outboundSsl); + B tokenExpire(Duration duration); B schedulerPoolSize(int schedulerPoolSize); diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiConfigModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiConfigModule.java index b275f7736c8..376bf26c019 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiConfigModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiConfigModule.java @@ -6,6 +6,9 @@ import dagger.Module; import dagger.Provides; import io.deephaven.server.config.ServerConfig; +import io.deephaven.ssl.config.SSLConfig; +import io.deephaven.ssl.config.Trust; +import io.deephaven.ssl.config.TrustJdk; import javax.inject.Named; @@ -35,4 +38,19 @@ public static long providesSessionTokenExpireTmMs(ServerConfig config) { public static int providesMaxInboundMessageSize(ServerConfig config) { return config.maxInboundMessageSize(); } + + /** + * The client SSL configuration is the first of {@link ServerConfig#outboundSsl()}, {@link ServerConfig#ssl()}, or + * {@link SSLConfig#empty()}. In addition, {@link TrustJdk} is mixed-in. + * + * @param config the server configuration + * @return the client SSL configuration + */ + @Provides + @Named("client.sslConfig") + public static SSLConfig providesSSLConfigForClient(ServerConfig config) { + final SSLConfig clientSslConfig = config.outboundSsl().or(config::ssl).orElseGet(SSLConfig::empty); + final Trust trustPlusJdk = clientSslConfig.trust().orElse(TrustJdk.of()).or(TrustJdk.of()); + return clientSslConfig.withTrust(trustPlusJdk); + } } diff --git a/server/src/main/java/io/deephaven/server/runner/Main.java b/server/src/main/java/io/deephaven/server/runner/Main.java index eb52f2c7528..79f66016a26 100644 --- a/server/src/main/java/io/deephaven/server/runner/Main.java +++ b/server/src/main/java/io/deephaven/server/runner/Main.java @@ -9,8 +9,9 @@ import io.deephaven.io.logger.LogBufferGlobal; import io.deephaven.io.logger.LogBufferInterceptor; import io.deephaven.io.logger.Logger; -import io.deephaven.ssl.config.IdentityPrivateKey; -import io.deephaven.ssl.config.SSLConfig; +import io.deephaven.ssl.config.*; +import io.deephaven.ssl.config.SSLConfig.Builder; +import io.deephaven.ssl.config.SSLConfig.ClientAuth; import io.deephaven.util.process.ProcessEnvironment; import org.jetbrains.annotations.NotNull; import org.slf4j.bridge.SLF4JBridgeHandler; @@ -25,7 +26,11 @@ public class Main { public static final String SSL_IDENTITY_TYPE = "ssl.identity.type"; public static final String SSL_IDENTITY_CERT_CHAIN_PATH = "ssl.identity.certChainPath"; public static final String SSL_IDENTITY_PRIVATE_KEY_PATH = "ssl.identity.privateKeyPath"; + public static final String SSL_TRUST_TYPE = "ssl.trust.type"; + public static final String SSL_TRUST_PATH = "ssl.trust.path"; + public static final String SSL_CLIENT_AUTH = "ssl.clientAuthentication"; public static final String PRIVATEKEY = "privatekey"; + public static final String CERTS = "certs"; private static void bootstrapSystemProperties(String[] args) throws IOException { if (args.length > 1) { @@ -88,29 +93,83 @@ public static Configuration init(String[] args, Class mainClass) throws IOExc } /** - * Parses the configuration properties {@value SSL_IDENTITY_TYPE}, {@value SSL_IDENTITY_CERT_CHAIN_PATH}, and - * {@value SSL_IDENTITY_PRIVATE_KEY_PATH}. Currently, the only valid identity type is {@value PRIVATEKEY}. + * Parses the configuration properties {@value SSL_IDENTITY_TYPE}, {@value SSL_IDENTITY_CERT_CHAIN_PATH}, + * {@value SSL_IDENTITY_PRIVATE_KEY_PATH}, {@value SSL_TRUST_TYPE}, {@value SSL_TRUST_PATH}, and + * {@value SSL_CLIENT_AUTH}. Currently, the only valid identity type is {@value PRIVATEKEY}, and the only valid + * trust type is {@value CERTS}. If no identity is present, empty will be returned. * * @param config the config * @return the optional SSL config */ public static Optional parseSSLConfig(Configuration config) { - String sslType = config.getStringWithDefault(SSL_IDENTITY_TYPE, null); - if (sslType == null) { + return parseSSLConfig(null, config, true); + } + + /** + * Parser the same properties as {@link #parseSSLConfig(Configuration)}, except with property keys prefixed with + * "outbound.". Identity configuration is not required. + * + * @param config the config + * @return the optional outbound SSL config + */ + public static Optional parseOutboundSSLConfig(Configuration config) { + return parseSSLConfig("outbound.", config, false); + } + + private static Optional parseSSLConfig(String prefix, Configuration config, boolean needsIdentity) { + final Optional identity = parseIdentityConfig(prefix, config); + if (needsIdentity && identity.isEmpty()) { + return Optional.empty(); + } + final Builder builder = SSLConfig.builder(); + identity.ifPresent(builder::identity); + parseTrustConfig(prefix, config).ifPresent(builder::trust); + parseClientAuth(prefix, config).ifPresent(builder::clientAuthentication); + return Optional.of(builder.build()); + } + + private static Optional parseIdentityConfig(String prefix, Configuration config) { + final String identityType = config.getStringWithDefault(prefix(prefix, SSL_IDENTITY_TYPE), null); + if (identityType == null) { return Optional.empty(); } - if (!PRIVATEKEY.equals(sslType)) { + if (!PRIVATEKEY.equals(identityType)) { throw new IllegalArgumentException( String.format("Only support `%s` identity type through Configuration", PRIVATEKEY)); } - String identityCa = config.getStringWithDefault(SSL_IDENTITY_CERT_CHAIN_PATH, null); - String identityKey = config.getStringWithDefault(SSL_IDENTITY_PRIVATE_KEY_PATH, null); + final String identityCa = config.getStringWithDefault(prefix(prefix, SSL_IDENTITY_CERT_CHAIN_PATH), null); + final String identityKey = config.getStringWithDefault(prefix(prefix, SSL_IDENTITY_PRIVATE_KEY_PATH), null); if (identityCa == null || identityKey == null) { - throw new IllegalArgumentException(String.format("Must specify `%s` and `%s`", SSL_IDENTITY_CERT_CHAIN_PATH, - SSL_IDENTITY_PRIVATE_KEY_PATH)); + throw new IllegalArgumentException(String.format("Must specify `%s` and `%s`", + prefix(prefix, SSL_IDENTITY_CERT_CHAIN_PATH), prefix(prefix, SSL_IDENTITY_PRIVATE_KEY_PATH))); + } + return Optional.of(IdentityPrivateKey.builder().certChainPath(identityCa).privateKeyPath(identityKey).build()); + } + + private static Optional parseTrustConfig(String prefix, Configuration config) { + final String trustType = config.getStringWithDefault(prefix(prefix, SSL_TRUST_TYPE), null); + if (trustType == null) { + return Optional.empty(); } - IdentityPrivateKey identity = - IdentityPrivateKey.builder().certChainPath(identityCa).privateKeyPath(identityKey).build(); - return Optional.of(SSLConfig.builder().identity(identity).build()); + if (!CERTS.equals(trustType)) { + throw new IllegalArgumentException( + String.format("Only support `%s` trust type through Configuration", CERTS)); + } + final String trustPath = config.getStringWithDefault(prefix(prefix, SSL_TRUST_PATH), null); + return Optional.ofNullable(trustPath) + .map(TrustCertificates::of) + .or(() -> { + throw new IllegalArgumentException( + String.format("Must specify `%s`", prefix(prefix, SSL_TRUST_PATH))); + }); + } + + private static Optional parseClientAuth(String prefix, Configuration config) { + final String clientAuth = config.getStringWithDefault(prefix(prefix, SSL_CLIENT_AUTH), null); + return Optional.ofNullable(clientAuth).map(ClientAuth::valueOf); + } + + private static String prefix(String prefix, String key) { + return prefix != null ? prefix + key : key; } } diff --git a/server/src/main/java/io/deephaven/server/runner/NettyServerBuilderModule.java b/server/src/main/java/io/deephaven/server/runner/NettyServerBuilderModule.java deleted file mode 100644 index e7741dcc886..00000000000 --- a/server/src/main/java/io/deephaven/server/runner/NettyServerBuilderModule.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.runner; - -import dagger.Module; -import dagger.Provides; -import io.grpc.ServerBuilder; - -import javax.inject.Named; - -@Module -public class NettyServerBuilderModule { - - @Provides - static ServerBuilder serverBuilder(final @Named("http.port") int port) { - return ServerBuilder.forPort(port); - } -} diff --git a/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java b/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java index c005f7201a7..29c6fb410c4 100644 --- a/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java +++ b/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java @@ -6,11 +6,11 @@ import dagger.Module; import dagger.Provides; import io.deephaven.extensions.barrage.util.DefensiveDrainable; +import io.deephaven.ssl.config.SSLConfig; import io.grpc.BindableService; import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; import io.grpc.ManagedChannelBuilder; import io.grpc.Metadata; -import io.grpc.ServerBuilder; import io.grpc.ServerCall; import io.grpc.ServerCall.Listener; import io.grpc.ServerCallHandler; @@ -56,6 +56,12 @@ static ManagedChannelBuilder channelBuilder(@Named("serverName") String serve return InProcessChannelBuilder.forName(serverName); } + @Provides + @Named("client.sslConfig") + static SSLConfig providesSSLConfigForClient() { + return SSLConfig.empty(); + } + /** * Deephaven has some defensive implementations of Drainable / InputStream that don't actually implement the read * methods of InputStream. This works when going over the wire, but when doing an in-process exchange, the defensive diff --git a/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java b/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java index 76e9f0a13c9..3135b19fbf6 100644 --- a/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java +++ b/server/src/main/java/io/deephaven/server/uri/BarrageTableResolver.java @@ -12,6 +12,7 @@ import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; import io.deephaven.qst.table.TableSpec; import io.deephaven.qst.table.TicketTable; +import io.deephaven.ssl.config.SSLConfig; import io.deephaven.uri.ApplicationUri; import io.deephaven.uri.DeephavenTarget; import io.deephaven.uri.DeephavenUri; @@ -25,6 +26,7 @@ import org.apache.arrow.memory.BufferAllocator; import javax.inject.Inject; +import javax.inject.Named; import javax.inject.Singleton; import java.net.URI; import java.util.*; @@ -71,14 +73,18 @@ public static BarrageTableResolver get() { private final BufferAllocator allocator; + private final SSLConfig sslConfig; + private final Map sessions; @Inject public BarrageTableResolver( - BarrageSessionFactoryBuilder builder, ScheduledExecutorService executor, BufferAllocator allocator) { + BarrageSessionFactoryBuilder builder, ScheduledExecutorService executor, BufferAllocator allocator, + @Named("client.sslConfig") SSLConfig sslConfig) { this.builder = Objects.requireNonNull(builder); this.executor = Objects.requireNonNull(executor); this.allocator = Objects.requireNonNull(allocator); + this.sslConfig = Objects.requireNonNull(sslConfig); this.sessions = new ConcurrentHashMap<>(); } @@ -293,6 +299,7 @@ private BarrageSession newSession(DeephavenTarget target) { return newSession(ClientConfig.builder() .target(target) .maxInboundMessageSize(MAX_INBOUND_MESSAGE_SIZE) + .ssl(sslConfig) .build()); } diff --git a/settings.gradle b/settings.gradle index 2985969e0c8..493a58c4508 100644 --- a/settings.gradle +++ b/settings.gradle @@ -53,6 +53,7 @@ include 'combined-javadoc' include 'grpc-java:grpc-servlet-jakarta' include 'grpc-java:grpc-servlet-websocket-jakarta' +include 'grpc-java:grpc-mtls' include 'DHProcess' include 'proto:proto-backplane-grpc' diff --git a/ssl/config/build.gradle b/ssl/config/build.gradle index 70a37c98161..d10e048e553 100644 --- a/ssl/config/build.gradle +++ b/ssl/config/build.gradle @@ -25,3 +25,7 @@ dependencies { test { useJUnitPlatform() } + +project.tasks.named('quick').configure { + dependsOn test +} diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/SSLConfig.java b/ssl/config/src/main/java/io/deephaven/ssl/config/SSLConfig.java index 503240e8fe2..9bc55375c9c 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/SSLConfig.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/SSLConfig.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.deephaven.annotations.BuildableStyle; +import org.immutables.value.Value; import org.immutables.value.Value.Default; import org.immutables.value.Value.Immutable; @@ -69,32 +70,26 @@ public static SSLConfig parseJson(URL url) throws IOException { public abstract Optional ciphers(); /** - * Client authentication. Defaults to {@link ClientAuth#NONE NONE}. + * The optional client authentication. */ - @Default - public ClientAuth clientAuthentication() { - return ClientAuth.NONE; - } + public abstract Optional clientAuthentication(); - public final SSLConfig orTrust(Trust defaultTrust) { - if (trust().isPresent()) { - return this; - } - return ((ImmutableSSLConfig) this).withTrust(defaultTrust); + public abstract SSLConfig withTrust(Trust trust); + + public abstract SSLConfig withProtocols(Protocols protocols); + + public abstract SSLConfig withCiphers(Ciphers ciphers); + + public final SSLConfig orTrust(Trust trust) { + return trust().isPresent() ? this : withTrust(trust); } - public final SSLConfig orProtocols(Protocols defaultProtocols) { - if (protocols().isPresent()) { - return this; - } - return ((ImmutableSSLConfig) this).withProtocols(defaultProtocols); + public final SSLConfig orProtocols(Protocols protocols) { + return protocols().isPresent() ? this : withProtocols(protocols); } - public final SSLConfig orCiphers(Ciphers defaultCiphers) { - if (ciphers().isPresent()) { - return this; - } - return ((ImmutableSSLConfig) this).withCiphers(defaultCiphers); + public final SSLConfig orCiphers(Ciphers ciphers) { + return ciphers().isPresent() ? this : withCiphers(ciphers); } public enum ClientAuth { @@ -114,4 +109,16 @@ public interface Builder { SSLConfig build(); } + + @Value.Check + final void checkMutualTLS() { + if (clientAuthentication().orElse(ClientAuth.NONE) != ClientAuth.NONE) { + if (!trust().isPresent()) { + throw new IllegalArgumentException("Trust material must be present when requesting mutual TLS"); + } + if (!identity().isPresent()) { + throw new IllegalArgumentException("Identity material must be present when requesting mutual TLS"); + } + } + } } diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/Trust.java b/ssl/config/src/main/java/io/deephaven/ssl/config/Trust.java index aca19a366ea..6e48160cb15 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/Trust.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/Trust.java @@ -33,6 +33,10 @@ public interface Trust { T walk(Visitor visitor); + boolean contains(Trust trust); + + Trust or(Trust other); + interface Visitor { T visit(TrustStore trustStore); diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustAll.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustAll.java index 4491191a216..c8199f64545 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustAll.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustAll.java @@ -13,7 +13,7 @@ @Immutable @SimpleStyle @JsonDeserialize(as = ImmutableTrustAll.class) -public abstract class TrustAll implements Trust { +public abstract class TrustAll extends TrustBase { public static TrustAll of() { return ImmutableTrustAll.of(); @@ -23,4 +23,14 @@ public static TrustAll of() { public final T walk(Visitor visitor) { return visitor.visit(this); } + + @Override + public final boolean contains(Trust trust) { + return true; + } + + @Override + public final Trust or(Trust other) { + return this; + } } diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustBase.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustBase.java new file mode 100644 index 00000000000..feb0e516bcd --- /dev/null +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustBase.java @@ -0,0 +1,20 @@ +package io.deephaven.ssl.config; + +public abstract class TrustBase implements Trust { + + @Override + public boolean contains(Trust trust) { + return equals(trust); + } + + @Override + public Trust or(Trust other) { + if (contains(other)) { + return this; + } + if (other.contains(this)) { + return other; + } + return TrustList.of(this, other); + } +} diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustCertificates.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustCertificates.java index 39b1651465c..103f7cc3b06 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustCertificates.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustCertificates.java @@ -17,7 +17,7 @@ @Immutable @BuildableStyle @JsonDeserialize(as = ImmutableTrustCertificates.class) -public abstract class TrustCertificates implements Trust { +public abstract class TrustCertificates extends TrustBase { public static TrustCertificates of(String... path) { return ImmutableTrustCertificates.builder().addPath(path).build(); diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustJdk.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustJdk.java index d16795d61a1..212b0c78277 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustJdk.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustJdk.java @@ -13,7 +13,7 @@ @Immutable @SimpleStyle @JsonDeserialize(as = ImmutableTrustJdk.class) -public abstract class TrustJdk implements Trust { +public abstract class TrustJdk extends TrustBase { public static TrustJdk of() { return ImmutableTrustJdk.of(); diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustList.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustList.java index 7031a3b1cb3..2eeb9e6bc8a 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustList.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustList.java @@ -16,7 +16,7 @@ @Immutable @BuildableStyle @JsonDeserialize(as = ImmutableTrustList.class) -public abstract class TrustList implements Trust { +public abstract class TrustList extends TrustBase { public static TrustList of(Trust... elements) { return ImmutableTrustList.builder().addValues(elements).build(); @@ -33,6 +33,22 @@ public final T walk(Visitor visitor) { return visitor.visit(this); } + @Override + public final boolean contains(Trust trust) { + return values().stream().anyMatch(t -> t.contains(trust)); + } + + @Override + public final Trust or(Trust other) { + if (contains(other)) { + return this; + } + if (other.contains(this)) { + return other; + } + return ImmutableTrustList.builder().addAllValues(values()).addValues(other).build(); + } + @Check final void checkNonEmpty() { if (values().isEmpty()) { diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustProperties.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustProperties.java index 500e62818e0..60656776ca6 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustProperties.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustProperties.java @@ -14,7 +14,7 @@ @Immutable @SimpleStyle @JsonDeserialize(as = ImmutableTrustProperties.class) -public abstract class TrustProperties implements Trust { +public abstract class TrustProperties extends TrustBase { public static TrustProperties of() { return ImmutableTrustProperties.of(); diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustStore.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustStore.java index 47810bf40f2..852796cb0d5 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustStore.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustStore.java @@ -13,7 +13,7 @@ @Immutable @BuildableStyle @JsonDeserialize(as = ImmutableTrustStore.class) -public abstract class TrustStore implements Trust { +public abstract class TrustStore extends TrustBase { public static TrustStore of(String path, String password) { return ImmutableTrustStore.builder().path(path).password(password).build(); } diff --git a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustSystem.java b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustSystem.java index 082d86fa1d1..6283504ae7d 100644 --- a/ssl/config/src/main/java/io/deephaven/ssl/config/TrustSystem.java +++ b/ssl/config/src/main/java/io/deephaven/ssl/config/TrustSystem.java @@ -13,7 +13,7 @@ @Immutable @SimpleStyle @JsonDeserialize(as = ImmutableTrustSystem.class) -public abstract class TrustSystem implements Trust { +public abstract class TrustSystem extends TrustBase { public static TrustSystem of() { return ImmutableTrustSystem.of(); diff --git a/ssl/config/src/test/java/io/deephaven/ssl/config/SSLConfigTest.java b/ssl/config/src/test/java/io/deephaven/ssl/config/SSLConfigTest.java index b92d9026b41..20806b75b99 100644 --- a/ssl/config/src/test/java/io/deephaven/ssl/config/SSLConfigTest.java +++ b/ssl/config/src/test/java/io/deephaven/ssl/config/SSLConfigTest.java @@ -140,12 +140,20 @@ void protocolsJdk() throws IOException { @Test void clientAuthenticationWanted() throws IOException { - check("client-authentication-wanted.json", SSLConfig.builder().clientAuthentication(ClientAuth.WANTED).build()); + check("client-authentication-wanted.json", SSLConfig.builder() + .clientAuthentication(ClientAuth.WANTED) + .trust(TrustJdk.of()) + .identity(IdentityProperties.of()) + .build()); } @Test void clientAuthenticationNeeded() throws IOException { - check("client-authentication-needed.json", SSLConfig.builder().clientAuthentication(ClientAuth.NEEDED).build()); + check("client-authentication-needed.json", SSLConfig.builder() + .clientAuthentication(ClientAuth.NEEDED) + .trust(TrustJdk.of()) + .identity(IdentityProperties.of()) + .build()); } private static SSLConfig server(Identity identity) { diff --git a/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-needed.json b/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-needed.json index e485ca95b41..e9f2c2b1cc4 100644 --- a/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-needed.json +++ b/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-needed.json @@ -1,3 +1,9 @@ { - "clientAuthentication": "NEEDED" + "clientAuthentication": "NEEDED", + "trust": { + "type": "jdk" + }, + "identity": { + "type": "properties" + } } diff --git a/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-wanted.json b/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-wanted.json index 5cbf8e7bcd8..a85d3c9996b 100644 --- a/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-wanted.json +++ b/ssl/config/src/test/resources/io/deephaven/ssl/config/client-authentication-wanted.json @@ -1,3 +1,9 @@ { - "clientAuthentication": "WANTED" + "clientAuthentication": "WANTED", + "trust": { + "type": "jdk" + }, + "identity": { + "type": "properties" + } } diff --git a/ssl/config/src/test/resources/io/deephaven/ssl/config/default-explicit.json b/ssl/config/src/test/resources/io/deephaven/ssl/config/default-explicit.json index 75d6c05b695..3fca23b1337 100644 --- a/ssl/config/src/test/resources/io/deephaven/ssl/config/default-explicit.json +++ b/ssl/config/src/test/resources/io/deephaven/ssl/config/default-explicit.json @@ -3,5 +3,5 @@ "trust": null, "ciphers": null, "protocols": null, - "clientAuthentication": "NONE" + "clientAuthentication": null } diff --git a/ssl/kickstart/src/main/java/io/deephaven/ssl/config/impl/KickstartUtils.java b/ssl/kickstart/src/main/java/io/deephaven/ssl/config/impl/KickstartUtils.java index c3a835c5ad4..b8baa0373ca 100644 --- a/ssl/kickstart/src/main/java/io/deephaven/ssl/config/impl/KickstartUtils.java +++ b/ssl/kickstart/src/main/java/io/deephaven/ssl/config/impl/KickstartUtils.java @@ -53,18 +53,7 @@ public static SSLFactory create(SSLConfig config) { config.trust().ifPresent(trust -> addTrust(builder, trust)); config.protocols().ifPresent(protocols -> addProtocols(builder, protocols)); config.ciphers().ifPresent(ciphers -> addCiphers(builder, ciphers)); - switch (config.clientAuthentication()) { - case WANTED: - builder.withWantClientAuthentication(); - break; - case NEEDED: - builder.withNeedClientAuthentication(); - break; - case NONE: - break; - default: - throw new IllegalStateException("Unexpected client auth: " + config.clientAuthentication()); - } + config.clientAuthentication().ifPresent(clientAuth -> addClientAuth(builder, clientAuth)); return builder.build(); } @@ -239,6 +228,21 @@ public Object visit(ProtocolsExplicit explicit) { }); } + private static void addClientAuth(SSLFactory.Builder builder, SSLConfig.ClientAuth auth) { + switch (auth) { + case NONE: + break; + case WANTED: + builder.withWantClientAuthentication(); + break; + case NEEDED: + builder.withNeedClientAuthentication(); + break; + default: + throw new IllegalStateException("Unexpected client auth: " + auth); + } + } + private static void addIdentity(SSLFactory.Builder builder, IdentityKeyStore config) { final char[] password = config.password().toCharArray(); try { From dffa8cc8b5674e8dfbc5b4b9ba599ffc1672c2d3 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 29 Aug 2022 07:21:40 -0700 Subject: [PATCH 082/215] UpdateBy gRPC (#2635) --- go/internal/proto/table/table.pb.go | 5259 +++++++++++------ go/internal/proto/table/table_grpc.pb.go | 38 + .../client/DeephavenFlightSessionTest.java | 27 +- .../client/UpdateOrSelectSessionTest.java | 35 +- .../client/impl/BatchTableRequestBuilder.java | 7 +- .../client/impl/UpdateByBuilder.java | 210 + .../impl/UpdateByControlBuilderTest.java | 69 + .../impl/UpdateByOperationBuilderTest.java | 48 + .../client/impl/UpdateBySpecBuilderTest.java | 122 + .../deephaven/proto/util/OperationHelper.java | 2 + .../main/proto/deephaven/proto/table.proto | 162 + py/client/pydeephaven/proto/table_pb2.py | 383 +- py/client/pydeephaven/proto/table_pb2_grpc.py | 35 + .../deephaven/server/table/TableModule.java | 6 + .../server/table/TableServiceGrpcImpl.java | 6 + .../server/table/ops/UpdateByGrpcImpl.java | 255 + .../api/updateby/BadDataBehavior.java | 6 +- 17 files changed, 4787 insertions(+), 1883 deletions(-) create mode 100644 java-client/session/src/main/java/io/deephaven/client/impl/UpdateByBuilder.java create mode 100644 java-client/session/src/test/java/io/deephaven/client/impl/UpdateByControlBuilderTest.java create mode 100644 java-client/session/src/test/java/io/deephaven/client/impl/UpdateByOperationBuilderTest.java create mode 100644 java-client/session/src/test/java/io/deephaven/client/impl/UpdateBySpecBuilderTest.java create mode 100644 server/src/main/java/io/deephaven/server/table/ops/UpdateByGrpcImpl.java diff --git a/go/internal/proto/table/table.pb.go b/go/internal/proto/table/table.pb.go index 770007947a8..1229ba9b3f1 100644 --- a/go/internal/proto/table/table.pb.go +++ b/go/internal/proto/table/table.pb.go @@ -24,6 +24,63 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Directives for how to handle {@code null} and {@code NaN} values +type BadDataBehavior int32 + +const ( + // Throw an exception and abort processing when bad data is encountered. + BadDataBehavior_THROW BadDataBehavior = 0 + // Reset the state for the bucket to {@code null} when invalid data is encountered. + BadDataBehavior_RESET BadDataBehavior = 1 + // Skip and do not process the invalid data without changing state. + BadDataBehavior_SKIP BadDataBehavior = 2 + // Allow the bad data to poison the result. This is only valid for use with NaN. + BadDataBehavior_POISON BadDataBehavior = 3 +) + +// Enum value maps for BadDataBehavior. +var ( + BadDataBehavior_name = map[int32]string{ + 0: "THROW", + 1: "RESET", + 2: "SKIP", + 3: "POISON", + } + BadDataBehavior_value = map[string]int32{ + "THROW": 0, + "RESET": 1, + "SKIP": 2, + "POISON": 3, + } +) + +func (x BadDataBehavior) Enum() *BadDataBehavior { + p := new(BadDataBehavior) + *p = x + return p +} + +func (x BadDataBehavior) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BadDataBehavior) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[0].Descriptor() +} + +func (BadDataBehavior) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[0] +} + +func (x BadDataBehavior) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BadDataBehavior.Descriptor instead. +func (BadDataBehavior) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{0} +} + type CaseSensitivity int32 const ( @@ -54,11 +111,11 @@ func (x CaseSensitivity) String() string { } func (CaseSensitivity) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[0].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[1].Descriptor() } func (CaseSensitivity) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[0] + return &file_deephaven_proto_table_proto_enumTypes[1] } func (x CaseSensitivity) Number() protoreflect.EnumNumber { @@ -67,7 +124,7 @@ func (x CaseSensitivity) Number() protoreflect.EnumNumber { // Deprecated: Use CaseSensitivity.Descriptor instead. func (CaseSensitivity) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{0} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{1} } type MatchType int32 @@ -100,11 +157,11 @@ func (x MatchType) String() string { } func (MatchType) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[1].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[2].Descriptor() } func (MatchType) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[1] + return &file_deephaven_proto_table_proto_enumTypes[2] } func (x MatchType) Number() protoreflect.EnumNumber { @@ -113,7 +170,71 @@ func (x MatchType) Number() protoreflect.EnumNumber { // Deprecated: Use MatchType.Descriptor instead. func (MatchType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{1} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{2} +} + +type MathContext_RoundingMode int32 + +const ( + MathContext_UP MathContext_RoundingMode = 0 + MathContext_DOWN MathContext_RoundingMode = 1 + MathContext_CEILING MathContext_RoundingMode = 2 + MathContext_FLOOR MathContext_RoundingMode = 3 + MathContext_HALF_UP MathContext_RoundingMode = 4 + MathContext_HALF_DOWN MathContext_RoundingMode = 5 + MathContext_HALF_EVEN MathContext_RoundingMode = 6 + MathContext_UNNECESSARY MathContext_RoundingMode = 7 +) + +// Enum value maps for MathContext_RoundingMode. +var ( + MathContext_RoundingMode_name = map[int32]string{ + 0: "UP", + 1: "DOWN", + 2: "CEILING", + 3: "FLOOR", + 4: "HALF_UP", + 5: "HALF_DOWN", + 6: "HALF_EVEN", + 7: "UNNECESSARY", + } + MathContext_RoundingMode_value = map[string]int32{ + "UP": 0, + "DOWN": 1, + "CEILING": 2, + "FLOOR": 3, + "HALF_UP": 4, + "HALF_DOWN": 5, + "HALF_EVEN": 6, + "UNNECESSARY": 7, + } +) + +func (x MathContext_RoundingMode) Enum() *MathContext_RoundingMode { + p := new(MathContext_RoundingMode) + *p = x + return p +} + +func (x MathContext_RoundingMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MathContext_RoundingMode) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_table_proto_enumTypes[3].Descriptor() +} + +func (MathContext_RoundingMode) Type() protoreflect.EnumType { + return &file_deephaven_proto_table_proto_enumTypes[3] +} + +func (x MathContext_RoundingMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MathContext_RoundingMode.Descriptor instead. +func (MathContext_RoundingMode) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{10, 0} } type AsOfJoinTablesRequest_MatchRule int32 @@ -152,11 +273,11 @@ func (x AsOfJoinTablesRequest_MatchRule) String() string { } func (AsOfJoinTablesRequest_MatchRule) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[2].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[4].Descriptor() } func (AsOfJoinTablesRequest_MatchRule) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[2] + return &file_deephaven_proto_table_proto_enumTypes[4] } func (x AsOfJoinTablesRequest_MatchRule) Number() protoreflect.EnumNumber { @@ -165,7 +286,7 @@ func (x AsOfJoinTablesRequest_MatchRule) Number() protoreflect.EnumNumber { // Deprecated: Use AsOfJoinTablesRequest_MatchRule.Descriptor instead. func (AsOfJoinTablesRequest_MatchRule) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{22, 0} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24, 0} } type ComboAggregateRequest_AggType int32 @@ -234,11 +355,11 @@ func (x ComboAggregateRequest_AggType) String() string { } func (ComboAggregateRequest_AggType) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[3].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[5].Descriptor() } func (ComboAggregateRequest_AggType) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[3] + return &file_deephaven_proto_table_proto_enumTypes[5] } func (x ComboAggregateRequest_AggType) Number() protoreflect.EnumNumber { @@ -247,7 +368,7 @@ func (x ComboAggregateRequest_AggType) Number() protoreflect.EnumNumber { // Deprecated: Use ComboAggregateRequest_AggType.Descriptor instead. func (ComboAggregateRequest_AggType) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23, 0} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{25, 0} } type SortDescriptor_SortDirection int32 @@ -286,11 +407,11 @@ func (x SortDescriptor_SortDirection) String() string { } func (SortDescriptor_SortDirection) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[4].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[6].Descriptor() } func (SortDescriptor_SortDirection) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[4] + return &file_deephaven_proto_table_proto_enumTypes[6] } func (x SortDescriptor_SortDirection) Number() protoreflect.EnumNumber { @@ -299,7 +420,7 @@ func (x SortDescriptor_SortDirection) Number() protoreflect.EnumNumber { // Deprecated: Use SortDescriptor_SortDirection.Descriptor instead. func (SortDescriptor_SortDirection) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24, 0} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{26, 0} } type CompareCondition_CompareOperation int32 @@ -344,11 +465,11 @@ func (x CompareCondition_CompareOperation) String() string { } func (CompareCondition_CompareOperation) Descriptor() protoreflect.EnumDescriptor { - return file_deephaven_proto_table_proto_enumTypes[5].Descriptor() + return file_deephaven_proto_table_proto_enumTypes[7].Descriptor() } func (CompareCondition_CompareOperation) Type() protoreflect.EnumType { - return &file_deephaven_proto_table_proto_enumTypes[5] + return &file_deephaven_proto_table_proto_enumTypes[7] } func (x CompareCondition_CompareOperation) Number() protoreflect.EnumNumber { @@ -357,7 +478,7 @@ func (x CompareCondition_CompareOperation) Number() protoreflect.EnumNumber { // Deprecated: Use CompareCondition_CompareOperation.Descriptor instead. func (CompareCondition_CompareOperation) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{34, 0} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{36, 0} } type TableReference struct { @@ -982,6 +1103,145 @@ func (x *SelectOrUpdateRequest) GetColumnSpecs() []string { return nil } +type MathContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Precision int32 `protobuf:"zigzag32,1,opt,name=precision,proto3" json:"precision,omitempty"` + RoundingMode MathContext_RoundingMode `protobuf:"varint,2,opt,name=rounding_mode,json=roundingMode,proto3,enum=io.deephaven.proto.backplane.grpc.MathContext_RoundingMode" json:"rounding_mode,omitempty"` +} + +func (x *MathContext) Reset() { + *x = MathContext{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MathContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MathContext) ProtoMessage() {} + +func (x *MathContext) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MathContext.ProtoReflect.Descriptor instead. +func (*MathContext) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{10} +} + +func (x *MathContext) GetPrecision() int32 { + if x != nil { + return x.Precision + } + return 0 +} + +func (x *MathContext) GetRoundingMode() MathContext_RoundingMode { + if x != nil { + return x.RoundingMode + } + return MathContext_UP +} + +// Create a table with the same rowset as its parent that will perform the specified set of row +// based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are +// capable of processing state between rows. This operation will group the table by the specified set of keys if +// provided before applying the operation. +type UpdateByRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultId *ticket.Ticket `protobuf:"bytes,1,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"` + SourceId *TableReference `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + // If unset, defaults to server-provided defaults. + Options *UpdateByRequest_UpdateByOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` + Operations []*UpdateByRequest_UpdateByOperation `protobuf:"bytes,4,rep,name=operations,proto3" json:"operations,omitempty"` + GroupByColumns []string `protobuf:"bytes,5,rep,name=group_by_columns,json=groupByColumns,proto3" json:"group_by_columns,omitempty"` +} + +func (x *UpdateByRequest) Reset() { + *x = UpdateByRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateByRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateByRequest) ProtoMessage() {} + +func (x *UpdateByRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateByRequest.ProtoReflect.Descriptor instead. +func (*UpdateByRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11} +} + +func (x *UpdateByRequest) GetResultId() *ticket.Ticket { + if x != nil { + return x.ResultId + } + return nil +} + +func (x *UpdateByRequest) GetSourceId() *TableReference { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *UpdateByRequest) GetOptions() *UpdateByRequest_UpdateByOptions { + if x != nil { + return x.Options + } + return nil +} + +func (x *UpdateByRequest) GetOperations() []*UpdateByRequest_UpdateByOperation { + if x != nil { + return x.Operations + } + return nil +} + +func (x *UpdateByRequest) GetGroupByColumns() []string { + if x != nil { + return x.GroupByColumns + } + return nil +} + type SelectDistinctRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -995,7 +1255,7 @@ type SelectDistinctRequest struct { func (x *SelectDistinctRequest) Reset() { *x = SelectDistinctRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[10] + mi := &file_deephaven_proto_table_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1008,7 +1268,7 @@ func (x *SelectDistinctRequest) String() string { func (*SelectDistinctRequest) ProtoMessage() {} func (x *SelectDistinctRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[10] + mi := &file_deephaven_proto_table_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1021,7 +1281,7 @@ func (x *SelectDistinctRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SelectDistinctRequest.ProtoReflect.Descriptor instead. func (*SelectDistinctRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{10} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{12} } func (x *SelectDistinctRequest) GetResultId() *ticket.Ticket { @@ -1058,7 +1318,7 @@ type DropColumnsRequest struct { func (x *DropColumnsRequest) Reset() { *x = DropColumnsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[11] + mi := &file_deephaven_proto_table_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1071,7 +1331,7 @@ func (x *DropColumnsRequest) String() string { func (*DropColumnsRequest) ProtoMessage() {} func (x *DropColumnsRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[11] + mi := &file_deephaven_proto_table_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1084,7 +1344,7 @@ func (x *DropColumnsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DropColumnsRequest.ProtoReflect.Descriptor instead. func (*DropColumnsRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{13} } func (x *DropColumnsRequest) GetResultId() *ticket.Ticket { @@ -1121,7 +1381,7 @@ type UnstructuredFilterTableRequest struct { func (x *UnstructuredFilterTableRequest) Reset() { *x = UnstructuredFilterTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[12] + mi := &file_deephaven_proto_table_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1134,7 +1394,7 @@ func (x *UnstructuredFilterTableRequest) String() string { func (*UnstructuredFilterTableRequest) ProtoMessage() {} func (x *UnstructuredFilterTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[12] + mi := &file_deephaven_proto_table_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1147,7 +1407,7 @@ func (x *UnstructuredFilterTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnstructuredFilterTableRequest.ProtoReflect.Descriptor instead. func (*UnstructuredFilterTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{12} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{14} } func (x *UnstructuredFilterTableRequest) GetResultId() *ticket.Ticket { @@ -1184,7 +1444,7 @@ type HeadOrTailRequest struct { func (x *HeadOrTailRequest) Reset() { *x = HeadOrTailRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[13] + mi := &file_deephaven_proto_table_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1197,7 +1457,7 @@ func (x *HeadOrTailRequest) String() string { func (*HeadOrTailRequest) ProtoMessage() {} func (x *HeadOrTailRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[13] + mi := &file_deephaven_proto_table_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1210,7 +1470,7 @@ func (x *HeadOrTailRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HeadOrTailRequest.ProtoReflect.Descriptor instead. func (*HeadOrTailRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{13} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{15} } func (x *HeadOrTailRequest) GetResultId() *ticket.Ticket { @@ -1248,7 +1508,7 @@ type HeadOrTailByRequest struct { func (x *HeadOrTailByRequest) Reset() { *x = HeadOrTailByRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[14] + mi := &file_deephaven_proto_table_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1261,7 +1521,7 @@ func (x *HeadOrTailByRequest) String() string { func (*HeadOrTailByRequest) ProtoMessage() {} func (x *HeadOrTailByRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[14] + mi := &file_deephaven_proto_table_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1274,7 +1534,7 @@ func (x *HeadOrTailByRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HeadOrTailByRequest.ProtoReflect.Descriptor instead. func (*HeadOrTailByRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{14} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{16} } func (x *HeadOrTailByRequest) GetResultId() *ticket.Ticket { @@ -1319,7 +1579,7 @@ type UngroupRequest struct { func (x *UngroupRequest) Reset() { *x = UngroupRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[15] + mi := &file_deephaven_proto_table_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1332,7 +1592,7 @@ func (x *UngroupRequest) String() string { func (*UngroupRequest) ProtoMessage() {} func (x *UngroupRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[15] + mi := &file_deephaven_proto_table_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1345,7 +1605,7 @@ func (x *UngroupRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UngroupRequest.ProtoReflect.Descriptor instead. func (*UngroupRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{15} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{17} } func (x *UngroupRequest) GetResultId() *ticket.Ticket { @@ -1389,7 +1649,7 @@ type MergeTablesRequest struct { func (x *MergeTablesRequest) Reset() { *x = MergeTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[16] + mi := &file_deephaven_proto_table_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1402,7 +1662,7 @@ func (x *MergeTablesRequest) String() string { func (*MergeTablesRequest) ProtoMessage() {} func (x *MergeTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[16] + mi := &file_deephaven_proto_table_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1415,7 +1675,7 @@ func (x *MergeTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MergeTablesRequest.ProtoReflect.Descriptor instead. func (*MergeTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{16} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{18} } func (x *MergeTablesRequest) GetResultId() *ticket.Ticket { @@ -1458,7 +1718,7 @@ type SnapshotTableRequest struct { func (x *SnapshotTableRequest) Reset() { *x = SnapshotTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[17] + mi := &file_deephaven_proto_table_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1471,7 +1731,7 @@ func (x *SnapshotTableRequest) String() string { func (*SnapshotTableRequest) ProtoMessage() {} func (x *SnapshotTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[17] + mi := &file_deephaven_proto_table_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1484,7 +1744,7 @@ func (x *SnapshotTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SnapshotTableRequest.ProtoReflect.Descriptor instead. func (*SnapshotTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{17} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{19} } func (x *SnapshotTableRequest) GetResultId() *ticket.Ticket { @@ -1539,7 +1799,7 @@ type CrossJoinTablesRequest struct { func (x *CrossJoinTablesRequest) Reset() { *x = CrossJoinTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[18] + mi := &file_deephaven_proto_table_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1552,7 +1812,7 @@ func (x *CrossJoinTablesRequest) String() string { func (*CrossJoinTablesRequest) ProtoMessage() {} func (x *CrossJoinTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[18] + mi := &file_deephaven_proto_table_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1565,7 +1825,7 @@ func (x *CrossJoinTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossJoinTablesRequest.ProtoReflect.Descriptor instead. func (*CrossJoinTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{18} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{20} } func (x *CrossJoinTablesRequest) GetResultId() *ticket.Ticket { @@ -1625,7 +1885,7 @@ type NaturalJoinTablesRequest struct { func (x *NaturalJoinTablesRequest) Reset() { *x = NaturalJoinTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[19] + mi := &file_deephaven_proto_table_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1638,7 +1898,7 @@ func (x *NaturalJoinTablesRequest) String() string { func (*NaturalJoinTablesRequest) ProtoMessage() {} func (x *NaturalJoinTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[19] + mi := &file_deephaven_proto_table_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1651,7 +1911,7 @@ func (x *NaturalJoinTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NaturalJoinTablesRequest.ProtoReflect.Descriptor instead. func (*NaturalJoinTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{19} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{21} } func (x *NaturalJoinTablesRequest) GetResultId() *ticket.Ticket { @@ -1704,7 +1964,7 @@ type ExactJoinTablesRequest struct { func (x *ExactJoinTablesRequest) Reset() { *x = ExactJoinTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[20] + mi := &file_deephaven_proto_table_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1717,7 +1977,7 @@ func (x *ExactJoinTablesRequest) String() string { func (*ExactJoinTablesRequest) ProtoMessage() {} func (x *ExactJoinTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[20] + mi := &file_deephaven_proto_table_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1730,7 +1990,7 @@ func (x *ExactJoinTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExactJoinTablesRequest.ProtoReflect.Descriptor instead. func (*ExactJoinTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{20} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{22} } func (x *ExactJoinTablesRequest) GetResultId() *ticket.Ticket { @@ -1783,7 +2043,7 @@ type LeftJoinTablesRequest struct { func (x *LeftJoinTablesRequest) Reset() { *x = LeftJoinTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[21] + mi := &file_deephaven_proto_table_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1796,7 +2056,7 @@ func (x *LeftJoinTablesRequest) String() string { func (*LeftJoinTablesRequest) ProtoMessage() {} func (x *LeftJoinTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[21] + mi := &file_deephaven_proto_table_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1809,7 +2069,7 @@ func (x *LeftJoinTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LeftJoinTablesRequest.ProtoReflect.Descriptor instead. func (*LeftJoinTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{21} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23} } func (x *LeftJoinTablesRequest) GetResultId() *ticket.Ticket { @@ -1865,7 +2125,7 @@ type AsOfJoinTablesRequest struct { func (x *AsOfJoinTablesRequest) Reset() { *x = AsOfJoinTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[22] + mi := &file_deephaven_proto_table_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1878,7 +2138,7 @@ func (x *AsOfJoinTablesRequest) String() string { func (*AsOfJoinTablesRequest) ProtoMessage() {} func (x *AsOfJoinTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[22] + mi := &file_deephaven_proto_table_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1891,7 +2151,7 @@ func (x *AsOfJoinTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AsOfJoinTablesRequest.ProtoReflect.Descriptor instead. func (*AsOfJoinTablesRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{22} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24} } func (x *AsOfJoinTablesRequest) GetResultId() *ticket.Ticket { @@ -1951,7 +2211,7 @@ type ComboAggregateRequest struct { func (x *ComboAggregateRequest) Reset() { *x = ComboAggregateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[23] + mi := &file_deephaven_proto_table_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1964,7 +2224,7 @@ func (x *ComboAggregateRequest) String() string { func (*ComboAggregateRequest) ProtoMessage() {} func (x *ComboAggregateRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[23] + mi := &file_deephaven_proto_table_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1977,7 +2237,7 @@ func (x *ComboAggregateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ComboAggregateRequest.ProtoReflect.Descriptor instead. func (*ComboAggregateRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{25} } func (x *ComboAggregateRequest) GetResultId() *ticket.Ticket { @@ -2028,7 +2288,7 @@ type SortDescriptor struct { func (x *SortDescriptor) Reset() { *x = SortDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[24] + mi := &file_deephaven_proto_table_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2041,7 +2301,7 @@ func (x *SortDescriptor) String() string { func (*SortDescriptor) ProtoMessage() {} func (x *SortDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[24] + mi := &file_deephaven_proto_table_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2054,7 +2314,7 @@ func (x *SortDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use SortDescriptor.ProtoReflect.Descriptor instead. func (*SortDescriptor) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{24} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{26} } func (x *SortDescriptor) GetColumnName() string { @@ -2091,7 +2351,7 @@ type SortTableRequest struct { func (x *SortTableRequest) Reset() { *x = SortTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[25] + mi := &file_deephaven_proto_table_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2104,7 +2364,7 @@ func (x *SortTableRequest) String() string { func (*SortTableRequest) ProtoMessage() {} func (x *SortTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[25] + mi := &file_deephaven_proto_table_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2117,7 +2377,7 @@ func (x *SortTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SortTableRequest.ProtoReflect.Descriptor instead. func (*SortTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{25} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{27} } func (x *SortTableRequest) GetResultId() *ticket.Ticket { @@ -2154,7 +2414,7 @@ type FilterTableRequest struct { func (x *FilterTableRequest) Reset() { *x = FilterTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[26] + mi := &file_deephaven_proto_table_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2167,7 +2427,7 @@ func (x *FilterTableRequest) String() string { func (*FilterTableRequest) ProtoMessage() {} func (x *FilterTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[26] + mi := &file_deephaven_proto_table_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2180,7 +2440,7 @@ func (x *FilterTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FilterTableRequest.ProtoReflect.Descriptor instead. func (*FilterTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{26} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{28} } func (x *FilterTableRequest) GetResultId() *ticket.Ticket { @@ -2215,7 +2475,7 @@ type Reference struct { func (x *Reference) Reset() { *x = Reference{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[27] + mi := &file_deephaven_proto_table_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2228,7 +2488,7 @@ func (x *Reference) String() string { func (*Reference) ProtoMessage() {} func (x *Reference) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[27] + mi := &file_deephaven_proto_table_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2241,7 +2501,7 @@ func (x *Reference) ProtoReflect() protoreflect.Message { // Deprecated: Use Reference.ProtoReflect.Descriptor instead. func (*Reference) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{27} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{29} } func (x *Reference) GetColumnName() string { @@ -2269,7 +2529,7 @@ type Literal struct { func (x *Literal) Reset() { *x = Literal{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[28] + mi := &file_deephaven_proto_table_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2282,7 +2542,7 @@ func (x *Literal) String() string { func (*Literal) ProtoMessage() {} func (x *Literal) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[28] + mi := &file_deephaven_proto_table_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2295,7 +2555,7 @@ func (x *Literal) ProtoReflect() protoreflect.Message { // Deprecated: Use Literal.ProtoReflect.Descriptor instead. func (*Literal) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{28} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{30} } func (m *Literal) GetValue() isLiteral_Value { @@ -2390,7 +2650,7 @@ type Value struct { func (x *Value) Reset() { *x = Value{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[29] + mi := &file_deephaven_proto_table_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2403,7 +2663,7 @@ func (x *Value) String() string { func (*Value) ProtoMessage() {} func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[29] + mi := &file_deephaven_proto_table_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2416,7 +2676,7 @@ func (x *Value) ProtoReflect() protoreflect.Message { // Deprecated: Use Value.ProtoReflect.Descriptor instead. func (*Value) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{29} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{31} } func (m *Value) GetData() isValue_Data { @@ -2479,7 +2739,7 @@ type Condition struct { func (x *Condition) Reset() { *x = Condition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[30] + mi := &file_deephaven_proto_table_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2492,7 +2752,7 @@ func (x *Condition) String() string { func (*Condition) ProtoMessage() {} func (x *Condition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[30] + mi := &file_deephaven_proto_table_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2505,7 +2765,7 @@ func (x *Condition) ProtoReflect() protoreflect.Message { // Deprecated: Use Condition.ProtoReflect.Descriptor instead. func (*Condition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{30} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{32} } func (m *Condition) GetData() isCondition_Data { @@ -2661,7 +2921,7 @@ type AndCondition struct { func (x *AndCondition) Reset() { *x = AndCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[31] + mi := &file_deephaven_proto_table_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2674,7 +2934,7 @@ func (x *AndCondition) String() string { func (*AndCondition) ProtoMessage() {} func (x *AndCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[31] + mi := &file_deephaven_proto_table_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2687,7 +2947,7 @@ func (x *AndCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use AndCondition.ProtoReflect.Descriptor instead. func (*AndCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{31} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{33} } func (x *AndCondition) GetFilters() []*Condition { @@ -2708,7 +2968,7 @@ type OrCondition struct { func (x *OrCondition) Reset() { *x = OrCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[32] + mi := &file_deephaven_proto_table_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2721,7 +2981,7 @@ func (x *OrCondition) String() string { func (*OrCondition) ProtoMessage() {} func (x *OrCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[32] + mi := &file_deephaven_proto_table_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2734,7 +2994,7 @@ func (x *OrCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use OrCondition.ProtoReflect.Descriptor instead. func (*OrCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{32} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{34} } func (x *OrCondition) GetFilters() []*Condition { @@ -2755,7 +3015,7 @@ type NotCondition struct { func (x *NotCondition) Reset() { *x = NotCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[33] + mi := &file_deephaven_proto_table_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2768,7 +3028,7 @@ func (x *NotCondition) String() string { func (*NotCondition) ProtoMessage() {} func (x *NotCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[33] + mi := &file_deephaven_proto_table_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2781,7 +3041,7 @@ func (x *NotCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use NotCondition.ProtoReflect.Descriptor instead. func (*NotCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{33} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{35} } func (x *NotCondition) GetFilter() *Condition { @@ -2805,7 +3065,7 @@ type CompareCondition struct { func (x *CompareCondition) Reset() { *x = CompareCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[34] + mi := &file_deephaven_proto_table_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2818,7 +3078,7 @@ func (x *CompareCondition) String() string { func (*CompareCondition) ProtoMessage() {} func (x *CompareCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[34] + mi := &file_deephaven_proto_table_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2831,7 +3091,7 @@ func (x *CompareCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use CompareCondition.ProtoReflect.Descriptor instead. func (*CompareCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{34} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{36} } func (x *CompareCondition) GetOperation() CompareCondition_CompareOperation { @@ -2876,7 +3136,7 @@ type InCondition struct { func (x *InCondition) Reset() { *x = InCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[35] + mi := &file_deephaven_proto_table_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2889,7 +3149,7 @@ func (x *InCondition) String() string { func (*InCondition) ProtoMessage() {} func (x *InCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[35] + mi := &file_deephaven_proto_table_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2902,7 +3162,7 @@ func (x *InCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use InCondition.ProtoReflect.Descriptor instead. func (*InCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{35} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{37} } func (x *InCondition) GetTarget() *Value { @@ -2946,7 +3206,7 @@ type InvokeCondition struct { func (x *InvokeCondition) Reset() { *x = InvokeCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[36] + mi := &file_deephaven_proto_table_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2959,7 +3219,7 @@ func (x *InvokeCondition) String() string { func (*InvokeCondition) ProtoMessage() {} func (x *InvokeCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[36] + mi := &file_deephaven_proto_table_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2972,7 +3232,7 @@ func (x *InvokeCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use InvokeCondition.ProtoReflect.Descriptor instead. func (*InvokeCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{36} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{38} } func (x *InvokeCondition) GetMethod() string { @@ -3007,7 +3267,7 @@ type IsNullCondition struct { func (x *IsNullCondition) Reset() { *x = IsNullCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[37] + mi := &file_deephaven_proto_table_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3020,7 +3280,7 @@ func (x *IsNullCondition) String() string { func (*IsNullCondition) ProtoMessage() {} func (x *IsNullCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[37] + mi := &file_deephaven_proto_table_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3033,7 +3293,7 @@ func (x *IsNullCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use IsNullCondition.ProtoReflect.Descriptor instead. func (*IsNullCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{37} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{39} } func (x *IsNullCondition) GetReference() *Reference { @@ -3057,7 +3317,7 @@ type MatchesCondition struct { func (x *MatchesCondition) Reset() { *x = MatchesCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[38] + mi := &file_deephaven_proto_table_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3070,7 +3330,7 @@ func (x *MatchesCondition) String() string { func (*MatchesCondition) ProtoMessage() {} func (x *MatchesCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[38] + mi := &file_deephaven_proto_table_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3083,7 +3343,7 @@ func (x *MatchesCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use MatchesCondition.ProtoReflect.Descriptor instead. func (*MatchesCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{38} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{40} } func (x *MatchesCondition) GetReference() *Reference { @@ -3128,7 +3388,7 @@ type ContainsCondition struct { func (x *ContainsCondition) Reset() { *x = ContainsCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[39] + mi := &file_deephaven_proto_table_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3141,7 +3401,7 @@ func (x *ContainsCondition) String() string { func (*ContainsCondition) ProtoMessage() {} func (x *ContainsCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[39] + mi := &file_deephaven_proto_table_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3154,7 +3414,7 @@ func (x *ContainsCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainsCondition.ProtoReflect.Descriptor instead. func (*ContainsCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{39} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{41} } func (x *ContainsCondition) GetReference() *Reference { @@ -3198,7 +3458,7 @@ type SearchCondition struct { func (x *SearchCondition) Reset() { *x = SearchCondition{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[40] + mi := &file_deephaven_proto_table_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3211,7 +3471,7 @@ func (x *SearchCondition) String() string { func (*SearchCondition) ProtoMessage() {} func (x *SearchCondition) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[40] + mi := &file_deephaven_proto_table_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3224,7 +3484,7 @@ func (x *SearchCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchCondition.ProtoReflect.Descriptor instead. func (*SearchCondition) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{40} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{42} } func (x *SearchCondition) GetSearchString() string { @@ -3253,7 +3513,7 @@ type FlattenRequest struct { func (x *FlattenRequest) Reset() { *x = FlattenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[41] + mi := &file_deephaven_proto_table_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3266,7 +3526,7 @@ func (x *FlattenRequest) String() string { func (*FlattenRequest) ProtoMessage() {} func (x *FlattenRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[41] + mi := &file_deephaven_proto_table_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3279,7 +3539,7 @@ func (x *FlattenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FlattenRequest.ProtoReflect.Descriptor instead. func (*FlattenRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{41} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43} } func (x *FlattenRequest) GetResultId() *ticket.Ticket { @@ -3312,7 +3572,7 @@ type RunChartDownsampleRequest struct { func (x *RunChartDownsampleRequest) Reset() { *x = RunChartDownsampleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[42] + mi := &file_deephaven_proto_table_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3325,7 +3585,7 @@ func (x *RunChartDownsampleRequest) String() string { func (*RunChartDownsampleRequest) ProtoMessage() {} func (x *RunChartDownsampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[42] + mi := &file_deephaven_proto_table_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3338,7 +3598,7 @@ func (x *RunChartDownsampleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunChartDownsampleRequest.ProtoReflect.Descriptor instead. func (*RunChartDownsampleRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{42} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44} } func (x *RunChartDownsampleRequest) GetResultId() *ticket.Ticket { @@ -3401,7 +3661,7 @@ type CreateInputTableRequest struct { func (x *CreateInputTableRequest) Reset() { *x = CreateInputTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[43] + mi := &file_deephaven_proto_table_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3414,7 +3674,7 @@ func (x *CreateInputTableRequest) String() string { func (*CreateInputTableRequest) ProtoMessage() {} func (x *CreateInputTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[43] + mi := &file_deephaven_proto_table_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3427,7 +3687,7 @@ func (x *CreateInputTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateInputTableRequest.ProtoReflect.Descriptor instead. func (*CreateInputTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{45} } func (x *CreateInputTableRequest) GetResultId() *ticket.Ticket { @@ -3494,7 +3754,7 @@ type BatchTableRequest struct { func (x *BatchTableRequest) Reset() { *x = BatchTableRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[44] + mi := &file_deephaven_proto_table_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3507,7 +3767,7 @@ func (x *BatchTableRequest) String() string { func (*BatchTableRequest) ProtoMessage() {} func (x *BatchTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[44] + mi := &file_deephaven_proto_table_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3520,7 +3780,7 @@ func (x *BatchTableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchTableRequest.ProtoReflect.Descriptor instead. func (*BatchTableRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44} + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{46} } func (x *BatchTableRequest) GetOps() []*BatchTableRequest_Operation { @@ -3530,35 +3790,53 @@ func (x *BatchTableRequest) GetOps() []*BatchTableRequest_Operation { return nil } -type ComboAggregateRequest_Aggregate struct { +type UpdateByRequest_UpdateByOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type ComboAggregateRequest_AggType `protobuf:"varint,1,opt,name=type,proto3,enum=io.deephaven.proto.backplane.grpc.ComboAggregateRequest_AggType" json:"type,omitempty"` - MatchPairs []string `protobuf:"bytes,2,rep,name=match_pairs,json=matchPairs,proto3" json:"match_pairs,omitempty"` // used in all aggregates except countBy - ColumnName string `protobuf:"bytes,3,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` // countBy result (output) column OR weighted avg weight (input) column, otherwise unused - Percentile float64 `protobuf:"fixed64,4,opt,name=percentile,proto3" json:"percentile,omitempty"` // required by percentileBy aggregates, otherwise unused - AvgMedian bool `protobuf:"varint,5,opt,name=avg_median,json=avgMedian,proto3" json:"avg_median,omitempty"` // used in percentileBy only -} - -func (x *ComboAggregateRequest_Aggregate) Reset() { - *x = ComboAggregateRequest_Aggregate{} + // If redirections should be used for output sources instead of sparse array sources. + // If unset, defaults to server-provided defaults. + UseRedirection *bool `protobuf:"varint,1,opt,name=use_redirection,json=useRedirection,proto3,oneof" json:"use_redirection,omitempty"` + // The maximum chunk capacity. + // If unset, defaults to server-provided defaults. + ChunkCapacity *int32 `protobuf:"varint,2,opt,name=chunk_capacity,json=chunkCapacity,proto3,oneof" json:"chunk_capacity,omitempty"` + // The maximum fractional memory overhead allowable for sparse redirections as a fraction (e.g. 1.1 is 10% + // overhead). Values less than zero disable overhead checking, and result in always using the sparse structure. A + // value of zero results in never using the sparse structure. + // If unset, defaults to server-provided defaults. + MaxStaticSparseMemoryOverhead *float64 `protobuf:"fixed64,3,opt,name=max_static_sparse_memory_overhead,json=maxStaticSparseMemoryOverhead,proto3,oneof" json:"max_static_sparse_memory_overhead,omitempty"` + // The initial hash table size. + // If unset, defaults to server-provided defaults. + InitialHashTableSize *int32 `protobuf:"varint,4,opt,name=initial_hash_table_size,json=initialHashTableSize,proto3,oneof" json:"initial_hash_table_size,omitempty"` + // The maximum load factor for the hash table. + // If unset, defaults to server-provided defaults. + MaximumLoadFactor *float64 `protobuf:"fixed64,5,opt,name=maximum_load_factor,json=maximumLoadFactor,proto3,oneof" json:"maximum_load_factor,omitempty"` + // The target load factor for the hash table. + // If unset, defaults to server-provided defaults. + TargetLoadFactor *float64 `protobuf:"fixed64,6,opt,name=target_load_factor,json=targetLoadFactor,proto3,oneof" json:"target_load_factor,omitempty"` + // The math context. + // If unset, defaults to server-provided defaults. + MathContext *MathContext `protobuf:"bytes,7,opt,name=math_context,json=mathContext,proto3" json:"math_context,omitempty"` +} + +func (x *UpdateByRequest_UpdateByOptions) Reset() { + *x = UpdateByRequest_UpdateByOptions{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[45] + mi := &file_deephaven_proto_table_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ComboAggregateRequest_Aggregate) String() string { +func (x *UpdateByRequest_UpdateByOptions) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ComboAggregateRequest_Aggregate) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOptions) ProtoMessage() {} -func (x *ComboAggregateRequest_Aggregate) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[45] +func (x *UpdateByRequest_UpdateByOptions) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3569,72 +3847,88 @@ func (x *ComboAggregateRequest_Aggregate) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ComboAggregateRequest_Aggregate.ProtoReflect.Descriptor instead. -func (*ComboAggregateRequest_Aggregate) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{23, 0} +// Deprecated: Use UpdateByRequest_UpdateByOptions.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOptions) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 0} } -func (x *ComboAggregateRequest_Aggregate) GetType() ComboAggregateRequest_AggType { - if x != nil { - return x.Type +func (x *UpdateByRequest_UpdateByOptions) GetUseRedirection() bool { + if x != nil && x.UseRedirection != nil { + return *x.UseRedirection } - return ComboAggregateRequest_SUM + return false } -func (x *ComboAggregateRequest_Aggregate) GetMatchPairs() []string { - if x != nil { - return x.MatchPairs +func (x *UpdateByRequest_UpdateByOptions) GetChunkCapacity() int32 { + if x != nil && x.ChunkCapacity != nil { + return *x.ChunkCapacity } - return nil + return 0 } -func (x *ComboAggregateRequest_Aggregate) GetColumnName() string { - if x != nil { - return x.ColumnName +func (x *UpdateByRequest_UpdateByOptions) GetMaxStaticSparseMemoryOverhead() float64 { + if x != nil && x.MaxStaticSparseMemoryOverhead != nil { + return *x.MaxStaticSparseMemoryOverhead } - return "" + return 0 } -func (x *ComboAggregateRequest_Aggregate) GetPercentile() float64 { - if x != nil { - return x.Percentile +func (x *UpdateByRequest_UpdateByOptions) GetInitialHashTableSize() int32 { + if x != nil && x.InitialHashTableSize != nil { + return *x.InitialHashTableSize } return 0 } -func (x *ComboAggregateRequest_Aggregate) GetAvgMedian() bool { +func (x *UpdateByRequest_UpdateByOptions) GetMaximumLoadFactor() float64 { + if x != nil && x.MaximumLoadFactor != nil { + return *x.MaximumLoadFactor + } + return 0 +} + +func (x *UpdateByRequest_UpdateByOptions) GetTargetLoadFactor() float64 { + if x != nil && x.TargetLoadFactor != nil { + return *x.TargetLoadFactor + } + return 0 +} + +func (x *UpdateByRequest_UpdateByOptions) GetMathContext() *MathContext { if x != nil { - return x.AvgMedian + return x.MathContext } - return false + return nil } -type RunChartDownsampleRequest_ZoomRange struct { +type UpdateByRequest_UpdateByOperation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MinDateNanos *int64 `protobuf:"varint,1,opt,name=min_date_nanos,json=minDateNanos,proto3,oneof" json:"min_date_nanos,omitempty"` - MaxDateNanos *int64 `protobuf:"varint,2,opt,name=max_date_nanos,json=maxDateNanos,proto3,oneof" json:"max_date_nanos,omitempty"` + // Types that are assignable to Type: + // + // *UpdateByRequest_UpdateByOperation_Column + Type isUpdateByRequest_UpdateByOperation_Type `protobuf_oneof:"type"` } -func (x *RunChartDownsampleRequest_ZoomRange) Reset() { - *x = RunChartDownsampleRequest_ZoomRange{} +func (x *UpdateByRequest_UpdateByOperation) Reset() { + *x = UpdateByRequest_UpdateByOperation{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[46] + mi := &file_deephaven_proto_table_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RunChartDownsampleRequest_ZoomRange) String() string { +func (x *UpdateByRequest_UpdateByOperation) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RunChartDownsampleRequest_ZoomRange) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOperation) ProtoMessage() {} -func (x *RunChartDownsampleRequest_ZoomRange) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[46] +func (x *UpdateByRequest_UpdateByOperation) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3645,54 +3939,61 @@ func (x *RunChartDownsampleRequest_ZoomRange) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -// Deprecated: Use RunChartDownsampleRequest_ZoomRange.ProtoReflect.Descriptor instead. -func (*RunChartDownsampleRequest_ZoomRange) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{42, 0} +// Deprecated: Use UpdateByRequest_UpdateByOperation.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1} } -func (x *RunChartDownsampleRequest_ZoomRange) GetMinDateNanos() int64 { - if x != nil && x.MinDateNanos != nil { - return *x.MinDateNanos +func (m *UpdateByRequest_UpdateByOperation) GetType() isUpdateByRequest_UpdateByOperation_Type { + if m != nil { + return m.Type } - return 0 + return nil } -func (x *RunChartDownsampleRequest_ZoomRange) GetMaxDateNanos() int64 { - if x != nil && x.MaxDateNanos != nil { - return *x.MaxDateNanos +func (x *UpdateByRequest_UpdateByOperation) GetColumn() *UpdateByRequest_UpdateByOperation_UpdateByColumn { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_Column); ok { + return x.Column } - return 0 + return nil } -type CreateInputTableRequest_InputTableKind struct { +type isUpdateByRequest_UpdateByOperation_Type interface { + isUpdateByRequest_UpdateByOperation_Type() +} + +type UpdateByRequest_UpdateByOperation_Column struct { + Column *UpdateByRequest_UpdateByOperation_UpdateByColumn `protobuf:"bytes,1,opt,name=column,proto3,oneof"` +} + +func (*UpdateByRequest_UpdateByOperation_Column) isUpdateByRequest_UpdateByOperation_Type() {} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to Kind: - // - // *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ - // *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ - Kind isCreateInputTableRequest_InputTableKind_Kind `protobuf_oneof:"kind"` + Spec *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` + MatchPairs []string `protobuf:"bytes,2,rep,name=match_pairs,json=matchPairs,proto3" json:"match_pairs,omitempty"` } -func (x *CreateInputTableRequest_InputTableKind) Reset() { - *x = CreateInputTableRequest_InputTableKind{} +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[47] + mi := &file_deephaven_proto_table_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateInputTableRequest_InputTableKind) String() string { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateInputTableRequest_InputTableKind) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn) ProtoMessage() {} -func (x *CreateInputTableRequest_InputTableKind) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[47] +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3703,74 +4004,192 @@ func (x *CreateInputTableRequest_InputTableKind) ProtoReflect() protoreflect.Mes return mi.MessageOf(x) } -// Deprecated: Use CreateInputTableRequest_InputTableKind.ProtoReflect.Descriptor instead. -func (*CreateInputTableRequest_InputTableKind) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0} +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0} } -func (m *CreateInputTableRequest_InputTableKind) GetKind() isCreateInputTableRequest_InputTableKind_Kind { - if m != nil { - return m.Kind +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn) GetSpec() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec { + if x != nil { + return x.Spec } return nil } -func (x *CreateInputTableRequest_InputTableKind) GetInMemoryAppendOnly() *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly { - if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_); ok { - return x.InMemoryAppendOnly +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn) GetMatchPairs() []string { + if x != nil { + return x.MatchPairs } return nil } -func (x *CreateInputTableRequest_InputTableKind) GetInMemoryKeyBacked() *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked { - if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_); ok { - return x.InMemoryKeyBacked +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Sum + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Min + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Max + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Product + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Fill + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Ema + Type isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type `protobuf_oneof:"type"` +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -type isCreateInputTableRequest_InputTableKind_Kind interface { - isCreateInputTableRequest_InputTableKind_Kind() +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) String() string { + return protoimpl.X.MessageStringOf(x) } -type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ struct { - InMemoryAppendOnly *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly `protobuf:"bytes,1,opt,name=in_memory_append_only,json=inMemoryAppendOnly,proto3,oneof"` +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) ProtoMessage() {} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ struct { - InMemoryKeyBacked *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked `protobuf:"bytes,2,opt,name=in_memory_key_backed,json=inMemoryKeyBacked,proto3,oneof"` +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0} } -func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_) isCreateInputTableRequest_InputTableKind_Kind() { +func (m *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetType() isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type { + if m != nil { + return m.Type + } + return nil } -func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_) isCreateInputTableRequest_InputTableKind_Kind() { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetSum() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Sum); ok { + return x.Sum + } + return nil } -// Creates an in-memory append-only table - rows cannot be modified or deleted. -type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly struct { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetMin() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Min); ok { + return x.Min + } + return nil +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetMax() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Max); ok { + return x.Max + } + return nil +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetProduct() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Product); ok { + return x.Product + } + return nil +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetFill() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Fill); ok { + return x.Fill + } + return nil +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec) GetEma() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Ema); ok { + return x.Ema + } + return nil +} + +type isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type interface { + isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Sum struct { + Sum *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum `protobuf:"bytes,1,opt,name=sum,proto3,oneof"` +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Min struct { + Min *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin `protobuf:"bytes,2,opt,name=min,proto3,oneof"` +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Max struct { + Max *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax `protobuf:"bytes,3,opt,name=max,proto3,oneof"` +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Product struct { + Product *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct `protobuf:"bytes,4,opt,name=product,proto3,oneof"` +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Fill struct { + Fill *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill `protobuf:"bytes,5,opt,name=fill,proto3,oneof"` +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Ema struct { + Ema *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma `protobuf:"bytes,6,opt,name=ema,proto3,oneof"` +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Sum) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Min) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Max) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Product) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Fill) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Ema) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Type() { +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Reset() { - *x = CreateInputTableRequest_InputTableKind_InMemoryAppendOnly{} +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[48] + mi := &file_deephaven_proto_table_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) String() string { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum) ProtoMessage() { +} -func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[48] +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3781,37 +4200,35 @@ func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoReflect return mi.MessageOf(x) } -// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryAppendOnly.ProtoReflect.Descriptor instead. -func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0, 0} +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 0} } -// Creates an in-memory table that supports updates and deletes by keys. -type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked struct { +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - KeyColumns []string `protobuf:"bytes,1,rep,name=key_columns,json=keyColumns,proto3" json:"key_columns,omitempty"` } -func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Reset() { - *x = CreateInputTableRequest_InputTableKind_InMemoryKeyBacked{} +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[49] + mi := &file_deephaven_proto_table_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) String() string { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin) ProtoMessage() { +} -func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[49] +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3822,76 +4239,74 @@ func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoReflect( return mi.MessageOf(x) } -// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryKeyBacked.ProtoReflect.Descriptor instead. -func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{43, 0, 1} +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 1} } -func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) GetKeyColumns() []string { - if x != nil { - return x.KeyColumns +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -type BatchTableRequest_Operation struct { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax) ProtoMessage() { +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[53] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 2} +} + +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Types that are assignable to Op: - // - // *BatchTableRequest_Operation_EmptyTable - // *BatchTableRequest_Operation_TimeTable - // *BatchTableRequest_Operation_DropColumns - // *BatchTableRequest_Operation_Update - // *BatchTableRequest_Operation_LazyUpdate - // *BatchTableRequest_Operation_View - // *BatchTableRequest_Operation_UpdateView - // *BatchTableRequest_Operation_Select - // *BatchTableRequest_Operation_SelectDistinct - // *BatchTableRequest_Operation_Filter - // *BatchTableRequest_Operation_UnstructuredFilter - // *BatchTableRequest_Operation_Sort - // *BatchTableRequest_Operation_Head - // *BatchTableRequest_Operation_Tail - // *BatchTableRequest_Operation_HeadBy - // *BatchTableRequest_Operation_TailBy - // *BatchTableRequest_Operation_Ungroup - // *BatchTableRequest_Operation_Merge - // *BatchTableRequest_Operation_ComboAggregate - // *BatchTableRequest_Operation_Snapshot - // *BatchTableRequest_Operation_Flatten - // *BatchTableRequest_Operation_RunChartDownsample - // *BatchTableRequest_Operation_CrossJoin - // *BatchTableRequest_Operation_NaturalJoin - // *BatchTableRequest_Operation_ExactJoin - // *BatchTableRequest_Operation_LeftJoin - // *BatchTableRequest_Operation_AsOfJoin - // *BatchTableRequest_Operation_FetchTable - // *BatchTableRequest_Operation_FetchPandasTable - // *BatchTableRequest_Operation_ApplyPreviewColumns - // *BatchTableRequest_Operation_CreateInputTable - Op isBatchTableRequest_Operation_Op `protobuf_oneof:"op"` } -func (x *BatchTableRequest_Operation) Reset() { - *x = BatchTableRequest_Operation{} +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_table_proto_msgTypes[50] + mi := &file_deephaven_proto_table_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BatchTableRequest_Operation) String() string { +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BatchTableRequest_Operation) ProtoMessage() {} +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct) ProtoMessage() { +} -func (x *BatchTableRequest_Operation) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_table_proto_msgTypes[50] +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3902,363 +4317,1128 @@ func (x *BatchTableRequest_Operation) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BatchTableRequest_Operation.ProtoReflect.Descriptor instead. -func (*BatchTableRequest_Operation) Descriptor() ([]byte, []int) { - return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44, 0} +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 3} } -func (m *BatchTableRequest_Operation) GetOp() isBatchTableRequest_Operation_Op { - if m != nil { - return m.Op - } - return nil +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (x *BatchTableRequest_Operation) GetEmptyTable() *EmptyTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_EmptyTable); ok { - return x.EmptyTable +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *BatchTableRequest_Operation) GetTimeTable() *TimeTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_TimeTable); ok { - return x.TimeTable - } - return nil +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *BatchTableRequest_Operation) GetDropColumns() *DropColumnsRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_DropColumns); ok { - return x.DropColumns +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill) ProtoMessage() {} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[55] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *BatchTableRequest_Operation) GetUpdate() *SelectOrUpdateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Update); ok { - return x.Update - } - return nil +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 4} } -func (x *BatchTableRequest_Operation) GetLazyUpdate() *SelectOrUpdateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_LazyUpdate); ok { - return x.LazyUpdate - } - return nil +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If unset, defaults to server-provided defaults. + Options *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` + Timescale *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale `protobuf:"bytes,2,opt,name=timescale,proto3" json:"timescale,omitempty"` } -func (x *BatchTableRequest_Operation) GetView() *SelectOrUpdateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_View); ok { - return x.View +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *BatchTableRequest_Operation) GetUpdateView() *SelectOrUpdateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_UpdateView); ok { - return x.UpdateView - } - return nil +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *BatchTableRequest_Operation) GetSelect() *SelectOrUpdateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Select); ok { - return x.Select +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) ProtoMessage() {} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[56] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *BatchTableRequest_Operation) GetSelectDistinct() *SelectDistinctRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_SelectDistinct); ok { - return x.SelectDistinct - } - return nil +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 5} } -func (x *BatchTableRequest_Operation) GetFilter() *FilterTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Filter); ok { - return x.Filter +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) GetOptions() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions { + if x != nil { + return x.Options } return nil } -func (x *BatchTableRequest_Operation) GetUnstructuredFilter() *UnstructuredFilterTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_UnstructuredFilter); ok { - return x.UnstructuredFilter +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma) GetTimescale() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale { + if x != nil { + return x.Timescale } return nil } -func (x *BatchTableRequest_Operation) GetSort() *SortTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Sort); ok { - return x.Sort +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If unset, defaults to server-provided defaults. + OnNullValue *BadDataBehavior `protobuf:"varint,1,opt,name=on_null_value,json=onNullValue,proto3,enum=io.deephaven.proto.backplane.grpc.BadDataBehavior,oneof" json:"on_null_value,omitempty"` + // If unset, defaults to server-provided defaults. + OnNanValue *BadDataBehavior `protobuf:"varint,2,opt,name=on_nan_value,json=onNanValue,proto3,enum=io.deephaven.proto.backplane.grpc.BadDataBehavior,oneof" json:"on_nan_value,omitempty"` + // If unset, defaults to server-provided defaults. + OnNullTime *BadDataBehavior `protobuf:"varint,3,opt,name=on_null_time,json=onNullTime,proto3,enum=io.deephaven.proto.backplane.grpc.BadDataBehavior,oneof" json:"on_null_time,omitempty"` + // If unset, defaults to server-provided defaults. + OnNegativeDeltaTime *BadDataBehavior `protobuf:"varint,4,opt,name=on_negative_delta_time,json=onNegativeDeltaTime,proto3,enum=io.deephaven.proto.backplane.grpc.BadDataBehavior,oneof" json:"on_negative_delta_time,omitempty"` + // If unset, defaults to server-provided defaults. + OnZeroDeltaTime *BadDataBehavior `protobuf:"varint,5,opt,name=on_zero_delta_time,json=onZeroDeltaTime,proto3,enum=io.deephaven.proto.backplane.grpc.BadDataBehavior,oneof" json:"on_zero_delta_time,omitempty"` + // If unset, defaults to server-provided defaults. + BigValueContext *MathContext `protobuf:"bytes,6,opt,name=big_value_context,json=bigValueContext,proto3" json:"big_value_context,omitempty"` +} + +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *BatchTableRequest_Operation) GetHead() *HeadOrTailRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Head); ok { - return x.Head - } - return nil +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *BatchTableRequest_Operation) GetTail() *HeadOrTailRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Tail); ok { - return x.Tail - } - return nil +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) ProtoMessage() { } -func (x *BatchTableRequest_Operation) GetHeadBy() *HeadOrTailByRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_HeadBy); ok { - return x.HeadBy +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *BatchTableRequest_Operation) GetTailBy() *HeadOrTailByRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_TailBy); ok { - return x.TailBy - } - return nil +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 5, 0} } -func (x *BatchTableRequest_Operation) GetUngroup() *UngroupRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Ungroup); ok { - return x.Ungroup +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetOnNullValue() BadDataBehavior { + if x != nil && x.OnNullValue != nil { + return *x.OnNullValue } - return nil + return BadDataBehavior_THROW } -func (x *BatchTableRequest_Operation) GetMerge() *MergeTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Merge); ok { - return x.Merge +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetOnNanValue() BadDataBehavior { + if x != nil && x.OnNanValue != nil { + return *x.OnNanValue } - return nil + return BadDataBehavior_THROW } -func (x *BatchTableRequest_Operation) GetComboAggregate() *ComboAggregateRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_ComboAggregate); ok { - return x.ComboAggregate +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetOnNullTime() BadDataBehavior { + if x != nil && x.OnNullTime != nil { + return *x.OnNullTime } - return nil + return BadDataBehavior_THROW } -func (x *BatchTableRequest_Operation) GetSnapshot() *SnapshotTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Snapshot); ok { - return x.Snapshot +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetOnNegativeDeltaTime() BadDataBehavior { + if x != nil && x.OnNegativeDeltaTime != nil { + return *x.OnNegativeDeltaTime } - return nil + return BadDataBehavior_THROW } -func (x *BatchTableRequest_Operation) GetFlatten() *FlattenRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_Flatten); ok { - return x.Flatten +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetOnZeroDeltaTime() BadDataBehavior { + if x != nil && x.OnZeroDeltaTime != nil { + return *x.OnZeroDeltaTime } - return nil + return BadDataBehavior_THROW } -func (x *BatchTableRequest_Operation) GetRunChartDownsample() *RunChartDownsampleRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_RunChartDownsample); ok { - return x.RunChartDownsample +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions) GetBigValueContext() *MathContext { + if x != nil { + return x.BigValueContext } return nil } -func (x *BatchTableRequest_Operation) GetCrossJoin() *CrossJoinTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_CrossJoin); ok { - return x.CrossJoin - } - return nil +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Ticks + // *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Time + Type isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type `protobuf_oneof:"type"` } -func (x *BatchTableRequest_Operation) GetNaturalJoin() *NaturalJoinTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_NaturalJoin); ok { - return x.NaturalJoin +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *BatchTableRequest_Operation) GetExactJoin() *ExactJoinTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_ExactJoin); ok { - return x.ExactJoin - } - return nil +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *BatchTableRequest_Operation) GetLeftJoin() *LeftJoinTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_LeftJoin); ok { - return x.LeftJoin - } - return nil +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) ProtoMessage() { } -func (x *BatchTableRequest_Operation) GetAsOfJoin() *AsOfJoinTablesRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_AsOfJoin); ok { - return x.AsOfJoin +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[58] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *BatchTableRequest_Operation) GetFetchTable() *FetchTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchTable); ok { - return x.FetchTable - } - return nil +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 5, 1} } -func (x *BatchTableRequest_Operation) GetFetchPandasTable() *FetchPandasTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchPandasTable); ok { - return x.FetchPandasTable +func (m *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) GetType() isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type { + if m != nil { + return m.Type } return nil } -func (x *BatchTableRequest_Operation) GetApplyPreviewColumns() *ApplyPreviewColumnsRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_ApplyPreviewColumns); ok { - return x.ApplyPreviewColumns +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) GetTicks() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Ticks); ok { + return x.Ticks } return nil } -func (x *BatchTableRequest_Operation) GetCreateInputTable() *CreateInputTableRequest { - if x, ok := x.GetOp().(*BatchTableRequest_Operation_CreateInputTable); ok { - return x.CreateInputTable +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale) GetTime() *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime { + if x, ok := x.GetType().(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Time); ok { + return x.Time } return nil } -type isBatchTableRequest_Operation_Op interface { - isBatchTableRequest_Operation_Op() +type isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type interface { + isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type() } -type BatchTableRequest_Operation_EmptyTable struct { - EmptyTable *EmptyTableRequest `protobuf:"bytes,1,opt,name=empty_table,json=emptyTable,proto3,oneof"` +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Ticks struct { + Ticks *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks `protobuf:"bytes,1,opt,name=ticks,proto3,oneof"` } -type BatchTableRequest_Operation_TimeTable struct { - TimeTable *TimeTableRequest `protobuf:"bytes,2,opt,name=time_table,json=timeTable,proto3,oneof"` +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Time struct { + Time *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime `protobuf:"bytes,2,opt,name=time,proto3,oneof"` } -type BatchTableRequest_Operation_DropColumns struct { - DropColumns *DropColumnsRequest `protobuf:"bytes,3,opt,name=drop_columns,json=dropColumns,proto3,oneof"` +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Ticks) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type() { } -type BatchTableRequest_Operation_Update struct { - Update *SelectOrUpdateRequest `protobuf:"bytes,4,opt,name=update,proto3,oneof"` +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Time) isUpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Type() { } -type BatchTableRequest_Operation_LazyUpdate struct { - LazyUpdate *SelectOrUpdateRequest `protobuf:"bytes,5,opt,name=lazy_update,json=lazyUpdate,proto3,oneof"` -} +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type BatchTableRequest_Operation_View struct { - View *SelectOrUpdateRequest `protobuf:"bytes,6,opt,name=view,proto3,oneof"` + Ticks int64 `protobuf:"zigzag64,1,opt,name=ticks,proto3" json:"ticks,omitempty"` } -type BatchTableRequest_Operation_UpdateView struct { - UpdateView *SelectOrUpdateRequest `protobuf:"bytes,7,opt,name=update_view,json=updateView,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -type BatchTableRequest_Operation_Select struct { - Select *SelectOrUpdateRequest `protobuf:"bytes,8,opt,name=select,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) String() string { + return protoimpl.X.MessageStringOf(x) } -type BatchTableRequest_Operation_SelectDistinct struct { - SelectDistinct *SelectDistinctRequest `protobuf:"bytes,9,opt,name=select_distinct,json=selectDistinct,proto3,oneof"` +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) ProtoMessage() { } -type BatchTableRequest_Operation_Filter struct { - Filter *FilterTableRequest `protobuf:"bytes,10,opt,name=filter,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[59] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type BatchTableRequest_Operation_UnstructuredFilter struct { - UnstructuredFilter *UnstructuredFilterTableRequest `protobuf:"bytes,11,opt,name=unstructured_filter,json=unstructuredFilter,proto3,oneof"` +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 5, 1, 0} } -type BatchTableRequest_Operation_Sort struct { - Sort *SortTableRequest `protobuf:"bytes,12,opt,name=sort,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks) GetTicks() int64 { + if x != nil { + return x.Ticks + } + return 0 } -type BatchTableRequest_Operation_Head struct { - Head *HeadOrTailRequest `protobuf:"bytes,13,opt,name=head,proto3,oneof"` -} +type UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type BatchTableRequest_Operation_Tail struct { - Tail *HeadOrTailRequest `protobuf:"bytes,14,opt,name=tail,proto3,oneof"` + Column string `protobuf:"bytes,1,opt,name=column,proto3" json:"column,omitempty"` + PeriodNanos int64 `protobuf:"zigzag64,2,opt,name=period_nanos,json=periodNanos,proto3" json:"period_nanos,omitempty"` } -type BatchTableRequest_Operation_HeadBy struct { - HeadBy *HeadOrTailByRequest `protobuf:"bytes,15,opt,name=head_by,json=headBy,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) Reset() { + *x = UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -type BatchTableRequest_Operation_TailBy struct { - TailBy *HeadOrTailByRequest `protobuf:"bytes,16,opt,name=tail_by,json=tailBy,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) String() string { + return protoimpl.X.MessageStringOf(x) } -type BatchTableRequest_Operation_Ungroup struct { - Ungroup *UngroupRequest `protobuf:"bytes,17,opt,name=ungroup,proto3,oneof"` +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) ProtoMessage() { } -type BatchTableRequest_Operation_Merge struct { - Merge *MergeTablesRequest `protobuf:"bytes,18,opt,name=merge,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[60] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type BatchTableRequest_Operation_ComboAggregate struct { - ComboAggregate *ComboAggregateRequest `protobuf:"bytes,19,opt,name=combo_aggregate,json=comboAggregate,proto3,oneof"` +// Deprecated: Use UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime.ProtoReflect.Descriptor instead. +func (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{11, 1, 0, 0, 5, 1, 1} } -type BatchTableRequest_Operation_Snapshot struct { - Snapshot *SnapshotTableRequest `protobuf:"bytes,20,opt,name=snapshot,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) GetColumn() string { + if x != nil { + return x.Column + } + return "" } -type BatchTableRequest_Operation_Flatten struct { - Flatten *FlattenRequest `protobuf:"bytes,21,opt,name=flatten,proto3,oneof"` +func (x *UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime) GetPeriodNanos() int64 { + if x != nil { + return x.PeriodNanos + } + return 0 } -type BatchTableRequest_Operation_RunChartDownsample struct { - RunChartDownsample *RunChartDownsampleRequest `protobuf:"bytes,22,opt,name=run_chart_downsample,json=runChartDownsample,proto3,oneof"` -} +type ComboAggregateRequest_Aggregate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type BatchTableRequest_Operation_CrossJoin struct { - CrossJoin *CrossJoinTablesRequest `protobuf:"bytes,23,opt,name=cross_join,json=crossJoin,proto3,oneof"` + Type ComboAggregateRequest_AggType `protobuf:"varint,1,opt,name=type,proto3,enum=io.deephaven.proto.backplane.grpc.ComboAggregateRequest_AggType" json:"type,omitempty"` + MatchPairs []string `protobuf:"bytes,2,rep,name=match_pairs,json=matchPairs,proto3" json:"match_pairs,omitempty"` // used in all aggregates except countBy + ColumnName string `protobuf:"bytes,3,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` // countBy result (output) column OR weighted avg weight (input) column, otherwise unused + Percentile float64 `protobuf:"fixed64,4,opt,name=percentile,proto3" json:"percentile,omitempty"` // required by percentileBy aggregates, otherwise unused + AvgMedian bool `protobuf:"varint,5,opt,name=avg_median,json=avgMedian,proto3" json:"avg_median,omitempty"` // used in percentileBy only } -type BatchTableRequest_Operation_NaturalJoin struct { - NaturalJoin *NaturalJoinTablesRequest `protobuf:"bytes,24,opt,name=natural_join,json=naturalJoin,proto3,oneof"` +func (x *ComboAggregateRequest_Aggregate) Reset() { + *x = ComboAggregateRequest_Aggregate{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -type BatchTableRequest_Operation_ExactJoin struct { - ExactJoin *ExactJoinTablesRequest `protobuf:"bytes,25,opt,name=exact_join,json=exactJoin,proto3,oneof"` +func (x *ComboAggregateRequest_Aggregate) String() string { + return protoimpl.X.MessageStringOf(x) } -type BatchTableRequest_Operation_LeftJoin struct { - LeftJoin *LeftJoinTablesRequest `protobuf:"bytes,26,opt,name=left_join,json=leftJoin,proto3,oneof"` -} +func (*ComboAggregateRequest_Aggregate) ProtoMessage() {} -type BatchTableRequest_Operation_AsOfJoin struct { - AsOfJoin *AsOfJoinTablesRequest `protobuf:"bytes,27,opt,name=as_of_join,json=asOfJoin,proto3,oneof"` +func (x *ComboAggregateRequest_Aggregate) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[61] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type BatchTableRequest_Operation_FetchTable struct { - FetchTable *FetchTableRequest `protobuf:"bytes,28,opt,name=fetch_table,json=fetchTable,proto3,oneof"` +// Deprecated: Use ComboAggregateRequest_Aggregate.ProtoReflect.Descriptor instead. +func (*ComboAggregateRequest_Aggregate) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{25, 0} } -type BatchTableRequest_Operation_FetchPandasTable struct { - FetchPandasTable *FetchPandasTableRequest `protobuf:"bytes,29,opt,name=fetch_pandas_table,json=fetchPandasTable,proto3,oneof"` +func (x *ComboAggregateRequest_Aggregate) GetType() ComboAggregateRequest_AggType { + if x != nil { + return x.Type + } + return ComboAggregateRequest_SUM } -type BatchTableRequest_Operation_ApplyPreviewColumns struct { - ApplyPreviewColumns *ApplyPreviewColumnsRequest `protobuf:"bytes,30,opt,name=apply_preview_columns,json=applyPreviewColumns,proto3,oneof"` +func (x *ComboAggregateRequest_Aggregate) GetMatchPairs() []string { + if x != nil { + return x.MatchPairs + } + return nil +} + +func (x *ComboAggregateRequest_Aggregate) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +func (x *ComboAggregateRequest_Aggregate) GetPercentile() float64 { + if x != nil { + return x.Percentile + } + return 0 +} + +func (x *ComboAggregateRequest_Aggregate) GetAvgMedian() bool { + if x != nil { + return x.AvgMedian + } + return false +} + +type RunChartDownsampleRequest_ZoomRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinDateNanos *int64 `protobuf:"varint,1,opt,name=min_date_nanos,json=minDateNanos,proto3,oneof" json:"min_date_nanos,omitempty"` + MaxDateNanos *int64 `protobuf:"varint,2,opt,name=max_date_nanos,json=maxDateNanos,proto3,oneof" json:"max_date_nanos,omitempty"` +} + +func (x *RunChartDownsampleRequest_ZoomRange) Reset() { + *x = RunChartDownsampleRequest_ZoomRange{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunChartDownsampleRequest_ZoomRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunChartDownsampleRequest_ZoomRange) ProtoMessage() {} + +func (x *RunChartDownsampleRequest_ZoomRange) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[62] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunChartDownsampleRequest_ZoomRange.ProtoReflect.Descriptor instead. +func (*RunChartDownsampleRequest_ZoomRange) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{44, 0} +} + +func (x *RunChartDownsampleRequest_ZoomRange) GetMinDateNanos() int64 { + if x != nil && x.MinDateNanos != nil { + return *x.MinDateNanos + } + return 0 +} + +func (x *RunChartDownsampleRequest_ZoomRange) GetMaxDateNanos() int64 { + if x != nil && x.MaxDateNanos != nil { + return *x.MaxDateNanos + } + return 0 +} + +type CreateInputTableRequest_InputTableKind struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ + // *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ + Kind isCreateInputTableRequest_InputTableKind_Kind `protobuf_oneof:"kind"` +} + +func (x *CreateInputTableRequest_InputTableKind) Reset() { + *x = CreateInputTableRequest_InputTableKind{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[63] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{45, 0} +} + +func (m *CreateInputTableRequest_InputTableKind) GetKind() isCreateInputTableRequest_InputTableKind_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *CreateInputTableRequest_InputTableKind) GetInMemoryAppendOnly() *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly { + if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_); ok { + return x.InMemoryAppendOnly + } + return nil +} + +func (x *CreateInputTableRequest_InputTableKind) GetInMemoryKeyBacked() *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked { + if x, ok := x.GetKind().(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_); ok { + return x.InMemoryKeyBacked + } + return nil +} + +type isCreateInputTableRequest_InputTableKind_Kind interface { + isCreateInputTableRequest_InputTableKind_Kind() +} + +type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_ struct { + InMemoryAppendOnly *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly `protobuf:"bytes,1,opt,name=in_memory_append_only,json=inMemoryAppendOnly,proto3,oneof"` +} + +type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_ struct { + InMemoryKeyBacked *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked `protobuf:"bytes,2,opt,name=in_memory_key_backed,json=inMemoryKeyBacked,proto3,oneof"` +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_) isCreateInputTableRequest_InputTableKind_Kind() { +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_) isCreateInputTableRequest_InputTableKind_Kind() { +} + +// Creates an in-memory append-only table - rows cannot be modified or deleted. +type CreateInputTableRequest_InputTableKind_InMemoryAppendOnly struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Reset() { + *x = CreateInputTableRequest_InputTableKind_InMemoryAppendOnly{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[64] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryAppendOnly.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{45, 0, 0} +} + +// Creates an in-memory table that supports updates and deletes by keys. +type CreateInputTableRequest_InputTableKind_InMemoryKeyBacked struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyColumns []string `protobuf:"bytes,1,rep,name=key_columns,json=keyColumns,proto3" json:"key_columns,omitempty"` +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Reset() { + *x = CreateInputTableRequest_InputTableKind_InMemoryKeyBacked{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoMessage() {} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[65] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInputTableRequest_InputTableKind_InMemoryKeyBacked.ProtoReflect.Descriptor instead. +func (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{45, 0, 1} +} + +func (x *CreateInputTableRequest_InputTableKind_InMemoryKeyBacked) GetKeyColumns() []string { + if x != nil { + return x.KeyColumns + } + return nil +} + +type BatchTableRequest_Operation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Op: + // + // *BatchTableRequest_Operation_EmptyTable + // *BatchTableRequest_Operation_TimeTable + // *BatchTableRequest_Operation_DropColumns + // *BatchTableRequest_Operation_Update + // *BatchTableRequest_Operation_LazyUpdate + // *BatchTableRequest_Operation_View + // *BatchTableRequest_Operation_UpdateView + // *BatchTableRequest_Operation_Select + // *BatchTableRequest_Operation_SelectDistinct + // *BatchTableRequest_Operation_Filter + // *BatchTableRequest_Operation_UnstructuredFilter + // *BatchTableRequest_Operation_Sort + // *BatchTableRequest_Operation_Head + // *BatchTableRequest_Operation_Tail + // *BatchTableRequest_Operation_HeadBy + // *BatchTableRequest_Operation_TailBy + // *BatchTableRequest_Operation_Ungroup + // *BatchTableRequest_Operation_Merge + // *BatchTableRequest_Operation_ComboAggregate + // *BatchTableRequest_Operation_Snapshot + // *BatchTableRequest_Operation_Flatten + // *BatchTableRequest_Operation_RunChartDownsample + // *BatchTableRequest_Operation_CrossJoin + // *BatchTableRequest_Operation_NaturalJoin + // *BatchTableRequest_Operation_ExactJoin + // *BatchTableRequest_Operation_LeftJoin + // *BatchTableRequest_Operation_AsOfJoin + // *BatchTableRequest_Operation_FetchTable + // *BatchTableRequest_Operation_FetchPandasTable + // *BatchTableRequest_Operation_ApplyPreviewColumns + // *BatchTableRequest_Operation_CreateInputTable + // *BatchTableRequest_Operation_UpdateBy + Op isBatchTableRequest_Operation_Op `protobuf_oneof:"op"` +} + +func (x *BatchTableRequest_Operation) Reset() { + *x = BatchTableRequest_Operation{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_table_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchTableRequest_Operation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchTableRequest_Operation) ProtoMessage() {} + +func (x *BatchTableRequest_Operation) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_table_proto_msgTypes[66] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchTableRequest_Operation.ProtoReflect.Descriptor instead. +func (*BatchTableRequest_Operation) Descriptor() ([]byte, []int) { + return file_deephaven_proto_table_proto_rawDescGZIP(), []int{46, 0} +} + +func (m *BatchTableRequest_Operation) GetOp() isBatchTableRequest_Operation_Op { + if m != nil { + return m.Op + } + return nil +} + +func (x *BatchTableRequest_Operation) GetEmptyTable() *EmptyTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_EmptyTable); ok { + return x.EmptyTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTimeTable() *TimeTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_TimeTable); ok { + return x.TimeTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetDropColumns() *DropColumnsRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_DropColumns); ok { + return x.DropColumns + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUpdate() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Update); ok { + return x.Update + } + return nil +} + +func (x *BatchTableRequest_Operation) GetLazyUpdate() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_LazyUpdate); ok { + return x.LazyUpdate + } + return nil +} + +func (x *BatchTableRequest_Operation) GetView() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_View); ok { + return x.View + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUpdateView() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_UpdateView); ok { + return x.UpdateView + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSelect() *SelectOrUpdateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Select); ok { + return x.Select + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSelectDistinct() *SelectDistinctRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_SelectDistinct); ok { + return x.SelectDistinct + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFilter() *FilterTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Filter); ok { + return x.Filter + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUnstructuredFilter() *UnstructuredFilterTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_UnstructuredFilter); ok { + return x.UnstructuredFilter + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSort() *SortTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Sort); ok { + return x.Sort + } + return nil +} + +func (x *BatchTableRequest_Operation) GetHead() *HeadOrTailRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Head); ok { + return x.Head + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTail() *HeadOrTailRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Tail); ok { + return x.Tail + } + return nil +} + +func (x *BatchTableRequest_Operation) GetHeadBy() *HeadOrTailByRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_HeadBy); ok { + return x.HeadBy + } + return nil +} + +func (x *BatchTableRequest_Operation) GetTailBy() *HeadOrTailByRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_TailBy); ok { + return x.TailBy + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUngroup() *UngroupRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Ungroup); ok { + return x.Ungroup + } + return nil +} + +func (x *BatchTableRequest_Operation) GetMerge() *MergeTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Merge); ok { + return x.Merge + } + return nil +} + +func (x *BatchTableRequest_Operation) GetComboAggregate() *ComboAggregateRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ComboAggregate); ok { + return x.ComboAggregate + } + return nil +} + +func (x *BatchTableRequest_Operation) GetSnapshot() *SnapshotTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Snapshot); ok { + return x.Snapshot + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFlatten() *FlattenRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_Flatten); ok { + return x.Flatten + } + return nil +} + +func (x *BatchTableRequest_Operation) GetRunChartDownsample() *RunChartDownsampleRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_RunChartDownsample); ok { + return x.RunChartDownsample + } + return nil +} + +func (x *BatchTableRequest_Operation) GetCrossJoin() *CrossJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_CrossJoin); ok { + return x.CrossJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetNaturalJoin() *NaturalJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_NaturalJoin); ok { + return x.NaturalJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetExactJoin() *ExactJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ExactJoin); ok { + return x.ExactJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetLeftJoin() *LeftJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_LeftJoin); ok { + return x.LeftJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetAsOfJoin() *AsOfJoinTablesRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_AsOfJoin); ok { + return x.AsOfJoin + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFetchTable() *FetchTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchTable); ok { + return x.FetchTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetFetchPandasTable() *FetchPandasTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_FetchPandasTable); ok { + return x.FetchPandasTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetApplyPreviewColumns() *ApplyPreviewColumnsRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_ApplyPreviewColumns); ok { + return x.ApplyPreviewColumns + } + return nil +} + +func (x *BatchTableRequest_Operation) GetCreateInputTable() *CreateInputTableRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_CreateInputTable); ok { + return x.CreateInputTable + } + return nil +} + +func (x *BatchTableRequest_Operation) GetUpdateBy() *UpdateByRequest { + if x, ok := x.GetOp().(*BatchTableRequest_Operation_UpdateBy); ok { + return x.UpdateBy + } + return nil +} + +type isBatchTableRequest_Operation_Op interface { + isBatchTableRequest_Operation_Op() +} + +type BatchTableRequest_Operation_EmptyTable struct { + EmptyTable *EmptyTableRequest `protobuf:"bytes,1,opt,name=empty_table,json=emptyTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_TimeTable struct { + TimeTable *TimeTableRequest `protobuf:"bytes,2,opt,name=time_table,json=timeTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_DropColumns struct { + DropColumns *DropColumnsRequest `protobuf:"bytes,3,opt,name=drop_columns,json=dropColumns,proto3,oneof"` +} + +type BatchTableRequest_Operation_Update struct { + Update *SelectOrUpdateRequest `protobuf:"bytes,4,opt,name=update,proto3,oneof"` +} + +type BatchTableRequest_Operation_LazyUpdate struct { + LazyUpdate *SelectOrUpdateRequest `protobuf:"bytes,5,opt,name=lazy_update,json=lazyUpdate,proto3,oneof"` +} + +type BatchTableRequest_Operation_View struct { + View *SelectOrUpdateRequest `protobuf:"bytes,6,opt,name=view,proto3,oneof"` +} + +type BatchTableRequest_Operation_UpdateView struct { + UpdateView *SelectOrUpdateRequest `protobuf:"bytes,7,opt,name=update_view,json=updateView,proto3,oneof"` +} + +type BatchTableRequest_Operation_Select struct { + Select *SelectOrUpdateRequest `protobuf:"bytes,8,opt,name=select,proto3,oneof"` +} + +type BatchTableRequest_Operation_SelectDistinct struct { + SelectDistinct *SelectDistinctRequest `protobuf:"bytes,9,opt,name=select_distinct,json=selectDistinct,proto3,oneof"` +} + +type BatchTableRequest_Operation_Filter struct { + Filter *FilterTableRequest `protobuf:"bytes,10,opt,name=filter,proto3,oneof"` +} + +type BatchTableRequest_Operation_UnstructuredFilter struct { + UnstructuredFilter *UnstructuredFilterTableRequest `protobuf:"bytes,11,opt,name=unstructured_filter,json=unstructuredFilter,proto3,oneof"` +} + +type BatchTableRequest_Operation_Sort struct { + Sort *SortTableRequest `protobuf:"bytes,12,opt,name=sort,proto3,oneof"` +} + +type BatchTableRequest_Operation_Head struct { + Head *HeadOrTailRequest `protobuf:"bytes,13,opt,name=head,proto3,oneof"` +} + +type BatchTableRequest_Operation_Tail struct { + Tail *HeadOrTailRequest `protobuf:"bytes,14,opt,name=tail,proto3,oneof"` +} + +type BatchTableRequest_Operation_HeadBy struct { + HeadBy *HeadOrTailByRequest `protobuf:"bytes,15,opt,name=head_by,json=headBy,proto3,oneof"` +} + +type BatchTableRequest_Operation_TailBy struct { + TailBy *HeadOrTailByRequest `protobuf:"bytes,16,opt,name=tail_by,json=tailBy,proto3,oneof"` +} + +type BatchTableRequest_Operation_Ungroup struct { + Ungroup *UngroupRequest `protobuf:"bytes,17,opt,name=ungroup,proto3,oneof"` +} + +type BatchTableRequest_Operation_Merge struct { + Merge *MergeTablesRequest `protobuf:"bytes,18,opt,name=merge,proto3,oneof"` +} + +type BatchTableRequest_Operation_ComboAggregate struct { + ComboAggregate *ComboAggregateRequest `protobuf:"bytes,19,opt,name=combo_aggregate,json=comboAggregate,proto3,oneof"` +} + +type BatchTableRequest_Operation_Snapshot struct { + Snapshot *SnapshotTableRequest `protobuf:"bytes,20,opt,name=snapshot,proto3,oneof"` +} + +type BatchTableRequest_Operation_Flatten struct { + Flatten *FlattenRequest `protobuf:"bytes,21,opt,name=flatten,proto3,oneof"` +} + +type BatchTableRequest_Operation_RunChartDownsample struct { + RunChartDownsample *RunChartDownsampleRequest `protobuf:"bytes,22,opt,name=run_chart_downsample,json=runChartDownsample,proto3,oneof"` +} + +type BatchTableRequest_Operation_CrossJoin struct { + CrossJoin *CrossJoinTablesRequest `protobuf:"bytes,23,opt,name=cross_join,json=crossJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_NaturalJoin struct { + NaturalJoin *NaturalJoinTablesRequest `protobuf:"bytes,24,opt,name=natural_join,json=naturalJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_ExactJoin struct { + ExactJoin *ExactJoinTablesRequest `protobuf:"bytes,25,opt,name=exact_join,json=exactJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_LeftJoin struct { + LeftJoin *LeftJoinTablesRequest `protobuf:"bytes,26,opt,name=left_join,json=leftJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_AsOfJoin struct { + AsOfJoin *AsOfJoinTablesRequest `protobuf:"bytes,27,opt,name=as_of_join,json=asOfJoin,proto3,oneof"` +} + +type BatchTableRequest_Operation_FetchTable struct { + FetchTable *FetchTableRequest `protobuf:"bytes,28,opt,name=fetch_table,json=fetchTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_FetchPandasTable struct { + FetchPandasTable *FetchPandasTableRequest `protobuf:"bytes,29,opt,name=fetch_pandas_table,json=fetchPandasTable,proto3,oneof"` +} + +type BatchTableRequest_Operation_ApplyPreviewColumns struct { + ApplyPreviewColumns *ApplyPreviewColumnsRequest `protobuf:"bytes,30,opt,name=apply_preview_columns,json=applyPreviewColumns,proto3,oneof"` } type BatchTableRequest_Operation_CreateInputTable struct { CreateInputTable *CreateInputTableRequest `protobuf:"bytes,31,opt,name=create_input_table,json=createInputTable,proto3,oneof"` } +type BatchTableRequest_Operation_UpdateBy struct { + UpdateBy *UpdateByRequest `protobuf:"bytes,32,opt,name=update_by,json=updateBy,proto3,oneof"` +} + func (*BatchTableRequest_Operation_EmptyTable) isBatchTableRequest_Operation_Op() {} func (*BatchTableRequest_Operation_TimeTable) isBatchTableRequest_Operation_Op() {} @@ -4321,6 +5501,8 @@ func (*BatchTableRequest_Operation_ApplyPreviewColumns) isBatchTableRequest_Oper func (*BatchTableRequest_Operation_CreateInputTable) isBatchTableRequest_Operation_Op() {} +func (*BatchTableRequest_Operation_UpdateBy) isBatchTableRequest_Operation_Op() {} + var File_deephaven_proto_table_proto protoreflect.FileDescriptor var file_deephaven_proto_table_proto_rawDesc = []byte{ @@ -4433,35 +5615,24 @@ var file_deephaven_proto_table_proto_rawDesc = []byte{ 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x73, - 0x22, 0xd2, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, - 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x11, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x60, + 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xcf, 0x01, 0x0a, 0x12, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x1e, 0x55, 0x6e, 0x73, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x68, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x6f, + 0x64, 0x65, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, + 0x22, 0x74, 0x0a, 0x0c, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, + 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x45, 0x49, 0x4c, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, + 0x09, 0x0a, 0x05, 0x46, 0x4c, 0x4f, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x41, + 0x4c, 0x46, 0x5f, 0x55, 0x50, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x41, 0x4c, 0x46, 0x5f, + 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x41, 0x4c, 0x46, 0x5f, 0x45, + 0x56, 0x45, 0x4e, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x4e, 0x45, 0x43, 0x45, 0x53, + 0x53, 0x41, 0x52, 0x59, 0x10, 0x07, 0x22, 0xfd, 0x1d, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, @@ -4471,269 +5642,289 @@ var file_deephaven_proto_table_proto_rawDesc = []byte{ 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0xca, 0x01, 0x0a, - 0x11, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x08, 0x6e, 0x75, - 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, - 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x22, 0xff, 0x01, 0x0a, 0x13, 0x48, 0x65, - 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x08, 0x6e, 0x75, 0x6d, - 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, - 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x5f, 0x62, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x73, 0x22, 0xf3, 0x01, 0x0a, 0x0e, - 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, - 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x66, - 0x69, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x46, - 0x69, 0x6c, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, - 0x6f, 0x5f, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x22, 0xcd, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, - 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x22, 0xcd, 0x02, 0x0a, 0x14, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x49, 0x64, 0x12, 0x5c, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, - 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, - 0x64, 0x6f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x6f, 0x49, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x22, 0xed, 0x02, 0x0a, 0x16, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, - 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, - 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x21, - 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x69, 0x74, - 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x18, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, - 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, - 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x64, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x62, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x1a, 0xc9, 0x04, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x0e, 0x75, 0x73, 0x65, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, + 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, 0x61, + 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x0d, 0x63, 0x68, + 0x75, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x4d, + 0x0a, 0x21, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x70, 0x61, + 0x72, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, + 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x48, 0x02, 0x52, 0x1d, 0x6d, 0x61, 0x78, + 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, + 0x17, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, + 0x52, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, 0x6d, 0x61, 0x78, + 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x48, 0x04, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, + 0x6d, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x31, + 0x0a, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x48, 0x05, 0x52, 0x10, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x51, 0x0a, 0x0c, 0x6d, 0x61, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, - 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x68, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x75, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x42, 0x24, 0x0a, 0x22, 0x5f, + 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x70, 0x61, 0x72, 0x73, + 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, + 0x64, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x16, 0x0a, + 0x14, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x97, 0x16, 0x0a, + 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x6d, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x53, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x1a, 0x8a, 0x15, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x74, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x60, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x69, 0x72, 0x73, 0x1a, 0xe0, 0x13, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x8a, 0x01, 0x0a, + 0x03, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x76, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, + 0x75, 0x6d, 0x48, 0x00, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x8a, 0x01, 0x0a, 0x03, 0x6d, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x76, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x48, + 0x00, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x8a, 0x01, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x76, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, - 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, - 0x22, 0xca, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x48, 0x00, 0x52, 0x03, + 0x6d, 0x61, 0x78, 0x12, 0x96, 0x01, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x7a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x83, 0x01, 0x0a, + 0x04, 0x66, 0x69, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x6d, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, + 0x6c, 0x6c, 0x12, 0x80, 0x01, 0x0a, 0x03, 0x65, 0x6d, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x6c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, + 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x48, 0x00, + 0x52, 0x03, 0x65, 0x6d, 0x61, 0x1a, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x75, 0x6d, 0x1a, 0x17, + 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x1a, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, + 0x1a, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x75, 0x6d, 0x75, + 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x1a, 0x0e, 0x0a, + 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, 0x6c, 0x1a, 0x86, 0x0c, + 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x12, 0x99, 0x01, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x7f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, + 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xa0, 0x01, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x81, 0x01, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, - 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, - 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, - 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, 0xc9, 0x02, - 0x0a, 0x15, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x63, 0x61, 0x6c, + 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x1a, 0xbd, 0x05, 0x0a, + 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x5b, 0x0a, 0x0d, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, - 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, + 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x48, 0x00, + 0x52, 0x0b, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x59, 0x0a, 0x0c, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x48, 0x01, 0x52, 0x0a, 0x6f, 0x6e, + 0x4e, 0x61, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x59, 0x0a, 0x0c, 0x6f, + 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x48, 0x02, 0x52, 0x0a, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6c, 0x0a, 0x16, 0x6f, 0x6e, 0x5f, 0x6e, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x48, 0x03, 0x52, 0x13, 0x6f, 0x6e, + 0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x54, 0x69, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x64, 0x0a, 0x12, 0x6f, 0x6e, 0x5f, 0x7a, 0x65, 0x72, 0x6f, 0x5f, + 0x64, 0x65, 0x6c, 0x74, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, - 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x65, 0x68, 0x61, + 0x76, 0x69, 0x6f, 0x72, 0x48, 0x04, 0x52, 0x0f, 0x6f, 0x6e, 0x5a, 0x65, 0x72, 0x6f, 0x44, 0x65, + 0x6c, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x5a, 0x0a, 0x11, 0x62, 0x69, + 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x68, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0f, 0x62, 0x69, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, + 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x6f, 0x6e, 0x5f, + 0x6e, 0x61, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x6f, 0x6e, + 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x6f, + 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6f, 0x6e, 0x5f, 0x7a, 0x65, 0x72, + 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xf7, 0x03, 0x0a, + 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x63, 0x61, 0x6c, 0x65, 0x12, 0xab, 0x01, 0x0a, 0x05, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x92, 0x01, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x45, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x73, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, + 0x63, 0x6b, 0x73, 0x12, 0xa8, 0x01, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x91, 0x01, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, + 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, + 0x6d, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x2c, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x63, + 0x6b, 0x73, 0x12, 0x18, 0x0a, 0x05, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x05, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x1a, 0x50, 0x0a, 0x0f, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x25, 0x0a, 0x0c, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, + 0x01, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x06, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xcf, 0x01, 0x0a, 0x12, + 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, - 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, 0x91, 0x04, 0x0a, 0x15, 0x41, 0x73, - 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, - 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, - 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, - 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, - 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, - 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x6b, 0x0a, 0x10, 0x61, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x61, 0x73, 0x4f, 0x66, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, - 0x6c, 0x65, 0x22, 0x59, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, - 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, - 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, - 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, - 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x47, - 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x03, 0x22, 0xeb, 0x05, - 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, - 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x62, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xd2, 0x01, + 0x0a, 0x1e, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x5f, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1f, 0x0a, - 0x0b, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x1a, 0xe2, - 0x01, 0x0a, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x40, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, - 0x69, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, - 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, - 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x67, 0x5f, 0x6d, 0x65, 0x64, 0x69, - 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x76, 0x67, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x41, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x07, 0x0a, 0x03, 0x53, 0x55, 0x4d, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x42, 0x53, 0x5f, - 0x53, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, - 0x12, 0x07, 0x0a, 0x03, 0x41, 0x56, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x55, - 0x4e, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x05, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x06, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x49, 0x4e, - 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x58, 0x10, 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x4d, - 0x45, 0x44, 0x49, 0x41, 0x4e, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x45, 0x52, 0x43, 0x45, - 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x10, 0x0a, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x54, 0x44, 0x10, 0x0b, - 0x12, 0x07, 0x0a, 0x03, 0x56, 0x41, 0x52, 0x10, 0x0c, 0x12, 0x10, 0x0a, 0x0c, 0x57, 0x45, 0x49, - 0x47, 0x48, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x56, 0x47, 0x10, 0x0d, 0x22, 0x84, 0x02, 0x0a, 0x0e, - 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1f, - 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, - 0x12, 0x5d, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x73, 0x22, 0xca, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, + 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x51, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x17, 0x0a, - 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, - 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, 0x45, - 0x10, 0x02, 0x22, 0xf3, 0x01, 0x0a, 0x10, 0x53, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x22, + 0xff, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, @@ -4744,244 +5935,480 @@ var file_deephaven_proto_table_proto_rawDesc = []byte{ 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x47, 0x0a, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x22, 0xf4, 0x01, 0x0a, 0x12, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x1d, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x31, + 0x0a, 0x15, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x53, 0x70, 0x65, 0x63, + 0x73, 0x22, 0xf3, 0x01, 0x0a, 0x0e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x46, 0x69, 0x6c, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, + 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xcd, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x72, 0x67, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6b, 0x65, + 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xcd, 0x02, 0x0a, 0x14, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, + 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x11, 0x64, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x22, 0xed, 0x02, 0x0a, 0x16, 0x43, 0x72, 0x6f, 0x73, + 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, + 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, + 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, - 0x2c, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xd0, 0x01, - 0x0a, 0x07, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, - 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x09, - 0x6c, 0x6f, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x6e, 0x61, 0x6e, - 0x6f, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x6e, 0x61, 0x6e, 0x6f, 0x54, 0x69, - 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0xa5, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, + 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, + 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, + 0x6f, 0x41, 0x64, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, + 0x62, 0x69, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x42, 0x69, 0x74, 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x18, 0x4e, 0x61, 0x74, 0x75, + 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, + 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6c, 0x69, 0x74, 0x65, - 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, - 0x74, 0x65, 0x72, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, - 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x82, 0x06, 0x0a, 0x09, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x03, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x02, 0x6f, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x72, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x6f, 0x72, 0x12, 0x43, 0x0a, - 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, + 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, + 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, 0xca, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x61, 0x63, 0x74, + 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, - 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x6e, - 0x6f, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, + 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, + 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, + 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, + 0x41, 0x64, 0x64, 0x22, 0xc9, 0x02, 0x0a, 0x15, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, + 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x73, 0x54, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x22, + 0x91, 0x04, 0x0a, 0x15, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, + 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x65, 0x66, 0x74, 0x49, 0x64, 0x12, 0x4c, 0x0a, + 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x6b, 0x0a, 0x10, 0x61, + 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x61, 0x73, 0x4f, 0x66, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x22, 0x59, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, + 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, + 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x52, 0x45, + 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, + 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, + 0x4e, 0x10, 0x03, 0x22, 0xeb, 0x05, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x62, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, + 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x62, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6d, + 0x62, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, + 0x6f, 0x6d, 0x62, 0x6f, 0x1a, 0xe2, 0x01, 0x0a, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x12, 0x54, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, 0x67, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, + 0x67, 0x5f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x61, 0x76, 0x67, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x41, 0x67, + 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x55, 0x4d, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x41, 0x42, 0x53, 0x5f, 0x53, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, + 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x56, 0x47, 0x10, 0x03, 0x12, + 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, + 0x52, 0x53, 0x54, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x06, 0x12, + 0x07, 0x0a, 0x03, 0x4d, 0x49, 0x4e, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x58, 0x10, + 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x4e, 0x10, 0x09, 0x12, 0x0e, 0x0a, + 0x0a, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x10, 0x0a, 0x12, 0x07, 0x0a, + 0x03, 0x53, 0x54, 0x44, 0x10, 0x0b, 0x12, 0x07, 0x0a, 0x03, 0x56, 0x41, 0x52, 0x10, 0x0c, 0x12, + 0x10, 0x0a, 0x0c, 0x57, 0x45, 0x49, 0x47, 0x48, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x56, 0x47, 0x10, + 0x0d, 0x22, 0x84, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x62, 0x73, 0x6f, + 0x6c, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x62, + 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, + 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6f, 0x72, + 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, + 0x47, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, + 0x45, 0x56, 0x45, 0x52, 0x53, 0x45, 0x10, 0x02, 0x22, 0xf3, 0x01, 0x0a, 0x10, 0x53, 0x6f, 0x72, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x47, 0x0a, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, - 0x6c, 0x6c, 0x12, 0x4f, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x56, 0x0a, - 0x0c, 0x41, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, - 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x73, 0x6f, 0x72, 0x74, 0x73, 0x22, 0xf4, + 0x01, 0x0a, 0x12, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, + 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, + 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0b, 0x4f, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x54, 0x0a, 0x0c, - 0x4e, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0xd2, 0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x62, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x44, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x10, 0x63, - 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, - 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, - 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x03, 0x6c, 0x68, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x03, 0x6c, 0x68, 0x73, 0x12, 0x3a, 0x0a, 0x03, 0x72, 0x68, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x2c, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x07, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12, + 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x6c, 0x6f, + 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, + 0x30, 0x01, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x2c, 0x0a, 0x0f, 0x6e, 0x61, 0x6e, 0x6f, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x0d, + 0x6e, 0x61, 0x6e, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x4c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x72, - 0x68, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, - 0x54, 0x48, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, - 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x10, - 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, - 0x12, 0x19, 0x0a, 0x15, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, - 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x45, - 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x54, 0x5f, 0x45, - 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x05, 0x22, 0xc5, 0x02, 0x0a, 0x0b, 0x49, 0x6e, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x61, 0x6e, - 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x46, + 0x0a, 0x07, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x6c, + 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x82, + 0x06, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x03, + 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x6e, + 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, + 0x64, 0x12, 0x40, 0x0a, 0x02, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, + 0x63, 0x2e, 0x4f, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, + 0x02, 0x6f, 0x72, 0x12, 0x43, 0x0a, 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x02, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x06, 0x69, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x69, 0x73, 0x5f, + 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, + 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x4f, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x08, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x4c, 0x0a, + 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, - 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, - 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, - 0xb3, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x40, 0x0a, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, + 0x63, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x06, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0x56, 0x0a, 0x0c, 0x41, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0b, 0x4f, + 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x46, 0x0a, - 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x73, 0x22, 0x54, 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x62, 0x0a, + 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x44, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x5d, 0x0a, 0x0f, 0x49, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, - 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, + 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, + 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x12, 0x3a, 0x0a, 0x03, 0x6c, 0x68, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6c, 0x68, 0x73, 0x12, 0x3a, 0x0a, 0x03, + 0x72, 0x68, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x03, 0x72, 0x68, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x72, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, + 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, + 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, + 0x41, 0x4c, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, + 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, + 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, + 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, + 0x0a, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x05, 0x22, 0xc5, 0x02, + 0x0a, 0x0b, 0x49, 0x6e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x48, 0x0a, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, + 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, + 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x12, 0x5d, 0x0a, 0x10, 0x63, - 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, - 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, - 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, + 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0x40, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x5d, 0x0a, 0x0f, 0x49, + 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, + 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x10, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, + 0x65, 0x67, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x67, 0x65, + 0x78, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, + 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb0, 0x02, + 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb0, 0x02, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, - 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5d, - 0x0a, 0x10, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, - 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, - 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, - 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, - 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x13, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x12, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x0e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, - 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x97, 0x04, - 0x0a, 0x19, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, + 0x70, 0x63, 0x2e, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x52, 0x0f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x13, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x12, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x0e, 0x46, 0x6c, 0x61, + 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, @@ -4991,406 +6418,443 @@ var file_deephaven_proto_table_proto_rawDesc = []byte{ 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x7a, 0x6f, 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6e, - 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x5a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x78, - 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x78, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x24, 0x0a, 0x0e, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x8f, 0x01, 0x0a, 0x09, 0x5a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x48, - 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x88, - 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, - 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, 0x01, 0x48, 0x01, - 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x88, 0x01, - 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, - 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0xd1, 0x05, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x65, 0x49, 0x64, 0x22, 0x97, 0x04, 0x0a, 0x19, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, + 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x69, 0x78, + 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x70, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x7a, 0x6f, + 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x5a, 0x6f, 0x6f, + 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x78, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x78, 0x43, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x79, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x8f, 0x01, 0x0a, 0x09, + 0x5a, 0x6f, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x02, 0x30, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x65, + 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x02, 0x30, 0x01, 0x48, 0x01, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x65, 0x4e, + 0x61, 0x6e, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, + 0x61, 0x78, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0xd1, 0x05, + 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, + 0x64, 0x12, 0x5b, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, + 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x5d, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x12, 0x5b, 0x0a, 0x0f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, + 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x1a, 0x89, 0x03, 0x0a, 0x0e, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x91, 0x01, 0x0a, 0x15, 0x69, + 0x6e, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, + 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5c, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x12, 0x69, 0x6e, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x8e, + 0x01, 0x0a, 0x14, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5b, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x48, 0x00, 0x52, 0x11, 0x69, 0x6e, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x1a, + 0x14, 0x0a, 0x12, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, + 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x1a, 0x34, 0x0a, 0x11, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, + 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0a, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xcc, 0x17, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x1a, 0xe4, 0x16, 0x0a, 0x09, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x54, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x12, 0x5d, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x49, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x0c, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x73, 0x12, 0x52, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x61, 0x7a, 0x79, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x4e, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x76, + 0x69, 0x65, 0x77, 0x12, 0x5b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x69, + 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, + 0x12, 0x52, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x1a, 0x89, 0x03, 0x0a, 0x0e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x91, 0x01, 0x0a, 0x15, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, - 0x72, 0x79, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x12, 0x63, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x64, + 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x74, 0x0a, 0x13, 0x75, 0x6e, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x75, 0x6e, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x12, 0x49, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x68, + 0x65, 0x61, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, + 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x4a, 0x0a, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, + 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x51, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x2e, - 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, - 0x6c, 0x79, 0x48, 0x00, 0x52, 0x12, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, - 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x8e, 0x01, 0x0a, 0x14, 0x69, 0x6e, 0x5f, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, + 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x42, 0x79, 0x12, 0x51, 0x0a, 0x07, 0x74, 0x61, 0x69, 0x6c, 0x5f, 0x62, + 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, - 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x64, 0x48, 0x00, 0x52, 0x11, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x1a, 0x14, 0x0a, 0x12, 0x49, 0x6e, 0x4d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x1a, - 0x34, 0x0a, 0x11, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x43, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x42, 0x0c, 0x0a, - 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf9, 0x16, 0x0a, 0x11, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x50, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x06, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x12, 0x4d, 0x0a, 0x07, 0x75, 0x6e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, + 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x05, 0x6d, 0x65, 0x72, 0x67, + 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x72, 0x67, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x62, 0x6f, + 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, + 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x08, + 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, - 0x6f, 0x70, 0x73, 0x1a, 0x91, 0x16, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x12, 0x4d, 0x0a, 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x18, 0x15, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, + 0x65, 0x6e, 0x12, 0x70, 0x0a, 0x14, 0x72, 0x75, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, + 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x12, 0x72, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x0a, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6a, 0x6f, + 0x69, 0x6e, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x6f, + 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, + 0x12, 0x60, 0x0a, 0x0c, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, + 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x74, 0x69, - 0x6d, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x12, 0x5a, 0x0a, 0x0c, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, + 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, + 0x69, 0x6e, 0x12, 0x5a, 0x0a, 0x0a, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, + 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x43, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x52, 0x0a, 0x06, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x5b, 0x0a, 0x0b, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x0a, 0x6c, 0x61, 0x7a, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4e, 0x0a, - 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, + 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x57, + 0x0a, 0x09, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x6c, + 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x5b, 0x0a, - 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x12, 0x52, 0x0a, 0x06, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x63, - 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, + 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x66, 0x65, + 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x66, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, + 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x73, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, + 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, + 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x6a, 0x0a, 0x12, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, - 0x6e, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x74, 0x0a, 0x13, 0x75, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x75, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x51, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x62, 0x79, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x08, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, + 0x2a, 0x3d, 0x0a, 0x0f, 0x42, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x48, 0x52, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x09, + 0x0a, 0x05, 0x52, 0x45, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x4b, 0x49, + 0x50, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x4f, 0x49, 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x2a, + 0x32, 0x0a, 0x0f, 0x43, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x43, 0x41, 0x53, 0x45, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x47, 0x4e, 0x4f, 0x52, 0x45, 0x5f, 0x43, 0x41, 0x53, + 0x45, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x49, 0x4e, 0x56, 0x45, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x32, 0xd3, 0x26, 0x0a, 0x0c, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x91, 0x01, 0x0a, + 0x20, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, - 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x75, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x04, 0x73, 0x6f, - 0x72, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, - 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x68, 0x65, 0x61, - 0x64, 0x12, 0x4a, 0x0a, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x40, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x51, 0x0a, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, + 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x42, 0x79, - 0x12, 0x51, 0x0a, 0x07, 0x74, 0x61, 0x69, 0x6c, 0x5f, 0x62, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, - 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x74, 0x61, 0x69, - 0x6c, 0x42, 0x79, 0x12, 0x4d, 0x0a, 0x07, 0x75, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x11, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x75, 0x6e, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x65, 0x72, 0x67, - 0x65, 0x12, 0x63, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, + 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x98, + 0x01, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x4d, 0x0a, - 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x70, 0x0a, 0x14, - 0x72, 0x75, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, - 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x72, 0x75, 0x6e, 0x43, - 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x5a, - 0x0a, 0x0a, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x17, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x09, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x60, 0x0a, 0x0c, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x61, 0x6c, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x0b, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x5a, 0x0a, 0x0a, - 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x65, - 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x09, 0x6c, 0x65, 0x66, 0x74, - 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, - 0x6e, 0x12, 0x58, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, - 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, - 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x08, 0x61, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x66, - 0x65, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, - 0x6e, 0x64, 0x61, 0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x44, 0x72, + 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x72, + 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, - 0x66, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x12, 0x73, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, - 0x77, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x6a, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x2a, 0x32, 0x0a, 0x0f, 0x43, 0x61, 0x73, 0x65, 0x53, - 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, - 0x54, 0x43, 0x48, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x47, - 0x4e, 0x4f, 0x52, 0x45, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x09, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, - 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x56, 0x45, 0x52, 0x54, 0x45, - 0x44, 0x10, 0x01, 0x32, 0xce, 0x25, 0x0a, 0x0c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x46, 0x65, 0x74, - 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, - 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x61, 0x6e, 0x64, 0x61, - 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, - 0x50, 0x61, 0x6e, 0x64, 0x61, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x98, 0x01, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3d, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x43, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, + 0x0a, 0x0a, 0x4c, 0x61, 0x7a, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x09, 0x54, - 0x69, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x56, + 0x69, 0x65, 0x77, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, + 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, + 0x01, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x08, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x12, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, - 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x4c, 0x61, 0x7a, 0x79, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, - 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, + 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x12, + 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, + 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x9b, 0x01, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x41, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, + 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x7f, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, + 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, 0x12, 0x38, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x72, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x8e, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, 0x74, 0x69, 0x6e, - 0x63, 0x74, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 0x69, 0x73, - 0x74, 0x69, 0x6e, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x83, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x69, 0x6f, + 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9b, 0x01, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x41, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x55, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x33, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x34, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x61, 0x69, 0x6c, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, @@ -5398,162 +6862,154 @@ var file_deephaven_proto_table_proto_rawDesc = []byte{ 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x04, 0x54, 0x61, 0x69, - 0x6c, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x06, - 0x48, 0x65, 0x61, 0x64, 0x42, 0x79, 0x12, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, - 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, - 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x12, 0x36, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, + 0x64, 0x42, 0x79, 0x12, 0x36, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, + 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x84, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x12, 0x36, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, + 0x65, 0x61, 0x64, 0x4f, 0x72, 0x54, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x07, 0x55, 0x6e, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x6e, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x4d, 0x65, + 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, + 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x90, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, - 0x0b, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x6f, + 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x90, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x6f, 0x73, - 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x4e, - 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x12, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x4e, 0x61, 0x74, 0x75, + 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x3b, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x90, + 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x90, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, + 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4a, - 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x65, 0x66, 0x74, 0x4a, 0x6f, 0x69, - 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x66, 0x74, - 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x87, 0x01, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x12, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x41, 0x73, 0x4f, 0x66, 0x4a, 0x6f, - 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x73, 0x4f, - 0x66, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x62, 0x6f, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, - 0x6d, 0x62, 0x6f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x87, 0x01, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x12, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, + 0x01, 0x0a, 0x07, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, + 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x80, 0x01, 0x0a, 0x07, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x31, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, - 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x2e, 0x69, 0x6f, + 0x00, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, + 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6e, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x75, 0x6e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x83, 0x01, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x92, 0x01, - 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x3e, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x34, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x3e, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0x00, 0x30, 0x01, 0x42, 0x41, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, + 0x01, 0x42, 0x41, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5568,274 +7024,319 @@ func file_deephaven_proto_table_proto_rawDescGZIP() []byte { return file_deephaven_proto_table_proto_rawDescData } -var file_deephaven_proto_table_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_deephaven_proto_table_proto_msgTypes = make([]protoimpl.MessageInfo, 51) +var file_deephaven_proto_table_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_deephaven_proto_table_proto_msgTypes = make([]protoimpl.MessageInfo, 67) var file_deephaven_proto_table_proto_goTypes = []interface{}{ - (CaseSensitivity)(0), // 0: io.deephaven.proto.backplane.grpc.CaseSensitivity - (MatchType)(0), // 1: io.deephaven.proto.backplane.grpc.MatchType - (AsOfJoinTablesRequest_MatchRule)(0), // 2: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule - (ComboAggregateRequest_AggType)(0), // 3: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType - (SortDescriptor_SortDirection)(0), // 4: io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection - (CompareCondition_CompareOperation)(0), // 5: io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation - (*TableReference)(nil), // 6: io.deephaven.proto.backplane.grpc.TableReference - (*ExportedTableCreationResponse)(nil), // 7: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - (*FetchTableRequest)(nil), // 8: io.deephaven.proto.backplane.grpc.FetchTableRequest - (*ApplyPreviewColumnsRequest)(nil), // 9: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest - (*FetchPandasTableRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest - (*ExportedTableUpdatesRequest)(nil), // 11: io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest - (*ExportedTableUpdateMessage)(nil), // 12: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage - (*EmptyTableRequest)(nil), // 13: io.deephaven.proto.backplane.grpc.EmptyTableRequest - (*TimeTableRequest)(nil), // 14: io.deephaven.proto.backplane.grpc.TimeTableRequest - (*SelectOrUpdateRequest)(nil), // 15: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - (*SelectDistinctRequest)(nil), // 16: io.deephaven.proto.backplane.grpc.SelectDistinctRequest - (*DropColumnsRequest)(nil), // 17: io.deephaven.proto.backplane.grpc.DropColumnsRequest - (*UnstructuredFilterTableRequest)(nil), // 18: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest - (*HeadOrTailRequest)(nil), // 19: io.deephaven.proto.backplane.grpc.HeadOrTailRequest - (*HeadOrTailByRequest)(nil), // 20: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest - (*UngroupRequest)(nil), // 21: io.deephaven.proto.backplane.grpc.UngroupRequest - (*MergeTablesRequest)(nil), // 22: io.deephaven.proto.backplane.grpc.MergeTablesRequest - (*SnapshotTableRequest)(nil), // 23: io.deephaven.proto.backplane.grpc.SnapshotTableRequest - (*CrossJoinTablesRequest)(nil), // 24: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest - (*NaturalJoinTablesRequest)(nil), // 25: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest - (*ExactJoinTablesRequest)(nil), // 26: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest - (*LeftJoinTablesRequest)(nil), // 27: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest - (*AsOfJoinTablesRequest)(nil), // 28: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest - (*ComboAggregateRequest)(nil), // 29: io.deephaven.proto.backplane.grpc.ComboAggregateRequest - (*SortDescriptor)(nil), // 30: io.deephaven.proto.backplane.grpc.SortDescriptor - (*SortTableRequest)(nil), // 31: io.deephaven.proto.backplane.grpc.SortTableRequest - (*FilterTableRequest)(nil), // 32: io.deephaven.proto.backplane.grpc.FilterTableRequest - (*Reference)(nil), // 33: io.deephaven.proto.backplane.grpc.Reference - (*Literal)(nil), // 34: io.deephaven.proto.backplane.grpc.Literal - (*Value)(nil), // 35: io.deephaven.proto.backplane.grpc.Value - (*Condition)(nil), // 36: io.deephaven.proto.backplane.grpc.Condition - (*AndCondition)(nil), // 37: io.deephaven.proto.backplane.grpc.AndCondition - (*OrCondition)(nil), // 38: io.deephaven.proto.backplane.grpc.OrCondition - (*NotCondition)(nil), // 39: io.deephaven.proto.backplane.grpc.NotCondition - (*CompareCondition)(nil), // 40: io.deephaven.proto.backplane.grpc.CompareCondition - (*InCondition)(nil), // 41: io.deephaven.proto.backplane.grpc.InCondition - (*InvokeCondition)(nil), // 42: io.deephaven.proto.backplane.grpc.InvokeCondition - (*IsNullCondition)(nil), // 43: io.deephaven.proto.backplane.grpc.IsNullCondition - (*MatchesCondition)(nil), // 44: io.deephaven.proto.backplane.grpc.MatchesCondition - (*ContainsCondition)(nil), // 45: io.deephaven.proto.backplane.grpc.ContainsCondition - (*SearchCondition)(nil), // 46: io.deephaven.proto.backplane.grpc.SearchCondition - (*FlattenRequest)(nil), // 47: io.deephaven.proto.backplane.grpc.FlattenRequest - (*RunChartDownsampleRequest)(nil), // 48: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest - (*CreateInputTableRequest)(nil), // 49: io.deephaven.proto.backplane.grpc.CreateInputTableRequest - (*BatchTableRequest)(nil), // 50: io.deephaven.proto.backplane.grpc.BatchTableRequest - (*ComboAggregateRequest_Aggregate)(nil), // 51: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate - (*RunChartDownsampleRequest_ZoomRange)(nil), // 52: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange - (*CreateInputTableRequest_InputTableKind)(nil), // 53: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind - (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly)(nil), // 54: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly - (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked)(nil), // 55: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked - (*BatchTableRequest_Operation)(nil), // 56: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation - (*ticket.Ticket)(nil), // 57: io.deephaven.proto.backplane.grpc.Ticket + (BadDataBehavior)(0), // 0: io.deephaven.proto.backplane.grpc.BadDataBehavior + (CaseSensitivity)(0), // 1: io.deephaven.proto.backplane.grpc.CaseSensitivity + (MatchType)(0), // 2: io.deephaven.proto.backplane.grpc.MatchType + (MathContext_RoundingMode)(0), // 3: io.deephaven.proto.backplane.grpc.MathContext.RoundingMode + (AsOfJoinTablesRequest_MatchRule)(0), // 4: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule + (ComboAggregateRequest_AggType)(0), // 5: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType + (SortDescriptor_SortDirection)(0), // 6: io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection + (CompareCondition_CompareOperation)(0), // 7: io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation + (*TableReference)(nil), // 8: io.deephaven.proto.backplane.grpc.TableReference + (*ExportedTableCreationResponse)(nil), // 9: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + (*FetchTableRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.FetchTableRequest + (*ApplyPreviewColumnsRequest)(nil), // 11: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + (*FetchPandasTableRequest)(nil), // 12: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + (*ExportedTableUpdatesRequest)(nil), // 13: io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest + (*ExportedTableUpdateMessage)(nil), // 14: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage + (*EmptyTableRequest)(nil), // 15: io.deephaven.proto.backplane.grpc.EmptyTableRequest + (*TimeTableRequest)(nil), // 16: io.deephaven.proto.backplane.grpc.TimeTableRequest + (*SelectOrUpdateRequest)(nil), // 17: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + (*MathContext)(nil), // 18: io.deephaven.proto.backplane.grpc.MathContext + (*UpdateByRequest)(nil), // 19: io.deephaven.proto.backplane.grpc.UpdateByRequest + (*SelectDistinctRequest)(nil), // 20: io.deephaven.proto.backplane.grpc.SelectDistinctRequest + (*DropColumnsRequest)(nil), // 21: io.deephaven.proto.backplane.grpc.DropColumnsRequest + (*UnstructuredFilterTableRequest)(nil), // 22: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + (*HeadOrTailRequest)(nil), // 23: io.deephaven.proto.backplane.grpc.HeadOrTailRequest + (*HeadOrTailByRequest)(nil), // 24: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + (*UngroupRequest)(nil), // 25: io.deephaven.proto.backplane.grpc.UngroupRequest + (*MergeTablesRequest)(nil), // 26: io.deephaven.proto.backplane.grpc.MergeTablesRequest + (*SnapshotTableRequest)(nil), // 27: io.deephaven.proto.backplane.grpc.SnapshotTableRequest + (*CrossJoinTablesRequest)(nil), // 28: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + (*NaturalJoinTablesRequest)(nil), // 29: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + (*ExactJoinTablesRequest)(nil), // 30: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + (*LeftJoinTablesRequest)(nil), // 31: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + (*AsOfJoinTablesRequest)(nil), // 32: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + (*ComboAggregateRequest)(nil), // 33: io.deephaven.proto.backplane.grpc.ComboAggregateRequest + (*SortDescriptor)(nil), // 34: io.deephaven.proto.backplane.grpc.SortDescriptor + (*SortTableRequest)(nil), // 35: io.deephaven.proto.backplane.grpc.SortTableRequest + (*FilterTableRequest)(nil), // 36: io.deephaven.proto.backplane.grpc.FilterTableRequest + (*Reference)(nil), // 37: io.deephaven.proto.backplane.grpc.Reference + (*Literal)(nil), // 38: io.deephaven.proto.backplane.grpc.Literal + (*Value)(nil), // 39: io.deephaven.proto.backplane.grpc.Value + (*Condition)(nil), // 40: io.deephaven.proto.backplane.grpc.Condition + (*AndCondition)(nil), // 41: io.deephaven.proto.backplane.grpc.AndCondition + (*OrCondition)(nil), // 42: io.deephaven.proto.backplane.grpc.OrCondition + (*NotCondition)(nil), // 43: io.deephaven.proto.backplane.grpc.NotCondition + (*CompareCondition)(nil), // 44: io.deephaven.proto.backplane.grpc.CompareCondition + (*InCondition)(nil), // 45: io.deephaven.proto.backplane.grpc.InCondition + (*InvokeCondition)(nil), // 46: io.deephaven.proto.backplane.grpc.InvokeCondition + (*IsNullCondition)(nil), // 47: io.deephaven.proto.backplane.grpc.IsNullCondition + (*MatchesCondition)(nil), // 48: io.deephaven.proto.backplane.grpc.MatchesCondition + (*ContainsCondition)(nil), // 49: io.deephaven.proto.backplane.grpc.ContainsCondition + (*SearchCondition)(nil), // 50: io.deephaven.proto.backplane.grpc.SearchCondition + (*FlattenRequest)(nil), // 51: io.deephaven.proto.backplane.grpc.FlattenRequest + (*RunChartDownsampleRequest)(nil), // 52: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + (*CreateInputTableRequest)(nil), // 53: io.deephaven.proto.backplane.grpc.CreateInputTableRequest + (*BatchTableRequest)(nil), // 54: io.deephaven.proto.backplane.grpc.BatchTableRequest + (*UpdateByRequest_UpdateByOptions)(nil), // 55: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions + (*UpdateByRequest_UpdateByOperation)(nil), // 56: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation + (*UpdateByRequest_UpdateByOperation_UpdateByColumn)(nil), // 57: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec)(nil), // 58: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum)(nil), // 59: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin)(nil), // 60: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax)(nil), // 61: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct)(nil), // 62: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill)(nil), // 63: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma)(nil), // 64: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions)(nil), // 65: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale)(nil), // 66: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks)(nil), // 67: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime)(nil), // 68: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime + (*ComboAggregateRequest_Aggregate)(nil), // 69: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate + (*RunChartDownsampleRequest_ZoomRange)(nil), // 70: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange + (*CreateInputTableRequest_InputTableKind)(nil), // 71: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind + (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly)(nil), // 72: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly + (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked)(nil), // 73: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked + (*BatchTableRequest_Operation)(nil), // 74: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation + (*ticket.Ticket)(nil), // 75: io.deephaven.proto.backplane.grpc.Ticket } var file_deephaven_proto_table_proto_depIdxs = []int32{ - 57, // 0: io.deephaven.proto.backplane.grpc.TableReference.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 1: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 2: io.deephaven.proto.backplane.grpc.FetchTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 3: io.deephaven.proto.backplane.grpc.FetchTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 4: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 5: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 6: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 7: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 57, // 8: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.export_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 57, // 9: io.deephaven.proto.backplane.grpc.EmptyTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 57, // 10: io.deephaven.proto.backplane.grpc.TimeTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 57, // 11: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 12: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 13: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 14: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 15: io.deephaven.proto.backplane.grpc.DropColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 16: io.deephaven.proto.backplane.grpc.DropColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 17: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 18: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 19: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 20: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 21: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 22: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 23: io.deephaven.proto.backplane.grpc.UngroupRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 24: io.deephaven.proto.backplane.grpc.UngroupRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 25: io.deephaven.proto.backplane.grpc.MergeTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 26: io.deephaven.proto.backplane.grpc.MergeTablesRequest.source_ids:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 27: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 28: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 29: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 30: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 31: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 32: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 33: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 34: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 35: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 36: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 37: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 38: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 39: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 40: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 41: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 42: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 43: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 6, // 44: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 2, // 45: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.as_of_match_rule:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule - 57, // 46: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 47: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 51, // 48: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.aggregates:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate - 4, // 49: io.deephaven.proto.backplane.grpc.SortDescriptor.direction:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection - 57, // 50: io.deephaven.proto.backplane.grpc.SortTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 51: io.deephaven.proto.backplane.grpc.SortTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 30, // 52: io.deephaven.proto.backplane.grpc.SortTableRequest.sorts:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor - 57, // 53: io.deephaven.proto.backplane.grpc.FilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 54: io.deephaven.proto.backplane.grpc.FilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 36, // 55: io.deephaven.proto.backplane.grpc.FilterTableRequest.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition - 33, // 56: io.deephaven.proto.backplane.grpc.Value.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference - 34, // 57: io.deephaven.proto.backplane.grpc.Value.literal:type_name -> io.deephaven.proto.backplane.grpc.Literal - 37, // 58: io.deephaven.proto.backplane.grpc.Condition.and:type_name -> io.deephaven.proto.backplane.grpc.AndCondition - 38, // 59: io.deephaven.proto.backplane.grpc.Condition.or:type_name -> io.deephaven.proto.backplane.grpc.OrCondition - 39, // 60: io.deephaven.proto.backplane.grpc.Condition.not:type_name -> io.deephaven.proto.backplane.grpc.NotCondition - 40, // 61: io.deephaven.proto.backplane.grpc.Condition.compare:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition - 41, // 62: io.deephaven.proto.backplane.grpc.Condition.in:type_name -> io.deephaven.proto.backplane.grpc.InCondition - 42, // 63: io.deephaven.proto.backplane.grpc.Condition.invoke:type_name -> io.deephaven.proto.backplane.grpc.InvokeCondition - 43, // 64: io.deephaven.proto.backplane.grpc.Condition.is_null:type_name -> io.deephaven.proto.backplane.grpc.IsNullCondition - 44, // 65: io.deephaven.proto.backplane.grpc.Condition.matches:type_name -> io.deephaven.proto.backplane.grpc.MatchesCondition - 45, // 66: io.deephaven.proto.backplane.grpc.Condition.contains:type_name -> io.deephaven.proto.backplane.grpc.ContainsCondition - 46, // 67: io.deephaven.proto.backplane.grpc.Condition.search:type_name -> io.deephaven.proto.backplane.grpc.SearchCondition - 36, // 68: io.deephaven.proto.backplane.grpc.AndCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition - 36, // 69: io.deephaven.proto.backplane.grpc.OrCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition - 36, // 70: io.deephaven.proto.backplane.grpc.NotCondition.filter:type_name -> io.deephaven.proto.backplane.grpc.Condition - 5, // 71: io.deephaven.proto.backplane.grpc.CompareCondition.operation:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation - 0, // 72: io.deephaven.proto.backplane.grpc.CompareCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity - 35, // 73: io.deephaven.proto.backplane.grpc.CompareCondition.lhs:type_name -> io.deephaven.proto.backplane.grpc.Value - 35, // 74: io.deephaven.proto.backplane.grpc.CompareCondition.rhs:type_name -> io.deephaven.proto.backplane.grpc.Value - 35, // 75: io.deephaven.proto.backplane.grpc.InCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value - 35, // 76: io.deephaven.proto.backplane.grpc.InCondition.candidates:type_name -> io.deephaven.proto.backplane.grpc.Value - 0, // 77: io.deephaven.proto.backplane.grpc.InCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity - 1, // 78: io.deephaven.proto.backplane.grpc.InCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType - 35, // 79: io.deephaven.proto.backplane.grpc.InvokeCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value - 35, // 80: io.deephaven.proto.backplane.grpc.InvokeCondition.arguments:type_name -> io.deephaven.proto.backplane.grpc.Value - 33, // 81: io.deephaven.proto.backplane.grpc.IsNullCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference - 33, // 82: io.deephaven.proto.backplane.grpc.MatchesCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference - 0, // 83: io.deephaven.proto.backplane.grpc.MatchesCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity - 1, // 84: io.deephaven.proto.backplane.grpc.MatchesCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType - 33, // 85: io.deephaven.proto.backplane.grpc.ContainsCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference - 0, // 86: io.deephaven.proto.backplane.grpc.ContainsCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity - 1, // 87: io.deephaven.proto.backplane.grpc.ContainsCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType - 33, // 88: io.deephaven.proto.backplane.grpc.SearchCondition.optional_references:type_name -> io.deephaven.proto.backplane.grpc.Reference - 57, // 89: io.deephaven.proto.backplane.grpc.FlattenRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 90: io.deephaven.proto.backplane.grpc.FlattenRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 57, // 91: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 92: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 52, // 93: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.zoom_range:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange - 57, // 94: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 6, // 95: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.source_table_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference - 53, // 96: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.kind:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind - 56, // 97: io.deephaven.proto.backplane.grpc.BatchTableRequest.ops:type_name -> io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation - 3, // 98: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.type:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType - 54, // 99: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_append_only:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly - 55, // 100: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_key_backed:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked - 13, // 101: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.empty_table:type_name -> io.deephaven.proto.backplane.grpc.EmptyTableRequest - 14, // 102: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.time_table:type_name -> io.deephaven.proto.backplane.grpc.TimeTableRequest - 17, // 103: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.drop_columns:type_name -> io.deephaven.proto.backplane.grpc.DropColumnsRequest - 15, // 104: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 105: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.lazy_update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 106: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 107: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 108: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 16, // 109: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select_distinct:type_name -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest - 32, // 110: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.filter:type_name -> io.deephaven.proto.backplane.grpc.FilterTableRequest - 18, // 111: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.unstructured_filter:type_name -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest - 31, // 112: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.sort:type_name -> io.deephaven.proto.backplane.grpc.SortTableRequest - 19, // 113: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest - 19, // 114: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest - 20, // 115: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest - 20, // 116: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest - 21, // 117: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.ungroup:type_name -> io.deephaven.proto.backplane.grpc.UngroupRequest - 22, // 118: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.merge:type_name -> io.deephaven.proto.backplane.grpc.MergeTablesRequest - 29, // 119: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.combo_aggregate:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest - 23, // 120: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.snapshot:type_name -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest - 47, // 121: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.flatten:type_name -> io.deephaven.proto.backplane.grpc.FlattenRequest - 48, // 122: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.run_chart_downsample:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest - 24, // 123: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.cross_join:type_name -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest - 25, // 124: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.natural_join:type_name -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest - 26, // 125: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.exact_join:type_name -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest - 27, // 126: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.left_join:type_name -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest - 28, // 127: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.as_of_join:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest - 8, // 128: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_table:type_name -> io.deephaven.proto.backplane.grpc.FetchTableRequest - 10, // 129: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_pandas_table:type_name -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest - 9, // 130: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.apply_preview_columns:type_name -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest - 49, // 131: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.create_input_table:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest - 57, // 132: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:input_type -> io.deephaven.proto.backplane.grpc.Ticket - 8, // 133: io.deephaven.proto.backplane.grpc.TableService.FetchTable:input_type -> io.deephaven.proto.backplane.grpc.FetchTableRequest - 10, // 134: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:input_type -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest - 9, // 135: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:input_type -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest - 13, // 136: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:input_type -> io.deephaven.proto.backplane.grpc.EmptyTableRequest - 14, // 137: io.deephaven.proto.backplane.grpc.TableService.TimeTable:input_type -> io.deephaven.proto.backplane.grpc.TimeTableRequest - 17, // 138: io.deephaven.proto.backplane.grpc.TableService.DropColumns:input_type -> io.deephaven.proto.backplane.grpc.DropColumnsRequest - 15, // 139: io.deephaven.proto.backplane.grpc.TableService.Update:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 140: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 141: io.deephaven.proto.backplane.grpc.TableService.View:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 142: io.deephaven.proto.backplane.grpc.TableService.UpdateView:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 15, // 143: io.deephaven.proto.backplane.grpc.TableService.Select:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest - 16, // 144: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:input_type -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest - 32, // 145: io.deephaven.proto.backplane.grpc.TableService.Filter:input_type -> io.deephaven.proto.backplane.grpc.FilterTableRequest - 18, // 146: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:input_type -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest - 31, // 147: io.deephaven.proto.backplane.grpc.TableService.Sort:input_type -> io.deephaven.proto.backplane.grpc.SortTableRequest - 19, // 148: io.deephaven.proto.backplane.grpc.TableService.Head:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest - 19, // 149: io.deephaven.proto.backplane.grpc.TableService.Tail:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest - 20, // 150: io.deephaven.proto.backplane.grpc.TableService.HeadBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest - 20, // 151: io.deephaven.proto.backplane.grpc.TableService.TailBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest - 21, // 152: io.deephaven.proto.backplane.grpc.TableService.Ungroup:input_type -> io.deephaven.proto.backplane.grpc.UngroupRequest - 22, // 153: io.deephaven.proto.backplane.grpc.TableService.MergeTables:input_type -> io.deephaven.proto.backplane.grpc.MergeTablesRequest - 24, // 154: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:input_type -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest - 25, // 155: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:input_type -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest - 26, // 156: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:input_type -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest - 27, // 157: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:input_type -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest - 28, // 158: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:input_type -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest - 29, // 159: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:input_type -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest - 23, // 160: io.deephaven.proto.backplane.grpc.TableService.Snapshot:input_type -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest - 47, // 161: io.deephaven.proto.backplane.grpc.TableService.Flatten:input_type -> io.deephaven.proto.backplane.grpc.FlattenRequest - 48, // 162: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:input_type -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest - 49, // 163: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:input_type -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest - 50, // 164: io.deephaven.proto.backplane.grpc.TableService.Batch:input_type -> io.deephaven.proto.backplane.grpc.BatchTableRequest - 11, // 165: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:input_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest - 7, // 166: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 167: io.deephaven.proto.backplane.grpc.TableService.FetchTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 168: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 169: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 170: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 171: io.deephaven.proto.backplane.grpc.TableService.TimeTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 172: io.deephaven.proto.backplane.grpc.TableService.DropColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 173: io.deephaven.proto.backplane.grpc.TableService.Update:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 174: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 175: io.deephaven.proto.backplane.grpc.TableService.View:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 176: io.deephaven.proto.backplane.grpc.TableService.UpdateView:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 177: io.deephaven.proto.backplane.grpc.TableService.Select:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 178: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 179: io.deephaven.proto.backplane.grpc.TableService.Filter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 180: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 181: io.deephaven.proto.backplane.grpc.TableService.Sort:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 182: io.deephaven.proto.backplane.grpc.TableService.Head:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 183: io.deephaven.proto.backplane.grpc.TableService.Tail:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 184: io.deephaven.proto.backplane.grpc.TableService.HeadBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 185: io.deephaven.proto.backplane.grpc.TableService.TailBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 186: io.deephaven.proto.backplane.grpc.TableService.Ungroup:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 187: io.deephaven.proto.backplane.grpc.TableService.MergeTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 188: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 189: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 190: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 191: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 192: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 193: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 194: io.deephaven.proto.backplane.grpc.TableService.Snapshot:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 195: io.deephaven.proto.backplane.grpc.TableService.Flatten:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 196: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 197: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 7, // 198: io.deephaven.proto.backplane.grpc.TableService.Batch:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse - 12, // 199: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage - 166, // [166:200] is the sub-list for method output_type - 132, // [132:166] is the sub-list for method input_type - 132, // [132:132] is the sub-list for extension type_name - 132, // [132:132] is the sub-list for extension extendee - 0, // [0:132] is the sub-list for field type_name + 75, // 0: io.deephaven.proto.backplane.grpc.TableReference.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 1: io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse.result_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 2: io.deephaven.proto.backplane.grpc.FetchTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 3: io.deephaven.proto.backplane.grpc.FetchTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 4: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 5: io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 6: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 7: io.deephaven.proto.backplane.grpc.FetchPandasTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 75, // 8: io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage.export_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 75, // 9: io.deephaven.proto.backplane.grpc.EmptyTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 75, // 10: io.deephaven.proto.backplane.grpc.TimeTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 75, // 11: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 12: io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 3, // 13: io.deephaven.proto.backplane.grpc.MathContext.rounding_mode:type_name -> io.deephaven.proto.backplane.grpc.MathContext.RoundingMode + 75, // 14: io.deephaven.proto.backplane.grpc.UpdateByRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 15: io.deephaven.proto.backplane.grpc.UpdateByRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 55, // 16: io.deephaven.proto.backplane.grpc.UpdateByRequest.options:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions + 56, // 17: io.deephaven.proto.backplane.grpc.UpdateByRequest.operations:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation + 75, // 18: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 19: io.deephaven.proto.backplane.grpc.SelectDistinctRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 20: io.deephaven.proto.backplane.grpc.DropColumnsRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 21: io.deephaven.proto.backplane.grpc.DropColumnsRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 22: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 23: io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 24: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 25: io.deephaven.proto.backplane.grpc.HeadOrTailRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 26: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 27: io.deephaven.proto.backplane.grpc.HeadOrTailByRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 28: io.deephaven.proto.backplane.grpc.UngroupRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 29: io.deephaven.proto.backplane.grpc.UngroupRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 30: io.deephaven.proto.backplane.grpc.MergeTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 31: io.deephaven.proto.backplane.grpc.MergeTablesRequest.source_ids:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 32: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 33: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 34: io.deephaven.proto.backplane.grpc.SnapshotTableRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 35: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 36: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 37: io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 38: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 39: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 40: io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 41: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 42: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 43: io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 44: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 45: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 46: io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 47: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 48: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.left_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 8, // 49: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.right_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 4, // 50: io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.as_of_match_rule:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule + 75, // 51: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 52: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 69, // 53: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.aggregates:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate + 6, // 54: io.deephaven.proto.backplane.grpc.SortDescriptor.direction:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection + 75, // 55: io.deephaven.proto.backplane.grpc.SortTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 56: io.deephaven.proto.backplane.grpc.SortTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 34, // 57: io.deephaven.proto.backplane.grpc.SortTableRequest.sorts:type_name -> io.deephaven.proto.backplane.grpc.SortDescriptor + 75, // 58: io.deephaven.proto.backplane.grpc.FilterTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 59: io.deephaven.proto.backplane.grpc.FilterTableRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 40, // 60: io.deephaven.proto.backplane.grpc.FilterTableRequest.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 37, // 61: io.deephaven.proto.backplane.grpc.Value.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 38, // 62: io.deephaven.proto.backplane.grpc.Value.literal:type_name -> io.deephaven.proto.backplane.grpc.Literal + 41, // 63: io.deephaven.proto.backplane.grpc.Condition.and:type_name -> io.deephaven.proto.backplane.grpc.AndCondition + 42, // 64: io.deephaven.proto.backplane.grpc.Condition.or:type_name -> io.deephaven.proto.backplane.grpc.OrCondition + 43, // 65: io.deephaven.proto.backplane.grpc.Condition.not:type_name -> io.deephaven.proto.backplane.grpc.NotCondition + 44, // 66: io.deephaven.proto.backplane.grpc.Condition.compare:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition + 45, // 67: io.deephaven.proto.backplane.grpc.Condition.in:type_name -> io.deephaven.proto.backplane.grpc.InCondition + 46, // 68: io.deephaven.proto.backplane.grpc.Condition.invoke:type_name -> io.deephaven.proto.backplane.grpc.InvokeCondition + 47, // 69: io.deephaven.proto.backplane.grpc.Condition.is_null:type_name -> io.deephaven.proto.backplane.grpc.IsNullCondition + 48, // 70: io.deephaven.proto.backplane.grpc.Condition.matches:type_name -> io.deephaven.proto.backplane.grpc.MatchesCondition + 49, // 71: io.deephaven.proto.backplane.grpc.Condition.contains:type_name -> io.deephaven.proto.backplane.grpc.ContainsCondition + 50, // 72: io.deephaven.proto.backplane.grpc.Condition.search:type_name -> io.deephaven.proto.backplane.grpc.SearchCondition + 40, // 73: io.deephaven.proto.backplane.grpc.AndCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 40, // 74: io.deephaven.proto.backplane.grpc.OrCondition.filters:type_name -> io.deephaven.proto.backplane.grpc.Condition + 40, // 75: io.deephaven.proto.backplane.grpc.NotCondition.filter:type_name -> io.deephaven.proto.backplane.grpc.Condition + 7, // 76: io.deephaven.proto.backplane.grpc.CompareCondition.operation:type_name -> io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation + 1, // 77: io.deephaven.proto.backplane.grpc.CompareCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 39, // 78: io.deephaven.proto.backplane.grpc.CompareCondition.lhs:type_name -> io.deephaven.proto.backplane.grpc.Value + 39, // 79: io.deephaven.proto.backplane.grpc.CompareCondition.rhs:type_name -> io.deephaven.proto.backplane.grpc.Value + 39, // 80: io.deephaven.proto.backplane.grpc.InCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value + 39, // 81: io.deephaven.proto.backplane.grpc.InCondition.candidates:type_name -> io.deephaven.proto.backplane.grpc.Value + 1, // 82: io.deephaven.proto.backplane.grpc.InCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 2, // 83: io.deephaven.proto.backplane.grpc.InCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 39, // 84: io.deephaven.proto.backplane.grpc.InvokeCondition.target:type_name -> io.deephaven.proto.backplane.grpc.Value + 39, // 85: io.deephaven.proto.backplane.grpc.InvokeCondition.arguments:type_name -> io.deephaven.proto.backplane.grpc.Value + 37, // 86: io.deephaven.proto.backplane.grpc.IsNullCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 37, // 87: io.deephaven.proto.backplane.grpc.MatchesCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 1, // 88: io.deephaven.proto.backplane.grpc.MatchesCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 2, // 89: io.deephaven.proto.backplane.grpc.MatchesCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 37, // 90: io.deephaven.proto.backplane.grpc.ContainsCondition.reference:type_name -> io.deephaven.proto.backplane.grpc.Reference + 1, // 91: io.deephaven.proto.backplane.grpc.ContainsCondition.case_sensitivity:type_name -> io.deephaven.proto.backplane.grpc.CaseSensitivity + 2, // 92: io.deephaven.proto.backplane.grpc.ContainsCondition.match_type:type_name -> io.deephaven.proto.backplane.grpc.MatchType + 37, // 93: io.deephaven.proto.backplane.grpc.SearchCondition.optional_references:type_name -> io.deephaven.proto.backplane.grpc.Reference + 75, // 94: io.deephaven.proto.backplane.grpc.FlattenRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 95: io.deephaven.proto.backplane.grpc.FlattenRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 75, // 96: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 97: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 70, // 98: io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.zoom_range:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange + 75, // 99: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 8, // 100: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.source_table_id:type_name -> io.deephaven.proto.backplane.grpc.TableReference + 71, // 101: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.kind:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind + 74, // 102: io.deephaven.proto.backplane.grpc.BatchTableRequest.ops:type_name -> io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation + 18, // 103: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions.math_context:type_name -> io.deephaven.proto.backplane.grpc.MathContext + 57, // 104: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.column:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn + 58, // 105: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.spec:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec + 59, // 106: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.sum:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum + 60, // 107: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.min:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin + 61, // 108: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.max:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax + 62, // 109: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.product:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct + 63, // 110: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.fill:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill + 64, // 111: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.ema:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma + 65, // 112: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.options:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions + 66, // 113: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.timescale:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale + 0, // 114: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.on_null_value:type_name -> io.deephaven.proto.backplane.grpc.BadDataBehavior + 0, // 115: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.on_nan_value:type_name -> io.deephaven.proto.backplane.grpc.BadDataBehavior + 0, // 116: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.on_null_time:type_name -> io.deephaven.proto.backplane.grpc.BadDataBehavior + 0, // 117: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.on_negative_delta_time:type_name -> io.deephaven.proto.backplane.grpc.BadDataBehavior + 0, // 118: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.on_zero_delta_time:type_name -> io.deephaven.proto.backplane.grpc.BadDataBehavior + 18, // 119: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions.big_value_context:type_name -> io.deephaven.proto.backplane.grpc.MathContext + 67, // 120: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.ticks:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks + 68, // 121: io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.time:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime + 5, // 122: io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate.type:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType + 72, // 123: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_append_only:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly + 73, // 124: io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.in_memory_key_backed:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked + 15, // 125: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.empty_table:type_name -> io.deephaven.proto.backplane.grpc.EmptyTableRequest + 16, // 126: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.time_table:type_name -> io.deephaven.proto.backplane.grpc.TimeTableRequest + 21, // 127: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.drop_columns:type_name -> io.deephaven.proto.backplane.grpc.DropColumnsRequest + 17, // 128: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 129: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.lazy_update:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 130: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 131: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_view:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 132: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select:type_name -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 20, // 133: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.select_distinct:type_name -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest + 36, // 134: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.filter:type_name -> io.deephaven.proto.backplane.grpc.FilterTableRequest + 22, // 135: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.unstructured_filter:type_name -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + 35, // 136: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.sort:type_name -> io.deephaven.proto.backplane.grpc.SortTableRequest + 23, // 137: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 23, // 138: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 24, // 139: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.head_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 24, // 140: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.tail_by:type_name -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 25, // 141: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.ungroup:type_name -> io.deephaven.proto.backplane.grpc.UngroupRequest + 26, // 142: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.merge:type_name -> io.deephaven.proto.backplane.grpc.MergeTablesRequest + 33, // 143: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.combo_aggregate:type_name -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest + 27, // 144: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.snapshot:type_name -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest + 51, // 145: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.flatten:type_name -> io.deephaven.proto.backplane.grpc.FlattenRequest + 52, // 146: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.run_chart_downsample:type_name -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + 28, // 147: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.cross_join:type_name -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + 29, // 148: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.natural_join:type_name -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + 30, // 149: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.exact_join:type_name -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + 31, // 150: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.left_join:type_name -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + 32, // 151: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.as_of_join:type_name -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + 10, // 152: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_table:type_name -> io.deephaven.proto.backplane.grpc.FetchTableRequest + 12, // 153: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.fetch_pandas_table:type_name -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + 11, // 154: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.apply_preview_columns:type_name -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + 53, // 155: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.create_input_table:type_name -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest + 19, // 156: io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.update_by:type_name -> io.deephaven.proto.backplane.grpc.UpdateByRequest + 75, // 157: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:input_type -> io.deephaven.proto.backplane.grpc.Ticket + 10, // 158: io.deephaven.proto.backplane.grpc.TableService.FetchTable:input_type -> io.deephaven.proto.backplane.grpc.FetchTableRequest + 12, // 159: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:input_type -> io.deephaven.proto.backplane.grpc.FetchPandasTableRequest + 11, // 160: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:input_type -> io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest + 15, // 161: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:input_type -> io.deephaven.proto.backplane.grpc.EmptyTableRequest + 16, // 162: io.deephaven.proto.backplane.grpc.TableService.TimeTable:input_type -> io.deephaven.proto.backplane.grpc.TimeTableRequest + 21, // 163: io.deephaven.proto.backplane.grpc.TableService.DropColumns:input_type -> io.deephaven.proto.backplane.grpc.DropColumnsRequest + 17, // 164: io.deephaven.proto.backplane.grpc.TableService.Update:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 165: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 166: io.deephaven.proto.backplane.grpc.TableService.View:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 167: io.deephaven.proto.backplane.grpc.TableService.UpdateView:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 17, // 168: io.deephaven.proto.backplane.grpc.TableService.Select:input_type -> io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest + 19, // 169: io.deephaven.proto.backplane.grpc.TableService.UpdateBy:input_type -> io.deephaven.proto.backplane.grpc.UpdateByRequest + 20, // 170: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:input_type -> io.deephaven.proto.backplane.grpc.SelectDistinctRequest + 36, // 171: io.deephaven.proto.backplane.grpc.TableService.Filter:input_type -> io.deephaven.proto.backplane.grpc.FilterTableRequest + 22, // 172: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:input_type -> io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest + 35, // 173: io.deephaven.proto.backplane.grpc.TableService.Sort:input_type -> io.deephaven.proto.backplane.grpc.SortTableRequest + 23, // 174: io.deephaven.proto.backplane.grpc.TableService.Head:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 23, // 175: io.deephaven.proto.backplane.grpc.TableService.Tail:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailRequest + 24, // 176: io.deephaven.proto.backplane.grpc.TableService.HeadBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 24, // 177: io.deephaven.proto.backplane.grpc.TableService.TailBy:input_type -> io.deephaven.proto.backplane.grpc.HeadOrTailByRequest + 25, // 178: io.deephaven.proto.backplane.grpc.TableService.Ungroup:input_type -> io.deephaven.proto.backplane.grpc.UngroupRequest + 26, // 179: io.deephaven.proto.backplane.grpc.TableService.MergeTables:input_type -> io.deephaven.proto.backplane.grpc.MergeTablesRequest + 28, // 180: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:input_type -> io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest + 29, // 181: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:input_type -> io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest + 30, // 182: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:input_type -> io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest + 31, // 183: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:input_type -> io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest + 32, // 184: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:input_type -> io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest + 33, // 185: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:input_type -> io.deephaven.proto.backplane.grpc.ComboAggregateRequest + 27, // 186: io.deephaven.proto.backplane.grpc.TableService.Snapshot:input_type -> io.deephaven.proto.backplane.grpc.SnapshotTableRequest + 51, // 187: io.deephaven.proto.backplane.grpc.TableService.Flatten:input_type -> io.deephaven.proto.backplane.grpc.FlattenRequest + 52, // 188: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:input_type -> io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest + 53, // 189: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:input_type -> io.deephaven.proto.backplane.grpc.CreateInputTableRequest + 54, // 190: io.deephaven.proto.backplane.grpc.TableService.Batch:input_type -> io.deephaven.proto.backplane.grpc.BatchTableRequest + 13, // 191: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:input_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest + 9, // 192: io.deephaven.proto.backplane.grpc.TableService.GetExportedTableCreationResponse:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 193: io.deephaven.proto.backplane.grpc.TableService.FetchTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 194: io.deephaven.proto.backplane.grpc.TableService.FetchPandasTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 195: io.deephaven.proto.backplane.grpc.TableService.ApplyPreviewColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 196: io.deephaven.proto.backplane.grpc.TableService.EmptyTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 197: io.deephaven.proto.backplane.grpc.TableService.TimeTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 198: io.deephaven.proto.backplane.grpc.TableService.DropColumns:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 199: io.deephaven.proto.backplane.grpc.TableService.Update:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 200: io.deephaven.proto.backplane.grpc.TableService.LazyUpdate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 201: io.deephaven.proto.backplane.grpc.TableService.View:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 202: io.deephaven.proto.backplane.grpc.TableService.UpdateView:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 203: io.deephaven.proto.backplane.grpc.TableService.Select:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 204: io.deephaven.proto.backplane.grpc.TableService.UpdateBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 205: io.deephaven.proto.backplane.grpc.TableService.SelectDistinct:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 206: io.deephaven.proto.backplane.grpc.TableService.Filter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 207: io.deephaven.proto.backplane.grpc.TableService.UnstructuredFilter:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 208: io.deephaven.proto.backplane.grpc.TableService.Sort:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 209: io.deephaven.proto.backplane.grpc.TableService.Head:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 210: io.deephaven.proto.backplane.grpc.TableService.Tail:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 211: io.deephaven.proto.backplane.grpc.TableService.HeadBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 212: io.deephaven.proto.backplane.grpc.TableService.TailBy:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 213: io.deephaven.proto.backplane.grpc.TableService.Ungroup:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 214: io.deephaven.proto.backplane.grpc.TableService.MergeTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 215: io.deephaven.proto.backplane.grpc.TableService.CrossJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 216: io.deephaven.proto.backplane.grpc.TableService.NaturalJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 217: io.deephaven.proto.backplane.grpc.TableService.ExactJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 218: io.deephaven.proto.backplane.grpc.TableService.LeftJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 219: io.deephaven.proto.backplane.grpc.TableService.AsOfJoinTables:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 220: io.deephaven.proto.backplane.grpc.TableService.ComboAggregate:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 221: io.deephaven.proto.backplane.grpc.TableService.Snapshot:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 222: io.deephaven.proto.backplane.grpc.TableService.Flatten:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 223: io.deephaven.proto.backplane.grpc.TableService.RunChartDownsample:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 224: io.deephaven.proto.backplane.grpc.TableService.CreateInputTable:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 9, // 225: io.deephaven.proto.backplane.grpc.TableService.Batch:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse + 14, // 226: io.deephaven.proto.backplane.grpc.TableService.ExportedTableUpdates:output_type -> io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage + 192, // [192:227] is the sub-list for method output_type + 157, // [157:192] is the sub-list for method input_type + 157, // [157:157] is the sub-list for extension type_name + 157, // [157:157] is the sub-list for extension extendee + 0, // [0:157] is the sub-list for field type_name } func init() { file_deephaven_proto_table_proto_init() } @@ -5965,7 +7466,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SelectDistinctRequest); i { + switch v := v.(*MathContext); i { case 0: return &v.state case 1: @@ -5977,7 +7478,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DropColumnsRequest); i { + switch v := v.(*UpdateByRequest); i { case 0: return &v.state case 1: @@ -5989,7 +7490,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnstructuredFilterTableRequest); i { + switch v := v.(*SelectDistinctRequest); i { case 0: return &v.state case 1: @@ -6001,7 +7502,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadOrTailRequest); i { + switch v := v.(*DropColumnsRequest); i { case 0: return &v.state case 1: @@ -6013,7 +7514,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadOrTailByRequest); i { + switch v := v.(*UnstructuredFilterTableRequest); i { case 0: return &v.state case 1: @@ -6025,7 +7526,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UngroupRequest); i { + switch v := v.(*HeadOrTailRequest); i { case 0: return &v.state case 1: @@ -6037,7 +7538,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MergeTablesRequest); i { + switch v := v.(*HeadOrTailByRequest); i { case 0: return &v.state case 1: @@ -6049,7 +7550,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotTableRequest); i { + switch v := v.(*UngroupRequest); i { case 0: return &v.state case 1: @@ -6061,7 +7562,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CrossJoinTablesRequest); i { + switch v := v.(*MergeTablesRequest); i { case 0: return &v.state case 1: @@ -6073,7 +7574,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NaturalJoinTablesRequest); i { + switch v := v.(*SnapshotTableRequest); i { case 0: return &v.state case 1: @@ -6085,7 +7586,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExactJoinTablesRequest); i { + switch v := v.(*CrossJoinTablesRequest); i { case 0: return &v.state case 1: @@ -6097,7 +7598,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LeftJoinTablesRequest); i { + switch v := v.(*NaturalJoinTablesRequest); i { case 0: return &v.state case 1: @@ -6109,7 +7610,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AsOfJoinTablesRequest); i { + switch v := v.(*ExactJoinTablesRequest); i { case 0: return &v.state case 1: @@ -6121,7 +7622,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComboAggregateRequest); i { + switch v := v.(*LeftJoinTablesRequest); i { case 0: return &v.state case 1: @@ -6133,7 +7634,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SortDescriptor); i { + switch v := v.(*AsOfJoinTablesRequest); i { case 0: return &v.state case 1: @@ -6145,7 +7646,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SortTableRequest); i { + switch v := v.(*ComboAggregateRequest); i { case 0: return &v.state case 1: @@ -6157,7 +7658,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FilterTableRequest); i { + switch v := v.(*SortDescriptor); i { case 0: return &v.state case 1: @@ -6169,7 +7670,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reference); i { + switch v := v.(*SortTableRequest); i { case 0: return &v.state case 1: @@ -6181,7 +7682,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Literal); i { + switch v := v.(*FilterTableRequest); i { case 0: return &v.state case 1: @@ -6193,7 +7694,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Value); i { + switch v := v.(*Reference); i { case 0: return &v.state case 1: @@ -6205,7 +7706,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Condition); i { + switch v := v.(*Literal); i { case 0: return &v.state case 1: @@ -6217,7 +7718,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AndCondition); i { + switch v := v.(*Value); i { case 0: return &v.state case 1: @@ -6229,7 +7730,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrCondition); i { + switch v := v.(*Condition); i { case 0: return &v.state case 1: @@ -6241,7 +7742,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotCondition); i { + switch v := v.(*AndCondition); i { case 0: return &v.state case 1: @@ -6253,7 +7754,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompareCondition); i { + switch v := v.(*OrCondition); i { case 0: return &v.state case 1: @@ -6265,7 +7766,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InCondition); i { + switch v := v.(*NotCondition); i { case 0: return &v.state case 1: @@ -6277,7 +7778,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeCondition); i { + switch v := v.(*CompareCondition); i { case 0: return &v.state case 1: @@ -6289,7 +7790,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsNullCondition); i { + switch v := v.(*InCondition); i { case 0: return &v.state case 1: @@ -6301,7 +7802,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MatchesCondition); i { + switch v := v.(*InvokeCondition); i { case 0: return &v.state case 1: @@ -6313,7 +7814,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainsCondition); i { + switch v := v.(*IsNullCondition); i { case 0: return &v.state case 1: @@ -6325,7 +7826,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchCondition); i { + switch v := v.(*MatchesCondition); i { case 0: return &v.state case 1: @@ -6337,7 +7838,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlattenRequest); i { + switch v := v.(*ContainsCondition); i { case 0: return &v.state case 1: @@ -6349,7 +7850,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunChartDownsampleRequest); i { + switch v := v.(*SearchCondition); i { case 0: return &v.state case 1: @@ -6361,7 +7862,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateInputTableRequest); i { + switch v := v.(*FlattenRequest); i { case 0: return &v.state case 1: @@ -6373,7 +7874,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchTableRequest); i { + switch v := v.(*RunChartDownsampleRequest); i { case 0: return &v.state case 1: @@ -6385,7 +7886,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComboAggregateRequest_Aggregate); i { + switch v := v.(*CreateInputTableRequest); i { case 0: return &v.state case 1: @@ -6397,7 +7898,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunChartDownsampleRequest_ZoomRange); i { + switch v := v.(*BatchTableRequest); i { case 0: return &v.state case 1: @@ -6409,7 +7910,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateInputTableRequest_InputTableKind); i { + switch v := v.(*UpdateByRequest_UpdateByOptions); i { case 0: return &v.state case 1: @@ -6421,7 +7922,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly); i { + switch v := v.(*UpdateByRequest_UpdateByOperation); i { case 0: return &v.state case 1: @@ -6433,7 +7934,7 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked); i { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn); i { case 0: return &v.state case 1: @@ -6445,6 +7946,198 @@ func file_deephaven_proto_table_proto_init() { } } file_deephaven_proto_table_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeSum); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeMax); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByCumulativeProduct); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByFill); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTicks); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_UpdateByEmaTime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComboAggregateRequest_Aggregate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunChartDownsampleRequest_ZoomRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_table_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchTableRequest_Operation); i { case 0: return &v.state @@ -6461,18 +8154,18 @@ func file_deephaven_proto_table_proto_init() { (*TableReference_Ticket)(nil), (*TableReference_BatchOffset)(nil), } - file_deephaven_proto_table_proto_msgTypes[28].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[30].OneofWrappers = []interface{}{ (*Literal_StringValue)(nil), (*Literal_DoubleValue)(nil), (*Literal_BoolValue)(nil), (*Literal_LongValue)(nil), (*Literal_NanoTimeValue)(nil), } - file_deephaven_proto_table_proto_msgTypes[29].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[31].OneofWrappers = []interface{}{ (*Value_Reference)(nil), (*Value_Literal)(nil), } - file_deephaven_proto_table_proto_msgTypes[30].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[32].OneofWrappers = []interface{}{ (*Condition_And)(nil), (*Condition_Or)(nil), (*Condition_Not)(nil), @@ -6484,16 +8177,33 @@ func file_deephaven_proto_table_proto_init() { (*Condition_Contains)(nil), (*Condition_Search)(nil), } - file_deephaven_proto_table_proto_msgTypes[43].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[45].OneofWrappers = []interface{}{ (*CreateInputTableRequest_SourceTableId)(nil), (*CreateInputTableRequest_Schema)(nil), } - file_deephaven_proto_table_proto_msgTypes[46].OneofWrappers = []interface{}{} - file_deephaven_proto_table_proto_msgTypes[47].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[47].OneofWrappers = []interface{}{} + file_deephaven_proto_table_proto_msgTypes[48].OneofWrappers = []interface{}{ + (*UpdateByRequest_UpdateByOperation_Column)(nil), + } + file_deephaven_proto_table_proto_msgTypes[50].OneofWrappers = []interface{}{ + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Sum)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Min)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Max)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Product)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Fill)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_Ema)(nil), + } + file_deephaven_proto_table_proto_msgTypes[57].OneofWrappers = []interface{}{} + file_deephaven_proto_table_proto_msgTypes[58].OneofWrappers = []interface{}{ + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Ticks)(nil), + (*UpdateByRequest_UpdateByOperation_UpdateByColumn_UpdateBySpec_UpdateByEma_UpdateByEmaTimescale_Time)(nil), + } + file_deephaven_proto_table_proto_msgTypes[62].OneofWrappers = []interface{}{} + file_deephaven_proto_table_proto_msgTypes[63].OneofWrappers = []interface{}{ (*CreateInputTableRequest_InputTableKind_InMemoryAppendOnly_)(nil), (*CreateInputTableRequest_InputTableKind_InMemoryKeyBacked_)(nil), } - file_deephaven_proto_table_proto_msgTypes[50].OneofWrappers = []interface{}{ + file_deephaven_proto_table_proto_msgTypes[66].OneofWrappers = []interface{}{ (*BatchTableRequest_Operation_EmptyTable)(nil), (*BatchTableRequest_Operation_TimeTable)(nil), (*BatchTableRequest_Operation_DropColumns)(nil), @@ -6525,14 +8235,15 @@ func file_deephaven_proto_table_proto_init() { (*BatchTableRequest_Operation_FetchPandasTable)(nil), (*BatchTableRequest_Operation_ApplyPreviewColumns)(nil), (*BatchTableRequest_Operation_CreateInputTable)(nil), + (*BatchTableRequest_Operation_UpdateBy)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_deephaven_proto_table_proto_rawDesc, - NumEnums: 6, - NumMessages: 51, + NumEnums: 8, + NumMessages: 67, NumExtensions: 0, NumServices: 1, }, diff --git a/go/internal/proto/table/table_grpc.pb.go b/go/internal/proto/table/table_grpc.pb.go index f1fa830c237..fffd20f8d15 100644 --- a/go/internal/proto/table/table_grpc.pb.go +++ b/go/internal/proto/table/table_grpc.pb.go @@ -47,6 +47,8 @@ type TableServiceClient interface { UpdateView(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) // Select the given columns from the given table. Select(ctx context.Context, in *SelectOrUpdateRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) + // Returns the result of an updateBy table operation. + UpdateBy(ctx context.Context, in *UpdateByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) // Returns a new table definition with the unique tuples of the specified columns SelectDistinct(ctx context.Context, in *SelectDistinctRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) // Filter parent table with structured filters. @@ -224,6 +226,15 @@ func (c *tableServiceClient) Select(ctx context.Context, in *SelectOrUpdateReque return out, nil } +func (c *tableServiceClient) UpdateBy(ctx context.Context, in *UpdateByRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { + out := new(ExportedTableCreationResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/UpdateBy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *tableServiceClient) SelectDistinct(ctx context.Context, in *SelectDistinctRequest, opts ...grpc.CallOption) (*ExportedTableCreationResponse, error) { out := new(ExportedTableCreationResponse) err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.TableService/SelectDistinct", in, out, opts...) @@ -496,6 +507,8 @@ type TableServiceServer interface { UpdateView(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) // Select the given columns from the given table. Select(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) + // Returns the result of an updateBy table operation. + UpdateBy(context.Context, *UpdateByRequest) (*ExportedTableCreationResponse, error) // Returns a new table definition with the unique tuples of the specified columns SelectDistinct(context.Context, *SelectDistinctRequest) (*ExportedTableCreationResponse, error) // Filter parent table with structured filters. @@ -598,6 +611,9 @@ func (UnimplementedTableServiceServer) UpdateView(context.Context, *SelectOrUpda func (UnimplementedTableServiceServer) Select(context.Context, *SelectOrUpdateRequest) (*ExportedTableCreationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Select not implemented") } +func (UnimplementedTableServiceServer) UpdateBy(context.Context, *UpdateByRequest) (*ExportedTableCreationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBy not implemented") +} func (UnimplementedTableServiceServer) SelectDistinct(context.Context, *SelectDistinctRequest) (*ExportedTableCreationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SelectDistinct not implemented") } @@ -893,6 +909,24 @@ func _TableService_Select_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _TableService_UpdateBy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateByRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TableServiceServer).UpdateBy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.TableService/UpdateBy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TableServiceServer).UpdateBy(ctx, req.(*UpdateByRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TableService_SelectDistinct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SelectDistinctRequest) if err := dec(in); err != nil { @@ -1350,6 +1384,10 @@ var TableService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Select", Handler: _TableService_Select_Handler, }, + { + MethodName: "UpdateBy", + Handler: _TableService_UpdateBy_Handler, + }, { MethodName: "SelectDistinct", Handler: _TableService_SelectDistinct_Handler, diff --git a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java index f44d6101573..f5e191384bd 100644 --- a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java +++ b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java @@ -4,14 +4,17 @@ package io.deephaven.client; import io.deephaven.api.TableOperations; +import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.client.impl.TableHandle; -import io.deephaven.client.impl.TableHandle.TableHandleException; import io.deephaven.qst.TableCreator; import io.deephaven.qst.column.header.ColumnHeader; import io.deephaven.qst.table.NewTable; import io.deephaven.qst.table.TableCreatorImpl; import io.deephaven.qst.table.TableSpec; +import io.deephaven.qst.table.UpdateByTable; import org.apache.arrow.flight.FlightStream; +import org.apache.arrow.vector.BigIntVector; +import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.types.Types.MinorType; import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.FieldType; @@ -54,6 +57,28 @@ public void getStream() throws Exception { } } + @Test + public void updateBy() throws Exception { + final int size = 100; + final UpdateByTable spec = TableSpec.empty(size) + .view("I=i") + .updateBy(UpdateByOperation.CumSum("I")); + try ( + final TableHandle handle = flightSession.session().batch().execute(spec); + final FlightStream stream = flightSession.stream(handle)) { + assertThat(stream.next()).isTrue(); + final VectorSchemaRoot root = stream.getRoot(); + assertThat(root.getRowCount()).isEqualTo(size); + final BigIntVector longVector = (BigIntVector) root.getVector("I"); + long sum = 0; + for (int i = 0; i < size; ++i) { + sum += i; + final long actual = longVector.get(i); + assertThat(actual).isEqualTo(sum); + } + } + } + // TODO (deephaven-core#1373): Hook up doPut integration unit testing // @Test // public void doPutStream() throws Exception { diff --git a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java index 9a68276f66f..630ce4fae4c 100644 --- a/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java +++ b/java-client/session-dagger/src/test/java/io/deephaven/client/UpdateOrSelectSessionTest.java @@ -57,12 +57,11 @@ public TableSpec apply(TableSpec spec, String[] formulas) { public TableSpec apply(TableSpec spec, String[] formulas) { return spec.lazyUpdate(formulas); } - } + }, } private final UpdateOrSelect method; - public UpdateOrSelectSessionTest(UpdateOrSelect method) { this.method = Objects.requireNonNull(method); } @@ -98,6 +97,12 @@ public void allowTickingII() throws InterruptedException, TableHandle.TableHandl allow(TimeTable.of(Duration.ofSeconds(1)).tail(1), "Y = ii"); } + @Test + public void allowSpecificFunctions() throws TableHandle.TableHandleException, InterruptedException { + // This test isn't meant to be exhaustive + allow(TableSpec.empty(1).view("Seconds=(long)1659095381"), "Nanos = secondsToNanos(Seconds)"); + } + @Test public void disallowCustomFunctions() throws InterruptedException { disallow(TableSpec.empty(1), String.format("X = %s.myFunction()", UpdateOrSelectSessionTest.class.getName())); @@ -109,25 +114,41 @@ public void disallowNew() throws InterruptedException { } @Test - public void allowPreviousColumn() throws TableHandle.TableHandleException, InterruptedException { - allow(TableSpec.empty(1), "X = 12", "Y = X + 1"); + public void allowPreviousColumnName() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1).view("X = 12"), "X"); + } + + @Test + public void allowPreviousColumnAssignment() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1).view("X = 12"), "Y = X"); + } + + @Test + public void allowPreviousColumnAssignmentInline() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12", "Y = X"); } @Test public void disallowFutureColumn() throws InterruptedException { - disallow(TableSpec.empty(1), "Y = X + 1", "X = 12"); + disallow(TableSpec.empty(1), "Y = X", "X = 12"); } @Test public void allowReassignmentColumn() throws TableHandle.TableHandleException, InterruptedException { - allow(TableSpec.empty(1), "X = 12", "Y = X + 1", "X = 42"); + allow(TableSpec.empty(1), "X = 12", "Y = X", "X = 42"); } @Test public void disallowNonExistentColumn() throws InterruptedException { - disallow(TableSpec.empty(1), "X = 12", "Y = Z + 1"); + disallow(TableSpec.empty(1), "Y = Z"); } + @Test + public void allowValue() throws TableHandle.TableHandleException, InterruptedException { + allow(TableSpec.empty(1), "X = 12"); + } + + private void allow(TableSpec parent, String... formulas) throws InterruptedException, TableHandle.TableHandleException { try (final TableHandle handle = session.batch().execute(method.apply(parent, formulas))) { diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java index 8a7f91ab76c..c1fbdb93267 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java @@ -63,6 +63,7 @@ import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.proto.backplane.grpc.TimeTableRequest; import io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; import io.deephaven.proto.util.ExportTicketHelper; import io.deephaven.qst.table.AggregateAllByTable; import io.deephaven.qst.table.AggregationTable; @@ -458,7 +459,11 @@ public void visit(CountByTable countByTable) { @Override public void visit(UpdateByTable updateByTable) { - throw new UnsupportedOperationException("TODO(deephaven-core#2607): UpdateByTable gRPC impl"); + final UpdateByRequest.Builder request = UpdateByBuilder + .adapt(updateByTable) + .setResultId(ticket) + .setSourceId(ref(updateByTable.parent())); + out = op(Builder::setUpdateBy, request); } private SelectOrUpdateRequest selectOrUpdate(SingleParentTable x, diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/UpdateByBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/UpdateByBuilder.java new file mode 100644 index 00000000000..12265dd6f62 --- /dev/null +++ b/java-client/session/src/main/java/io/deephaven/client/impl/UpdateByBuilder.java @@ -0,0 +1,210 @@ +package io.deephaven.client.impl; + +import io.deephaven.api.ColumnName; +import io.deephaven.api.Strings; +import io.deephaven.api.agg.Pair; +import io.deephaven.api.updateby.BadDataBehavior; +import io.deephaven.api.updateby.ColumnUpdateOperation; +import io.deephaven.api.updateby.OperationControl; +import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.api.updateby.UpdateByOperation; +import io.deephaven.api.updateby.spec.CumMinMaxSpec; +import io.deephaven.api.updateby.spec.CumProdSpec; +import io.deephaven.api.updateby.spec.CumSumSpec; +import io.deephaven.api.updateby.spec.EmaSpec; +import io.deephaven.api.updateby.spec.FillBySpec; +import io.deephaven.api.updateby.spec.TimeScale; +import io.deephaven.api.updateby.spec.UpdateBySpec; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions; +import io.deephaven.qst.table.UpdateByTable; + +import java.math.MathContext; +import java.math.RoundingMode; + +class UpdateByBuilder { + + public static UpdateByRequest.Builder adapt(UpdateByTable updateByTable) { + UpdateByRequest.Builder builder = UpdateByRequest.newBuilder(); + updateByTable.control().map(UpdateByBuilder::adapt).ifPresent(builder::setOptions); + for (UpdateByOperation operation : updateByTable.operations()) { + builder.addOperations(adapt(operation)); + } + for (ColumnName groupByColumn : updateByTable.groupByColumns()) { + builder.addGroupByColumns(groupByColumn.name()); + } + return builder; + } + + private enum OperationVisitor implements UpdateByOperation.Visitor { + INSTANCE; + + @Override + public UpdateByRequest.UpdateByOperation visit(ColumnUpdateOperation clause) { + return UpdateByRequest.UpdateByOperation.newBuilder().setColumn(adapt(clause)).build(); + } + } + + static UpdateByRequest.UpdateByOperation adapt(UpdateByOperation clause) { + return clause.walk(OperationVisitor.INSTANCE); + } + + private static UpdateByColumn adapt(ColumnUpdateOperation columnUpdate) { + UpdateByColumn.Builder builder = UpdateByColumn.newBuilder() + .setSpec(adapt(columnUpdate.spec())); + for (Pair pair : columnUpdate.columns()) { + builder.addMatchPairs(Strings.of(pair)); + } + return builder.build(); + } + + private enum SpecVisitor implements UpdateBySpec.Visitor { + INSTANCE; + + private static io.deephaven.proto.backplane.grpc.BadDataBehavior adapt(BadDataBehavior b) { + switch (b) { + case RESET: + return io.deephaven.proto.backplane.grpc.BadDataBehavior.RESET; + case SKIP: + return io.deephaven.proto.backplane.grpc.BadDataBehavior.SKIP; + case THROW: + return io.deephaven.proto.backplane.grpc.BadDataBehavior.THROW; + case POISON: + return io.deephaven.proto.backplane.grpc.BadDataBehavior.POISON; + default: + throw new IllegalArgumentException("Unexpected BadDataBehavior: " + b); + } + } + + private static UpdateByEmaOptions adapt(OperationControl control) { + UpdateByEmaOptions.Builder builder = UpdateByEmaOptions.newBuilder(); + control.onNullValue().map(SpecVisitor::adapt).ifPresent(builder::setOnNullValue); + control.onNanValue().map(SpecVisitor::adapt).ifPresent(builder::setOnNanValue); + control.onNullTime().map(SpecVisitor::adapt).ifPresent(builder::setOnNullTime); + control.onNegativeDeltaTime().map(SpecVisitor::adapt).ifPresent(builder::setOnNegativeDeltaTime); + control.onZeroDeltaTime().map(SpecVisitor::adapt).ifPresent(builder::setOnZeroDeltaTime); + control.bigValueContext().map(UpdateByBuilder::adapt).ifPresent(builder::setBigValueContext); + return builder.build(); + } + + private static UpdateByEmaTimescale adapt(TimeScale timeScale) { + if (timeScale.isTimeBased()) { + return UpdateByEmaTimescale.newBuilder() + .setTime(UpdateByEmaTime.newBuilder() + .setColumn(timeScale.timestampCol()) + .setPeriodNanos(timeScale.timescaleUnits()) + .build()) + .build(); + } else { + return UpdateByEmaTimescale.newBuilder() + .setTicks(UpdateByEmaTicks.newBuilder() + .setTicks(timeScale.timescaleUnits()) + .build()) + .build(); + } + } + + @Override + public UpdateByColumn.UpdateBySpec visit(EmaSpec ema) { + UpdateByEma.Builder builder = UpdateByEma.newBuilder().setTimescale(adapt(ema.timeScale())); + ema.control().map(SpecVisitor::adapt).ifPresent(builder::setOptions); + return UpdateByColumn.UpdateBySpec.newBuilder() + .setEma(builder.build()) + .build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(FillBySpec f) { + return UpdateByColumn.UpdateBySpec.newBuilder() + .setFill(UpdateByFill.getDefaultInstance()) + .build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumSumSpec c) { + return UpdateByColumn.UpdateBySpec.newBuilder() + .setSum(UpdateByCumulativeSum.getDefaultInstance()) + .build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumMinMaxSpec m) { + if (m.isMax()) { + return UpdateByColumn.UpdateBySpec.newBuilder() + .setMax(UpdateByCumulativeMax.getDefaultInstance()) + .build(); + } else { + return UpdateByColumn.UpdateBySpec.newBuilder() + .setMin(UpdateByCumulativeMin.getDefaultInstance()) + .build(); + } + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumProdSpec p) { + return UpdateByColumn.UpdateBySpec.newBuilder() + .setProduct(UpdateByCumulativeProduct.getDefaultInstance()) + .build(); + } + } + + static UpdateByColumn.UpdateBySpec adapt(UpdateBySpec spec) { + return spec.walk(SpecVisitor.INSTANCE); + } + + static UpdateByOptions adapt(UpdateByControl control) { + UpdateByOptions.Builder builder = UpdateByOptions.newBuilder(); + final Boolean useRedirection = control.useRedirection(); + if (useRedirection != null) { + builder.setUseRedirection(useRedirection); + } + control.chunkCapacity().ifPresent(builder::setChunkCapacity); + control.maxStaticSparseMemoryOverhead().ifPresent(builder::setMaxStaticSparseMemoryOverhead); + control.initialHashTableSize().ifPresent(builder::setInitialHashTableSize); + control.maximumLoadFactor().ifPresent(builder::setMaximumLoadFactor); + control.targetLoadFactor().ifPresent(builder::setTargetLoadFactor); + control.mathContext().map(UpdateByBuilder::adapt).ifPresent(builder::setMathContext); + return builder.build(); + } + + static io.deephaven.proto.backplane.grpc.MathContext adapt(MathContext mathContext) { + return io.deephaven.proto.backplane.grpc.MathContext.newBuilder() + .setPrecision(mathContext.getPrecision()) + .setRoundingMode(adapt(mathContext.getRoundingMode())) + .build(); + } + + private static io.deephaven.proto.backplane.grpc.MathContext.RoundingMode adapt(RoundingMode roundingMode) { + switch (roundingMode) { + case UP: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.UP; + case DOWN: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.DOWN; + case CEILING: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.CEILING; + case FLOOR: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.FLOOR; + case HALF_UP: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.HALF_UP; + case HALF_DOWN: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.HALF_DOWN; + case HALF_EVEN: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.HALF_EVEN; + case UNNECESSARY: + return io.deephaven.proto.backplane.grpc.MathContext.RoundingMode.UNNECESSARY; + default: + throw new IllegalArgumentException("Unexpected rounding mode: " + roundingMode); + } + } +} diff --git a/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByControlBuilderTest.java b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByControlBuilderTest.java new file mode 100644 index 00000000000..ac093a43f73 --- /dev/null +++ b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByControlBuilderTest.java @@ -0,0 +1,69 @@ +package io.deephaven.client.impl; + +import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.proto.backplane.grpc.MathContext.RoundingMode; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions; +import org.junit.jupiter.api.Test; + +import java.math.MathContext; + +import static org.assertj.core.api.Assertions.assertThat; + +public class UpdateByControlBuilderTest { + + @Test + void defaultInstance() { + check(UpdateByControl.defaultInstance(), UpdateByOptions.getDefaultInstance()); + } + + @Test + void useRedirection() { + check(UpdateByControl.builder().useRedirection(false).build(), + UpdateByOptions.newBuilder().setUseRedirection(false).build()); + check(UpdateByControl.builder().useRedirection(true).build(), + UpdateByOptions.newBuilder().setUseRedirection(true).build()); + } + + @Test + void chunkCapacity() { + check(UpdateByControl.builder().chunkCapacity(42).build(), + UpdateByOptions.newBuilder().setChunkCapacity(42).build()); + } + + @Test + void maxStaticSparseMemoryOverhead() { + check(UpdateByControl.builder().maxStaticSparseMemoryOverhead(1.42).build(), + UpdateByOptions.newBuilder().setMaxStaticSparseMemoryOverhead(1.42).build()); + } + + @Test + void initialHashTableSize() { + check(UpdateByControl.builder().initialHashTableSize(13).build(), + UpdateByOptions.newBuilder().setInitialHashTableSize(13).build()); + } + + @Test + void maximumLoadFactor() { + check(UpdateByControl.builder().maximumLoadFactor(0.99).build(), + UpdateByOptions.newBuilder().setMaximumLoadFactor(0.99).build()); + } + + @Test + void targetLoadFactor() { + check(UpdateByControl.builder().targetLoadFactor(0.5).build(), + UpdateByOptions.newBuilder().setTargetLoadFactor(0.5).build()); + } + + @Test + void mathContext() { + check(UpdateByControl.builder().mathContext(MathContext.DECIMAL32).build(), + UpdateByOptions.newBuilder().setMathContext(io.deephaven.proto.backplane.grpc.MathContext.newBuilder() + .setPrecision(7).setRoundingMode(RoundingMode.HALF_EVEN).build()).build()); + } + + private static void check(UpdateByControl control, UpdateByOptions options) { + assertThat(UpdateByBuilder.adapt(control)).isEqualTo(options); + } +} diff --git a/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByOperationBuilderTest.java b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByOperationBuilderTest.java new file mode 100644 index 00000000000..1bf30ea5ed0 --- /dev/null +++ b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateByOperationBuilderTest.java @@ -0,0 +1,48 @@ +package io.deephaven.client.impl; + +import io.deephaven.api.ColumnName; +import io.deephaven.api.updateby.ColumnUpdateOperation; +import io.deephaven.api.updateby.UpdateByOperation; +import io.deephaven.api.updateby.UpdateByOperation.Visitor; +import io.deephaven.api.updateby.spec.CumSumSpec; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class UpdateByOperationBuilderTest { + + @Test + void ColumnUpdateOperation() { + check(ColumnUpdateOperation.builder().spec(CumSumSpec.of()).addColumns(ColumnName.of("Foo")).build()); + } + + private enum ExpectedOperationVisitor implements Visitor { + INSTANCE; + + // Note: this is written in a way to encourage new tests get added any time a new UpdateByOperation type gets + // created. The visitor methods should not typically need to look at the actual message - it's meant to return + // the expected value. + + @Override + public UpdateByRequest.UpdateByOperation visit(ColumnUpdateOperation clause) { + return UpdateByRequest.UpdateByOperation.newBuilder() + .setColumn(UpdateByColumn.newBuilder() + .setSpec(UpdateBySpec.newBuilder().setSum(UpdateByCumulativeSum.getDefaultInstance()) + .build()) + .addMatchPairs("Foo").build()) + .build(); + } + } + + private static void check(UpdateByOperation spec) { + check(spec, spec.walk(ExpectedOperationVisitor.INSTANCE)); + } + + private static void check(UpdateByOperation spec, UpdateByRequest.UpdateByOperation expected) { + assertThat(UpdateByBuilder.adapt(spec)).isEqualTo(expected); + } +} diff --git a/java-client/session/src/test/java/io/deephaven/client/impl/UpdateBySpecBuilderTest.java b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateBySpecBuilderTest.java new file mode 100644 index 00000000000..42e04b0f201 --- /dev/null +++ b/java-client/session/src/test/java/io/deephaven/client/impl/UpdateBySpecBuilderTest.java @@ -0,0 +1,122 @@ +package io.deephaven.client.impl; + +import io.deephaven.api.updateby.BadDataBehavior; +import io.deephaven.api.updateby.OperationControl; +import io.deephaven.api.updateby.spec.CumMinMaxSpec; +import io.deephaven.api.updateby.spec.CumProdSpec; +import io.deephaven.api.updateby.spec.CumSumSpec; +import io.deephaven.api.updateby.spec.EmaSpec; +import io.deephaven.api.updateby.spec.FillBySpec; +import io.deephaven.api.updateby.spec.UpdateBySpec; +import io.deephaven.api.updateby.spec.UpdateBySpec.Visitor; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill; +import org.junit.jupiter.api.Test; + +import java.time.Duration; + +import static org.assertj.core.api.Assertions.assertThat; + +public class UpdateBySpecBuilderTest { + + private enum ExpectedSpecVisitor implements Visitor { + INSTANCE; + + // Note: this is written in a way to encourage new tests get added any time a new UpdateByColumn.UpdateBySpec + // type gets created. + // The visitor methods should not typically need to look at the actual message - it's meant to return the + // expected value. An exception is for CumMinMaxSpec, where we need to read the field to determine the proper + // gRPC message type. + + @Override + public UpdateByColumn.UpdateBySpec visit(EmaSpec ema) { + return UpdateByColumn.UpdateBySpec + .newBuilder().setEma( + UpdateByEma.newBuilder() + .setTimescale(UpdateByEmaTimescale.newBuilder().setTime(UpdateByEmaTime.newBuilder() + .setColumn("Timestamp").setPeriodNanos(1).build()).build()) + .build()) + .build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(FillBySpec f) { + return UpdateByColumn.UpdateBySpec.newBuilder().setFill(UpdateByFill.getDefaultInstance()).build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumSumSpec c) { + return UpdateByColumn.UpdateBySpec.newBuilder().setSum(UpdateByCumulativeSum.getDefaultInstance()).build(); + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumMinMaxSpec m) { + if (m.isMax()) { + return UpdateByColumn.UpdateBySpec.newBuilder().setMax(UpdateByCumulativeMax.getDefaultInstance()) + .build(); + } else { + return UpdateByColumn.UpdateBySpec.newBuilder().setMin(UpdateByCumulativeMin.getDefaultInstance()) + .build(); + } + } + + @Override + public UpdateByColumn.UpdateBySpec visit(CumProdSpec p) { + return UpdateByColumn.UpdateBySpec.newBuilder().setProduct(UpdateByCumulativeProduct.getDefaultInstance()) + .build(); + } + } + + @Test + void ema() { + check(EmaSpec.ofTime("Timestamp", Duration.ofNanos(1))); + check(EmaSpec.ofTicks(42L), UpdateByColumn.UpdateBySpec.newBuilder() + .setEma(UpdateByEma.newBuilder().setTimescale(UpdateByEmaTimescale.newBuilder() + .setTicks(UpdateByEmaTimescale.UpdateByEmaTicks.newBuilder().setTicks(42L).build()).build()) + .build()) + .build()); + check(EmaSpec.ofTicks(OperationControl.builder().onNullValue(BadDataBehavior.THROW).build(), 100L), + UpdateByColumn.UpdateBySpec.newBuilder().setEma(UpdateByEma.newBuilder() + .setOptions(UpdateByEma.UpdateByEmaOptions.newBuilder() + .setOnNullValue(io.deephaven.proto.backplane.grpc.BadDataBehavior.THROW).build()) + .setTimescale(UpdateByEmaTimescale.newBuilder() + .setTicks(UpdateByEmaTimescale.UpdateByEmaTicks.newBuilder().setTicks(100L).build()) + .build()) + .build()).build()); + } + + @Test + void cumulativeMin() { + check(CumMinMaxSpec.of(false)); + } + + @Test + void cumulativeMax() { + check(CumMinMaxSpec.of(true)); + } + + @Test + void cumulativeProd() { + check(CumProdSpec.of()); + } + + @Test + void fillBy() { + check(FillBySpec.of()); + } + + private static void check(UpdateBySpec spec) { + check(spec, spec.walk(ExpectedSpecVisitor.INSTANCE)); + } + + private static void check(UpdateBySpec spec, UpdateByColumn.UpdateBySpec expected) { + assertThat(UpdateByBuilder.adapt(spec)).isEqualTo(expected); + } +} diff --git a/proto/proto-backplane-grpc/src/main/java/io/deephaven/proto/util/OperationHelper.java b/proto/proto-backplane-grpc/src/main/java/io/deephaven/proto/util/OperationHelper.java index 9ff919a457f..4a7d4fb5e70 100644 --- a/proto/proto-backplane-grpc/src/main/java/io/deephaven/proto/util/OperationHelper.java +++ b/proto/proto-backplane-grpc/src/main/java/io/deephaven/proto/util/OperationHelper.java @@ -80,6 +80,8 @@ public static Stream getSourceIds(Operation op) { return op.getCreateInputTable().hasSourceTableId() ? Stream.of(op.getCreateInputTable().getSourceTableId()) : Stream.empty(); + case UPDATE_BY: + return Stream.of(op.getUpdateBy().getSourceId()); case OP_NOT_SET: throw new IllegalStateException("Operation id not set"); default: diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto index d5692e6a8a9..119f3a12869 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto @@ -72,6 +72,11 @@ service TableService { */ rpc Select(SelectOrUpdateRequest) returns (ExportedTableCreationResponse) {} + /* + * Returns the result of an updateBy table operation. + */ + rpc UpdateBy(UpdateByRequest) returns (ExportedTableCreationResponse) {} + /* * Returns a new table definition with the unique tuples of the specified columns */ @@ -268,6 +273,162 @@ message SelectOrUpdateRequest { repeated string column_specs = 3; } +message MathContext { + enum RoundingMode { + UP = 0; + DOWN = 1; + CEILING = 2; + FLOOR = 3; + HALF_UP = 4; + HALF_DOWN = 5; + HALF_EVEN = 6; + UNNECESSARY = 7; + } + sint32 precision = 1; + RoundingMode rounding_mode = 2; +} + +// Directives for how to handle {@code null} and {@code NaN} values +enum BadDataBehavior { + // Throw an exception and abort processing when bad data is encountered. + THROW = 0; + + // Reset the state for the bucket to {@code null} when invalid data is encountered. + RESET = 1; + + // Skip and do not process the invalid data without changing state. + SKIP = 2; + + // Allow the bad data to poison the result. This is only valid for use with NaN. + POISON = 3; +} + +// Create a table with the same rowset as its parent that will perform the specified set of row +// based operations to it. As opposed to {@link #update(String...)} these operations are more restricted but are +// capable of processing state between rows. This operation will group the table by the specified set of keys if +// provided before applying the operation. +message UpdateByRequest { + + message UpdateByOptions { + // If redirections should be used for output sources instead of sparse array sources. + // If unset, defaults to server-provided defaults. + optional bool use_redirection = 1; + + // The maximum chunk capacity. + // If unset, defaults to server-provided defaults. + optional int32 chunk_capacity = 2; + + // The maximum fractional memory overhead allowable for sparse redirections as a fraction (e.g. 1.1 is 10% + // overhead). Values less than zero disable overhead checking, and result in always using the sparse structure. A + // value of zero results in never using the sparse structure. + // If unset, defaults to server-provided defaults. + optional double max_static_sparse_memory_overhead = 3; + + // The initial hash table size. + // If unset, defaults to server-provided defaults. + optional int32 initial_hash_table_size = 4; + + // The maximum load factor for the hash table. + // If unset, defaults to server-provided defaults. + optional double maximum_load_factor = 5; + + // The target load factor for the hash table. + // If unset, defaults to server-provided defaults. + optional double target_load_factor = 6; + + // The math context. + // If unset, defaults to server-provided defaults. + MathContext math_context = 7; + } + + message UpdateByOperation { + message UpdateByColumn { + message UpdateBySpec { + message UpdateByCumulativeSum { + + } + + message UpdateByCumulativeMin { + + } + + message UpdateByCumulativeMax { + + } + + message UpdateByCumulativeProduct { + + } + + message UpdateByFill { + + } + + message UpdateByEma { + message UpdateByEmaOptions { + // If unset, defaults to server-provided defaults. + optional BadDataBehavior on_null_value = 1; + + // If unset, defaults to server-provided defaults. + optional BadDataBehavior on_nan_value = 2; + + // If unset, defaults to server-provided defaults. + optional BadDataBehavior on_null_time = 3; + + // If unset, defaults to server-provided defaults. + optional BadDataBehavior on_negative_delta_time = 4; + + // If unset, defaults to server-provided defaults. + optional BadDataBehavior on_zero_delta_time = 5; + + // If unset, defaults to server-provided defaults. + MathContext big_value_context = 6; + } + message UpdateByEmaTimescale { + message UpdateByEmaTicks { + sint64 ticks = 1 [jstype=JS_STRING]; + } + message UpdateByEmaTime { + string column = 1; + sint64 period_nanos = 2 [jstype=JS_STRING]; + } + oneof type { + UpdateByEmaTicks ticks = 1; + UpdateByEmaTime time = 2; + } + } + // If unset, defaults to server-provided defaults. + UpdateByEmaOptions options = 1; + UpdateByEmaTimescale timescale = 2; + } + + oneof type { + UpdateByCumulativeSum sum = 1; + UpdateByCumulativeMin min = 2; + UpdateByCumulativeMax max = 3; + UpdateByCumulativeProduct product = 4; + UpdateByFill fill = 5; + UpdateByEma ema = 6; + } + } + + UpdateBySpec spec = 1; + repeated string match_pairs = 2; + } + oneof type { + UpdateByColumn column = 1; + } + } + + Ticket result_id = 1; + TableReference source_id = 2; + + // If unset, defaults to server-provided defaults. + UpdateByOptions options = 3; + repeated UpdateByOperation operations = 4; + repeated string group_by_columns = 5; +} + message SelectDistinctRequest { Ticket result_id = 1; TableReference source_id = 2; @@ -635,6 +796,7 @@ message BatchTableRequest { FetchPandasTableRequest fetch_pandas_table = 29; ApplyPreviewColumnsRequest apply_preview_columns = 30; CreateInputTableRequest create_input_table = 31; + UpdateByRequest update_by = 32; } } } diff --git a/py/client/pydeephaven/proto/table_pb2.py b/py/client/pydeephaven/proto/table_pb2.py index 415b63317ef..57e42004aea 100644 --- a/py/client/pydeephaven/proto/table_pb2.py +++ b/py/client/pydeephaven/proto/table_pb2.py @@ -16,12 +16,18 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x64\x65\x65phaven/proto/table.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"l\n\x0eTableReference\x12;\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketH\x00\x12\x16\n\x0c\x62\x61tch_offset\x18\x02 \x01(\x11H\x00\x42\x05\n\x03ref\"\xc6\x01\n\x1d\x45xportedTableCreationResponse\x12\x44\n\tresult_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\nerror_info\x18\x03 \x01(\t\x12\x15\n\rschema_header\x18\x04 \x01(\x0c\x12\x11\n\tis_static\x18\x05 \x01(\x08\x12\x10\n\x04size\x18\x06 \x01(\x12\x42\x02\x30\x01\"\x97\x01\n\x11\x46\x65tchTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xa0\x01\n\x1a\x41pplyPreviewColumnsRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9d\x01\n\x17\x46\x65tchPandasTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x1d\n\x1b\x45xportedTableUpdatesRequest\"\x8c\x01\n\x1a\x45xportedTableUpdateMessage\x12<\n\texport_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x1e\n\x16update_failure_message\x18\x03 \x01(\t\"c\n\x11\x45mptyTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\"\x88\x01\n\x10TimeTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x1c\n\x10start_time_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x18\n\x0cperiod_nanos\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xb1\x01\n\x15SelectOrUpdateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_specs\x18\x03 \x03(\t\"\xb1\x01\n\x15SelectDistinctRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xae\x01\n\x12\x44ropColumnsRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xb5\x01\n\x1eUnstructuredFilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07\x66ilters\x18\x03 \x03(\t\"\xad\x01\n\x11HeadOrTailRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xce\x01\n\x13HeadOrTailByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x1d\n\x15group_by_column_specs\x18\x04 \x03(\t\"\xc3\x01\n\x0eUngroupRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x11\n\tnull_fill\x18\x03 \x01(\x08\x12\x1a\n\x12\x63olumns_to_ungroup\x18\x04 \x03(\t\"\xad\x01\n\x12MergeTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x45\n\nsource_ids\x18\x02 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x12\n\nkey_column\x18\x03 \x01(\t\"\x91\x02\n\x14SnapshotTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x1b\n\x13\x64o_initial_snapshot\x18\x04 \x01(\x08\x12\x15\n\rstamp_columns\x18\x05 \x03(\t\"\xa7\x02\n\x16\x43rossJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\x14\n\x0creserve_bits\x18\x06 \x01(\x05\"\x93\x02\n\x18NaturalJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x91\x02\n\x16\x45xactJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x90\x02\n\x15LeftJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\xc9\x03\n\x15\x41sOfJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\\\n\x10\x61s_of_match_rule\x18\x07 \x01(\x0e\x32\x42.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule\"Y\n\tMatchRule\x12\x13\n\x0fLESS_THAN_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12GREATER_THAN_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\"\xfa\x04\n\x15\x43omboAggregateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12V\n\naggregates\x18\x03 \x03(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate\x12\x18\n\x10group_by_columns\x18\x04 \x03(\t\x12\x13\n\x0b\x66orce_combo\x18\x05 \x01(\x08\x1a\xad\x01\n\tAggregate\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x12\x13\n\x0b\x63olumn_name\x18\x03 \x01(\t\x12\x12\n\npercentile\x18\x04 \x01(\x01\x12\x12\n\navg_median\x18\x05 \x01(\x08\"\xa5\x01\n\x07\x41ggType\x12\x07\n\x03SUM\x10\x00\x12\x0b\n\x07\x41\x42S_SUM\x10\x01\x12\t\n\x05GROUP\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\t\n\x05\x43OUNT\x10\x04\x12\t\n\x05\x46IRST\x10\x05\x12\x08\n\x04LAST\x10\x06\x12\x07\n\x03MIN\x10\x07\x12\x07\n\x03MAX\x10\x08\x12\n\n\x06MEDIAN\x10\t\x12\x0e\n\nPERCENTILE\x10\n\x12\x07\n\x03STD\x10\x0b\x12\x07\n\x03VAR\x10\x0c\x12\x10\n\x0cWEIGHTED_AVG\x10\r\"\xe1\x01\n\x0eSortDescriptor\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\x12\x13\n\x0bis_absolute\x18\x02 \x01(\x08\x12R\n\tdirection\x18\x03 \x01(\x0e\x32?.io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection\"Q\n\rSortDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\nDESCENDING\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\r\n\tASCENDING\x10\x01\x12\x0b\n\x07REVERSE\x10\x02\"\xd8\x01\n\x10SortTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12@\n\x05sorts\x18\x03 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.SortDescriptor\"\xd7\x01\n\x12\x46ilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12=\n\x07\x66ilters\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\" \n\tReference\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\"\x91\x01\n\x07Literal\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x18\n\nlong_value\x18\x04 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1d\n\x0fnano_time_value\x18\x05 \x01(\x12\x42\x02\x30\x01H\x00\x42\x07\n\x05value\"\x91\x01\n\x05Value\x12\x41\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.ReferenceH\x00\x12=\n\x07literal\x18\x02 \x01(\x0b\x32*.io.deephaven.proto.backplane.grpc.LiteralH\x00\x42\x06\n\x04\x64\x61ta\"\xbc\x05\n\tCondition\x12>\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\x91\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xae\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x42\x04\n\x02op*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xce%\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x41H\x01P\x01Z;github.com/deephaven/deephaven-core/go/internal/proto/tableb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x64\x65\x65phaven/proto/table.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"l\n\x0eTableReference\x12;\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketH\x00\x12\x16\n\x0c\x62\x61tch_offset\x18\x02 \x01(\x11H\x00\x42\x05\n\x03ref\"\xc6\x01\n\x1d\x45xportedTableCreationResponse\x12\x44\n\tresult_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\nerror_info\x18\x03 \x01(\t\x12\x15\n\rschema_header\x18\x04 \x01(\x0c\x12\x11\n\tis_static\x18\x05 \x01(\x08\x12\x10\n\x04size\x18\x06 \x01(\x12\x42\x02\x30\x01\"\x97\x01\n\x11\x46\x65tchTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\xa0\x01\n\x1a\x41pplyPreviewColumnsRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x9d\x01\n\x17\x46\x65tchPandasTableRequest\x12\x44\n\tsource_id\x18\x01 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x1d\n\x1b\x45xportedTableUpdatesRequest\"\x8c\x01\n\x1a\x45xportedTableUpdateMessage\x12<\n\texport_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x1e\n\x16update_failure_message\x18\x03 \x01(\t\"c\n\x11\x45mptyTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x10\n\x04size\x18\x02 \x01(\x12\x42\x02\x30\x01\"\x88\x01\n\x10TimeTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x1c\n\x10start_time_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x12\x18\n\x0cperiod_nanos\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xb1\x01\n\x15SelectOrUpdateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_specs\x18\x03 \x03(\t\"\xea\x01\n\x0bMathContext\x12\x11\n\tprecision\x18\x01 \x01(\x11\x12R\n\rrounding_mode\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.MathContext.RoundingMode\"t\n\x0cRoundingMode\x12\x06\n\x02UP\x10\x00\x12\x08\n\x04\x44OWN\x10\x01\x12\x0b\n\x07\x43\x45ILING\x10\x02\x12\t\n\x05\x46LOOR\x10\x03\x12\x0b\n\x07HALF_UP\x10\x04\x12\r\n\tHALF_DOWN\x10\x05\x12\r\n\tHALF_EVEN\x10\x06\x12\x0f\n\x0bUNNECESSARY\x10\x07\"\xe6\x1a\n\x0fUpdateByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12S\n\x07options\x18\x03 \x01(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions\x12X\n\noperations\x18\x04 \x03(\x0b\x32\x44.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation\x12\x18\n\x10group_by_columns\x18\x05 \x03(\t\x1a\xc3\x03\n\x0fUpdateByOptions\x12\x1c\n\x0fuse_redirection\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x63hunk_capacity\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12.\n!max_static_sparse_memory_overhead\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12$\n\x17initial_hash_table_size\x18\x04 \x01(\x05H\x03\x88\x01\x01\x12 \n\x13maximum_load_factor\x18\x05 \x01(\x01H\x04\x88\x01\x01\x12\x1f\n\x12target_load_factor\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x44\n\x0cmath_context\x18\x07 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.MathContextB\x12\n\x10_use_redirectionB\x11\n\x0f_chunk_capacityB$\n\"_max_static_sparse_memory_overheadB\x1a\n\x18_initial_hash_table_sizeB\x16\n\x14_maximum_load_factorB\x15\n\x13_target_load_factor\x1a\xbf\x14\n\x11UpdateByOperation\x12\x65\n\x06\x63olumn\x18\x01 \x01(\x0b\x32S.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumnH\x00\x1a\xba\x13\n\x0eUpdateByColumn\x12n\n\x04spec\x18\x01 \x01(\x0b\x32`.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x1a\xa2\x12\n\x0cUpdateBySpec\x12\x85\x01\n\x03sum\x18\x01 \x01(\x0b\x32v.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSumH\x00\x12\x85\x01\n\x03min\x18\x02 \x01(\x0b\x32v.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMinH\x00\x12\x85\x01\n\x03max\x18\x03 \x01(\x0b\x32v.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMaxH\x00\x12\x8d\x01\n\x07product\x18\x04 \x01(\x0b\x32z.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProductH\x00\x12}\n\x04\x66ill\x18\x05 \x01(\x0b\x32m.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFillH\x00\x12{\n\x03\x65ma\x18\x06 \x01(\x0b\x32l.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEmaH\x00\x1a\x17\n\x15UpdateByCumulativeSum\x1a\x17\n\x15UpdateByCumulativeMin\x1a\x17\n\x15UpdateByCumulativeMax\x1a\x1b\n\x19UpdateByCumulativeProduct\x1a\x0e\n\x0cUpdateByFill\x1a\xed\n\n\x0bUpdateByEma\x12\x90\x01\n\x07options\x18\x01 \x01(\x0b\x32\x7f.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions\x12\x95\x01\n\ttimescale\x18\x02 \x01(\x0b\x32\x81\x01.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale\x1a\xe1\x04\n\x12UpdateByEmaOptions\x12N\n\ron_null_value\x18\x01 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.BadDataBehaviorH\x00\x88\x01\x01\x12M\n\x0con_nan_value\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.BadDataBehaviorH\x01\x88\x01\x01\x12M\n\x0con_null_time\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.BadDataBehaviorH\x02\x88\x01\x01\x12W\n\x16on_negative_delta_time\x18\x04 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.BadDataBehaviorH\x03\x88\x01\x01\x12S\n\x12on_zero_delta_time\x18\x05 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.BadDataBehaviorH\x04\x88\x01\x01\x12I\n\x11\x62ig_value_context\x18\x06 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.MathContextB\x10\n\x0e_on_null_valueB\x0f\n\r_on_nan_valueB\x0f\n\r_on_null_timeB\x19\n\x17_on_negative_delta_timeB\x15\n\x13_on_zero_delta_time\x1a\xce\x03\n\x14UpdateByEmaTimescale\x12\xa4\x01\n\x05ticks\x18\x01 \x01(\x0b\x32\x92\x01.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicksH\x00\x12\xa2\x01\n\x04time\x18\x02 \x01(\x0b\x32\x91\x01.io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTimeH\x00\x1a%\n\x10UpdateByEmaTicks\x12\x11\n\x05ticks\x18\x01 \x01(\x12\x42\x02\x30\x01\x1a;\n\x0fUpdateByEmaTime\x12\x0e\n\x06\x63olumn\x18\x01 \x01(\t\x12\x18\n\x0cperiod_nanos\x18\x02 \x01(\x12\x42\x02\x30\x01\x42\x06\n\x04typeB\x06\n\x04typeB\x06\n\x04type\"\xb1\x01\n\x15SelectDistinctRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xae\x01\n\x12\x44ropColumnsRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x0c\x63olumn_names\x18\x03 \x03(\t\"\xb5\x01\n\x1eUnstructuredFilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x0f\n\x07\x66ilters\x18\x03 \x03(\t\"\xad\x01\n\x11HeadOrTailRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\"\xce\x01\n\x13HeadOrTailByRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x14\n\x08num_rows\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x1d\n\x15group_by_column_specs\x18\x04 \x03(\t\"\xc3\x01\n\x0eUngroupRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x11\n\tnull_fill\x18\x03 \x01(\x08\x12\x1a\n\x12\x63olumns_to_ungroup\x18\x04 \x03(\t\"\xad\x01\n\x12MergeTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x45\n\nsource_ids\x18\x02 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x12\n\nkey_column\x18\x03 \x01(\t\"\x91\x02\n\x14SnapshotTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x1b\n\x13\x64o_initial_snapshot\x18\x04 \x01(\x08\x12\x15\n\rstamp_columns\x18\x05 \x03(\t\"\xa7\x02\n\x16\x43rossJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\x14\n\x0creserve_bits\x18\x06 \x01(\x05\"\x93\x02\n\x18NaturalJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x91\x02\n\x16\x45xactJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\x90\x02\n\x15LeftJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\"\xc9\x03\n\x15\x41sOfJoinTablesRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x07left_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x43\n\x08right_id\x18\x03 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x18\n\x10\x63olumns_to_match\x18\x04 \x03(\t\x12\x16\n\x0e\x63olumns_to_add\x18\x05 \x03(\t\x12\\\n\x10\x61s_of_match_rule\x18\x07 \x01(\x0e\x32\x42.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest.MatchRule\"Y\n\tMatchRule\x12\x13\n\x0fLESS_THAN_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12GREATER_THAN_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\"\xfa\x04\n\x15\x43omboAggregateRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12V\n\naggregates\x18\x03 \x03(\x0b\x32\x42.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate\x12\x18\n\x10group_by_columns\x18\x04 \x03(\t\x12\x13\n\x0b\x66orce_combo\x18\x05 \x01(\x08\x1a\xad\x01\n\tAggregate\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.io.deephaven.proto.backplane.grpc.ComboAggregateRequest.AggType\x12\x13\n\x0bmatch_pairs\x18\x02 \x03(\t\x12\x13\n\x0b\x63olumn_name\x18\x03 \x01(\t\x12\x12\n\npercentile\x18\x04 \x01(\x01\x12\x12\n\navg_median\x18\x05 \x01(\x08\"\xa5\x01\n\x07\x41ggType\x12\x07\n\x03SUM\x10\x00\x12\x0b\n\x07\x41\x42S_SUM\x10\x01\x12\t\n\x05GROUP\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\t\n\x05\x43OUNT\x10\x04\x12\t\n\x05\x46IRST\x10\x05\x12\x08\n\x04LAST\x10\x06\x12\x07\n\x03MIN\x10\x07\x12\x07\n\x03MAX\x10\x08\x12\n\n\x06MEDIAN\x10\t\x12\x0e\n\nPERCENTILE\x10\n\x12\x07\n\x03STD\x10\x0b\x12\x07\n\x03VAR\x10\x0c\x12\x10\n\x0cWEIGHTED_AVG\x10\r\"\xe1\x01\n\x0eSortDescriptor\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\x12\x13\n\x0bis_absolute\x18\x02 \x01(\x08\x12R\n\tdirection\x18\x03 \x01(\x0e\x32?.io.deephaven.proto.backplane.grpc.SortDescriptor.SortDirection\"Q\n\rSortDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\nDESCENDING\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\r\n\tASCENDING\x10\x01\x12\x0b\n\x07REVERSE\x10\x02\"\xd8\x01\n\x10SortTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12@\n\x05sorts\x18\x03 \x03(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.SortDescriptor\"\xd7\x01\n\x12\x46ilterTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12=\n\x07\x66ilters\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\" \n\tReference\x12\x13\n\x0b\x63olumn_name\x18\x01 \x01(\t\"\x91\x01\n\x07Literal\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x18\n\nlong_value\x18\x04 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1d\n\x0fnano_time_value\x18\x05 \x01(\x12\x42\x02\x30\x01H\x00\x42\x07\n\x05value\"\x91\x01\n\x05Value\x12\x41\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.ReferenceH\x00\x12=\n\x07literal\x18\x02 \x01(\x0b\x32*.io.deephaven.proto.backplane.grpc.LiteralH\x00\x42\x06\n\x04\x64\x61ta\"\xbc\x05\n\tCondition\x12>\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\xda\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xf7\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x12G\n\tupdate_by\x18 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.UpdateByRequestH\x00\x42\x04\n\x02op*=\n\x0f\x42\x61\x64\x44\x61taBehavior\x12\t\n\x05THROW\x10\x00\x12\t\n\x05RESET\x10\x01\x12\x08\n\x04SKIP\x10\x02\x12\n\n\x06POISON\x10\x03*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xd3&\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x82\x01\n\x08UpdateBy\x12\x32.io.deephaven.proto.backplane.grpc.UpdateByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x41H\x01P\x01Z;github.com/deephaven/deephaven-core/go/internal/proto/tableb\x06proto3') +_BADDATABEHAVIOR = DESCRIPTOR.enum_types_by_name['BadDataBehavior'] +BadDataBehavior = enum_type_wrapper.EnumTypeWrapper(_BADDATABEHAVIOR) _CASESENSITIVITY = DESCRIPTOR.enum_types_by_name['CaseSensitivity'] CaseSensitivity = enum_type_wrapper.EnumTypeWrapper(_CASESENSITIVITY) _MATCHTYPE = DESCRIPTOR.enum_types_by_name['MatchType'] MatchType = enum_type_wrapper.EnumTypeWrapper(_MATCHTYPE) +THROW = 0 +RESET = 1 +SKIP = 2 +POISON = 3 MATCH_CASE = 0 IGNORE_CASE = 1 REGULAR = 0 @@ -38,6 +44,22 @@ _EMPTYTABLEREQUEST = DESCRIPTOR.message_types_by_name['EmptyTableRequest'] _TIMETABLEREQUEST = DESCRIPTOR.message_types_by_name['TimeTableRequest'] _SELECTORUPDATEREQUEST = DESCRIPTOR.message_types_by_name['SelectOrUpdateRequest'] +_MATHCONTEXT = DESCRIPTOR.message_types_by_name['MathContext'] +_UPDATEBYREQUEST = DESCRIPTOR.message_types_by_name['UpdateByRequest'] +_UPDATEBYREQUEST_UPDATEBYOPTIONS = _UPDATEBYREQUEST.nested_types_by_name['UpdateByOptions'] +_UPDATEBYREQUEST_UPDATEBYOPERATION = _UPDATEBYREQUEST.nested_types_by_name['UpdateByOperation'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN = _UPDATEBYREQUEST_UPDATEBYOPERATION.nested_types_by_name['UpdateByColumn'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN.nested_types_by_name['UpdateBySpec'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeSum'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeMin'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeMax'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeProduct'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByFill'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByEma'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA.nested_types_by_name['UpdateByEmaOptions'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA.nested_types_by_name['UpdateByEmaTimescale'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE.nested_types_by_name['UpdateByEmaTicks'] +_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE.nested_types_by_name['UpdateByEmaTime'] _SELECTDISTINCTREQUEST = DESCRIPTOR.message_types_by_name['SelectDistinctRequest'] _DROPCOLUMNSREQUEST = DESCRIPTOR.message_types_by_name['DropColumnsRequest'] _UNSTRUCTUREDFILTERTABLEREQUEST = DESCRIPTOR.message_types_by_name['UnstructuredFilterTableRequest'] @@ -79,6 +101,7 @@ _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.nested_types_by_name['InMemoryKeyBacked'] _BATCHTABLEREQUEST = DESCRIPTOR.message_types_by_name['BatchTableRequest'] _BATCHTABLEREQUEST_OPERATION = _BATCHTABLEREQUEST.nested_types_by_name['Operation'] +_MATHCONTEXT_ROUNDINGMODE = _MATHCONTEXT.enum_types_by_name['RoundingMode'] _ASOFJOINTABLESREQUEST_MATCHRULE = _ASOFJOINTABLESREQUEST.enum_types_by_name['MatchRule'] _COMBOAGGREGATEREQUEST_AGGTYPE = _COMBOAGGREGATEREQUEST.enum_types_by_name['AggType'] _SORTDESCRIPTOR_SORTDIRECTION = _SORTDESCRIPTOR.enum_types_by_name['SortDirection'] @@ -153,6 +176,132 @@ }) _sym_db.RegisterMessage(SelectOrUpdateRequest) +MathContext = _reflection.GeneratedProtocolMessageType('MathContext', (_message.Message,), { + 'DESCRIPTOR' : _MATHCONTEXT, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MathContext) + }) +_sym_db.RegisterMessage(MathContext) + +UpdateByRequest = _reflection.GeneratedProtocolMessageType('UpdateByRequest', (_message.Message,), { + + 'UpdateByOptions' : _reflection.GeneratedProtocolMessageType('UpdateByOptions', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPTIONS, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions) + }) + , + + 'UpdateByOperation' : _reflection.GeneratedProtocolMessageType('UpdateByOperation', (_message.Message,), { + + 'UpdateByColumn' : _reflection.GeneratedProtocolMessageType('UpdateByColumn', (_message.Message,), { + + 'UpdateBySpec' : _reflection.GeneratedProtocolMessageType('UpdateBySpec', (_message.Message,), { + + 'UpdateByCumulativeSum' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeSum', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum) + }) + , + + 'UpdateByCumulativeMin' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeMin', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin) + }) + , + + 'UpdateByCumulativeMax' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeMax', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax) + }) + , + + 'UpdateByCumulativeProduct' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeProduct', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct) + }) + , + + 'UpdateByFill' : _reflection.GeneratedProtocolMessageType('UpdateByFill', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill) + }) + , + + 'UpdateByEma' : _reflection.GeneratedProtocolMessageType('UpdateByEma', (_message.Message,), { + + 'UpdateByEmaOptions' : _reflection.GeneratedProtocolMessageType('UpdateByEmaOptions', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions) + }) + , + + 'UpdateByEmaTimescale' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTimescale', (_message.Message,), { + + 'UpdateByEmaTicks' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTicks', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks) + }) + , + + 'UpdateByEmaTime' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTime', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation) + }) + , + 'DESCRIPTOR' : _UPDATEBYREQUEST, + '__module__' : 'pydeephaven.proto.table_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest) + }) +_sym_db.RegisterMessage(UpdateByRequest) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOptions) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks) +_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime) + SelectDistinctRequest = _reflection.GeneratedProtocolMessageType('SelectDistinctRequest', (_message.Message,), { 'DESCRIPTOR' : _SELECTDISTINCTREQUEST, '__module__' : 'pydeephaven.proto.table_pb2' @@ -461,6 +610,10 @@ _TIMETABLEREQUEST.fields_by_name['start_time_nanos']._serialized_options = b'0\001' _TIMETABLEREQUEST.fields_by_name['period_nanos']._options = None _TIMETABLEREQUEST.fields_by_name['period_nanos']._serialized_options = b'0\001' + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS.fields_by_name['ticks']._options = None + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS.fields_by_name['ticks']._serialized_options = b'0\001' + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME.fields_by_name['period_nanos']._options = None + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME.fields_by_name['period_nanos']._serialized_options = b'0\001' _HEADORTAILREQUEST.fields_by_name['num_rows']._options = None _HEADORTAILREQUEST.fields_by_name['num_rows']._serialized_options = b'0\001' _HEADORTAILBYREQUEST.fields_by_name['num_rows']._options = None @@ -473,10 +626,12 @@ _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['min_date_nanos']._serialized_options = b'0\001' _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']._options = None _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE.fields_by_name['max_date_nanos']._serialized_options = b'0\001' - _CASESENSITIVITY._serialized_start=12579 - _CASESENSITIVITY._serialized_end=12629 - _MATCHTYPE._serialized_start=12631 - _MATCHTYPE._serialized_end=12669 + _BADDATABEHAVIOR._serialized_start=16322 + _BADDATABEHAVIOR._serialized_end=16383 + _CASESENSITIVITY._serialized_start=16385 + _CASESENSITIVITY._serialized_end=16435 + _MATCHTYPE._serialized_start=16437 + _MATCHTYPE._serialized_end=16475 _TABLEREFERENCE._serialized_start=96 _TABLEREFERENCE._serialized_end=204 _EXPORTEDTABLECREATIONRESPONSE._serialized_start=207 @@ -497,96 +652,130 @@ _TIMETABLEREQUEST._serialized_end=1296 _SELECTORUPDATEREQUEST._serialized_start=1299 _SELECTORUPDATEREQUEST._serialized_end=1476 - _SELECTDISTINCTREQUEST._serialized_start=1479 - _SELECTDISTINCTREQUEST._serialized_end=1656 - _DROPCOLUMNSREQUEST._serialized_start=1659 - _DROPCOLUMNSREQUEST._serialized_end=1833 - _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_start=1836 - _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_end=2017 - _HEADORTAILREQUEST._serialized_start=2020 - _HEADORTAILREQUEST._serialized_end=2193 - _HEADORTAILBYREQUEST._serialized_start=2196 - _HEADORTAILBYREQUEST._serialized_end=2402 - _UNGROUPREQUEST._serialized_start=2405 - _UNGROUPREQUEST._serialized_end=2600 - _MERGETABLESREQUEST._serialized_start=2603 - _MERGETABLESREQUEST._serialized_end=2776 - _SNAPSHOTTABLEREQUEST._serialized_start=2779 - _SNAPSHOTTABLEREQUEST._serialized_end=3052 - _CROSSJOINTABLESREQUEST._serialized_start=3055 - _CROSSJOINTABLESREQUEST._serialized_end=3350 - _NATURALJOINTABLESREQUEST._serialized_start=3353 - _NATURALJOINTABLESREQUEST._serialized_end=3628 - _EXACTJOINTABLESREQUEST._serialized_start=3631 - _EXACTJOINTABLESREQUEST._serialized_end=3904 - _LEFTJOINTABLESREQUEST._serialized_start=3907 - _LEFTJOINTABLESREQUEST._serialized_end=4179 - _ASOFJOINTABLESREQUEST._serialized_start=4182 - _ASOFJOINTABLESREQUEST._serialized_end=4639 - _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_start=4550 - _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_end=4639 - _COMBOAGGREGATEREQUEST._serialized_start=4642 - _COMBOAGGREGATEREQUEST._serialized_end=5276 - _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_start=4935 - _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_end=5108 - _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_start=5111 - _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_end=5276 - _SORTDESCRIPTOR._serialized_start=5279 - _SORTDESCRIPTOR._serialized_end=5504 - _SORTDESCRIPTOR_SORTDIRECTION._serialized_start=5423 - _SORTDESCRIPTOR_SORTDIRECTION._serialized_end=5504 - _SORTTABLEREQUEST._serialized_start=5507 - _SORTTABLEREQUEST._serialized_end=5723 - _FILTERTABLEREQUEST._serialized_start=5726 - _FILTERTABLEREQUEST._serialized_end=5941 - _REFERENCE._serialized_start=5943 - _REFERENCE._serialized_end=5975 - _LITERAL._serialized_start=5978 - _LITERAL._serialized_end=6123 - _VALUE._serialized_start=6126 - _VALUE._serialized_end=6271 - _CONDITION._serialized_start=6274 - _CONDITION._serialized_end=6974 - _ANDCONDITION._serialized_start=6976 - _ANDCONDITION._serialized_end=7053 - _ORCONDITION._serialized_start=7055 - _ORCONDITION._serialized_end=7131 - _NOTCONDITION._serialized_start=7133 - _NOTCONDITION._serialized_end=7209 - _COMPARECONDITION._serialized_start=7212 - _COMPARECONDITION._serialized_end=7640 - _COMPARECONDITION_COMPAREOPERATION._serialized_start=7510 - _COMPARECONDITION_COMPAREOPERATION._serialized_end=7640 - _INCONDITION._serialized_start=7643 - _INCONDITION._serialized_end=7920 - _INVOKECONDITION._serialized_start=7923 - _INVOKECONDITION._serialized_end=8075 - _ISNULLCONDITION._serialized_start=8077 - _ISNULLCONDITION._serialized_end=8159 - _MATCHESCONDITION._serialized_start=8162 - _MATCHESCONDITION._serialized_end=8404 - _CONTAINSCONDITION._serialized_start=8407 - _CONTAINSCONDITION._serialized_end=8658 - _SEARCHCONDITION._serialized_start=8660 - _SEARCHCONDITION._serialized_end=8775 - _FLATTENREQUEST._serialized_start=8778 - _FLATTENREQUEST._serialized_end=8926 - _RUNCHARTDOWNSAMPLEREQUEST._serialized_start=8929 - _RUNCHARTDOWNSAMPLEREQUEST._serialized_end=9365 - _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_start=9250 - _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_end=9365 - _CREATEINPUTTABLEREQUEST._serialized_start=9368 - _CREATEINPUTTABLEREQUEST._serialized_end=9997 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_start=9643 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_end=9983 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_start=9913 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_end=9933 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_start=9935 - _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_end=9975 - _BATCHTABLEREQUEST._serialized_start=10000 - _BATCHTABLEREQUEST._serialized_end=12577 - _BATCHTABLEREQUEST_OPERATION._serialized_start=10099 - _BATCHTABLEREQUEST_OPERATION._serialized_end=12577 - _TABLESERVICE._serialized_start=12672 - _TABLESERVICE._serialized_end=17486 + _MATHCONTEXT._serialized_start=1479 + _MATHCONTEXT._serialized_end=1713 + _MATHCONTEXT_ROUNDINGMODE._serialized_start=1597 + _MATHCONTEXT_ROUNDINGMODE._serialized_end=1713 + _UPDATEBYREQUEST._serialized_start=1716 + _UPDATEBYREQUEST._serialized_end=5146 + _UPDATEBYREQUEST_UPDATEBYOPTIONS._serialized_start=2069 + _UPDATEBYREQUEST_UPDATEBYOPTIONS._serialized_end=2520 + _UPDATEBYREQUEST_UPDATEBYOPERATION._serialized_start=2523 + _UPDATEBYREQUEST_UPDATEBYOPERATION._serialized_end=5146 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN._serialized_start=2648 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN._serialized_end=5138 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC._serialized_start=2800 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC._serialized_end=5138 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM._serialized_start=3620 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM._serialized_end=3643 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN._serialized_start=3645 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN._serialized_end=3668 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX._serialized_start=3670 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX._serialized_end=3693 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT._serialized_start=3695 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT._serialized_end=3722 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL._serialized_start=3724 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL._serialized_end=3738 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA._serialized_start=3741 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA._serialized_end=5130 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS._serialized_start=4056 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS._serialized_end=4665 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE._serialized_start=4668 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE._serialized_end=5130 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS._serialized_start=5024 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS._serialized_end=5061 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME._serialized_start=5063 + _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME._serialized_end=5122 + _SELECTDISTINCTREQUEST._serialized_start=5149 + _SELECTDISTINCTREQUEST._serialized_end=5326 + _DROPCOLUMNSREQUEST._serialized_start=5329 + _DROPCOLUMNSREQUEST._serialized_end=5503 + _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_start=5506 + _UNSTRUCTUREDFILTERTABLEREQUEST._serialized_end=5687 + _HEADORTAILREQUEST._serialized_start=5690 + _HEADORTAILREQUEST._serialized_end=5863 + _HEADORTAILBYREQUEST._serialized_start=5866 + _HEADORTAILBYREQUEST._serialized_end=6072 + _UNGROUPREQUEST._serialized_start=6075 + _UNGROUPREQUEST._serialized_end=6270 + _MERGETABLESREQUEST._serialized_start=6273 + _MERGETABLESREQUEST._serialized_end=6446 + _SNAPSHOTTABLEREQUEST._serialized_start=6449 + _SNAPSHOTTABLEREQUEST._serialized_end=6722 + _CROSSJOINTABLESREQUEST._serialized_start=6725 + _CROSSJOINTABLESREQUEST._serialized_end=7020 + _NATURALJOINTABLESREQUEST._serialized_start=7023 + _NATURALJOINTABLESREQUEST._serialized_end=7298 + _EXACTJOINTABLESREQUEST._serialized_start=7301 + _EXACTJOINTABLESREQUEST._serialized_end=7574 + _LEFTJOINTABLESREQUEST._serialized_start=7577 + _LEFTJOINTABLESREQUEST._serialized_end=7849 + _ASOFJOINTABLESREQUEST._serialized_start=7852 + _ASOFJOINTABLESREQUEST._serialized_end=8309 + _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_start=8220 + _ASOFJOINTABLESREQUEST_MATCHRULE._serialized_end=8309 + _COMBOAGGREGATEREQUEST._serialized_start=8312 + _COMBOAGGREGATEREQUEST._serialized_end=8946 + _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_start=8605 + _COMBOAGGREGATEREQUEST_AGGREGATE._serialized_end=8778 + _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_start=8781 + _COMBOAGGREGATEREQUEST_AGGTYPE._serialized_end=8946 + _SORTDESCRIPTOR._serialized_start=8949 + _SORTDESCRIPTOR._serialized_end=9174 + _SORTDESCRIPTOR_SORTDIRECTION._serialized_start=9093 + _SORTDESCRIPTOR_SORTDIRECTION._serialized_end=9174 + _SORTTABLEREQUEST._serialized_start=9177 + _SORTTABLEREQUEST._serialized_end=9393 + _FILTERTABLEREQUEST._serialized_start=9396 + _FILTERTABLEREQUEST._serialized_end=9611 + _REFERENCE._serialized_start=9613 + _REFERENCE._serialized_end=9645 + _LITERAL._serialized_start=9648 + _LITERAL._serialized_end=9793 + _VALUE._serialized_start=9796 + _VALUE._serialized_end=9941 + _CONDITION._serialized_start=9944 + _CONDITION._serialized_end=10644 + _ANDCONDITION._serialized_start=10646 + _ANDCONDITION._serialized_end=10723 + _ORCONDITION._serialized_start=10725 + _ORCONDITION._serialized_end=10801 + _NOTCONDITION._serialized_start=10803 + _NOTCONDITION._serialized_end=10879 + _COMPARECONDITION._serialized_start=10882 + _COMPARECONDITION._serialized_end=11310 + _COMPARECONDITION_COMPAREOPERATION._serialized_start=11180 + _COMPARECONDITION_COMPAREOPERATION._serialized_end=11310 + _INCONDITION._serialized_start=11313 + _INCONDITION._serialized_end=11590 + _INVOKECONDITION._serialized_start=11593 + _INVOKECONDITION._serialized_end=11745 + _ISNULLCONDITION._serialized_start=11747 + _ISNULLCONDITION._serialized_end=11829 + _MATCHESCONDITION._serialized_start=11832 + _MATCHESCONDITION._serialized_end=12074 + _CONTAINSCONDITION._serialized_start=12077 + _CONTAINSCONDITION._serialized_end=12328 + _SEARCHCONDITION._serialized_start=12330 + _SEARCHCONDITION._serialized_end=12445 + _FLATTENREQUEST._serialized_start=12448 + _FLATTENREQUEST._serialized_end=12596 + _RUNCHARTDOWNSAMPLEREQUEST._serialized_start=12599 + _RUNCHARTDOWNSAMPLEREQUEST._serialized_end=13035 + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_start=12920 + _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE._serialized_end=13035 + _CREATEINPUTTABLEREQUEST._serialized_start=13038 + _CREATEINPUTTABLEREQUEST._serialized_end=13667 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_start=13313 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND._serialized_end=13653 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_start=13583 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY._serialized_end=13603 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_start=13605 + _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED._serialized_end=13645 + _BATCHTABLEREQUEST._serialized_start=13670 + _BATCHTABLEREQUEST._serialized_end=16320 + _BATCHTABLEREQUEST_OPERATION._serialized_start=13769 + _BATCHTABLEREQUEST_OPERATION._serialized_end=16320 + _TABLESERVICE._serialized_start=16478 + _TABLESERVICE._serialized_end=21425 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/table_pb2_grpc.py b/py/client/pydeephaven/proto/table_pb2_grpc.py index 869bcc95947..a2ea73c2b8c 100644 --- a/py/client/pydeephaven/proto/table_pb2_grpc.py +++ b/py/client/pydeephaven/proto/table_pb2_grpc.py @@ -75,6 +75,11 @@ def __init__(self, channel): request_serializer=deephaven_dot_proto_dot_table__pb2.SelectOrUpdateRequest.SerializeToString, response_deserializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, ) + self.UpdateBy = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.TableService/UpdateBy', + request_serializer=deephaven_dot_proto_dot_table__pb2.UpdateByRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + ) self.SelectDistinct = channel.unary_unary( '/io.deephaven.proto.backplane.grpc.TableService/SelectDistinct', request_serializer=deephaven_dot_proto_dot_table__pb2.SelectDistinctRequest.SerializeToString, @@ -286,6 +291,14 @@ def Select(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def UpdateBy(self, request, context): + """ + Returns the result of an updateBy table operation. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def SelectDistinct(self, request, context): """ Returns a new table definition with the unique tuples of the specified columns @@ -538,6 +551,11 @@ def add_TableServiceServicer_to_server(servicer, server): request_deserializer=deephaven_dot_proto_dot_table__pb2.SelectOrUpdateRequest.FromString, response_serializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.SerializeToString, ), + 'UpdateBy': grpc.unary_unary_rpc_method_handler( + servicer.UpdateBy, + request_deserializer=deephaven_dot_proto_dot_table__pb2.UpdateByRequest.FromString, + response_serializer=deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.SerializeToString, + ), 'SelectDistinct': grpc.unary_unary_rpc_method_handler( servicer.SelectDistinct, request_deserializer=deephaven_dot_proto_dot_table__pb2.SelectDistinctRequest.FromString, @@ -862,6 +880,23 @@ def Select(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def UpdateBy(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.TableService/UpdateBy', + deephaven_dot_proto_dot_table__pb2.UpdateByRequest.SerializeToString, + deephaven_dot_proto_dot_table__pb2.ExportedTableCreationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def SelectDistinct(request, target, diff --git a/server/src/main/java/io/deephaven/server/table/TableModule.java b/server/src/main/java/io/deephaven/server/table/TableModule.java index 5904cf661d2..9a6f7f79df3 100644 --- a/server/src/main/java/io/deephaven/server/table/TableModule.java +++ b/server/src/main/java/io/deephaven/server/table/TableModule.java @@ -29,6 +29,7 @@ import io.deephaven.server.table.ops.TimeTableGrpcImpl; import io.deephaven.server.table.ops.UngroupGrpcImpl; import io.deephaven.server.table.ops.UnstructuredFilterTableGrpcImpl; +import io.deephaven.server.table.ops.UpdateByGrpcImpl; import io.deephaven.server.table.ops.UpdateOrSelectGrpcImpl; import io.grpc.BindableService; @@ -193,4 +194,9 @@ public interface TableModule { @IntoMap @BatchOpCode(BatchTableRequest.Operation.OpCase.CREATE_INPUT_TABLE) GrpcTableOperation bindCreateInputTable(CreateInputTableGrpcImpl op); + + @Binds + @IntoMap + @BatchOpCode(BatchTableRequest.Operation.OpCase.UPDATE_BY) + GrpcTableOperation bindUpdateBy(UpdateByGrpcImpl op); } diff --git a/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java index 72156605ad0..90224e22ffc 100644 --- a/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java @@ -40,6 +40,7 @@ import io.deephaven.proto.backplane.grpc.TimeTableRequest; import io.deephaven.proto.backplane.grpc.UngroupRequest; import io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; import io.deephaven.proto.util.ExportTicketHelper; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; @@ -266,6 +267,11 @@ public void createInputTable(CreateInputTableRequest request, oneShotOperationWrapper(BatchTableRequest.Operation.OpCase.CREATE_INPUT_TABLE, request, responseObserver); } + @Override + public void updateBy(UpdateByRequest request, StreamObserver responseObserver) { + oneShotOperationWrapper(BatchTableRequest.Operation.OpCase.UPDATE_BY, request, responseObserver); + } + @Override public void batch(final BatchTableRequest request, final StreamObserver responseObserver) { diff --git a/server/src/main/java/io/deephaven/server/table/ops/UpdateByGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/ops/UpdateByGrpcImpl.java new file mode 100644 index 00000000000..f1aaef50b85 --- /dev/null +++ b/server/src/main/java/io/deephaven/server/table/ops/UpdateByGrpcImpl.java @@ -0,0 +1,255 @@ +package io.deephaven.server.table.ops; + +import com.google.rpc.Code; +import io.deephaven.api.ColumnName; +import io.deephaven.api.agg.Pair; +import io.deephaven.api.updateby.BadDataBehavior; +import io.deephaven.api.updateby.ColumnUpdateOperation; +import io.deephaven.api.updateby.OperationControl; +import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.api.updateby.UpdateByOperation; +import io.deephaven.api.updateby.spec.CumMinMaxSpec; +import io.deephaven.api.updateby.spec.CumProdSpec; +import io.deephaven.api.updateby.spec.CumSumSpec; +import io.deephaven.api.updateby.spec.EmaSpec; +import io.deephaven.api.updateby.spec.FillBySpec; +import io.deephaven.api.updateby.spec.TimeScale; +import io.deephaven.api.updateby.spec.UpdateBySpec; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.extensions.barrage.util.GrpcUtil; +import io.deephaven.proto.backplane.grpc.BatchTableRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill; +import io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions; +import io.deephaven.qst.TableCreator; +import io.deephaven.qst.table.UpdateByTable; +import io.deephaven.qst.table.UpdateByTable.Builder; +import io.deephaven.server.session.SessionState; +import io.grpc.StatusRuntimeException; + +import javax.inject.Inject; +import javax.inject.Singleton; +import java.math.MathContext; +import java.math.RoundingMode; +import java.util.List; +import java.util.stream.Collectors; + +@Singleton +public final class UpdateByGrpcImpl extends GrpcTableOperation { + + @Inject + public UpdateByGrpcImpl() { + super(BatchTableRequest.Operation::getUpdateBy, UpdateByRequest::getResultId, UpdateByRequest::getSourceId); + } + + public void validateRequest(final UpdateByRequest request) throws StatusRuntimeException { + try { + if (request.getOperationsCount() == 0) { + // Copied condition from io.deephaven.qst.table.UpdateByTable.checkNumOperations + throw new IllegalArgumentException("Operations must not be empty"); + } + if (request.hasOptions()) { + adaptOptions(request.getOptions()); + } + for (UpdateByRequest.UpdateByOperation updateByOperation : request.getOperationsList()) { + adaptOperation(updateByOperation); + } + for (String columnName : request.getGroupByColumnsList()) { + ColumnName.of(columnName); + } + } catch (IllegalArgumentException e) { + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, e.getMessage()); + } + + } + + @Override + public Table create(UpdateByRequest request, List> sourceTables) { + final Table parent = sourceTables.get(0).get(); + final UpdateByControl control = request.hasOptions() ? adaptOptions(request.getOptions()) : null; + final List operations = + request.getOperationsList().stream().map(UpdateByGrpcImpl::adaptOperation).collect(Collectors.toList()); + final List groupByColumns = + request.getGroupByColumnsList().stream().map(ColumnName::of).collect(Collectors.toList()); + return control == null ? parent.updateBy(operations, groupByColumns) + : parent.updateBy(control, operations, groupByColumns); + } + + private static UpdateByControl adaptOptions(UpdateByOptions options) { + UpdateByControl.Builder builder = UpdateByControl.builder(); + if (options.hasUseRedirection()) { + builder.useRedirection(options.getUseRedirection()); + } + if (options.hasChunkCapacity()) { + builder.chunkCapacity(options.getChunkCapacity()); + } + if (options.hasMaxStaticSparseMemoryOverhead()) { + builder.maxStaticSparseMemoryOverhead(options.getMaxStaticSparseMemoryOverhead()); + } + if (options.hasInitialHashTableSize()) { + builder.initialHashTableSize(options.getInitialHashTableSize()); + } + if (options.hasMaximumLoadFactor()) { + builder.maximumLoadFactor(options.getMaximumLoadFactor()); + } + if (options.hasTargetLoadFactor()) { + builder.targetLoadFactor(options.getTargetLoadFactor()); + } + if (options.hasMathContext()) { + builder.mathContext(adaptMathContext(options.getMathContext())); + } + return builder.build(); + } + + private static UpdateByOperation adaptOperation(UpdateByRequest.UpdateByOperation operation) { + switch (operation.getTypeCase()) { + case COLUMN: + return adaptColumn(operation.getColumn()); + case TYPE_NOT_SET: + default: + throw new IllegalArgumentException("Unexpected operation type case: " + operation.getTypeCase()); + } + } + + private static ColumnUpdateOperation adaptColumn(UpdateByColumn column) { + ColumnUpdateOperation.Builder builder = ColumnUpdateOperation.builder() + .spec(adaptSpec(column.getSpec())); + for (String matchPair : column.getMatchPairsList()) { + builder.addColumns(Pair.parse(matchPair)); + } + return builder.build(); + } + + private static UpdateBySpec adaptSpec(UpdateByColumn.UpdateBySpec spec) { + switch (spec.getTypeCase()) { + case SUM: + return adaptSum(spec.getSum()); + case MIN: + return adaptMin(spec.getMin()); + case MAX: + return adaptMax(spec.getMax()); + case PRODUCT: + return adaptProduct(spec.getProduct()); + case FILL: + return adaptFill(spec.getFill()); + case EMA: + return adaptEma(spec.getEma()); + case TYPE_NOT_SET: + default: + throw new IllegalArgumentException("Unexpected spec type: " + spec.getTypeCase()); + } + } + + private static CumSumSpec adaptSum(@SuppressWarnings("unused") UpdateByCumulativeSum sum) { + return CumSumSpec.of(); + } + + private static CumMinMaxSpec adaptMin(@SuppressWarnings("unused") UpdateByCumulativeMin min) { + return CumMinMaxSpec.of(false); + } + + private static CumMinMaxSpec adaptMax(@SuppressWarnings("unused") UpdateByCumulativeMax max) { + return CumMinMaxSpec.of(true); + } + + private static CumProdSpec adaptProduct(@SuppressWarnings("unused") UpdateByCumulativeProduct product) { + return CumProdSpec.of(); + } + + private static FillBySpec adaptFill(@SuppressWarnings("unused") UpdateByFill fill) { + return FillBySpec.of(); + } + + private static EmaSpec adaptEma(UpdateByEma ema) { + return ema.hasOptions() ? EmaSpec.of(adaptEmaOptions(ema.getOptions()), adaptTimescale(ema.getTimescale())) + : EmaSpec.of(adaptTimescale(ema.getTimescale())); + } + + private static OperationControl adaptEmaOptions(UpdateByEmaOptions options) { + final OperationControl.Builder builder = OperationControl.builder(); + if (options.hasOnNullValue()) { + builder.onNullValue(adaptBadDataBehavior(options.getOnNullValue())); + } + if (options.hasOnNanValue()) { + builder.onNanValue(adaptBadDataBehavior(options.getOnNanValue())); + } + if (options.hasOnNullTime()) { + builder.onNullTime(adaptBadDataBehavior(options.getOnNullTime())); + } + if (options.hasOnNegativeDeltaTime()) { + builder.onNegativeDeltaTime(adaptBadDataBehavior(options.getOnNegativeDeltaTime())); + } + if (options.hasOnZeroDeltaTime()) { + builder.onZeroDeltaTime(adaptBadDataBehavior(options.getOnZeroDeltaTime())); + } + if (options.hasBigValueContext()) { + builder.bigValueContext(adaptMathContext(options.getBigValueContext())); + } + return builder.build(); + } + + private static MathContext adaptMathContext(io.deephaven.proto.backplane.grpc.MathContext bigValueContext) { + return new MathContext(bigValueContext.getPrecision(), adaptRoundingMode(bigValueContext.getRoundingMode())); + } + + private static RoundingMode adaptRoundingMode( + io.deephaven.proto.backplane.grpc.MathContext.RoundingMode roundingMode) { + switch (roundingMode) { + case UP: + return RoundingMode.UP; + case DOWN: + return RoundingMode.DOWN; + case CEILING: + return RoundingMode.CEILING; + case FLOOR: + return RoundingMode.FLOOR; + case HALF_UP: + return RoundingMode.HALF_UP; + case HALF_DOWN: + return RoundingMode.HALF_DOWN; + case HALF_EVEN: + return RoundingMode.HALF_EVEN; + case UNNECESSARY: + return RoundingMode.UNNECESSARY; + case UNRECOGNIZED: + default: + throw new IllegalArgumentException("Unexpected rounding mode: " + roundingMode); + } + } + + private static TimeScale adaptTimescale(UpdateByEma.UpdateByEmaTimescale timescale) { + switch (timescale.getTypeCase()) { + case TICKS: + return TimeScale.ofTicks(timescale.getTicks().getTicks()); + case TIME: + return TimeScale.ofTime(timescale.getTime().getColumn(), timescale.getTime().getPeriodNanos()); + case TYPE_NOT_SET: + default: + throw new IllegalArgumentException("Unexpected timescale type: " + timescale.getTypeCase()); + } + } + + private static BadDataBehavior adaptBadDataBehavior(io.deephaven.proto.backplane.grpc.BadDataBehavior b) { + switch (b) { + case RESET: + return BadDataBehavior.RESET; + case SKIP: + return BadDataBehavior.SKIP; + case THROW: + return BadDataBehavior.THROW; + case POISON: + return BadDataBehavior.POISON; + case UNRECOGNIZED: + default: + throw new IllegalArgumentException("Unexpected BadDataBehavior: " + b); + } + } +} diff --git a/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java b/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java index ac76bd218f9..631b97d8dc7 100644 --- a/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java +++ b/table-api/src/main/java/io/deephaven/api/updateby/BadDataBehavior.java @@ -4,15 +4,15 @@ * Directives for how to handle {@code null} and {@code NaN} values while processing EMAs */ public enum BadDataBehavior { + /** Throw an exception and abort processing when bad data is encountered */ + THROW, + /** Reset the state for the bucket to {@code null} when invalid data is encountered */ RESET, /** Skip and do not process the invalid data without changing state */ SKIP, - /** Throw an exception and abort processing when bad data is encountered */ - THROW, - /** Allow the bad data to poison the result. This is only valid for use with NaN */ POISON } From 124df76840da3eec950bebe77874f8af1ab3ec57 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 29 Aug 2022 09:36:24 -0500 Subject: [PATCH 083/215] Fail incoming grpc connections that don't use http2 (#2725) This is overzealous in general, as grpc-web can technically operate on http/*, but we aren't interested in supporting that use case, since streaming data is important to us. Fixes #2724 --- .../io/deephaven/server/jetty/GrpcFilter.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/GrpcFilter.java b/server/jetty/src/main/java/io/deephaven/server/jetty/GrpcFilter.java index 26fcfdbb5ff..d7547d5b4b9 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/GrpcFilter.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/GrpcFilter.java @@ -3,19 +3,31 @@ */ package io.deephaven.server.jetty; +import io.deephaven.configuration.Configuration; import io.grpc.servlet.jakarta.ServletAdapter; -import jakarta.servlet.Filter; import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpFilter; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import javax.inject.Inject; import java.io.IOException; -public class GrpcFilter implements Filter { +import static io.grpc.internal.GrpcUtil.CONTENT_TYPE_GRPC; + +/** + * Deephaven-core's own handler for registering handlers for various grpc endpoints. + */ +public class GrpcFilter extends HttpFilter { + /** + * Disabling this configuration option allows a server to permit http/1.1 connections. While technically forbidden + * for grpc calls, it could be helpful for extremely lightweight http clients (IoT use cases), or for grpc-web where + * http/1.1 is technically supported. + */ + public static final boolean REQUIRE_HTTP2 = + Configuration.getInstance().getBooleanWithDefault("http.requireHttp2", true); + private final ServletAdapter grpcAdapter; @Inject @@ -24,10 +36,22 @@ public GrpcFilter(ServletAdapter grpcAdapter) { } @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { - if (request instanceof HttpServletRequest && ServletAdapter.isGrpc((HttpServletRequest) request)) { - grpcAdapter.doPost((HttpServletRequest) request, (HttpServletResponse) response); + if (ServletAdapter.isGrpc(request)) { + // we now know that this request is meant to be grpc, ensure that the underlying http version is not + // 1.1 so that grpc will behave + if (!REQUIRE_HTTP2 || request.getProtocol().equals("HTTP/2.0")) { + grpcAdapter.doPost(request, response); + } else { + // A "clean" implementation of this would use @Internal-annotated types from grpc, which is discouraged. + response.setStatus(HttpServletResponse.SC_OK); + response.setContentType(CONTENT_TYPE_GRPC); + // Status.Code.INTERNAL.valueAscii() is private, using a string literal instead for "13" + response.setHeader("grpc-status", "13"); + response.setHeader("grpc-message", + "The server connection is not using http2, so streams and metadata may not behave as expected. The client may be connecting improperly, or a proxy may be interfering."); + } } else { chain.doFilter(request, response); } From 2a6985931d90f8f8d74f85cdaf2dddbcd5545e9c Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 29 Aug 2022 10:37:26 -0700 Subject: [PATCH 084/215] Fix DeephavenFlightSessionTest.updateBy; account for split streams (#2767) --- .../client/DeephavenFlightSessionTest.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java index f5e191384bd..bf5ffa12ff8 100644 --- a/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java +++ b/java-client/flight-dagger/src/test/java/io/deephaven/client/DeephavenFlightSessionTest.java @@ -66,16 +66,19 @@ public void updateBy() throws Exception { try ( final TableHandle handle = flightSession.session().batch().execute(spec); final FlightStream stream = flightSession.stream(handle)) { - assertThat(stream.next()).isTrue(); - final VectorSchemaRoot root = stream.getRoot(); - assertThat(root.getRowCount()).isEqualTo(size); - final BigIntVector longVector = (BigIntVector) root.getVector("I"); + int i = 0; long sum = 0; - for (int i = 0; i < size; ++i) { - sum += i; - final long actual = longVector.get(i); - assertThat(actual).isEqualTo(sum); + while (stream.next()) { + final VectorSchemaRoot root = stream.getRoot(); + final BigIntVector longVector = (BigIntVector) root.getVector("I"); + final int rowCount = root.getRowCount(); + for (int r = 0; r < rowCount; ++r, ++i) { + sum += i; + final long actual = longVector.get(r); + assertThat(actual).isEqualTo(sum); + } } + assertThat(i).isEqualTo(size); } } From f472a5d94008cb790d7c5b5a23591acfff5aafa6 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Mon, 29 Aug 2022 11:45:08 -0700 Subject: [PATCH 085/215] Server side application support (#2758) --- .../deephaven/appmode/ApplicationConfig.java | 20 ++-- .../deephaven/appmode/ApplicationState.java | 6 ++ .../io/deephaven/server/appmode/AppMode.java | 34 ------- .../server/appmode/ApplicationInjector.java | 47 ++++++---- .../appmode/ApplicationServiceGrpcImpl.java | 13 +-- .../server/runner/DeephavenApiServer.java | 2 +- .../runner/DeephavenApiServerModule.java | 7 -- .../appmode/ApplicationExampleTest.java | 94 +++++++++++++++++++ .../ApplicationServiceGrpcImplTest.java | 2 +- 9 files changed, 141 insertions(+), 84 deletions(-) delete mode 100644 server/src/main/java/io/deephaven/server/appmode/AppMode.java create mode 100644 server/src/test/java/io/deephaven/server/appmode/ApplicationExampleTest.java diff --git a/application-mode/src/main/java/io/deephaven/appmode/ApplicationConfig.java b/application-mode/src/main/java/io/deephaven/appmode/ApplicationConfig.java index ff324689552..8b536957715 100644 --- a/application-mode/src/main/java/io/deephaven/appmode/ApplicationConfig.java +++ b/application-mode/src/main/java/io/deephaven/appmode/ApplicationConfig.java @@ -13,26 +13,20 @@ public interface ApplicationConfig { - /** - * True if application mode is enabled; set system property {@link ApplicationConfigImpl#APPLICATION_DIR_PROP} to - * enable. - * - * @return true if application mode is enabled - */ - static boolean isApplicationModeEnabled() { + static boolean isCustomApplicationModeEnabled() { return ApplicationConfigImpl.APPLICATION_DIR != null; } /** - * The application directory. Application mode must be enabled. + * The custom application directory. Custom application mode must be enabled. * * @return the application dir - * @see #isApplicationModeEnabled() + * @see #isCustomApplicationModeEnabled() */ - static Path applicationDir() { - if (!isApplicationModeEnabled()) { + static Path customApplicationDir() { + if (!isCustomApplicationModeEnabled()) { throw new IllegalStateException( - String.format("Application mode is not enabled, please set system property '%s'", + String.format("Custom application mode is not enabled, please set system property '%s'", ApplicationConfigImpl.APPLICATION_DIR_PROP)); } final Path applicationDir; @@ -57,7 +51,7 @@ static Path applicationDir() { * @throws ClassNotFoundException on class not found */ static List find() throws IOException, ClassNotFoundException { - return ApplicationConfigImpl.find(applicationDir()); + return ApplicationConfigImpl.find(customApplicationDir()); } /** diff --git a/application-mode/src/main/java/io/deephaven/appmode/ApplicationState.java b/application-mode/src/main/java/io/deephaven/appmode/ApplicationState.java index dbfb482c2cd..caeb9804bef 100644 --- a/application-mode/src/main/java/io/deephaven/appmode/ApplicationState.java +++ b/application-mode/src/main/java/io/deephaven/appmode/ApplicationState.java @@ -9,10 +9,16 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.ServiceLoader; public class ApplicationState { public interface Factory { + + static Iterable loadFromServiceFactory() { + return ServiceLoader.load(Factory.class); + } + ApplicationState create(Listener appStateListener); } diff --git a/server/src/main/java/io/deephaven/server/appmode/AppMode.java b/server/src/main/java/io/deephaven/server/appmode/AppMode.java deleted file mode 100644 index df6f76e5f97..00000000000 --- a/server/src/main/java/io/deephaven/server/appmode/AppMode.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.appmode; - -import io.deephaven.appmode.ApplicationConfig; -import io.deephaven.server.console.ConsoleServiceGrpcImpl; - -public enum AppMode { - APP_ONLY, HYBRID, CONSOLE_ONLY, API_ONLY; - - public static AppMode currentMode() { - boolean appEnabled = ApplicationConfig.isApplicationModeEnabled(); - boolean consoleEnabled = !ConsoleServiceGrpcImpl.REMOTE_CONSOLE_DISABLED; - if (appEnabled && consoleEnabled) { - return HYBRID; - } - if (appEnabled) { - return APP_ONLY; - } - if (consoleEnabled) { - return CONSOLE_ONLY; - } - return API_ONLY; - } - - public boolean hasVisibilityToAppExports() { - return this == HYBRID || this == APP_ONLY; - } - - public boolean hasVisibilityToConsoleExports() { - return this == HYBRID || this == CONSOLE_ONLY; - } -} diff --git a/server/src/main/java/io/deephaven/server/appmode/ApplicationInjector.java b/server/src/main/java/io/deephaven/server/appmode/ApplicationInjector.java index 62d84ab58cd..28c750c2ef7 100644 --- a/server/src/main/java/io/deephaven/server/appmode/ApplicationInjector.java +++ b/server/src/main/java/io/deephaven/server/appmode/ApplicationInjector.java @@ -24,29 +24,31 @@ public class ApplicationInjector { private static final Logger log = LoggerFactory.getLogger(ApplicationInjector.class); - private final AppMode appMode; private final Provider scriptSessionProvider; private final ApplicationTicketResolver ticketResolver; private final ApplicationState.Listener applicationListener; @Inject - public ApplicationInjector(final AppMode appMode, + public ApplicationInjector( final Provider scriptSessionProvider, final ApplicationTicketResolver ticketResolver, final ApplicationState.Listener applicationListener) { - this.appMode = appMode; this.scriptSessionProvider = Objects.requireNonNull(scriptSessionProvider); this.ticketResolver = ticketResolver; this.applicationListener = applicationListener; } public void run() throws IOException, ClassNotFoundException { - if (!ApplicationConfig.isApplicationModeEnabled()) { + for (ApplicationState.Factory factory : ApplicationState.Factory.loadFromServiceFactory()) { + loadApplicationFactory(factory); + } + + if (!ApplicationConfig.isCustomApplicationModeEnabled()) { return; } - final Path applicationDir = ApplicationConfig.applicationDir(); - log.info().append("Finding application(s) in '").append(applicationDir.toString()).append("'...").endl(); + final Path applicationDir = ApplicationConfig.customApplicationDir(); + log.info().append("Finding custom application(s) in '").append(applicationDir.toString()).append("'...").endl(); List configs; try { @@ -54,21 +56,18 @@ public void run() throws IOException, ClassNotFoundException { } catch (final NoSuchFileException ignored) { configs = Collections.emptyList(); } catch (final RuntimeException error) { - log.error().append("Failed to read application config(s): ").append(error).endl(); + log.error().append("Failed to read custom application config(s): ").append(error).endl(); throw error; } if (configs.isEmpty()) { - log.warn().append("No application(s) found...").endl(); - if (appMode != AppMode.HYBRID) { - log.warn().append("No console sessions allowed...").endl(); - } + log.warn().append("No custom application(s) found...").endl(); return; } for (ApplicationConfig config : configs) { if (!config.isEnabled()) { - log.info().append("Skipping disabled application: ").append(config.toString()).endl(); + log.info().append("Skipping disabled custom application: ").append(config.toString()).endl(); continue; } loadApplication(applicationDir, config); @@ -79,14 +78,26 @@ private void loadApplication(final Path applicationDir, final ApplicationConfig // Note: if we need to be more specific about which application we are starting, we can print out the path of // the application. log.info().append("Starting application '").append(config.toString()).append('\'').endl(); - try (final SafeCloseable ignored = LivenessScopeStack.open()) { - final ApplicationState app = ApplicationFactory.create(applicationDir, config, - scriptSessionProvider.get(), applicationListener); - int numExports = app.listFields().size(); - log.info().append("\tfound ").append(numExports).append(" exports").endl(); + final ApplicationState app; + try (final SafeCloseable ignored = LivenessScopeStack.open(); + final SafeCloseable ignored2 = scriptSessionProvider.get().getExecutionContext().open()) { + app = ApplicationFactory.create(applicationDir, config, scriptSessionProvider.get(), applicationListener); + } + int numExports = app.listFields().size(); + log.info().append("\tfound ").append(numExports).append(" exports").endl(); + ticketResolver.onApplicationLoad(app); + } - ticketResolver.onApplicationLoad(app); + private void loadApplicationFactory(ApplicationState.Factory factory) { + log.info().append("Starting ApplicationState.Factory '").append(factory.toString()).append('\'').endl(); + final ApplicationState app; + try (final SafeCloseable ignored1 = LivenessScopeStack.open(); + final SafeCloseable ignored2 = scriptSessionProvider.get().getExecutionContext().open()) { + app = factory.create(applicationListener); } + int numExports = app.listFields().size(); + log.info().append("\tfound ").append(numExports).append(" exports").endl(); + ticketResolver.onApplicationLoad(app); } } diff --git a/server/src/main/java/io/deephaven/server/appmode/ApplicationServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/appmode/ApplicationServiceGrpcImpl.java index 23b2cc0cebd..21f70def4dc 100644 --- a/server/src/main/java/io/deephaven/server/appmode/ApplicationServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/appmode/ApplicationServiceGrpcImpl.java @@ -15,6 +15,7 @@ import io.deephaven.proto.backplane.grpc.FieldsChangeUpdate; import io.deephaven.proto.backplane.grpc.ListFieldsRequest; import io.deephaven.proto.backplane.grpc.TypedTicket; +import io.deephaven.server.console.ConsoleServiceGrpcImpl; import io.deephaven.server.object.TypeLookup; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; @@ -42,7 +43,6 @@ public class ApplicationServiceGrpcImpl extends ApplicationServiceGrpc.Applicati private static final String QUERY_SCOPE_DESCRIPTION = "query scope variable"; - private final AppMode mode; private final Scheduler scheduler; private final SessionService sessionService; private final TypeLookup typeLookup; @@ -60,11 +60,10 @@ public class ApplicationServiceGrpcImpl extends ApplicationServiceGrpc.Applicati private final Map accumulated = new LinkedHashMap<>(); @Inject - public ApplicationServiceGrpcImpl(final AppMode mode, + public ApplicationServiceGrpcImpl( final Scheduler scheduler, final SessionService sessionService, final TypeLookup typeLookup) { - this.mode = mode; this.scheduler = scheduler; this.sessionService = sessionService; this.typeLookup = typeLookup; @@ -72,7 +71,7 @@ public ApplicationServiceGrpcImpl(final AppMode mode, @Override public synchronized void onScopeChanges(final ScriptSession scriptSession, final ScriptSession.Changes changes) { - if (!mode.hasVisibilityToConsoleExports() || changes.isEmpty()) { + if (ConsoleServiceGrpcImpl.REMOTE_CONSOLE_DISABLED || changes.isEmpty()) { return; } for (Entry e : changes.removed.entrySet()) { @@ -89,18 +88,12 @@ public synchronized void onScopeChanges(final ScriptSession scriptSession, final @Override public synchronized void onRemoveField(ApplicationState app, Field oldField) { - if (!mode.hasVisibilityToAppExports()) { - return; - } remove(AppFieldId.from(app, oldField.name())); schedulePropagationOrClearIncrementalState(); } @Override public synchronized void onNewField(final ApplicationState app, final Field field) { - if (!mode.hasVisibilityToAppExports()) { - return; - } final AppFieldId id = AppFieldId.from(app, field.name()); final String type = typeLookup.type(field.value()).orElse(null); create(id, field.description().orElse(null), type); diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index cb84fdbf4e1..58f245485c7 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -149,7 +149,7 @@ public void join() throws InterruptedException { void startForUnitTests() throws Exception { pluginRegistration.registerAll(); - + applicationInjector.run(); log.info().append("Starting server...").endl(); server.start(); } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java index f75d8b2f1f4..a9f99cd28f5 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java @@ -13,7 +13,6 @@ import io.deephaven.server.object.ObjectServiceModule; import io.deephaven.server.partitionedtable.PartitionedTableServiceModule; import io.deephaven.server.plugin.PluginsModule; -import io.deephaven.server.appmode.AppMode; import io.deephaven.server.appmode.AppModeModule; import io.deephaven.server.arrow.ArrowModule; import io.deephaven.server.auth.AuthContextModule; @@ -78,12 +77,6 @@ static Set primeInterceptors() { return Collections.emptySet(); } - @Provides - @Singleton - public static AppMode provideAppMode() { - return AppMode.currentMode(); - } - @Provides @Singleton public ScriptSession provideScriptSession(Map> scriptTypes) { diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationExampleTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationExampleTest.java new file mode 100644 index 00000000000..d312a5191fb --- /dev/null +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationExampleTest.java @@ -0,0 +1,94 @@ +package io.deephaven.server.appmode; + +import com.google.auto.service.AutoService; +import com.google.protobuf.ByteString; +import io.deephaven.appmode.ApplicationState; +import io.deephaven.appmode.ApplicationState.Listener; +import io.deephaven.engine.util.TableTools; +import io.deephaven.proto.backplane.grpc.FieldInfo; +import io.deephaven.proto.backplane.grpc.FieldsChangeUpdate; +import io.deephaven.proto.backplane.grpc.ListFieldsRequest; +import io.deephaven.proto.backplane.grpc.Ticket; +import io.deephaven.proto.backplane.grpc.TypedTicket; +import io.deephaven.server.runner.DeephavenApiServerSingleAuthenticatedBase; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.ClientCallStreamObserver; +import io.grpc.stub.ClientResponseObserver; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ApplicationExampleTest extends DeephavenApiServerSingleAuthenticatedBase { + + @AutoService(ApplicationState.Factory.class) + public static class ExampleApplication implements ApplicationState.Factory { + + @Override + public ApplicationState create(Listener listener) { + final ApplicationState state = + new ApplicationState(listener, ExampleApplication.class.getName(), "Example Application"); + state.setField("example_field", TableTools.emptyTable(42)); + return state; + } + } + + @Test + public void exampleField() throws InterruptedException, TimeoutException { + final ListFieldsRequest request = ListFieldsRequest.newBuilder().build(); + final SingleValueListener listener = new SingleValueListener(); + channel().application().listFields(request, listener); + if (!listener.latch.await(5, TimeUnit.SECONDS)) { + throw new TimeoutException("Request didn't complete in 5 seconds"); + } + assertThat(listener.error).isExactlyInstanceOf(StatusRuntimeException.class); + assertThat(((StatusRuntimeException) listener.error).getStatus().getCode()).isEqualTo(Code.CANCELLED); + assertThat(listener.value).isNotNull(); + final Ticket ticket = Ticket.newBuilder() + .setTicket(ByteString.copyFromUtf8( + "a/io.deephaven.server.appmode.ApplicationExampleTest$ExampleApplication/f/example_field")) + .build(); + final FieldInfo fieldInfo = FieldInfo.newBuilder() + .setTypedTicket(TypedTicket.newBuilder().setType("Table").setTicket(ticket).build()) + .setApplicationId(ExampleApplication.class.getName()) + .setApplicationName("Example Application") + .setFieldName("example_field") + .build(); + final FieldsChangeUpdate expected = FieldsChangeUpdate.newBuilder().addCreated(fieldInfo).build(); + assertThat(listener.value).isEqualTo(expected); + } + + private static class SingleValueListener implements ClientResponseObserver { + ClientCallStreamObserver r; + FieldsChangeUpdate value; + Throwable error; + + CountDownLatch latch = new CountDownLatch(1); + + @Override + public void beforeStart(ClientCallStreamObserver requestStream) { + r = requestStream; + } + + @Override + public void onNext(FieldsChangeUpdate value) { + this.value = value; + r.cancel("Done", null); + } + + @Override + public void onError(Throwable t) { + this.error = t; + latch.countDown(); + } + + @Override + public void onCompleted() { + latch.countDown(); + } + } +} diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java index 2897c832150..9e5f0722cc1 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java @@ -42,7 +42,7 @@ public void setup() { sessionService = new SessionService(scheduler, authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), TOKEN_EXPIRE_MS); - applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(AppMode.HYBRID, scheduler, sessionService, + applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(scheduler, sessionService, new TypeLookup(ObjectTypeLookup.NoOp.INSTANCE)); } From f7a785bd41316f89649dd445664722775d21ffdc Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:55:17 -0600 Subject: [PATCH 086/215] Correctly check for main module when blding scope (#2770) --- py/server/deephaven/table.py | 5 +++-- py/server/tests/test_table.py | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 90500110290..d9e053deec1 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -67,8 +67,9 @@ def _query_scope_ctx(): break # combine the immediate caller's globals and locals into a single dict and use it as the query scope - if len(outer_frames) > i + 2: - caller_frame, *_ = outer_frames[i + 1] + caller_frame = outer_frames[i + 1].frame + function = outer_frames[i + 1].function + if len(outer_frames) > i + 2 or function != "": scope_dict = caller_frame.f_globals.copy() scope_dict.update(caller_frame.f_locals) try: diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 34e1aabe8a7..47264a0927e 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -6,7 +6,7 @@ from types import SimpleNamespace from typing import List, Any -from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule, time_table +from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule, time_table, ugp from deephaven.agg import sum_, weighted_avg, avg, pct, group, count_, first, last, max_, median, min_, std, abs_sum, \ var, formula, partition from deephaven.pandas import to_pandas @@ -629,6 +629,27 @@ def inner_func(p) -> str: t = empty_table(1).update("X = i").update("TableString = inner_func(X + 10)") self.assertIn("100", t.to_string()) + def test_nested_scope_ticking(self): + import jpy + _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + j_context = (_JExecutionContext.newBuilder() + .captureCompilerContext() + .captureQueryLibrary() + .captureQueryScope() + .build()) + + def inner_func(p) -> str: + open_ctx = j_context.open() + t = empty_table(1).update("X = p * 10") + open_ctx.close() + return t.to_string().split()[2] + + with ugp.shared_lock(): + t = time_table("00:00:01").update("X = i").update("TableString = inner_func(X + 10)") + self.wait_ticking_table_update(t, row_count=5, timeout=10) + + self.assertIn("100", t.to_string()) + def test_scope_comprehensions(self): with self.subTest("List comprehension"): t = empty_table(1) From 5538488ad0c3414d3912c3f103279e5717d93d3e Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 30 Aug 2022 09:16:10 -0600 Subject: [PATCH 087/215] BaseArrayBackedMutableTable#run never reset processedSequence to -1 (#2775) --- .../engine/table/impl/util/BaseArrayBackedMutableTable.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java index f95eb21bc5e..ec7d36c1270 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/BaseArrayBackedMutableTable.java @@ -145,6 +145,9 @@ private void processPending(RowSetChangeRecorder rowSetChangeRecorder) { public void run() { super.run(); synchronized (pendingChanges) { + if (pendingProcessed < 0) { + return; + } processedSequence = pendingProcessed; pendingProcessed = -1L; pendingChanges.notifyAll(); From 2d670673496775868da462188c41ecbfbf693e84 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 30 Aug 2022 15:53:37 -0600 Subject: [PATCH 088/215] Fix liveness cyclical dependency in DoPutObserver (#2780) --- .../engine/liveness/LivenessArtifact.java | 10 +++++- .../server/arrow/ArrowFlightUtil.java | 36 +++++++++++++------ .../server/console/ScopeTicketResolver.java | 8 ++++- .../server/session/SessionState.java | 12 +++---- 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/engine/updategraph/src/main/java/io/deephaven/engine/liveness/LivenessArtifact.java b/engine/updategraph/src/main/java/io/deephaven/engine/liveness/LivenessArtifact.java index eb493564108..c8fdf553a1f 100644 --- a/engine/updategraph/src/main/java/io/deephaven/engine/liveness/LivenessArtifact.java +++ b/engine/updategraph/src/main/java/io/deephaven/engine/liveness/LivenessArtifact.java @@ -18,7 +18,15 @@ public class LivenessArtifact extends ReferenceCountedLivenessNode implements Se private static final long serialVersionUID = 1L; protected LivenessArtifact() { - super(false); + this(false); + } + + /** + * @param enforceStrongReachability Whether this {@link LivenessArtifact} should maintain strong references to its + * referents + */ + protected LivenessArtifact(final boolean enforceStrongReachability) { + super(enforceStrongReachability); manageWithCurrentScope(); } diff --git a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java index 2ef650569d5..cabc5aae122 100644 --- a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java +++ b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java @@ -253,8 +253,7 @@ private static void createAndSendSnapshot(BaseTable table, BitSet columns, RowSe /** * This is a stateful observer; a DoPut stream begins with its schema. */ - public static class DoPutObserver extends SingletonLivenessManager - implements StreamObserver, Closeable { + public static class DoPutObserver implements StreamObserver, Closeable { private final ScheduledExecutorService executorService; private final SessionState session; @@ -304,7 +303,6 @@ public void onNext(final InputStream request) { resultExportBuilder = ticketRouter .publish(session, mi.descriptor, "Flight.Descriptor") .onError(observer); - manage(resultExportBuilder.getExport()); } } @@ -402,6 +400,8 @@ private void onCancel() { }); resultExportBuilder = null; } + + session.removeOnCloseCallback(this); } @Override @@ -418,6 +418,8 @@ public void onError(Throwable t) { }); resultExportBuilder = null; } + + session.removeOnCloseCallback(this); } public void onCompleted() { @@ -430,16 +432,31 @@ public void onCompleted() { throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "Result flight schema never provided"); } + final BarrageTable localResultTable = resultTable; + resultTable = null; + final SessionState.ExportBuilder
    localExportBuilder = resultExportBuilder; + resultExportBuilder = null; + + + // gRPC is about to remove its hard reference to this observer. We must keep the result table hard + // referenced until the export is complete, so that the export can properly be satisfied. ExportObject's + // LivenessManager enforces strong reachability. + if (!localExportBuilder.getExport().tryManage(localResultTable)) { + GrpcUtil.safelyError(observer, Code.DATA_LOSS, "Result export already destroyed"); + localResultTable.dropReference(); + session.removeOnCloseCallback(this); + return; + } + localResultTable.dropReference(); + // no more changes allowed; this is officially static content - resultTable.sealTable(() -> resultExportBuilder.submit(() -> { - // transfer ownership to submit's liveness scope, drop our extra reference - resultTable.manageWithCurrentScope(); - resultTable.dropReference(); + localResultTable.sealTable(() -> localExportBuilder.submit(() -> { GrpcUtil.safelyExecuteLocked(observer, observer::onCompleted); - return resultTable; + session.removeOnCloseCallback(this); + return localResultTable; }), () -> { GrpcUtil.safelyError(observer, Code.DATA_LOSS, "Do put could not be sealed"); - resultExportBuilder = null; + session.removeOnCloseCallback(this); }); }); } @@ -447,7 +464,6 @@ public void onCompleted() { @Override public void close() { // close() is intended to be invoked only though session expiration - release(); GrpcUtil.safelyError(observer, Code.UNAUTHENTICATED, "Session expired"); } diff --git a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java index 06b8eecab66..a505711a3db 100644 --- a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java +++ b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java @@ -6,7 +6,9 @@ import com.google.protobuf.ByteStringAccess; import com.google.rpc.Code; import io.deephaven.base.string.EncodingInfo; +import io.deephaven.engine.liveness.LivenessReferent; import io.deephaven.engine.table.Table; +import io.deephaven.engine.updategraph.DynamicNode; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.ScriptSession; import io.deephaven.extensions.barrage.util.GrpcUtil; @@ -138,7 +140,11 @@ private SessionState.ExportBuilder publish( .require(resultExport) .submit(() -> { final ScriptSession gss = scriptSessionProvider.get(); - gss.setVariable(varName, resultExport.get()); + T value = resultExport.get(); + if (value instanceof LivenessReferent && DynamicNode.notDynamicOrIsRefreshing(value)) { + gss.manage((LivenessReferent) value); + } + gss.setVariable(varName, value); }); return resultBuilder; diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index d76c44fb6fb..398c67c4129 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -529,16 +529,15 @@ public final static class ExportObject extends LivenessArtifact { * @param exportId the export id for this export */ private ExportObject(final SessionState session, final int exportId) { + super(true); this.session = session; this.exportId = exportId; this.logIdentity = isNonExport() ? Integer.toHexString(System.identityHashCode(this)) : Long.toString(exportId); setState(ExportNotification.State.UNKNOWN); - // non-exports stay alive until they have been exported - if (isNonExport()) { - retainReference(); - } + // we retain a reference until a non-export becomes EXPORTED or a regular export becomes RELEASED + retainReference(); } /** @@ -548,6 +547,7 @@ private ExportObject(final SessionState session, final int exportId) { * @param result the object to wrap in an export */ private ExportObject(final T result) { + super(true); this.session = null; this.exportId = NON_EXPORT_ID; this.state = ExportNotification.State.EXPORTED; @@ -1341,9 +1341,7 @@ public ExportObject newValue(final int key) { throw GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, "session has expired"); } - final ExportObject retval = new ExportObject<>(SessionState.this, key); - retval.retainReference(); - return retval; + return new ExportObject<>(SessionState.this, key); } }; } From 43ec6eb1f0b05dfae3a98799daa3ddb475610180 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Wed, 31 Aug 2022 09:15:23 -0400 Subject: [PATCH 089/215] Add getObject to IdeConnection instead of just IdeSession (#2773) - Add getObject to IdeConnection instead of just IdeSession - Need some way to get objects when sessions are unavailable - Need to wait for connected before trying to subscribe to field updates or getting object --- .../io/deephaven/ide/shared/IdeSession.java | 70 +------------------ .../web/client/api/QueryConnectable.java | 2 +- .../web/client/api/WorkerConnection.java | 67 ++++++++++++++++++ .../deephaven/ide/client/IdeConnection.java | 23 ++++++ 4 files changed, 94 insertions(+), 68 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/ide/shared/IdeSession.java b/web/client-api/src/main/java/io/deephaven/ide/shared/IdeSession.java index 25cb3187c36..a88fdd1be80 100644 --- a/web/client-api/src/main/java/io/deephaven/ide/shared/IdeSession.java +++ b/web/client-api/src/main/java/io/deephaven/ide/shared/IdeSession.java @@ -15,7 +15,6 @@ import io.deephaven.web.client.api.barrage.stream.BiDiStream; import io.deephaven.web.client.api.console.JsCommandResult; import io.deephaven.web.client.api.console.JsVariableChanges; -import io.deephaven.web.client.api.console.JsVariableDefinition; import io.deephaven.web.client.api.widget.plot.JsFigure; import io.deephaven.web.client.fu.CancellablePromise; import io.deephaven.web.client.fu.JsLog; @@ -34,7 +33,6 @@ import java.util.HashMap; import java.util.Map; -import java.util.function.Consumer; import java.util.function.Supplier; import static io.deephaven.web.client.api.QueryConnectable.EVENT_TABLE_OPENED; @@ -93,7 +91,7 @@ public IdeSession( // TODO (deephaven-core#188): improve usage of subscriptions (w.r.t. this optional param) public Promise getTable(String name, @JsOptional Boolean applyPreviewColumns) { - return getVariableDefinition(name, JsVariableChanges.TABLE).then(varDef -> { + return connection.getVariableDefinition(name, JsVariableChanges.TABLE).then(varDef -> { final Promise table = connection.getTable(varDef, applyPreviewColumns); final CustomEventInit event = CustomEventInit.create(); event.setDetail(table); @@ -103,33 +101,11 @@ public Promise getTable(String name, @JsOptional Boolean applyPreviewCo } public Promise getFigure(String name) { - return getVariableDefinition(name, JsVariableChanges.FIGURE).then(connection::getFigure); + return connection.getVariableDefinition(name, JsVariableChanges.FIGURE).then(connection::getFigure); } public Promise getObject(JsPropertyMap definitionObject) { - if (definitionObject instanceof JsVariableDefinition) { - return connection.getObject((JsVariableDefinition) definitionObject); - } - - if (!definitionObject.has("type")) { - throw new IllegalArgumentException("no type field; could not getObject"); - } - String type = definitionObject.getAsAny("type").asString(); - - boolean hasName = definitionObject.has("name"); - boolean hasId = definitionObject.has("id"); - if (hasName && hasId) { - throw new IllegalArgumentException("has both name and id field; could not getObject"); - } else if (hasName) { - String name = definitionObject.getAsAny("name").asString(); - return getVariableDefinition(name, type) - .then(connection::getObject); - } else if (hasId) { - String id = definitionObject.getAsAny("id").asString(); - return connection.getObject(new JsVariableDefinition(type, null, id, null)); - } else { - throw new IllegalArgumentException("no name/id field; could not construct getObject"); - } + return connection.getJsObject(definitionObject); } public Promise newTable(String[] columnNames, String[] types, String[][] data, String userTimeZone) { @@ -166,46 +142,6 @@ public JsRunnable subscribeToFieldUpdates(JsConsumer callback return connection.subscribeToFieldUpdates(callback); } - private Promise getVariableDefinition(String name, String type) { - LazyPromise promise = new LazyPromise<>(); - - final class Listener implements Consumer { - final JsRunnable subscription; - - Listener() { - subscription = subscribeToFieldUpdates(this::accept); - } - - @Override - public void accept(JsVariableChanges changes) { - JsVariableDefinition foundField = changes.getCreated() - .find((field, p1, p2) -> field.getTitle().equals(name) && field.getType().equals(type)); - - if (foundField == null) { - foundField = changes.getUpdated().find((field, p1, p2) -> field.getTitle().equals(name) - && field.getType().equals(type)); - } - - if (foundField != null) { - subscription.run(); - promise.succeed(foundField); - } - } - } - - Listener listener = new Listener(); - - return promise - .timeout(10_000) - .asPromise() - .then(Promise::resolve, fail -> { - listener.subscription.run(); - // noinspection unchecked, rawtypes - return (Promise) (Promise) Promise - .reject(fail); - }); - } - public void close() { pendingAutocompleteCalls.clear();// let the timer clean up the rest for now closer.run(); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java index e375b59293c..1666f5cee80 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java @@ -107,7 +107,7 @@ public RemoverFn addEventListener(String name, EventFn callback) { return super.addEventListener(name, callback); } - private Promise onConnected() { + protected Promise onConnected() { if (connected) { return Promise.resolve((Void) null); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index 02c089cb08c..ece1613f476 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -104,6 +104,7 @@ import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; +import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -648,6 +649,46 @@ public void onError(Throwable throwable) { info.failureHandled(throwable.toString()); } + public Promise getVariableDefinition(String name, String type) { + LazyPromise promise = new LazyPromise<>(); + + final class Listener implements Consumer { + final JsRunnable subscription; + + Listener() { + subscription = subscribeToFieldUpdates(this::accept); + } + + @Override + public void accept(JsVariableChanges changes) { + JsVariableDefinition foundField = changes.getCreated() + .find((field, p1, p2) -> field.getTitle().equals(name) && field.getType().equals(type)); + + if (foundField == null) { + foundField = changes.getUpdated().find((field, p1, p2) -> field.getTitle().equals(name) + && field.getType().equals(type)); + } + + if (foundField != null) { + subscription.run(); + promise.succeed(foundField); + } + } + } + + Listener listener = new Listener(); + + return promise + .timeout(10_000) + .asPromise() + .then(Promise::resolve, fail -> { + listener.subscription.run(); + // noinspection unchecked, rawtypes + return (Promise) (Promise) Promise + .reject(fail); + }); + } + public Promise getTable(JsVariableDefinition varDef, @Nullable Boolean applyPreviewColumns) { return whenServerReady("get a table").then(serve -> { JsLog.debug("innerGetTable", varDef.getTitle(), " started"); @@ -694,6 +735,32 @@ public Promise getObject(JsVariableDefinition definition) { } } + public Promise getJsObject(JsPropertyMap definitionObject) { + if (definitionObject instanceof JsVariableDefinition) { + return getObject((JsVariableDefinition) definitionObject); + } + + if (!definitionObject.has("type")) { + throw new IllegalArgumentException("no type field; could not getObject"); + } + String type = definitionObject.getAsAny("type").asString(); + + boolean hasName = definitionObject.has("name"); + boolean hasId = definitionObject.has("id"); + if (hasName && hasId) { + throw new IllegalArgumentException("has both name and id field; could not getObject"); + } else if (hasName) { + String name = definitionObject.getAsAny("name").asString(); + return getVariableDefinition(name, type) + .then(this::getObject); + } else if (hasId) { + String id = definitionObject.getAsAny("id").asString(); + return getObject(new JsVariableDefinition(type, null, id, null)); + } else { + throw new IllegalArgumentException("no name/id field; could not construct getObject"); + } + } + @JsMethod @SuppressWarnings("ConstantConditions") public JsRunnable subscribeToFieldUpdates(JsConsumer callback) { diff --git a/web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java b/web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java index 526c7ad1af7..87cb717901c 100644 --- a/web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java +++ b/web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java @@ -4,10 +4,15 @@ package io.deephaven.ide.client; import elemental2.promise.Promise; +import io.deephaven.web.client.api.Callbacks; import io.deephaven.web.client.api.QueryConnectable; +import io.deephaven.web.client.api.WorkerConnection; +import io.deephaven.web.client.api.console.JsVariableChanges; +import io.deephaven.web.shared.fu.JsConsumer; import io.deephaven.web.shared.fu.JsRunnable; import io.deephaven.web.shared.data.ConnectToken; import jsinterop.annotations.*; +import jsinterop.base.JsPropertyMap; import java.nio.charset.StandardCharsets; @@ -68,6 +73,24 @@ public Promise running() { } } + public Promise getObject(JsPropertyMap definitionObject) { + WorkerConnection conn = connection.get(); + return onConnected().then(e -> conn.getJsObject(definitionObject)); + } + + public JsRunnable subscribeToFieldUpdates(JsConsumer callback) { + // Need to make sure the connection is initialized and connected + WorkerConnection conn = connection.get(); + Promise cleanupPromise = + onConnected().then(e -> Promise.resolve(conn.subscribeToFieldUpdates(callback))); + return () -> { + cleanupPromise.then(c -> { + c.run(); + return null; + }); + }; + } + @Override public void disconnected() { super.disconnected(); From 184d354e2fe03d044df4f92ac55497d6e0f2f817 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Wed, 31 Aug 2022 21:18:30 -0600 Subject: [PATCH 090/215] Fix ExecutionContext and PartitionTable bugs caught by enabling parallel updates (#2756) --- .../WritableSourceWithEnsurePrevious.java | 30 ------------- ...ourceWithPrepareForParallelPopulation.java | 35 +++++++++++++++ .../engine/context/ExecutionContext.java | 2 +- .../engine/table/impl/QueryTable.java | 6 ++- .../PartitionedTableProxyImpl.java | 43 ++++++++++++++++--- .../select/analyzers/SelectColumnLayer.java | 15 ++++--- .../AbstractSparseLongArraySource.java | 29 ++++++------- .../sources/BooleanSparseArraySource.java | 29 ++++++------- .../impl/sources/ByteSparseArraySource.java | 29 ++++++------- .../sources/CharacterSparseArraySource.java | 29 ++++++------- .../impl/sources/DoubleSparseArraySource.java | 29 ++++++------- .../impl/sources/FloatSparseArraySource.java | 29 ++++++------- .../sources/IntegerSparseArraySource.java | 29 ++++++------- .../impl/sources/ObjectSparseArraySource.java | 29 ++++++------- .../impl/sources/ShortSparseArraySource.java | 29 ++++++------- .../impl/sources/SparseArrayColumnSource.java | 4 +- .../immutable/Immutable2DByteArraySource.java | 6 +-- .../immutable/Immutable2DCharArraySource.java | 6 +-- .../Immutable2DDoubleArraySource.java | 6 +-- .../Immutable2DFloatArraySource.java | 6 +-- .../immutable/Immutable2DIntArraySource.java | 6 +-- .../immutable/Immutable2DLongArraySource.java | 6 +-- .../Immutable2DObjectArraySource.java | 6 +-- .../Immutable2DShortArraySource.java | 6 +-- .../immutable/ImmutableByteArraySource.java | 6 +-- .../immutable/ImmutableCharArraySource.java | 6 +-- .../immutable/ImmutableDoubleArraySource.java | 6 +-- .../immutable/ImmutableFloatArraySource.java | 6 +-- .../immutable/ImmutableIntArraySource.java | 6 +-- .../immutable/ImmutableLongArraySource.java | 6 +-- .../immutable/ImmutableObjectArraySource.java | 6 +-- .../immutable/ImmutableShortArraySource.java | 6 +-- py/server/tests/test_partitioned_table.py | 15 +++++++ py/server/tests/test_table.py | 9 ++++ 34 files changed, 286 insertions(+), 230 deletions(-) delete mode 100644 engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithEnsurePrevious.java create mode 100644 engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithPrepareForParallelPopulation.java diff --git a/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithEnsurePrevious.java b/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithEnsurePrevious.java deleted file mode 100644 index 93e6960d665..00000000000 --- a/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithEnsurePrevious.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table; - -import io.deephaven.engine.rowset.RowSet; - -/** - * A writable source that allows setting all previous values with one operation rather than on each set. - */ -public interface WritableSourceWithEnsurePrevious { - /** - * Does the specified WritableColumnSource provide the ensurePrevious function? - * - * @param wcs the WritableColumnSource to check - * @return true if ensurePrevious can be called on wcs - */ - static boolean providesEnsurePrevious(WritableColumnSource wcs) { - return wcs instanceof WritableSourceWithEnsurePrevious; - } - - /** - * Prepare this column source such that all values in rowSet may be accessed using getPrev. Further operations in - * this cycle need not check for previous when writing data to the column source; you must provide a row set that - * contains every row that may be written to this column source. - * - * @param rowSet the rowset of values that will change on this cycle - */ - void ensurePrevious(RowSet rowSet); -} diff --git a/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithPrepareForParallelPopulation.java b/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithPrepareForParallelPopulation.java new file mode 100644 index 00000000000..0af021d57e5 --- /dev/null +++ b/engine/api/src/main/java/io/deephaven/engine/table/WritableSourceWithPrepareForParallelPopulation.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.engine.table; + +import io.deephaven.engine.rowset.RowSet; + +/** + * A writable source that allows parallel population. + */ +public interface WritableSourceWithPrepareForParallelPopulation { + /** + * Does the specified WritableColumnSource provide the prepareForParallelPopulation function? + * + * @param wcs the WritableColumnSource to check + * @return true if prepareForParallelPopulation can be called on wcs + */ + static boolean supportsParallelPopulation(WritableColumnSource wcs) { + return wcs instanceof WritableSourceWithPrepareForParallelPopulation; + } + + /** + * Prepare this column source such that: + *
      + *
    • all values in rowSet may be accessed using getPrev
    • + *
    • all values in rowSet may be populated in parallel
    • + *
    + * + * Further operations in this cycle need not check for previous when writing data to the column source; you must + * provide a row set that contains every row that may be written to this column source. + * + * @param rowSet the rowset of values that will change on this cycle + */ + void prepareForParallelPopulation(RowSet rowSet); +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java index f2122dfc4da..21157401555 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java @@ -47,7 +47,7 @@ public static ExecutionContext createForUnitTests() { private static volatile ExecutionContext defaultContext = null; - private static ExecutionContext getDefaultContext() { + public static ExecutionContext getDefaultContext() { ExecutionContext localContext; if ((localContext = defaultContext) == null) { synchronized (ExecutionContext.class) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index 50413177869..cd1ec492937 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -20,6 +20,7 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.configuration.Configuration; import io.deephaven.datastructures.util.CollectionUtil; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.exceptions.CancellationException; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.rowset.*; @@ -1266,7 +1267,10 @@ private Table selectOrUpdate(Flavor flavor, final SelectColumn... selectColumns) final QueryTable resultTable; final LivenessScope liveResultCapture = isRefreshing() ? new LivenessScope() : null; - try (final SafeCloseable ignored = liveResultCapture != null ? liveResultCapture::release : null) { + try (final SafeCloseable ignored1 = liveResultCapture != null ? liveResultCapture::release : null; + final SafeCloseable ignored2 = ExecutionContext.getDefaultContext().open()) { + // we open the default context here to ensure that the update processing happens in the default + // context whether it is processed in parallel or not try (final RowSet emptyRowSet = RowSetFactory.empty(); final SelectAndViewAnalyzer.UpdateHelper updateHelper = new SelectAndViewAnalyzer.UpdateHelper(emptyRowSet, fakeUpdate)) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 8e3bfaa21e2..7738d7ec678 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -9,6 +9,7 @@ import io.deephaven.api.filter.Filter; import io.deephaven.api.updateby.UpdateByOperation; import io.deephaven.api.updateby.UpdateByControl; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.MatchPair; @@ -127,9 +128,29 @@ public boolean sanityChecksJoins() { return sanityCheckJoins; } + private static ExecutionContext getOrCreateExecutionContext(final boolean requiresFullContext) { + ExecutionContext context = ExecutionContext.getContextToRecord(); + if (context == null) { + final ExecutionContext.Builder builder = ExecutionContext.newBuilder() + .captureCompilerContext() + .markSystemic(); + if (requiresFullContext) { + builder.newQueryLibrary(); + builder.emptyQueryScope(); + } + context = builder.build(); + } + return context; + } + private PartitionedTable.Proxy basicTransform(@NotNull final UnaryOperator
    transformer) { + return basicTransform(false, transformer); + } + + private PartitionedTable.Proxy basicTransform( + final boolean requiresFullContext, @NotNull final UnaryOperator
    transformer) { return new PartitionedTableProxyImpl( - target.transform(null, transformer), + target.transform(getOrCreateExecutionContext(requiresFullContext), transformer), requireMatchingKeys, sanityCheckJoins); } @@ -138,13 +159,22 @@ private PartitionedTable.Proxy complexTransform( @NotNull final TableOperations other, @NotNull final BinaryOperator
    transformer, @Nullable final Collection joinMatches) { + return complexTransform(false, other, transformer, joinMatches); + } + + private PartitionedTable.Proxy complexTransform( + final boolean requiresFullContext, + @NotNull final TableOperations other, + @NotNull final BinaryOperator
    transformer, + @Nullable final Collection joinMatches) { + final ExecutionContext context = getOrCreateExecutionContext(requiresFullContext); if (other instanceof Table) { final Table otherTable = (Table) other; if ((target.table().isRefreshing() || otherTable.isRefreshing()) && joinMatches != null) { UpdateGraphProcessor.DEFAULT.checkInitiateTableOperation(); } return new PartitionedTableProxyImpl( - target.transform(null, ct -> transformer.apply(ct, otherTable)), + target.transform(context, ct -> transformer.apply(ct, otherTable)), requireMatchingKeys, sanityCheckJoins); } @@ -173,7 +203,7 @@ private PartitionedTable.Proxy complexTransform( final PartitionedTable rhsToUse = maybeRewrap(validatedRhsTable, otherTarget); return new PartitionedTableProxyImpl( - lhsToUse.partitionedTransform(rhsToUse, null, transformer), + lhsToUse.partitionedTransform(rhsToUse, context, transformer), requireMatchingKeys, sanityCheckJoins); } @@ -482,16 +512,17 @@ public PartitionedTable.Proxy raj(TableOperations rightTable, Collection ct.aggAllBy(spec, groupByColumns)); + return basicTransform(true, ct -> ct.aggAllBy(spec, groupByColumns)); } @Override public PartitionedTable.Proxy aggBy(Collection aggregations, boolean preserveEmpty, TableOperations initialGroups, Collection groupByColumns) { if (initialGroups == null) { - return basicTransform(ct -> ct.aggBy(aggregations, preserveEmpty, null, groupByColumns)); + return basicTransform(true, ct -> ct.aggBy(aggregations, preserveEmpty, null, groupByColumns)); } - return complexTransform(initialGroups, (ct, ot) -> ct.aggBy(aggregations, preserveEmpty, ot, groupByColumns), + return complexTransform(true, initialGroups, + (ct, ot) -> ct.aggBy(aggregations, preserveEmpty, ot, groupByColumns), null); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java index 74bac2e3042..b0f1de0d6b0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectColumnLayer.java @@ -93,7 +93,7 @@ final public class SelectColumnLayer extends SelectOrViewColumnLayer { // We can only parallelize this column if we are not redirected, our destination provides ensure previous, and // the select column is stateless canParallelizeThisColumn = canUseThreads && !isRedirected - && WritableSourceWithEnsurePrevious.providesEnsurePrevious(ws) && sc.isStateless(); + && WritableSourceWithPrepareForParallelPopulation.supportsParallelPopulation(ws) && sc.isStateless(); // If we were created on a systemic thread, we want to be sure to make sure that any updates are also // applied systemically. @@ -145,7 +145,8 @@ public void onAllRequiredColumnsCompleted() { final boolean hasShifts = upstream.shifted().nonempty(); if (canParallelizeThisColumn && jobScheduler.threadCount() > 1 && !hasShifts && - (resultTypeIsTable || totalSize > QueryTable.MINIMUM_PARALLEL_SELECT_ROWS)) { + ((resultTypeIsTable && totalSize > 0) + || totalSize > QueryTable.MINIMUM_PARALLEL_SELECT_ROWS)) { final long divisionSize = resultTypeIsTable ? 1 : Math.max(QueryTable.MINIMUM_PARALLEL_SELECT_ROWS, (totalSize + jobScheduler.threadCount() - 1) / jobScheduler.threadCount()); @@ -204,7 +205,7 @@ private void prepareParallelUpdate(final JobScheduler jobScheduler, final TableU // threads to avoid concurrency problems with our destination column sources doEnsureCapacity(); - copyPreviousValues(upstream); + prepareSourcesForParallelPopulation(upstream); final boolean checkTableOperations = UpdateGraphProcessor.DEFAULT.getCheckTableOperations() @@ -537,13 +538,13 @@ private void doEnsureCapacity() { } } - void copyPreviousValues(TableUpdate upstream) { + void prepareSourcesForParallelPopulation(TableUpdate upstream) { // we do not permit in-column parallelization with redirected results, so do not need to worry about how this // interacts with the previous clearing of the redirection index that has occurred at the start of applyUpdate - try (final WritableRowSet changedRows = - upstream.added().union(upstream.getModifiedPreShift())) { + try (final WritableRowSet changedRows = upstream.added().union(upstream.getModifiedPreShift())) { changedRows.insert(upstream.removed()); - ((WritableSourceWithEnsurePrevious) (writableSource)).ensurePrevious(changedRows); + ((WritableSourceWithPrepareForParallelPopulation) (writableSource)) + .prepareForParallelPopulation(changedRows); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java index b4494a0964f..d8d235f9c1f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/AbstractSparseLongArraySource.java @@ -393,7 +393,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -404,15 +404,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -420,23 +418,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final long[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final long[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java index 3efb3e332c0..5209e62a69f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanSparseArraySource.java @@ -413,7 +413,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -424,15 +424,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -440,23 +438,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final byte[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final byte[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java index ab1b2f27db6..5755d1dcdca 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteSparseArraySource.java @@ -408,7 +408,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -419,15 +419,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -435,23 +433,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final byte[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final byte[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterSparseArraySource.java index 6123059db61..80d6a2696d0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterSparseArraySource.java @@ -403,7 +403,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -414,15 +414,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -430,23 +428,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final char[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final char[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java index 3a011f64fe6..d90a9cbb75e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DoubleSparseArraySource.java @@ -408,7 +408,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -419,15 +419,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -435,23 +433,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final double[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final double[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java index 76ef2d9240b..2a3f4b9c004 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/FloatSparseArraySource.java @@ -408,7 +408,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -419,15 +419,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -435,23 +433,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final float[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final float[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java index a56cd3b21f4..078a7087f65 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/IntegerSparseArraySource.java @@ -408,7 +408,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -419,15 +419,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -435,23 +433,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final int[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final int[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java index 3678f6296a2..e6c0ad0f456 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectSparseArraySource.java @@ -395,7 +395,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -406,15 +406,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -422,23 +420,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final T [] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final T [] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java index f1a58a9115c..0aa7decd336 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ShortSparseArraySource.java @@ -408,7 +408,7 @@ private void commitUpdates() { } @Override - public void ensurePrevious(RowSet changedRows) { + public void prepareForParallelPopulation(RowSet changedRows) { final long currentStep = LogicalClock.DEFAULT.currentStep(); if (ensurePreviousClockCycle == currentStep) { throw new IllegalStateException("May not call ensurePrevious twice on one clock cycle!"); @@ -419,15 +419,13 @@ public void ensurePrevious(RowSet changedRows) { return; } - if (prevFlusher == null) { - return; + if (prevFlusher != null) { + prevFlusher.maybeActivate(); } - prevFlusher.maybeActivate(); - try (final RowSet.Iterator it = changedRows.iterator()) { - long key = it.nextLong(); - while (true) { - final long firstKey = key; + try (final RowSequence.Iterator it = changedRows.getRowSequenceIterator()) { + do { + final long firstKey = it.peekNextKey(); final long maxKeyInCurrentBlock = firstKey | INDEX_MASK; final int block0 = (int) (firstKey >> BLOCK0_SHIFT) & BLOCK0_MASK; @@ -435,23 +433,24 @@ public void ensurePrevious(RowSet changedRows) { final int block2 = (int) (firstKey >> BLOCK2_SHIFT) & BLOCK2_MASK; final short[] block = ensureBlock(block0, block1, block2); + if (prevFlusher == null) { + it.advance(maxKeyInCurrentBlock + 1); + continue; + } + final short[] prevBlock = ensurePrevBlock(firstKey, block0, block1, block2); final long[] inUse = prevInUse.get(block0).get(block1).get(block2); assert inUse != null; - do { + it.getNextRowSequenceThrough(maxKeyInCurrentBlock).forAllRowKeys(key -> { final int indexWithinBlock = (int) (key & INDEX_MASK); final int indexWithinInUse = indexWithinBlock >> LOG_INUSE_BITSET_SIZE; final long maskWithinInUse = 1L << (indexWithinBlock & IN_USE_MASK); prevBlock[indexWithinBlock] = block[indexWithinBlock]; inUse[indexWithinInUse] |= maskWithinInUse; - } while (it.hasNext() && (key = it.nextLong()) <= maxKeyInCurrentBlock); - if (key <= maxKeyInCurrentBlock) { - // we did not advance the iterator so should break - break; - } - } + }); + } while (it.hasMore()); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SparseArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SparseArrayColumnSource.java index 2bdf242a511..a43e95b3496 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SparseArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SparseArrayColumnSource.java @@ -6,7 +6,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.util.type.ArrayTypeUtils; import io.deephaven.time.DateTime; import io.deephaven.engine.rowset.chunkattributes.RowKeys; @@ -72,7 +72,7 @@ public abstract class SparseArrayColumnSource extends AbstractDeferredGroupingColumnSource implements FillUnordered, WritableColumnSource, InMemoryColumnSource, PossiblyImmutableColumnSource, - WritableSourceWithEnsurePrevious { + WritableSourceWithPrepareForParallelPopulation { public static final SparseArrayColumnSource[] ZERO_LENGTH_SPARSE_ARRAY_COLUMN_SOURCE_ARRAY = new SparseArrayColumnSource[0]; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DByteArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DByteArraySource.java index 9bc247a26d8..994cade6cef 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DByteArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DByteArraySource.java @@ -17,7 +17,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -40,7 +40,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableByteArraySource}. */ -public class Immutable2DByteArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForByte, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DByteArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForByte, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -275,7 +275,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DCharArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DCharArraySource.java index 9092b3e0bd3..bfa07889f68 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DCharArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DCharArraySource.java @@ -10,7 +10,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -33,7 +33,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableCharArraySource}. */ -public class Immutable2DCharArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForChar, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DCharArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForChar, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -268,7 +268,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DDoubleArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DDoubleArraySource.java index 8c313c4ce2f..6b3d7357b16 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DDoubleArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DDoubleArraySource.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -38,7 +38,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableDoubleArraySource}. */ -public class Immutable2DDoubleArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForDouble, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DDoubleArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForDouble, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -273,7 +273,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DFloatArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DFloatArraySource.java index da6ed6227fe..90547543feb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DFloatArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DFloatArraySource.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -38,7 +38,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableFloatArraySource}. */ -public class Immutable2DFloatArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForFloat, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DFloatArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForFloat, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -273,7 +273,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DIntArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DIntArraySource.java index 0892dc52231..082159fce2b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DIntArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DIntArraySource.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -38,7 +38,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableIntArraySource}. */ -public class Immutable2DIntArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForInt, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DIntArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForInt, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -273,7 +273,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DLongArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DLongArraySource.java index 58588ffac8f..6ba01b193fc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DLongArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DLongArraySource.java @@ -19,7 +19,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -42,7 +42,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableLongArraySource}. */ -public class Immutable2DLongArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForLong, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DLongArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForLong, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -277,7 +277,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DObjectArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DObjectArraySource.java index 79da690f410..297d66ac691 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DObjectArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DObjectArraySource.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -37,7 +37,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableObjectArraySource}. */ -public class Immutable2DObjectArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForObject, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DObjectArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForObject, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -272,7 +272,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DShortArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DShortArraySource.java index b417f2c3cf1..08016f655d2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DShortArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/Immutable2DShortArraySource.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -38,7 +38,7 @@ * * If your size is smaller than the maximum array size, prefer {@link ImmutableShortArraySource}. */ -public class Immutable2DShortArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForShort, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class Immutable2DShortArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForShort, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private static final int DEFAULT_SEGMENT_SHIFT = 30; private final long segmentShift; private final int segmentMask; @@ -273,7 +273,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // nothing to do } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java index 6959889eb73..28b922da535 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableByteArraySource.java @@ -16,7 +16,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -39,7 +39,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DByteArraySource}. */ -public class ImmutableByteArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForByte, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableByteArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForByte, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private byte[] data; // region constructor @@ -235,7 +235,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableCharArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableCharArraySource.java index ddd5768428f..af3d6c9a50c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableCharArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableCharArraySource.java @@ -9,7 +9,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -32,7 +32,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DCharArraySource}. */ -public class ImmutableCharArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForChar, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableCharArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForChar, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private char[] data; // region constructor @@ -228,7 +228,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java index f212e2ceda7..036296b4d5e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableDoubleArraySource.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -37,7 +37,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DDoubleArraySource}. */ -public class ImmutableDoubleArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForDouble, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableDoubleArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForDouble, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private double[] data; // region constructor @@ -233,7 +233,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java index 310a01e8278..ef49ed0c9eb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableFloatArraySource.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -37,7 +37,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DFloatArraySource}. */ -public class ImmutableFloatArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForFloat, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableFloatArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForFloat, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private float[] data; // region constructor @@ -233,7 +233,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java index 1e814f2381e..1ff6c1cc3f3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableIntArraySource.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -37,7 +37,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DIntArraySource}. */ -public class ImmutableIntArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForInt, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableIntArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForInt, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private int[] data; // region constructor @@ -233,7 +233,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java index e9e66f9c666..f899fcdf9ff 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableLongArraySource.java @@ -18,7 +18,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -41,7 +41,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DLongArraySource}. */ -public class ImmutableLongArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForLong, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableLongArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForLong, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private long[] data; // region constructor @@ -237,7 +237,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java index bcd017942bf..0200ea9e5f9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableObjectArraySource.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -36,7 +36,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DObjectArraySource}. */ -public class ImmutableObjectArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForObject, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableObjectArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForObject, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private Object[] data; // region constructor @@ -232,7 +232,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java index 4eb1f78c8a2..84ebdf8f628 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/immutable/ImmutableShortArraySource.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.WritableColumnSource; -import io.deephaven.engine.table.WritableSourceWithEnsurePrevious; +import io.deephaven.engine.table.WritableSourceWithPrepareForParallelPopulation; import io.deephaven.engine.table.impl.DefaultGetContext; import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults; import io.deephaven.engine.table.impl.sources.*; @@ -37,7 +37,7 @@ * * If your size is greater than the maximum capacity of an array, prefer {@link Immutable2DShortArraySource}. */ -public class ImmutableShortArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForShort, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithEnsurePrevious { +public class ImmutableShortArraySource extends AbstractDeferredGroupingColumnSource implements ImmutableColumnSourceGetDefaults.ForShort, WritableColumnSource, FillUnordered, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation { private short[] data; // region constructor @@ -233,7 +233,7 @@ public boolean providesFillUnordered() { } @Override - public void ensurePrevious(RowSet rowSet) { + public void prepareForParallelPopulation(RowSet rowSet) { // we don't track previous values, so we don't care to do any work } diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index 8a8a58bf0d4..f64625daa17 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -2,6 +2,7 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # +import jpy import unittest from deephaven.agg import partition @@ -116,6 +117,12 @@ def test_constituents(self): self.assertGreater(len(constituent_tables), 0) def test_transform(self): + _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + context = _JExecutionContext.newBuilder() \ + .captureCompilerContext() \ + .captureQueryLibrary() \ + .emptyQueryScope() \ + .build().open() pt = self.partitioned_table.transform(transform_func) self.assertIn("f", [col.name for col in pt.constituent_table_columns]) @@ -125,14 +132,22 @@ def test_transform(self): with self.assertRaises(DHError) as cm: pt = self.partitioned_table.transform(lambda t, t1: t.join(t1)) self.assertRegex(str(cm.exception), r"missing .* argument") + context.close() def test_partitioned_transform(self): + _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + context = _JExecutionContext.newBuilder() \ + .captureCompilerContext() \ + .captureQueryLibrary() \ + .emptyQueryScope() \ + .build().open() other_pt = self.partitioned_table.transform(transform_func) pt = self.partitioned_table.partitioned_transform(other_pt, partitioned_transform_func) self.assertIn("f", [col.name for col in pt.constituent_table_columns]) pt = self.partitioned_table.partitioned_transform(other_pt, PartitionedTransformer()) self.assertIn("f", [col.name for col in pt.constituent_table_columns]) + context.close() def test_partition_agg(self): with ugp.shared_lock(): diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 47264a0927e..592babc66aa 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -2,6 +2,7 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # +import jpy import unittest from types import SimpleNamespace from typing import List, Any @@ -622,8 +623,16 @@ def closure_fn() -> str: inner_func("param str") def test_nested_scopes(self): + _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + context = _JExecutionContext.newBuilder() \ + .captureCompilerContext() \ + .captureQueryLibrary() \ + .captureQueryScope() \ + .build() def inner_func(p) -> str: + openContext = context.open() t = empty_table(1).update("X = p * 10") + openContext.close() return t.to_string().split()[2] t = empty_table(1).update("X = i").update("TableString = inner_func(X + 10)") From 0345877e89ae9a4b241fe76d4936696d03c42974 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Thu, 1 Sep 2022 09:09:58 -0400 Subject: [PATCH 091/215] Address capacity reservation issue for streaming last-by operators with cached redirections (#2791) --- .../engine/table/impl/by/AggregationContext.java | 5 +++-- .../impl/by/BaseStreamFirstOrLastChunkedOperator.java | 7 ++++--- .../by/ByteStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../by/CharStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../table/impl/by/ChunkedOperatorAggregationHelper.java | 8 ++++---- .../by/DoubleStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../by/FloatStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../engine/table/impl/by/FormulaChunkedOperator.java | 4 ++-- .../engine/table/impl/by/GroupByChunkedOperator.java | 2 +- .../by/IntStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../impl/by/IterativeChunkedAggregationOperator.java | 3 ++- .../by/LongStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../by/ObjectStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../engine/table/impl/by/PartitionByChunkedOperator.java | 4 ++-- .../by/ShortStreamSortedFirstOrLastChunkedOperator.java | 4 ++-- .../engine/table/impl/by/TDigestPercentileOperator.java | 2 +- 16 files changed, 35 insertions(+), 32 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java index 683a46afce9..711b2aae192 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java @@ -268,10 +268,11 @@ UnaryOperator[] initializeRefreshing(@NotNull final QueryTabl * mutated in any way. * * @param upstream The upstream {@link TableUpdateImpl} + * @param startingDestinationsCount The number of used destinations at the beginning of this step */ - void resetOperatorsForStep(@NotNull final TableUpdate upstream) { + void resetOperatorsForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { for (final IterativeChunkedAggregationOperator operator : operators) { - operator.resetForStep(upstream); + operator.resetForStep(upstream, startingDestinationsCount); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java index e19e0e6759d..74e23ff35c2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BaseStreamFirstOrLastChunkedOperator.java @@ -36,7 +36,7 @@ public abstract class BaseStreamFirstOrLastChunkedOperator /** * Result columns, parallel to {@link #inputColumns} and {@link #outputColumns}. */ - protected final Map> resultColumns; + private final Map> resultColumns; /** *

    * Input columns, parallel to {@link #outputColumns} and {@link #resultColumns}. @@ -54,7 +54,7 @@ public abstract class BaseStreamFirstOrLastChunkedOperator /** * Cached pointer to the most-recently allocated {@link #redirections}. */ - protected SoftReference cachedRedirections; + private SoftReference cachedRedirections; /** * Map from destination slot to first key. Only used during a step to keep track of the appropriate rows to copy * into the output columns. @@ -95,9 +95,10 @@ public final boolean requiresRowKeys() { @Override @OverridingMethodsMustInvokeSuper - public void resetForStep(@NotNull final TableUpdate upstream) { + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { if ((redirections = cachedRedirections.get()) == null) { cachedRedirections = new SoftReference<>(redirections = new LongArraySource()); + ensureCapacity(startingDestinationsCount); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java index 4a004c035fa..2b67c7d4e17 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java index bcf139b4b74..c993b44ee86 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java @@ -53,8 +53,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java index 97b4826d52e..280df34f166 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java @@ -562,8 +562,8 @@ private TableUpdate computeDownstreamIndicesAndCopyKeys( @NotNull final WritableColumnSource[] keyColumnsCopied, @NotNull final ModifiedColumnSet resultModifiedColumnSet, @NotNull final UnaryOperator[] resultModifiedColumnSetFactories) { - final int previousLastState = outputPosition.intValue(); - ac.resetOperatorsForStep(upstream); + final int firstStateToAdd = outputPosition.intValue(); + ac.resetOperatorsForStep(upstream, firstStateToAdd); if (upstream.removed().isNonempty()) { doRemoves(upstream.removed()); @@ -660,7 +660,7 @@ private TableUpdate computeDownstreamIndicesAndCopyKeys( final TableUpdateImpl downstream = new TableUpdateImpl(); downstream.shifted = RowSetShiftData.EMPTY; - try (final RowSet newStates = makeNewStatesRowSet(previousLastState, outputPosition.intValue() - 1)) { + try (final RowSet newStates = makeNewStatesRowSet(firstStateToAdd, outputPosition.intValue() - 1)) { downstream.added = reincarnatedStatesBuilder.build(); downstream.removed = emptiedStatesBuilder.build(); @@ -1983,7 +1983,7 @@ public void onUpdate(@NotNull final TableUpdate upstream) { } private void processNoKeyUpdate(@NotNull final TableUpdate upstream) { - ac.resetOperatorsForStep(upstream); + ac.resetOperatorsForStep(upstream, 1); final ModifiedColumnSet upstreamModifiedColumnSet = upstream.modified().isEmpty() ? ModifiedColumnSet.EMPTY diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java index c6c29ff1a88..5598e6b07e7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java index 0ef89c1406b..bd9171b5954 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java index edf352154c2..0b5b64950ed 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java @@ -308,9 +308,9 @@ public UnaryOperator initializeRefreshing(@NotNull final Quer } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { if (delegateToBy) { - groupBy.resetForStep(upstream); + groupBy.resetForStep(upstream, startingDestinationsCount); } updateUpstreamModifiedColumnSet = upstream.modified().isEmpty() ? ModifiedColumnSet.EMPTY : upstream.modifiedColumnSet(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java index eed663374c5..fb8018e0ddf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java @@ -330,7 +330,7 @@ public ModifiedColumnSet apply(@NotNull final ModifiedColumnSet upstreamModified } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { stepValuesModified = upstream.modified().isNonempty() && upstream.modifiedColumnSet().nonempty() && upstream.modifiedColumnSet().containsAny(resultInputsModifiedColumnSet); someKeyHasAddsOrRemoves = false; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java index 4063d92442e..c3abd87b3a7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java index db5af4c648a..3baad4f4be6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java @@ -303,8 +303,9 @@ default UnaryOperator initializeRefreshing(@NotNull final Que * Reset any per-step internal state. Note that the arguments to this method should not be mutated in any way. * * @param upstream The upstream ShiftAwareListener.Update + * @param startingDestinationsCount The number of used destinations at the beginning of this step */ - default void resetForStep(@NotNull final TableUpdate upstream) {} + default void resetForStep(@NotNull TableUpdate upstream, int startingDestinationsCount) {} /** * Perform any internal state keeping needed for destinations that were added (went from 0 keys to > 0), removed diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java index 30ed418e4be..0434a9023e7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java index 830a0e70e80..0ae2bf8270a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java index 892f1f5fd97..c9bd43f3c89 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java @@ -108,7 +108,7 @@ public interface AttributeCopier { * downstream modifies, because updates to constituents are not modifies to their rows in the aggregation * output table, but rather table updates to be propagated. *

    - * This exists in each cycle between {@link IterativeChunkedAggregationOperator#resetForStep(TableUpdate)} and + * This exists in each cycle between {@link IterativeChunkedAggregationOperator#resetForStep(TableUpdate, int)} and * {@link IterativeChunkedAggregationOperator#propagateUpdates(TableUpdate, RowSet)} *

    * If this ever becomes necessary in other operators, it could be moved out to the helper the way modified @@ -540,7 +540,7 @@ private void linkTableReferences(@NotNull final Table subTable) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { + public void resetForStep(@NotNull final TableUpdate upstream, int startingDestinationsCount) { stepUpdatedDestinations = RowSetFactory.empty(); final boolean upstreamModified = upstream.modified().isNonempty() && upstream.modifiedColumnSet().nonempty(); if (upstreamModified) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java index 180df591f06..76bc6b23a25 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java @@ -58,8 +58,8 @@ public void ensureCapacity(final long tableSize) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { - super.resetForStep(upstream); + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { + super.resetForStep(upstream, startingDestinationsCount); if (isCombo) { changedDestinationsBuilder = RowSetFactory.builderRandom(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java index ff81dedba94..e3baa25cd91 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java @@ -200,7 +200,7 @@ private void updateDestination(final long destination) { } @Override - public void resetForStep(@NotNull final TableUpdate upstream) { + public void resetForStep(@NotNull final TableUpdate upstream, final int startingDestinationsCount) { modifiedThisStep = false; } From 18f929df9fc929e10e4fcc668b47ba3001e4c89d Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 1 Sep 2022 08:24:06 -0500 Subject: [PATCH 092/215] Provide a servlet filter to automatically translate grpc-web clients calls to grpc (#2717) Combined with #2401, the Jetty-based server can now directly offer grpc-web (albeit without support for text payloads). While technically this works with http/1.1 connections, it is best suited for h/2, so the JS API still defaults to the existing websocket transport when https is not present. See https://github.com/grpc/grpc/blob/v1.48.0/doc/PROTOCOL-WEB.md Also includes a workaround for eclipse/jetty.project#8405. Fixes #1769 --- .../grpc/servlet/jakarta/ServletAdapter.java | 7 + .../jakarta/web/DelegatingAsyncContext.java | 88 +++++++++++ .../servlet/jakarta/web/GrpcWebFilter.java | 142 ++++++++++++++++++ .../server/jetty/JettyBackedGrpcServer.java | 4 + 4 files changed, 241 insertions(+) create mode 100644 grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/DelegatingAsyncContext.java create mode 100644 grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/GrpcWebFilter.java diff --git a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java index a29fb747709..8ad5503140b 100644 --- a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java +++ b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/ServletAdapter.java @@ -45,6 +45,7 @@ import java.util.Enumeration; import java.util.List; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; import static com.google.common.base.Preconditions.checkArgument; @@ -279,6 +280,7 @@ private static final class GrpcReadListener implements ReadListener { final AsyncContext asyncCtx; final ServletInputStream input; final InternalLogId logId; + private final AtomicBoolean closed = new AtomicBoolean(false); GrpcReadListener( ServletServerStream stream, @@ -321,6 +323,11 @@ public void onDataAvailable() throws IOException { @Override public void onAllDataRead() { logger.log(FINE, "[{0}] onAllDataRead", logId); + if (!closed.compareAndSet(false, true)) { + // https://github.com/eclipse/jetty.project/issues/8405 + logger.log(FINE, "[{0}] onAllDataRead already called, skipping this one", logId); + return; + } stream.transportState().runOnTransportThread( () -> stream.transportState().inboundDataReceived(ReadableBuffers.empty(), true)); } diff --git a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/DelegatingAsyncContext.java b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/DelegatingAsyncContext.java new file mode 100644 index 00000000000..a51577f99a8 --- /dev/null +++ b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/DelegatingAsyncContext.java @@ -0,0 +1,88 @@ +package io.grpc.servlet.jakarta.web; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.AsyncListener; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +/** + * Util class to allow the complete() call to get some work done (writing trailers as a payload) before calling the + * actual container implementation. The container will finish closing the stream before invoking the async listener and + * formally informing the filter that the stream has closed, making this our last chance to intercept the closing of the + * stream before it happens. + */ +public class DelegatingAsyncContext implements AsyncContext { + private final AsyncContext delegate; + + public DelegatingAsyncContext(AsyncContext delegate) { + this.delegate = delegate; + } + + @Override + public ServletRequest getRequest() { + return delegate.getRequest(); + } + + @Override + public ServletResponse getResponse() { + return delegate.getResponse(); + } + + @Override + public boolean hasOriginalRequestAndResponse() { + return delegate.hasOriginalRequestAndResponse(); + } + + @Override + public void dispatch() { + delegate.dispatch(); + } + + @Override + public void dispatch(String path) { + delegate.dispatch(path); + } + + @Override + public void dispatch(ServletContext context, String path) { + delegate.dispatch(context, path); + } + + @Override + public void complete() { + delegate.complete(); + } + + @Override + public void start(Runnable run) { + delegate.start(run); + } + + @Override + public void addListener(AsyncListener listener) { + delegate.addListener(listener); + } + + @Override + public void addListener(AsyncListener listener, ServletRequest servletRequest, + ServletResponse servletResponse) { + delegate.addListener(listener, servletRequest, servletResponse); + } + + @Override + public T createListener(Class clazz) throws ServletException { + return delegate.createListener(clazz); + } + + @Override + public void setTimeout(long timeout) { + delegate.setTimeout(timeout); + } + + @Override + public long getTimeout() { + return delegate.getTimeout(); + } +} diff --git a/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/GrpcWebFilter.java b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/GrpcWebFilter.java new file mode 100644 index 00000000000..9d09f799368 --- /dev/null +++ b/grpc-java/grpc-servlet-jakarta/src/main/java/io/grpc/servlet/jakarta/web/GrpcWebFilter.java @@ -0,0 +1,142 @@ +package io.grpc.servlet.jakarta.web; + +import io.grpc.internal.GrpcUtil; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpFilter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Pattern; + +/** + * Servlet filter that translates grpc-web on the fly to match what is expected by GrpcServlet. This work is done + * in-process with no addition copies to the request or response data - only the content type header and the trailer + * content is specially treated at this time. + * + * Note that grpc-web-text is not yet supported. + */ +public class GrpcWebFilter extends HttpFilter { + private static final Logger logger = Logger.getLogger(GrpcWebFilter.class.getName()); + + public static final String CONTENT_TYPE_GRPC_WEB = GrpcUtil.CONTENT_TYPE_GRPC + "-web"; + + @Override + public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws IOException, ServletException { + if (isGrpcWeb(request)) { + // wrap the request and response to paper over the grpc-web details + GrpcWebHttpResponse wrappedResponse = new GrpcWebHttpResponse(response); + HttpServletRequestWrapper wrappedRequest = new HttpServletRequestWrapper(request) { + @Override + public String getContentType() { + // Adapt the content-type to replace grpc-web with grpc + return super.getContentType().replaceFirst(Pattern.quote(CONTENT_TYPE_GRPC_WEB), + GrpcUtil.CONTENT_TYPE_GRPC); + } + + @Override + public AsyncContext startAsync() throws IllegalStateException { + return startAsync(this, wrappedResponse); + } + + @Override + public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) + throws IllegalStateException { + AsyncContext delegate = super.startAsync(servletRequest, servletResponse); + return new DelegatingAsyncContext(delegate) { + @Override + public void complete() { + // Write any trailers out to the output stream as a payload, since grpc-web doesn't + // use proper trailers. + try { + if (wrappedResponse.trailers != null) { + Map map = wrappedResponse.trailers.get(); + if (map != null) { + // write a payload, even for an empty set of trailers, but not for + // the absence of trailers. + int trailerLength = map.entrySet().stream() + .mapToInt(e -> e.getKey().length() + e.getValue().length() + 4).sum(); + ByteBuffer payload = ByteBuffer.allocate(5 + trailerLength); + payload.put((byte) 0x80); + payload.putInt(trailerLength); + for (Map.Entry entry : map.entrySet()) { + payload.put(entry.getKey().getBytes(StandardCharsets.US_ASCII)); + payload.put((byte) ':'); + payload.put((byte) ' '); + payload.put(entry.getValue().getBytes(StandardCharsets.US_ASCII)); + payload.put((byte) '\r'); + payload.put((byte) '\n'); + } + if (payload.hasRemaining()) { + // Normally we must not throw, but this is an exceptional case. Complete + // the stream, _then_ throw. + super.complete(); + throw new IllegalStateException( + "Incorrectly sized buffer, trailer payload will be sized wrong"); + } + wrappedResponse.getOutputStream().write(payload.array()); + } + } + } catch (IOException e) { + // complete() should not throw, but instead just log the error. In this case, + // the connection has likely been lost, so there is no way to send the trailers, + // so we just let the exception slide. + logger.log(Level.FINE, "Error sending grpc-web trailers", e); + } + + // Let the superclass complete the stream so we formally close it + super.complete(); + } + }; + } + }; + + chain.doFilter(wrappedRequest, wrappedResponse); + } else { + chain.doFilter(request, response); + } + } + + private static boolean isGrpcWeb(ServletRequest request) { + return request.getContentType() != null && request.getContentType().startsWith(CONTENT_TYPE_GRPC_WEB); + } + + private static class GrpcWebHttpResponse extends HttpServletResponseWrapper { + private Supplier> trailers; + + public GrpcWebHttpResponse(HttpServletResponse response) { + super(response); + } + + @Override + public void setContentType(String type) { + // Adapt the content-type to be grpc-web + super.setContentType( + type.replaceFirst(Pattern.quote(GrpcUtil.CONTENT_TYPE_GRPC), CONTENT_TYPE_GRPC_WEB)); + } + + // intercept trailers and write them out as a message just before we complete + @Override + public void setTrailerFields(Supplier> supplier) { + trailers = supplier; + } + + @Override + public Supplier> getTrailerFields() { + return trailers; + } + } +} diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index ef0203fe7f9..a1404f13c06 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -11,6 +11,7 @@ import io.deephaven.ssl.config.TrustJdk; import io.deephaven.ssl.config.impl.KickstartUtils; import io.grpc.servlet.web.websocket.WebSocketServerStream; +import io.grpc.servlet.jakarta.web.GrpcWebFilter; import jakarta.servlet.DispatcherType; import jakarta.websocket.server.ServerEndpointConfig; import nl.altindag.ssl.SSLFactory; @@ -78,6 +79,9 @@ public JettyBackedGrpcServer( // Direct jetty all use this configuration as the root application context.setContextPath("/"); + // Handle grpc-web connections, translate to vanilla grpc + context.addFilter(new FilterHolder(new GrpcWebFilter()), "/*", EnumSet.noneOf(DispatcherType.class)); + // Wire up the provided grpc filter context.addFilter(new FilterHolder(filter), "/*", EnumSet.noneOf(DispatcherType.class)); From 7a70a0fb3ee4a564851f5bce2c788ea35d802029 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Thu, 1 Sep 2022 08:24:27 -0600 Subject: [PATCH 093/215] force reference count to zero when table listener failure occurs (#2789) --- .../referencecounting/ReferenceCounted.java | 60 +++++++++++++++---- .../impl/InstrumentedTableListenerBase.java | 5 +- .../engine/table/impl/MergedListener.java | 4 +- .../table/impl/SelectOrUpdateListener.java | 9 +-- .../impl/util/AsyncClientErrorNotifier.java | 4 +- .../java/io/deephaven/server/log/LogInit.java | 4 ++ 6 files changed, 63 insertions(+), 23 deletions(-) diff --git a/Util/src/main/java/io/deephaven/util/referencecounting/ReferenceCounted.java b/Util/src/main/java/io/deephaven/util/referencecounting/ReferenceCounted.java index c64dddba3d5..6a54b407c73 100644 --- a/Util/src/main/java/io/deephaven/util/referencecounting/ReferenceCounted.java +++ b/Util/src/main/java/io/deephaven/util/referencecounting/ReferenceCounted.java @@ -36,7 +36,7 @@ public abstract class ReferenceCounted implements LogOutputAppendable, Serializa /** * Since we've reserved -1 as our initial reference count value, our maximum is really one less. */ - private static final int MAXIMUM_VALUE = -2; + private static final int MAXIMUM_VALUE = -3; /** * This is our "one" reference count value. @@ -44,9 +44,16 @@ public abstract class ReferenceCounted implements LogOutputAppendable, Serializa private static final int ONE_VALUE = 1; /** - * This is our "zero" reference count value (terminal state). + * This is our normal "zero" reference count value (terminal state). */ - private static final int TERMINAL_ZERO_VALUE = 0; + private static final int NORMAL_TERMINAL_ZERO_VALUE = 0; + + /** + * This is a marker "zero" reference count value (terminal state), signifying that a reference count was set to zero + * under exceptional circumstances, and additional attempts to drop the reference count should be treated as + * successful so as not to violate constraints. + */ + private static final int FORCED_TERMINAL_ZERO_VALUE = -2; /** * The actual value of our reference count. @@ -57,6 +64,10 @@ protected ReferenceCounted() { this(0); } + /** + * @param initialValue The initial value for the reference count, taken as an unsigned integer. Must not be one of + * the reserved values {@value #INITIAL_ZERO_VALUE} or {@value #FORCED_TERMINAL_ZERO_VALUE}. + */ @SuppressWarnings("WeakerAccess") protected ReferenceCounted(final int initialValue) { initializeReferenceCount(initialValue); @@ -72,13 +83,13 @@ public String toString() { } @Override - public LogOutput append(@NotNull final LogOutput logOutput) { + public LogOutput append(final LogOutput logOutput) { return logOutput.append(Utils.REFERENT_FORMATTER, this).append('[').append(getCurrentReferenceCount()) .append(']'); } private void initializeReferenceCount(final int initialValue) { - if (initialValue == INITIAL_ZERO_VALUE) { + if (initialValue == INITIAL_ZERO_VALUE || initialValue == FORCED_TERMINAL_ZERO_VALUE) { throw new IllegalArgumentException("Invalid initial reference count " + initialValue); } referenceCount = initialValue == 0 ? INITIAL_ZERO_VALUE : initialValue; @@ -96,12 +107,25 @@ private boolean tryUpdateReferenceCount(final int expected, final int update) { * Reset this reference count to its initial state for reuse. */ public final void resetReferenceCount() { - if (!tryUpdateReferenceCount(TERMINAL_ZERO_VALUE, INITIAL_ZERO_VALUE)) { + if (!tryUpdateReferenceCount(NORMAL_TERMINAL_ZERO_VALUE, INITIAL_ZERO_VALUE) + && !tryUpdateReferenceCount(FORCED_TERMINAL_ZERO_VALUE, INITIAL_ZERO_VALUE)) { throw new IllegalStateException( Utils.makeReferentDescription(this) + "'s reference count is non-zero and cannot be reset"); } } + private static boolean isInitialZero(final int countValue) { + return countValue == INITIAL_ZERO_VALUE; + } + + private static boolean isTerminalZero(final int countValue) { + return countValue == NORMAL_TERMINAL_ZERO_VALUE || countValue == FORCED_TERMINAL_ZERO_VALUE; + } + + private static boolean isZero(final int countValue) { + return isInitialZero(countValue) || isTerminalZero(countValue); + } + /** * Increment the reference count by 1, if it has not already been decreased to 0. * @@ -110,13 +134,13 @@ public final void resetReferenceCount() { */ public final boolean tryIncrementReferenceCount() { int currentReferenceCount; - while ((currentReferenceCount = getCurrentReferenceCount()) != TERMINAL_ZERO_VALUE) { + while (!isTerminalZero(currentReferenceCount = getCurrentReferenceCount())) { if (currentReferenceCount == MAXIMUM_VALUE) { throw new IllegalStateException( Utils.makeReferentDescription(this) + "'s reference count cannot exceed maximum value"); } if (tryUpdateReferenceCount(currentReferenceCount, - currentReferenceCount == INITIAL_ZERO_VALUE ? ONE_VALUE : currentReferenceCount + 1)) { + isInitialZero(currentReferenceCount) ? ONE_VALUE : currentReferenceCount + 1)) { return true; } } @@ -144,8 +168,7 @@ public final void incrementReferenceCount() { @SuppressWarnings({"WeakerAccess", "BooleanMethodIsAlwaysInverted"}) public final boolean tryDecrementReferenceCount() { int currentReferenceCount; - while ((currentReferenceCount = getCurrentReferenceCount()) != TERMINAL_ZERO_VALUE - && currentReferenceCount != INITIAL_ZERO_VALUE) { + while (!isZero(currentReferenceCount = getCurrentReferenceCount())) { if (tryUpdateReferenceCount(currentReferenceCount, currentReferenceCount - 1)) { if (currentReferenceCount == ONE_VALUE) { // Did we just CAS from 1 to 0? onReferenceCountAtZero(); @@ -153,7 +176,22 @@ public final boolean tryDecrementReferenceCount() { return true; } } - return false; + return currentReferenceCount == FORCED_TERMINAL_ZERO_VALUE; + } + + /** + * Force the reference count to zero. If it was non-zero, this will have the same side effects as returning to zero + * normally, but subsequent invocations of {@link #decrementReferenceCount()} and + * {@link #tryDecrementReferenceCount()} will act as if the reference count was successfully decremented until + * {@link #resetReferenceCount()} is invoked. + */ + public final void forceReferenceCountToZero() { + int currentReferenceCount; + while (!isZero(currentReferenceCount = getCurrentReferenceCount())) { + if (tryUpdateReferenceCount(currentReferenceCount, FORCED_TERMINAL_ZERO_VALUE)) { + onReferenceCountAtZero(); + } + } } /** diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java index c45a6ccd41f..e76e5d61dae 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/InstrumentedTableListenerBase.java @@ -152,6 +152,7 @@ public boolean satisfied(final long step) { @Override public void onFailure(Throwable originalException, Entry sourceEntry) { + forceReferenceCountToZero(); onFailureInternal(originalException, sourceEntry == null ? entry : sourceEntry); } @@ -194,7 +195,7 @@ public void run() { log.error().append("Error logging failure from ").append(entry).append(": ").append(e).endl(); } try { - onFailureInternal(originalException, sourceEntry); + onFailure(originalException, sourceEntry); } catch (Exception e) { log.error().append("Error propagating failure from ").append(sourceEntry).append(": ").append(e).endl(); } @@ -319,7 +320,7 @@ private void doRunInternal(final Runnable invokeOnUpdate) { // If the table has an error, we should cease processing further updates. failed = true; - onFailureInternal(e, entry); + onFailure(e, entry); } finally { entry.onUpdateEnd(); final long oldLastCompletedStep = diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java index 2c5d4db79d1..003a43299a1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/MergedListener.java @@ -6,6 +6,7 @@ import io.deephaven.base.log.LogOutput; import io.deephaven.base.verify.Assert; import io.deephaven.engine.exceptions.UncheckedTableException; +import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.table.TableListener; import io.deephaven.engine.table.impl.perf.PerformanceEntry; import io.deephaven.engine.updategraph.UpdateGraphProcessor; @@ -14,7 +15,6 @@ import io.deephaven.io.logger.Logger; import io.deephaven.engine.updategraph.NotificationQueue; import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker; -import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.updategraph.LogicalClock; import io.deephaven.engine.updategraph.AbstractNotification; import io.deephaven.engine.table.impl.util.AsyncClientErrorNotifier; @@ -117,6 +117,8 @@ private void propagateProcessError(Exception updateException) { } private void propagateErrorInternal(@NotNull final Throwable error, @Nullable final TableListener.Entry entry) { + forceReferenceCountToZero(); + recorders.forEach(ListenerRecorder::forceReferenceCountToZero); propagateErrorDownstream(error, entry); try { if (systemicResult()) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java index bf192620e75..6f240850b97 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SelectOrUpdateListener.java @@ -102,14 +102,7 @@ protected void onError(Exception error) { } private void handleException(Exception e) { - dependent.notifyListenersOnError(e, getEntry()); - try { - if (SystemicObjectTracker.isSystemic(dependent)) { - AsyncClientErrorNotifier.reportError(e); - } - } catch (IOException ioe) { - throw new UncheckedTableException("Exception in " + getEntry().toString(), e); - } + onFailure(e, getEntry()); updateInProgress = false; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/AsyncClientErrorNotifier.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/AsyncClientErrorNotifier.java index d32d380fbdf..7cb5d3305a1 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/AsyncClientErrorNotifier.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/AsyncClientErrorNotifier.java @@ -4,6 +4,7 @@ package io.deephaven.engine.table.impl.util; import io.deephaven.engine.table.impl.UpdateErrorReporter; +import io.deephaven.util.datastructures.WeakIdentityHashSet; import java.io.IOException; @@ -14,6 +15,7 @@ public class AsyncClientErrorNotifier { private static volatile UpdateErrorReporter reporter = null; + private static final WeakIdentityHashSet knownErrors = new WeakIdentityHashSet.Synchronized<>(); public static UpdateErrorReporter setReporter(UpdateErrorReporter reporter) { final UpdateErrorReporter old = AsyncClientErrorNotifier.reporter; @@ -23,7 +25,7 @@ public static UpdateErrorReporter setReporter(UpdateErrorReporter reporter) { public static void reportError(Throwable t) throws IOException { final UpdateErrorReporter localReporter = reporter; - if (localReporter != null) { + if (localReporter != null && knownErrors.add(t)) { localReporter.reportUpdateError(t); } } diff --git a/server/src/main/java/io/deephaven/server/log/LogInit.java b/server/src/main/java/io/deephaven/server/log/LogInit.java index 631b0b1d0ed..bfdd58df3cc 100644 --- a/server/src/main/java/io/deephaven/server/log/LogInit.java +++ b/server/src/main/java/io/deephaven/server/log/LogInit.java @@ -4,6 +4,7 @@ package io.deephaven.server.log; import io.deephaven.base.system.StandardStreamState; +import io.deephaven.engine.table.impl.util.AsyncClientErrorNotifier; import io.deephaven.internal.log.InitSink; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.log.LogSink; @@ -36,6 +37,9 @@ public void run() throws UnsupportedEncodingException { checkLogSinkIsSingleton(); standardStreamState.setupRedirection(); configureLoggerSink(); + Logger errLog = LoggerFactory.getLogger(AsyncClientErrorNotifier.class); + AsyncClientErrorNotifier + .setReporter(err -> errLog.error().append("Error in table update: ").append(err).endl()); } private void configureLoggerSink() { From 8111232508f2b7fbc27b3782d648164e70fd028c Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 1 Sep 2022 07:33:36 -0700 Subject: [PATCH 094/215] Add explicit configuration for websockets, http1, and a proxy hint. (#2731) --- .../server/jetty/JettyBackedGrpcServer.java | 20 ++++-- .../deephaven/server/jetty/JettyConfig.java | 63 ++++++++++++++++--- .../deephaven/server/config/ServerConfig.java | 20 ++++++ 3 files changed, 90 insertions(+), 13 deletions(-) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index a1404f13c06..146de8434bd 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -86,7 +86,7 @@ public JettyBackedGrpcServer( context.addFilter(new FilterHolder(filter), "/*", EnumSet.noneOf(DispatcherType.class)); // Set up websocket for grpc-web - if (config.websockets()) { + if (config.websocketsOrDefault()) { JakartaWebSocketServletContainerInitializer.configure(context, (servletContext, container) -> { container.addEndpoint( ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") @@ -137,10 +137,10 @@ public int getPort() { return ((ServerConnector) jetty.getConnectors()[0]).getLocalPort(); } - private static ServerConnector createConnector(Server server, ServerConfig config) { + private static ServerConnector createConnector(Server server, JettyConfig config) { // https://www.eclipse.org/jetty/documentation/jetty-11/programming-guide/index.html#pg-server-http-connector-protocol-http2-tls final HttpConfiguration httpConfig = new HttpConfiguration(); - final HttpConnectionFactory http11 = new HttpConnectionFactory(httpConfig); + final HttpConnectionFactory http11 = config.http1OrDefault() ? new HttpConnectionFactory(httpConfig) : null; final ServerConnector serverConnector; if (config.ssl().isPresent()) { // Consider allowing configuration of sniHostCheck @@ -149,7 +149,7 @@ private static ServerConnector createConnector(Server server, ServerConfig confi final HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(httpConfig); h2.setRateControlFactory(new RateControl.Factory() {}); final ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory(); - alpn.setDefaultProtocol(http11.getProtocol()); + alpn.setDefaultProtocol(http11 != null ? http11.getProtocol() : h2.getProtocol()); // The Jetty server is getting intermediate setup by default if none are configured. This is most similar to // how the Netty servers gets setup by default via GrpcSslContexts. final SSLConfig sslConfig = config.ssl().get() @@ -159,11 +159,19 @@ private static ServerConnector createConnector(Server server, ServerConfig confi final SSLFactory kickstart = KickstartUtils.create(sslConfig); final SslContextFactory.Server jetty = JettySslUtils.forServer(kickstart); final SslConnectionFactory tls = new SslConnectionFactory(jetty, alpn.getProtocol()); - serverConnector = new ServerConnector(server, tls, alpn, h2, http11); + if (http11 != null) { + serverConnector = new ServerConnector(server, tls, alpn, h2, http11); + } else { + serverConnector = new ServerConnector(server, tls, alpn, h2); + } } else { final HTTP2CServerConnectionFactory h2c = new HTTP2CServerConnectionFactory(httpConfig); h2c.setRateControlFactory(new RateControl.Factory() {}); - serverConnector = new ServerConnector(server, http11, h2c); + if (http11 != null) { + serverConnector = new ServerConnector(server, http11, h2c); + } else { + serverConnector = new ServerConnector(server, h2c); + } } config.host().ifPresent(serverConnector::setHost); serverConnector.setPort(config.port()); diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java index 5ad48b37f5c..52857d1250c 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java @@ -6,10 +6,13 @@ import io.deephaven.annotations.BuildableStyle; import io.deephaven.configuration.Configuration; import io.deephaven.server.config.ServerConfig; +import org.immutables.value.Value; import org.immutables.value.Value.Default; import org.immutables.value.Value.Immutable; import org.immutables.value.Value.Style; +import javax.annotation.Nullable; + /** * The jetty server configuration. */ @@ -21,8 +24,9 @@ public abstract class JettyConfig implements ServerConfig { public static final int DEFAULT_SSL_PORT = 443; public static final int DEFAULT_PLAINTEXT_PORT = 10000; - public static final boolean DEFAULT_WITH_WEBSOCKETS = true; public static final String HTTP_WEBSOCKETS = "http.websockets"; + public static final String HTTP_HTTP1 = "http.http1"; + public static Builder builder() { return ImmutableJettyConfig.builder(); @@ -44,7 +48,8 @@ public static JettyConfig defaultConfig() { * {@link ServerConfig#buildFromConfig(ServerConfig.Builder, Configuration)}. * *

    - * Additionally, parses the property {@value HTTP_WEBSOCKETS} into {@link Builder#websockets(boolean)}. + * Additionally, parses the property {@value HTTP_WEBSOCKETS} into {@link Builder#websockets(Boolean)} and + * {@value HTTP_HTTP1} into {@link Builder#http1(Boolean)}. * * @param config the config * @return the builder @@ -52,9 +57,13 @@ public static JettyConfig defaultConfig() { public static Builder buildFromConfig(Configuration config) { final Builder builder = ServerConfig.buildFromConfig(builder(), config); String httpWebsockets = config.getStringWithDefault(HTTP_WEBSOCKETS, null); + String httpHttp1 = config.getStringWithDefault(HTTP_HTTP1, null); if (httpWebsockets != null) { builder.websockets(Boolean.parseBoolean(httpWebsockets)); } + if (httpHttp1 != null) { + builder.http1(Boolean.parseBoolean(httpHttp1)); + } return builder; } @@ -68,15 +77,55 @@ public int port() { } /** - * Include websockets. Defaults to {@value DEFAULT_WITH_WEBSOCKETS}. + * Include websockets. */ - @Default - public boolean websockets() { - return DEFAULT_WITH_WEBSOCKETS; + @Nullable + public abstract Boolean websockets(); + + /** + * Include HTTP/1.1. + */ + @Nullable + public abstract Boolean http1(); + + /** + * Returns {@link #websockets()} if explicitly set. If {@link #proxyHint()} is {@code true}, returns {@code false}. + * Otherwise, defaults to {@code true} when {@link #ssl()} is empty, and {@code false} when {@link #ssl()} is + * present. + */ + public final boolean websocketsOrDefault() { + final Boolean websockets = websockets(); + if (websockets != null) { + return websockets; + } + if (Boolean.TRUE.equals(proxyHint())) { + return false; + } + return ssl().isEmpty(); + } + + /** + * Returns {@link #http1()} if explicitly set. If {@link #proxyHint()} is {@code true}, returns {@code false}. + * Otherwise, defaults to {@code true}. This may become more strict in the future, see + * #2787). + */ + public final boolean http1OrDefault() { + final Boolean http1 = http1(); + if (http1 != null) { + return http1; + } + if (Boolean.TRUE.equals(proxyHint())) { + return false; + } + // TODO(deephaven-core#2787): OS / browser testing to determine minimum viable HTTP version + // return ssl().isEmpty(); + return true; } public interface Builder extends ServerConfig.Builder { - Builder websockets(boolean websockets); + Builder websockets(Boolean websockets); + + Builder http1(Boolean http1); } } diff --git a/server/src/main/java/io/deephaven/server/config/ServerConfig.java b/server/src/main/java/io/deephaven/server/config/ServerConfig.java index 9db2b3a4467..d52d04313d3 100644 --- a/server/src/main/java/io/deephaven/server/config/ServerConfig.java +++ b/server/src/main/java/io/deephaven/server/config/ServerConfig.java @@ -8,6 +8,7 @@ import io.deephaven.ssl.config.SSLConfig; import org.immutables.value.Value.Default; +import javax.annotation.Nullable; import java.time.Duration; import java.util.Optional; @@ -32,6 +33,8 @@ public interface ServerConfig { String GRPC_MAX_INBOUND_MESSAGE_SIZE = "grpc.maxInboundMessageSize"; + String PROXY_HINT = "proxy.hint"; + /** * Parses the configuration values into the appropriate builder methods. * @@ -60,6 +63,10 @@ public interface ServerConfig { *

    * * + * + * + * + * *
    {@value GRPC_MAX_INBOUND_MESSAGE_SIZE}{@link Builder#maxInboundMessageSize(int)}
    {@value PROXY_HINT}{@link Builder#proxyHint(Boolean)}
    * * Also parses {@link Main#parseSSLConfig(Configuration)} into {@link Builder#ssl(SSLConfig)} and @@ -77,6 +84,7 @@ static > B buildFromConfig(B builder, Configuration conf int httpPort = config.getIntegerWithDefault(HTTP_PORT, -1); int schedulerPoolSize = config.getIntegerWithDefault(SCHEDULER_POOL_SIZE, -1); int maxInboundMessageSize = config.getIntegerWithDefault(GRPC_MAX_INBOUND_MESSAGE_SIZE, -1); + String proxyHint = config.getStringWithDefault(PROXY_HINT, null); if (httpSessionExpireMs > -1) { builder.tokenExpire(Duration.ofMillis(httpSessionExpireMs)); } @@ -92,6 +100,9 @@ static > B buildFromConfig(B builder, Configuration conf if (maxInboundMessageSize != -1) { builder.maxInboundMessageSize(maxInboundMessageSize); } + if (proxyHint != null) { + builder.proxyHint(Boolean.parseBoolean(proxyHint)); + } Main.parseSSLConfig(config).ifPresent(builder::ssl); Main.parseOutboundSSLConfig(config).ifPresent(builder::outboundSsl); return builder; @@ -142,6 +153,13 @@ default int maxInboundMessageSize() { return DEFAULT_MAX_INBOUND_MESSAGE_SIZE_MiB * 1024 * 1024; } + /** + * A hint that the server is running behind a proxy. This may allow consumers of the configuration to make more + * appropriate default choices. + */ + @Nullable + Boolean proxyHint(); + interface Builder> { B host(String host); @@ -157,6 +175,8 @@ interface Builder> { B maxInboundMessageSize(int maxInboundMessageSize); + B proxyHint(Boolean proxyHint); + T build(); } } From 2c59654362209d6ea61c351afb6dc04793b66fd7 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 1 Sep 2022 10:50:27 -0500 Subject: [PATCH 095/215] Rewire python<->java logging to be generally friendlier to python (#2763) Reworks how we handle logging between Java and Python, giving Python code more control over and more visibility into the stdout and stderr streams. These changes also make it possible to see the same logs in both the web UI and the python terminal, in the case of DHaaL from Python. Follow-up is required to address some inefficiency around PyObject's tools for calling methods, see #2793. For #2723, jpy-consortium/jpy#85 is also required, to deal with zero-length bytestrings. Fixes #2734 Partial #2723 --- .../io/logger/LogBufferOutputStream.java | 2 +- .../python/PyLogOutputStream.java | 49 ++++++++++ .../python/PythonDeephavenSession.java | 6 -- .../integrations/python/PythonLogAdapter.java | 66 -------------- .../table/python/core/deephaven_jpy_init.py | 9 +- py/embedded-server/deephaven_server/server.py | 9 +- .../python/server/EmbeddedPyLogModule.java | 49 ++++++++++ .../python/server/EmbeddedServer.java | 34 +++++++ py/server/deephaven_internal/stream.py | 91 +++++++++++++++++++ .../engine/util/WorkerPythonEnvironment.java | 3 - .../server/jetty/JettyServerComponent.java | 2 + .../server/netty/NettyServerComponent.java | 2 + ...avenApiServerInProcessGroovyComponent.java | 2 + ...avenApiServerInProcessPythonComponent.java | 2 + .../runner/DeephavenApiServerModule.java | 6 -- 15 files changed, 248 insertions(+), 84 deletions(-) create mode 100644 Integrations/src/main/java/io/deephaven/integrations/python/PyLogOutputStream.java delete mode 100644 Integrations/src/main/java/io/deephaven/integrations/python/PythonLogAdapter.java create mode 100644 py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedPyLogModule.java create mode 100644 py/server/deephaven_internal/stream.py diff --git a/IO/src/main/java/io/deephaven/io/logger/LogBufferOutputStream.java b/IO/src/main/java/io/deephaven/io/logger/LogBufferOutputStream.java index f7bdb455b8b..0829cca3306 100644 --- a/IO/src/main/java/io/deephaven/io/logger/LogBufferOutputStream.java +++ b/IO/src/main/java/io/deephaven/io/logger/LogBufferOutputStream.java @@ -10,7 +10,7 @@ import java.nio.ByteBuffer; import java.util.Objects; -class LogBufferOutputStream extends OutputStream { +public class LogBufferOutputStream extends OutputStream { private final LogBuffer sink; private final LogLevel level; diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PyLogOutputStream.java b/Integrations/src/main/java/io/deephaven/integrations/python/PyLogOutputStream.java new file mode 100644 index 00000000000..e8fee6b10ab --- /dev/null +++ b/Integrations/src/main/java/io/deephaven/integrations/python/PyLogOutputStream.java @@ -0,0 +1,49 @@ +package io.deephaven.integrations.python; + +import org.jetbrains.annotations.NotNull; +import org.jpy.PyObject; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.function.Supplier; + +/** + * Simple output stream that redirects all writes to a python io.TextIOBase type. + */ +public class PyLogOutputStream extends OutputStream { + private final Supplier rawIoBaseSupplier; + + public PyLogOutputStream(Supplier rawIoBaseSupplier) { + this.rawIoBaseSupplier = rawIoBaseSupplier; + } + + @Override + public void write(int i) throws IOException { + write(new byte[] {(byte) i}); + } + + @Override + public void write(@NotNull byte[] b) throws IOException { + // TODO (deephaven#2793) switch to modern method overloads when jpy#87 is fixed + rawIoBaseSupplier.get().callMethod("write", new String(b)); + } + + @Override + public void write(@NotNull byte[] b, int off, int len) throws IOException { + byte[] buffer = new byte[len]; + System.arraycopy(b, off, buffer, 0, len); + write(buffer); + } + + @Override + public void flush() throws IOException { + // TODO (deephaven#2793) switch to modern method overloads when jpy#87 is fixed + rawIoBaseSupplier.get().callMethod("flush"); + } + + @Override + public void close() throws IOException { + // TODO (deephaven#2793) switch to modern method overloads when jpy#87 is fixed + rawIoBaseSupplier.get().callMethod("close"); + } +} diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java index 51797293178..a7198b6f330 100644 --- a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java +++ b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java @@ -7,7 +7,6 @@ import io.deephaven.base.verify.Assert; import io.deephaven.configuration.Configuration; import io.deephaven.engine.exceptions.CancellationException; -import io.deephaven.engine.context.QueryLibrary; import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.AbstractScriptSession; @@ -93,11 +92,6 @@ public PythonDeephavenSession( } this.scriptFinder = new ScriptFinder(DEFAULT_SCRIPT_PATH); - /* - * We redirect the standard Python sys.stdout and sys.stderr streams to our log object. - */ - PythonLogAdapter.interceptOutputStreams(evaluator); - publishInitial(); /* diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PythonLogAdapter.java b/Integrations/src/main/java/io/deephaven/integrations/python/PythonLogAdapter.java deleted file mode 100644 index 78468defcc0..00000000000 --- a/Integrations/src/main/java/io/deephaven/integrations/python/PythonLogAdapter.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.integrations.python; - -import io.deephaven.engine.util.PythonEvaluator; - -import java.io.PrintStream; - -/** - * This class is stored in the sys.stdout and sys.stderr variables inside of a Python session, so that we can intercept - * the Python session's output, rather than having it all go to the system stdout/stderr streams, which are not - * accessible to the console. - */ -public class PythonLogAdapter { - private final PrintStream out; - - private PythonLogAdapter(PrintStream out) { - this.out = out; - } - - /** - * This method is used from Python so that we appear as a stream. - * - * We don't want to write the trailing newline, as the Logger implementation will do that for us. If there is no - * newline; we need to remember that we added one, so that we can suppress the next empty newline. If there was a - * newline, we shouldn't suppress it (e.g., when printing just a blank line to the output we need to preserve it). - * - * @param s the string to write - * @return the number of characters written - */ - public int write(String s) { - out.print(s); - return s.length(); - } - - /** - * https://docs.python.org/2/library/io.html#io.IOBase.flush - * https://github.com/python/cpython/blob/2.7/Modules/_io/iobase.c - */ - public void flush() { - out.flush(); - } - - // note: technically, we *should* be implementing the other methods present on stdout / stderr. - // but it's *very* unlikely that anybody will be calling most of the other methods. - // - // Maybe these? - // https://docs.python.org/2/library/io.html#io.RawIOBase.write - // https://docs.python.org/2/library/io.html#io.IOBase.close - - /** - * If we just allow python to print to it's regular STDOUT and STDERR, then it bypasses the Java System.out/err. - * - * We replace the stdout/stderr with a small log adapter so that console users still get their output. - * - * @param pythonHolder the PythonHolder object which we will insert our adapters into - */ - public static void interceptOutputStreams(PythonEvaluator pythonHolder) { - pythonHolder.set("_stdout", new PythonLogAdapter(System.out)); - pythonHolder.set("_stderr", new PythonLogAdapter(System.err)); - pythonHolder.evalStatement("import sys"); - pythonHolder.evalStatement("sys.stdout = _stdout"); - pythonHolder.evalStatement("sys.stderr = _stderr"); - } -} diff --git a/engine/table/python/core/deephaven_jpy_init.py b/engine/table/python/core/deephaven_jpy_init.py index e73e879c934..36158d942d0 100644 --- a/engine/table/python/core/deephaven_jpy_init.py +++ b/engine/table/python/core/deephaven_jpy_init.py @@ -2,10 +2,17 @@ import jpy import os +import sys +from deephaven_internal.stream import TeeStream -# Set stdin to /dev/null to prevent functions (like help()) that attempt to read from stdin from hanging the worker. +# Set stdin to /dev/null to prevent functions (like help()) that attempt to read from stdin from hanging python +# execution from within Java. os.dup2(os.open("/dev/null", os.O_RDONLY), 0) jpy.VerboseExceptions.enabled = True # If you want jpy to tell you about all that it is doing, change this # jpy.diag.flags = jpy.diag.F_ALL + +j_sys = jpy.get_type('java.lang.System') +sys.stdout = TeeStream.redirect(sys.stdout, j_sys.out) +sys.stderr = TeeStream.redirect(sys.stderr, j_sys.err) diff --git a/py/embedded-server/deephaven_server/server.py b/py/embedded-server/deephaven_server/server.py index 53fb3a53d07..58e5260a721 100644 --- a/py/embedded-server/deephaven_server/server.py +++ b/py/embedded-server/deephaven_server/server.py @@ -3,6 +3,7 @@ # from typing import Dict, List, Optional +import sys from .start_jvm import start_jvm @@ -39,9 +40,15 @@ def __init__(self, host: Optional[str] = None, port: Optional[int] = None, jvm_a # it is now safe to import jpy import jpy - # Create a wrapped java server that we can reference to talk to the platform + # Create a python-wrapped java server that we can reference to talk to the platform self.j_server = jpy.get_type('io.deephaven.python.server.EmbeddedServer')(host, port, dh_args) + # Obtain references to the deephaven logbuffer and redirect stdout/stderr to it. Note that we should not import + # this until after jpy has started. + from deephaven_internal.stream import TeeStream + sys.stdout = TeeStream.split(sys.stdout, self.j_server.getStdout()) + sys.stderr = TeeStream.split(sys.stderr, self.j_server.getStderr()) + # Keep a reference to the server so we know it is running Server.instance = self diff --git a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedPyLogModule.java b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedPyLogModule.java new file mode 100644 index 00000000000..903ae81fa27 --- /dev/null +++ b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedPyLogModule.java @@ -0,0 +1,49 @@ +package io.deephaven.python.server; + +import dagger.Module; +import dagger.Provides; +import dagger.multibindings.ElementsIntoSet; +import io.deephaven.base.system.StandardStreamState; +import io.deephaven.internal.log.InitSink; +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.log.LogSink; +import io.deephaven.io.logger.LogBuffer; +import io.deephaven.io.logger.LogBufferGlobal; +import io.deephaven.server.log.LogModule; + +import javax.inject.Singleton; +import java.util.Collections; +import java.util.ServiceLoader; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +@Module +public interface EmbeddedPyLogModule { + + @Provides + static LogBuffer providesLogBuffer() { + return LogBufferGlobal.getInstance().orElseThrow(() -> new RuntimeException("No global LogBuffer found")); + } + + @Provides + static LogSink providesLogSink() { + // In contract, this should be a singleton - see LogInit#checkLogSinkIsSingleton() + return LoggerFactory.getLogger(LogModule.class).getSink(); + } + + @Provides + @ElementsIntoSet + static Set providesLoggerSinkSetups() { + return StreamSupport + .stream(ServiceLoader.load(InitSink.class).spliterator(), false) + .collect(Collectors.toSet()); + } + + @Provides + @Singleton + static StandardStreamState providesStandardStreamState() { + return new StandardStreamState(Collections.emptySet()); + } + +} diff --git a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java index 5083c33d54b..a45d98be2c5 100644 --- a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java +++ b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java @@ -7,6 +7,10 @@ import dagger.Component; import io.deephaven.configuration.Configuration; import io.deephaven.engine.util.ScriptSession; +import io.deephaven.integrations.python.PyLogOutputStream; +import io.deephaven.io.log.LogLevel; +import io.deephaven.io.logger.LogBuffer; +import io.deephaven.io.logger.LogBufferOutputStream; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeModule; @@ -21,6 +25,7 @@ import io.deephaven.server.runner.DeephavenApiServerModule; import io.deephaven.server.runner.Main; import io.deephaven.server.util.Scheduler; +import org.jpy.PyModule; import org.jpy.PyObject; import javax.annotation.Nullable; @@ -28,11 +33,14 @@ import javax.inject.Provider; import javax.inject.Singleton; import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; public class EmbeddedServer { @Singleton @Component(modules = { DeephavenApiServerModule.class, + EmbeddedPyLogModule.class, DeephavenApiConfigModule.class, PythonGlobalScopeModule.class, HealthCheckModule.class, @@ -60,7 +68,19 @@ interface Builder extends DeephavenApiServerComponent.Builder scriptSession; + // // this is a nice idea, but won't work, since this is the same instance that we had to disable via sysprop + // @Inject + // StreamToLogBuffer logBuffer; + + @Inject + LogBuffer logBuffer; + public EmbeddedServer(String host, Integer port, PyObject dict) throws IOException { + // Redirect System.out and err to the python equivelents, in case python has (or will) redirected them. + PyModule sys = PyModule.importModule("sys"); + System.setOut(new PrintStream(new PyLogOutputStream(() -> sys.getAttribute("stdout")))); + System.setErr(new PrintStream(new PyLogOutputStream(() -> sys.getAttribute("stderr")))); + final Configuration config = Main.init(new String[0], EmbeddedServer.class); final Builder builder = JettyConfig.buildFromConfig(config); if (host != null) { @@ -113,4 +133,18 @@ private void checkGlobals(ScriptSession scriptSession, @Nullable ScriptSession.S public int getPort() { return server.server().getPort(); } + + /** + * Provide a way for Python to "tee" log output into the Deephaven log buffers. + */ + public OutputStream getStdout() { + return new LogBufferOutputStream(logBuffer, LogLevel.STDOUT, 256, 1 << 19); + } + + /** + * Provide a way for Python to "tee" log output into the Deephaven log buffers. + */ + public OutputStream getStderr() { + return new LogBufferOutputStream(logBuffer, LogLevel.STDERR, 256, 1 << 19); + } } diff --git a/py/server/deephaven_internal/stream.py b/py/server/deephaven_internal/stream.py new file mode 100644 index 00000000000..8daec2d2785 --- /dev/null +++ b/py/server/deephaven_internal/stream.py @@ -0,0 +1,91 @@ +import io + + +class TeeStream(io.TextIOBase): + """TextIOBase subclass that splits output between a delegate instance and a set of lambdas. + + Can delegate some calls to the provided stream but actually write only to the lambdas. Useful to adapt any existing + file-like object (such as sys.stdout or sys.stderr), but actually let some other processing take place before + writing. + """ + + @classmethod + def split(cls, py_stream, java_stream): + if hasattr(py_stream, "encoding"): + encoding = py_stream.encoding + else: + encoding = 'UTF-8' + return TeeStream( + orig_stream=py_stream, + should_write_to_orig_stream=True, + write_func=lambda t: java_stream.write(bytes(t, encoding)), + flush_func=lambda: java_stream.flush(), + close_func=lambda: java_stream.close() + ) + + @classmethod + def redirect(cls, py_stream, java_stream): + if hasattr(py_stream, "encoding"): + encoding = py_stream.encoding + else: + encoding = 'UTF-8' + return TeeStream( + orig_stream=py_stream, + should_write_to_orig_stream=False, + write_func=lambda t: java_stream.write(bytes(t, encoding)), + flush_func=lambda: java_stream.flush(), + close_func=lambda: java_stream.close() + ) + + def __init__(self, orig_stream, should_write_to_orig_stream, write_func, flush_func, close_func): + """Creates a new TeeStream to let output be written from out place, but be sent to multiple places. + + Ideally, the stream would be passed as more funcs, but we have to manage correctly propagating certain non-java + details like encoding and isatty. + + Args: + orig_stream: the underlying python stream to use as a prototype + should_write_to_orig_stream: True to delegate writes to the original stream, False to only write to the + lambdas that follow + write_func: a function to call when data should be written + flush_func: a function to call when data should be flushed + close_func: a function to call when the stream should be closed + """ + self._stream = orig_stream + self.should_write_to_orig_stream = should_write_to_orig_stream + self.write_func = write_func + self.flush_func = flush_func + self.close_func = close_func + + def isatty(self): + if not hasattr(self._stream, "isatty"): + return False + return self._stream.isatty() + + def fileno(self): + if not hasattr(self._stream, "fileno"): + return None + return self._stream.fileno() + + @property + def encoding(self): + if hasattr(self._stream, 'encoding') and self._stream.encoding is not None: + return self._stream.encoding + else: + return 'UTF-8' + + def write(self, string): + self.write_func(string) + if self.should_write_to_orig_stream: + self._stream.write(string) + + def flush(self): + self.flush_func() + if self.should_write_to_orig_stream: + self._stream.flush() + + def close(self): + super().close() + self.close_func() + if self.should_write_to_orig_stream: + self._stream.close() diff --git a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java index db506c45bb1..ee7232022d6 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java @@ -8,7 +8,6 @@ import io.deephaven.base.verify.Assert; import io.deephaven.configuration.Configuration; import io.deephaven.integrations.python.PythonDeephavenSession; -import io.deephaven.integrations.python.PythonLogAdapter; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.engine.context.QueryScope; @@ -65,8 +64,6 @@ public enum WorkerPythonEnvironment { .endl(); } - PythonLogAdapter.interceptOutputStreams(evaluator); - final String defaultScriptPath = Configuration.getInstance() .getProperty("WorkerPythonEnvironment.defaultScriptPath") .replace("", Configuration.getInstance().getDevRootPath()) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java index 8f69e50618b..3c052082e45 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java @@ -9,6 +9,7 @@ import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.deephaven.server.healthcheck.HealthCheckModule; +import io.deephaven.server.log.LogModule; import io.deephaven.server.plugin.python.PythonPluginsRegistration; import io.deephaven.server.runner.DeephavenApiConfigModule; import io.deephaven.server.runner.DeephavenApiServerComponent; @@ -19,6 +20,7 @@ @Singleton @Component(modules = { DeephavenApiServerModule.class, + LogModule.class, DeephavenApiConfigModule.class, PythonGlobalScopeCopyModule.class, HealthCheckModule.class, diff --git a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java index 392916cd630..3469794ac2b 100644 --- a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java +++ b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java @@ -9,6 +9,7 @@ import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.deephaven.server.healthcheck.HealthCheckModule; +import io.deephaven.server.log.LogModule; import io.deephaven.server.plugin.python.PythonPluginsRegistration; import io.deephaven.server.runner.DeephavenApiConfigModule; import io.deephaven.server.runner.DeephavenApiServerComponent; @@ -19,6 +20,7 @@ @Singleton @Component(modules = { DeephavenApiServerModule.class, + LogModule.class, DeephavenApiConfigModule.class, PythonGlobalScopeCopyModule.class, HealthCheckModule.class, diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java index 0f6e8b9eafd..4d61c51b3cf 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java @@ -6,6 +6,7 @@ import dagger.BindsInstance; import dagger.Component; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; +import io.deephaven.server.log.LogModule; import io.grpc.ManagedChannelBuilder; import javax.inject.Named; @@ -15,6 +16,7 @@ @Singleton @Component(modules = { DeephavenApiServerModule.class, + LogModule.class, GroovyConsoleSessionModule.class, ServerBuilderInProcessModule.class }) diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java index a8854915dc0..2cd576e51fe 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java @@ -7,6 +7,7 @@ import dagger.Component; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; +import io.deephaven.server.log.LogModule; import io.grpc.ManagedChannelBuilder; import javax.inject.Named; @@ -16,6 +17,7 @@ @Singleton @Component(modules = { DeephavenApiServerModule.class, + LogModule.class, PythonConsoleSessionModule.class, PythonGlobalScopeCopyModule.class, ServerBuilderInProcessModule.class diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java index a9f99cd28f5..a567f5f0e22 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java @@ -17,9 +17,6 @@ import io.deephaven.server.arrow.ArrowModule; import io.deephaven.server.auth.AuthContextModule; import io.deephaven.server.console.ConsoleModule; -import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; -import io.deephaven.server.console.python.PythonConsoleSessionModule; -import io.deephaven.server.log.LogModule; import io.deephaven.server.session.SessionModule; import io.deephaven.server.table.TableModule; import io.deephaven.server.table.inputtables.InputTableModule; @@ -28,8 +25,6 @@ import io.deephaven.util.process.ProcessEnvironment; import io.deephaven.util.thread.NamingThreadFactory; import io.grpc.BindableService; -import io.grpc.Server; -import io.grpc.ServerBuilder; import io.grpc.ServerInterceptor; import org.jetbrains.annotations.NotNull; @@ -53,7 +48,6 @@ AppModeModule.class, ArrowModule.class, AuthContextModule.class, - LogModule.class, UriModule.class, SessionModule.class, TableModule.class, From c895513b17298bb202b35806199cd2eefdaf2151 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Thu, 1 Sep 2022 15:28:35 -0600 Subject: [PATCH 096/215] change Table#getMeta to use Class#getCanonicalName for data type (#2796) --- .../deephaven/engine/table/impl/TableDefaults.java | 5 +++-- .../table/impl/preview/ColumnPreviewManager.java | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java index ced7a4bbb73..03dcd4b1019 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java @@ -58,11 +58,12 @@ default Table getMeta() { List columnGrouping = new ArrayList<>(); for (ColumnDefinition cDef : getDefinition().getColumns()) { columnNames.add(cDef.getName()); - columnDataTypes.add(cDef.getDataType().getName()); + final Class dataType = cDef.getDataType(); + final String dataTypeName = dataType.getCanonicalName(); + columnDataTypes.add(dataTypeName == null ? dataType.getName() : dataTypeName); columnTypes.add(cDef.getColumnType().name()); columnPartitioning.add(cDef.isPartitioning()); columnGrouping.add(cDef.isGrouping()); - } final String[] resultColumnNames = {"Name", "DataType", "ColumnType", "IsPartitioning", "IsGrouping"}; final Object[] resultValues = { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java index 0eaf0d1b542..0b7ac7470c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java @@ -85,27 +85,31 @@ public static Table applyPreview(final Table table) { for (String name : columns.keySet()) { final ColumnSource columnSource = columns.get(name); final Class type = columnSource.getType(); + String typeName = type.getCanonicalName(); + if (typeName == null) { + typeName = type.getName(); + } if (shouldPreview(type)) { final PreviewColumnFactory factory = previewMap.get(type); selectColumns.add(factory.makeColumn(name)); - originalTypes.put(name, type.getCanonicalName()); + originalTypes.put(name, typeName); } else if (Vector.class.isAssignableFrom(type)) { // Always wrap Vectors selectColumns.add(vectorPreviewFactory.makeColumn(name)); - originalTypes.put(name, type.getCanonicalName()); + originalTypes.put(name, typeName); } else if (PyListWrapper.class.isAssignableFrom(type)) { // Always wrap PyListWrapper selectColumns.add(pyListWrapperPreviewFactory.makeColumn(name)); - originalTypes.put(name, type.getCanonicalName()); + originalTypes.put(name, typeName); } else if (type.isArray()) { // Always wrap arrays selectColumns.add(arrayPreviewFactory.makeColumn(name)); - originalTypes.put(name, type.getCanonicalName()); + originalTypes.put(name, typeName); } else if (!isColumnTypeDisplayable(type) || !io.deephaven.util.type.TypeUtils.isPrimitiveOrSerializable(type)) { // Always wrap non-displayable and non-serializable types selectColumns.add(nonDisplayableFactory.makeColumn(name)); - originalTypes.put(name, type.getCanonicalName()); + originalTypes.put(name, typeName); } } From 15e528cf61bafa56078bca0680149acd04633040 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 2 Sep 2022 12:54:36 -0400 Subject: [PATCH 097/215] Web version bump to v0.16.0, embeddable iframe for charts (#2798) - Web version bump to v0.16.0 - Pull in the embed-chart package to embed charts into iframes, similar to functionality we already have for tables - Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.16.0 --- web/client-ui/Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 63e8e9752e2..9e20265fcf2 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.15.6 +ARG WEB_VERSION=0.16.0 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ @@ -15,7 +15,16 @@ RUN set -eux; \ RUN set -eux; \ npm pack @deephaven/embed-grid@${WEB_VERSION}; \ tar --touch -xf deephaven-embed-grid-${WEB_VERSION}.tgz; \ - mkdir iframe; \ + mkdir -p iframe; \ mv package/build iframe/table; \ rm -r package; \ rm deephaven-embed-grid-${WEB_VERSION}.tgz; + +# Pull in the published embed-chart package from npmjs and extract is +RUN set -eux; \ + npm pack @deephaven/embed-chart@${WEB_VERSION}; \ + tar --touch -xf deephaven-embed-chart-${WEB_VERSION}.tgz; \ + mkdir -p iframe; \ + mv package/build iframe/chart; \ + rm -r package; \ + rm deephaven-embed-chart-${WEB_VERSION}.tgz; From 508260d26102318d88c4b3764e51780be99c35af Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Fri, 2 Sep 2022 14:52:57 -0600 Subject: [PATCH 098/215] Reinterpret the ColumnSource prior to creating empty stream generator (#2799) --- .../table/impl/remote/ConstructSnapshot.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java index 57fe2ad23e3..9b76f99572b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java @@ -752,9 +752,9 @@ public boolean snapshotConsistent(long currentClockValue, boolean usingPreviousV * Make a {@link SnapshotControl} from individual function objects. * * @param usePreviousValues The {@link UsePreviousValues} to use - * + * * @param snapshotConsistent The {@link SnapshotConsistent} to use - * + * * @param snapshotCompletedConsistently The {@link SnapshotCompletedConsistently} to use, or null to use * {@code * snapshotConsistent} */ @@ -1341,19 +1341,19 @@ public static boolean serializeAllTable(final boolean usePrev, final RowSet rows = columnIsEmpty ? RowSetFactory.empty() : snapshot.rowsIncluded; // Note: cannot use shared context across several calls of differing lengths and no sharing necessary // when empty - acd.data = - getSnapshotDataAsChunkList(columnSource, columnIsEmpty ? null : sharedContext, rows, usePrev); - acd.type = columnSource.getType(); - acd.componentType = columnSource.getComponentType(); - acd.chunkType = columnSource.getChunkType(); + final ColumnSource sourceToUse = ReinterpretUtils.maybeConvertToPrimitive(columnSource); + acd.data = getSnapshotDataAsChunkList(sourceToUse, columnIsEmpty ? null : sharedContext, rows, usePrev); + acd.type = sourceToUse.getType(); + acd.componentType = sourceToUse.getComponentType(); + acd.chunkType = sourceToUse.getChunkType(); final BarrageMessage.ModColumnData mcd = new BarrageMessage.ModColumnData(); snapshot.modColumnData[ii] = mcd; mcd.rowsModified = RowSetFactory.empty(); - mcd.data = getSnapshotDataAsChunkList(columnSource, null, RowSetFactory.empty(), usePrev); + mcd.data = getSnapshotDataAsChunkList(sourceToUse, null, RowSetFactory.empty(), usePrev); mcd.type = acd.type; mcd.componentType = acd.componentType; - mcd.chunkType = columnSource.getChunkType(); + mcd.chunkType = sourceToUse.getChunkType(); } } @@ -1436,7 +1436,6 @@ private static WritableChunk getSnapshotDataAsChunk(final ColumnSour private static ArrayList> getSnapshotDataAsChunkList(final ColumnSource columnSource, final SharedContext sharedContext, final RowSet rowSet, final boolean usePrev) { - final ColumnSource sourceToUse = ReinterpretUtils.maybeConvertToPrimitive(columnSource); long offset = 0; final long size = rowSet.size(); final ArrayList> result = new ArrayList<>(); @@ -1447,20 +1446,20 @@ private static ArrayList> getSnapshotDataAsChunkList(final Col final int maxChunkSize = (int) Math.min(size, SNAPSHOT_CHUNK_SIZE); - try (final ColumnSource.FillContext context = sourceToUse.makeFillContext(maxChunkSize, sharedContext); + try (final ColumnSource.FillContext context = columnSource.makeFillContext(maxChunkSize, sharedContext); final RowSequence.Iterator it = rowSet.getRowSequenceIterator()) { int chunkSize = maxChunkSize; while (it.hasMore()) { final RowSequence reducedRowSet = it.getNextRowSequenceWithLength(chunkSize); - final ChunkType chunkType = sourceToUse.getChunkType(); + final ChunkType chunkType = columnSource.getChunkType(); // create a new chunk WritableChunk currentChunk = chunkType.makeWritableChunk(chunkSize); if (usePrev) { - sourceToUse.fillPrevChunk(context, currentChunk, reducedRowSet); + columnSource.fillPrevChunk(context, currentChunk, reducedRowSet); } else { - sourceToUse.fillChunk(context, currentChunk, reducedRowSet); + columnSource.fillChunk(context, currentChunk, reducedRowSet); } // add the chunk to the current list From 21f4208c3e577ce891278ff372554b3b3c628b76 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 2 Sep 2022 15:28:39 -0700 Subject: [PATCH 099/215] Gc Application (#2795) --- .../stream/StreamFailureConsumer.java | 2 +- .../stream/StreamToTableAdapter.java | 6 +- .../java/io/deephaven/kafka/KafkaTools.java | 2 +- .../deephaven/kafka/ingest/KafkaIngester.java | 6 +- plugin/gc-app/build.gradle | 11 + plugin/gc-app/gradle.properties | 1 + .../java/io/deephaven/app/GcApplication.java | 216 ++++++++++++++++++ .../app/GcNotificationPublisher.java | 130 +++++++++++ .../io/deephaven/app/GcPoolsPublisher.java | 167 ++++++++++++++ server/build.gradle | 1 + server/jetty-app/build.gradle | 4 + server/netty-app/build.gradle | 4 + settings.gradle | 3 + 13 files changed, 545 insertions(+), 8 deletions(-) create mode 100644 plugin/gc-app/build.gradle create mode 100644 plugin/gc-app/gradle.properties create mode 100644 plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java create mode 100644 plugin/gc-app/src/main/java/io/deephaven/app/GcNotificationPublisher.java create mode 100644 plugin/gc-app/src/main/java/io/deephaven/app/GcPoolsPublisher.java diff --git a/engine/table/src/main/java/io/deephaven/stream/StreamFailureConsumer.java b/engine/table/src/main/java/io/deephaven/stream/StreamFailureConsumer.java index f5eeb3bcb29..5c4ae8e5d2f 100644 --- a/engine/table/src/main/java/io/deephaven/stream/StreamFailureConsumer.java +++ b/engine/table/src/main/java/io/deephaven/stream/StreamFailureConsumer.java @@ -14,5 +14,5 @@ public interface StreamFailureConsumer { * * @param cause the cause of the error */ - void acceptFailure(@NotNull Exception cause); + void acceptFailure(@NotNull Throwable cause); } diff --git a/engine/table/src/main/java/io/deephaven/stream/StreamToTableAdapter.java b/engine/table/src/main/java/io/deephaven/stream/StreamToTableAdapter.java index e0ead4c3362..e580ac75182 100644 --- a/engine/table/src/main/java/io/deephaven/stream/StreamToTableAdapter.java +++ b/engine/table/src/main/java/io/deephaven/stream/StreamToTableAdapter.java @@ -65,7 +65,7 @@ public class StreamToTableAdapter extends ReferenceCountedLivenessNode private ChunkColumnSource[] prevChunkSources; /** A list of failures that have occurred. */ - private List enqueuedFailure; + private List enqueuedFailure; private volatile QueryTable table; private volatile Runnable shutdownCallback; @@ -306,7 +306,7 @@ private void doRefresh() { throw new UncheckedDeephavenException( MultiException.maybeWrapInMultiException( "Multiple errors encountered while ingesting stream", - enqueuedFailure.toArray(new Exception[0]))); + enqueuedFailure.toArray(new Throwable[0]))); } } @@ -386,7 +386,7 @@ public final void accept(@NotNull final WritableChunk... data) { } @Override - public void acceptFailure(@NotNull Exception cause) { + public void acceptFailure(@NotNull Throwable cause) { if (!alive) { return; } diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java b/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java index 2eb1c8cb49c..5055ea2c04b 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java @@ -2168,7 +2168,7 @@ public void accept(List> consumerRecords) { } @Override - public void acceptFailure(@NotNull Exception cause) { + public void acceptFailure(@NotNull Throwable cause) { streamToTableAdapter.acceptFailure(cause); } } diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/KafkaIngester.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/KafkaIngester.java index b7dfff5d48b..9c7c432b3f0 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/KafkaIngester.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/KafkaIngester.java @@ -157,7 +157,7 @@ public String toString() { * @param partitionToStreamConsumer A function implementing a mapping from partition to its consumer of records. The * function will be invoked once per partition at construction; implementations should internally defer * resource allocation until first call to {@link KafkaStreamConsumer#accept(Object)} or - * {@link KafkaStreamConsumer#acceptFailure(Exception)} if appropriate. + * {@link KafkaStreamConsumer#acceptFailure(Throwable)} if appropriate. * @param partitionToInitialSeekOffset A function implementing a mapping from partition to its initial seek offset, * or -1 if seek to beginning is intended. */ @@ -186,7 +186,7 @@ public KafkaIngester(final Logger log, * @param partitionToStreamConsumer A function implementing a mapping from partition to its consumer of records. The * function will be invoked once per partition at construction; implementations should internally defer * resource allocation until first call to {@link KafkaStreamConsumer#accept(Object)} or - * {@link KafkaStreamConsumer#acceptFailure(Exception)} if appropriate. + * {@link KafkaStreamConsumer#acceptFailure(Throwable)} if appropriate. * @param partitionToInitialSeekOffset A function implementing a mapping from partition to its initial seek offset, * or -1 if seek to beginning is intended. */ @@ -330,7 +330,7 @@ private boolean pollOnce(final Duration timeout) { try { streamConsumer.accept(partitionRecords); - } catch (Exception ex) { + } catch (Throwable ex) { ++messagesWithErr; log.error().append(logPrefix).append("Exception while processing Kafka message:").append(ex).endl(); if (messagesWithErr > MAX_ERRS) { diff --git a/plugin/gc-app/build.gradle b/plugin/gc-app/build.gradle new file mode 100644 index 00000000000..bcf83372a75 --- /dev/null +++ b/plugin/gc-app/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'io.deephaven.project.register' + id 'java-library' +} + +dependencies { + api project(':application-mode') + implementation project(':engine-table') + + Classpaths.inheritAutoService(project) +} diff --git a/plugin/gc-app/gradle.properties b/plugin/gc-app/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/plugin/gc-app/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java b/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java new file mode 100644 index 00000000000..571c7818c84 --- /dev/null +++ b/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java @@ -0,0 +1,216 @@ +package io.deephaven.app; + +import com.google.auto.service.AutoService; +import com.sun.management.GarbageCollectionNotificationInfo; +import io.deephaven.appmode.ApplicationState; +import io.deephaven.appmode.ApplicationState.Listener; +import io.deephaven.engine.liveness.LivenessScope; +import io.deephaven.engine.liveness.LivenessScopeStack; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.sources.ring.RingTableTools; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.stream.StreamToTableAdapter; +import io.deephaven.util.SafeCloseable; + +import javax.management.ListenerNotFoundException; +import javax.management.Notification; +import javax.management.NotificationBroadcaster; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.openmbean.CompositeData; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; + +import static com.sun.management.GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION; + +/** + * The {@value APP_NAME}, application id {@value APP_ID}, produces stream {@link io.deephaven.engine.table.Table tables} + * {@value NOTIFICATION_INFO} and {@value POOLS}; and derived tables {@value NOTIFICATION_INFO_STATS}, + * {@value NOTIFICATION_INFO_RING}, and {@value POOLS_STATS}. This data is modeled after the + * {@link GarbageCollectionNotificationInfo} event information from + * {@link ManagementFactory#getGarbageCollectorMXBeans()}. + * + * @see #enabled() + * @see #notificationInfoEnabled() + * @see #poolsEnabled() + * @see #notificationInfoStatsEnabled() + * @see #notificationInfoRingSize() + * @see #poolStatsEnabled() + */ +@AutoService(ApplicationState.Factory.class) +public final class GcApplication implements ApplicationState.Factory, NotificationListener { + + private static final String APP_ID = "io.deephaven.app.GcApplication"; + private static final String APP_NAME = "Garbage-Collection Application"; + private static final String NOTIFICATION_INFO = "notification_info"; + private static final String NOTIFICATION_INFO_STATS = "notification_info_stats"; + private static final String NOTIFICATION_INFO_RING = "notification_info_ring"; + private static final String POOLS = "pools"; + private static final String POOLS_STATS = "pools_stats"; + + private static final String ENABLED = "io.deephaven.app.GcApplication.enabled"; + private static final String NOTIFICATION_INFO_ENABLED = "io.deephaven.app.GcApplication.notification_info.enabled"; + private static final String NOTIFICATION_INFO_STATS_ENABLED = + "io.deephaven.app.GcApplication.notification_info_stats.enabled"; + private static final String NOTIFICATION_INFO_RING_ENABLED = + "io.deephaven.app.GcApplication.notification_info_ring.enabled"; + private static final String POOLS_ENABLED = "io.deephaven.app.GcApplication.pools.enabled"; + private static final String POOLS_STATS_ENABLED = "io.deephaven.app.GcApplication.pools_stats.enabled"; + + /** + * Looks up the system property {@value ENABLED}, defaults to {@code false}. + * + * @return if the GC application is enabled + */ + private static boolean enabled() { + // Note: this is off-by-default until the Web UI has been updated to better handle on-by-default applications. + return "true".equalsIgnoreCase(System.getProperty(ENABLED)); + } + + /** + * Looks up the system property {@value NOTIFICATION_INFO_ENABLED}, defaults to {@code true}. + * + * @return if {@value NOTIFICATION_INFO} table is enabled + */ + public static boolean notificationInfoEnabled() { + return "true".equalsIgnoreCase(System.getProperty(NOTIFICATION_INFO_ENABLED, "true")); + } + + /** + * Looks up the system property {@value NOTIFICATION_INFO_STATS_ENABLED}, defaults to {@code true}. + * + * @return if {@value NOTIFICATION_INFO_STATS} table is enabled + */ + public static boolean notificationInfoStatsEnabled() { + return "true".equalsIgnoreCase(System.getProperty(NOTIFICATION_INFO_STATS_ENABLED, "true")); + } + + /** + * Looks up the system property {@value NOTIFICATION_INFO_RING_ENABLED}, defaults to {@code 1024}. The + * {@value NOTIFICATION_INFO_RING} table is disabled when {@code 0} or less. + * + * @return the {@value NOTIFICATION_INFO_RING} table size + */ + public static int notificationInfoRingSize() { + return Integer.getInteger(NOTIFICATION_INFO_RING_ENABLED, 1024); + } + + /** + * Looks up the system property {@value POOLS_ENABLED}, defaults to {@code true}. + * + * @return if {@value POOLS} table is enabled + */ + public static boolean poolsEnabled() { + return "true".equalsIgnoreCase(System.getProperty(POOLS_ENABLED, "true")); + } + + /** + * Looks up the system property {@value POOLS_STATS_ENABLED}, defaults to {@code true}. + * + * @return if {@value POOLS_STATS} table is enabled + */ + public static boolean poolStatsEnabled() { + return "true".equalsIgnoreCase(System.getProperty(POOLS_STATS_ENABLED, "true")); + } + + private GcNotificationPublisher notificationInfoPublisher; + private GcPoolsPublisher poolsPublisher; + @SuppressWarnings("FieldCanBeLocal") + private LivenessScope scope; + + @Override + public void handleNotification(Notification notification, Object handback) { + try { + final GarbageCollectionNotificationInfo info = + GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()); + notificationInfoPublisher.add(info); + poolsPublisher.add(info.getGcInfo()); + } catch (Throwable t) { + notificationInfoPublisher.acceptFailure(t); + poolsPublisher.acceptFailure(t); + try { + remove(); + } catch (ListenerNotFoundException e) { + t.addSuppressed(e); + } + throw t; + } + } + + @Override + public ApplicationState create(Listener listener) { + final ApplicationState state = new ApplicationState(listener, APP_ID, APP_NAME); + if (!enabled()) { + return state; + } + final boolean notificationInfoEnabled = notificationInfoEnabled(); + final boolean poolsEnabled = poolsEnabled(); + if (!notificationInfoEnabled() && !poolsEnabled()) { + return state; + } + scope = new LivenessScope(); + try (final SafeCloseable ignored = LivenessScopeStack.open(scope, false)) { + if (notificationInfoEnabled) { + setNotificationInfo(state); + } + if (poolsEnabled) { + setPools(state); + } + } + install(); + return state; + } + + private void setNotificationInfo(ApplicationState state) { + notificationInfoPublisher = new GcNotificationPublisher(); + final StreamToTableAdapter adapter = new StreamToTableAdapter(GcNotificationPublisher.definition(), + notificationInfoPublisher, UpdateGraphProcessor.DEFAULT, NOTIFICATION_INFO); + final Table notificationInfo = adapter.table(); + state.setField(NOTIFICATION_INFO, notificationInfo); + if (notificationInfoStatsEnabled()) { + state.setField(NOTIFICATION_INFO_STATS, GcNotificationPublisher.stats(notificationInfo)); + } + final int ringSize = notificationInfoRingSize(); + if (ringSize > 0) { + state.setField(NOTIFICATION_INFO_RING, RingTableTools.of(notificationInfo, ringSize)); + } + } + + private void setPools(ApplicationState state) { + poolsPublisher = new GcPoolsPublisher(); + final StreamToTableAdapter adapter = new StreamToTableAdapter(GcPoolsPublisher.definition(), poolsPublisher, + UpdateGraphProcessor.DEFAULT, POOLS); + final Table pools = adapter.table(); + state.setField(POOLS, pools); + if (poolStatsEnabled()) { + state.setField(POOLS_STATS, GcPoolsPublisher.stats(pools)); + } + } + + private void install() { + for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) { + if (!(bean instanceof NotificationBroadcaster)) { + continue; + } + ((NotificationBroadcaster) bean).addNotificationListener(this, GcNotificationFilter.INSTANCE, null); + } + } + + private void remove() throws ListenerNotFoundException { + for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) { + if (!(bean instanceof NotificationBroadcaster)) { + continue; + } + ((NotificationBroadcaster) bean).removeNotificationListener(this); + } + } + + private enum GcNotificationFilter implements NotificationFilter { + INSTANCE; + + @Override + public boolean isNotificationEnabled(Notification notification) { + return GARBAGE_COLLECTION_NOTIFICATION.equals(notification.getType()); + } + } +} diff --git a/plugin/gc-app/src/main/java/io/deephaven/app/GcNotificationPublisher.java b/plugin/gc-app/src/main/java/io/deephaven/app/GcNotificationPublisher.java new file mode 100644 index 00000000000..474b2981c45 --- /dev/null +++ b/plugin/gc-app/src/main/java/io/deephaven/app/GcNotificationPublisher.java @@ -0,0 +1,130 @@ +package io.deephaven.app; + +import com.sun.management.GarbageCollectionNotificationInfo; +import com.sun.management.GcInfo; +import io.deephaven.api.agg.Aggregation; +import io.deephaven.api.agg.util.PercentileOutput; +import io.deephaven.chunk.WritableChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.table.ColumnDefinition; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.TableDefinition; +import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; +import io.deephaven.stream.StreamConsumer; +import io.deephaven.stream.StreamPublisher; +import io.deephaven.stream.StreamToTableAdapter; +import io.deephaven.time.DateTimeUtils; +import org.jetbrains.annotations.NotNull; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryUsage; +import java.util.Arrays; +import java.util.Objects; + +final class GcNotificationPublisher implements StreamPublisher { + + private static final TableDefinition DEFINITION = TableDefinition.of( + ColumnDefinition.ofLong("Id"), + ColumnDefinition.ofTime("Start"), + ColumnDefinition.ofTime("End"), + ColumnDefinition.ofString("GcName"), + ColumnDefinition.ofString("GcAction"), + ColumnDefinition.ofString("GcCause"), + ColumnDefinition.ofLong("Reclaimed")); + private static final int CHUNK_SIZE = ArrayBackedColumnSource.BLOCK_SIZE; + + public static TableDefinition definition() { + return DEFINITION; + } + + public static Table stats(Table notificationInfo) { + // Would be great to have a aggBy Exponential Decayed Sum so we could have "GC rate over the last 1, 5, 15 min" + // Could further extend with updateBy Exponential Decayed Sum and graphs of rates. + return notificationInfo + .updateView("Duration=(End-Start)/1000000000") + .aggBy(Arrays.asList( + Aggregation.AggCount("Count"), + Aggregation.AggSum("DurationTotal=Duration", "ReclaimedTotal=Reclaimed"), + Aggregation.AggMax("DurationMax=Duration"), + Aggregation.AggAvg("DurationAvg=Duration", "ReclaimedAvg=Reclaimed"), + Aggregation.AggApproxPct("Reclaimed", + PercentileOutput.of(0.5, "ReclaimedP_50")), + Aggregation.AggApproxPct("Duration", + PercentileOutput.of(0.5, "DurationP_50"), + PercentileOutput.of(0.9, "DurationP_90"), + PercentileOutput.of(0.95, "DurationP_95"), + PercentileOutput.of(0.99, "DurationP_99")), + Aggregation.AggLast( + "LastId=Id", + "LastStart=Start", + "LastEnd=End", + "LastReclaimed=Reclaimed")), + "GcName", "GcAction", "GcCause"); + } + + private final long vmStartMillis; + private WritableChunk[] chunks; + private StreamConsumer consumer; + + GcNotificationPublisher() { + this.vmStartMillis = ManagementFactory.getRuntimeMXBean().getStartTime(); + // noinspection unchecked + chunks = StreamToTableAdapter.makeChunksForDefinition(DEFINITION, CHUNK_SIZE); + } + + @Override + public void register(@NotNull StreamConsumer consumer) { + if (this.consumer != null) { + throw new IllegalStateException("Can not register multiple StreamConsumers."); + } + this.consumer = Objects.requireNonNull(consumer); + } + + public synchronized void add(GarbageCollectionNotificationInfo gcNotification) { + final GcInfo gcInfo = gcNotification.getGcInfo(); + + // Note: there's potential for possible further optimization by having a typed field per column (ie, doing the + // casts only once per flush). Also, potential to use `set` with our own size field instead of `add`. + chunks[0].asWritableLongChunk().add(gcInfo.getId()); + chunks[1].asWritableLongChunk().add(DateTimeUtils.millisToNanos(vmStartMillis + gcInfo.getStartTime())); + chunks[2].asWritableLongChunk().add(DateTimeUtils.millisToNanos(vmStartMillis + gcInfo.getEndTime())); + + // Note: there may be value in interning these strings for ring tables if we find they are causing a lot of + // extra memory usage. + chunks[3].asWritableObjectChunk().add(gcNotification.getGcName()); + chunks[4].asWritableObjectChunk().add(gcNotification.getGcAction()); + chunks[5].asWritableObjectChunk().add(gcNotification.getGcCause()); + + // This is a bit of a de-normalization - arguably, it could be computed by joining against the "pools" table. + // But this is a very useful summary value, and easy for use to provide here for more convenience. + final long usedBefore = gcNotification.getGcInfo().getMemoryUsageBeforeGc().values().stream() + .mapToLong(MemoryUsage::getUsed).sum(); + final long usedAfter = gcNotification.getGcInfo().getMemoryUsageAfterGc().values().stream() + .mapToLong(MemoryUsage::getUsed).sum(); + // Note: reclaimed *can* be negative + final long reclaimed = usedBefore - usedAfter; + chunks[6].asWritableLongChunk().add(reclaimed); + + if (chunks[0].size() == CHUNK_SIZE) { + flushInternal(); + } + } + + @Override + public synchronized void flush() { + if (chunks[0].size() == 0) { + return; + } + flushInternal(); + } + + private void flushInternal() { + consumer.accept(chunks); + // noinspection unchecked + chunks = StreamToTableAdapter.makeChunksForDefinition(DEFINITION, CHUNK_SIZE); + } + + public void acceptFailure(Throwable e) { + consumer.acceptFailure(e); + } +} diff --git a/plugin/gc-app/src/main/java/io/deephaven/app/GcPoolsPublisher.java b/plugin/gc-app/src/main/java/io/deephaven/app/GcPoolsPublisher.java new file mode 100644 index 00000000000..c2005405e7b --- /dev/null +++ b/plugin/gc-app/src/main/java/io/deephaven/app/GcPoolsPublisher.java @@ -0,0 +1,167 @@ +package io.deephaven.app; + +import com.sun.management.GcInfo; +import io.deephaven.api.agg.Aggregation; +import io.deephaven.api.agg.util.PercentileOutput; +import io.deephaven.chunk.WritableChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.table.ColumnDefinition; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.TableDefinition; +import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; +import io.deephaven.stream.StreamConsumer; +import io.deephaven.stream.StreamPublisher; +import io.deephaven.stream.StreamToTableAdapter; +import io.deephaven.util.QueryConstants; +import org.jetbrains.annotations.NotNull; + +import java.lang.management.MemoryUsage; +import java.util.Arrays; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; + +final class GcPoolsPublisher implements StreamPublisher { + + private static final TableDefinition DEFINITION = TableDefinition.of( + ColumnDefinition.ofLong("Id"), + ColumnDefinition.ofString("Name"), + ColumnDefinition.ofLong("BeforeInit"), + ColumnDefinition.ofLong("BeforeUsed"), + ColumnDefinition.ofLong("BeforeCommitted"), + ColumnDefinition.ofLong("BeforeMax"), + ColumnDefinition.ofLong("AfterInit"), + ColumnDefinition.ofLong("AfterUsed"), + ColumnDefinition.ofLong("AfterCommitted"), + ColumnDefinition.ofLong("AfterMax")); + + private static final int INITIAL_CHUNK_SIZE = ArrayBackedColumnSource.BLOCK_SIZE; + + public static TableDefinition definition() { + return DEFINITION; + } + + public static Table stats(Table pools) { + return pools + .updateView( + "UsedReclaimed=BeforeUsed-AfterUsed", + "CommittedReclaimed=BeforeCommitted-AfterCommitted") + .aggBy(Arrays.asList( + Aggregation.AggCount("Count"), + Aggregation.AggSum( + "UsedReclaimedTotal=UsedReclaimed", + "CommittedReclaimedTotal=CommittedReclaimed"), + Aggregation.AggAvg( + "UsedReclaimedAvg=UsedReclaimed", + "CommittedReclaimedAvg=CommittedReclaimed"), + Aggregation.AggApproxPct("UsedReclaimed", + PercentileOutput.of(0.5, "UsedReclaimedP_50")), + Aggregation.AggApproxPct("CommittedReclaimed", + PercentileOutput.of(0.5, "CommittedReclaimedP_50")), + Aggregation.AggLast( + "BeforeInit", + "BeforeUsed", + "BeforeCommitted", + "BeforeMax", + "AfterInit", + "AfterUsed", + "AfterCommitted", + "AfterMax")), + "Name"); + } + + private int chunkSize; + private WritableChunk[] chunks; + private StreamConsumer consumer; + private boolean isFirst; + + GcPoolsPublisher() { + chunkSize = INITIAL_CHUNK_SIZE; + // noinspection unchecked + chunks = StreamToTableAdapter.makeChunksForDefinition(DEFINITION, chunkSize); + isFirst = true; + } + + @Override + public void register(@NotNull StreamConsumer consumer) { + if (this.consumer != null) { + throw new IllegalStateException("Can not register multiple StreamConsumers."); + } + this.consumer = Objects.requireNonNull(consumer); + } + + public synchronized void add(GcInfo info) { + final Map afterMap = info.getMemoryUsageAfterGc(); + final int poolSize = afterMap.size(); + final int initialSize = chunks[0].size(); + // Note: we don't expect this to trigger since we are checking the size after the add, but it's an extra + // safety if a JVM implementation adds additional pools types during runtime. + if (initialSize + poolSize >= chunkSize) { + maybeFlushAndGrow(initialSize, poolSize); + } + for (Entry e : info.getMemoryUsageBeforeGc().entrySet()) { + final String poolName = e.getKey(); + final MemoryUsage before = e.getValue(); + final MemoryUsage after = afterMap.get(poolName); + if (!isFirst && equals(before, after)) { + continue; + } + // Note: there's potential for possible further optimization by having a typed field per column (ie, doing + // the casts only once per flush). Also, potential to use `set` with our own size field instead of `add`. + chunks[0].asWritableLongChunk().add(info.getId()); + chunks[1].asWritableObjectChunk().add(poolName); + + chunks[2].asWritableLongChunk().add(negativeOneToNullLong(before.getInit())); + chunks[3].asWritableLongChunk().add(before.getUsed()); + chunks[4].asWritableLongChunk().add(before.getCommitted()); + chunks[5].asWritableLongChunk().add(negativeOneToNullLong(before.getMax())); + + chunks[6].asWritableLongChunk().add(negativeOneToNullLong(after.getInit())); + chunks[7].asWritableLongChunk().add(after.getUsed()); + chunks[8].asWritableLongChunk().add(after.getCommitted()); + chunks[9].asWritableLongChunk().add(negativeOneToNullLong(after.getMax())); + } + isFirst = false; + if (initialSize + 2 * poolSize >= chunkSize) { + flushInternal(); + } + } + + @Override + public synchronized void flush() { + if (chunks[0].size() == 0) { + return; + } + flushInternal(); + } + + private void maybeFlushAndGrow(int initialSize, int poolSize) { + if (initialSize > 0) { + consumer.accept(chunks); + } + chunkSize = Math.max(chunkSize, poolSize); + // noinspection unchecked + chunks = StreamToTableAdapter.makeChunksForDefinition(DEFINITION, chunkSize); + } + + private void flushInternal() { + consumer.accept(chunks); + // noinspection unchecked + chunks = StreamToTableAdapter.makeChunksForDefinition(DEFINITION, chunkSize); + } + + public void acceptFailure(Throwable e) { + consumer.acceptFailure(e); + } + + private static boolean equals(MemoryUsage before, MemoryUsage after) { + return before.getUsed() == after.getUsed() + && before.getCommitted() == after.getCommitted() + && before.getMax() == after.getMax() + && before.getInit() == after.getInit(); + } + + private static long negativeOneToNullLong(long x) { + return x == -1 ? QueryConstants.NULL_LONG : x; + } +} diff --git a/server/build.gradle b/server/build.gradle index a3bec8d2e0c..cea162cb44e 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -69,6 +69,7 @@ dependencies { runtimeOnly project(':plugin-figure') runtimeOnly project(':plugin-partitionedtable') + runtimeOnly project(':plugin-gc-app') Classpaths.inheritGrpcPlatform(project, 'api') diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index e19716b9d56..45692d9c810 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -61,6 +61,10 @@ if (hasProperty('debug')) { extraJvmArgs += ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'] } +if (hasProperty('gcApplication')) { + extraJvmArgs += ['-Dio.deephaven.app.GcApplication.enabled=true'] +} + tasks.withType(JavaExec).configureEach { // This appends to the existing jvm args, so that java-open-nio still takes effect jvmArgs extraJvmArgs diff --git a/server/netty-app/build.gradle b/server/netty-app/build.gradle index 0df87ce4857..7d2286fe438 100644 --- a/server/netty-app/build.gradle +++ b/server/netty-app/build.gradle @@ -61,6 +61,10 @@ if (hasProperty('debug')) { extraJvmArgs += ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'] } +if (hasProperty('gcApplication')) { + extraJvmArgs += ['-Dio.deephaven.app.GcApplication.enabled=true'] +} + tasks.withType(JavaExec).configureEach { // This appends to the existing jvm args, so that java-open-nio still takes effect jvmArgs extraJvmArgs diff --git a/settings.gradle b/settings.gradle index 493a58c4508..05d00f72c3e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -233,6 +233,9 @@ project(':plugin-figure').projectDir = file('plugin/figure') include(':plugin-partitionedtable') project(':plugin-partitionedtable').projectDir = file('plugin/partitionedtable') +include(':plugin-gc-app') +project(':plugin-gc-app').projectDir = file('plugin/gc-app') + include(':envoy') include(':grpc-proxy') From 3463b56a2d6905c7a5fd4f31c027f43e4476f47d Mon Sep 17 00:00:00 2001 From: Andrew <3199649+abaranec@users.noreply.github.com> Date: Fri, 2 Sep 2022 20:17:51 -0400 Subject: [PATCH 100/215] Write Encoding stats with data. (#2555) --- .../engine/util/BigDecimalUtils.java | 4 +- .../base/AbstractBulkValuesWriter.java | 129 ++- .../io/deephaven/parquet/base/BulkWriter.java | 76 +- .../deephaven/parquet/base/ColumnWriter.java | 10 +- .../parquet/base/ColumnWriterImpl.java | 71 +- .../parquet/base/ParquetFileWriter.java | 11 +- .../base/PlainBinaryChunkedWriter.java | 71 +- .../base/PlainBooleanChunkedWriter.java | 29 +- .../base/PlainDoubleChunkedWriter.java | 100 ++- .../base/PlainFixedLenChunkedWriter.java | 121 --- .../parquet/base/PlainFloatChunkedWriter.java | 100 ++- .../parquet/base/PlainIntChunkedWriter.java | 97 +- .../parquet/base/PlainLongChunkedWriter.java | 100 ++- .../parquet/base/RleIntChunkedWriter.java | 21 +- .../parquet/base/RowGroupWriterImpl.java | 39 +- .../DictionarySizeExceededException.java | 10 + .../deephaven/parquet/table/MappedSchema.java | 7 +- .../parquet/table/ParquetInstructions.java | 58 +- .../parquet/table/ParquetTableWriter.java | 838 ++++++++++-------- .../io/deephaven/parquet/table/TypeInfos.java | 26 +- .../table/location/ParquetColumnLocation.java | 42 +- .../parquet/table/TestParquetTools.java | 72 +- .../parquet/table/TestSymbolTableSource.java | 64 ++ .../ReplicateParquetChunkedWriters.java | 42 +- .../replication/ReplicatePrimitiveCode.java | 15 +- 25 files changed, 1373 insertions(+), 780 deletions(-) delete mode 100644 extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFixedLenChunkedWriter.java create mode 100644 extensions/parquet/table/src/main/java/io/deephaven/parquet/table/DictionarySizeExceededException.java create mode 100644 extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestSymbolTableSource.java diff --git a/engine/table/src/main/java/io/deephaven/engine/util/BigDecimalUtils.java b/engine/table/src/main/java/io/deephaven/engine/util/BigDecimalUtils.java index 5eda34eb2f5..c86986b8464 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/BigDecimalUtils.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/BigDecimalUtils.java @@ -6,7 +6,7 @@ import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.TrackingRowSet; +import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ChunkSource; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.Table; @@ -60,7 +60,7 @@ public static PrecisionAndScale computePrecisionAndScale( * @return a {@code PrecisionAndScale} object result. */ public static PrecisionAndScale computePrecisionAndScale( - final TrackingRowSet rowSet, + final RowSet rowSet, final ColumnSource source) { final int sz = 4096; // we first compute max(precision - scale) and max(scale), which corresponds to diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/AbstractBulkValuesWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/AbstractBulkValuesWriter.java index 2b2278c3d1e..e506ce3e401 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/AbstractBulkValuesWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/AbstractBulkValuesWriter.java @@ -3,6 +3,7 @@ */ package io.deephaven.parquet.base; +import io.deephaven.util.QueryConstants; import org.apache.parquet.column.values.ValuesWriter; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; import org.jetbrains.annotations.NotNull; @@ -10,58 +11,134 @@ import java.io.IOException; import java.nio.IntBuffer; -public abstract class AbstractBulkValuesWriter extends ValuesWriter implements BulkWriter { +/** + * The base class for writing vectors into individual pages. + * + * @param + */ +public abstract class AbstractBulkValuesWriter extends ValuesWriter + implements BulkWriter { + private static final int RL_FIRST_ELEM = 0; + private static final int RL_CONSECUTIVE_ELEM = 1; + + // These DL values are only relevant for Vector types + private static final int DL_VECTOR_NULL_VECTOR = 0; + private static final int DL_VECTOR_EMPTY_VECTOR = 1; + private static final int DL_VECTOR_NULL_ELEMENT = 2; + private static final int DL_VECTOR_ACTUAL_VALUE = 3; + + // These DL values are only relevant for individual items + static final int DL_ITEM_NULL = 0; + static final int DL_ITEM_PRESENT = 1; @Override - public int writeBulkVector(T bulkValues, IntBuffer repeatCount, RunLengthBitPackingHybridEncoder rlEncoder, - RunLengthBitPackingHybridEncoder dlEncoder, int nonNullValueCount, L nullValue) throws IOException { - IntBuffer nullsOffsets = writeBulkFilterNulls(bulkValues, nullValue, nonNullValueCount).nullOffsets; - return applyDlAndRl(repeatCount, rlEncoder, dlEncoder, nullsOffsets); + public int writeBulkVector(@NotNull final BUFFER_TYPE bulkValues, + @NotNull final IntBuffer vectorSizes, + @NotNull final RunLengthBitPackingHybridEncoder rlEncoder, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int nonNullValueCount) throws IOException { + final IntBuffer nullsOffsets = writeBulkFilterNulls(bulkValues, nonNullValueCount).nullOffsets; + return applyDlAndRl(vectorSizes, rlEncoder, dlEncoder, nullsOffsets); } - @NotNull - int applyDlAndRl(IntBuffer repeatCount, RunLengthBitPackingHybridEncoder rlEncoder, - RunLengthBitPackingHybridEncoder dlEncoder, - IntBuffer nullsOffsets) throws IOException { + /** + *

    + * Compute the definition levels and repetition levels. These are how Parquet encodes data that has a complex + * structure. In this case, the most complex structure we encode are Deephaven Vectors. + *

    + *
    + * + *

    + * Definition and Repetition levels are used to define how the complex structure is encoded into multiple columns. + * Repetition levels define the number of common prefix elements an item shares with its immediate predecessor, + * where the value 0 represents the root node of a single instance of a structure. The best way to think about this + * is to understand how it is read back - see + * Dremel Paper pgs 3 + * and 4. + *

    + *
    + * + *

    + * Basically, take the data structure being encoded and draw a Finite State Machine. If a repetition level less than + * the depth of that element is read, it means that the value belongs to a different instance of the parent item, + * and processing should advance to the next field. If the value is allowed to be repeated, and the RL is equal to + * the current field depth then keep reading values from the same field. + *

    + *
    + * + *

    + * In our case, we are storing Vectors, which are only this + *

    + * + *
    +     * message Vector {
    +     *     repeated int32 value
    +     * }
    +     * 
    + * + *

    + * So we can have a repetition level of 0 or 1, where 0 indicates the first element of a new vector and 1 indicates + * another entry in the current vector. + *

    + * + *

    + * Definition levels are used to encode how many preceeding optional fields are defined at a given point. For + * Vectors, as defined above, this gives us three different possible values for the definition value of a single + * item: + *

      + * 0 - The array itself at this position is a null 1 - The array exists, but is empty 2 - The element at this + * position in the array is null 3 - The value in the array exists and is non null + *
    + *

    + * + * @param vectorSizes a buffer containing the sizes of each vector being written + * @param rlEncoder the encoder for repetition levels + * @param dlEncoder the encoder for definition levels + * @param nullsOffsets a buffer containing the offset of the next null value. + * + * @return the total number of values written. + * @throws IOException if writing failed + */ + int applyDlAndRl(@NotNull final IntBuffer vectorSizes, + @NotNull final RunLengthBitPackingHybridEncoder rlEncoder, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + @NotNull final IntBuffer nullsOffsets) throws IOException { int valueCount = 0; int leafCount = 0; nullsOffsets.flip(); int nextNullOffset = nullsOffsets.hasRemaining() ? nullsOffsets.get() : Integer.MAX_VALUE; - /* - * DL: 0 - null row DL: 1 - empty array DL: 2 - null element DL: 3 - non-null array element - */ - - while (repeatCount.hasRemaining()) { - int length = repeatCount.get(); - if (length != Integer.MIN_VALUE) { + while (vectorSizes.hasRemaining()) { + int length = vectorSizes.get(); + if (length != QueryConstants.NULL_INT) { if (length == 0) { - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_VECTOR_EMPTY_VECTOR); } else { if (leafCount == nextNullOffset) { nextNullOffset = nullsOffsets.hasRemaining() ? nullsOffsets.get() : Integer.MAX_VALUE; - dlEncoder.writeInt(2); + dlEncoder.writeInt(DL_VECTOR_NULL_ELEMENT); } else { - dlEncoder.writeInt(3); + dlEncoder.writeInt(DL_VECTOR_ACTUAL_VALUE); } leafCount++; } + valueCount++; - rlEncoder.writeInt(0); - for (short i = 1; i < length; i++) { + rlEncoder.writeInt(RL_FIRST_ELEM); + for (int i = 1; i < length; i++) { if (leafCount++ == nextNullOffset) { nextNullOffset = nullsOffsets.hasRemaining() ? nullsOffsets.get() : Integer.MAX_VALUE; - dlEncoder.writeInt(2); + dlEncoder.writeInt(DL_VECTOR_NULL_ELEMENT); } else { - dlEncoder.writeInt(3); + dlEncoder.writeInt(DL_VECTOR_ACTUAL_VALUE); } - rlEncoder.writeInt(1); + rlEncoder.writeInt(RL_CONSECUTIVE_ELEM); valueCount++; } } else { valueCount++; - dlEncoder.writeInt(0); - rlEncoder.writeInt(0); + dlEncoder.writeInt(DL_VECTOR_NULL_VECTOR); + rlEncoder.writeInt(RL_FIRST_ELEM); } } return valueCount; diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/BulkWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/BulkWriter.java index b5e184ae622..4a52d382059 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/BulkWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/BulkWriter.java @@ -4,43 +4,97 @@ package io.deephaven.parquet.base; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.IntBuffer; /** - * Provides the option to write values of specific type in bulk The concrete type of the bulkValue object depends in the + * Provides the option to write values of specific type in bulk The concrete type of the bulkValue object depends on the * specific implementation */ -public interface BulkWriter { - void writeBulk(T bulkValues, int rowCount); - +public interface BulkWriter { class WriteResult { final int valueCount; final IntBuffer nullOffsets; - WriteResult(int valueCount) { + WriteResult(final int valueCount) { this(valueCount, null); } - public WriteResult(int valueCount, IntBuffer nullOffsets) { + public WriteResult(final int valueCount, @Nullable final IntBuffer nullOffsets) { this.valueCount = valueCount; - this.nullOffsets = nullOffsets; } } - WriteResult writeBulkFilterNulls(T bulkValues, L nullValue, RunLengthBitPackingHybridEncoder dlEncoder, + /** + * Write a buffer's worth of values to the underlying page. + * + * @param bulkValues the buffer of values + * @param rowCount the total number of rows to write. + */ + void writeBulk(@NotNull BUFFER_TYPE bulkValues, int rowCount); + + /** + * Write a buffer's worth of values to the underlying page. This method will find, without writing, {@code null} + * values and record their offsets in an {@link WriteResult#nullOffsets IntBuffer} in the result. The appropriate + * definition level will be set for null values. + * + * @param bulkValues the values to write + * @param dlEncoder the encoder for definition levels + * @param rowCount the number of rows being written + * @return a {@link WriteResult} containing the statistics of the result. + * @throws IOException if there was an error during write. + */ + @NotNull + WriteResult writeBulkFilterNulls(@NotNull BUFFER_TYPE bulkValues, + @NotNull RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException; - int writeBulkVector(T bulkValues, IntBuffer repeatCount, RunLengthBitPackingHybridEncoder rlEncoder, - RunLengthBitPackingHybridEncoder dlEncoder, int nonNullValueCount, L nullValue) throws IOException; + /** + * Write a buffer's worth of packed vector values to the underlying page. This method will set the proper definition + * level and repetition values in the encoders for {@code null} values. + * + * @param bulkValues the packed array values + * @param vectorSizes a buffer where each element contains the number of elements in each packed vector. + * @param rlEncoder the repetition level encoder + * @param dlEncoder the definition level encoder. + * @param nonNullValueCount the total count of non-null values + * @return the number of values actually written + * @throws IOException if writing failed. + */ + int writeBulkVector(@NotNull final BUFFER_TYPE bulkValues, + @NotNull final IntBuffer vectorSizes, + @NotNull final RunLengthBitPackingHybridEncoder rlEncoder, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int nonNullValueCount) throws IOException; - WriteResult writeBulkFilterNulls(T bulkValues, L nullValue, int rowCount); + /** + * Write a buffer's worth of packed vector values to the underlying page, skipping null values. This method will + * find {@code null} values and record their offsets in an {@link WriteResult#nullOffsets IntBuffer} in the result. + * + * @param bulkValues the packed vector values to write + * @param rowCount the number of rows being written. + * @return a {@link WriteResult} containing the statistics of the result. + */ + @NotNull + WriteResult writeBulkFilterNulls(@NotNull BUFFER_TYPE bulkValues, int rowCount); + /** + * Clear all internal state. + */ void reset(); + /** + * Get a view of this writer {@link ByteBuffer}. + * + * @return a {@link ByteBuffer} containing the written data. + * + * @throws IOException + */ ByteBuffer getByteBufferView() throws IOException; } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriter.java index 274b9df30df..006017516b8 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriter.java @@ -3,17 +3,17 @@ */ package io.deephaven.parquet.base; +import io.deephaven.util.SafeCloseable; + import java.io.IOException; import java.nio.IntBuffer; -public interface ColumnWriter { +public interface ColumnWriter extends SafeCloseable { void addPageNoNulls(Object pageData, int valuesCount) throws IOException; void addDictionaryPage(Object dictionaryValues, int valuesCount) throws IOException; - void addPage(Object pageData, Object nullValues, int valuesCount) throws IOException; - - void addVectorPage(Object pageData, IntBuffer repeatCount, int valuesCount, Object nullValue) throws IOException; + void addPage(Object pageData, int valuesCount) throws IOException; - void close(); + void addVectorPage(Object pageData, IntBuffer repeatCount, int valuesCount) throws IOException; } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java index 92393fc4ff3..39d8969f9e1 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java @@ -9,6 +9,7 @@ import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.Encoding; +import org.apache.parquet.column.EncodingStats; import org.apache.parquet.column.statistics.Statistics; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; import org.apache.parquet.format.*; @@ -46,7 +47,7 @@ public class ColumnWriterImpl implements ColumnWriter { private BulkWriter bulkWriter; - private final int pageSize; + private final int targetPageSize; private final ByteBufferAllocator allocator; private final RunLengthBitPackingHybridEncoder dlEncoder; private final RunLengthBitPackingHybridEncoder rlEncoder; @@ -59,24 +60,26 @@ public class ColumnWriterImpl implements ColumnWriter { private DictionaryPageHeader dictionaryPage; private final OffsetIndexBuilder offsetIndexBuilder; + private final EncodingStats.Builder encodingStatsBuilder = new EncodingStats.Builder(); + ColumnWriterImpl( final RowGroupWriterImpl owner, final SeekableByteChannel writeChannel, final ColumnDescriptor column, final Compressor compressor, - final int pageSize, + final int targetPageSize, final ByteBufferAllocator allocator) { this.writeChannel = writeChannel; this.column = column; this.compressor = compressor; - this.pageSize = pageSize; + this.targetPageSize = targetPageSize; this.allocator = allocator; dlEncoder = column.getMaxDefinitionLevel() == 0 ? null : new RunLengthBitPackingHybridEncoder( - getWidthFromMaxInt(column.getMaxDefinitionLevel()), MIN_SLAB_SIZE, pageSize, allocator); + getWidthFromMaxInt(column.getMaxDefinitionLevel()), MIN_SLAB_SIZE, targetPageSize, allocator); rlEncoder = column.getMaxRepetitionLevel() == 0 ? null : new RunLengthBitPackingHybridEncoder( - getWidthFromMaxInt(column.getMaxRepetitionLevel()), MIN_SLAB_SIZE, pageSize, allocator); + getWidthFromMaxInt(column.getMaxRepetitionLevel()), MIN_SLAB_SIZE, targetPageSize, allocator); this.owner = owner; offsetIndexBuilder = OffsetIndexBuilder.getBuilder(); } @@ -98,7 +101,7 @@ public void addPageNoNulls(final Object pageData, final int valuesCount) throws private void initWriter() { if (bulkWriter == null) { if (hasDictionary) { - bulkWriter = new RleIntChunkedWriter(pageSize, allocator, + bulkWriter = new RleIntChunkedWriter(targetPageSize, allocator, (byte) (32 - Integer.numberOfLeadingZeros(dictionaryPage.num_values))); } else { bulkWriter = getWriter(column.getPrimitiveType()); @@ -111,9 +114,14 @@ private void initWriter() { @Override public void addDictionaryPage(final Object dictionaryValues, final int valuesCount) throws IOException { if (pageCount > 0) { - throw new RuntimeException("Attempting to add dictionary past the first page"); + throw new IllegalStateException("Attempting to add dictionary past the first page"); } - BulkWriter dictionaryWriter = getWriter(column.getPrimitiveType()); + + encodingStatsBuilder.addDictEncoding(org.apache.parquet.column.Encoding.PLAIN); + + // noinspection rawtypes + final BulkWriter dictionaryWriter = getWriter(column.getPrimitiveType()); + // noinspection unchecked dictionaryWriter.writeBulk(dictionaryValues, valuesCount); dictionaryOffset = writeChannel.position(); @@ -152,21 +160,20 @@ public void writeDictionaryPage(final ByteBuffer dictionaryBuffer, final int val private BulkWriter getWriter(final PrimitiveType primitiveType) { switch (primitiveType.getPrimitiveTypeName()) { case INT96: - return new PlainFixedLenChunkedWriter(pageSize, 12, allocator); case FIXED_LEN_BYTE_ARRAY: - return new PlainFixedLenChunkedWriter(pageSize, column.getPrimitiveType().getTypeLength(), allocator); + throw new UnsupportedOperationException("No support for writing FIXED_LENGTH or INT96 types"); case INT32: - return new PlainIntChunkedWriter(pageSize, allocator); + return new PlainIntChunkedWriter(targetPageSize, allocator); case INT64: - return new PlainLongChunkedWriter(pageSize, allocator); + return new PlainLongChunkedWriter(targetPageSize, allocator); case FLOAT: - return new PlainFloatChunkedWriter(pageSize, allocator); + return new PlainFloatChunkedWriter(targetPageSize, allocator); case DOUBLE: - return new PlainDoubleChunkedWriter(pageSize, allocator); + return new PlainDoubleChunkedWriter(targetPageSize, allocator); case BINARY: - return new PlainBinaryChunkedWriter(pageSize, allocator); + return new PlainBinaryChunkedWriter(targetPageSize, allocator); case BOOLEAN: - return new PlainBooleanChunkedWriter(pageSize, allocator); + return new PlainBooleanChunkedWriter(); default: throw new UnsupportedOperationException("Unknown type " + primitiveType.getPrimitiveTypeName()); } @@ -174,13 +181,13 @@ private BulkWriter getWriter(final PrimitiveType primitiveType) { } @Override - public void addPage(final Object pageData, final Object nullValues, final int valuesCount) throws IOException { + public void addPage(final Object pageData, final int valuesCount) throws IOException { if (dlEncoder == null) { - throw new RuntimeException("Null values not supported"); + throw new IllegalStateException("Null values not supported"); } initWriter(); // noinspection unchecked - bulkWriter.writeBulkFilterNulls(pageData, nullValues, dlEncoder, valuesCount); + bulkWriter.writeBulkFilterNulls(pageData, dlEncoder, valuesCount); writePage(bulkWriter.getByteBufferView(), valuesCount); bulkWriter.reset(); } @@ -188,21 +195,19 @@ public void addPage(final Object pageData, final Object nullValues, final int va public void addVectorPage( final Object pageData, final IntBuffer repeatCount, - final int nonNullValueCount, - final Object nullValue) throws IOException { + final int nonNullValueCount) throws IOException { if (dlEncoder == null) { - throw new RuntimeException("Null values not supported"); + throw new IllegalStateException("Null values not supported"); } if (rlEncoder == null) { - throw new RuntimeException("Repeating values not supported"); + throw new IllegalStateException("Repeating values not supported"); } initWriter(); // noinspection unchecked int valueCount = - bulkWriter.writeBulkVector(pageData, repeatCount, rlEncoder, dlEncoder, nonNullValueCount, nullValue); + bulkWriter.writeBulkVector(pageData, repeatCount, rlEncoder, dlEncoder, nonNullValueCount); writePage(bulkWriter.getByteBufferView(), valueCount); bulkWriter.reset(); - } private void writeDataPageV2Header( @@ -324,7 +329,8 @@ private void writePage(final BytesInput bytes, final int valueCount, final Encod writeChannel.write(compressedBytes.toByteBuffer()); offsetIndexBuilder.add((int) (writeChannel.position() - initialOffset), valueCount); - + encodings.add(valuesEncoding); + encodingStatsBuilder.addDataEncoding(valuesEncoding); } private void writeDataPageV1Header( @@ -387,10 +393,17 @@ private void writePage(final ByteBuffer encodedData, final long valueCount) { @Override public void close() { owner.releaseWriter(this, - ColumnChunkMetaData.get(ColumnPath.get(column.getPath()), column.getPrimitiveType(), + ColumnChunkMetaData.get(ColumnPath.get(column.getPath()), + column.getPrimitiveType(), compressor.getCodecName(), - null, encodings, Statistics.createStats(column.getPrimitiveType()), firstDataPageOffset, - dictionaryOffset, totalValueCount, compressedLength, uncompressedLength)); + encodingStatsBuilder.build(), + encodings, + Statistics.createStats(column.getPrimitiveType()), + firstDataPageOffset, + dictionaryOffset, + totalValueCount, + compressedLength, + uncompressedLength)); } public ColumnDescriptor getColumn() { diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java index 507e88979ec..03e6265f137 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java @@ -34,7 +34,7 @@ public class ParquetFileWriter { private final SeekableByteChannel writeChannel; private final MessageType type; - private final int pageSize; + private final int targetPageSize; private final ByteBufferAllocator allocator; private final SeekableChannelsProvider channelsProvider; private final Compressor compressor; @@ -45,12 +45,12 @@ public class ParquetFileWriter { public ParquetFileWriter( final String filePath, final SeekableChannelsProvider channelsProvider, - final int pageSize, + final int targetPageSize, final ByteBufferAllocator allocator, final MessageType type, final String codecName, final Map extraMetaData) throws IOException { - this.pageSize = pageSize; + this.targetPageSize = targetPageSize; this.allocator = allocator; this.extraMetaData = new HashMap<>(extraMetaData); writeChannel = channelsProvider.getWriteChannel(filePath, false); // TODO add support for appending @@ -62,13 +62,14 @@ public ParquetFileWriter( @SuppressWarnings("unused") RowGroupWriter addRowGroup(final String path, final boolean append) throws IOException { RowGroupWriterImpl rowGroupWriter = - new RowGroupWriterImpl(path, append, channelsProvider, type, pageSize, allocator, compressor); + new RowGroupWriterImpl(path, append, channelsProvider, type, targetPageSize, allocator, compressor); blocks.add(rowGroupWriter.getBlock()); return rowGroupWriter; } public RowGroupWriter addRowGroup(final long size) { - RowGroupWriterImpl rowGroupWriter = new RowGroupWriterImpl(writeChannel, type, pageSize, allocator, compressor); + RowGroupWriterImpl rowGroupWriter = + new RowGroupWriterImpl(writeChannel, type, targetPageSize, allocator, compressor); rowGroupWriter.getBlock().setRowCount(size); blocks.add(rowGroupWriter.getBlock()); offsetIndexes.add(rowGroupWriter.offsetIndexes()); diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBinaryChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBinaryChunkedWriter.java index d98e4e137a5..045c6f65cd0 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBinaryChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBinaryChunkedWriter.java @@ -9,42 +9,31 @@ import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; import org.apache.parquet.io.api.Binary; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; -import java.util.Objects; /** * Plain encoding except for binary values */ -public class PlainBinaryChunkedWriter extends AbstractBulkValuesWriter { +public class PlainBinaryChunkedWriter extends AbstractBulkValuesWriter { private final ByteBufferAllocator allocator; - private int originalLimit; ByteBuffer innerBuffer; - public PlainBinaryChunkedWriter(int pageSize, ByteBufferAllocator allocator) { + public PlainBinaryChunkedWriter(final int pageSize, @NotNull final ByteBufferAllocator allocator) { innerBuffer = allocator.allocate(pageSize); innerBuffer.order(ByteOrder.LITTLE_ENDIAN); this.allocator = allocator; innerBuffer.mark(); - originalLimit = innerBuffer.limit(); } @Override public final void writeBytes(Binary v) { - if (innerBuffer.remaining() < v.length() + 4) { - ByteBuffer newBuffer = allocator.allocate(innerBuffer.capacity() * 2); - innerBuffer.flip(); - newBuffer.mark(); - newBuffer.put(innerBuffer); - allocator.release(innerBuffer); - innerBuffer = newBuffer; - innerBuffer.order(ByteOrder.LITTLE_ENDIAN); - originalLimit = innerBuffer.limit(); - } + ensureCapacityFor(v); innerBuffer.putInt(v.length()); innerBuffer.put(v.toByteBuffer()); } @@ -61,13 +50,14 @@ public BytesInput getBytes() { @Override public void reset() { - innerBuffer.position(0); - innerBuffer.limit(originalLimit); + innerBuffer.reset(); + innerBuffer.limit(innerBuffer.capacity()); } @Override public ByteBuffer getByteBufferView() { - innerBuffer.flip(); + innerBuffer.limit(innerBuffer.position()); + innerBuffer.reset(); return innerBuffer; } @@ -92,30 +82,33 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(Binary[] bulkValues, int rowCount) { + public void writeBulk(@NotNull Binary[] bulkValues, int rowCount) { for (int i = 0; i < rowCount; i++) { writeBytes(bulkValues[i]); } } + @NotNull @Override - public WriteResult writeBulkFilterNulls(Binary[] bulkValues, Binary nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { + public WriteResult writeBulkFilterNulls(@NotNull final Binary[] bulkValues, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int rowCount) throws IOException { for (int i = 0; i < rowCount; i++) { - if (!Objects.equals(bulkValues[i], nullValue)) { + if (bulkValues[i] != null) { writeBytes(bulkValues[i]); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } @Override - public WriteResult writeBulkFilterNulls(Binary[] bulkValues, Binary nullValue, int nonNullLeafCount) { + public @NotNull WriteResult writeBulkFilterNulls(@NotNull Binary[] bulkValues, int nonNullLeafCount) { IntBuffer nullOffsets = IntBuffer.allocate(4); for (int i = 0; i < nonNullLeafCount; i++) { - if (!Objects.equals(bulkValues[i], nullValue)) { + if (bulkValues[i] != null) { writeBytes(bulkValues[i]); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); @@ -124,4 +117,32 @@ public WriteResult writeBulkFilterNulls(Binary[] bulkValues, Binary nullValue, i } return new WriteResult(nonNullLeafCount, nullOffsets); } + + private void ensureCapacityFor(@NotNull final Binary v) { + if(v.length() == 0 || innerBuffer.remaining() >= v.length() + Integer.BYTES) { + return; + } + + final int currentCapacity = innerBuffer.capacity(); + final int currentPosition = innerBuffer.position(); + final long requiredCapacity = (long)currentPosition + v.length() + Integer.BYTES; + if(requiredCapacity > Integer.MAX_VALUE) { + throw new IllegalStateException("Unable to write " + requiredCapacity + " values"); + } + + int newCapacity = currentCapacity; + while(newCapacity < requiredCapacity) { + newCapacity = Math.min(Integer.MAX_VALUE, newCapacity * 2); + } + + final ByteBuffer newBuf = allocator.allocate(newCapacity); + newBuf.order(ByteOrder.LITTLE_ENDIAN); + newBuf.mark(); + + innerBuffer.limit(innerBuffer.position()); + innerBuffer.reset(); + newBuf.put(innerBuffer); + allocator.release(innerBuffer); + innerBuffer = newBuf; + } } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBooleanChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBooleanChunkedWriter.java index 4c5be1d98b0..bb40de9a6ee 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBooleanChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainBooleanChunkedWriter.java @@ -4,11 +4,13 @@ package io.deephaven.parquet.base; import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.plain.BooleanPlainValuesWriter; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; @@ -17,10 +19,10 @@ /** * Plain encoding except for booleans */ -public class PlainBooleanChunkedWriter extends AbstractBulkValuesWriter { - BooleanPlainValuesWriter writer; +public class PlainBooleanChunkedWriter extends AbstractBulkValuesWriter { + private final BooleanPlainValuesWriter writer; - public PlainBooleanChunkedWriter(int pageSize, ByteBufferAllocator allocator) { + public PlainBooleanChunkedWriter() { writer = new BooleanPlainValuesWriter(); } @@ -70,35 +72,34 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(ByteBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull ByteBuffer bulkValues, int rowCount) { while (bulkValues.hasRemaining()) { writeBoolean(bulkValues.get() == 1); } } + @NotNull @Override - public WriteResult writeBulkFilterNulls(ByteBuffer bulkValues, Byte nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - byte nullBool = nullValue; + public WriteResult writeBulkFilterNulls(@NotNull ByteBuffer bulkValues, @NotNull RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { while (bulkValues.hasRemaining()) { - byte next = bulkValues.get(); - if (next != nullBool) { + final byte next = bulkValues.get(); + if (next != QueryConstants.NULL_BYTE) { writeBoolean(next == 1); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } @Override - public WriteResult writeBulkFilterNulls(ByteBuffer bulkValues, Byte nullValue, int rowCount) { - byte nullBool = nullValue; + public @NotNull WriteResult writeBulkFilterNulls(@NotNull ByteBuffer bulkValues, int rowCount) { IntBuffer nullOffsets = IntBuffer.allocate(4); int i = 0; while (bulkValues.hasRemaining()) { - byte next = bulkValues.get(); - if (next != nullBool) { + final byte next = bulkValues.get(); + if (next != QueryConstants.NULL_BYTE) { writeBoolean(next == 1); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainDoubleChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainDoubleChunkedWriter.java index aa946cc1c10..fcc88fb603b 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainDoubleChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainDoubleChunkedWriter.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* @@ -8,36 +8,35 @@ */ package io.deephaven.parquet.base; +import java.nio.IntBuffer; + import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.DoubleBuffer; -import java.nio.IntBuffer; /** - * Plain encoding except for booleans + * A writer for encoding doubles in the PLAIN format */ -public class PlainDoubleChunkedWriter extends AbstractBulkValuesWriter { +public class PlainDoubleChunkedWriter extends AbstractBulkValuesWriter { + private static final int MAXIMUM_TOTAL_CAPACITY = Integer.MAX_VALUE / Double.BYTES; private final ByteBufferAllocator allocator; - private final int originalLimit; - private final DoubleBuffer targetBuffer; - private final ByteBuffer innerBuffer; + private DoubleBuffer targetBuffer; + private ByteBuffer innerBuffer; - PlainDoubleChunkedWriter(int pageSize, ByteBufferAllocator allocator) { - innerBuffer = allocator.allocate(pageSize); - innerBuffer.order(ByteOrder.LITTLE_ENDIAN); - originalLimit = innerBuffer.limit(); + + PlainDoubleChunkedWriter(final int targetPageSize, @NotNull final ByteBufferAllocator allocator) { this.allocator = allocator; - targetBuffer = innerBuffer.asDoubleBuffer(); - targetBuffer.mark(); - innerBuffer.mark(); + realloc(targetPageSize); } @Override @@ -47,7 +46,7 @@ public final void writeDouble(double v) { @Override public long getBufferedSize() { - return targetBuffer.remaining() * Double.BYTES; + return (long) targetBuffer.remaining() * Double.BYTES; } @Override @@ -58,8 +57,8 @@ public BytesInput getBytes() { @Override public void reset() { - innerBuffer.limit(originalLimit); innerBuffer.reset(); + innerBuffer.limit(innerBuffer.capacity()); targetBuffer.reset(); } @@ -90,33 +89,39 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(DoubleBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull DoubleBuffer bulkValues, int rowCount) { + ensureCapacityFor(bulkValues); targetBuffer.put(bulkValues); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(DoubleBuffer bulkValues, Number nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - double nullDouble = nullValue.doubleValue(); + public WriteResult writeBulkFilterNulls(@NotNull final DoubleBuffer bulkValues, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int rowCount) throws IOException { + ensureCapacityFor(bulkValues); while (bulkValues.hasRemaining()) { - double next = bulkValues.get(); - if (next != nullDouble) { + final double next = bulkValues.get(); + if (next != QueryConstants.NULL_DOUBLE) { writeDouble(next); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(DoubleBuffer bulkValues, Number nullValue, int rowCount) { - double nullDouble = nullValue.doubleValue(); + public WriteResult writeBulkFilterNulls(@NotNull final DoubleBuffer bulkValues, + final int rowCount) { + ensureCapacityFor(bulkValues); int i = 0; IntBuffer nullOffsets = IntBuffer.allocate(4); while (bulkValues.hasRemaining()) { - double next = bulkValues.get(); - if (next != nullDouble) { + final double next = bulkValues.get(); + if (next != QueryConstants.NULL_DOUBLE) { writeDouble(next); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); @@ -126,4 +131,45 @@ public WriteResult writeBulkFilterNulls(DoubleBuffer bulkValues, Number nullValu } return new WriteResult(rowCount, nullOffsets); } + + private void ensureCapacityFor(@NotNull final DoubleBuffer valuesToAdd) { + if(!valuesToAdd.hasRemaining()) { + return; + } + + final int currentCapacity = targetBuffer.capacity(); + final int currentPosition = targetBuffer.position(); + final int requiredCapacity = currentPosition + valuesToAdd.remaining(); + if(requiredCapacity < currentCapacity) { + return; + } + + if(requiredCapacity > MAXIMUM_TOTAL_CAPACITY) { + throw new IllegalStateException("Unable to write " + requiredCapacity + " values"); + } + + int newCapacity = currentCapacity; + while(newCapacity < requiredCapacity) { + newCapacity = Math.min(MAXIMUM_TOTAL_CAPACITY, newCapacity * 2); + } + + realloc(newCapacity * Double.BYTES); + } + + private void realloc(final int newCapacity) { + final ByteBuffer newBuf = allocator.allocate(newCapacity); + newBuf.order(ByteOrder.LITTLE_ENDIAN); + final DoubleBuffer newDoubleBuf = newBuf.asDoubleBuffer(); + newBuf.mark(); + newDoubleBuf.mark(); + + if(this.innerBuffer != null) { + targetBuffer.limit(targetBuffer.position()); + targetBuffer.reset(); + newDoubleBuf.put(targetBuffer); + allocator.release(innerBuffer); + } + innerBuffer = newBuf; + targetBuffer = newDoubleBuf; + } } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFixedLenChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFixedLenChunkedWriter.java deleted file mode 100644 index 914aaf34c92..00000000000 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFixedLenChunkedWriter.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.parquet.base; - -import io.deephaven.parquet.base.util.Helpers; -import org.apache.parquet.bytes.ByteBufferAllocator; -import org.apache.parquet.bytes.BytesInput; -import org.apache.parquet.column.Encoding; -import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; -import org.apache.parquet.io.api.Binary; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.util.Arrays; - -/** - * Plain encoding except for booleans - */ -public class PlainFixedLenChunkedWriter extends AbstractBulkValuesWriter { - private final ByteBufferAllocator allocator; - private final int originalLimit; - private final int fixedLength; - private final int initialPosition; - - ByteBuffer innerBuffer; - - public PlainFixedLenChunkedWriter(int pageSize, int fixedLength, ByteBufferAllocator allocator) { - innerBuffer = allocator.allocate(pageSize); - this.allocator = allocator; - initialPosition = innerBuffer.position(); - originalLimit = innerBuffer.limit(); - this.fixedLength = fixedLength; - } - - @Override - public final void writeBytes(Binary v) { - innerBuffer.put(v.toByteBuffer()); - } - - @Override - public long getBufferedSize() { - return innerBuffer.remaining(); - } - - @Override - public BytesInput getBytes() { - return BytesInput.from(innerBuffer); - } - - @Override - public void reset() { - innerBuffer.position(initialPosition); - innerBuffer.limit(originalLimit); - } - - @Override - public ByteBuffer getByteBufferView() { - innerBuffer.flip(); - return innerBuffer; - } - - @Override - public void close() { - allocator.release(innerBuffer); - } - - @Override - public long getAllocatedSize() { - return innerBuffer.capacity(); - } - - @Override - public Encoding getEncoding() { - return Encoding.PLAIN; - } - - @Override - public String memUsageString(String prefix) { - return String.format("%s %s, %,d bytes", prefix, getClass().getSimpleName(), innerBuffer.capacity()); - } - - @Override - public void writeBulk(ByteBuffer bulkValues, int rowCount) { - innerBuffer.put(bulkValues); - } - - @Override - public WriteResult writeBulkFilterNulls(ByteBuffer bulkValues, Binary nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - byte[] nullBytes = nullValue.getBytes(); - byte[] stepBytes = new byte[fixedLength]; - for (int i = bulkValues.position(); i < bulkValues.limit(); i += fixedLength) { - bulkValues.get(stepBytes); - if (!Arrays.equals(stepBytes, nullBytes)) { - innerBuffer.put(bulkValues); - dlEncoder.writeInt(1); - } else { - dlEncoder.writeInt(0); - } - } - return new WriteResult(rowCount); - } - - @Override - public WriteResult writeBulkFilterNulls(ByteBuffer bulkValues, Binary nullValue, int rowCount) { - byte[] nullBytes = nullValue.getBytes(); - byte[] stepBytes = new byte[fixedLength]; - IntBuffer nullOffsets = IntBuffer.allocate(4); - for (int i = bulkValues.position(); i < bulkValues.limit(); i += fixedLength) { - bulkValues.get(stepBytes); - if (!Arrays.equals(stepBytes, nullBytes)) { - innerBuffer.put(bulkValues); - } else { - nullOffsets = Helpers.ensureCapacity(nullOffsets); - nullOffsets.put(i); - } - } - return new WriteResult(rowCount, nullOffsets); - } -} diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFloatChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFloatChunkedWriter.java index 12dbfdc3117..9e3e3905b85 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFloatChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainFloatChunkedWriter.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* @@ -8,36 +8,35 @@ */ package io.deephaven.parquet.base; +import java.nio.IntBuffer; + import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; -import java.nio.IntBuffer; /** - * Plain encoding except for booleans + * A writer for encoding floats in the PLAIN format */ -public class PlainFloatChunkedWriter extends AbstractBulkValuesWriter { +public class PlainFloatChunkedWriter extends AbstractBulkValuesWriter { + private static final int MAXIMUM_TOTAL_CAPACITY = Integer.MAX_VALUE / Float.BYTES; private final ByteBufferAllocator allocator; - private final int originalLimit; - private final FloatBuffer targetBuffer; - private final ByteBuffer innerBuffer; + private FloatBuffer targetBuffer; + private ByteBuffer innerBuffer; - PlainFloatChunkedWriter(int pageSize, ByteBufferAllocator allocator) { - innerBuffer = allocator.allocate(pageSize); - innerBuffer.order(ByteOrder.LITTLE_ENDIAN); - originalLimit = innerBuffer.limit(); + + PlainFloatChunkedWriter(final int targetPageSize, @NotNull final ByteBufferAllocator allocator) { this.allocator = allocator; - targetBuffer = innerBuffer.asFloatBuffer(); - targetBuffer.mark(); - innerBuffer.mark(); + realloc(targetPageSize); } @Override @@ -47,7 +46,7 @@ public final void writeFloat(float v) { @Override public long getBufferedSize() { - return targetBuffer.remaining() * Float.BYTES; + return (long) targetBuffer.remaining() * Float.BYTES; } @Override @@ -58,8 +57,8 @@ public BytesInput getBytes() { @Override public void reset() { - innerBuffer.limit(originalLimit); innerBuffer.reset(); + innerBuffer.limit(innerBuffer.capacity()); targetBuffer.reset(); } @@ -90,33 +89,39 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(FloatBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull FloatBuffer bulkValues, int rowCount) { + ensureCapacityFor(bulkValues); targetBuffer.put(bulkValues); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(FloatBuffer bulkValues, Number nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - float nullFloat = nullValue.floatValue(); + public WriteResult writeBulkFilterNulls(@NotNull final FloatBuffer bulkValues, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int rowCount) throws IOException { + ensureCapacityFor(bulkValues); while (bulkValues.hasRemaining()) { - float next = bulkValues.get(); - if (next != nullFloat) { + final float next = bulkValues.get(); + if (next != QueryConstants.NULL_FLOAT) { writeFloat(next); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(FloatBuffer bulkValues, Number nullValue, int rowCount) { - float nullFloat = nullValue.floatValue(); + public WriteResult writeBulkFilterNulls(@NotNull final FloatBuffer bulkValues, + final int rowCount) { + ensureCapacityFor(bulkValues); int i = 0; IntBuffer nullOffsets = IntBuffer.allocate(4); while (bulkValues.hasRemaining()) { - float next = bulkValues.get(); - if (next != nullFloat) { + final float next = bulkValues.get(); + if (next != QueryConstants.NULL_FLOAT) { writeFloat(next); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); @@ -126,4 +131,45 @@ public WriteResult writeBulkFilterNulls(FloatBuffer bulkValues, Number nullValue } return new WriteResult(rowCount, nullOffsets); } + + private void ensureCapacityFor(@NotNull final FloatBuffer valuesToAdd) { + if(!valuesToAdd.hasRemaining()) { + return; + } + + final int currentCapacity = targetBuffer.capacity(); + final int currentPosition = targetBuffer.position(); + final int requiredCapacity = currentPosition + valuesToAdd.remaining(); + if(requiredCapacity < currentCapacity) { + return; + } + + if(requiredCapacity > MAXIMUM_TOTAL_CAPACITY) { + throw new IllegalStateException("Unable to write " + requiredCapacity + " values"); + } + + int newCapacity = currentCapacity; + while(newCapacity < requiredCapacity) { + newCapacity = Math.min(MAXIMUM_TOTAL_CAPACITY, newCapacity * 2); + } + + realloc(newCapacity * Float.BYTES); + } + + private void realloc(final int newCapacity) { + final ByteBuffer newBuf = allocator.allocate(newCapacity); + newBuf.order(ByteOrder.LITTLE_ENDIAN); + final FloatBuffer newFloatBuf = newBuf.asFloatBuffer(); + newBuf.mark(); + newFloatBuf.mark(); + + if(this.innerBuffer != null) { + targetBuffer.limit(targetBuffer.position()); + targetBuffer.reset(); + newFloatBuf.put(targetBuffer); + allocator.release(innerBuffer); + } + innerBuffer = newBuf; + targetBuffer = newFloatBuf; + } } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainIntChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainIntChunkedWriter.java index 8471d0febdd..a7849b4a75b 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainIntChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainIntChunkedWriter.java @@ -1,13 +1,15 @@ -/** +/* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ package io.deephaven.parquet.base; import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; @@ -15,23 +17,19 @@ import java.nio.IntBuffer; /** - * Plain encoding except for booleans + * A writer for encoding ints in the PLAIN format */ -public class PlainIntChunkedWriter extends AbstractBulkValuesWriter { +public class PlainIntChunkedWriter extends AbstractBulkValuesWriter { + private static final int MAXIMUM_TOTAL_CAPACITY = Integer.MAX_VALUE / Integer.BYTES; private final ByteBufferAllocator allocator; - private final int originalLimit; - private final IntBuffer targetBuffer; - private final ByteBuffer innerBuffer; + private IntBuffer targetBuffer; + private ByteBuffer innerBuffer; + - PlainIntChunkedWriter(int pageSize, ByteBufferAllocator allocator) { - innerBuffer = allocator.allocate(pageSize); - innerBuffer.order(ByteOrder.LITTLE_ENDIAN); - originalLimit = innerBuffer.limit(); + PlainIntChunkedWriter(final int targetPageSize, @NotNull final ByteBufferAllocator allocator) { this.allocator = allocator; - targetBuffer = innerBuffer.asIntBuffer(); - targetBuffer.mark(); - innerBuffer.mark(); + realloc(targetPageSize); } @Override @@ -41,7 +39,7 @@ public final void writeInteger(int v) { @Override public long getBufferedSize() { - return targetBuffer.remaining() * Integer.BYTES; + return (long) targetBuffer.remaining() * Integer.BYTES; } @Override @@ -52,8 +50,8 @@ public BytesInput getBytes() { @Override public void reset() { - innerBuffer.limit(originalLimit); innerBuffer.reset(); + innerBuffer.limit(innerBuffer.capacity()); targetBuffer.reset(); } @@ -84,33 +82,39 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(IntBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull IntBuffer bulkValues, int rowCount) { + ensureCapacityFor(bulkValues); targetBuffer.put(bulkValues); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(IntBuffer bulkValues, Number nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - int nullInt = nullValue.intValue(); + public WriteResult writeBulkFilterNulls(@NotNull final IntBuffer bulkValues, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int rowCount) throws IOException { + ensureCapacityFor(bulkValues); while (bulkValues.hasRemaining()) { - int next = bulkValues.get(); - if (next != nullInt) { + final int next = bulkValues.get(); + if (next != QueryConstants.NULL_INT) { writeInteger(next); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(IntBuffer bulkValues, Number nullValue, int rowCount) { - int nullInt = nullValue.intValue(); + public WriteResult writeBulkFilterNulls(@NotNull final IntBuffer bulkValues, + final int rowCount) { + ensureCapacityFor(bulkValues); int i = 0; IntBuffer nullOffsets = IntBuffer.allocate(4); while (bulkValues.hasRemaining()) { - int next = bulkValues.get(); - if (next != nullInt) { + final int next = bulkValues.get(); + if (next != QueryConstants.NULL_INT) { writeInteger(next); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); @@ -120,4 +124,45 @@ public WriteResult writeBulkFilterNulls(IntBuffer bulkValues, Number nullValue, } return new WriteResult(rowCount, nullOffsets); } + + private void ensureCapacityFor(@NotNull final IntBuffer valuesToAdd) { + if(!valuesToAdd.hasRemaining()) { + return; + } + + final int currentCapacity = targetBuffer.capacity(); + final int currentPosition = targetBuffer.position(); + final int requiredCapacity = currentPosition + valuesToAdd.remaining(); + if(requiredCapacity < currentCapacity) { + return; + } + + if(requiredCapacity > MAXIMUM_TOTAL_CAPACITY) { + throw new IllegalStateException("Unable to write " + requiredCapacity + " values"); + } + + int newCapacity = currentCapacity; + while(newCapacity < requiredCapacity) { + newCapacity = Math.min(MAXIMUM_TOTAL_CAPACITY, newCapacity * 2); + } + + realloc(newCapacity * Integer.BYTES); + } + + private void realloc(final int newCapacity) { + final ByteBuffer newBuf = allocator.allocate(newCapacity); + newBuf.order(ByteOrder.LITTLE_ENDIAN); + final IntBuffer newIntBuf = newBuf.asIntBuffer(); + newBuf.mark(); + newIntBuf.mark(); + + if(this.innerBuffer != null) { + targetBuffer.limit(targetBuffer.position()); + targetBuffer.reset(); + newIntBuf.put(targetBuffer); + allocator.release(innerBuffer); + } + innerBuffer = newBuf; + targetBuffer = newIntBuf; + } } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainLongChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainLongChunkedWriter.java index 7d513ad63e8..7be983d5cdb 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainLongChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainLongChunkedWriter.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ /* @@ -8,36 +8,35 @@ */ package io.deephaven.parquet.base; +import java.nio.IntBuffer; + import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.nio.IntBuffer; import java.nio.LongBuffer; /** - * Plain encoding except for booleans + * A writer for encoding longs in the PLAIN format */ -public class PlainLongChunkedWriter extends AbstractBulkValuesWriter { +public class PlainLongChunkedWriter extends AbstractBulkValuesWriter { + private static final int MAXIMUM_TOTAL_CAPACITY = Integer.MAX_VALUE / Long.BYTES; private final ByteBufferAllocator allocator; - private final int originalLimit; - private final LongBuffer targetBuffer; - private final ByteBuffer innerBuffer; + private LongBuffer targetBuffer; + private ByteBuffer innerBuffer; - PlainLongChunkedWriter(int pageSize, ByteBufferAllocator allocator) { - innerBuffer = allocator.allocate(pageSize); - innerBuffer.order(ByteOrder.LITTLE_ENDIAN); - originalLimit = innerBuffer.limit(); + + PlainLongChunkedWriter(final int targetPageSize, @NotNull final ByteBufferAllocator allocator) { this.allocator = allocator; - targetBuffer = innerBuffer.asLongBuffer(); - targetBuffer.mark(); - innerBuffer.mark(); + realloc(targetPageSize); } @Override @@ -47,7 +46,7 @@ public final void writeLong(long v) { @Override public long getBufferedSize() { - return targetBuffer.remaining() * Long.BYTES; + return (long) targetBuffer.remaining() * Long.BYTES; } @Override @@ -58,8 +57,8 @@ public BytesInput getBytes() { @Override public void reset() { - innerBuffer.limit(originalLimit); innerBuffer.reset(); + innerBuffer.limit(innerBuffer.capacity()); targetBuffer.reset(); } @@ -90,33 +89,39 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(LongBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull LongBuffer bulkValues, int rowCount) { + ensureCapacityFor(bulkValues); targetBuffer.put(bulkValues); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(LongBuffer bulkValues, Number nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - long nullLong = nullValue.longValue(); + public WriteResult writeBulkFilterNulls(@NotNull final LongBuffer bulkValues, + @NotNull final RunLengthBitPackingHybridEncoder dlEncoder, + final int rowCount) throws IOException { + ensureCapacityFor(bulkValues); while (bulkValues.hasRemaining()) { - long next = bulkValues.get(); - if (next != nullLong) { + final long next = bulkValues.get(); + if (next != QueryConstants.NULL_LONG) { writeLong(next); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } + @NotNull @Override - public WriteResult writeBulkFilterNulls(LongBuffer bulkValues, Number nullValue, int rowCount) { - long nullLong = nullValue.longValue(); + public WriteResult writeBulkFilterNulls(@NotNull final LongBuffer bulkValues, + final int rowCount) { + ensureCapacityFor(bulkValues); int i = 0; IntBuffer nullOffsets = IntBuffer.allocate(4); while (bulkValues.hasRemaining()) { - long next = bulkValues.get(); - if (next != nullLong) { + final long next = bulkValues.get(); + if (next != QueryConstants.NULL_LONG) { writeLong(next); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); @@ -126,4 +131,45 @@ public WriteResult writeBulkFilterNulls(LongBuffer bulkValues, Number nullValue, } return new WriteResult(rowCount, nullOffsets); } + + private void ensureCapacityFor(@NotNull final LongBuffer valuesToAdd) { + if(!valuesToAdd.hasRemaining()) { + return; + } + + final int currentCapacity = targetBuffer.capacity(); + final int currentPosition = targetBuffer.position(); + final int requiredCapacity = currentPosition + valuesToAdd.remaining(); + if(requiredCapacity < currentCapacity) { + return; + } + + if(requiredCapacity > MAXIMUM_TOTAL_CAPACITY) { + throw new IllegalStateException("Unable to write " + requiredCapacity + " values"); + } + + int newCapacity = currentCapacity; + while(newCapacity < requiredCapacity) { + newCapacity = Math.min(MAXIMUM_TOTAL_CAPACITY, newCapacity * 2); + } + + realloc(newCapacity * Long.BYTES); + } + + private void realloc(final int newCapacity) { + final ByteBuffer newBuf = allocator.allocate(newCapacity); + newBuf.order(ByteOrder.LITTLE_ENDIAN); + final LongBuffer newLongBuf = newBuf.asLongBuffer(); + newBuf.mark(); + newLongBuf.mark(); + + if(this.innerBuffer != null) { + targetBuffer.limit(targetBuffer.position()); + targetBuffer.reset(); + newLongBuf.put(targetBuffer); + allocator.release(innerBuffer); + } + innerBuffer = newBuf; + targetBuffer = newLongBuf; + } } diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RleIntChunkedWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RleIntChunkedWriter.java index 23333e2963d..87b55837ecf 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RleIntChunkedWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RleIntChunkedWriter.java @@ -4,10 +4,12 @@ package io.deephaven.parquet.base; import io.deephaven.parquet.base.util.Helpers; +import io.deephaven.util.QueryConstants; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridEncoder; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +22,7 @@ /** * Plain encoding except for booleans */ -public class RleIntChunkedWriter extends AbstractBulkValuesWriter { +public class RleIntChunkedWriter extends AbstractBulkValuesWriter { private static final Logger LOG = LoggerFactory.getLogger(org.apache.parquet.column.values.plain.PlainValuesWriter.class); private final RunLengthBitPackingHybridEncoder encoder; @@ -93,36 +95,35 @@ public String memUsageString(String prefix) { } @Override - public void writeBulk(IntBuffer bulkValues, int rowCount) { + public void writeBulk(@NotNull IntBuffer bulkValues, int rowCount) { for (int i = 0; i < rowCount; i++) { writeInteger(bulkValues.get()); } } + @NotNull @Override - public WriteResult writeBulkFilterNulls(IntBuffer bulkValues, Integer nullValue, RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { - int nullInt = nullValue; + public WriteResult writeBulkFilterNulls(@NotNull IntBuffer bulkValues, @NotNull RunLengthBitPackingHybridEncoder dlEncoder, int rowCount) throws IOException { while (bulkValues.hasRemaining()) { int next = bulkValues.get(); - if (next != nullInt) { + if (next != QueryConstants.NULL_INT) { writeInteger(next); - dlEncoder.writeInt(1); + dlEncoder.writeInt(DL_ITEM_PRESENT); } else { - dlEncoder.writeInt(0); + dlEncoder.writeInt(DL_ITEM_NULL); } } return new WriteResult(rowCount); } @Override - public WriteResult writeBulkFilterNulls(IntBuffer bulkValues, Integer nullValue, int rowCount) { - int nullInt = nullValue; + public @NotNull WriteResult writeBulkFilterNulls(@NotNull IntBuffer bulkValues, int rowCount) { IntBuffer nullOffsets = IntBuffer.allocate(4); int i = 0; while (bulkValues.hasRemaining()) { int next = bulkValues.get(); - if (next != nullInt) { + if (next != QueryConstants.NULL_INT) { writeInteger(next); } else { nullOffsets = Helpers.ensureCapacity(nullOffsets); diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java index 4c9dd953abc..feb6a962e6c 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java @@ -22,17 +22,22 @@ public class RowGroupWriterImpl implements RowGroupWriter { private final SeekableByteChannel writeChannel; private final MessageType type; - private final int pageSize; + private final int targetPageSize; private final ByteBufferAllocator allocator; private ColumnWriterImpl activeWriter; private final BlockMetaData blockMetaData; private final List currentOffsetIndexes = new ArrayList<>(); private final Compressor compressor; - RowGroupWriterImpl(String path, boolean append, SeekableChannelsProvider channelsProvider, MessageType type, - int pageSize, ByteBufferAllocator allocator, Compressor compressor) + RowGroupWriterImpl(String path, + boolean append, + SeekableChannelsProvider channelsProvider, + MessageType type, + int targetPageSize, + ByteBufferAllocator allocator, + Compressor compressor) throws IOException { - this(channelsProvider.getWriteChannel(path, append), type, pageSize, allocator, blockWithPath(path), + this(channelsProvider.getWriteChannel(path, append), type, targetPageSize, allocator, blockWithPath(path), compressor); } @@ -42,18 +47,24 @@ private static BlockMetaData blockWithPath(String path) { return blockMetaData; } - RowGroupWriterImpl(SeekableByteChannel writeChannel, MessageType type, int pageSize, ByteBufferAllocator allocator, + RowGroupWriterImpl(SeekableByteChannel writeChannel, + MessageType type, + int targetPageSize, + ByteBufferAllocator allocator, Compressor compressor) { - this(writeChannel, type, pageSize, allocator, new BlockMetaData(), compressor); + this(writeChannel, type, targetPageSize, allocator, new BlockMetaData(), compressor); } - private RowGroupWriterImpl(SeekableByteChannel writeChannel, MessageType type, int pageSize, - ByteBufferAllocator allocator, BlockMetaData blockMetaData, + private RowGroupWriterImpl(SeekableByteChannel writeChannel, + MessageType type, + int targetPageSize, + ByteBufferAllocator allocator, + BlockMetaData blockMetaData, Compressor compressor) { this.writeChannel = writeChannel; this.type = type; - this.pageSize = pageSize; + this.targetPageSize = targetPageSize; this.allocator = allocator; this.blockMetaData = blockMetaData; this.compressor = compressor; @@ -77,12 +88,16 @@ String[] getPrimitivePath(String columnName) { @Override public ColumnWriter addColumn(String columnName) { if (activeWriter != null) { - throw new RuntimeException( + throw new IllegalStateException( "There is already an active column writer for " + activeWriter.getColumn().getPath()[0] + " need to close that before opening a writer for " + columnName); } - activeWriter = new ColumnWriterImpl(this, writeChannel, type.getColumnDescription(getPrimitivePath(columnName)), - compressor, pageSize, allocator); + activeWriter = new ColumnWriterImpl(this, + writeChannel, + type.getColumnDescription(getPrimitivePath(columnName)), + compressor, + targetPageSize, + allocator); return activeWriter; } diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/DictionarySizeExceededException.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/DictionarySizeExceededException.java new file mode 100644 index 00000000000..e5c0fb37563 --- /dev/null +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/DictionarySizeExceededException.java @@ -0,0 +1,10 @@ +package io.deephaven.parquet.table; + +import io.deephaven.UncheckedDeephavenException; +import org.jetbrains.annotations.NotNull; + +final class DictionarySizeExceededException extends UncheckedDeephavenException { + public DictionarySizeExceededException(@NotNull final String message) { + super(message); + } +} diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/MappedSchema.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/MappedSchema.java index 0de735996d2..e8be584590d 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/MappedSchema.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/MappedSchema.java @@ -3,11 +3,10 @@ */ package io.deephaven.parquet.table; +import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ColumnDefinition; -import io.deephaven.engine.table.TableDefinition; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.rowset.TrackingRowSet; - +import io.deephaven.engine.table.TableDefinition; import org.apache.parquet.schema.MessageType; import org.apache.parquet.schema.Type; import org.apache.parquet.schema.Types; @@ -25,7 +24,7 @@ class MappedSchema { static MappedSchema create( final Map> computedCache, final TableDefinition definition, - final TrackingRowSet rowSet, + final RowSet rowSet, final Map> columnSourceMap, final ParquetInstructions instructions, final ColumnDefinition... extraColumns) { diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetInstructions.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetInstructions.java index 59b8a57ff24..e1e7e1c8984 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetInstructions.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetInstructions.java @@ -62,6 +62,32 @@ public static int getDefaultMaximumDictionaryKeys() { return defaultMaximumDictionaryKeys; } + private static final int MIN_DEFAULT_PAGE_SIZE = 64 << 10; + private static volatile int defaultTargetPageSize = 1 << 20; + + /** + * Set the default target page size (in bytes) used to section rows of data into pages during column writing. This + * number should be no smaller than {@value #MIN_DEFAULT_PAGE_SIZE}. + * + * @param newDefaultSizeBytes the new default target page size. + */ + public static void setDefaultTargetPageSize(final int newDefaultSizeBytes) { + if (newDefaultSizeBytes < MIN_DEFAULT_PAGE_SIZE) { + throw new IllegalArgumentException( + "Default target page size should be larger than " + MIN_DEFAULT_PAGE_SIZE + " bytes"); + } + defaultTargetPageSize = newDefaultSizeBytes; + } + + /** + * Get the current default target page size in bytes. + * + * @return the current default target page size in bytes. + */ + public static int getDefaultTargetPageSize() { + return defaultTargetPageSize; + } + public ParquetInstructions() {} public final String getColumnNameFromParquetColumnNameOrDefault(final String parquetColumnName) { @@ -96,6 +122,8 @@ public final String getColumnNameFromParquetColumnNameOrDefault(final String par public abstract boolean isLegacyParquet(); + public abstract int getTargetPageSize(); + @VisibleForTesting public static boolean sameColumnNamesAndCodecMappings(final ParquetInstructions i1, final ParquetInstructions i2) { if (i1 == EMPTY) { @@ -150,6 +178,11 @@ public int getMaximumDictionaryKeys() { public boolean isLegacyParquet() { return false; } + + @Override + public int getTargetPageSize() { + return defaultTargetPageSize; + } }; private static class ColumnInstructions { @@ -215,17 +248,21 @@ private static final class ReadOnly extends ParquetInstructions { private int maximumDictionaryKeys; private final boolean isLegacyParquet; - protected ReadOnly( + private final int targetPageSize; + + private ReadOnly( final KeyedObjectHashMap columnNameToInstructions, final KeyedObjectHashMap parquetColumnNameToColumnName, final String compressionCodecName, final int maximumDictionaryKeys, - final boolean isLegacyParquet) { + final boolean isLegacyParquet, + final int targetPageSize) { this.columnNameToInstructions = columnNameToInstructions; this.parquetColumnNameToInstructions = parquetColumnNameToColumnName; this.compressionCodecName = compressionCodecName; this.maximumDictionaryKeys = maximumDictionaryKeys; this.isLegacyParquet = isLegacyParquet; + this.targetPageSize = targetPageSize; } private String getOrDefault(final String columnName, final String defaultValue, @@ -299,6 +336,11 @@ public boolean isLegacyParquet() { return isLegacyParquet; } + @Override + public int getTargetPageSize() { + return targetPageSize; + } + KeyedObjectHashMap copyColumnNameToInstructions() { // noinspection unchecked return (columnNameToInstructions == null) @@ -347,6 +389,8 @@ public static class Builder { private int maximumDictionaryKeys = defaultMaximumDictionaryKeys; private boolean isLegacyParquet; + private int targetPageSize = defaultTargetPageSize; + public Builder() {} public Builder(final ParquetInstructions parquetInstructions) { @@ -492,6 +536,14 @@ public Builder setIsLegacyParquet(final boolean isLegacyParquet) { return this; } + public Builder setTargetPageSize(final int targetPageSize) { + if (targetPageSize < MIN_DEFAULT_PAGE_SIZE) { + throw new IllegalArgumentException("Target page size should be >= " + MIN_DEFAULT_PAGE_SIZE); + } + this.targetPageSize = targetPageSize; + return this; + } + public ParquetInstructions build() { final KeyedObjectHashMap columnNameToInstructionsOut = columnNameToInstructions; columnNameToInstructions = null; @@ -499,7 +551,7 @@ public ParquetInstructions build() { parquetColumnNameToInstructions; parquetColumnNameToInstructions = null; return new ReadOnly(columnNameToInstructionsOut, parquetColumnNameToColumnNameOut, compressionCodecName, - maximumDictionaryKeys, isLegacyParquet); + maximumDictionaryKeys, isLegacyParquet, targetPageSize); } } diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetTableWriter.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetTableWriter.java index 7bb2a9aa83b..5bcf98fe882 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetTableWriter.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/ParquetTableWriter.java @@ -3,46 +3,51 @@ */ package io.deephaven.parquet.table; +import gnu.trove.impl.Constants; +import gnu.trove.list.array.TIntArrayList; +import gnu.trove.map.hash.TObjectIntHashMap; import io.deephaven.UncheckedDeephavenException; import io.deephaven.api.ColumnName; import io.deephaven.api.RawString; import io.deephaven.api.Selectable; import io.deephaven.api.agg.Aggregation; +import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.*; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.engine.liveness.LivenessScopeStack; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.RowSet; +import io.deephaven.engine.rowset.TrackingRowSet; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.CodecLookup; -import io.deephaven.engine.util.BigDecimalUtils; -import io.deephaven.vector.Vector; -import io.deephaven.stringset.StringSet; -import io.deephaven.time.DateTime; import io.deephaven.engine.table.impl.QueryTable; -import io.deephaven.parquet.table.util.TrackedSeekableChannelsProvider; -import io.deephaven.parquet.table.metadata.CodecInfo; -import io.deephaven.parquet.table.metadata.ColumnTypeInfo; -import io.deephaven.parquet.table.metadata.GroupingColumnInfo; -import io.deephaven.parquet.table.metadata.TableInfo; import io.deephaven.engine.table.impl.select.FormulaColumn; import io.deephaven.engine.table.impl.select.NullSelectColumn; import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.select.SourceColumn; import io.deephaven.engine.table.impl.sources.ReinterpretUtils; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.chunk.*; -import io.deephaven.engine.rowset.RowSet; -import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.TrackingRowSet; -import io.deephaven.util.QueryConstants; -import io.deephaven.util.codec.ObjectCodec; -import io.deephaven.util.type.TypeUtils; +import io.deephaven.engine.util.BigDecimalUtils; import io.deephaven.parquet.base.ColumnWriter; import io.deephaven.parquet.base.ParquetFileWriter; import io.deephaven.parquet.base.RowGroupWriter; -import org.apache.commons.lang3.mutable.MutableBoolean; -import org.apache.commons.lang3.mutable.MutableInt; -import org.apache.commons.lang3.mutable.MutableObject; +import io.deephaven.parquet.table.metadata.CodecInfo; +import io.deephaven.parquet.table.metadata.ColumnTypeInfo; +import io.deephaven.parquet.table.metadata.GroupingColumnInfo; +import io.deephaven.parquet.table.metadata.TableInfo; +import io.deephaven.parquet.table.util.TrackedSeekableChannelsProvider; +import io.deephaven.stringset.StringSet; +import io.deephaven.time.DateTime; +import io.deephaven.util.QueryConstants; +import io.deephaven.util.SafeCloseable; +import io.deephaven.util.annotations.VisibleForTesting; +import io.deephaven.util.codec.ObjectCodec; +import io.deephaven.util.type.TypeUtils; +import io.deephaven.vector.Vector; import org.apache.commons.lang3.tuple.Pair; import org.apache.parquet.bytes.HeapByteBufferAllocator; import org.apache.parquet.io.api.Binary; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.IOException; @@ -53,14 +58,14 @@ import java.nio.file.Paths; import java.util.*; import java.util.function.Function; -import java.util.function.Supplier; +import java.util.function.LongSupplier; + +import static io.deephaven.util.QueryConstants.NULL_INT; /** * API for writing DH tables in parquet format */ public class ParquetTableWriter { - - private static final int PAGE_SIZE = 1 << 20; private static final int INITIAL_DICTIONARY_SIZE = 1 << 8; public static final String METADATA_KEY = "deephaven"; @@ -73,14 +78,34 @@ public class ParquetTableWriter { public static final String PARQUET_FILE_EXTENSION = ".parquet"; - private static String minusParquetSuffix(final String s) { + enum CacheTags { + DECIMAL_ARGS + } + + /** + * Classes that implement this interface are responsible for converting data from individual DH columns into buffers + * to be written out to the Parquet file. + * + * @param + */ + interface TransferObject extends SafeCloseable { + void propagateChunkData(); + + B getBuffer(); + + int rowCount(); + + void fetchData(RowSequence rs); + } + + private static String minusParquetSuffix(@NotNull final String s) { if (s.endsWith(PARQUET_FILE_EXTENSION)) { return s.substring(0, s.length() - PARQUET_FILE_EXTENSION.length()); } return s; } - public static Function defaultGroupingFileName(final String path) { + public static Function defaultGroupingFileName(@NotNull final String path) { final String prefix = minusParquetSuffix(path); return columnName -> prefix + "_" + columnName + "_grouping.parquet"; } @@ -91,7 +116,7 @@ public static Function defaultGroupingFileName(final String path * @param t The table to write * @param path The destination path * @param incomingMeta A map of metadata values to be stores in the file footer - * @param groupingPathFactory + * @param groupingPathFactory a factory to construct paths for grouping tables. * @param groupingColumns List of columns the tables are grouped by (the write operation will store the grouping * info) * @throws SchemaMappingException Error creating a parquet table schema for the given table (likely due to @@ -99,17 +124,27 @@ public static Function defaultGroupingFileName(final String path * @throws IOException For file writing related errors */ public static void write( - Table t, - String path, - Map incomingMeta, - Function groupingPathFactory, - String... groupingColumns) throws SchemaMappingException, IOException { + @NotNull final Table t, + @NotNull final String path, + @NotNull final Map incomingMeta, + @NotNull final Function groupingPathFactory, + @NotNull final String... groupingColumns) throws SchemaMappingException, IOException { write(t, t.getDefinition(), ParquetInstructions.EMPTY, path, incomingMeta, groupingPathFactory, groupingColumns); } - public static void write(Table t, String path, Map incomingMeta, String... groupingColumns) - throws SchemaMappingException, IOException { + /** + * Writes a table in parquet format under a given path + * + * @param t the table to write + * @param path the destination path + * @param incomingMeta any metadata to include in the parquet metadata + * @param groupingColumns the grouping columns (if any) + */ + public static void write(@NotNull final Table t, + @NotNull final String path, + @NotNull final Map incomingMeta, + @NotNull final String... groupingColumns) throws SchemaMappingException, IOException { write(t, path, incomingMeta, defaultGroupingFileName(path), groupingColumns); } @@ -121,7 +156,7 @@ public static void write(Table t, String path, Map incomingMeta, * @param writeInstructions Write instructions for customizations while writing * @param destPathName The destination path * @param incomingMeta A map of metadata values to be stores in the file footer - * @param groupingPathFactory + * @param groupingPathFactory a factory for constructing paths for grouping tables * @param groupingColumns List of columns the tables are grouped by (the write operation will store the grouping * info) * @throws SchemaMappingException Error creating a parquet table schema for the given table (likely due to @@ -129,20 +164,22 @@ public static void write(Table t, String path, Map incomingMeta, * @throws IOException For file writing related errors */ public static void write( - final Table t, - final TableDefinition definition, - final ParquetInstructions writeInstructions, - final String destPathName, - final Map incomingMeta, - final Function groupingPathFactory, - final String... groupingColumns) throws SchemaMappingException, IOException { + @NotNull final Table t, + @NotNull final TableDefinition definition, + @NotNull final ParquetInstructions writeInstructions, + @NotNull final String destPathName, + @NotNull final Map incomingMeta, + @NotNull final Function groupingPathFactory, + @NotNull final String... groupingColumns) throws SchemaMappingException, IOException { final TableInfo.Builder tableInfoBuilder = TableInfo.builder(); ArrayList cleanupPaths = null; try { if (groupingColumns.length > 0) { cleanupPaths = new ArrayList<>(groupingColumns.length); final Table[] auxiliaryTables = Arrays.stream(groupingColumns) - .map(columnName -> groupingAsTable(t, columnName)).toArray(Table[]::new); + .map(columnName -> groupingAsTable(t, columnName)) + .toArray(Table[]::new); + final Path destDirPath = Paths.get(destPathName).getParent(); for (int gci = 0; gci < auxiliaryTables.length; ++gci) { final String parquetColumnName = @@ -158,12 +195,11 @@ public static void write( write(t, definition, writeInstructions, destPathName, incomingMeta, tableInfoBuilder); } catch (Exception e) { if (cleanupPaths != null) { - for (String cleanupPath : cleanupPaths) { + for (final String cleanupPath : cleanupPaths) { try { // noinspection ResultOfMethodCallIgnored new File(cleanupPath).delete(); - } catch (Exception x) { - // ignore. + } catch (Exception ignored) { } } } @@ -171,14 +207,23 @@ public static void write( } } + /** + * Writes a table in parquet format under a given path + * + * @param t the table to write + * @param definition the writable table definition + * @param writeInstructions the parquet instructions for writing + * @param path the path to write to + * @param incomingMeta any metadata to include ih the parquet metadata + * @param groupingColumns the grouping columns (if any) + */ public static void write( - final Table t, - final TableDefinition definition, - final ParquetInstructions writeInstructions, - final String path, - final Map incomingMeta, - final String... groupingColumns) - throws SchemaMappingException, IOException { + @NotNull final Table t, + @NotNull final TableDefinition definition, + @NotNull final ParquetInstructions writeInstructions, + @NotNull final String path, + @NotNull final Map incomingMeta, + @NotNull final String... groupingColumns) throws SchemaMappingException, IOException { write(t, definition, writeInstructions, path, incomingMeta, defaultGroupingFileName(path), groupingColumns); } @@ -196,33 +241,54 @@ public static void write( * @throws IOException For file writing related errors */ public static void write( - final Table table, - final TableDefinition definition, - final ParquetInstructions writeInstructions, - final String path, - final Map tableMeta, - final TableInfo.Builder tableInfoBuilder) throws SchemaMappingException, IOException { - - final Table t = pretransformTable(table, definition); - final TrackingRowSet tableRowSet = t.getRowSet(); - final Map> columnSourceMap = t.getColumnSourceMap(); - // When we need to perform some computation depending on column data to make a decision impacting both - // schema and written data, we store results in computedCache to avoid having to calculate twice. - // An example is the necessary precision and scale for a BigDecimal column writen as decimal logical type. - final Map> computedCache = new HashMap<>(); - final ParquetFileWriter parquetFileWriter = getParquetFileWriter(computedCache, definition, tableRowSet, - columnSourceMap, path, writeInstructions, tableMeta, - tableInfoBuilder); - final long nrows = t.size(); - if (nrows > 0) { - RowGroupWriter rowGroupWriter = parquetFileWriter.addRowGroup(nrows); - // noinspection rawtypes - for (Map.Entry nameToSource : columnSourceMap.entrySet()) { - String name = nameToSource.getKey(); - // noinspection rawtypes - ColumnSource columnSource = nameToSource.getValue(); + @NotNull final Table table, + @NotNull final TableDefinition definition, + @NotNull final ParquetInstructions writeInstructions, + @NotNull final String path, + @NotNull final Map tableMeta, + @NotNull final TableInfo.Builder tableInfoBuilder) throws SchemaMappingException, IOException { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { + final Table t = pretransformTable(table, definition); + final TrackingRowSet tableRowSet = t.getRowSet(); + final Map> columnSourceMap = t.getColumnSourceMap(); + // When we need to perform some computation depending on column data to make a decision impacting both + // schema and written data, we store results in computedCache to avoid having to calculate twice. + // An example is the necessary precision and scale for a BigDecimal column writen as decimal logical type. + final Map> computedCache = new HashMap<>(); + final ParquetFileWriter parquetFileWriter = getParquetFileWriter(computedCache, definition, tableRowSet, + columnSourceMap, path, writeInstructions, tableMeta, + tableInfoBuilder); + + write(t, definition, writeInstructions, parquetFileWriter, computedCache); + } + } + + /** + * Writes a table in parquet format under a given path. This method should only be invoked when wrapped in a + * try-with-resources using a new {@link LivenessScopeStack#open() LivenessScope} to ensure that the various derived + * tables created are properly cleaned up. + * + * @param table The table to write + * @param definition The table definition + * @param writeInstructions Write instructions for customizations while writing + * @param parquetFileWriter the writer + * @throws IOException For file writing related errors + */ + private static void write( + @NotNull final Table table, + @NotNull final TableDefinition definition, + @NotNull final ParquetInstructions writeInstructions, + @NotNull final ParquetFileWriter parquetFileWriter, + @NotNull final Map> computedCache) throws IOException { + final TrackingRowSet tableRowSet = table.getRowSet(); + final Map> columnSourceMap = table.getColumnSourceMap(); + final long nRows = table.size(); + if (nRows > 0) { + final RowGroupWriter rowGroupWriter = parquetFileWriter.addRowGroup(nRows); + for (final Map.Entry> nameToSource : columnSourceMap.entrySet()) { + final String name = nameToSource.getKey(); + final ColumnSource columnSource = nameToSource.getValue(); try { - // noinspection unchecked writeColumnSource(computedCache, tableRowSet, rowGroupWriter, name, columnSource, definition.getColumn(name), writeInstructions); } catch (IllegalAccessException e) { @@ -234,13 +300,22 @@ public static void write( parquetFileWriter.close(); } - private static Table pretransformTable(final Table table, final TableDefinition definition) { - List updateViewColumnsTransform = new ArrayList<>(); - List viewColumnsTransform = new ArrayList<>(); - Table t = table; - for (ColumnDefinition column : definition.getColumns()) { + /** + * Detect any missing or StringSet columns and convert them to arrays / null values as appropriate to prepare the + * input table to be written to the parquet file. + * + * @param table the input table + * @param definition the table definition being written + * @return a transformed view of the input table. + */ + @NotNull + private static Table pretransformTable(@NotNull final Table table, @NotNull final TableDefinition definition) { + final List updateViewColumnsTransform = new ArrayList<>(); + final List viewColumnsTransform = new ArrayList<>(); + + for (final ColumnDefinition column : definition.getColumns()) { final String colName = column.getName(); - if (t.hasColumns(colName)) { + if (table.hasColumns(colName)) { if (StringSet.class.isAssignableFrom(column.getDataType())) { updateViewColumnsTransform.add(FormulaColumn.createFormulaColumn(colName, colName + ".values()")); } @@ -251,33 +326,48 @@ private static Table pretransformTable(final Table table, final TableDefinition column.getDataType(), column.getComponentType(), colName)); } } - if (viewColumnsTransform.size() > 0) { - t = t.view(viewColumnsTransform.toArray((SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY))); - } - if (updateViewColumnsTransform.size() > 0) { - t = t.updateView(updateViewColumnsTransform.toArray(SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY)); + + Table transformed = table; + if (!viewColumnsTransform.isEmpty()) { + transformed = + transformed.view(viewColumnsTransform.toArray((SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY))); } - return t; - } - enum CacheTags { - DECIMAL_ARGS + if (!updateViewColumnsTransform.isEmpty()) { + transformed = transformed + .updateView(updateViewColumnsTransform.toArray(SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY)); + } + return transformed; } + /** + * Create a {@link ParquetFileWriter} for writing the table to disk. + * + * @param computedCache Per column cache tags + * @param definition the writable definition + * @param tableRowSet the row set being written + * @param columnSourceMap the columns of the table + * @param path the destination to write to + * @param writeInstructions write instructions for the file + * @param tableMeta metadata to include in the parquet metadata + * @param tableInfoBuilder a builder for accumulating per-column information to construct the deephaven metadata + * + * @return a new file writer + */ @NotNull private static ParquetFileWriter getParquetFileWriter( - final Map> computedCache, - final TableDefinition definition, - final TrackingRowSet tableRowSet, - final Map> columnSourceMap, - final String path, - final ParquetInstructions writeInstructions, - final Map tableMeta, - final TableInfo.Builder tableInfoBuilder) throws IOException { + @NotNull final Map> computedCache, + @NotNull final TableDefinition definition, + @NotNull final RowSet tableRowSet, + @NotNull final Map> columnSourceMap, + @NotNull final String path, + @NotNull final ParquetInstructions writeInstructions, + @NotNull final Map tableMeta, + @NotNull final TableInfo.Builder tableInfoBuilder) throws IOException { + // First, map the TableDefinition to a parquet Schema final MappedSchema mappedSchema = MappedSchema.create(computedCache, definition, tableRowSet, columnSourceMap, writeInstructions); - final Map extraMetaData = new HashMap<>(tableMeta); for (final ColumnDefinition column : definition.getColumns()) { final String colName = column.getName(); final ColumnTypeInfo.Builder columnInfoBuilder = ColumnTypeInfo.builder() @@ -307,100 +397,118 @@ private static ParquetFileWriter getParquetFileWriter( columnInfoBuilder.specialType(ColumnTypeInfo.SpecialType.Vector); usedColumnInfo = true; } + if (usedColumnInfo) { tableInfoBuilder.addColumnTypes(columnInfoBuilder.build()); } } + + final Map extraMetaData = new HashMap<>(tableMeta); extraMetaData.put(METADATA_KEY, tableInfoBuilder.build().serializeToJSON()); - return new ParquetFileWriter(path, TrackedSeekableChannelsProvider.getInstance(), PAGE_SIZE, + return new ParquetFileWriter(path, TrackedSeekableChannelsProvider.getInstance(), + writeInstructions.getTargetPageSize(), new HeapByteBufferAllocator(), mappedSchema.getParquetSchema(), writeInstructions.getCompressionCodecName(), extraMetaData); } - private static void writeColumnSource( - final Map> computedCache, - final TrackingRowSet tableRowSet, - final RowGroupWriter rowGroupWriter, - final String name, - final ColumnSource columnSourceIn, - final ColumnDefinition columnDefinition, - final ParquetInstructions writeInstructions) throws IllegalAccessException, IOException { + @VisibleForTesting + static void writeColumnSource( + @NotNull final Map> computedCache, + @NotNull final TrackingRowSet tableRowSet, + @NotNull final RowGroupWriter rowGroupWriter, + @NotNull final String name, + @NotNull final ColumnSource columnSourceIn, + @NotNull final ColumnDefinition columnDefinition, + @NotNull final ParquetInstructions writeInstructions) throws IllegalAccessException, IOException { RowSet rowSet = tableRowSet; ColumnSource columnSource = columnSourceIn; ColumnSource lengthSource = null; - RowSet lengthRowSet = null; - int targetSize = getTargetSize(columnSource.getType()); - Supplier rowStepGetter; - Supplier valuesStepGetter; - int stepsCount; + LongSupplier rowStepGetter; + LongSupplier valuesStepGetter; + + int maxValuesPerPage = 0; + int maxOriginalRowsPerPage = 0; + int pageCount; if (columnSource.getComponentType() != null && !CodecLookup.explicitCodecPresent(writeInstructions.getCodecName(columnDefinition.getName())) && !CodecLookup.codecRequired(columnDefinition)) { - targetSize = getTargetSize(columnSource.getComponentType()); - HashMap> columns = new HashMap<>(); + final int targetRowsPerPage = getTargetRowsPerPage(columnSource.getComponentType(), + writeInstructions.getTargetPageSize()); + final HashMap> columns = new HashMap<>(); columns.put("array", columnSource); - Table t = new QueryTable(tableRowSet, columns); - lengthSource = t - .view("len= ((Object)array) == null?null:(int)array." + final Table lengthsTable = new QueryTable(tableRowSet, columns); + lengthSource = lengthsTable + .view("len= ((Object)array) == null ? null : (int)array." + (Vector.class.isAssignableFrom(columnSource.getType()) ? "size()" : "length")) .getColumnSource("len"); - lengthRowSet = tableRowSet; - List valueChunkSize = new ArrayList<>(); - List originalChunkSize = new ArrayList<>(); - int runningSize = 0; - int originalRowsCount = 0; + + // These two lists are parallel, where each element represents a single page. The rawItemCountPerPage + // contains the number of items (the sum of the array sizes for each containing row) contained within the + // page. + final TIntArrayList rawItemCountPerPage = new TIntArrayList(); + + // The originalRowsPerPage contains the number of arrays (rows) from the original table contained within + // the page. + final TIntArrayList originalRowsPerPage = new TIntArrayList(); + + // This is the count of items contained in all arrays from the original table as we process. + int totalItemsInPage = 0; + + // This is the count of rows in the original table as we process them + int originalRowsInPage = 0; try (final ChunkSource.GetContext context = lengthSource.makeGetContext(LOCAL_CHUNK_SIZE); final RowSequence.Iterator it = rowSet.getRowSequenceIterator()) { while (it.hasMore()) { - RowSequence rs = it.getNextRowSequenceWithLength(LOCAL_CHUNK_SIZE); - // noinspection unchecked - IntChunk chunk = (IntChunk) lengthSource.getChunk(context, rs); - for (int i = 0; i < chunk.size(); i++) { - if (chunk.get(i) != Integer.MIN_VALUE) { - if (runningSize + chunk.get(i) > targetSize || originalRowsCount + 1 > targetSize) { - if (runningSize > targetSize) { - targetSize = chunk.get(i); - } - valueChunkSize.add(runningSize); - originalChunkSize.add(originalRowsCount); - originalRowsCount = 0; - runningSize = 0; + final RowSequence rs = it.getNextRowSequenceWithLength(LOCAL_CHUNK_SIZE); + final IntChunk lengthChunk = lengthSource.getChunk(context, rs).asIntChunk(); + for (int chunkPos = 0; chunkPos < lengthChunk.size(); chunkPos++) { + final int curLength = lengthChunk.get(chunkPos); + if (curLength != NULL_INT) { + // If this array puts us past the target number of items within a page then we'll record the + // current values into the page lists above and restart our counts. + if (((totalItemsInPage + curLength > targetRowsPerPage) || + (originalRowsInPage + 1 > targetRowsPerPage)) && + (totalItemsInPage > 0 || originalRowsInPage > 0)) { + // Record the current item count and original row count into the parallel page arrays. + rawItemCountPerPage.add(totalItemsInPage); + originalRowsPerPage.add(originalRowsInPage); + maxValuesPerPage = Math.max(totalItemsInPage, maxValuesPerPage); + maxOriginalRowsPerPage = Math.max(originalRowsInPage, maxOriginalRowsPerPage); + + // Reset the counts to compute these values for the next page. + originalRowsInPage = 0; + totalItemsInPage = 0; } - runningSize += chunk.get(i); + totalItemsInPage += curLength; } - originalRowsCount++; + originalRowsInPage++; } } } - if (originalRowsCount > 0) { - valueChunkSize.add(runningSize); - originalChunkSize.add(originalRowsCount); + + // If there are any leftover, accumulate the last page. + if (originalRowsInPage > 0) { + maxValuesPerPage = Math.max(totalItemsInPage, maxValuesPerPage); + maxOriginalRowsPerPage = Math.max(originalRowsInPage, maxOriginalRowsPerPage); + rawItemCountPerPage.add(totalItemsInPage); + originalRowsPerPage.add(originalRowsInPage); } - rowStepGetter = new Supplier<>() { - int step; - @Override - public Integer get() { - return originalChunkSize.get(step++); - } - }; - valuesStepGetter = new Supplier<>() { - int step; + rowStepGetter = originalRowsPerPage.iterator()::next; + valuesStepGetter = rawItemCountPerPage.iterator()::next; - @Override - public Integer get() { - return valueChunkSize.get(step++); - } - }; - stepsCount = valueChunkSize.size(); - Table array = t.ungroup("array"); - rowSet = array.getRowSet(); - columnSource = array.getColumnSource("array"); + pageCount = rawItemCountPerPage.size(); + final Table ungroupedArrays = lengthsTable.ungroup("array"); + rowSet = ungroupedArrays.getRowSet(); + columnSource = ungroupedArrays.getColumnSource("array"); } else { - int finalTargetSize = targetSize; + final int finalTargetSize = getTargetRowsPerPage(columnSource.getType(), + writeInstructions.getTargetPageSize()); rowStepGetter = valuesStepGetter = () -> finalTargetSize; - stepsCount = (int) (rowSet.size() / finalTargetSize + ((rowSet.size() % finalTargetSize) == 0 ? 0 : 1)); + maxValuesPerPage = maxOriginalRowsPerPage = (int) Math.min(rowSet.size(), finalTargetSize); + pageCount = (int) (rowSet.size() / finalTargetSize + ((rowSet.size() % finalTargetSize) == 0 ? 0 : 1)); } + Class columnType = columnSource.getType(); if (columnType == DateTime.class) { // noinspection unchecked @@ -411,226 +519,262 @@ public Integer get() { columnSource = (ColumnSource) ReinterpretUtils.booleanToByteSource(columnSource); } - ColumnWriter columnWriter = rowGroupWriter.addColumn( - writeInstructions.getParquetColumnNameFromColumnNameOrDefault(name)); + try (final ColumnWriter columnWriter = rowGroupWriter.addColumn( + writeInstructions.getParquetColumnNameFromColumnNameOrDefault(name))) { + boolean usedDictionary = false; + if (columnSource.getType() == String.class) { + usedDictionary = tryEncodeDictionary(writeInstructions, + tableRowSet, + rowSet, + columnDefinition, + columnWriter, + columnSource, + lengthSource, + rowStepGetter, + valuesStepGetter, + maxValuesPerPage, + maxOriginalRowsPerPage, + pageCount); + } - boolean usedDictionary = false; - if (supportsDictionary(columnSource.getType())) { - final boolean useDictionaryHint = writeInstructions.useDictionary(columnDefinition.getName()); - final int maxKeys = useDictionaryHint ? Integer.MAX_VALUE : writeInstructions.getMaximumDictionaryKeys(); - final class DictionarySizeExceededException extends RuntimeException { + if (!usedDictionary) { + encodePlain(writeInstructions, + tableRowSet, + rowSet, + columnDefinition, + columnType, + columnWriter, + columnSource, + lengthSource, + rowStepGetter, + valuesStepGetter, + computedCache, + maxValuesPerPage, + maxOriginalRowsPerPage, + pageCount); } - try { - final List buffersPerPage = new ArrayList<>(); - final Function keyArrayBuilder = getKeyArrayBuilder(columnSource.getType()); - final Function toParquetPrimitive = getToParquetConversion(columnSource.getType()); - final MutableObject keys = - new MutableObject<>(keyArrayBuilder.apply(Math.min(INITIAL_DICTIONARY_SIZE, maxKeys))); - final Map keyToPos = new HashMap<>(); - final MutableInt keyCount = new MutableInt(0); - final MutableBoolean hasNulls = new MutableBoolean(false); - try (final ChunkSource.GetContext context = columnSource.makeGetContext(targetSize); - final RowSequence.Iterator it = rowSet.getRowSequenceIterator()) { - for (int step = 0; step < stepsCount; step++) { - final RowSequence rs = it.getNextRowSequenceWithLength(valuesStepGetter.get()); - // noinspection unchecked - final ObjectChunk chunk = - (ObjectChunk) columnSource.getChunk(context, rs); - final IntBuffer posInDictionary = IntBuffer.allocate((int) rs.size()); - for (int vi = 0; vi < chunk.size(); ++vi) { - posInDictionary.put(keyToPos.computeIfAbsent(chunk.get(vi), o -> { - if (o == null) { - hasNulls.setValue(true); - return Integer.MIN_VALUE; - } - if (keyCount.intValue() == keys.getValue().length) { - if (keyCount.intValue() == maxKeys) { - throw new DictionarySizeExceededException(); - } - keys.setValue(Arrays.copyOf(keys.getValue(), - (int) Math.min(keyCount.intValue() * 2L, maxKeys))); - } - keys.getValue()[keyCount.intValue()] = toParquetPrimitive.apply(o); - Integer result = keyCount.getValue(); - keyCount.increment(); - return result; - })); + } + } - } - buffersPerPage.add(posInDictionary); - } - } - List repeatCount = null; - if (lengthSource != null) { - repeatCount = new ArrayList<>(); - try (final ChunkSource.GetContext context = lengthSource.makeGetContext(targetSize); - final RowSequence.Iterator it = lengthRowSet.getRowSequenceIterator()) { - while (it.hasMore()) { - final RowSequence rs = it.getNextRowSequenceWithLength(rowStepGetter.get()); - // noinspection unchecked - final IntChunk chunk = (IntChunk) lengthSource.getChunk(context, rs); - final IntBuffer newBuffer = IntBuffer.allocate(chunk.size()); - chunk.copyToTypedBuffer(0, newBuffer, 0, chunk.size()); - newBuffer.limit(chunk.size()); - repeatCount.add(newBuffer); - } - } - } - columnWriter.addDictionaryPage(keys.getValue(), keyCount.intValue()); - final Iterator repeatCountIt = repeatCount == null ? null : repeatCount.iterator(); - for (final IntBuffer intBuffer : buffersPerPage) { - intBuffer.flip(); - if (lengthSource != null) { - columnWriter.addVectorPage(intBuffer, repeatCountIt.next(), intBuffer.remaining(), - Integer.MIN_VALUE); - } else if (hasNulls.getValue()) { - columnWriter.addPage(intBuffer, Integer.MIN_VALUE, intBuffer.remaining()); + private static void encodePlain(@NotNull final ParquetInstructions writeInstructions, + @NotNull final RowSet originalRowSet, + @NotNull final RowSet dataRowSet, + @NotNull final ColumnDefinition columnDefinition, + @NotNull final Class columnType, + @NotNull final ColumnWriter columnWriter, + @NotNull final ColumnSource dataSource, + @Nullable final ColumnSource lengthSource, + @NotNull final LongSupplier rowStepGetter, + @NotNull final LongSupplier valuesStepGetter, + @NotNull final Map> computedCache, + final int maxValuesPerPage, + final int maxOriginalRowsPerPage, + final int pageCount) throws IOException { + try (final TransferObject transferObject = getDestinationBuffer(computedCache, + originalRowSet, + dataSource, + columnDefinition, + maxValuesPerPage, + columnType, + writeInstructions)) { + final boolean supportNulls = supportNulls(columnType); + final Object bufferToWrite = transferObject.getBuffer(); + try (final RowSequence.Iterator lengthIndexIt = + lengthSource != null ? originalRowSet.getRowSequenceIterator() : null; + final ChunkSource.GetContext lengthSourceContext = + lengthSource != null ? lengthSource.makeGetContext(maxOriginalRowsPerPage) : null; + final RowSequence.Iterator it = dataRowSet.getRowSequenceIterator()) { + + final IntBuffer repeatCount = lengthSource != null ? IntBuffer.allocate(maxOriginalRowsPerPage) : null; + for (int step = 0; step < pageCount; ++step) { + final RowSequence rs = it.getNextRowSequenceWithLength(valuesStepGetter.getAsLong()); + transferObject.fetchData(rs); + transferObject.propagateChunkData(); + if (lengthIndexIt != null) { + final IntChunk lenChunk = lengthSource.getChunk( + lengthSourceContext, + lengthIndexIt.getNextRowSequenceWithLength(rowStepGetter.getAsLong())).asIntChunk(); + lenChunk.copyToTypedBuffer(0, repeatCount, 0, lenChunk.size()); + repeatCount.limit(lenChunk.size()); + columnWriter.addVectorPage(bufferToWrite, repeatCount, transferObject.rowCount()); + repeatCount.clear(); + } else if (supportNulls) { + columnWriter.addPage(bufferToWrite, transferObject.rowCount()); } else { - columnWriter.addPageNoNulls(intBuffer, intBuffer.remaining()); + columnWriter.addPageNoNulls(bufferToWrite, transferObject.rowCount()); } } - usedDictionary = true; - } catch (DictionarySizeExceededException ignored) { } } - if (!usedDictionary) { - try (final TransferObject transferObject = - getDestinationBuffer(computedCache, tableRowSet, columnSource, columnDefinition, targetSize, - columnType, writeInstructions)) { - final boolean supportNulls = supportNulls(columnType); - final Object bufferToWrite = transferObject.getBuffer(); - final Object nullValue = getNullValue(columnType); - try (final RowSequence.Iterator lengthIndexIt = - lengthRowSet != null ? lengthRowSet.getRowSequenceIterator() : null; - final ChunkSource.GetContext lengthSourceContext = - lengthSource != null ? lengthSource.makeGetContext(targetSize) : null; - final RowSequence.Iterator it = rowSet.getRowSequenceIterator()) { - final IntBuffer repeatCount = lengthSource != null ? IntBuffer.allocate(targetSize) : null; - for (int step = 0; step < stepsCount; ++step) { - final RowSequence rs = it.getNextRowSequenceWithLength(valuesStepGetter.get()); - transferObject.fetchData(rs); - transferObject.propagateChunkData(); - if (lengthIndexIt != null) { - // noinspection unchecked - final IntChunk lenChunk = (IntChunk) lengthSource.getChunk( - lengthSourceContext, - lengthIndexIt.getNextRowSequenceWithLength(rowStepGetter.get())); - lenChunk.copyToTypedBuffer(0, repeatCount, 0, lenChunk.size()); - repeatCount.limit(lenChunk.size()); - columnWriter.addVectorPage(bufferToWrite, repeatCount, transferObject.rowCount(), - nullValue); - repeatCount.clear(); - } else if (supportNulls) { - columnWriter.addPage(bufferToWrite, nullValue, transferObject.rowCount()); - } else { - columnWriter.addPageNoNulls(bufferToWrite, transferObject.rowCount()); + } + + private static boolean tryEncodeDictionary(@NotNull final ParquetInstructions writeInstructions, + @NotNull final RowSet originalRowSet, + @NotNull final RowSet dataRowSet, + @NotNull final ColumnDefinition columnDefinition, + @NotNull final ColumnWriter columnWriter, + @NotNull final ColumnSource dataSource, + @Nullable final ColumnSource lengthSource, + @NotNull final LongSupplier rowStepGetter, + @NotNull final LongSupplier valuesStepGetter, + final int maxRowsPerPage, + final int maxOriginalRowsPerPage, + final int pageCount) throws IOException { + // Note: We only support strings as dictionary pages. Knowing that, we can make some assumptions about chunk + // types and avoid a bunch of lambda and virtual method invocations. If we decide to support more, than + // these assumptions will need to be revisited. + Assert.eq(dataSource.getType(), "dataSource.getType()", String.class, "ColumnSource supports dictionary"); + + final boolean useDictionaryHint = writeInstructions.useDictionary(columnDefinition.getName()); + final int maxKeys = useDictionaryHint ? Integer.MAX_VALUE : writeInstructions.getMaximumDictionaryKeys(); + try { + final List pageBuffers = new ArrayList<>(); + Binary[] encodedKeys = new Binary[Math.min(INITIAL_DICTIONARY_SIZE, maxKeys)]; + + final TObjectIntHashMap keyToPos = + new TObjectIntHashMap<>(Constants.DEFAULT_CAPACITY, + Constants.DEFAULT_LOAD_FACTOR, + QueryConstants.NULL_INT); + int keyCount = 0; + boolean hasNulls = false; + try (final ChunkSource.GetContext context = dataSource.makeGetContext(maxRowsPerPage); + final RowSequence.Iterator it = dataRowSet.getRowSequenceIterator()) { + for (int curPage = 0; curPage < pageCount; curPage++) { + final RowSequence rs = it.getNextRowSequenceWithLength(valuesStepGetter.getAsLong()); + final ObjectChunk chunk = + dataSource.getChunk(context, rs).asObjectChunk(); + final IntBuffer posInDictionary = IntBuffer.allocate(rs.intSize()); + for (int vi = 0; vi < chunk.size(); ++vi) { + final String key = chunk.get(vi); + int dictionaryPos = keyToPos.get(key); + if (dictionaryPos == keyToPos.getNoEntryValue()) { + if (key == null) { + hasNulls = true; + } else { + if (keyCount == encodedKeys.length) { + if (keyCount >= maxKeys) { + throw new DictionarySizeExceededException( + "Dictionary maximum size exceeded for " + columnDefinition.getName()); + } + + encodedKeys = Arrays.copyOf(encodedKeys, (int) Math.min(keyCount * 2L, maxKeys)); + } + encodedKeys[keyCount] = Binary.fromString(key); + dictionaryPos = keyCount; + keyCount++; + } + keyToPos.put(key, dictionaryPos); } + posInDictionary.put(dictionaryPos); } + pageBuffers.add(posInDictionary); } } - } - columnWriter.close(); - } - private static Function getToParquetConversion(Class type) { - if (type == String.class) { - // noinspection unchecked,rawtypes - return (Function) (Function) Binary::fromString; - } - throw new UnsupportedOperationException("Dictionary storage not supported for " + type); - } + List arraySizeBuffers = null; + if (lengthSource != null) { + arraySizeBuffers = new ArrayList<>(); + try (final ChunkSource.GetContext context = lengthSource.makeGetContext(maxOriginalRowsPerPage); + final RowSequence.Iterator it = originalRowSet.getRowSequenceIterator()) { + while (it.hasMore()) { + final RowSequence rs = it.getNextRowSequenceWithLength(rowStepGetter.getAsLong()); + final IntChunk chunk = lengthSource.getChunk(context, rs).asIntChunk(); + final IntBuffer newBuffer = IntBuffer.allocate(chunk.size()); + chunk.copyToTypedBuffer(0, newBuffer, 0, chunk.size()); + newBuffer.limit(chunk.size()); + arraySizeBuffers.add(newBuffer); + } + } + } - private static Function getKeyArrayBuilder(Class type) { - if (type == String.class) { - return Binary[]::new; + columnWriter.addDictionaryPage(encodedKeys, keyCount); + final Iterator arraySizeIt = arraySizeBuffers == null ? null : arraySizeBuffers.iterator(); + for (final IntBuffer pageBuffer : pageBuffers) { + pageBuffer.flip(); + if (lengthSource != null) { + columnWriter.addVectorPage(pageBuffer, arraySizeIt.next(), pageBuffer.remaining()); + } else if (hasNulls) { + columnWriter.addPage(pageBuffer, pageBuffer.remaining()); + } else { + columnWriter.addPageNoNulls(pageBuffer, pageBuffer.remaining()); + } + } + return true; + } catch (final DictionarySizeExceededException ignored) { + return false; } - throw new UnsupportedOperationException("Dictionary storage not supported for " + type); - } - - private static boolean supportsDictionary(Class dataType) { - return dataType == String.class; - } - - private static Object getNullValue(Class columnType) { - if (columnType == Boolean.class) { - return QueryConstants.NULL_BYTE; - } else if (columnType == char.class) { - return (int) QueryConstants.NULL_CHAR; - } else if (columnType == byte.class) { - return QueryConstants.NULL_BYTE; - } else if (columnType == short.class) { - return QueryConstants.NULL_SHORT; - } else if (columnType == int.class) { - return QueryConstants.NULL_INT; - } else if (columnType == long.class) { - return QueryConstants.NULL_LONG; - } else if (columnType == float.class) { - return QueryConstants.NULL_FLOAT; - } else if (columnType == double.class) { - return QueryConstants.NULL_DOUBLE; - } - return null; } - private static boolean supportNulls(Class columnType) { + private static boolean supportNulls(@NotNull final Class columnType) { return !columnType.isPrimitive(); } - private static int getTargetSize(Class columnType) throws IllegalAccessException { + /** + * Get the number of rows that fit within the current targetPageSize for the specified type. + * + * @param columnType the column type + * @return the number of rows that fit within the target page size. + */ + private static int getTargetRowsPerPage(@NotNull final Class columnType, + final int targetPageSize) + throws IllegalAccessException { if (columnType == Boolean.class) { - return PAGE_SIZE * 8; + return targetPageSize * 8; } + if (columnType == short.class || columnType == char.class || columnType == byte.class) { - return PAGE_SIZE / Integer.BYTES; + return targetPageSize / Integer.BYTES; } + if (columnType == String.class) { - return PAGE_SIZE / Integer.BYTES; + return targetPageSize / Integer.BYTES; } - Field bytesCountField; + try { - bytesCountField = TypeUtils.getBoxedType(columnType).getField("BYTES"); - return PAGE_SIZE / ((Integer) bytesCountField.get(null)); + final Field bytesCountField = TypeUtils.getBoxedType(columnType).getField("BYTES"); + return targetPageSize / ((Integer) bytesCountField.get(null)); } catch (NoSuchFieldException e) { - return PAGE_SIZE / 8;// We assume the baseline and go from there + // We assume the baseline and go from there + return targetPageSize / 8; } } private static TransferObject getDestinationBuffer( - final Map> computedCache, - final TrackingRowSet tableRowSet, - final ColumnSource columnSource, - final ColumnDefinition columnDefinition, - final int targetSize, - final Class columnType, - final ParquetInstructions instructions) { + @NotNull final Map> computedCache, + @NotNull final RowSet tableRowSet, + @NotNull final ColumnSource columnSource, + @NotNull final ColumnDefinition columnDefinition, + final int maxValuesPerPage, + @NotNull final Class columnType, + @NotNull final ParquetInstructions instructions) { if (int.class.equals(columnType)) { - int[] array = new int[targetSize]; + int[] array = new int[maxValuesPerPage]; WritableIntChunk chunk = WritableIntChunk.writableChunkWrap(array); - return new PrimitiveTransfer<>(columnSource, chunk, IntBuffer.wrap(array), targetSize); + return new PrimitiveTransfer<>(columnSource, chunk, IntBuffer.wrap(array), maxValuesPerPage); } else if (long.class.equals(columnType)) { - long[] array = new long[targetSize]; + long[] array = new long[maxValuesPerPage]; WritableLongChunk chunk = WritableLongChunk.writableChunkWrap(array); - return new PrimitiveTransfer<>(columnSource, chunk, LongBuffer.wrap(array), targetSize); + return new PrimitiveTransfer<>(columnSource, chunk, LongBuffer.wrap(array), maxValuesPerPage); } else if (double.class.equals(columnType)) { - double[] array = new double[targetSize]; + double[] array = new double[maxValuesPerPage]; WritableDoubleChunk chunk = WritableDoubleChunk.writableChunkWrap(array); - return new PrimitiveTransfer<>(columnSource, chunk, DoubleBuffer.wrap(array), targetSize); + return new PrimitiveTransfer<>(columnSource, chunk, DoubleBuffer.wrap(array), maxValuesPerPage); } else if (float.class.equals(columnType)) { - float[] array = new float[targetSize]; + float[] array = new float[maxValuesPerPage]; WritableFloatChunk chunk = WritableFloatChunk.writableChunkWrap(array); - return new PrimitiveTransfer<>(columnSource, chunk, FloatBuffer.wrap(array), targetSize); + return new PrimitiveTransfer<>(columnSource, chunk, FloatBuffer.wrap(array), maxValuesPerPage); } else if (Boolean.class.equals(columnType)) { - byte[] array = new byte[targetSize]; + byte[] array = new byte[maxValuesPerPage]; WritableByteChunk chunk = WritableByteChunk.writableChunkWrap(array); - return new PrimitiveTransfer<>(columnSource, chunk, ByteBuffer.wrap(array), targetSize); + return new PrimitiveTransfer<>(columnSource, chunk, ByteBuffer.wrap(array), maxValuesPerPage); } else if (short.class.equals(columnType)) { - return new ShortTransfer(columnSource, targetSize); + return new ShortTransfer(columnSource, maxValuesPerPage); } else if (char.class.equals(columnType)) { - return new CharTransfer(columnSource, targetSize); + return new CharTransfer(columnSource, maxValuesPerPage); } else if (byte.class.equals(columnType)) { - return new ByteTransfer(columnSource, targetSize); + return new ByteTransfer(columnSource, maxValuesPerPage); } else if (String.class.equals(columnType)) { - return new StringTransfer(columnSource, targetSize); + return new StringTransfer(columnSource, maxValuesPerPage); } else if (BigDecimal.class.equals(columnType)) { // noinspection unchecked final ColumnSource bigDecimalColumnSource = (ColumnSource) columnSource; @@ -638,25 +782,14 @@ private static TransferObject getDestinationBuffer( computedCache, columnDefinition.getName(), tableRowSet, () -> bigDecimalColumnSource); final ObjectCodec codec = new BigDecimalParquetBytesCodec( precisionAndScale.precision, precisionAndScale.scale, -1); - return new CodecTransfer<>(bigDecimalColumnSource, codec, targetSize); + return new CodecTransfer<>(bigDecimalColumnSource, codec, maxValuesPerPage); } - final ObjectCodec codec = CodecLookup.lookup(columnDefinition, instructions); - return new CodecTransfer<>(columnSource, codec, targetSize); - } - interface TransferObject extends Context { - - void propagateChunkData(); - - B getBuffer(); - - int rowCount(); - - void fetchData(RowSequence rs); + final ObjectCodec codec = CodecLookup.lookup(columnDefinition, instructions); + return new CodecTransfer<>(columnSource, codec, maxValuesPerPage); } static class PrimitiveTransfer, B extends Buffer> implements TransferObject { - private final C chunk; private final B buffer; private final ColumnSource columnSource; @@ -669,7 +802,6 @@ static class PrimitiveTransfer, B extends Buffer context = columnSource.makeFillContext(targetSize); } - @Override public void propagateChunkData() { buffer.position(0); diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/TypeInfos.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/TypeInfos.java index 64992575aa9..efd10704dfb 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/TypeInfos.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/TypeInfos.java @@ -3,12 +3,12 @@ */ package io.deephaven.parquet.table; -import io.deephaven.engine.table.impl.CodecLookup; +import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ColumnDefinition; +import io.deephaven.engine.table.ColumnSource; +import io.deephaven.engine.table.impl.CodecLookup; import io.deephaven.stringset.StringSet; import io.deephaven.time.DateTime; -import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.rowset.TrackingRowSet; import io.deephaven.util.codec.ExternalizableCodec; import io.deephaven.util.codec.SerializableCodec; import org.apache.commons.lang3.tuple.ImmutablePair; @@ -21,14 +21,14 @@ import org.apache.parquet.schema.Types.PrimitiveBuilder; import org.jetbrains.annotations.NotNull; -import static io.deephaven.engine.util.BigDecimalUtils.PrecisionAndScale; -import static io.deephaven.engine.util.BigDecimalUtils.computePrecisionAndScale; - import java.io.Externalizable; import java.math.BigDecimal; import java.util.*; import java.util.function.Supplier; +import static io.deephaven.engine.util.BigDecimalUtils.PrecisionAndScale; +import static io.deephaven.engine.util.BigDecimalUtils.computePrecisionAndScale; + /** * Contains the necessary information to convert a Deephaven table into a Parquet table. Both the schema translation, * and the data translation. @@ -51,7 +51,7 @@ class TypeInfos { private static final Map, TypeInfo> BY_CLASS; static { - Map, TypeInfo> fa = new HashMap<>(); + final Map, TypeInfo> fa = new HashMap<>(); for (TypeInfo typeInfo : TYPE_INFOS) { for (Class type : typeInfo.getTypes()) { fa.put(type, typeInfo); @@ -104,10 +104,10 @@ static Pair getCodecAndArgs( } static PrecisionAndScale getPrecisionAndScale( - final Map> computedCache, - final String columnName, - final TrackingRowSet rowSet, - Supplier> columnSourceSupplier) { + @NotNull final Map> computedCache, + @NotNull final String columnName, + @NotNull final RowSet rowSet, + @NotNull Supplier> columnSourceSupplier) { return (PrecisionAndScale) computedCache .computeIfAbsent(columnName, unusedColumnName -> new HashMap<>()) .computeIfAbsent(ParquetTableWriter.CacheTags.DECIMAL_ARGS, @@ -117,7 +117,7 @@ static PrecisionAndScale getPrecisionAndScale( static TypeInfo bigDecimalTypeInfo( final Map> computedCache, @NotNull final ColumnDefinition column, - final TrackingRowSet rowSet, + final RowSet rowSet, final Map> columnSourceMap) { final String columnName = column.getName(); // noinspection unchecked @@ -144,7 +144,7 @@ public PrimitiveBuilder getBuilder(boolean required, boolean repe static TypeInfo getTypeInfo( final Map> computedCache, @NotNull final ColumnDefinition column, - final TrackingRowSet rowSet, + final RowSet rowSet, final Map> columnSourceMap, @NotNull final ParquetInstructions instructions) { final Class dataType = column.getDataType(); diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetColumnLocation.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetColumnLocation.java index 14fa8142350..7764f6bb324 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetColumnLocation.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetColumnLocation.java @@ -5,44 +5,44 @@ import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.Require; +import io.deephaven.chunk.*; +import io.deephaven.chunk.attributes.Any; +import io.deephaven.chunk.attributes.Values; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.rowset.RowSequence; +import io.deephaven.engine.rowset.RowSequenceFactory; +import io.deephaven.engine.rowset.chunkattributes.UnorderedRowKeys; import io.deephaven.engine.table.ChunkSource; +import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Context; import io.deephaven.engine.table.impl.CodecLookup; -import io.deephaven.engine.table.ColumnDefinition; -import io.deephaven.vector.Vector; +import io.deephaven.engine.table.impl.chunkattributes.DictionaryKeys; +import io.deephaven.engine.table.impl.chunkboxer.ChunkBoxer; import io.deephaven.engine.table.impl.locations.TableDataException; import io.deephaven.engine.table.impl.locations.impl.AbstractColumnLocation; -import io.deephaven.parquet.table.pagestore.ColumnChunkPageStore; -import io.deephaven.parquet.table.pagestore.PageCache; -import io.deephaven.parquet.table.ParquetInstructions; -import io.deephaven.parquet.table.ParquetSchemaReader; -import io.deephaven.parquet.table.ParquetTableWriter; -import io.deephaven.parquet.table.metadata.CodecInfo; -import io.deephaven.parquet.table.metadata.ColumnTypeInfo; -import io.deephaven.parquet.table.metadata.GroupingColumnInfo; -import io.deephaven.parquet.table.metadata.TableInfo; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.engine.table.impl.chunkattributes.DictionaryKeys; -import io.deephaven.engine.rowset.chunkattributes.UnorderedRowKeys; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.chunk.*; import io.deephaven.engine.table.impl.sources.regioned.*; -import io.deephaven.engine.table.impl.chunkboxer.ChunkBoxer; -import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.RowSequenceFactory; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.parquet.base.ColumnChunkReader; import io.deephaven.parquet.base.ParquetFileReader; import io.deephaven.parquet.base.RowGroupReader; import io.deephaven.parquet.base.tempfix.ParquetMetadataConverter; +import io.deephaven.parquet.table.BigDecimalParquetBytesCodec; +import io.deephaven.parquet.table.ParquetInstructions; +import io.deephaven.parquet.table.ParquetSchemaReader; +import io.deephaven.parquet.table.ParquetTableWriter; +import io.deephaven.parquet.table.metadata.CodecInfo; +import io.deephaven.parquet.table.metadata.ColumnTypeInfo; +import io.deephaven.parquet.table.metadata.GroupingColumnInfo; +import io.deephaven.parquet.table.metadata.TableInfo; +import io.deephaven.parquet.table.pagestore.ColumnChunkPageStore; +import io.deephaven.parquet.table.pagestore.PageCache; import io.deephaven.parquet.table.pagestore.topage.*; import io.deephaven.parquet.table.region.*; -import io.deephaven.parquet.table.BigDecimalParquetBytesCodec; import io.deephaven.util.codec.CodecCache; import io.deephaven.util.codec.ObjectCodec; import io.deephaven.util.codec.SimpleByteArrayCodec; +import io.deephaven.vector.Vector; import org.apache.parquet.schema.LogicalTypeAnnotation; import org.apache.parquet.schema.PrimitiveType; import org.jetbrains.annotations.NotNull; @@ -58,8 +58,8 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -import static io.deephaven.parquet.table.ParquetTableWriter.*; import static io.deephaven.engine.table.impl.sources.regioned.RegionedColumnSource.ROW_KEY_TO_SUB_REGION_ROW_INDEX_MASK; +import static io.deephaven.parquet.table.ParquetTableWriter.*; final class ParquetColumnLocation extends AbstractColumnLocation { diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java index c1e703e8137..46f73ae46dd 100644 --- a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestParquetTools.java @@ -8,18 +8,18 @@ import io.deephaven.configuration.Configuration; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; -import io.deephaven.stringset.HashStringSet; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.parquet.table.layout.ParquetKeyValuePartitionedLayout; -import io.deephaven.stringset.StringSet; -import io.deephaven.engine.util.TestTableTools; -import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.table.impl.InMemoryTable; -import io.deephaven.engine.table.impl.TstUtils; import io.deephaven.engine.table.impl.locations.TableDataException; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.TableTools; +import io.deephaven.engine.util.TestTableTools; +import io.deephaven.parquet.table.layout.ParquetKeyValuePartitionedLayout; +import io.deephaven.stringset.HashStringSet; +import io.deephaven.stringset.StringSet; import io.deephaven.test.junit4.EngineCleanup; +import io.deephaven.vector.*; import junit.framework.TestCase; import org.junit.*; @@ -32,7 +32,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.stream.IntStream; +import java.util.stream.LongStream; +import static io.deephaven.engine.table.impl.TstUtils.assertTableEquals; import static io.deephaven.engine.util.TableTools.*; /** @@ -194,13 +197,13 @@ public void testWriteTableRenames() { final Table resultDefault = ParquetTools.readTable(pathFile); TableTools.show(table1); TableTools.show(resultDefault); - TstUtils.assertTableEquals(table1.view("X=StringKeys", "Y=GroupedInts"), resultDefault); + assertTableEquals(table1.view("X=StringKeys", "Y=GroupedInts"), resultDefault); resultDefault.close(); final Table resultRenamed = ParquetTools.readTable(pathFile, instructions); TableTools.show(table1); TableTools.show(resultRenamed); - TstUtils.assertTableEquals(table1, resultRenamed); + assertTableEquals(table1, resultRenamed); resultRenamed.close(); } @@ -247,7 +250,7 @@ public void testWriteTableMissingColumns() { ParquetTools.writeTables(new Table[] {TableTools.emptyTable(10_000L)}, nullTable.getDefinition(), new File[] {dest}); final Table result = ParquetTools.readTable(dest); - TstUtils.assertTableEquals(nullTable, result); + assertTableEquals(nullTable, result); result.close(); } @@ -360,6 +363,55 @@ public void testPartitionedRead() { table1.updateView("Date=`2021-07-20`", "Num=100"), table1.updateView("Date=`2021-07-20`", "Num=200"), table1.updateView("Date=`2021-07-21`", "Num=300")).moveColumnsUp("Date", "Num"); - TstUtils.assertTableEquals(expected, result); + assertTableEquals(expected, result); + } + + @Test + public void testBigArrays() { + ExecutionContext.getContext().getQueryLibrary().importClass(LongVectorDirect.class); + ExecutionContext.getContext().getQueryLibrary().importClass(LongVector.class); + ExecutionContext.getContext().getQueryLibrary().importClass(LongStream.class); + ExecutionContext.getContext().getQueryLibrary().importClass(IntVectorDirect.class); + ExecutionContext.getContext().getQueryLibrary().importClass(IntVector.class); + ExecutionContext.getContext().getQueryLibrary().importClass(IntStream.class); + ExecutionContext.getContext().getQueryLibrary().importClass(TestParquetTools.class); + + final Table stuff = emptyTable(10) + .update("Biggie = (int)(500_000/(k+1))", + "Doobles = (LongVector)new LongVectorDirect(LongStream.range(0, Biggie).toArray())", + "Woobles = TestParquetTools.generateDoubles(Biggie)", + "Goobles = (IntVector)new IntVectorDirect(IntStream.range(0, 2*Biggie).toArray())", + "Toobles = TestParquetTools.generateDoubles(2*Biggie)", + "Noobles = TestParquetTools.makeSillyStringArray(Biggie)"); + + final File f2w = new File(testRoot, "bigArray.parquet"); + ParquetTools.writeTable(stuff, f2w); + + final Table readBack = ParquetTools.readTable(f2w); + assertTableEquals(stuff, readBack); + } + + public static DoubleVector generateDoubles(int howMany) { + final double[] yarr = new double[howMany]; + for (int ii = 0; ii < howMany; ii++) { + yarr[ii] = ii; + } + return new DoubleVectorDirect(yarr); + } + + public static FloatVector generateFloats(int howMany) { + final float[] yarr = new float[howMany]; + for (int ii = 0; ii < howMany; ii++) { + yarr[ii] = ii; + } + return new FloatVectorDirect(yarr); + } + + public static ObjectVector makeSillyStringArray(int howMany) { + final String[] fireTruck = new String[howMany]; + for (int ii = 0; ii < howMany; ii++) { + fireTruck[ii] = String.format("%04d", ii); + } + return new ObjectVectorDirect<>(fireTruck); } } diff --git a/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestSymbolTableSource.java b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestSymbolTableSource.java new file mode 100644 index 00000000000..99ae08e2c0e --- /dev/null +++ b/extensions/parquet/table/src/test/java/io/deephaven/parquet/table/TestSymbolTableSource.java @@ -0,0 +1,64 @@ +package io.deephaven.parquet.table; + +import io.deephaven.base.FileUtils; +import io.deephaven.configuration.Configuration; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.sources.regioned.SymbolTableSource; +import io.deephaven.engine.util.TableTools; +import io.deephaven.engine.util.file.TrackedFileHandleFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import static io.deephaven.engine.table.impl.TstUtils.assertTableEquals; + +/** + * Unit tests for Parquet symbol tables + */ +public class TestSymbolTableSource { + private File dataDirectory; + + @Before + public final void setUp() throws IOException { + final Path rootPath = Files.createTempDirectory(Paths.get(Configuration.getInstance().getWorkspacePath()), + "TestSymbolTables-"); + dataDirectory = rootPath.toFile(); + } + + @After + public final void tearDown() { + if (dataDirectory.exists()) { + TrackedFileHandleFactory.getInstance().closeAll(); + FileUtils.deleteRecursively(dataDirectory); + } + } + + /** + * Verify that a parquet writing encodes a simple low-cardinality String column using a dictionary, and that we can + * correctly read this back via the {@link SymbolTableSource} interface. + */ + @Test + public void testWriteAndReadSymbols() { + final Table t = TableTools.emptyTable(100).update("TheBestColumn=`S`+ (k % 10)", "Sentinel=k"); + final File toWrite = new File(dataDirectory, "table.parquet"); + ParquetTools.writeTable(t, toWrite, t.getDefinition()); + + // Make sure we have the expected symbol table (or not) + final Table readBack = ParquetTools.readTable(toWrite); + final SymbolTableSource source = + (SymbolTableSource) readBack.getColumnSource("TheBestColumn", String.class); + Assert.assertTrue(source.hasSymbolTable(readBack.getRowSet())); + + final Table expected = TableTools.emptyTable(10).update("ID=k", "Symbol=`S` + k"); + final Table syms = source.getStaticSymbolTable(t.getRowSet(), false); + + assertTableEquals(expected, syms); + } +} diff --git a/replication/static/src/main/java/io/deephaven/replicators/ReplicateParquetChunkedWriters.java b/replication/static/src/main/java/io/deephaven/replicators/ReplicateParquetChunkedWriters.java index f8c68f310b6..c11b64949c0 100644 --- a/replication/static/src/main/java/io/deephaven/replicators/ReplicateParquetChunkedWriters.java +++ b/replication/static/src/main/java/io/deephaven/replicators/ReplicateParquetChunkedWriters.java @@ -4,8 +4,15 @@ package io.deephaven.replicators; import io.deephaven.replication.ReplicatePrimitiveCode; +import org.apache.commons.io.FileUtils; +import java.io.File; import java.io.IOException; +import java.nio.file.Path; +import java.util.List; + +import static io.deephaven.replication.ReplicationUtils.addImport; +import static java.nio.file.Files.readAllLines; public class ReplicateParquetChunkedWriters { @@ -13,10 +20,39 @@ public static void main(String[] args) throws IOException { ReplicatePrimitiveCode.intToLongAndFloatingPoints( "extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PlainIntChunkedWriter.java", - "int pageSize", "IntBuffer.allocate\\(4\\)", "int originalLimit", "int writeBulk", "int valueCount", + "int pageSize", + "IntBuffer.allocate\\(4\\)", + "int originalLimit", + "int writeBulk", + "int valueCount", "int rowCount", - "int nullCount", "writeInt\\(", "IntBuffer repeatCount", "length != Integer\\.MIN_VALUE", "int length", - "int i = 0;", "int targetCapacity", "IntBuffer nullOffsets"); + "int nullCount", + "writeInt\\(", + "IntBuffer repeatCount", + "length != QueryConstants\\.NULL_INT", + "int length", + "int i = 0;", + "int targetCapacity", + "IntBuffer nullOffsets", + "// Duplicate for Replication\nimport java.nio.IntBuffer;", + "int newSize", + "final int currentCapacity", + "final int currentPosition", + "final int targetPageSize", + "int requiredCapacity", + "int newCapacity", + "int MAXIMUM_TOTAL_CAPACITY = Integer.MAX_VALUE") + .forEach(ReplicateParquetChunkedWriters::injectIntBuffer); + } + + private static void injectIntBuffer(String s) { + try { + List lines = readAllLines(Path.of(s)); + lines = addImport(lines, "import java.nio.IntBuffer;"); + FileUtils.writeLines(new File(s), lines); + } catch (IOException e) { + throw new RuntimeException(e); + } } } diff --git a/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java b/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java index d91af7c107c..8427d392ec4 100644 --- a/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java +++ b/replication/util/src/main/java/io/deephaven/replication/ReplicatePrimitiveCode.java @@ -546,16 +546,19 @@ public static String replaceAllInternal(String inputText, Long serialVersionUID, return result; } - public static void intToLongAndFloatingPoints(String sourceClassJavaPath, + public static List intToLongAndFloatingPoints(String sourceClassJavaPath, Map serialVersionUIDs, String... exemptions) throws IOException { - intToDouble(sourceClassJavaPath, serialVersionUIDs, exemptions); - intToFloat(sourceClassJavaPath, serialVersionUIDs, exemptions); - intToLong(sourceClassJavaPath, serialVersionUIDs, exemptions); + final List files = new ArrayList<>(); + files.add(intToDouble(sourceClassJavaPath, serialVersionUIDs, exemptions)); + files.add(intToFloat(sourceClassJavaPath, serialVersionUIDs, exemptions)); + files.add(intToLong(sourceClassJavaPath, serialVersionUIDs, exemptions)); + + return files; } - public static void intToLongAndFloatingPoints(String sourceClassJavaPath, String... exemptions) + public static List intToLongAndFloatingPoints(String sourceClassJavaPath, String... exemptions) throws IOException { - intToLongAndFloatingPoints(sourceClassJavaPath, null, exemptions); + return intToLongAndFloatingPoints(sourceClassJavaPath, null, exemptions); } } From 44548c0b8f5d0581ae71b8febfbbeb307112ad8a Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 2 Sep 2022 22:19:13 -0700 Subject: [PATCH 101/215] Post release bump from 0.16.0 to 0.17.0 (#2802) --- .github/workflows/build-ci.yml | 20 +++++++++---------- .../io.deephaven.common-conventions.gradle | 2 +- py/client/README.md | 2 +- py/client/pydeephaven/__init__.py | 2 +- py/client/setup.py | 2 +- py/server/deephaven/__init__.py | 2 +- server/jetty-app/README.md | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 5bbb421b7bb..2e366024271 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -57,7 +57,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Docker meta server nltk @@ -71,7 +71,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Docker meta server pytorch @@ -85,7 +85,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Docker meta server sklearn @@ -99,7 +99,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Docker meta server tensorflow @@ -113,7 +113,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Docker meta server slim @@ -127,7 +127,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.16.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -290,7 +290,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -377,7 +377,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -440,7 +440,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Setup JDK 11 @@ -536,7 +536,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.15.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch - name: Setup JDK 11 diff --git a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle index 80036eec3b1..fdc968d246e 100644 --- a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle @@ -4,7 +4,7 @@ plugins { } group = 'io.deephaven' -version = '0.16.0' +version = '0.17.0' if (!name.startsWith('deephaven-')) { archivesBaseName = "deephaven-${name}" diff --git a/py/client/README.md b/py/client/README.md index c4ef5199f0a..92c377d4dd4 100644 --- a/py/client/README.md +++ b/py/client/README.md @@ -35,7 +35,7 @@ $ python3 -m examples.demo_asof_join ``` ## Install ``` shell -$ pip3 install dist/pydeephaven-0.16.0-py3-none-any.whl +$ pip3 install dist/pydeephaven-0.17.0-py3-none-any.whl ``` ## Quick start diff --git a/py/client/pydeephaven/__init__.py b/py/client/pydeephaven/__init__.py index 002cab8ddbc..53c1ed36750 100644 --- a/py/client/pydeephaven/__init__.py +++ b/py/client/pydeephaven/__init__.py @@ -30,4 +30,4 @@ from .constants import SortDirection, MatchRule from .query import Query -__version__ = "0.16.0" +__version__ = "0.17.0" diff --git a/py/client/setup.py b/py/client/setup.py index 8a59d44288c..dd4a752decc 100644 --- a/py/client/setup.py +++ b/py/client/setup.py @@ -12,7 +12,7 @@ setup( name='pydeephaven', - version='0.16.0', + version='0.17.0', description='The Deephaven Python Client', long_description=README, long_description_content_type="text/markdown", diff --git a/py/server/deephaven/__init__.py b/py/server/deephaven/__init__.py index 113f3ad7473..587cd0bbf17 100644 --- a/py/server/deephaven/__init__.py +++ b/py/server/deephaven/__init__.py @@ -7,7 +7,7 @@ """ -__version__ = "0.16.0" +__version__ = "0.17.0" from deephaven_internal import jvm try: diff --git a/server/jetty-app/README.md b/server/jetty-app/README.md index bdc2c421294..7192b083e79 100644 --- a/server/jetty-app/README.md +++ b/server/jetty-app/README.md @@ -24,17 +24,17 @@ be sure to first set `PYTHON_CONFIGURE_OPTS="--enabled-shared"`. ```shell $ python -m pip install --upgrade pip # First upgrade pip $ pip install wheel - $ export DEEPHAVEN_VERSION=0.16.0 # this should match the current version of your git repo + $ export DEEPHAVEN_VERSION=0.17.0 # this should match the current version of your git repo $ cd py/jpy $ export JAVA_HOME=/path/to/your/java/home # Customize this to fit your computer $ python setup.py bdist_wheel - $ pip install dist/deephaven_jpy-0.16.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform + $ pip install dist/deephaven_jpy-0.17.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform $ cd - $ cd Integrations/python $ python setup.py bdist_wheel - $ pip install dist/deephaven-0.16.0-py2.py3-none-any.whl + $ pip install dist/deephaven-0.17.0-py2.py3-none-any.whl $ cd - ``` From d6dbe6b596cf2caf7422890e46460f2aa4e09f46 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Sat, 3 Sep 2022 13:35:42 -0700 Subject: [PATCH 102/215] Bump docker base images (#2804) --- docker/registry/go/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python-dev-base/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/slim-base/gradle.properties | 2 +- docker/registry/tensorflow-base/gradle.properties | 2 +- docker/server/src/main/server-nltk/requirements.txt | 4 ++-- .../server/src/main/server-pytorch/requirements.txt | 12 ++++++------ .../server/src/main/server-sklearn/requirements.txt | 2 +- .../src/main/server-tensorflow/requirements.txt | 12 ++++++------ docker/server/src/main/server/requirements.txt | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties index bb715ab9709..ae4a3b4de93 100644 --- a/docker/registry/go/gradle.properties +++ b/docker/registry/go/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=golang:1 -deephaven.registry.imageId=golang@sha256:538867fdf0bc58fe1b2e3b831c9e8c68e09c2a016ebfe240b8c14fca4284543b +deephaven.registry.imageId=golang@sha256:d3f734e1f46ec36da8c1bce67cd48536138085289e24cfc8765f483c401b7d96 diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index da2c35cd71d..723f390d2d5 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:f9f41e37bbaf98bbfcb7d5241d207b23df38c699df14c3753c280472a4dc46e4 +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:262be75b8ca9a0f4b6f8e0c2474c449dcfb6c8a5d81f1f5995d5e38628da64ae diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 3053b3b945d..6e266a3240a 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:0ec55a0c037dcad5055089a10e96c878e1eb3de1e81a99a5ff2c8ee81e6baf11 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:c9cb597c2cd784da48d3cdf08065ce1bb00d1f079b1fee68aeadaa14c4259d0c diff --git a/docker/registry/python-dev-base/gradle.properties b/docker/registry/python-dev-base/gradle.properties index c32681b7b98..920b5af87ee 100644 --- a/docker/registry/python-dev-base/gradle.properties +++ b/docker/registry/python-dev-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/python-dev-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:693944fc2b52a476387232c784a8d902d75714ea0ceef678ab2c180f6fb0df2c +deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:fb01ac09e98bc9a363e64a7f59f1413b48f0d270eca0a0f092c4f819f581d404 diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index 2da38b671b5..42b91354bdd 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:73e6b9a1d8ae1b0a23f0972b385543123fef4e756338972ada21c440d636df4b +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:9fd68c695baea12be44c65cb5da0a85cd92e3e4bb9c904c35d4433eaac16aa61 diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index 2744b9f820e..1980dae3ed0 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:6beff88aa1fcd462c6523926b09da1fd12112e9006b60ab1317938583c9ab0e8 +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:472187971da83046cdee278d1b167077e2af2a9b15ba2eff5c69670ac533f0cf diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index 1877b7a2859..a23052071c3 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:4dc470bfedc389589510f8120bb464ff38a6a924ee190dff1fc961c7c54d6b65 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:18ca26c4577ce9267f92b244a7f7ab60a58ab4226f9bef2ee8ab9593340d008c diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index 018fccd71d8..f52e5812150 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:a7b08b7de1f3ca89dca7008e416871c33386afc25138d3f0d4715d50573d73ac +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:cd087ae1e4415f218d4856dd8f0a101da5919a8c001a432dad318fd30be4e5ee diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index 736c65a61e9..c2415efc02b 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:573446ca74ba701f3a8013a8af8b42239559237f7f442915e8d3aaa5bef8e88f +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:06c28c717ca9686c36be82625afca660aefb70b3223496daf31e55bca51a93ac diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk/requirements.txt index c15fec7e95a..7a49bd0afb0 100644 --- a/docker/server/src/main/server-nltk/requirements.txt +++ b/docker/server/src/main/server-nltk/requirements.txt @@ -9,8 +9,8 @@ numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.1 -regex==2022.7.25 +pytz==2022.2.1 +regex==2022.8.17 six==1.16.0 tqdm==4.64.0 typing_extensions==4.3.0 diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch/requirements.txt index 70071cef78d..71ab6dd0a8f 100644 --- a/docker/server/src/main/server-pytorch/requirements.txt +++ b/docker/server/src/main/server-pytorch/requirements.txt @@ -1,9 +1,9 @@ absl-py==1.2.0 cachetools==5.2.0 certifi==2022.6.15 -charset-normalizer==2.1.0 +charset-normalizer==2.1.1 deephaven-plugin==0.2.0 -google-auth==2.9.1 +google-auth==2.11.0 google-auth-oauthlib==0.4.6 grpcio==1.47.0 idna==3.3 @@ -20,16 +20,16 @@ protobuf==3.19.4 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 -pytz==2022.1 +pytz==2022.2.1 requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 six==1.16.0 -tensorboard==2.9.1 +tensorboard==2.10.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 torch==1.10.2 typing_extensions==4.3.0 -urllib3==1.26.11 -Werkzeug==2.2.1 +urllib3==1.26.12 +Werkzeug==2.2.2 zipp==3.8.1 diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn/requirements.txt index 30f6783b03d..5c4aed09f26 100644 --- a/docker/server/src/main/server-sklearn/requirements.txt +++ b/docker/server/src/main/server-sklearn/requirements.txt @@ -7,7 +7,7 @@ numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.1 +pytz==2022.2.1 scikit-learn==0.24.2 scipy==1.7.3 six==1.16.0 diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow/requirements.txt index 34bddbadd03..92460886d3c 100644 --- a/docker/server/src/main/server-tensorflow/requirements.txt +++ b/docker/server/src/main/server-tensorflow/requirements.txt @@ -2,11 +2,11 @@ absl-py==1.2.0 astunparse==1.6.3 cachetools==5.2.0 certifi==2022.6.15 -charset-normalizer==2.1.0 +charset-normalizer==2.1.1 deephaven-plugin==0.2.0 flatbuffers==2.0 gast==0.4.0 -google-auth==2.9.1 +google-auth==2.11.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 grpcio==1.47.0 @@ -29,12 +29,12 @@ protobuf==3.19.4 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 -pytz==2022.1 +pytz==2022.2.1 requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 six==1.16.0 -tensorboard==2.9.1 +tensorboard==2.10.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorflow==2.7.3 @@ -42,7 +42,7 @@ tensorflow-estimator==2.7.0 tensorflow-io-gcs-filesystem==0.26.0 termcolor==1.1.0 typing_extensions==4.3.0 -urllib3==1.26.11 -Werkzeug==2.2.1 +urllib3==1.26.12 +Werkzeug==2.2.2 wrapt==1.14.1 zipp==3.8.1 diff --git a/docker/server/src/main/server/requirements.txt b/docker/server/src/main/server/requirements.txt index 4348b50d9e9..91aafb0b122 100644 --- a/docker/server/src/main/server/requirements.txt +++ b/docker/server/src/main/server/requirements.txt @@ -6,7 +6,7 @@ numba==0.56.0 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.1 +pytz==2022.2.1 six==1.16.0 typing_extensions==4.3.0 zipp==3.8.1 From 268f5a821b61f7a3f150892b4fc411fbfaa05728 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 6 Sep 2022 08:57:42 -0700 Subject: [PATCH 103/215] Bump node and python images (#2807) --- docker/registry/node/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index 4f12eb57b93..a93a753f59c 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:4d6ebb12739acf0caec74996e6a83eada4716c32e4cde758b736325f4d1a9db8 +deephaven.registry.imageId=node@sha256:48ad857f33fb03f542133b1e0d3524b1fcf596fce29e212cd9b7abd22d3d9188 diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index 558e7a96a76..cff1ac76748 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:37c909c5c8ae3ec62d06ac89f4e3630b27ea09a13e2a13894df0cc70a9649323 +deephaven.registry.imageId=python@sha256:8b743b1af852e554b98e2377f9c92221693225b85d984b23be6b033018f97cc3 From 84e6dd46aa4d7b306814a0d8a4c8c1df41ed48e4 Mon Sep 17 00:00:00 2001 From: JJ Brosnan <84038776+jjbrosnan@users.noreply.github.com> Date: Tue, 6 Sep 2022 13:32:29 -0400 Subject: [PATCH 104/215] Update py/embedded-server setup for PyPi (#2739) * Create PyPi readme and update setup.py with new file * Apply Devin's suggested changes. Remove mention of any dev env setup. * Updates from Devin's review * Add PyPi readme to build.gradle --- py/embedded-server/README_PyPi.md | 29 +++++++++++++++++++++++++++++ py/embedded-server/build.gradle | 2 +- py/embedded-server/setup.py | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 py/embedded-server/README_PyPi.md diff --git a/py/embedded-server/README_PyPi.md b/py/embedded-server/README_PyPi.md new file mode 100644 index 00000000000..88f5c7228b4 --- /dev/null +++ b/py/embedded-server/README_PyPi.md @@ -0,0 +1,29 @@ +# deephaven-server + +A Python-native way of launching [deephaven-core](https://www.github.com/deephaven/deephaven-core). + +Deephaven Community Core is a real-time, time-series, column-oriented analytics engine with relational database features. It is an open version of [Deephaven Enterprise](https://deephaven.io/enterprise/), which serves as the data backbone for prominent hedge funds, banks, and financial exchanges. + +## Requirements + +Java 11+ is required for this module, and the `JAVA_HOME` environment variable must be set appropriately. + +This module also requires Python version 3.7 or newer. + +## Setup + +```shell +pip3 install --upgrade pip setuptools wheel +pip3 install deephaven-server +``` + +## Quick start + +```python +from deephaven_server import Server +server = Server() +server.start() + +from deephaven import time_table +ticking_table = time_table('00:00:01').update_view(formulas=["Col1 = i % 2"]) +``` \ No newline at end of file diff --git a/py/embedded-server/build.gradle b/py/embedded-server/build.gradle index 97aab0df456..d61f6f780ba 100644 --- a/py/embedded-server/build.gradle +++ b/py/embedded-server/build.gradle @@ -8,7 +8,7 @@ configurations { } wheel { contents { - include 'deephaven_server/', 'setup.py', 'README.md' + include 'deephaven_server/', 'setup.py', 'README.md', 'README_PyPi.md' from(configurations.classpath) { include '*' into('deephaven_server/jars') diff --git a/py/embedded-server/setup.py b/py/embedded-server/setup.py index eff7db1dd86..b9283bb0212 100644 --- a/py/embedded-server/setup.py +++ b/py/embedded-server/setup.py @@ -10,7 +10,7 @@ HERE = pathlib.Path(__file__).parent # The text of the README file -README = (HERE / "README.md").read_text() +README = (HERE / "README_PyPi.md").read_text() # Versions should comply with PEP440. For a discussion on single-sourcing From 8749bf3c6c2125fd799544256e7b6dfe2e7f1fa3 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 6 Sep 2022 14:02:21 -0600 Subject: [PATCH 105/215] Allow multiple concurrent DynamicTableRow writers (#2805) --- .../table/impl/util/DynamicTableWriter.java | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/DynamicTableWriter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/DynamicTableWriter.java index acbd117da7d..ada940b16c3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/DynamicTableWriter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/DynamicTableWriter.java @@ -31,7 +31,8 @@ * The DynamicTableWriter creates an in-memory table using ArrayBackedColumnSources of the type specified in the * constructor. You can retrieve the table using the {@code getTable} function. *

    - * This class is not thread safe, you must synchronize externally. + * This class is not thread safe, you must synchronize externally. However, multiple setters may safely log + * concurrently. */ public class DynamicTableWriter implements TableWriter { private final UpdateSourceQueryTable table; @@ -782,32 +783,34 @@ public PermissiveRowSetter getSetter(final String name) { @Override public void writeRow() { - boolean doFlush = false; - switch (flags) { - case SingleRow: - doFlush = true; - case StartTransaction: - if (lastCommittedRow != lastSetterRow) { - lastSetterRow = lastCommittedRow + 1; - } - break; - case EndTransaction: - doFlush = true; - break; - case None: - break; - } - row = lastSetterRow++; + synchronized (DynamicTableWriter.this) { + boolean doFlush = false; + switch (flags) { + case SingleRow: + doFlush = true; + case StartTransaction: + if (lastCommittedRow != lastSetterRow) { + lastSetterRow = lastCommittedRow + 1; + } + break; + case EndTransaction: + doFlush = true; + break; + case None: + break; + } + row = lastSetterRow++; - // Before this row can be returned to a pool, it needs to ensure that the underlying sources - // are appropriately sized to avoid race conditions. - ensureCapacity(row); - columnToSetter.values().forEach((x) -> x.setRow(row)); + // Before this row can be returned to a pool, it needs to ensure that the underlying sources + // are appropriately sized to avoid race conditions. + ensureCapacity(row); + columnToSetter.values().forEach((x) -> x.setRow(row)); - // The row has been committed during set, we just need to insert the row keys into the table - if (doFlush) { - DynamicTableWriter.this.addRangeToTableIndex(lastCommittedRow + 1, row); - lastCommittedRow = row; + // The row has been committed during set, we just need to insert the row keys into the table + if (doFlush) { + DynamicTableWriter.this.addRangeToTableIndex(lastCommittedRow + 1, row); + lastCommittedRow = row; + } } } From e472f092bf0df38e473c4df4849bbf7e8e1f45af Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 6 Sep 2022 14:03:25 -0600 Subject: [PATCH 106/215] When an ExportObject runner throws StatusRuntimeException forward to client (#2794) Also allow StatusRuntimeExceptions to cascade to dependent work. --- .../server/session/SessionState.java | 27 +++++++++---- .../server/table/TableServiceGrpcImpl.java | 39 +++++++++++++----- .../server/session/SessionStateTest.java | 40 +++++++++++++++++++ 3 files changed, 89 insertions(+), 17 deletions(-) diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index 398c67c4129..54c2b2960b8 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -524,6 +524,7 @@ public final static class ExportObject extends LivenessArtifact { /** used to identify and propagate error details */ private String errorId; private String dependentHandle; + private Exception caughtException; /** * @param exportId the export id for this export @@ -740,7 +741,7 @@ private synchronized void setState(final ExportNotification.State state) { if (errorId == null) { assignErrorId(); } - safelyExecute(() -> errorHandler.onError(state, errorId, dependentHandle)); + safelyExecute(() -> errorHandler.onError(state, errorId, caughtException, dependentHandle)); } if (state == ExportNotification.State.EXPORTED || isExportStateTerminal(state)) { @@ -772,6 +773,9 @@ private void onResolveOne(@Nullable final ExportObject parent) { if (parent != null && isExportStateTerminal(parent.state)) { synchronized (this) { errorId = parent.errorId; + if (parent.caughtException instanceof StatusRuntimeException) { + caughtException = parent.caughtException; + } ExportNotification.State terminalState = ExportNotification.State.DEPENDENCY_FAILED; if (errorId == null) { @@ -841,7 +845,6 @@ private void doExport() { } setState(ExportNotification.State.RUNNING); } - Exception exception = null; boolean shouldLog = false; int evaluationNumber = -1; QueryProcessingResults queryProcessingResults = null; @@ -858,7 +861,7 @@ private void doExport() { shouldLog = QueryPerformanceRecorder.getInstance().endQuery(); } } catch (final Exception err) { - exception = err; + caughtException = err; synchronized (this) { if (!isExportStateTerminal(state)) { assignErrorId(); @@ -867,12 +870,12 @@ private void doExport() { } } } finally { - if (exception != null && queryProcessingResults != null) { - queryProcessingResults.setException(exception.toString()); + if (caughtException != null && queryProcessingResults != null) { + queryProcessingResults.setException(caughtException.toString()); } QueryPerformanceRecorder.resetInstance(); } - if ((shouldLog || exception != null) && queryProcessingResults != null) { + if ((shouldLog || caughtException != null) && queryProcessingResults != null) { final MemoryTableLoggers memLoggers = MemoryTableLoggers.getInstance(); final QueryPerformanceLogLogger qplLogger = memLoggers.getQplLogger(); final QueryOperationPerformanceLogLogger qoplLogger = memLoggers.getQoplLogger(); @@ -975,6 +978,7 @@ public synchronized void cancel() { protected synchronized void destroy() { super.destroy(); result = null; + caughtException = null; } /** @@ -1141,7 +1145,9 @@ public interface ExportErrorHandler { * @param dependentExportId an identifier for the export id of the dependent that caused the failure if * applicable */ - void onError(final ExportNotification.State resultState, @Nullable final String errorContext, + void onError(final ExportNotification.State resultState, + final String errorContext, + @Nullable final Exception cause, @Nullable final String dependentExportId); } @FunctionalInterface @@ -1248,7 +1254,12 @@ public ExportBuilder onError(final ExportErrorHandler errorHandler) { * @return this builder */ public ExportBuilder onErrorHandler(final ExportErrorGrpcHandler errorHandler) { - return onError(((resultState, errorContext, dependentExportId) -> { + return onError(((resultState, errorContext, cause, dependentExportId) -> { + if (cause instanceof StatusRuntimeException) { + errorHandler.onError((StatusRuntimeException) cause); + return; + } + final String dependentStr = dependentExportId == null ? "" : (" (related parent export id: " + dependentExportId + ")"); errorHandler.onError(GrpcUtil.statusRuntimeException( diff --git a/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java index 90224e22ffc..193eb3f837b 100644 --- a/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/table/TableServiceGrpcImpl.java @@ -47,6 +47,8 @@ import io.deephaven.server.session.SessionState.ExportBuilder; import io.deephaven.server.session.TicketRouter; import io.deephaven.server.table.ops.GrpcTableOperation; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; @@ -55,6 +57,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import static io.deephaven.extensions.barrage.util.GrpcUtil.safelyExecute; @@ -291,6 +294,20 @@ public void batch(final BatchTableRequest request, // step 4: submit the batched operations final AtomicInteger remaining = new AtomicInteger(exportBuilders.size()); + final AtomicReference firstFailure = new AtomicReference<>(); + + final Runnable onOneResolved = () -> { + if (remaining.decrementAndGet() == 0) { + safelyExecuteLocked(responseObserver, () -> { + final StatusRuntimeException failure = firstFailure.get(); + if (failure != null) { + responseObserver.onError(failure); + } else { + responseObserver.onCompleted(); + } + }); + } + }; for (int i = 0; i < exportBuilders.size(); ++i) { final BatchExportBuilder exportBuilder = exportBuilders.get(i); @@ -303,25 +320,29 @@ public void batch(final BatchTableRequest request, resultId = ExportTicketHelper.tableReference(exportId); } - exportBuilder.exportBuilder.onError((result, errorContext, dependentId) -> { + exportBuilder.exportBuilder.onError((result, errorContext, cause, dependentId) -> { + String errorInfo = errorContext; + if (dependentId != null) { + errorInfo += " dependency: " + dependentId; + } + if (cause instanceof StatusRuntimeException) { + errorInfo += " cause: " + cause.getMessage(); + firstFailure.compareAndSet(null, (StatusRuntimeException) cause); + } + final String finalErrorInfo = errorInfo; safelyExecuteLocked(responseObserver, () -> responseObserver.onNext(ExportedTableCreationResponse.newBuilder() .setResultId(resultId) .setSuccess(false) - .setErrorInfo(errorContext + " dependency: " + dependentId) + .setErrorInfo(finalErrorInfo) .build())); - - if (remaining.decrementAndGet() == 0) { - safelyExecuteLocked(responseObserver, responseObserver::onCompleted); - } + onOneResolved.run(); }).submit(() -> { final Table table = exportBuilder.doExport(); safelyExecuteLocked(responseObserver, () -> responseObserver.onNext(ExportUtil.buildTableCreationResponse(resultId, table))); - if (remaining.decrementAndGet() == 0) { - safelyExecuteLocked(responseObserver, responseObserver::onCompleted); - } + onOneResolved.run(); return table; }); diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index a21f0dcddff..ec21c30d1b1 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -7,6 +7,7 @@ import io.deephaven.base.verify.AssertionFailure; import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.proto.util.ExportTicketHelper; +import io.deephaven.server.table.ExportTableUpdateListenerTest; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.liveness.LivenessReferent; @@ -18,6 +19,7 @@ import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.util.SafeCloseable; import io.deephaven.util.auth.AuthContext; +import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; import org.apache.commons.lang3.mutable.MutableBoolean; @@ -1248,6 +1250,44 @@ public void testNonExportWithDependencyReleaseOnExport() { Assert.eq(clr.refCount, "clr.refCount", 0); } + @Test + public void testCascadingStatusRuntimeFailureDeliversToErrorHandler() { + final SessionState.ExportObject e1 = session.newExport(nextExportId++) + .submit(() -> { + throw Status.DATA_LOSS.asRuntimeException(); + }); + + final MutableBoolean submitRan = new MutableBoolean(); + final MutableObject caughtErr = new MutableObject<>(); + final StreamObserver observer = new StreamObserver<>() { + @Override + public void onNext(Object value) { + throw new RuntimeException("this should not reach test framework"); + } + + @Override + public void onError(Throwable t) { + caughtErr.setValue(t); + } + + @Override + public void onCompleted() { + throw new RuntimeException("this should not reach test framework"); + } + }; + session.newExport(nextExportId++) + .onError(observer) + .require(e1) + .submit(submitRan::setTrue); + + scheduler.runUntilQueueEmpty(); + Assert.eqFalse(submitRan.booleanValue(), "submitRan.booleanValue()"); + Assert.eqTrue(caughtErr.getValue() instanceof StatusRuntimeException, "caughtErr.getValue()"); + + final StatusRuntimeException sre = (StatusRuntimeException) caughtErr.getValue(); + Assert.eq(sre.getStatus(), "sre.getStatus()", Status.DATA_LOSS, "Status.DATA_LOSS"); + } + private static long getExportId(final ExportNotification notification) { return ticketToExportId(notification.getTicket(), "test"); } From 570d4dc5c03c6930277259494b9b77450f1d13ee Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 6 Sep 2022 15:52:41 -0600 Subject: [PATCH 107/215] ConstructSnapshot's SharedContext needs to be reset per rowset (#2809) --- .../engine/table/impl/remote/ConstructSnapshot.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java index 9b76f99572b..00d0bd691a9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/remote/ConstructSnapshot.java @@ -1474,6 +1474,11 @@ private static ArrayList> getSnapshotDataAsChunkList(final Col } else { chunkSize = (int) (size - offset); } + + if (sharedContext != null) { + // a shared context is good for only one chunk of rows + sharedContext.reset(); + } } } return result; From b3a748df497a0e1a180d0a6e74cc1f115c591463 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 6 Sep 2022 15:55:16 -0600 Subject: [PATCH 108/215] Refactor CompilerTools into QueryCompiler (#2808) --- ...NoExecutionContextRegisteredException.java | 4 +- .../engine/table/PartitionedTable.java | 6 +- engine/context/build.gradle | 2 +- .../engine/context/ExecutionContext.java | 30 +- ...ontext.java => PoisonedQueryCompiler.java} | 37 +- ...{CompilerTools.java => QueryCompiler.java} | 579 +++++++++--------- ...pilerTools.java => TestQueryCompiler.java} | 14 +- .../impl/by/typed/TypedHasherFactory.java | 7 +- .../PartitionedTableProxyImpl.java | 2 +- .../table/impl/select/ConditionFilter.java | 7 +- .../table/impl/select/DhFormulaColumn.java | 9 +- .../impl/select/QueryScopeParamTypeUtil.java | 4 +- .../table/impl/select/SelectColumn.java | 4 +- .../engine/table/impl/select/WhereFilter.java | 4 +- .../select/codegen/JavaKernelBuilder.java | 9 +- .../engine/util/AbstractScriptSession.java | 8 +- .../engine/util/DynamicCompileUtils.java | 11 +- .../engine/util/GroovyDeephavenSession.java | 17 +- .../table/impl/PartitionedTableTest.java | 8 +- .../table/impl/RefreshingTableTestCase.java | 10 +- .../deephaven/engine/table/impl/TestSort.java | 12 +- .../select/TestConditionFilterGeneration.java | 2 +- .../table/impl/select/TestFormulaColumn.java | 6 +- .../select/TestFormulaColumnGeneration.java | 3 +- .../deephaven/engine/util/TestTableTools.java | 10 +- .../src/main/resources/dh-defaults.prop | 2 +- .../src/main/resources/dh-tests.prop | 2 +- py/server/tests/test_partitioned_table.py | 4 +- py/server/tests/test_table.py | 4 +- py/server/tests/test_ugp.py | 10 +- .../impl/select/TestConditionFilter.java | 12 +- 31 files changed, 405 insertions(+), 434 deletions(-) rename engine/context/src/main/java/io/deephaven/engine/context/{PoisonedCompilerToolsContext.java => PoisonedQueryCompiler.java} (52%) rename engine/context/src/main/java/io/deephaven/engine/context/{CompilerTools.java => QueryCompiler.java} (71%) rename engine/context/src/test/java/io/deephaven/engine/context/{TestCompilerTools.java => TestQueryCompiler.java} (93%) diff --git a/Util/src/main/java/io/deephaven/util/NoExecutionContextRegisteredException.java b/Util/src/main/java/io/deephaven/util/NoExecutionContextRegisteredException.java index 1045ccf3408..347305a0693 100644 --- a/Util/src/main/java/io/deephaven/util/NoExecutionContextRegisteredException.java +++ b/Util/src/main/java/io/deephaven/util/NoExecutionContextRegisteredException.java @@ -3,8 +3,8 @@ import io.deephaven.UncheckedDeephavenException; /** - * This exception is thrown when the thread-local QueryScope, QueryLibrary, or CompilerTools.Context are accessed from - * user-code without an explicit ExecutionContext. + * This exception is thrown when the thread-local QueryScope, QueryLibrary, or QueryCompiler are accessed from user-code + * without an explicit ExecutionContext. */ public final class NoExecutionContextRegisteredException extends UncheckedDeephavenException { public NoExecutionContextRegisteredException() { diff --git a/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java b/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java index 448e7ff6188..2d1f2838d33 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/PartitionedTable.java @@ -203,7 +203,7 @@ default Proxy proxy() { * * @apiNote {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for an * empty input table. It is required to install an ExecutionContext to access any - * QueryLibrary/QueryScope/CompilerContext functionality from the {@code transformer}. + * QueryLibrary/QueryScope/QueryCompiler functionality from the {@code transformer}. * * @param transformer The {@link UnaryOperator} to apply to all constituent {@link Table tables} * @return The new PartitionedTable containing the resulting constituents @@ -245,7 +245,7 @@ default PartitionedTable transform(@NotNull UnaryOperator transformer) { * * @apiNote {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for * empty input tables. It is required to install an ExecutionContext to access any - * QueryLibrary/QueryScope/CompilerContext functionality from the {@code transformer}. + * QueryLibrary/QueryScope/QueryCompiler functionality from the {@code transformer}. * * @param other The other PartitionedTable to find constituents in * @param transformer The {@link BinaryOperator} to apply to all pairs of constituent {@link Table tables} @@ -275,7 +275,7 @@ default PartitionedTable partitionedTransform( * *

    * {@code transformer} must be stateless, safe for concurrent use, and able to return a valid result for empty input - * tables. It is required to install an ExecutionContext to access any QueryLibrary/QueryScope/CompilerContext + * tables. It is required to install an ExecutionContext to access any QueryLibrary/QueryScope/QueryCompiler * functionality from the {@code transformer}. * * @param other The other PartitionedTable to find constituents in diff --git a/engine/context/build.gradle b/engine/context/build.gradle index d6716f5eec2..11e6288abe8 100644 --- a/engine/context/build.gradle +++ b/engine/context/build.gradle @@ -3,7 +3,7 @@ plugins { id 'io.deephaven.project.register' } -description 'Engine Context: QueryScope, QueryLibrary and CompilerTools via ExecutionContext' +description 'Engine Context: QueryScope, QueryLibrary and QueryCompiler via ExecutionContext' configurations { testCompile.extendsFrom junit diff --git a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java index 21157401555..3b7a8e2b2f6 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java @@ -26,7 +26,7 @@ public static ExecutionContext makeSystemicExecutionContext() { return ExecutionContext.newBuilder() .captureQueryScope() .captureQueryLibrary() - .captureCompilerContext() + .captureQueryCompiler() .markSystemic() .build(); } @@ -37,7 +37,7 @@ public static ExecutionContext createForUnitTests() { .markSystemic() .newQueryScope() .newQueryLibrary() - .setCompilerContext(CompilerTools.createContextForUnitTests()) + .setQueryCompiler(QueryCompiler.createForUnitTests()) .build(); } @@ -96,17 +96,17 @@ static void setContext(final ExecutionContext context) { private final QueryLibrary queryLibrary; private final QueryScope queryScope; - private final CompilerTools.Context compilerContext; + private final QueryCompiler queryCompiler; private ExecutionContext( final boolean isSystemic, final QueryLibrary queryLibrary, final QueryScope queryScope, - final CompilerTools.Context compilerContext) { + final QueryCompiler queryCompiler) { this.isSystemic = isSystemic; this.queryLibrary = queryLibrary; this.queryScope = queryScope; - this.compilerContext = compilerContext; + this.queryCompiler = queryCompiler; } /** @@ -154,8 +154,8 @@ public QueryScope getQueryScope() { return queryScope; } - public CompilerTools.Context getCompilerContext() { - return compilerContext; + public QueryCompiler getQueryCompiler() { + return queryCompiler; } @SuppressWarnings("unused") @@ -164,7 +164,7 @@ public static class Builder { private QueryLibrary queryLibrary = PoisonedQueryLibrary.INSTANCE; private QueryScope queryScope = PoisonedQueryScope.INSTANCE; - private CompilerTools.Context compilerContext = PoisonedCompilerToolsContext.INSTANCE; + private QueryCompiler queryCompiler = PoisonedQueryCompiler.INSTANCE; /** * A systemic execution context is one that is supplied by the system and not the user. A systemic context will @@ -213,20 +213,20 @@ public Builder captureQueryLibrary() { } /** - * Use the provided CompilerTools.Context. + * Use the provided QueryCompiler */ @ScriptApi - public Builder setCompilerContext(final CompilerTools.Context compilerContext) { - this.compilerContext = compilerContext; + public Builder setQueryCompiler(final QueryCompiler queryCompiler) { + this.queryCompiler = queryCompiler; return this; } /** - * Use the current ExecutionContext's CompilerTools.Context instance. + * Use the current ExecutionContext's QueryCompiler instance. */ @ScriptApi - public Builder captureCompilerContext() { - compilerContext = currentContext.get().getCompilerContext(); + public Builder captureQueryCompiler() { + queryCompiler = currentContext.get().getQueryCompiler(); return this; } @@ -297,7 +297,7 @@ public Builder captureQueryScopeVars(String... vars) { */ @ScriptApi public ExecutionContext build() { - return new ExecutionContext(isSystemic, queryLibrary, queryScope, compilerContext); + return new ExecutionContext(isSystemic, queryLibrary, queryScope, queryCompiler); } } } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java similarity index 52% rename from engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java rename to engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java index fb3c094bf63..e12653801b7 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedCompilerToolsContext.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java @@ -6,49 +6,36 @@ import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.util.NoExecutionContextRegisteredException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.util.Map; -import java.util.concurrent.CompletableFuture; -public class PoisonedCompilerToolsContext implements CompilerTools.Context { - private static final Logger logger = LoggerFactory.getLogger(PoisonedCompilerToolsContext.class); - public static final PoisonedCompilerToolsContext INSTANCE = new PoisonedCompilerToolsContext(); +public class PoisonedQueryCompiler extends QueryCompiler { + private static final Logger logger = LoggerFactory.getLogger(PoisonedQueryCompiler.class); + public static final PoisonedQueryCompiler INSTANCE = new PoisonedQueryCompiler(); - private PoisonedCompilerToolsContext() {} + private PoisonedQueryCompiler() {} private T fail() { - logger.error().append("No ExecutionContext provided; cannot use CompilerTools").endl(); + logger.error().append("No ExecutionContext provided; cannot use QueryCompiler").endl(); throw new NoExecutionContextRegisteredException(); } @Override - public Map>> getKnownClasses() { - return fail(); - } - - @Override - public ClassLoader getClassLoaderForFormula(Map> parameterClasses) { - return fail(); - } - - @Override - public File getClassDestination() { + public File getFakeClassDestination() { return fail(); } @Override - public String getClassPath() { - return fail(); + public void setParentClassLoader(ClassLoader parentClassLoader) { + fail(); } @Override - public File getFakeClassDestination() { + public Class compile(@NotNull String className, @NotNull String classBody, @NotNull String packageNameRoot, + @Nullable StringBuilder codeLog, @NotNull Map> parameterClasses) { return fail(); } - - @Override - public void setParentClassLoader(ClassLoader parentClassLoader) { - fail(); - } } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java similarity index 71% rename from engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java rename to engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java index 919dacc8588..afd8375dca1 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/CompilerTools.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java @@ -41,8 +41,8 @@ import static java.security.AccessController.doPrivileged; -public class CompilerTools { - private static final Logger log = LoggerFactory.getLogger(CompilerTools.class); +public class QueryCompiler { + private static final Logger log = LoggerFactory.getLogger(QueryCompiler.class); /** * We pick a number just shy of 65536, leaving a little elbow room for good luck. */ @@ -53,15 +53,78 @@ public class CompilerTools { private static final String IDENTIFYING_FIELD_NAME = "_CLASS_BODY_"; - private static final String CODEGEN_TIMEOUT_PROP = "CompilerTools.codegen.timeoutMs"; + private static final String CODEGEN_TIMEOUT_PROP = "QueryCompiler.codegen.timeoutMs"; private static final long CODEGEN_TIMEOUT_MS_DEFAULT = TimeUnit.SECONDS.toMillis(10); // 10 seconds - private static final String CODEGEN_LOOP_DELAY_PROP = "CompilerTools.codegen.retry.delay"; + private static final String CODEGEN_LOOP_DELAY_PROP = "QueryCompiler.codegen.retry.delay"; private static final long CODEGEN_LOOP_DELAY_MS_DEFAULT = 100; private static final long codegenTimeoutMs = Configuration.getInstance().getLongWithDefault(CODEGEN_TIMEOUT_PROP, CODEGEN_TIMEOUT_MS_DEFAULT); private static final long codegenLoopDelayMs = Configuration.getInstance().getLongWithDefault(CODEGEN_LOOP_DELAY_PROP, CODEGEN_LOOP_DELAY_MS_DEFAULT); + private static boolean logEnabled = Configuration.getInstance().getBoolean("QueryCompiler.logEnabledDefault"); + + public static final String FORMULA_PREFIX = "io.deephaven.temp"; + public static final String DYNAMIC_GROOVY_CLASS_PREFIX = "io.deephaven.dynamic"; + + public static QueryCompiler create(File cacheDirectory, ClassLoader classLoader) { + return new QueryCompiler(cacheDirectory, classLoader, true); + } + + static QueryCompiler createForUnitTests() { + return new QueryCompiler(new File(Configuration.getInstance().getWorkspacePath() + + File.separator + "cache" + File.separator + "classes")); + } + + private final Map>> knownClasses = new HashMap<>(); + + private final String[] dynamicPatterns = new String[] {DYNAMIC_GROOVY_CLASS_PREFIX, FORMULA_PREFIX}; + + private final File classDestination; + private final boolean isCacheDirectory; + private final Set additionalClassLocations; + private volatile WritableURLClassLoader ucl; + + /** package-private constructor for {@link io.deephaven.engine.context.PoisonedQueryCompiler} */ + QueryCompiler() { + classDestination = null; + isCacheDirectory = false; + additionalClassLocations = null; + } + + private QueryCompiler(File classDestination) { + this(classDestination, null, false); + } + + private QueryCompiler( + final File classDestination, + final ClassLoader parentClassLoader, + final boolean isCacheDirectory) { + final ClassLoader parentClassLoaderToUse = parentClassLoader == null + ? QueryCompiler.class.getClassLoader() + : parentClassLoader; + this.classDestination = classDestination; + this.isCacheDirectory = isCacheDirectory; + ensureDirectories(this.classDestination, () -> "Failed to create missing class destination directory " + + classDestination.getAbsolutePath()); + additionalClassLocations = new LinkedHashSet<>(); + + URL[] urls = new URL[1]; + try { + urls[0] = (classDestination.toURI().toURL()); + } catch (MalformedURLException e) { + throw new RuntimeException("", e); + } + // We should be able to create this class loader, even if this is invoked from external code + // that does not have sufficient security permissions. + this.ucl = doPrivileged((PrivilegedAction) () -> new WritableURLClassLoader(urls, + parentClassLoaderToUse)); + + if (isCacheDirectory) { + addClassSource(classDestination); + } + } + /** * Enables or disables compilation logging. * @@ -69,8 +132,8 @@ public class CompilerTools { * @return The value of {@code logEnabled} before calling this method. */ public static boolean setLogEnabled(boolean logEnabled) { - boolean original = CompilerTools.logEnabled; - CompilerTools.logEnabled = logEnabled; + boolean original = QueryCompiler.logEnabled; + QueryCompiler.logEnabled = logEnabled; return original; } @@ -84,18 +147,6 @@ public static void writeClass(final File destinationDirectory, final String clas writeClass(destinationDirectory, className, data, null); } - private static void ensureDirectories(final File file, final Supplier runtimeErrMsg) { - // File.mkdirs() checks for existrance on entry, in which case it returns false. - // It may also return false on a failure to create. - // Also note, two separate threads or JVMs may be running this code in parallel. It's possible that we could - // lose the race - // (and therefore mkdirs() would return false), but still get the directory we need (and therefore exists() - // would return true) - if (!file.mkdirs() && !file.isDirectory()) { - throw new RuntimeException(runtimeErrMsg.get()); - } - } - /* * NB: This is (obviously) not thread safe if code tries to write the same className to the same * destinationDirectory from multiple threads. Seeing as we don't currently have this use case, leaving @@ -144,327 +195,257 @@ public static void writeClass(final File destinationDirectory, final String clas fileOutStream.close(); } - public static final String FORMULA_PREFIX = "io.deephaven.temp"; - public static final String DYNAMIC_GROOVY_CLASS_PREFIX = "io.deephaven.dynamic"; - - public interface Context { - Map>> getKnownClasses(); - - ClassLoader getClassLoaderForFormula(Map> parameterClasses); - - File getClassDestination(); - - File getFakeClassDestination(); - - String getClassPath(); + public File getFakeClassDestination() { + // Groovy classes need to be written out to a location where they can be found by the compiler + // (so that filters and formulae can use them). + // + // We don't want the regular runtime class loader to find them, because then they get "stuck" in there + // even if the class itself changes, and we can't forget it. So instead we use a single-use class loader + // for each formula, that will always read the class from disk. + return isCacheDirectory ? classDestination : null; + } - void setParentClassLoader(ClassLoader parentClassLoader); + public void setParentClassLoader(final ClassLoader parentClassLoader) { + // The system should always be able to create this class loader, even if invoked from something that + // doesn't have the right security permissions for it. + ucl = doPrivileged( + (PrivilegedAction) () -> new WritableURLClassLoader(ucl.getURLs(), + parentClassLoader)); } - public static Context newContext(File cacheDirectory, ClassLoader classLoader) { - return new CompilerTools.ContextImpl(cacheDirectory, classLoader, true); + public final Class compile(String className, String classBody, String packageNameRoot) { + return compile(className, classBody, packageNameRoot, null, Collections.emptyMap()); } - private static class ContextImpl implements Context { - private final Map>> knownClasses = new HashMap<>(); + public final Class compile(String className, String classBody, String packageNameRoot, + Map> parameterClasses) { + return compile(className, classBody, packageNameRoot, null, parameterClasses); + } - String[] dynamicPatterns = new String[] {DYNAMIC_GROOVY_CLASS_PREFIX, FORMULA_PREFIX}; + public final Class compile(String className, String classBody, String packageNameRoot, StringBuilder codeLog) { + return compile(className, classBody, packageNameRoot, codeLog, Collections.emptyMap()); + } - private final File classDestination; - private final boolean isCacheDirectory; - private final Set additionalClassLocations; - private volatile WritableURLClassLoader ucl; + /** + * Compile a class. + * + * @param className Class name + * @param classBody Class body, before update with "$CLASS_NAME$" replacement and package name prefixing + * @param packageNameRoot Package name prefix + * @param codeLog Optional "log" for final class code + * @param parameterClasses Generic parameters, empty if none required + * @return The compiled class + */ + public Class compile(@NotNull final String className, + @NotNull final String classBody, + @NotNull final String packageNameRoot, + @Nullable final StringBuilder codeLog, + @NotNull final Map> parameterClasses) { + CompletableFuture> promise; + final boolean promiseAlreadyMade; - private ContextImpl(File classDestination) { - this(classDestination, Context.class.getClassLoader(), false); + synchronized (this) { + promise = knownClasses.get(classBody); + if (promise != null) { + promiseAlreadyMade = true; + } else { + promise = new CompletableFuture<>(); + knownClasses.put(classBody, promise); + promiseAlreadyMade = false; + } } - private ContextImpl(File classDestination, ClassLoader parentClassLoader, boolean isCacheDirectory) { - this.classDestination = classDestination; - this.isCacheDirectory = isCacheDirectory; - ensureDirectories(this.classDestination, () -> "Failed to create missing class destination directory " + - classDestination.getAbsolutePath()); - additionalClassLocations = new LinkedHashSet<>(); - - URL[] urls = new URL[1]; + // Someone else has already made the promise. I'll just wait for the answer. + if (promiseAlreadyMade) { try { - urls[0] = (classDestination.toURI().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException("", e); - } - // We should be able to create this class loader, even if this is invoked from external code - // that does not have sufficient security permissions. - this.ucl = doPrivileged((PrivilegedAction) () -> new WritableURLClassLoader(urls, - parentClassLoader)); - - if (isCacheDirectory) { - addClassSource(classDestination); + return promise.get(); + } catch (InterruptedException | ExecutionException error) { + throw new UncheckedDeephavenException(error); } } - @Override - public Map>> getKnownClasses() { - return knownClasses; + // It's my job to fulfill the promise + try { + return compileHelper(className, classBody, packageNameRoot, codeLog, parameterClasses); + } catch (RuntimeException e) { + promise.completeExceptionally(e); + throw e; } + } - @Override - public ClassLoader getClassLoaderForFormula(final Map> parameterClasses) { - // We should always be able to get our own class loader, even if this is invoked from external code - // that doesn't have security permissions to make ITS own class loader. - return doPrivileged((PrivilegedAction) () -> new URLClassLoader(ucl.getURLs(), ucl) { - // Once we find a class that is missing, we should not attempt to load it again, - // otherwise we can end up with a StackOverflow Exception - final HashSet missingClasses = new HashSet<>(); - - @Override - protected Class findClass(String name) throws ClassNotFoundException { - // If we have a parameter that uses this class, return it - final Class paramClass = parameterClasses.get(name); - if (paramClass != null) { - return paramClass; - } - - // Unless we are looking for a formula or Groovy class, we should use the default behavior - if (!isFormulaClass(name)) { - return super.findClass(name); - } - - // if it is a groovy class, always try to use the instance in the shell - if (name.startsWith(DYNAMIC_GROOVY_CLASS_PREFIX)) { - try { - return ucl.getParent().loadClass(name); - } catch (final ClassNotFoundException ignored) { - // we'll try to load it otherwise - } - } + private static void ensureDirectories(final File file, final Supplier runtimeErrMsg) { + // File.mkdirs() checks for existence on entry, in which case it returns false. + // It may also return false on a failure to create. + // Also note, two separate threads or JVMs may be running this code in parallel. It's possible that we could + // lose the race + // (and therefore mkdirs() would return false), but still get the directory we need (and therefore exists() + // would return true) + if (!file.mkdirs() && !file.isDirectory()) { + throw new RuntimeException(runtimeErrMsg.get()); + } + } - // We've already not found this class, so we should not try to search again - if (missingClasses.contains(name)) { - return super.findClass(name); - } + private ClassLoader getClassLoaderForFormula(final Map> parameterClasses) { + // We should always be able to get our own class loader, even if this is invoked from external code + // that doesn't have security permissions to make ITS own class loader. + return doPrivileged((PrivilegedAction) () -> new URLClassLoader(ucl.getURLs(), ucl) { + // Once we find a class that is missing, we should not attempt to load it again, + // otherwise we can end up with a StackOverflow Exception + final HashSet missingClasses = new HashSet<>(); - final byte[] bytes; - try { - bytes = loadClassData(name); - } catch (IOException ioe) { - missingClasses.add(name); - return super.loadClass(name); - } - return defineClass(name, bytes, 0, bytes.length); + @Override + protected Class findClass(String name) throws ClassNotFoundException { + // If we have a parameter that uses this class, return it + final Class paramClass = parameterClasses.get(name); + if (paramClass != null) { + return paramClass; } - @SuppressWarnings("BooleanMethodIsAlwaysInverted") - private boolean isFormulaClass(String name) { - return Arrays.stream(dynamicPatterns).anyMatch(name::startsWith); + // Unless we are looking for a formula or Groovy class, we should use the default behavior + if (!isFormulaClass(name)) { + return super.findClass(name); } - @Override - public Class loadClass(String name) throws ClassNotFoundException { - if (!isFormulaClass(name)) { - return super.loadClass(name); + // if it is a groovy class, always try to use the instance in the shell + if (name.startsWith(DYNAMIC_GROOVY_CLASS_PREFIX)) { + try { + return ucl.getParent().loadClass(name); + } catch (final ClassNotFoundException ignored) { + // we'll try to load it otherwise } - return findClass(name); } - private byte[] loadClassData(String name) throws IOException { - try { - // The compiler should always have access to the class-loader directories, - // even if code that invokes this does not. - return doPrivileged((PrivilegedExceptionAction) () -> { - final File destFile = new File(classDestination, - name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); - if (destFile.exists()) { - return Files.readAllBytes(destFile.toPath()); - } - - for (File location : additionalClassLocations) { - final File checkFile = new File(location, - name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); - if (checkFile.exists()) { - return Files.readAllBytes(checkFile.toPath()); - } - } + // We've already not found this class, so we should not try to search again + if (missingClasses.contains(name)) { + return super.findClass(name); + } - throw new FileNotFoundException(name); - }); - } catch (final PrivilegedActionException pae) { - final Exception inner = pae.getException(); - if (inner instanceof IOException) { - throw (IOException) inner; - } else { - throw new RuntimeException(inner); - } - } + final byte[] bytes; + try { + bytes = loadClassData(name); + } catch (IOException ioe) { + missingClasses.add(name); + return super.loadClass(name); } - }); - } + return defineClass(name, bytes, 0, bytes.length); + } - private static class WritableURLClassLoader extends URLClassLoader { - private WritableURLClassLoader(URL[] urls, ClassLoader parent) { - super(urls, parent); + @SuppressWarnings("BooleanMethodIsAlwaysInverted") + private boolean isFormulaClass(String name) { + return Arrays.stream(dynamicPatterns).anyMatch(name::startsWith); } @Override - protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - Class clazz = findLoadedClass(name); - if (clazz != null) { - return clazz; + public Class loadClass(String name) throws ClassNotFoundException { + if (!isFormulaClass(name)) { + return super.loadClass(name); } + return findClass(name); + } + private byte[] loadClassData(String name) throws IOException { try { - clazz = findClass(name); - } catch (ClassNotFoundException e) { - clazz = getParent().loadClass(name); - } + // The compiler should always have access to the class-loader directories, + // even if code that invokes this does not. + return doPrivileged((PrivilegedExceptionAction) () -> { + final File destFile = new File(classDestination, + name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); + if (destFile.exists()) { + return Files.readAllBytes(destFile.toPath()); + } - if (resolve) { - resolveClass(clazz); + for (File location : additionalClassLocations) { + final File checkFile = new File(location, + name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); + if (checkFile.exists()) { + return Files.readAllBytes(checkFile.toPath()); + } + } + + throw new FileNotFoundException(name); + }); + } catch (final PrivilegedActionException pae) { + final Exception inner = pae.getException(); + if (inner instanceof IOException) { + throw (IOException) inner; + } else { + throw new RuntimeException(inner); + } } - return clazz; } + }); + } - @Override - public synchronized void addURL(URL url) { - super.addURL(url); - } + private static class WritableURLClassLoader extends URLClassLoader { + private WritableURLClassLoader(URL[] urls, ClassLoader parent) { + super(urls, parent); } - protected void addClassSource(File classSourceDirectory) { - synchronized (additionalClassLocations) { - if (additionalClassLocations.contains(classSourceDirectory)) { - return; - } - additionalClassLocations.add(classSourceDirectory); + @Override + protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + Class clazz = findLoadedClass(name); + if (clazz != null) { + return clazz; } + try { - ucl.addURL(classSourceDirectory.toURI().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException("", e); + clazz = findClass(name); + } catch (ClassNotFoundException e) { + if (getParent() != null) { + clazz = getParent().loadClass(name); + } } - } - public File getFakeClassDestination() { - // Groovy classes need to be written out to a location where they can be found by the compiler - // (so that filters and formulae can use them). - // - // We don't want the regular runtime class loader to find them, because then they get "stuck" in there - // even if the class itself changes, and we can't forget it. So instead we use a single-use class loader - // for each formula, that will always read the class from disk. - return isCacheDirectory ? classDestination : null; + if (resolve) { + resolveClass(clazz); + } + return clazz; } @Override - public File getClassDestination() { - return classDestination; + public synchronized void addURL(URL url) { + super.addURL(url); } + } - public String getClassPath() { - StringBuilder sb = new StringBuilder(); - sb.append(classDestination.getAbsolutePath()); - synchronized (additionalClassLocations) { - for (File classLoc : additionalClassLocations) { - sb.append(File.pathSeparatorChar).append(classLoc.getAbsolutePath()); - } + private void addClassSource(File classSourceDirectory) { + synchronized (additionalClassLocations) { + if (additionalClassLocations.contains(classSourceDirectory)) { + return; } - return sb.toString(); - } - - public WritableURLClassLoader getClassLoader() { - return ucl; - } - - public void setParentClassLoader(final ClassLoader parentClassLoader) { - // The system should always be able to create this class loader, even if invoked from something that - // doesn't have the right security permissions for it. - ucl = doPrivileged( - (PrivilegedAction) () -> new WritableURLClassLoader(ucl.getURLs(), - parentClassLoader)); + additionalClassLocations.add(classSourceDirectory); } - - public void cleanup() { - FileUtils.deleteRecursively(classDestination); + try { + ucl.addURL(classSourceDirectory.toURI().toURL()); + } catch (MalformedURLException e) { + throw new RuntimeException("", e); } } - static Context createContextForUnitTests() { - return new ContextImpl(new File(Configuration.getInstance().getWorkspacePath() + - File.separator + "cache" + File.separator + "classes")); - } - - public static Context getContext() { - return ExecutionContext.getContext().getCompilerContext(); - } - - private static boolean logEnabled = Configuration.getInstance().getBoolean("CompilerTools.logEnabledDefault"); - - public static Class compile(String className, String classBody, String packageNameRoot) { - return compile(className, classBody, packageNameRoot, null, Collections.emptyMap()); - } - - public static Class compile(String className, String classBody, String packageNameRoot, - Map> parameterClasses) { - return compile(className, classBody, packageNameRoot, null, parameterClasses); + private File getClassDestination() { + return classDestination; } - public static Class compile(String className, String classBody, String packageNameRoot, StringBuilder codeLog) { - return compile(className, classBody, packageNameRoot, codeLog, Collections.emptyMap()); - } - - /** - * Compile a class. - * - * @param className Class name - * @param classBody Class body, before update with "$CLASS_NAME$" replacement and package name prefixing - * @param packageNameRoot Package name prefix - * @param codeLog Optional "log" for final class code - * @param parameterClasses Generic parameters, empty if none required - * @return The compiled class - */ - public static Class compile(@NotNull final String className, - @NotNull final String classBody, - @NotNull final String packageNameRoot, - @Nullable final StringBuilder codeLog, - @NotNull final Map> parameterClasses) { - CompletableFuture> promise; - final boolean promiseAlreadyMade; - - final Context context = getContext(); - - synchronized (context) { - promise = context.getKnownClasses().get(classBody); - if (promise != null) { - promiseAlreadyMade = true; - } else { - promise = new CompletableFuture<>(); - context.getKnownClasses().put(classBody, promise); - promiseAlreadyMade = false; - } - } - - // Someone else has already made the promise. I'll just wait for the answer. - if (promiseAlreadyMade) { - try { - return promise.get(); - } catch (InterruptedException | ExecutionException error) { - throw new UncheckedDeephavenException(error); + private String getClassPath() { + StringBuilder sb = new StringBuilder(); + sb.append(classDestination.getAbsolutePath()); + synchronized (additionalClassLocations) { + for (File classLoc : additionalClassLocations) { + sb.append(File.pathSeparatorChar).append(classLoc.getAbsolutePath()); } } + return sb.toString(); + } - // It's my job to fulfill the promise - try { - return compileHelper(className, classBody, packageNameRoot, codeLog, parameterClasses, context); - } catch (RuntimeException e) { - promise.completeExceptionally(e); - throw e; - } + private WritableURLClassLoader getClassLoader() { + return ucl; } - private static Class compileHelper(@NotNull final String className, + private Class compileHelper(@NotNull final String className, @NotNull final String classBody, @NotNull final String packageNameRoot, @Nullable final StringBuilder codeLog, - @NotNull final Map> parameterClasses, - @NotNull final Context context) { + @NotNull final Map> parameterClasses) { // NB: We include class name hash in order to (hopefully) account for case insensitive file systems. final int classNameHash = className.hashCode(); final int classBodyHash = classBody.hashCode(); @@ -518,13 +499,13 @@ private static Class compileHelper(@NotNull final String className, // We have a class. It either contains the formula we are looking for (cases 2, A, and B) or a different // formula with the same name (cases 3 and C). In either case, we should store the result in our cache, // either fulfilling an existing promise or making a new, fulfilled promise. - synchronized (context) { + synchronized (this) { // Note we are doing something kind of subtle here. We are removing an entry whose key was matched by // value equality and replacing it with a value-equal but reference-different string that is a static // member of the class we just loaded. This should be easier on the garbage collector because we are // replacing a calculated value with a classloaded value and so in effect we are "canonicalizing" the // string. This is important because these long strings stay in knownClasses forever. - CompletableFuture> p = context.getKnownClasses().remove(identifyingFieldValue); + CompletableFuture> p = knownClasses.remove(identifyingFieldValue); if (p == null) { // If we encountered a different class than the one we're looking for, make a fresh promise and // immediately fulfill it. This is for the purpose of populating the cache in case someone comes @@ -532,7 +513,7 @@ private static Class compileHelper(@NotNull final String className, // throwing it away now, even though this is not the class we're looking for. p = new CompletableFuture<>(); } - context.getKnownClasses().put(identifyingFieldValue, p); + knownClasses.put(identifyingFieldValue, p); // It's also possible that some other code has already fulfilled this promise with exactly the same // class. That's ok though: the promise code does not reject multiple sets to the identical value. p.complete(result); @@ -554,9 +535,9 @@ private static Class compileHelper(@NotNull final String className, + ", class body hash=" + classBodyHash + " - contact Deephaven support!"); } - private static Class tryLoadClassByFqName(String fqClassName, Map> parameterClasses) { + private Class tryLoadClassByFqName(String fqClassName, Map> parameterClasses) { try { - return getContext().getClassLoaderForFormula(parameterClasses).loadClass(fqClassName); + return getClassLoaderForFormula(parameterClasses).loadClass(fqClassName); } catch (ClassNotFoundException cnfe) { return null; } @@ -641,7 +622,7 @@ private static int calcBytesConsumed(final char ch) { return 3; } - static class JavaSourceFromString extends SimpleJavaFileObject { + private static class JavaSourceFromString extends SimpleJavaFileObject { final String code; JavaSourceFromString(String name, String code) { @@ -654,11 +635,11 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) { } } - static class JavaSourceFromFile extends SimpleJavaFileObject { + private static class JavaSourceFromFile extends SimpleJavaFileObject { private static final int JAVA_LENGTH = Kind.SOURCE.extension.length(); final String code; - JavaSourceFromFile(File basePath, File file) { + private JavaSourceFromFile(File basePath, File file) { super(URI.create("string:///" + createName(basePath, file).replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); try { @@ -682,12 +663,13 @@ private static String createName(File basePath, File file) { } } + @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { return code; } } - private static void maybeCreateClass(String className, String code, String packageName, String fqClassName) { + private void maybeCreateClass(String className, String code, String packageName, String fqClassName) { final String finalCode = makeFinalCode(className, code, packageName); // The 'compile' action does a bunch of things that need security permissions; this always needs to run @@ -696,8 +678,7 @@ private static void maybeCreateClass(String className, String code, String packa log.info().append("Generating code ").append(finalCode).endl(); } - final Context ctx = getContext(); - final File ctxClassDestination = ctx.getClassDestination(); + final File ctxClassDestination = getClassDestination(); final String[] splitPackageName = packageName.split("\\."); if (splitPackageName.length == 0) { @@ -735,7 +716,7 @@ private static void maybeCreateClass(String className, String code, String packa } try { - maybeCreateClassHelper(fqClassName, finalCode, splitPackageName, ctx, rootPathAsString, tempDirAsString); + maybeCreateClassHelper(fqClassName, finalCode, splitPackageName, rootPathAsString, tempDirAsString); } finally { AccessController.doPrivileged((PrivilegedAction) () -> { try { @@ -748,8 +729,8 @@ private static void maybeCreateClass(String className, String code, String packa } } - private static void maybeCreateClassHelper(String fqClassName, String finalCode, String[] splitPackageName, - Context ctx, String rootPathAsString, String tempDirAsString) { + private void maybeCreateClassHelper(String fqClassName, String finalCode, String[] splitPackageName, + String rootPathAsString, String tempDirAsString) { final StringWriter compilerOutput = new StringWriter(); final JavaCompiler compiler = @@ -758,7 +739,7 @@ private static void maybeCreateClassHelper(String fqClassName, String finalCode, throw new RuntimeException("No Java compiler provided - are you using a JRE instead of a JDK?"); } - final String classPathAsString = ctx.getClassPath() + File.pathSeparator + getJavaClassPath(); + final String classPathAsString = getClassPath() + File.pathSeparator + getJavaClassPath(); final List compilerOptions = AccessController.doPrivileged( (PrivilegedAction>) () -> Arrays.asList("-d", tempDirAsString, "-cp", classPathAsString)); @@ -772,14 +753,13 @@ private static void maybeCreateClassHelper(String fqClassName, String finalCode, Collections.singletonList(new JavaSourceFromString(fqClassName, finalCode))) .call(); if (!result) { - throw new RuntimeException("Error compiling class " + fqClassName + ":\n" + compilerOutput.toString()); + throw new RuntimeException("Error compiling class " + fqClassName + ":\n" + compilerOutput); } // The above has compiled into into e.g. // /tmp/workspace/cache/classes/temporaryCompilationDirectory12345/io/deephaven/test/cm12862183232603186v52_0/{various // class files} // We want to atomically move it to e.g. // /tmp/workspace/cache/classes/io/deephaven/test/cm12862183232603186v52_0/{various class files} - // Our strategy try { AccessController.doPrivileged((PrivilegedExceptionAction) () -> { Path srcDir = Paths.get(tempDirAsString, splitPackageName); @@ -809,7 +789,7 @@ private static void maybeCreateClassHelper(String fqClassName, String finalCode, * @param javaFiles the java source files * @return a Pair of success, and the compiler output */ - public static Pair tryCompile(File basePath, Collection javaFiles) throws IOException { + private Pair tryCompile(File basePath, Collection javaFiles) throws IOException { try { // We need multiple filesystem accesses et al, so make this whole section privileged. return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> { @@ -823,7 +803,6 @@ public static Pair tryCompile(File basePath, Collection j try { final StringWriter compilerOutput = new StringWriter(); - final Context ctx = getContext(); final String javaClasspath = getJavaClassPath(); final Collection javaFileObjects = javaFiles.stream() @@ -831,7 +810,7 @@ public static Pair tryCompile(File basePath, Collection j final boolean result = compiler.getTask(compilerOutput, null, null, Arrays.asList("-d", outputDirectory.getAbsolutePath(), "-cp", - ctx.getClassPath() + File.pathSeparator + javaClasspath), + getClassPath() + File.pathSeparator + javaClasspath), null, javaFileObjects).call(); return new Pair<>(result, compilerOutput.toString()); @@ -854,7 +833,7 @@ public static Pair tryCompile(File basePath, Collection j * * @return */ - public static String getJavaClassPath() { + private static String getJavaClassPath() { String javaClasspath; { final StringBuilder javaClasspathBuilder = new StringBuilder(System.getProperty("java.class.path")); @@ -862,18 +841,18 @@ public static String getJavaClassPath() { final String teamCityWorkDir = System.getProperty("teamcity.build.workingDir"); if (teamCityWorkDir != null) { // We are running in TeamCity, get the classpath differently - final File classDirs[] = new File(teamCityWorkDir + "/_out_/classes").listFiles(); + final File[] classDirs = new File(teamCityWorkDir + "/_out_/classes").listFiles(); for (File f : classDirs) { javaClasspathBuilder.append(File.pathSeparator).append(f.getAbsolutePath()); } - final File testDirs[] = new File(teamCityWorkDir + "/_out_/test-classes").listFiles(); + final File[] testDirs = new File(teamCityWorkDir + "/_out_/test-classes").listFiles(); for (File f : testDirs) { javaClasspathBuilder.append(File.pathSeparator).append(f.getAbsolutePath()); } - final File jars[] = FileUtils.findAllFiles(new File(teamCityWorkDir + "/lib")); + final File[] jars = FileUtils.findAllFiles(new File(teamCityWorkDir + "/lib")); for (File f : jars) { if (f.getName().endsWith(".jar")) { javaClasspathBuilder.append(File.pathSeparator).append(f.getAbsolutePath()); @@ -890,7 +869,7 @@ public static String getJavaClassPath() { if (javaClasspath.matches(intellijClassPathJarRegex)) { try { final Enumeration resources = - CompilerTools.class.getClassLoader().getResources("META-INF/MANIFEST.MF"); + QueryCompiler.class.getClassLoader().getResources("META-INF/MANIFEST.MF"); final Attributes.Name createdByAttribute = new Attributes.Name("Created-By"); final Attributes.Name classPathAttribute = new Attributes.Name("Class-Path"); while (resources.hasMoreElements()) { diff --git a/engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java b/engine/context/src/test/java/io/deephaven/engine/context/TestQueryCompiler.java similarity index 93% rename from engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java rename to engine/context/src/test/java/io/deephaven/engine/context/TestQueryCompiler.java index f43ac9b6d08..6d22a650162 100644 --- a/engine/context/src/test/java/io/deephaven/engine/context/TestCompilerTools.java +++ b/engine/context/src/test/java/io/deephaven/engine/context/TestQueryCompiler.java @@ -17,7 +17,7 @@ import java.util.Collections; import java.util.List; -public class TestCompilerTools { +public class TestQueryCompiler { private final static int NUM_THREADS = 500; private final static int NUM_METHODS = 5000; private final static long WAIT_BETWEEN_THREAD_START_MILLIS = 5; @@ -158,7 +158,8 @@ private void compile(boolean printDetails, final String className) throws Except } else { startMillis = 0; } - CompilerTools.compile(className, CLASS_CODE, "io.deephaven.temp"); + ExecutionContext.getContext().getQueryCompiler() + .compile(className, CLASS_CODE, "io.deephaven.temp"); if (printDetails) { final long endMillis = System.currentTimeMillis(); System.out.println(printMillis(endMillis) + ": Thread 0 ending compile: (" + (endMillis - startMillis) @@ -185,8 +186,8 @@ public void testSimpleCompile() throws Exception { "}"); StringBuilder codeLog = new StringBuilder(); - final Class clazz1 = - CompilerTools.compile("Test", program1Text, "com.deephaven.test", codeLog, Collections.emptyMap()); + final Class clazz1 = ExecutionContext.getContext().getQueryCompiler() + .compile("Test", program1Text, "com.deephaven.test", codeLog, Collections.emptyMap()); final Method m1 = clazz1.getMethod("main", String[].class); Object[] args1 = new Object[] {new String[] {"hello", "there"}}; m1.invoke(null, args1); @@ -208,8 +209,9 @@ public void testCollidingCompile() throws Exception { Thread t = new Thread(() -> { StringBuilder codeLog = new StringBuilder(); try { - final Class clazz1 = CompilerTools.compile("Test", program1Text, "com.deephaven.test", codeLog, - Collections.emptyMap()); + final Class clazz1 = ExecutionContext.getContext().getQueryCompiler() + .compile("Test", program1Text, "com.deephaven.test", codeLog, + Collections.emptyMap()); final Method m1 = clazz1.getMethod("main", String[].class); Object[] args1 = new Object[] {new String[] {"hello", "there"}}; m1.invoke(null, args1); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index 1025d408ab5..ecc83cc6a16 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -10,7 +10,8 @@ import io.deephaven.chunk.*; import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; @@ -33,11 +34,11 @@ import io.deephaven.util.compare.CharComparisons; import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.lang.model.element.Modifier; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.security.spec.ECField; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -476,7 +477,7 @@ public static T make(HasherConfig hasherConfig, ColumnSource[] tableKe final String javaString = Arrays.stream(javaStrings).filter(s -> !s.startsWith("package ")).collect(Collectors.joining("\n")); - final Class clazz = CompilerTools.compile(className, javaString, + final Class clazz = ExecutionContext.getContext().getQueryCompiler().compile(className, javaString, "io.deephaven.engine.table.impl.by.typed." + hasherConfig.packageMiddle + ".gen"); if (!hasherConfig.baseClass.isAssignableFrom(clazz)) { throw new IllegalStateException("Generated class is not a " + hasherConfig.baseClass.getCanonicalName()); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 7738d7ec678..4960878ec81 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -132,7 +132,7 @@ private static ExecutionContext getOrCreateExecutionContext(final boolean requir ExecutionContext context = ExecutionContext.getContextToRecord(); if (context == null) { final ExecutionContext.Builder builder = ExecutionContext.newBuilder() - .captureCompilerContext() + .captureQueryCompiler() .markSystemic(); if (requiresFullContext) { builder.newQueryLibrary(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java index fbeb6ed341f..0bb90ca9505 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/ConditionFilter.java @@ -5,7 +5,7 @@ import io.deephaven.base.Pair; import io.deephaven.chunk.attributes.Any; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.table.Context; @@ -390,8 +390,9 @@ protected void generateFilterCode(TableDefinition tableDefinition, DateTimeUtils addParamClass.accept(QueryScopeParamTypeUtil.getDeclaredClass(param.getValue())); } - filterKernelClass = CompilerTools.compile("GeneratedFilterKernel", this.classBody = classBody.toString(), - CompilerTools.FORMULA_PREFIX, QueryScopeParamTypeUtil.expandParameterClasses(paramClasses)); + filterKernelClass = ExecutionContext.getContext().getQueryCompiler() + .compile("GeneratedFilterKernel", this.classBody = classBody.toString(), + QueryCompiler.FORMULA_PREFIX, QueryScopeParamTypeUtil.expandParameterClasses(paramClasses)); } finally { nugget.done(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java index dd1fe98b2d9..da4de5afd46 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java @@ -4,7 +4,7 @@ package io.deephaven.engine.table.impl.select; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.Table; @@ -344,7 +344,7 @@ private CodeGenerator generateApplyFormulaPerItem(final TypeAnalyzer ta) { g.replace("ARGS", makeCommaSeparatedList(args)); g.replace("FORMULA_STRING", ta.wrapWithCastIfNecessary(formulaString)); g.replace("COLUMN_NAME", StringEscapeUtils.escapeJava(columnName)); - final String joinedFormulaString = CompilerTools.createEscapedJoinedString(formulaString); + final String joinedFormulaString = QueryCompiler.createEscapedJoinedString(formulaString); g.replace("JOINED_FORMULA_STRING", joinedFormulaString); g.replace("EXCEPTION_TYPE", EVALUATION_EXCEPTION_CLASSNAME); return g.freeze(); @@ -765,10 +765,11 @@ private Class compileFormula(final String what, final String classBody, final addParamClass.accept(p.type); return null; }); + final QueryCompiler compiler = ExecutionContext.getContext().getQueryCompiler(); return AccessController .doPrivileged( - (PrivilegedExceptionAction>) () -> CompilerTools.compile(className, classBody, - CompilerTools.FORMULA_PREFIX, + (PrivilegedExceptionAction>) () -> compiler.compile(className, classBody, + QueryCompiler.FORMULA_PREFIX, QueryScopeParamTypeUtil.expandParameterClasses(paramClasses))); } catch (PrivilegedActionException pae) { throw new FormulaCompilationException("Formula compilation error for: " + what, pae.getException()); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java index c1a25668420..eff4220e584 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/QueryScopeParamTypeUtil.java @@ -4,7 +4,7 @@ package io.deephaven.engine.table.impl.select; import groovy.lang.Closure; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.util.type.TypeUtils; import java.lang.reflect.Modifier; @@ -48,7 +48,7 @@ private static void visitParameterClass(final Map> found, Class } final String name = cls.getName(); - if (!name.startsWith(CompilerTools.DYNAMIC_GROOVY_CLASS_PREFIX)) { + if (!name.startsWith(QueryCompiler.DYNAMIC_GROOVY_CLASS_PREFIX)) { return; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java index f1aec384ff6..f4fbe37fa48 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/SelectColumn.java @@ -8,6 +8,7 @@ import io.deephaven.api.Selectable; import io.deephaven.api.expression.Expression; import io.deephaven.api.value.Value; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.table.*; import io.deephaven.engine.table.WritableColumnSource; import io.deephaven.engine.rowset.TrackingRowSet; @@ -69,8 +70,7 @@ static SelectColumn[] copyFrom(SelectColumn[] selectColumns) { * * @return a list of columns on which the result of this is dependent * @apiNote Any {@link io.deephaven.engine.context.QueryLibrary}, {@link io.deephaven.engine.context.QueryScope}, or - * {@link io.deephaven.engine.context.CompilerTools} usage needs to be resolved within initDef. - * Implementations must be idempotent. + * {@link QueryCompiler} usage needs to be resolved within initDef. Implementations must be idempotent. */ List initDef(Map> columnDefinitionMap); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java index 38a349cf544..e17bf6fca8d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/WhereFilter.java @@ -8,6 +8,7 @@ import io.deephaven.api.Strings; import io.deephaven.api.filter.*; import io.deephaven.api.value.Value; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.rowset.WritableRowSet; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; @@ -107,8 +108,7 @@ interface RecomputeListener { * * @param tableDefinition the definition of the table that will be filtered * @apiNote Any {@link io.deephaven.engine.context.QueryLibrary}, {@link io.deephaven.engine.context.QueryScope}, or - * {@link io.deephaven.engine.context.CompilerTools} usage needs to be resolved within init. - * Implementations must be idempotent. + * {@link QueryCompiler} usage needs to be resolved within init. Implementations must be idempotent. */ void init(TableDefinition tableDefinition); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java index f650ec164c8..3cd97dbe1d7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java @@ -3,7 +3,7 @@ */ package io.deephaven.engine.table.impl.select.codegen; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.vector.Vector; import io.deephaven.engine.context.QueryScopeParam; @@ -217,7 +217,7 @@ private CodeGenerator generateApplyFormulaPerItem(final TypeAnalyzer ta) { null); g.replace("ARGS", makeCommaSeparatedList(args)); g.replace("FORMULA_STRING", ta.wrapWithCastIfNecessary(cookedFormulaString)); - final String joinedFormulaString = CompilerTools.createEscapedJoinedString(cookedFormulaString); + final String joinedFormulaString = QueryCompiler.createEscapedJoinedString(cookedFormulaString); g.replace("JOINED_FORMULA_STRING", joinedFormulaString); g.replace("EXCEPTION_TYPE", FormulaEvaluationException.class.getCanonicalName()); return g.freeze(); @@ -266,8 +266,9 @@ private static Class compileFormula(final String what, final String classBody try (final QueryPerformanceNugget nugget = QueryPerformanceRecorder.getInstance().getNugget("Compile:" + what)) { // Compilation needs to take place with elevated privileges, but the created object should not have them. - return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> CompilerTools - .compile(className, classBody, CompilerTools.FORMULA_PREFIX)); + final QueryCompiler compiler = ExecutionContext.getContext().getQueryCompiler(); + return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> compiler.compile(className, + classBody, QueryCompiler.FORMULA_PREFIX)); } catch (PrivilegedActionException pae) { throw new FormulaCompilationException("Formula compilation error for: " + what, pae.getException()); } diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java index c2afafea72a..8caa1b24282 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java @@ -7,14 +7,13 @@ import io.deephaven.UncheckedDeephavenException; import io.deephaven.api.util.NameValidator; import io.deephaven.base.FileUtils; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.engine.context.QueryLibrary; import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.plugin.type.ObjectType; @@ -75,14 +74,13 @@ protected AbstractScriptSession(ObjectTypeLookup objectTypeLookup, @Nullable Lis createOrClearDirectory(classCacheDirectory); final QueryScope queryScope = newQueryScope(); - final CompilerTools.Context compilerContext = - CompilerTools.newContext(classCacheDirectory, getClass().getClassLoader()); + final QueryCompiler compilerContext = QueryCompiler.create(classCacheDirectory, getClass().getClassLoader()); executionContext = ExecutionContext.newBuilder() .markSystemic() .newQueryLibrary() .setQueryScope(queryScope) - .setCompilerContext(compilerContext) + .setQueryCompiler(compilerContext) .build(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java b/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java index b9e79e81865..6991153b155 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/DynamicCompileUtils.java @@ -3,7 +3,8 @@ */ package io.deephaven.engine.util; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryCompiler; import java.util.*; import java.util.function.Supplier; @@ -51,8 +52,8 @@ public static Supplier compileSimpleFunction(final Class res classBody.append(" }\n"); classBody.append("}\n"); - final Class partitionClass = - CompilerTools.compile("Function", classBody.toString(), CompilerTools.FORMULA_PREFIX); + final Class partitionClass = ExecutionContext.getContext().getQueryCompiler() + .compile("Function", classBody.toString(), QueryCompiler.FORMULA_PREFIX); try { // noinspection unchecked @@ -70,8 +71,8 @@ public static Class getClassThroughCompilation(final String object) { classBody.append(" public Class get() { return ").append(object).append(".class; }\n"); classBody.append("}\n"); - final Class partitionClass = - CompilerTools.compile("Function", classBody.toString(), CompilerTools.FORMULA_PREFIX); + final Class partitionClass = ExecutionContext.getContext().getQueryCompiler() + .compile("Function", classBody.toString(), QueryCompiler.FORMULA_PREFIX); try { // noinspection unchecked diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java index 814cd175363..bac9aa5c942 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java @@ -11,7 +11,8 @@ import io.deephaven.base.FileUtils; import io.deephaven.base.Pair; import io.deephaven.base.StringUtils; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.configuration.Configuration; import io.deephaven.engine.exceptions.CancellationException; import io.deephaven.engine.updategraph.UpdateGraphProcessor; @@ -58,7 +59,7 @@ public class GroovyDeephavenSession extends AbstractScriptSession fullCommand(String command) { } public static byte[] getDynamicClass(String name) { - return readClass(CompilerTools.getContext().getFakeClassDestination(), name); + return readClass(ExecutionContext.getContext().getQueryCompiler().getFakeClassDestination(), name); } private static byte[] readClass(final File rootDirectory, final String className) { @@ -573,7 +574,7 @@ private void updateClassloader(String currentCommand) { } catch (RuntimeException e) { throw new GroovyExceptionWrapper(e); } - final File dynamicClassDestination = CompilerTools.getContext().getFakeClassDestination(); + final File dynamicClassDestination = ExecutionContext.getContext().getQueryCompiler().getFakeClassDestination(); if (dynamicClassDestination == null) { return; } @@ -601,7 +602,7 @@ && isAnInteger(aClass.getName().substring(SCRIPT_PREFIX.length()))) { } try { - CompilerTools.writeClass(dynamicClassDestination, entry.getKey(), entry.getValue()); + QueryCompiler.writeClass(dynamicClassDestination, entry.getKey(), entry.getValue()); } catch (IOException e) { throw new RuntimeException(e); } @@ -714,7 +715,7 @@ public Throwable sanitizeThrowable(Throwable e) { @Override public void onApplicationInitializationBegin(Supplier pathLoaderSupplier, ScriptPathLoaderState scriptLoaderState) { - CompilerTools.getContext().setParentClassLoader(getShell().getClassLoader()); + ExecutionContext.getContext().getQueryCompiler().setParentClassLoader(getShell().getClassLoader()); setScriptPathLoader(pathLoaderSupplier, true); } @@ -764,7 +765,7 @@ public boolean setUseOriginalScriptLoaderState(boolean useOriginal) { } } else { log.warn().append("Incorrect closure type for query: ") - .append(sourceClosure == null ? "(null)" : sourceClosure.getClass().toString()).endl(); + .append(sourceClosure.getClass().toString()).endl(); } return false; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java index b01e68201b0..d435f55615c 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java @@ -465,7 +465,7 @@ public void testCrossDependencies() { final ExecutionContext executionContext = ExecutionContext.newBuilder() .captureQueryScopeVars("pauseHelper2") .captureQueryLibrary() - .captureCompilerContext() + .captureQueryCompiler() .build(); final PartitionedTable result2 = sourceTable2.update("SlowItDown=pauseHelper.pauseValue(k)").partitionBy("USym2") @@ -552,7 +552,7 @@ public void testCrossDependencies2() { final ExecutionContext executionContext = ExecutionContext.newBuilder() .captureQueryScopeVars("pauseHelper") .captureQueryLibrary() - .captureCompilerContext() + .captureQueryCompiler() .build(); final PartitionedTable result2 = sourceTable2.partitionBy("USym2") .transform(executionContext, t -> t.update("SlowItDown2=pauseHelper.pauseValue(2 * k)")); @@ -755,7 +755,7 @@ public void testMergeConstituentChanges() { final Table underlying; try (final SafeCloseable ignored = ExecutionContext.newBuilder() .captureQueryLibrary() - .captureCompilerContext() + .captureQueryCompiler() .captureQueryScope() .build().open()) { underlying = base.update( @@ -818,7 +818,7 @@ private EvalNugget newExecutionContextNugget( protected Table e() { // note we cannot reuse the execution context and remove the values as the table is built each iteration try (final SafeCloseable ignored = ExecutionContext.newBuilder() - .captureCompilerContext() + .captureQueryCompiler() .captureQueryLibrary() .newQueryScope() .build().open()) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java index a3d6bb2574d..bb050f156f5 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/RefreshingTableTestCase.java @@ -6,7 +6,7 @@ import io.deephaven.base.testing.BaseArrayTestCase; import io.deephaven.chunk.util.pools.ChunkPoolReleaseTracking; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.liveness.LivenessScopeStack; @@ -30,8 +30,8 @@ abstract public class RefreshingTableTestCase extends BaseArrayTestCase implements UpdateErrorReporter { public static boolean printTableUpdates = Configuration.getInstance() .getBooleanForClassWithDefault(RefreshingTableTestCase.class, "printTableUpdates", false); - private static final boolean ENABLE_COMPILER_TOOLS_LOGGING = Configuration.getInstance() - .getBooleanForClassWithDefault(RefreshingTableTestCase.class, "CompilerTools.logEnabled", false); + private static final boolean ENABLE_QUERY_COMPILER_LOGGING = Configuration.getInstance() + .getBooleanForClassWithDefault(RefreshingTableTestCase.class, "QueryCompile.logEnabled", false); private boolean oldMemoize; private UpdateErrorReporter oldReporter; @@ -62,7 +62,7 @@ protected void setUp() throws Exception { // initialize the unit test's execution context executionContext = ExecutionContext.createForUnitTests().open(); - oldLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING); + oldLogEnabled = QueryCompiler.setLogEnabled(ENABLE_QUERY_COMPILER_LOGGING); oldCheckLtm = UpdateGraphProcessor.DEFAULT.setCheckTableOperations(false); UpdatePerformanceTracker.getInstance().enableUnitTestMode(); ChunkPoolReleaseTracking.enableStrict(); @@ -72,7 +72,7 @@ protected void setUp() throws Exception { protected void tearDown() throws Exception { ChunkPoolReleaseTracking.checkAndDisable(); UpdateGraphProcessor.DEFAULT.setCheckTableOperations(oldCheckLtm); - CompilerTools.setLogEnabled(oldLogEnabled); + QueryCompiler.setLogEnabled(oldLogEnabled); // reset the execution context executionContext.close(); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java index 67c3d70b30c..284c1a3327a 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSort.java @@ -4,7 +4,7 @@ package io.deephaven.engine.table.impl; import io.deephaven.base.testing.BaseArrayTestCase; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.configuration.Configuration; import io.deephaven.engine.exceptions.NotSortableException; import io.deephaven.engine.table.DataColumn; @@ -32,11 +32,11 @@ @Category(OutOfBandTest.class) public class TestSort extends BaseArrayTestCase { - private static final boolean ENABLE_COMPILER_TOOLS_LOGGING = Configuration.getInstance() - .getBooleanForClassWithDefault(TestSort.class, "CompilerTools.logEnabled", false); + private static final boolean ENABLE_QUERY_COMPILER_LOGGING = Configuration.getInstance() + .getBooleanForClassWithDefault(TestSort.class, "QueryCompiler.logEnabled", false); private boolean lastMemoize = false; - private boolean oldCompilerToolsLogEnabled; + private boolean oldQueryCompilerLogEnabled; private SafeCloseable executionContext; @Override @@ -45,14 +45,14 @@ protected void setUp() throws Exception { UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); lastMemoize = QueryTable.setMemoizeResults(false); - oldCompilerToolsLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING); + oldQueryCompilerLogEnabled = QueryCompiler.setLogEnabled(ENABLE_QUERY_COMPILER_LOGGING); executionContext = ExecutionContext.createForUnitTests().open(); } @Override protected void tearDown() throws Exception { super.tearDown(); - CompilerTools.setLogEnabled(oldCompilerToolsLogEnabled); + QueryCompiler.setLogEnabled(oldQueryCompilerLogEnabled); QueryTable.setMemoizeResults(lastMemoize); UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); executionContext.close(); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java index 05fd0dea8d7..af6571a86f8 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilterGeneration.java @@ -27,7 +27,7 @@ public class TestConditionFilterGeneration { public void setUp() { executionContext = ExecutionContext.newBuilder() .newQueryLibrary("DEFAULT") - .captureCompilerContext() + .captureQueryCompiler() .captureQueryScope() .build().open(); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java index 6daf482aa16..372cd34f166 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumn.java @@ -189,8 +189,8 @@ public void testArrayEvaluation() { @Test public void testNoInput() { - final String oldValue = Configuration.getInstance().getProperty("CompilerTools.logEnabledDefault"); - Configuration.getInstance().setProperty("CompilerTools.logEnabledDefault", "true"); + final String oldValue = Configuration.getInstance().getProperty("QueryCompiler.logEnabledDefault"); + Configuration.getInstance().setProperty("QueryCompiler.logEnabledDefault", "true"); try { FormulaColumn formulaColumn = FormulaColumn.createFormulaColumn("Foo", "(String)\"1234\""); formulaColumn.initDef(Collections.emptyMap()); @@ -202,7 +202,7 @@ public void testNoInput() { final long longResult = longFormulaColumn.getDataView().getLong(0); assertEquals(longResult, 1234L); } finally { - Configuration.getInstance().setProperty("CompilerTools.logEnabledDefault", oldValue); + Configuration.getInstance().setProperty("QueryCompiler.logEnabledDefault", oldValue); } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java index 28190f20058..356d85a5fce 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/select/TestFormulaColumnGeneration.java @@ -5,7 +5,6 @@ import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.Table; -import io.deephaven.engine.context.QueryLibrary; import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.table.impl.util.ModelFileGenerator; @@ -48,7 +47,7 @@ public void generateFiles() throws FileNotFoundException { public void setUp() { executionContext = ExecutionContext.newBuilder() .newQueryLibrary("DEFAULT") - .captureCompilerContext() + .captureQueryCompiler() .captureQueryScope() .build().open(); } diff --git a/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java b/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java index 67eff6709c8..20b2bfe9c53 100644 --- a/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java +++ b/engine/table/src/test/java/io/deephaven/engine/util/TestTableTools.java @@ -5,7 +5,7 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.configuration.Configuration; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.rowset.RowSet; @@ -48,8 +48,8 @@ @Category(OutOfBandTest.class) public class TestTableTools extends TestCase implements UpdateErrorReporter { - private static final boolean ENABLE_COMPILER_TOOLS_LOGGING = Configuration.getInstance() - .getBooleanForClassWithDefault(TestTableTools.class, "CompilerTools.logEnabled", false); + private static final boolean ENABLE_QUERY_COMPILER_LOGGING = Configuration.getInstance() + .getBooleanForClassWithDefault(TestTableTools.class, "QueryCompiler.logEnabled", false); private UpdateErrorReporter oldReporter; @@ -68,7 +68,7 @@ public void setUp() throws Exception { super.setUp(); oldCheckUgp = UpdateGraphProcessor.DEFAULT.setCheckTableOperations(false); - oldLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING); + oldLogEnabled = QueryCompiler.setLogEnabled(ENABLE_QUERY_COMPILER_LOGGING); UpdateGraphProcessor.DEFAULT.enableUnitTestMode(); UpdateGraphProcessor.DEFAULT.resetForUnitTests(false); UpdatePerformanceTracker.getInstance().enableUnitTestMode(); @@ -97,7 +97,7 @@ public void tearDown() throws Exception { LivenessScopeStack.pop(scope); scope.release(); executionContext.close(); - CompilerTools.setLogEnabled(oldLogEnabled); + QueryCompiler.setLogEnabled(oldLogEnabled); UpdateGraphProcessor.DEFAULT.setCheckTableOperations(oldCheckUgp); AsyncClientErrorNotifier.setReporter(oldReporter); UpdateGraphProcessor.DEFAULT.resetForUnitTests(true); diff --git a/props/configs/src/main/resources/dh-defaults.prop b/props/configs/src/main/resources/dh-defaults.prop index 0b76987dac1..24a71e5ffaf 100644 --- a/props/configs/src/main/resources/dh-defaults.prop +++ b/props/configs/src/main/resources/dh-defaults.prop @@ -1,4 +1,4 @@ -CompilerTools.logEnabledDefault=false +QueryCompiler.logEnabledDefault=false UpdatePerformanceTracker.reportingMode=LISTENER_ONLY UpdatePerformanceTracker.reportIntervalMillis=60000 measurement.per_thread_cpu=false diff --git a/props/test-configs/src/main/resources/dh-tests.prop b/props/test-configs/src/main/resources/dh-tests.prop index 3001014dc3c..e270fa9e6de 100644 --- a/props/test-configs/src/main/resources/dh-tests.prop +++ b/props/test-configs/src/main/resources/dh-tests.prop @@ -3,7 +3,7 @@ include= measurement.per_thread_cpu=false -CompilerTools.logEnabledDefault=false +QueryCompiler.logEnabledDefault=false UpdatePerformanceTracker.reportingMode=NONE UpdatePerformanceTracker.reportIntervalMillis=60000 diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index f64625daa17..dd2b7c89bb5 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -119,7 +119,7 @@ def test_constituents(self): def test_transform(self): _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") context = _JExecutionContext.newBuilder() \ - .captureCompilerContext() \ + .captureQueryCompiler() \ .captureQueryLibrary() \ .emptyQueryScope() \ .build().open() @@ -137,7 +137,7 @@ def test_transform(self): def test_partitioned_transform(self): _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") context = _JExecutionContext.newBuilder() \ - .captureCompilerContext() \ + .captureQueryCompiler() \ .captureQueryLibrary() \ .emptyQueryScope() \ .build().open() diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 592babc66aa..31e7913d7d3 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -625,7 +625,7 @@ def closure_fn() -> str: def test_nested_scopes(self): _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") context = _JExecutionContext.newBuilder() \ - .captureCompilerContext() \ + .captureQueryCompiler() \ .captureQueryLibrary() \ .captureQueryScope() \ .build() @@ -642,7 +642,7 @@ def test_nested_scope_ticking(self): import jpy _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") j_context = (_JExecutionContext.newBuilder() - .captureCompilerContext() + .captureQueryCompiler() .captureQueryLibrary() .captureQueryScope() .build()) diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index 033721ecb7d..b49b85975e7 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -209,11 +209,11 @@ def test_auto_locking_partitioned_table(self): _ExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") _context = _ExecutionContext.newBuilder() \ - .captureCompilerContext() \ - .captureQueryLibrary() \ - .emptyQueryScope() \ - .build() \ - .open() + .captureQueryCompiler() \ + .captureQueryLibrary() \ + .emptyQueryScope() \ + .build() \ + .open() with self.subTest("Merge"): ugp.auto_locking = False diff --git a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java index bf989294696..89cb4e93029 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/table/impl/select/TestConditionFilter.java @@ -13,7 +13,7 @@ import io.deephaven.io.log.LogLevel; import io.deephaven.io.logger.StreamLoggerImpl; import io.deephaven.util.process.ProcessEnvironment; -import io.deephaven.engine.context.CompilerTools; +import io.deephaven.engine.context.QueryCompiler; import io.deephaven.engine.table.Table; import io.deephaven.engine.context.QueryScopeParam; import io.deephaven.engine.context.QueryScope; @@ -48,11 +48,11 @@ public class TestConditionFilter extends PythonTest { } } - private static final boolean ENABLE_COMPILER_TOOLS_LOGGING = Configuration.getInstance() - .getBooleanForClassWithDefault(TestConditionFilter.class, "CompilerTools.logEnabled", false); + private static final boolean ENABLE_QUERY_COMPILER_LOGGING = Configuration.getInstance() + .getBooleanForClassWithDefault(TestConditionFilter.class, "QueryCompiler.logEnabled", false); private final Table testDataTable; - private boolean compilerToolsLogEnabledInitial = false; + private boolean queryCompilerLogEnabledInitial = false; public TestConditionFilter() { testDataTable = getTestDataTable(); @@ -67,12 +67,12 @@ public void setUp() throws Exception { ProcessEnvironment.basicInteractiveProcessInitialization(Configuration.getInstance(), PythonMatchFilterTest.class.getCanonicalName(), new StreamLoggerImpl(System.out, LogLevel.INFO)); } - compilerToolsLogEnabledInitial = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING); + queryCompilerLogEnabledInitial = QueryCompiler.setLogEnabled(ENABLE_QUERY_COMPILER_LOGGING); } @After public void tearDown() throws Exception { - CompilerTools.setLogEnabled(compilerToolsLogEnabledInitial); + QueryCompiler.setLogEnabled(queryCompilerLogEnabledInitial); } @Test From d0cba487f9405ba8567c0c1a4b92af3a6620a5ce Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 6 Sep 2022 16:10:39 -0600 Subject: [PATCH 109/215] Arrow Flight Auth 1 and 2 (#2713) --- .../io/deephaven/util/auth/AuthContext.java | 53 -- authentication/README.md | 52 ++ authentication/build.gradle | 14 + authentication/gradle.properties | 1 + .../auth/AnonymousAuthenticationHandler.java | 50 ++ .../java/io/deephaven/auth/AuthContext.java | 36 ++ .../auth/AuthenticationException.java | 8 + .../auth/AuthenticationRequestHandler.java | 75 +++ .../deephaven/auth/BasicAuthMarshaller.java | 118 ++++ engine/api/build.gradle | 1 + .../exceptions/TableAccessException.java | 4 +- .../UncheckedPermissionException.java | 8 +- go/internal/proto/session/session.pb.go | 543 ++++++++++-------- go/pkg/client/client.go | 2 +- go/pkg/client/session_stub.go | 2 +- .../main/proto/deephaven/proto/session.proto | 12 + py/client/pydeephaven/proto/session_pb2.py | 68 ++- py/client/pydeephaven/session.py | 12 +- server/build.gradle | 1 + server/jetty/build.gradle | 1 + .../jetty/JettyFlightRoundTripTest.java | 4 +- server/netty/build.gradle | 1 + .../netty/NettyFlightRoundTripTest.java | 4 +- .../server/arrow/FlightServiceGrpcImpl.java | 111 +++- .../server/auth/AuthContextModule.java | 74 ++- .../server/auth/AuthContextProvider.java | 30 - .../auth/TrivialAuthContextProvider.java | 28 - .../server/runner/DeephavenApiServer.java | 16 +- .../server/session/SessionService.java | 75 ++- .../session/SessionServiceGrpcImpl.java | 147 +++-- .../server/session/SessionState.java | 2 +- .../ApplicationServiceGrpcImplTest.java | 6 +- ...havenApiServerSingleAuthenticatedBase.java | 18 +- .../server/session/SessionServiceTest.java | 7 +- .../server/session/SessionStateTest.java | 2 +- .../table/ExportTableUpdateListenerTest.java | 2 +- server/test/build.gradle | 3 +- .../deephaven/server/test/AuthTestModule.java | 58 ++ .../test/FlightMessageRoundTripTest.java | 312 ++++++++-- settings.gradle | 6 +- 40 files changed, 1454 insertions(+), 513 deletions(-) delete mode 100644 Util/src/main/java/io/deephaven/util/auth/AuthContext.java create mode 100644 authentication/README.md create mode 100644 authentication/build.gradle create mode 100644 authentication/gradle.properties create mode 100644 authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java create mode 100644 authentication/src/main/java/io/deephaven/auth/AuthContext.java create mode 100644 authentication/src/main/java/io/deephaven/auth/AuthenticationException.java create mode 100644 authentication/src/main/java/io/deephaven/auth/AuthenticationRequestHandler.java create mode 100644 authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java delete mode 100644 server/src/main/java/io/deephaven/server/auth/AuthContextProvider.java delete mode 100644 server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java create mode 100644 server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java diff --git a/Util/src/main/java/io/deephaven/util/auth/AuthContext.java b/Util/src/main/java/io/deephaven/util/auth/AuthContext.java deleted file mode 100644 index fd6cb399be9..00000000000 --- a/Util/src/main/java/io/deephaven/util/auth/AuthContext.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.util.auth; - -import io.deephaven.util.annotations.FinalDefault; -import org.jetbrains.annotations.NotNull; - -public interface AuthContext { - - /** - * Get a role name for this auth context. - * - * @return The role name for this auth context - */ - @NotNull - String getAuthRoleName(); - - /** - * Get an implementation-specific identifier that may be used as a key, for audit logging, etc. - * - * @return The authentication identifier for this context - */ - @NotNull - String getAuthId(); - - /** - * Get a log representation for this auth context. - * - * @return The log representation - */ - @FinalDefault - @NotNull - default String getLogRepresentation() { - return getAuthRoleName() + ':' + getAuthId(); - } - - /** - * A trivial auth context that allows a user to do everything the APIs allow. - */ - class SuperUser implements AuthContext { - - @NotNull - public final String getAuthRoleName() { - return "SuperUser"; - } - - @NotNull - public final String getAuthId() { - return "default"; - } - } -} diff --git a/authentication/README.md b/authentication/README.md new file mode 100644 index 00000000000..8dbd788f042 --- /dev/null +++ b/authentication/README.md @@ -0,0 +1,52 @@ +Deephaven's Approach to Authentication +====================================== + +Deephaven integrates with both the original and the re-envisioned versions of Flight Auth. + +Configuration +------------- + +Add `-DAuthHandlers=$CLASS_1,$CLASS_2,etc...` to your jvm command line to enable authentication for each supplied +class. + +Flight Basic Auth +----------------- + +Implement `io.deephaven.auth.BasicAuthMarshaller.Handler` and add to the list of enabled authenticators. +Deephaven will check both Auth1 and Auth2 payloads to see if the request is via Flight's `BasicAuth` before moving +to other authenticators. + +More Complex Auth +----------------- + +Implement `io.deephaven.auth.AuthenticationRequestHandler` and add to the list of enabled authenticators. User are +not required to implement both `login` methods unless they want to support clients using both Auth1 and Auth2. The +interface includes a `String getAuthType()` which is used to route requests from clients to the proper +authentication authority. + +Flight Auth1 `FlightService#Handshake` +-------------------------------------- +Flight's gRPC call for `Handshake()` takes a `HandshakeRequest`, which provides both a payload in bytes and a +protocol version int64. The protocol version value is never written by current FlightClient implementations, leaving +servers to only recognize the authentication details by the payload bytes. + +As a result, our implementation tries to ignore protocol version. We felt that the API did not provided sufficient +means for supporting multiple forms of authentication simulatenously. Aside from the `BasicAuth` support, we expect +the `Handshake` payload to be a `WrappedAuthenticationRequest`. This is a tuple of `type` and `payload`. The `type` +is used to route the request to the instance of `io.deephaven.auth.AuthenticationRequestHandler` where `getAuthType` +is an exact match. + + +Flight Auth2 `Authentication` Header +------------------------------------ +Flight Auth was reenvisioned for the client to send an `Authentication` header to identify themselves. The header +contains a prefix such as `Basic` or `Bearer` followed by a text payload. This prefix is used to route the request +to the instance of `io.deephaven.auth.AuthenticationRequestHandler` where `getAuthType` is an exact match. + +Session Bearer Token +-------------------- + +Deephaven's server builds a Session around each authentication. An identification token is provided to the client +in the form of a bearer token. This token needs to be supplied with all subsequent gRPC requests to match RPCs to +a session and therefore an authorization context. As clients tend to be emphemeral, the server requires that the +client rotates this bearer token and in return will ensure oustanding state continues to be available to that client. diff --git a/authentication/build.gradle b/authentication/build.gradle new file mode 100644 index 00000000000..b26de459000 --- /dev/null +++ b/authentication/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + +description 'authentication: Deephaven authentication and identity' + +dependencies { + api project(':Base') + api project(':proto:proto-backplane-grpc') + implementation project(':log-factory') + + Classpaths.inheritArrow(project, 'flight-core', 'implementation') +} diff --git a/authentication/gradle.properties b/authentication/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/authentication/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java b/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java new file mode 100644 index 00000000000..c5a422d12fa --- /dev/null +++ b/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java @@ -0,0 +1,50 @@ +package io.deephaven.auth; + +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; + +import java.nio.ByteBuffer; +import java.util.Optional; + +/** + * Handler to accept an empty payload and accept that user as anonymous. To prevent anonymous access, do not enable this + * authentication handler. + */ +public class AnonymousAuthenticationHandler implements AuthenticationRequestHandler { + private final static Logger log = LoggerFactory.getLogger(AnonymousAuthenticationHandler.class); + + @Override + public String getAuthType() { + return "Anonymous"; + } + + @Override + public void initialize(String targetUrl) { + for (int ii = 0; ii < 5; ++ii) { + log.warn().endl(); + } + log.warn().append("================================================================================").endl(); + log.warn().append("WARNING! Anonymous authentication is enabled. This is not recommended!").endl(); + log.warn().append(" Listening on ").append(targetUrl).endl(); + log.warn().append("================================================================================").endl(); + for (int ii = 0; ii < 5; ++ii) { + log.warn().endl(); + } + } + + @Override + public Optional login(long protocolVersion, ByteBuffer payload, HandshakeResponseListener listener) { + if (!payload.hasRemaining()) { + return Optional.of(new AuthContext.Anonymous()); + } + return Optional.empty(); + } + + @Override + public Optional login(String payload, MetadataResponseListener listener) { + if (payload.length() == 0) { + return Optional.of(new AuthContext.Anonymous()); + } + return Optional.empty(); + } +} diff --git a/authentication/src/main/java/io/deephaven/auth/AuthContext.java b/authentication/src/main/java/io/deephaven/auth/AuthContext.java new file mode 100644 index 00000000000..a047601e411 --- /dev/null +++ b/authentication/src/main/java/io/deephaven/auth/AuthContext.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.auth; + +import io.deephaven.base.log.LogOutput; +import io.deephaven.base.log.LogOutputAppendable; +import io.deephaven.io.log.impl.LogOutputStringImpl; + +public abstract class AuthContext implements LogOutputAppendable { + + @Override + public abstract LogOutput append(LogOutput logOutput); + + @Override + public final String toString() { + return new LogOutputStringImpl().append(this).toString(); + } + + /** + * A trivial auth context that allows a user to do everything the APIs allow. + */ + public static class SuperUser extends AuthContext { + @Override + public LogOutput append(LogOutput logOutput) { + return logOutput.append("SuperUser"); + } + } + + public static class Anonymous extends AuthContext { + @Override + public LogOutput append(LogOutput logOutput) { + return logOutput.append("Anonymous"); + } + } +} diff --git a/authentication/src/main/java/io/deephaven/auth/AuthenticationException.java b/authentication/src/main/java/io/deephaven/auth/AuthenticationException.java new file mode 100644 index 00000000000..37a81bd1c12 --- /dev/null +++ b/authentication/src/main/java/io/deephaven/auth/AuthenticationException.java @@ -0,0 +1,8 @@ +package io.deephaven.auth; + +/** + * An error occurred and this handshake to authenticate has failed for some reason. Details are not provided to the + * user. + */ +public class AuthenticationException extends Exception { +} diff --git a/authentication/src/main/java/io/deephaven/auth/AuthenticationRequestHandler.java b/authentication/src/main/java/io/deephaven/auth/AuthenticationRequestHandler.java new file mode 100644 index 00000000000..e01d0eac53a --- /dev/null +++ b/authentication/src/main/java/io/deephaven/auth/AuthenticationRequestHandler.java @@ -0,0 +1,75 @@ +package io.deephaven.auth; + +import java.nio.ByteBuffer; +import java.util.Optional; + +/** + * Simple interface to handle incoming authentication requests from flight/barrage clients, via Handshake or the Flight + * Authentication header. This is intended to be a low-level way to handle incoming payload bytes. + */ +public interface AuthenticationRequestHandler { + + /** + * This handler can be referred to via both Arrow Flight's original Auth and Auth2. + * + * To use via the original Arrow Flight Handshake, the request should be sent in a + * {@link io.deephaven.proto.backplane.grpc.WrappedAuthenticationRequest} with this handler's identity string. + * + * To use via Arrow Flight Auth 2's metadata header, then the + * {@link org.apache.arrow.flight.auth2.Auth2Constants#AUTHORIZATION_HEADER} should be prefixed with this handler's + * identity string. + * + * @return the type string used to identify the handler + */ + String getAuthType(); + + /** + * Given a protocol version (very likely to be zero) and payload bytes, if possible authenticate this user. If the + * handler can correctly decode the payload and confirm the user's identity, an appropriate UserContext should be + * returned. If the payload is correctly decoded and definitely isn't a valid user, an exception may be thrown. If + * there is ambiguity in decoding the payload (leading to apparent "not a valid user") or the payload cannot be + * decoded, an empty optional should be returned. + * + * Note that regular arrow flight clients cannot specify the protocolVersion; to be compatible with flight auth + * assume protocolVersion will be zero. + * + * @param protocolVersion Mostly unused, this is an allowed field to set on HandshakeRequests from the Flight gRPC + * call. + * @param payload The byte payload of the handshake, such as an encoded protobuf. + * @param listener The handshake response observer, which enables multi-request authentication. + * @return AuthContext for this user if applicable else Empty + */ + Optional login(long protocolVersion, ByteBuffer payload, HandshakeResponseListener listener) + throws AuthenticationException; + + /** + * Given a payload string, if possible authenticate this user. If the handler can correctly decode the payload and + * confirm the user's identity, an appropriate UserContext should be returned. If the payload is correctly decoded + * and definitely isn't a valid user, an exception may be thrown. If there is ambiguity in decoding the payload + * (leading to apparent "not a valid user") or the payload cannot be decoded, an empty optional should be returned. + * + * Note that metadata can only be sent with the initial gRPC response; multi-message authentication via gRPC + * metadata headers require multiple gRPC call attempts. + * + * @param payload The byte payload of the {@code Authorization} header, such as an encoded protobuf or b64 encoded + * string. + * @param listener The metadata response observer, which enables multi-request authentication. + * @return AuthContext for this user if applicable else Empty + */ + Optional login(String payload, MetadataResponseListener listener) + throws AuthenticationException; + + /** + * Initialize request handler with the provided url. + * + * @param targetUrl the base url of the hosted UI + */ + void initialize(String targetUrl); + + interface HandshakeResponseListener { + void respond(long protocolVersion, ByteBuffer payload); + } + interface MetadataResponseListener { + void addHeader(String key, String string); + } +} diff --git a/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java b/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java new file mode 100644 index 00000000000..d774ad68383 --- /dev/null +++ b/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java @@ -0,0 +1,118 @@ +package io.deephaven.auth; + +import com.google.protobuf.CodedInputStream; +import com.google.protobuf.WireFormat; +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import org.apache.arrow.flight.auth2.Auth2Constants; +import org.apache.arrow.flight.impl.Flight; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Optional; + +import static com.google.protobuf.WireFormat.WIRETYPE_LENGTH_DELIMITED; + +/** + * Manually decode the payload as a BasicAuth message, confirm that only tags 2 and 3 are present as strings, otherwise + * pass. This is stricter than a usual protobuf decode, under the assumption that FlightClient will always only write + * those two fields, and user code couldn't customize the payload further to repeatedly write those fields or any other + * field. + * + * Despite being stricter than a standard protobuf decode, this is also very generic and might accidentally match the + * wrong message type. For this reason, this handler should not run until other more selective handlers have finished. + * + * This class delegates to a typed auth handler once it is certain that the payload appears to be a BasicAuth value. + */ +public class BasicAuthMarshaller implements AuthenticationRequestHandler { + private final static Logger log = LoggerFactory.getLogger(AnonymousAuthenticationHandler.class); + + public interface Handler { + Optional login(String username, String password) throws AuthenticationException; + } + + private final Handler handler; + + public BasicAuthMarshaller(Handler handler) { + this.handler = handler; + } + + @Override + public String getAuthType() { + return Auth2Constants.BASIC_PREFIX.trim(); + } + + @Override + public void initialize(String targetUrl) { + for (int ii = 0; ii < 5; ++ii) { + log.warn().endl(); + } + log.warn().append("================================================================================").endl(); + log.warn().append("Basic Authentication is enabled.").endl(); + log.warn().append(" Listening on ").append(targetUrl).endl(); + log.warn().append("================================================================================").endl(); + for (int ii = 0; ii < 5; ++ii) { + log.warn().endl(); + } + } + + @Override + public Optional login(long protocolVersion, ByteBuffer payload, HandshakeResponseListener listener) + throws AuthenticationException { + CodedInputStream inputStream = CodedInputStream.newInstance(payload); + + String username = null, password = null; + + try { + while (!inputStream.isAtEnd()) { + int tag = inputStream.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case Flight.BasicAuth.USERNAME_FIELD_NUMBER: { + if (username == null && WireFormat.getTagWireType(tag) == WIRETYPE_LENGTH_DELIMITED) { + username = inputStream.readString(); + } else { + return Optional.empty(); + } + break; + } + case Flight.BasicAuth.PASSWORD_FIELD_NUMBER: { + if (password == null && WireFormat.getTagWireType(tag) == WIRETYPE_LENGTH_DELIMITED) { + password = inputStream.readString(); + } else { + return Optional.empty(); + } + break; + } + default: + // Found an unexpected field; this is not a BasicAuth request. + return Optional.empty(); + } + } + } catch (IOException e) { + return Optional.empty(); + } + if (username != null && password != null) { + // This is likely to be an un-wrapped BasicAuth instance, attempt to read it and login with it + return handler.login(username, password); + } + + return Optional.empty(); + } + + @Override + public Optional login(String payload, MetadataResponseListener listener) + throws AuthenticationException { + // The value has the format Base64(:) + final String authDecoded = new String(Base64.getDecoder().decode(payload), StandardCharsets.UTF_8); + final int colonPos = authDecoded.indexOf(':'); + if (colonPos == -1) { + return Optional.empty(); + } + + final String username = authDecoded.substring(0, colonPos); + final String password = authDecoded.substring(colonPos + 1); + return handler.login(username, password); + } +} diff --git a/engine/api/build.gradle b/engine/api/build.gradle index 5156ade7a0d..ef761aedff4 100644 --- a/engine/api/build.gradle +++ b/engine/api/build.gradle @@ -6,6 +6,7 @@ plugins { description 'Engine API: Engine API module, suitable as a compile-time dependency for most queries' dependencies { + api project(':authentication') api project(':qst') api project(':engine-chunk') api project(':engine-context') diff --git a/engine/api/src/main/java/io/deephaven/engine/exceptions/TableAccessException.java b/engine/api/src/main/java/io/deephaven/engine/exceptions/TableAccessException.java index 9ed79f23913..b663be0b968 100644 --- a/engine/api/src/main/java/io/deephaven/engine/exceptions/TableAccessException.java +++ b/engine/api/src/main/java/io/deephaven/engine/exceptions/TableAccessException.java @@ -3,7 +3,7 @@ */ package io.deephaven.engine.exceptions; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -30,7 +30,7 @@ private static String makeDescription(@NotNull String tableDescription, @NotNull AuthContext authContext, @Nullable String reason) { final StringBuilder sb = new StringBuilder(); - sb.append(authContext.getLogRepresentation()).append(" may not access: "); + sb.append(authContext).append(" may not access: "); sb.append(tableDescription); if (reason != null && !reason.isEmpty()) { diff --git a/engine/api/src/main/java/io/deephaven/engine/exceptions/UncheckedPermissionException.java b/engine/api/src/main/java/io/deephaven/engine/exceptions/UncheckedPermissionException.java index 548de8f411a..9a503e40b9c 100644 --- a/engine/api/src/main/java/io/deephaven/engine/exceptions/UncheckedPermissionException.java +++ b/engine/api/src/main/java/io/deephaven/engine/exceptions/UncheckedPermissionException.java @@ -4,7 +4,7 @@ package io.deephaven.engine.exceptions; import io.deephaven.UncheckedDeephavenException; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; /** * An {@link UncheckedDeephavenException} that indicates an issue with permissions. @@ -24,14 +24,14 @@ public UncheckedPermissionException(Throwable cause) { } public UncheckedPermissionException(AuthContext context, String reason) { - super(context.getLogRepresentation() + ": " + reason); + super(context.toString() + ": " + reason); } public UncheckedPermissionException(AuthContext context, String reason, Throwable cause) { - super(context.getLogRepresentation() + ": " + reason, cause); + super(context.toString() + ": " + reason, cause); } public UncheckedPermissionException(AuthContext context, Throwable cause) { - super(context.getLogRepresentation(), cause); + super(context.toString(), cause); } } diff --git a/go/internal/proto/session/session.pb.go b/go/internal/proto/session/session.pb.go index 96f5b4a6425..7eb629e60ea 100644 --- a/go/internal/proto/session/session.pb.go +++ b/go/internal/proto/session/session.pb.go @@ -100,7 +100,64 @@ func (x ExportNotification_State) Number() protoreflect.EnumNumber { // Deprecated: Use ExportNotification_State.Descriptor instead. func (ExportNotification_State) EnumDescriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8, 0} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{9, 0} +} + +type WrappedAuthenticationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type of the protobuf the auth payload protobuf. + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // The serialized payload of the protobuf instance. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *WrappedAuthenticationRequest) Reset() { + *x = WrappedAuthenticationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_session_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WrappedAuthenticationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WrappedAuthenticationRequest) ProtoMessage() {} + +func (x *WrappedAuthenticationRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_session_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WrappedAuthenticationRequest.ProtoReflect.Descriptor instead. +func (*WrappedAuthenticationRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{0} +} + +func (x *WrappedAuthenticationRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *WrappedAuthenticationRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil } // The request that a client provides to a server on handshake. @@ -122,7 +179,7 @@ type HandshakeRequest struct { func (x *HandshakeRequest) Reset() { *x = HandshakeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[0] + mi := &file_deephaven_proto_session_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -135,7 +192,7 @@ func (x *HandshakeRequest) String() string { func (*HandshakeRequest) ProtoMessage() {} func (x *HandshakeRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[0] + mi := &file_deephaven_proto_session_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -148,7 +205,7 @@ func (x *HandshakeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead. func (*HandshakeRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{0} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{1} } func (x *HandshakeRequest) GetAuthProtocol() int32 { @@ -187,7 +244,7 @@ type HandshakeResponse struct { func (x *HandshakeResponse) Reset() { *x = HandshakeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[1] + mi := &file_deephaven_proto_session_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -200,7 +257,7 @@ func (x *HandshakeResponse) String() string { func (*HandshakeResponse) ProtoMessage() {} func (x *HandshakeResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[1] + mi := &file_deephaven_proto_session_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -213,7 +270,7 @@ func (x *HandshakeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead. func (*HandshakeResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{1} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{2} } func (x *HandshakeResponse) GetMetadataHeader() []byte { @@ -253,7 +310,7 @@ type CloseSessionResponse struct { func (x *CloseSessionResponse) Reset() { *x = CloseSessionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[2] + mi := &file_deephaven_proto_session_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -266,7 +323,7 @@ func (x *CloseSessionResponse) String() string { func (*CloseSessionResponse) ProtoMessage() {} func (x *CloseSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[2] + mi := &file_deephaven_proto_session_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -279,7 +336,7 @@ func (x *CloseSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseSessionResponse.ProtoReflect.Descriptor instead. func (*CloseSessionResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{2} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{3} } type ReleaseRequest struct { @@ -293,7 +350,7 @@ type ReleaseRequest struct { func (x *ReleaseRequest) Reset() { *x = ReleaseRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[3] + mi := &file_deephaven_proto_session_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -306,7 +363,7 @@ func (x *ReleaseRequest) String() string { func (*ReleaseRequest) ProtoMessage() {} func (x *ReleaseRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[3] + mi := &file_deephaven_proto_session_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -319,7 +376,7 @@ func (x *ReleaseRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReleaseRequest.ProtoReflect.Descriptor instead. func (*ReleaseRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{3} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{4} } func (x *ReleaseRequest) GetId() *ticket.Ticket { @@ -338,7 +395,7 @@ type ReleaseResponse struct { func (x *ReleaseResponse) Reset() { *x = ReleaseResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[4] + mi := &file_deephaven_proto_session_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -351,7 +408,7 @@ func (x *ReleaseResponse) String() string { func (*ReleaseResponse) ProtoMessage() {} func (x *ReleaseResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[4] + mi := &file_deephaven_proto_session_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -364,7 +421,7 @@ func (x *ReleaseResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReleaseResponse.ProtoReflect.Descriptor instead. func (*ReleaseResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{4} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{5} } type ExportRequest struct { @@ -379,7 +436,7 @@ type ExportRequest struct { func (x *ExportRequest) Reset() { *x = ExportRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[5] + mi := &file_deephaven_proto_session_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +449,7 @@ func (x *ExportRequest) String() string { func (*ExportRequest) ProtoMessage() {} func (x *ExportRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[5] + mi := &file_deephaven_proto_session_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -405,7 +462,7 @@ func (x *ExportRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExportRequest.ProtoReflect.Descriptor instead. func (*ExportRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{5} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{6} } func (x *ExportRequest) GetSourceId() *ticket.Ticket { @@ -431,7 +488,7 @@ type ExportResponse struct { func (x *ExportResponse) Reset() { *x = ExportResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[6] + mi := &file_deephaven_proto_session_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -444,7 +501,7 @@ func (x *ExportResponse) String() string { func (*ExportResponse) ProtoMessage() {} func (x *ExportResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[6] + mi := &file_deephaven_proto_session_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -457,7 +514,7 @@ func (x *ExportResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExportResponse.ProtoReflect.Descriptor instead. func (*ExportResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{6} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{7} } type ExportNotificationRequest struct { @@ -469,7 +526,7 @@ type ExportNotificationRequest struct { func (x *ExportNotificationRequest) Reset() { *x = ExportNotificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[7] + mi := &file_deephaven_proto_session_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -482,7 +539,7 @@ func (x *ExportNotificationRequest) String() string { func (*ExportNotificationRequest) ProtoMessage() {} func (x *ExportNotificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[7] + mi := &file_deephaven_proto_session_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -495,7 +552,7 @@ func (x *ExportNotificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExportNotificationRequest.ProtoReflect.Descriptor instead. func (*ExportNotificationRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{7} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8} } type ExportNotification struct { @@ -514,7 +571,7 @@ type ExportNotification struct { func (x *ExportNotification) Reset() { *x = ExportNotification{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[8] + mi := &file_deephaven_proto_session_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -527,7 +584,7 @@ func (x *ExportNotification) String() string { func (*ExportNotification) ProtoMessage() {} func (x *ExportNotification) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[8] + mi := &file_deephaven_proto_session_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -540,7 +597,7 @@ func (x *ExportNotification) ProtoReflect() protoreflect.Message { // Deprecated: Use ExportNotification.ProtoReflect.Descriptor instead. func (*ExportNotification) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{8} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{9} } func (x *ExportNotification) GetTicket() *ticket.Ticket { @@ -580,7 +637,7 @@ type TerminationNotificationRequest struct { func (x *TerminationNotificationRequest) Reset() { *x = TerminationNotificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[9] + mi := &file_deephaven_proto_session_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -593,7 +650,7 @@ func (x *TerminationNotificationRequest) String() string { func (*TerminationNotificationRequest) ProtoMessage() {} func (x *TerminationNotificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[9] + mi := &file_deephaven_proto_session_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -606,7 +663,7 @@ func (x *TerminationNotificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TerminationNotificationRequest.ProtoReflect.Descriptor instead. func (*TerminationNotificationRequest) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{9} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{10} } type TerminationNotificationResponse struct { @@ -627,7 +684,7 @@ type TerminationNotificationResponse struct { func (x *TerminationNotificationResponse) Reset() { *x = TerminationNotificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[10] + mi := &file_deephaven_proto_session_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -640,7 +697,7 @@ func (x *TerminationNotificationResponse) String() string { func (*TerminationNotificationResponse) ProtoMessage() {} func (x *TerminationNotificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[10] + mi := &file_deephaven_proto_session_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -653,7 +710,7 @@ func (x *TerminationNotificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TerminationNotificationResponse.ProtoReflect.Descriptor instead. func (*TerminationNotificationResponse) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{10} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{11} } func (x *TerminationNotificationResponse) GetAbnormalTermination() bool { @@ -697,7 +754,7 @@ type TerminationNotificationResponse_StackTrace struct { func (x *TerminationNotificationResponse_StackTrace) Reset() { *x = TerminationNotificationResponse_StackTrace{} if protoimpl.UnsafeEnabled { - mi := &file_deephaven_proto_session_proto_msgTypes[11] + mi := &file_deephaven_proto_session_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -710,7 +767,7 @@ func (x *TerminationNotificationResponse_StackTrace) String() string { func (*TerminationNotificationResponse_StackTrace) ProtoMessage() {} func (x *TerminationNotificationResponse_StackTrace) ProtoReflect() protoreflect.Message { - mi := &file_deephaven_proto_session_proto_msgTypes[11] + mi := &file_deephaven_proto_session_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -723,7 +780,7 @@ func (x *TerminationNotificationResponse_StackTrace) ProtoReflect() protoreflect // Deprecated: Use TerminationNotificationResponse_StackTrace.ProtoReflect.Descriptor instead. func (*TerminationNotificationResponse_StackTrace) Descriptor() ([]byte, []int) { - return file_deephaven_proto_session_proto_rawDescGZIP(), []int{10, 0} + return file_deephaven_proto_session_proto_rawDescGZIP(), []int{11, 0} } func (x *TerminationNotificationResponse_StackTrace) GetType() string { @@ -756,167 +813,172 @@ var file_deephaven_proto_session_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x51, 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0c, 0x61, 0x75, 0x74, - 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x22, 0xe9, 0x01, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, - 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, - 0x17, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x45, 0x0a, 0x1d, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, - 0x02, 0x30, 0x01, 0x52, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, - 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x02, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x64, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe6, 0x03, 0x0a, 0x12, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x5e, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x29, 0x0a, 0x10, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, - 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x50, - 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x51, - 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, - 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, - 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, 0x06, - 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, - 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x44, - 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, - 0x10, 0x09, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, - 0x5f, 0x4e, 0x45, 0x56, 0x45, 0x52, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0a, 0x12, 0x18, - 0x0a, 0x14, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x43, 0x41, 0x4e, - 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x45, 0x50, 0x45, - 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, - 0x0c, 0x22, 0x20, 0x0a, 0x1e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0xf3, 0x02, 0x0a, 0x1f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, + 0x22, 0x4c, 0x0a, 0x1c, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x51, + 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x22, 0xe9, 0x01, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x64, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x69, 0x6c, + 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x17, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x45, 0x0a, 0x1d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, + 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, + 0x01, 0x52, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x16, 0x0a, + 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x46, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe6, 0x03, 0x0a, 0x12, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, + 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x5e, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x55, 0x42, + 0x4c, 0x49, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x51, 0x55, 0x45, + 0x55, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, + 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x05, + 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0d, + 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, 0x0a, 0x0a, + 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x50, + 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x09, + 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x4e, + 0x45, 0x56, 0x45, 0x52, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0a, 0x12, 0x18, 0x0a, 0x14, + 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, + 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x45, 0x50, 0x45, 0x4e, 0x44, + 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, 0x0c, 0x22, + 0x20, 0x0a, 0x1e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xf3, 0x02, 0x0a, 0x1f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x62, 0x6e, 0x6f, 0x72, 0x6d, 0x61, + 0x6c, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x62, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x54, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, 0x63, 0x61, + 0x75, 0x67, 0x68, 0x74, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x6e, 0x63, 0x61, + 0x75, 0x67, 0x68, 0x74, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x70, 0x0a, + 0x0c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x62, 0x6e, 0x6f, 0x72, - 0x6d, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x62, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x54, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, - 0x63, 0x61, 0x75, 0x67, 0x68, 0x74, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x6e, - 0x63, 0x61, 0x75, 0x67, 0x68, 0x74, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x70, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, - 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, - 0x72, 0x61, 0x63, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, - 0x73, 0x1a, 0x56, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xb5, 0x07, 0x0a, 0x0e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0a, - 0x4e, 0x65, 0x77, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x1a, + 0x56, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xb5, 0x07, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x4e, 0x65, + 0x77, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, + 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x0c, 0x43, 0x6c, + 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, - 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x0c, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, - 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x07, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, - 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, - 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x79, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, + 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x07, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, + 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x30, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x13, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, - 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x13, 0x45, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, 0x12, 0xa2, 0x01, 0x0a, - 0x17, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x69, 0x6f, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, - 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, 0x12, 0xa2, 0x01, 0x0a, 0x17, 0x54, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -932,44 +994,45 @@ func file_deephaven_proto_session_proto_rawDescGZIP() []byte { } var file_deephaven_proto_session_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_deephaven_proto_session_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_deephaven_proto_session_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_deephaven_proto_session_proto_goTypes = []interface{}{ (ExportNotification_State)(0), // 0: io.deephaven.proto.backplane.grpc.ExportNotification.State - (*HandshakeRequest)(nil), // 1: io.deephaven.proto.backplane.grpc.HandshakeRequest - (*HandshakeResponse)(nil), // 2: io.deephaven.proto.backplane.grpc.HandshakeResponse - (*CloseSessionResponse)(nil), // 3: io.deephaven.proto.backplane.grpc.CloseSessionResponse - (*ReleaseRequest)(nil), // 4: io.deephaven.proto.backplane.grpc.ReleaseRequest - (*ReleaseResponse)(nil), // 5: io.deephaven.proto.backplane.grpc.ReleaseResponse - (*ExportRequest)(nil), // 6: io.deephaven.proto.backplane.grpc.ExportRequest - (*ExportResponse)(nil), // 7: io.deephaven.proto.backplane.grpc.ExportResponse - (*ExportNotificationRequest)(nil), // 8: io.deephaven.proto.backplane.grpc.ExportNotificationRequest - (*ExportNotification)(nil), // 9: io.deephaven.proto.backplane.grpc.ExportNotification - (*TerminationNotificationRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.TerminationNotificationRequest - (*TerminationNotificationResponse)(nil), // 11: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse - (*TerminationNotificationResponse_StackTrace)(nil), // 12: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace - (*ticket.Ticket)(nil), // 13: io.deephaven.proto.backplane.grpc.Ticket + (*WrappedAuthenticationRequest)(nil), // 1: io.deephaven.proto.backplane.grpc.WrappedAuthenticationRequest + (*HandshakeRequest)(nil), // 2: io.deephaven.proto.backplane.grpc.HandshakeRequest + (*HandshakeResponse)(nil), // 3: io.deephaven.proto.backplane.grpc.HandshakeResponse + (*CloseSessionResponse)(nil), // 4: io.deephaven.proto.backplane.grpc.CloseSessionResponse + (*ReleaseRequest)(nil), // 5: io.deephaven.proto.backplane.grpc.ReleaseRequest + (*ReleaseResponse)(nil), // 6: io.deephaven.proto.backplane.grpc.ReleaseResponse + (*ExportRequest)(nil), // 7: io.deephaven.proto.backplane.grpc.ExportRequest + (*ExportResponse)(nil), // 8: io.deephaven.proto.backplane.grpc.ExportResponse + (*ExportNotificationRequest)(nil), // 9: io.deephaven.proto.backplane.grpc.ExportNotificationRequest + (*ExportNotification)(nil), // 10: io.deephaven.proto.backplane.grpc.ExportNotification + (*TerminationNotificationRequest)(nil), // 11: io.deephaven.proto.backplane.grpc.TerminationNotificationRequest + (*TerminationNotificationResponse)(nil), // 12: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse + (*TerminationNotificationResponse_StackTrace)(nil), // 13: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace + (*ticket.Ticket)(nil), // 14: io.deephaven.proto.backplane.grpc.Ticket } var file_deephaven_proto_session_proto_depIdxs = []int32{ - 13, // 0: io.deephaven.proto.backplane.grpc.ReleaseRequest.id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 13, // 1: io.deephaven.proto.backplane.grpc.ExportRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 13, // 2: io.deephaven.proto.backplane.grpc.ExportRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket - 13, // 3: io.deephaven.proto.backplane.grpc.ExportNotification.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 14, // 0: io.deephaven.proto.backplane.grpc.ReleaseRequest.id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 14, // 1: io.deephaven.proto.backplane.grpc.ExportRequest.source_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 14, // 2: io.deephaven.proto.backplane.grpc.ExportRequest.result_id:type_name -> io.deephaven.proto.backplane.grpc.Ticket + 14, // 3: io.deephaven.proto.backplane.grpc.ExportNotification.ticket:type_name -> io.deephaven.proto.backplane.grpc.Ticket 0, // 4: io.deephaven.proto.backplane.grpc.ExportNotification.export_state:type_name -> io.deephaven.proto.backplane.grpc.ExportNotification.State - 12, // 5: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.stack_traces:type_name -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace - 1, // 6: io.deephaven.proto.backplane.grpc.SessionService.NewSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest - 1, // 7: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest - 1, // 8: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest - 4, // 9: io.deephaven.proto.backplane.grpc.SessionService.Release:input_type -> io.deephaven.proto.backplane.grpc.ReleaseRequest - 6, // 10: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:input_type -> io.deephaven.proto.backplane.grpc.ExportRequest - 8, // 11: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:input_type -> io.deephaven.proto.backplane.grpc.ExportNotificationRequest - 10, // 12: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:input_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationRequest - 2, // 13: io.deephaven.proto.backplane.grpc.SessionService.NewSession:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse - 2, // 14: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse - 3, // 15: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:output_type -> io.deephaven.proto.backplane.grpc.CloseSessionResponse - 5, // 16: io.deephaven.proto.backplane.grpc.SessionService.Release:output_type -> io.deephaven.proto.backplane.grpc.ReleaseResponse - 7, // 17: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:output_type -> io.deephaven.proto.backplane.grpc.ExportResponse - 9, // 18: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:output_type -> io.deephaven.proto.backplane.grpc.ExportNotification - 11, // 19: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:output_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse + 13, // 5: io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.stack_traces:type_name -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace + 2, // 6: io.deephaven.proto.backplane.grpc.SessionService.NewSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 2, // 7: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 2, // 8: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:input_type -> io.deephaven.proto.backplane.grpc.HandshakeRequest + 5, // 9: io.deephaven.proto.backplane.grpc.SessionService.Release:input_type -> io.deephaven.proto.backplane.grpc.ReleaseRequest + 7, // 10: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:input_type -> io.deephaven.proto.backplane.grpc.ExportRequest + 9, // 11: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:input_type -> io.deephaven.proto.backplane.grpc.ExportNotificationRequest + 11, // 12: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:input_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationRequest + 3, // 13: io.deephaven.proto.backplane.grpc.SessionService.NewSession:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse + 3, // 14: io.deephaven.proto.backplane.grpc.SessionService.RefreshSessionToken:output_type -> io.deephaven.proto.backplane.grpc.HandshakeResponse + 4, // 15: io.deephaven.proto.backplane.grpc.SessionService.CloseSession:output_type -> io.deephaven.proto.backplane.grpc.CloseSessionResponse + 6, // 16: io.deephaven.proto.backplane.grpc.SessionService.Release:output_type -> io.deephaven.proto.backplane.grpc.ReleaseResponse + 8, // 17: io.deephaven.proto.backplane.grpc.SessionService.ExportFromTicket:output_type -> io.deephaven.proto.backplane.grpc.ExportResponse + 10, // 18: io.deephaven.proto.backplane.grpc.SessionService.ExportNotifications:output_type -> io.deephaven.proto.backplane.grpc.ExportNotification + 12, // 19: io.deephaven.proto.backplane.grpc.SessionService.TerminationNotification:output_type -> io.deephaven.proto.backplane.grpc.TerminationNotificationResponse 13, // [13:20] is the sub-list for method output_type 6, // [6:13] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name @@ -984,7 +1047,7 @@ func file_deephaven_proto_session_proto_init() { } if !protoimpl.UnsafeEnabled { file_deephaven_proto_session_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeRequest); i { + switch v := v.(*WrappedAuthenticationRequest); i { case 0: return &v.state case 1: @@ -996,7 +1059,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeResponse); i { + switch v := v.(*HandshakeRequest); i { case 0: return &v.state case 1: @@ -1008,7 +1071,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CloseSessionResponse); i { + switch v := v.(*HandshakeResponse); i { case 0: return &v.state case 1: @@ -1020,7 +1083,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReleaseRequest); i { + switch v := v.(*CloseSessionResponse); i { case 0: return &v.state case 1: @@ -1032,7 +1095,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReleaseResponse); i { + switch v := v.(*ReleaseRequest); i { case 0: return &v.state case 1: @@ -1044,7 +1107,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExportRequest); i { + switch v := v.(*ReleaseResponse); i { case 0: return &v.state case 1: @@ -1056,7 +1119,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExportResponse); i { + switch v := v.(*ExportRequest); i { case 0: return &v.state case 1: @@ -1068,7 +1131,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExportNotificationRequest); i { + switch v := v.(*ExportResponse); i { case 0: return &v.state case 1: @@ -1080,7 +1143,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExportNotification); i { + switch v := v.(*ExportNotificationRequest); i { case 0: return &v.state case 1: @@ -1092,7 +1155,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminationNotificationRequest); i { + switch v := v.(*ExportNotification); i { case 0: return &v.state case 1: @@ -1104,7 +1167,7 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminationNotificationResponse); i { + switch v := v.(*TerminationNotificationRequest); i { case 0: return &v.state case 1: @@ -1116,6 +1179,18 @@ func file_deephaven_proto_session_proto_init() { } } file_deephaven_proto_session_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminationNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_session_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TerminationNotificationResponse_StackTrace); i { case 0: return &v.state @@ -1134,7 +1209,7 @@ func file_deephaven_proto_session_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_deephaven_proto_session_proto_rawDesc, NumEnums: 1, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/go/pkg/client/client.go b/go/pkg/client/client.go index b465f402434..a9d0dd90258 100644 --- a/go/pkg/client/client.go +++ b/go/pkg/client/client.go @@ -195,7 +195,7 @@ func (client *Client) withToken(ctx context.Context) (context.Context, error) { return nil, err } - return metadata.NewOutgoingContext(ctx, metadata.Pairs("deephaven_session_id", string(tok))), nil + return metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", string(tok))), nil } // RunScript executes a script on the deephaven server. diff --git a/go/pkg/client/session_stub.go b/go/pkg/client/session_stub.go index 33946ee3ed9..913bae08b8b 100644 --- a/go/pkg/client/session_stub.go +++ b/go/pkg/client/session_stub.go @@ -87,7 +87,7 @@ func startRefresher(ctx context.Context, sessionStub sessionpb2.SessionServiceCl return err } - ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs("deephaven_session_id", string(handshakeResp.SessionToken))) + ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", string(handshakeResp.SessionToken))) token.setToken(handshakeResp.SessionToken) diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto index b664ebcb315..56fcbc7d295 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto @@ -75,6 +75,18 @@ service SessionService { rpc TerminationNotification(TerminationNotificationRequest) returns (TerminationNotificationResponse) {} } +message WrappedAuthenticationRequest { + /* + * The type of the protobuf the auth payload protobuf. + */ + string type = 1; + + /* + * The serialized payload of the protobuf instance. + */ + bytes payload = 2; +} + /* * The request that a client provides to a server on handshake. */ diff --git a/py/client/pydeephaven/proto/session_pb2.py b/py/client/pydeephaven/proto/session_pb2.py index 37b8719cf5b..25f58c8fc24 100644 --- a/py/client/pydeephaven/proto/session_pb2.py +++ b/py/client/pydeephaven/proto/session_pb2.py @@ -15,10 +15,11 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\":\n\x10HandshakeRequest\x12\x15\n\rauth_protocol\x18\x01 \x01(\x11\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x96\x01\n\x11HandshakeResponse\x12\x17\n\x0fmetadata_header\x18\x01 \x01(\x0c\x12\x15\n\rsession_token\x18\x02 \x01(\x0c\x12&\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x02\x30\x01\x12)\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x02\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xb5\x07\n\x0eSessionService\x12y\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12\x82\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/sessionb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"=\n\x1cWrappedAuthenticationRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\":\n\x10HandshakeRequest\x12\x15\n\rauth_protocol\x18\x01 \x01(\x11\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x96\x01\n\x11HandshakeResponse\x12\x17\n\x0fmetadata_header\x18\x01 \x01(\x0c\x12\x15\n\rsession_token\x18\x02 \x01(\x0c\x12&\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x02\x30\x01\x12)\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x02\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xb5\x07\n\x0eSessionService\x12y\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12\x82\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/sessionb\x06proto3') +_WRAPPEDAUTHENTICATIONREQUEST = DESCRIPTOR.message_types_by_name['WrappedAuthenticationRequest'] _HANDSHAKEREQUEST = DESCRIPTOR.message_types_by_name['HandshakeRequest'] _HANDSHAKERESPONSE = DESCRIPTOR.message_types_by_name['HandshakeResponse'] _CLOSESESSIONRESPONSE = DESCRIPTOR.message_types_by_name['CloseSessionResponse'] @@ -32,6 +33,13 @@ _TERMINATIONNOTIFICATIONRESPONSE = DESCRIPTOR.message_types_by_name['TerminationNotificationResponse'] _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE = _TERMINATIONNOTIFICATIONRESPONSE.nested_types_by_name['StackTrace'] _EXPORTNOTIFICATION_STATE = _EXPORTNOTIFICATION.enum_types_by_name['State'] +WrappedAuthenticationRequest = _reflection.GeneratedProtocolMessageType('WrappedAuthenticationRequest', (_message.Message,), { + 'DESCRIPTOR' : _WRAPPEDAUTHENTICATIONREQUEST, + '__module__' : 'pydeephaven.proto.session_pb2' + # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.WrappedAuthenticationRequest) + }) +_sym_db.RegisterMessage(WrappedAuthenticationRequest) + HandshakeRequest = _reflection.GeneratedProtocolMessageType('HandshakeRequest', (_message.Message,), { 'DESCRIPTOR' : _HANDSHAKEREQUEST, '__module__' : 'pydeephaven.proto.session_pb2' @@ -126,32 +134,34 @@ _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._serialized_options = b'0\001' _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._options = None _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._serialized_options = b'0\001' - _HANDSHAKEREQUEST._serialized_start=98 - _HANDSHAKEREQUEST._serialized_end=156 - _HANDSHAKERESPONSE._serialized_start=159 - _HANDSHAKERESPONSE._serialized_end=309 - _CLOSESESSIONRESPONSE._serialized_start=311 - _CLOSESESSIONRESPONSE._serialized_end=333 - _RELEASEREQUEST._serialized_start=335 - _RELEASEREQUEST._serialized_end=406 - _RELEASERESPONSE._serialized_start=408 - _RELEASERESPONSE._serialized_end=425 - _EXPORTREQUEST._serialized_start=428 - _EXPORTREQUEST._serialized_end=567 - _EXPORTRESPONSE._serialized_start=569 - _EXPORTRESPONSE._serialized_end=585 - _EXPORTNOTIFICATIONREQUEST._serialized_start=587 - _EXPORTNOTIFICATIONREQUEST._serialized_end=614 - _EXPORTNOTIFICATION._serialized_start=617 - _EXPORTNOTIFICATION._serialized_end=1056 - _EXPORTNOTIFICATION_STATE._serialized_start=825 - _EXPORTNOTIFICATION_STATE._serialized_end=1056 - _TERMINATIONNOTIFICATIONREQUEST._serialized_start=1058 - _TERMINATIONNOTIFICATIONREQUEST._serialized_end=1090 - _TERMINATIONNOTIFICATIONRESPONSE._serialized_start=1093 - _TERMINATIONNOTIFICATIONRESPONSE._serialized_end=1372 - _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_start=1311 - _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_end=1372 - _SESSIONSERVICE._serialized_start=1375 - _SESSIONSERVICE._serialized_end=2324 + _WRAPPEDAUTHENTICATIONREQUEST._serialized_start=98 + _WRAPPEDAUTHENTICATIONREQUEST._serialized_end=159 + _HANDSHAKEREQUEST._serialized_start=161 + _HANDSHAKEREQUEST._serialized_end=219 + _HANDSHAKERESPONSE._serialized_start=222 + _HANDSHAKERESPONSE._serialized_end=372 + _CLOSESESSIONRESPONSE._serialized_start=374 + _CLOSESESSIONRESPONSE._serialized_end=396 + _RELEASEREQUEST._serialized_start=398 + _RELEASEREQUEST._serialized_end=469 + _RELEASERESPONSE._serialized_start=471 + _RELEASERESPONSE._serialized_end=488 + _EXPORTREQUEST._serialized_start=491 + _EXPORTREQUEST._serialized_end=630 + _EXPORTRESPONSE._serialized_start=632 + _EXPORTRESPONSE._serialized_end=648 + _EXPORTNOTIFICATIONREQUEST._serialized_start=650 + _EXPORTNOTIFICATIONREQUEST._serialized_end=677 + _EXPORTNOTIFICATION._serialized_start=680 + _EXPORTNOTIFICATION._serialized_end=1119 + _EXPORTNOTIFICATION_STATE._serialized_start=888 + _EXPORTNOTIFICATION_STATE._serialized_end=1119 + _TERMINATIONNOTIFICATIONREQUEST._serialized_start=1121 + _TERMINATIONNOTIFICATIONREQUEST._serialized_end=1153 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_start=1156 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_end=1435 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_start=1374 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_end=1435 + _SESSIONSERVICE._serialized_start=1438 + _SESSIONSERVICE._serialized_end=2387 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/session.py b/py/client/pydeephaven/session.py index 5c59baa0849..b6b47e04abf 100644 --- a/py/client/pydeephaven/session.py +++ b/py/client/pydeephaven/session.py @@ -43,7 +43,7 @@ def __init__(self, host: str = None, port: int = None, never_timeout: bool = Tru port (int): the port number that Deephaven server is listening on, default is 10000 never_timeout (bool, optional): never allow the session to timeout, default is True session_type (str, optional): the Deephaven session type. Defaults to 'python' - + Raises: DHError """ @@ -90,7 +90,7 @@ def tables(self): @property def grpc_metadata(self): - return [(b'deephaven_session_id', self.session_token)] + return [(b'authorization', self.session_token)] @property def table_service(self): @@ -116,12 +116,12 @@ def flight_service(self): self._flight_service = ArrowFlightService(self) return self._flight_service - + @property def app_service(self): if not self._app_service: self._app_service = AppService(self) - + return self._app_service def make_ticket(self, ticket_no=None): @@ -150,7 +150,7 @@ def _fetch_fields(self): if not list_fields.cancel(): raise DHError("could not cancel ListFields subscription") return resp.created if resp.created else [] - + def _connect(self): with self._r_lock: self.grpc_channel, self.session_token, self._timeout = self.session_service.connect() @@ -251,7 +251,7 @@ def open_table(self, name: str) -> Table: # Explicitly close the table without releasing it (because it isn't ours) faketable.ticket = None faketable.schema = None - + def bind_table(self, name: str, table: Table) -> None: """ Bind a table to the given name on the server so that it can be referenced by that name. diff --git a/server/build.gradle b/server/build.gradle index cea162cb44e..6754a0e04fa 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -4,6 +4,7 @@ plugins { } dependencies { + implementation project(':authentication') implementation project(':engine-table') implementation project(':extensions-csv') implementation project(':extensions-parquet-table') diff --git a/server/jetty/build.gradle b/server/jetty/build.gradle index 318c873ae46..0d36fbd39bc 100644 --- a/server/jetty/build.gradle +++ b/server/jetty/build.gradle @@ -4,6 +4,7 @@ plugins { } dependencies { + api project(':authentication') api project(':server') api(project(':Integrations')) { because 'downstream dagger compile' diff --git a/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java b/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java index 9d924e0a7ab..4c4012eaca5 100644 --- a/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java +++ b/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java @@ -7,8 +7,8 @@ import dagger.Module; import dagger.Provides; import io.deephaven.server.arrow.ArrowModule; -import io.deephaven.server.auth.AuthContextModule; import io.deephaven.server.session.SessionModule; +import io.deephaven.server.test.AuthTestModule; import io.deephaven.server.test.FlightMessageRoundTripTest; import javax.inject.Singleton; @@ -28,7 +28,7 @@ static JettyConfig providesJettyConfig() { FlightTestModule.class, ArrowModule.class, SessionModule.class, - AuthContextModule.class, + AuthTestModule.class, JettyServerModule.class, JettyTestConfig.class }) diff --git a/server/netty/build.gradle b/server/netty/build.gradle index 20864ade011..1014c0e6242 100644 --- a/server/netty/build.gradle +++ b/server/netty/build.gradle @@ -4,6 +4,7 @@ plugins { } dependencies { + api project(':authentication') api project(':server') api(project(':Integrations')) { because 'downstream dagger compile' diff --git a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java index 447468531f5..d37cd8b747f 100644 --- a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java +++ b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java @@ -7,8 +7,8 @@ import dagger.Module; import dagger.Provides; import io.deephaven.server.arrow.ArrowModule; -import io.deephaven.server.auth.AuthContextModule; import io.deephaven.server.session.SessionModule; +import io.deephaven.server.test.AuthTestModule; import io.deephaven.server.test.FlightMessageRoundTripTest; import javax.inject.Singleton; @@ -28,7 +28,7 @@ static NettyConfig providesNettyConfig() { FlightTestModule.class, ArrowModule.class, SessionModule.class, - AuthContextModule.class, + AuthTestModule.class, NettyServerModule.class, NettyTestConfig.class }) diff --git a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java index b901a1a1df6..ff9326e46e7 100644 --- a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java @@ -3,19 +3,23 @@ */ package io.deephaven.server.arrow; +import com.google.protobuf.ByteString; +import com.google.protobuf.ByteStringAccess; +import com.google.protobuf.InvalidProtocolBufferException; import com.google.rpc.Code; -import io.deephaven.engine.table.impl.BaseTable; -import io.deephaven.engine.table.impl.remote.ConstructSnapshot; -import io.deephaven.engine.table.impl.util.BarrageMessage; -import io.deephaven.extensions.barrage.BarragePerformanceLog; +import io.deephaven.auth.AuthenticationException; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.auth.BasicAuthMarshaller; import io.deephaven.extensions.barrage.BarrageSnapshotOptions; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.proto.backplane.grpc.ExportNotification; +import io.deephaven.proto.backplane.grpc.WrappedAuthenticationRequest; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; import io.deephaven.server.session.TicketRouter; +import io.deephaven.auth.AuthContext; import io.grpc.stub.StreamObserver; import org.apache.arrow.flight.impl.Flight; import org.apache.arrow.flight.impl.FlightServiceGrpc; @@ -24,6 +28,8 @@ import javax.inject.Inject; import javax.inject.Singleton; import java.io.InputStream; +import java.util.Map; +import java.util.Optional; import java.util.concurrent.ScheduledExecutorService; @Singleton @@ -38,24 +44,113 @@ public class FlightServiceGrpcImpl extends FlightServiceGrpc.FlightServiceImplBa private final TicketRouter ticketRouter; private final ArrowFlightUtil.DoExchangeMarshaller.Factory doExchangeFactory; + private final BasicAuthMarshaller basicAuthMarshaller; + private final Map authRequestHandlers; + + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @Inject public FlightServiceGrpcImpl( @Nullable final ScheduledExecutorService executorService, final SessionService sessionService, final TicketRouter ticketRouter, - final ArrowFlightUtil.DoExchangeMarshaller.Factory doExchangeFactory) { + final ArrowFlightUtil.DoExchangeMarshaller.Factory doExchangeFactory, + final Optional basicAuthMarshaller, + Map authRequestHandlers) { this.executorService = executorService; this.sessionService = sessionService; this.ticketRouter = ticketRouter; this.doExchangeFactory = doExchangeFactory; + this.basicAuthMarshaller = basicAuthMarshaller.orElse(null); + this.authRequestHandlers = authRequestHandlers; } @Override public StreamObserver handshake( StreamObserver responseObserver) { - return GrpcUtil.rpcWrapper(log, responseObserver, () -> { - throw GrpcUtil.statusRuntimeException(Code.UNIMPLEMENTED, "See deephaven-core#997; support flight auth."); - }); + return GrpcUtil.rpcWrapper(log, responseObserver, () -> new HandshakeObserver(responseObserver)); + } + + private final class HandshakeObserver implements StreamObserver { + + private boolean isComplete = false; + private final StreamObserver responseObserver; + + private HandshakeObserver(StreamObserver responseObserver) { + this.responseObserver = responseObserver; + } + + @Override + public void onNext(final Flight.HandshakeRequest value) { + // handle the scenario where authentication headers initialized a session + SessionState session = sessionService.getOptionalSession(); + if (session != null) { + respondWithAuthTokenBin(session); + return; + } + + final AuthenticationRequestHandler.HandshakeResponseListener handshakeResponseListener = + (protocol, response) -> { + GrpcUtil.safelyExecute(() -> { + responseObserver.onNext(Flight.HandshakeResponse.newBuilder() + .setProtocolVersion(protocol) + .setPayload(ByteStringAccess.wrap(response)) + .build()); + }); + }; + + final ByteString payload = value.getPayload(); + final long protocolVersion = value.getProtocolVersion(); + Optional auth = Optional.empty(); + try { + if (basicAuthMarshaller != null) { + auth = basicAuthMarshaller.login(protocolVersion, payload.asReadOnlyByteBuffer(), + handshakeResponseListener); + } + if (auth.isEmpty()) { + final WrappedAuthenticationRequest req = WrappedAuthenticationRequest.parseFrom(payload); + final AuthenticationRequestHandler handler = authRequestHandlers.get(req.getType()); + if (handler != null) { + auth = handler.login(protocolVersion, req.getPayload().asReadOnlyByteBuffer(), + handshakeResponseListener); + } + } + } catch (final AuthenticationException | InvalidProtocolBufferException err) { + log.error().append("Authentication failed: ").append(err).endl(); + auth = Optional.empty(); + } + + if (auth.isEmpty()) { + responseObserver.onError(GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, + "authentication details invalid")); + return; + } + + session = sessionService.newSession(auth.get()); + respondWithAuthTokenBin(session); + } + + /** send the bearer token as an AuthTokenBin, as headers might have already been sent */ + private void respondWithAuthTokenBin(SessionState session) { + isComplete = true; + responseObserver.onNext(Flight.HandshakeResponse.newBuilder() + .setPayload(session.getExpiration().getTokenAsByteString()) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void onError(final Throwable t) { + // ignore + } + + @Override + public void onCompleted() { + if (isComplete) { + return; + } + responseObserver.onError( + GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, "no authentication details provided")); + } } @Override diff --git a/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java b/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java index 41c55226949..c1a0e689ca1 100644 --- a/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java +++ b/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java @@ -3,14 +3,76 @@ */ package io.deephaven.server.auth; -import dagger.Binds; import dagger.Module; +import dagger.Provides; +import io.deephaven.UncheckedDeephavenException; +import io.deephaven.auth.AnonymousAuthenticationHandler; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.auth.BasicAuthMarshaller; +import io.deephaven.configuration.Configuration; +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.deephaven.server.barrage.BarrageStreamGenerator; -import javax.inject.Singleton; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; @Module() -public interface AuthContextModule { - @Binds - @Singleton - AuthContextProvider bindAuthContextProvider(TrivialAuthContextProvider authContextProvider); +public class AuthContextModule { + private static final Logger log = LoggerFactory.getLogger(BarrageStreamGenerator.class); + private static final String[] AUTH_HANDLERS = Configuration.getInstance() + .getStringArrayFromPropertyWithDefault("AuthHandlers", + new String[] {AnonymousAuthenticationHandler.class.getCanonicalName()}); + + private static BasicAuthMarshaller basicAuthMarshaller; + private static Map authHandlerMap; + + private static void initializeAuthHandlers() { + if (authHandlerMap != null) { + return; + } + + authHandlerMap = new LinkedHashMap<>(); + + for (String handler : AUTH_HANDLERS) { + try { + final Class clazz = AuthContextModule.class.getClassLoader().loadClass(handler); + Object instance = clazz.getDeclaredConstructor().newInstance(); + if (instance instanceof BasicAuthMarshaller.Handler) { + if (basicAuthMarshaller != null) { + throw new UncheckedDeephavenException("Found multiple BasicAuthMarshaller.Handlers"); + } + basicAuthMarshaller = new BasicAuthMarshaller((BasicAuthMarshaller.Handler) instance); + authHandlerMap.put(basicAuthMarshaller.getAuthType(), basicAuthMarshaller); + } else if (instance instanceof AuthenticationRequestHandler) { + final AuthenticationRequestHandler authHandler = (AuthenticationRequestHandler) instance; + authHandlerMap.put(authHandler.getAuthType(), authHandler); + } else { + log.error().append("Provided auth handler does not implement an auth interface: ") + .append(handler).endl(); + throw new UncheckedDeephavenException("Could not load authentication"); + } + } catch (Exception error) { + log.error().append("Could not load authentication handler class: ").append(handler).endl(); + log.error().append(error).endl(); + throw new UncheckedDeephavenException(error); + } + } + + authHandlerMap = Collections.unmodifiableMap(authHandlerMap); + } + + @Provides + public Optional bindBasicAuth() { + initializeAuthHandlers(); + return Optional.ofNullable(basicAuthMarshaller); + } + + @Provides + public Map bindAuthHandlerMap() { + initializeAuthHandlers(); + return authHandlerMap; + } } diff --git a/server/src/main/java/io/deephaven/server/auth/AuthContextProvider.java b/server/src/main/java/io/deephaven/server/auth/AuthContextProvider.java deleted file mode 100644 index 2c5080470f0..00000000000 --- a/server/src/main/java/io/deephaven/server/auth/AuthContextProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.auth; - -import com.google.protobuf.ByteString; -import io.deephaven.util.auth.AuthContext; - -/** - * The AuthContextProvider's job is to manage all authentication and authorization responsibilities. If audit logging is - * required, an implementation of this (and its companion AuthContext) is the correct way path forward. - */ -public interface AuthContextProvider { - /** - * Returns true if this auth context provider can authenticate using the provided protocol version. - * - * @param authProtocol the protocol version to use (application specific) - * @return true iff `authProtocol` is supported - */ - boolean supportsProtocol(long authProtocol); - - /** - * Authenticate and obtain an {@link AuthContext} using the provided protocol and byte payload. - * - * @param protocolVersion the protocol version to use (application specific) - * @param payload the user's login details (protocol specific) - * @return null if user could not be authenticated, otherwise an AuthContext for the user - */ - AuthContext authenticate(long protocolVersion, ByteString payload); -} diff --git a/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java b/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java deleted file mode 100644 index 40fcf1d7847..00000000000 --- a/server/src/main/java/io/deephaven/server/auth/TrivialAuthContextProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.auth; - -import com.google.protobuf.ByteString; -import io.deephaven.util.auth.AuthContext; - -import javax.inject.Inject; - -public class TrivialAuthContextProvider implements AuthContextProvider { - - @Inject() - public TrivialAuthContextProvider() {} - - @Override - public boolean supportsProtocol(final long authProtocol) { - return authProtocol == 1; - } - - @Override - public AuthContext authenticate(final long protocolVersion, final ByteString payload) { - if (!supportsProtocol(protocolVersion)) { - return null; - } - return new AuthContext.SuperUser(); - } -} diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index 58f245485c7..5b2eb27594a 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -3,6 +3,8 @@ */ package io.deephaven.server.runner; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.configuration.Configuration; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker; import io.deephaven.engine.table.impl.util.MemoryTableLoggers; @@ -26,6 +28,7 @@ import javax.inject.Inject; import javax.inject.Provider; import java.io.IOException; +import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -36,6 +39,9 @@ public class DeephavenApiServer { private static final Logger log = LoggerFactory.getLogger(DeephavenApiServer.class); + private static final String TARGET_URL = Configuration.getInstance() + .getStringWithDefault("TargetUrl", "https://localhost:10000/"); + private final GrpcServer server; private final UpdateGraphProcessor ugp; private final LogInit logInit; @@ -44,6 +50,7 @@ public class DeephavenApiServer { private final ApplicationInjector applicationInjector; private final UriResolvers uriResolvers; private final SessionService sessionService; + private final Map authenticationHandlers; @Inject public DeephavenApiServer( @@ -54,7 +61,8 @@ public DeephavenApiServer( final PluginRegistration pluginRegistration, final ApplicationInjector applicationInjector, final UriResolvers uriResolvers, - final SessionService sessionService) { + final SessionService sessionService, + final Map authenticationHandlers) { this.server = server; this.ugp = ugp; this.logInit = logInit; @@ -63,6 +71,7 @@ public DeephavenApiServer( this.applicationInjector = applicationInjector; this.uriResolvers = uriResolvers; this.sessionService = sessionService; + this.authenticationHandlers = authenticationHandlers; } @VisibleForTesting @@ -131,6 +140,9 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time // inject applications before we start the gRPC server applicationInjector.run(); + log.info().append("Initializing Authentication...").endl(); + authenticationHandlers.forEach((name, handler) -> handler.initialize(TARGET_URL)); + log.info().append("Starting server...").endl(); server.start(); log.info().append("Server started on port ").append(server.getPort()).endl(); @@ -139,7 +151,7 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time /** * Blocks until the server exits. - * + * * @throws InterruptedException thrown if this thread is interrupted while blocking for the server to halt. */ public void join() throws InterruptedException { diff --git a/server/src/main/java/io/deephaven/server/session/SessionService.java b/server/src/main/java/io/deephaven/server/session/SessionService.java index 1b509aca7b3..0303d255464 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionService.java +++ b/server/src/main/java/io/deephaven/server/session/SessionService.java @@ -5,17 +5,21 @@ import com.github.f4b6a3.uuid.UuidCreator; import com.google.protobuf.ByteString; +import io.deephaven.auth.AuthenticationException; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.auth.BasicAuthMarshaller; import io.deephaven.configuration.Configuration; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.proto.backplane.grpc.TerminationNotificationResponse; import io.deephaven.server.util.Scheduler; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.deephaven.util.process.ProcessEnvironment; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; +import org.apache.arrow.flight.auth2.Auth2Constants; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -27,6 +31,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedDeque; @@ -58,12 +63,20 @@ public class SessionService { private final List terminationListeners = new CopyOnWriteArrayList<>(); + private final BasicAuthMarshaller basicAuthMarshaller; + private final Map authRequestHandlers; + @Inject() + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") public SessionService(final Scheduler scheduler, final SessionState.Factory sessionFactory, - @Named("session.tokenExpireMs") final long tokenExpireMs) { + @Named("session.tokenExpireMs") final long tokenExpireMs, + final Optional basicAuthMarshaller, + Map authRequestHandlers) { this.scheduler = scheduler; this.sessionFactory = sessionFactory; this.tokenExpireMs = tokenExpireMs; + this.basicAuthMarshaller = basicAuthMarshaller.orElse(null); + this.authRequestHandlers = authRequestHandlers; if (tokenExpireMs < MIN_COOKIE_EXPIRE_MS) { throw new IllegalArgumentException("session.tokenExpireMs is set too low. It is configured to " @@ -168,10 +181,16 @@ private TokenExpiration refreshToken(final SessionState session, boolean initial synchronized (session) { expiration = session.getExpiration(); - if (expiration != null - && expiration.deadline.getMillis() - tokenExpireMs + tokenRotateMs > now.getMillis()) { - // current token is not old enough to rotate - return expiration; + if (!initialToken) { + if (expiration == null) { + // current token is expired; we should not rotate + return null; + } + + if (expiration.deadline.getMillis() - tokenExpireMs + tokenRotateMs > now.getMillis()) { + // current token is not old enough to rotate + return expiration; + } } do { @@ -205,6 +224,42 @@ public long getExpirationDelayMs() { return tokenExpireMs; } + /** + * Lookup a session by token. Creates a new session if it's a basic auth and it passes. + * + * @param token the Authentication header to service + * @return the session or null if the session is invalid + */ + public SessionState getSessionForAuthToken(final String token) throws AuthenticationException { + if (token.startsWith(Auth2Constants.BEARER_PREFIX)) { + final String authToken = token.substring(Auth2Constants.BEARER_PREFIX.length()); + try { + UUID uuid = UuidCreator.fromString(authToken); + SessionState session = getSessionForToken(uuid); + if (session != null) { + return session; + } + } catch (IllegalArgumentException ignored) { + } + } + + Optional context = Optional.empty(); + if (token.startsWith(Auth2Constants.BASIC_PREFIX) && basicAuthMarshaller != null) { + final String payload = token.substring(Auth2Constants.BASIC_PREFIX.length()); + context = basicAuthMarshaller.login(payload, SessionServiceGrpcImpl::insertCallHeader); + } else { + int offset = token.indexOf(' '); + final String key = token.substring(0, offset < 0 ? token.length() : offset); + final String payload = offset < 0 ? "" : token.substring(offset + 1); + AuthenticationRequestHandler handler = authRequestHandlers.get(key); + if (handler != null) { + context = handler.login(payload, SessionServiceGrpcImpl::insertCallHeader); + } + } + + return context.map(this::newSession).orElse(null); + } + /** * Lookup a session by token. * @@ -231,7 +286,7 @@ public SessionState getSessionForToken(final UUID token) { public SessionState getCurrentSession() { final SessionState session = getOptionalSession(); if (session == null) { - throw new StatusRuntimeException(Status.UNAUTHENTICATED); + throw Status.UNAUTHENTICATED.asRuntimeException(); } return session; } @@ -282,8 +337,12 @@ public TokenExpiration(final UUID cookie, final DateTime deadline, final Session } /** - * Returns the UUID cookie in byte[] friendly format. + * Returns the bearer token in byte[] friendly format. */ + public ByteString getBearerTokenAsByteString() { + return ByteString.copyFromUtf8(Auth2Constants.BEARER_PREFIX + UuidCreator.toString(token)); + } + public ByteString getTokenAsByteString() { return ByteString.copyFromUtf8(UuidCreator.toString(token)); } diff --git a/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java index ea146dd0d98..4b59d2f2383 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java @@ -3,9 +3,9 @@ */ package io.deephaven.server.session; -import com.github.f4b6a3.uuid.UuidCreator; import com.google.protobuf.ByteString; import com.google.rpc.Code; +import io.deephaven.auth.AuthenticationException; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; @@ -21,64 +21,57 @@ import io.deephaven.proto.backplane.grpc.SessionServiceGrpc; import io.deephaven.proto.backplane.grpc.TerminationNotificationRequest; import io.deephaven.proto.backplane.grpc.TerminationNotificationResponse; -import io.deephaven.server.auth.AuthContextProvider; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.grpc.Context; import io.grpc.Contexts; +import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; import io.grpc.Metadata; import io.grpc.ServerCall; import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; +import io.grpc.Status; import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; +import org.apache.arrow.flight.auth.AuthConstants; +import org.apache.arrow.flight.auth2.Auth2Constants; +import org.jetbrains.annotations.Nullable; import javax.inject.Inject; import javax.inject.Singleton; -import java.util.Optional; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; public class SessionServiceGrpcImpl extends SessionServiceGrpc.SessionServiceImplBase { - // TODO (#997): use flight AuthConstants - public static final String DEEPHAVEN_SESSION_ID = "deephaven_session_id"; + public static final String DEEPHAVEN_SESSION_ID = Auth2Constants.AUTHORIZATION_HEADER; public static final Metadata.Key SESSION_HEADER_KEY = Metadata.Key.of(DEEPHAVEN_SESSION_ID, Metadata.ASCII_STRING_MARSHALLER); public static final Context.Key SESSION_CONTEXT_KEY = Context.key(DEEPHAVEN_SESSION_ID); + private static final String SERVER_CALL_ID = "SessionServiceGrpcImpl.ServerCall"; + private static final Context.Key> SESSION_CALL_KEY = Context.key(SERVER_CALL_ID); + private static final Logger log = LoggerFactory.getLogger(SessionServiceGrpcImpl.class); private final SessionService service; - private final AuthContextProvider authProvider; private final TicketRouter ticketRouter; @Inject() - public SessionServiceGrpcImpl(final SessionService service, - final AuthContextProvider authProvider, - final TicketRouter ticketRouter) { + public SessionServiceGrpcImpl(final SessionService service, final TicketRouter ticketRouter) { this.service = service; - this.authProvider = authProvider; this.ticketRouter = ticketRouter; } @Override public void newSession(final HandshakeRequest request, final StreamObserver responseObserver) { GrpcUtil.rpcWrapper(log, responseObserver, () -> { - if (!authProvider.supportsProtocol(request.getAuthProtocol())) { - responseObserver.onError( - GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "Protocol version not allowed.")); - return; - } - - final AuthContext authContext = authProvider.authenticate(request.getAuthProtocol(), request.getPayload()); - if (authContext == null) { - responseObserver - .onError(GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, "Authentication failed.")); - return; - } + // TODO: once jsapi is updated to use flight auth, then newSession can be deprecated or removed + final AuthContext authContext = new AuthContext.SuperUser(); final SessionState session = service.newSession(authContext); responseObserver.onNext(HandshakeResponse.newBuilder() .setMetadataHeader(ByteString.copyFromUtf8(DEEPHAVEN_SESSION_ID)) - .setSessionToken(session.getExpiration().getTokenAsByteString()) + .setSessionToken(session.getExpiration().getBearerTokenAsByteString()) .setTokenDeadlineTimeMillis(session.getExpiration().deadline.getMillis()) .setTokenExpirationDelayMillis(service.getExpirationDelayMs()) .build()); @@ -91,6 +84,7 @@ public void newSession(final HandshakeRequest request, final StreamObserver responseObserver) { GrpcUtil.rpcWrapper(log, responseObserver, () -> { + // TODO: once jsapi is updated to use flight auth, then newSession can be deprecated or removed if (request.getAuthProtocol() != 0) { responseObserver.onError( GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "Protocol version not allowed.")); @@ -98,17 +92,11 @@ public void refreshSessionToken(final HandshakeRequest request, } final SessionState session = service.getCurrentSession(); - if (session != service.getSessionForToken(UUID.fromString(request.getPayload().toStringUtf8()))) { - responseObserver.onError(GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, - "Refresh request's session ID does not match metadata header provided ID.")); - return; - } - final SessionService.TokenExpiration expiration = service.refreshToken(session); responseObserver.onNext(HandshakeResponse.newBuilder() .setMetadataHeader(ByteString.copyFromUtf8(DEEPHAVEN_SESSION_ID)) - .setSessionToken(expiration.getTokenAsByteString()) + .setSessionToken(expiration.getBearerTokenAsByteString()) .setTokenDeadlineTimeMillis(expiration.deadline.getMillis()) .setTokenExpirationDelayMillis(service.getExpirationDelayMs()) .build()); @@ -128,12 +116,6 @@ public void closeSession(final HandshakeRequest request, } final SessionState session = service.getCurrentSession(); - if (session != service.getSessionForToken(UUID.fromString(request.getPayload().toStringUtf8()))) { - responseObserver.onError(GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, - "Refresh request's session ID does not match metadata header provided ID.")); - return; - } - service.closeSession(session); responseObserver.onNext(CloseSessionResponse.getDefaultInstance()); responseObserver.onCompleted(); @@ -221,6 +203,71 @@ public void terminationNotification(TerminationNotificationRequest request, }); } + public static void insertCallHeader(String key, String value) { + final Metadata.Key metaKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + final InterceptedCall call = SESSION_CALL_KEY.get(); + if (call == null) { + throw new IllegalStateException("Cannot insert call header; there is no grpc call in the context"); + } + if (call.sentHeaders) { + throw new IllegalStateException("Cannot insert call header; headers already sent"); + } + if (call.extraHeaders.put(metaKey, value) != null) { + log.warn().append("Overwrote gRPC call header with key: ").append(metaKey.toString()).endl(); + } + } + + public static class InterceptedCall extends SimpleForwardingServerCall { + private boolean sentHeaders = false; + private final SessionService service; + private final SessionState session; + private final Map, String> extraHeaders = new LinkedHashMap<>(); + + private InterceptedCall(final SessionService service, final ServerCall call, + @Nullable final SessionState session) { + super(call); + this.service = service; + this.session = session; + } + + @Override + public void sendHeaders(final Metadata headers) { + sentHeaders = true; + try { + addHeaders(headers); + } finally { + // Make sure to always call the gRPC callback to avoid interrupting the gRPC request cycle + super.sendHeaders(headers); + } + } + + @Override + public void close(final Status status, final Metadata trailers) { + try { + if (!sentHeaders) { + // gRPC doesn't always send response headers if the call errors or completes immediately + addHeaders(trailers); + } + } finally { + // Make sure to always call the gRPC callback to avoid interrupting the gRPC request cycle + super.close(status, trailers); + } + } + + private void addHeaders(final Metadata md) { + // add any headers that were have been accumulated + extraHeaders.forEach(md::put); + + // add the bearer header if applicable + if (session != null) { + final SessionService.TokenExpiration exp = service.refreshToken(session); + if (exp != null) { + md.put(SESSION_HEADER_KEY, Auth2Constants.BEARER_PREFIX + exp.token.toString()); + } + } + } + } + @Singleton public static class AuthServerInterceptor implements ServerInterceptor { private final SessionService service; @@ -231,16 +278,30 @@ public AuthServerInterceptor(final SessionService service) { } @Override - public ServerCall.Listener interceptCall(final ServerCall serverCall, + public ServerCall.Listener interceptCall(final ServerCall call, final Metadata metadata, final ServerCallHandler serverCallHandler) { SessionState session = null; - final Optional tokenBytes = Optional.ofNullable(metadata.get(SESSION_HEADER_KEY)); - if (tokenBytes.isPresent()) { - UUID token = UuidCreator.fromString(tokenBytes.get()); - session = service.getSessionForToken(token); + final byte[] altToken = metadata.get(AuthConstants.TOKEN_KEY); + if (altToken != null) { + try { + session = service.getSessionForToken(UUID.fromString(new String(altToken))); + } catch (IllegalArgumentException ignored) { + } + } + + final String token = metadata.get(SESSION_HEADER_KEY); + if (session == null && token != null) { + try { + session = service.getSessionForAuthToken(token); + } catch (AuthenticationException e) { + log.error().append("Failed to authenticate: ").append(e).endl(); + throw Status.UNAUTHENTICATED.asRuntimeException(); + } } - final Context newContext = Context.current().withValue(SESSION_CONTEXT_KEY, session); + final InterceptedCall serverCall = new InterceptedCall<>(service, call, session); + final Context newContext = Context.current().withValues( + SESSION_CONTEXT_KEY, session, SESSION_CALL_KEY, serverCall); return Contexts.interceptCall(newContext, serverCall, metadata, serverCallHandler); } } diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index 54c2b2960b8..22967b0c391 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -37,7 +37,7 @@ import io.deephaven.engine.context.ExecutionContext; import io.deephaven.util.SafeCloseable; import io.deephaven.util.annotations.VisibleForTesting; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.deephaven.util.datastructures.SimpleReferenceManager; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java index 9e5f0722cc1..9174541b82d 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java @@ -15,13 +15,15 @@ import io.deephaven.server.session.SessionState; import io.deephaven.server.util.TestControlledScheduler; import io.deephaven.util.SafeCloseable; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.grpc.Context; import io.grpc.stub.StreamObserver; import org.junit.After; import org.junit.Before; import org.junit.Test; +import java.util.Collections; +import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; import static org.junit.Assert.assertEquals; @@ -41,7 +43,7 @@ public void setup() { scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), - TOKEN_EXPIRE_MS); + TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(scheduler, sessionService, new TypeLookup(ObjectTypeLookup.NoOp.INSTANCE)); } diff --git a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerSingleAuthenticatedBase.java b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerSingleAuthenticatedBase.java index cc0c85b34e7..b1d5eedc569 100644 --- a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerSingleAuthenticatedBase.java +++ b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerSingleAuthenticatedBase.java @@ -3,6 +3,8 @@ */ package io.deephaven.server.runner; +import io.deephaven.UncheckedDeephavenException; +import io.deephaven.auth.AuthenticationException; import io.deephaven.proto.DeephavenChannel; import io.deephaven.proto.backplane.grpc.HandshakeRequest; import io.deephaven.proto.backplane.grpc.HandshakeResponse; @@ -18,13 +20,11 @@ import io.grpc.MethodDescriptor; import org.junit.Before; -import java.util.UUID; - public abstract class DeephavenApiServerSingleAuthenticatedBase extends DeephavenApiServerTestBase { DeephavenChannel channel; - UUID sessionToken; + String sessionToken; @Override @Before @@ -35,7 +35,7 @@ public void setUp() throws Exception { channel.sessionBlocking().newSession(HandshakeRequest.newBuilder().setAuthProtocol(1).build()); // Note: the authentication token for DeephavenApiServerTestBase is valid for 7 days, // so we should only need to authenticate once :) - sessionToken = UUID.fromString(result.getSessionToken().toStringUtf8()); + sessionToken = result.getSessionToken().toStringUtf8(); final String sessionHeader = result.getMetadataHeader().toStringUtf8(); final Key sessionHeaderKey = Metadata.Key.of(sessionHeader, Metadata.ASCII_STRING_MARSHALLER); final Channel authenticatedChannel = ClientInterceptors.intercept(channel.channel(), new ClientInterceptor() { @@ -43,11 +43,11 @@ public void setUp() throws Exception { public ClientCall interceptCall( final MethodDescriptor methodDescriptor, final CallOptions callOptions, final Channel channel) { - return new ForwardingClientCall.SimpleForwardingClientCall( + return new ForwardingClientCall.SimpleForwardingClientCall<>( channel.newCall(methodDescriptor, callOptions)) { @Override public void start(final Listener responseListener, final Metadata headers) { - headers.put(sessionHeaderKey, sessionToken.toString()); + headers.put(sessionHeaderKey, sessionToken); super.start(responseListener, headers); } }; @@ -57,7 +57,11 @@ public void start(final Listener responseListener, final Metadata headers } public SessionState authenticatedSessionState() { - return server().sessionService().getSessionForToken(sessionToken); + try { + return server().sessionService().getSessionForAuthToken(sessionToken); + } catch (AuthenticationException e) { + throw new UncheckedDeephavenException(); + } } public DeephavenChannel channel() { diff --git a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java index 7997bdd3e19..1c66173a101 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java @@ -8,11 +8,14 @@ import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.server.util.TestControlledScheduler; import io.deephaven.util.SafeCloseable; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import org.junit.After; import org.junit.Before; import org.junit.Test; +import java.util.Collections; +import java.util.Optional; + public class SessionServiceTest { private static final long TOKEN_EXPIRE_MS = 1_000_000; @@ -28,7 +31,7 @@ public void setup() { scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), - TOKEN_EXPIRE_MS); + TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); } @After diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index ec21c30d1b1..79eec750bd8 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -18,7 +18,7 @@ import io.deephaven.proto.backplane.grpc.ExportNotification; import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.util.SafeCloseable; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java index 0134a7bd7a1..cebddeded14 100644 --- a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java +++ b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java @@ -18,7 +18,7 @@ import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.util.SafeCloseable; import io.deephaven.UncheckedDeephavenException; -import io.deephaven.util.auth.AuthContext; +import io.deephaven.auth.AuthContext; import io.deephaven.server.session.SessionService; import io.deephaven.server.session.SessionState; import io.deephaven.server.util.TestControlledScheduler; diff --git a/server/test/build.gradle b/server/test/build.gradle index d504f26b071..9d4e4a632bd 100644 --- a/server/test/build.gradle +++ b/server/test/build.gradle @@ -6,6 +6,7 @@ plugins { dependencies { implementation project(':Base') + implementation project(':authentication') implementation project(':engine-table')//Table, LTM, TableDiff, TableTools, ScriptSession implementation project(':server') implementation project(':proto:proto-backplane-grpc-flight') @@ -20,4 +21,4 @@ dependencies { // Classpaths.inheritJUnitPlatform(project, 'api') Classpaths.inheritJUnitClassic(project, 'implementation') -} \ No newline at end of file +} diff --git a/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java b/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java new file mode 100644 index 00000000000..7126f279ff4 --- /dev/null +++ b/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.server.test; + +import dagger.Module; +import dagger.Provides; +import io.deephaven.auth.AuthenticationException; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.auth.BasicAuthMarshaller; +import io.deephaven.auth.AuthContext; + +import javax.inject.Singleton; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@Module() +public class AuthTestModule { + public static class BasicAuthTestImpl implements BasicAuthMarshaller.Handler { + public Map validLogins = new HashMap<>(); + + @Override + public Optional login(String username, String password) throws AuthenticationException { + final String validPassword = validLogins.get(username); + if (Objects.equals(validPassword, password)) { + return Optional.of(new AuthContext.SuperUser()); + } + return Optional.empty(); + } + } + + @Provides + @Singleton + public BasicAuthTestImpl bindBasicAuthTestImpl() { + return new BasicAuthTestImpl(); + } + + @Provides + @Singleton + public BasicAuthMarshaller bindBasicAuth(BasicAuthTestImpl handler) { + return new BasicAuthMarshaller(handler); + } + + @Provides + @Singleton + public Optional bindBasicAuthProvider(BasicAuthMarshaller marshaller) { + return Optional.of(marshaller); + } + + @Provides + @Singleton + public Map bindAuthHandlerMap() { + // note this is mutable + return new HashMap<>(); + } +} diff --git a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java index 565e6df9ece..6fd5d095356 100644 --- a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java +++ b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java @@ -4,10 +4,16 @@ package io.deephaven.server.test; import com.google.flatbuffers.FlatBufferBuilder; +import com.google.protobuf.ByteString; import dagger.Module; import dagger.Provides; import dagger.multibindings.IntoSet; -import io.deephaven.barrage.flatbuf.*; +import io.deephaven.auth.AuthenticationRequestHandler; +import io.deephaven.barrage.flatbuf.BarrageMessageType; +import io.deephaven.barrage.flatbuf.BarrageMessageWrapper; +import io.deephaven.barrage.flatbuf.BarrageSnapshotOptions; +import io.deephaven.barrage.flatbuf.BarrageSnapshotRequest; +import io.deephaven.barrage.flatbuf.ColumnConversionMode; import io.deephaven.base.verify.Assert; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.engine.table.Table; @@ -18,9 +24,7 @@ import io.deephaven.engine.util.TableDiff; import io.deephaven.engine.util.TableTools; import io.deephaven.extensions.barrage.util.BarrageUtil; -import io.deephaven.proto.backplane.grpc.HandshakeRequest; -import io.deephaven.proto.backplane.grpc.HandshakeResponse; -import io.deephaven.proto.backplane.grpc.SessionServiceGrpc; +import io.deephaven.proto.backplane.grpc.WrappedAuthenticationRequest; import io.deephaven.proto.flight.util.FlightExportTicketHelper; import io.deephaven.proto.util.ScopeTicketHelper; import io.deephaven.server.arrow.FlightServiceGrpcBinding; @@ -32,10 +36,13 @@ import io.deephaven.server.session.TicketResolver; import io.deephaven.server.util.Scheduler; import io.deephaven.util.SafeCloseable; -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; +import io.deephaven.auth.AuthContext; import io.grpc.ServerInterceptor; +import io.grpc.Status; import org.apache.arrow.flight.*; +import org.apache.arrow.flight.auth.ClientAuthHandler; +import org.apache.arrow.flight.auth2.Auth2Constants; +import org.apache.arrow.flight.grpc.CredentialCallOption; import org.apache.arrow.flight.impl.Flight; import org.apache.arrow.memory.ArrowBuf; import org.apache.arrow.memory.RootAllocator; @@ -43,6 +50,7 @@ import org.apache.arrow.vector.types.pojo.ArrowType; import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.Schema; +import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.Nullable; import org.junit.After; @@ -54,7 +62,12 @@ import javax.inject.Named; import javax.inject.Singleton; import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.util.EnumSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -69,6 +82,8 @@ * is to verify that we can round trip */ public abstract class FlightMessageRoundTripTest { + private static final String ANONYMOUS = "Anonymous"; + @Module public static class FlightTestModule { @IntoSet @@ -131,22 +146,27 @@ public interface TestComponent { AbstractScriptSession scriptSession(); GrpcServer server(); + + AuthTestModule.BasicAuthTestImpl basicAuthHandler(); + + Map authRequestHandlers(); } private GrpcServer server; - private ManagedChannel channel; private FlightClient client; - SessionService sessionService; - private UUID sessionToken; + protected SessionService sessionService; + private SessionState currentSession; private AbstractScriptSession scriptSession; private SafeCloseable executionContext; + private Location serverLocation; + private TestComponent component; @Before public void setup() throws IOException { - TestComponent component = component(); + component = component(); server = component.server(); server.start(); @@ -156,14 +176,14 @@ public void setup() throws IOException { sessionService = component.sessionService(); executionContext = scriptSession.getExecutionContext().open(); - client = FlightClient.builder().location(Location.forGrpcInsecure("localhost", actualPort)) + serverLocation = Location.forGrpcInsecure("localhost", actualPort); + currentSession = sessionService.newSession(new AuthContext.SuperUser()); + client = FlightClient.builder().location(serverLocation) .allocator(new RootAllocator()).intercept(info -> new FlightClientMiddleware() { @Override public void onBeforeSendingHeaders(CallHeaders outgoingHeaders) { - final UUID currSession = sessionToken; - if (currSession != null) { - outgoingHeaders.insert(SessionServiceGrpcImpl.DEEPHAVEN_SESSION_ID, currSession.toString()); - } + String token = currentSession.getExpiration().token.toString(); + outgoingHeaders.insert("Authorization", Auth2Constants.BEARER_PREFIX + token); } @Override @@ -172,18 +192,6 @@ public void onHeadersReceived(CallHeaders incomingHeaders) {} @Override public void onCallCompleted(CallStatus status) {} }).build(); - channel = ManagedChannelBuilder.forTarget("localhost:" + actualPort) - .usePlaintext() - .build(); - SessionServiceGrpc.SessionServiceBlockingStub sessionServiceClient = - SessionServiceGrpc.newBlockingStub(channel); - - HandshakeResponse response = - sessionServiceClient.newSession(HandshakeRequest.newBuilder().setAuthProtocol(1).build()); - assertNotNull(response.getSessionToken()); - sessionToken = UUID.fromString(response.getSessionToken().toStringUtf8()); - - currentSession = sessionService.getSessionForToken(sessionToken); } protected abstract TestComponent component(); @@ -194,27 +202,25 @@ public void teardown() { scriptSession.release(); executionContext.close(); - channel.shutdown(); + closeClient(); + server.stopWithTimeout(1, TimeUnit.MINUTES); + try { - client.close(); + server.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); + } finally { + server = null; } + } - server.stopWithTimeout(1, TimeUnit.MINUTES); - + private void closeClient() { try { - channel.awaitTermination(1, TimeUnit.MINUTES); - server.join(); + client.close(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); - } finally { - channel.shutdownNow(); - channel = null; - - server = null; } } @@ -236,6 +242,206 @@ protected void after() { } }; + private void fullyReadStream(Ticket ticket, boolean expectError) { + try (final FlightStream stream = client.getStream(ticket)) { + // noinspection StatementWithEmptyBody + while (stream.next()); + if (expectError) { + fail("expected error"); + } + } catch (Exception ignored) { + } + } + + @Test + public void testLoginHandshakeBasicAuth() { + closeClient(); + client = FlightClient.builder().location(serverLocation) + .allocator(new RootAllocator()) + .build(); + + scriptSession.setVariable("test", TableTools.emptyTable(10).update("I=i")); + + // do get cannot be invoked by unauthenticated user + final Ticket ticket = new Ticket("s/test".getBytes(StandardCharsets.UTF_8)); + fullyReadStream(ticket, true); + + // now login + component.basicAuthHandler().validLogins.put("HANDSHAKE", "BASIC_AUTH"); + client.authenticateBasic("HANDSHAKE", "BASIC_AUTH"); + + // now we should see the scope variable + fullyReadStream(ticket, false); + } + + @Test + public void testLoginHeaderBasicAuth() { + closeClient(); + client = FlightClient.builder().location(serverLocation) + .allocator(new RootAllocator()) + .build(); + + scriptSession.setVariable("test", TableTools.emptyTable(10).update("I=i")); + + // do get cannot be invoked by unauthenticated user + final Ticket ticket = new Ticket("s/test".getBytes(StandardCharsets.UTF_8)); + fullyReadStream(ticket, true); + + // now login + component.basicAuthHandler().validLogins.put("HANDSHAKE", "BASIC_AUTH"); + final Optional authOpt = client.authenticateBasicToken("HANDSHAKE", "BASIC_AUTH"); + + final CredentialCallOption auth = authOpt.orElseGet(() -> { + throw Status.UNAUTHENTICATED.asRuntimeException(); + }); + + // now we should see the scope variable + fullyReadStream(ticket, false); + } + + @Test + public void testLoginHeaderCustomBearer() { + closeClient(); + scriptSession.setVariable("test", TableTools.emptyTable(10).update("I=i")); + + // add the bearer token override + final String bearerToken = UUID.randomUUID().toString(); + component.authRequestHandlers().put(Auth2Constants.BEARER_PREFIX.trim(), new AuthenticationRequestHandler() { + @Override + public String getAuthType() { + return Auth2Constants.BEARER_PREFIX.trim(); + } + + @Override + public Optional login(long protocolVersion, ByteBuffer payload, + HandshakeResponseListener listener) { + return Optional.empty(); + } + + @Override + public Optional login(String payload, MetadataResponseListener listener) { + if (payload.equals(bearerToken)) { + return Optional.of(new AuthContext.SuperUser()); + } + return Optional.empty(); + } + + @Override + public void initialize(String targetUrl) { + // do nothing + } + }); + + final MutableBoolean tokenChanged = new MutableBoolean(); + client = FlightClient.builder().location(serverLocation) + .allocator(new RootAllocator()) + .intercept(info -> new FlightClientMiddleware() { + String currToken = Auth2Constants.BEARER_PREFIX + bearerToken; + + @Override + public void onBeforeSendingHeaders(CallHeaders outgoingHeaders) { + outgoingHeaders.insert(Auth2Constants.AUTHORIZATION_HEADER, currToken); + } + + @Override + public void onHeadersReceived(CallHeaders incomingHeaders) { + String newToken = incomingHeaders.get(Auth2Constants.AUTHORIZATION_HEADER); + if (newToken != null) { + tokenChanged.setTrue(); + currToken = newToken; + } + } + + @Override + public void onCallCompleted(CallStatus status) {} + }).build(); + + // We will authenticate just prior to the do get request, so we should see the test table. + final Ticket ticket = new Ticket("s/test".getBytes(StandardCharsets.UTF_8)); + fullyReadStream(ticket, false); + Assert.eqTrue(tokenChanged.booleanValue(), "tokenChanged"); // assert we were sent a session token + } + + @Test + public void testLoginHandshakeAnonymous() { + closeClient(); + client = FlightClient.builder().location(serverLocation) + .allocator(new RootAllocator()) + .build(); + + scriptSession.setVariable("test", TableTools.emptyTable(10).update("I=i")); + + // do get cannot be invoked by unauthenticated user + final Ticket ticket = new Ticket("s/test".getBytes(StandardCharsets.UTF_8)); + fullyReadStream(ticket, false); + + // install the auth handler + component.authRequestHandlers().put(ANONYMOUS, new AnonymousRequestHandler()); + + client.authenticate(new ClientAuthHandler() { + byte[] callToken = new byte[0]; + + @Override + public void authenticate(ClientAuthSender outgoing, Iterator incoming) { + WrappedAuthenticationRequest request = WrappedAuthenticationRequest.newBuilder() + .setType(ANONYMOUS) + .setPayload(ByteString.EMPTY) + .build(); + outgoing.send(request.toByteArray()); + + callToken = incoming.next(); + } + + @Override + public byte[] getCallToken() { + return callToken; + } + }); + + // now we should see the scope variable + fullyReadStream(ticket, false); + } + + @Test + public void testLoginHeaderAnonymous() { + final String ANONYMOUS = "Anonymous"; + + closeClient(); + scriptSession.setVariable("test", TableTools.emptyTable(10).update("I=i")); + + // install the auth handler + component.authRequestHandlers().put(ANONYMOUS, new AnonymousRequestHandler()); + + final MutableBoolean tokenChanged = new MutableBoolean(); + client = FlightClient.builder().location(serverLocation) + .allocator(new RootAllocator()) + .intercept(info -> new FlightClientMiddleware() { + String currToken = ANONYMOUS; + + @Override + public void onBeforeSendingHeaders(CallHeaders outgoingHeaders) { + outgoingHeaders.insert(Auth2Constants.AUTHORIZATION_HEADER, currToken); + } + + @Override + public void onHeadersReceived(CallHeaders incomingHeaders) { + String newToken = incomingHeaders.get(Auth2Constants.AUTHORIZATION_HEADER); + if (newToken != null) { + tokenChanged.setTrue(); + currToken = newToken; + } + } + + @Override + public void onCallCompleted(CallStatus status) {} + }).build(); + + // We will authenticate just prior to the do get request, so we should see the test table. + final Ticket ticket = new Ticket("s/test".getBytes(StandardCharsets.UTF_8)); + fullyReadStream(ticket, false); + Assert.eqTrue(tokenChanged.booleanValue(), "tokenChanged"); // assert we were sent a session token + } + @Test public void testSimpleEmptyTableDoGet() throws Exception { Flight.Ticket simpleTableTicket = FlightExportTicketHelper.exportIdToFlightTicket(1); @@ -620,4 +826,34 @@ private void assertRoundTripDataEqual(Table deephavenTable) throws Exception { assertEquals(0, (long) TableTools .diffPair(deephavenTable, uploadedTable, 0, EnumSet.noneOf(TableDiff.DiffItems.class)).getSecond()); } + + private static class AnonymousRequestHandler implements AuthenticationRequestHandler { + @Override + public String getAuthType() { + return ANONYMOUS; + } + + @Override + public Optional login(long protocolVersion, ByteBuffer payload, + AuthenticationRequestHandler.HandshakeResponseListener listener) { + if (!payload.hasRemaining()) { + return Optional.of(new AuthContext.Anonymous()); + } + return Optional.empty(); + } + + @Override + public Optional login(String payload, + AuthenticationRequestHandler.MetadataResponseListener listener) { + if (payload.isEmpty()) { + return Optional.of(new AuthContext.Anonymous()); + } + return Optional.empty(); + } + + @Override + public void initialize(String targetUrl) { + // do nothing + } + } } diff --git a/settings.gradle b/settings.gradle index 05d00f72c3e..7147b44adae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,7 +20,8 @@ String[] mods = [ 'server', 'table-api', 'qst', - 'go' + 'go', + 'authentication', ] // new web projects; these modules are intended to form a complete, modular web application, @@ -325,6 +326,8 @@ project(':hotspot').projectDir = file('hotspot') include(':hotspot-impl') project(':hotspot-impl').projectDir = file('hotspot-impl') +include ':authentication' + file("${rootDir}/docker/registry").list().each { name -> if (file("${rootDir}/docker/registry/${name}/build.gradle").exists()) { include(":docker-${name}") @@ -375,3 +378,4 @@ if (isCiServer) { } } } + From 424f20a23e213f3c48a1d96b315333eef8234927 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Wed, 7 Sep 2022 08:14:35 -0600 Subject: [PATCH 110/215] Make DeephavenSessionTestBase use NoLanguageDeephavenSession (#2811) --- .../engine/context/QueryLibrary.java | 4 ++ .../python/server/EmbeddedServer.java | 2 + server/jetty/build.gradle | 1 + .../server/jetty/JettyServerComponent.java | 2 + .../jetty/JettyFlightRoundTripTest.java | 4 +- server/netty/build.gradle | 1 + .../server/netty/NettyServerComponent.java | 2 + .../netty/NettyFlightRoundTripTest.java | 4 +- .../console/NoConsoleSessionModule.java | 27 +++++++++++ .../SessionToExecutionStateModule.java | 14 ++++++ .../server/runner/DeephavenApiServer.java | 8 +++- ...avenApiServerInProcessGroovyComponent.java | 4 +- ...avenApiServerInProcessPythonComponent.java | 4 +- .../server/session/SessionState.java | 4 +- .../ApplicationServiceGrpcImplTest.java | 3 +- .../runner/DeephavenApiServerTestBase.java | 45 +++++++++++++++++-- .../ExecutionContextUnitTestModule.java | 16 +++++++ .../server/session/SessionServiceTest.java | 3 +- .../server/session/SessionStateTest.java | 5 ++- .../table/ExportTableUpdateListenerTest.java | 3 +- .../test/FlightMessageRoundTripTest.java | 5 ++- 21 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 server/src/main/java/io/deephaven/server/console/NoConsoleSessionModule.java create mode 100644 server/src/main/java/io/deephaven/server/console/SessionToExecutionStateModule.java create mode 100644 server/src/test/java/io/deephaven/server/runner/ExecutionContextUnitTestModule.java diff --git a/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java index 724cd0011e0..3bb72dd7660 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryLibrary.java @@ -108,4 +108,8 @@ public Collection getImportStrings() { public void updateVersionString() { versionString = UuidCreator.toString(UuidCreator.getRandomBased()); } + + public void updateVersionString(String version) { + versionString = version; + } } diff --git a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java index a45d98be2c5..0f62b6e71ef 100644 --- a/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java +++ b/py/embedded-server/java-runtime/src/main/java/io/deephaven/python/server/EmbeddedServer.java @@ -11,6 +11,7 @@ import io.deephaven.io.log.LogLevel; import io.deephaven.io.logger.LogBuffer; import io.deephaven.io.logger.LogBufferOutputStream; +import io.deephaven.server.console.SessionToExecutionStateModule; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeModule; @@ -48,6 +49,7 @@ public class EmbeddedServer { JettyServerModule.class, PythonConsoleSessionModule.class, GroovyConsoleSessionModule.class, + SessionToExecutionStateModule.class, }) public interface PythonServerComponent extends DeephavenApiServerComponent { @Component.Builder diff --git a/server/jetty/build.gradle b/server/jetty/build.gradle index 0d36fbd39bc..b9883ec7569 100644 --- a/server/jetty/build.gradle +++ b/server/jetty/build.gradle @@ -36,6 +36,7 @@ dependencies { implementation project(':grpc-java:grpc-mtls') testImplementation project(':server-test') + testImplementation TestTools.projectDependency(project, ':server') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java index 3c052082e45..e5dc662be55 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyServerComponent.java @@ -5,6 +5,7 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.SessionToExecutionStateModule; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; @@ -28,6 +29,7 @@ JettyServerModule.class, PythonConsoleSessionModule.class, GroovyConsoleSessionModule.class, + SessionToExecutionStateModule.class, }) public interface JettyServerComponent extends DeephavenApiServerComponent { @Component.Builder diff --git a/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java b/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java index 4c4012eaca5..8d977dc8cc3 100644 --- a/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java +++ b/server/jetty/src/test/java/io/deephaven/server/jetty/JettyFlightRoundTripTest.java @@ -7,6 +7,7 @@ import dagger.Module; import dagger.Provides; import io.deephaven.server.arrow.ArrowModule; +import io.deephaven.server.runner.ExecutionContextUnitTestModule; import io.deephaven.server.session.SessionModule; import io.deephaven.server.test.AuthTestModule; import io.deephaven.server.test.FlightMessageRoundTripTest; @@ -30,7 +31,8 @@ static JettyConfig providesJettyConfig() { SessionModule.class, AuthTestModule.class, JettyServerModule.class, - JettyTestConfig.class + JettyTestConfig.class, + ExecutionContextUnitTestModule.class, }) public interface JettyTestComponent extends TestComponent { } diff --git a/server/netty/build.gradle b/server/netty/build.gradle index 1014c0e6242..4076a5d0985 100644 --- a/server/netty/build.gradle +++ b/server/netty/build.gradle @@ -23,6 +23,7 @@ dependencies { implementation project(':grpc-java:grpc-mtls') testImplementation project(':server-test') + testImplementation TestTools.projectDependency(project, ':server') testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') diff --git a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java index 3469794ac2b..d50256c9519 100644 --- a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java +++ b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerComponent.java @@ -5,6 +5,7 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.SessionToExecutionStateModule; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; @@ -28,6 +29,7 @@ NettyServerModule.class, PythonConsoleSessionModule.class, GroovyConsoleSessionModule.class, + SessionToExecutionStateModule.class, }) public interface NettyServerComponent extends DeephavenApiServerComponent { @Component.Builder diff --git a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java index d37cd8b747f..32901a5b879 100644 --- a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java +++ b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java @@ -7,6 +7,7 @@ import dagger.Module; import dagger.Provides; import io.deephaven.server.arrow.ArrowModule; +import io.deephaven.server.runner.ExecutionContextUnitTestModule; import io.deephaven.server.session.SessionModule; import io.deephaven.server.test.AuthTestModule; import io.deephaven.server.test.FlightMessageRoundTripTest; @@ -30,7 +31,8 @@ static NettyConfig providesNettyConfig() { SessionModule.class, AuthTestModule.class, NettyServerModule.class, - NettyTestConfig.class + NettyTestConfig.class, + ExecutionContextUnitTestModule.class, }) public interface NettyTestComponent extends TestComponent { } diff --git a/server/src/main/java/io/deephaven/server/console/NoConsoleSessionModule.java b/server/src/main/java/io/deephaven/server/console/NoConsoleSessionModule.java new file mode 100644 index 00000000000..f2eb1a65213 --- /dev/null +++ b/server/src/main/java/io/deephaven/server/console/NoConsoleSessionModule.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.server.console; + +import dagger.Module; +import dagger.Provides; +import dagger.multibindings.IntoMap; +import dagger.multibindings.StringKey; +import io.deephaven.engine.util.NoLanguageDeephavenSession; +import io.deephaven.engine.util.ScriptSession; +import io.deephaven.server.console.groovy.InitScriptsModule; + +@Module(includes = InitScriptsModule.ServiceLoader.class) +public class NoConsoleSessionModule { + @Provides + @IntoMap + @StringKey("none") + ScriptSession bindScriptSession(NoLanguageDeephavenSession noLanguageSession) { + return noLanguageSession; + } + + @Provides + NoLanguageDeephavenSession bindNoLanguageSession() { + return new NoLanguageDeephavenSession(); + } +} diff --git a/server/src/main/java/io/deephaven/server/console/SessionToExecutionStateModule.java b/server/src/main/java/io/deephaven/server/console/SessionToExecutionStateModule.java new file mode 100644 index 00000000000..6eecb5fc743 --- /dev/null +++ b/server/src/main/java/io/deephaven/server/console/SessionToExecutionStateModule.java @@ -0,0 +1,14 @@ +package io.deephaven.server.console; + +import dagger.Module; +import dagger.Provides; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.util.ScriptSession; + +@Module +public class SessionToExecutionStateModule { + @Provides + ExecutionContext bindExecutionContext(ScriptSession session) { + return session.getExecutionContext(); + } +} diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index 5b2eb27594a..5f47aa89fbc 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -5,6 +5,7 @@ import io.deephaven.auth.AuthenticationRequestHandler; import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker; import io.deephaven.engine.table.impl.util.MemoryTableLoggers; @@ -51,6 +52,7 @@ public class DeephavenApiServer { private final UriResolvers uriResolvers; private final SessionService sessionService; private final Map authenticationHandlers; + private final Provider executionContextProvider; @Inject public DeephavenApiServer( @@ -62,7 +64,8 @@ public DeephavenApiServer( final ApplicationInjector applicationInjector, final UriResolvers uriResolvers, final SessionService sessionService, - final Map authenticationHandlers) { + final Map authenticationHandlers, + final Provider executionContextProvider) { this.server = server; this.ugp = ugp; this.logInit = logInit; @@ -72,6 +75,7 @@ public DeephavenApiServer( this.uriResolvers = uriResolvers; this.sessionService = sessionService; this.authenticationHandlers = authenticationHandlers; + this.executionContextProvider = executionContextProvider; } @VisibleForTesting @@ -162,6 +166,8 @@ public void join() throws InterruptedException { void startForUnitTests() throws Exception { pluginRegistration.registerAll(); applicationInjector.run(); + executionContextProvider.get().getQueryLibrary().updateVersionString("DEFAULT"); + log.info().append("Starting server...").endl(); server.start(); } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java index 4d61c51b3cf..346d4e59bb0 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java @@ -5,6 +5,7 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.SessionToExecutionStateModule; import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; import io.deephaven.server.log.LogModule; import io.grpc.ManagedChannelBuilder; @@ -18,7 +19,8 @@ DeephavenApiServerModule.class, LogModule.class, GroovyConsoleSessionModule.class, - ServerBuilderInProcessModule.class + ServerBuilderInProcessModule.class, + SessionToExecutionStateModule.class, }) public interface DeephavenApiServerInProcessGroovyComponent { diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java index 2cd576e51fe..83c84b4eb0c 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java @@ -5,6 +5,7 @@ import dagger.BindsInstance; import dagger.Component; +import io.deephaven.server.console.SessionToExecutionStateModule; import io.deephaven.server.console.python.PythonConsoleSessionModule; import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; import io.deephaven.server.log.LogModule; @@ -20,7 +21,8 @@ LogModule.class, PythonConsoleSessionModule.class, PythonGlobalScopeCopyModule.class, - ServerBuilderInProcessModule.class + ServerBuilderInProcessModule.class, + SessionToExecutionStateModule.class, }) public interface DeephavenApiServerInProcessPythonComponent { diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index 22967b0c391..d2b4bf01b73 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -136,13 +136,13 @@ public static ExportObject wrapAsExport(final T export) { @AssistedInject public SessionState(final Scheduler scheduler, - final Provider scriptSessionProvider, + final Provider executionContextProvider, @Assisted final AuthContext authContext) { this.sessionId = UuidCreator.toString(UuidCreator.getRandomBased()); this.logPrefix = "SessionState{" + sessionId + "}: "; this.scheduler = scheduler; this.authContext = authContext; - this.executionContext = scriptSessionProvider.get().getExecutionContext(); + this.executionContext = executionContextProvider.get(); log.info().append(logPrefix).append("session initialized").endl(); } diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java index 9174541b82d..ecd8a8072a4 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java @@ -3,6 +3,7 @@ */ package io.deephaven.server.appmode; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.engine.util.ScriptSession; @@ -42,7 +43,7 @@ public void setup() { livenessScope = LivenessScopeStack.open(); scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, - authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), + authContext -> new SessionState(scheduler, ExecutionContext::createForUnitTests, authContext), TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(scheduler, sessionService, new TypeLookup(ObjectTypeLookup.NoOp.INSTANCE)); diff --git a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java index 427e4c7418d..af4a3f8d729 100644 --- a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java +++ b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java @@ -3,12 +3,17 @@ */ package io.deephaven.server.runner; +import dagger.BindsInstance; +import dagger.Component; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.io.logger.LogBuffer; import io.deephaven.io.logger.LogBufferGlobal; import io.deephaven.proto.DeephavenChannel; +import io.deephaven.server.console.NoConsoleSessionModule; +import io.deephaven.server.log.LogModule; import io.deephaven.util.SafeCloseable; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; @@ -17,17 +22,52 @@ import org.junit.Before; import org.junit.Rule; +import javax.inject.Named; +import javax.inject.Singleton; +import java.io.PrintStream; import java.util.concurrent.TimeUnit; /** * Manages a single instance of {@link DeephavenApiServer}. */ public abstract class DeephavenApiServerTestBase { + @Singleton + @Component(modules = { + DeephavenApiServerModule.class, + LogModule.class, + NoConsoleSessionModule.class, + ServerBuilderInProcessModule.class, + ExecutionContextUnitTestModule.class, + }) + public interface TestComponent { + + DeephavenApiServer getServer(); + + ManagedChannelBuilder channelBuilder(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder withSchedulerPoolSize(@Named("scheduler.poolSize") int numThreads); + + @BindsInstance + Builder withSessionTokenExpireTmMs(@Named("session.tokenExpireMs") long tokenExpireMs); + + @BindsInstance + Builder withOut(@Named("out") PrintStream out); + + @BindsInstance + Builder withErr(@Named("err") PrintStream err); + + TestComponent build(); + } + } @Rule public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); - private DeephavenApiServerInProcessGroovyComponent serverComponent; + private TestComponent serverComponent; private LogBuffer logBuffer; private DeephavenApiServer server; private SafeCloseable scopeCloseable; @@ -40,8 +80,7 @@ public void setUp() throws Exception { logBuffer = new LogBuffer(128); LogBufferGlobal.setInstance(logBuffer); - serverComponent = DaggerDeephavenApiServerInProcessGroovyComponent - .builder() + serverComponent = DaggerDeephavenApiServerTestBase_TestComponent.builder() .withSchedulerPoolSize(4) .withSessionTokenExpireTmMs(sessionTokenExpireTmMs()) .withOut(System.out) diff --git a/server/src/test/java/io/deephaven/server/runner/ExecutionContextUnitTestModule.java b/server/src/test/java/io/deephaven/server/runner/ExecutionContextUnitTestModule.java new file mode 100644 index 00000000000..f0b3521cd80 --- /dev/null +++ b/server/src/test/java/io/deephaven/server/runner/ExecutionContextUnitTestModule.java @@ -0,0 +1,16 @@ +package io.deephaven.server.runner; + +import dagger.Module; +import dagger.Provides; +import io.deephaven.engine.context.ExecutionContext; + +import javax.inject.Singleton; + +@Module +public class ExecutionContextUnitTestModule { + @Provides + @Singleton + public ExecutionContext provideExecutionContext() { + return ExecutionContext.createForUnitTests(); + } +} diff --git a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java index 1c66173a101..8253f5527d6 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java @@ -4,6 +4,7 @@ package io.deephaven.server.session; import io.deephaven.base.verify.Assert; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.server.util.TestControlledScheduler; @@ -30,7 +31,7 @@ public void setup() { livenessScope = LivenessScopeStack.open(); scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, - authContext -> new SessionState(scheduler, NoLanguageDeephavenSession::new, authContext), + authContext -> new SessionState(scheduler, ExecutionContext::createForUnitTests, authContext), TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); } diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index 79eec750bd8..b576b5da6bf 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -5,6 +5,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.AssertionFailure; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.proto.util.ExportTicketHelper; import io.deephaven.server.table.ExportTableUpdateListenerTest; @@ -61,7 +62,7 @@ public void setup() { livenessScope = new LivenessScope(); LivenessScopeStack.push(livenessScope); scheduler = new TestControlledScheduler(); - session = new SessionState(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); + session = new SessionState(scheduler, ExecutionContext::createForUnitTests, AUTH_CONTEXT); session.initializeExpiration(new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), session)); nextExportId = 1; @@ -637,7 +638,7 @@ public void testCannotOutOfOrderServerExports() { @Test public void testVerifyExpirationSession() { - final SessionState session = new SessionState(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); + final SessionState session = new SessionState(scheduler, ExecutionContext::createForUnitTests, AUTH_CONTEXT); final SessionService.TokenExpiration expiration = new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), session); diff --git a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java index cebddeded14..9a858f6cc0b 100644 --- a/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java +++ b/server/src/test/java/io/deephaven/server/table/ExportTableUpdateListenerTest.java @@ -4,6 +4,7 @@ package io.deephaven.server.table; import io.deephaven.base.verify.Assert; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.impl.TableUpdateImpl; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.NoLanguageDeephavenSession; @@ -340,7 +341,7 @@ private void expectNoMessage() { public class TestSessionState extends SessionState { public TestSessionState() { - super(scheduler, NoLanguageDeephavenSession::new, AUTH_CONTEXT); + super(scheduler, ExecutionContext::createForUnitTests, AUTH_CONTEXT); initializeExpiration(new SessionService.TokenExpiration(UUID.randomUUID(), DateTimeUtils.nanosToTime(Long.MAX_VALUE), this)); } diff --git a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java index 6fd5d095356..48f54787c5a 100644 --- a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java +++ b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java @@ -15,6 +15,7 @@ import io.deephaven.barrage.flatbuf.BarrageSnapshotRequest; import io.deephaven.barrage.flatbuf.ColumnConversionMode; import io.deephaven.base.verify.Assert; +import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessScopeStack; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; @@ -150,6 +151,8 @@ public interface TestComponent { AuthTestModule.BasicAuthTestImpl basicAuthHandler(); Map authRequestHandlers(); + + ExecutionContext executionContext(); } private GrpcServer server; @@ -174,7 +177,7 @@ public void setup() throws IOException { scriptSession = component.scriptSession(); sessionService = component.sessionService(); - executionContext = scriptSession.getExecutionContext().open(); + executionContext = component.executionContext().open(); serverLocation = Location.forGrpcInsecure("localhost", actualPort); currentSession = sessionService.newSession(new AuthContext.SuperUser()); From 1ea9d0c53869a90cd803df054af3d932e71286a1 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:51:39 -0600 Subject: [PATCH 111/215] Use ugp ex-lock to control ticking table ticking (#2819) --- py/server/tests/test_table.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 31e7913d7d3..dd650fb7f36 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -719,8 +719,9 @@ def test_ticking_table_scope(self): self.wait_ticking_table_update(rt, row_count=1, timeout=5) for i in range(2, 5): - x.v = i - self.wait_ticking_table_update(rt, row_count=i, timeout=5) + with ugp.exclusive_lock(): + x.v = i + self.wait_ticking_table_update(rt, row_count=rt.size + 1, timeout=5) self.verify_table_data(rt, list(range(1, 5))) From 0c33c606b1d3502deed8eb8f8adf1eddf1cc17e1 Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Wed, 7 Sep 2022 19:35:31 -0400 Subject: [PATCH 112/215] Updated C++ client code, tests, and examples. (#2818) * Updated C++ client code, tests, and examples. * Move third-party flatbuffers to a different directory; write a README.md file; make it clear how I patched flatbuffers. --- cpp-client/deephaven/client/CMakeLists.txt | 26 +- .../client/arrowutil/arrow_value_converter.h | 30 + .../client/arrowutil/arrow_visitors.h | 52 +- .../client/immerutil/abstract_flex_vector.h | 128 +++- .../client/immerutil/immer_column_source.h | 183 +++-- .../deephaven/client/impl/table_handle_impl.h | 3 +- .../client/subscription/batch_parser.h | 2 +- .../client/subscription/classic_table_state.h | 2 + .../client/subscription/immer_table_state.h | 5 +- .../client/subscription/subscribe_thread.h | 3 +- .../client/subscription/update_processor.h | 10 +- .../private/deephaven/client/utility/misc.h | 2 + .../public/deephaven/client/chunk/chunk.h | 19 +- .../deephaven/client/chunk/chunk_filler.h | 3 +- .../include/public/deephaven/client/client.h | 7 +- .../client/column/array_column_source.h | 325 +++++++++ .../deephaven/client/column/column_source.h | 178 +---- .../deephaven/client/container/row_sequence.h | 18 +- .../public/deephaven/client/table/table.h | 54 +- .../include/public/deephaven/client/ticking.h | 112 +-- .../include/public/deephaven/client/types.h | 35 +- .../public/deephaven/client/utility/utility.h | 23 +- .../client/src/chunk/chunk_filler.cc | 75 +- .../deephaven/client/src/chunk/chunk_maker.cc | 9 + cpp-client/deephaven/client/src/client.cc | 4 +- .../client/src/column/array_column_source.cc | 15 + .../client/src/container/row_sequence.cc | 131 ++-- .../client/src/impl/table_handle_impl.cc | 4 +- .../client/src/subscription/batch_parser.cc | 13 +- .../src/subscription/classic_table_state.cc | 80 ++- .../src/subscription/immer_table_state.cc | 40 +- .../src/subscription/shift_processor.cc | 8 +- .../src/subscription/subscribe_thread.cc | 15 +- .../src/subscription/update_processor.cc | 276 +++---- .../deephaven/client/src/table/table.cc | 360 ++++++++++ cpp-client/deephaven/client/src/ticking.cc | 46 +- cpp-client/deephaven/client/src/types.cc | 2 +- .../deephaven/client/src/utility/utility.cc | 7 + .../third_party/flatbuffers/LICENSE.txt | 7 - .../client/third_party/flatbuffers/README.md | 13 + .../{ => include/flatbuffers}/allocator.h | 0 .../{ => include/flatbuffers}/array.h | 0 .../{ => include/flatbuffers}/base.h | 0 .../{ => include/flatbuffers}/buffer.h | 0 .../{ => include/flatbuffers}/buffer_ref.h | 0 .../flatbuffers}/default_allocator.h | 0 .../flatbuffers}/detached_buffer.h | 0 .../flatbuffers}/flatbuffer_builder.h | 0 .../{ => include/flatbuffers}/flatbuffers.h | 0 .../{ => include/flatbuffers}/stl_emulation.h | 0 .../{ => include/flatbuffers}/string.h | 0 .../{ => include/flatbuffers}/struct.h | 0 .../{ => include/flatbuffers}/table.h | 0 .../{ => include/flatbuffers}/util.h | 0 .../{ => include/flatbuffers}/vector.h | 0 .../flatbuffers}/vector_downward.h | 0 .../{ => include/flatbuffers}/verifier.h | 0 .../client/third_party/flatbuffers/patch.001 | 350 +++++++++ cpp-client/tests/CMakeLists.txt | 31 +- .../{add_drop_example.cc => add_drop_test.cc} | 15 +- ...gregates_example.cc => aggregates_test.cc} | 34 +- .../{filter_example.cc => filter_test.cc} | 15 +- ..._tail_example.cc => head_and_tail_test.cc} | 14 +- .../tests/{join_example.cc => join_test.cc} | 14 +- .../{lastby_example.cc => lastby_test.cc} | 18 +- cpp-client/tests/main.cc | 2 +- ...tables_example.cc => merge_tables_test.cc} | 10 +- ...new_table_example.cc => new_table_test.cc} | 18 +- .../{select_example.cc => select_test.cc} | 21 +- .../tests/{sort_example.cc => sort_test.cc} | 16 +- ...ilter_example.cc => string_filter_test.cc} | 37 +- cpp-client/tests/test_util.cc | 12 +- cpp-client/tests/test_util.h | 22 +- cpp-client/tests/{ => third_party}/catch.hpp | 0 .../{ungroup_example.cc => ungroup_test.cc} | 15 +- ...lidation_example.cc => validation_test.cc} | 72 +- .../tests/{view_example.cc => view_test.cc} | 14 +- .../build-all-examples/CMakeLists.txt | 4 +- cpp-examples/cleanup/CMakeLists.txt | 6 - .../compare_approaches/CMakeLists.txt | 20 - cpp-examples/compare_approaches/main.cc | 671 ------------------ .../CMakeLists.txt | 6 - .../create_table_with_arrow_flight/main.cc | 2 +- .../CMakeLists.txt | 6 - cpp-examples/do_exchange/CMakeLists.txt | 19 - cpp-examples/do_exchange/main.cc | 556 --------------- cpp-examples/hello_world/CMakeLists.txt | 6 - cpp-examples/read_csv/CMakeLists.txt | 11 + cpp-examples/{readcsv => read_csv}/main.cc | 0 cpp-examples/read_csv/test.csv | 2 + .../CMakeLists.txt | 6 - cpp-examples/readcsv/CMakeLists.txt | 17 - 92 files changed, 2105 insertions(+), 2282 deletions(-) create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h create mode 100644 cpp-client/deephaven/client/include/public/deephaven/client/column/array_column_source.h create mode 100644 cpp-client/deephaven/client/src/column/array_column_source.cc delete mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/README.md rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/allocator.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/array.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/base.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/buffer.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/buffer_ref.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/default_allocator.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/detached_buffer.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/flatbuffer_builder.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/flatbuffers.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/stl_emulation.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/string.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/struct.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/table.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/util.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/vector.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/vector_downward.h (100%) rename cpp-client/deephaven/client/third_party/flatbuffers/{ => include/flatbuffers}/verifier.h (100%) create mode 100644 cpp-client/deephaven/client/third_party/flatbuffers/patch.001 rename cpp-client/tests/{add_drop_example.cc => add_drop_test.cc} (75%) rename cpp-client/tests/{aggregates_example.cc => aggregates_test.cc} (72%) rename cpp-client/tests/{filter_example.cc => filter_test.cc} (83%) rename cpp-client/tests/{head_and_tail_example.cc => head_and_tail_test.cc} (80%) rename cpp-client/tests/{join_example.cc => join_test.cc} (81%) rename cpp-client/tests/{lastby_example.cc => lastby_test.cc} (72%) rename cpp-client/tests/{merge_tables_example.cc => merge_tables_test.cc} (88%) rename cpp-client/tests/{new_table_example.cc => new_table_test.cc} (83%) rename cpp-client/tests/{select_example.cc => select_test.cc} (94%) rename cpp-client/tests/{sort_example.cc => sort_test.cc} (91%) rename cpp-client/tests/{string_filter_example.cc => string_filter_test.cc} (82%) rename cpp-client/tests/{ => third_party}/catch.hpp (100%) rename cpp-client/tests/{ungroup_example.cc => ungroup_test.cc} (76%) rename cpp-client/tests/{validation_example.cc => validation_test.cc} (58%) rename cpp-client/tests/{view_example.cc => view_test.cc} (81%) delete mode 100644 cpp-examples/compare_approaches/CMakeLists.txt delete mode 100644 cpp-examples/compare_approaches/main.cc delete mode 100644 cpp-examples/do_exchange/CMakeLists.txt delete mode 100644 cpp-examples/do_exchange/main.cc create mode 100644 cpp-examples/read_csv/CMakeLists.txt rename cpp-examples/{readcsv => read_csv}/main.cc (100%) create mode 100644 cpp-examples/read_csv/test.csv delete mode 100644 cpp-examples/readcsv/CMakeLists.txt diff --git a/cpp-client/deephaven/client/CMakeLists.txt b/cpp-client/deephaven/client/CMakeLists.txt index f581256e186..9567eabf0e2 100644 --- a/cpp-client/deephaven/client/CMakeLists.txt +++ b/cpp-client/deephaven/client/CMakeLists.txt @@ -44,6 +44,7 @@ set(ALL_FILES include/private/deephaven/client/impl/util.h include/private/deephaven/client/arrowutil/arrow_visitors.h + include/private/deephaven/client/arrowutil/arrow_value_converter.h src/columns.cc src/expressions.cc @@ -53,6 +54,7 @@ set(ALL_FILES src/chunk/chunk.cc src/chunk/chunk_filler.cc src/chunk/chunk_maker.cc + src/column/array_column_source.cc src/column/column_source.cc src/container/row_sequence.cc src/table/table.cc @@ -65,6 +67,7 @@ set(ALL_FILES include/public/deephaven/client/chunk/chunk.h include/public/deephaven/client/chunk/chunk_filler.h include/public/deephaven/client/chunk/chunk_maker.h + include/public/deephaven/client/column/array_column_source.h include/public/deephaven/client/column/column_source.h include/public/deephaven/client/container/row_sequence.h include/public/deephaven/client/table/table.h @@ -87,7 +90,6 @@ set(ALL_FILES src/subscription/subscribe_thread.cc src/subscription/update_processor.cc - src/immerutil/abstract_flex_vector.cc src/immerutil/immer_column_source.cc include/private/deephaven/client/immerutil/abstract_flex_vector.h @@ -108,6 +110,8 @@ set(ALL_FILES include/public/deephaven/client/utility/table_maker.h include/public/deephaven/client/utility/utility.h + flatbuf/deephaven/flatbuf/Barrage_generated.h + proto/deephaven/proto/application.grpc.pb.cc proto/deephaven/proto/application.grpc.pb.h proto/deephaven/proto/application.pb.cc @@ -141,7 +145,23 @@ set(ALL_FILES proto/deephaven/proto/ticket.pb.cc proto/deephaven/proto/ticket.pb.h - flatbuf/deephaven/flatbuf/Barrage_generated.h + third_party/flatbuffers/include/flatbuffers/allocator.h + third_party/flatbuffers/include/flatbuffers/array.h + third_party/flatbuffers/include/flatbuffers/base.h + third_party/flatbuffers/include/flatbuffers/buffer.h + third_party/flatbuffers/include/flatbuffers/buffer_ref.h + third_party/flatbuffers/include/flatbuffers/default_allocator.h + third_party/flatbuffers/include/flatbuffers/detached_buffer.h + third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h + third_party/flatbuffers/include/flatbuffers/flatbuffers.h + third_party/flatbuffers/include/flatbuffers/stl_emulation.h + third_party/flatbuffers/include/flatbuffers/string.h + third_party/flatbuffers/include/flatbuffers/struct.h + third_party/flatbuffers/include/flatbuffers/table.h + third_party/flatbuffers/include/flatbuffers/util.h + third_party/flatbuffers/include/flatbuffers/vector_downward.h + third_party/flatbuffers/include/flatbuffers/vector.h + third_party/flatbuffers/include/flatbuffers/verifier.h ) add_library(client ${ALL_FILES}) @@ -152,7 +172,7 @@ target_compile_options(client PRIVATE -Wall -Werror) target_include_directories(client PRIVATE ${Boost_INCLUDE_DIR}) target_include_directories(client PRIVATE include/private) -target_include_directories(client PRIVATE third_party) +target_include_directories(client PRIVATE third_party/flatbuffers/include) target_include_directories(client PUBLIC $) # Protos and flatbuf are doing their own thing. diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h new file mode 100644 index 00000000000..3294db399f2 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once + +#include +#include +#include +#include + +namespace deephaven::client::arrowutil { +class ArrowValueConverter { +public: + // "convert" function for anything except string_view is the identity function. + template + static void convert(SRC src, DEST *dest) { + *dest = src; + } + + // "convert" function for string_view is std::string + static void convert(arrow::util::string_view sv, std::string *dest) { + dest->clear(); + dest->append(sv.data(), sv.size()); + } + + static void convert(int64_t src, deephaven::client::DateTime *dest) { + *dest = deephaven::client::DateTime::fromNanos(src); + } +}; +} // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h index a280cc41727..927b662af00 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h @@ -4,6 +4,7 @@ #pragma once #include +#include "deephaven/client/types.h" namespace deephaven::client::arrowutil { @@ -33,21 +34,31 @@ class ArrowTypeVisitor final : public arrow::TypeVisitor { return arrow::Status::OK(); } - arrow::Status Visit(const arrow::FloatType &type) final { + arrow::Status Visit(const arrow::FloatType &) final { inner_.template operator()(); return arrow::Status::OK(); } - arrow::Status Visit(const arrow::DoubleType &type) final { + arrow::Status Visit(const arrow::DoubleType &) final { inner_.template operator()(); return arrow::Status::OK(); } - arrow::Status Visit(const arrow::StringType &type) final { + arrow::Status Visit(const arrow::BooleanType &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::StringType &) final { inner_.template operator()(); return arrow::Status::OK(); } + arrow::Status Visit(const arrow::TimestampType &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + Inner &inner() { return inner_; } const Inner &inner() const { return inner_; } @@ -96,10 +107,45 @@ class ArrowArrayTypeVisitor : public arrow::ArrayVisitor { return arrow::Status::OK(); } + arrow::Status Visit(const arrow::BooleanArray &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + + arrow::Status Visit(const arrow::TimestampArray &) final { + inner_.template operator()(); + return arrow::Status::OK(); + } + Inner &inner() { return inner_; } const Inner &inner() const { return inner_; } private: Inner inner_; }; + +/** + * Returns true iff type T is one of the numeric types. + */ +template +constexpr bool isNumericType() { + static_assert( + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v, + "T is not one of the supported element types for Deephaven columns"); + + return std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v; +} } // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h index 1c36f17b3b0..112c2306bdf 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h @@ -7,6 +7,7 @@ #include #include #include +#include "deephaven/client/arrowutil/arrow_value_converter.h" #include "deephaven/client/column/column_source.h" #include "deephaven/client/immerutil/immer_column_source.h" #include "deephaven/client/utility/utility.h" @@ -46,38 +47,53 @@ struct CorrespondingArrowArrayType { typedef arrow::DoubleArray type_t; }; +template<> +struct CorrespondingArrowArrayType { + typedef arrow::BooleanArray type_t; +}; + template<> struct CorrespondingArrowArrayType { typedef arrow::StringArray type_t; }; +template<> +struct CorrespondingArrowArrayType { + typedef arrow::TimestampArray type_t; +}; + struct FlexVectorAppender { template - static void append(const ARROW_SRC &src, immer::flex_vector *dest) { - auto transient = dest->transient(); - for (auto element : src) { - if (!element.has_value()) { - throw std::runtime_error("TODO(kosak): we are not dealing with null values yet"); - } - transient.push_back(*element); - } - *dest = transient.persistent(); - } + static void append(const ARROW_SRC &src, immer::flex_vector *destData, + immer::flex_vector *optionalDestNulls) { - static void append(const arrow::StringArray &src, immer::flex_vector *dest) { - auto transient = dest->transient(); - for (auto element : src) { - if (!element.has_value()) { - throw std::runtime_error("TODO(kosak): we are not dealing with null values yet"); + auto transientData = destData->transient(); + immer::flex_vector_transient transientNulls; + if (optionalDestNulls != nullptr) { + transientNulls = optionalDestNulls->transient(); + } + for (auto optValue : src) { + bool isNull = !optValue.has_value(); + T value = T(); + if (isNull) { + if constexpr(deephaven::client::arrowutil::isNumericType()) { + value = deephaven::client::DeephavenConstantsForType::NULL_VALUE; + } + } else { + deephaven::client::arrowutil::ArrowValueConverter::convert(*optValue, &value); } - transient.push_back(std::string(*element)); + transientData.push_back(std::move(value)); + if (optionalDestNulls != nullptr) { + transientNulls.push_back(isNull); + } + } + *destData = transientData.persistent(); + if (optionalDestNulls != nullptr) { + *optionalDestNulls = transientNulls.persistent(); } - *dest = transient.persistent(); } }; } // namespace internal -template -class AbstractFlexVector; /** * This class allows us to manipulate an immer::flex_vector without needing to know what type @@ -87,9 +103,6 @@ class AbstractFlexVectorBase { protected: typedef deephaven::client::column::ColumnSource ColumnSource; public: - template - static std::unique_ptr create(immer::flex_vector vec); - virtual ~AbstractFlexVectorBase(); virtual std::unique_ptr take(size_t n) = 0; @@ -101,12 +114,16 @@ class AbstractFlexVectorBase { }; template -class AbstractFlexVector final : public AbstractFlexVectorBase { +class NumericAbstractFlexVector final : public AbstractFlexVectorBase { public: - explicit AbstractFlexVector(immer::flex_vector vec) : vec_(std::move(vec)) {} + NumericAbstractFlexVector() = default; + + explicit NumericAbstractFlexVector(immer::flex_vector vec) : vec_(std::move(vec)) {} + + ~NumericAbstractFlexVector() final = default; std::unique_ptr take(size_t n) final { - return create(vec_.take(n)); + return std::make_unique(vec_.take(n)); } void inPlaceDrop(size_t n) final { @@ -115,21 +132,21 @@ class AbstractFlexVector final : public AbstractFlexVectorBase { } void inPlaceAppend(std::unique_ptr other) final { - auto *otherVec = deephaven::client::utility::verboseCast(other.get(), - DEEPHAVEN_PRETTY_FUNCTION); + auto *otherVec = deephaven::client::utility::verboseCast( + DEEPHAVEN_EXPR_MSG(other.get())); auto temp = std::move(vec_) + std::move(otherVec->vec_); vec_ = std::move(temp); } void inPlaceAppendArrow(const arrow::Array &data) final { typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; - auto *typedArrow = deephaven::client::utility::verboseCast(&data, - DEEPHAVEN_PRETTY_FUNCTION); - internal::FlexVectorAppender::append(*typedArrow, &vec_); + auto *typedArrow = deephaven::client::utility::verboseCast( + DEEPHAVEN_EXPR_MSG(&data)); + internal::FlexVectorAppender::append(*typedArrow, &vec_, nullptr); } std::shared_ptr makeColumnSource() const final { - return deephaven::client::immerutil::ImmerColumnSource::create(vec_); + return deephaven::client::immerutil::NumericImmerColumnSource::create(vec_); } private: @@ -137,7 +154,50 @@ class AbstractFlexVector final : public AbstractFlexVectorBase { }; template -std::unique_ptr AbstractFlexVectorBase::create(immer::flex_vector vec) { - return std::make_unique>(std::move(vec)); -} +class GenericAbstractFlexVector final : public AbstractFlexVectorBase { +public: + GenericAbstractFlexVector() = default; + + GenericAbstractFlexVector(immer::flex_vector data, immer::flex_vector nulls) : + data_(std::move(data)), nulls_(std::move(nulls)) {} + + ~GenericAbstractFlexVector() final = default; + + std::unique_ptr take(size_t n) final { + return std::make_unique(data_.take(n), nulls_.take(n)); + } + + void inPlaceDrop(size_t n) final { + auto tempData = std::move(data_).drop(n); + data_ = std::move(tempData); + + auto tempNulls = std::move(nulls_).drop(n); + nulls_ = std::move(tempNulls); + } + + void inPlaceAppend(std::unique_ptr other) final { + auto *otherVec = deephaven::client::utility::verboseCast( + DEEPHAVEN_EXPR_MSG(other.get())); + auto tempData = std::move(data_) + std::move(otherVec->data_); + data_ = std::move(tempData); + + auto tempNulls = std::move(nulls_) + std::move(otherVec->nulls_); + nulls_ = std::move(tempNulls); + } + + void inPlaceAppendArrow(const arrow::Array &data) final { + typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; + auto *typedArrow = deephaven::client::utility::verboseCast( + DEEPHAVEN_EXPR_MSG(&data)); + internal::FlexVectorAppender::append(*typedArrow, &data_, &nulls_); + } + + std::shared_ptr makeColumnSource() const final { + return deephaven::client::immerutil::GenericImmerColumnSource::create(data_, nulls_); + } + +private: + immer::flex_vector data_; + immer::flex_vector nulls_; +}; } // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h index 74881645108..fc68a6c997a 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h @@ -4,78 +4,137 @@ #pragma once #include #include +#include "deephaven/client/arrowutil/arrow_visitors.h" #include "deephaven/client/chunk/chunk.h" #include "deephaven/client/column/column_source.h" +#include "deephaven/client/types.h" #include "deephaven/client/utility/utility.h" namespace deephaven::client::immerutil { namespace internal { -struct ColumnSourceImpls { +struct ImmerColumnSourceImpls { + typedef deephaven::client::chunk::BooleanChunk BooleanChunk; typedef deephaven::client::chunk::Chunk Chunk; typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; typedef deephaven::client::container::RowSequence RowSequence; + /** + * This helper function has two dimensions of optionality: the first (controlled by whether the + * template is numeric) indicates whether (if it is numeric) "null-ness" comes from the inherent + * Deephaven notion of null-ness (the special numeric constants), or (if it is not numeric), + * it comes from a separate vector of null flags. The second dimension of optionality is + * controlled by 'optionalDestNullFlags', which indicates whether the caller cares about nullness. + * If this pointer is not null, then it points to a BooleanChunk which can hold all the null + * flags. On the other hand if this pointer is null, then the caller doesn't care about null flags + * and we don't have to do any special work to determine nullness. + */ + template - static void fillChunk(const immer::flex_vector &src, const RowSequence &rows, Chunk *dest) { + static void fillChunk(const immer::flex_vector &srcData, + const immer::flex_vector *srcNullFlags, + const RowSequence &rows, Chunk *destData, BooleanChunk *optionalDestNullFlags) { using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::trueOrThrow; using deephaven::client::utility::verboseCast; typedef typename TypeToChunk::type_t chunkType_t; - auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); - - assertLessEq(rows.size(), typedDest->size(), DEEPHAVEN_PRETTY_FUNCTION, "rows.size()", - "typedDest->size()"); - auto *destp = typedDest->data(); + auto *typedDest = verboseCast(DEEPHAVEN_EXPR_MSG(destData)); + + constexpr bool typeIsNumeric = deephaven::client::arrowutil::isNumericType(); + + trueOrThrow(DEEPHAVEN_EXPR_MSG(rows.size() <= typedDest->size())); + trueOrThrow(DEEPHAVEN_EXPR_MSG(optionalDestNullFlags == nullptr || + rows.size() <= optionalDestNullFlags->size())); + if (!typeIsNumeric) { + trueOrThrow(DEEPHAVEN_EXPR_MSG(srcNullFlags != nullptr)); + } else { + // avoid CLion warning about unused variable. + (void)srcNullFlags; + } + auto *destDatap = typedDest->data(); + auto *destNullp = optionalDestNullFlags != nullptr ? optionalDestNullFlags->data() : nullptr; - auto copyDataInner = [&destp](const T *dataBegin, const T *dataEnd) { + auto copyDataInner = [&destDatap, &destNullp](const T *dataBegin, const T *dataEnd) { for (const T *current = dataBegin; current != dataEnd; ++current) { - *destp++ = *current; + auto value = *current; + *destDatap++ = value; + if constexpr(typeIsNumeric) { + if (destNullp != nullptr) { + *destNullp++ = value == deephaven::client::DeephavenConstantsForType::NULL_VALUE; + } + } + } + }; + + auto copyNullsInner = [&destNullp](const bool *nullBegin, const bool *nullEnd) { + for (const bool *current = nullBegin; current != nullEnd; ++current) { + *destNullp++ = *current; } }; - auto copyDataOuter = [&src, ©DataInner](uint64_t srcBegin, uint64_t srcEnd) { - auto srcBeginp = src.begin() + srcBegin; - auto srcEndp = src.begin() + srcEnd; + auto copyOuter = [&srcData, srcNullFlags, destNullp, ©DataInner, + ©NullsInner](uint64_t srcBegin, uint64_t srcEnd) { + auto srcBeginp = srcData.begin() + srcBegin; + auto srcEndp = srcData.begin() + srcEnd; immer::for_each_chunk(srcBeginp, srcEndp, copyDataInner); + + if constexpr(!typeIsNumeric) { + if (destNullp != nullptr) { + auto nullsBeginp = srcNullFlags->begin() + srcBegin; + auto nullsEndp = srcNullFlags->begin() + srcEnd; + immer::for_each_chunk(nullsBeginp, nullsEndp, copyNullsInner); + } + } }; - rows.forEachChunk(copyDataOuter); + rows.forEachChunk(copyOuter); } template - static void fillChunkUnordered(const immer::flex_vector &src, const UInt64Chunk &rowKeys, - Chunk *dest) { + static void fillChunkUnordered(const immer::flex_vector &srcData, + const immer::flex_vector *srcNullFlags, + const UInt64Chunk &rowKeys, Chunk *destData, BooleanChunk *optionalDestNullFlags) { using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; + using deephaven::client::utility::trueOrThrow; using deephaven::client::utility::verboseCast; typedef typename TypeToChunk::type_t chunkType_t; - auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); - assertLessEq(rowKeys.size(), typedDest->size(), DEEPHAVEN_PRETTY_FUNCTION, "rowKeys.size()", - "typedDest->size()"); + constexpr bool typeIsNumeric = deephaven::client::arrowutil::isNumericType(); + + auto *typedDest = verboseCast(DEEPHAVEN_EXPR_MSG(destData)); + trueOrThrow(DEEPHAVEN_EXPR_MSG(rowKeys.size() <= typedDest->size())); + trueOrThrow(DEEPHAVEN_EXPR_MSG(optionalDestNullFlags == nullptr || + rowKeys.size() <= optionalDestNullFlags->size())); + if (!typeIsNumeric) { + trueOrThrow(DEEPHAVEN_EXPR_MSG(srcNullFlags != nullptr)); + } auto *destp = typedDest->data(); + auto *destNullp = optionalDestNullFlags != nullptr ? optionalDestNullFlags->data() : nullptr; - // Note: Uses random access with Immer, which is rather more expensive than iterating + // Note: Uses random access with Immer, which is significantly more expensive than iterating // over contiguous Immer ranges. for (auto key : rowKeys) { - *destp++ = src[key]; + auto value = srcData[key]; + *destp++ = value; + if (destNullp != nullptr) { + if constexpr(typeIsNumeric) { + *destNullp++ = value == deephaven::client::DeephavenConstantsForType::NULL_VALUE; + } else { + *destNullp++ = (*srcNullFlags)[key]; + } + } } } }; } // namespace internal class ImmerColumnSource : public virtual deephaven::client::column::ColumnSource { -public: - template - static std::shared_ptr create(immer::flex_vector vec); - - static std::shared_ptr create(immer::flex_vector vec); }; template -class ImmerNumericColumnSource final : public ImmerColumnSource, +class NumericImmerColumnSource final : public ImmerColumnSource, public deephaven::client::column::NumericColumnSource, - std::enable_shared_from_this> { + std::enable_shared_from_this> { + struct Private {}; typedef deephaven::client::chunk::Chunk Chunk; typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; @@ -83,15 +142,23 @@ class ImmerNumericColumnSource final : public ImmerColumnSource, typedef deephaven::client::container::RowSequence RowSequence; public: - explicit ImmerNumericColumnSource(immer::flex_vector data) : data_(std::move(data)) {} - ~ImmerNumericColumnSource() final = default; + static std::shared_ptr create(immer::flex_vector data) { + return std::make_shared(Private(), std::move(data)); + } + + explicit NumericImmerColumnSource(Private, immer::flex_vector data) : data_(std::move(data)) {} + + ~NumericImmerColumnSource() final = default; - void fillChunk(const RowSequence &rows, Chunk *dest) const final { - internal::ColumnSourceImpls::fillChunk(data_, rows, dest); + void fillChunk(const RowSequence &rows, Chunk *destData, BooleanChunk *optionalDestNullFlags) const final { + internal::ImmerColumnSourceImpls::fillChunk(data_, nullptr, rows, destData, + optionalDestNullFlags); } - void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final { - internal::ColumnSourceImpls::fillChunkUnordered(data_, rowKeys, dest); + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *destData, + BooleanChunk *optionalDestNullFlags) const final { + internal::ImmerColumnSourceImpls::fillChunkUnordered(data_, nullptr, rowKeys, destData, + optionalDestNullFlags); } void acceptVisitor(ColumnSourceVisitor *visitor) const final { @@ -106,37 +173,43 @@ class ImmerNumericColumnSource final : public ImmerColumnSource, immer::flex_vector data_; }; -class ImmerStringColumnSource final : public ImmerColumnSource, - public deephaven::client::column::StringColumnSource, - std::enable_shared_from_this { +template +class GenericImmerColumnSource final : public ImmerColumnSource, + public deephaven::client::column::GenericColumnSource, + std::enable_shared_from_this> { + struct Private {}; typedef deephaven::client::column::ColumnSourceVisitor ColumnSourceVisitor; public: - explicit ImmerStringColumnSource(immer::flex_vector data) : data_(std::move(data)) {} - ~ImmerStringColumnSource() final = default; + static std::shared_ptr create(immer::flex_vector data, + immer::flex_vector nullFlags) { + return std::make_shared(Private(), std::move(data), std::move(nullFlags)); + } + + GenericImmerColumnSource(Private, immer::flex_vector &&data, immer::flex_vector &&nullFlags) : + data_(std::move(data)), nullFlags_(std::move(nullFlags)) {} + ~GenericImmerColumnSource() final = default; - void fillChunk(const RowSequence &rows, Chunk *dest) const final { - internal::ColumnSourceImpls::fillChunk(data_, rows, dest); + void fillChunk(const RowSequence &rows, Chunk *dest, BooleanChunk *optionalDestNullFlags) const final { + internal::ImmerColumnSourceImpls::fillChunk(data_, &nullFlags_, rows, dest, + optionalDestNullFlags); } - void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final { - internal::ColumnSourceImpls::fillChunkUnordered(data_, rowKeys, dest); + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest, + BooleanChunk *optionalDestNullFlags) const final { + internal::ImmerColumnSourceImpls::fillChunkUnordered(data_, &nullFlags_, rowKeys, dest, + optionalDestNullFlags); } void acceptVisitor(ColumnSourceVisitor *visitor) const final { visitor->visit(*this); } + std::any backdoor() const final { + return &data_; + } + private: - immer::flex_vector data_; + immer::flex_vector data_; + immer::flex_vector nullFlags_; }; - -template -std::shared_ptr ImmerColumnSource::create(immer::flex_vector vec) { - return std::make_shared>(std::move(vec)); -} - -inline std::shared_ptr ImmerColumnSource::create( - immer::flex_vector vec) { - return std::make_shared(std::move(vec)); -} } // namespace deephaven::client::immerutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h index f4c6a208f38..d567548337d 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h @@ -176,8 +176,7 @@ class TableHandleImpl { void bindToVariableAsync(std::string variable, std::shared_ptr> callback); - std::shared_ptr subscribe(std::shared_ptr callback, - bool wantImmer); + std::shared_ptr subscribe(std::shared_ptr callback); void unsubscribe(std::shared_ptr handle); // For debugging diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h index 9cbff87760f..dfc5ad373ca 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h @@ -15,7 +15,7 @@ class BatchParser { BatchParser() = delete; static void parseBatches( - const ColumnDefinitions &colDefs, + size_t expectedNumCols, size_t numBatches, bool allowInconsistentColumnSizes, arrow::flight::FlightStreamReader *fsr, diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h index d3c42f3f583..1a9ff4241d2 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/classic_table_state.h @@ -16,6 +16,7 @@ class ClassicTableState final { typedef deephaven::client::column::ColumnSource ColumnSource; typedef deephaven::client::column::MutableColumnSource MutableColumnSource; typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::table::Schema Schema; typedef deephaven::client::table::Table Table; typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; @@ -43,6 +44,7 @@ class ClassicTableState final { private: UInt64Chunk modifyKeysHelper(const RowSequence &rowsToModifyKeySpace); + std::shared_ptr schema_; std::vector> columns_; std::shared_ptr> redirection_; /** diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h index 83d44429a44..7c1c86aa70e 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h @@ -16,11 +16,12 @@ class ImmerTableState final { typedef deephaven::client::column::ColumnSource ColumnSource; typedef deephaven::client::container::RowSequence RowSequence; typedef deephaven::client::immerutil::AbstractFlexVectorBase AbstractFlexVectorBase; + typedef deephaven::client::table::Schema Schema; typedef deephaven::client::table::Table Table; typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; public: - explicit ImmerTableState(const ColumnDefinitions &colDefs); + explicit ImmerTableState(std::shared_ptr colDefs); ~ImmerTableState(); std::shared_ptr addKeys(const RowSequence &rowsToAddKeySpace); @@ -44,6 +45,8 @@ class ImmerTableState final { std::unique_ptr modifiedData, const RowSequence &rowsToModifyKeySpace); + std::shared_ptr colDefs_; + std::shared_ptr schema_; std::vector> flexVectors_; // Keeps track of keyspace -> index space mapping SpaceMapper spaceMapper_; diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h index 04999199aba..004e20cff0c 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/subscribe_thread.h @@ -16,6 +16,5 @@ std::shared_ptr startSubscribeThread( deephaven::client::utility::Executor *flightExecutor, std::shared_ptr columnDefinitions, const io::deephaven::proto::backplane::grpc::Ticket &ticket, - std::shared_ptr callback, - bool wantImmer); + std::shared_ptr callback); } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h index 959b719bd33..7bed257455a 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h @@ -3,6 +3,7 @@ */ #pragma once +#include #include #include #include "deephaven/client/ticking.h" @@ -17,8 +18,7 @@ class UpdateProcessor final { static std::shared_ptr startThread( std::unique_ptr fsr, std::shared_ptr colDefs, - std::shared_ptr callback, - bool wantImmer); + std::shared_ptr callback); UpdateProcessor(std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback); @@ -27,13 +27,13 @@ class UpdateProcessor final { void cancel(); private: - static void runForever(const std::shared_ptr &self, bool wantImmer); - void classicRunForeverHelper(); - void immerRunForeverHelper(); + static void runForever(const std::shared_ptr &self); + void runForeverHelper(); public: std::unique_ptr fsr_; std::shared_ptr colDefs_; std::shared_ptr callback_; + std::atomic cancelled_; }; } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h b/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h index ceb16de63df..a0b94dac782 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/utility/misc.h @@ -22,6 +22,8 @@ class ColumnDefinitions { const map_t &map() const { return map_; } + size_t size() const { return vec_.size(); } + private: vec_t vec_; map_t map_; diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h index 479e162bc30..1f1d6d61642 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h @@ -7,6 +7,7 @@ #include #include #include +#include "deephaven/client/types.h" #include "deephaven/client/utility/utility.h" namespace deephaven::client::chunk { @@ -63,6 +64,7 @@ class GenericChunk final : public Chunk { std::shared_ptr data_; }; +typedef GenericChunk BooleanChunk; typedef GenericChunk Int8Chunk; typedef GenericChunk Int16Chunk; typedef GenericChunk Int32Chunk; @@ -71,13 +73,14 @@ typedef GenericChunk UInt64Chunk; typedef GenericChunk FloatChunk; typedef GenericChunk DoubleChunk; typedef GenericChunk StringChunk; +typedef GenericChunk DateTimeChunk; /** * Typesafe union of all the Chunk types. */ class AnyChunk { - typedef std::variant variant_t; + typedef std::variant variant_t; public: template @@ -145,7 +148,9 @@ class ChunkVisitor { virtual void visit(const UInt64Chunk &) const = 0; virtual void visit(const FloatChunk &) const = 0; virtual void visit(const DoubleChunk &) const = 0; + virtual void visit(const BooleanChunk &) const = 0; virtual void visit(const StringChunk &) const = 0; + virtual void visit(const DateTimeChunk &) const = 0; }; template @@ -186,8 +191,18 @@ struct TypeToChunk { typedef deephaven::client::chunk::DoubleChunk type_t; }; +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::BooleanChunk type_t; +}; + template<> struct TypeToChunk { typedef deephaven::client::chunk::StringChunk type_t; }; + +template<> +struct TypeToChunk { + typedef deephaven::client::chunk::DateTimeChunk type_t; +}; } // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h index 9ea7f499c31..c47902b315b 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk_filler.h @@ -13,6 +13,7 @@ namespace deephaven::client::chunk { class ChunkFiller { typedef deephaven::client::container::RowSequence RowSequence; public: - static void fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *dest); + static void fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *destData, + BooleanChunk *optionalDestNullFlags); }; } // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/client.h b/cpp-client/deephaven/client/include/public/deephaven/client/client.h index a88d36231c9..4fa7686becc 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/client.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/client.h @@ -1081,12 +1081,9 @@ class TableHandle { std::shared_ptr getFlightStreamReader() const; /** - * Early unstable interface to subscribe/unsubscribe to ticking tables. This interface supports - * append-only tables and will call back with an error if the table changes in a way that is not - * append-only. + * Subscribe to a ticking table. */ - std::shared_ptr subscribe(std::shared_ptr callback, - bool wantImmer); + std::shared_ptr subscribe(std::shared_ptr callback); /** * Unsubscribe from the table. */ diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/column/array_column_source.h b/cpp-client/deephaven/client/include/public/deephaven/client/column/array_column_source.h new file mode 100644 index 00000000000..eeb8d21004a --- /dev/null +++ b/cpp-client/deephaven/client/include/public/deephaven/client/column/array_column_source.h @@ -0,0 +1,325 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ + +#pragma once + +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/types.h" + +namespace deephaven::client::column { +namespace internal { +// A central place to put the implementations for the similar-but-not-identical +// fill{,From}Chunk{,Unordered} implementations for the various column source types. + +struct ColumnSourceImpls { + typedef deephaven::client::chunk::BooleanChunk BooleanChunk; + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + + template + static void fillChunk(const RowSequence &rows, + Chunk *dest, BooleanChunk *optionalNullFlags, const BACKING_STORE &backingStore) { + using deephaven::client::utility::trueOrThrow; + using deephaven::client::utility::verboseCast; + + auto *typedDest = verboseCast(DEEPHAVEN_EXPR_MSG(dest)); + trueOrThrow(DEEPHAVEN_EXPR_MSG(rows.size() <= typedDest->size())); + auto *destData = typedDest->data(); + auto *destNull = optionalNullFlags != nullptr ? optionalNullFlags->data() : nullptr; + size_t destIndex = 0; + auto applyChunk = [destData, destNull, &backingStore, &destIndex] + (uint64_t begin, uint64_t end) { + for (auto srcIndex = begin; srcIndex != end; ++srcIndex) { + auto [value, isNull] = backingStore.get(srcIndex); + destData[destIndex] = std::move(value); + if (destNull != nullptr) { + destNull[destIndex] = isNull; + } + ++destIndex; + } + }; + rows.forEachChunk(applyChunk); + } + + template + static void fillChunkUnordered( + const UInt64Chunk &rowKeys, Chunk *dest, BooleanChunk *optionalNullFlags, + const BACKING_STORE &backingStore) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::trueOrThrow; + using deephaven::client::utility::verboseCast; + + auto *typedDest = verboseCast(DEEPHAVEN_EXPR_MSG(dest)); + trueOrThrow(DEEPHAVEN_EXPR_MSG(rowKeys.size() <= typedDest->size())); + const uint64_t *keys = rowKeys.data(); + auto *destData = typedDest->data(); + auto *destNull = optionalNullFlags != nullptr ? optionalNullFlags->data() : nullptr; + + for (size_t destIndex = 0; destIndex < rowKeys.size(); ++destIndex) { + auto srcIndex = keys[destIndex]; + auto [value, isNull] = backingStore.get(srcIndex); + destData[destIndex] = std::move(value); + if (destNull != nullptr) { + destNull[destIndex] = isNull; + } + } + } + + template + static void fillFromChunk(const Chunk &src, const BooleanChunk *optionalSrcNullFlags, + const RowSequence &rows, BACKING_STORE *backingStore) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::trueOrThrow; + using deephaven::client::utility::verboseCast; + + const auto *typedSrc = verboseCast(DEEPHAVEN_EXPR_MSG(&src)); + trueOrThrow(DEEPHAVEN_EXPR_MSG(rows.size() <= typedSrc->size())); + + const auto *srcData = typedSrc->data(); + const auto *nullData = optionalSrcNullFlags != nullptr ? optionalSrcNullFlags->data() : nullptr; + size_t srcIndex = 0; + auto applyChunk = [srcData, &srcIndex, nullData, backingStore](uint64_t begin, uint64_t end) { + backingStore->ensureCapacity(end); + for (auto destIndex = begin; destIndex != end; ++destIndex) { + auto value = srcData[srcIndex]; + auto forceNull = nullData != nullptr && nullData[srcIndex]; + backingStore->set(destIndex, value, forceNull); + ++srcIndex; + } + }; + rows.forEachChunk(applyChunk); + } + + template + static void fillFromChunkUnordered(const Chunk &src, const BooleanChunk *optionalSrcNullFlags, + const UInt64Chunk &rowKeys, BACKING_STORE *backingStore) { + using deephaven::client::chunk::TypeToChunk; + using deephaven::client::utility::trueOrThrow; + using deephaven::client::utility::verboseCast; + + const auto *typedSrc = verboseCast(DEEPHAVEN_EXPR_MSG(&src)); + trueOrThrow(DEEPHAVEN_EXPR_MSG(rowKeys.size() <= typedSrc->size())); + trueOrThrow(DEEPHAVEN_EXPR_MSG(optionalSrcNullFlags == nullptr || + rowKeys.size() <= optionalSrcNullFlags->size())); + + const auto *keyData = rowKeys.data(); + const auto *srcData = typedSrc->data(); + const auto *nullData = optionalSrcNullFlags != nullptr ? optionalSrcNullFlags->data() : nullptr; + for (size_t srcIndex = 0; srcIndex < typedSrc->size(); ++srcIndex) { + auto destIndex = keyData[srcIndex]; + backingStore->ensureCapacity(destIndex + 1); + auto value = srcData[srcIndex]; + auto forceNull = nullData != nullptr && nullData[srcIndex]; + backingStore->set(destIndex, value, forceNull); + } + } + +}; + +class BackingStoreBase { +protected: + void assertIndexValid(size_t index) const; + + template + void growIfNeeded(size_t requestedCapacity, std::unique_ptr *data, + std::unique_ptr *optionalNullFlags) { + if (requestedCapacity <= capacity_) { + return; + } + auto oldCapacity = capacity_; + // sad + if (capacity_ == 0) { + capacity_ = 1; + } + while (capacity_ < requestedCapacity) { + capacity_ *= 2; + } + + auto newData = std::make_unique(capacity_); + auto newNullFlags = + optionalNullFlags != nullptr ? std::make_unique(capacity_) : nullptr; + std::copy( + std::make_move_iterator(data->get()), + std::make_move_iterator(data->get() + oldCapacity), + newData.get()); + *data = std::move(newData); + if (optionalNullFlags != nullptr) { + std::copy(optionalNullFlags->get(), + optionalNullFlags->get() + oldCapacity, + newNullFlags.get()); + *optionalNullFlags = std::move(newNullFlags); + } + } + + size_t capacity_ = 0; +}; + +/** + * This is the backing store used for the numeric types, which have the property that "null" is + * represented by a special Deephaven constant. + */ +template +class NumericBackingStore : public BackingStoreBase { +public: + NumericBackingStore() { + data_ = std::make_unique(0); + } + + std::tuple get(size_t index) const { + assertIndexValid(index); + auto value = data_[index]; + auto isNull = value == deephaven::client::DeephavenConstantsForType::NULL_VALUE; + return std::make_tuple(value, isNull); + } + + void set(size_t index, T value, bool forceNull) { + assertIndexValid(index); + if (forceNull) { + value = deephaven::client::DeephavenConstantsForType::NULL_VALUE; + } + data_[index] = value; + } + + void ensureCapacity(size_t requestedCapacity) { + growIfNeeded(requestedCapacity, &data_, nullptr); + } + +private: + std::unique_ptr data_; +}; + +/** + * This is the backing store used for other types like std::string, bool, and DateTime, which track + * the "null" flag explicitly. + */ +template +class GenericBackingStore : public BackingStoreBase { +public: + GenericBackingStore() { + data_ = std::make_unique(0); + } + + std::tuple get(size_t index) const { + assertIndexValid(index); + auto value = data_[index]; + auto isNull = isNull_[index]; + return std::make_tuple(value, isNull); + } + + void set(size_t index, T value, bool forceNull) { + assertIndexValid(index); + data_[index] = std::move(value); + isNull_[index] = forceNull; + } + + void ensureCapacity(size_t requestedCapacity) { + growIfNeeded(requestedCapacity, &data_, &isNull_); + } + +private: + std::unique_ptr data_; + std::unique_ptr isNull_; +}; +} // namespace internal + +template +class NumericArrayColumnSource final : public MutableNumericColumnSource, + std::enable_shared_from_this> { + struct Private { + }; + typedef deephaven::client::chunk::BooleanChunk BooleanChunk; + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + static std::shared_ptr create() { + return std::make_shared>(Private()); + } + + explicit NumericArrayColumnSource(Private) {} + + ~NumericArrayColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest, + BooleanChunk *optionalNullFlags) const final { + typedef typename deephaven::client::chunk::TypeToChunk::type_t chunkType_t; + internal::ColumnSourceImpls::fillChunk(rows, dest, optionalNullFlags, data_); + } + + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest, + BooleanChunk *optionalNullFlags) const final { + typedef typename deephaven::client::chunk::TypeToChunk::type_t chunkType_t; + internal::ColumnSourceImpls::fillChunkUnordered(rowKeys, dest, optionalNullFlags, data_); + } + + void fillFromChunk(const Chunk &src, const BooleanChunk *optionalNullFlags, + const RowSequence &rows) final { + typedef typename deephaven::client::chunk::TypeToChunk::type_t chunkType_t; + internal::ColumnSourceImpls::fillFromChunk(src, optionalNullFlags, rows, &data_); + } + + void fillFromChunkUnordered(const Chunk &src, + const BooleanChunk *optionalNullFlags, const UInt64Chunk &rowKeys) final { + typedef typename deephaven::client::chunk::TypeToChunk::type_t chunkType_t; + internal::ColumnSourceImpls::fillFromChunkUnordered(src, optionalNullFlags, + rowKeys, &data_); + } + + void acceptVisitor(ColumnSourceVisitor *visitor) const final { + visitor->visit(*this); + } + +private: + internal::NumericBackingStore data_; +}; + +template +class GenericArrayColumnSource final : public MutableGenericColumnSource, + std::enable_shared_from_this> { + struct Private { + }; + typedef deephaven::client::chunk::BooleanChunk BooleanChunk; + typedef deephaven::client::chunk::Chunk Chunk; + typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; + typedef deephaven::client::container::RowSequence RowSequence; + +public: + static std::shared_ptr create() { + return std::make_shared(Private()); + } + + explicit GenericArrayColumnSource(Private) {} + ~GenericArrayColumnSource() final = default; + + void fillChunk(const RowSequence &rows, Chunk *dest, BooleanChunk *optionalDestNullFlags) const final { + internal::ColumnSourceImpls::fillChunk(rows, dest, optionalDestNullFlags, data_); + } + + void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest, + BooleanChunk *optionalDestNullFlags) const final { + internal::ColumnSourceImpls::fillChunkUnordered(rowKeys, dest, + optionalDestNullFlags, data_); + } + + void fillFromChunk(const Chunk &src, const BooleanChunk *optionalSrcNullFlags, + const RowSequence &rows) final { + internal::ColumnSourceImpls::fillFromChunk(src, optionalSrcNullFlags, rows, &data_); + } + + void fillFromChunkUnordered(const Chunk &src, const BooleanChunk *optionalSrcNullFlags, + const UInt64Chunk &rowKeys) final { + internal::ColumnSourceImpls::fillFromChunkUnordered(src, optionalSrcNullFlags, + rowKeys, &data_); + } + + void acceptVisitor(ColumnSourceVisitor *visitor) const final { + visitor->visit(*this); + } + +private: + internal::GenericBackingStore data_; +}; +} // namespace deephaven::client::column diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h b/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h index b1dfa14cc21..94d7543845b 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/column/column_source.h @@ -9,6 +9,7 @@ #include #include "deephaven/client/chunk/chunk.h" #include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/types.h" #include "deephaven/client/utility/utility.h" namespace deephaven::client::column { @@ -17,6 +18,7 @@ class ColumnSourceVisitor; // the column source interfaces class ColumnSource { protected: + typedef deephaven::client::chunk::BooleanChunk BooleanChunk; typedef deephaven::client::chunk::Chunk Chunk; typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; typedef deephaven::client::container::RowSequence RowSequence; @@ -24,11 +26,17 @@ class ColumnSource { public: virtual ~ColumnSource(); - virtual void fillChunk(const RowSequence &rows, Chunk *dest) const = 0; - virtual void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const = 0; + virtual void fillChunk(const RowSequence &rows, Chunk *destData, + BooleanChunk *optionalDestNullFlags) const = 0; + virtual void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest, + BooleanChunk *optionalDestNullFlags) const = 0; virtual void acceptVisitor(ColumnSourceVisitor *visitor) const = 0; + /** + * Temporary access to some implementation-defined subclass information. Used for debugging and + * until we finalize the API. + */ virtual std::any backdoor() const { return 0; } @@ -38,8 +46,10 @@ class MutableColumnSource : public virtual ColumnSource { public: ~MutableColumnSource() override; - virtual void fillFromChunk(const Chunk &src, const RowSequence &rows) = 0; - virtual void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) = 0; + virtual void fillFromChunk(const Chunk &src, const BooleanChunk *optionalSrcNullFlags, + const RowSequence &rows) = 0; + virtual void fillFromChunkUnordered(const Chunk &srcData, + const BooleanChunk *optionalSrcNullFlags, const UInt64Chunk &rowKeys) = 0; }; // the per-type interfaces @@ -47,8 +57,9 @@ template class NumericColumnSource : public virtual ColumnSource { }; -// TODO(kosak): it's not obvious to me that String needs to be handled separately. -class StringColumnSource : public virtual ColumnSource { +// the per-type interfaces +template +class GenericColumnSource : public virtual ColumnSource { }; // convenience typedefs @@ -59,157 +70,19 @@ typedef NumericColumnSource Int64ColumnSource; typedef NumericColumnSource FloatColumnSource; typedef NumericColumnSource DoubleColumnSource; +typedef GenericColumnSource BooleanColumnSource; +typedef GenericColumnSource StringColumnSource; +typedef GenericColumnSource DateTimeColumnSource; + // the mutable per-type interfaces template class MutableNumericColumnSource : public NumericColumnSource, public MutableColumnSource { }; -class MutableStringColumnSource : public StringColumnSource, public MutableColumnSource { -}; - template -class NumericArrayColumnSource final : public MutableNumericColumnSource, - std::enable_shared_from_this> { - struct Private {}; - typedef deephaven::client::chunk::Chunk Chunk; - typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; - typedef deephaven::client::container::RowSequence RowSequence; - -public: - static std::shared_ptr create(); - explicit NumericArrayColumnSource(Private) {} - ~NumericArrayColumnSource() final = default; - - void fillChunk(const RowSequence &rows, Chunk *dest) const final; - void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final; - void fillFromChunk(const Chunk &src, const RowSequence &rows) final; - void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) final; - - void acceptVisitor(ColumnSourceVisitor *visitor) const final; - -private: - void ensureSize(size_t size); - - std::vector data_; -}; - -class StringArrayColumnSource final : public MutableStringColumnSource, - std::enable_shared_from_this { - struct Private {}; - typedef deephaven::client::chunk::Chunk Chunk; - typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; - typedef deephaven::client::container::RowSequence RowSequence; - -public: - static std::shared_ptr create(); - explicit StringArrayColumnSource(Private) {} - ~StringArrayColumnSource() final = default; - - void fillChunk(const RowSequence &rows, Chunk *dest) const final; - void fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const final; - void fillFromChunk(const Chunk &src, const RowSequence &rows) final; - void fillFromChunkUnordered(const Chunk &src, const UInt64Chunk &rowKeys) final; - - void acceptVisitor(ColumnSourceVisitor *visitor) const final; - -private: - void ensureSize(size_t size); - - std::vector data_; +class MutableGenericColumnSource : public GenericColumnSource, public MutableColumnSource { }; -template -std::shared_ptr> NumericArrayColumnSource::create() { - return std::make_shared>(Private()); -} - -template -void NumericArrayColumnSource::fillChunk(const RowSequence &rows, Chunk *dest) const { - using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; - using deephaven::client::utility::verboseCast; - typedef typename TypeToChunk::type_t chunkType_t; - - auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); - // assert rows.size() <= typedDest->size() - assertLessEq(rows.size(), typedDest->size(), "rows.size()", "typedDest->size()", __PRETTY_FUNCTION__); - - size_t destIndex = 0; - auto applyChunk = [this, typedDest, &destIndex](uint64_t begin, uint64_t end) { - // assert end <= data_.size() - assertLessEq(end, data_.size(), "end", "data_.size()", __PRETTY_FUNCTION__); - for (auto current = begin; current != end; ++current) { - typedDest->data()[destIndex] = data_[current]; - ++destIndex; - } - }; - rows.forEachChunk(applyChunk); -} - -template -void NumericArrayColumnSource::fillChunkUnordered(const UInt64Chunk &rowKeys, Chunk *dest) const { - using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; - using deephaven::client::utility::verboseCast; - typedef typename TypeToChunk::type_t chunkType_t; - - auto *typedDest = verboseCast(dest, DEEPHAVEN_PRETTY_FUNCTION); - // assert size <= dest->capacity() - assertLessEq(rowKeys.size(), typedDest->size(), "rowKeys.size()", "typedDest->size()", __PRETTY_FUNCTION__); - - for (size_t i = 0; i < rowKeys.size(); ++i) { - auto srcIndex = rowKeys.data()[i]; - assertLessEq(srcIndex, data_.size(), "srcIndex", "data_.size()", DEEPHAVEN_PRETTY_FUNCTION); - typedDest->data()[i] = this->data_[srcIndex]; - } -} - -template -void NumericArrayColumnSource::fillFromChunk(const Chunk &src, const RowSequence &rows) { - using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; - using deephaven::client::utility::verboseCast; - typedef typename TypeToChunk::type_t chunkType_t; - - const auto *typedSrc = verboseCast(&src, DEEPHAVEN_PRETTY_FUNCTION); - assertLessEq(rows.size(), typedSrc->size(), "rows.size()", "src.size()", __PRETTY_FUNCTION__); - - const auto *srcp = typedSrc->data(); - auto applyChunk = [this, &srcp](uint64_t begin, uint64_t end) { - ensureSize(end); - for (auto current = begin; current != end; ++current) { - data_[current] = *srcp++; - } - }; - rows.forEachChunk(applyChunk); -} - -template -void NumericArrayColumnSource::fillFromChunkUnordered(const Chunk &src, - const UInt64Chunk &rowKeys) { - using deephaven::client::chunk::TypeToChunk; - using deephaven::client::utility::assertLessEq; - using deephaven::client::utility::verboseCast; - typedef typename TypeToChunk::type_t chunkType_t; - - const auto *typedSrc = verboseCast(&src, DEEPHAVEN_PRETTY_FUNCTION); - // assert rowKeys.size() <= src.capacity() - assertLessEq(typedSrc->size(), rowKeys.size(), "src.size()", "rowKeys.size()", __PRETTY_FUNCTION__); - - for (size_t i = 0; i < typedSrc->size(); ++i) { - auto destIndex = rowKeys.data()[i]; - ensureSize(destIndex + 1); - data_[destIndex] = typedSrc->data()[i]; - } -} - -template -void NumericArrayColumnSource::ensureSize(size_t size) { - if (size > data_.size()) { - data_.resize(size); - } -} - class ColumnSourceVisitor { public: virtual void visit(const Int8ColumnSource &) = 0; @@ -218,11 +91,8 @@ class ColumnSourceVisitor { virtual void visit(const Int64ColumnSource &) = 0; virtual void visit(const FloatColumnSource &) = 0; virtual void visit(const DoubleColumnSource &) = 0; + virtual void visit(const BooleanColumnSource &) = 0; virtual void visit(const StringColumnSource &) = 0; + virtual void visit(const DateTimeColumnSource &) = 0; }; - -template -void NumericArrayColumnSource::acceptVisitor(ColumnSourceVisitor *visitor) const { - visitor->visit(*this); -} } // namespace deephaven::client::column diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h b/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h index 3fe3b0cdaf3..2d098bf2446 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/container/row_sequence.h @@ -20,7 +20,7 @@ class RowSequence { virtual ~RowSequence(); - virtual std::shared_ptr getRowSequenceIterator() const = 0; + RowSequenceIterator getRowSequenceIterator() const; virtual std::shared_ptr take(size_t size) const = 0; virtual std::shared_ptr drop(size_t size) const = 0; @@ -37,9 +37,21 @@ class RowSequence { }; class RowSequenceIterator { + static constexpr size_t chunkSize = 8192; + struct Private {}; public: - virtual ~RowSequenceIterator(); - virtual bool tryGetNext(uint64_t *result) = 0; + explicit RowSequenceIterator(std::shared_ptr rowSequence); + RowSequenceIterator(RowSequenceIterator &&other) noexcept; + ~RowSequenceIterator(); + bool tryGetNext(uint64_t *result); + +private: + void refillRanges(); + + std::shared_ptr residual_; + std::vector> ranges_; + size_t rangeIndex_ = 0; + uint64_t offset_ = 0; }; class RowSequenceBuilder { diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h index 7482c0864ff..da83426efcf 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h @@ -10,6 +10,46 @@ #include "deephaven/client/container/row_sequence.h" namespace deephaven::client::table { +class Table; + +namespace internal { +class TableStreamAdaptor { + typedef deephaven::client::container::RowSequence RowSequence; +public: + TableStreamAdaptor(const Table &table, + std::vector> rowSequences, bool wantHeaders, bool wantRowNumbers, + bool highlightCells) : table_(table), rowSequences_(std::move(rowSequences)), + wantHeaders_(wantHeaders), wantRowNumbers_(wantRowNumbers), highlightCells_(highlightCells) {} + TableStreamAdaptor(const TableStreamAdaptor &) = delete; + TableStreamAdaptor &operator=(const TableStreamAdaptor &) = delete; + ~TableStreamAdaptor() = default; + +private: + const Table &table_; + std::vector> rowSequences_; + bool wantHeaders_ = false; + bool wantRowNumbers_ = false; + bool highlightCells_ = false; + + friend std::ostream &operator<<(std::ostream &s, const TableStreamAdaptor &o); +}; +} // namespace internal + +class Schema { +public: + explicit Schema(std::vector>> columns); + Schema(Schema &&other) noexcept; + Schema &operator=(Schema &&other) noexcept; + ~Schema(); + + const std::vector>> &columns() const { + return columns_; + } + +private: + std::vector>> columns_; +}; + class Table { protected: typedef deephaven::client::column::ColumnSource ColumnSource; @@ -22,7 +62,19 @@ class Table { virtual std::shared_ptr getRowSequence() const = 0; virtual std::shared_ptr getColumn(size_t columnIndex) const = 0; + std::shared_ptr getColumn(std::string_view name, bool strict) const; + virtual size_t numRows() const = 0; virtual size_t numColumns() const = 0; + + virtual const Schema &schema() const = 0; + + internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers) const; + + internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers, + std::shared_ptr rowSequence) const; + + internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers, + std::vector> rowSequences) const; }; -} // namespace deephaven::client::highlevel::table +} // namespace deephaven::client::table diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h b/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h index 10ff74e4eb9..fbbbe491a85 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/ticking.h @@ -13,111 +13,55 @@ #include "immer/flex_vector.hpp" namespace deephaven::client { -class ClassicTickingUpdate; -class ImmerTickingUpdate; +class TickingUpdate; class TickingCallback : public deephaven::client::utility::FailureCallback { public: - /** - * @param update An update message which describes the changes (removes, adds, modifies) that - * transform the previous version of the table to the new version. This class is *shared* with - * the caller and so the receiving code will block the caller while it is using it. - */ - virtual void onTick(const ClassicTickingUpdate &update) = 0; /** * @param update An update message which describes the changes (removes, adds, modifies) that * transform the previous version of the table to the new version. This class is threadsafe and * can be kept around for an arbitrary amount of time. On the other hand, it probably should be * processed and discard quickly so that the underlying resources can be reused. */ - virtual void onTick(ImmerTickingUpdate update) = 0; + virtual void onTick(TickingUpdate update) = 0; }; -class ClassicTickingUpdate final { +class TickingUpdate final { protected: - typedef deephaven::client::chunk::UInt64Chunk UInt64Chunk; - typedef deephaven::client::column::ColumnSource ColumnSource; typedef deephaven::client::container::RowSequence RowSequence; typedef deephaven::client::table::Table Table; public: - ClassicTickingUpdate(std::shared_ptr removedRowsKeySpace, - UInt64Chunk removedRowsIndexSpace, - std::shared_ptr addedRowsKeySpace, - UInt64Chunk addedRowsIndexSpace, - std::vector> modifiedRowsKeySpace, - std::vector modifiedRowsIndexSpace, - std::shared_ptr

    currentTableKeySpace, - std::shared_ptr
    currentTableIndexSpace); - ClassicTickingUpdate(ClassicTickingUpdate &&other) noexcept; - ClassicTickingUpdate &operator=(ClassicTickingUpdate &&other) noexcept; - ~ClassicTickingUpdate(); + TickingUpdate(std::shared_ptr
    prev, + std::shared_ptr removedRows, std::shared_ptr
    afterRemoves, + std::shared_ptr addedRows, std::shared_ptr
    afterAdds, + std::vector> modifiedRows, std::shared_ptr
    afterModifies); + TickingUpdate(TickingUpdate &&other) noexcept; + TickingUpdate &operator=(TickingUpdate &&other) noexcept; + ~TickingUpdate(); - const std::shared_ptr &removedRowsKeySpace() const { return removedRowsKeySpace_; } - const UInt64Chunk &removedRowsIndexSpace() const { return removedRowsIndexSpace_; } - const std::shared_ptr &addedRowsKeySpace() const { return addedRowsKeySpace_; } - const UInt64Chunk &addedRowsIndexSpace() const { return addedRowsIndexSpace_; } - const std::vector> &modifiedRowsKeySpace() const { return modifiedRowsKeySpace_; } - const std::vector &modifiedRowsIndexSpace() const { return modifiedRowsIndexSpace_; } - const std::shared_ptr
    ¤tTableKeySpace() const { return currentTableKeySpace_; } - const std::shared_ptr
    ¤tTableIndexSpace() const { return currentTableIndexSpace_; } - -private: - // In the pre-shift key space - std::shared_ptr removedRowsKeySpace_; - // In the pre-shift index space - UInt64Chunk removedRowsIndexSpace_; - // In the post-shift key space - std::shared_ptr addedRowsKeySpace_; - // In the post-shift index space - UInt64Chunk addedRowsIndexSpace_; - // In the post-shift key space - std::vector> modifiedRowsKeySpace_; - // In the post-shift index space - std::vector modifiedRowsIndexSpace_; + const std::shared_ptr
    &prev() const { return prev_; } - std::shared_ptr
    currentTableKeySpace_; - std::shared_ptr
    currentTableIndexSpace_; -}; + const std::shared_ptr
    &beforeRemoves() const { return prev_; } + const std::shared_ptr &removedRows() const { return removedRows_; } + const std::shared_ptr
    &afterRemoves() const { return afterRemoves_; } -class ImmerTickingUpdate final { -protected: - typedef deephaven::client::container::RowSequence RowSequence; - typedef deephaven::client::table::Table Table; + const std::shared_ptr
    &beforeAdds() const { return afterRemoves_; } + const std::shared_ptr &addedRows() const { return addedRows_; } + const std::shared_ptr
    &afterAdds() const { return afterAdds_; } -public: - ImmerTickingUpdate(std::shared_ptr
    beforeRemoves, - std::shared_ptr
    beforeModifies, - std::shared_ptr
    current, - std::shared_ptr removed, - std::vector> modified, - std::shared_ptr added); - ImmerTickingUpdate(ImmerTickingUpdate &&other) noexcept; - ImmerTickingUpdate &operator=(ImmerTickingUpdate &&other) noexcept; - ~ImmerTickingUpdate(); + const std::shared_ptr
    &beforeModifies() const { return afterAdds_; } + const std::vector> &modifiedRows() const { return modifiedRows_; } + const std::shared_ptr
    &afterModifies() const { return afterModifies_; } - // Note: the table is flat. - const std::shared_ptr
    &beforeRemoves() const { return beforeRemoves_; } - // Note: the table is flat. - const std::shared_ptr
    &beforeModifies() const { return beforeModifies_; } - // Note: the table is flat. - const std::shared_ptr
    ¤t() const { return current_; } - // In the key space of 'prevTable' - const std::shared_ptr &removed() const { return removed_; } - // In the key space of 'current' - const std::vector> &modified() const { return modified_; } - // In the key space of 'current' - const std::shared_ptr &added() const { return added_; } + const std::shared_ptr
    ¤t() const { return afterModifies_; } private: - std::shared_ptr
    beforeRemoves_; - std::shared_ptr
    beforeModifies_; - std::shared_ptr
    current_; - // In the key space of 'beforeRemoves_' - std::shared_ptr removed_; - // In the key space of beforeModifies_ and current_, which have the same key space. - // Old values are in beforeModifies_; new values are in current_. - std::vector> modified_; - // In the key space of current_. - std::shared_ptr added_; + std::shared_ptr
    prev_; + std::shared_ptr removedRows_; + std::shared_ptr
    afterRemoves_; + std::shared_ptr addedRows_; + std::shared_ptr
    afterAdds_; + std::vector> modifiedRows_; + std::shared_ptr
    afterModifies_; }; } // namespace deephaven::client diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/types.h b/cpp-client/deephaven/client/include/public/deephaven/client/types.h index 0228ffcbb5b..e315e25dd7a 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/types.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/types.h @@ -4,9 +4,9 @@ #pragma once #include +#include #include #include -#include namespace deephaven::client { class DeephavenConstants { @@ -54,6 +54,39 @@ class DeephavenConstants { static constexpr const int64_t MAX_LONG = std::numeric_limits::max(); }; +template +struct DeephavenConstantsForType {}; + +template<> +struct DeephavenConstantsForType { + static constexpr const int8_t NULL_VALUE = DeephavenConstants::NULL_BYTE; +}; + +template<> +struct DeephavenConstantsForType { + static constexpr const int16_t NULL_VALUE = DeephavenConstants::NULL_SHORT; +}; + +template<> +struct DeephavenConstantsForType { + static constexpr const int32_t NULL_VALUE = DeephavenConstants::NULL_INT; +}; + +template<> +struct DeephavenConstantsForType { + static constexpr const int64_t NULL_VALUE = DeephavenConstants::NULL_LONG; +}; + +template<> +struct DeephavenConstantsForType { + static constexpr const float NULL_VALUE = DeephavenConstants::NULL_FLOAT; +}; + +template<> +struct DeephavenConstantsForType { + static constexpr const double NULL_VALUE = DeephavenConstants::NULL_DOUBLE; +}; + /** * The Deephaven DateTime type. Records nanoseconds relative to the epoch (January 1, 1970) UTC. * Times before the epoch can be represented with negative nanosecond values. diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h index 14ec0496b20..a260f8d6286 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h @@ -25,9 +25,6 @@ std::vector makeReservedVector(size_t n) { return v; } -void assertLessEq(size_t lhs, size_t rhs, std::string_view context, std::string_view lhsName, - std::string_view rhsName); - // A more efficient ostringstream that also allows you to grab the internal buffer if you want it. // Or, if you don't want to use the internal buffer, it allows you to provide your own. class SimpleOstringstream final : private std::basic_streambuf, public std::ostream { @@ -214,7 +211,7 @@ constexpr std::string_view getTypeName() { } template -DESTP verboseCast(SRCP ptr, std::string_view caller) { +DESTP verboseCast(const DebugInfo &debugInfo, SRCP ptr) { using deephaven::client::utility::stringf; auto *typedPtr = dynamic_cast(ptr); @@ -223,21 +220,19 @@ DESTP verboseCast(SRCP ptr, std::string_view caller) { } typedef decltype(*std::declval()) destType_t; auto message = stringf("%o: Expected type %o. Got type %o", - caller, getTypeName(), typeid(*ptr).name()); + debugInfo, getTypeName(), typeid(*ptr).name()); throw std::runtime_error(message); } -/** - * TODO(kosak): Do something else here. Maybe. - */ -template -void assertLessEq(const T &lhs, const T &rhs, std::string_view lhsText, std::string_view rhsText, - std::string_view func) { - if (lhs <= rhs) { +namespace internal { +void trueOrThrowHelper(const DebugInfo &debugInfo); +} // namespace internal + +inline void trueOrThrow(const DebugInfo &debugInfo, bool value) { + if (value) { return; } - throw std::runtime_error(stringf("assertion failed: %o: %o <= %o (%o <= %o)", func, lhs, rhs, - lhsText, rhsText)); + internal::trueOrThrowHelper(debugInfo); } /** diff --git a/cpp-client/deephaven/client/src/chunk/chunk_filler.cc b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc index b49c2cb3e20..999ab8de090 100644 --- a/cpp-client/deephaven/client/src/chunk/chunk_filler.cc +++ b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc @@ -3,48 +3,85 @@ */ #include "deephaven/client/chunk/chunk_filler.h" +#include "deephaven/client/arrowutil/arrow_visitors.h" +#include "deephaven/client/arrowutil/arrow_value_converter.h" #include "deephaven/client/container/row_sequence.h" #include "deephaven/client/impl/util.h" +#include "deephaven/client/types.h" #include "deephaven/client/utility/utility.h" +using deephaven::client::arrowutil::isNumericType; +using deephaven::client::arrowutil::ArrowValueConverter; +using deephaven::client::container::RowSequence; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::stringf; using deephaven::client::utility::verboseCast; -using deephaven::client::container::RowSequence; namespace deephaven::client::chunk { namespace { struct Visitor final : arrow::ArrayVisitor { - Visitor(const RowSequence &keys, Chunk *dest) : keys_(keys), dest_(dest) {} + Visitor(const RowSequence &keys, Chunk *destData, BooleanChunk *optionalDestNullFlags) : + keys_(keys), destData_(destData), optionalDestNullFlags_(optionalDestNullFlags) {} + + arrow::Status Visit(const arrow::Int8Array &array) final { + return fillChunk(array); + } + + arrow::Status Visit(const arrow::Int16Array &array) final { + return fillChunk(array); + } arrow::Status Visit(const arrow::Int32Array &array) final { - return fillNumericChunk(array); + return fillChunk(array); } arrow::Status Visit(const arrow::Int64Array &array) final { - return fillNumericChunk(array); + return fillChunk(array); } - arrow::Status Visit(const arrow::UInt64Array &array) final { - return fillNumericChunk(array); + arrow::Status Visit(const arrow::FloatArray &array) final { + return fillChunk(array); } arrow::Status Visit(const arrow::DoubleArray &array) final { - return fillNumericChunk(array); + return fillChunk(array); + } + + arrow::Status Visit(const arrow::StringArray &array) final { + return fillChunk(array); + } + + arrow::Status Visit(const arrow::BooleanArray &array) final { + return fillChunk(array); } template - arrow::Status fillNumericChunk(const TArrowAray &array) { - auto *typedDest = verboseCast*>(dest_, DEEPHAVEN_PRETTY_FUNCTION); + arrow::Status fillChunk(const TArrowAray &array) { + auto *typedDest = verboseCast*>(DEEPHAVEN_EXPR_MSG(destData_)); + auto *destDatap = typedDest->data(); + auto *destNullp = optionalDestNullFlags_ != nullptr ? optionalDestNullFlags_->data() : nullptr; checkSize(typedDest->size()); size_t destIndex = 0; - auto copyChunk = [&destIndex, &array, typedDest](uint64_t begin, uint64_t end) { - for (auto current = begin; current != end; ++current) { - if (array.IsNull(current)) { - throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Not handling nulls yet")); + + auto copyChunk = + [&array, destDatap, destNullp, &destIndex](uint64_t begin, uint64_t end) { + auto beginp = array.begin() + begin; + auto endp = array.begin() + end; + for (auto currentp = beginp; currentp != endp; ++currentp) { + auto optValue = *currentp; + bool isNull = !optValue.has_value(); + T value = T(); + if (isNull) { + if constexpr(isNumericType()) { + value = deephaven::client::DeephavenConstantsForType::NULL_VALUE; + } + } else { + ArrowValueConverter::convert(*optValue, &value); + } + destDatap[destIndex] = std::move(value); + if (destNullp != nullptr) { + destNullp[destIndex] = isNull; } - auto val = array.Value((int64_t)current); - typedDest->data()[destIndex] = val; ++destIndex; } }; @@ -60,12 +97,14 @@ struct Visitor final : arrow::ArrayVisitor { } const RowSequence &keys_; - Chunk *const dest_; + Chunk *const destData_ = nullptr; + BooleanChunk *const optionalDestNullFlags_ = nullptr; }; } // namespace -void ChunkFiller::fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *dest) { - Visitor visitor(keys, dest); +void ChunkFiller::fillChunk(const arrow::Array &src, const RowSequence &keys, Chunk *destData, + BooleanChunk *optionalDestNullFlags) { + Visitor visitor(keys, destData, optionalDestNullFlags); okOrThrow(DEEPHAVEN_EXPR_MSG(src.Accept(&visitor))); } } // namespace deephaven::client::chunk diff --git a/cpp-client/deephaven/client/src/chunk/chunk_maker.cc b/cpp-client/deephaven/client/src/chunk/chunk_maker.cc index a8287ee14a9..16e6faf46e6 100644 --- a/cpp-client/deephaven/client/src/chunk/chunk_maker.cc +++ b/cpp-client/deephaven/client/src/chunk/chunk_maker.cc @@ -6,6 +6,7 @@ #include "deephaven/client/column/column_source.h" using deephaven::client::column::ColumnSourceVisitor; +using deephaven::client::column::DateTimeColumnSource; using deephaven::client::column::DoubleColumnSource; using deephaven::client::column::FloatColumnSource; using deephaven::client::column::Int8ColumnSource; @@ -43,10 +44,18 @@ struct Visitor final : ColumnSourceVisitor { result_ = DoubleChunk::create(chunkSize_); } + void visit(const column::BooleanColumnSource &source) final { + result_ = BooleanChunk::create(chunkSize_); + } + void visit(const StringColumnSource &source) final { result_ = StringChunk::create(chunkSize_); } + void visit(const DateTimeColumnSource &source) final { + result_ = DateTimeChunk::create(chunkSize_); + } + size_t chunkSize_; AnyChunk result_; }; diff --git a/cpp-client/deephaven/client/src/client.cc b/cpp-client/deephaven/client/src/client.cc index 1afeb93bba8..457b2beb19d 100644 --- a/cpp-client/deephaven/client/src/client.cc +++ b/cpp-client/deephaven/client/src/client.cc @@ -522,8 +522,8 @@ std::shared_ptr TableHandle::getFlightStreamR } std::shared_ptr TableHandle::subscribe( - std::shared_ptr callback, bool wantImmer) { - return impl_->subscribe(std::move(callback), wantImmer); + std::shared_ptr callback) { + return impl_->subscribe(std::move(callback)); } void TableHandle::unsubscribe(std::shared_ptr callback) { diff --git a/cpp-client/deephaven/client/src/column/array_column_source.cc b/cpp-client/deephaven/client/src/column/array_column_source.cc new file mode 100644 index 00000000000..7ea15d1f71c --- /dev/null +++ b/cpp-client/deephaven/client/src/column/array_column_source.cc @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/column/array_column_source.h" + +namespace deephaven::client::column { + +using deephaven::client::utility::trueOrThrow; + +namespace internal { +void BackingStoreBase::assertIndexValid(size_t index) const { + trueOrThrow(DEEPHAVEN_EXPR_MSG(index < capacity_)); +} +} // namespace internal +} // namespace deephaven::client::column diff --git a/cpp-client/deephaven/client/src/container/row_sequence.cc b/cpp-client/deephaven/client/src/container/row_sequence.cc index a1b20478da9..be437a5b256 100644 --- a/cpp-client/deephaven/client/src/container/row_sequence.cc +++ b/cpp-client/deephaven/client/src/container/row_sequence.cc @@ -7,24 +7,47 @@ using deephaven::client::utility::stringf; namespace deephaven::client::container { +namespace { +class SequentialRowSequence final : public RowSequence { +public: + static std::shared_ptr create(uint64_t begin, uint64_t end); + + SequentialRowSequence(uint64_t begin, uint64_t end) : begin_(begin), end_(end) {} + + std::shared_ptr take(size_t size) const final; + std::shared_ptr drop(size_t size) const final; + void forEachChunk(const std::function &f) const final; + + size_t size() const final { + return end_ - begin_; + } + +private: + uint64_t begin_ = 0; + uint64_t end_ = 0; +}; +} // namespace + std::shared_ptr RowSequence::createEmpty() { return RowSequenceBuilder().build(); } std::shared_ptr RowSequence::createSequential(uint64_t begin, uint64_t end) { - RowSequenceBuilder builder; - builder.addRange(begin, end); - return builder.build(); + return SequentialRowSequence::create(begin, end); } RowSequence::~RowSequence() = default; +RowSequenceIterator RowSequence::getRowSequenceIterator() const { + return RowSequenceIterator(drop(0)); +} + std::ostream &operator<<(std::ostream &s, const RowSequence &o) { s << '['; auto iter = o.getRowSequenceIterator(); const char *sep = ""; uint64_t item; - while (iter->tryGetNext(&item)) { + while (iter.tryGetNext(&item)) { s << sep << item; sep = ", "; } @@ -32,6 +55,46 @@ std::ostream &operator<<(std::ostream &s, const RowSequence &o) { return s; } +RowSequenceIterator::RowSequenceIterator(std::shared_ptr rowSequence) : + residual_(std::move(rowSequence)) {} +RowSequenceIterator::RowSequenceIterator(RowSequenceIterator &&other) noexcept = default; +RowSequenceIterator::~RowSequenceIterator() = default; + +bool RowSequenceIterator::tryGetNext(uint64_t *result) { + while (true) { + if (rangeIndex_ == ranges_.size()) { + rangeIndex_ = 0; + refillRanges(); + if (ranges_.empty()) { + return false; + } + continue; + } + + const auto &range = ranges_[rangeIndex_]; + auto rangeSize = range.second - range.first; + if (offset_ == rangeSize) { + ++rangeIndex_; + offset_ = 0; + continue; + } + + *result = range.first + offset_; + ++offset_; + return true; + } +} + +void RowSequenceIterator::refillRanges() { + auto thisChunk = residual_->take(chunkSize); + residual_ = residual_->drop(chunkSize); + ranges_.clear(); + auto addRange = [this](uint64_t beginKey, uint64_t endKey) { + ranges_.emplace_back(beginKey, endKey); + }; + thisChunk->forEachChunk(addRange); +} + namespace { class MyRowSequence final : public RowSequence { // begin->end @@ -40,12 +103,11 @@ class MyRowSequence final : public RowSequence { MyRowSequence(std::shared_ptr ranges, ranges_t::const_iterator beginp, size_t entryOffset, size_t size); ~MyRowSequence() final = default; - std::shared_ptr getRowSequenceIterator() const final; std::shared_ptr take(size_t size) const final; std::shared_ptr drop(size_t size) const final; - void forEachChunk(const std::function &f) const final; + void forEachChunk(const std::function &f) const final; size_t size() const final { return size_; @@ -57,30 +119,15 @@ class MyRowSequence final : public RowSequence { size_t entryOffset_ = 0; size_t size_ = 0; }; - -class MyRowSequenceIterator final : public RowSequenceIterator { - typedef std::map ranges_t; -public: - MyRowSequenceIterator(std::shared_ptr ranges, ranges_t::const_iterator currentp, - size_t currentOffset, size_t size); - ~MyRowSequenceIterator() final = default; - bool tryGetNext(uint64_t *result) final; - -private: - std::shared_ptr ranges_; - ranges_t::const_iterator current_; - size_t currentOffset_ = 0; - size_t size_ = 0; -}; } // namespace -RowSequenceIterator::~RowSequenceIterator() = default; RowSequenceBuilder::RowSequenceBuilder() = default; RowSequenceBuilder::~RowSequenceBuilder() = default; void RowSequenceBuilder::addRange(uint64_t begin, uint64_t end) { if (begin > end) { - throw std::runtime_error(stringf("Malformed range [%o,%o)", begin, end)); + auto message = stringf("Malformed range [%o,%o)", begin, end); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } if (begin == end) { @@ -180,10 +227,6 @@ MyRowSequence::MyRowSequence(std::shared_ptr ranges, ranges_t::const_i size_t entryOffset, size_t size) : ranges_(std::move(ranges)), beginp_(beginp), entryOffset_(entryOffset), size_(size) {} -std::shared_ptr MyRowSequence::getRowSequenceIterator() const { - return std::make_shared(ranges_, beginp_, entryOffset_, size_); -} - std::shared_ptr MyRowSequence::take(size_t size) const { auto newSize = std::min(size, size_); return std::make_shared(ranges_, beginp_, entryOffset_, newSize); @@ -232,24 +275,22 @@ void MyRowSequence::forEachChunk(const std::function ranges, - ranges_t::const_iterator current, size_t currentOffset, size_t size) : - ranges_(std::move(ranges)), current_(current), currentOffset_(currentOffset), size_(size) {} - -bool MyRowSequenceIterator::tryGetNext(uint64_t *result) { - while (size_ != 0) { - auto entrySize = current_->second - current_->first; - if (currentOffset_ < entrySize) { - *result = current_->first + currentOffset_; - ++currentOffset_; - --size_; - return true; - } - currentOffset_ = 0; - ++current_; - } - return false; +std::shared_ptr SequentialRowSequence::create(uint64_t begin, uint64_t end) { + return std::make_shared(begin, end); +} + +std::shared_ptr SequentialRowSequence::take(size_t size) const { + auto sizeToUse = std::min(size, this->size()); + return create(begin_, begin_ + sizeToUse); +} + +std::shared_ptr SequentialRowSequence::drop(size_t size) const { + auto sizeToUse = std::min(size, this->size()); + return create(begin_ + sizeToUse, end_); +} + +void SequentialRowSequence::forEachChunk(const std::function &f) const { + f(begin_, end_); } } // namespace } // namespace deephaven::client::container - diff --git a/cpp-client/deephaven/client/src/impl/table_handle_impl.cc b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc index 22e917f441e..439f63981d4 100644 --- a/cpp-client/deephaven/client/src/impl/table_handle_impl.cc +++ b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc @@ -340,7 +340,7 @@ std::shared_ptr TableHandleImpl::asOfJoin(AsOfJoinTablesRequest } std::shared_ptr TableHandleImpl::subscribe( - std::shared_ptr callback, bool wantImmer) { + std::shared_ptr callback) { // On the flight executor thread, we invoke DoExchange (waiting for a successful response). // We wait for that response here. That makes the first part of this call synchronous. If there // is an error in the DoExchange invocation, the caller will get an exception here. The @@ -348,7 +348,7 @@ std::shared_ptr TableHandleImpl::subscribe( // parsing of all the replies) is done on a newly-created thread dedicated to that job. auto colDefs = lazyState_->getColumnDefinitions(); auto handle = startSubscribeThread(managerImpl_->server(), managerImpl_->flightExecutor().get(), - colDefs, ticket_, std::move(callback), wantImmer); + colDefs, ticket_, std::move(callback)); subscriptions_.insert(handle); return handle; diff --git a/cpp-client/deephaven/client/src/subscription/batch_parser.cc b/cpp-client/deephaven/client/src/subscription/batch_parser.cc index 804fb1063e8..a5bec484f24 100644 --- a/cpp-client/deephaven/client/src/subscription/batch_parser.cc +++ b/cpp-client/deephaven/client/src/subscription/batch_parser.cc @@ -13,13 +13,12 @@ using deephaven::client::utility::stringf; namespace deephaven::client::subscription { // Processes all of the adds in this add batch. Will invoke (numAdds - 1) additional calls to GetNext(). void BatchParser::parseBatches( - const ColumnDefinitions &colDefs, + size_t expectedNumCols, size_t numBatches, bool allowInconsistentColumnSizes, arrow::flight::FlightStreamReader *fsr, arrow::flight::FlightStreamChunk *flightStreamChunk, const std::function> &)> &callback) { - auto colDefsSize = colDefs.vec().size(); if (numBatches == 0) { return; } @@ -27,22 +26,20 @@ void BatchParser::parseBatches( while (true) { const auto &srcCols = flightStreamChunk->data->columns(); auto ncols = srcCols.size(); - if (ncols != colDefsSize) { - throw std::runtime_error(stringf("Received %o columns, but my table has %o columns", ncols, - colDefsSize)); + if (ncols != expectedNumCols) { + auto message = stringf("Expected %o columns, got %o", expectedNumCols, ncols); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } if (!allowInconsistentColumnSizes) { auto numRows = srcCols[0]->length(); for (size_t i = 1; i < ncols; ++i) { const auto &srcColArrow = *srcCols[i]; - // I think you do not want this check for the modify case. When you are parsing modify - // messages, the columns may indeed be of different sizes. if (srcColArrow.length() != numRows) { auto message = stringf( "Inconsistent column lengths: Column 0 has %o rows, but column %o has %o rows", numRows, i, srcColArrow.length()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } } } diff --git a/cpp-client/deephaven/client/src/subscription/classic_table_state.cc b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc index 6fd2aa4141b..48a2f8fb4b2 100644 --- a/cpp-client/deephaven/client/src/subscription/classic_table_state.cc +++ b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc @@ -4,20 +4,28 @@ #include "deephaven/client/subscription/classic_table_state.h" #include +#include "deephaven/client/arrowutil/arrow_visitors.h" #include "deephaven/client/chunk/chunk_filler.h" #include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/column/array_column_source.h" #include "deephaven/client/container/row_sequence.h" #include "deephaven/client/subscription/shift_processor.h" #include "deephaven/client/utility/utility.h" +using deephaven::client::arrowutil::ArrowTypeVisitor; +using deephaven::client::arrowutil::isNumericType; +using deephaven::client::chunk::BooleanChunk; using deephaven::client::chunk::ChunkFiller; using deephaven::client::chunk::ChunkMaker; using deephaven::client::chunk::UInt64Chunk; using deephaven::client::column::ColumnSource; +using deephaven::client::column::GenericArrayColumnSource; using deephaven::client::column::MutableColumnSource; using deephaven::client::column::NumericArrayColumnSource; using deephaven::client::container::RowSequence; using deephaven::client::container::RowSequenceBuilder; +using deephaven::client::table::Schema; using deephaven::client::table::Table; using deephaven::client::utility::ColumnDefinitions; using deephaven::client::utility::makeReservedVector; @@ -34,7 +42,7 @@ makeColumnSources(const ColumnDefinitions &colDefs); class TableView final : public Table { public: - TableView(std::vector> columns, + TableView(std::shared_ptr schema, std::vector> columns, std::shared_ptr> redirection); ~TableView() final; @@ -50,18 +58,25 @@ class TableView final : public Table { return redirection_->size(); } - size_t numColumns() const override { + size_t numColumns() const final { return columns_.size(); } + const Schema &schema() const final { + return *schema_; + } + private: + std::shared_ptr schema_; std::vector> columns_; std::shared_ptr> redirection_; }; class UnwrappedTableView final : public Table { public: - UnwrappedTableView(std::vector> columns, size_t numRows); + UnwrappedTableView(std::shared_ptr schema, + std::vector> columns, + size_t numRows); ~UnwrappedTableView() final; std::shared_ptr getRowSequence() const final; @@ -78,7 +93,12 @@ class UnwrappedTableView final : public Table { return columns_.size(); } + const Schema &schema() const final { + return *schema_; + } + private: + std::shared_ptr schema_; std::vector> columns_; size_t numRows_ = 0; }; @@ -154,13 +174,14 @@ void ClassicTableState::addData(const std::vector> auto ncols = data.size(); auto nrows = rowsToAddIndexSpace.size(); auto sequentialRows = RowSequence::createSequential(0, nrows); + auto nullFlags = BooleanChunk::create(nrows); for (size_t i = 0; i < ncols; ++i) { const auto &src = *data[i]; auto *dest = columns_[i].get(); auto anyChunk = ChunkMaker::createChunkFor(*dest, nrows); - auto &chunk = anyChunk.unwrap(); - ChunkFiller::fillChunk(src, *sequentialRows, &chunk); - dest->fillFromChunkUnordered(chunk, rowsToAddIndexSpace); + auto &dataChunk = anyChunk.unwrap(); + ChunkFiller::fillChunk(src, *sequentialRows, &dataChunk, &nullFlags); + dest->fillFromChunkUnordered(dataChunk, &nullFlags, rowsToAddIndexSpace); } } @@ -177,11 +198,11 @@ void ClassicTableState::applyShifts(const RowSequence &firstIndex, const RowSequ } std::shared_ptr
    ClassicTableState::snapshot() const { - return std::make_shared(columns_, redirection_); + return std::make_shared(schema_, columns_, redirection_); } std::shared_ptr
    ClassicTableState::snapshotUnwrapped() const { - return std::make_shared(columns_, redirection_->size()); + return std::make_shared(schema_, columns_, redirection_->size()); } std::vector ClassicTableState::modifyKeys( @@ -237,8 +258,9 @@ void ClassicTableState::modifyData(const std::vectorfillFromChunkUnordered(chunk, rows); + auto nullFlags = BooleanChunk::create(nrows); + ChunkFiller::fillChunk(srcArray, *sequentialRows, &chunk, &nullFlags); + destCol->fillFromChunkUnordered(chunk, &nullFlags, rows); } } @@ -293,20 +315,14 @@ void mapShifter(uint64_t begin, uint64_t end, uint64_t dest, std::map::create(); - return arrow::Status::OK(); - } - - arrow::Status Visit(const arrow::Int64Type &type) final { - columnSource_ = NumericArrayColumnSource::create(); - return arrow::Status::OK(); - } - - arrow::Status Visit(const arrow::DoubleType &type) final { - columnSource_ = NumericArrayColumnSource::create(); - return arrow::Status::OK(); +struct ColumnSourceMaker final { + template + void operator()() { + if constexpr(isNumericType()) { + columnSource_ = NumericArrayColumnSource::create(); + } else { + columnSource_ = GenericArrayColumnSource::create(); + } } std::shared_ptr columnSource_; @@ -315,25 +331,27 @@ struct MyVisitor final : public arrow::TypeVisitor { std::vector> makeColumnSources(const ColumnDefinitions &colDefs) { std::vector> result; for (const auto &[name, arrowType] : colDefs.vec()) { - MyVisitor v; + ArrowTypeVisitor v; okOrThrow(DEEPHAVEN_EXPR_MSG(arrowType->Accept(&v))); - result.push_back(v.columnSource_); + result.push_back(std::move(v.inner().columnSource_)); } return result; } -TableView::TableView(std::vector> columns, - std::shared_ptr> redirection) : columns_(std::move(columns)), - redirection_(std::move(redirection)) {} +TableView::TableView(std::shared_ptr schema, + std::vector> columns, + std::shared_ptr> redirection) : schema_(std::move(schema)), + columns_(std::move(columns)), redirection_(std::move(redirection)) {} TableView::~TableView() = default; std::shared_ptr TableView::getRowSequence() const { throw std::runtime_error("TODO(kosak)"); } -UnwrappedTableView::UnwrappedTableView(std::vector> columns, - size_t numRows) : columns_(std::move(columns)), numRows_(numRows) {} +UnwrappedTableView::UnwrappedTableView(std::shared_ptr schema, + std::vector> columns, size_t numRows) : + schema_(std::move(schema)), columns_(std::move(columns)), numRows_(numRows) {} UnwrappedTableView::~UnwrappedTableView() = default; std::shared_ptr UnwrappedTableView::getRowSequence() const { diff --git a/cpp-client/deephaven/client/src/subscription/immer_table_state.cc b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc index e7449a83ff4..f354cbc4e92 100644 --- a/cpp-client/deephaven/client/src/subscription/immer_table_state.cc +++ b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc @@ -13,11 +13,10 @@ #include "deephaven/client/immerutil/abstract_flex_vector.h" #include "deephaven/client/subscription/shift_processor.h" #include "deephaven/client/utility/utility.h" -#include "immer/flex_vector.hpp" -#include "immer/flex_vector_transient.hpp" using deephaven::client::arrowutil::ArrowTypeVisitor; using deephaven::client::arrowutil::ArrowArrayTypeVisitor; +using deephaven::client::arrowutil::isNumericType; using deephaven::client::chunk::Int64Chunk; using deephaven::client::column::ColumnSource; using deephaven::client::container::RowSequence; @@ -25,6 +24,9 @@ using deephaven::client::container::RowSequenceBuilder; using deephaven::client::container::RowSequenceIterator; using deephaven::client::subscription::ShiftProcessor; using deephaven::client::immerutil::AbstractFlexVectorBase; +using deephaven::client::immerutil::GenericAbstractFlexVector; +using deephaven::client::immerutil::NumericAbstractFlexVector; +using deephaven::client::table::Schema; using deephaven::client::table::Table; using deephaven::client::utility::ColumnDefinitions; using deephaven::client::utility::makeReservedVector; @@ -34,24 +36,32 @@ using deephaven::client::utility::stringf; namespace deephaven::client::subscription { namespace { -// void mapShifter(int64_t start, int64_t endInclusive, int64_t dest, std::map *zm); class MyTable final : public Table { public: - explicit MyTable(std::vector> sources, size_t numRows); + explicit MyTable(std::shared_ptr schema, + std::vector> sources, size_t numRows); ~MyTable() final; std::shared_ptr getRowSequence() const final; + std::shared_ptr getColumn(size_t columnIndex) const final { return sources_[columnIndex]; } + size_t numRows() const final { return numRows_; } + size_t numColumns() const final { return sources_.size(); } + const Schema &schema() const final { + return *schema_; + } + private: + std::shared_ptr schema_; std::vector> sources_; size_t numRows_ = 0; }; @@ -62,12 +72,10 @@ std::vector> makeFlexVectorsFromArrays( const std::vector> &arrays); } // namespace -//ImmerTableState::ImmerTableState(const ColumnDefinitions &colDefs) -// std::vector> flexVectors) : -// flexVectors_(std::move(flexVectors)) {} - -ImmerTableState::ImmerTableState(const ColumnDefinitions &colDefs) { - flexVectors_ = makeFlexVectorsFromColDefs(colDefs); +ImmerTableState::ImmerTableState(std::shared_ptr colDefs) : + colDefs_(std::move(colDefs)) { + schema_ = std::make_shared(colDefs_->vec()); + flexVectors_ = makeFlexVectorsFromColDefs(*colDefs_); } ImmerTableState::~ImmerTableState() = default; @@ -189,13 +197,13 @@ std::shared_ptr
    ImmerTableState::snapshot() const { for (const auto &fv : flexVectors_) { columnSources.push_back(fv->makeColumnSource()); } - return std::make_shared(std::move(columnSources), spaceMapper_.size()); + return std::make_shared(schema_, std::move(columnSources), spaceMapper_.size()); } namespace { -MyTable::MyTable(std::vector> sources, size_t numRows) : - sources_(std::move(sources)), numRows_(numRows) {} +MyTable::MyTable(std::shared_ptr schema, std::vector> sources, + size_t numRows) : schema_(std::move(schema)), sources_(std::move(sources)), numRows_(numRows) {} MyTable::~MyTable() = default; std::shared_ptr MyTable::getRowSequence() const { @@ -208,7 +216,11 @@ std::shared_ptr MyTable::getRowSequence() const { struct FlexVectorMaker final { template void operator()() { - result_ = AbstractFlexVectorBase::create(immer::flex_vector()); + if constexpr(isNumericType()) { + result_ = std::make_unique>(); + } else { + result_ = std::make_unique>(); + } } std::unique_ptr result_; diff --git a/cpp-client/deephaven/client/src/subscription/shift_processor.cc b/cpp-client/deephaven/client/src/subscription/shift_processor.cc index a0943ac4dc4..77a9fd8c400 100644 --- a/cpp-client/deephaven/client/src/subscription/shift_processor.cc +++ b/cpp-client/deephaven/client/src/subscription/shift_processor.cc @@ -2,6 +2,7 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include "deephaven/client/subscription/shift_processor.h" +#include "deephaven/client/utility/utility.h" namespace deephaven::client::subscription { void ShiftProcessor::applyShiftData(const RowSequence &firstIndex, const RowSequence &lastIndex, @@ -24,9 +25,10 @@ void ShiftProcessor::applyShiftData(const RowSequence &firstIndex, const RowSequ }; { uint64_t first, last, dest; - while (startIter->tryGetNext(&first)) { - if (!endIter->tryGetNext(&last) || !destIter->tryGetNext(&dest)) { - throw std::runtime_error("Sequences not of same size"); + while (startIter.tryGetNext(&first)) { + if (!endIter.tryGetNext(&last) || !destIter.tryGetNext(&dest)) { + const char *message = "Sequences not of same size"; + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } if (dest >= first) { positiveShifts.emplace_back(first, last, dest); diff --git a/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc index e97c770fe9b..04814213e38 100644 --- a/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc +++ b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc @@ -33,8 +33,7 @@ class SubscribeState final : public Callback<> { SubscribeState(std::shared_ptr server, std::vector ticketBytes, std::shared_ptr colDefs, std::promise> promise, - std::shared_ptr callback, - bool wantImmer); + std::shared_ptr callback); void invoke() final; private: @@ -45,7 +44,6 @@ class SubscribeState final : public Callback<> { std::shared_ptr colDefs_; std::promise> promise_; std::shared_ptr callback_; - bool wantImmer_ = false; }; // A simple extension to arrow::Buffer that owns its DetachedBuffer storage @@ -64,13 +62,12 @@ std::shared_ptr startSubscribeThread( Executor *flightExecutor, std::shared_ptr columnDefinitions, const Ticket &ticket, - std::shared_ptr callback, - bool wantImmer) { + std::shared_ptr callback) { std::promise> promise; auto future = promise.get_future(); std::vector ticketBytes(ticket.ticket().begin(), ticket.ticket().end()); auto ss = std::make_shared(std::move(server), std::move(ticketBytes), - std::move(columnDefinitions), std::move(promise), std::move(callback), wantImmer); + std::move(columnDefinitions), std::move(promise), std::move(callback)); flightExecutor->invoke(std::move(ss)); return future.get(); } @@ -78,9 +75,9 @@ std::shared_ptr startSubscribeThread( namespace { SubscribeState::SubscribeState(std::shared_ptr server, std::vector ticketBytes, std::shared_ptr colDefs, std::promise> promise, - std::shared_ptr callback, bool wantImmer) : + std::shared_ptr callback) : server_(std::move(server)), ticketBytes_(std::move(ticketBytes)), colDefs_(std::move(colDefs)), - promise_(std::move(promise)), callback_(std::move(callback)), wantImmer_(wantImmer) {} + promise_(std::move(promise)), callback_(std::move(callback)) {} void SubscribeState::invoke() { try { @@ -152,7 +149,7 @@ std::shared_ptr SubscribeState::invokeHelper() { // Run forever (until error or cancellation) auto processor = UpdateProcessor::startThread(std::move(fsr), std::move(colDefs_), - std::move(callback_), wantImmer_); + std::move(callback_)); return std::make_shared(std::move(processor)); } diff --git a/cpp-client/deephaven/client/src/subscription/update_processor.cc b/cpp-client/deephaven/client/src/subscription/update_processor.cc index 30005c264c2..98290d0fd3b 100644 --- a/cpp-client/deephaven/client/src/subscription/update_processor.cc +++ b/cpp-client/deephaven/client/src/subscription/update_processor.cc @@ -19,7 +19,6 @@ #include "deephaven/client/ticking.h" #include "deephaven/flatbuf/Barrage_generated.h" -using deephaven::client::ClassicTickingUpdate; using deephaven::client::chunk::ChunkFiller; using deephaven::client::chunk::ChunkMaker; using deephaven::client::chunk::UInt64Chunk; @@ -74,144 +73,130 @@ std::optional extractMetadata( std::shared_ptr UpdateProcessor::startThread( std::unique_ptr fsr, std::shared_ptr colDefs, - std::shared_ptr callback, - bool wantImmer) { + std::shared_ptr callback) { auto result = std::make_shared(std::move(fsr), std::move(colDefs), std::move(callback)); - std::thread t(&UpdateProcessor::runForever, result, wantImmer); + std::thread t(&UpdateProcessor::runForever, result); t.detach(); return result; } UpdateProcessor::UpdateProcessor(std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback) : - fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)) {} + fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)), + cancelled_(false) {} UpdateProcessor::~UpdateProcessor() = default; void UpdateProcessor::cancel() { + cancelled_ = true; fsr_->Cancel(); } -void UpdateProcessor::runForever(const std::shared_ptr &self, bool wantImmer) { +void UpdateProcessor::runForever(const std::shared_ptr &self) { std::cerr << "UpdateProcessor is starting.\n"; std::exception_ptr eptr; try { - if (wantImmer) { - self->immerRunForeverHelper(); - } else { - self->classicRunForeverHelper(); - } + self->runForeverHelper(); } catch (...) { - eptr = std::current_exception(); - self->callback_->onFailure(eptr); + // If the thread was been cancelled via explicit user action, then swallow all errors. + if (!self->cancelled_) { + eptr = std::current_exception(); + self->callback_->onFailure(eptr); + } } - std::cerr << "UpdateProcessor is exiting.\n"; } -void UpdateProcessor::classicRunForeverHelper() { - ClassicTableState state(*colDefs_); - - // In this loop we process Arrow Flight messages until error or cancellation. - arrow::flight::FlightStreamChunk flightStreamChunk; - while (true) { - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); +std::pair, std::shared_ptr
    > processRemoves( + const std::shared_ptr
    &beforeRemoves, ImmerTableState *state, + const ExtractedMetadata &md) { + if (md.removedRows_->empty()) { + auto empty = RowSequence::createEmpty(); + auto afterRemoves = beforeRemoves; + return {std::move(empty), std::move(afterRemoves)}; + } - // Parse all the metadata out of the Barrage message before we advance the cursor past it. - auto mdo = extractMetadata(flightStreamChunk); - if (!mdo.has_value()) { - continue; - } - auto &md = *mdo; + auto removedRowsIndexSpace = state->erase(*md.removedRows_); + auto afterRemoves = state->snapshot(); + return {std::move(removedRowsIndexSpace), std::move(afterRemoves)}; +} - // Correct order to process all this info is: - // 1. removes - // 2. shifts - // 3. adds - // 4. modifies +std::pair, std::shared_ptr
    > processAdds( + const std::shared_ptr
    &beforeAdds, ImmerTableState *state, + const ExtractedMetadata &md, size_t numCols, + arrow::flight::FlightStreamReader *fsr, arrow::flight::FlightStreamChunk *flightStreamChunk) { + if (md.numAdds_ == 0) { + auto empty = RowSequence::createEmpty(); + auto afterAdds = beforeAdds; + return {std::move(empty), std::move(afterAdds)}; + } - // 1. Removes - auto removedRowsKeySpace = std::move(md.removedRows_); - auto removedRowsIndexSpace = state.erase(*removedRowsKeySpace); + auto addedRowsIndexSpace = state->addKeys(*md.addedRows_); - // 2. Shifts - state.applyShifts(*md.shiftStartIndex_, *md.shiftEndIndex_, *md.shiftDestIndex_); + // Copy everything. + auto rowsRemaining = addedRowsIndexSpace->take(addedRowsIndexSpace->size()); - // 3. Adds - auto addedRowsKeySpace = RowSequence::createEmpty(); - auto addedRowsIndexSpace = UInt64Chunk::create(0); - if (md.numAdds_ != 0) { - addedRowsKeySpace = std::move(md.addedRows_); - addedRowsIndexSpace = state.addKeys(*addedRowsKeySpace); - - // Copy everything. - auto rowsRemaining = addedRowsIndexSpace.take(addedRowsIndexSpace.size()); - - auto processAddBatch = [&state, &rowsRemaining]( - const std::vector> &data) { - if (data.empty()) { - return; - } - auto size = data[0]->length(); - auto rowsToAddThisTime = rowsRemaining.take(size); - rowsRemaining = rowsRemaining.drop(size); - state.addData(data, rowsToAddThisTime); - }; - BatchParser::parseBatches(*colDefs_, md.numAdds_, false, fsr_.get(), &flightStreamChunk, - processAddBatch); - - if (md.numMods_ != 0) { - // Currently the FlightStreamReader is pointing to the last add record. We need to advance - // it so it points to the first mod record. - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); - } + auto processAddBatch = [state, &rowsRemaining]( + const std::vector> &data) { + if (data.empty()) { + return; } + auto size = data[0]->length(); + auto rowsToAddThisTime = rowsRemaining->take(size); + rowsRemaining = rowsRemaining->drop(size); + state->addData(data, *rowsToAddThisTime); + }; + BatchParser::parseBatches(numCols, md.numAdds_, false, fsr, flightStreamChunk, + processAddBatch); + + if (md.numMods_ != 0) { + // Currently the FlightStreamReader is pointing to the last add record. We need to advance + // it so it points to the first mod record. + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr->Next(flightStreamChunk))); + } + auto afterAdds = state->snapshot(); + return {std::move(addedRowsIndexSpace), std::move(afterAdds)}; +} - auto ncols = colDefs_->vec().size(); +std::pair>, std::shared_ptr
    > processModifies( + const std::shared_ptr
    &beforeModifies, ImmerTableState *state, + const ExtractedMetadata &md, size_t numCols, arrow::flight::FlightStreamReader *fsr, + arrow::flight::FlightStreamChunk *flightStreamChunk) { + if (md.numMods_ == 0) { + auto afterModifies = beforeModifies; + return {{}, std::move(afterModifies)}; + } + auto modifiedRowsIndexSpace = state->modifyKeys(md.modifiedRows_); + // Local copy of modifiedRowsIndexSpace + auto keysRemaining = makeReservedVector>(numCols); + for (const auto &keys: modifiedRowsIndexSpace) { + keysRemaining.push_back(keys->take(keys->size())); + } - // 4. Modifies - auto modifiedRowsKeySpace = std::move(md.modifiedRows_); - auto modifiedRowsIndexSpace = state.modifyKeys(modifiedRowsKeySpace); - if (md.numMods_ != 0) { - // Local copy of modifiedRowsIndexSpace - auto keysRemaining = makeReservedVector(ncols); - for (const auto &keys : modifiedRowsIndexSpace) { - keysRemaining.push_back(keys.take(keys.size())); - } - - std::vector keysToModifyThisTime(ncols); - - auto processModifyBatch = [&state, &keysRemaining, &keysToModifyThisTime, ncols]( - const std::vector> &data) { - if (data.size() != ncols) { - throw std::runtime_error(stringf("data.size() != ncols (%o != %o)", data.size(), ncols)); - } - for (size_t i = 0; i < data.size(); ++i) { - const auto &src = data[i]; - auto &krm = keysRemaining[i]; - keysToModifyThisTime[i] = krm.take(src->length()); - krm = krm.drop(src->length()); - } - state.modifyData(data, keysToModifyThisTime); - }; - - BatchParser::parseBatches(*colDefs_, md.numMods_, true, fsr_.get(), &flightStreamChunk, - processModifyBatch); - } + std::vector> keysToModifyThisTime(numCols); - auto currentTableKeySpace = state.snapshot(); - auto currentTableIndexSpace = state.snapshotUnwrapped(); + auto processModifyBatch = [state, &keysRemaining, &keysToModifyThisTime, numCols]( + const std::vector> &data) { + if (data.size() != numCols) { + auto message = stringf("Expected % cols, got %o", numCols, data.size()); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); + } + for (size_t i = 0; i < data.size(); ++i) { + const auto &src = data[i]; + auto &krm = keysRemaining[i]; + keysToModifyThisTime[i] = krm->take(src->length()); + krm = krm->drop(src->length()); + } + state->modifyData(data, keysToModifyThisTime); + }; - ClassicTickingUpdate update(std::move(removedRowsKeySpace), std::move(removedRowsIndexSpace), - std::move(addedRowsKeySpace), std::move(addedRowsIndexSpace), - std::move(modifiedRowsKeySpace), std::move(modifiedRowsIndexSpace), - std::move(currentTableKeySpace), std::move(currentTableIndexSpace)); - callback_->onTick(update); - } + BatchParser::parseBatches(numCols, md.numMods_, true, fsr, flightStreamChunk, processModifyBatch); + auto afterModifies = state->snapshot(); + return {std::move(modifiedRowsIndexSpace), std::move(afterModifies)}; } -void UpdateProcessor::immerRunForeverHelper() { - ImmerTableState state(*colDefs_); +void UpdateProcessor::runForeverHelper() { + ImmerTableState state(colDefs_); // In this loop we process Arrow Flight messages until error or cancellation. arrow::flight::FlightStreamChunk flightStreamChunk; @@ -231,82 +216,27 @@ void UpdateProcessor::immerRunForeverHelper() { // 3. adds // 4. modifies + auto prev = state.snapshot(); + // 1. Removes - auto beforeRemoves = state.snapshot(); - auto removedRowsKeySpace = std::move(md.removedRows_); - auto removedRowsIndexSpace = state.erase(*removedRowsKeySpace); + auto [removes, afterRemoves] = processRemoves(prev, &state, md); // 2. Shifts state.applyShifts(*md.shiftStartIndex_, *md.shiftEndIndex_, *md.shiftDestIndex_); // 3. Adds - auto addedRowsKeySpace = RowSequence::createEmpty(); - auto addedRowsIndexSpace = RowSequence::createEmpty(); - if (md.numAdds_ != 0) { - addedRowsKeySpace = std::move(md.addedRows_); - addedRowsIndexSpace = state.addKeys(*addedRowsKeySpace); - - // Copy everything. - auto rowsRemaining = addedRowsIndexSpace->take(addedRowsIndexSpace->size()); - - auto processAddBatch = [&state, &rowsRemaining]( - const std::vector> &data) { - if (data.empty()) { - return; - } - auto size = data[0]->length(); - auto rowsToAddThisTime = rowsRemaining->take(size); - rowsRemaining = rowsRemaining->drop(size); - state.addData(data, *rowsToAddThisTime); - }; - BatchParser::parseBatches(*colDefs_, md.numAdds_, false, fsr_.get(), &flightStreamChunk, - processAddBatch); - - if (md.numMods_ != 0) { - // Currently the FlightStreamReader is pointing to the last add record. We need to advance - // it so it points to the first mod record. - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); - } - } - - auto beforeModifies = state.snapshot(); - - auto ncols = colDefs_->vec().size(); + auto [adds, afterAdds] = processAdds(afterRemoves, &state, md, colDefs_->size(), fsr_.get(), + &flightStreamChunk); // 4. Modifies - auto modifiedRowsKeySpace = std::move(md.modifiedRows_); - auto modifiedRowsIndexSpace = state.modifyKeys(modifiedRowsKeySpace); - if (md.numMods_ != 0) { - // Local copy of modifiedRowsIndexSpace - auto keysRemaining = makeReservedVector>(ncols); - for (const auto &keys : modifiedRowsIndexSpace) { - keysRemaining.push_back(keys->take(keys->size())); - } - - std::vector> keysToModifyThisTime(ncols); - - auto processModifyBatch = [&state, &keysRemaining, &keysToModifyThisTime, ncols]( - const std::vector> &data) { - if (data.size() != ncols) { - throw std::runtime_error(stringf("data.size() != ncols (%o != %o)", data.size(), ncols)); - } - for (size_t i = 0; i < data.size(); ++i) { - const auto &src = data[i]; - auto &krm = keysRemaining[i]; - keysToModifyThisTime[i] = krm->take(src->length()); - krm = krm->drop(src->length()); - } - state.modifyData(data, keysToModifyThisTime); - }; - - BatchParser::parseBatches(*colDefs_, md.numMods_, true, fsr_.get(), &flightStreamChunk, - processModifyBatch); - } - - auto current = state.snapshot(); - ImmerTickingUpdate update(std::move(beforeRemoves), std::move(beforeModifies), - std::move(current), std::move(removedRowsIndexSpace), std::move(modifiedRowsIndexSpace), - std::move(addedRowsIndexSpace)); + auto [modifies, afterModifies] = processModifies(afterAdds, &state, md, colDefs_->size(), + fsr_.get(), &flightStreamChunk); + + // These are convenience copies of the user which might + TickingUpdate update(std::move(prev), + std::move(removes), std::move(afterRemoves), + std::move(adds), std::move(afterAdds), + std::move(modifies), std::move(afterModifies)); callback_->onTick(std::move(update)); } } diff --git a/cpp-client/deephaven/client/src/table/table.cc b/cpp-client/deephaven/client/src/table/table.cc index d75fcbabf4c..d37228f69f7 100644 --- a/cpp-client/deephaven/client/src/table/table.cc +++ b/cpp-client/deephaven/client/src/table/table.cc @@ -3,5 +3,365 @@ */ #include "deephaven/client/table/table.h" +#include "deephaven/client/chunk/chunk_maker.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/container/row_sequence.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::chunk::AnyChunk; +using deephaven::client::chunk::BooleanChunk; +using deephaven::client::chunk::ChunkMaker; +using deephaven::client::column::ColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::container::RowSequenceIterator; +using deephaven::client::utility::makeReservedVector; +using deephaven::client::utility::separatedList; +using deephaven::client::utility::stringf; + namespace deephaven::client::table { +namespace { +void printTableData(std::ostream &stream, const Table &table, + const std::vector &whichCols, + const std::vector> &rowSequences, + bool wantHeaders, bool wantRowNumbers, bool highlightCells); +} // namespace + +std::shared_ptr Table::getColumn(std::string_view name, bool strict) const { + // TODO(kosak): improve linear search. + const auto &cols = schema().columns(); + for (size_t i = 0; i < cols.size(); ++i) { + if (cols[i].first == name) { + return getColumn(i); + } + } + // Not found: check strictness flag. + if (strict) { + auto message = stringf("Column name '%o' not found", name); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); + } + return {}; +} + +internal::TableStreamAdaptor Table::stream(bool wantHeaders, bool wantRowNumbers) const { + std::vector> rowSequences{getRowSequence()}; + return {*this, std::move(rowSequences), wantHeaders, wantRowNumbers, false}; +} + +internal::TableStreamAdaptor Table::stream(bool wantHeaders, bool wantRowNumbers, + std::shared_ptr rowSequence) const { + std::vector> rowSequences{std::move(rowSequence)}; + return {*this, std::move(rowSequences), wantHeaders, wantRowNumbers, false}; +} + +internal::TableStreamAdaptor Table::stream(bool wantHeaders, bool wantRowNumbers, + std::vector> rowSequences) const { + return {*this, std::move(rowSequences), wantHeaders, wantRowNumbers, true}; +} + +Schema::Schema(std::vector>> columns) : + columns_(std::move(columns)) {} +Schema::Schema(Schema &&other) noexcept = default; +Schema &Schema::operator=(Schema &&other) noexcept = default; +Schema::~Schema() = default; + +namespace internal { +std::ostream &operator<<(std::ostream &s, const TableStreamAdaptor &o) { + const auto &t = o.table_; + auto numCols = t.numColumns(); + auto whichCols = makeReservedVector(numCols); + for (size_t i = 0; i < numCols; ++i) { + whichCols.push_back(i); + } + printTableData(s, t, whichCols, o.rowSequences_, o.wantHeaders_, o.wantRowNumbers_, o.highlightCells_); + return s; +} +} // namespace internal + +namespace { +class ArrayRowSequence final : public RowSequence { +public: + static std::shared_ptr create(std::shared_ptr data, + const uint64_t *begin, const uint64_t *end); + + ArrayRowSequence(std::shared_ptr data, const uint64_t *begin, const uint64_t *end); + ~ArrayRowSequence() final; + + std::shared_ptr take(size_t size) const final; + std::shared_ptr drop(size_t size) const final; + void forEachChunk(const std::function &f) const final; + + size_t size() const final { + return end_ - begin_; + } + +private: + std::shared_ptr data_; + const uint64_t *begin_ = nullptr; + const uint64_t *end_ = nullptr; +}; + +class ElementStreamer final { +public: + ElementStreamer(std::ostream &s, size_t index, bool nullFlag, bool highlight) : + s_(s), index_(index), nullFlag_(nullFlag), highlight_(highlight) {} + + template + void operator()(const T &chunk) const { + if (highlight_) { + s_ << '*'; + } + + if (nullFlag_) { + s_ << "null"; + } else { + render(chunk.data()[index_]); + } + + if (highlight_) { + s_ << '*'; + } + } + +private: + template + void render(const T &item) const { + s_ << item; + } + + void render(const bool &item) const { + s_ << (item ? "true" : "false"); + } + + std::ostream &s_; + size_t index_ = 0; + bool nullFlag_ = false; + bool highlight_ = false; +}; + +struct RowSequenceState { + explicit RowSequenceState(RowSequenceIterator iterator, size_t chunkSize); + RowSequenceState(RowSequenceState &&other) noexcept; + ~RowSequenceState(); + + RowSequenceIterator iterator_; + std::optional currentValue_; + std::unique_ptr isPresent_; +}; + +class RowMerger { +public: + RowMerger(std::vector iterators, size_t chunkSize); + ~RowMerger(); + + std::shared_ptr getNextChunk(); + + bool isCellPresent(size_t colIndex, size_t chunkOffset) const; + +private: + size_t chunkSize_ = 0; + std::vector rowSequenceStates_; + /** + * This is a shared ponter because we share it with the ArrayRowSequence that we return + * from getNextChunk. size = chunkSize_ + */ + std::shared_ptr build_; +}; + +void printTableData(std::ostream &stream, const Table &table, + const std::vector &whichCols, + const std::vector> &rowSequences, + bool wantHeaders, bool wantRowNumbers, bool highlightCells) { + if (wantHeaders) { + const char *separator = ""; + if (wantRowNumbers) { + stream << "[Row]"; + separator = "\t"; + } + for (auto colIndex : whichCols) { + stream << separator << table.schema().columns()[colIndex].first; + separator = "\t"; + } + stream << std::endl; + } + + if (whichCols.empty() || rowSequences.empty()) { + return; + } + + const size_t chunkSize = 8192; + + auto numCols = whichCols.size(); + auto dataChunks = makeReservedVector(numCols); + auto nullFlagChunks = makeReservedVector(numCols); + for (size_t i = 0; i < numCols; ++i) { + const auto &c = table.getColumn(i); + auto dataChunk = ChunkMaker::createChunkFor(*c, chunkSize); + auto nullFlagChunk = BooleanChunk::create(chunkSize); + dataChunks.push_back(std::move(dataChunk)); + nullFlagChunks.push_back(std::move(nullFlagChunk)); + } + + auto iterators = makeReservedVector(rowSequences.size()); + for (const auto &rs : rowSequences) { + iterators.push_back(rs->getRowSequenceIterator()); + } + + RowMerger merger(std::move(iterators), chunkSize); + + while (true) { + auto chunkOfRows = merger.getNextChunk(); + auto thisSize = chunkOfRows->size(); + if (thisSize == 0) { + break; + } + + for (size_t i = 0; i < numCols; ++i) { + const auto colNum = whichCols[i]; + const auto &c = table.getColumn(colNum); + auto &dataChunk = dataChunks[colNum].unwrap(); + auto &nullFlagChunk = nullFlagChunks[colNum]; + c->fillChunk(*chunkOfRows, &dataChunk, &nullFlagChunk); + } + + // To print out the optional row number + auto rowsIter = chunkOfRows->getRowSequenceIterator(); + + for (size_t chunkOffset = 0; chunkOffset < thisSize; ++chunkOffset) { + const char *separator = ""; + if (wantRowNumbers) { + uint64_t rowNum; + if (!rowsIter.tryGetNext(&rowNum)) { + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Impossible: no more rows")); + } + stream << '[' << rowNum << "] "; + separator = "\t"; + } + + for (size_t i = 0; i < numCols; ++i) { + stream << separator; + separator = "\t"; + auto nullFlag = nullFlagChunks[i].data()[chunkOffset]; + auto highlight = highlightCells && merger.isCellPresent(i, chunkOffset); + ElementStreamer es(stream, chunkOffset, nullFlag, highlight); + dataChunks[i].visit(es); + } + + stream << std::endl; + } + } +} + +std::shared_ptr +ArrayRowSequence::create(std::shared_ptr data, const uint64_t *begin, + const uint64_t *end) { + return std::make_shared(std::move(data), begin, end); +} + +ArrayRowSequence::ArrayRowSequence(std::shared_ptr data, const uint64_t *begin, + const uint64_t *end) : data_(std::move(data)), begin_(begin), end_(end) {} + +ArrayRowSequence::~ArrayRowSequence() = default; + +std::shared_ptr ArrayRowSequence::take(size_t size) const { + auto sizeToUse = std::min(size, this->size()); + return create(data_, begin_, begin_ + sizeToUse); +} + +std::shared_ptr ArrayRowSequence::drop(size_t size) const { + auto sizeToUse = std::min(size, this->size()); + return create(data_, begin_ + sizeToUse, end_); +} + +void ArrayRowSequence::forEachChunk(const std::function &f) const { + const auto *rangeStart = begin_; + while (rangeStart != end_) { + auto beginKey = *rangeStart; + const auto *rangeEnd = rangeStart + 1; + auto endKey = beginKey + 1; + while (rangeEnd != end_ && *rangeEnd == endKey) { + ++rangeEnd; + ++endKey; + } + f(beginKey, endKey); + rangeStart = rangeEnd; + } +} + +RowSequenceState::RowSequenceState(RowSequenceIterator iterator, size_t chunkSize) : + iterator_(std::move(iterator)), isPresent_(std::make_unique(chunkSize)) { + uint64_t value; + if (iterator_.tryGetNext(&value)) { + currentValue_ = value; + } +} +RowSequenceState::RowSequenceState(RowSequenceState &&other) noexcept = default; +RowSequenceState::~RowSequenceState() = default; + +RowMerger::RowMerger(std::vector iterators, size_t chunkSize) : + chunkSize_(chunkSize) { + + rowSequenceStates_ = makeReservedVector(iterators.size()); + for (auto &iter : iterators) { + rowSequenceStates_.emplace_back(std::move(iter), chunkSize); + } + build_ = std::shared_ptr(new uint64_t[chunkSize]); +} + +RowMerger::~RowMerger() = default; + +std::shared_ptr RowMerger::getNextChunk() { + size_t destIndex; + uint64_t *buildp = build_.get(); + for (destIndex = 0; destIndex < chunkSize_; ++destIndex) { + // Simplistic priority queue. If performance becomes an issue, this should be rewritten as a + // legit priority queue. + + // First calculate the minimum value among the current values (if one exists) + std::optional minValue; + for (const auto &rss : rowSequenceStates_) { + const auto &cv = rss.currentValue_; + if (!cv.has_value()) { + continue; + } + if (!minValue.has_value() || *cv < *minValue) { + minValue = *cv; + } + } + + // If no values found, we are done. + if (!minValue.has_value()) { + break; + } + + // Store the minimum value, calculate the isPresent flag, and advance the iterators that match + // the minimum value. + buildp[destIndex] = *minValue; + + // Advance the iterators that match the minimum value. + for (auto &rss : rowSequenceStates_) { + auto &cv = rss.currentValue_; + if (!cv.has_value() || *cv != *minValue) { + rss.isPresent_[destIndex] = false; + continue; + } + rss.isPresent_[destIndex] = true; + + // Bump to next if you can + uint64_t value; + if (rss.iterator_.tryGetNext(&value)) { + cv = value; + } else { + cv.reset(); + } + } + } + + return ArrayRowSequence::create(build_, build_.get(), build_.get() + destIndex); +} + +bool RowMerger::isCellPresent(size_t colIndex, size_t chunkOffset) const { + auto colIndexToUse = colIndex < rowSequenceStates_.size() ? colIndex : 0; + return rowSequenceStates_[colIndexToUse].isPresent_[chunkOffset]; +} +} // namespace } // namespace deephaven::client::table diff --git a/cpp-client/deephaven/client/src/ticking.cc b/cpp-client/deephaven/client/src/ticking.cc index cd3bf250e3f..c9e45aa9041 100644 --- a/cpp-client/deephaven/client/src/ticking.cc +++ b/cpp-client/deephaven/client/src/ticking.cc @@ -4,40 +4,14 @@ #include "deephaven/client/ticking.h" namespace deephaven::client { -ClassicTickingUpdate::ClassicTickingUpdate(std::shared_ptr removedRowsKeySpace, - UInt64Chunk removedRowsIndexSpace, - std::shared_ptr addedRowsKeySpace, - UInt64Chunk addedRowsIndexSpace, - std::vector> modifiedRowsKeySpace, - std::vector modifiedRowsIndexSpace, - std::shared_ptr
    currentTableKeySpace, - std::shared_ptr
    currentTableIndexSpace) : - removedRowsKeySpace_(std::move(removedRowsKeySpace)), - removedRowsIndexSpace_(std::move(removedRowsIndexSpace)), - addedRowsKeySpace_(std::move(addedRowsKeySpace)), - addedRowsIndexSpace_(std::move(addedRowsIndexSpace)), - modifiedRowsKeySpace_(std::move(modifiedRowsKeySpace)), - modifiedRowsIndexSpace_(std::move(modifiedRowsIndexSpace)), - currentTableKeySpace_(std::move(currentTableKeySpace)), - currentTableIndexSpace_(std::move(currentTableIndexSpace)) {} -ClassicTickingUpdate::ClassicTickingUpdate(ClassicTickingUpdate &&other) noexcept = default; -ClassicTickingUpdate &ClassicTickingUpdate::operator=(ClassicTickingUpdate &&other) noexcept = default; -ClassicTickingUpdate::~ClassicTickingUpdate() = default; - -ImmerTickingUpdate::ImmerTickingUpdate(std::shared_ptr
    beforeRemoves, - std::shared_ptr
    beforeModifies, - std::shared_ptr
    current, - std::shared_ptr removed, - std::vector> modified, - std::shared_ptr added) : beforeRemoves_(std::move(beforeRemoves)), - beforeModifies_(std::move(beforeModifies)), - current_(std::move(current)), - removed_(std::move(removed)), - modified_(std::move(modified)), - added_(std::move(added)) {} - -ImmerTickingUpdate::ImmerTickingUpdate(ImmerTickingUpdate &&other) noexcept = default; -ImmerTickingUpdate &ImmerTickingUpdate::operator=(ImmerTickingUpdate &&other) noexcept = default; -ImmerTickingUpdate::~ImmerTickingUpdate() = default; - +TickingUpdate::TickingUpdate(std::shared_ptr
    prev, std::shared_ptr removedRows, + std::shared_ptr
    afterRemoves, std::shared_ptr addedRows, + std::shared_ptr
    afterAdds, std::vector> modifiedRows, + std::shared_ptr
    afterModifies) : prev_(std::move(prev)), + removedRows_(std::move(removedRows)), afterRemoves_(std::move(afterRemoves)), + addedRows_(std::move(addedRows)), afterAdds_(std::move(afterAdds)), + modifiedRows_(std::move(modifiedRows)), afterModifies_(std::move(afterModifies)) {} +TickingUpdate::TickingUpdate(TickingUpdate &&other) noexcept = default; +TickingUpdate &TickingUpdate::operator=(TickingUpdate &&other) noexcept = default; +TickingUpdate::~TickingUpdate() = default; } // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/types.cc b/cpp-client/deephaven/client/src/types.cc index fafe8f3c64b..28724d9e05f 100644 --- a/cpp-client/deephaven/client/src/types.cc +++ b/cpp-client/deephaven/client/src/types.cc @@ -65,7 +65,7 @@ void DateTime::streamIrisRepresentation(std::ostream &s) const { size_t oneBillion = 1000000000; time_t timeSecs = nanos_ / oneBillion; auto nanos = nanos_ % oneBillion; - struct tm tm; + struct tm tm = {}; gmtime_r(&timeSecs, &tm); char dateBuffer[32]; // ample char nanosBuffer[32]; // ample diff --git a/cpp-client/deephaven/client/src/utility/utility.cc b/cpp-client/deephaven/client/src/utility/utility.cc index 868c4fef0cb..d1f0f13a205 100644 --- a/cpp-client/deephaven/client/src/utility/utility.cc +++ b/cpp-client/deephaven/client/src/utility/utility.cc @@ -110,6 +110,13 @@ std::ostream &operator<<(std::ostream &s, const DebugInfo &o) { return streamf(s, "%o@%o:%o args=(%o))", o.func_, o.file_, o.line_, o.args_); } +namespace internal { +void trueOrThrowHelper(const DebugInfo &debugInfo) { + auto message = stringf("Assertion failed: %o", debugInfo); + throw std::runtime_error(message); +} +} // namespace internal + void okOrThrow(const DebugInfo &debugInfo, const arrow::Status &status) { if (status.ok()) { return; diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt b/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt deleted file mode 100644 index 854c7efc32f..00000000000 --- a/cpp-client/deephaven/client/third_party/flatbuffers/LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -TODO: put correct license here -indicating we are using Flatbuffers v2.0.6 -modifications are: -- copied only the files we needed -- moved the namespace of the code to a Deephaven-internal namespace, - so as not to conflict with any other flatbuffers being linked - (such as the one inside Arrow) diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/README.md b/cpp-client/deephaven/client/third_party/flatbuffers/README.md new file mode 100644 index 00000000000..7cd23f293e3 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/README.md @@ -0,0 +1,13 @@ +This directory contains a vendored version of Flatbuffers v2.0.6, +with the following changes: + +1. We have copied only the files we need: + allocator.h array.h base.h buffer.h buffer_ref.h default_allocator.h + detached_buffer.h flatbuffer_builder.h flatbuffers.h stl_emulation.h + string.h struct.h table.h util.h vector_downward.h vector.h verifier.h +2. We have moved the namespace of the code to a Deephaven-internal namespace, + so as not to conflict with any other flatbuffers being indirectly linked + from some other library (such as the one inside Arrow). +3. The patch representing step 2 is in the file patch.001 in this directory. + + diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/allocator.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/allocator.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/allocator.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/array.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/array.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/array.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/array.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/base.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/base.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/base.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/base.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/buffer.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/buffer.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/buffer.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/buffer_ref.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/buffer_ref.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/buffer_ref.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/default_allocator.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/default_allocator.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/default_allocator.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/detached_buffer.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/detached_buffer.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/detached_buffer.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/flatbuffer_builder.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/flatbuffers.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/flatbuffers.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/flatbuffers.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/stl_emulation.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/stl_emulation.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/stl_emulation.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/string.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/string.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/string.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/string.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/struct.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/struct.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/struct.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/struct.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/table.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/table.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/table.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/table.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/util.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/util.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/util.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/util.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/vector.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/vector.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/vector.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/vector_downward.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/vector_downward.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/vector_downward.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/verifier.h b/cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/verifier.h similarity index 100% rename from cpp-client/deephaven/client/third_party/flatbuffers/verifier.h rename to cpp-client/deephaven/client/third_party/flatbuffers/include/flatbuffers/verifier.h diff --git a/cpp-client/deephaven/client/third_party/flatbuffers/patch.001 b/cpp-client/deephaven/client/third_party/flatbuffers/patch.001 new file mode 100644 index 00000000000..11f934d027f --- /dev/null +++ b/cpp-client/deephaven/client/third_party/flatbuffers/patch.001 @@ -0,0 +1,350 @@ +diff -ur orig/allocator.h flatbuffers/allocator.h +--- orig/allocator.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/allocator.h 2022-08-06 02:58:02.748814653 -0400 +@@ -19,7 +19,12 @@ + + #include "flatbuffers/base.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++ ++namespace deephaven::third_party::flatbuffers { + + // Allocator interface. This is flatbuffers-specific and meant only for + // `vector_downward` usage. +@@ -65,4 +70,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_ALLOCATOR_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_ALLOCATOR_H_ +diff -ur orig/array.h flatbuffers/array.h +--- orig/array.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/array.h 2022-08-06 02:58:02.748814653 -0400 +@@ -21,7 +21,12 @@ + #include "flatbuffers/stl_emulation.h" + #include "flatbuffers/vector.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++ ++namespace deephaven::third_party::flatbuffers { + + // This is used as a helper type for accessing arrays. + template class Array { +diff -ur orig/base.h flatbuffers/base.h +--- orig/base.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/base.h 2022-08-06 02:58:02.748814653 -0400 +@@ -143,7 +143,11 @@ + #define FLATBUFFERS_VERSION_REVISION 6 + #define FLATBUFFERS_STRING_EXPAND(X) #X + #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + // Returns version as string "MAJOR.MINOR.REVISION". + const char* FLATBUFFERS_VERSION(); + } +@@ -221,21 +225,21 @@ + // Check for std::string_view (in c++17) + #if __has_include() && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17)) + #include +- namespace flatbuffers { ++ namespace deephaven::third_party::flatbuffers { + typedef std::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for std::experimental::string_view (in c++14, compiler-dependent) + #elif __has_include() && (__cplusplus >= 201411) + #include +- namespace flatbuffers { ++ namespace deephaven::third_party::flatbuffers { + typedef std::experimental::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for absl::string_view + #elif __has_include("absl/strings/string_view.h") + #include "absl/strings/string_view.h" +- namespace flatbuffers { ++ namespace deephaven::third_party::flatbuffers { + typedef absl::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 +@@ -308,7 +312,7 @@ + /// @endcond + + /// @file +-namespace flatbuffers { ++namespace deephaven::third_party::flatbuffers { + + /// @cond FLATBUFFERS_INTERNAL + // Our default offset / size type, 32bit on purpose on 64bit systems. +diff -ur orig/buffer.h flatbuffers/buffer.h +--- orig/buffer.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/buffer.h 2022-08-06 02:58:02.748814653 -0400 +@@ -19,7 +19,11 @@ + + #include "flatbuffers/base.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // Wrapper for uoffset_t to allow safe template specialization. + // Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). +@@ -139,4 +143,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_BUFFER_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_BUFFER_H_ +diff -ur orig/buffer_ref.h flatbuffers/buffer_ref.h +--- orig/buffer_ref.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/buffer_ref.h 2022-08-06 02:58:02.748814653 -0400 +@@ -20,7 +20,11 @@ + #include "flatbuffers/base.h" + #include "flatbuffers/verifier.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // Convenient way to bundle a buffer and its length, to pass it around + // typed by its root. +@@ -50,4 +54,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_BUFFER_REF_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_BUFFER_REF_H_ +diff -ur orig/default_allocator.h flatbuffers/default_allocator.h +--- orig/default_allocator.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/default_allocator.h 2022-08-06 02:58:02.748814653 -0400 +@@ -20,7 +20,11 @@ + #include "flatbuffers/allocator.h" + #include "flatbuffers/base.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // DefaultAllocator uses new/delete to allocate memory regions + class DefaultAllocator : public Allocator { +@@ -61,4 +65,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ +diff -ur orig/detached_buffer.h flatbuffers/detached_buffer.h +--- orig/detached_buffer.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/detached_buffer.h 2022-08-06 02:58:02.748814653 -0400 +@@ -21,7 +21,11 @@ + #include "flatbuffers/base.h" + #include "flatbuffers/default_allocator.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // DetachedBuffer is a finished flatbuffer memory region, detached from its + // builder. The original memory region and allocator are also stored so that +diff -ur orig/flatbuffer_builder.h flatbuffers/flatbuffer_builder.h +--- orig/flatbuffer_builder.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/flatbuffer_builder.h 2022-08-06 02:58:02.748814653 -0400 +@@ -33,7 +33,11 @@ + #include "flatbuffers/vector_downward.h" + #include "flatbuffers/verifier.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // Converts a Field ID to a virtual table offset. + inline voffset_t FieldIndexToOffset(voffset_t field_id) { +diff -ur orig/flatbuffers.h flatbuffers/flatbuffers.h +--- orig/flatbuffers.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/flatbuffers.h 2022-08-06 02:58:02.748814653 -0400 +@@ -33,7 +33,11 @@ + #include "flatbuffers/vector_downward.h" + #include "flatbuffers/verifier.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. + /// it is the opposite transformation of GetRoot(). +diff -ur orig/stl_emulation.h flatbuffers/stl_emulation.h +--- orig/stl_emulation.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/stl_emulation.h 2022-08-06 02:58:02.748814653 -0400 +@@ -56,7 +56,11 @@ + #endif // defined(FLATBUFFERS_USE_STD_SPAN) + + // This header provides backwards compatibility for older versions of the STL. +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + #if defined(FLATBUFFERS_TEMPLATES_ALIASES) + template +diff -ur orig/string.h flatbuffers/string.h +--- orig/string.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/string.h 2022-08-06 02:58:02.748814653 -0400 +@@ -20,7 +20,11 @@ + #include "flatbuffers/base.h" + #include "flatbuffers/vector.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + struct String : public Vector { + const char *c_str() const { return reinterpret_cast(Data()); } +@@ -61,4 +65,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_STRING_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_STRING_H_ +diff -ur orig/struct.h flatbuffers/struct.h +--- orig/struct.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/struct.h 2022-08-06 02:58:02.748814653 -0400 +@@ -19,7 +19,11 @@ + + #include "flatbuffers/base.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // "structs" are flat structures that do not have an offset table, thus + // always have all members present and do not support forwards/backwards +@@ -50,4 +54,4 @@ + + } // namespace flatbuffers + +-#endif // FLATBUFFERS_STRUCT_H_ +\ No newline at end of file ++#endif // FLATBUFFERS_STRUCT_H_ +diff -ur orig/table.h flatbuffers/table.h +--- orig/table.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/table.h 2022-08-06 02:58:02.748814653 -0400 +@@ -20,7 +20,11 @@ + #include "flatbuffers/base.h" + #include "flatbuffers/verifier.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // "tables" use an offset table (possibly shared) that allows fields to be + // omitted and added at will, but uses an extra indirection to read. +diff -ur orig/util.h flatbuffers/util.h +--- orig/util.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/util.h 2022-08-06 02:58:02.748814653 -0400 +@@ -33,7 +33,11 @@ + + #include + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // @locale-independent functions for ASCII characters set. + +diff -ur orig/vector_downward.h flatbuffers/vector_downward.h +--- orig/vector_downward.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/vector_downward.h 2022-08-06 02:58:02.748814653 -0400 +@@ -21,7 +21,11 @@ + #include "flatbuffers/default_allocator.h" + #include "flatbuffers/detached_buffer.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // This is a minimal replication of std::vector functionality, + // except growing from higher to lower addresses. i.e push_back() inserts data +diff -ur orig/vector.h flatbuffers/vector.h +--- orig/vector.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/vector.h 2022-08-06 02:58:02.748814653 -0400 +@@ -20,7 +20,11 @@ + #include "flatbuffers/base.h" + #include "flatbuffers/buffer.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + struct String; + +diff -ur orig/verifier.h flatbuffers/verifier.h +--- orig/verifier.h 2022-09-07 19:04:45.122547635 -0400 ++++ flatbuffers/verifier.h 2022-08-06 02:58:02.748814653 -0400 +@@ -21,7 +21,11 @@ + #include "flatbuffers/util.h" + #include "flatbuffers/vector.h" + +-namespace flatbuffers { ++// Move the vendored copy of flatbuffers to a private namespace so it doesn't conflict ++// with the flatbuffers namespace compiled into Arrow. ++namespace deephaven::third_party::flatbuffers {} ++namespace flatbuffers = deephaven::third_party::flatbuffers; ++namespace deephaven::third_party::flatbuffers { + + // Helper class to verify the integrity of a FlatBuffer + class Verifier FLATBUFFERS_FINAL_CLASS { diff --git a/cpp-client/tests/CMakeLists.txt b/cpp-client/tests/CMakeLists.txt index c264a4dae21..8f39e2d0abb 100644 --- a/cpp-client/tests/CMakeLists.txt +++ b/cpp-client/tests/CMakeLists.txt @@ -4,24 +4,27 @@ project(tests) set(CMAKE_CXX_STANDARD 17) add_executable(tests - add_drop_example.cc - aggregates_example.cc - head_and_tail_example.cc - filter_example.cc - join_example.cc - lastby_example.cc + add_drop_test.cc + aggregates_test.cc + head_and_tail_test.cc + filter_test.cc + join_test.cc + lastby_test.cc main.cc - merge_tables_example.cc - new_table_example.cc - select_example.cc - sort_example.cc - string_filter_example.cc + merge_tables_test.cc + new_table_test.cc + select_test.cc + sort_test.cc + string_filter_test.cc test_util.cc test_util.h - ungroup_example.cc - validation_example.cc - view_example.cc + ungroup_test.cc + validation_test.cc + view_test.cc + + third_party/catch.hpp ) + target_compile_options(tests PRIVATE -Wall -Werror) target_include_directories(tests PUBLIC "..") diff --git a/cpp-client/tests/add_drop_example.cc b/cpp-client/tests/add_drop_test.cc similarity index 75% rename from cpp-client/tests/add_drop_example.cc rename to cpp-client/tests/add_drop_test.cc index 18aefb3e4e0..f75fb8a49db 100644 --- a/cpp-client/tests/add_drop_example.cc +++ b/cpp-client/tests/add_drop_test.cc @@ -1,15 +1,13 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" using deephaven::client::utility::streamf; -using deephaven::client::highlevel::NumericExpression; +using deephaven::client::NumericExpression; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Drop all columns", "[adddrop]") { auto tm = TableMakerForTests::create(); @@ -27,9 +25,6 @@ TEST_CASE("Drop all columns", "[adddrop]") { t2, "Volume", volData, "II", iiData - ); + ); } - -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/aggregates_example.cc b/cpp-client/tests/aggregates_test.cc similarity index 72% rename from cpp-client/tests/aggregates_example.cc rename to cpp-client/tests/aggregates_test.cc index 33219e6602a..4479991c7cf 100644 --- a/cpp-client/tests/aggregates_example.cc +++ b/cpp-client/tests/aggregates_test.cc @@ -1,28 +1,26 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::aggAvg; -using deephaven::client::highlevel::aggSum; -using deephaven::client::highlevel::aggMin; -using deephaven::client::highlevel::aggMax; -using deephaven::client::highlevel::aggCount; -using deephaven::client::highlevel::aggCombo; -using deephaven::client::highlevel::Aggregate; -using deephaven::client::highlevel::AggregateCombo; -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::SortPair; -using deephaven::client::highlevel::DeephavenConstants; +using deephaven::client::aggAvg; +using deephaven::client::aggSum; +using deephaven::client::aggMin; +using deephaven::client::aggMax; +using deephaven::client::aggCount; +using deephaven::client::aggCombo; +using deephaven::client::Aggregate; +using deephaven::client::AggregateCombo; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; +using deephaven::client::SortPair; +using deephaven::client::DeephavenConstants; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Various aggregates", "[aggregates]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -73,6 +71,4 @@ TEST_CASE("Various aggregates", "[aggregates]") { ); } } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/filter_example.cc b/cpp-client/tests/filter_test.cc similarity index 83% rename from cpp-client/tests/filter_example.cc rename to cpp-client/tests/filter_test.cc index 4a3d20cf718..a2011f2a0bf 100644 --- a/cpp-client/tests/filter_example.cc +++ b/cpp-client/tests/filter_test.cc @@ -2,16 +2,13 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" -using deephaven::client::highlevel::TableHandle; - -namespace deephaven { -namespace client { -namespace tests { +using deephaven::client::TableHandle; +namespace deephaven::client::tests { TEST_CASE("Filter a table", "[filter]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -46,6 +43,4 @@ TEST_CASE("Filter a table", "[filter]") { ); } } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/head_and_tail_example.cc b/cpp-client/tests/head_and_tail_test.cc similarity index 80% rename from cpp-client/tests/head_and_tail_example.cc rename to cpp-client/tests/head_and_tail_test.cc index e553f14a4ba..22033bc7a71 100644 --- a/cpp-client/tests/head_and_tail_example.cc +++ b/cpp-client/tests/head_and_tail_test.cc @@ -1,15 +1,13 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Head and Tail", "[headtail]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -45,6 +43,4 @@ TEST_CASE("Head and Tail", "[headtail]") { "Volume", tailVolumeData ); } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/join_example.cc b/cpp-client/tests/join_test.cc similarity index 81% rename from cpp-client/tests/join_example.cc rename to cpp-client/tests/join_test.cc index e9ef8220857..b3ee7146435 100644 --- a/cpp-client/tests/join_example.cc +++ b/cpp-client/tests/join_test.cc @@ -1,15 +1,13 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Join", "[join]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -42,6 +40,4 @@ TEST_CASE("Join", "[join]") { "ADV", advData ); } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/lastby_example.cc b/cpp-client/tests/lastby_test.cc similarity index 72% rename from cpp-client/tests/lastby_example.cc rename to cpp-client/tests/lastby_test.cc index edc1d07500f..ea84dcd9b48 100644 --- a/cpp-client/tests/lastby_example.cc +++ b/cpp-client/tests/lastby_test.cc @@ -1,20 +1,18 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::BooleanExpression; -using deephaven::client::highlevel::NumericExpression; -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::BooleanExpression; +using deephaven::client::NumericExpression; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Last By", "[lastby]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -38,6 +36,4 @@ TEST_CASE("Last By", "[lastby]") { "Close", closeData ); } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/main.cc b/cpp-client/tests/main.cc index 66124812dd6..03224795d07 100644 --- a/cpp-client/tests/main.cc +++ b/cpp-client/tests/main.cc @@ -2,4 +2,4 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #define CATCH_CONFIG_MAIN -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" diff --git a/cpp-client/tests/merge_tables_example.cc b/cpp-client/tests/merge_tables_test.cc similarity index 88% rename from cpp-client/tests/merge_tables_example.cc rename to cpp-client/tests/merge_tables_test.cc index 15fb9a933a8..755944ebbed 100644 --- a/cpp-client/tests/merge_tables_example.cc +++ b/cpp-client/tests/merge_tables_test.cc @@ -1,12 +1,10 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Merge Tables", "[merge]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -39,6 +37,4 @@ TEST_CASE("Merge Tables", "[merge]") { "Volume", volData ); } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/new_table_example.cc b/cpp-client/tests/new_table_test.cc similarity index 83% rename from cpp-client/tests/new_table_example.cc rename to cpp-client/tests/new_table_test.cc index 8e8b6cb48ce..0fdb6f21435 100644 --- a/cpp-client/tests/new_table_example.cc +++ b/cpp-client/tests/new_table_test.cc @@ -3,21 +3,19 @@ */ #include -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::DeephavenConstants; -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::SortPair; +using deephaven::client::DeephavenConstants; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; +using deephaven::client::SortPair; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; using deephaven::client::utility::TableMaker; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("New Table", "[newtable]") { auto tm = TableMakerForTests::create(); @@ -42,6 +40,4 @@ TEST_CASE("New Table", "[newtable]") { auto temp = maker.makeTable(tm.client().getManager()); std::cout << temp.stream(true) << '\n'; } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/select_example.cc b/cpp-client/tests/select_test.cc similarity index 94% rename from cpp-client/tests/select_example.cc rename to cpp-client/tests/select_test.cc index 72411d03721..25fce15e145 100644 --- a/cpp-client/tests/select_example.cc +++ b/cpp-client/tests/select_test.cc @@ -4,9 +4,9 @@ #include #include #include -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/utility.h" #include @@ -23,18 +23,15 @@ #include #include -using deephaven::client::highlevel::Client; -using deephaven::client::highlevel::NumCol; -using deephaven::client::highlevel::StrCol; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::Client; +using deephaven::client::NumCol; +using deephaven::client::StrCol; +using deephaven::client::TableHandle; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; using deephaven::client::utility::TableMaker; -namespace deephaven { -namespace client { -namespace tests { - +namespace deephaven::client::tests { TEST_CASE("Create / update / fetch a table", "[select]") { auto tm = TableMakerForTests::create(); @@ -229,6 +226,4 @@ TEST_CASE("New columns", "[select]") { ); } } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/sort_example.cc b/cpp-client/tests/sort_test.cc similarity index 91% rename from cpp-client/tests/sort_example.cc rename to cpp-client/tests/sort_test.cc index 5302c295aa6..8e865cf3edd 100644 --- a/cpp-client/tests/sort_example.cc +++ b/cpp-client/tests/sort_test.cc @@ -1,21 +1,19 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; -using deephaven::client::highlevel::SortPair; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; +using deephaven::client::SortPair; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; using deephaven::client::utility::TableMaker; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("Sort demo table", "[sort]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -99,6 +97,4 @@ TEST_CASE("Sort temp table", "[sort]") { "IntValue3", sid3 ); } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/string_filter_example.cc b/cpp-client/tests/string_filter_test.cc similarity index 82% rename from cpp-client/tests/string_filter_example.cc rename to cpp-client/tests/string_filter_test.cc index a0266fd6cb5..4595f625c67 100644 --- a/cpp-client/tests/string_filter_example.cc +++ b/cpp-client/tests/string_filter_test.cc @@ -1,26 +1,15 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" -using deephaven::client::highlevel::TableHandle; - -namespace deephaven { -namespace client { -namespace tests { +using deephaven::client::TableHandle; +namespace deephaven::client::tests { namespace { void testFilter(const char *description, const TableHandle &filteredTable, const std::vector &tickerData, - const std::vector &closeData) { - INFO(description); - INFO(filteredTable.stream(true)); - compareTable( - filteredTable, - "Ticker", tickerData, - "Close", closeData - ); -} + const std::vector &closeData); } // namespace TEST_CASE("String Filter", "[strfilter]") { @@ -61,6 +50,18 @@ TEST_CASE("String Filter", "[strfilter]") { tickerData, closeData); } } -} // namespace tests -} // namespace client -} // namespace deephaven + +namespace { +void testFilter(const char *description, const TableHandle &filteredTable, + const std::vector &tickerData, + const std::vector &closeData) { + INFO(description); + INFO(filteredTable.stream(true)); + compareTable( + filteredTable, + "Ticker", tickerData, + "Close", closeData + ); +} +} // namespace +} // namespace deephaven::client::tests { diff --git a/cpp-client/tests/test_util.cc b/cpp-client/tests/test_util.cc index 014c76f3faf..a5cc7ed9b75 100644 --- a/cpp-client/tests/test_util.cc +++ b/cpp-client/tests/test_util.cc @@ -5,17 +5,14 @@ #include "deephaven/client/utility/table_maker.h" #include "deephaven/client/utility/utility.h" -namespace deephaven { -namespace client { -namespace tests { - -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandle; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::valueOrThrow; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; using deephaven::client::utility::TableMaker; +namespace deephaven::client::tests { ColumnNamesForTests::ColumnNamesForTests() : importDate_("ImportDate"), ticker_("Ticker"), open_("Open"), close_("Close"), volume_("Volume") {} ColumnNamesForTests::ColumnNamesForTests(ColumnNamesForTests &&other) noexcept = default; @@ -206,7 +203,4 @@ std::shared_ptr basicValidate(const TableHandle &table, int expect return arrowTable; } } // namespace internal - -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/test_util.h b/cpp-client/tests/test_util.h index 62edbab7e8b..8726b947fc7 100644 --- a/cpp-client/tests/test_util.h +++ b/cpp-client/tests/test_util.h @@ -18,14 +18,11 @@ #include #include #include -#include "deephaven/client/highlevel/client.h" +#include "deephaven/client/client.h" #include "deephaven/client/utility/utility.h" #include "deephaven/client/utility/table_maker.h" -namespace deephaven { -namespace client { -namespace tests { - +namespace deephaven::client::tests { class ColumnNamesForTests { public: ColumnNamesForTests(); @@ -68,9 +65,9 @@ class ColumnDataForTests { }; class TableMakerForTests { - typedef deephaven::client::highlevel::Client Client; - typedef deephaven::client::highlevel::TableHandleManager TableHandleManager; - typedef deephaven::client::highlevel::TableHandle TableHandle; + typedef deephaven::client::Client Client; + typedef deephaven::client::TableHandleManager TableHandleManager; + typedef deephaven::client::TableHandle TableHandle; public: static TableMakerForTests create(); @@ -114,16 +111,13 @@ void compareTableRecurse(int depth, const std::shared_ptr &table, compareTableRecurse(depth + 1, table, std::forward(rest)...); } -std::shared_ptr basicValidate(const deephaven::client::highlevel::TableHandle &table, +std::shared_ptr basicValidate(const deephaven::client::TableHandle &table, int expectedColumns); } // namespace internal template -void compareTable(const deephaven::client::highlevel::TableHandle &table, Args &&... args) { +void compareTable(const deephaven::client::TableHandle &table, Args &&... args) { auto arrowTable = internal::basicValidate(table, sizeof...(Args) / 2); internal::compareTableRecurse(0, arrowTable, std::forward(args)...); } - -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/catch.hpp b/cpp-client/tests/third_party/catch.hpp similarity index 100% rename from cpp-client/tests/catch.hpp rename to cpp-client/tests/third_party/catch.hpp diff --git a/cpp-client/tests/ungroup_example.cc b/cpp-client/tests/ungroup_test.cc similarity index 76% rename from cpp-client/tests/ungroup_example.cc rename to cpp-client/tests/ungroup_test.cc index df5b84f50b4..ae13185ec59 100644 --- a/cpp-client/tests/ungroup_example.cc +++ b/cpp-client/tests/ungroup_test.cc @@ -1,14 +1,14 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -namespace deephaven { -namespace client { -namespace tests { -TEST_CASE("Ungroup columns", "[ungroup]") { +namespace deephaven::client::tests { +// TODO(kosak): This test is currently disabled (by membership in the [.] test group, because we +// don't yet deserialize the grouped column correctly. +TEST_CASE("Ungroup columns", "[.]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -40,8 +40,5 @@ TEST_CASE("Ungroup columns", "[ungroup]") { "Ticker", ugTickerData, "Close", ugCloseData ); - } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/validation_example.cc b/cpp-client/tests/validation_test.cc similarity index 58% rename from cpp-client/tests/validation_example.cc rename to cpp-client/tests/validation_test.cc index 253ffab0995..52463cc4b09 100644 --- a/cpp-client/tests/validation_example.cc +++ b/cpp-client/tests/validation_test.cc @@ -1,20 +1,18 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; using deephaven::client::utility::SimpleOstringstream; using deephaven::client::utility::separatedList; using deephaven::client::utility::streamf; using deephaven::client::utility::stringf; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { namespace { void testWheres(const TableHandleManager &scope); void testSelects(const TableHandleManager &scope); @@ -24,9 +22,6 @@ void testWheresHelper(std::string_view what, const TableHandle &table, void testSelectsHelper(std::string_view what, const TableHandle &table, const std::vector> &badSelects, const std::vector> &goodSelects); - -template -std::vector concat(const std::vector &lhs, const std::vector &rhs); } // namespace TEST_CASE("Validate selects", "[validation]") { @@ -49,35 +44,19 @@ void testWheres(const TableHandleManager &scope) { "S = java.util.regex.Pattern.quote(S)", // Pattern.quote not on whitelist "X = Math.min(3, 4)" // Math.min not on whitelist }; - std::vector badWheresWhenDynamic = { - "X = i", // clients can't use i on dynamic tables - "X = ii", // clients can't use ii on dynamic tables - }; + std::vector goodWheres = { "X = 3", "S = `hello`", "S.length() = 17", // instance methods of String ok "X = min(3, 4)", // "builtin" from GroovyStaticImports - "X = isNormal(3)", // another builtin from GroovyStaticImports + "X = isFinite(3)", // another builtin from GroovyStaticImports "X in 3, 4, 5", }; auto staticTable = scope.emptyTable(10) .update("X = 12", "S = `hello`"); - // "badWheresWhenDynamic" are ok for static tables - // testWheresHelper("static table", staticTable, badWheres, concat(goodWheres, badWheresWhenDynamic)); - - auto now = std::chrono::system_clock::now(); - auto nowNanos = std::chrono::duration_cast(now.time_since_epoch()).count(); - std::chrono::seconds duration(10); - auto durationNanos = std::chrono::duration_cast(duration).count(); - - auto dynamicTable = scope.timeTable(nowNanos, durationNanos) - .update("X = 12", "S = `hello`"); - // .preemptive(100); - // "badWheresWhenDynamic" are bad for dynamic tables - testWheresHelper("dynamic table", dynamicTable, concat(badWheres, badWheresWhenDynamic), - goodWheres); + testWheresHelper("static table", staticTable, badWheres, goodWheres); } void testWheresHelper(std::string_view what, const TableHandle &table, @@ -88,7 +67,6 @@ void testWheresHelper(std::string_view what, const TableHandle &table, streamf(std::cerr, "Trying %o %o\n", what, bw); auto t1 = table.where(bw); t1.observe(); - // auto t2 = t1.getTableData(); } catch (const std::exception &e) { streamf(std::cerr, "%o: %o: Failed *as expected* with: %o\n", what, bw, e.what()); continue; @@ -109,36 +87,15 @@ void testSelects(const TableHandleManager &scope) { { "S = `hello`", "T = java.util.regex.Pattern.quote(S)" }, // Pattern.quote not on whitelist { "X = Math.min(3, 4)" } // Math.min not on whitelist }; - std::vector> badSelectsWhenDynamic = { - {"X = i"}, // clients can't use i on dynamic tables - {"X = ii"} // clients can't use ii on dynamic tables - }; std::vector> goodSelects = { {"X = 3"}, {"S = `hello`", "T = S.length()"}, // instance methods of String ok {"X = min(3, 4)"}, // "builtin" from GroovyStaticImports - {"X = isNormal(3)"}, // another builtin from GroovyStaticImports + {"X = isFinite(3)"}, // another builtin from GroovyStaticImports }; auto staticTable = scope.emptyTable(10) .update("X = 12", "S = `hello`"); - // "badSelectsWhenDynamic" are ok for static tables - testSelectsHelper("static table", staticTable, badSelects, concat(goodSelects, badSelectsWhenDynamic)); - -// auto now = std::chrono::system_clock::now(); -// auto nowNanos = std::chrono::duration_cast(now.time_since_epoch()).count(); -// std::chrono::seconds duration(10); -// auto durationNanos = std::chrono::duration_cast(duration).count(); - - auto now = std::chrono::system_clock::now(); - auto nowNanos = std::chrono::duration_cast(now.time_since_epoch()).count(); - std::chrono::seconds duration(10); - auto durationNanos = std::chrono::duration_cast(duration).count(); - - auto dynamicTable = scope.timeTable(nowNanos, durationNanos) - .update("X = 12", "S = `hello`"); - // .preemptive(100); - // "badSelectsWhenDynamic" are bad for dynamic tables - testSelectsHelper("dynamic table", dynamicTable, concat(badSelects, badSelectsWhenDynamic), goodSelects); + testSelectsHelper("static table", staticTable, badSelects, goodSelects); } void testSelectsHelper(std::string_view what, const TableHandle &table, @@ -163,14 +120,5 @@ void testSelectsHelper(std::string_view what, const TableHandle &table, separatedList(gs.begin(), gs.end())); } } - -template -std::vector concat(const std::vector &lhs, const std::vector &rhs) { - std::vector result(lhs); - result.insert(result.end(), rhs.begin(), rhs.end()); - return result; -} } // namespace -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-client/tests/view_example.cc b/cpp-client/tests/view_test.cc similarity index 81% rename from cpp-client/tests/view_example.cc rename to cpp-client/tests/view_test.cc index 62349ed64ab..27758cf98bf 100644 --- a/cpp-client/tests/view_example.cc +++ b/cpp-client/tests/view_test.cc @@ -1,17 +1,15 @@ /* * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -#include "tests/catch.hpp" +#include "tests/third_party/catch.hpp" #include "tests/test_util.h" #include "deephaven/client/utility/utility.h" -using deephaven::client::highlevel::TableHandleManager; -using deephaven::client::highlevel::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::TableHandle; using deephaven::client::utility::streamf; -namespace deephaven { -namespace client { -namespace tests { +namespace deephaven::client::tests { TEST_CASE("View", "[view]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -41,6 +39,4 @@ TEST_CASE("View", "[view]") { ); } } -} // namespace tests -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::tests diff --git a/cpp-examples/build-all-examples/CMakeLists.txt b/cpp-examples/build-all-examples/CMakeLists.txt index f4c529838b4..71f29a2d660 100644 --- a/cpp-examples/build-all-examples/CMakeLists.txt +++ b/cpp-examples/build-all-examples/CMakeLists.txt @@ -2,10 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(build-all-examples) add_subdirectory(../cleanup cleanup_dir) -add_subdirectory(../compare_approaches compare_approaches_dir) add_subdirectory(../create_table_with_arrow_flight create_table_with_arrow_flight_dir) add_subdirectory(../create_table_with_table_maker create_table_with_table_maker_dir) -add_subdirectory(../do_exchange do_exchange_dir) add_subdirectory(../hello_world hello_world_dir) -add_subdirectory(../readcsv readcsv_dir) +add_subdirectory(../read_csv read_csv_dir) add_subdirectory(../read_table_with_arrow_flight read_table_with_arrow_flight_dir) diff --git a/cpp-examples/cleanup/CMakeLists.txt b/cpp-examples/cleanup/CMakeLists.txt index 8212289743a..e0ea72bcb5b 100644 --- a/cpp-examples/cleanup/CMakeLists.txt +++ b/cpp-examples/cleanup/CMakeLists.txt @@ -6,12 +6,6 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(cleanup main.cc) target_link_libraries(cleanup deephaven::client) diff --git a/cpp-examples/compare_approaches/CMakeLists.txt b/cpp-examples/compare_approaches/CMakeLists.txt deleted file mode 100644 index c3e1e081d95..00000000000 --- a/cpp-examples/compare_approaches/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(compare_approaches) - -set(CMAKE_CXX_STANDARD 17) - -add_subdirectory(../../cpp-client/deephaven deephaven_dir) -#find_package(deephaven REQUIRED) - -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Boost REQUIRED) -find_package(Immer REQUIRED) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) -find_package(Immer REQUIRED) - -add_executable(compare_approaches main.cc) - -target_link_libraries(compare_approaches deephaven::client) diff --git a/cpp-examples/compare_approaches/main.cc b/cpp-examples/compare_approaches/main.cc deleted file mode 100644 index 4d69d682070..00000000000 --- a/cpp-examples/compare_approaches/main.cc +++ /dev/null @@ -1,671 +0,0 @@ -/* - * Copyright (c) 2016-2020 Deephaven Data Labs and Patent Pending - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "deephaven/client/client.h" -#include "deephaven/client/ticking.h" -#include "deephaven/client/chunk/chunk_maker.h" -#include "deephaven/client/chunk/chunk.h" -#include "deephaven/client/container/row_sequence.h" -#include "deephaven/client/table/table.h" -#include "deephaven/client/utility/table_maker.h" -#include "deephaven/client/utility/utility.h" -#include "immer/algorithm.hpp" - -using deephaven::client::Client; -using deephaven::client::NumCol; -using deephaven::client::SortPair; -using deephaven::client::TableHandle; -using deephaven::client::TableHandleManager; -using deephaven::client::TickingCallback; -using deephaven::client::ClassicTickingUpdate; -using deephaven::client::ImmerTickingUpdate; -using deephaven::client::chunk::ChunkMaker; -using deephaven::client::chunk::AnyChunk; -using deephaven::client::chunk::ChunkVisitor; -using deephaven::client::chunk::Chunk; -using deephaven::client::chunk::DoubleChunk; -using deephaven::client::chunk::Int32Chunk; -using deephaven::client::chunk::Int64Chunk; -using deephaven::client::chunk::UInt64Chunk; -using deephaven::client::column::ColumnSource; -using deephaven::client::container::RowSequence; -using deephaven::client::container::RowSequenceBuilder; -using deephaven::client::table::Table; -using deephaven::client::utility::makeReservedVector; -using deephaven::client::utility::okOrThrow; -using deephaven::client::utility::separatedList; -using deephaven::client::utility::streamf; -using deephaven::client::utility::stringf; -using deephaven::client::utility::TableMaker; -using deephaven::client::utility::valueOrThrow; -using deephaven::client::utility::verboseCast; - -using std::size_t; - -namespace { -struct UserConfig { - UserConfig(std::string server, bool wantLastBy, bool wantImmer, int64_t period, int64_t tableSize, - int64_t endSerialNumber, int64_t keyFactor, int64_t numAdditionalCols); - ~UserConfig(); - - std::string server_; - bool wantLastBy_ = false; - bool wantImmer_ = false; - int64_t period_ = 0; - int64_t tableSize_ = 0; - int64_t endSerialNumber_ = 0; - int64_t keyFactor_ = 0; - int64_t numAdditionalCols_ = 0; - - friend std::ostream &operator<<(std::ostream &s, const UserConfig &o); -}; - -struct RuntimeConfig { - RuntimeConfig(size_t keyColumn, size_t serialNumberColumn) : keyColumn_(keyColumn), - serialNumberColumn_(serialNumberColumn) {} - - size_t keyColumn_ = 0; - size_t serialNumberColumn_ = 0; -}; - -UserConfig parseArgs(int argc, const char **argv); -void demo(std::shared_ptr config, TableHandleManager *manager); -std::pair> makeQuery(const UserConfig *userConfig, - TableHandleManager *manager); -void showUsageAndExit(); -int64_t getLong(std::string_view s); -} // namespace - -int main(int argc, const char **argv) { - auto config = parseArgs(argc, argv); - streamf(std::cout, "Config is %o\n", config); - try { - auto client = Client::connect(config.server_); - auto manager = client.getManager(); - auto sharedConfig = std::make_shared(std::move(config)); - demo(std::move(sharedConfig), &manager); - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } -} - -namespace { -UserConfig parseArgs(int argc, const char **argv) { - if (argc != 9) { - showUsageAndExit(); - } - size_t nextIndex = 1; - std::string serverAndPort = argv[nextIndex++]; - - std::string_view tailVsLastBy = argv[nextIndex++]; - bool wantLastBy; - if (tailVsLastBy == "lastby") { - wantLastBy = true; - } else if (tailVsLastBy == "tail") { - wantLastBy = false; - } else { - showUsageAndExit(); - } - - std::string_view immerVsClassic = argv[nextIndex++]; - bool wantImmer; - if (immerVsClassic == "immer") { - wantImmer = true; - } else if (immerVsClassic == "classic") { - wantImmer = false; - } else { - showUsageAndExit(); - } - - auto period = getLong(argv[nextIndex++]); - auto tableSize = getLong(argv[nextIndex++]); - auto endSerialNumber = getLong(argv[nextIndex++]); - auto keyFactor = getLong(argv[nextIndex++]); - auto numAdditionalCols = getLong(argv[nextIndex++]); - - return UserConfig(std::move(serverAndPort), wantLastBy, wantImmer, period, tableSize, - endSerialNumber, keyFactor, numAdditionalCols); -} - -int64_t getLong(std::string_view s) { - int64_t value; - auto res = std::from_chars(s.begin(), s.end(), value); - if (res.ec != std::errc()) { - throw std::runtime_error(stringf("Couldn't parse %o, error code is %o", s, (int)res.ec)); - } - if (res.ptr != s.end()) { - throw std::runtime_error(stringf("Non-numeric material in %o", s)); - } - return value; -} - -void showUsageAndExit() { - streamf(std::cerr, - "Usage: server:port (tail/lastby) (immer/classic) period tableSize endSerialNumber keyFactor numAdditionalCols\n" - "server:port\n" - " The server endpoint, such as localhost:10000\n" - "(tail/lastby):\n" - " tail - creates an append-only table\n" - " lastby - creates a table with lastby (will experience shifts and modifies)\n" - "(immer/classic):\n" - " immer - use Immer data structures to track the table data\n" - " classic - use traditional data structures to track the table data\n" - "period:\n" - " The server adds a new row every 'period' nanoseconds\n" - "tableSize:\n" - " The max size of the table (in general this is smaller than the number of new rows created because rows can wrap around and replace previous versions)\n" - "endSerialNumber:\n" - " The (exclusive) upper bound of row numbers added to the table. The table will stop changing at this point\n" - "keyFactor:\n" - " The serial number is multiplied by the keyFactor in order to spread rows around and cause a lot of shifts or modifies\n" - "numAdditionalCols:\n" - " Number of additional autogenerated data columns\n" - "\n" - "One reasonable test would be:\n" - " localhost:10000 tail immer 10000000 1000 10000 3 5\n" - ); - std::exit(1); -} - -// or maybe make a stream manipulator -std::string getWhat(std::exception_ptr ep); - -class SerialNumberProcessor final { -public: - void process(Int64Chunk *unorderedSerialNumbers); - -private: - int64_t nextExpectedSerial_ = 0; -}; - -class Stopwatch { -public: - Stopwatch(); - - bool pulse(size_t *elapsedSeconds); - -private: - std::chrono::steady_clock::time_point start_; - std::chrono::steady_clock::time_point last_; -}; - -class StatsProcessor { -public: - void update(size_t rowsRemoved, size_t rowsAdded, size_t rowsModifiedEstimated, - size_t cellsModified); - void showStats(size_t numCols, size_t elapsedSeconds); - -private: - size_t lastRowsRemoved_ = 0; - size_t lastRowsAdded_ = 0; - size_t lastRowsModifiedEstimated_ = 0; - size_t lastCellsModified_ = 0; - - size_t rowsRemoved_ = 0; - size_t rowsAdded_ = 0; - size_t rowsModifiedEstimated_ = 0; - size_t cellsModified_ = 0; -}; - -class TableScanner { -public: - void scanTable(const Table &table); -}; - -class FragmentationAnalyzer { -public: - void analyze(const Table &table); - -private: - void analyzeHelper(std::string_view what, const ColumnSource &col); -}; - -class ClassicProcessor { - struct Private {}; -public: - static std::shared_ptr create(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig); - - ClassicProcessor(Private, std::shared_ptr userConfig, - std::shared_ptr runtimeConfi); - ~ClassicProcessor(); - - void processUpdate(const ClassicTickingUpdate &update); - -private: - void processSerialNumber(const ClassicTickingUpdate &update); - - std::shared_ptr userConfig_; - std::shared_ptr runtimeConfig_; - SerialNumberProcessor serialNumberProcessor_; - StatsProcessor statsProcessor_; - TableScanner tableScanner_; - Stopwatch stopwatch_; -}; - -class ImmerProcessor { - struct Private {}; -public: - static std::shared_ptr create(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig); - - ImmerProcessor(Private, std::shared_ptr userConfig, - std::shared_ptr runtimeConfi); - ~ImmerProcessor(); - - void post(ImmerTickingUpdate update); - -private: - static void runForever(std::shared_ptr self); - void runForeverHelper(); - void processUpdate(const ImmerTickingUpdate &update); - void processSerialNumber(const ImmerTickingUpdate &update); - - std::shared_ptr userConfig_; - std::shared_ptr runtimeConfig_; - SerialNumberProcessor serialNumberProcessor_; - StatsProcessor statsProcessor_; - TableScanner tableScanner_; - Stopwatch stopwatch_; - FragmentationAnalyzer fragmentationAnalyzer_; - std::mutex mutex_; - std::condition_variable condvar_; - std::queue todo_; -}; - -class DemoCallback final : public TickingCallback { -public: - explicit DemoCallback(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig); - ~DemoCallback() final; - - void onFailure(std::exception_ptr ep) final; - void onTick(const ClassicTickingUpdate &update) final; - void onTick(ImmerTickingUpdate update) final; - -private: - std::shared_ptr classicProcessor_; - std::shared_ptr immerProcessor_; -}; - -void demo(std::shared_ptr userConfig, TableHandleManager *manager) { - auto [table, runtimeConfig] = makeQuery(userConfig.get(), manager); - table.bindToVariable("showme"); - - auto wantImmer = userConfig->wantImmer_; - auto myCallback = std::make_shared(std::move(userConfig), std::move(runtimeConfig)); - auto handle = table.subscribe(myCallback, wantImmer); - std::cout << "Press enter to stop:\n"; - std::string temp; - std::getline(std::cin, temp); - std::cerr << "Unsubscribing, then sleeping for 5 seconds\n"; - table.unsubscribe(handle); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -std::pair> makeQuery(const UserConfig *userConfig, - TableHandleManager *manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - - auto table = manager->timeTable(start, userConfig->period_).view("SerialNumber = ii"); - auto sn = table.getNumCol("SerialNumber"); - // Demo is done at 'maxSerialNumber' - table = table.where(sn < userConfig->endSerialNumber_); - // Key column: increasing, but wraps at 'tableSize' - table = table.updateView(((sn * userConfig->keyFactor_) % userConfig->tableSize_).as("Key")); - std::shared_ptr runtimeConfig; - if (userConfig->wantLastBy_) { - table = table.lastBy("Key"); - runtimeConfig = std::make_shared(0, 1); - } else { - table = table.tail(userConfig->tableSize_); - runtimeConfig = std::make_shared(1, 0); - } - - for (int32_t i = 0; i < userConfig->numAdditionalCols_; ++i) { - auto colName = stringf("Col%o", i); - table = table.updateView((sn * (i + 1)).as(colName)); - } - - return std::make_pair(std::move(table), std::move(runtimeConfig)); -} - -DemoCallback::DemoCallback(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig) { - classicProcessor_ = ClassicProcessor::create(userConfig, runtimeConfig); - immerProcessor_ = ImmerProcessor::create(std::move(userConfig), std::move(runtimeConfig)); -} -DemoCallback::~DemoCallback() = default; - -void DemoCallback::onFailure(std::exception_ptr ep) { - streamf(std::cerr, "Callback reported failure: %o\n", getWhat(std::move(ep))); -} - -void DemoCallback::onTick(const ClassicTickingUpdate &update) { - classicProcessor_->processUpdate(update); -} - -void DemoCallback::onTick(ImmerTickingUpdate update) { - immerProcessor_->post(std::move(update)); -} - -std::shared_ptr ClassicProcessor::create(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig) { - return std::make_shared(Private(), std::move(userConfig), std::move(runtimeConfig)); -} - -ClassicProcessor::ClassicProcessor(Private,std::shared_ptr userConfig, - std::shared_ptr runtimeConfig) - : userConfig_(std::move(userConfig)), runtimeConfig_(std::move(runtimeConfig)) {} - -ClassicProcessor::~ClassicProcessor() = default; - -void ClassicProcessor::processUpdate(const ClassicTickingUpdate &update) { - const auto &table = *update.currentTableIndexSpace(); - auto numCols = table.numColumns(); - auto expectedNumColumns = 2 + userConfig_->numAdditionalCols_; - if (numCols != expectedNumColumns) { - throw std::runtime_error(stringf("Expected %o columns, got %o", expectedNumColumns, numCols)); - } - - size_t rowsModifiedEstimated = 0; - size_t cellsModified = 0; - for (const auto &mods : update.modifiedRowsKeySpace()) { - rowsModifiedEstimated = std::max(rowsModifiedEstimated, mods->size()); - cellsModified += mods->size(); - } - statsProcessor_.update(update.removedRowsKeySpace()->size(), - update.addedRowsKeySpace()->size(), rowsModifiedEstimated, cellsModified); - processSerialNumber(update); - size_t elapsedSeconds; - if (stopwatch_.pulse(&elapsedSeconds)) { - tableScanner_.scanTable(table); - statsProcessor_.showStats(numCols, elapsedSeconds); - } -} - -void ClassicProcessor::processSerialNumber(const ClassicTickingUpdate &update) { - // Do a bunch of work to make sure we received contiguous serial numbers without any skips. - const auto &table = *update.currentTableIndexSpace(); - auto sni = runtimeConfig_->serialNumberColumn_; - const auto &serialNumberCol = table.getColumn(sni); - - const auto &addedRows = update.addedRowsIndexSpace(); - const auto &modRowsVec = update.modifiedRowsIndexSpace(); - UInt64Chunk emptyModifiedRows; - const auto *modifiedRowsToUse = sni < modRowsVec.size() ? &modRowsVec[sni] : &emptyModifiedRows; - - auto totalChunkSize = addedRows.size() + modifiedRowsToUse->size(); - if (totalChunkSize == 0) { - return; - } - auto totalChunk = Int64Chunk::create(totalChunkSize); - auto addSlice = totalChunk.take(addedRows.size()); - auto modSlice = totalChunk.drop(addedRows.size()); - - serialNumberCol->fillChunkUnordered(addedRows, &addSlice); - serialNumberCol->fillChunkUnordered(*modifiedRowsToUse, &modSlice); - - serialNumberProcessor_.process(&totalChunk); -} - -std::shared_ptr ImmerProcessor::create(std::shared_ptr userConfig, - std::shared_ptr runtimeConfig) { - auto result = std::make_shared(Private(), std::move(userConfig), - std::move(runtimeConfig)); - std::thread t(&runForever, result); - t.detach(); - return result; -} - -ImmerProcessor::ImmerProcessor(Private,std::shared_ptr userConfig, - std::shared_ptr runtimeConfig) - : userConfig_(std::move(userConfig)), runtimeConfig_(std::move(runtimeConfig)) {} - - ImmerProcessor::~ImmerProcessor() = default; - -void ImmerProcessor::post(ImmerTickingUpdate update) { - mutex_.lock(); - auto empty = todo_.empty(); - todo_.push(std::move(update)); - mutex_.unlock(); - if (empty) { - condvar_.notify_all(); - } -} - -void ImmerProcessor::runForever(std::shared_ptr self) { - std::cerr << "Immer processor thread starting up\n"; - try { - self->runForeverHelper(); - } catch (const std::exception &e) { - streamf(std::cerr, "Caught exception: %o\n", e.what()); - } - std::cerr << "Immer processor thread shutting down\n"; -} - -void ImmerProcessor::runForeverHelper() { - while (true) { - std::unique_lock guard(mutex_); - while (todo_.empty()) { - condvar_.wait(guard); - } - auto update = std::move(todo_.front()); - todo_.pop(); - guard.unlock(); - - processUpdate(update); - } -} - -void ImmerProcessor::processUpdate(const ImmerTickingUpdate &update) { - const auto &table = *update.current(); - auto numCols = table.numColumns(); - auto expectedNumColumns = 2 + userConfig_->numAdditionalCols_; - if (numCols != expectedNumColumns) { - throw std::runtime_error(stringf("Expected %o columns, got %o", expectedNumColumns, numCols)); - } - size_t rowsModifiedEstimated = 0; - size_t cellsModified = 0; - for (const auto &mods : update.modified()) { - rowsModifiedEstimated = std::max(rowsModifiedEstimated, mods->size()); - cellsModified += mods->size(); - } - statsProcessor_.update(update.removed()->size(), - update.added()->size(), rowsModifiedEstimated, cellsModified); - - processSerialNumber(update); - size_t elapsedSeconds; - if (stopwatch_.pulse(&elapsedSeconds)) { - tableScanner_.scanTable(table); - statsProcessor_.showStats(numCols, elapsedSeconds); - fragmentationAnalyzer_.analyze(*update.current()); - } -} - -void ImmerProcessor::processSerialNumber(const ImmerTickingUpdate &update) { - // Do a bunch of work to make sure we received contiguous serial numbers without any skips. - const auto &table = *update.current(); - auto sni = runtimeConfig_->serialNumberColumn_; - const auto &serialNumberCol = table.getColumn(sni); - - const auto &addedRows = update.added(); - const auto &modRowsVec = update.modified(); - auto emptyModifiedRows = RowSequence::createEmpty(); - const auto *modifiedRowsToUse = sni < modRowsVec.size() ? modRowsVec[sni].get() : emptyModifiedRows.get(); - - auto totalChunkSize = addedRows->size() + modifiedRowsToUse->size(); - if (totalChunkSize == 0) { - return; - } - auto totalChunk = Int64Chunk::create(totalChunkSize); - auto addSlice = totalChunk.take(addedRows->size()); - auto modSlice = totalChunk.drop(addedRows->size()); - - serialNumberCol->fillChunk(*addedRows, &addSlice); - serialNumberCol->fillChunk(*modifiedRowsToUse, &modSlice); - - serialNumberProcessor_.process(&totalChunk); -} - -void SerialNumberProcessor::process(Int64Chunk *unorderedSerialNumbers) { - auto &usns = *unorderedSerialNumbers; - std::sort(usns.begin(), usns.end()); - auto firstSerial = *usns.begin(); - auto lastSerial = *(usns.end() - 1); // Safe because chunk is not empty. - if (lastSerial - firstSerial + 1 != usns.size()) { - throw std::runtime_error(stringf("Serial numbers not contiguous [%o..%o]", firstSerial, lastSerial)); - } - if (firstSerial != nextExpectedSerial_) { - throw std::runtime_error(stringf("Expected next serial %o, got %o", nextExpectedSerial_, - firstSerial)); - } - nextExpectedSerial_ = lastSerial + 1; - streamf(std::cout, "next expected serial %o\n", nextExpectedSerial_); -} - -Stopwatch::Stopwatch() { - auto now = std::chrono::steady_clock::now(); - start_ = now; - last_ = now; -} - -bool Stopwatch::pulse(size_t *elapsedSeconds) { - auto now = std::chrono::steady_clock::now(); - *elapsedSeconds = std::chrono::duration_cast(now - start_).count(); - auto thisPulse = std::chrono::duration_cast(now - last_).count(); - if (thisPulse < 5) { - return false; - } - last_ = now; - return true; -} - -void StatsProcessor::update(size_t rowsRemoved, size_t rowsAdded, - size_t rowsModifiedEstimated, size_t cellsModified) { - rowsRemoved_ += rowsRemoved; - rowsAdded_ += rowsAdded; - rowsModifiedEstimated_ += rowsModifiedEstimated; - cellsModified_ += cellsModified; -} - -void StatsProcessor::showStats(size_t numCols, size_t elapsedSeconds) { - auto deltaRemoved = rowsRemoved_ - lastRowsRemoved_; - auto deltaAdded = rowsAdded_ - lastRowsAdded_; - auto deltaModifiedRows = rowsModifiedEstimated_ - lastRowsModifiedEstimated_; - auto deltaModifiedCells = cellsModified_ - lastCellsModified_; - auto totalRows = rowsRemoved_ + rowsAdded_ + rowsModifiedEstimated_; - auto totalCells = rowsRemoved_ * numCols + rowsAdded_ * numCols + cellsModified_; - auto rowsPerSec = totalRows / elapsedSeconds; - auto cellsPerSec = totalCells / elapsedSeconds; - - lastRowsRemoved_ = rowsRemoved_; - lastRowsAdded_ = rowsAdded_; - lastRowsModifiedEstimated_ = rowsModifiedEstimated_; - lastCellsModified_ = cellsModified_; - streamf(std::cout, - "removed %o rows, added %o rows, modified %o rows (%o cells) (totals %o, %o, %o, %o). " - "Total %o rows (%o cells) in %o seconds (%o rows / second) (%o cells / second)\n", - deltaRemoved, deltaAdded, deltaModifiedRows, deltaModifiedCells, - rowsRemoved_, rowsAdded_, rowsModifiedEstimated_, cellsModified_, - totalRows, totalCells, elapsedSeconds, rowsPerSec, cellsPerSec); -} - -void TableScanner::scanTable(const Table &table) { - auto start = std::chrono::system_clock::now(); - auto ncols = table.numColumns(); - auto nrows = table.numRows(); - std::vector results(ncols); - auto allRows = RowSequence::createSequential(0, nrows); - for (size_t colNum = 0; colNum < ncols; ++colNum) { - const auto &col = table.getColumn(colNum); - auto chunk = ChunkMaker::createChunkFor(*col, nrows); - col->fillChunk(*allRows, &chunk.unwrap()); - - // Assume for now that all the columns are int64_t - const auto &typedChunk = chunk.get(); - int64_t total = 0; - for (auto element : typedChunk) { - total += element; - } - results[colNum] = total; - } - auto end = std::chrono::system_clock::now(); - auto duration = std::chrono::duration_cast(end - start).count(); - auto durationMillis = (double)duration / 1'000; - streamf(std::cout, "Table scan took %o millis. Sums are %o\n", durationMillis, - separatedList(results.begin(), results.end(), ", ")); -} - -void FragmentationAnalyzer::analyze(const Table &table) { - for (size_t i = 0; i < table.numColumns(); ++i) { - const auto &col = table.getColumn(i); - auto what = stringf("Col %o", i); - analyzeHelper(what, *col); - } -} - -void FragmentationAnalyzer::analyzeHelper(std::string_view what, const ColumnSource &col) { - const auto underlying = col.backdoor(); - const auto * const *vecpp = std::any_cast*>(&underlying); - if (vecpp == nullptr) { - return; - } - const auto *src = *vecpp; - std::map sizes; - auto analyze = [&sizes](const int64_t *begin, const int64_t *end) { - auto size = end - begin; - ++sizes[size]; - }; - immer::for_each_chunk(src->begin(), src->end(), analyze); - - auto renderSize = [](std::ostream &s, const std::pair &p) { - streamf(s, "%o:%o", p.first, p.second); - }; - - streamf(std::cout, "Immer histogram for %o: %o\n", what, separatedList(sizes.begin(), sizes.end(), - ", ", renderSize)); -} - -UserConfig::UserConfig(std::string server, bool wantLastBy, bool wantImmer, int64_t period, - int64_t tableSize, int64_t endSerialNumber, int64_t keyFactor, int64_t numAdditionalCols) : - server_(std::move(server)), wantLastBy_(wantLastBy), wantImmer_(wantImmer), period_(period), - tableSize_(tableSize),endSerialNumber_(endSerialNumber), keyFactor_(keyFactor), - numAdditionalCols_(numAdditionalCols) {} -UserConfig::~UserConfig() = default; - -std::string getWhat(std::exception_ptr ep) { - try { - std::rethrow_exception(std::move(ep)); - } catch (const std::exception &e) { - return e.what(); - } catch (...) { - return "(unknown exception)"; - } -} - -std::ostream &operator<<(std::ostream &s, const UserConfig &o) { - return streamf(s, "server: %o\n" - "wantLastBy: %o\n" - "wantImmer: %o\n" - "period: %o\n" - "tableSize: %o\n" - "endSerialNumber: %o\n" - "keyFactor: %o\n" - "numAdditionalCols: %o", - o.server_, o.wantLastBy_, o.wantImmer_, o.period_, o.tableSize_, o.endSerialNumber_, o.keyFactor_, - o.numAdditionalCols_); -} -} // namespace diff --git a/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt b/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt index 6269e738a55..25488fa7962 100644 --- a/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt +++ b/cpp-examples/create_table_with_arrow_flight/CMakeLists.txt @@ -6,12 +6,6 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(create_table_with_arrow_flight main.cc) target_link_libraries(create_table_with_arrow_flight deephaven::client) diff --git a/cpp-examples/create_table_with_arrow_flight/main.cc b/cpp-examples/create_table_with_arrow_flight/main.cc index 94c874df43f..b992d4ff429 100644 --- a/cpp-examples/create_table_with_arrow_flight/main.cc +++ b/cpp-examples/create_table_with_arrow_flight/main.cc @@ -53,7 +53,7 @@ void doit(const TableHandleManager &manager) { okOrThrow(DEEPHAVEN_EXPR_MSG(schemaBuilder.AddField(priceField))); } - // 4. Add "Volume" column (type: int) to schema + // 4. Add "Volume" column (type: int32) to schema { auto volumeMetadata = std::make_shared(); okOrThrow(DEEPHAVEN_EXPR_MSG(volumeMetadata->Set("deephaven:type", "int"))); diff --git a/cpp-examples/create_table_with_table_maker/CMakeLists.txt b/cpp-examples/create_table_with_table_maker/CMakeLists.txt index 1ab8e343f60..01057ca522d 100644 --- a/cpp-examples/create_table_with_table_maker/CMakeLists.txt +++ b/cpp-examples/create_table_with_table_maker/CMakeLists.txt @@ -6,12 +6,6 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(create_table_with_table_maker main.cc) target_link_libraries(create_table_with_table_maker deephaven::client) diff --git a/cpp-examples/do_exchange/CMakeLists.txt b/cpp-examples/do_exchange/CMakeLists.txt deleted file mode 100644 index 8e00f4a7a9b..00000000000 --- a/cpp-examples/do_exchange/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(do_exchange) - -set(CMAKE_CXX_STANDARD 17) - - -add_subdirectory(../../cpp-client/deephaven deephaven_dir) -#find_package(deephaven REQUIRED) - -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) -find_package(Immer REQUIRED) - -add_executable(do_exchange main.cc) - -target_link_libraries(do_exchange deephaven::client) diff --git a/cpp-examples/do_exchange/main.cc b/cpp-examples/do_exchange/main.cc deleted file mode 100644 index 08817531c55..00000000000 --- a/cpp-examples/do_exchange/main.cc +++ /dev/null @@ -1,556 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include -#include -#include -#include - -#include "deephaven/client/client.h" -#include "deephaven/client/ticking.h" -#include "deephaven/client/chunk/chunk_maker.h" -#include "deephaven/client/chunk/chunk.h" -#include "deephaven/client/container/row_sequence.h" -#include "deephaven/client/table/table.h" -#include "deephaven/client/utility/table_maker.h" -#include "deephaven/client/utility/utility.h" -#include "immer/algorithm.hpp" - -using deephaven::client::Client; -using deephaven::client::NumCol; -using deephaven::client::SortPair; -using deephaven::client::TableHandle; -using deephaven::client::TableHandleManager; -using deephaven::client::TickingCallback; -using deephaven::client::ClassicTickingUpdate; -using deephaven::client::ImmerTickingUpdate; -using deephaven::client::chunk::ChunkMaker; -using deephaven::client::chunk::AnyChunk; -using deephaven::client::chunk::ChunkVisitor; -using deephaven::client::container::RowSequence; -using deephaven::client::container::RowSequenceBuilder; -using deephaven::client::chunk::DoubleChunk; -using deephaven::client::chunk::Int32Chunk; -using deephaven::client::chunk::Int64Chunk; -using deephaven::client::chunk::UInt64Chunk; -using deephaven::client::table::Table; -using deephaven::client::utility::makeReservedVector; -using deephaven::client::utility::okOrThrow; -using deephaven::client::utility::separatedList; -using deephaven::client::utility::streamf; -using deephaven::client::utility::stringf; -using deephaven::client::utility::TableMaker; -using deephaven::client::utility::valueOrThrow; - -using std::size_t; - -namespace { -void doit(const TableHandleManager &manager); -void makeModifiesHappen(const TableHandleManager &manager); -void millionRows(const TableHandleManager &manager); -void lastBy(const TableHandleManager &manager); -void varietyOfTypes(const TableHandleManager &manager); -void demo(const TableHandleManager &manager); -template -void ensure(std::vector *vec, size_t size); -template -struct optionalAdaptor_t { - explicit optionalAdaptor_t(const std::optional &value) : value_(value) {} - const std::optional &value_; - - friend std::ostream &operator<<(std::ostream &s, const optionalAdaptor_t &o) { - if (!o.value_.has_value()) { - return s << "[none]"; - } - return s << *o.value_; - } -}; - -template -optionalAdaptor_t adaptOptional(const std::optional &value) { - return optionalAdaptor_t(value); -} -} // namespace - -int main() { - const char *server = "localhost:10000"; - try { - auto client = Client::connect(server); - auto manager = client.getManager(); - varietyOfTypes(manager); - } catch (const std::exception &e) { - std::cerr << "Caught exception: " << e.what() << '\n'; - } -} - -// TODO(kosak): we should standardize on either deephaven or io::deephaven - -namespace { -class Callback final : public TickingCallback { -public: - void onFailure(std::exception_ptr ep) final; - void onTick(const ClassicTickingUpdate &update) final; - void onTick(ImmerTickingUpdate update) final; - - bool failed() const { return failed_; } - -private: - std::atomic failed_ = false; -}; - -class DemoCallback final : public TickingCallback { -public: - void onFailure(std::exception_ptr ep) final; - void onTick(const ClassicTickingUpdate &update) final; - void onTick(ImmerTickingUpdate update) final; - -private: - void processClassicCommon(const Table &table, const UInt64Chunk &affectedRows); - void processImmerCommon(const Table &table, const RowSequence &affectedRows); - void updateCache(const Int64Chunk &tableContentsKeys, const Int64Chunk &tableContentsValues); - void periodicCheck(); - - std::vector> receivedValues_; - std::vector> recalcedValues_; - int64_t maxValueReceived_ = -1; - int64_t nextValueToRecalc_ = 0; -}; - -// or maybe make a stream manipulator -std::string getWhat(std::exception_ptr ep); - -void Callback::onFailure(std::exception_ptr ep) { - streamf(std::cerr, "Callback reported failure: %o\n", getWhat(std::move(ep))); - failed_ = true; -} - -class ElementStreamer final { -public: - ElementStreamer(std::ostream &s, size_t index) : s_(s), index_(index) {} - - template - void operator()(const T &chunk) const { - s_ << chunk.data()[index_]; - } - -private: - std::ostream &s_; - size_t index_ = 0; -}; - -void dumpTable(std::string_view what, const Table &table, const std::vector &whichCols, - std::shared_ptr rows); - -void Callback::onTick(const ClassicTickingUpdate &update) { - streamf(std::cout, "adds: %o\n", *update.addedRowsKeySpace()); - auto render = [](std::ostream &s, const std::shared_ptr &rs) { - s << *rs; - }; - streamf(std::cout, "modifies: %o\n", separatedList(update.modifiedRowsKeySpace().begin(), - update.modifiedRowsKeySpace().end(), " === ", render)); -} - -void Callback::onTick(ImmerTickingUpdate update) { - auto ncols = update.current()->numColumns(); - auto allCols = makeReservedVector(update.current()->numColumns()); - for (size_t i = 0; i < ncols; ++i) { - allCols.push_back(i); - } - dumpTable("removed", *update.beforeRemoves(), allCols, update.removed()); - for (size_t i = 0; i < update.modified().size(); ++i) { - std::vector oneCol{i}; - auto prevText = stringf("Col%o-prev", i); - auto currText = stringf("Col%o-curr", i); - dumpTable(prevText, *update.beforeModifies(), allCols, update.modified()[i]); - dumpTable(currText, *update.current(), allCols, update.modified()[i]); - } - dumpTable("added", *update.current(), allCols, update.added()); -} - -void dumpTable(std::string_view what, const Table &table, const std::vector &whichCols, - std::shared_ptr rows) { - if (rows->empty()) { - return; - } - streamf(std::cout, "===== THIS IS %o =====\n", what); - // Deliberately chosen to be small so I can test chunking. - const size_t chunkSize = 16; - - auto ncols = whichCols.size(); - auto chunks = makeReservedVector(ncols); - for (auto col : whichCols) { - const auto &c = table.getColumn(col); - auto chunk = ChunkMaker::createChunkFor(*c, chunkSize); - chunks.push_back(std::move(chunk)); - } - - while (true) { - auto chunkOfRows = rows->take(chunkSize); - rows = rows->drop(chunkSize); - auto thisSize = chunkOfRows->size(); - if (thisSize == 0) { - break; - } - - for (size_t i = 0; i < ncols; ++i) { - const auto &c = table.getColumn(whichCols[i]); - auto &chunk = chunks[i].unwrap(); - c->fillChunk(*chunkOfRows, &chunk); - } - - for (size_t j = 0; j < thisSize; ++j) { - ElementStreamer es(std::cout, j); - auto chunkAcceptor = [&es](std::ostream &s, const AnyChunk &chunk) { - chunk.visit(es); - }; - std::cout << separatedList(chunks.begin(), chunks.end(), ", ", chunkAcceptor) << '\n'; - } - } -} - -void doit(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - auto tt1 = manager - .timeTable(start, 1 * 1'000'000'000L) -// .select("Foo = (ii % 20)", "Bar = ii") -// .select("Foo = ii < 3 ? ii * 10 : (i == 3 ? 15 : (i == 4 ? 12 : 3))" -// // .select("Foo = ii < 10 ? ii * 10 : 23") - .select("Foo = ((ii * 0xdeadbeef) + 0xbaddbabe) % 5000", "Bar = 34.2 + ii", "II = ii", "SomeInt = (int) Bar") - .sort({SortPair::ascending("Foo", false)}) - .head(10) - //.tail(3) // this will give us deletes - ; - //auto tt2 = manager.timeTable(start, 2 * 1'000'000'000L).select("TS2 = Timestamp"); - //auto t = tt1.crossJoin(tt2, std::vector(), {}); - - - // tt1.bindToVariable("showme"); - - // // .select("Foo = (ii % 20)") - // // .select("Foo = ii < 3 ? ii * 10 : (i == 3 ? 15 : (i == 4 ? 12 : 3))") - // // .select("Foo = ii < 10 ? ii * 10 : 23") - // .select("Foo = ((ii * 0xdeadbeef) + 0xbaddbabe) % 5000") - // .sort({SortPair::ascending("Foo", false)}) - // .head(10); - - auto myCallback = std::make_shared(); - auto subscriptionHandle = tt1.subscribe(myCallback, true); - uint32_t tens_of_seconds_to_run = 50000; - while (tens_of_seconds_to_run-- > 0) { - std::this_thread::sleep_for(std::chrono::milliseconds (100)); - if (myCallback->failed()) { - std::cerr << "callback reported failure, aborting in main subscription thread.\n"; - break; - } - } - std::cerr << "I unsubscribed here.\n"; - tt1.unsubscribe(std::move(subscriptionHandle)); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting.\n"; -} - -// let's keep this off to the side -// auto tLeft = manager -// .emptyTable(10) -// .select("II = ii", "Zamboni = `zamboni`+ii"); -// auto tRight = manager -// .timeTable(start, 1 * 1'000'000'000L) -// .update("II = 0L") -// .tail(1); -// auto tt1 = tLeft.naturalJoin(tRight, {"II"}, {}); - - -// also this -// auto tt1 = manager -// .timeTable(start, 1 * 1'000'000'000L) -// // .select("Foo = (ii % 20)") -// // .select("Foo = ii < 3 ? ii * 10 : (i == 3 ? 15 : (i == 4 ? 12 : 3))") -// // .select("Foo = ii < 10 ? ii * 10 : 23") -// .select("Foo = ((ii * 0xdeadbeef) + 0xbaddbabe) % 5000") -// .sort({SortPair::ascending("Foo", false)}) -// .head(10); -//.tail(3); // this will give us deletes -//auto tt2 = manager.timeTable(start, 2 * 1'000'000'000L).select("TS2 = Timestamp"); -//auto t = tt1.crossJoin(tt2, std::vector(), {}); - - -// tt1.bindToVariable("showme"); - -// // .select("Foo = (ii % 20)") -// // .select("Foo = ii < 3 ? ii * 10 : (i == 3 ? 15 : (i == 4 ? 12 : 3))") -// // .select("Foo = ii < 10 ? ii * 10 : 23") -// .select("Foo = ((ii * 0xdeadbeef) + 0xbaddbabe) % 5000") -// .sort({SortPair::ascending("Foo", false)}) -// .head(10); - - -void makeModifiesHappen(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - - auto tLeft = manager - .emptyTable(10) - .select("II = ii", "Zamboni = ii"); - auto tRight = manager - .timeTable(start, 1 * 1'000'000'000L) - .select("II = 0L", "TS = (long)(Timestamp.getNanos()/1000000000)") - .tail(1); - auto tt1 = tLeft.naturalJoin(tRight, {"II"}, {}).select("II", "Zamboni", "TS"); - - tt1.bindToVariable("showme"); - - auto myCallback = std::make_shared(); - auto handle = tt1.subscribe(myCallback, true); - std::this_thread::sleep_for(std::chrono::seconds(5'000)); - std::cerr << "I unsubscribed here\n"; - tt1.unsubscribe(std::move(handle)); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -void millionRows(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - -// const size_t topAndBottomSize = 500'000; - const size_t topAndBottomSize = 10; - auto tTop = manager.emptyTable(topAndBottomSize).select("Value = ii"); - auto tBottom = manager.emptyTable(topAndBottomSize).select("Value = 10_000_000 + ii"); - auto pulsatingMiddle = manager.timeTable(start, 1 * 1'000'000'000L) - .tail(10) - .select("Selector = ((int)(Timestamp.getNanos() / 1_000_000_000)) % 20") - .where("Selector < 10") - .select("Value = 1_000_000L + Selector"); - - auto table = tTop.merge({pulsatingMiddle, tBottom}); - - table.bindToVariable("showme"); - - auto myCallback = std::make_shared(); - auto handle = table.subscribe(myCallback, true); - std::this_thread::sleep_for(std::chrono::seconds(5'000)); - std::cerr << "I unsubscribed here\n"; - table.unsubscribe(handle); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -void demo(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - - const long modSize = 1000; - auto table = manager.timeTable(start, 1 * 100'000'000L) - .view("II = ii") - .where("II < 500") - .view("Temp1 = (II ^ (long)(II / 65536)) * 0x8febca6b", - "Temp2 = (Temp1 ^ ((long)(Temp1 / 8192))) * 0xc2b2ae35", - "HashValue = Temp2 ^ (long)(Temp2 / 65536)", - "II"); - - // might as well use this interface once in a while - auto [hv, ii] = table.getCols("HashValue", "II"); - auto t2 = table.view((hv % modSize).as("Key"), "Value = II"); - auto key = t2.getNumCol("Key"); - auto lb = t2.lastBy(key).sort({key.ascending()}); - - lb.bindToVariable("showme"); - - auto myCallback = std::make_shared(); - auto handle = lb.subscribe(myCallback, false); - std::this_thread::sleep_for(std::chrono::seconds(5'000)); - std::cerr << "I unsubscribed here\n"; - lb.unsubscribe(handle); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -void lastBy(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - - const long modSize = 10; - auto table = manager.timeTable(start, 1 * 10'000'000L) - .select("II = ii") - .where("II < 2000") - .select("Temp1 = (II ^ (long)(II / 65536)) * 0x8febca6b", - "Temp2 = (Temp1 ^ ((long)(Temp1 / 8192))) * 0xc2b2ae35", - "HashValue = Temp2 ^ (long)(Temp2 / 65536)", - "II"); - - // might as well use this interface once in a while - auto [hv, ii] = table.getCols("HashValue", "II"); - auto t2 = table.select((hv % modSize).as("Key"), "Value = II"); - auto key = t2.getNumCol("Key"); - auto lb = t2.lastBy(key).sort({key.ascending()}); - - lb.bindToVariable("showme"); - - auto myCallback = std::make_shared(); - auto handle = lb.subscribe(myCallback, true); - std::this_thread::sleep_for(std::chrono::seconds(5'000)); - std::cerr << "I unsubscribed here\n"; - lb.unsubscribe(handle); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -void varietyOfTypes(const TableHandleManager &manager) { - auto start = std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - - auto table = manager.timeTable(start, 1 * 1'000'000'000L) - .select("XXX = `hello`", "YYY = (short)12", "ZZZ = (byte)65", "QQ = `true`"); - - table.bindToVariable("showme"); - - auto myCallback = std::make_shared(); - auto handle = table.subscribe(myCallback, true); - std::this_thread::sleep_for(std::chrono::seconds(8)); - std::cerr << "I unsubscribed here\n"; - table.unsubscribe(handle); - std::this_thread::sleep_for(std::chrono::seconds(5)); - std::cerr << "exiting\n"; -} - -void DemoCallback::onFailure(std::exception_ptr ep) { - streamf(std::cerr, "Callback reported failure: %o\n", getWhat(std::move(ep))); -} - -void DemoCallback::onTick(const ClassicTickingUpdate &update) { - const auto &table = *update.currentTableIndexSpace(); - const auto &addedRows = update.addedRowsIndexSpace(); - if (table.numColumns() != 2) { - throw std::runtime_error(stringf("Expected 2 columns, got %o", table.numColumns())); - } - processClassicCommon(table, addedRows); - - const auto &modifiedRows = update.modifiedRowsIndexSpace(); - if (!modifiedRows.empty()) { - if (modifiedRows.size() != 2) { - throw std::runtime_error(stringf("Expected 2 modified rows, got %o", modifiedRows.size())); - } - const auto &tableContentsKeyMods = modifiedRows[0]; - const auto &tableContenstsValueMods = modifiedRows[1]; - if (tableContentsKeyMods.size() != 0) { - throw std::runtime_error( - stringf("Our application doesn't modify the key column, but got %o", - tableContentsKeyMods.size())); - } - processClassicCommon(table, tableContenstsValueMods); - } - periodicCheck(); -} - -void DemoCallback::processClassicCommon(const Table &table, const UInt64Chunk &affectedRows) { - auto nrows = affectedRows.size(); - auto tableContentsKeys = Int64Chunk::create(nrows); - auto tableContentsValues = Int64Chunk::create(nrows); - const auto &keyCol = table.getColumn(0); - const auto &valueCol = table.getColumn(1); - keyCol->fillChunkUnordered(affectedRows, &tableContentsKeys); - valueCol->fillChunkUnordered(affectedRows, &tableContentsValues); - updateCache(tableContentsKeys, tableContentsValues); -} - -void DemoCallback::onTick(ImmerTickingUpdate update) { - const auto &table = *update.current(); - const auto &added = *update.added(); - if (table.numColumns() != 2) { - throw std::runtime_error(stringf("Expected 2 columns, got %o", table.numColumns())); - } - processImmerCommon(table, added); - - const auto &modified = update.modified(); - if (!modified.empty()) { - if (modified.size() != 2) { - throw std::runtime_error(stringf("Expected 2 modified rows, got %o", modified.size())); - } - const auto &tableContentsKeyMods = *modified[0]; - const auto &tableContenstsValueMods = *modified[1]; - if (!tableContentsKeyMods.empty()) { - throw std::runtime_error(stringf("Our application doesn't modify the key column, but got %o", - tableContentsKeyMods.size())); - } - processImmerCommon(table, tableContenstsValueMods); - } - periodicCheck(); -} - -void DemoCallback::processImmerCommon(const Table &table, const RowSequence &affectedRows) { - auto nrows = affectedRows.size(); - auto tableContentsKeys = Int64Chunk::create(nrows); - auto tableContentsValues = Int64Chunk::create(nrows); - const auto &keyCol = table.getColumn(0); - const auto &valueCol = table.getColumn(1); - keyCol->fillChunk(affectedRows, &tableContentsKeys); - valueCol->fillChunk(affectedRows, &tableContentsValues); - updateCache(tableContentsKeys, tableContentsValues); -} - -void DemoCallback::updateCache(const Int64Chunk &tableContentsKeys, const Int64Chunk &tableContentsValues) { - auto size = tableContentsKeys.size(); - if (size != tableContentsValues.size()) { - throw std::runtime_error( - stringf("Expected tableContentsKeys.size() == tableContentsValues.size(), got (%o != %o)", - size, tableContentsValues.size())); - } - for (size_t i = 0; i < size; ++i) { - auto key = tableContentsKeys.data()[i]; - auto value = tableContentsValues.data()[i]; - streamf(std::cout, "%o - %o\n", key, value); - ensure(&receivedValues_, key + 1); - receivedValues_[key] = value; - maxValueReceived_ = std::max(maxValueReceived_, value); - } -} - -void DemoCallback::periodicCheck() { - streamf(std::cout, "hello, max value seen is %o\n", maxValueReceived_); - - auto end = maxValueReceived_ + 1; - for (auto ii = nextValueToRecalc_; ii != end; ++ii) { - // We need to do these divides as floating point because that's what the server is doing. - auto temp1 = (ii ^ (int64_t)(ii / 65536.0)) * 0x8febca6b; - auto temp2 = (temp1 ^ ((int64_t)(temp1 / 8192.0))) * 0xc2b2ae35; - auto hashValue = temp2 ^ (int64_t)(temp2 / 65536.0); - auto key = hashValue % 1000; - auto value = ii; - ensure(&recalcedValues_, key + 1); - recalcedValues_[key] = value; - } - - if (receivedValues_.size() != recalcedValues_.size()) { - throw std::runtime_error(stringf("receivedValues_.size() != recalcedValues_.size() (%o != %o)", - receivedValues_.size(), recalcedValues_.size())); - } - - for (auto ii = nextValueToRecalc_; ii != end; ++ii) { - if (receivedValues_[ii] == recalcedValues_[ii]) { - continue; - } - throw std::runtime_error(stringf("At offset %o, received != recalc (%o != %o)", - ii, adaptOptional(receivedValues_[ii]), adaptOptional(recalcedValues_[ii]))); - } - - nextValueToRecalc_ = end; -} - -template -void ensure(std::vector *vec, size_t size) { - if (size > vec->size()) { - vec->resize(size); - } -} - -std::string getWhat(std::exception_ptr ep) { - try { - std::rethrow_exception(std::move(ep)); - } catch (const std::exception &e) { - return e.what(); - } catch (...) { - return "(unknown exception)"; - } -} -} // namespace diff --git a/cpp-examples/hello_world/CMakeLists.txt b/cpp-examples/hello_world/CMakeLists.txt index 6e021454316..594c2a39004 100644 --- a/cpp-examples/hello_world/CMakeLists.txt +++ b/cpp-examples/hello_world/CMakeLists.txt @@ -6,12 +6,6 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(hello_world main.cc) target_link_libraries(hello_world deephaven::client) diff --git a/cpp-examples/read_csv/CMakeLists.txt b/cpp-examples/read_csv/CMakeLists.txt new file mode 100644 index 00000000000..44a88f9ae92 --- /dev/null +++ b/cpp-examples/read_csv/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.16) +project(read_csv) + +set(CMAKE_CXX_STANDARD 17) + +add_subdirectory(../../cpp-client/deephaven deephaven_dir) +#find_package(deephaven REQUIRED) + +add_executable(read_csv main.cc) + +target_link_libraries(read_csv deephaven::client) diff --git a/cpp-examples/readcsv/main.cc b/cpp-examples/read_csv/main.cc similarity index 100% rename from cpp-examples/readcsv/main.cc rename to cpp-examples/read_csv/main.cc diff --git a/cpp-examples/read_csv/test.csv b/cpp-examples/read_csv/test.csv new file mode 100644 index 00000000000..657cce95db2 --- /dev/null +++ b/cpp-examples/read_csv/test.csv @@ -0,0 +1,2 @@ +A,B,C +1,2.2,"three" diff --git a/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt b/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt index f2c7b7f3d98..1be006b247c 100644 --- a/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt +++ b/cpp-examples/read_table_with_arrow_flight/CMakeLists.txt @@ -7,12 +7,6 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(read_table_with_arrow_flight main.cc) target_link_libraries(read_table_with_arrow_flight deephaven::client) diff --git a/cpp-examples/readcsv/CMakeLists.txt b/cpp-examples/readcsv/CMakeLists.txt deleted file mode 100644 index f3fcb96daf0..00000000000 --- a/cpp-examples/readcsv/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(readcsv) - -set(CMAKE_CXX_STANDARD 17) - -add_subdirectory(../../cpp-client/deephaven deephaven_dir) -#find_package(deephaven REQUIRED) - -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - -add_executable(readcsv main.cc) - -target_link_libraries(readcsv deephaven::client) From 1a40f8b79f5368cb1e158aa4c2c22ed521069020 Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Wed, 7 Sep 2022 20:23:20 -0400 Subject: [PATCH 113/215] C++ client examples used in our demo videos. (#2821) --- cpp-examples/demos/CMakeLists.txt | 19 ++ cpp-examples/demos/chapter1.cc | 205 ++++++++++++++++++++ cpp-examples/demos/chapter2.cc | 305 ++++++++++++++++++++++++++++++ 3 files changed, 529 insertions(+) create mode 100644 cpp-examples/demos/CMakeLists.txt create mode 100644 cpp-examples/demos/chapter1.cc create mode 100644 cpp-examples/demos/chapter2.cc diff --git a/cpp-examples/demos/CMakeLists.txt b/cpp-examples/demos/CMakeLists.txt new file mode 100644 index 00000000000..1739b6f870b --- /dev/null +++ b/cpp-examples/demos/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.16) +project(demos) + +set(CMAKE_CXX_STANDARD 17) + +add_subdirectory(../../cpp-client/deephaven deephaven_dir) +#find_package(deephaven REQUIRED) + +find_package(Arrow REQUIRED) +find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) +find_package(Protobuf REQUIRED) +find_package(gRPC REQUIRED) +find_package(Threads REQUIRED) + +add_executable(chapter1 chapter1.cc) +add_executable(chapter2 chapter2.cc) + +target_link_libraries(chapter1 deephaven::client) +target_link_libraries(chapter2 deephaven::client) diff --git a/cpp-examples/demos/chapter1.cc b/cpp-examples/demos/chapter1.cc new file mode 100644 index 00000000000..9e1a8294035 --- /dev/null +++ b/cpp-examples/demos/chapter1.cc @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include +#include +#include +#include +#include "deephaven/client/client.h" + +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; + +namespace { +void mainMenu(); + +// demo options +void printStaticTable(const TableHandleManager &manager); +void withArrow(const TableHandleManager &manager); +void interactiveWhereClause1(const TableHandleManager &manager); +void interactiveWhereClause2(const TableHandleManager &manager); + +// utilities +void printTable(const TableHandle &table, bool nullAware); +void checkNotNull(const void *p, std::string_view where); +int64_t readNumber(std::istream &s); + +// a bunch of work to create an ostream adaptor +template +class OptionalAdaptor { +public: + explicit OptionalAdaptor(const ARROW_OPTIONAL &optional) : optional_(optional) {} + +private: + const ARROW_OPTIONAL &optional_; + + friend std::ostream &operator<<(std::ostream &s, const OptionalAdaptor &self) { + if (!self.optional_.has_value()) { + return s << "null"; + } + return s << *self.optional_; + } +}; + +template +inline OptionalAdaptor adaptOptional(const ARROW_OPTIONAL &optional) { + return OptionalAdaptor(optional); +} +} // namespace + +int main() { + try { + while (true) { + mainMenu(); + } + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { +void mainMenu() { + std::cout << "*** CHAPTER 1: MAIN MENU ***\n" + "1 - printStaticTable\n" + "2 - withArrow\n" + "3 - interactiveWhereClause1\n" + "4 - interactiveWhereClause2\n" + "\n" + "Please select 1-4: "; + + auto selection = readNumber(std::cin); + + const char *server = "localhost:10000"; + auto client = Client::connect(server); + auto manager = client.getManager(); + + switch (selection) { + case 1: + printStaticTable(manager); + break; + + case 2: + withArrow(manager); + break; + + case 3: + interactiveWhereClause1(manager); + break; + + case 4: + interactiveWhereClause2(manager); + break; + + default: + std::cout << "Invalid selection\n"; + } +} + +void printStaticTable(const TableHandleManager &manager) { + auto table = manager.fetchTable("demo1"); + std::cout << table.stream(true) << std::endl; +} + +void withArrow(const TableHandleManager &manager) { + auto table = manager.fetchTable("demo1"); + + std::cout << "Do you want the null-aware version? [y/n]"; + std::string response; + std::getline(std::cin, response); + + auto nullAware = !response.empty() && response[0] == 'y'; + printTable(table, nullAware); +} + +void interactiveWhereClause1(const TableHandleManager &manager) { + std::cout << "Enter limit: "; + auto limit = readNumber(std::cin); + + std::ostringstream whereClause; + whereClause << "Int64Value < " << limit; + std::cout << "NOTE: 'where' expression is " << whereClause.str() << '\n'; + + auto table = manager.fetchTable("demo1"); + table = table.where(whereClause.str()); + printTable(table, true); +} + +void interactiveWhereClause2(const TableHandleManager &manager) { + std::cout << "Enter limit: "; + auto limit = readNumber(std::cin); + + auto table = manager.fetchTable("demo1"); + auto intCol = table.getNumCol("Int64Value"); + table = table.where(intCol < limit); + printTable(table, true); +} + +void printTable(const TableHandle &table, bool nullAware) { + auto fsr = table.getFlightStreamReader(); + + while (true) { + arrow::flight::FlightStreamChunk chunk; + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr->Next(&chunk))); + if (chunk.data == nullptr) { + break; + } + + auto int64Data = chunk.data->GetColumnByName("Int64Value"); + checkNotNull(int64Data.get(), DEEPHAVEN_DEBUG_MSG("Int64Value column not found")); + auto doubleData = chunk.data->GetColumnByName("DoubleValue"); + checkNotNull(doubleData.get(), DEEPHAVEN_DEBUG_MSG("DoubleValue column not found")); + + auto int64Array = std::dynamic_pointer_cast(int64Data); + checkNotNull(int64Array.get(), DEEPHAVEN_DEBUG_MSG("intData was not an arrow::Int64Array")); + auto doubleArray = std::dynamic_pointer_cast(doubleData); + checkNotNull(doubleArray.get(), DEEPHAVEN_DEBUG_MSG("doubleData was not an arrow::DoubleArray")); + + if (int64Array->length() != doubleArray->length()) { + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Lengths differ")); + } + + if (!nullAware) { + for (int64_t i = 0; i < int64Array->length(); ++i) { + auto int64Value = int64Array->Value(i); + auto doubleValue = doubleArray->Value(i); + std::cout << int64Value << ' ' << doubleValue << '\n'; + } + } else { + for (int64_t i = 0; i < int64Array->length(); ++i) { + // We use the indexing operator (operator[]) which returns an arrow "optional" type, + // which is a workalike to std::optional. + auto int64Value = (*int64Array)[i]; + auto doubleValue = (*doubleArray)[i]; + // We use our own "ostream adaptor" to provide a handy way to write these arrow optionals + // to an ostream. + std::cout << adaptOptional(int64Value) << ' ' << adaptOptional(doubleValue) << '\n'; + } + } + } +} + +void checkNotNull(const void *p, std::string_view where) { + if (p != nullptr) { + return; + } + throw std::runtime_error(std::string(where)); +} + +int64_t readNumber(std::istream &s) { + while (true) { + std::string line; + std::getline(s, line); + if (line.empty()) { + continue; + } + int64_t result; + auto [ptr, ec] = std::from_chars(line.data(), line.data() + line.size(), result); + if (ec == std::errc()) { + return result; + } + std::cout << "Input not parseable as int64. Please try again\n"; + } +} + +} // namespace diff --git a/cpp-examples/demos/chapter2.cc b/cpp-examples/demos/chapter2.cc new file mode 100644 index 00000000000..c2525560705 --- /dev/null +++ b/cpp-examples/demos/chapter2.cc @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include +#include +#include +#include +#include "deephaven/client/client.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::column::Int64ColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::table::Table; +using deephaven::client::utility::verboseCast; + +namespace { +void mainMenu(const TableHandleManager &manager); + +// demo options +void printDynamicTableFull(const TableHandleManager &manager); +void printDiffs(const TableHandleManager &manager); +void sumColumnsFull(const TableHandleManager &manager); +void sumColumnsDiff(const TableHandleManager &manager); + +// utilities +void printTable(const TableHandle &table, bool nullAware); +void checkNotNull(const void *p, std::string_view where); +int64_t readNumber(std::string_view prompt); +std::string readString(std::string_view prompt); + +// a bunch of work to create an ostream adaptor +template +class OptionalAdaptor { +public: + explicit OptionalAdaptor(const ARROW_OPTIONAL &optional) : optional_(optional) {} + +private: + const ARROW_OPTIONAL &optional_; + + friend std::ostream &operator<<(std::ostream &s, const OptionalAdaptor &self) { + if (!self.optional_.has_value()) { + return s << "null"; + } + return s << *self.optional_; + } +}; + +template +inline OptionalAdaptor adaptOptional(const ARROW_OPTIONAL &optional) { + return OptionalAdaptor(optional); +} +} // namespace + +int main() { + try { + const char *server = "localhost:10000"; + auto client = Client::connect(server); + auto manager = client.getManager(); + + while (true) { + mainMenu(manager); + } + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { +void mainMenu(const TableHandleManager &manager) { + auto selection = readNumber( + "*** CHAPTER 2: MAIN MENU ***\n" + "1 - print full table\n" + "2 - print diffs\n" + "3 - sum column - full\n" + "4 - sum column - using diffs\n" + "\n" + "Please select 1-4: " + ); + + switch (selection) { + case 1: + printDynamicTableFull(manager); + break; + + case 2: + printDiffs(manager); + break; + + case 3: + sumColumnsFull(manager); + break; + + case 4: + sumColumnsDiff(manager); + break; + + default: + std::cout << "Invalid selection\n"; + } +} + +class CallbackPrintFull final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + std::cout << "=== The Full Table ===\n" + << update.current()->stream(true, true) + << '\n'; + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } +}; + +void printDynamicTableFull(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +class CallbackPrintDiff final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + if (update.beforeRemoves() != update.afterRemoves()) { + std::cout << "=== REMOVES ===\n" + << update.beforeRemoves()->stream(true, true, update.removedRows()) + << '\n'; + } + if (update.beforeAdds() != update.afterAdds()) { + std::cout << "=== ADDS ===\n" + << update.afterAdds()->stream(true, true, update.addedRows()) + << '\n'; + } + if (update.beforeModifies() != update.afterModifies()) { + std::cout << "=== MODIFIES (BEFORE) ===\n" + << update.beforeModifies()->stream(true, true, update.modifiedRows()) + << '\n'; + std::cout << "=== MODIFIES (AFTER) ===\n" + << update.afterModifies()->stream(true, true, update.modifiedRows()) + << '\n'; + } + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } +}; + +void printDiffs(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +class CallbackSumFull final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + const auto ¤t = update.current(); + auto int64ColGeneric = current->getColumn("IntValue", true); + + const auto *typedInt64Col = + verboseCast(DEEPHAVEN_EXPR_MSG(int64ColGeneric.get())); + + auto rows = current->getRowSequence(); + + size_t chunkSize = 8192; + auto dataChunk = Int64Chunk::create(chunkSize); + + int64_t int64Sum = 0; + while (!rows->empty()) { + auto theseRows = rows->take(chunkSize); + auto theseRowsSize = theseRows->size(); + rows = rows->drop(chunkSize); + + typedInt64Col->fillChunk(*theseRows, &dataChunk, nullptr); + + for (size_t i = 0; i < theseRowsSize; ++i) { + int64Sum += dataChunk.data()[i]; + ++numOps_; + } + } + std::cout << "int64Sum is " << int64Sum << ", cumulative number of ops is " << numOps_ << '\n'; + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } + +private: + size_t numOps_ = 0; +}; + +void sumColumnsFull(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +class CallbackSumDiff final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + processDeltas(*update.beforeRemoves(), update.removedRows(), -1); + processDeltas(*update.afterAdds(), update.addedRows(), 1); + std::cout << "int64Sum is " << int64Sum_ << ", cumulative number of ops is " << numOps_ << '\n'; + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } + +private: + void processDeltas(const Table &table, std::shared_ptr rows, int64_t parity) { + auto int64ColGeneric = table.getColumn("IntValue", true); + + const auto *typedInt64Col = + verboseCast(DEEPHAVEN_EXPR_MSG(int64ColGeneric.get())); + + size_t chunkSize = 8192; + auto dataChunk = Int64Chunk::create(chunkSize); + + while (!rows->empty()) { + auto theseRows = rows->take(chunkSize); + auto theseRowsSize = theseRows->size(); + rows = rows->drop(chunkSize); + + typedInt64Col->fillChunk(*theseRows, &dataChunk, nullptr); + + for (size_t i = 0; i < theseRowsSize; ++i) { + int64Sum_ += dataChunk.data()[i] * parity; + ++numOps_; + } + } + } + +private: + int64_t int64Sum_ = 0; + size_t numOps_ = 0; +}; + +void sumColumnsDiff(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +std::string readString(std::string_view prompt) { + std::cout << prompt; + std::string line; + std::getline(std::cin, line); + return line; +} + +int64_t readNumber(std::string_view prompt) { + while (true) { + auto line = readString(prompt); + if (line.empty()) { + continue; + } + int64_t result; + auto [ptr, ec] = std::from_chars(line.data(), line.data() + line.size(), result); + if (ec == std::errc()) { + return result; + } + std::cout << "Input not parseable as int64. Please try again\n"; + } +} +} // namespace From f1d8922cbf6f3b02156d956b533dcd82230be2c6 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Wed, 7 Sep 2022 22:31:51 -0400 Subject: [PATCH 114/215] Fix improper initial magic number placement in Parquet writing, thereby also "fixing" dictionary offset 0 issue (#2820) --- .../main/java/io/deephaven/parquet/base/ParquetFileWriter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java index 03e6265f137..0deee61fbea 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.OutputStream; +import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.SeekableByteChannel; import java.util.ArrayList; @@ -54,6 +55,7 @@ public ParquetFileWriter( this.allocator = allocator; this.extraMetaData = new HashMap<>(extraMetaData); writeChannel = channelsProvider.getWriteChannel(filePath, false); // TODO add support for appending + writeChannel.write(ByteBuffer.wrap(ParquetFileReader.MAGIC)); this.type = type; this.channelsProvider = channelsProvider; this.compressor = DeephavenCodecFactory.getInstance().getByName(codecName); @@ -78,7 +80,6 @@ public RowGroupWriter addRowGroup(final long size) { public void close() throws IOException { try (final OutputStream os = Channels.newOutputStream(writeChannel)) { - os.write(ParquetFileReader.MAGIC); serializeOffsetIndexes(offsetIndexes, blocks, os); ParquetMetadata footer = new ParquetMetadata(new FileMetaData(type, extraMetaData, Version.FULL_VERSION), blocks); From 16fd9d5a68d8b33b85141bf1a843d312151ecf42 Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Thu, 8 Sep 2022 11:20:16 -0400 Subject: [PATCH 115/215] C++ client: fix documentation cross-references, fill in some more docs. (#2823) --- .../include/public/deephaven/client/client.h | 353 ++++++++++++++---- .../include/public/deephaven/client/columns.h | 49 ++- .../public/deephaven/client/expressions.h | 40 ++ .../include/public/deephaven/client/types.h | 137 ++++++- .../public/deephaven/client/utility/utility.h | 2 +- cpp-client/deephaven/client/src/client.cc | 2 + cpp-client/doc/fluent.rst | 10 +- cpp-client/doc/fluent_columns.rst | 24 +- cpp-client/doc/fluent_expressions.rst | 10 +- cpp-client/doc/main.rst | 8 +- cpp-client/doc/tablehandles.rst | 23 +- cpp-client/doc/types.rst | 6 +- cpp-client/doc/utility.rst | 2 +- .../doc/create_table_with_arrow_flight.rst | 16 +- .../doc/create_table_with_tablemaker.rst | 8 +- cpp-examples/doc/fluent.rst | 106 +++--- cpp-examples/doc/getting_started.rst | 10 +- cpp-examples/doc/index.rst | 2 +- .../doc/read_data_with_arrow_flight.rst | 10 +- 19 files changed, 628 insertions(+), 190 deletions(-) diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/client.h b/cpp-client/deephaven/client/include/public/deephaven/client/client.h index 4fa7686becc..0daa882b440 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/client.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/client.h @@ -198,79 +198,231 @@ class Client { std::shared_ptr impl_; }; +/** + * Defines an aggregator class that represents one of a variet of aggregation operations. + */ class Aggregate { public: + /** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ template static Aggregate absSum(Args &&... args); + /** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ static Aggregate absSum(std::vector columnSpecs); + /** + * Returns an aggregator that computes an array of all values within an aggregation group, + * for each input column. + */ template static Aggregate group(Args &&... args); + + /** + * Returns an aggregator that computes an array of all values within an aggregation group, + * for each input column. + */ static Aggregate group(std::vector columnSpecs); + /** + * Returns an aggregator that computes the average (mean) of values, within an aggregation group, + * for each input column. + */ template static Aggregate avg(Args &&... args); + + /** + * Returns an aggregator that computes the average (mean) of values, within an aggregation group, + * for each input column. + */ static Aggregate avg(std::vector columnSpecs); + /** + * Returns an aggregator that computes the number of elements within an aggregation group. + */ template static Aggregate count(ColArg &&arg); + + /** + * Returns an aggregator that computes the number of elements within an aggregation group. + */ static Aggregate count(std::string columnSpec); + /** + * Returns an aggregator that computes the first value, within an aggregation group, + * for each input column. + */ template static Aggregate first(Args &&... args); + + /** + * Returns an aggregator that computes the first value, within an aggregation group, + * for each input column. + */ static Aggregate first(std::vector columnSpecs); + /** + * Returns an aggregator that computes the last value, within an aggregation group, + * for each input column. + */ template static Aggregate last(Args &&... args); + + /** + * Returns an aggregator that computes the last value, within an aggregation group, + * for each input column. + */ static Aggregate last(std::vector columnSpecs); + /** + * Returns an aggregator that computes the maximum value, within an aggregation group, + * for each input column. + */ template static Aggregate max(Args &&... args); + + /** + * Returns an aggregator that computes the maximum value, within an aggregation group, + * for each input column. + */ static Aggregate max(std::vector columnSpecs); + /** + * Returns an aggregator that computes the median value, within an aggregation group, + * for each input column. + */ template static Aggregate med(Args &&... args); + + /** + * Returns an aggregator that computes the median value, within an aggregation group, + * for each input column. + */ static Aggregate med(std::vector columnSpecs); + /** + * Returns an aggregator that computes the minimum value, within an aggregation group, + * for each input column. + */ template static Aggregate min(Args &&... args); + + /** + * Returns an aggregator that computes the minimum value, within an aggregation group, + * for each input column. + */ static Aggregate min(std::vector columnSpecs); + /** + * Returns an aggregator that computes the designated percentile of values, within an aggregation + * group, for each input column. + */ template static Aggregate pct(double percentile, bool avgMedian, Args &&... args); + + /** + * Returns an aggregator that computes the designated percentile of values, within an aggregation + * group, for each input column. + */ static Aggregate pct(double percentile, bool avgMedian, std::vector columnSpecs); + /** + * Returns an aggregator that computes the standard deviation of values, within an aggregation + * group, for each input column. + */ template static Aggregate std(Args &&... args); + + /** + * Returns an aggregator that computes the standard deviation of values, within an aggregation + * group, for each input column. + */ static Aggregate std(std::vector columnSpecs); + /** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ template static Aggregate sum(Args &&... args); + + /** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ static Aggregate sum(std::vector columnSpecs); + /** + * Returns an aggregator that computes the variance of values, within an aggregation group, + * for each input column. + */ template static Aggregate var(Args &&... args); + + /** + * Returns an aggregator that computes the variance of values, within an aggregation group, + * for each input column. + */ static Aggregate var(std::vector columnSpecs); + /** + * Returns an aggregator that computes the weighted average of values, within an aggregation + * group, for each input column. + */ template static Aggregate wavg(ColArg &&weightColumn, Args &&... args); + /** + * Returns an aggregator that computes the weighted average of values, within an aggregation + * group, for each input column. + */ static Aggregate wavg(std::string weightColumn, std::vector columnSpecs); + /** + * Constructor. + */ explicit Aggregate(std::shared_ptr impl); + /** + * Returns the underlying "impl" object. Used internally. + */ const std::shared_ptr &impl() const { return impl_; } private: std::shared_ptr impl_; }; +/** + * Represents a collection of Aggregate objects. + */ class AggregateCombo { public: + /** + * Create an AggregateCombo from an initializer list. + */ static AggregateCombo create(std::initializer_list list); + /** + * Create an AggregateCombo from a vector. + */ static AggregateCombo create(std::vector vec); + /** + * Move constructor. + */ + AggregateCombo(AggregateCombo &&other) noexcept; + /** + * Move assignment operator. + */ + AggregateCombo &operator=(AggregateCombo &&other) noexcept; + ~AggregateCombo(); + /** + * Returns the underlying "impl" object. Used internally. + */ const std::shared_ptr &impl() const { return impl_; } private: @@ -279,88 +431,158 @@ class AggregateCombo { std::shared_ptr impl_; }; +/** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ template Aggregate aggAbsSum(Args &&... args) { return Aggregate::absSum(std::forward(args)...); } +/** + * Returns an aggregator that computes an array of all values within an aggregation group, + * for each input column. + */ template Aggregate aggGroup(Args &&... args) { return Aggregate::group(std::forward(args)...); } +/** + * Returns an aggregator that computes the average (mean) of values, within an aggregation group, + * for each input column. + */ template Aggregate aggAvg(Args &&... args) { return Aggregate::avg(std::forward(args)...); } +/** + * Returns an aggregator that computes the number of elements within an aggregation group. + */ template Aggregate aggCount(Args &&... args) { return Aggregate::count(std::forward(args)...); } +/** + * Returns an aggregator that computes the first value, within an aggregation group, + * for each input column. + */ template Aggregate aggFirst(Args &&... args) { return Aggregate::first(std::forward(args)...); } +/** + * Returns an aggregator that computes the last value, within an aggregation group, + * for each input column. + */ template Aggregate aggLast(Args &&... args) { return Aggregate::last(std::forward(args)...); } +/** + * Returns an aggregator that computes the maximum value, within an aggregation group, + * for each input column. + */ template Aggregate aggMax(Args &&... args) { return Aggregate::max(std::forward(args)...); } +/** + * Returns an aggregator that computes the median value, within an aggregation group, + * for each input column. + */ template Aggregate aggMed(Args &&... args) { return Aggregate::med(std::forward(args)...); } +/** + * Returns an aggregator that computes the minimum value, within an aggregation group, + * for each input column. + */ template Aggregate aggMin(Args &&... args) { return Aggregate::min(std::forward(args)...); } +/** + * Returns an aggregator that computes the designated percentile of values, within an aggregation + * group, for each input column. + */ template Aggregate aggPct(double percentile, Args &&... args) { return Aggregate::pct(percentile, std::forward(args)...); } +/** + * Returns an aggregator that computes the standard deviation of values, within an aggregation + * group, for each input column. + */ template Aggregate aggStd(Args &&... args) { return Aggregate::std(std::forward(args)...); } +/** + * Returns an aggregator that computes the total sum of values, within an aggregation group, + * for each input column. + */ template Aggregate aggSum(Args &&... args) { return Aggregate::sum(std::forward(args)...); } +/** + * Returns an aggregator that computes the variance of values, within an aggregation group, + * for each input column. + */ template Aggregate aggVar(Args &&... args) { return Aggregate::var(std::forward(args)...); } +/** + * Returns an aggregator that computes the weighted average of values, within an aggregation + * group, for each input column. + */ template Aggregate aggWavg(Args &&... args) { return Aggregate::wavg(std::forward(args)...); } +/** + * Returns an AggregateCombo object, which represents a collection of aggregators. + */ inline AggregateCombo aggCombo(std::initializer_list args) { return AggregateCombo::create(args); } namespace internal { -// Holds a string, regardless of T. Used for GetCols +/** + * Used internally. Holds a std::string, regardless of T. Used for GetCols. + * T is ignored but we use it to make sure we are passed the right number of arguments. + */ template struct StringHolder { + /** + * Constructor. + */ StringHolder(std::string s) : s_(std::move(s)) {} + /** + * Constructor. + */ StringHolder(const char *s) : s_(s) {} + /** + * Constructor. + */ StringHolder(std::string_view s) : s_(s) {} std::string s_; @@ -558,11 +780,11 @@ class TableHandle { * A variadic form of minBy(std::vector) const that takes a combination of * argument types. * @tparam Args Any combination of `std::string`, `std::string_view`, `const char *`, or `SelectColumn`. - * @param args The columns to group by + * @param columnSpecs The columns to group by * @return A TableHandle referencing the new table */ template - TableHandle minBy(Args &&... args) const; + TableHandle minBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "min" aggregate operation * applied to the remaining columns. @@ -575,11 +797,11 @@ class TableHandle { * A variadic form of maxBy(std::vector) const that takes a combination of * argument types. * @tparam Args Any combination of `std::string`, `std::string_view`, `const char *`, or `SelectColumn`. - * @param args The columns to group by + * @param columnSpecs The columns to group by * @return A TableHandle referencing the new table */ template - TableHandle maxBy(Args &&... args) const; + TableHandle maxBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "max" aggregate operation * applied to the remaining columns. @@ -592,11 +814,11 @@ class TableHandle { * A variadic form of sumBy(std::vector) const that takes a combination of * argument types. * @tparam Args Any combination of `std::string`, `std::string_view`, `const char *`, or `SelectColumn`. - * @param args The columns to group by + * @param columnSpecs The columns to group by * @return A TableHandle referencing the new table */ template - TableHandle sumBy(Args &&... args) const; + TableHandle sumBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "sum" aggregate operation * applied to the remaining columns. @@ -609,11 +831,11 @@ class TableHandle { * A variadic form of absSumBy(std::vector) const that takes a combination of * argument types. * @tparam Args Any combination of `std::string`, `std::string_view`, `const char *`, or `SelectColumn`. - * @param args The columns to group by + * @param columnSpecs The columns to group by * @return A TableHandle referencing the new table */ template - TableHandle absSumBy(Args &&... args) const; + TableHandle absSumBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "absSum" aggregate operation * applied to the remaining columns. @@ -630,7 +852,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle varBy(Args &&... args) const; + TableHandle varBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "var" aggregate operation * applied to the remaining columns. @@ -647,7 +869,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle stdBy(Args &&... args) const; + TableHandle stdBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "std" aggregate operation * applied to the remaining columns. @@ -664,7 +886,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle avgBy(Args &&... args) const; + TableHandle avgBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "avg" aggregate operation * applied to the remaining columns. @@ -681,7 +903,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle firstBy(Args &&... args) const; + TableHandle firstBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "first" aggregate operation * applied to the remaining columns. @@ -698,7 +920,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle lastBy(Args &&... args) const; + TableHandle lastBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "last" aggregate operation * applied to the remaining columns. @@ -715,7 +937,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle medianBy(Args &&... args) const; + TableHandle medianBy(Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "median" aggregate operation * applied to the remaining columns. @@ -732,7 +954,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle percentileBy(double percentile, bool avgMedian, Args &&... args) const; + TableHandle percentileBy(double percentile, bool avgMedian, Args &&... columnSpecs) const; // TODO(kosak): document avgMedian /** * Creates a new table from this table, grouped by columnSpecs, with the "percentile" aggregate operation @@ -752,7 +974,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle percentileBy(double percentile, Args &&... args) const; + TableHandle percentileBy(double percentile, Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, with the "percentile" aggregate operation * applied to the remaining columns. @@ -773,7 +995,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle countBy(CCol &&countByColumn, Args &&... args) const; + TableHandle countBy(CCol &&countByColumn, Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, having a new column named by * `countByColumn` containing the size of each group. @@ -793,7 +1015,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle wAvgBy(WCol &&weightColumn, Args &&... args) const; + TableHandle wAvgBy(WCol &&weightColumn, Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, having a new column named by * `weightColumn` containing the weighted average of each group. @@ -812,7 +1034,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle tailBy(int64_t n, Args &&... args) const; + TableHandle tailBy(int64_t n, Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, containing the last `n` rows of * each group. @@ -831,7 +1053,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle headBy(int64_t n, Args &&... args) const; + TableHandle headBy(int64_t n, Args &&... columnSpecs) const; /** * Creates a new table from this table, grouped by columnSpecs, containing the first `n` rows of * each group. @@ -863,7 +1085,7 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle ungroup(bool nullFill, Args &&... args) const; + TableHandle ungroup(bool nullFill, Args &&... columnSpecs) const; //TODO(kosak): document nullFill /** * Creates a new table from this table with the column array data ungrouped. This is the inverse @@ -881,8 +1103,8 @@ class TableHandle { * @return A TableHandle referencing the new table */ template - TableHandle ungroup(Args &&... args) const { - return ungroup(false, std::forward(args)...); + TableHandle ungroup(Args &&... columnSpecs) const { + return ungroup(false, std::forward(columnSpecs)...); } /** @@ -1001,12 +1223,12 @@ class TableHandle { /** * Binds this table to a variable name in the QueryScope. - * @param variable + * @param variable The QueryScope variable to bind to. */ void bindToVariable(std::string variable) const; /** * The async version of bindToVariable(std::string variable) const. - * @param The QueryScope variable to bind to. + * @param variable The QueryScope variable to bind to. * @param callback The asynchronous callback. */ void bindToVariableAsync(std::string variable, std::shared_ptr> callback) const; @@ -1069,9 +1291,14 @@ class TableHandle { */ internal::TableHandleStreamAdaptor stream(bool wantHeaders) const; - // for debugging + /** + * Used internally, for debugging. + */ void observe() const; + /** + * Used internally. Returns the underlying impl object. + */ const std::shared_ptr &impl() const { return impl_; } /** @@ -1326,145 +1553,145 @@ TableHandle TableHandle::by(Args &&... args) const { } template -TableHandle TableHandle::by(AggregateCombo combo, Args &&... args) const { +TableHandle TableHandle::by(AggregateCombo combo, Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return by(std::move(combo), std::move(columns)); } template -TableHandle TableHandle::minBy(Args &&... args) const { +TableHandle TableHandle::minBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return minBy(std::move(columns)); } template -TableHandle TableHandle::maxBy(Args &&... args) const { +TableHandle TableHandle::maxBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return maxBy(std::move(columns)); } template -TableHandle TableHandle::sumBy(Args &&... args) const { +TableHandle TableHandle::sumBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return sumBy(std::move(columns)); } template -TableHandle TableHandle::absSumBy(Args &&... args) const { +TableHandle TableHandle::absSumBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return absSumBy(std::move(columns)); } template -TableHandle TableHandle::varBy(Args &&... args) const { +TableHandle TableHandle::varBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return varBy(std::move(columns)); } template -TableHandle TableHandle::stdBy(Args &&... args) const { +TableHandle TableHandle::stdBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return stdBy(std::move(columns)); } template -TableHandle TableHandle::avgBy(Args &&... args) const { +TableHandle TableHandle::avgBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return avgBy(std::move(columns)); } template -TableHandle TableHandle::firstBy(Args &&... args) const { +TableHandle TableHandle::firstBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return firstBy(std::move(columns)); } template -TableHandle TableHandle::lastBy(Args &&... args) const { +TableHandle TableHandle::lastBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return lastBy(std::move(columns)); } template -TableHandle TableHandle::medianBy(Args &&... args) const { +TableHandle TableHandle::medianBy(Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return medianBy(std::move(columns)); } template -TableHandle TableHandle::percentileBy(double percentile, bool avgMedian, Args &&... args) const { +TableHandle TableHandle::percentileBy(double percentile, bool avgMedian, Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return percentileBy(percentile, avgMedian, std::move(columns)); } template -TableHandle TableHandle::percentileBy(double percentile, Args &&... args) const { +TableHandle TableHandle::percentileBy(double percentile, Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return percentileBy(percentile, std::move(columns)); } template -TableHandle TableHandle::countBy(CCol &&countByColumn, Args &&... args) const { +TableHandle TableHandle::countBy(CCol &&countByColumn, Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return countBy(internal::ConvertToString::toString(countByColumn), std::move(columns)); } template -TableHandle TableHandle::wAvgBy(WCol &&weightColumn, Args &&... args) const { +TableHandle TableHandle::wAvgBy(WCol &&weightColumn, Args &&... columnSpecs) const { std::vector columns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return wAvgBy(internal::ConvertToString::toString(weightColumn), std::move(columns)); } template -TableHandle TableHandle::tailBy(int64_t n, Args &&... args) const { +TableHandle TableHandle::tailBy(int64_t n, Args &&... columnSpecs) const { std::vector lastByColumns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return tailBy(n, std::move(lastByColumns)); } template -TableHandle TableHandle::headBy(int64_t n, Args &&... args) const { +TableHandle TableHandle::headBy(int64_t n, Args &&... columnSpecs) const { std::vector lastByColumns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return headBy(n, std::move(lastByColumns)); } template -TableHandle TableHandle::ungroup(bool nullFill, Args &&... args) const { +TableHandle TableHandle::ungroup(bool nullFill, Args &&... columnSpecs) const { std::vector groupByColumns = { - internal::ConvertToString::toString(std::forward(args))... + internal::ConvertToString::toString(std::forward(columnSpecs))... }; return ungroup(nullFill, std::move(groupByColumns)); } diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/columns.h b/cpp-client/deephaven/client/include/public/deephaven/client/columns.h index 72670126ee7..e0c2b108f31 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/columns.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/columns.h @@ -27,29 +27,47 @@ class AssignedColumnImpl; */ class IrisRepresentable { public: + /** + * Constructor. + */ explicit IrisRepresentable(std::shared_ptr impl) : impl_( std::move(impl)) {} + /** + * Destructor. + */ virtual ~IrisRepresentable(); + /** + * Gets underlying "impl" member. Used internally. + */ impl::IrisRepresentableImpl *getIrisRepresentableImpl() const { return impl_.get(); } protected: + /** + * The underlying implementation. + */ std::shared_ptr impl_; }; /** - * A base class for representing columns in the fluent interface. Objects inheriting from SelectColumn - * are suitable for use in methods like TableHandle::select() const + * A base class for representing columns in the fluent interface. Objects inheriting from + * SelectColumn are suitable for use in methods like TableHandle::select() const * Some common leaf classes are StrCol, NumCol, and DateTimeCol. */ class SelectColumn : public virtual IrisRepresentable { public: + /** + * Constructor. + */ explicit SelectColumn(std::shared_ptr impl) : IrisRepresentable( std::move(impl)) {} + /** + * Destructor. + */ ~SelectColumn() override; }; @@ -59,9 +77,15 @@ class SelectColumn : public virtual IrisRepresentable { */ class MatchWithColumn : public virtual IrisRepresentable { public: + /** + * Constructor. + */ explicit MatchWithColumn(std::shared_ptr impl) : IrisRepresentable( std::move(impl)) {} + /** + * Destructor. + */ ~MatchWithColumn() override; }; @@ -76,11 +100,26 @@ class Column : public SelectColumn, public MatchWithColumn { * Constructor. Used internally. */ explicit Column(std::shared_ptr impl); + /** + * Destructor. + */ ~Column() override; + /** + * Create a SortPair from this column, with direction_ set to ascending and abs_ set to the + * incoming parameter. + */ SortPair ascending(bool abs = false) const; + + /** + * Create a SortPair from this column, with direction_ set to descending and abs_ set to the + * incoming parameter. + */ SortPair descending(bool abs = false) const; + /** + * Gets the name of this column. + */ const std::string &name() const; }; @@ -179,8 +218,6 @@ class NumCol final : public NumericExpression, public Column { /** * Create the NumCol. Used internally. Typically client code will call TableHandle::getNumCol() * or TableHandle::getCols<>(). - * @param Column name - * @return the NumCol */ static NumCol create(std::string name); /** @@ -214,8 +251,6 @@ class StrCol final : public StringExpression, public Column { /** * Create the StrCol. Used internally. Typically client code will call TableHandle::getStrCol() * or TableHandle::getCols<>(). - * @param Column name - * @return the StrCol */ static StrCol create(std::string name); /** @@ -249,8 +284,6 @@ class DateTimeCol final : public DateTimeExpression, public Column { /** * Create the DateTimeCol. Used internally. Typically client code will call TableHandle::getDateTimeCol() * or TableHandle::getCols<>(). - * @param Column name - * @return the DateTimeCol */ static DateTimeCol create(std::string name); /** diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h b/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h index c8025cb9acf..7ed0a538ee9 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/expressions.h @@ -71,6 +71,9 @@ class Expression { } protected: + /** + * The underlying implementation object. + */ std::shared_ptr impl_; }; @@ -96,16 +99,50 @@ class BooleanExpression final : public Expression { */ ~BooleanExpression() final; + /** + * Used internally. + */ std::shared_ptr implAsBooleanExpressionImpl() const; + /** + * Unary operator ! + * @param expr The incoming BooleanExpression. + * @return A BooleanExpression representing the logical NOT of the argument. + */ friend BooleanExpression operator!(const BooleanExpression &expr); + + /** + * Boolean operator &. Equivalent to operator &&. + * @param lhs A BooleanExpression representing the left-hand side of the AND. + * @param rhs A BooelanExpression representing the right-hand side of the AND. + * @return The BooleanExpression representing the expression `lhs AND rhs` + */ friend BooleanExpression operator&(const BooleanExpression &lhs, const BooleanExpression &rhs); + + /** + * Boolean operator |. Equivalent to operator ||. + * @param lhs A BooleanExpression representing the left-hand side of the OR. + * @param rhs A BooelanExpression representing the right-hand side of the OR. + * @return The BooleanExpression representing the expression `lhs OR rhs` + */ friend BooleanExpression operator|(const BooleanExpression &lhs, const BooleanExpression &rhs); + /** + * Boolean operator &&. + * @param lhs A BooleanExpression representing the left-hand side of the AND. + * @param rhs A BooelanExpression representing the right-hand side of the AND. + * @return The BooleanExpression representing the expression `lhs AND rhs` + */ friend BooleanExpression operator&&(const BooleanExpression &lhs, const BooleanExpression &rhs) { return lhs & rhs; } + /** + * Boolean operator ||. + * @param lhs A BooleanExpression representing the left-hand side of the OR. + * @param rhs A BooelanExpression representing the right-hand side of the OR. + * @return The BooleanExpression representing the expression `lhs OR rhs` + */ friend BooleanExpression operator||(const BooleanExpression &lhs, const BooleanExpression &rhs) { return lhs | rhs; } @@ -151,6 +188,9 @@ class NumericExpression : public Expression { */ ~NumericExpression() override; + /** + * Used internally. + */ std::shared_ptr implAsNumericExpressionImpl() const; /** diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/types.h b/cpp-client/deephaven/client/include/public/deephaven/client/types.h index e315e25dd7a..3b5fae191c8 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/types.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/types.h @@ -11,46 +11,160 @@ namespace deephaven::client { class DeephavenConstants { public: + /** + * The special reserved null value constant for the Deephaven char type + * (which is represented as a signed 16 bit value). + */ static constexpr const char16_t NULL_CHAR = std::numeric_limits::max(); + /** + * The minimum valid value for the Deephaven char type + * (which is represented as a signed 16 bit value). + */ static constexpr const char16_t MIN_CHAR = std::numeric_limits::min(); + /** + * The maximum valid value for the Deephaven char type + * (which is represented as a signed 16 bit value). + */ static constexpr const char16_t MAX_CHAR = std::numeric_limits::max() - 1; + /** + * The special reserved null value constant for the Deephaven float type. + */ static constexpr const float NULL_FLOAT = -std::numeric_limits::max(); + /** + * The NaN value for the Deephaven float type. + */ static constexpr const float NAN_FLOAT = std::numeric_limits::quiet_NaN(); + /** + * The negative infinity value for the Deephaven float type. + */ static constexpr const float NEG_INFINITY_FLOAT = -std::numeric_limits::infinity(); + /** + * The positive infinity value for the Deephaven float type. + */ static constexpr const float POS_INFINITY_FLOAT = std::numeric_limits::infinity(); + /** + * The minimum valid value for the Deephaven float type. + */ static constexpr const float MIN_FLOAT = -std::numeric_limits::infinity(); + /** + * The maximum valid value for the Deephaven float type. + */ static constexpr const float MAX_FLOAT = std::numeric_limits::infinity(); + /** + * The minimum finite value for the Deephaven float type. + */ static constexpr const float MIN_FINITE_FLOAT = std::nextafter(-std::numeric_limits::max(), 0.0f); + /** + * The maximum finite value for the Deephaven float type. + */ static constexpr const float MAX_FINITE_FLOAT = std::numeric_limits::max(); + /** + * The smallest positive value for the Deephaven float type. + */ static constexpr const float MIN_POS_FLOAT = std::numeric_limits::min(); + /** + * The special reserved null value constant for the Deephaven double type. + */ static constexpr const double NULL_DOUBLE = -std::numeric_limits::max(); + /** + * The NaN value for the Deephaven double type. + */ static constexpr const double NAN_DOUBLE = std::numeric_limits::quiet_NaN(); + /** + * The negative infinity value for the Deephaven double type. + */ static constexpr const double NEG_INFINITY_DOUBLE = -std::numeric_limits::infinity(); + /** + * The positive infinity value for the Deephaven double type. + */ static constexpr const double POS_INFINITY_DOUBLE = std::numeric_limits::infinity(); + /** + * The minimum valid value for the Deephaven double type. + */ static constexpr const double MIN_DOUBLE = -std::numeric_limits::infinity(); + /** + * The maximum valid value for the Deephaven double type. + */ static constexpr const double MAX_DOUBLE = std::numeric_limits::infinity(); + /** + * The minimum finite value for the Deephaven double type. + */ static constexpr const double MIN_FINITE_DOUBLE = std::nextafter( -std::numeric_limits::max(), 0.0f); + /** + * The maximum finite value for the Deephaven double type. + */ static constexpr const double MAX_FINITE_DOUBLE = std::numeric_limits::max(); + /** + * The smallest positive value for the Deephaven double type. + */ static constexpr const double MIN_POS_DOUBLE = std::numeric_limits::min(); + /** + * The special reserved null value constant for the Deephaven byte type + * (which is represented as a signed 8 bit integer). + */ static constexpr const int8_t NULL_BYTE = std::numeric_limits::min(); + /** + * The minimum valid value for the Deephaven byte type + * (which is represented as a signed 8 bit integer). + */ static constexpr const int8_t MIN_BYTE = std::numeric_limits::min() + 1; + /** + * The maximum valid value for the Deephaven byte type + * (which is represented as a signed 8 bit integer). + */ static constexpr const int8_t MAX_BYTE = std::numeric_limits::max(); + /** + * The special reserved null value constant for the Deephaven short type + * (which is represented as a signed 16 bit integer). + */ static constexpr const int16_t NULL_SHORT = std::numeric_limits::min(); + /** + * The minimum valid value for the Deephaven short type + * (which is represented as a signed 16 bit integer). + */ static constexpr const int16_t MIN_SHORT = std::numeric_limits::min() + 1; + /** + * The maximum valid value for the Deephaven short type + * (which is represented as a signed 16 bit integer). + */ static constexpr const int16_t MAX_SHORT = std::numeric_limits::max(); + /** + * The special reserved null value constant for the Deephaven int type + * (which is represented as a signed 32 bit integer). + */ static constexpr const int32_t NULL_INT = std::numeric_limits::min(); + /** + * The minimum valid value for the Deephaven int type + * (which is represented as a signed 32 bit integer). + */ static constexpr const int32_t MIN_INT = std::numeric_limits::min() + 1; + /** + * The maximum valid value for the Deephaven int type + * (which is represented as a signed 32 bit integer). + */ static constexpr const int32_t MAX_INT = std::numeric_limits::max(); + /** + * The special reserved null value constant for the Deephaven long type + * (which is represented as a signed 64 bit integer). + */ static constexpr const int64_t NULL_LONG = std::numeric_limits::min(); + /** + * The minimum valid value for the Deephaven long type + * (which is represented as a signed 64 bit integer). + */ static constexpr const int64_t MIN_LONG = std::numeric_limits::min() + 1; + /** + * The maximum valid value for the Deephaven long type + * (which is represented as a signed 64 bit integer). + */ static constexpr const int64_t MAX_LONG = std::numeric_limits::max(); }; @@ -59,31 +173,49 @@ struct DeephavenConstantsForType {}; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const int8_t NULL_VALUE = DeephavenConstants::NULL_BYTE; }; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const int16_t NULL_VALUE = DeephavenConstants::NULL_SHORT; }; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const int32_t NULL_VALUE = DeephavenConstants::NULL_INT; }; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const int64_t NULL_VALUE = DeephavenConstants::NULL_LONG; }; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const float NULL_VALUE = DeephavenConstants::NULL_FLOAT; }; template<> struct DeephavenConstantsForType { + /** + * The Deephaven reserved null value constant for this type. + */ static constexpr const double NULL_VALUE = DeephavenConstants::NULL_DOUBLE; }; @@ -147,11 +279,14 @@ class DateTime { */ DateTime(int year, int month, int day, int hour, int minute, int second, long nanos); - /* + /** * The DateTime as expressed in nanoseconds since the epoch. Can be negative. */ int64_t nanos() const { return nanos_; } + /** + * Used internally to serialize this object to Deephaven. + */ void streamIrisRepresentation(std::ostream &result) const; private: diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h index a260f8d6286..ca29010630f 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/utility.h @@ -255,8 +255,8 @@ void okOrThrow(const DebugInfo &debugInfo, const arrow::Status &status); /** * If result's internal status is OK, return result's contained value. * Otherwise throw a runtime error with an informative message. + * @param debugInfo A DebugInfo object, typically as provided by DEEPHAVEN_EXPR_MESSAGE. * @param result The arrow::Result - * @param message An optional message to be included in the exception message. */ template T valueOrThrow(const DebugInfo &debugInfo, arrow::Result result) { diff --git a/cpp-client/deephaven/client/src/client.cc b/cpp-client/deephaven/client/src/client.cc index 457b2beb19d..0b964c5a7ef 100644 --- a/cpp-client/deephaven/client/src/client.cc +++ b/cpp-client/deephaven/client/src/client.cc @@ -218,6 +218,8 @@ AggregateCombo AggregateCombo::create(std::vector vec) { } AggregateCombo::AggregateCombo(std::shared_ptr impl) : impl_(std::move(impl)) {} +AggregateCombo::AggregateCombo(AggregateCombo &&other) noexcept = default; +AggregateCombo &AggregateCombo::operator=(AggregateCombo &&other) noexcept = default; AggregateCombo::~AggregateCombo() = default; TableHandle::TableHandle() = default; diff --git a/cpp-client/doc/fluent.rst b/cpp-client/doc/fluent.rst index a7cf4cdd077..11b785b5ee9 100644 --- a/cpp-client/doc/fluent.rst +++ b/cpp-client/doc/fluent.rst @@ -15,15 +15,15 @@ operators. Consider the following code fragment: In this code, the fluent expression ``symbol == "AAPL" && price < 50.0`` happens to have the type -:cpp:class:`BooelanExpression `. +:cpp:class:`BooelanExpression `. However that type is not explicitly spelled out in the code and many programs would never need to explicitly name that type. Rather, most programs start with a -:cpp:class:`TableHandle ` +:cpp:class:`TableHandle ` and various column types ( -e.g. :cpp:class:`StrCol `, -:cpp:class:`NumCol `, -and :cpp:class:`DateTimeCol `) +e.g. :cpp:class:`StrCol `, +:cpp:class:`NumCol `, +and :cpp:class:`DateTimeCol `) and perform various method calls and overloaded operators on them. .. toctree:: diff --git a/cpp-client/doc/fluent_columns.rst b/cpp-client/doc/fluent_columns.rst index a8bfd559801..25baee884f1 100644 --- a/cpp-client/doc/fluent_columns.rst +++ b/cpp-client/doc/fluent_columns.rst @@ -2,8 +2,8 @@ Fluent classes representing columns =================================== Typically these are created by a -:cpp:func:`TableHandle::select ` or -:cpp:func:`TableHandle::select ` +:cpp:func:`TableHandle::select ` or +:cpp:func:`TableHandle::select ` method. For example .. code:: c++ @@ -13,17 +13,19 @@ method. For example Leaf classes ------------ -.. doxygenclass:: deephaven::client::highlevel::NumCol +.. doxygenclass:: deephaven::client::NumCol :members: -.. doxygenclass:: deephaven::client::highlevel::StrCol +.. doxygenclass:: deephaven::client::StrCol :members: -.. doxygenclass:: deephaven::client::highlevel::DateTimeCol +.. doxygenclass:: deephaven::client::DateTimeCol :members: -.. doxygenclass:: deephaven::client::highlevel::BoolCol - :members: +.. + TODO(kosak): + .. doxygenclass:: deephaven::client::BoolCol + :members: TODO(kosak) - BoolCol @@ -33,14 +35,14 @@ Intermediate classes These classes are typically not specified directly by client code. Instead they are used by library methods to indicate the type of column they work with. -.. doxygenclass:: deephaven::client::highlevel::SelectColumn +.. doxygenclass:: deephaven::client::SelectColumn :members: -.. doxygenclass:: deephaven::client::highlevel::MatchWithColumn +.. doxygenclass:: deephaven::client::MatchWithColumn :members: -.. doxygenclass:: deephaven::client::highlevel::AssignedColumn +.. doxygenclass:: deephaven::client::AssignedColumn :members: -.. doxygenclass:: deephaven::client::highlevel::Column +.. doxygenclass:: deephaven::client::Column :members: diff --git a/cpp-client/doc/fluent_expressions.rst b/cpp-client/doc/fluent_expressions.rst index af142f40bac..c157bfcc518 100644 --- a/cpp-client/doc/fluent_expressions.rst +++ b/cpp-client/doc/fluent_expressions.rst @@ -4,20 +4,20 @@ Fluent classes representing expressions Leaf classes ------------ -.. doxygenclass:: deephaven::client::highlevel::NumericExpression +.. doxygenclass:: deephaven::client::NumericExpression :members: -.. doxygenclass:: deephaven::client::highlevel::StringExpression +.. doxygenclass:: deephaven::client::StringExpression :members: -.. doxygenclass:: deephaven::client::highlevel::DateTimeExpression +.. doxygenclass:: deephaven::client::DateTimeExpression :members: -.. doxygenclass:: deephaven::client::highlevel::BooleanExpression +.. doxygenclass:: deephaven::client::BooleanExpression :members: Intermediate classes -------------------- -.. doxygenclass:: deephaven::client::highlevel::Expression +.. doxygenclass:: deephaven::client::Expression :members: diff --git a/cpp-client/doc/main.rst b/cpp-client/doc/main.rst index 2d9d410839d..bc30518a991 100644 --- a/cpp-client/doc/main.rst +++ b/cpp-client/doc/main.rst @@ -2,11 +2,11 @@ Top-level class: Client ======================= The main entry point to the Deephaven Client API. Use -:cpp:func:`connect ` +:cpp:func:`connect ` to connect to a Deephaven instance, then call -:cpp:func:`getManager ` +:cpp:func:`getManager ` to get a -:cpp:class:`TableHandleManager ` +:cpp:class:`TableHandleManager ` -.. doxygenclass:: deephaven::client::highlevel::Client +.. doxygenclass:: deephaven::client::Client :members: diff --git a/cpp-client/doc/tablehandles.rst b/cpp-client/doc/tablehandles.rst index e9e45ae5ccc..392608f87e3 100644 --- a/cpp-client/doc/tablehandles.rst +++ b/cpp-client/doc/tablehandles.rst @@ -1,26 +1,26 @@ TableHandleManager and TableHandle ================================== -:cpp:class:`TableHandleManager ` +:cpp:class:`TableHandleManager ` is one of two ways to get -:cpp:class:`TableHandle ` resources +:cpp:class:`TableHandle ` resources in the system. -:cpp:class:`TableHandleManager ` is used to access existing tables in the system (e.g. via -:cpp:func:`fetchTable `) +:cpp:class:`TableHandleManager ` is used to access existing tables in the system (e.g. via +:cpp:func:`fetchTable `) or create new tables (e.g. via -:cpp:func:`emptyTable ` or -:cpp:func:`timeTable `). +:cpp:func:`emptyTable ` or +:cpp:func:`timeTable `). It is also that place that (in a future version) you can set attributes that affect a related group of tables, such as whether they are resolved synchronously or asynchronously. On the other hand, the methods on -:cpp:class:`TableHandle ` +:cpp:class:`TableHandle ` are used to create tables derived from other tables. Some examples are -:cpp:func:`where ` and -:cpp:func:`sort `). +:cpp:func:`where ` and +:cpp:func:`sort `). These are used to create tables derived from other tables. A typical pattern might be @@ -30,9 +30,8 @@ might be TableHandle t1 = ...; TableHandle t2 = t1.where(...).sort(...).tail(5); -.. doxygenclass:: deephaven::client::highlevel::TableHandleManager +.. doxygenclass:: deephaven::client::TableHandleManager :members: -.. doxygenclass:: deephaven::client::highlevel::TableHandle +.. doxygenclass:: deephaven::client::TableHandle :members: - diff --git a/cpp-client/doc/types.rst b/cpp-client/doc/types.rst index 4cc26f4d945..21b17e25504 100644 --- a/cpp-client/doc/types.rst +++ b/cpp-client/doc/types.rst @@ -6,13 +6,13 @@ A variety of other types that appear in the system. Types used for sorting tables ----------------------------- -.. doxygenclass:: deephaven::client::highlevel::SortPair +.. doxygenclass:: deephaven::client::SortPair :members: -.. doxygenenum:: deephaven::client::highlevel::SortDirection +.. doxygenenum:: deephaven::client::SortDirection Types used for manipulating dates/times --------------------------------------- -.. doxygenclass:: deephaven::client::highlevel::DateTime +.. doxygenclass:: deephaven::client::DateTime :members: diff --git a/cpp-client/doc/utility.rst b/cpp-client/doc/utility.rst index 529305b31f5..68d214fc4b5 100644 --- a/cpp-client/doc/utility.rst +++ b/cpp-client/doc/utility.rst @@ -6,5 +6,5 @@ These are various utility and helper classes available in the system. .. doxygenclass:: deephaven::client::utility::TableMaker :members: -.. doxygenclass:: deephaven::client::highlevel::FlightWrapper +.. doxygenclass:: deephaven::client::FlightWrapper :members: diff --git a/cpp-examples/doc/create_table_with_arrow_flight.rst b/cpp-examples/doc/create_table_with_arrow_flight.rst index ddb5d830404..6c33fa719c0 100644 --- a/cpp-examples/doc/create_table_with_arrow_flight.rst +++ b/cpp-examples/doc/create_table_with_arrow_flight.rst @@ -5,13 +5,13 @@ Client programs that create tables using `Arrow Flight RPC `__ typically follow the below recipe: -1. Get a :cpp:class:`FlightWrapper ` class via - :cpp:func:`TableHandleManager::createFlightWrapper ` +1. Get a :cpp:class:`FlightWrapper ` class via + :cpp:func:`TableHandleManager::createFlightWrapper ` 2. For calls like Arrow ``DoPut`` that take an ``arrow::Flight::FlightCallOptions``, endow that object with Deephaven authentication headers via - :cpp:func:`FlightWrapper::addAuthHeaders ` + :cpp:func:`FlightWrapper::addAuthHeaders ` 3. Get a pointer to the ``arrow::flight::FlightClient`` from - :cpp:func:`FlightWrapper::flightClient ` + :cpp:func:`FlightWrapper::flightClient ` 4. Then perform the operations as described in `Arrow Flight RPC `__ @@ -23,10 +23,10 @@ Consider the following program from ``cpp-examples/create_table_with_arrow_fligh #include "deephaven/client/highlevel/client.h" #include "deephaven/client/utility/table_maker.h" - using deephaven::client::highlevel::NumCol; - using deephaven::client::highlevel::Client; - using deephaven::client::highlevel::TableHandle; - using deephaven::client::highlevel::TableHandleManager; + using deephaven::client::NumCol; + using deephaven::client::Client; + using deephaven::client::TableHandle; + using deephaven::client::TableHandleManager; using deephaven::client::utility::flight::statusOrDie; using deephaven::client::utility::flight::valueOrDie; using deephaven::client::utility::TableMaker; diff --git a/cpp-examples/doc/create_table_with_tablemaker.rst b/cpp-examples/doc/create_table_with_tablemaker.rst index 10954be4160..eaec36b85ae 100644 --- a/cpp-examples/doc/create_table_with_tablemaker.rst +++ b/cpp-examples/doc/create_table_with_tablemaker.rst @@ -24,10 +24,10 @@ Consider the following program from ``cpp-examples/make_table``: #include "deephaven/client/highlevel/client.h" #include "deephaven/client/utility/table_maker.h" - using deephaven::client::highlevel::NumCol; - using deephaven::client::highlevel::Client; - using deephaven::client::highlevel::TableHandle; - using deephaven::client::highlevel::TableHandleManager; + using deephaven::client::NumCol; + using deephaven::client::Client; + using deephaven::client::TableHandle; + using deephaven::client::TableHandleManager; using deephaven::client::utility::TableMaker; // This example shows how to use the TableMaker wrapper to make a simple table. diff --git a/cpp-examples/doc/fluent.rst b/cpp-examples/doc/fluent.rst index 9ade977fcb1..03d8600f2f2 100644 --- a/cpp-examples/doc/fluent.rst +++ b/cpp-examples/doc/fluent.rst @@ -2,19 +2,19 @@ The Fluent Interface ==================== The Deephaven client has numerous methods that take expressions (e.g. -:cpp:func:`TableHandle::select ` or -:cpp:func:`TableHandle::view `), +:cpp:func:`TableHandle::select ` or +:cpp:func:`TableHandle::view `), boolean conditions (e.g. -:cpp:func:`TableHandle::where `), +:cpp:func:`TableHandle::where `), column names (e.g. -:cpp:func:`TableHandle::sort `), +:cpp:func:`TableHandle::sort `), and so on. These methods generally come in two flavors: a string version and a more structured *typed* version. The reason both flavors exist is because the string versions are convenient and simple to use for small programs, whereas the typed versions are typically more maintainable in larger programs. Consider these two ways of doing a -:cpp:func:`TableHandle::where `, +:cpp:func:`TableHandle::where `, using literal strings versus using the "fluent" syntax. .. code:: c++ @@ -97,17 +97,17 @@ a programming language. Rather than formally describing the syntax here, we inst informal description. There are basically four kinds of expressions in the system: -:cpp:class:`NumericExpression `, -:cpp:class:`StringExpression `, -:cpp:class:`DateTimeExpression `, and -:cpp:class:`BooleanExpression `. +:cpp:class:`NumericExpression `, +:cpp:class:`StringExpression `, +:cpp:class:`DateTimeExpression `, and +:cpp:class:`BooleanExpression `. These model the four types of expressions we want to represent in the system. In typical usage, client programs do not explicitly declare variables of these types. Instead, these objects are created as anonymous temporaries (as the intermediate results of overloaded operators) which are then consumed by other operators or by Deephaven methods like -:cpp:func:`TableHandle::select ` or -:cpp:func:`TableHandle::where `. +:cpp:func:`TableHandle::select ` or +:cpp:func:`TableHandle::where `. Local vs Remote Evaluation -------------------------- @@ -162,9 +162,9 @@ Consider the following examples: var t4a = t0.select((100 + myFunc(x) + close).as("Result")); A binary operator with at least one -:cpp:class:`NumericExpression ` +:cpp:class:`NumericExpression ` yields a -:cpp:class:`NumericExpression `. +:cpp:class:`NumericExpression `. Because binary operators like left-to-right associativity, mathematically equivalent but differently-ordered expressions get sent to the server as a different tree: @@ -205,10 +205,10 @@ whatever expression ``e`` is passed into it: NumericExpression ^^^^^^^^^^^^^^^^^ -:cpp:class:`NumericExpression ` +:cpp:class:`NumericExpression ` objects are either ``Numeric terminals`` or the result of an operator applied to some combination of `Numeric terminals` and -:cpp:class:`NumericExpression ` objects. +:cpp:class:`NumericExpression ` objects. ``Numeric terminals`` are: @@ -216,17 +216,17 @@ some combination of `Numeric terminals` and * Client-side numeric variables such as `int x`` or ``double x`` * Client-side numeric expressions such as ``x * 2 + 5`` * Numeric columns, which are typically obtained from a call like - :cpp:func:`getCols `. + :cpp:func:`getCols `. The operators are the the usual unary arithmetic operators ``+``, ``-``, ``~``, and the usual binary operators ``+``, ``-``, ``*``, ``/``, ``%``, ``&``, ``|``, ``^``. In this example, the table ``t1`` contains two columns: the ``Ticker`` column and a ``Result`` columns which holds the product ``Price * Volume + 12``. Notice that in a -:cpp:func:`TableHandle::select ` +:cpp:func:`TableHandle::select ` statement, when we are creating a new column that is the result of a calculation, we need to give that new column a name (using the -:cpp:func:`Expression::as ` +:cpp:func:`Expression::as ` method). In general, the fluent syntax ``expr.as("X")`` corresponds to Deephaven Code Studio expression ``X = expr``. @@ -245,10 +245,10 @@ corresponds to Deephaven Code Studio expression ``X = expr``. StringExpression ^^^^^^^^^^^^^^^^ -:cpp:class:`StringExpression ` +:cpp:class:`StringExpression ` objects are either ``String terminals`` or the result of the `+` operator applied to some combination of ``String terminals`` and -:cpp:class:`StringExpression ` objects. +:cpp:class:`StringExpression ` objects. ``String terminals`` are: @@ -256,7 +256,7 @@ or the result of the `+` operator applied to some combination of ``String termin * Client-side string variables such as ``string x``. * Client-side string expressions such as ``x + "QQQ"`` * String columns, which are typically obtained from a call like - :cpp:func:`getCols `. + :cpp:func:`getCols `. Example: @@ -265,11 +265,11 @@ Example: auto t2 = t0.select(ticker, (ticker + "XYZ").as("Result")); auto t2_literal = t0.select("Ticker", "Result = Ticker + `XYZ`"); -:cpp:class:`StringExpression ` +:cpp:class:`StringExpression ` provides four additional methods that work on -:cpp:class:`StringExpression ` +:cpp:class:`StringExpression ` objects. These operations have the semantics described in the Deephaven documentation, and they yield -:cpp:class:`BooleanExpression ` +:cpp:class:`BooleanExpression ` (described in the :ref:`BooleanExpression` subsection). For example: .. code:: c++ @@ -285,12 +285,12 @@ DateTimeExpression `DateTime terminals` are: * C++ string literals, variables or string expressions in Deephaven - :cpp:class:`StringExpression ` + :cpp:class:`StringExpression ` format, e.g. ``"2020-03-01T09:45:00.123456 NY"``. * Client-side variables/expressions of type - :cpp:class:`StringExpression ` + :cpp:class:`StringExpression ` -:cpp:class:`StringExpression ` +:cpp:class:`StringExpression ` is the standard Deephaven Date/Time type, representing nanoseconds since January 1, 1970 UTC. .. _BooleanExpression: @@ -298,11 +298,11 @@ is the standard Deephaven Date/Time type, representing nanoseconds since January BooleanExpression ^^^^^^^^^^^^^^^^^ -:cpp:class:`BooleanExpression ` +:cpp:class:`BooleanExpression ` objets can be used to represent expressions involving boolean-valued columns (e.g. ``!boolCol1 || boolCol2``) but more commonly, they are used to represent the result of relational operators applied to other expression types. -:cpp:class:`BooleanExpression ` objects +:cpp:class:`BooleanExpression ` objects support the unary ``!``, as well as the binary operators ``&&`` and ``||`` and their cousins ``&`` and ``|``. @@ -333,7 +333,7 @@ This example creates two boolean-valued columns and does simplistic filtering on auto t3 = t.where(a && b); More commonly, -:cpp:class:`BooleanExpression ` +:cpp:class:`BooleanExpression ` are created as the result of relational operators on other expressions. For example we might say .. code:: c++ @@ -348,17 +348,17 @@ are created as the result of relational operators on other expressions. For exam auto result = temp.where(a > 15); Here ``a > 15`` applies the ``>`` operator to two -:cpp:class:`NumericExpression ` objects +:cpp:class:`NumericExpression ` objects yielding a -:cpp:class:`BooleanExpression ` +:cpp:class:`BooleanExpression ` suitable for passing to the -:cpp:func:`TableHandle ` +:cpp:func:`TableHandle ` method and being evaluated on the server. The library supports the usual relational operators (``<``, ``<=``, ``==``, ``>=``, ``>``, ``!=``) on -:cpp:class:`NumericExpression `, -:cpp:class:`StringExpression `, and -:cpp:class:`DateTimeExpression `; meanwhile -:cpp:class:`BooleanExpression ` +:cpp:class:`NumericExpression `, +:cpp:class:`StringExpression `, and +:cpp:class:`DateTimeExpression `; meanwhile +:cpp:class:`BooleanExpression ` itself supports only ``==`` and ``!=``. Column Terminals @@ -368,7 +368,7 @@ A Column Terminal is used to represent a database column symbolically, so it can fluent invocation such as ``t.where(a > 5)``. To do this, the program needs to know the name of the database column (in this example, "A") as well as its type (in this example, -:cpp:class:`NumCol `). +:cpp:class:`NumCol `). .. code:: c++ @@ -376,13 +376,13 @@ the database column (in this example, "A") as well as its type (in this example, The Column Terminal types are: -* :cpp:class:`NumCol ` -* :cpp:class:`StrCol ` -* :cpp:class:`DateTimeCol ` -* :cpp:class:`BoolCol ` +* :cpp:class:`NumCol ` +* :cpp:class:`StrCol ` +* :cpp:class:`DateTimeCol ` +* :cpp:class:`BoolCol ` Note that the single fluent type -:cpp:class:`NumCol ` +:cpp:class:`NumCol ` stands in for all the numeric types (``short``, ``int``, ``double``, and so on). This does *not* mean that the server represents all these types as the same thing, or that there is some kind of loss of precision involved. Rather @@ -399,15 +399,15 @@ The syntax for creating a single Column Terminal is auto col = table.getXXX(name); where ``getXXX`` is one of ` -:cpp:func:`getNumCol `, -:cpp:func:`getStrCol `, -:cpp:func:`getDateTimeCol `, +:cpp:func:`getNumCol `, +:cpp:func:`getStrCol `, +:cpp:func:`getDateTimeCol `, or -:cpp:func:`getBoolCol `, +:cpp:func:`getBoolCol `, and ``name`` is the name of the column. To conveniently bind more than one column at a time, the program can use -:cpp:func:`getCols `. +:cpp:func:`getCols `. For example this statement binds three columns at once: @@ -420,12 +420,12 @@ SelectColumns ^^^^^^^^^^^^^ A -:cpp:class:`SelectColumn ` +:cpp:class:`SelectColumn ` is an object suitable to be passed to a -:cpp:func:`select `, -:cpp:func:`update `, -:cpp:func:`view `, or -:cpp:func:`updateView ` +:cpp:func:`select `, +:cpp:func:`update `, +:cpp:func:`view `, or +:cpp:func:`updateView ` method. It either needs to either refer to an already-existing column, or it is an expression bound to a column name, which will cause a new column to be created. Examples: diff --git a/cpp-examples/doc/getting_started.rst b/cpp-examples/doc/getting_started.rst index f971d160f73..57cf05ac925 100644 --- a/cpp-examples/doc/getting_started.rst +++ b/cpp-examples/doc/getting_started.rst @@ -19,14 +19,14 @@ Hello, World Deephaven client programs typically follow this recipe: 1. Connect to the server with - :cpp:func:`Client::connect ` + :cpp:func:`Client::connect ` providing the server hostname and port. 2. Call - :cpp:func:`Client.getManager ` + :cpp:func:`Client.getManager ` to get a - :cpp:class:`TableHandleManager `. + :cpp:class:`TableHandleManager `. 3. Use that - :cpp:class:`TableHandleManager ` + :cpp:class:`TableHandleManager ` to create, access, or modify tables in the system. 4. Clean up resources automatically when the variables exit their scopes. @@ -37,7 +37,7 @@ This is the "Hello, World" example from the file ``hello_world/main.cc``. #include #include "deephaven/client/highlevel/client.h" - using deephaven::client::highlevel::Client; + using deephaven::client::Client; int main() { const char *server = "localhost:10000"; diff --git a/cpp-examples/doc/index.rst b/cpp-examples/doc/index.rst index 90359ce107d..41d22c50149 100644 --- a/cpp-examples/doc/index.rst +++ b/cpp-examples/doc/index.rst @@ -11,7 +11,7 @@ functionality. The library... between operations, without burdening the caller with managing callback state. * Provides a shared ownership model so that objects like - :cpp:class:`TableHandle ` + :cpp:class:`TableHandle ` can be manipulated like value types (e.g. freely copied). Their corresponding server resources will be cleaned up when last one goes out of scope. diff --git a/cpp-examples/doc/read_data_with_arrow_flight.rst b/cpp-examples/doc/read_data_with_arrow_flight.rst index ea54bc793e6..392ead4dc97 100644 --- a/cpp-examples/doc/read_data_with_arrow_flight.rst +++ b/cpp-examples/doc/read_data_with_arrow_flight.rst @@ -6,7 +6,7 @@ Client programs that read tables using typically follow the below recipe: 1. Get a ``shared_ptr`` to a ``arrow::flight::FlightStreamReader`` via - :cpp:func:`TableHandle::getFlightStreamReader ` + :cpp:func:`TableHandle::getFlightStreamReader ` 2. Read the data using operations as described in `Arrow Flight RPC `__ @@ -19,10 +19,10 @@ Consider the following program from ``cpp-examples/read_table_with_arrow_flight` #include "deephaven/client/utility/table_maker.h" #include "deephaven/client/utility/utility.h" - using deephaven::client::highlevel::NumCol; - using deephaven::client::highlevel::Client; - using deephaven::client::highlevel::TableHandle; - using deephaven::client::highlevel::TableHandleManager; + using deephaven::client::NumCol; + using deephaven::client::Client; + using deephaven::client::TableHandle; + using deephaven::client::TableHandleManager; using deephaven::client::utility::flight::statusOrDie; using deephaven::client::utility::TableMaker; From 4a026701f8e3bb7098c6403d0760464ff2f76db7 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Thu, 8 Sep 2022 12:43:15 -0600 Subject: [PATCH 116/215] Remove Python specific checks for parallel evaluation of formulas (#2813) * Rebase to resolve merge conflicts * Fix engine-table test failures --- .../deephaven/engine/table/ColumnSource.java | 13 ------- .../engine/table/impl/NaturalJoinHelper.java | 5 --- .../engine/table/impl/PrevColumnSource.java | 5 --- .../impl/UnboxedDateTimeColumnSource.java | 5 --- .../BiTableTransformationColumn.java | 2 +- .../impl/partitioned/LongConstantColumn.java | 2 +- .../TableTransformationColumn.java | 2 +- .../impl/select/AbstractFormulaColumn.java | 7 +--- .../table/impl/select/DhFormulaColumn.java | 37 ------------------- .../table/impl/select/FunctionalColumn.java | 2 +- .../select/MultiSourceFunctionalColumn.java | 4 +- .../select/analyzers/SelectColumnLayer.java | 9 +---- .../select/python/FormulaColumnPython.java | 5 --- .../impl/sources/BitMaskingColumnSource.java | 5 --- .../impl/sources/BitShiftingColumnSource.java | 5 --- .../sources/BooleanAsByteColumnSource.java | 5 --- .../table/impl/sources/BoxedColumnSource.java | 5 --- .../sources/ByteAsBooleanColumnSource.java | 5 --- .../sources/CrossJoinRightColumnSource.java | 5 --- .../sources/DateTimeAsLongColumnSource.java | 5 --- .../impl/sources/DelegatingColumnSource.java | 5 --- .../sources/LongAsDateTimeColumnSource.java | 5 --- .../impl/sources/RedirectedColumnSource.java | 5 --- .../impl/sources/ReversedColumnSource.java | 5 --- .../impl/sources/SwitchColumnSource.java | 5 --- .../UngroupedByteArrayColumnSource.java | 5 --- .../UngroupedByteVectorColumnSource.java | 5 --- .../UngroupedCharArrayColumnSource.java | 5 --- .../UngroupedCharVectorColumnSource.java | 5 --- .../UngroupedDoubleArrayColumnSource.java | 5 --- .../UngroupedDoubleVectorColumnSource.java | 5 --- .../UngroupedFloatArrayColumnSource.java | 5 --- .../UngroupedFloatVectorColumnSource.java | 5 --- .../UngroupedIntArrayColumnSource.java | 5 --- .../UngroupedIntVectorColumnSource.java | 5 --- .../UngroupedLongArrayColumnSource.java | 5 --- .../UngroupedLongVectorColumnSource.java | 5 --- .../UngroupedShortArrayColumnSource.java | 5 --- .../UngroupedShortVectorColumnSource.java | 5 --- .../table/impl/sources/UnionColumnSource.java | 11 ------ .../table/impl/sources/ViewColumnSource.java | 11 +----- .../aggregate/BaseAggregateColumnSource.java | 5 --- .../impl/util/ColumnsToRowsTransform.java | 5 --- .../table/impl/util/MergeSortedHelper.java | 5 --- .../io/deephaven/engine/util/WindowCheck.java | 5 --- .../impl/TestPartitionAwareSourceTable.java | 2 - .../table/impl/TestSimpleSourceTable.java | 2 - 47 files changed, 11 insertions(+), 263 deletions(-) diff --git a/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java b/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java index 351d3667fae..c1624ee3725 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/ColumnSource.java @@ -173,19 +173,6 @@ default ColumnSource cast(Class clazz) { return (ColumnSource) this; } - /** - * Can this column source be evaluated on an arbitrary thread? - * - * Most column sources can be evaluated on an arbitrary thread, however those that do call into Python can not be - * evaluated on an arbitrary thread as the calling thread may already have the GIL, which would result in a deadlock - * when the column source takes the GIL to evaluate formulas. - * - * @return true if this column prevents parallelization - */ - default boolean preventsParallelism() { - return false; - } - /** * Most column sources will return the same value for a given row without respect to the order that the rows are * read. Those columns sources are considered "stateless" and should return true. diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java index 490939d0638..04512cd1586 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java @@ -521,11 +521,6 @@ public void fillChunk(@NotNull final FillContext context, destination.setSize(longChunk.size()); } - @Override - public boolean preventsParallelism() { - return symbolSource.preventsParallelism(); - } - @Override public boolean isStateless() { return symbolSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java index e52baa6af4e..7af75576860 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java @@ -167,11 +167,6 @@ public final void fillPrevChunk(@NotNull final FillContext context, throw new UnsupportedOperationException(); } - @Override - public boolean preventsParallelism() { - return originalSource.preventsParallelism(); - } - @Override public boolean isStateless() { return originalSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UnboxedDateTimeColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UnboxedDateTimeColumnSource.java index 237a4812f3a..57b73904291 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UnboxedDateTimeColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UnboxedDateTimeColumnSource.java @@ -49,11 +49,6 @@ public ColumnSource doReinterpret( return (ColumnSource) alternateColumnSource; } - @Override - public boolean preventsParallelism() { - return alternateColumnSource.preventsParallelism(); - } - @Override public boolean isStateless() { return alternateColumnSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java index 4fcc375c25e..a78458837af 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/BiTableTransformationColumn.java @@ -71,7 +71,7 @@ public List getColumns() { @NotNull @Override public ColumnSource getDataView() { - return new ViewColumnSource<>(Table.class, new OutputFormula(), false, true); + return new ViewColumnSource<>(Table.class, new OutputFormula(), true); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/LongConstantColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/LongConstantColumn.java index 9e712308b79..7ace17cee74 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/LongConstantColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/LongConstantColumn.java @@ -56,7 +56,7 @@ public List getColumns() { @NotNull @Override public ColumnSource getDataView() { - return new ViewColumnSource<>(long.class, new OutputFormula(), false, true); + return new ViewColumnSource<>(long.class, new OutputFormula(), true); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java index ea01fe4b043..262d12c08c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/TableTransformationColumn.java @@ -66,7 +66,7 @@ public List getColumns() { @NotNull @Override public ColumnSource getDataView() { - return new ViewColumnSource<>(Table.class, new OutputFormula(), false, true); + return new ViewColumnSource<>(Table.class, new OutputFormula(), true); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java index 4929050eac8..66459d1d3df 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java @@ -198,7 +198,6 @@ public ColumnSource getLazyView() { @NotNull private ColumnSource getViewColumnSource(boolean lazy) { - final boolean preventsParallelization = preventsParallelization(); final boolean isStateless = isStateless(); final SecurityManager sm = System.getSecurityManager(); @@ -219,18 +218,16 @@ private ColumnSource getViewColumnSource(boolean lazy) { final Formula formula = getFormula(lazy, columnSources, params); // noinspection unchecked,rawtypes return new ViewColumnSource((returnedType == boolean.class ? Boolean.class : returnedType), formula, - preventsParallelization, isStateless); + isStateless); }, context); } else { final Formula formula = getFormula(lazy, columnSources, params); // noinspection unchecked,rawtypes return new ViewColumnSource((returnedType == boolean.class ? Boolean.class : returnedType), formula, - preventsParallelization, isStateless); + isStateless); } } - public abstract boolean preventsParallelization(); - private Formula getFormula(boolean initLazyMap, Map> columnsToData, QueryScopeParam... params) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java index da4de5afd46..4359c8d08ac 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java @@ -831,37 +831,10 @@ private static boolean isImmutableType(QueryScopeParam param) { return TypeUtils.isBoxedType(type); } - /** - * Is this parameter possibly a Python type? - * - * Immutable types are not Python, known Python wrappers are Python, and anything else from a PythonScope is Python. - * - * @return true if this query scope parameter may be a Python type - */ - private static boolean isPythonType(QueryScopeParam param) { - if (isImmutableType(param)) { - return false; - } - - // we want to catch PyObjects, and CallableWrappers even if they were hand inserted into a scope - final Object value = param.getValue(); - if (value instanceof PyObject || value instanceof PythonScopeJpyImpl.CallableWrapper - || value instanceof PyListWrapper || value instanceof PyDictWrapper) { - return true; - } - - // beyond the immutable types, we must assume that anything coming from Python is python - return ExecutionContext.getContext().getQueryScope() instanceof PythonScope; - } - private boolean isUsedColumnStateless(String columnName) { return columnSources.get(columnName).isStateless(); } - private boolean usedColumnUsesPython(String columnName) { - return columnSources.get(columnName).preventsParallelism(); - } - @Override public boolean isStateless() { return Arrays.stream(params).allMatch(DhFormulaColumn::isImmutableType) @@ -869,14 +842,4 @@ public boolean isStateless() { && usedColumnArrays.stream().allMatch(this::isUsedColumnStateless); } - /** - * Does this formula column use Python (which would cause us to hang the GIL if we evaluate it off thread?) - * - * @return true if this column has the potential to hang the gil - */ - public boolean preventsParallelization() { - return Arrays.stream(params).anyMatch(DhFormulaColumn::isPythonType) - || usedColumns.stream().anyMatch(this::usedColumnUsesPython) - || usedColumnArrays.stream().anyMatch(this::usedColumnUsesPython); - } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FunctionalColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FunctionalColumn.java index 8080a723d0b..ea2e251d348 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FunctionalColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FunctionalColumn.java @@ -177,7 +177,7 @@ public void fillPrevChunk(@NotNull FillContext fillContext, final FunctionalColumnFillContext ctx = (FunctionalColumnFillContext) fillContext; ctx.chunkFiller.fillByIndices(this, rowSequence, destination); } - }, sourceColumnSource.preventsParallelism(), false); + }, false); } private static class FunctionalColumnFillContext implements Formula.FillContext { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MultiSourceFunctionalColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MultiSourceFunctionalColumn.java index 3560290b0e7..1ce7b16f347 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MultiSourceFunctionalColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/MultiSourceFunctionalColumn.java @@ -94,8 +94,6 @@ public List initInputs(TrackingRowSet rowSet, Map d byteDestination.setSize(booleanObjectChunk.size()); } - @Override - public boolean preventsParallelism() { - return alternateColumnSource.preventsParallelism(); - } - @Override public boolean isStateless() { return alternateColumnSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BoxedColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BoxedColumnSource.java index 6fbc071aef6..2e0a60d5f56 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BoxedColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BoxedColumnSource.java @@ -155,11 +155,6 @@ final void transformChunk(@NotNull final Chunk source, } } - @Override - public boolean preventsParallelism() { - return originalSource.preventsParallelism(); - } - @Override public boolean isStateless() { return originalSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteAsBooleanColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteAsBooleanColumnSource.java index 0b175eebb62..1c288d5bffe 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteAsBooleanColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ByteAsBooleanColumnSource.java @@ -132,11 +132,6 @@ public void fillPrevChunkUnordered(@NotNull FillContext context, @NotNull Writab convertToBoolean(dest, toBooleanFillContext.byteChunk); } - @Override - public boolean preventsParallelism() { - return alternateColumnSource.preventsParallelism(); - } - @Override public boolean isStateless() { return alternateColumnSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CrossJoinRightColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CrossJoinRightColumnSource.java index cca3dadbb6a..ea63821d06a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CrossJoinRightColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CrossJoinRightColumnSource.java @@ -687,11 +687,6 @@ private void doOrderedFillAndPermute(@NotNull final ColumnSource innerSource, } } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DateTimeAsLongColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DateTimeAsLongColumnSource.java index 962b809f3f7..5784ccc3e2c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DateTimeAsLongColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DateTimeAsLongColumnSource.java @@ -93,11 +93,6 @@ private static void convertToLong(@NotNull final WritableChunk d longDestination.setSize(dateTimeChunk.size()); } - @Override - public boolean preventsParallelism() { - return alternateColumnSource.preventsParallelism(); - } - @Override public boolean isStateless() { return alternateColumnSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java index 5a4c379d8c3..d38d12278bd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java @@ -202,11 +202,6 @@ public short getPrevShort(long rowKey) { return delegate.getPrevShort(rowKey); } - @Override - public boolean preventsParallelism() { - return delegate.preventsParallelism(); - } - @Override public boolean isStateless() { return delegate.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongAsDateTimeColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongAsDateTimeColumnSource.java index 5ca4fdc57f8..d48f460cc5f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongAsDateTimeColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/LongAsDateTimeColumnSource.java @@ -136,11 +136,6 @@ private static void convertToDateTime(@NotNull final WritableChunk innerSource, } } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ReversedColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ReversedColumnSource.java index a766b6f3879..8ba61bd94f0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ReversedColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ReversedColumnSource.java @@ -175,11 +175,6 @@ public void fillPrevChunk(@NotNull ColumnSource.FillContext _context, context.reverseKernel.reverse(destination); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SwitchColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SwitchColumnSource.java index 9afe8ae82ea..3e329e52940 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SwitchColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/SwitchColumnSource.java @@ -298,11 +298,6 @@ private boolean prevInvalid() { return prevValidityStep == -1 || prevValidityStep != LogicalClock.DEFAULT.currentStep(); } - @Override - public boolean preventsParallelism() { - return currentSource.preventsParallelism() || (!prevInvalid() && prevSource.preventsParallelism()); - } - @Override public boolean isStateless() { return currentSource.isStateless() && (prevInvalid() || prevSource.isStateless()); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java index dc167c1ba8b..ef7b0aaa714 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java index e7161002a11..67103a75e0e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedByteVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharArrayColumnSource.java index d181e8d6e50..a365a7e5047 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharArrayColumnSource.java @@ -55,11 +55,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharVectorColumnSource.java index f0d28e0dbef..478e53ad18c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedCharVectorColumnSource.java @@ -106,11 +106,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java index c7d9aedc0d8..92a68163bda 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java index 03b8e52aadd..4eb6cd55bbd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedDoubleVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java index b5ce1ef674f..c1e1a73dad7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java index e114c1293a2..14e7e4c8bad 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedFloatVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java index a2d8fb133fc..5059894b5f2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java index 712beafa8a3..f5222b4b3f6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedIntVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java index 089c5f62c71..5e1d359de61 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java index de7bf315ff9..0c68797c14e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedLongVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java index 275589ad2a2..6fadb7a6073 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortArrayColumnSource.java @@ -60,11 +60,6 @@ public boolean isImmutable() { return innerSource.isImmutable(); } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java index d4469523b85..8bbbed732d2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UngroupedShortVectorColumnSource.java @@ -111,11 +111,6 @@ public boolean isImmutable() { return false; } - @Override - public boolean preventsParallelism() { - return innerSource.preventsParallelism(); - } - @Override public boolean isStateless() { return innerSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionColumnSource.java index 134a6062fc8..88ae19afbb6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionColumnSource.java @@ -18,7 +18,6 @@ import io.deephaven.hash.KeyedObjectKey; import io.deephaven.chunk.ResettableWritableChunk; import io.deephaven.chunk.WritableChunk; -import io.deephaven.qst.column.Column; import io.deephaven.util.SafeCloseable; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -763,16 +762,6 @@ public boolean isImmutable() { } } - @Override - public boolean preventsParallelism() { - if (!unionSourceManager.isUsingComponentsSafe()) { - return true; - } - try (final Stream> sources = sourceLookup.currSources()) { - return sources.anyMatch(ColumnSource::preventsParallelism); - } - } - @Override public boolean isStateless() { if (!unionSourceManager.isUsingComponentsSafe()) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java index 9359824135d..0dff1ce0147 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java @@ -41,21 +41,18 @@ public class ViewColumnSource extends AbstractColumnSource { new ProtectionDomain[] {new ProtectionDomain( new CodeSource(groovyShellUrl, (java.security.cert.Certificate[]) null), perms)})); - private final boolean preventsParallelization; private final boolean isStateless; - public ViewColumnSource(Class type, Formula formula, boolean preventsParallelization, boolean isStateless) { + public ViewColumnSource(Class type, Formula formula, boolean isStateless) { super(type); this.formula = formula; - this.preventsParallelization = preventsParallelization; this.isStateless = isStateless; } - public ViewColumnSource(Class type, Class elementType, Formula formula, boolean preventsParallelization, + public ViewColumnSource(Class type, Class elementType, Formula formula, boolean isStateless) { super(type, elementType); this.formula = formula; - this.preventsParallelization = preventsParallelization; this.isStateless = isStateless; } @@ -288,10 +285,6 @@ public void close() { } } - public boolean preventsParallelism() { - return preventsParallelization; - } - @Override public boolean isStateless() { return isStateless; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/aggregate/BaseAggregateColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/aggregate/BaseAggregateColumnSource.java index a0d2558bea2..ac9313636e6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/aggregate/BaseAggregateColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/aggregate/BaseAggregateColumnSource.java @@ -244,11 +244,6 @@ public final long getUngroupedPrevLong(final long groupIndexKey, final int offse return aggregatedSource.getPrevLong(getPrevRowKey(groupIndexKey, offsetInGroup)); } - @Override - public boolean preventsParallelism() { - return aggregatedSource.preventsParallelism() || groupRowSetSource.preventsParallelism(); - } - @Override public boolean isStateless() { return aggregatedSource.isStateless() && groupRowSetSource.isStateless(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/ColumnsToRowsTransform.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/ColumnsToRowsTransform.java index b1956612dce..65abb6e896d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/ColumnsToRowsTransform.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/ColumnsToRowsTransform.java @@ -615,11 +615,6 @@ private void doFillAndPermute(@NotNull final WritableChunk desti } } - @Override - public boolean preventsParallelism() { - return Arrays.stream(transposeColumns).anyMatch(ColumnSource::preventsParallelism); - } - @Override public boolean isStateless() { return Arrays.stream(transposeColumns).allMatch(ColumnSource::isStateless); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/MergeSortedHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/MergeSortedHelper.java index d5c84b96678..04f6dafb330 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/MergeSortedHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/MergeSortedHelper.java @@ -278,11 +278,6 @@ public boolean isImmutable() { return true; } - @Override - public boolean preventsParallelism() { - return innerSources.stream().anyMatch(ColumnSource::preventsParallelism); - } - @Override public boolean isStateless() { return innerSources.stream().allMatch(ColumnSource::isStateless); diff --git a/engine/table/src/main/java/io/deephaven/engine/util/WindowCheck.java b/engine/table/src/main/java/io/deephaven/engine/util/WindowCheck.java index db96475b997..56ad2bf2214 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/WindowCheck.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/WindowCheck.java @@ -461,11 +461,6 @@ private void captureTime() { clockStep = LogicalClock.DEFAULT.currentStep(); } - @Override - public boolean preventsParallelism() { - return timeStampSource.preventsParallelism(); - } - @Override public boolean isStateless() { return timeStampSource.isStateless(); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionAwareSourceTable.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionAwareSourceTable.java index 81e38eeaf2e..942cc804bac 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionAwareSourceTable.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestPartitionAwareSourceTable.java @@ -425,8 +425,6 @@ private void doTestRedefinition() { will(returnValue(columnDefinition.getDataType())); allowing(columnSource).getComponentType(); will(returnValue(columnDefinition.getComponentType())); - allowing(columnSource).preventsParallelism(); - will(returnValue(false)); allowing(columnSource).isStateless(); will(returnValue(true)); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSimpleSourceTable.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSimpleSourceTable.java index 6351262d691..7700ade4724 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSimpleSourceTable.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestSimpleSourceTable.java @@ -75,8 +75,6 @@ public void setUp() throws Exception { will(returnValue(cd.getDataType())); allowing(mocked).getComponentType(); will(returnValue(cd.getComponentType())); - allowing(mocked).preventsParallelism(); - will(returnValue(false)); allowing(mocked).isStateless(); will(returnValue(true)); } From e43cd36b0e0c92067a6895db01312fb46b37723e Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Thu, 8 Sep 2022 13:51:12 -0600 Subject: [PATCH 117/215] Write a unit test to verify that @FinalDefault is respected (#2825) --- .../engine/table/impl/DefaultChunkSource.java | 10 - .../engine/table/impl/PrevColumnSource.java | 5 - .../engine/table/impl/TableDefaults.java | 1 - .../impl/sources/DelegatingColumnSource.java | 12 - extensions/classgraph/build.gradle | 2 +- server/build.gradle | 2 + .../util/annotations/TestFinalDefault.java | 275 ++++++++++++++++++ 7 files changed, 278 insertions(+), 29 deletions(-) create mode 100644 server/src/test/java/io/deephaven/util/annotations/TestFinalDefault.java diff --git a/engine/base/src/main/java/io/deephaven/engine/table/impl/DefaultChunkSource.java b/engine/base/src/main/java/io/deephaven/engine/table/impl/DefaultChunkSource.java index e6f5befdc6b..0ac739a7c6d 100644 --- a/engine/base/src/main/java/io/deephaven/engine/table/impl/DefaultChunkSource.java +++ b/engine/base/src/main/java/io/deephaven/engine/table/impl/DefaultChunkSource.java @@ -99,20 +99,10 @@ public GetContext makeGetContext(int chunkCapacity, SharedContext sharedContext) return chunkSource.makeGetContext(chunkCapacity, sharedContext); } - @Override - public GetContext makeGetContext(int chunkCapacity) { - return chunkSource.makeGetContext(chunkCapacity); - } - @Override public FillContext makeFillContext(int chunkCapacity, SharedContext sharedContext) { return chunkSource.makeFillContext(chunkCapacity, sharedContext); } - - @Override - public FillContext makeFillContext(int chunkCapacity) { - return chunkSource.makeFillContext(chunkCapacity); - } }; } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java index 7af75576860..e64577ea8e8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrevColumnSource.java @@ -128,11 +128,6 @@ public final boolean isImmutable() { return originalSource.isImmutable(); } - @Override - public final ChunkType getChunkType() { - return originalSource.getChunkType(); - } - @Override public final GetContext makeGetContext(final int chunkCapacity, final SharedContext sharedContext) { return originalSource.makeGetContext(chunkCapacity, sharedContext); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java index 03dcd4b1019..c3cc31e963c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java @@ -179,7 +179,6 @@ default ShortColumnIterator shortColumnIterator(@NotNull final String columnName } @Override - @FinalDefault default IntegerColumnIterator integerColumnIterator(@NotNull final String columnName) { return new IntegerColumnIterator(this, columnName); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java index d38d12278bd..f4d33b70a30 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/DelegatingColumnSource.java @@ -145,23 +145,11 @@ public FillContext makeFillContext(int chunkCapacity, SharedContext sharedContex return delegate.makeFillContext(chunkCapacity, sharedContext); } - @Override - @FinalDefault - public FillContext makeFillContext(int chunkCapacity) { - return delegate.makeFillContext(chunkCapacity); - } - @Override public GetContext makeGetContext(int chunkCapacity, SharedContext sharedContext) { return delegate.makeGetContext(chunkCapacity, sharedContext); } - @Override - @FinalDefault - public GetContext makeGetContext(int chunkCapacity) { - return delegate.makeGetContext(chunkCapacity); - } - @Override public Boolean getPrevBoolean(long rowKey) { return delegate.getPrevBoolean(rowKey); diff --git a/extensions/classgraph/build.gradle b/extensions/classgraph/build.gradle index cef93d41192..16b3346716a 100644 --- a/extensions/classgraph/build.gradle +++ b/extensions/classgraph/build.gradle @@ -9,7 +9,7 @@ dependencies { compileOnly 'javax.inject:javax.inject:1' - api 'io.github.classgraph:classgraph:4.8.103' + api 'io.github.classgraph:classgraph:4.8.149' Classpaths.inheritAutoService(project) } diff --git a/server/build.gradle b/server/build.gradle index 6754a0e04fa..84e2e811b9b 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -57,6 +57,8 @@ dependencies { if ('true' == project.findProperty('extensions.classgraph.enabled')) { runtimeOnly project(':extensions-classgraph') } + testImplementation project(':extensions-classgraph') + if ('true' == project.findProperty('extensions.suanshu.enabled')) { runtimeOnly project(':extensions-suanshu') } diff --git a/server/src/test/java/io/deephaven/util/annotations/TestFinalDefault.java b/server/src/test/java/io/deephaven/util/annotations/TestFinalDefault.java new file mode 100644 index 00000000000..5becff64653 --- /dev/null +++ b/server/src/test/java/io/deephaven/util/annotations/TestFinalDefault.java @@ -0,0 +1,275 @@ +package io.deephaven.util.annotations; + +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfo; +import io.github.classgraph.MethodInfo; +import io.github.classgraph.ScanResult; +import org.junit.Assert; +import org.junit.Test; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Target; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; + +public class TestFinalDefault { + private static final Logger logger = LoggerFactory.getLogger(TestFinalDefault.class); + private static final String FINAL_DEFAULT = FinalDefault.class.getName(); + private static final String EXPECT_EXCEPTION = ExpectException.class.getName(); + + @Test + public void testForOverriddenFinalDefault() { + checkForOverridesInPackage("io.deephaven", FINAL_DEFAULT); + } + + @Test + public void testClassA() { + expectFailure(() -> checkForOverridesInClass(TestClassA.class, EXPECT_EXCEPTION)); + } + + @Test + public void testClassB() { + expectFailure(() -> checkForOverridesInClass(TestClassB.class, EXPECT_EXCEPTION)); + } + + @Test + public void testClassC() { + expectFailure(() -> checkForOverridesInClass(TestClassC.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSubInterfaceA() { + expectFailure(() -> checkForOverridesInClass(TestSubInterfaceA.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSubInterfaceB() { + expectFailure(() -> checkForOverridesInClass(TestSubInterfaceB.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSubInterfaceC() { + expectFailure(() -> checkForOverridesInClass(TestSubInterfaceC.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSuperClassA() { + expectFailure(() -> checkForOverridesInClass(TestSuperClassA.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSuperClassB() { + expectFailure(() -> checkForOverridesInClass(TestSuperClassB.class, EXPECT_EXCEPTION)); + } + + @Test + public void testSuperClassC() { + expectFailure(() -> checkForOverridesInClass(TestSuperClassC.class, EXPECT_EXCEPTION)); + } + + @Test + public void testGenericClassA() { + expectFailure(() -> checkForOverridesInClass(TestGenericClassA.class, EXPECT_EXCEPTION)); + } + + @Test + public void testGenericClassB() { + expectFailure(() -> checkForOverridesInClass(TestGenericClassB.class, EXPECT_EXCEPTION)); + } + + @Test + public void testGenericClassC() { + expectFailure(() -> checkForOverridesInClass(TestGenericClassC.class, EXPECT_EXCEPTION)); + } + + @Test + public void testFixedClassA() { + expectFailure(() -> checkForOverridesInClass(TestFixedClassA.class, EXPECT_EXCEPTION)); + } + + @Test + public void testFixedClassB() { + expectFailure(() -> checkForOverridesInClass(TestFixedClassB.class, EXPECT_EXCEPTION)); + } + + @Test + public void testFixedClassC() { + expectFailure(() -> checkForOverridesInClass(TestFixedClassC.class, EXPECT_EXCEPTION)); + } + + @Target({ElementType.METHOD}) + @Inherited + public @interface ExpectException { + } + public interface TestInterface { + @ExpectException + default void test() {} + } + public static class TestClassA implements TestInterface { + public void test() {} + } + public static class TestClassB implements TestInterface { + @Override + public void test() {} + } + public static class TestClassC implements TestInterface { + @ExpectException + public void test() {} + } + public interface TestSubInterfaceA extends TestInterface { + default void test() {} + } + public interface TestSubInterfaceB extends TestInterface { + @Override + default void test() {} + } + public interface TestSubInterfaceC extends TestInterface { + @ExpectException + default void test() {} + } + public static class TestSuperClass { + @ExpectException + public void test() {} + } + public static class TestSuperClassA extends TestSuperClass { + public void test() {} + } + public static class TestSuperClassB extends TestSuperClass { + @Override + public void test() {} + } + public static class TestSuperClassC extends TestSuperClass { + @ExpectException + public void test() {} + } + public interface TestGenericInterface { + @ExpectException + default T test(T t) { + return null; + } + } + public static class TestGenericClassA implements TestGenericInterface { + public T test(T t) { + return null; + } + } + public static class TestGenericClassB implements TestGenericInterface { + @Override + public T test(T t) { + return null; + } + } + public static class TestGenericClassC implements TestGenericInterface { + @ExpectException + public T test(T t) { + return null; + } + } + public static class TestFixedClassA implements TestGenericInterface { + public String test(String s) { + return null; + } + } + public static class TestFixedClassB implements TestGenericInterface { + @Override + public String test(String s) { + return null; + } + } + public static class TestFixedClassC implements TestGenericInterface { + @ExpectException + public String test(String s) { + return null; + } + } + + private static void expectFailure(final Runnable runner) { + try { + runner.run(); + } catch (final AssertionError e) { + return; // assertion is expected + } + Assert.fail("Expected assertion failure, but none was thrown"); + } + + @SuppressWarnings("SameParameterValue") + private static void checkForOverridesInPackage(final String packageName, final String annotationName) { + checkForOverrides(new ClassGraph().enableAllInfo().acceptPackages(packageName), annotationName); + } + + @SuppressWarnings("SameParameterValue") + private static void checkForOverridesInClass(final Class cls, final String annotationName) { + checkForOverrides(new ClassGraph().enableAllInfo().acceptClasses(cls.getName()), annotationName); + } + + private static void checkForOverrides(final ClassGraph classGraph, final String annotationName) { + final List errors = new ArrayList<>(); + int numClassesChecked = 0; + int numAnnotatedMethodsChecked = 0; + try (ScanResult scanResult = classGraph.scan()) { + for (final ClassInfo classInfo : scanResult.getClassesWithMethodAnnotation(annotationName)) { + numClassesChecked++; + for (final MethodInfo methodInfo : classInfo.getDeclaredMethodInfo()) { + if (!methodInfo.hasAnnotation(annotationName)) { + continue; + } + numAnnotatedMethodsChecked++; + findOverrides(methodInfo).forEach(method -> { + errors.add("Method " + methodInfo.getName() + " in " + + method.getDeclaringClass() + " overrides " + classInfo.getName() + " but is " + + "annotated with " + annotationName + "."); + }); + } + } + } + + if (!errors.isEmpty()) { + errors.forEach(error -> logger.error().append(error).endl()); + Assert.fail("Found " + errors.size() + " methods annotated with " + annotationName + + " that are overridden."); + } + logger.info().append("Verified ").append(annotationName).append(" on ").append(numClassesChecked) + .append(" classes and ").append(numAnnotatedMethodsChecked).append(" methods.").endl(); + } + + private static Collection findOverrides(final MethodInfo target) { + final Collection overrides = new ArrayList<>(); + + final Method targetMethod = target.loadClassAndGetMethod(); + final Consumer visitClass = (ci) -> { + Arrays.stream(ci.loadClass().getDeclaredMethods()) + .filter(m -> overrides(m, targetMethod)) + .forEach(overrides::add); + }; + + final ClassInfo clsInfo = target.getClassInfo(); + clsInfo.getSubclasses().forEach(visitClass); + if (clsInfo.isInterface()) { + clsInfo.getClassesImplementing().forEach(visitClass); + } + + return overrides; + } + + private static boolean overrides(final Method override, final Method target) { + if (!target.getName().equals(override.getName())) { + return false; + } + if (target.getParameterCount() != override.getParameterCount()) { + return false; + } + for (int ii = 0; ii < target.getParameterCount(); ++ii) { + if (!target.getParameterTypes()[ii].isAssignableFrom(override.getParameterTypes()[ii])) { + return false; + } + } + return target.getReturnType().isAssignableFrom(override.getReturnType()); + } +} From d7ceb4d531719d02c28cf9b6bcfa19097a2a243b Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 8 Sep 2022 13:38:56 -0700 Subject: [PATCH 118/215] Bump to slf4j 2.0.0 and logback 1.4.0 (#2826) --- buildSrc/src/main/groovy/Classpaths.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index a1f2470bd02..3cf55541b59 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -49,7 +49,7 @@ class Classpaths { static final String ARROW_VERSION = '7.0.0' static final String SLF4J_GROUP = 'org.slf4j' - static final String SLF4J_VERSION = '2.0.0-alpha5' + static final String SLF4J_VERSION = '2.0.0' static final String FLATBUFFER_GROUP = 'com.google.flatbuffers' static final String FLATBUFFER_NAME = 'flatbuffers-java' @@ -88,7 +88,7 @@ class Classpaths { static final String LOGBACK_GROUP = 'ch.qos.logback' static final String LOGBACK_NAME = 'logback-classic' - static final String LOGBACK_VERSION = '1.3.0-alpha12' + static final String LOGBACK_VERSION = '1.4.0' static final String GROOVY_GROUP = 'org.codehaus.groovy' static final String GROOVY_VERSION = '3.0.9' From d63e544b74e8b2d7e42c744cc92e334de60f63de Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 8 Sep 2022 14:13:07 -0700 Subject: [PATCH 119/215] Bump jetty to 11.0.11 (#2827) --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 3cf55541b59..87b1ffdc80a 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -116,7 +116,7 @@ class Classpaths { static final String JETTY11_GROUP = 'org.eclipse.jetty' static final String JETTY11_NAME = 'jetty-bom' - static final String JETTY11_VERSION = '11.0.8' + static final String JETTY11_VERSION = '11.0.11' static boolean addDependency(Configuration conf, String group, String name, String version, Action configure = Actions.doNothing()) { if (!conf.dependencies.find { it.name == name && it.group == group}) { From ec8111bc9d8fde3eae2221223c7c4337a3ac7f45 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 9 Sep 2022 12:49:15 -0700 Subject: [PATCH 120/215] Use double hashing for HashMapBase (#2810) Fixes #2784 --- .../util/datastructures/hash/HashMapBase.java | 32 +++++ .../util/datastructures/hash/HashMapK1V1.java | 5 +- .../util/datastructures/hash/HashMapK2V2.java | 5 +- .../util/datastructures/hash/HashMapK4V4.java | 5 +- engine/table/build.gradle | 15 ++ engine/table/src/jmh/README.md | 14 ++ .../engine/bench/BlackholeListener.java | 28 ++++ .../io/deephaven/engine/bench/Functions.java | 73 ++++++++++ .../bench/IncrementalSortCyclesBenchmark.java | 135 ++++++++++++++++++ .../IncrementalSortCyclesBenchmarkBase.java | 88 ++++++++++++ .../bench/IncrementalSortRedirectionBase.java | 122 ++++++++++++++++ ...IncrementalSortRedirectionDefaultCase.java | 5 + .../IncrementalSortRedirectionEdgeCase.java | 12 ++ 13 files changed, 530 insertions(+), 9 deletions(-) create mode 100644 engine/table/src/jmh/README.md create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/BlackholeListener.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/Functions.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmark.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmarkBase.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionBase.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionDefaultCase.java create mode 100644 engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionEdgeCase.java diff --git a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapBase.java b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapBase.java index e83dd8e1776..ce8ce39a527 100644 --- a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapBase.java +++ b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapBase.java @@ -461,4 +461,36 @@ public void putAll(TLongLongMap map) { public TLongCollection valueCollection() { return null; } + + /** + * Computes Stafford variant 13 of 64bit mix function. + * + *

    + * See David Stafford's Mix13 + * variant / java.util.SplittableRandom#mix64(long). + */ + static long mix64(long key) { + key ^= (key >>> 30); + key *= 0xbf58476d1ce4e5b9L; + key ^= (key >>> 27); + key *= 0x94d049bb133111ebL; + key ^= (key >>> 31); + return key; + } + + /** + * This poorly distributed hash function has been intentionally left with the acknowledgement that some sequentially + * indexed key cases may benefit from the cacheability of the poor distribution. If we find common use cases in the + * future where this poor first hash causes more problems than it solves, we can update it to a better distributed + * hash function. + */ + static int probe1(long key, int range) { + final long badHash = (key ^ (key >>> 32)); + return (int) ((badHash & 0x7fffffffffffffffL) % range); + } + + static int probe2(long key, int range) { + final long mixHash = mix64(key); + return (int) ((mixHash & 0x7fffffffffffffffL) % range); + } } diff --git a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK1V1.java b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK1V1.java index 631c1f1d0be..8e63c5af55a 100644 --- a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK1V1.java +++ b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK1V1.java @@ -88,8 +88,7 @@ private static int getLocationFor(long[] kvs, long target) { // In units of buckets final int numBuckets = length / (1 * 2); - final int hash1 = gnu.trove.impl.HashFunctions.hash(target) & 0x7fffffff; - final int bucketProbe = hash1 % numBuckets; + final int bucketProbe = probe1(target, numBuckets); // In units of longs again int probe = bucketProbe * (1 * 2); @@ -114,7 +113,7 @@ private static int getLocationFor(long[] kvs, long target) { } // Offset is also in units of longs - final int offset = (1 + (hash1 % (numBuckets - 2))) * (1 * 2); + final int offset = (1 + probe2(target, numBuckets - 2)) * (1 * 2); final int probeStart = probe; while (true) { probe = (int) (((long) probe + offset) % length); diff --git a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK2V2.java b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK2V2.java index 167adb1b78c..e321ef1f4fa 100644 --- a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK2V2.java +++ b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK2V2.java @@ -88,8 +88,7 @@ private static int getLocationFor(long[] kvs, long target) { // In units of buckets final int numBuckets = length / (2 * 2); - final int hash1 = gnu.trove.impl.HashFunctions.hash(target) & 0x7fffffff; - final int bucketProbe = hash1 % numBuckets; + final int bucketProbe = probe1(target, numBuckets); // In units of longs again int probe = bucketProbe * (2 * 2); @@ -123,7 +122,7 @@ private static int getLocationFor(long[] kvs, long target) { } // Offset is also in units of longs - final int offset = (1 + (hash1 % (numBuckets - 2))) * (2 * 2); + final int offset = (1 + probe2(target, numBuckets - 2)) * (2 * 2); final int probeStart = probe; while (true) { probe = (int) (((long) probe + offset) % length); diff --git a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK4V4.java b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK4V4.java index d1cad9050c8..947c1282b33 100644 --- a/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK4V4.java +++ b/Util/src/main/java/io/deephaven/util/datastructures/hash/HashMapK4V4.java @@ -87,8 +87,7 @@ private static int getLocationFor(long[] kvs, long target) { // In units of buckets final int numBuckets = length / (4 * 2); - final int hash1 = gnu.trove.impl.HashFunctions.hash(target) & 0x7fffffff; - final int bucketProbe = hash1 % numBuckets; + final int bucketProbe = probe1(target, numBuckets); // In units of longs again int probe = bucketProbe * (4 * 2); @@ -140,7 +139,7 @@ private static int getLocationFor(long[] kvs, long target) { } // Offset is also in units of longs - final int offset = (1 + (hash1 % (numBuckets - 2))) * (4 * 2); + final int offset = (1 + probe2(target, numBuckets - 2)) * (4 * 2); final int probeStart = probe; while (true) { probe = (int) (((long) probe + offset) % length); diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 879be96a368..fd02bebaf78 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'io.deephaven.project.register' + id 'me.champeau.jmh' version '0.6.7' } description 'Engine Table: Implementation and closely-coupled utilities' @@ -22,6 +23,12 @@ sourceSets { } } +configurations { + // Ensure jmh picks up the same dependencies as tests + jmhImplementation.extendsFrom testImplementation + jmhRuntimeOnly.extendsFrom testRuntimeOnly +} + dependencies { api project(':Util') api project(':TableLogger') @@ -140,3 +147,11 @@ tasks.testParallel.maxHeapSize = maxHeapSize tasks.testSerial.maxHeapSize = maxHeapSize tasks.testOutOfBand.maxHeapSize = maxHeapSize tasks.test.maxHeapSize = maxHeapSize + +jmh { + jmhVersion = '1.35' +} + +// No need to assemble the jar by default on build +// assemble.dependsOn(jmhJar) +check.dependsOn(jmhClasses) diff --git a/engine/table/src/jmh/README.md b/engine/table/src/jmh/README.md new file mode 100644 index 00000000000..72f5ec23d9b --- /dev/null +++ b/engine/table/src/jmh/README.md @@ -0,0 +1,14 @@ +# engine-table JMH + +``` +./gradlew engine-table:jmhJar +java -jar engine/table/build/libs/deephaven-engine-table--jmh.jar +``` + +### Incremental Sort Cycles Benchmark + +``` +java -jar engine/table/build/libs/deephaven-engine-table--jmh.jar \ + io.deephaven.engine.bench.IncrementalSortCyclesBenchmark \ + -p params=REVERSE_START_0_CYCLE_1m +``` diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/BlackholeListener.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/BlackholeListener.java new file mode 100644 index 00000000000..f164de72be2 --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/BlackholeListener.java @@ -0,0 +1,28 @@ +package io.deephaven.engine.bench; + +import io.deephaven.engine.table.TableUpdate; +import io.deephaven.engine.table.impl.InstrumentedTableUpdateListener; +import org.openjdk.jmh.infra.Blackhole; + +class BlackholeListener extends InstrumentedTableUpdateListener { + + private final Blackhole blackhole; + int updates; + Throwable e; + + public BlackholeListener(Blackhole blackhole) { + super("Blackhole Listener"); + this.blackhole = blackhole; + } + + @Override + public void onUpdate(TableUpdate upstream) { + blackhole.consume(upstream); + ++updates; + } + + @Override + protected void onFailureInternal(Throwable originalException, Entry sourceEntry) { + e = originalException; + } +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/Functions.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/Functions.java new file mode 100644 index 00000000000..e7e530391b1 --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/Functions.java @@ -0,0 +1,73 @@ +package io.deephaven.engine.bench; + +public class Functions { + + public static long identity(long ix) { + return ix; + } + + public static long mod_2(long ix) { + return ix % 2; + } + + public static long mod_10(long ix) { + return ix % 10; + } + + public static long mod_100(long ix) { + return ix % 100; + } + + public static long mod_1000(long ix) { + return ix % 1000; + } + + public static long div_2(long ix) { + return ix / 2; + } + + public static long div_10(long ix) { + return ix / 10; + } + + public static long div_100(long ix) { + return ix / 100; + } + + public static long div_1000(long ix) { + return ix / 1000; + } + + public static long prng(long ix) { + // http://mostlymangling.blogspot.com/2019/12/stronger-better-morer-moremur-better.html + ix ^= ix >>> 27; + ix *= 0x3C79AC492BA7B653L; + ix ^= ix >>> 33; + ix *= 0x1C69B3F74AC4AE35L; + ix ^= ix >>> 27; + return ix; + } + + public static long prng_2(long ix) { + return (prng(ix) & 0x7FFFFFFFFFFFFFFFL) % 2; + } + + public static long prng_10(long ix) { + return (prng(ix) & 0x7FFFFFFFFFFFFFFFL) % 10; + } + + public static long prng_100(long ix) { + return (prng(ix) & 0x7FFFFFFFFFFFFFFFL) % 100; + } + + public static long prng_1000(long ix) { + return (prng(ix) & 0x7FFFFFFFFFFFFFFFL) % 1000; + } + + /** + * A binomial distribution with p=0.5, n=64. + */ + public static long prng_binomial_64(long ix) { + return Long.bitCount(prng(ix)); + } +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmark.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmark.java new file mode 100644 index 00000000000..19fc05b1db9 --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmark.java @@ -0,0 +1,135 @@ +package io.deephaven.engine.bench; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.OperationsPerInvocation; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * This benchmark is built around the basic construction: + * + *

    + * emptyTable(N)
    + *         .select("Value=function(ii)")
    + *         .where(incremental_release_filter)
    + *         .sort("Value")
    + * 
    + * + * Users are able to choose the function and control various sizing aspects for the table and + * {@link io.deephaven.engine.table.impl.select.IncrementalReleaseFilter}. + */ +public class IncrementalSortCyclesBenchmark extends IncrementalSortCyclesBenchmarkBase { + private static final int NUM_ROWS = 1000000; + private static final String IDENTITY = "io.deephaven.engine.bench.Functions.identity"; + private static final String PRNG_100 = "io.deephaven.engine.bench.Functions.prng_100"; + private static final String PRNG_BINOMIAL_64 = "io.deephaven.engine.bench.Functions.prng_binomial_64"; + private static final String MOD_10 = "io.deephaven.engine.bench.Functions.mod_10"; + private static final String DIV_10 = "io.deephaven.engine.bench.Functions.div_10"; + + // Note: I'm not sure if there is a better way to parameterize JMH. It could be nice if we could construct POJOs + // instead to handoff to the JMH api; that would allow runtime parameterization for all of these fields. + public enum Params { + // @formatter:off + IDENTITY_START_0_CYCLE_1k(0, 1000, false, IDENTITY), + IDENTITY_START_0_CYCLE_10k(0, 10000, false, IDENTITY), + IDENTITY_START_0_CYCLE_100k(0, 100000, false, IDENTITY), + IDENTITY_START_0_CYCLE_1m(0, 1000000, false, IDENTITY), + + IDENTITY_START_10M_CYCLE_1k(10000000, 1000, false, IDENTITY), + IDENTITY_START_10M_CYCLE_10k(10000000, 10000, false, IDENTITY), + IDENTITY_START_10M_CYCLE_100k(10000000, 100000, false, IDENTITY), + IDENTITY_START_10M_CYCLE_1m(10000000, 1000000, false, IDENTITY), + + REVERSE_START_0_CYCLE_1k(0, 1000, true, IDENTITY), + REVERSE_START_0_CYCLE_10k(0, 10000, true, IDENTITY), + REVERSE_START_0_CYCLE_100k(0, 100000, true, IDENTITY), + REVERSE_START_0_CYCLE_1m(0, 1000000, true, IDENTITY), + + REVERSE_START_10M_CYCLE_1k(10000000, 1000, true, IDENTITY), + REVERSE_START_10M_CYCLE_10k(10000000, 10000, true, IDENTITY), + REVERSE_START_10M_CYCLE_100k(10000000, 100000, true, IDENTITY), + REVERSE_START_10M_CYCLE_1m(10000000, 1000000, true, IDENTITY), + + PRNG_100_START_0_CYCLE_1k(0, 1000, false, PRNG_100), + PRNG_100_START_0_CYCLE_10k(0, 10000, false, PRNG_100), + PRNG_100_START_0_CYCLE_100k(0, 100000, false, PRNG_100), + PRNG_100_START_0_CYCLE_1m(0, 1000000, false, PRNG_100), + + PRNG_100_START_10M_CYCLE_1k(10000000, 1000, false, PRNG_100), + PRNG_100_START_10M_CYCLE_10k(10000000, 10000, false, PRNG_100), + PRNG_100_START_10M_CYCLE_100k(10000000, 100000, false, PRNG_100), + PRNG_100_START_10M_CYCLE_1m(10000000, 1000000, false, PRNG_100), + + PRNG_BINOMIAL_64_START_0_CYCLE_1k(0, 1000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_0_CYCLE_10k(0, 10000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_0_CYCLE_100k(0, 100000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_0_CYCLE_1m(0, 1000000, false, PRNG_BINOMIAL_64), + + PRNG_BINOMIAL_64_START_10M_CYCLE_1k(10000000, 1000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_10M_CYCLE_10k(10000000, 10000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_10M_CYCLE_100k(10000000, 100000, false, PRNG_BINOMIAL_64), + PRNG_BINOMIAL_64_START_10M_CYCLE_1m(10000000, 1000000, false, PRNG_BINOMIAL_64), + + MOD_10_START_0_CYCLE_1k(0, 1000, false, MOD_10), + MOD_10_START_0_CYCLE_10k(0, 10000, false, MOD_10), + MOD_10_START_0_CYCLE_100k(0, 100000, false, MOD_10), + MOD_10_START_0_CYCLE_1m(0, 1000000, false, MOD_10), + + MOD_10_START_10M_CYCLE_1k(10000000, 1000, false, MOD_10), + MOD_10_START_10M_CYCLE_10k(10000000, 10000, false, MOD_10), + MOD_10_START_10M_CYCLE_100k(10000000, 100000, false, MOD_10), + MOD_10_START_10M_CYCLE_1m(10000000, 1000000, false, MOD_10), + + DIV_10_START_0_CYCLE_1k(0, 1000, false, DIV_10), + DIV_10_START_0_CYCLE_10k(0, 10000, false, DIV_10), + DIV_10_START_0_CYCLE_100k(0, 100000, false, DIV_10), + DIV_10_START_0_CYCLE_1m(0, 1000000, false, DIV_10), + + DIV_10_START_10M_CYCLE_1k(10000000, 1000, false, DIV_10), + DIV_10_START_10M_CYCLE_10k(10000000, 10000, false, DIV_10), + DIV_10_START_10M_CYCLE_100k(10000000, 100000, false, DIV_10), + DIV_10_START_10M_CYCLE_1m(10000000, 1000000, false, DIV_10), + ; + // @formatter:on + + + private final long initialSize; + private final long cycleSize; + private final int numCycles; + private final boolean reversed; + private final String indexToValueFunction; + + Params(int initialSize, int cycleSize, boolean reversed, String indexToValueFunction) { + if (NUM_ROWS % cycleSize != 0) { + throw new IllegalArgumentException(String.format("Cycle size must divide evenly into %d", NUM_ROWS)); + } + this.initialSize = initialSize; + this.cycleSize = cycleSize; + this.numCycles = NUM_ROWS / cycleSize; + this.reversed = reversed; + this.indexToValueFunction = indexToValueFunction; + } + } + + @Param + public Params params; + + @Setup(Level.Invocation) + public void setup(Blackhole blackhole) throws Exception { + init( + params.initialSize, + params.cycleSize, + params.numCycles, + params.indexToValueFunction, + params.reversed, + blackhole); + } + + @Benchmark + @OperationsPerInvocation(NUM_ROWS) + public void numRows() throws Throwable { + runCycles(); + } +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmarkBase.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmarkBase.java new file mode 100644 index 00000000000..7ac4f19159b --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortCyclesBenchmarkBase.java @@ -0,0 +1,88 @@ +package io.deephaven.engine.bench; + +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.select.IncrementalReleaseFilter; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.engine.util.TableTools; +import io.deephaven.test.junit4.EngineCleanup; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.util.concurrent.TimeUnit; + +@Fork(value = 2, jvmArgs = {"-Xms16G", "-Xmx16G"}) +@BenchmarkMode(Mode.Throughput) +@Warmup(iterations = 2, time = 2, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) +@State(Scope.Benchmark) +public abstract class IncrementalSortCyclesBenchmarkBase { + static { + System.setProperty("Configuration.rootFile", "dh-tests.prop"); + System.setProperty("workspace", "build/workspace"); + } + + private EngineCleanup engine; + private UpdateGraphProcessor ugp; + private IncrementalReleaseFilter filter; + private Table out; + private BlackholeListener listener; + private int numCycles; + + public void init(long initialSize, long cycleSize, int numCycles, String indexToValueFunction, boolean reverse, + Blackhole blackhole) + throws Exception { + engine = new EngineCleanup(); + engine.setUp(); + ugp = UpdateGraphProcessor.DEFAULT; + ugp.startCycleForUnitTests(); + try { + this.numCycles = numCycles; + filter = new IncrementalReleaseFilter(initialSize, cycleSize); + out = TableTools.emptyTable(initialSize + cycleSize * numCycles) + .select(String.format("Value=%s(ii)", indexToValueFunction)); + if (reverse) { + out = out.reverse(); + } + out = out.where(filter).sort("Value"); + filter.start(); + listener = new BlackholeListener(blackhole); + out.listenForUpdates(listener); + } finally { + ugp.completeCycleForUnitTests(); + } + } + + @TearDown(Level.Invocation) + public void teardown() throws Exception { + filter = null; + out.removeUpdateListener(listener); + listener = null; + out.close(); + out = null; + ugp = null; + engine.tearDown(); + engine = null; + } + + public void runCycles() throws Throwable { + for (int i = 0; i < numCycles; ++i) { + ugp.startCycleForUnitTests(); + try { + filter.run(); + } finally { + ugp.completeCycleForUnitTests(); + } + if (listener.e != null) { + throw listener.e; + } + } + } +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionBase.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionBase.java new file mode 100644 index 00000000000..5ca3470901b --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionBase.java @@ -0,0 +1,122 @@ +package io.deephaven.engine.bench; + +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.select.IncrementalReleaseFilter; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; +import io.deephaven.engine.util.TableTools; +import io.deephaven.test.junit4.EngineCleanup; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OperationsPerInvocation; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * This is a benchmark base that was constructed based on the implementation / interaction details between + * {@link io.deephaven.util.datastructures.hash.HashMapBase}, + * {@link io.deephaven.engine.table.impl.util.RowRedirection}, + * {@link io.deephaven.engine.table.impl.sources.UnionRedirection}, and sort. + * + *

    + * Classes that extend this may want to experiment with the system property "UnionRedirection.allocationUnit" and + * implementation of {@link io.deephaven.util.datastructures.hash.HashMapBase}. + * + *

    + * See #2784 + */ +@Fork(value = 2, jvmArgs = {"-Xms16G", "-Xmx16G"}) +@BenchmarkMode(Mode.Throughput) +@Warmup(iterations = 2, time = 2, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) +@State(Scope.Benchmark) +public abstract class IncrementalSortRedirectionBase { + static { + System.setProperty("Configuration.rootFile", "dh-tests.prop"); + System.setProperty("workspace", "build/workspace"); + } + + private static final int REMAINING_ROWS = 1000000; + + private EngineCleanup engine; + private UpdateGraphProcessor ugp; + private IncrementalReleaseFilter filter; + private Table ms; + private int numCycles; + private BlackholeListener listener; + + @Setup(Level.Invocation) + public void setup(Blackhole blackhole) throws Exception { + engine = new EngineCleanup(); + engine.setUp(); + ugp = UpdateGraphProcessor.DEFAULT; + + final int componentSize = 2000000; + final int numBuckets = 2000; + final int numParts = 10; + final int remainingRows = REMAINING_ROWS; + final int tableSize = numParts * componentSize; + final int initialSize = tableSize - remainingRows; + final int cycleIncrement = 20000; + numCycles = remainingRows / cycleIncrement; + + // create the initial table + ugp.startCycleForUnitTests(); + ms = create(componentSize, numBuckets, numParts, initialSize, cycleIncrement); + listener = new BlackholeListener(blackhole); + ms.listenForUpdates(listener); + ugp.completeCycleForUnitTests(); + + } + + private Table create(int componentSize, int numBuckets, int numParts, int initialSize, int cycleIncrement) { + final Table base = TableTools.emptyTable(componentSize).update("Bucket = ii % " + numBuckets, "Time = ii"); + final List

    parts = new ArrayList<>(); + for (int i = 0; i < numParts; ++i) { + parts.add(base.update("Tab=" + i)); + } + final Table m = TableTools.merge(parts); + filter = new IncrementalReleaseFilter(initialSize, cycleIncrement); + final Table mf = m.where(filter); + filter.start(); + return mf.sort("Tab", "Bucket", "Time"); + } + + @TearDown(Level.Invocation) + public void teardown() throws Exception { + ms.removeUpdateListener(listener); + listener = null; + ms.close(); + ms = null; + ugp = null; + engine.tearDown(); + engine = null; + } + + @Benchmark + @OperationsPerInvocation(REMAINING_ROWS) + public void numRows() throws Throwable { + for (int i = 0; i < numCycles; ++i) { + ugp.startCycleForUnitTests(); + try { + filter.run(); + } finally { + ugp.completeCycleForUnitTests(); + } + if (listener.e != null) { + throw listener.e; + } + } + } +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionDefaultCase.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionDefaultCase.java new file mode 100644 index 00000000000..ff875785ae9 --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionDefaultCase.java @@ -0,0 +1,5 @@ +package io.deephaven.engine.bench; + +public class IncrementalSortRedirectionDefaultCase extends IncrementalSortRedirectionBase { + +} diff --git a/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionEdgeCase.java b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionEdgeCase.java new file mode 100644 index 00000000000..c8431537faf --- /dev/null +++ b/engine/table/src/jmh/java/io/deephaven/engine/bench/IncrementalSortRedirectionEdgeCase.java @@ -0,0 +1,12 @@ +package io.deephaven.engine.bench; + +public class IncrementalSortRedirectionEdgeCase extends IncrementalSortRedirectionBase { + + static { + // A value that exhibits on O(n^2) case with poorly distributed hash functions, ie (int)(value ^ (value >>> 32)) + // from gnu.trove.impl.HashFunctions.hash(long). + // + // When used with a bad hash function, this benchmark will not complete in a reasonable amount of time. + System.setProperty("UnionRedirection.allocationUnit", "2199023255552"); + } +} From a24630d2ad442b890d92320d9015ece4f06c2116 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Fri, 9 Sep 2022 14:04:00 -0600 Subject: [PATCH 121/215] Remove deprecated uses of java.security (#2830) --- .../io/deephaven/base/system/AsyncSystem.java | 9 +- .../deephaven/configuration/PropertyFile.java | 15 +- .../io/deephaven/util/PropertyRetriever.java | 72 +++---- .../util/process/ShutdownManagerImpl.java | 7 +- IO/src/main/java/io/deephaven/io/NioUtil.java | 121 ++++++------ .../main/java/io/deephaven/util/Utils.java | 118 +----------- .../engine/context/QueryCompiler.java | 181 ++++++------------ .../impl/by/typed/TypedHasherFactory.java | 2 - .../local/PrivilegedFileAccessUtil.java | 35 ---- .../impl/select/AbstractFormulaColumn.java | 34 +--- .../table/impl/select/DhFormulaColumn.java | 10 +- .../select/codegen/JavaKernelBuilder.java | 8 +- .../table/impl/sources/ViewColumnSource.java | 36 +--- .../engine/util/GroovyDeephavenSession.java | 27 +-- .../engine/util/file/FileHandleAccessor.java | 22 +-- .../DeephavenNestedPartitionLayout.java | 57 +++--- .../layout/ParquetFlatPartitionedLayout.java | 17 +- .../table/layout/ParquetSingleFileLayout.java | 4 +- .../location/ParquetTableLocationFactory.java | 3 +- 19 files changed, 204 insertions(+), 574 deletions(-) delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/locations/local/PrivilegedFileAccessUtil.java diff --git a/Base/src/main/java/io/deephaven/base/system/AsyncSystem.java b/Base/src/main/java/io/deephaven/base/system/AsyncSystem.java index afe7996d9ff..221f4d9ca2a 100644 --- a/Base/src/main/java/io/deephaven/base/system/AsyncSystem.java +++ b/Base/src/main/java/io/deephaven/base/system/AsyncSystem.java @@ -35,7 +35,7 @@ public void uncaughtException(Thread t, Throwable e) { /** * Creates an {@link UncaughtExceptionHandler} which calls out to * {@link #exitUncaught(Thread, Throwable, int, PrintStream)}. - * + * * @param status the exit status * @return the uncaught exception handler */ @@ -55,15 +55,8 @@ public static UncaughtExceptionHandler uncaughtExceptionHandler(int status, Prin * @param name the name to attach to the thread * @param status exit status * @param out the output print stream (on exception) - * @throws SecurityException if a security manager exists and its {@code checkExit} method doesn't allow exit with - * the specified status. */ public static void exit(String name, int status, PrintStream out) { - // preemptively checks security manager in the same way that System.exit does - final SecurityManager security = System.getSecurityManager(); - if (security != null) { - security.checkExit(status); - } createThread(name, status, out) .start(); } diff --git a/Configuration/src/main/java/io/deephaven/configuration/PropertyFile.java b/Configuration/src/main/java/io/deephaven/configuration/PropertyFile.java index 865e0cbf8d5..7dad8105165 100644 --- a/Configuration/src/main/java/io/deephaven/configuration/PropertyFile.java +++ b/Configuration/src/main/java/io/deephaven/configuration/PropertyFile.java @@ -17,8 +17,6 @@ import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.BitSet; import java.util.*; import java.util.regex.Matcher; @@ -60,7 +58,7 @@ public PropertyFile(String filename, Logger log, boolean fatal) { /** * Return the Properties object loaded by this property file. - * + * * @return the Properties object. */ public Properties getProperties() { @@ -69,7 +67,7 @@ public Properties getProperties() { /** * Collect all of the properties in this property file that begin with a given prefix. - * + * * @return a new Properties object containing the selected properties, with the prefix removed. */ public Properties getProperties(String prefix) { @@ -421,12 +419,7 @@ public void getClassParams(final Logger log, final Class c, final String instanc throw new PropertyException("null value for property " + propName); } else { source = "file"; - // Setting field accessibility should be allowed by our code, but not from outside classes, so - // this should be privileged. - AccessController.doPrivileged((PrivilegedAction) () -> { - f.setAccessible(true); - return null; - }); + f.setAccessible(true); final String fieldTypeName = f.getType().getName(); if (fieldTypeName.equals("java.lang.String")) { f.set(obj, value.trim()); @@ -554,7 +547,7 @@ public int[] getIntegerArray(final String propertyName) { /** * Parse a set of non-negative ints from a property. Format is comma-separated individual values and ranges of the * form start-end. - * + * * @example 0,22,100-200,99,1000-2000 * @param propertyName * @return A set of ints derived from the specified property. diff --git a/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java b/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java index d77fdf8fc32..2f1e360cd7e 100644 --- a/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java +++ b/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java @@ -9,11 +9,7 @@ import org.jetbrains.annotations.Nullable; import java.io.*; -import java.nio.charset.Charset; import java.nio.file.Files; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; /** * Class to assist with retrieving properties such as passwords from environment variables, files, and properties. @@ -34,7 +30,7 @@ public class PropertyRetriever { *
  • If both a property file and property name are provided and exist in the Configuration instance, an exception * will be thrown.
  • * - * + * * @param configuration the Configuration instance to check * @param propertyMeaning a user-friendly property meaning, included in thrown exceptions * @param environmentVariable an optional environment variable to check for the value @@ -94,48 +90,36 @@ private static String getPropertyFromEnvironmentVariable(final String environmen return environmentVariable != null ? System.getenv(environmentVariable) : null; } - private static String getPropertyFromFileOrProperty(final Configuration configuration, - final String propertyMeaning, - final String fileProperty, - final String propertyName) { - try { - // We need permission to read the property and access the file, so this needs to be privileged. - return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - if (fileProperty != null && configuration.hasProperty(fileProperty)) { - if (propertyName != null && configuration.hasProperty(propertyName)) { - throw new IllegalArgumentException("Conflicting properties for " + propertyMeaning + " - both " - + fileProperty + " and " + propertyName + " are set."); - } - final String propertyFilename = configuration.getProperty(fileProperty); - final File propertyFile = new File(propertyFilename); - try { - return new String(Files.readAllBytes(propertyFile.toPath()), Charset.forName("UTF-8")).trim(); - } catch (IOException e) { - try (InputStream resourceAsStream = - PropertyRetriever.class.getResourceAsStream("/" + propertyFilename)) { - if (resourceAsStream == null) { - throw new ConfigurationException("Unable to open file " + propertyFilename - + " specified by " + fileProperty + " for " + propertyMeaning); - } - final BufferedReader bufferedReader = - new BufferedReader(new InputStreamReader(resourceAsStream)); - return bufferedReader.readLine(); - } catch (IOException e2) { - throw new UncheckedIOException( - "Can not read property file " + propertyFilename + " for " + propertyMeaning, e2); - } + private static String getPropertyFromFileOrProperty( + final Configuration configuration, final String propertyMeaning, + final String fileProperty, final String propertyName) { + if (fileProperty != null && configuration.hasProperty(fileProperty)) { + if (propertyName != null && configuration.hasProperty(propertyName)) { + throw new IllegalArgumentException("Conflicting properties for " + propertyMeaning + " - both " + + fileProperty + " and " + propertyName + " are set."); + } + final String propertyFilename = configuration.getProperty(fileProperty); + final File propertyFile = new File(propertyFilename); + try { + return Files.readString(propertyFile.toPath()).trim(); + } catch (IOException e) { + try (InputStream resourceAsStream = + PropertyRetriever.class.getResourceAsStream("/" + propertyFilename)) { + if (resourceAsStream == null) { + throw new ConfigurationException("Unable to open file " + propertyFilename + + " specified by " + fileProperty + " for " + propertyMeaning); } - } else if (propertyName != null && configuration.hasProperty(propertyName)) { - return configuration.getProperty(propertyName); + final BufferedReader bufferedReader = + new BufferedReader(new InputStreamReader(resourceAsStream)); + return bufferedReader.readLine(); + } catch (IOException e2) { + throw new UncheckedIOException( + "Can not read property file " + propertyFilename + " for " + propertyMeaning, e2); } - return null; - }); - } catch (final PrivilegedActionException pae) { - if (pae.getException() instanceof UncheckedIOException) { - throw (UncheckedIOException) pae.getException(); - } else { - throw new RuntimeException(pae.getException()); } + } else if (propertyName != null && configuration.hasProperty(propertyName)) { + return configuration.getProperty(propertyName); } + return null; } } diff --git a/FishUtil/src/main/java/io/deephaven/util/process/ShutdownManagerImpl.java b/FishUtil/src/main/java/io/deephaven/util/process/ShutdownManagerImpl.java index 8a19a2a1de4..520b86a96bf 100644 --- a/FishUtil/src/main/java/io/deephaven/util/process/ShutdownManagerImpl.java +++ b/FishUtil/src/main/java/io/deephaven/util/process/ShutdownManagerImpl.java @@ -15,8 +15,6 @@ import org.jetbrains.annotations.Nullable; import java.io.PrintStream; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -65,10 +63,7 @@ public ShutdownManagerImpl() {} @Override public void addShutdownHookToRuntime() { - AccessController.doPrivileged((PrivilegedAction) () -> { - Runtime.getRuntime().addShutdownHook(new Thread(this::maybeInvokeTasks)); - return null; - }); + Runtime.getRuntime().addShutdownHook(new Thread(this::maybeInvokeTasks)); } @Override diff --git a/IO/src/main/java/io/deephaven/io/NioUtil.java b/IO/src/main/java/io/deephaven/io/NioUtil.java index cb669258312..4e24b19ac38 100644 --- a/IO/src/main/java/io/deephaven/io/NioUtil.java +++ b/IO/src/main/java/io/deephaven/io/NioUtil.java @@ -12,8 +12,6 @@ import java.lang.reflect.Field; import java.nio.channels.Selector; import java.nio.channels.spi.AbstractSelector; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.List; import java.util.Set; @@ -49,68 +47,63 @@ public static Selector reduceSelectorGarbage(Selector selector) { } private static Selector reduceSelectorGarbageImpl(Selector selector) { - // This code does several things that normally would be restricted, like accessing the Sun classes - // and changing the accessibility of fields via reflection. We need to make sure that we can do this, - // but client code cannot, so we need to do all of this within a 'privileged' block. - return AccessController.doPrivileged((PrivilegedAction) () -> { - try { - Class selectorImplClass = Class.forName("sun.nio.ch.SelectorImpl"); - Require.instanceOf(selector, "selector", selectorImplClass); - - Field cancelledKeysField = AbstractSelector.class.getDeclaredField("cancelledKeys"); - cancelledKeysField.setAccessible(true); - Set newCancelledKeys = new LowGarbageArraySet(); - cancelledKeysField.set(selector, newCancelledKeys); - - Field keysField = selectorImplClass.getDeclaredField("keys"); - keysField.setAccessible(true); - Field publicKeysField = selectorImplClass.getDeclaredField("publicKeys"); - publicKeysField.setAccessible(true); - Set newKeys = new LowGarbageArraySet(); - keysField.set(selector, newKeys); - publicKeysField.set(selector, newKeys); - - Field selectedKeysField = selectorImplClass.getDeclaredField("selectedKeys"); - selectedKeysField.setAccessible(true); - Field publicSelectedKeysField = selectorImplClass.getDeclaredField("publicSelectedKeys"); - publicSelectedKeysField.setAccessible(true); - Set newSelectedKeys = new LowGarbageArraySet(); - selectedKeysField.set(selector, newSelectedKeys); - publicSelectedKeysField.set(selector, newSelectedKeys); - - if (System.getProperty("os.name").startsWith("Windows") - && System.getProperty("java.vendor").startsWith("Oracle")) { - Class windowsSelectorImplClass = Class.forName("sun.nio.ch.WindowsSelectorImpl"); - Require.instanceOf(selector, "selector", windowsSelectorImplClass); - - Field threadsField = windowsSelectorImplClass.getDeclaredField("threads"); - threadsField.setAccessible(true); - List newThreads = new LowGarbageArrayList(); - threadsField.set(selector, newThreads); - - } else if (System.getProperty("os.name").startsWith("Linux")) { - Class ePollSelectorImplClass = Class.forName("sun.nio.ch.EPollSelectorImpl"); - Require.instanceOf(selector, "selector", ePollSelectorImplClass); - - Field fdToKeyField = ePollSelectorImplClass.getDeclaredField("fdToKey"); - fdToKeyField.setAccessible(true); - LowGarbageArrayIntegerMap newFdToKey = new LowGarbageArrayIntegerMap(); - fdToKeyField.set(selector, newFdToKey); - - } else if (System.getProperty("os.name").startsWith("SunOS")) { - Class devPollSelectorImplClass = Class.forName("sun.nio.ch.DevPollSelectorImpl"); - Require.instanceOf(selector, "selector", devPollSelectorImplClass); - - Field fdToKeyField = devPollSelectorImplClass.getDeclaredField("fdToKey"); - fdToKeyField.setAccessible(true); - LowGarbageArrayIntegerMap newFdToKey = new LowGarbageArrayIntegerMap(); - fdToKeyField.set(selector, newFdToKey); - } - - return selector; - } catch (final NoSuchFieldException | IllegalAccessException | ClassNotFoundException e) { - throw Assert.exceptionNeverCaught(e); + try { + Class selectorImplClass = Class.forName("sun.nio.ch.SelectorImpl"); + Require.instanceOf(selector, "selector", selectorImplClass); + + Field cancelledKeysField = AbstractSelector.class.getDeclaredField("cancelledKeys"); + cancelledKeysField.setAccessible(true); + Set newCancelledKeys = new LowGarbageArraySet(); + cancelledKeysField.set(selector, newCancelledKeys); + + Field keysField = selectorImplClass.getDeclaredField("keys"); + keysField.setAccessible(true); + Field publicKeysField = selectorImplClass.getDeclaredField("publicKeys"); + publicKeysField.setAccessible(true); + Set newKeys = new LowGarbageArraySet(); + keysField.set(selector, newKeys); + publicKeysField.set(selector, newKeys); + + Field selectedKeysField = selectorImplClass.getDeclaredField("selectedKeys"); + selectedKeysField.setAccessible(true); + Field publicSelectedKeysField = selectorImplClass.getDeclaredField("publicSelectedKeys"); + publicSelectedKeysField.setAccessible(true); + Set newSelectedKeys = new LowGarbageArraySet(); + selectedKeysField.set(selector, newSelectedKeys); + publicSelectedKeysField.set(selector, newSelectedKeys); + + if (System.getProperty("os.name").startsWith("Windows") + && System.getProperty("java.vendor").startsWith("Oracle")) { + Class windowsSelectorImplClass = Class.forName("sun.nio.ch.WindowsSelectorImpl"); + Require.instanceOf(selector, "selector", windowsSelectorImplClass); + + Field threadsField = windowsSelectorImplClass.getDeclaredField("threads"); + threadsField.setAccessible(true); + List newThreads = new LowGarbageArrayList(); + threadsField.set(selector, newThreads); + + } else if (System.getProperty("os.name").startsWith("Linux")) { + Class ePollSelectorImplClass = Class.forName("sun.nio.ch.EPollSelectorImpl"); + Require.instanceOf(selector, "selector", ePollSelectorImplClass); + + Field fdToKeyField = ePollSelectorImplClass.getDeclaredField("fdToKey"); + fdToKeyField.setAccessible(true); + LowGarbageArrayIntegerMap newFdToKey = new LowGarbageArrayIntegerMap(); + fdToKeyField.set(selector, newFdToKey); + + } else if (System.getProperty("os.name").startsWith("SunOS")) { + Class devPollSelectorImplClass = Class.forName("sun.nio.ch.DevPollSelectorImpl"); + Require.instanceOf(selector, "selector", devPollSelectorImplClass); + + Field fdToKeyField = devPollSelectorImplClass.getDeclaredField("fdToKey"); + fdToKeyField.setAccessible(true); + LowGarbageArrayIntegerMap newFdToKey = new LowGarbageArrayIntegerMap(); + fdToKeyField.set(selector, newFdToKey); } - }); + + return selector; + } catch (final NoSuchFieldException | IllegalAccessException | ClassNotFoundException e) { + throw Assert.exceptionNeverCaught(e); + } } } diff --git a/Util/src/main/java/io/deephaven/util/Utils.java b/Util/src/main/java/io/deephaven/util/Utils.java index b531bd99975..2a5263366f5 100644 --- a/Util/src/main/java/io/deephaven/util/Utils.java +++ b/Util/src/main/java/io/deephaven/util/Utils.java @@ -17,14 +17,8 @@ import java.io.UncheckedIOException; import java.net.URL; import java.net.URLClassLoader; -import java.nio.file.DirectoryStream; import java.nio.file.Files; -import java.nio.file.LinkOption; import java.nio.file.Path; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -135,7 +129,7 @@ public static boolean isEmptyElement(Element elem, String... ignoredAttrs) { /** * Wrap the specified element in a new one with the specified name - * + * * @param wrapperName The name of the wrapper element to create * @param wrapee The element being wrapped. * @@ -235,10 +229,7 @@ public static URLClassLoader cleanRoom() { } cl = cl.getParent(); } - // We should be able to create this class loader even if this is invoked from external code that lacks that - // permission. - return AccessController.doPrivileged( - (PrivilegedAction) () -> new URLClassLoader(all.toArray(new URL[0]), null)); + return new URLClassLoader(all.toArray(new URL[0]), null); } /** @@ -247,7 +238,7 @@ public static URLClassLoader cleanRoom() { * method is not required to be idempotent. In other words, calling this close method more than once may have * some visible side effect, unlike Closeable.close which is required to have no effect if called more than * once. However, implementers of this interface are strongly encouraged to make their close methods idempotent. - * + * * @param autoCloseable The resource to close. */ public static void ensureClosed(@NotNull final AutoCloseable autoCloseable) { @@ -442,107 +433,4 @@ public static int getMajorJavaVersion() { throw new RuntimeException("Unsupported Java version: " + versionString); } - - - // region privileged actions - - /** - * Perform a file existence check in a privileged context. - * - * @param file The File to check - * @return same as File.exists - */ - public static boolean fileExistsPrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::exists); - } - - /** - * Perform an IsDirectory check in a privileged context. - * - * @param file the File to check - * @return same as File.isDirectory - */ - public static boolean fileIsDirectoryPrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::isDirectory); - } - - /** - * Perform an IsDirectory check in a privileged context. - * - * @param path the File to check - * @return same as File.isDirectory - */ - public static boolean fileIsDirectoryPrivileged(final Path path, final LinkOption... options) { - return AccessController.doPrivileged((PrivilegedAction) () -> Files.isDirectory(path, options)); - } - - public static DirectoryStream fileGetDirectoryStream(Path dir, - DirectoryStream.Filter filter) throws IOException { - try { - return AccessController.doPrivileged( - (PrivilegedExceptionAction>) () -> Files.newDirectoryStream(dir, filter)); - } catch (final PrivilegedActionException pae) { - if (pae.getException() instanceof IOException) { - throw (IOException) pae.getException(); - } else { - throw new RuntimeException(pae.getException()); - } - } - } - - - /** - * Get an absolute File in a privileged context. - * - * @param file the File to check - * @return same as File.getAbsoluteFile - */ - public static File fileGetAbsoluteFilePrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::getAbsoluteFile); - } - - /** - * Get an absolute path in a privileged context. - * - * @param file the File to check - * @return same as File.getAbsolutePath - */ - public static String fileGetAbsolutePathPrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::getAbsolutePath); - } - - /** - * Create the directory specified by this File, excluding parent directories, in a privileged context. - * - * @param file The directory to create - * @return same as File.mkdir - */ - @SuppressWarnings("UnusedReturnValue") - public static boolean fileMkdirPrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::mkdir); - } - - /** - * Rename a file in a privileged context. - * - * @param file the File to rename - * @param dest the new name - * @return same as File.renameTo - */ - public static boolean fileRenameToPrivileged(final File file, final File dest) { - return AccessController.doPrivileged((PrivilegedAction) () -> file.renameTo(dest)); - } - - /** - * Delete a file in a privileged context - * - * @param file The File to delete - * @return same as File.delete - */ - @SuppressWarnings("BooleanMethodIsAlwaysInverted") - public static boolean fileDeletePrivileged(final File file) { - return AccessController.doPrivileged((PrivilegedAction) file::delete); - } - - // endregion privileged actions } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java index afd8375dca1..2e522750d84 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java @@ -25,10 +25,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -39,8 +35,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.security.AccessController.doPrivileged; - public class QueryCompiler { private static final Logger log = LoggerFactory.getLogger(QueryCompiler.class); /** @@ -115,10 +109,7 @@ private QueryCompiler( } catch (MalformedURLException e) { throw new RuntimeException("", e); } - // We should be able to create this class loader, even if this is invoked from external code - // that does not have sufficient security permissions. - this.ucl = doPrivileged((PrivilegedAction) () -> new WritableURLClassLoader(urls, - parentClassLoaderToUse)); + this.ucl = new WritableURLClassLoader(urls, parentClassLoaderToUse); if (isCacheDirectory) { addClassSource(classDestination); @@ -206,11 +197,7 @@ public File getFakeClassDestination() { } public void setParentClassLoader(final ClassLoader parentClassLoader) { - // The system should always be able to create this class loader, even if invoked from something that - // doesn't have the right security permissions for it. - ucl = doPrivileged( - (PrivilegedAction) () -> new WritableURLClassLoader(ucl.getURLs(), - parentClassLoader)); + ucl = new WritableURLClassLoader(ucl.getURLs(), parentClassLoader); } public final Class compile(String className, String classBody, String packageNameRoot) { @@ -286,9 +273,7 @@ private static void ensureDirectories(final File file, final Supplier ru } private ClassLoader getClassLoaderForFormula(final Map> parameterClasses) { - // We should always be able to get our own class loader, even if this is invoked from external code - // that doesn't have security permissions to make ITS own class loader. - return doPrivileged((PrivilegedAction) () -> new URLClassLoader(ucl.getURLs(), ucl) { + return new URLClassLoader(ucl.getURLs(), ucl) { // Once we find a class that is missing, we should not attempt to load it again, // otherwise we can end up with a StackOverflow Exception final HashSet missingClasses = new HashSet<>(); @@ -344,36 +329,23 @@ public Class loadClass(String name) throws ClassNotFoundException { } private byte[] loadClassData(String name) throws IOException { - try { - // The compiler should always have access to the class-loader directories, - // even if code that invokes this does not. - return doPrivileged((PrivilegedExceptionAction) () -> { - final File destFile = new File(classDestination, - name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); - if (destFile.exists()) { - return Files.readAllBytes(destFile.toPath()); - } - - for (File location : additionalClassLocations) { - final File checkFile = new File(location, - name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); - if (checkFile.exists()) { - return Files.readAllBytes(checkFile.toPath()); - } - } + final File destFile = new File(classDestination, + name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); + if (destFile.exists()) { + return Files.readAllBytes(destFile.toPath()); + } - throw new FileNotFoundException(name); - }); - } catch (final PrivilegedActionException pae) { - final Exception inner = pae.getException(); - if (inner instanceof IOException) { - throw (IOException) inner; - } else { - throw new RuntimeException(inner); + for (File location : additionalClassLocations) { + final File checkFile = new File(location, + name.replace('.', File.separatorChar) + JavaFileObject.Kind.CLASS.extension); + if (checkFile.exists()) { + return Files.readAllBytes(checkFile.toPath()); } } + + throw new FileNotFoundException(name); } - }); + }; } private static class WritableURLClassLoader extends URLClassLoader { @@ -672,8 +644,6 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) { private void maybeCreateClass(String className, String code, String packageName, String fqClassName) { final String finalCode = makeFinalCode(className, code, packageName); - // The 'compile' action does a bunch of things that need security permissions; this always needs to run - // with elevated permissions. if (logEnabled) { log.info().append("Generating code ").append(finalCode).endl(); } @@ -698,34 +668,25 @@ private void maybeCreateClass(String className, String code, String packageName, final String rootPathAsString; final String tempDirAsString; try { - final Pair resultPair = - AccessController.doPrivileged((PrivilegedExceptionAction>) () -> { - final String rootPathString = ctxClassDestination.getAbsolutePath(); - final Path rootPathWithPackage = Paths.get(rootPathString, truncatedSplitPackageName); - final File rpf = rootPathWithPackage.toFile(); - ensureDirectories(rpf, () -> "Couldn't create package directories: " + rootPathWithPackage); - final Path tempPath = - Files.createTempDirectory(Paths.get(rootPathString), "temporaryCompilationDirectory"); - final String tempPathString = tempPath.toFile().getAbsolutePath(); - return new Pair<>(rootPathString, tempPathString); - }); - rootPathAsString = resultPair.first; - tempDirAsString = resultPair.second; - } catch (PrivilegedActionException pae) { - throw new RuntimeException(pae.getException()); + rootPathAsString = ctxClassDestination.getAbsolutePath(); + final Path rootPathWithPackage = Paths.get(rootPathAsString, truncatedSplitPackageName); + final File rpf = rootPathWithPackage.toFile(); + ensureDirectories(rpf, () -> "Couldn't create package directories: " + rootPathWithPackage); + final Path tempPath = + Files.createTempDirectory(Paths.get(rootPathAsString), "temporaryCompilationDirectory"); + tempDirAsString = tempPath.toFile().getAbsolutePath(); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); } try { maybeCreateClassHelper(fqClassName, finalCode, splitPackageName, rootPathAsString, tempDirAsString); } finally { - AccessController.doPrivileged((PrivilegedAction) () -> { - try { - FileUtils.deleteRecursively(new File(tempDirAsString)); - } catch (Exception e) { - // ignore errors here - } - return null; - }); + try { + FileUtils.deleteRecursively(new File(tempDirAsString)); + } catch (Exception e) { + // ignore errors here + } } } @@ -733,15 +694,13 @@ private void maybeCreateClassHelper(String fqClassName, String finalCode, String String rootPathAsString, String tempDirAsString) { final StringWriter compilerOutput = new StringWriter(); - final JavaCompiler compiler = - AccessController.doPrivileged((PrivilegedAction) ToolProvider::getSystemJavaCompiler); + final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if (compiler == null) { throw new RuntimeException("No Java compiler provided - are you using a JRE instead of a JDK?"); } final String classPathAsString = getClassPath() + File.pathSeparator + getJavaClassPath(); - final List compilerOptions = AccessController.doPrivileged( - (PrivilegedAction>) () -> Arrays.asList("-d", tempDirAsString, "-cp", classPathAsString)); + final List compilerOptions = Arrays.asList("-d", tempDirAsString, "-cp", classPathAsString); final StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); @@ -760,25 +719,18 @@ private void maybeCreateClassHelper(String fqClassName, String finalCode, String // class files} // We want to atomically move it to e.g. // /tmp/workspace/cache/classes/io/deephaven/test/cm12862183232603186v52_0/{various class files} + Path srcDir = Paths.get(tempDirAsString, splitPackageName); + Path destDir = Paths.get(rootPathAsString, splitPackageName); try { - AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - Path srcDir = Paths.get(tempDirAsString, splitPackageName); - Path destDir = Paths.get(rootPathAsString, splitPackageName); - try { - Files.move(srcDir, destDir, StandardCopyOption.ATOMIC_MOVE); - } catch (IOException ioe) { - // The move might have failed for a variety of bad reasons. However, if the reason was because - // we lost the race to some other process, that's a harmless/desirable outcome, and we can ignore - // it. - if (!Files.exists(destDir)) { - throw new IOException("Move failed for some reason other than destination already existing", - ioe); - } - } - return null; - }); - } catch (PrivilegedActionException pae) { - throw new RuntimeException(pae.getException()); + Files.move(srcDir, destDir, StandardCopyOption.ATOMIC_MOVE); + } catch (IOException ioe) { + // The move might have failed for a variety of bad reasons. However, if the reason was because + // we lost the race to some other process, that's a harmless/desirable outcome, and we can ignore + // it. + if (!Files.exists(destDir)) { + throw new UncheckedIOException("Move failed for some reason other than destination already existing", + ioe); + } } } @@ -790,41 +742,28 @@ private void maybeCreateClassHelper(String fqClassName, String finalCode, String * @return a Pair of success, and the compiler output */ private Pair tryCompile(File basePath, Collection javaFiles) throws IOException { - try { - // We need multiple filesystem accesses et al, so make this whole section privileged. - return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> { - - final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); - if (compiler == null) { - throw new RuntimeException("No Java compiler provided - are you using a JRE instead of a JDK?"); - } - - final File outputDirectory = Files.createTempDirectory("temporaryCompilationDirectory").toFile(); + final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + if (compiler == null) { + throw new RuntimeException("No Java compiler provided - are you using a JRE instead of a JDK?"); + } - try { - final StringWriter compilerOutput = new StringWriter(); - final String javaClasspath = getJavaClassPath(); + final File outputDirectory = Files.createTempDirectory("temporaryCompilationDirectory").toFile(); - final Collection javaFileObjects = javaFiles.stream() - .map(f -> new JavaSourceFromFile(basePath, f)).collect(Collectors.toList()); + try { + final StringWriter compilerOutput = new StringWriter(); + final String javaClasspath = getJavaClassPath(); - final boolean result = compiler.getTask(compilerOutput, null, null, - Arrays.asList("-d", outputDirectory.getAbsolutePath(), "-cp", - getClassPath() + File.pathSeparator + javaClasspath), - null, javaFileObjects).call(); + final Collection javaFileObjects = javaFiles.stream() + .map(f -> new JavaSourceFromFile(basePath, f)).collect(Collectors.toList()); - return new Pair<>(result, compilerOutput.toString()); + final boolean result = compiler.getTask(compilerOutput, null, null, + Arrays.asList("-d", outputDirectory.getAbsolutePath(), "-cp", + getClassPath() + File.pathSeparator + javaClasspath), + null, javaFileObjects).call(); - } finally { - FileUtils.deleteRecursively(outputDirectory); - } - }); - } catch (final PrivilegedActionException pae) { - if (pae.getException() instanceof IOException) { - throw (IOException) pae.getException(); - } else { - throw new RuntimeException(pae.getException()); - } + return new Pair<>(result, compilerOutput.toString()); + } finally { + FileUtils.deleteRecursively(outputDirectory); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index ecc83cc6a16..88931d732da 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -11,7 +11,6 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.chunk.util.hashing.CharChunkHasher; import io.deephaven.engine.context.ExecutionContext; -import io.deephaven.engine.context.QueryCompiler; import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; @@ -38,7 +37,6 @@ import javax.lang.model.element.Modifier; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.security.spec.ECField; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/locations/local/PrivilegedFileAccessUtil.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/locations/local/PrivilegedFileAccessUtil.java deleted file mode 100644 index 69eea4d3080..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/locations/local/PrivilegedFileAccessUtil.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl.locations.local; - -import io.deephaven.UncheckedDeephavenException; -import io.deephaven.engine.table.impl.locations.TableDataException; -import org.jetbrains.annotations.NotNull; - -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -public class PrivilegedFileAccessUtil { - - /** - * Wrap a filesystem operation (or series of them) as a privileged action. - * - * @param operation The operation to wrap - */ - public static void doFilesystemAction(@NotNull final Runnable operation) { - try { - AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - operation.run(); - return null; - }); - } catch (final PrivilegedActionException pae) { - if (pae.getException() instanceof TableDataException) { - throw (TableDataException) pae.getException(); - } else { - throw new UncheckedDeephavenException(pae.getException()); - } - } - } -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java index 66459d1d3df..58b529c8191 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/AbstractFormulaColumn.java @@ -20,9 +20,6 @@ import io.deephaven.api.util.NameValidator; import org.jetbrains.annotations.NotNull; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.*; import java.util.*; import java.util.function.Consumer; @@ -199,33 +196,10 @@ public ColumnSource getLazyView() { @NotNull private ColumnSource getViewColumnSource(boolean lazy) { final boolean isStateless = isStateless(); - - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - // We explicitly want all Groovy commands to run under the 'file:/groovy/shell' source, so explicitly create - // that. - AccessControlContext context; - try { - final URL urlSource = new URL("file:/groovy/shell"); - final CodeSource codeSource = new CodeSource(urlSource, (java.security.cert.Certificate[]) null); - final PermissionCollection perms = Policy.getPolicy().getPermissions(codeSource); - context = new AccessControlContext(new ProtectionDomain[] {new ProtectionDomain(codeSource, perms)}); - } catch (MalformedURLException e) { - throw new RuntimeException("Invalid file path in groovy url source", e); - } - - return AccessController.doPrivileged((PrivilegedAction>) () -> { - final Formula formula = getFormula(lazy, columnSources, params); - // noinspection unchecked,rawtypes - return new ViewColumnSource((returnedType == boolean.class ? Boolean.class : returnedType), formula, - isStateless); - }, context); - } else { - final Formula formula = getFormula(lazy, columnSources, params); - // noinspection unchecked,rawtypes - return new ViewColumnSource((returnedType == boolean.class ? Boolean.class : returnedType), formula, - isStateless); - } + final Formula formula = getFormula(lazy, columnSources, params); + // noinspection unchecked,rawtypes + return new ViewColumnSource((returnedType == boolean.class ? Boolean.class : returnedType), formula, + isStateless); } private Formula getFormula(boolean initLazyMap, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java index 4359c8d08ac..ec5da82e493 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DhFormulaColumn.java @@ -43,7 +43,6 @@ import java.math.BigDecimal; import java.math.BigInteger; -import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.*; @@ -766,13 +765,8 @@ private Class compileFormula(final String what, final String classBody, final return null; }); final QueryCompiler compiler = ExecutionContext.getContext().getQueryCompiler(); - return AccessController - .doPrivileged( - (PrivilegedExceptionAction>) () -> compiler.compile(className, classBody, - QueryCompiler.FORMULA_PREFIX, - QueryScopeParamTypeUtil.expandParameterClasses(paramClasses))); - } catch (PrivilegedActionException pae) { - throw new FormulaCompilationException("Formula compilation error for: " + what, pae.getException()); + return compiler.compile(className, classBody, QueryCompiler.FORMULA_PREFIX, + QueryScopeParamTypeUtil.expandParameterClasses(paramClasses)); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java index 3cd97dbe1d7..e34be36fc18 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/codegen/JavaKernelBuilder.java @@ -20,9 +20,6 @@ import io.deephaven.util.type.TypeUtils; import org.jetbrains.annotations.NotNull; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -267,10 +264,7 @@ private static Class compileFormula(final String what, final String classBody QueryPerformanceRecorder.getInstance().getNugget("Compile:" + what)) { // Compilation needs to take place with elevated privileges, but the created object should not have them. final QueryCompiler compiler = ExecutionContext.getContext().getQueryCompiler(); - return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> compiler.compile(className, - classBody, QueryCompiler.FORMULA_PREFIX)); - } catch (PrivilegedActionException pae) { - throw new FormulaCompilationException("Formula compilation error for: " + what, pae.getException()); + return compiler.compile(className, classBody, QueryCompiler.FORMULA_PREFIX); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java index 0dff1ce0147..cb55ba3a6d5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ViewColumnSource.java @@ -12,34 +12,10 @@ import io.deephaven.engine.rowset.RowSequence; import org.jetbrains.annotations.NotNull; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.*; - import static io.deephaven.util.QueryConstants.*; public class ViewColumnSource extends AbstractColumnSource { private final Formula formula; - // We explicitly want all Groovy commands to run under the 'file:/groovy/shell' source, so explicitly create that. - private static URL groovyShellUrl; - static { - try { - groovyShellUrl = new URL("file:/groovy/shell"); - } catch (MalformedURLException ignored) { - groovyShellUrl = null; - // It should not be possible for this to get malformed. - } - } - - private static final CodeSource codeSource = - new CodeSource(groovyShellUrl, (java.security.cert.Certificate[]) null); - // The permission collection should not be static, because the class loader might take place before the - // custom policy object is assigned. - private final PermissionCollection perms = Policy.getPolicy().getPermissions(codeSource); - private final AccessControlContext context = - AccessController.doPrivileged((PrivilegedAction) () -> new AccessControlContext( - new ProtectionDomain[] {new ProtectionDomain( - new CodeSource(groovyShellUrl, (java.security.cert.Certificate[]) null), perms)})); private final boolean isStateless; @@ -66,16 +42,8 @@ public T get(long rowKey) { if (rowKey < 0) { return null; } - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - return AccessController.doPrivileged((PrivilegedAction) () -> { - // noinspection unchecked - return (T) formula.get(rowKey); - }, context); - } else { - // noinspection unchecked - return (T) formula.get(rowKey); - } + // noinspection unchecked + return (T) formula.get(rowKey); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java index bac9aa5c942..fbee4a166d7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java @@ -38,12 +38,10 @@ import java.io.InputStream; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; -import java.security.*; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; @@ -205,30 +203,7 @@ public T getVariable(String name, T defaultValue) { } private void evaluateCommand(String command) { - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - // We explicitly want all Groovy commands to run under the 'file:/groovy/shell' source, so explicitly create - // that. - AccessControlContext context; - try { - final URL urlSource = new URL("file:/groovy/shell"); - final CodeSource codeSource = new CodeSource(urlSource, (java.security.cert.Certificate[]) null); - final PermissionCollection perms = Policy.getPolicy().getPermissions(codeSource); - context = AccessController - .doPrivileged((PrivilegedAction) () -> new AccessControlContext( - new ProtectionDomain[] {new ProtectionDomain( - new CodeSource(urlSource, (java.security.cert.Certificate[]) null), perms)})); - } catch (MalformedURLException e) { - throw new RuntimeException("Groovy shell URL somehow invalid.", e); - } - - AccessController.doPrivileged((PrivilegedAction) () -> { - groovyShell.evaluate(command); - return null; - }, context); - } else { - groovyShell.evaluate(command); - } + groovyShell.evaluate(command); } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/util/file/FileHandleAccessor.java b/engine/table/src/main/java/io/deephaven/engine/util/file/FileHandleAccessor.java index b87583ab66d..dcd86503740 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/file/FileHandleAccessor.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/file/FileHandleAccessor.java @@ -3,15 +3,11 @@ */ package io.deephaven.engine.util.file; -import io.deephaven.util.Utils; import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; /** * Base class for accessors that wrap a {@link FileHandle} with support for interruption and asynchronous close. @@ -32,25 +28,15 @@ public abstract class FileHandleAccessor { protected FileHandleAccessor(@NotNull final FileHandleFactory.FileToHandleFunction fileHandleCreator, @NotNull final File file) { this.fileHandleCreator = fileHandleCreator; - this.file = Utils.fileGetAbsoluteFilePrivileged(file); + this.file = file.getAbsoluteFile(); fileHandle = makeHandle(); } private FileHandle makeHandle() { try { - return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - try { - return fileHandleCreator.invoke(file); - } catch (IOException e) { - throw new UncheckedIOException(this + ": makeHandle encountered exception", e); - } - }); - } catch (final PrivilegedActionException pae) { - if (pae.getException() instanceof UncheckedIOException) { - throw (UncheckedIOException) pae.getException(); - } else { - throw new RuntimeException(pae.getException()); - } + return fileHandleCreator.invoke(file); + } catch (IOException e) { + throw new UncheckedIOException(this + ": makeHandle encountered exception", e); } } diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/DeephavenNestedPartitionLayout.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/DeephavenNestedPartitionLayout.java index a0af63f8bc1..ad09a8425ea 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/DeephavenNestedPartitionLayout.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/DeephavenNestedPartitionLayout.java @@ -6,7 +6,6 @@ import io.deephaven.engine.table.impl.locations.TableDataException; import io.deephaven.engine.table.impl.locations.impl.TableLocationKeyFinder; import io.deephaven.engine.table.impl.locations.local.FileTableLocationKey; -import io.deephaven.engine.table.impl.locations.local.PrivilegedFileAccessUtil; import io.deephaven.parquet.table.location.ParquetTableLocationKey; import io.deephaven.util.annotations.VisibleForTesting; import org.jetbrains.annotations.NotNull; @@ -27,11 +26,11 @@ /** * {@link TableLocationKeyFinder} that will traverse a directory hierarchy laid out in Deephaven's "nested-partitioned" * format, e.g. - * + * *
      * tableRootDirectory/internalPartitionValue/columnPartitionValue/tableName/...
      * 
    - * + * * , producing {@link FileTableLocationKey}'s with two partitions, for keys {@value INTERNAL_PARTITION_KEY} and the * specified {@code columnPartitionKey}. */ @@ -88,37 +87,35 @@ public String toString() { @Override public final void findKeys(@NotNull final Consumer locationKeyObserver) { final Map> partitions = new LinkedHashMap<>(); - PrivilegedFileAccessUtil.doFilesystemAction(() -> { - try (final DirectoryStream internalPartitionStream = - Files.newDirectoryStream(tableRootDirectory.toPath(), Files::isDirectory)) { - for (final Path internalPartition : internalPartitionStream) { - final String internalPartitionValue = internalPartition.getFileName().toString(); - if (internalPartitionValueFilter != null - && !internalPartitionValueFilter.test(internalPartitionValue)) { - continue; - } - boolean needToUpdateInternalPartitionValue = true; - try (final DirectoryStream columnPartitionStream = - Files.newDirectoryStream(internalPartition, Files::isDirectory)) { - for (final Path columnPartition : columnPartitionStream) { - partitions.put(columnPartitionKey, columnPartition.getFileName().toString()); - if (needToUpdateInternalPartitionValue) { - // Partition order dictates comparison priority, so we need to insert the internal - // partition after the column partition. - partitions.put(INTERNAL_PARTITION_KEY, internalPartitionValue); - needToUpdateInternalPartitionValue = false; - } - locationKeyObserver.accept(makeKey(columnPartition.resolve(tableName), partitions)); + try (final DirectoryStream internalPartitionStream = + Files.newDirectoryStream(tableRootDirectory.toPath(), Files::isDirectory)) { + for (final Path internalPartition : internalPartitionStream) { + final String internalPartitionValue = internalPartition.getFileName().toString(); + if (internalPartitionValueFilter != null + && !internalPartitionValueFilter.test(internalPartitionValue)) { + continue; + } + boolean needToUpdateInternalPartitionValue = true; + try (final DirectoryStream columnPartitionStream = + Files.newDirectoryStream(internalPartition, Files::isDirectory)) { + for (final Path columnPartition : columnPartitionStream) { + partitions.put(columnPartitionKey, columnPartition.getFileName().toString()); + if (needToUpdateInternalPartitionValue) { + // Partition order dictates comparison priority, so we need to insert the internal + // partition after the column partition. + partitions.put(INTERNAL_PARTITION_KEY, internalPartitionValue); + needToUpdateInternalPartitionValue = false; } + locationKeyObserver.accept(makeKey(columnPartition.resolve(tableName), partitions)); } } - } catch (final NoSuchFileException | FileNotFoundException ignored) { - // If we found nothing at all, then there's nothing to be done at this level. - } catch (final IOException e) { - throw new TableDataException( - "Error finding locations for " + tableName + " under " + tableRootDirectory, e); } - }); + } catch (final NoSuchFileException | FileNotFoundException ignored) { + // If we found nothing at all, then there's nothing to be done at this level. + } catch (final IOException e) { + throw new TableDataException( + "Error finding locations for " + tableName + " under " + tableRootDirectory, e); + } } protected abstract TLK makeKey(@NotNull final Path tableLeafDirectory, diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetFlatPartitionedLayout.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetFlatPartitionedLayout.java index a1f8d36cc9d..d54369ccf3d 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetFlatPartitionedLayout.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetFlatPartitionedLayout.java @@ -5,7 +5,6 @@ import io.deephaven.engine.table.impl.locations.TableDataException; import io.deephaven.engine.table.impl.locations.impl.TableLocationKeyFinder; -import io.deephaven.engine.table.impl.locations.local.PrivilegedFileAccessUtil; import io.deephaven.parquet.table.location.ParquetTableLocationKey; import org.jetbrains.annotations.NotNull; @@ -38,15 +37,13 @@ public String toString() { @Override public void findKeys(@NotNull final Consumer locationKeyObserver) { - PrivilegedFileAccessUtil.doFilesystemAction(() -> { - try (final DirectoryStream parquetFileStream = - Files.newDirectoryStream(tableRootDirectory.toPath(), "*" + PARQUET_FILE_EXTENSION)) { - for (final Path parquetFilePath : parquetFileStream) { - locationKeyObserver.accept(new ParquetTableLocationKey(parquetFilePath.toFile(), 0, null)); - } - } catch (final IOException e) { - throw new TableDataException("Error finding parquet locations under " + tableRootDirectory, e); + try (final DirectoryStream parquetFileStream = + Files.newDirectoryStream(tableRootDirectory.toPath(), "*" + PARQUET_FILE_EXTENSION)) { + for (final Path parquetFilePath : parquetFileStream) { + locationKeyObserver.accept(new ParquetTableLocationKey(parquetFilePath.toFile(), 0, null)); } - }); + } catch (final IOException e) { + throw new TableDataException("Error finding parquet locations under " + tableRootDirectory, e); + } } } diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetSingleFileLayout.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetSingleFileLayout.java index 29a3588d34a..36dc561ee84 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetSingleFileLayout.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/layout/ParquetSingleFileLayout.java @@ -4,7 +4,6 @@ package io.deephaven.parquet.table.layout; import io.deephaven.engine.table.impl.locations.impl.TableLocationKeyFinder; -import io.deephaven.engine.table.impl.locations.local.PrivilegedFileAccessUtil; import io.deephaven.parquet.table.location.ParquetTableLocationKey; import org.jetbrains.annotations.NotNull; @@ -31,7 +30,6 @@ public String toString() { @Override public void findKeys(@NotNull final Consumer locationKeyObserver) { - PrivilegedFileAccessUtil.doFilesystemAction( - () -> locationKeyObserver.accept(new ParquetTableLocationKey(parquetFile, 0, null))); + locationKeyObserver.accept(new ParquetTableLocationKey(parquetFile, 0, null)); } } diff --git a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetTableLocationFactory.java b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetTableLocationFactory.java index bcb096ace9d..4a047c16c2f 100644 --- a/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetTableLocationFactory.java +++ b/extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetTableLocationFactory.java @@ -9,7 +9,6 @@ import io.deephaven.engine.table.impl.locations.impl.TableLocationFactory; import io.deephaven.engine.table.impl.locations.util.TableDataRefreshService; import io.deephaven.parquet.table.ParquetInstructions; -import io.deephaven.util.Utils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,7 +31,7 @@ public TableLocation makeLocation(@NotNull final TableKey tableKey, @NotNull final ParquetTableLocationKey locationKey, @Nullable final TableDataRefreshService refreshService) { final File parquetFile = locationKey.getFile(); - if (Utils.fileExistsPrivileged(parquetFile)) { + if (parquetFile.exists()) { return new ParquetTableLocation(tableKey, locationKey, readInstructions); } else { return new NonexistentTableLocation(tableKey, locationKey); From 8821486edf743e8cd0340df5e10df5159e5583f3 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Mon, 12 Sep 2022 14:38:21 -0600 Subject: [PATCH 122/215] Merge py integration tests into the main suite (#2834) * Merge py integration tests into the main suite * Small formatting change --- Integrations/build.gradle | 6 --- .../integration-tests/null_integers_test.py | 23 ---------- .../numbers_from_list_and_func_test.py | 42 ------------------- py/server/integration-tests/perfmon_test.py | 24 ----------- .../integration-tests/pylong_conv_test.py | 24 ----------- .../pyobj_field_access_test.py | 34 --------------- py/server/integration-tests/run-tests.sh | 14 ------- py/server/tests/test_column.py | 35 +++++++++++++++- py/server/tests/test_constants.py | 14 +++++++ .../test_numba_vectorized_column.py} | 3 -- .../test_numba_vectorized_filter.py} | 3 -- py/server/tests/test_perfmon.py | 12 +++++- py/server/tests/test_table.py | 35 +++++++++++++--- 13 files changed, 89 insertions(+), 180 deletions(-) delete mode 100644 py/server/integration-tests/null_integers_test.py delete mode 100644 py/server/integration-tests/numbers_from_list_and_func_test.py delete mode 100644 py/server/integration-tests/perfmon_test.py delete mode 100644 py/server/integration-tests/pylong_conv_test.py delete mode 100644 py/server/integration-tests/pyobj_field_access_test.py delete mode 100755 py/server/integration-tests/run-tests.sh rename py/server/{integration-tests/numba_vectorized_column_test.py => tests/test_numba_vectorized_column.py} (95%) rename py/server/{integration-tests/numba_vectorized_filter_test.py => tests/test_numba_vectorized_filter.py} (95%) diff --git a/Integrations/build.gradle b/Integrations/build.gradle index ac4ec50aa37..8055b8ad11b 100644 --- a/Integrations/build.gradle +++ b/Integrations/build.gradle @@ -102,14 +102,8 @@ Closure composeConfig = { task -> } def pyTest = runInDocker('test-py-deephaven', '../py/server', ['python3', '-m', 'xmlrunner', 'discover', '-s', 'tests', '-t', '.', '-v', '-o', '/out/report'], composeConfig) -def pyTestIntegration = runInDocker('test-py-deephaven-integration', '../py/server', ['/bin/bash', '-c', 'PYTHONPATH=/python integration-tests/run-tests.sh'], composeConfig) pyTest.configure({ onlyIf { TestTools.shouldRunTests(project) } }) tasks.getByName('check').dependsOn(pyTest) - -pyTestIntegration.configure({ - onlyIf { TestTools.shouldRunTests(project) } -}) -tasks.getByName('check').dependsOn(pyTestIntegration) diff --git a/py/server/integration-tests/null_integers_test.py b/py/server/integration-tests/null_integers_test.py deleted file mode 100644 index 034e13ea8c8..00000000000 --- a/py/server/integration-tests/null_integers_test.py +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending -# - -from test_helper import start_jvm -start_jvm() - -from deephaven import empty_table -from deephaven.constants import NULL_LONG, NULL_SHORT, NULL_INT, NULL_BYTE - -null_byte = NULL_BYTE -null_short = NULL_SHORT -null_int = NULL_INT -null_long = NULL_LONG - - -def return_null_long(): - return NULL_LONG - - -t = empty_table(9).update( - ["X = null_byte", "Y = null_short", "YY = null_int", "Z = null_long", "ZZ = (long)return_null_long()"]) -assert t.to_string().count("null") == 45 diff --git a/py/server/integration-tests/numbers_from_list_and_func_test.py b/py/server/integration-tests/numbers_from_list_and_func_test.py deleted file mode 100644 index 72408f8f127..00000000000 --- a/py/server/integration-tests/numbers_from_list_and_func_test.py +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending -# - -from test_helper import start_jvm -start_jvm() - -from deephaven import dtypes -from deephaven import empty_table -from deephaven.constants import MAX_BYTE, MAX_SHORT, MAX_INT, MAX_LONG - -x = [MAX_BYTE, MAX_SHORT, MAX_INT, MAX_LONG, 0.98888, 999999.888888] -n = len(x) - - -def get_x(i): - return x[i] - - -t_list = empty_table(n).update(["X = x[i]"]) -t_func = empty_table(n).update(["X = get_x(i)"]) -# We want to test that casting on both PyObject and JObject works as expected. -assert t_list.columns[0].data_type == dtypes.PyObject -assert t_func.columns[0].data_type == dtypes.JObject - -t_list_integers = t_list.update( - ["A = (byte)X", "B = (short)X", "C = (int)X", "D = (long)X", "E = (float)X", "F = (double)X"]) -assert t_list_integers.columns[1].data_type == dtypes.byte -assert t_list_integers.columns[2].data_type == dtypes.short -assert t_list_integers.columns[3].data_type == dtypes.int32 -assert t_list_integers.columns[4].data_type == dtypes.long -assert t_list_integers.columns[5].data_type == dtypes.float32 -assert t_list_integers.columns[6].data_type == dtypes.double - -t_func_integers = t_list.update( - ["A = (byte)X", "B = (short)X", "C = (int)X", "D = (long)X", "E = (float)X", "F = (double)X"]) -assert t_func_integers.columns[1].data_type == dtypes.byte -assert t_func_integers.columns[2].data_type == dtypes.short -assert t_func_integers.columns[3].data_type == dtypes.int32 -assert t_func_integers.columns[4].data_type == dtypes.long -assert t_list_integers.columns[5].data_type == dtypes.float32 -assert t_list_integers.columns[6].data_type == dtypes.float64 diff --git a/py/server/integration-tests/perfmon_test.py b/py/server/integration-tests/perfmon_test.py deleted file mode 100644 index df9266caeea..00000000000 --- a/py/server/integration-tests/perfmon_test.py +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending -# - -import unittest - -from test_helper import start_jvm -start_jvm() - -from deephaven.perfmon import query_update_performance, query_performance, query_operation_performance, server_state - -class TestClass(unittest.TestCase): - def test_performance_queries(self): - q = query_performance(1) - self.assertTrue(q.to_string()) - q = query_operation_performance(1) - self.assertTrue(q.to_string()) - q = server_state() - self.assertTrue(q.to_string()) - q = query_update_performance(1) - self.assertTrue(q.to_string()) - -if __name__ == "__main__": - unittest.main(verbosity=2) diff --git a/py/server/integration-tests/pylong_conv_test.py b/py/server/integration-tests/pylong_conv_test.py deleted file mode 100644 index 8b585c6912f..00000000000 --- a/py/server/integration-tests/pylong_conv_test.py +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending -# - -import unittest - -from test_helper import start_jvm -start_jvm() - -from deephaven import empty_table - -long_value = 2 ** 32 + 5 - - -class TestClass(unittest.TestCase): - - def test_long_number_conversion(self): - t = empty_table(1) - result = t.update("X = long_value").to_string(1) - self.assertEqual(long_value, int(result.split()[2])) - - -if __name__ == "__main__": - unittest.main(verbosity=2) diff --git a/py/server/integration-tests/pyobj_field_access_test.py b/py/server/integration-tests/pyobj_field_access_test.py deleted file mode 100644 index 96a9a02c7f6..00000000000 --- a/py/server/integration-tests/pyobj_field_access_test.py +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending -# - -import unittest - -from test_helper import start_jvm -start_jvm() - -from deephaven import empty_table -from deephaven.html import to_html - - -class EmptyCls: - ... - - -pyobj = EmptyCls() -pyobj.name = "GOOG" -pyobj.price = 1000 - - -class TestClass(unittest.TestCase): - - def test_pyobj_field_access(self): - t = empty_table(10) - t2 = t.update(formulas=["SYM = `AAPL-` + (String)pyobj.name", "PRICE = i * 1000"]).where("PRICE > (int)pyobj.price + 100") - html_output = to_html(t2) - self.assertIn("AAPL-GOOG", html_output) - self.assertIn("2000", html_output) - - -if __name__ == "__main__": - unittest.main(verbosity=2) diff --git a/py/server/integration-tests/run-tests.sh b/py/server/integration-tests/run-tests.sh deleted file mode 100755 index 823a32cc996..00000000000 --- a/py/server/integration-tests/run-tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -eux - -# -# Run each test py file in its own interpreter so they don't share globals -# - -DIR=$(dirname "$0") - -for test_file_name in $DIR/*test.py; -do - echo $test_file_name >> /out/report/scripting-test_results 2>&1 - python3 $test_file_name >> /out/report/scripting-test_results 2>&1 -done diff --git a/py/server/tests/test_column.py b/py/server/tests/test_column.py index ce930ebb5d6..97e1989b01c 100644 --- a/py/server/tests/test_column.py +++ b/py/server/tests/test_column.py @@ -7,9 +7,11 @@ from dataclasses import dataclass from deephaven import DHError, dtypes, new_table -from deephaven.jcompat import j_array_list +from deephaven import empty_table from deephaven.column import byte_col, char_col, short_col, bool_col, int_col, long_col, float_col, double_col, \ string_col, datetime_col, jobj_col, ColumnType +from deephaven.constants import MAX_BYTE, MAX_SHORT, MAX_INT, MAX_LONG +from deephaven.jcompat import j_array_list from tests.testbase import BaseTestCase @@ -70,6 +72,37 @@ def test_array_column(self): self.assertIsNone(test_table.columns[0].component_type) self.assertEqual(test_table.columns[1].component_type, dtypes.double) + def test_numeric_columns(self): + x = [MAX_BYTE, MAX_SHORT, MAX_INT, MAX_LONG, 0.98888, 999999.888888] + n = len(x) + + def get_x(i): + return x[i] + + t_list = empty_table(n).update(["X = x[i]"]) + t_func = empty_table(n).update(["X = get_x(i)"]) + # We want to test that casting on both PyObject and JObject works as expected. + self.assertEqual(t_list.columns[0].data_type, dtypes.PyObject) + self.assertEqual(t_func.columns[0].data_type, dtypes.JObject) + + t_list_integers = t_list.update( + ["A = (byte)X", "B = (short)X", "C = (int)X", "D = (long)X", "E = (float)X", "F = (double)X"]) + self.assertEqual(t_list_integers.columns[1].data_type, dtypes.byte) + self.assertEqual(t_list_integers.columns[2].data_type, dtypes.short) + self.assertEqual(t_list_integers.columns[3].data_type, dtypes.int32) + self.assertEqual(t_list_integers.columns[4].data_type, dtypes.long) + self.assertEqual(t_list_integers.columns[5].data_type, dtypes.float32) + self.assertEqual(t_list_integers.columns[6].data_type, dtypes.double) + + t_func_integers = t_func.update( + ["A = (byte)X", "B = (short)X", "C = (int)X", "D = (long)X", "E = (float)X", "F = (double)X"]) + self.assertEqual(t_func_integers.columns[1].data_type, dtypes.byte) + self.assertEqual(t_func_integers.columns[2].data_type, dtypes.short) + self.assertEqual(t_func_integers.columns[3].data_type, dtypes.int32) + self.assertEqual(t_func_integers.columns[4].data_type, dtypes.long) + self.assertEqual(t_list_integers.columns[5].data_type, dtypes.float32) + self.assertEqual(t_list_integers.columns[6].data_type, dtypes.float64) + @dataclass class CustomClass: diff --git a/py/server/tests/test_constants.py b/py/server/tests/test_constants.py index a713ad12f24..13c8a77d4a0 100644 --- a/py/server/tests/test_constants.py +++ b/py/server/tests/test_constants.py @@ -2,6 +2,7 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # +from deephaven import empty_table from deephaven.constants import * from tests.testbase import BaseTestCase @@ -43,3 +44,16 @@ def test_constants_values(self): self.assertEqual(NULL_SHORT, -32768) self.assertEqual(POS_INFINITY_DOUBLE, float('inf')) self.assertEqual(POS_INFINITY_FLOAT, float('inf')) + + def test_return_null_long(self): + null_byte = NULL_BYTE + null_short = NULL_SHORT + null_int = NULL_INT + null_long = NULL_LONG + + def return_null_long(): + return NULL_LONG + + t = empty_table(9).update( + ["X = null_byte", "Y = null_short", "YY = null_int", "Z = null_long", "ZZ = (long)return_null_long()"]) + self.assertEqual(t.to_string().count("null"), 45) diff --git a/py/server/integration-tests/numba_vectorized_column_test.py b/py/server/tests/test_numba_vectorized_column.py similarity index 95% rename from py/server/integration-tests/numba_vectorized_column_test.py rename to py/server/tests/test_numba_vectorized_column.py index a7fcc380caf..f1252b8b3ab 100644 --- a/py/server/integration-tests/numba_vectorized_column_test.py +++ b/py/server/tests/test_numba_vectorized_column.py @@ -6,9 +6,6 @@ from numba import vectorize, int64 -from test_helper import start_jvm -start_jvm() - from deephaven import empty_table from deephaven.html import to_html diff --git a/py/server/integration-tests/numba_vectorized_filter_test.py b/py/server/tests/test_numba_vectorized_filter.py similarity index 95% rename from py/server/integration-tests/numba_vectorized_filter_test.py rename to py/server/tests/test_numba_vectorized_filter.py index c15b1a22a27..ea296abc207 100644 --- a/py/server/integration-tests/numba_vectorized_filter_test.py +++ b/py/server/tests/test_numba_vectorized_filter.py @@ -6,9 +6,6 @@ from numba import vectorize, int64, boolean, short -from test_helper import start_jvm -start_jvm() - from deephaven import empty_table from deephaven.html import to_html diff --git a/py/server/tests/test_perfmon.py b/py/server/tests/test_perfmon.py index 673e2393d7c..45f2392b33a 100644 --- a/py/server/tests/test_perfmon.py +++ b/py/server/tests/test_perfmon.py @@ -5,10 +5,10 @@ import unittest from deephaven import empty_table - from deephaven.perfmon import process_info_log, process_metrics_log, server_state_log, \ query_operation_performance_log, query_performance_log, update_performance_log, metrics_get_counters, \ metrics_reset_counters +from deephaven.perfmon import query_update_performance, query_performance, query_operation_performance, server_state from tests.testbase import BaseTestCase @@ -54,6 +54,16 @@ def test_query_logs(self): log_table = update_performance_log() self.assertTrue(log_table.to_string()) + def test_performance_queries(self): + q = query_performance(1) + self.assertTrue(q.to_string()) + q = query_operation_performance(1) + self.assertTrue(q.to_string()) + q = server_state() + self.assertTrue(q.to_string()) + q = query_update_performance(1) + self.assertTrue(q.to_string()) + if __name__ == '__main__': unittest.main() diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index dd650fb7f36..59d1e54f7d2 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -10,6 +10,7 @@ from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule, time_table, ugp from deephaven.agg import sum_, weighted_avg, avg, pct, group, count_, first, last, max_, median, min_, std, abs_sum, \ var, formula, partition +from deephaven.html import to_html from deephaven.pandas import to_pandas from deephaven.table import Table from tests.testbase import BaseTestCase @@ -624,11 +625,12 @@ def closure_fn() -> str: def test_nested_scopes(self): _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - context = _JExecutionContext.newBuilder() \ - .captureQueryCompiler() \ - .captureQueryLibrary() \ - .captureQueryScope() \ - .build() + context = (_JExecutionContext.newBuilder() + .captureQueryCompiler() + .captureQueryLibrary() + .captureQueryScope() + .build()) + def inner_func(p) -> str: openContext = context.open() t = empty_table(1).update("X = p * 10") @@ -724,6 +726,20 @@ def test_ticking_table_scope(self): self.wait_ticking_table_update(rt, row_count=rt.size + 1, timeout=5) self.verify_table_data(rt, list(range(1, 5))) + def test_long_number_conversion(self): + long_value = 2 ** 32 + 5 + t = empty_table(1) + result = t.update("X = long_value").to_string(1) + self.assertEqual(long_value, int(result.split()[2])) + + def test_python_field_access(self): + t = empty_table(10) + t2 = t.update(formulas=["SYM = `AAPL-` + (String)foo.name", "PRICE = i * 1000"]).where( + "PRICE > (int)foo.price + 100") + html_output = to_html(t2) + self.assertIn("AAPL-GOOG", html_output) + self.assertIn("2000", html_output) + def global_fn() -> str: return "global str" @@ -732,5 +748,14 @@ def global_fn() -> str: global_int = 1001 a_number = 10001 + +class EmptyCls: + ... + + +foo = EmptyCls() +foo.name = "GOOG" +foo.price = 1000 + if __name__ == "__main__": unittest.main() From 16d229b954e8517264262e724d4585650308f2e1 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:10:35 -0600 Subject: [PATCH 123/215] Support numpy.bool_ to Java Boolean in array() (#2839) * Support numpy.bool_ to Java Boolean in array() * Add a test case for the change --- py/server/deephaven/dtypes.py | 10 ++++++++++ py/server/deephaven/numpy.py | 9 --------- py/server/tests/test_dtypes.py | 7 +++++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/py/server/deephaven/dtypes.py b/py/server/deephaven/dtypes.py index 0ab90127940..6983d49e1e1 100644 --- a/py/server/deephaven/dtypes.py +++ b/py/server/deephaven/dtypes.py @@ -18,6 +18,7 @@ _JQstType = jpy.get_type("io.deephaven.qst.type.Type") _JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") +_JPrimitiveArrayConversionUtility = jpy.get_type("io.deephaven.integrations.common.PrimitiveArrayConversionUtility") _j_name_type_map: Dict[str, DType] = {} @@ -164,6 +165,15 @@ def array(dtype: DType, seq: Sequence, remap: Callable[[Any], Any] = None) -> jp if isinstance(seq, str) and dtype == char: return array(char, seq, remap=ord) + if isinstance(seq, np.ndarray): + if dtype == bool_: + bytes_ = seq.astype(dtype=np.int8) + j_bytes = array(byte, bytes_) + seq = _JPrimitiveArrayConversionUtility.translateArrayByteToBoolean(j_bytes) + if dtype == DateTime: + longs = jpy.array('long', seq.astype('datetime64[ns]').astype('int64')) + seq = _JPrimitiveArrayConversionUtility.translateArrayLongToDateTime(longs) + return jpy.array(dtype.j_type, seq) except Exception as e: raise DHError(e, f"failed to create a Java {dtype.j_name} array.") from e diff --git a/py/server/deephaven/numpy.py b/py/server/deephaven/numpy.py index a4758e1d65f..bf4573d0b18 100644 --- a/py/server/deephaven/numpy.py +++ b/py/server/deephaven/numpy.py @@ -84,15 +84,6 @@ def _columns_to_2d_numpy_array(col_def: Column, j_arrays: List[jpy.JType]) -> np def _make_input_column(col: str, np_array: np.ndarray, dtype: DType) -> InputColumn: """ Creates a InputColumn with the given column name and the numpy array. """ - if dtype == dtypes.bool_: - bytes_ = np_array.astype(dtype=np.int8) - j_bytes = dtypes.array(dtypes.byte, bytes_) - np_array = _JPrimitiveArrayConversionUtility.translateArrayByteToBoolean(j_bytes) - - if dtype == dtypes.DateTime: - longs = jpy.array('long', np_array.astype('datetime64[ns]').astype('int64')) - np_array = _JPrimitiveArrayConversionUtility.translateArrayLongToDateTime(longs) - return InputColumn(name=_to_column_name(col), data_type=dtype, input_data=np_array) diff --git a/py/server/tests/test_dtypes.py b/py/server/tests/test_dtypes.py index 1e3a07e9b9d..99390d71772 100644 --- a/py/server/tests/test_dtypes.py +++ b/py/server/tests/test_dtypes.py @@ -192,6 +192,13 @@ def test_datetime(self): j_array = dtypes.array(DateTime, values) self.assertTrue(all(x == y for x, y in zip(j_array, values))) + def test_bool_array(self): + np_array = np.array([True, False], np.bool_) + j_array = dtypes.array(dtypes.bool_, np_array) + j_array2 = dtypes.array(dtypes.bool_, [True, False]) + self.assertEqual(j_array[0], j_array2[0]) + self.assertEqual(j_array[1], j_array2[1]) + if __name__ == '__main__': unittest.main() From d3c4ff7bc1fa99f36170e311ad8c448d164178dc Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 13 Sep 2022 11:42:00 -0500 Subject: [PATCH 124/215] Correctly base64 encode binary gRPC trailers to websocket frames (#2842) Fixes #2841 --- .../io/grpc/servlet/web/websocket/WebsocketStreamImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java index 459dbdb2018..2d492f34757 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java @@ -11,6 +11,7 @@ import io.grpc.internal.SerializingExecutor; import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; +import io.grpc.internal.TransportFrameUtil; import io.grpc.internal.TransportTracer; import io.grpc.internal.WritableBuffer; import jakarta.websocket.Session; @@ -223,7 +224,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) // Trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the size in a 4 byte int - byte[][] serializedTrailers = InternalMetadata.serialize(trailers); + byte[][] serializedTrailers = TransportFrameUtil.toHttp2Headers(trailers); // Total up the size of the payload: 5 bytes for the prefix, and each trailer needs a colon+space delimiter, // and to end with \r\n int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); From e2fd0d8a92a6765c3f0da156f099a2be07a09ea0 Mon Sep 17 00:00:00 2001 From: SuperTails Date: Wed, 14 Sep 2022 17:30:59 -0400 Subject: [PATCH 125/215] Fixed missing libraries in C++ build instructions; fixed missing header includes (#2726) --- cpp-client/README.md | 2 +- cpp-client/deephaven/client/src/container/row_sequence.cc | 2 ++ cpp-client/deephaven/client/src/subscription/space_mapper.cc | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp-client/README.md b/cpp-client/README.md index 48cde309ccc..01823519bd4 100644 --- a/cpp-client/README.md +++ b/cpp-client/README.md @@ -49,7 +49,7 @@ C++ compiler and tool suite (cmake etc). cd $DHSRC/deephaven-core/cpp-client/deephaven/ mkdir build && cd build export PFX=$HOME/dhcpp/local # This should reflect your selection in the previous point. - export CMAKE_PREFIX_PATH=${PFX}/abseil:${PFX}/cares:${PFX}/flatbuffers:${PFX}/gflags:${PFX}/protobuf:${PFX}/re2:${PFX}/zlib:${PFX}/grpc:${PFX}/arrow:${PFX}/deephaven + export CMAKE_PREFIX_PATH=${PFX}/abseil:${PFX}/boost:${PFX}/cares:${PFX}/flatbuffers:${PFX}/gflags:${PFX}/immer:${PFX}/protobuf:${PFX}/re2:${PFX}/zlib:${PFX}/grpc:${PFX}/arrow:${PFX}/deephaven export NCPUS=$(getconf _NPROCESSORS_ONLN) cmake -DCMAKE_INSTALL_PREFIX=${PFX}/deephaven .. && make -j$NCPUS install ``` diff --git a/cpp-client/deephaven/client/src/container/row_sequence.cc b/cpp-client/deephaven/client/src/container/row_sequence.cc index be437a5b256..505a60bbdce 100644 --- a/cpp-client/deephaven/client/src/container/row_sequence.cc +++ b/cpp-client/deephaven/client/src/container/row_sequence.cc @@ -2,6 +2,8 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include "deephaven/client/container/row_sequence.h" + +#include #include "deephaven/client/utility/utility.h" using deephaven::client::utility::stringf; diff --git a/cpp-client/deephaven/client/src/subscription/space_mapper.cc b/cpp-client/deephaven/client/src/subscription/space_mapper.cc index b849167e537..54890522a47 100644 --- a/cpp-client/deephaven/client/src/subscription/space_mapper.cc +++ b/cpp-client/deephaven/client/src/subscription/space_mapper.cc @@ -2,6 +2,8 @@ * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ #include "deephaven/client/subscription/space_mapper.h" + +#include #include "deephaven/client/utility/utility.h" using deephaven::client::container::RowSequence; From c4a0422a6cc55cff7b089bf58cd38ebb0c145b06 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 15 Sep 2022 10:58:03 -0500 Subject: [PATCH 126/215] If a TeeStream is gc'd, don't close underlying streams (#2837) Fixes #2812 --- py/server/deephaven_internal/stream.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py/server/deephaven_internal/stream.py b/py/server/deephaven_internal/stream.py index 8daec2d2785..bc1e5c52e5a 100644 --- a/py/server/deephaven_internal/stream.py +++ b/py/server/deephaven_internal/stream.py @@ -89,3 +89,7 @@ def close(self): self.close_func() if self.should_write_to_orig_stream: self._stream.close() + + def __del__(self): + # Do nothing, override superclass which would call close() + pass From 732ed305db1914a5dcd950f824e3fcf7d3369529 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 15 Sep 2022 10:58:47 -0500 Subject: [PATCH 127/215] Package proto files in the top level of the jar based on them (#2844) This follows the pattern in use by flight-core with its Flight.proto file. Fixes #2840 --- proto/proto-backplane-grpc/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index 769bd169b1b..4a5e99f1cc6 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -105,6 +105,9 @@ sourceSets { srcDir 'build/generated/source/proto/main/grpc' srcDir 'build/generated/source/proto/main/java' } + resources { + srcDir 'src/main/proto/deephaven/proto' + } } } From 414ec5e02ca8e3c5bb911e8b552189150b5d757b Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Thu, 15 Sep 2022 11:03:58 -0600 Subject: [PATCH 128/215] TicketResolver: return failed export object instead of throwing (#2845) --- .../extensions/barrage/util/GrpcUtil.java | 4 +- .../server/console/ScopeTicketResolver.java | 18 +++-- .../server/session/SessionState.java | 33 ++++++-- .../server/session/SessionStateTest.java | 77 +++++++++++++------ 4 files changed, 95 insertions(+), 37 deletions(-) diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/GrpcUtil.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/GrpcUtil.java index c32c85b2f05..39dc14095e6 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/GrpcUtil.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/GrpcUtil.java @@ -41,9 +41,9 @@ public static void rpcWrapper(final Logger log, final St } else { log.error().append(err).endl(); } - response.onError(err); + safelyError(response, err); } catch (final RuntimeException | IOException err) { - response.onError(securelyWrapError(log, err)); + safelyError(response, securelyWrapError(log, err)); } } diff --git a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java index a505711a3db..e6de82386e1 100644 --- a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java +++ b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java @@ -6,6 +6,7 @@ import com.google.protobuf.ByteStringAccess; import com.google.rpc.Code; import io.deephaven.base.string.EncodingInfo; +import io.deephaven.engine.context.QueryScope; import io.deephaven.engine.liveness.LivenessReferent; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.DynamicNode; @@ -96,22 +97,23 @@ public SessionState.ExportObject resolve( private SessionState.ExportObject resolve( @Nullable final SessionState session, final String scopeName, final String logId) { - // if we are not attached to a session, check the scope for a variable right now + // fetch the variable from the scope right now final T export = UpdateGraphProcessor.DEFAULT.sharedLock().computeLocked(() -> { final ScriptSession gss = scriptSessionProvider.get(); - // noinspection unchecked - T scopeVar = (T) gss.unwrapObject(gss.getVariable(scopeName)); - if (scopeVar == null) { - throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, - "Could not resolve '" + logId + "': no variable exists with name '" + scopeName + "'"); + T scopeVar = null; + try { + // noinspection unchecked + scopeVar = (T) gss.unwrapObject(gss.getVariable(scopeName)); + } catch (QueryScope.MissingVariableException ignored) { } return scopeVar; }); if (export == null) { - throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, - "Could not resolve '" + logId + "': no variable exists with name '" + scopeName + "'"); + return SessionState.wrapAsFailedExport(GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, + "Could not resolve '" + logId + "': no variable exists with name '" + scopeName + "'")); } + return SessionState.wrapAsExport(export); } diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index d2b4bf01b73..e484854edf0 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -21,7 +21,6 @@ import io.deephaven.engine.tablelogger.QueryOperationPerformanceLogLogger; import io.deephaven.engine.tablelogger.QueryPerformanceLogLogger; import io.deephaven.engine.updategraph.DynamicNode; -import io.deephaven.engine.util.ScriptSession; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.hash.KeyedIntObjectHash; import io.deephaven.hash.KeyedIntObjectHashMap; @@ -103,6 +102,20 @@ public static ExportObject wrapAsExport(final T export) { return new ExportObject<>(export); } + /** + * Wrap an exception in an ExportObject to make it conform to the session export API. The export behaves as if it + * has already failed. + * + * @param caughtException the exception to propagate + * @param the type of the object + * @return a sessionless export object + */ + public static ExportObject wrapAsFailedExport(final Exception caughtException) { + ExportObject exportObject = new ExportObject<>(null); + exportObject.caughtException = caughtException; + return exportObject; + } + private static final Logger log = LoggerFactory.getLogger(SessionState.class); private final String logPrefix; @@ -551,11 +564,17 @@ private ExportObject(final T result) { super(true); this.session = null; this.exportId = NON_EXPORT_ID; - this.state = ExportNotification.State.EXPORTED; this.result = result; this.dependentCount = 0; this.logIdentity = Integer.toHexString(System.identityHashCode(this)) + "-sessionless"; + if (result == null) { + assignErrorId(); + state = ExportNotification.State.FAILED; + } else { + state = ExportNotification.State.EXPORTED; + } + if (result instanceof LivenessReferent && DynamicNode.notDynamicOrIsRefreshing(result)) { manage((LivenessReferent) result); } @@ -733,8 +752,9 @@ private synchronized void setState(final ExportNotification.State state) { exportListenerVersion = session.exportListenerVersion; session.exportListeners.forEach(listener -> listener.notify(notification)); } else { - log.debug().append(session.logPrefix).append("non-export '").append(logIdentity) - .append("' is ExportState.").append(state.name()).endl(); + log.debug().append(session == null ? "Session " : session.logPrefix) + .append("non-export '").append(logIdentity).append("' is ExportState.") + .append(state.name()).endl(); } if (isExportStateFailure(state) && errorHandler != null) { @@ -978,7 +998,10 @@ public synchronized void cancel() { protected synchronized void destroy() { super.destroy(); result = null; - caughtException = null; + // keep SREs since error propagation won't reference a real errorId on the server + if (!(caughtException instanceof StatusRuntimeException)) { + caughtException = null; + } } /** diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index b576b5da6bf..038a49d797f 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -6,9 +6,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.base.verify.AssertionFailure; import io.deephaven.engine.context.ExecutionContext; -import io.deephaven.engine.util.NoLanguageDeephavenSession; import io.deephaven.proto.util.ExportTicketHelper; -import io.deephaven.server.table.ExportTableUpdateListenerTest; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.liveness.LivenessReferent; @@ -81,7 +79,7 @@ public void teardown() { public void testDestroyOnExportRelease() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject exportObj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { exportObj = session.newExport(nextExportId++).submit(() -> export); } @@ -107,7 +105,7 @@ public void testDestroyOnExportRelease() { public void testServerExportDestroyOnExportRelease() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject exportObj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { exportObj = session.newServerSideExport(export); } @@ -127,7 +125,7 @@ public void testServerExportDestroyOnExportRelease() { public void testDestroyOnSessionRelease() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject exportObj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { exportObj = session.newExport(nextExportId++).submit(() -> export); } @@ -154,7 +152,7 @@ public void testDestroyOnSessionRelease() { public void testServerExportDestroyOnSessionRelease() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject exportObj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { exportObj = session.newServerSideExport(export); } @@ -271,7 +269,7 @@ public void testCancelDuringExport() { public void testCancelPostExport() { final MutableObject export = new MutableObject<>(); final SessionState.ExportObject exportObj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { exportObj = session.newExport(nextExportId++).submit(() -> { export.setValue(new PublicLivenessArtifact()); return export.getValue(); @@ -403,7 +401,7 @@ public void testDependencyNotReleasedEarly() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject e1; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { e1 = session.newExport(nextExportId++) .submit(() -> export); } @@ -429,7 +427,7 @@ public void testLateDependencyAlreadyReleasedFails() { final CountingLivenessReferent export = new CountingLivenessReferent(); final SessionState.ExportObject e1; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { e1 = session.newExport(nextExportId++) .submit(() -> export); } @@ -440,12 +438,10 @@ public void testLateDependencyAlreadyReleasedFails() { Assert.eq(e1.getState(), "e1.getState()", ExportNotification.State.RELEASED); final MutableBoolean errored = new MutableBoolean(); - expectException(LivenessStateException.class, () -> { - final SessionState.ExportObject e2 = session.newExport(nextExportId++) - .require(e1) - .onErrorHandler(err -> errored.setTrue()) - .submit(() -> Assert.gt(e1.get().refCount, "e1.get().refCount", 0)); - }); + expectException(LivenessStateException.class, () -> session.newExport(nextExportId++) + .require(e1) + .onErrorHandler(err -> errored.setTrue()) + .submit(() -> Assert.gt(e1.get().refCount, "e1.get().refCount", 0))); } @Test @@ -597,7 +593,7 @@ public void testDependencyAlreadyExported() { public void testDependencyReleasedBeforeExport() { final CountingLivenessReferent e1 = new CountingLivenessReferent(); final SessionState.ExportObject e1obj; - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { e1obj = session.newExport(nextExportId++).submit(() -> e1); } scheduler.runUntilQueueEmpty(); @@ -748,7 +744,7 @@ public void testNonExportCycle() { @Test public void testExportListenerOnCompleteOnRemoval() { final QueueingExportListener listener = new QueueingExportListener(); - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { session.addExportListener(listener); } Assert.eqFalse(listener.isComplete, "listener.isComplete"); @@ -759,7 +755,7 @@ public void testExportListenerOnCompleteOnRemoval() { @Test public void testExportListenerOnCompleteOnSessionExpire() { final QueueingExportListener listener = new QueueingExportListener(); - try (final SafeCloseable scope = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open()) { session.addExportListener(listener); } Assert.eqFalse(listener.isComplete, "listener.isComplete"); @@ -866,7 +862,7 @@ public void testExportListenerInterestingUpdates() { final QueueingExportListener listener = new QueueingExportListener(); session.addExportListener(listener); - final SessionState.ExportObject e1 = session.getExport(nextExportId++); + final SessionState.ExportObject e1 = session.getExport(nextExportId++); final SessionState.ExportObject e4 = session.newExport(nextExportId++).submit(() -> session); // exported final SessionState.ExportObject e5 = @@ -1032,7 +1028,6 @@ public void onNext(final ExportNotification n) { @Test public void testExportListenerTerminalDuringSeqSent() { - final ArrayList notifications = new ArrayList<>(); final SessionState.ExportBuilder b1 = session.newExport(nextExportId++); final SessionState.ExportBuilder b2 = session.newExport(nextExportId++); final SessionState.ExportBuilder b3 = session.newExport(nextExportId++); @@ -1283,7 +1278,45 @@ public void onCompleted() { scheduler.runUntilQueueEmpty(); Assert.eqFalse(submitRan.booleanValue(), "submitRan.booleanValue()"); - Assert.eqTrue(caughtErr.getValue() instanceof StatusRuntimeException, "caughtErr.getValue()"); + Assert.eqTrue(caughtErr.getValue() instanceof StatusRuntimeException, + "caughtErr.getValue() instanceof StatusRuntimeException"); + + final StatusRuntimeException sre = (StatusRuntimeException) caughtErr.getValue(); + Assert.eq(sre.getStatus(), "sre.getStatus()", Status.DATA_LOSS, "Status.DATA_LOSS"); + } + + @Test + public void testCascadingStatusRuntimeFailureDeliversToErrorHandlerAlreadyFailed() { + final SessionState.ExportObject e1 = SessionState.wrapAsFailedExport( + Status.DATA_LOSS.asRuntimeException()); + + final MutableBoolean submitRan = new MutableBoolean(); + final MutableObject caughtErr = new MutableObject<>(); + final StreamObserver observer = new StreamObserver<>() { + @Override + public void onNext(Object value) { + throw new RuntimeException("this should not reach test framework"); + } + + @Override + public void onError(Throwable t) { + caughtErr.setValue(t); + } + + @Override + public void onCompleted() { + throw new RuntimeException("this should not reach test framework"); + } + }; + session.newExport(nextExportId++) + .onError(observer) + .require(e1) + .submit(submitRan::setTrue); + + scheduler.runUntilQueueEmpty(); + Assert.eqFalse(submitRan.booleanValue(), "submitRan.booleanValue()"); + Assert.eqTrue(caughtErr.getValue() instanceof StatusRuntimeException, + "caughtErr.getValue() instanceof StatusRuntimeException"); final StatusRuntimeException sre = (StatusRuntimeException) caughtErr.getValue(); Assert.eq(sre.getStatus(), "sre.getStatus()", Status.DATA_LOSS, "Status.DATA_LOSS"); @@ -1394,5 +1427,5 @@ public void dropReference() { public WeakReference getWeakReference() { return new WeakReference<>(this); } - }; + } } From 7ec6315674b16606d6abd6fbcdc18470d226dd3d Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Fri, 16 Sep 2022 08:45:47 -0600 Subject: [PATCH 129/215] Add __version__ in deephaven_server (#2861) --- py/embedded-server/deephaven_server/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/embedded-server/deephaven_server/__init__.py b/py/embedded-server/deephaven_server/__init__.py index be71dffb003..f0a5f0fa961 100644 --- a/py/embedded-server/deephaven_server/__init__.py +++ b/py/embedded-server/deephaven_server/__init__.py @@ -1,6 +1,8 @@ # # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # +__version__ = "0.17.0" from .start_jvm import DEFAULT_JVM_PROPERTIES, DEFAULT_JVM_ARGS, start_jvm from .server import Server + From d9ba97e36dbebe6681e0caf25fbbb03dca28e3cc Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Fri, 16 Sep 2022 08:48:06 -0700 Subject: [PATCH 130/215] Improve `RowSetBuilderSequential` performance when adding keys from a chunk (#2856) * hack for improving performance for RowSetBuilderSequential * refactored function calls --- .../engine/rowset/RowSetBuilderRandom.java | 4 ++ .../rowset/RowSetBuilderSequential.java | 6 +- .../engine/rowset/impl/OrderedLongSet.java | 8 +++ .../impl/OrderedLongSetBuilderSequential.java | 4 +- .../impl/RspBitmapBuilderSequential.java | 66 ++++++++++++++++++- 5 files changed, 84 insertions(+), 4 deletions(-) diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderRandom.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderRandom.java index 45b9ec4802e..8179b1aee68 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderRandom.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderRandom.java @@ -50,6 +50,10 @@ default void addOrderedRowKeysChunk(final LongChunk ch addRowKeysChunk(chunk); } + default void addOrderedRowKeysChunk(final LongChunk chunk, int offset, int length) { + addKeys(new LongChunkIterator(chunk, offset, length)); + } + default void addOrderedRowKeysChunk(final IntChunk chunk) { addRowKeysChunk(chunk); } diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderSequential.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderSequential.java index 157e4f7a8d9..c8d6cd7544c 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderSequential.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/RowSetBuilderSequential.java @@ -43,7 +43,11 @@ default void appendKeys(PrimitiveIterator.OfLong it) { } default void appendOrderedRowKeysChunk(final LongChunk chunk) { - appendKeys(new LongChunkIterator(chunk)); + appendOrderedRowKeysChunk(chunk, 0, chunk.size()); + } + + default void appendOrderedRowKeysChunk(final LongChunk chunk, int offset, int length) { + appendKeys(new LongChunkIterator(chunk, offset, length)); } default void appendRanges(final LongRangeIterator it) { diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSet.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSet.java index 2ebaa672f09..48d9d9ea24e 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSet.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSet.java @@ -3,6 +3,7 @@ */ package io.deephaven.engine.rowset.impl; +import io.deephaven.chunk.util.LongChunkIterator; import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.RowSequenceFactory; import io.deephaven.engine.rowset.RowSet; @@ -489,6 +490,13 @@ default void appendOrderedLongSet(final long shiftAmount, final OrderedLongSet i }); } + default void appendOrderedRowKeysChunk(LongChunk chunk, int offset, int length) { + LongChunkIterator it = new LongChunkIterator(chunk, offset, length); + while (it.hasNext()) { + appendKey(it.nextLong()); + } + } + @Override default void accept(final long firstKey, final long lastKey) { appendRange(firstKey, lastKey); diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSetBuilderSequential.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSetBuilderSequential.java index 9869c40feb6..d7c9db247bd 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSetBuilderSequential.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/OrderedLongSetBuilderSequential.java @@ -3,9 +3,9 @@ */ package io.deephaven.engine.rowset.impl; -import io.deephaven.engine.rowset.impl.singlerange.*; -import io.deephaven.engine.rowset.impl.sortedranges.SortedRanges; import io.deephaven.engine.rowset.impl.rsp.RspBitmap; +import io.deephaven.engine.rowset.impl.singlerange.SingleRange; +import io.deephaven.engine.rowset.impl.sortedranges.SortedRanges; import io.deephaven.util.annotations.TestUseOnly; public class OrderedLongSetBuilderSequential extends RspBitmapBuilderSequential { diff --git a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/RspBitmapBuilderSequential.java b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/RspBitmapBuilderSequential.java index 336f5be99ef..f3bff5ab81e 100644 --- a/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/RspBitmapBuilderSequential.java +++ b/engine/rowset/src/main/java/io/deephaven/engine/rowset/impl/RspBitmapBuilderSequential.java @@ -3,8 +3,10 @@ */ package io.deephaven.engine.rowset.impl; +import io.deephaven.chunk.LongChunk; +import io.deephaven.chunk.util.LongChunkIterator; import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.impl.OrderedLongSet; +import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.rowset.impl.rsp.DisposableRspBitmap; import io.deephaven.engine.rowset.impl.rsp.RspArray; import io.deephaven.engine.rowset.impl.rsp.RspBitmap; @@ -119,6 +121,68 @@ public void appendOrderedLongSet(final long shiftAmount, final OrderedLongSet ix rb.appendShiftedUnsafeNoWriteCheck(shiftAmount, (RspBitmap) ix, acquire); } + @Override + public void appendOrderedRowKeysChunk(LongChunk chunk, int offset, int length) { + if (length == 0) { + return; + } + + if (rb != null) { + appendKeyChunkRb(chunk, offset, length); + } else { + appendKeyChunk(chunk, offset, length); + } + } + + private void appendKeyChunkRb(LongChunk chunk, int offset, int length) { + // flush to the rb before appending + if (pendingStart != -1) { + flushPendingRange(); + } + if (pendingContainerKey != -1) { + flushPendingContainer(); + } + + // single key? + if (length == 1) { + rb.appendUnsafeNoWriteCheck(chunk.get(offset)); + return; + } + + // single range? + final int lastOffsetInclusive = offset + length - 1; + final long first = chunk.get(offset); + final long last = chunk.get(lastOffsetInclusive); + if (last - first + 1 == length) { + rb.appendRangeUnsafeNoWriteCheck(first, last); + return; + } + + rb.addValuesUnsafeNoWriteCheck(chunk, offset, length); + } + + private void appendKeyChunk(LongChunk chunk, int offset, int length) { + // single key? + if (length == 1) { + appendKey(chunk.get(offset)); + return; + } + + // single range? + final int lastOffsetInclusive = offset + length - 1; + final long first = chunk.get(offset); + final long last = chunk.get(lastOffsetInclusive); + if (last - first + 1 == length) { + appendRange(first, last); + return; + } + + final LongChunkIterator it = new LongChunkIterator(chunk, offset, length); + while (it.hasNext()) { + appendKey(it.nextLong()); + } + } + protected void flushPendingRange() { final long pendingStartOnEntry = pendingStart; pendingStart = -1; From 58f5cccffeba2087307ca040c1ebebff7001cbb0 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Mon, 19 Sep 2022 11:48:59 -0400 Subject: [PATCH 131/215] Bump web version v0.17.0 (#2864) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.17.0 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 9e20265fcf2..498d26b891a 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.16.0 +ARG WEB_VERSION=0.17.0 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 322f79d2038245123feba2c4f6537007ce2cae62 Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Mon, 19 Sep 2022 14:56:27 -0700 Subject: [PATCH 132/215] Update `PartitionTable` to use `RowSetBuilder` instead of `RowSet.insert()` (#2852) * updated PT to use builders * bugfix, re-scope setter for initialized flag * ported Builder improvements * PR comments round 1 addressed * add'l PR comments addressed * extracted the local class to allow general usage --- .../impl/PrecomputedRowSetBuilderRandom.java | 50 +++ .../impl/by/PartitionByChunkedOperator.java | 291 ++++++++++++------ 2 files changed, 243 insertions(+), 98 deletions(-) create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/PrecomputedRowSetBuilderRandom.java diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/PrecomputedRowSetBuilderRandom.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrecomputedRowSetBuilderRandom.java new file mode 100644 index 00000000000..cecaaefa74d --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/PrecomputedRowSetBuilderRandom.java @@ -0,0 +1,50 @@ +package io.deephaven.engine.table.impl; + +import io.deephaven.engine.rowset.RowSetBuilderRandom; +import io.deephaven.engine.rowset.WritableRowSet; +import io.deephaven.engine.table.impl.by.PartitionByChunkedOperator; +import org.jetbrains.annotations.NotNull; + +/** + * This is a niche class that allows an existing {@link WritableRowSet rowset} to masquerade as a + * {@link RowSetBuilderRandom} for the sake of efficient processing. + * + * General usage would embed this in a collection with actual {@link RowSetBuilderRandom} and process all items + * similarly. See + * {@link PartitionByChunkedOperator#appendShifts(io.deephaven.chunk.LongChunk, io.deephaven.chunk.LongChunk, int, int, long)} + * and {@link PartitionByChunkedOperator#extractAndClearBuilderRandom(io.deephaven.chunk.WritableObjectChunk, int)} for + * an example. + */ + +public class PrecomputedRowSetBuilderRandom implements RowSetBuilderRandom { + WritableRowSet rowSet; + + private PrecomputedRowSetBuilderRandom(@NotNull final WritableRowSet rowSet) { + this.rowSet = rowSet; + } + + @Override + public WritableRowSet build() { + if (rowSet == null) { + throw new IllegalStateException("PrecomputedRowSetBuilderRandom - build() already called)"); + } + // make sure to release our reference to the rowset after `build()` is called + WritableRowSet tmp = rowSet; + rowSet = null; + return tmp; + } + + @Override + public void addKey(long rowKey) { + throw new UnsupportedOperationException("PrecomputedRowSetBuilderRandom does not allow modifications)"); + } + + @Override + public void addRange(long firstRowKey, long lastRowKey) { + throw new UnsupportedOperationException("PrecomputedRowSetBuilderRandom does not allow modifications"); + } + + public static PrecomputedRowSetBuilderRandom createFromRowSet(@NotNull final WritableRowSet rowSet) { + return new PrecomputedRowSetBuilderRandom(rowSet); + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java index c9bd43f3c89..e12f155c060 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java @@ -17,15 +17,10 @@ import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.liveness.LivenessReferent; import io.deephaven.engine.liveness.LivenessScopeStack; -import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.RowSet; -import io.deephaven.engine.rowset.RowSetFactory; -import io.deephaven.engine.rowset.RowSetShiftData; -import io.deephaven.engine.rowset.WritableRowSet; +import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.rowset.impl.AdaptiveOrderedLongSetBuilderRandom; -import io.deephaven.engine.rowset.impl.OrderedLongSet; import io.deephaven.engine.rowset.impl.WritableRowSetImpl; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.ColumnSource; @@ -34,6 +29,7 @@ import io.deephaven.engine.table.TableListener; import io.deephaven.engine.table.TableUpdate; import io.deephaven.engine.table.impl.ConstituentDependency; +import io.deephaven.engine.table.impl.PrecomputedRowSetBuilderRandom; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.TableUpdateImpl; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; @@ -58,11 +54,17 @@ public final class PartitionByChunkedOperator implements IterativeChunkedAggrega // region nonexistent table sentinels /** - * Sentinel value for the row set belonging to a table that was never created because either the result table was no - * longer live or the aggregation update listener was no longer live. Should be used for assignment and reference - * equality tests, only. + * Sentinel value for the row set builders belonging to a table that was never created because either the result + * table was no longer live or the aggregation update listener was no longer live. Should be used for assignment and + * reference equality tests, only. + */ + private static final RowSetBuilderRandom NONEXISTENT_TABLE_ROW_SET_BUILDER = RowSetFactory.builderRandom(); + + /** + * Helper value for the following sentinel values but not used directly for comparison */ private static final WritableRowSet NONEXISTENT_TABLE_ROW_SET = RowSetFactory.empty(); + /** * Sentinel value for the shift builder belonging to a table that was never created because either the result table * was no longer live or the aggregation update listener was no longer live. Should be used for assignment and @@ -90,13 +92,16 @@ public interface AttributeCopier { private final String callSite; private final ObjectArraySource tables; - private final ObjectArraySource addedRowSets; - private final ObjectArraySource removedRowSets; - private final ObjectArraySource modifiedRowSets; + private final ObjectArraySource addedBuilders; + private final ObjectArraySource removedBuilders; + private final ObjectArraySource modifiedBuilders; + private final ObjectArraySource shiftDataBuilders; private final ModifiedColumnSet resultModifiedColumnSet; private final ModifiedColumnSet.Transformer upstreamToResultTransformer; + private boolean initialized; + private volatile Table resultTable; private volatile LivenessReferent aggregationUpdateListener; @@ -139,11 +144,12 @@ public interface AttributeCopier { @NotNull final String... keyColumnNames) { this.parentTable = parentTable; this.resultName = resultName; + initialized = false; callSite = QueryPerformanceRecorder.getCallerLine(); tables = new ObjectArraySource<>(QueryTable.class); - addedRowSets = new ObjectArraySource<>(WritableRowSet.class); + addedBuilders = new ObjectArraySource<>(Object.class); // Note: Sub-tables always share their ColumnSource map with the parent table, so they can all use this result // MCS. @@ -158,8 +164,8 @@ public interface AttributeCopier { } if (parentTable.isRefreshing()) { - removedRowSets = new ObjectArraySource<>(WritableRowSet.class); - modifiedRowSets = new ObjectArraySource<>(WritableRowSet.class); + removedBuilders = new ObjectArraySource<>(Object.class); + modifiedBuilders = new ObjectArraySource<>(Object.class); shiftDataBuilders = new ObjectArraySource<>(RowSetShiftData.SmartCoalescingBuilder.class); final Set keyColumnNameSet = Arrays.stream(keyColumnNames).collect(Collectors.toSet()); @@ -177,8 +183,8 @@ public interface AttributeCopier { retainedResultColumnNames, retainedResultModifiedColumnSets); } else { - removedRowSets = null; - modifiedRowSets = null; + removedBuilders = null; + modifiedBuilders = null; shiftDataBuilders = null; upstreamToResultTransformer = null; } @@ -199,7 +205,14 @@ public void addChunk(final BucketedContext bucketedContext, final Chunk inputRowKeysAsOrdered = (LongChunk) inputRowKeys; - accumulateToRowSet(addedRowSets, inputRowKeysAsOrdered, 0, chunkSize, destination); + if (!initialized) { + accumulateToBuilderSequential(addedBuilders, inputRowKeysAsOrdered, 0, chunkSize, destination); + } else { + accumulateToBuilderRandom(addedBuilders, inputRowKeysAsOrdered, 0, chunkSize, destination); + } if (stepUpdatedDestinations != null) { stepUpdatedDestinations.insert(destination); } @@ -315,7 +334,11 @@ public boolean addChunk(final SingletonContext singletonContext, final int chunk @Override public boolean addRowSet(SingletonContext context, RowSet rowSet, long destination) { - accumulateToRowSet(addedRowSets, rowSet, destination); + if (!initialized) { + accumulateToBuilderSequential(addedBuilders, rowSet, destination); + } else { + accumulateToBuilderRandom(addedBuilders, rowSet, destination); + } if (stepUpdatedDestinations != null) { stepUpdatedDestinations.insert(destination); } @@ -330,7 +353,7 @@ public boolean removeChunk(final SingletonContext singletonContext, final int ch Assert.neqNull(stepUpdatedDestinations, "stepUpdatedDestinations"); // noinspection unchecked final LongChunk inputRowKeysAsOrdered = (LongChunk) inputRowKeys; - accumulateToRowSet(removedRowSets, inputRowKeysAsOrdered, 0, chunkSize, destination); + accumulateToBuilderRandom(removedBuilders, inputRowKeysAsOrdered, 0, chunkSize, destination); stepUpdatedDestinations.insert(destination); return false; } @@ -367,39 +390,76 @@ public boolean modifyRowKeys(final SingletonContext context, @NotNull final Long } // noinspection unchecked final LongChunk rowKeysAsOrdered = (LongChunk) rowKeys; - accumulateToRowSet(modifiedRowSets, rowKeysAsOrdered, 0, rowKeys.size(), destination); + accumulateToBuilderRandom(modifiedBuilders, rowKeysAsOrdered, 0, rowKeys.size(), destination); stepUpdatedDestinations.insert(destination); return false; } - private static void accumulateToRowSet(@NotNull final ObjectArraySource rowSetColumn, + private static void accumulateToBuilderSequential( + @NotNull final ObjectArraySource rowSetColumn, + @NotNull final LongChunk rowKeysToAdd, + final int start, final int length, final long destination) { + final RowSetBuilderSequential builder = (RowSetBuilderSequential) rowSetColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with these keys + final RowSetBuilderSequential newBuilder = RowSetFactory.builderSequential(); + newBuilder.appendOrderedRowKeysChunk(rowKeysToAdd, start, length); + rowSetColumn.set(destination, newBuilder); + return; + } + // add the keys to the stored builder + builder.appendOrderedRowKeysChunk(rowKeysToAdd, start, length); + } + + private static void accumulateToBuilderSequential( + @NotNull final ObjectArraySource rowSetColumn, + @NotNull final RowSet rowSetToAdd, final long destination) { + final RowSetBuilderSequential builder = (RowSetBuilderSequential) rowSetColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with this rowset + final RowSetBuilderSequential newBuilder = RowSetFactory.builderSequential(); + newBuilder.appendRowSequence(rowSetToAdd); + rowSetColumn.set(destination, newBuilder); + return; + } + // add the rowset to the stored builder + builder.appendRowSequence(rowSetToAdd); + } + + + private static void accumulateToBuilderRandom(@NotNull final ObjectArraySource rowSetColumn, @NotNull final LongChunk rowKeysToAdd, final int start, final int length, final long destination) { - final WritableRowSet rowSet = rowSetColumn.getUnsafe(destination); - if (rowSet == NONEXISTENT_TABLE_ROW_SET) { + final RowSetBuilderRandom builder = (RowSetBuilderRandom) rowSetColumn.getUnsafe(destination); + if (builder == NONEXISTENT_TABLE_ROW_SET_BUILDER) { return; } - if (rowSet == null) { - rowSetColumn.set(destination, - new WritableRowSetImpl(OrderedLongSet.fromChunk(rowKeysToAdd, start, length, false))); + if (builder == null) { + // create (and store) a new builder, fill with these keys + final RowSetBuilderRandom newBuilder = RowSetFactory.builderRandom(); + newBuilder.addOrderedRowKeysChunk(rowKeysToAdd, start, length); + rowSetColumn.set(destination, newBuilder); return; } - rowSet.insert(rowKeysToAdd, start, length); + // add the keys to the stored builder + builder.addOrderedRowKeysChunk(rowKeysToAdd, start, length); } - private static void accumulateToRowSet(@NotNull final ObjectArraySource rowSetColumn, + private static void accumulateToBuilderRandom(@NotNull final ObjectArraySource rowSetColumn, @NotNull final RowSet rowSetToAdd, final long destination) { - final WritableRowSet rowSet = rowSetColumn.getUnsafe(destination); - if (rowSet == NONEXISTENT_TABLE_ROW_SET) { + final RowSetBuilderRandom builder = (RowSetBuilderRandom) rowSetColumn.getUnsafe(destination); + if (builder == NONEXISTENT_TABLE_ROW_SET_BUILDER) { return; } - if (rowSet == null) { - final WritableRowSet currentRowSet = RowSetFactory.empty(); - currentRowSet.insert(rowSetToAdd); - rowSetColumn.set(destination, currentRowSet); + if (builder == null) { + // create (and store) a new builder, fill with this rowset + final RowSetBuilderRandom newBuilder = RowSetFactory.builderRandom(); + newBuilder.addRowSet(rowSetToAdd); + rowSetColumn.set(destination, newBuilder); return; } - rowSet.insert(rowSetToAdd); + // add the rowset to the stored builder + builder.addRowSet(rowSetToAdd); } private boolean appendShifts(@NotNull final LongChunk preShiftRowKeys, @@ -411,12 +471,18 @@ private boolean appendShifts(@NotNull final LongChunk preShif } if (builder == null) { final RowSet tableRowSet = tables.getUnsafe(destination).getRowSet(); - final RowSet removedRowSet = removedRowSets.getUnsafe(destination); + final RowSetBuilderRandom removedRowSetBuilder = + (RowSetBuilderRandom) removedBuilders.getUnsafe(destination); final RowSet preShiftKeys; - if (removedRowSet == null) { + if (removedRowSetBuilder == null) { preShiftKeys = tableRowSet.copy(); } else { - preShiftKeys = tableRowSet.minus(removedRowSet); + final WritableRowSet rs = removedRowSetBuilder.build(); + preShiftKeys = tableRowSet.minus(rs); + + // no future modifications are expected, replace the exhausted builder with a dummy for compatibility + RowSetBuilderRandom newBuilder = PrecomputedRowSetBuilderRandom.createFromRowSet(rs); + removedBuilders.set(destination, newBuilder); } shiftDataBuilders.set(destination, builder = new RowSetShiftData.SmartCoalescingBuilder(preShiftKeys)); } @@ -446,10 +512,10 @@ private boolean appendShifts(@NotNull final LongChunk preShif @Override public void ensureCapacity(final long tableSize) { tables.ensureCapacity(tableSize); - addedRowSets.ensureCapacity(tableSize); + addedBuilders.ensureCapacity(tableSize); if (parentTable.isRefreshing()) { - removedRowSets.ensureCapacity(tableSize); - modifiedRowSets.ensureCapacity(tableSize); + removedBuilders.ensureCapacity(tableSize); + modifiedBuilders.ensureCapacity(tableSize); shiftDataBuilders.ensureCapacity(tableSize); } } @@ -464,6 +530,7 @@ public void startTrackingPrevValues() {} @Override public void propagateInitialState(@NotNull final QueryTable resultTable) { + Assert.neqTrue(initialized, "initialized"); final RowSet initialDestinations = resultTable.getRowSet(); if (initialDestinations.isNonempty()) { // This is before resultTable and aggregationUpdateListener are set (if they will be). We're still in our @@ -471,7 +538,7 @@ public void propagateInitialState(@NotNull final QueryTable resultTable) { final boolean setCallSite = QueryPerformanceRecorder.setCallsite(callSite); try (final ResettableWritableObjectChunk tablesResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk addedRowSetsResettableChunk = + final ResettableWritableObjectChunk addedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); final RowSequence.Iterator initialDestinationsIterator = initialDestinations.getRowSequenceIterator()) { @@ -480,14 +547,15 @@ public void propagateInitialState(@NotNull final QueryTable resultTable) { final WritableObjectChunk tablesBackingChunk = tablesResettableChunk.asWritableObjectChunk(); // noinspection unchecked - final WritableObjectChunk addedRowSetsBackingChunk = - addedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); while (initialDestinationsIterator.hasMore()) { final long firstSliceDestination = initialDestinationsIterator.peekNextKey(); final long firstBackingChunkDestination = tables.resetWritableChunkToBackingStore(tablesResettableChunk, firstSliceDestination); - addedRowSets.resetWritableChunkToBackingStore(addedRowSetsResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, + firstSliceDestination); final long lastBackingChunkDestination = firstBackingChunkDestination + tablesBackingChunk.size() - 1; final RowSequence initialDestinationsSlice = @@ -496,8 +564,9 @@ public void propagateInitialState(@NotNull final QueryTable resultTable) { initialDestinationsSlice.forAllRowKeys((final long destinationToInitialize) -> { final int backingChunkOffset = Math.toIntExact(destinationToInitialize - firstBackingChunkDestination); + // we use sequential builders during initialization final WritableRowSet initialRowSet = - extractAndClearRowSet(addedRowSetsBackingChunk, backingChunkOffset); + extractAndClearBuilderSequential(addedBuildersBackingChunk, backingChunkOffset); final QueryTable newTable = makeSubTable(initialRowSet); tablesBackingChunk.set(backingChunkOffset, newTable); }); @@ -508,6 +577,7 @@ public void propagateInitialState(@NotNull final QueryTable resultTable) { } } } + initialized = true; } @Override @@ -582,7 +652,7 @@ private void propagateResurrectedDestinations(@NotNull final RowSequence resurre } try (final ResettableWritableObjectChunk tablesResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk addedRowSetsResettableChunk = + final ResettableWritableObjectChunk addedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); final RowSequence.Iterator resurrectedDestinationsIterator = resurrectedDestinations.getRowSequenceIterator()) { @@ -591,14 +661,15 @@ private void propagateResurrectedDestinations(@NotNull final RowSequence resurre // noinspection unchecked final ObjectChunk tablesBackingChunk = tablesResettableChunk.asObjectChunk(); // noinspection unchecked - final WritableObjectChunk addedRowSetsBackingChunk = - addedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); while (resurrectedDestinationsIterator.hasMore()) { final long firstSliceDestination = resurrectedDestinationsIterator.peekNextKey(); final long firstBackingChunkDestination = tables.resetWritableChunkToBackingStore(tablesResettableChunk, firstSliceDestination); - addedRowSets.resetWritableChunkToBackingStore(addedRowSetsResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, + firstSliceDestination); final long lastBackingChunkDestination = firstBackingChunkDestination + tablesBackingChunk.size() - 1; final RowSequence resurrectedDestinationsSlice = resurrectedDestinationsIterator.getNextRowSequenceThrough(lastBackingChunkDestination); @@ -620,7 +691,8 @@ private void propagateResurrectedDestinations(@NotNull final RowSequence resurre final TableUpdateImpl downstream = new TableUpdateImpl(); - downstream.added = nullToEmpty(extractAndClearRowSet(addedRowSetsBackingChunk, backingChunkOffset)); + downstream.added = + nullToEmpty(extractAndClearBuilderRandom(addedBuildersBackingChunk, backingChunkOffset)); downstream.removed = RowSetFactory.empty(); downstream.modified = RowSetFactory.empty(); downstream.shifted = RowSetShiftData.EMPTY; @@ -646,11 +718,11 @@ private void propagateNewDestinations(@NotNull final RowSequence newDestinations final boolean setCallSite = QueryPerformanceRecorder.setCallsite(callSite); try (final ResettableWritableObjectChunk tablesResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk addedRowSetsResettableChunk = + final ResettableWritableObjectChunk addedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk removedRowSetsResettableChunk = + final ResettableWritableObjectChunk removedBuildersResettableChunk = allowCreation ? null : ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk modifiedRowSetsResettableChunk = + final ResettableWritableObjectChunk modifiedBuildersResettableChunk = allowCreation ? null : ResettableWritableObjectChunk.makeResettableChunk(); final ResettableWritableObjectChunk shiftDataBuildersResettableChunk = allowCreation ? null : ResettableWritableObjectChunk.makeResettableChunk(); @@ -660,14 +732,14 @@ private void propagateNewDestinations(@NotNull final RowSequence newDestinations final WritableObjectChunk tablesBackingChunk = tablesResettableChunk.asWritableObjectChunk(); // noinspection unchecked - final WritableObjectChunk addedRowSetsBackingChunk = - addedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); // noinspection unchecked - final WritableObjectChunk removedRowSetsBackingChunk = - allowCreation ? null : removedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk removedBuildersBackingChunk = + allowCreation ? null : removedBuildersResettableChunk.asWritableObjectChunk(); // noinspection unchecked - final WritableObjectChunk modifiedRowSetsBackingChunk = - allowCreation ? null : modifiedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk modifiedBuildersBackingChunk = + allowCreation ? null : modifiedBuildersResettableChunk.asWritableObjectChunk(); // noinspection unchecked final WritableObjectChunk shiftDataBuildersBackingChunk = allowCreation ? null : shiftDataBuildersResettableChunk.asWritableObjectChunk(); @@ -676,11 +748,12 @@ private void propagateNewDestinations(@NotNull final RowSequence newDestinations final long firstSliceDestination = newDestinationsIterator.peekNextKey(); final long firstBackingChunkDestination = tables.resetWritableChunkToBackingStore(tablesResettableChunk, firstSliceDestination); - addedRowSets.resetWritableChunkToBackingStore(addedRowSetsResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, + firstSliceDestination); if (!allowCreation) { - removedRowSets.resetWritableChunkToBackingStore(removedRowSetsResettableChunk, + removedBuilders.resetWritableChunkToBackingStore(removedBuildersResettableChunk, firstSliceDestination); - modifiedRowSets.resetWritableChunkToBackingStore(modifiedRowSetsResettableChunk, + modifiedBuilders.resetWritableChunkToBackingStore(modifiedBuildersResettableChunk, firstSliceDestination); shiftDataBuilders.resetWritableChunkToBackingStore(shiftDataBuildersResettableChunk, firstSliceDestination); @@ -693,16 +766,16 @@ private void propagateNewDestinations(@NotNull final RowSequence newDestinations final int backingChunkOffset = Math.toIntExact(newDestination - firstBackingChunkDestination); if (allowCreation) { final WritableRowSet newRowSet = - extractAndClearRowSet(addedRowSetsBackingChunk, backingChunkOffset); + extractAndClearBuilderRandom(addedBuildersBackingChunk, backingChunkOffset); final QueryTable newTable = makeSubTable(newRowSet); linkTableReferences(newTable); tablesBackingChunk.set(backingChunkOffset, newTable); } else { // We will never try to create this table again, or accumulate further state for it. tablesBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE); - addedRowSetsBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET); - removedRowSetsBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET); - modifiedRowSetsBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET); + addedBuildersBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET_BUILDER); + removedBuildersBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET_BUILDER); + modifiedBuildersBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_ROW_SET_BUILDER); shiftDataBuildersBackingChunk.set(backingChunkOffset, NONEXISTENT_TABLE_SHIFT_BUILDER); } }); @@ -734,7 +807,7 @@ private void propagateUpdatesToRemovedDestinations(@NotNull final RowSequence re } try (final ResettableWritableObjectChunk tablesResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk removedRowSetsResettableChunk = + final ResettableWritableObjectChunk removedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); final RowSequence.Iterator removedDestinationsIterator = removedDestinations.getRowSequenceIterator()) { // Destinations that were completely removed can't have any additions, modifications, or shifts. @@ -742,14 +815,15 @@ private void propagateUpdatesToRemovedDestinations(@NotNull final RowSequence re // noinspection unchecked final ObjectChunk tablesBackingChunk = tablesResettableChunk.asObjectChunk(); // noinspection unchecked - final WritableObjectChunk removedRowSetsBackingChunk = - removedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk removedBuildersBackingChunk = + removedBuildersResettableChunk.asWritableObjectChunk(); while (removedDestinationsIterator.hasMore()) { final long firstSliceDestination = removedDestinationsIterator.peekNextKey(); final long firstBackingChunkDestination = tables.resetWritableChunkToBackingStore(tablesResettableChunk, firstSliceDestination); - removedRowSets.resetWritableChunkToBackingStore(removedRowSetsResettableChunk, firstSliceDestination); + removedBuilders.resetWritableChunkToBackingStore(removedBuildersResettableChunk, + firstSliceDestination); final long lastBackingChunkDestination = firstBackingChunkDestination + tablesBackingChunk.size() - 1; final RowSequence removedDestinationsSlice = removedDestinationsIterator.getNextRowSequenceThrough(lastBackingChunkDestination); @@ -769,7 +843,7 @@ private void propagateUpdatesToRemovedDestinations(@NotNull final RowSequence re downstream.added = RowSetFactory.empty(); downstream.removed = - nullToEmpty(extractAndClearRowSet(removedRowSetsBackingChunk, backingChunkOffset)); + nullToEmpty(extractAndClearBuilderRandom(removedBuildersBackingChunk, backingChunkOffset)); downstream.modified = RowSetFactory.empty(); downstream.shifted = RowSetShiftData.EMPTY; downstream.modifiedColumnSet = ModifiedColumnSet.EMPTY; @@ -789,11 +863,11 @@ private void propagateUpdatesToModifiedDestinations(@NotNull final RowSequence m } try (final ResettableWritableObjectChunk tablesResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk addedRowSetsResettableChunk = + final ResettableWritableObjectChunk addedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk removedRowSetsResettableChunk = + final ResettableWritableObjectChunk removedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); - final ResettableWritableObjectChunk modifiedRowSetsResettableChunk = + final ResettableWritableObjectChunk modifiedBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); final ResettableWritableObjectChunk shiftDataBuildersResettableChunk = ResettableWritableObjectChunk.makeResettableChunk(); @@ -803,14 +877,15 @@ private void propagateUpdatesToModifiedDestinations(@NotNull final RowSequence m // noinspection unchecked final ObjectChunk tablesBackingChunk = tablesResettableChunk.asObjectChunk(); // noinspection unchecked - final WritableObjectChunk addedRowSetsBackingChunk = - addedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); + // noinspection unchecked - final WritableObjectChunk removedRowSetsBackingChunk = - removedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk removedBuildersBackingChunk = + removedBuildersResettableChunk.asWritableObjectChunk(); // noinspection unchecked - final WritableObjectChunk modifiedRowSetsBackingChunk = - modifiedRowSetsResettableChunk.asWritableObjectChunk(); + final WritableObjectChunk modifiedBuildersBackingChunk = + modifiedBuildersResettableChunk.asWritableObjectChunk(); // noinspection unchecked final WritableObjectChunk shiftDataBuildersBackingChunk = shiftDataBuildersResettableChunk.asWritableObjectChunk(); @@ -820,9 +895,12 @@ private void propagateUpdatesToModifiedDestinations(@NotNull final RowSequence m final long firstBackingChunkDestination = tables.resetWritableChunkToBackingStore(tablesResettableChunk, firstSliceDestination); // The (valid) assumption is that the other write-through resets will address the same range. - addedRowSets.resetWritableChunkToBackingStore(addedRowSetsResettableChunk, firstSliceDestination); - removedRowSets.resetWritableChunkToBackingStore(removedRowSetsResettableChunk, firstSliceDestination); - modifiedRowSets.resetWritableChunkToBackingStore(modifiedRowSetsResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, + firstSliceDestination); + removedBuilders.resetWritableChunkToBackingStore(removedBuildersResettableChunk, + firstSliceDestination); + modifiedBuilders.resetWritableChunkToBackingStore(modifiedBuildersResettableChunk, + firstSliceDestination); shiftDataBuilders.resetWritableChunkToBackingStore(shiftDataBuildersResettableChunk, firstSliceDestination); final long lastBackingChunkDestination = firstBackingChunkDestination + tablesBackingChunk.size() - 1; @@ -842,11 +920,13 @@ private void propagateUpdatesToModifiedDestinations(@NotNull final RowSequence m final TableUpdateImpl downstream = new TableUpdateImpl(); - downstream.added = nullToEmpty(extractAndClearRowSet(addedRowSetsBackingChunk, backingChunkOffset)); + downstream.added = + nullToEmpty(extractAndClearBuilderRandom(addedBuildersBackingChunk, backingChunkOffset)); downstream.removed = - nullToEmpty(extractAndClearRowSet(removedRowSetsBackingChunk, backingChunkOffset)); + nullToEmpty(extractAndClearBuilderRandom(removedBuildersBackingChunk, backingChunkOffset)); downstream.modified = stepValuesModified - ? nullToEmpty(extractAndClearRowSet(modifiedRowSetsBackingChunk, backingChunkOffset)) + ? nullToEmpty( + extractAndClearBuilderRandom(modifiedBuildersBackingChunk, backingChunkOffset)) : RowSetFactory.empty(); downstream.shifted = extractAndClearShiftDataBuilder(shiftDataBuildersBackingChunk, backingChunkOffset); @@ -871,15 +951,30 @@ private void propagateUpdatesToModifiedDestinations(@NotNull final RowSequence m } } - private static WritableRowSet extractAndClearRowSet( - @NotNull final WritableObjectChunk rowSetChunk, + private static WritableRowSet extractAndClearBuilderRandom( + @NotNull final WritableObjectChunk builderChunk, + final int offset) { + final RowSetBuilderRandom builder = builderChunk.get(offset); + Assert.neq(builder, "builder", NONEXISTENT_TABLE_ROW_SET_BUILDER, + "NONEXISTENT_TABLE_ROW_SET_BUILDER"); + if (builder != null) { + final WritableRowSet rowSet = builder.build(); + builderChunk.set(offset, null); + return rowSet; + } + return null; + } + + private static WritableRowSet extractAndClearBuilderSequential( + @NotNull final WritableObjectChunk builderChunk, final int offset) { - final WritableRowSet rowSet = rowSetChunk.get(offset); - Assert.neq(rowSet, "rowSet", NONEXISTENT_TABLE_ROW_SET, "NONEXISTENT_TABLE_ROW_SET"); - if (rowSet != null) { - rowSetChunk.set(offset, null); + final RowSetBuilderSequential builder = builderChunk.get(offset); + if (builder != null) { + final WritableRowSet rowSet = builder.build(); + builderChunk.set(offset, null); + return rowSet; } - return rowSet; + return null; } private static RowSet nullToEmpty(@Nullable final RowSet rowSet) { From 645adb0a71215c7257c09e639a776fdd8d51f901 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Mon, 19 Sep 2022 18:13:31 -0400 Subject: [PATCH 133/215] Fix the table used for state manager sizing in ticking left + static right NJ when building from right (#2877) --- .../java/io/deephaven/engine/table/impl/NaturalJoinHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java index 04512cd1586..cef2ddc91c3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java @@ -258,7 +258,7 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT final StaticHashedNaturalJoinStateManager jsm = USE_TYPED_STATE_MANAGER ? TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, bucketingContext.leftSources, bucketingContext.originalLeftSources, - control.tableSizeForRightBuild(leftTable), + control.tableSizeForRightBuild(rightTable), control.getMaximumLoadFactor(), control.getTargetLoadFactor()) : new StaticChunkedNaturalJoinStateManager(bucketingContext.leftSources, control.tableSizeForRightBuild(rightTable), bucketingContext.originalLeftSources); From f564b7a6db86666ac06510085bbf8a6a665ae918 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Mon, 19 Sep 2022 21:10:16 -0600 Subject: [PATCH 134/215] Netty fix bind to port races (#2879) - enable SO_REUSEADDR - let kernel pick a free port for use --- .../java/io/deephaven/server/netty/NettyServerModule.java | 3 +++ .../io/deephaven/server/netty/NettyFlightRoundTripTest.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java index 51e95cebc1c..2e440809759 100644 --- a/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java +++ b/server/netty/src/main/java/io/deephaven/server/netty/NettyServerModule.java @@ -18,6 +18,7 @@ import io.grpc.ServerInterceptor; import io.grpc.netty.GrpcSslContexts; import io.grpc.netty.NettyServerBuilder; +import io.netty.channel.ChannelOption; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SupportedCipherSuiteFilter; import nl.altindag.ssl.SSLFactory; @@ -45,6 +46,8 @@ static GrpcServer serverBuilder( } else { serverBuilder = NettyServerBuilder.forPort(serverConfig.port()); } + serverBuilder.withOption(ChannelOption.SO_REUSEADDR, true); + services.forEach(serverBuilder::addService); interceptors.forEach(serverBuilder::intercept); serverBuilder.intercept(MTlsCertificate.DEFAULT_INTERCEPTOR); diff --git a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java index 32901a5b879..f6a99980707 100644 --- a/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java +++ b/server/netty/src/test/java/io/deephaven/server/netty/NettyFlightRoundTripTest.java @@ -20,7 +20,9 @@ public class NettyFlightRoundTripTest extends FlightMessageRoundTripTest { public interface NettyTestConfig { @Provides static NettyConfig providesNettyConfig() { - return NettyConfig.defaultConfig(); + return NettyConfig.builder() + .port(0) + .build(); } } From 1233561f0a20691e20c12e53caae77561a2e2e19 Mon Sep 17 00:00:00 2001 From: Chip Kent <5250374+chipkent@users.noreply.github.com> Date: Tue, 20 Sep 2022 08:50:26 -0600 Subject: [PATCH 135/215] Add a vectorized ternary if to the query library. (#2876) * Add a vectorized ternary if to the query library. * Rerun static import generator. * Address review comments * Address review comments --- engine/function/src/templates/Basic.ftl | 139 ++++++++++++++++++ engine/function/src/templates/TestBasic.ftl | 72 +++++++++ .../deephaven/libs/GroovyStaticImports.java | 48 ++++++ 3 files changed, 259 insertions(+) diff --git a/engine/function/src/templates/Basic.ftl b/engine/function/src/templates/Basic.ftl index 7297137afac..72f47439b52 100644 --- a/engine/function/src/templates/Basic.ftl +++ b/engine/function/src/templates/Basic.ftl @@ -684,6 +684,77 @@ public class Basic { return NULL_LONG; } + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return trueCase value if condition is true, falseCase value if condition is false, or null if condition is null. + */ + public static T ifelseObj(Boolean condition, T trueCase, T falseCase) { + if (condition == null) { + return null; + } + + return condition ? trueCase : falseCase; + } + + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. + * The result element will be the trueCase element if the condition element is true; + * the falseCase element if the condition element is false; or null if the condition element is null. + * Returns null if any of the inputs is null. + */ + public static T[] ifelseObj(BooleanVector condition, ObjectVector trueCase, ObjectVector falseCase) { + if (condition == null || trueCase == null || falseCase == null) { + return null; + } + + final int n_c = condition.intSize("condition"); + final int n_t = trueCase.intSize("trueCase"); + final int n_f = falseCase.intSize("falseCase"); + + if (n_c != n_t || n_c != n_f) { + throw new IllegalArgumentException("Inconsistent input sizes: condition=" + n_c + " trueCase=" + n_t + " falseCase=" + n_f); + } + + if (!trueCase.getComponentType().equals(falseCase.getComponentType())) { + throw new IllegalArgumentException("Input vectors have different element types. trueCase=" + trueCase.getComponentType() + " falseCase=" + falseCase.getComponentType()); + } + + @SuppressWarnings("unchecked") final T[] result = (T[])Array.newInstance(trueCase.getComponentType(), n_c); + + for (int i=0; i < n_c; i++) { + result[i] = condition.get(i) == null ? null : (condition.get(i) ? trueCase.get(i) : falseCase.get(i)); + } + + return result; + } + + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. + * The result element will be the trueCase element if the condition element is true; + * the falseCase element if the condition element is false; or null if the condition element is null. + * Returns null if any of the inputs is null. + */ + public static T[] ifelseObj(Boolean[] condition, T[] trueCase, T[] falseCase) { + if (condition == null || trueCase == null || falseCase == null) { + return null; + } + + return ifelseObj(new BooleanVectorDirect(condition), new ObjectVectorDirect(trueCase), new ObjectVectorDirect(falseCase)); + } <#list primitiveTypes as pt> <#if !pt.valueType.isBoolean > @@ -1402,6 +1473,74 @@ public class Basic { return NULL_LONG; } + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null. + */ + public static ${pt.primitive} ifelse(Boolean condition, ${pt.primitive} trueCase, ${pt.primitive} falseCase) { + if (condition == null) { + return ${pt.null}; + } + + return condition ? trueCase : falseCase; + } + + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return An array of ${pt.primitive} whose values are determined by the corresponding elements of condition, trueCase, and falseCase. + * The result element will be the trueCase element if the condition element is true; + * the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. + * Returns null if any of the inputs is null. + */ + public static ${pt.primitive}[] ifelse(BooleanVector condition, ${pt.dbArray} trueCase, ${pt.dbArray} falseCase) { + if (condition == null || trueCase == null || falseCase == null) { + return null; + } + + final int n_c = condition.intSize("condition"); + final int n_t = trueCase.intSize("trueCase"); + final int n_f = falseCase.intSize("falseCase"); + + if (n_c != n_t || n_c != n_f) { + throw new IllegalArgumentException("Inconsistent input sizes: condition=" + n_c + " trueCase=" + n_t + " falseCase=" + n_f); + } + + final ${pt.primitive}[] result = new ${pt.primitive}[n_c]; + + for (int i=0; i < n_c; i++) { + result[i] = condition.get(i) == null ? ${pt.null} : (condition.get(i) ? trueCase.get(i) : falseCase.get(i)); + } + + return result; + } + + /** + * Returns elements from either trueCase or falseCase, depending on condition. + * + * @param condition a boolean value used to select output values. + * @param trueCase value returned when condition is true. + * @param falseCase value returned when condition is false. + * @return An array of ${pt.primitive} whose values are determined by the corresponding elements of condition, trueCase, and falseCase. + * The result element will be the trueCase element if the condition element is true; + * the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. + * Returns null if any of the inputs is null. + */ + public static ${pt.primitive}[] ifelse(Boolean[] condition, ${pt.primitive}[] trueCase, ${pt.primitive}[] falseCase) { + if (condition == null || trueCase == null || falseCase == null) { + return null; + } + + return ifelse(new BooleanVectorDirect(condition), new ${pt.dbArrayDirect}(trueCase), new ${pt.dbArrayDirect}(falseCase)); + } + public static ${pt.primitive}[] forwardFill(${pt.primitive}... values){ if(values == null){ return null; diff --git a/engine/function/src/templates/TestBasic.ftl b/engine/function/src/templates/TestBasic.ftl index 3b2adf0925a..d63812c7e77 100644 --- a/engine/function/src/templates/TestBasic.ftl +++ b/engine/function/src/templates/TestBasic.ftl @@ -262,6 +262,43 @@ public class TestBasic extends BaseArrayTestCase { assertTrue(inObj(1000000L, 1000000L, 2000000L, 3000000L)); } + public void testObjIfelseScalar() { + final Integer i1 = Integer.valueOf(1); + final Integer i2 = Integer.valueOf(2); + assertEquals(null, ifelseObj(null, i1, i2)); + assertEquals(i1, ifelseObj(true, i1, i2)); + assertEquals(i2, ifelseObj(false, i1, i2)); + } + + public void testObjIfelseVec() { + final BooleanVector bv = new BooleanVectorDirect(new Boolean[]{null, true, false}); + final ObjectVector iv1 = new ObjectVectorDirect(new Integer[]{1, 2, 3}); + final ObjectVector iv2 = new ObjectVectorDirect(new Integer[]{11, 12, 13}); + assertEquals(new Integer[]{null, 2, 13}, ifelseObj(bv, iv1, iv2)); + assertEquals(null, ifelseObj((BooleanVector) null, iv1, iv2)); + assertEquals(null, ifelseObj(bv, null, iv2)); + assertEquals(null, ifelseObj(bv, iv1, null)); + + try { + ifelseObj(new BooleanVectorDirect(new Boolean[]{null, true, false, false}), iv1, iv2); + fail("Should have raised an IllegalArgumentException"); + } catch(IllegalArgumentException e) { + } + } + + public void testObjIfelseArray() { + assertEquals(new Integer[]{null, 2, 13}, ifelseObj(new Boolean[]{null, true, false}, new Integer[]{1, 2, 3}, new Integer[]{11, 12, 13})); + assertEquals(null, ifelseObj((Boolean[]) null, new Integer[]{1, 2, 3}, new Integer[]{11, 12, 13})); + assertEquals(null, ifelseObj(new Boolean[]{null, true, false}, null, new Integer[]{11, 12, 13})); + assertEquals(null, ifelseObj(new Boolean[]{null, true, false}, new Integer[]{1, 2, 3}, null)); + + try { + ifelseObj(new Boolean[]{null, true, false, false}, new Integer[]{1, 2, 3}, new Integer[]{11, 12, 13}); + fail("Should have raised an IllegalArgumentException"); + } catch(IllegalArgumentException e) { + } + } + //////////////////////////// boolean //////////////////////////// @@ -659,6 +696,41 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(NULL_LONG, firstIndexOf((${pt.primitive})40, (${pt.dbArray}) null)); } + public void test${pt.boxed}IfelseScalar() { + assertEquals(${pt.null}, ifelse(null, (${pt.primitive})1, (${pt.primitive})2)); + assertEquals((${pt.primitive})1, ifelse(true, (${pt.primitive})1, (${pt.primitive})2)); + assertEquals((${pt.primitive})2, ifelse(false, (${pt.primitive})1, (${pt.primitive})2)); + } + + public void test${pt.boxed}IfelseVec() { + final BooleanVector bv = new BooleanVectorDirect(new Boolean[]{null, true, false}); + final ${pt.dbArray} iv1 = new ${pt.dbArrayDirect}(new ${pt.primitive}[]{1, 2, 3}); + final ${pt.dbArray} iv2 = new ${pt.dbArrayDirect}(new ${pt.primitive}[]{11, 12, 13}); + assertEquals(new ${pt.primitive}[]{${pt.null}, 2, 13}, ifelse(bv, iv1, iv2)); + assertEquals(null, ifelse((BooleanVector) null, iv1, iv2)); + assertEquals(null, ifelse(bv, null, iv2)); + assertEquals(null, ifelse(bv, iv1, null)); + + try { + ifelse(new BooleanVectorDirect(new Boolean[]{null, true, false, false}), iv1, iv2); + fail("Should have raised an IllegalArgumentException"); + } catch(IllegalArgumentException e) { + } + } + + public void test${pt.boxed}IfelseArray() { + assertEquals(new ${pt.primitive}[]{${pt.null}, 2, 13}, ifelse(new Boolean[]{null, true, false}, new ${pt.primitive}[]{1, 2, 3}, new ${pt.primitive}[]{11, 12, 13})); + assertEquals(null, ifelse((Boolean[]) null, new ${pt.primitive}[]{1, 2, 3}, new ${pt.primitive}[]{11, 12, 13})); + assertEquals(null, ifelse(new Boolean[]{null, true, false}, null, new ${pt.primitive}[]{11, 12, 13})); + assertEquals(null, ifelse(new Boolean[]{null, true, false}, new ${pt.primitive}[]{1, 2, 3}, null)); + + try { + ifelse(new Boolean[]{null, true, false, false}, new ${pt.primitive}[]{1, 2, 3}, new ${pt.primitive}[]{11, 12, 13}); + fail("Should have raised an IllegalArgumentException"); + } catch(IllegalArgumentException e) { + } + } + } diff --git a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java index fa7c8152ee5..b5a638945bd 100644 --- a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java +++ b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java @@ -1553,6 +1553,54 @@ public class GroovyStaticImports { public static long[] forwardFill( io.deephaven.vector.LongVector values ) {return Basic.forwardFill( values );} /** @see io.deephaven.function.Basic#forwardFill(io.deephaven.vector.ShortVector) */ public static short[] forwardFill( io.deephaven.vector.ShortVector values ) {return Basic.forwardFill( values );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],byte[],byte[]) */ + public static byte[] ifelse( java.lang.Boolean[] condition, byte[] trueCase, byte[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],char[],char[]) */ + public static char[] ifelse( java.lang.Boolean[] condition, char[] trueCase, char[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],double[],double[]) */ + public static double[] ifelse( java.lang.Boolean[] condition, double[] trueCase, double[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],float[],float[]) */ + public static float[] ifelse( java.lang.Boolean[] condition, float[] trueCase, float[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],int[],int[]) */ + public static int[] ifelse( java.lang.Boolean[] condition, int[] trueCase, int[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],long[],long[]) */ + public static long[] ifelse( java.lang.Boolean[] condition, long[] trueCase, long[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean[],short[],short[]) */ + public static short[] ifelse( java.lang.Boolean[] condition, short[] trueCase, short[] falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,byte,byte) */ + public static byte ifelse( java.lang.Boolean condition, byte trueCase, byte falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,char,char) */ + public static char ifelse( java.lang.Boolean condition, char trueCase, char falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,double,double) */ + public static double ifelse( java.lang.Boolean condition, double trueCase, double falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,float,float) */ + public static float ifelse( java.lang.Boolean condition, float trueCase, float falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,int,int) */ + public static int ifelse( java.lang.Boolean condition, int trueCase, int falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,long,long) */ + public static long ifelse( java.lang.Boolean condition, long trueCase, long falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(java.lang.Boolean,short,short) */ + public static short ifelse( java.lang.Boolean condition, short trueCase, short falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.ByteVector,io.deephaven.vector.ByteVector) */ + public static byte[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.ByteVector trueCase, io.deephaven.vector.ByteVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.CharVector,io.deephaven.vector.CharVector) */ + public static char[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.CharVector trueCase, io.deephaven.vector.CharVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.DoubleVector,io.deephaven.vector.DoubleVector) */ + public static double[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.DoubleVector trueCase, io.deephaven.vector.DoubleVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.FloatVector,io.deephaven.vector.FloatVector) */ + public static float[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.FloatVector trueCase, io.deephaven.vector.FloatVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.IntVector,io.deephaven.vector.IntVector) */ + public static int[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.IntVector trueCase, io.deephaven.vector.IntVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.LongVector,io.deephaven.vector.LongVector) */ + public static long[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.LongVector trueCase, io.deephaven.vector.LongVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelse(io.deephaven.vector.BooleanVector,io.deephaven.vector.ShortVector,io.deephaven.vector.ShortVector) */ + public static short[] ifelse( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.ShortVector trueCase, io.deephaven.vector.ShortVector falseCase ) {return Basic.ifelse( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelseObj(java.lang.Boolean[],T[],T[]) */ + public static T[] ifelseObj( java.lang.Boolean[] condition, T[] trueCase, T[] falseCase ) {return Basic.ifelseObj( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelseObj(java.lang.Boolean,T,T) */ + public static T ifelseObj( java.lang.Boolean condition, T trueCase, T falseCase ) {return Basic.ifelseObj( condition, trueCase, falseCase );} + /** @see io.deephaven.function.Basic#ifelseObj(io.deephaven.vector.BooleanVector,io.deephaven.vector.ObjectVector,io.deephaven.vector.ObjectVector) */ + public static T[] ifelseObj( io.deephaven.vector.BooleanVector condition, io.deephaven.vector.ObjectVector trueCase, io.deephaven.vector.ObjectVector falseCase ) {return Basic.ifelseObj( condition, trueCase, falseCase );} /** @see io.deephaven.function.Basic#in(byte,byte[]) */ public static boolean in( byte testedValues, byte[] possibleValues ) {return Basic.in( testedValues, possibleValues );} /** @see io.deephaven.function.Basic#in(char,char[]) */ From d7d252246029b19c56d0a04cfd5d2b1055ef037b Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 20 Sep 2022 09:01:21 -0700 Subject: [PATCH 136/215] Remove dependency on python-dev-base, follow up to #2583 (#2878) --- .github/workflows/build-ci.yml | 1 - docker/registry/python-dev-base/build.gradle | 3 --- docker/registry/python-dev-base/gradle.properties | 3 --- 3 files changed, 7 deletions(-) delete mode 100644 docker/registry/python-dev-base/build.gradle delete mode 100644 docker/registry/python-dev-base/gradle.properties diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 2e366024271..6bdc1f87c1e 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -234,7 +234,6 @@ jobs: - name: Tag upstream images if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} run: | - ./docker/registry/python-dev-base/build/crane/retag.sh ./docker/registry/protoc-base/build/crane/retag.sh ./docker/registry/slim-base/build/crane/retag.sh ./docker/registry/server-base/build/crane/retag.sh diff --git a/docker/registry/python-dev-base/build.gradle b/docker/registry/python-dev-base/build.gradle deleted file mode 100644 index a9bb1568cd2..00000000000 --- a/docker/registry/python-dev-base/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'io.deephaven.project.register' -} diff --git a/docker/registry/python-dev-base/gradle.properties b/docker/registry/python-dev-base/gradle.properties deleted file mode 100644 index 920b5af87ee..00000000000 --- a/docker/registry/python-dev-base/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -io.deephaven.project.ProjectType=DOCKER_REGISTRY -deephaven.registry.imageName=ghcr.io/deephaven/python-dev-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/python-dev-base@sha256:fb01ac09e98bc9a363e64a7f59f1413b48f0d270eca0a0f092c4f819f581d404 From a42ca0760d1bd92ec1fe71c4754bbe3afcf11779 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 20 Sep 2022 09:32:35 -0700 Subject: [PATCH 137/215] Bump images, add helper script (#2880) --- docker/registry/go/gradle.properties | 2 +- docker/registry/nginx-base/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- .../registry/pytorch-base/gradle.properties | 2 +- .../registry/scripts/update-requirements.sh | 29 +++++++++++++++++++ docker/registry/server-base/gradle.properties | 2 +- .../registry/sklearn-base/gradle.properties | 2 +- docker/registry/slim-base/gradle.properties | 2 +- .../tensorflow-base/gradle.properties | 2 +- .../src/main/server-nltk/requirements.txt | 10 +++---- .../src/main/server-pytorch/requirements.txt | 16 +++++----- .../src/main/server-sklearn/requirements.txt | 6 ++-- .../main/server-tensorflow/requirements.txt | 24 +++++++-------- .../server/src/main/server/requirements.txt | 4 +-- 17 files changed, 70 insertions(+), 41 deletions(-) create mode 100755 docker/registry/scripts/update-requirements.sh diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties index ae4a3b4de93..cf18db876ae 100644 --- a/docker/registry/go/gradle.properties +++ b/docker/registry/go/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=golang:1 -deephaven.registry.imageId=golang@sha256:d3f734e1f46ec36da8c1bce67cd48536138085289e24cfc8765f483c401b7d96 +deephaven.registry.imageId=golang@sha256:2d17ffd12a2cdb25d4a633ad25f8dc29608ed84f31b3b983427d825280427095 diff --git a/docker/registry/nginx-base/gradle.properties b/docker/registry/nginx-base/gradle.properties index fc19fd3aea1..ed7f4187347 100644 --- a/docker/registry/nginx-base/gradle.properties +++ b/docker/registry/nginx-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nginx-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nginx-base@sha256:4833e381165ec4fe0f84114db34aa0ca5321663fe0a3aef3d35484dc5a793f18 +deephaven.registry.imageId=ghcr.io/deephaven/nginx-base@sha256:59e01d102c0137cd947583ad6add1a56629e7a2de26a2071745a3190bdf7b3be diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index 723f390d2d5..05fa38f964a 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:262be75b8ca9a0f4b6f8e0c2474c449dcfb6c8a5d81f1f5995d5e38628da64ae +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:87138dec8f42ba200a711b7aa150ee9f7c8f0def8371c7aa28787f852b2304cb diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index a93a753f59c..fda873af989 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:48ad857f33fb03f542133b1e0d3524b1fcf596fce29e212cd9b7abd22d3d9188 +deephaven.registry.imageId=node@sha256:6adfb0c2a9db12a06893974bb140493a7482e2b3df59c058590594ceecd0c99b diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 6e266a3240a..3dc06f82c69 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:c9cb597c2cd784da48d3cdf08065ce1bb00d1f079b1fee68aeadaa14c4259d0c +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:228b372ed0e528657f4a6b805d2c30e1db788936536b11816592699dff883a9c diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index cff1ac76748..958e21a6528 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:8b743b1af852e554b98e2377f9c92221693225b85d984b23be6b033018f97cc3 +deephaven.registry.imageId=python@sha256:2341ac5eedd71f1e6481afe854af572f5ec1b78fa3aea2293dba65942108e663 diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index 42b91354bdd..bc22ea7188b 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:9fd68c695baea12be44c65cb5da0a85cd92e3e4bb9c904c35d4433eaac16aa61 +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:58d386abae8e65c1a5e04987992683b430f72a6699bb320f1bd81b2170b217b3 diff --git a/docker/registry/scripts/update-requirements.sh b/docker/registry/scripts/update-requirements.sh new file mode 100755 index 00000000000..2b210490d39 --- /dev/null +++ b/docker/registry/scripts/update-requirements.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -o errexit +set -o pipefail +set -o nounset +set -o xtrace + +# This script is a helper utility to automate the process of bumping the base images and updated the requirements. + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +__gradlew="${__dir}/../../../gradlew" + +# Pull and update the registry images +"${__gradlew}" pullImage bumpImage --continue + +# Get the (potentially) new IDs +server_base_image_id="$(${__gradlew} -q docker-server-base:showImageId)" +nltk_base_image_id="$(${__gradlew} -q docker-nltk-base:showImageId)" +pytorch_base_image_id="$(${__gradlew} -q docker-pytorch-base:showImageId)" +sklearn_base_image_id="$(${__gradlew} -q docker-sklearn-base:showImageId)" +tensorflow_base_image_id="$(${__gradlew} -q docker-tensorflow-base:showImageId)" + +# Write down the (potentially) new requirements +# Need to manually remove pkg-resources +# https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 +docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server/requirements.txt" +docker run --rm "${nltk_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-nltk/requirements.txt" +docker run --rm "${pytorch_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-pytorch/requirements.txt" +docker run --rm "${sklearn_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-sklearn/requirements.txt" +docker run --rm "${tensorflow_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-tensorflow/requirements.txt" \ No newline at end of file diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index 1980dae3ed0..41293d29e4f 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:472187971da83046cdee278d1b167077e2af2a9b15ba2eff5c69670ac533f0cf +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:014c9f24f95c16fc06b67fd376c6eba9a6d62264642929a8be63e55e61822ae9 diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index a23052071c3..e96aba8bdc7 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:18ca26c4577ce9267f92b244a7f7ab60a58ab4226f9bef2ee8ab9593340d008c +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:d679d732f1e341629defec041646ab07859a178eb1cf9715191a366e36bf1d23 diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index f52e5812150..febf340bb6f 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:cd087ae1e4415f218d4856dd8f0a101da5919a8c001a432dad318fd30be4e5ee +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:c7aa71e7c9c22583e6a61592fa403d87190d987ef6a14f4f591455281c0b8ee0 diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index c2415efc02b..2bb12b0c9c6 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:06c28c717ca9686c36be82625afca660aefb70b3223496daf31e55bca51a93ac +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:4e2d9a4803a9f910bd4478ef7f977e7dd8cbd1b86f53fcde2b9d5aab8184b9e1 diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk/requirements.txt index 7a49bd0afb0..b4412e7271e 100644 --- a/docker/server/src/main/server-nltk/requirements.txt +++ b/docker/server/src/main/server-nltk/requirements.txt @@ -1,17 +1,17 @@ click==8.1.3 deephaven-plugin==0.2.0 importlib-metadata==4.12.0 -joblib==1.1.0 +joblib==1.2.0 jpy==0.11.0 -llvmlite==0.39.0 +llvmlite==0.39.1 nltk==3.6.7 -numba==0.56.0 +numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.2.1 -regex==2022.8.17 +regex==2022.9.13 six==1.16.0 -tqdm==4.64.0 +tqdm==4.64.1 typing_extensions==4.3.0 zipp==3.8.1 diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch/requirements.txt index 71ab6dd0a8f..85d082abeae 100644 --- a/docker/server/src/main/server-pytorch/requirements.txt +++ b/docker/server/src/main/server-pytorch/requirements.txt @@ -1,22 +1,22 @@ absl-py==1.2.0 cachetools==5.2.0 -certifi==2022.6.15 +certifi==2022.9.14 charset-normalizer==2.1.1 deephaven-plugin==0.2.0 -google-auth==2.11.0 +google-auth==2.11.1 google-auth-oauthlib==0.4.6 -grpcio==1.47.0 -idna==3.3 +grpcio==1.48.1 +idna==3.4 importlib-metadata==4.12.0 jpy==0.11.0 -llvmlite==0.39.0 +llvmlite==0.39.1 Markdown==3.4.1 MarkupSafe==2.1.1 -numba==0.56.0 +numba==0.56.2 numpy==1.21.6 -oauthlib==3.2.0 +oauthlib==3.2.1 pandas==1.3.5 -protobuf==3.19.4 +protobuf==3.19.5 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn/requirements.txt index 5c4aed09f26..491e076838f 100644 --- a/docker/server/src/main/server-sklearn/requirements.txt +++ b/docker/server/src/main/server-sklearn/requirements.txt @@ -1,9 +1,9 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 -joblib==1.1.0 +joblib==1.2.0 jpy==0.11.0 -llvmlite==0.39.0 -numba==0.56.0 +llvmlite==0.39.1 +numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow/requirements.txt index 92460886d3c..917be8a592b 100644 --- a/docker/server/src/main/server-tensorflow/requirements.txt +++ b/docker/server/src/main/server-tensorflow/requirements.txt @@ -1,31 +1,31 @@ absl-py==1.2.0 astunparse==1.6.3 cachetools==5.2.0 -certifi==2022.6.15 +certifi==2022.9.14 charset-normalizer==2.1.1 deephaven-plugin==0.2.0 -flatbuffers==2.0 +flatbuffers==2.0.7 gast==0.4.0 -google-auth==2.11.0 +google-auth==2.11.1 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 -grpcio==1.47.0 +grpcio==1.48.1 h5py==3.7.0 -idna==3.3 +idna==3.4 importlib-metadata==4.12.0 jpy==0.11.0 keras==2.7.0 Keras-Preprocessing==1.1.2 libclang==14.0.6 -llvmlite==0.39.0 +llvmlite==0.39.1 Markdown==3.4.1 MarkupSafe==2.1.1 -numba==0.56.0 +numba==0.56.2 numpy==1.21.6 -oauthlib==3.2.0 +oauthlib==3.2.1 opt-einsum==3.3.0 pandas==1.3.5 -protobuf==3.19.4 +protobuf==3.19.5 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 @@ -37,10 +37,10 @@ six==1.16.0 tensorboard==2.10.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 -tensorflow==2.7.3 +tensorflow==2.7.4 tensorflow-estimator==2.7.0 -tensorflow-io-gcs-filesystem==0.26.0 -termcolor==1.1.0 +tensorflow-io-gcs-filesystem==0.27.0 +termcolor==2.0.1 typing_extensions==4.3.0 urllib3==1.26.12 Werkzeug==2.2.2 diff --git a/docker/server/src/main/server/requirements.txt b/docker/server/src/main/server/requirements.txt index 91aafb0b122..0be336a937b 100644 --- a/docker/server/src/main/server/requirements.txt +++ b/docker/server/src/main/server/requirements.txt @@ -1,8 +1,8 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 jpy==0.11.0 -llvmlite==0.39.0 -numba==0.56.0 +llvmlite==0.39.1 +numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 From 05976d66e75ae3820ec23912ffe63f4864dcd9cd Mon Sep 17 00:00:00 2001 From: James Nelson Date: Tue, 20 Sep 2022 10:35:41 -0600 Subject: [PATCH 138/215] Issue 2870: make gradleVersion consistent with checked in wrapper (#2871) --- build.gradle | 4 +- gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 60756 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 263 ++++++++++++++--------- gradlew.bat | 34 +-- 5 files changed, 175 insertions(+), 128 deletions(-) diff --git a/build.gradle b/build.gradle index 5655763f924..afdfa20f8cc 100644 --- a/build.gradle +++ b/build.gradle @@ -83,8 +83,10 @@ tasks.register('smoke') { tasks.wrapper { Wrapper w -> - w.gradleVersion = '6.2.2' w.distributionType = 'ALL' + w.gradleVersion = '7.5' + // if you wish to update the gradleVersion, copy-paste the correct SHA from https://gradle.org/release-checksums + w.distributionSha256Sum = '97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1' } if (findProperty('debugCI') == 'true') { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2faf2fc91d853cd5d4242b5547257070..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 21912 zcmaHRQ*fXSuxvKw#E|kC)I-v%6oWUFP;8P+T(h)cy{e*B=UO|U~9cUnxg&o zx!;116S$o<1F;z*ftXQkfS6G(*jsh>jK#~X+VP^1CTjMbJ zQMwl6T>QIa`zF*>rG{y`gc-V(hpHU)`>NC?oyO{vZneAQBme6Bd>-9>q`4ZxMeCZ2 z<9xj}M+bFKx=}}W^UR9W?$YbyRi#S-y&B?0-#8xWR1LndN5Ag-ygUEv?3stRbv*+0 z(UxC`hB*2PrREEbSoy-FOaq8Bm+p}eC^OaWkkWAMCPwl)uExSNKQ+XNG1wK&5Z5d({%r4tb9S~uHK=gao?)~b@8~cv4U$QJiWBv z_9!m0(Rfd&<>$}Q>x2N^-G8J0%Un4UhSOMDpS7Cc zQ*$w1JoD4rwZ~rUfKTpWbs!qpWP`bY3NehKn8)MMdyQLw*0H{ z2YNaxkLpQdkzQ*kRUNQqq9r6JvsIx3ddMI#XuClWful=L*dWWWhD=IK4H{{d>8=yp zMNZn0!t|n)W@iDg&Hu9=Hum-v;^`dOEy$nuXZ4Q^JP1X2#qF4(uqADwETWMSIv?a1 zSDZxV?SJtqcYT02y(IN9BT=9ucK(!EOR(H0(|bD|KPzd#HwU8qQ$?o=h^;O_>!^Zr z#IC9&Rn}&(KBd;lzEK#zz}j_Do}O4gL(gLa>zKLTdW8hwMQIM~9PQJcEm-#c6!2;L z>sHODn$cFlqu0L{$tqZxQn2rZZvN}6OR@>1q8}%A&x=`q%ZN5PfH61Quy10oq(reB z-f?HeCbVp&g95@cHe0p;<1~RivYx;?xM~DB{4G$GR(YF+N8<|jEUBt($9rG-zF#`@ z=q!YMqRkm)`${T=v-OCZIJuxYBA}_EMTX+wWjq8p-2o0L-yaKOrkU~(hE${4r;Rnz z$~%=tNA;l&yX&ysMZ29Z1YYv6XnC^Y@H&Q@-%ej_z5t=%?2X8WWM3Tn2Y4KF6h%^# zhypxoIF5g09`#FmsKHJe4vA-GD023qBc6iB4J|^?umkv!Pumjpxij0i$`wO)>6i^! ze$SMcV;~S`kJw6vA|9<}BGtV;w)+e^!JppRU`cK(Po^)+wNfCs69=m8PB2IAaeOw` zK{@m#1@z^ye?S0BH=NiTJ^PiRzz)s%;N>KoO@xrvbSkiC;Jn>~&R4rD=qcO>u=9|i zF^iyz^_PVk%OyKTLacEA618Tbd?Md>Co?z2pf-46SE8x8L74ZHD=(Bal&KISS~KynH>uC z(A-tXH!mPsLb}YG<A}z8 zv`?DfylV%%_)D3vwlG_8g;m&J23FL7eKmbb@8n}^d1f~>s?dGZ0Iq`+(OjAh*sJy< zwcq&sQT%#SP{n;Brv3|Oh5}-TF*TVH+MX%nBh5@x+2AYm1oE6<(yT6}JED!p`nl+h z7t4o!N=?xTVY3w!V8gq(k2fV)}>WxC@SO+-So;9IHEYJB(hEg;Lj+4Xa%NX z^+AF4^qB=drO~>v-G0(M<}3OL#(dC5#=bM`mdS-XjMIG5ft5``Tdr2GeN*K)l>F7z4|@-rT0u!jjKK8i-p##$ zFXA|U{e-N`1`X}Kr#dcHg%&H|xPC6Vka*w}w4FiDGkr>SELjJ_?(|-f{ zHIMQ)B0IDRCb+u`2bfv5huIYS^t0&{E!TDydtGqec2}#*1#wA2Phbx)giw@z`+H!1 zqG6C2vLUbNh-C*PcXC_#VV9`AO)I-h$*h>4CA9D+lKI8miE4{KHnCfYO0FBn0QL)v zy?alF>XH^V+3ooiRNDiVRfQ^#OheMSgp3eN0^I{LGtwsVaO(`mKm@iaQ+k-GQ>sEq zk{){muW?e&NFSD+T{i>RJ~)m9mas5JPy0*fQ%p1$i}T7KTsGq#9rqh zFgdbL8=_u`qF(izXPcx?o6r)7R|Rc_MY&D-rGGJnS0`8y{Sjqy)d(*{=_lC;3+LYGZh>T~zfGe!`<8{nz2(Y{6*ZY-DO{#^~m1Wy=WmKNSG>|082%?`r03 zZ}eXY$p0P=_Ej+c1_}Z~2>}8^@&9YowsKUlwQ^)Iu{CmW2~pKiSr9_|O2t5tZi7%o z8!RV6`g03QQ%<$_2MA<+WXWfg(Hb|-Tr{QK%Mt|p`pqa%jyQT!e*Hx?(o`V4G@TyC z-+BDxcRc^~^7@MVn>BqZA9(=#qA&c%%AgY%B@0)CEhM$)oBQ~n75z*)m(5;wcP=M$ zrO2?X?&uB)1G@YDTFAUc=^b|!@>(Gq&-;?1Z@=!0q-6@azo!h*z_G9MUDa0ijc z=FULp_{|(w?5~kx^@q+Rl(e0R#(OB7@vXm#>ePotkp#BwdTPRXEA7xJG&Y?P##4sX(&7p%QoXlt;q7LO+~~nTrzJ-& zKh=OxQfGl5wX$R)a5lXFFK})v(&DZ&TSd-HD~cLdHgRX2VyF%eWMQ(}#i_MvqlV*T z8tvtSTfj-=FKy@G8^69#i3!kbDQCj0 zjkJs$0oZA^&sEB}@JbD|NFUN57i@$r5dZQeMw=GB!(4#r;ne3%mx`_ifw^k0|2z>R z95crg1=u}*iW{GMw9eMY<}yl7t)4z;uuYe2d|+e>^u1hlQ^u(#{)r*8B!q`ot}V#C z_~Zf)JJ=medqjq}b3#8tNSK#5xuTdv$acLvGLbXoVA@%uA1hh;QzO@G-|K$K(NSIG z26uVRH1Cig|98DlP{{4aNJ1Zs>s+2JVdLQ70M)5`d-Rf{mGGIXbs}V4Yn!x1@X1Nt z!qq?FV~KxRCykvj>R=6-PdO#`n)CAo22J=sjG%vdHS6@UfrEhjgZiH}PAXUw0ZP=i zRdChNzU(=&Ld;N=C8^M~h1PLE$<=6Kt!#9NaB!r_(L}4J$=eau89Limg}y@tUKZ23 zPm&fe4R}a}-AeryGQLQ^yyviU=A6X&pHci>VY%>=#@acbH(a`}JC83mDFNUUx|jB4 zR20;Ktq^@+K3Xz~eJtCqmmBpMxHU&jY$MWO$ZQLqqlh-z5Ss4Qp(ym^bv7b6Ga-qC zv0}hYXLB6tMH3mkr9t0ib;aQ8NvwG3x(J`FoJmUy$)l#SNG&L!!&BM~Fy#8PGR*9- zLZJUN6nVK+x$YBefMVahf>z&18*!|0!3))A?gNmw650g06%6tx;3@XD`uylm2AVFNqF_G5~s!8 zrON!@E>O2TUxceCmWhWQbyzp~>iBvG_F~D{+A1Mgz9AO6$fmV&$4#iH%1M0_W*NVU zpPI9XweNJLanOQwU@%SrQ%bDKngbS-WF+ZUidSbnCuL{1R_Q+4!jnTTm_?N=O}moJ z>!jn=%&{Fg&-ICevSEj`L1#lBh6c;BB>E-1vqX!2Rec%{l^uwU)k5s;g0?@V7=Lkw z4s6F*I#MhYLA6i%)!^*7Yzy%5F=F!<`l;bjs(yi8Yo?3O^}}QX%_r?%OTEz{HtFn4 zl>FE84OhRicEh#ZPEJ@C*g5Od23u4}rg1%I`rq5^cfoWyZ-_;n0M#7P>m51z4K#9| zoUda`2S|Ey+Qo+J1!2S`b2n`H66J2Y^uU z(2LXD+!A^NhQ1`%g21zSP5lJLwkI)ogG&4<>zSVyDZvQDR-JPcIA&x@9Ux6raGrbS zkqR3a7MI;#m2oA1p{#i@E%4jzx}BI_Z;2#hh|nk08BR()w}wv?;N$=C9ZukTS-QKg-)KKgeF>G(@?4i3qcVHDbtFJVm=M z@)G@qoO}K0hu<)Qi1vbn+pBB}kR5{TUC%4BriC!uiFjm$^t zD~_Fj^mZH)0wtt%$UAAP+{Y0~>#_s4Cb6K*lH0lC=`iyFV=z;WHlol5)X>G&5k4L_ zHFo}8U^1$JQD&pITk+2 zA!@alM3TKs{ORh=l+x|J`UX)v;KklZ&l5G5lH=4!xtVNm-K7D1K{Kz`II| zuht$}irDf@S&6boehqt`Ei-0v7IBtE2ii|2GxP^eCo~w}FfQAj5QihE!yKM^&gRVx zqm@ynO$JZ@_UUvKxLrE*p^VU z3!Q`i4z~kEqLh%NfsaplgjVO|uR>q9x1gjXgimBQRqr+09_rg~z7mI7*6bld&7r)u zpdQ0L2h|&ec-c@;eKE!@iYlZ6hh6+ctkq~zu|$&MWl46qZ;5>Vu!jfgvpzPo1R{ff4PkrU$%r={->?XwXJ3 zeJN;|e}>`sP_(y+n(l$9!k!JecI1s@#btEKm=lv<4;QpZ`>S-!V^&$&KV?Z>(Ic`jFf48Esa7*XbEzLcn! zfH}bPMDVnS@8q-9(!XN%+jCTm(DTIUEhWuguIF~%ge@Rc%IGOEO@`03UgRNLpJ$u_ z{uFG~xYZJEt{gVa+w!N+U@u%>b%icPn?;3gtz$?ShI2`nAK$u2-7VhSB)Y9yVa9R6 z&)m9tgIx#$?S43Z*B^{`vpT-9>H2h;fQ#Bs&l3azh28t1XV5u1`y-?ZP&1f#yk{F-B21M z@>B^8XGEQdq_z4BOTp=3p%wBJdSSaV+qvihO(sXk3hhSi9VDXNu6e<`8jXi1K-K>% zg|o6t>QMgIC5rjw)2!P@(VaQsXL4)#MwO#v{F~~PhF6s^CHmIUZk3nN;id5K&yYGL z&$98A$}XA1bJb>b6jGXNC9gV7EHzKnU92RG=%Hv+9aV*r zXtag)^B7`&eD;-*=aE7u{w{88fKVQ%Le+xI49C#)F2HqXr=ywMcyMww-+uTP-Szd> z;$~Bg&&u-CmSTMwu5FIbgP*sFY8(P*=%gtb$Ht`UGDcj9EWf$^QjwJn>^zK2*(BHDHbS{U)=uHD#The`^qVFV5iHfj`d=&zEPg z?(UExm+4xB{dvSUO<6F!B@@clnJK`;sq`?&;(!BG;Uc}*1ucD8*sm7hMYP&McYko zjIThv8sedr+YRntp@qkC%h?Q=S$pT4IeFNIXtZeBN2`PG<-7YX@72+0xj63$`HfKm?F?AKh8F!GOOhC|>13?WRQsgCw*q>u3Xzy-? zJEdqG=<>8(3cH`Mgrm$7=@<%5laUp}f@Qyvc(7O>!610bLegnG>(ms)Aj?RM#FR!9 zI1_*WwqW9f^bB4JY#>JCwQJ2~S+2H^Ll`&hsP2%grB~;q4MkYcPQGB7OyJV(B8p?Q zf){JhDPo862d3gDwe*K@DB!9Zb5ab=e|5G|uGUf(A@{L!#?fvICpy^?6zLSg=6HG0 z9_SUS$oHC!j;2T!2c4GN<9u?M8ZSyea z?G)^G;Vp5u+J4-<9S#tP_@7o+&SU!`BV2w_dB`2k!}vRMW5NE0=civp>MB{Zeu_l1 z4iBXb+#x>;mk;JGoc!!iDJna$GBg`xLq&i|_)p`oeen_gnnqq+B*S*kwpuvVkZYK^ zgxxN<&GAheHrVN8?}m~ngU4Su344ege!jy@SZ-=BQ8Sk$&CUym-@9XV_)3odCZF3V zyZ!w5E#9L5koQ=>HV_Tby?3$ z{Dl{6f8qUW==HpJWEh-V9(Hx@g@p3xgYk=LBFNCh+qvJv+lLlnE_e}COvMAnyQRMY zt1+}Q(|E_bAgz7ofF{&JZfg0@?30+NBQG}1TTok05f*Xxti?LaAsC-Sx#=w;H|X?R zAz_8m=->a6{KW-F$QAcw_Ay`47Iy8~R`xbZSIz2vfb~m=GC2B}PUi;H;#={1p(>*Vre#WgAKqQ^}E74jUrkur{;$BEtBW_{Ez4>8r<%8Rn+?JM>8P_jTRcIfaX z=%X8PUTLDKX{3eh7HRK4G^vr7L6KISj4MxKHGZAIM?KK&fD@k8#cTW{FPV5ZpYm6; zkWRwm;DOILe+MU?6etbAz{i!TVRyME9G)c6Mo z>pKy6c~E>#@{EMWW2`!JH5IfLw_4~Mm2ECQ=H7N;By?19U{V@@5$x5F_ETQzomU85 zxiN(+_$^WXPmEAzynxTRiSfQT@%kUZh&J(qJ+@y~tlwe7@bE}6q~dx(bDq+C)kCK6 zh37M85$4;unPoSaFohK#?5rllY1Acuq<33qcfyISV*>pp_{_BbPL%`h3Yb@D?dCFT zNNUSbSE0oMd^FpDR76w%maFs)&?;+r3HkMCX$=eA*s^L*O`FtnW7^$7*037r{>$w~ z!J>&Un<)__oZkLa!jrKxfXVi$!PhK-owu}RERE&zmH&I-$S_*c*1(tX!@~;MTRGAd*tT%_S007yJ2L5N=<3Umgo@+!4Tc zP^NQ&^wx@^1ml;DF>Ch_vGKw*oHvOJ!0sy?#|Q@9TEGnp+^ULgQ|edU`E-5`1*!Po zx0vvuuYg2Qkixu|=sbe4Z?6 zUOa&CQ+)&4stm0btEjNaqq&NG0e?Izf&ydy1vF^3du8i_nH*eIkHtGDs+QJvB&m)g zbwlDKF322Q*47A0;q32fhfdR#vU(2VlTYFN_D&qfZ@xSk%vdvtKTXb5Pk4D>(pEl2 z(Uwk|r?4)xw@%fDs()A37B?uUD}28Ckv3npM5e(_# zaszS#A+aI{?HofaZ5+``WczLwCQ!YYt{)26pxug{s{S0(dvgs9~Hwp z-FE+s%0qJu1(*%^Ok}1-gx|eFVh?z2RdNx8vuoz~h}EtTLT+D_{4948R0cWcRlZnr zLS=;tjh$Uvzxtcf>1m>vzG9Eui0%Djk_b>sS2r=c2cOefBaTJG1Y;=Uh7{Ew+zj<8>&`ktpsDoHV2AGEl2r8so|9H^pS7{?+SkiPkKH>g zGh(ULx}8(-A5vs$_qaq??$)ErMQ+2S(O`qtID3hOo?SWwZD$k=Q)rm6^Ve}y7z3`m zI0~oQ4yS7@Jri~2mWREW^NC?r$1vI{1yNUJjZWJ9JDr}<%h{E8)Aan+b&u*PV-8ws zt9aVH+TJrF#YW>UFS$^b0maxh6Fb3`+Ow5il&8v^Pa60xGOUZPu6w^^)!s5$T{E`b zGF5wMMbcLCN^{@f|KOFxQi$1d$pacBwkxmNtcw)Wty?Rx`k@>zDa;*bsw!Si#F0pQ zjDnBwbOKRZrOyE>zU?Saet8xXbr8RykUaZy$eR&PI&gH?t(Y%Gg|0x4YKzp0Nz*;R zR)U}}nI1vyz}TWQkQGVTzzs5*)9eeW8qM*_<$Eop2DM-X*iU_$3E#IRuYth*nG^Fj z7^E*3)4AtUqEFII5IOq;F;~<)3C?>KoIVDt1>eSaN*y?md_;KW?UoKJRt{1gZ7xS6SES?lHAB8oB-i@&S9(G3`))@bDC1{; z_r9w6i(_2is~Kd zQ)CT&!h)GWPk=HK$R}A4{%JfIaH*lhJmO&zDO3 zuFm#1a3M$h8~)>#rtpOQOqgL!%0V*9Rdb}CUO9I0(_?-hDq-VWU%Qxq`_a!TVZw^` zGpGyAO>Pdd_(p`OUtU|}J2%t|y3Z+6e65H6WjrR+I6x_7gp0THG zrJTW-X(>X~uYg(Za$n9LcW}3VvGMeIq!Bx10Jx?a!ZFw+tQDjrH?}p{Z*rhf{Xbhd z6eY=l4JT<<2r?;u1scfF@bX2|!2j;PFt^B%B|?Dc5L#a}&hmkwPYxak4K`+jVf!I0 zER%8ZGfT?cVtG{y^f7-;JI;HB_EDfAQo3O^xG?59VA*@Sutxj3>dQz_ZE@Sd+@q;e zOW9Z;uZ#2g@Al{Wm;d$U>Nnp5({Hzz5t8QqJ>tFrIL~@7$va?Y)KWyc-w69xv8i~$-snXn+x()|HSLLJ$79$ZN`Bbi++qx zpeI67H%ItNL-oppC)m~~uR~?;Ur$!l?vONx8X<6pDj_t7Vx7#vqAdV(@IB~72#GLxE*kN+FHCFA35GDC;m7mD!L9_kuWUaI3?XJYPc@DW zJZ&M4i1!}F<}5gdM_gstQoVhM*I%jpK&wLU`O`(afRfde8pJZZO_t|>;<00k**Ce} z48|S7V`c zPisL~{vD7)F{`L-spV>qyh?D3woG7#$#XQDxzZ)F(pr5jCX;pFi@=NZRSJ#DuQTH= z(c^6;jIfN5jXi9$jZ0^Yk)0iKS@Vt)ed6)WwRe8Pr+5E(a1C2-tTUC0~kzlTZkVY+Ony$+J<~ z*l=Yzi+IB%{y?AWFV>C7E=jEx*ZML1%Kf2=pO9>4Q;K?(Pt@3f@-+IXJ|1hSAK%z+ zWzGUR<<4rXDHW(3cNDFu1e2$HLqvgYJ0b_mVGt%B_iZG!ENb&&KF?c=;H4|FgR?{7u-h1y1^a*!`?DcbRQ5x`D?06DES3K5LI z5rGgit|i>3MDefOv3O|@ba@F0G}vQ?hy(UDVEw1wfFLZRQWaLVuvHiU&1phFIxx4_ zf&4?h@A?)B0vOCg`@jZ>_fUGtMBOy0NwrP1<>kh^^b{5qe=Kof$Q5c4{VS`Gny@9U z0L;R^LwjgFQCLA~Es9psSn&C44}+bnM?-S(4wmlGX{{KCqk9kU1I2gNqUh#qfqB-N zs5N&ZZpDR+%@b!fYu(hGm_!>T{bY50P3i&;W1GtT#vxD40n^n-)!u;7LRV#UK4@rn8LjJH8;VpJRnp~of9uG)tDgSxY!3ekK@9HLYgJmVInQIx2TEKv?1qdP zG~s%4+6|AuJWc}psZc}Fv)JwUvs%1%OWn-C8c#v}>^ThkEU)gz3&YVt!;+AS*UG%N z?dB#L%jxckJ9aas7>sk@J)zIqhg-WizWLUXBE)f&lK!qCpV|2@6U)1y)nD82eLw2MuH=CTJ|pAhN!$Et+W~@y>{~tfOJ8ja#JX z*&=-I&IHq;V3k-Pdh~AOPEBDHfgzlFoWf4g{N;wmF7n(+MPB%q+ko_Kdz-Gv= z7~XJ%vB@&)Djd>-%N?>swfq*yd>@Iw$vz$n?xd1e!a$Rt7ZrYa1HY*zZuoG(1`+2U zd~wni2&9BKy?;DMvCjns=7GD4d;7K)WIra4Ss>w614w38bUa{QjSglXMy| zbZrkUZni}ZyDy^H>%jck3|{x|pBE55XDXl)=iNW)WA0zd39d$M!!DZ*lZZHDz9=ob z2FdLgXaEf|21r8(IW92QovOHg2a)`YVXNpLu5TkmcEV7)h32oAF%sqbp~n}YbgK{@ zanGbDOBg7-rk)VG8N7oU{J^iO=byOw`|krfk<`1?wm?670Z-7U_AM9Wsj8vwhRmNo zd7g0*K8|o|#fSPpt&(lAZ$pF7F4{v56Le%o3r|P|2)D7Le9s5Bq1MK0v^%@KfywOLN)I6pAk)t zUj;8dweM5wxypqBUr{6Sm8&B^u;vQr-Uc&VxQy6&8SA_V)Xhb@*7qMiW~y0v%l{Rx zdT>M!dabD+&i!)OwMF?q7B<*UK0Vc{+UffVa@72P};ELN&G^fMTZw$H!O$p#16bvYCI$x$g1 zDd1%@+hTZmma#CzT}}5O?Z<(eaHEd%%c-k^`Yd?X?~!u3O5@nAa`3;N$i*dKnI$Fo zIH<`*Q3h1Qw(Ngk8>2rQf9L^wp&i55pfd4~bOO*(uCmn)?<;EOk3eo|7XG(FYu&&w$ z`#&5EurOLCKPR@=&H9V12>go5oe!~$TS+0P8$j+yTR7nBM6_a&l$69hi>w7}`c|m&{h(3z;^5j$9SnGt6tE zVKCOd6!2?=7RG%Ast~viR<|p$Lf!Lq2Nd zF>lbUB10N7dZVs3f;vUAmGR<_(z;;-8xo>M-Vqu4Zx@_QKHLN>}%zAPEH zj)Y@LR*ij@oKna3>blvs`585y&6y>fnT1oX+PTvoxs0T62UZ1q^z)t#^1pHm?osqB zRrnc`R+37z805<1e>&IXX;}J3%GNEOlKNJ{`}fYc&DYJh1GyUS?Z3>Ip`Xjf`v35x zI2PrtNC6$gay<0=k2sv?&3Ge5jzMg=CEOw>wuv?L{#$gUI&52&w;Y1N>`Vtk$#jO@j9(~;Li7QVQPt86@%(~ke(c+3zSRTFCX);BzQ<}U^o6dgy^zoh7 zyr}CM1*uXF;C=%yI8q!ZgF4?HCU|iiJT27%$2G(&R;=fLmC~(%#bdA!=X!=w<9;sz zdus5ZWF=5~8^R;@N|M8Pw0Y+mTK&~FoM!m}lats;+?O_9J0ZF^;pQ!2J4Zjo>l-qx zVeN~aG>0X#W=^KOZTBayOy5MkP{5cXNj;IezQafk*i0>*vZ%ASUG1uHT1uUY!Ofi6 z(ropjS5aDMKay{vFdpu(*1izsT2`B2s}*2)Fn&^JO>F$|Wlv&6xjt(|kzL5zi>S@4 z4PHfVuy!Y(%q5^zS}3MySlCA1Mvoet`dO-F4~MH!c6^vjuy9oi7B$xrt|%~PH!!@x z{?9cVSXw8LA|K$bVc!i`TiLQFPdcAUukfsLDw=ithd^|!gB%-jnIdbE@;6TRnsF>) zm0^4QpeD{kQx-L|pSg+~-L45GOHMWtV(-%2v?>F7!pD2o#v{zA9lMs2w*~Uq+ozw! z&c=<)ik03Y#V~7OAU|ifR<*x*;8xSF-Q>X$=n{7&DYcx*v7iyOR*o+R8=>sCqxRZP z3}=e*7#*SOG@mFHr=yoqvL!Q$(mbLzng6E7OFxU1KrJo^af}^x? zzB_XynOLl!4CV3lX_MG0kl7hLOR$rQ5rk+mY~)7|@OHrxXs{(qapt@>s-KAIRoAHm znp6xkT20WC%GS?@Jh56XRiTc=cF9=rL8YqrQ=r%V*v|vxg{{|#w=R^p7G7{-1Z(C9Vgv`+ z+{#j*J)RD&9aZ>#n&t>dpEU?~?vcj;3#;u7Fm%ZWfkuB)Y!!li@Nj*2`(Y$`=L+Ip zCFN8!D}H%M*2PE^v{jJem)244v-K(AYDAm*nAHsD;bX8~c1P9}V|hreYWBraaq;Oy z@rVZ@PrCD(iKD5)Cf=$RZYuv&vV45fylh!2F#kY?N)$xp=c<~QMGda@Y@oV_ z!mX$@x~YfGq7XOl{ew9KmW{BrW#VMd!{=y3Y%*pm1u(SN!#MNkvSzpWYkl3uC5>iYMW#%v0to_Lzg2Sktqu!D=x9pSM2g5lM^ zw6p%=9(294t`yXbxP}Scz>DxjvJHXkOfDL4simV4(?7Puc$qB{4jND9m3Mrex*v+a$)fZG$mJBq|$(A;+nSP#sMk+58vk04ev(8+-av2ZJWd&2ToEI|Y3`K6jX}>of4gMj z{FfANQnZN~jOXW^3O0AfCVE_QTriujs@Ug`pBft^l*YsGm;YZz zxI_UVZ-R6rK%Q-Ep9_sKNgp3nel6TLZ)!z{su-l4GoH+v{m0CwV;Y{i>bGpYJbIJ~ z1-yTvgSa1Cbe&v9I)1G7Dvx;f6}2k*z+5Xs0@Hs)8~20lukj7*M|IzJO4+fYkhhkv zumjx4ygwayt^~SM8>}sO2de@4>*eMgmo&vpBe@Jb@I~N@pxW(lgZL5#`7H?|xb&CB z6t<1b!D4!c@LnN!R-xo|6}q4?rKpcFT)eAL;kGf)A~mKO1i@b^b;|pjL~-8$>qEwW zY$uJ}JvBOp*$Q2CaYQBI=OH&$(r!=&5BEP-T`DNv{Rlv5Pr?cz$g>{+kW#;@Qk%ZgJMEE#p>-H@RdB?BX6yqENE`$MczL26^|v^?GuiVpW83sH-VU?eez} znn3DW)`D=tZT{PpQ-v+k?olrV-QlHBe5B)oeTw|srH@0|MuI-uhy0Xv!NA+CcH0&f zz#MG^Ar%0*%=BiW+`(}&I!H!9sz(B)fib>}cMO{tu3L5iB3Jk`7;|^hu=d>%kPVo7IX!P#nn9=GoJqsf9Fwh?1p_MdS8jPetEMg>-6&>#;g zY14*-N9bQN+L```*2D5c3C5_IH>NX`2q!a!j$}CGV}ij5c{jT;Pck!|z3ZYD;NUH4 z>0I;!wEaVSU)M?w6nrEcS-y69v2C_&^@nJV>%qGO9y9XfVpfAEJiGPauDNx_#8A{- zXtAaCzbW>`8~UV{3HbGL!Fc#&ha=Iu#B31uI}Z2Eck+;IPA^XyKOKr9|JyYRH}aOf z^mx7_V>#i2w@G?a`ODDiQqX}mz?EpcD^3<}+OlTD&kUC0k=;i%HnY7E4)3W$xYlq_ zkJM&dKy^up^3F~c^G?xQeujO2=#9!@hO(SB^Th0cUl=xXny8cKiThOgBq zePJ)14n#UZcx^0U>A?}BEHUUylPqEMf-+#kDEu-7M2d5RDb*GF)pEU2y7{m^>GYzI zcg+P)iwg|2Ruxc}i!%P{-h#x83>3$6?p&4?Dt5aji3mi;!M#8NR?;?Ny_lnQmDL3K zd;XbkR4E(0kuyoe`_78B5OuVcJUPOY^A(XZf2OUp1T^N4Pk0>3&IJ`#{!bs*0o2sC zwL|DNp+gK^1tLYH_a+D;gx(}nK>`R!l_CKQRY2f?1?ix4lp@lLiUJBGfK=&4iUQKB z{E_?a_4?k-zcZP9Yprjuea_CANlvoXcQ2N%s2L<2@bY!Id-hYF5uc6#>hV|;{yv&| zTBK4vM?=$a0Qt_;(}|?0wGWTE#D|!5$B<#$_k65e=Rvw2J3`xfX=l=+va>$gDEqPlOnC~v)2&K?k8u=LVh6j@m}IH*5GPyzMu1HeArh^ zGTVllSo&@4nC*nr;~Mh!--+i$$cD>Xhb6Ox5Np`0_nqkoWnM7Mq-h$gO)% zjHQ+7qg|-U9c${aOXpE40MnjisnsX-mcCr1K)AStCFgC}v|n26j<)lm z;Nlwl+{c?0GqNh{0aW~SVud==%!fR1Ys#6nB9scbjv^^%eU{*KS#Ve^UYjiblCuG^VSg7)#Xfx9d zLpJz1*{p4IEoI9nLm1sm+i`qhK0jb%?2*Lu6`m53%F(Oy+SGX8vKN8jU5XcOn(_=~ z=;wHvNqX~yN~>6RK9x3X{+g+yuwHHUGWdsLUT#;GC(c!7wO1m^I;yHEY-UN9ZCX@< zYfWeAdudgw!@Nh^OI8b)nl5$DZzZ6^7K~ZxkdukE4n`lrx}Ct+8)Tf1=L%S8;7;am zF}XSfdN7UpkX%AubiEQ&%U*Y6rMgNahct{nhop}jHlU0@M z8X3&Ch;d3}@XWa3+A6KG1A3-r8BxsTM^;TVdafDY5cNLdXjyPdx%TE_VEQn>Bj$3L z0tpq=r>Ql7zrEFrCOV}V)OlC>U|egip{l}#(Vh<9A{InZvD`w@p>7--T@kmrXuP9O z9E2A3TJ{sk))T>ACTqtP;C44;>O=W)5ei9uc`fi`69w&}Kt@mNtHKvMR&c$SQn)+{ zKJEZMcXbUtJg%3*J?0>d+hOyDb=oD0!EUi&}B`p*_Q9Z#vxn$5gvM=Qqi(b|W zdT_qAMdDy6$fr`%U<#%d=Slj+$4MeEiW_+%Z@li&Wu&1drQz0gdrgg9FSeG{0o>oG zZJpxPor?P&H~4JgsdKQ&E5uaKr1%zDs|Fg?#E+_0k<54Cef7Ph+D@U^Z%}E}_g57ie1H0Eb)gF?z zk8VK9av9KL%2tTO0ea@xi0mp7VmfLV&8h(E-iX1KYg<)OP3UCFMMn`EaJjtdTZ<{^ zyM^GLI=3B;ai{p>rS2Rb63j+X+NZm(89jq7EP@k+vW;5n&v2|Me$Xm_>ia`0=&4w1 z4|1%66YlKP8+s`v99diq(f3+rQm$SZ5DckJz^=y8ueHj~POAloXnyimUO0{y_%O$f z<$oiJN@-iIhUC$7&GK6G0!t25OPs+%R-q3_Q5y97{(QZfrb2tl`c+{jbzssZ2HVF8 zfU-FfgCD%pa$!%ugbg~$q{^f!fDj08zBTr290t_ue(p8YC*e8*DPK(=XQ@C$i;8ATOdc}zFckTAX ziR7efHS7!2O}b6a`*Cd}@g?CrX30r1ZZ@eA7`gfR#7iN9>{$ZKLa-JD3x>fs&DKnlZq&Hczdo!`EG)k$Kv(FRtNv!n5hLchZp~m?+ z9FymzZp=W|kZp5&`UToNA9)SmYq|c4EH+p;x{+4%pz_8cWrk6du98_W*@be2Hbl8n zTgXM@UL3sAw=&t8mS%>5IK^TSM*$%^-#7atW=rk9J=fcDNumIh4l|eCIED`SbnX@V zqA#qTm|ZjE+}LENe@mip985k^A>eNDJ#N9i)cybJ*3X`AWR$38*-S0zuOvl% zzG!Sk2lz%rF+d#YVWKMvMbUQ@;-pH~V=-+H*~8nB@^R4ejSWf8!OK>Vyfc$Dv)A|h z*e30wWSY;s*?qI8lu0qm5Yjpb@Vc*W7F|5}Apz-)zGM2%n@54`Jt&0j&4b~6QcmkR z6=kOteqL*;X-6p=%IVKgYwBs=9gO_lwgJot9#fSBR=-3PX3qP~yTC zRV?$#WfY4t%JSas_HND1C3(&r5y_Rdi1+!{P7vw1;sQ=%9jb`MVzvXva~|;}WbyU4 zQ7Y>x#YKZ?B65eZrq{iZETnrMw!j*g@9Bn;j-w)9nH;QpQkkBAtP|;q?DF=&dz2NY z%(bStGZ~3g4M?h&8#D3wTGyENCQ>+VNJN|6G^nW2c?EZ^S+m>KRx2&k7)u=S_gVC& zPY7NRGVeJW6ac41qNxP9Qvh8@OQ(2sQmU1-Tao2e)vMR$SS2<~sa-T$uYIe+kRP7g za5H4ey_Is_(K}VB5BDlTN)=sS*HrrWxs~zz&$;%N-~$xDQRi5s3kvD@y7~Nx%4&Uk z#F&?uuu3+3*F8qA;-MKLQ%SWyj2kPf(__=w#r#4*j`mrpjmh~zAq{bkk>j+yhbqey z?0vWr60^5NqKvu~hSXJ0P-kreFsyNgO%u{hf_EaiRNh?&zhRQrjaqyKz`l$fv`0|fuNMY0i_ zHI1UY{pvAZ=vl|W#LXy!qYU)1 zdTZu+NAB#`6>_ew4=qh=8o!=tA1o9;v;H^kZ4fR;y^=ojGb?0n zCpK4VP`X{N{wl7#eKA%ocTH~ydtilQu-k}P~nGD zcT>fs7MI1LT537V8vMD?4%U=cPnhXOu=4YhE~9nbruCu^(Fq^pCohoB-@Y#LM1H1@ zSwYUnjx}8ao*RT0tB>Eu;O{lu27^~~ET|bITKqo-v(dZz+_+LZgg46fA3!=cW;yB1 z&F0;_*+|BdSsU~4&c^xRHTkDV`LQDj&g>uDmh>9rs+f4w+*K)sQ1MU)vA8L7ngKOG zm;>jh0t)CwPrl5;H#X|rXOM%?^aKdM3lw=E4YiyxE0e@Z<7$jC_bylMAmn&6B)0a@ zg}Eh>V|rv#clpMGcilF9OK&(Bc@mH7D28R)(gqE!)NS)>&2rB(^9`yGBXbjyu&!Ei zvU>IDE3y-_NyZ&W;acYS4ar?(hJEv67X$r>iFK0R`j}o(y3Na# zJGQ|SJCwLa1nb422seaR?}jEq7^OBFo}Q)1g^0@__imlVV}`_Zf*^omQ~>|eB)LO+ zA(?Niopfp)G1&e$7>5Vjj-#FDhBBhRShV904<}T)D>B!&O~g82`!y*mvU0Ui6pmEi zt6L1p$9=2agWsw$b~;e9QgpsOhKw%NyfY($>{5<)iUnyGm`inD@!s-L4&xsJj(_Ty z&`9ET4c=$NF~liZm)ZRc^ys^CZd*3_k~Q67dO)uU3aa?V1YG7~_5LAiWyy2IN>Bgj zF&#=?L9W+`jb+uCR}Gu&!NYU{5?+bv@VvWl{j1Stm*6Ee$GHJxmrd{56@UXP$}r4F z@>75V@8Dzm2>#~KDqU{csAC8cE#p(&e;96*PSre29yxI_vi?wA^}2yvtM9f2}XeD862?s zq6+R}I)&+DT)-$Hf?zo{Yi8kq$T$q_2`89*00v7AboN65*$61j-wWr5UFSFrxx3@oWga7hBu(+IGb3IU1& z*9!ldN<0GtbE^|ve1K@lUlSY%E+36k*S#`MLJkDDT#I1x0(7$%!4%g4qK~|QJpnR1 z5TFRaISvI_d;Wa{vQEJ2tP_~l8QAZYKiyYc9}Ukh-J`z-6!cwn3jIGSNWhOij#CY! z-z=!h|FA^=QAE<$Ap$cI|CVF=Z$+fPm&*^+{{Pbap^pUI9EAeG{V;IUEuaF;4CoQT z32!a}9PjZTlL_D)xCq|$A@qcE0`3E>@ISR={$BIfg*WO;AQ{1b>p_4(62IdF!mYs5 zEFzx;;D0up|7PWf*%JO@J8eI|2<}J(+CHPewMnPP(!t3pnwGG>GStKtVlD6IHr5z2~W{+Jija!OLMqy@eW3&8*Q zp8N;#R@;AwjD)jBfM0c-nhkawr<+jd^zRF>y_*n(13yO;!L2v~M6l@VkdpmMCrx

    i_@% delta 19725 zcmV)KK)S!w+5^YR1F$OrldI+sv!!iA2nBjz)r)lEZSbRvT;WEMd1bvEJye!ZPyM?Gn`LiXpk3f zIhdn=%8oLa>%nEjC?OQDjq!zA#tF&QU2g?1i-MQsl%Sqm!)h&7eV;5(_Dnjj!P{Os zH$HN`C>8?SbBRS8Rkm1lXiA=NQ*o)?4S^SMXPstjlj6F{EO=G&$=Z@-bUjYL1hlXp z7cI16uZ1?WTiAyV3rEpUtojYSVPOIV3x{!k#G?1+MFW!-E@8^Rw6wfQW!;80!#<^T zsPyTHsvFqzV#6pAXAHb$;cZ;D@D45;c$XpbKe|pyZ{m&5UKK^EPVZBUH-nax9cth4 zZK0QHt-B1zYJ;TEXuSM_c)u##qR8}YF`QMW~Ozd__oK6CUWN{LzhnL+ZMXD_o{_5;;VBn#~&C$B57u80@OQ`62eC zK85xWW~!?-yaJu%&0C0)GSnRT492uHKR`?_y=1(Lx(FmIO|d!%gXA}K*?&t|-%)no z6Veap!;d(DpA@?kaVE44c7u2hNyTmuJ!B23U9URVM|&MwJk~;LdcSIvAJr&-XJcln zvwH>gG1HkF&=dMC93f`mg#Hl@NX`j;6(-S+9lnc(5T;WJovL^nO@sOuh|aX@D`>ob zM}ZFzL93R=GpHl^GZpn0YRs=VhTq8kC!P2m8T^3}{H0PkPUISie3}x~$zsyU=T&2} z8|h_LQcUe+QkqJt4%)yu16BiDG?9ARsXzn`5;djn*Rb&O9KQ7000OG0000%09FQ7P#6LL z089h`05kxTq39ixT<95pl~Y}B5r$1aeno>ZX)sMp&@`zw zF@2iC1lDYK$uLOySNb9iHU0p9l=04%R?-rx`>-=}?>Xn5J2&&|_uwah$9QgG8VeR| zESOkKW68o@ET^%O#;V@lv#^Hy77}nxtebeikb32ZzIx4&a0|PC49QAV7YtXcekk5| z4)%ro!1n`+IMt}egIz9teI5prs_C~Ww=JW?-eyNNMX3B5SCM3}--e-(m4LU~f-t3O zBpY5s@_Hb=uH>zjklvf98wL@tuU-@=Gt4%G+9rB8lJ$|CAB7AnZlU^_f8kyzls6t! zHt~>Q*_~K;qpZ7sHV#V+i|A1gV$%%Sm>BS|;qCO= zN*pju>$%8?kgCV9=2k}_O8Q}=T(}rwcrga}kJRk>7@1IiQKiY{rj(paB;CSZg&{wt z#9l>Dcy2BLw^YvdXS(OKqrq@ngOQP`!K%I#z2<-sW{ljHR$=o064fwYZ5u+ zhvat@)w%pJ5}%yp5vH7!V;&*>9as9WzMjcBL<0sSdrapaBrzC~&YwsVFoW5l^h;We zp)WSxSMCHjF!ZH&w=oyf?!@?c+=xpX)OrEeVd0jBWz&BEP)h>@3IG5I2mk;8K>*~V zkK+6e004L%001EXlcDG%f2~;wcvRPQ{*N>>?`ib3Fo0md#$zy8Xf+svEo^KA0tSR6 zG)P2XjGv?@X<#%X&%8lk$HsO;(~YK0+{Lu9vovvFe)@%bvwzMzI* zSHo`@_)R~2_$~GFMaA{oCVt0{-^K44_>vzMe&3Hjz#sbY9R5fRUsgPStcI`nu?2r( z;Hw7y)Q^?;Ge1_~&;9rS{z5JPr5gUq#Or>%4}YzOuNn9o_552u-jBcY|Ln)t@h=Acf7Qgl`LPNA?uGhO4^-nD_zypx$A6mmFF*bp-&7L5r6}Jr@IT6q zZ>!-AHGD@6a~uR}5H(a7QfY|C6t5p0;-h6^m}2@dC{?ETO{q4-@}m=HM8sZ}g> zYF5vn$ud6x|jyn7cPI9gijK(Y|D2Jn5uT-O-fmkWmmI>D>9#r9B&^_+M_Y2eL87RO*zT- zZoNn~2H$(^Nr#!?Y|u%jqKUYmerl03t>xsrneUYBf4estkGi`AosCOau-Ns*l+A+z z&z{66jjZdA#+{z@9%$D-ruq_eOzbl58!6;n;bwMWhzwx@F5n4>whthvUl+_>Ym5A=s~TB3>eebJbs zH5m5jf2cBzby3R7`WbanZZw|LRa?531<-YF#F`NG?i zNGr|EB|}DYSC{BzbHtqyWh*VHOr%{wL&2Zkf3!Q5b{TcYp5$^xl-pMpR>Sf6MMLg1 zWSb#(8M57w9fsUZgH!gHGmwl5)-4G3=7j+jN7Yy{F>*fc+UE*^+^M5RQ4P#Wr=5z9 zEX?@kvI$-6rAn=Tr0~w7P+O#@(>P>dp$yiiztt{dyj*w>D zQN-xeWx>g+q8%D`yY&Loc8_2g+kPY+vt4JP5Q+8WGgj)hj$B-0o;gLK(}^U#36zM_ z^(`M+fm(4E~e`vl$DhshyiBvIhcXEVP?~f$X$q`32AzMF> zFl|bXg~#x;8s1?cjk6Y}F=^o(CIvf}K&RWj%fUp6(qZ8|9<}g&cn32u;kr|8Qwouk z^M>rSE!iV`EnLDoE&LolWJ#CoBMRnwf3Z^| zg)>^*v268XU@Bfx^7pIZfF)r$XyNDaQ46o(I-{rzZ`EnDWsDn-IZKK*)Tc?IiOI%5_fabxFr_ci2vE-~w=L)lU?`?%0wOKGcn#dZI z(^CwIhMcqHygbSn4;eN--+q5wB*S|<;I$diPfGGGwiTew@@ycF2+`Y(6ndo>45 zJRizkIp}`*L%bM1;zjJm0MK2M{-YDg#B}x&xU%d~C^+>0c8670jN)oMPdcruW@C_- zTix^egk3UBTFSite+#~S{3*xH9Zt+x(P3S}r)AVAwRV!kY^dw=NAdiH)i-%&G@4B5 zYcsLg>n3#k3Y_zI)Mbr}FUrBj@)t(6R!eu|#fe+9KxWDPGeEEUok!BVUC#&V_A15Ppp%{!oIIJ`Lrj5a{@$;B_Mq-JSx|lJpk&y{U;fulffkev9&iaUX zxtXoPZE|)bf9)t_RgJMPX^&6ptK!sK%J*VQ`2V&|`Pa0x$^v+3W*-aGj-?jlCU;v` z?c-AciZi^eZ|VCXcjT)3v|BjzRCF{tsU&S)czfTOt@RT43NB{LUGkX~mHV8yjo-zn zyaJWU{0GVdW%is{w5M3gqEDXHZ??vGMdN1^XIL=zf0PO6i83)R_mQLm)_LAlzfNi> z=b`$7zNvA~QsGx+IR6FY8%rc7ZFhlHWt=Z#RgMd{VjcP+7>9u%VwmJS4xj=Ftico> zDZD57o+^5G5l|m0oCnmmihiEUJ^8u8r=Pr!;q4qB=i30h@bFpH)GRHnGmxuV%oCci zf@2Fzf3)HPXH8i~Jc+0D?;xwRBGEIYszT3{vP!Mu>70rmqYCv~%S}x)sAy__8I?_~ zFT>Lm^t=pj(=2>L%`G!9UWQ4As(JnE=seI)t#?rF7Sv)ZR^UzsXB#%+E^X7ctmJ}C zn+i5<((YF1*|fGv&6IT>Qu)!9v#wWL3#QSU&<@1tcOqk;?c{`t`2YWH3TwP-r<|YilJGo ze;lIXh8e8t3HmZv-Qj6!4tiz~WXRWa7(q{9ZP3Wzrl2Q-n>)PA8u2N!!&Gm#Z1-2~ zsIJ;k6Z8hn3_?TOt16y{a}BpM)BdV_Kq ztZArOfz6Xu&%75Fm;4u>xr{ZM=Ip3xfBGcMX3`p}UqQ1EtwFPLWmN_(FU-A%OO=7v z4BCR;8!&_34BA_7pox?_UciQqy7KFWS`XG;zsjI^aRaY2RIlS}`k77Tk75JIyH5%jSWBm6svqZnmICpk+q^cQfPp+A9lf8iuP zh==eCIK>aRVd`}7MU3G~?A|XUim&1{wLADaY2P62o20#g(;|q8hte)+n`-&@8lUfC z61Um^)2QjGR@JMk`*Yr82I2E`>TG@O8yTSILy(V zvT}?1#8kig$aVbV45Gq?)>&*BYRX`%aJZ8{+xT-Af41{y#|-Yi(mjigf1$w6<{8|3 zT{mEe;B!w2ButZX4(kavDvu2myq<1;7%yo4R(ynU&w_&wVjJ9Dp?+tQ!-tRM(05l8 zb==p}`Z;*626i>mrVQ@C3`^Je1FZ3u!0uUe4$WXsU~dLpO+@N_d}gqpO*;=$S;%~X zx-KxJPtua7v5H_9q6PO6f0yQAd{+Tpb`{`d7i;)g6-)x%FKWoVs3E=L+o)zLR}|v8 ziA?;m&&E??RO;i(C5G)l2I0dkfrA+w3UpU~8izCJ>1he{s`ow*--jv#M3yux zW9;82==rf+jG7o3u!BtY%W8H_8>{~w`hA4`(9imxU&OD^7#!L7FGdRH*XK7FIQ1~QxxKYwhWH?hba;XsOOFFK+bTG0r?Dq;C;bv6K zQGKPZVRp zDsNFQu?s$d+nFEb+kvb>Ip2H?>}PalEGFW!+P47DgJ06V1$kQhvc5Qk*hRm>nU`|5 z<5xNJk@JSu8vHrpI(QqaWId?=p*6X-j@YmMyLcVW!2iFq$dJhj4Vhy$H>U{z01XxZ z04kHv$QG0Emh#`26359uyQkBY1?kK8p}Czm zZ~j;3y%`>P{NXDAR*3})o}pqho~c5`v*hq>Ioz$_IVvh7xdMOBRq#9o&-dd6e!Nf; z&Z~G4UhKz9{CKH?dsNg)##&sEi!W30a=b#pD^<*N$*)rJYTPSf?~}u8)mpAj~w3X z$3;Ibsi?&Joni#Rwi!@i0aed`Q7%73*-Aog0HIBj;{&K>e$=T7HL1S zucv+Qkand@a$tXhz|>YVnX>hyy=HBBnLaG+^odaii&sr4J1mR#S&FJ>brE>aiq^ z@+J5yFf)IAsMKUfx^4{+ug+sxK+Pg=*DZl+mm_92ZHvVXu2v6OCKv6Pk&+Yv#WGF1 zEk@poA>B$D{8*T;XEYvbYBduHJ=rgf-RR=ONOO)1SAG?9)<3uym1YU)qkvo5p|X(oPp^AC>Ji6ST7;ZVn7cW#@WD zA>u4@UrmISRhc;OPDR#cmL|DO?zk!kLV%>Pm8z zUQoo|P#n(MtU~!RriDw`{BdTb)Ge10NyBd1x3`OHf^y~;5PQxgZT)P{9`c0p5^a~+ z8rOeQsW#*IHZz^_9fR!D(N0}qHc^Gq^s>irt_qDR9Mk=9@%rQs;(*U&_#Lc=%lE&9LsP%?)mbMP4o zvQBf^mZu50e2`h7;oJC*g70eh9==bWQv!eGr_wRQ7Fhj%96Jp^zz;S22tQWv6Ah2z zr_7@9L)59K1{p*RKf})z{6fPo@hc56JVnD0PH8xSrz-fhhTq_~0&_gf>XPL+9_Qh9 z7tT=SmC~WVEA-$P|8CtLY)Pez1hdAHe7~2&9|Y<>n76W4rEE^5znE~YL4U-b1hjwr zJfcbN&K2Y3PQw0K!Cy4|6@Sz4cNyG&;F^Yi;u_1toy-eskw8_!mVe>ja^GVL{-fb> z{8ynMA;c6#lxe~z$`w(e2}SssPd7M0^wfAx>`f=_Si;CH5?@qmLX}$hj#GI}R0&OB zbE}?Ans%t)ppglNFcg*NZixO09XEfiP}V0Q*7?wJ%S?o#Y)QxTlo6_5oT^_@kcZvJ zP8d;J6H`UC6j!5&X_}}N0Y%hlVmi{SG&errnwWuWikPX1SzZ zVA%QXV)j_OC~cxjw#N%>okUg6LtzEk&`>lNnC>M;-aFEEi>w%da4`gZuyEq;OB;9~ z4itAnw-Br;X`z#9=Y<9r^_YLsV0hotYKvu)cKC+CUIlfmD|xOKlut*1VmMaN^g~{0 z<0-!$76vmy@*p@J7?!Rt9Q^c&&YeD;~g2kp6H``LzugJj^* zPv{KX?H=Ag9doP{nz7-dy8+ciy~)^F4XTfiy`(hpSMayI zaTrrBIV}4)Ryf2E_H)!+1{}Z>_*;oS93&Svi+iY46=_#TP!?G_0^d#!<-0~v(KigG z*%$O>;6D)bm0w0>Us<54r_UGAdNP=rLG?JfMv|vV@_|v*a%Z5qJXkLG)&+fy8BA}k z7{QEYC8&^EF^YegWSN!0>_`^@}6H za3mc$0w%xt_Q*y#N~|f;GCFb;;l9Q|!!R00u#`T`l9uL?#vM{k#ei+7LkE`7d}-87 z7YY`Yfb)NK)GX^KV6< zDX=nwTZgf#7_K`HZdMMCuhA^rqja6ryEmX_usVY^8LZ9VwjB>(YGf4a`<4#l_Nx@p z9N3V-#``c^5(Arjm$A98tg&YVTZVDRRXV8UA#8sYxERT*)i#Xwiw<%PlV=?^(OVr1 zf0?7(5(WqSs$t3ms9_yX(LA1@FvGct+I3LRP6k=(-pIh!aNlX1;jE53&*B`l@1#{{ z@g#oDW2(8UPv&1Oe0vqFdkmEd?h17&6spQcXV&08Cl7!Hje)8Rw%v>AZsa-X$e>fI zJ%Tze>Bh3WQ1?@;fjP{zad$3oa?ll81~G?X_@d2?n@T$vn8~ zESz8}ORlH?50itN_yjp@6ylSAoG*V^d3+Ri761OS$1IZp(ojMdXq#GWb1&g4gu_BY zF>MkcA%p~^o$L;qA+s~<>@0zLP;IS8z3Y{FpIAku*la@4#`{2Py>HQ0tw%lUANEs4 zeQ#zr+1)HDF`v)=&UgLZ`@Z-4P0s!2p@#vi!awF=11xTm+`Nz*o0}9jj*Nd6q$M1Y z5yFUsqcUWqd2)CgI}}PD=QM zK*bT&SYcRE)fmu|H|d5Zu%P3xdPI%rR)psp1e%tLxSZL3TtP}^bI@krcOV}=$PvDIW!vm zsQJ8#ZyY#cWyr#)sop5%L&yU)@+Y_zNu-kRGT$o8kQO(#sR`wNg4x%N&RfVoQmdv@Yx`=jDp*yw^@BAJ|jShczs!5kc!lxvhlJEdo zJ7s!G!fAoabIx=lx^wWb7G>S@di1!dI%%8KZJkMwX8>hKG;Q0O=|oz|iL9=KJ#vqg zwxgQoq+D#8n2bQP-HaMmilEe~IYU-V!lxBHh%p7*ag%~g*sNd+H_yY33btaKf>yLC z*ntem%2%ae9J_x6mJ~yDTUs|_nyp|0XB0eyvlQ1RYgoZ&c)kOlRq!w-6?~4H&-2nHfBgr6z+IewwwJbtO*S9nap-c`(7I+mq*i({FG?4DyON29CUr`dM?1+j}x=Fs^xHIZlaYSz4Y z&YBA$v8aR&LQ;}v2H|;eDWp(F^ zg}~t;gednZ-}hMbvMfr=e2A`lcC(9^XFeW6`c&bos>$Ea6-1(uhSXG-c9d$H-*mg2 z0XMJ#jdL+zpmg~zRUN&0lK&pcd(zE>*Lr`pW%ni6l8^XHDS0^s8(6`{|N9y3ilPH` zk}Ne&306K`q~_{Hz9YOVr%M~*B~;UwP7BCB1S=}|DFjfzCEL@3$nEJ(bzuX>mEc|2J_BB?jJ|F zH&Zg0U%7yq3>J>lyO&md8C*7s_4OH4j-r_s1TT6UizaY+XTt;*k0L}})v421Lj4sP zgo%D>pC`2PK1lu(@cTB?+&_V3UCVz*F+8gY%co3e@rV6cQDOpDW=SirB7(*Yt|p=k zs=du?SbW%j2G8*!?DwQy+n2L=0xMeF-RBCl1j2zcxK3acn|XA-pyy?%C0L}ShLnVZ zbWG2htfFvm0=0c7{yUkK9LS(9gL>9SKiX`_Zj^ay8&BZ2mOzo{2#NG8WZ{36E4`^N zJ8dpdn8&t?Eh2@hrwGDI|=f=^OT^^$f!$*#v<8U;zxe)N%T0Y-He`!(Wm z^wX}uh`5(>Yd`TG7x&-*S?t5pq7pB_L6UMF4X)$>X#*6Z_x5fhPpE&i(hT_m_DKjy z=zazZ=HEzmIYPqV1uT{jl@NOdt%oHv{R;>FjR;XeBQ`$?I#jWh(k||$9U^WTf^s;6 z^`}Z^ui_D8PcS8h+98)-$6>c0hT-ldV4{;om9(}2-d{JZ_CWq0P)h>@3IG5I2mk;8 zK>!7>3+{XZ000>V0003klhDW(lfdd4f0dNoPt#Bs#-FowD=Qt~L`A*?nX(O}<3kgo z7$b?%1oUEN3EmybVHCQKw4M4NdBcS!5{)Kadf^{se9vjw#+ZR+*?Z30p6B;IZ_jD} z{QdC@zzQB2NTVdfLWaVk3=d?wq@ygyWdj+k=vZYiYChj{#mh!rFbr)S^7q_we;U>c z#}$w1!ajH0rZ2Wd5bzqU$VDq$?$xYH=sRAGR_XC72J@8{gxqyE4}^WBQcw7sE)N0` zFl-bqs*76A zU8k6qci1RKX>LZVa6>T+*<>$5iS;0iog+kU60*UVutQmr#$hTyP+B;JR$4qo@=FVo zqY_{f(AXq0YzjkcS|Mj5e;LLx0jQaTGc}XVCg?{`J}&c|MtLt=`U>qgbnO$gcBhzKCXV*GpkfgtYWL}rMG)Gk7=KVp0|W{H00;;G z002P%fpp8hq!a)EK$GC7D1TWAd{oudKPR)i$?(_$Aq?w)1VR?Vjs&Da2oekd2@nHS zc_c5%$Sm>A8rEuC-RHRy5!Lyf-tM zBo6_9Uw+BG@7;Uuxo7#GbI-eZ=8Fdp646Zl%unZVjx@uh87@t(G=C$q(d0=pQeFdo zD&SEHk9HBi{HUM&JVxfmN;A&S<2fkJ1V2yYgJIPoucRPY>`k87Y-!y23O3G@eKKc_z>DQ#sF;*E!P6m1f=mI>^WSc)r4AGQGf0 z=kh`sJi*6{r2m?qPk-daK3*a-fim+QF9BO>LRz}t-yk6m2AD`;uIvLpDrzN~mny>rmbv{ku(-l5L9yj^v zWY+w&f;TH%@26G5eFZo8SeKVZY33>1NBXYv+l!he3Mm63>_Hu5MRN2QNR zGtbX0e3p+5kvX2tCMQI*tv+s*zD)#bSNLo{HH%%F`J4gtA)hPFHx&M+pCWvUH0KH7 z`3iqa;cxrN5Zbf&JF;M#D0_jQKH>}I^+I{tE*`p2;foZ$m`SaS#!W38E^pTBw^*-H z-6#)h@wgsm3V$rEShjdw)!H+bR@SUtQ@Lc_+R9bcXRKblb~#f{)tTB>tu(Afn@Vd; zBNS~~z%;NtCj6r2dM%vLeS8U%Hymqf(ha83RWYNfw8_vK!g^_|p|!N=MroBbiIu*F zSZg#K(;Aq@IT2PaP0q_MEt=W97$QbChlTS*rvGa0*}oPz#}9Z_+FwGy#?2oGrWWFILVI35=OmlMZ*BS ztwpal^#*Ik7q$TjRfEo8%2eGW-~s92jeosK6?zJr)P$O%nwc=L`Sc_3>Sqn0B(9qk zZGfUF23)Nhkx)D?@J9glfwGoq?yd)6{+njKm(y;ynGNbp3j#cT9U6A&_wW2bLEsaDAjDMa< zGSCK6c`Opqq6kM7L@^^7gbH5)lZN88p(xHU=;|t%x&dm%;?ym2?2m63f zi6^YH1ybV8SKkbE3?0B8w$U+30PYIC0~aTvXNREic*i))^ngc?nnrut36_Dev=k|< zLS`hV!2{`(A;FSjvMOU-(xR{m34gNkGMH6F6A?X~*Ikxa?gm{B7v=0!p3LjNyA4Uc zQsEs6Uj?+*$6DGmau?II0>_-@ES`-vSk7hP$rTnW`ZdeClcrCf&eY_1)TPeF|Id7t z)izz48Pd$`kz%$;;e6nxq;T9NT_>d&%@IZmkDXCw9hKrW_sG1Cm~c|O=6?yVl4Ieu zp=a^&viOvvSbVI>Hmhw`&o1+2mj%a+gv^Ke19EZuksCiJ!;4=LHi70cB9HS@y$>nQ$vJ&&GN-1D121@ zG2eo?&z#K&VsL=2d@J9k@@~Fe>?7Z8(&}?ZFvoy7pqUDBNl;uOd}B&PuQi{G*K*=S>6Uwos|Xi{5kou%)N64K~J%vY@1#KPmjS z%J1+q$aAsyv?xkEmH*6tQTVSa|Be5y@;~^Wm}|AGL4TFs<@Z$n7r&1J)Up0i={^3p z${&aq|HB`q%-gR>Q~4uFb^jF~kLl}yRlTaWk(n7cb4rZ=vH0Q>l|H6VRQ{B&R{4K? zI|}Q=CwrzTM_KovQcg`v1fxovdF&tGDX&}3O8b*(^p|`BXCfuDd>qufPC)_QFBW?F zC8LmK8h`FoWcHG7ZL<+;wZ9@!^h>2(P+2Lxlfj&BK~VBG>1J>3hZIchdkr$O4^hU& z!tesetAyZ@?9Oz?v0VFnr8|_IK4M#+Kxy@QE>!%WOJApK`^tq`Z>t@(a?TZ_S4)1B zEq468ve1Gf6=1}-nps*7;RFc1E_Uo10SXR)f`66<(Rye&!{NqY>Jct@+`wLg;A`WO zsg;l}(bAxqQfpzrhMcz{842!!sdB|Lw0C~At~m#ovE@CtJ-G#yj@a?yyQ#@+wlFPw ziOuAzcXUB{fBN(VQSsrmaw7Mcv6LK2C|(h1G4X-wZM4n;>kFwLvyJ^N>nMJ@HlHE2 z`F{zHVjcZ=oI4&mTf!S2>}RpGf1Sd8Ni1dp`dZ6MR9!WuW|-oE!BX2*X^AK*0Aq!Q zk#Wu!Fg?+c)@Nq&+p!P%(d**X&qDDb8Lz;>mU3rdUsc#yY4PTGESxZPiSyo-LOaSM zq#hRz-OOv1)i7?)O~EjSVfea5-onv7GJj+Qo?CAVStzzqjW_Ec$(HM{W%i}kP$0aY zl|u2QsX7^=X$=7EaYw#^#1=!KYq=JUMN#L5ZDmIkI9$D0`8_U<6yY;*&~wkEv}z#} z1r1IfE95hdjl7J!*ZX>Qr1Kqz>^H1uDtTWfqdrLnRo120!ea`QephRfc~_?HA%8Pm zjDyX}Hv^OTE%n~}w6RAQ$n96E0<%7bk17wOF6{z`z3q@2oLG~cJy$0yf2PSt#eYFc z9sBH;!%40X*VUx|ag{N#z{-qOu~r-nT3qkhBa_B)4+YVzx21WsZLV&(ZIr@eWVl??|&n2VaYxk zwAb3OILgPq+EtVRQ#w zg%OcvKlw>Pzo@8#2Cqajq`L3{8ia?TW$u8xgL29|(hV!~Vtio0+eO3c3IpDNr?{x3 zlX5#~#G{mVZy!0QLdQaIE`NrsB{Z6*LGtOAoXhRq(sC}MtLYj@%-?_%#WE1az^f_z{)Nf zRaewWqpMwW-9v}aL%uRkt~=`n8dDPRbkLZ&?p*iv-R~C%Jg!_QIe&I{_uIuCG_DL< zj<4&aV432Y>&x{8ya#Wl=|ibI;LY{T`sRL`P?jCY?x2b88)-m588W?tj;jqQGBl}n zn~!&QKOay!C|}ItvdprKhN5kR*iAH;ngNXvTzDppr!6#v!Z1{Xj;9uw!=RHWPHV`d zO_TuDRyvE?s2yYH0e^s(TU`8@3(zevQZ}uiIdm)CMm|wGZPp8DH;jbPz^dEn4j5-J zINeEiL7p7&+JhBt@CegS=x&&G5q7-?PhRwk=w8|jH{Az5CFJP_nOC866v|WReuW-j zh4vAR`+|nzL80+{h$bsk{wWRY<&zHTOk%7X8+b(ULb$?HU4L?bCNms6JZFmgVJfI| z71!*isr#w$Ud$9BmE3@-;=WU^15}blz?#5vKTUfQM5TR*WMcZgmJDL_$uN(^n-`Hf z7;zdzL=?g_3lIe-AvRYbIyWIM#i+Aw3DX8_wD88((|+*C0+&s6fF6VaPlDUJFzcp= zFt1u>mbr&9Cx1p8Os+!|ROsNSLo^9y>t&Wlpo49e7qF!SOGU{OR9;xzNi)jaB@$~h zchM}sa8_;3Y{gQrsHV=1fjKpGo|2k6Z@?`ImwE1^xq{+((E9kjX{Z%i_`d=h?w|pP z^WliF0Ag%1B%X!-c!+Z%L|F;|U2a977h@{@)XGc)5Pye1!;@r_inKK<=rJqf$&*B1 zmi6>=D@yOPaw2~QhM9UkPEVxWpJkzQMHkISP?brRS+J89qFY!E-Dj1EOApTVxaN9u zy}6#7X+prA>z!GqND!T{lhopXa)1_PQSCM_V(ZP~zAoMk{48 zIH=Im_+^-AoWR|co&fPPR(AXa{+^}h>{9>+^je}nhEw2cJITGbi}LD9V*VMA{Rol;lkdxG);O3oTPVgkOJ4yvg|x)T$xt=>&zY_{w1h{V62PVJyN8Q35m z3L^C@U9=G#zn*hi2c0fpMAt!QbkL@~&?XmQbrG$z`m3lm3B?UG0&NGZ-3j|0z(M#R zD1ROT3?HU4m}Uv0p%(G536R?Yh@A)2TmU0o1kYRo-&}#`tLSNf_8Gbs2D}O8yOo{? z^$V6qTL9Nu94^n(FRc*F$M}obt(nHsuK-RTc3ML((aS(f8J$e8(68Z}OF;W7{RU&# zz_YK?Z!NGtmd3ziR&b*zMIQW}1@>HI#(&q+V6PybuN(XNQa;9Sxk5`6dR?Iv3epN4 zqH!1#Ah6aqZdWLI}PE(pfzsO|;_sHCX<2lIz*w zP%IzY7hQRDYyDL5V>qNaW;lVa;TEo8GY$n3wj$JgmAtslY&TeNKZE z`U{W!6il+@Uq{Ik|3z#rk+h?Wnt$c257|gQQ_h(!a?XVC5N5zEV#iE$C*_H9#qtt^ zdL7h)P1o8ek*(2WH=;A@ncg>-S-t4}W01|Ii8a zA@cRd;PfeYeMT{$%Rt|b{#^PT{JLoy3&(D{4E>czLSpPSu*)PmmHrOC9;_Zu{{(k0 z__xw~*h3QEj_%g)67F+avjD5uK7c8 z@cOEYN>ISn&2?W(gNjS6@~wS$_qzb**~m__vjXT*qdBjmP}Y)tE6*YZ6_peS}U)u75FG{g99J;o@3;b&HkjBSHn7z z7JV=?K1*DC9XZ(_Nld;pCm%T3WsMJwUDo&j56SeI7FPikCwFE!Z}a8uygtL7zzPrI z!A{0tXWoY~24(ROq35CWO$+lbyt)DfN=mOMjgy?e zPk-?i?{@_sY83;;H${*ZK`1IHg1&9rrEZN$*`|trrCVcg}t1 zo%em7_nG^ibN{X){zTC#B}3|&zucUtO-Zx7=LNB|`R;j-T93O@5V;0VU0dyCv}6XS zYqDIswR=lIA6K*<#G_KI6{wYpC6VuUS;blvE?MdtboxL=!qaq80lDYF{tG``A-#l+vb^>kUGy& z${AvB$VAt$>Ti^|Gcr4x|6z(3-C=n!I$Qsz?^S0FWWjkagq`7Qt+IX$E z+`?kkLOjv6pK|)&hxnRmp6j#tam1D_tC1}JtV6SS@DqQl{EF1T&(m*rZu_`&^-IPl z_2sLk2#GkRvhDrvxojpdM1>Isy9Z^fibI*I3uv(L9UH+Ic}@LXPCv8qRr3r@cf;3d zFw^vu$^5b?wOh`T7vJ!wc`8b`Q<42!6Fp(~emx}lOW92aO zX!CkX(+l~xf-P)RiVTMw{J6Z^$E1f!R!_ zl%hF~`zQX0ODAA|@siK6;CVR8nA2 zujGs+;fi6~eaqLKlQ!JAiSjzWmwigESVgy#=H&C3phin&Wy_;V#r+F2ZH0>7Y3{R{ zKE>XzdvTUawJWx91~5jXGsb?y;!x4BJ0FDkug;1)@5!w8JDw2ZuXCo4^#{N zgc|8@eQP>RmTzSx+sAA%zPK@$^jg?i_WQ@hS^}Gfz5BVqjxN3CvqxfFXARfOUv{nf z+1Qm!=RJK=o^xRUh{B2)e^7hk>6=$ly(7Nue7Svk-ltk!Qd3B9Gx+go-{~G!jg!Ld zN?HdGUJ@h76#7tacexdKOjN1XdKXqrMPak6Nt_a@+EK2vHn(^iIYzl0%W>`S)SKG% z(Jw-Cp&sMrV7*4CeN7aXEtGbspJYbg#c6pn-jnHg^Cm&}Ee;;O;&C&@ zpYeV4Yi}0+j7&}Ij^!J+jx$+ewNBBz@7=Q><#UD(VBoKY-?@CzBd9M+2N#9I=ms_3 zDZ;(eSGw8wD)(Gl{L$~10@5Sv#!UGJsfF=%uLcKwWH&BfhRd!rI5-pJjz4 zuBRa0>!-uNIpg+a1YRtb>n#~ezdt}gcRmR$D0sCVxV>#L;pxe*b`o`Q{)0@IbxpPI zQpd!soH}B?Ouep}JUWav@{SE?Gmow!cuCrHd*HbIh~GZ=>Y9wyiVy9O-_#T(`PbdO zmUAOu2evf0(J-V@v&M3!B5{TUg^BJDq4LIL+#am6<*mtr&$0ycmg|`;|Ky~e$Qi43!T`zm zI{Zd^NlyuH(=~E-{DA!?yWL}zj}q9Cu&XR%5yx5S1aqwTzm)x?6a^*WyN?Ly+>}S+gTC!@E9Q^s zdB&~@<}&SPKGnivDBMN-nj#2~v!+WkYl?B+ytHQH|1_$xl+{Un!%bk@2zS6NiG-7_ ztz^XI2RG!QD>=D5LW5m;^ZHtxFj@75fp^UAoLa6*2$$wVWtb+FS63*MA%!d&l~8lo zbIsWMi^_M3^z|id-Y-`YT2D#NooToj`BgmuoE5FOE;%leyz1uu=m%C)n2Ge)POh!c z<|FPLJ!#T_o2Z;y^Ec0$k9bsK^`eG;0F(A(Rhi=3T=V4DaO_9dHWg&931!DRM+}f=4y21QI&yc&SJDbe4M)ARVa!!4DM;K z5K+9!KcPg#WMJ!_tD^<80|G8COnxjs9+V$L<#Jy$M6Yn?U0{75V?BY-UuYtmFT|i_ zhqu>ucq$CyLO#jhHtM?)LSct@_LY{mdU5dlUQeXkBMvSIRTeo69)V-wlNihgskRQ& z@+qK{0QWtI-0s)N;el>*L7!dhe1MC)kB5w#k2k0e7hswC#l!9*5n_9Z=Wsz#dk9&o z@|kb9FcK2HFvttO_2mXB(~5w|K9JPP1F1-GbC?~Z4`OG5ylDq9Jb{T;*+f2w38YT5 zqiD61pn@m;&}u;IUkbVs!~K|P;L?mTYHwwfUlcK%3Gq*z6iL+H>KDI50qhWD3cL`c zv8;2Nz#}1A3+L_$fqGC2ljo2C@d(XCNkM|6bL^-+i9x@DLGALw`~&Xh2?>K=Azzzg zG?UQ0AZmBtsWnv3C5jUUL+|m^QldeA5cK;75t%(uAC?By&tp*ky`P5&p*>Kh=0A}b zLG*$=5N1VF5w$G4Uj{{6_tL>&U!ff+$M^V2+d?ZXBh=o-*Drz?&UTiz6q8((2Vz~I zpo(C^A_hqF1jj$ffrAU|AaxN5-1ml56ez#M4xSoDp#B?WP#}?C!Jv+!1c1_TF>r1W z1DIa{GvHF7<`4!*y#o3SsR6B5z$^qGD8qsThafBNDx_i|ksY)eMgseF104xa!vZqme=NfhWbf&?@pAyot{MltS=BGCKr??X)LHb@#d4|GOD7YWdHR0U{= zqv3By^?*ZnX`;lK8PJwQ6Env2fwfec$T+SC{FMQTlAxE;K`>z)15mSQ>ZRlCpy?Pp zsIT_>lbCX8H*czOKrB1x^#uvg=RqbV@XZ$tK=%|9<-i-7f4d%=KmwEk$Rq+f>HO`G z44HIa&`jhB0|5UL649W>q&(2y0Qyf_08@X03U0EX*$C9xp1(ht`6DPeZ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 68ced1c29a1..ef80eb5051f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7d95e..a69d9cb6c20 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,78 +17,113 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,79 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9109989e3cb..53a6b238d41 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal From 7f63d2ca46dbbb051df984868ea54ab6fa2ab627 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 20 Sep 2022 10:02:51 -0700 Subject: [PATCH 139/215] Remove java execution logic during table.py module init (#2872) --- .../engine/context/ExecutionContext.java | 34 +++++++------ .../engine/util/AbstractScriptSession.java | 4 +- .../engine/table/impl/FuzzerTest.java | 3 +- .../table/impl/PartitionedTableTest.java | 8 +-- .../impl/TestConcurrentInstantiation.java | 2 +- py/server/deephaven/_jpy.py | 21 ++++++++ py/server/deephaven/dherror.py | 5 ++ py/server/deephaven/table.py | 19 ++++--- py/server/test_helper/__init__.py | 5 ++ py/server/tests/test_calendar.py | 4 ++ py/server/tests/test_filters.py | 2 + py/server/tests/test_numpy.py | 2 + py/server/tests/test_pandas.py | 2 + py/server/tests/test_partitioned_table.py | 49 +++++++------------ py/server/tests/test_plot/test_color.py | 2 + py/server/tests/test_plot/test_figure.py | 2 + py/server/tests/test_plot/test_font.py | 2 + py/server/tests/test_plot/test_linestyle.py | 2 + py/server/tests/test_plot/test_plot.py | 2 + .../test_plot/test_selectable_dataset.py | 2 + py/server/tests/test_pt_proxy.py | 2 + py/server/tests/test_table.py | 31 +++--------- py/server/tests/test_table_factory.py | 2 + py/server/tests/test_table_listener.py | 2 + py/server/tests/test_ugp.py | 11 +---- py/server/tests/test_updateby.py | 2 + py/server/tests/testbase.py | 20 ++++++-- 27 files changed, 145 insertions(+), 97 deletions(-) create mode 100644 py/server/deephaven/_jpy.py diff --git a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java index 3b7a8e2b2f6..1fa751e423f 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/ExecutionContext.java @@ -8,6 +8,7 @@ import io.deephaven.util.annotations.VisibleForTesting; import java.util.Arrays; +import java.util.Objects; import java.util.function.Supplier; public class ExecutionContext { @@ -18,17 +19,8 @@ public static Builder newBuilder() { return new Builder(); } - public static ExecutionContext makeSystemicExecutionContext() { - final ExecutionContext context = getContext(); - if (context.isSystemic) { - return context; - } - return ExecutionContext.newBuilder() - .captureQueryScope() - .captureQueryLibrary() - .captureQueryCompiler() - .markSystemic() - .build(); + public static ExecutionContext makeExecutionContext(boolean isSystemic) { + return getContext().withSystemic(isSystemic); } @VisibleForTesting @@ -104,9 +96,23 @@ private ExecutionContext( final QueryScope queryScope, final QueryCompiler queryCompiler) { this.isSystemic = isSystemic; - this.queryLibrary = queryLibrary; - this.queryScope = queryScope; - this.queryCompiler = queryCompiler; + this.queryLibrary = Objects.requireNonNull(queryLibrary); + this.queryScope = Objects.requireNonNull(queryScope); + this.queryCompiler = Objects.requireNonNull(queryCompiler); + } + + /** + * Returns, or creates, an execution context with the given value for {@code isSystemic} and existing values for the + * other members. + * + * @param isSystemic if the context should be systemic + * @return the execution context + */ + public ExecutionContext withSystemic(boolean isSystemic) { + if (isSystemic == this.isSystemic) { + return this; + } + return new ExecutionContext(isSystemic, queryLibrary, queryScope, queryCompiler); } /** diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java index 8caa1b24282..9da8ab335ce 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java @@ -287,10 +287,10 @@ public VariableProvider getVariableProvider() { // ScriptSession-based QueryScope implementation, with no remote scope or object reflection support // ----------------------------------------------------------------------------------------------------------------- - private abstract static class ScriptSessionQueryScope extends QueryScope { + public abstract static class ScriptSessionQueryScope extends QueryScope { final ScriptSession scriptSession; - private ScriptSessionQueryScope(ScriptSession scriptSession) { + public ScriptSessionQueryScope(ScriptSession scriptSession) { this.scriptSession = scriptSession; } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java index 7a801288e20..25b2c5c4394 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java @@ -11,7 +11,6 @@ import io.deephaven.plugin.type.ObjectTypeLookup.NoOp; import io.deephaven.time.DateTimeUtils; import io.deephaven.engine.updategraph.UpdateGraphProcessor; -import io.deephaven.engine.context.QueryScope; import io.deephaven.time.DateTime; import io.deephaven.engine.util.TableTools; import io.deephaven.engine.util.GroovyDeephavenSession; @@ -336,7 +335,7 @@ private void validateBindingTables(GroovyDeephavenSession session, Map hardReferences) { - final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext(); + final ExecutionContext executionContext = ExecutionContext.makeExecutionContext(true); // noinspection unchecked session.getBinding().getVariables().forEach((k, v) -> { if (v instanceof PartitionedTable) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java index d435f55615c..9621858eaf1 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java @@ -244,7 +244,7 @@ public void testTransformPartitionedTableThenMerge() { final PartitionedTable partitionedTable = sourceTable.partitionBy("Key"); - final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext(); + final ExecutionContext executionContext = ExecutionContext.makeExecutionContext(true); final EvalNuggetInterface[] en = new EvalNuggetInterface[] { new EvalNugget() { @Override @@ -753,11 +753,7 @@ public void testMergeConstituentChanges() { ExecutionContext.getContext().getQueryLibrary().importStatic(TableTools.class); final Table underlying; - try (final SafeCloseable ignored = ExecutionContext.newBuilder() - .captureQueryLibrary() - .captureQueryCompiler() - .captureQueryScope() - .build().open()) { + try (final SafeCloseable ignored = ExecutionContext.makeExecutionContext(false).open()) { underlying = base.update( "Constituent=emptyTable(1000 * step.longValue()).update(\"JJ=ii * \" + II + \" * step.longValue()\")"); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java index b0f5c118125..9262b5052c3 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestConcurrentInstantiation.java @@ -58,7 +58,7 @@ public class TestConcurrentInstantiation extends QueryTableTestBase { @Override protected void setUp() throws Exception { super.setUp(); - final ExecutionContext executionContext = ExecutionContext.makeSystemicExecutionContext(); + final ExecutionContext executionContext = ExecutionContext.makeExecutionContext(true); final ThreadFactory threadFactory = runnable -> { Thread thread = new Thread(() -> { try (final SafeCloseable ignored = executionContext.open()) { diff --git a/py/server/deephaven/_jpy.py b/py/server/deephaven/_jpy.py new file mode 100644 index 00000000000..2615872572b --- /dev/null +++ b/py/server/deephaven/_jpy.py @@ -0,0 +1,21 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# + +""" This module is an internal module to simplify usage patterns around jpy. +""" +from __future__ import annotations + +import jpy + +from deephaven import DHError + + +def strict_cast(j_obj: jpy.JType, to_type: type) -> jpy.JType: + """A convenience function around jpy.cast. Checks that j_obj is not None and that the result is not None.""" + if not j_obj: + raise DHError(message=f"Unable to cast None into '{to_type}'") + j_obj_casted = jpy.cast(j_obj, to_type) + if not j_obj_casted: + raise DHError(message=f"Unable to cast '{j_obj.getClass()}' into '{to_type}'") + return j_obj_casted diff --git a/py/server/deephaven/dherror.py b/py/server/deephaven/dherror.py index fe8a5293be7..ab7816bcd72 100644 --- a/py/server/deephaven/dherror.py +++ b/py/server/deephaven/dherror.py @@ -23,6 +23,11 @@ class DHError(Exception): """ def __init__(self, cause=None, message=""): + if isinstance(cause, str) and message == "": + # Saves a lot of debugging headache when library code incorrectly creates something like: + # raise DHError("My error message here") + message = cause + cause = None self._message = message self._traceback = traceback.format_exc() self._cause = cause diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index d9e053deec1..014a9ba01e8 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -15,6 +15,7 @@ import jpy from deephaven import DHError, dtypes +from deephaven._jpy import strict_cast from deephaven._wrapper import JObjectWrapper from deephaven.agg import Aggregation from deephaven.column import Column, ColumnType @@ -47,12 +48,15 @@ # Dynamic Query Scope _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") -_JQueryScope = jpy.get_type("io.deephaven.engine.context.QueryScope") -_JUnsynchronizedScriptSessionQueryScope = jpy.get_type( - "io.deephaven.engine.util.AbstractScriptSession$UnsynchronizedScriptSessionQueryScope") +_JScriptSessionQueryScope = jpy.get_type("io.deephaven.engine.util.AbstractScriptSession$ScriptSessionQueryScope") _JPythonScriptSession = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession") -_j_script_session = jpy.cast(_JExecutionContext.getContext().getQueryScope(), _JUnsynchronizedScriptSessionQueryScope).scriptSession() -_j_py_script_session = jpy.cast(_j_script_session, _JPythonScriptSession) + + +def _j_py_script_session() -> _JPythonScriptSession: + j_execution_context = _JExecutionContext.getContext() + j_query_scope = j_execution_context.getQueryScope() + j_script_session_query_scope = strict_cast(j_query_scope, _JScriptSessionQueryScope) + return strict_cast(j_script_session_query_scope.scriptSession(), _JPythonScriptSession) @contextlib.contextmanager @@ -72,11 +76,12 @@ def _query_scope_ctx(): if len(outer_frames) > i + 2 or function != "": scope_dict = caller_frame.f_globals.copy() scope_dict.update(caller_frame.f_locals) + j_py_script_session = _j_py_script_session() try: - _j_py_script_session.pushScope(scope_dict) + j_py_script_session.pushScope(scope_dict) yield finally: - _j_py_script_session.popScope() + j_py_script_session.popScope() else: # in the __main__ module, use the default main global scope yield diff --git a/py/server/test_helper/__init__.py b/py/server/test_helper/__init__.py index 28bebf10d94..675b012a89b 100644 --- a/py/server/test_helper/__init__.py +++ b/py/server/test_helper/__init__.py @@ -12,6 +12,10 @@ from deephaven_internal import jvm + +py_dh_session = None + + def start_jvm(jvm_props: Dict[str, str] = None): jvm.preload_jvm_dll() import jpy @@ -93,6 +97,7 @@ def start_jvm(jvm_props: Dict[str, str] = None): # Set up a Deephaven Python session py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals() + global py_dh_session py_dh_session = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession")(py_scope_jpy) py_dh_session.getExecutionContext().open() diff --git a/py/server/tests/test_calendar.py b/py/server/tests/test_calendar.py index 17c632b267d..aa318f26b9d 100644 --- a/py/server/tests/test_calendar.py +++ b/py/server/tests/test_calendar.py @@ -12,6 +12,7 @@ class CalendarTestCase(BaseTestCase): def setUp(self) -> None: + super().setUp() self.test_calendar = BusinessCalendar("USNYSE") self.b_day1 = "2022-01-03" self.b_day = "2022-03-08" @@ -22,6 +23,9 @@ def setUp(self) -> None: self.last_b_day_month = "2022-03-31" self.last_b_day_week = "2022-03-11" + def tearDown(self) -> None: + super().tearDown() + def test_calendar(self): with self.subTest(msg="calendarNames() test"): cal_names = calendar_names() diff --git a/py/server/tests/test_filters.py b/py/server/tests/test_filters.py index 0fb7fdd1247..6f37c822b29 100644 --- a/py/server/tests/test_filters.py +++ b/py/server/tests/test_filters.py @@ -11,10 +11,12 @@ class FilterTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_regex_filter(self): new_test_table = self.test_table.update("X = String.valueOf(d)") diff --git a/py/server/tests/test_numpy.py b/py/server/tests/test_numpy.py index d1e56b512df..965c04245b1 100644 --- a/py/server/tests/test_numpy.py +++ b/py/server/tests/test_numpy.py @@ -24,6 +24,7 @@ class CustomClass: class NumpyTestCase(BaseTestCase): def setUp(self): + super().setUp() j_array_list1 = j_array_list([1, -1]) j_array_list2 = j_array_list([2, -2]) input_cols = [ @@ -65,6 +66,7 @@ def setUp(self): def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_to_numpy(self): for col in self.test_table.columns: diff --git a/py/server/tests/test_pandas.py b/py/server/tests/test_pandas.py index 009623fad1a..aaf880f1a0f 100644 --- a/py/server/tests/test_pandas.py +++ b/py/server/tests/test_pandas.py @@ -26,6 +26,7 @@ class CustomClass: class PandasTestCase(BaseTestCase): def setUp(self): + super().setUp() j_array_list1 = j_array_list([1, -1]) j_array_list2 = j_array_list([2, -2]) input_cols = [ @@ -49,6 +50,7 @@ def setUp(self): def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_to_pandas(self): df = to_pandas(self.test_table) diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index dd2b7c89bb5..9200648ea1c 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -2,7 +2,6 @@ # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # -import jpy import unittest from deephaven.agg import partition @@ -11,7 +10,7 @@ from deephaven.filters import Filter from deephaven import read_csv, DHError, new_table, ugp, time_table -from tests.testbase import BaseTestCase +from tests.testbase import BaseTestCase, make_user_exec_ctx def transform_func(t: Table) -> Table: @@ -35,12 +34,14 @@ def apply(self, t: Table, ot: Table) -> Table: class PartitionedTableTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv").tail(num_rows=100) self.partitioned_table = self.test_table.partition_by(by=["c", "e"]) def tearDown(self): self.partitioned_table = None self.test_table = None + super().tearDown() def test_table(self): self.assertIsNotNone(self.partitioned_table.table) @@ -117,37 +118,25 @@ def test_constituents(self): self.assertGreater(len(constituent_tables), 0) def test_transform(self): - _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - context = _JExecutionContext.newBuilder() \ - .captureQueryCompiler() \ - .captureQueryLibrary() \ - .emptyQueryScope() \ - .build().open() - pt = self.partitioned_table.transform(transform_func) - self.assertIn("f", [col.name for col in pt.constituent_table_columns]) - - pt = self.partitioned_table.transform(Transformer) - self.assertIn("f", [col.name for col in pt.constituent_table_columns]) + with make_user_exec_ctx(): + pt = self.partitioned_table.transform(transform_func) + self.assertIn("f", [col.name for col in pt.constituent_table_columns]) - with self.assertRaises(DHError) as cm: - pt = self.partitioned_table.transform(lambda t, t1: t.join(t1)) - self.assertRegex(str(cm.exception), r"missing .* argument") - context.close() + pt = self.partitioned_table.transform(Transformer) + self.assertIn("f", [col.name for col in pt.constituent_table_columns]) + + with self.assertRaises(DHError) as cm: + pt = self.partitioned_table.transform(lambda t, t1: t.join(t1)) + self.assertRegex(str(cm.exception), r"missing .* argument") def test_partitioned_transform(self): - _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - context = _JExecutionContext.newBuilder() \ - .captureQueryCompiler() \ - .captureQueryLibrary() \ - .emptyQueryScope() \ - .build().open() - other_pt = self.partitioned_table.transform(transform_func) - pt = self.partitioned_table.partitioned_transform(other_pt, partitioned_transform_func) - self.assertIn("f", [col.name for col in pt.constituent_table_columns]) - - pt = self.partitioned_table.partitioned_transform(other_pt, PartitionedTransformer()) - self.assertIn("f", [col.name for col in pt.constituent_table_columns]) - context.close() + with make_user_exec_ctx(): + other_pt = self.partitioned_table.transform(transform_func) + pt = self.partitioned_table.partitioned_transform(other_pt, partitioned_transform_func) + self.assertIn("f", [col.name for col in pt.constituent_table_columns]) + + pt = self.partitioned_table.partitioned_transform(other_pt, PartitionedTransformer()) + self.assertIn("f", [col.name for col in pt.constituent_table_columns]) def test_partition_agg(self): with ugp.shared_lock(): diff --git a/py/server/tests/test_plot/test_color.py b/py/server/tests/test_plot/test_color.py index 80231bc61de..23f0cd40688 100644 --- a/py/server/tests/test_plot/test_color.py +++ b/py/server/tests/test_plot/test_color.py @@ -13,10 +13,12 @@ class ColorTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_color(self): figure = Figure() diff --git a/py/server/tests/test_plot/test_figure.py b/py/server/tests/test_plot/test_figure.py index 75e46803089..32aef642401 100644 --- a/py/server/tests/test_plot/test_figure.py +++ b/py/server/tests/test_plot/test_figure.py @@ -11,10 +11,12 @@ class FigureTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_figure(self): with self.subTest("Not supported yet."): diff --git a/py/server/tests/test_plot/test_font.py b/py/server/tests/test_plot/test_font.py index 4cbe77be099..41025c34283 100644 --- a/py/server/tests/test_plot/test_font.py +++ b/py/server/tests/test_plot/test_font.py @@ -13,10 +13,12 @@ class FontTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_font_family_names(self): self.assertIn("Serif", font_family_names()) diff --git a/py/server/tests/test_plot/test_linestyle.py b/py/server/tests/test_plot/test_linestyle.py index dd5f2e7ca43..2dab3d32f69 100644 --- a/py/server/tests/test_plot/test_linestyle.py +++ b/py/server/tests/test_plot/test_linestyle.py @@ -14,10 +14,12 @@ class LineStyleTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_default_line_style(self): line_style = LineStyle() diff --git a/py/server/tests/test_plot/test_plot.py b/py/server/tests/test_plot/test_plot.py index ad696330337..359ed9a6617 100644 --- a/py/server/tests/test_plot/test_plot.py +++ b/py/server/tests/test_plot/test_plot.py @@ -16,10 +16,12 @@ class PlotTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_plot_style(self): figure = Figure() diff --git a/py/server/tests/test_plot/test_selectable_dataset.py b/py/server/tests/test_plot/test_selectable_dataset.py index 62a59127157..c8558e51ea1 100644 --- a/py/server/tests/test_plot/test_selectable_dataset.py +++ b/py/server/tests/test_plot/test_selectable_dataset.py @@ -11,10 +11,12 @@ class SelectableDatasetTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_one_click(self): sds = one_click(self.test_table, by=['a', 'b']) diff --git a/py/server/tests/test_pt_proxy.py b/py/server/tests/test_pt_proxy.py index 0be79dcfe22..e8c234fb4e0 100644 --- a/py/server/tests/test_pt_proxy.py +++ b/py/server/tests/test_pt_proxy.py @@ -13,6 +13,7 @@ class PartitionedTableProxyTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv").tail(num_rows=100) self.partitioned_table = self.test_table.partition_by(by=["c"]) self.pt_proxy = self.partitioned_table.proxy() @@ -20,6 +21,7 @@ def setUp(self): def tearDown(self): self.partitioned_table = None self.test_table = None + super().tearDown() def test_target(self): self.assertEqual(self.partitioned_table, self.pt_proxy.target) diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index 59d1e54f7d2..f3220f58d34 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -13,15 +13,17 @@ from deephaven.html import to_html from deephaven.pandas import to_pandas from deephaven.table import Table -from tests.testbase import BaseTestCase +from tests.testbase import BaseTestCase, make_user_exec_ctx class TableTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_repr(self): regex = r"deephaven\.table\.Table\(io\.deephaven\.engine\.table\.Table\(objectRef=0x.+\{.+\}\)\)" @@ -624,41 +626,24 @@ def closure_fn() -> str: inner_func("param str") def test_nested_scopes(self): - _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - context = (_JExecutionContext.newBuilder() - .captureQueryCompiler() - .captureQueryLibrary() - .captureQueryScope() - .build()) - def inner_func(p) -> str: - openContext = context.open() t = empty_table(1).update("X = p * 10") - openContext.close() return t.to_string().split()[2] - t = empty_table(1).update("X = i").update("TableString = inner_func(X + 10)") + with make_user_exec_ctx(): + t = empty_table(1).update("X = i").update("TableString = inner_func(X + 10)") + self.assertIn("100", t.to_string()) def test_nested_scope_ticking(self): - import jpy - _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - j_context = (_JExecutionContext.newBuilder() - .captureQueryCompiler() - .captureQueryLibrary() - .captureQueryScope() - .build()) - def inner_func(p) -> str: - open_ctx = j_context.open() t = empty_table(1).update("X = p * 10") - open_ctx.close() return t.to_string().split()[2] - with ugp.shared_lock(): + with make_user_exec_ctx(), ugp.shared_lock(): t = time_table("00:00:01").update("X = i").update("TableString = inner_func(X + 10)") - self.wait_ticking_table_update(t, row_count=5, timeout=10) + self.wait_ticking_table_update(t, row_count=5, timeout=10) self.assertIn("100", t.to_string()) def test_scope_comprehensions(self): diff --git a/py/server/tests/test_table_factory.py b/py/server/tests/test_table_factory.py index f4927f4c91a..b78b1e40894 100644 --- a/py/server/tests/test_table_factory.py +++ b/py/server/tests/test_table_factory.py @@ -26,10 +26,12 @@ class CustomClass: class TableFactoryTestCase(BaseTestCase): def setUp(self): + super().setUp() self.test_table = read_csv("tests/data/test_table.csv") def tearDown(self) -> None: self.test_table = None + super().tearDown() def test_empty_table(self): t = empty_table(10) diff --git a/py/server/tests/test_table_listener.py b/py/server/tests/test_table_listener.py index 0cdd8b276ee..27c4b623aef 100644 --- a/py/server/tests/test_table_listener.py +++ b/py/server/tests/test_table_listener.py @@ -58,6 +58,7 @@ def ensure_ugp_cycles(table_update_recorder: TableUpdateRecorder, cycles: int = class TableListenerTestCase(BaseTestCase): def setUp(self) -> None: + super().setUp() with exclusive_lock(): self.test_table = time_table("00:00:00.001").update(["X=i%11"]).sort("X").tail(16) source_table = time_table("00:00:00.001").update(["TS=currentTime()"]) @@ -66,6 +67,7 @@ def setUp(self) -> None: def tearDown(self) -> None: self.test_table = None self.test_table2 = None + super().tearDown() def check_update_recorder(self, table_update_recorder: TableUpdateRecorder, cols: Union[str, List[str]] = None, *, has_replay: bool = False, has_added: bool = False, diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index b49b85975e7..a2764a51bbc 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -21,10 +21,12 @@ def partitioned_transform_func(t: Table, ot: Table) -> Table: class UgpTestCase(BaseTestCase): def setUp(self) -> None: + super().setUp() ugp.auto_locking = False def tearDown(self): ugp.auto_locking = False + super().tearDown() def test_ugp_context_manager(self): with self.assertRaises(DHError) as cm: @@ -207,14 +209,6 @@ def test_auto_locking_partitioned_table(self): test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) pt = test_table.partition_by(by="Y") - _ExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") - _context = _ExecutionContext.newBuilder() \ - .captureQueryCompiler() \ - .captureQueryLibrary() \ - .emptyQueryScope() \ - .build() \ - .open() - with self.subTest("Merge"): ugp.auto_locking = False with self.assertRaises(DHError) as cm: @@ -242,7 +236,6 @@ def test_auto_locking_partitioned_table(self): ugp.auto_locking = True pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) - _context.close() def test_auto_locking_table_factory(self): with ugp.shared_lock(): diff --git a/py/server/tests/test_updateby.py b/py/server/tests/test_updateby.py index 9c7f48eb9f0..98ae9f43e61 100644 --- a/py/server/tests/test_updateby.py +++ b/py/server/tests/test_updateby.py @@ -12,6 +12,7 @@ class UpdateByTestCase(BaseTestCase): def setUp(self): + super().setUp() self.static_table = read_csv("tests/data/test_table.csv").update("Timestamp=currentTime()") with ugp.exclusive_lock(): self.ticking_table = time_table("00:00:00.001").update( @@ -20,6 +21,7 @@ def setUp(self): def tearDown(self) -> None: self.static_table = None self.ticking_table = None + super().tearDown() def test_ema(self): op_ctrl = OperationControl(on_null=BadDataBehavior.THROW, diff --git a/py/server/tests/testbase.py b/py/server/tests/testbase.py index c9c4641afc4..a42976016eb 100644 --- a/py/server/tests/testbase.py +++ b/py/server/tests/testbase.py @@ -12,8 +12,10 @@ from deephaven.ugp import exclusive_lock from deephaven.table import Table -_JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") +from test_helper import py_dh_session +_JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") +_JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") def table_equals(table_a: Table, table_b: Table) -> bool: try: @@ -22,6 +24,18 @@ def table_equals(table_a: Table, table_b: Table) -> bool: raise DHError(e, "table equality test failed.") from e +# TODO(deephaven-core#2867): Wrap ExecutionContext in Python +# Jianfeng to remove this and introduce into deephaven execution_context module for users' convenience +@contextlib.contextmanager +def make_user_exec_ctx(): + j_execution_context = _JExecutionContext.makeExecutionContext(False).open() + try: + yield + except Exception as e: + raise DHError(e, "exception raised in the enclosed code block.") from e + finally: + j_execution_context.close() + class BaseTestCase(unittest.TestCase): @classmethod def setUpClass(cls) -> None: @@ -32,10 +46,10 @@ def tearDownClass(cls) -> None: ... def setUp(self) -> None: - ... + self._execution_context = py_dh_session.getExecutionContext().open() def tearDown(self) -> None: - ... + self._execution_context.close() def wait_ticking_table_update(self, table: Table, row_count: int, timeout: int): """Waits for a ticking table to grow to the specified size or times out. From e104d2c0b113f0a0592ac7d9302d9de14782a341 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 20 Sep 2022 13:29:32 -0600 Subject: [PATCH 140/215] SessionState should tryManage as dependencies may no longer be live (#2884) --- .../server/session/SessionState.java | 4 ++-- .../server/session/SessionStateTest.java | 24 +++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/io/deephaven/server/session/SessionState.java b/server/src/main/java/io/deephaven/server/session/SessionState.java index e484854edf0..39ef9bcf59b 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionState.java +++ b/server/src/main/java/io/deephaven/server/session/SessionState.java @@ -596,7 +596,7 @@ private synchronized void setDependencies(final List> parents) { this.parents = parents; dependentCount = parents.size(); - parents.stream().filter(Objects::nonNull).forEach(this::manage); + parents.stream().filter(Objects::nonNull).forEach(this::tryManage); if (log.isDebugEnabled()) { final Exception e = new RuntimeException(); @@ -767,7 +767,7 @@ private synchronized void setState(final ExportNotification.State state) { if (state == ExportNotification.State.EXPORTED || isExportStateTerminal(state)) { children.forEach(child -> child.onResolveOne(this)); children = Collections.emptyList(); - parents.stream().filter(Objects::nonNull).forEach(this::unmanage); + parents.stream().filter(Objects::nonNull).forEach(this::tryUnmanage); parents = Collections.emptyList(); exportMain = null; errorHandler = null; diff --git a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java index 038a49d797f..c874a1dbe7d 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionStateTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionStateTest.java @@ -33,6 +33,7 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import java.util.concurrent.Callable; import java.util.stream.Collectors; import static io.deephaven.proto.backplane.grpc.ExportNotification.State.CANCELLED; @@ -438,10 +439,12 @@ public void testLateDependencyAlreadyReleasedFails() { Assert.eq(e1.getState(), "e1.getState()", ExportNotification.State.RELEASED); final MutableBoolean errored = new MutableBoolean(); - expectException(LivenessStateException.class, () -> session.newExport(nextExportId++) + final SessionState.ExportObject e2 = session.newExport(nextExportId++) .require(e1) .onErrorHandler(err -> errored.setTrue()) - .submit(() -> Assert.gt(e1.get().refCount, "e1.get().refCount", 0))); + .submit((Callable) Assert::statementNeverExecuted); + Assert.eqTrue(errored.booleanValue(), "errored.booleanValue()"); + Assert.eq(e2.getState(), "e2.getState()", ExportNotification.State.DEPENDENCY_RELEASED); } @Test @@ -1322,6 +1325,23 @@ public void onCompleted() { Assert.eq(sre.getStatus(), "sre.getStatus()", Status.DATA_LOSS, "Status.DATA_LOSS"); } + @Test + public void testDestroyedExportObjectDependencyFailsNotThrows() { + final SessionState.ExportObject failedExport; + try (final SafeCloseable ignored = LivenessScopeStack.open()) { + failedExport = SessionState.wrapAsFailedExport(new RuntimeException()); + } + Assert.eqFalse(failedExport.tryIncrementReferenceCount(), "failedExport.tryIncrementReferenceCount()"); + final MutableBoolean errored = new MutableBoolean(); + final SessionState.ExportObject result = + session.newExport(nextExportId++) + .onErrorHandler(err -> errored.setTrue()) + .require(failedExport) + .submit(failedExport::get); + Assert.eqTrue(errored.booleanValue(), "errored.booleanValue()"); + Assert.eq(result.getState(), "result.getState()", DEPENDENCY_FAILED); + } + private static long getExportId(final ExportNotification notification) { return ticketToExportId(notification.getTicket(), "test"); } From a71a0da2c977199bb08f11e29e41d3a620484e0e Mon Sep 17 00:00:00 2001 From: Chip Kent <5250374+chipkent@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:31:33 -0600 Subject: [PATCH 141/215] Add query language functions to get data structure sizes. (#2885) * Added methods to get data structure sizes. * Addressed review comments plus changed the null return value to NULL_LONG * Address review comments. --- engine/function/src/templates/Basic.ftl | 44 +++++++++++++++++++ engine/function/src/templates/TestBasic.ftl | 44 +++++++++++++++++++ .../deephaven/libs/GroovyStaticImports.java | 19 ++++++++ 3 files changed, 107 insertions(+) diff --git a/engine/function/src/templates/Basic.ftl b/engine/function/src/templates/Basic.ftl index 72f47439b52..f48b8839e3a 100644 --- a/engine/function/src/templates/Basic.ftl +++ b/engine/function/src/templates/Basic.ftl @@ -5,6 +5,7 @@ package io.deephaven.function; import io.deephaven.vector.*; +import io.deephaven.util.datastructures.LongSizedDataStructure; import io.deephaven.util.QueryConstants; import gnu.trove.list.array.*; import gnu.trove.set.*; @@ -131,6 +132,35 @@ public class Basic { return result; } + /** + * Returns the length of the input. + * + * @param values values. + * @return length of the input or the Deephaven null constant for null inputs. + */ + static public long len(T[] values) { + if (values == null) { + return NULL_LONG; + } + + return values.length; + } + + /** + * Returns the length of the input. + * + * @param values values. + * @return length of the input or the Deephaven null constant for null inputs. + */ + @SuppressWarnings("rawtypes") + static public long len(LongSizedDataStructure values) { + if (values == null) { + return NULL_LONG; + } + + return values.size(); + } + /** * Counts the number of non-null values. * @@ -849,6 +879,20 @@ public class Basic { return result; } + /** + * Returns the length of the input. + * + * @param values values. + * @return length of the input or the Deephaven null constant for null inputs. + */ + static public long len(${pt.primitive}[] values) { + if (values == null) { + return NULL_LONG; + } + + return values.length; + } + /** * Counts the number of non-null values. * diff --git a/engine/function/src/templates/TestBasic.ftl b/engine/function/src/templates/TestBasic.ftl index d63812c7e77..ff530fae290 100644 --- a/engine/function/src/templates/TestBasic.ftl +++ b/engine/function/src/templates/TestBasic.ftl @@ -78,6 +78,22 @@ public class TestBasic extends BaseArrayTestCase { assertFalse(inRange(Integer.valueOf(4), Integer.valueOf(1), Integer.valueOf(3))); } + public void testObjLen() { + assertEquals(NULL_LONG, len((ObjectVector)null)); + assertEquals(3, len(new ObjectVectorDirect(40, 50, 60))); + assertEquals(0, len(new ObjectVectorDirect())); + assertEquals(1, len(new ObjectVectorDirect(new Integer[]{null}))); + assertEquals(3, len(new ObjectVectorDirect(5, null, 15))); + assertEquals(4, len(new ObjectVectorDirect(5, null, 15, NULL_INT))); + + assertEquals(NULL_LONG, len((Integer[])null)); + assertEquals(3, len(new Integer[]{40, 50, 60})); + assertEquals(0, len(new Integer[]{})); + assertEquals(1, len(new Integer[]{null})); + assertEquals(3, len(new Integer[]{5, null, 15})); + assertEquals(4, len(new Integer[]{5, null, 15, NULL_INT})); + } + public void testObjCount() { assertEquals(NULL_LONG, countObj((ObjectVector)null)); assertEquals(3, countObj(new ObjectVectorDirect(40, 50, 60))); @@ -319,6 +335,20 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(new Boolean[]{true, false, false}, replaceIfNull(new Boolean[]{Boolean.TRUE, null, Boolean.FALSE}, false)); } + public void testBooleanLen() { + assertEquals(3, len(new Boolean[]{true, false, true})); + assertEquals(0, len(new Boolean[]{})); + assertEquals(1, len(new Boolean[]{QueryConstants.NULL_BOOLEAN})); + assertEquals(3, len(new Boolean[]{true, QueryConstants.NULL_BOOLEAN, true})); + assertEquals(NULL_LONG, len((Boolean[])null)); + + assertEquals(3, len(new ObjectVectorDirect<>(new Boolean[]{true, false, true}))); + assertEquals(0, len(new ObjectVectorDirect<>())); + assertEquals(1, len(new ObjectVectorDirect<>(QueryConstants.NULL_BOOLEAN))); + assertEquals(3, len(new ObjectVectorDirect<>(new Boolean[]{true, QueryConstants.NULL_BOOLEAN, true}))); + assertEquals(NULL_LONG, len((ObjectVector)null)); + } + public void testBooleanCount(){ assertEquals(3,countObj(new Boolean[]{true, false, true})); assertEquals(0,countObj(new Boolean[]{})); @@ -510,6 +540,20 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(new ${pt.primitive}[]{(${pt.primitive}) 3, (${pt.primitive}) 7, (${pt.primitive}) 11}, replaceIfNull(new ${pt.primitive}[]{(${pt.primitive}) 3, ${pt.null}, (${pt.primitive}) 11}, (${pt.primitive}) 7)); } + public void test${pt.boxed}Len() { + assertEquals(NULL_LONG, len((${pt.primitive}[])null)); + assertEquals(3, len(new ${pt.primitive}[]{40,50,60})); + assertEquals(0, len(new ${pt.primitive}[]{})); + assertEquals(1, len(new ${pt.primitive}[]{${pt.null}})); + assertEquals(3, len(new ${pt.primitive}[]{5, ${pt.null},15})); + + assertEquals(NULL_LONG, len((${pt.dbArray})null)); + assertEquals(3, len(new ${pt.dbArrayDirect}(new ${pt.primitive}[]{40,50,60}))); + assertEquals(0, len(new ${pt.dbArrayDirect}())); + assertEquals(1, len(new ${pt.dbArrayDirect}(${pt.null}))); + assertEquals(3, len(new ${pt.dbArrayDirect}(new ${pt.primitive}[]{5, ${pt.null},15}))); + } + public void test${pt.boxed}Count(){ assertEquals(NULL_LONG,count((${pt.primitive}[])null)); assertEquals(3,count(new ${pt.primitive}[]{40,50,60})); diff --git a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java index b5a638945bd..9302e692bd9 100644 --- a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java +++ b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java @@ -16,6 +16,7 @@ import io.deephaven.function.Parse; import io.deephaven.function.Random; import io.deephaven.function.Sort; +import io.deephaven.util.datastructures.LongSizedDataStructure; import io.deephaven.vector.BooleanVector; import io.deephaven.vector.ByteVector; import io.deephaven.vector.CharVector; @@ -1835,6 +1836,24 @@ public class GroovyStaticImports { public static T lastObj( T[] values ) {return Basic.lastObj( values );} /** @see io.deephaven.function.Basic#lastObj(io.deephaven.vector.ObjectVector) */ public static T lastObj( io.deephaven.vector.ObjectVector values ) {return Basic.lastObj( values );} + /** @see io.deephaven.function.Basic#len(T[]) */ + public static long len( T[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(byte[]) */ + public static long len( byte[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(char[]) */ + public static long len( char[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(double[]) */ + public static long len( double[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(float[]) */ + public static long len( float[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(int[]) */ + public static long len( int[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(long[]) */ + public static long len( long[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(short[]) */ + public static long len( short[] values ) {return Basic.len( values );} + /** @see io.deephaven.function.Basic#len(io.deephaven.util.datastructures.LongSizedDataStructure) */ + public static long len( io.deephaven.util.datastructures.LongSizedDataStructure values ) {return Basic.len( values );} /** @see io.deephaven.function.Numeric#log(byte) */ public static double log( byte value ) {return Numeric.log( value );} /** @see io.deephaven.function.Numeric#log(double) */ From 748de3944b3db46fbfcea830b9fae2b80eec95b6 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 20 Sep 2022 14:58:18 -0600 Subject: [PATCH 142/215] Subscribe to all columns for stream tables (#2882) --- .../web/client/api/subscription/TableViewportSubscription.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java index 723f04bbbf3..04767c8cd8e 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java @@ -122,7 +122,8 @@ public TableViewportSubscription(double firstRow, double lastRow, Column[] colum batcher.setFlat(true); }); // TODO handle updateInterval core#188 - table.setInternalViewport(firstRow, lastRow, columns); + Column[] columnsToSub = table.isStreamTable() ? table.getColumns().asArray(columns) : columns; + table.setInternalViewport(firstRow, lastRow, columnsToSub); // Listen for events and refire them on ourselves, optionally on the original table table.addEventListener(JsTable.EVENT_UPDATED, this::refire); From 6c5755c5ba341b7177a6a24d9f77400a76a92a49 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 21 Sep 2022 10:32:32 -0700 Subject: [PATCH 143/215] Fix test_auto_locking_partitioned_table (#2892) --- py/server/tests/test_ugp.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index a2764a51bbc..76c2842d868 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -8,7 +8,7 @@ from deephaven import time_table, DHError, merge, merge_sorted from deephaven import ugp from deephaven.table import Table -from tests.testbase import BaseTestCase +from tests.testbase import BaseTestCase, make_user_exec_ctx def transform_func(t: Table) -> Table: @@ -220,21 +220,23 @@ def test_auto_locking_partitioned_table(self): with self.subTest("Transform"): ugp.auto_locking = False - with self.assertRaises(DHError) as cm: + with make_user_exec_ctx(), self.assertRaises(DHError) as cm: pt1 = pt.transform(transform_func) self.assertRegex(str(cm.exception), r"IllegalStateException") ugp.auto_locking = True - pt1 = pt.transform(transform_func) + with make_user_exec_ctx(): + pt1 = pt.transform(transform_func) with self.subTest("Partitioned Transform"): ugp.auto_locking = False - with self.assertRaises(DHError) as cm: + with make_user_exec_ctx(), self.assertRaises(DHError) as cm: pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) self.assertRegex(str(cm.exception), r"IllegalStateException") ugp.auto_locking = True - pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) + with make_user_exec_ctx(): + pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) def test_auto_locking_table_factory(self): From cf1abf6a7bdbd3a680bf4ed8785a06ebf20fc2a2 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 21 Sep 2022 12:36:44 -0700 Subject: [PATCH 144/215] Make io.deephaven.app.GcApplication#enabled public (#2891) --- plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java b/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java index 571c7818c84..c4594d188ce 100644 --- a/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java +++ b/plugin/gc-app/src/main/java/io/deephaven/app/GcApplication.java @@ -62,7 +62,7 @@ public final class GcApplication implements ApplicationState.Factory, Notificati * * @return if the GC application is enabled */ - private static boolean enabled() { + public static boolean enabled() { // Note: this is off-by-default until the Web UI has been updated to better handle on-by-default applications. return "true".equalsIgnoreCase(System.getProperty(ENABLED)); } From a46eb609a0ec73387efc8bc8015338abfbfe104f Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Wed, 21 Sep 2022 16:52:24 -0400 Subject: [PATCH 145/215] Fix improper call to "manage" for static snapshot tables in Table.snapshot implementation (#2894) --- .../engine/table/impl/snapshot/SnapshotInternalListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java index 71c8e0411b0..17b3703e1af 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java @@ -48,7 +48,9 @@ public SnapshotInternalListener(QueryTable triggerTable, this.resultLeftColumns = resultLeftColumns; this.resultRightColumns = resultRightColumns; this.resultRowSet = resultRowSet; - manage(snapshotTable); + if (snapshotTable.isRefreshing()) { + manage(snapshotTable); + } triggerStampColumns = SnapshotUtils.generateTriggerStampColumns(triggerTable); snapshotDataColumns = SnapshotUtils.generateSnapshotDataColumns(snapshotTable); } From daeadd70231a99dde7d2311bb34b510aa9fcd03c Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Wed, 21 Sep 2022 15:37:44 -0600 Subject: [PATCH 146/215] Supply toString adapter for boolean[] which does not have Vector support (#2895) --- .../table/impl/preview/ArrayPreview.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ArrayPreview.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ArrayPreview.java index b5546ee22fe..4307d031acc 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ArrayPreview.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ArrayPreview.java @@ -5,6 +5,7 @@ import io.deephaven.vector.Vector; import io.deephaven.vector.VectorFactory; +import org.jetbrains.annotations.NotNull; import org.jpy.PyListWrapper; /** @@ -28,7 +29,13 @@ public static ArrayPreview fromArray(final Object array) { if (!array.getClass().isArray()) { throw new IllegalArgumentException("Input must be an array, instead input class is " + array.getClass()); } - return new ArrayPreview(VectorFactory.forElementType(array.getClass().getComponentType()).vectorWrap(array) + final Class componentType = array.getClass().getComponentType(); + // we do not support boolean[] as a wrapped Vector + if (componentType == boolean.class) { + return new ArrayPreview(convertToString((boolean[]) array)); + } + return new ArrayPreview(VectorFactory.forElementType(componentType) + .vectorWrap(array) .toString(ARRAY_SIZE_CUTOFF)); } @@ -48,4 +55,28 @@ private ArrayPreview(String displayString) { public String toString() { return displayString; } + + /** + * Helper method for generating a string preview of a {@code boolean[]}. + * + * @param array The boolean array to convert to a String + * @return The String representation of array + */ + private static String convertToString(@NotNull final boolean[] array) { + if (array.length == 0) { + return "[]"; + } + final StringBuilder builder = new StringBuilder("["); + final int displaySize = Math.min(array.length, ARRAY_SIZE_CUTOFF); + builder.append(array[0] ? "true" : "false"); + for (int ei = 1; ei < displaySize; ++ei) { + builder.append(',').append(array[ei] ? "true" : "false"); + } + if (displaySize == array.length) { + builder.append(']'); + } else { + builder.append(", ...]"); + } + return builder.toString(); + } } From eb8a9b4255907e17b19f33cbdeb4bd7ca40c31c4 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:00:46 -0600 Subject: [PATCH 147/215] Wrap ExecutionContext in Python (#2867) Co-authored-by: Chip Kent --- .../engine/context/PoisonedQueryCompiler.java | 4 +- .../engine/context/PoisonedQueryLibrary.java | 4 +- .../engine/context/PoisonedQueryScope.java | 4 +- py/server/deephaven/execution_context.py | 89 ++++++++++++ py/server/deephaven/table.py | 11 +- py/server/tests/test_exec_ctx.py | 132 ++++++++++++++++++ py/server/tests/test_partitioned_table.py | 3 +- py/server/tests/test_pt_proxy.py | 1 - py/server/tests/test_table.py | 5 +- py/server/tests/test_ugp.py | 4 +- py/server/tests/testbase.py | 16 +-- 11 files changed, 246 insertions(+), 27 deletions(-) create mode 100644 py/server/deephaven/execution_context.py create mode 100644 py/server/tests/test_exec_ctx.py diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java index e12653801b7..49b0eb02fcb 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryCompiler.java @@ -19,7 +19,9 @@ public class PoisonedQueryCompiler extends QueryCompiler { private PoisonedQueryCompiler() {} private T fail() { - logger.error().append("No ExecutionContext provided; cannot use QueryCompiler").endl(); + logger.error().append( + "No ExecutionContext provided, cannot use QueryCompiler. If this is being run in a thread, did you specify an ExecutionContext for the thread? Please refer to the documentation on ExecutionContext for details.") + .endl(); throw new NoExecutionContextRegisteredException(); } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java index 4040a6e04a9..d3045948706 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryLibrary.java @@ -13,7 +13,9 @@ public class PoisonedQueryLibrary extends QueryLibrary { private PoisonedQueryLibrary() {} private T fail() { - logger.error().append("No ExecutionContext provided; cannot use QueryLibrary").endl(); + logger.error().append( + "No ExecutionContext provided, cannot use QueryLibrary. If this is being run in a thread, did you specify an ExecutionContext for the thread? Please refer to the documentation on ExecutionContext for details.") + .endl(); throw new NoExecutionContextRegisteredException(); } diff --git a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java index 309dc154577..770babb91a5 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/PoisonedQueryScope.java @@ -16,7 +16,9 @@ public class PoisonedQueryScope extends QueryScope { private PoisonedQueryScope() {} private T fail() { - logger.error().append("No ExecutionContext provided; cannot use QueryScope").endl(); + logger.error().append( + "No ExecutionContext provided, cannot use QueryScope. If this is being run in a thread, did you specify an ExecutionContext for the thread? Please refer to the documentation on ExecutionContext for details.") + .endl(); throw new NoExecutionContextRegisteredException(); } diff --git a/py/server/deephaven/execution_context.py b/py/server/deephaven/execution_context.py new file mode 100644 index 00000000000..908fe2d7fc4 --- /dev/null +++ b/py/server/deephaven/execution_context.py @@ -0,0 +1,89 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# +"""This module gives users the ability to directly manage the Deephaven query execution context on threads, which is +critical for applications to correctly launch deferred query evaluations, such as table update operations in threads. +""" +from __future__ import annotations + +from typing import Sequence, Union +from contextlib import ContextDecorator + +import jpy + +from deephaven import DHError +from deephaven._wrapper import JObjectWrapper +from deephaven.jcompat import to_sequence + +_JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + + +class ExecutionContext(JObjectWrapper, ContextDecorator): + """An ExecutionContext represents a specific combination of query library, query compiler, and query scope under + which a query is evaluated. + + A default, systemic ExecutionContext is created when a Deephaven script session is initialized, and it is used to + evaluate queries submitted through this script session. However, to be able to evaluate a query in a deferred + manner, such as in a different thread from the script session thread, an application must explicitly obtain or + build a ExecutionContext and use it as a context manager to enclose the query in the body of the with statement. + + Note that, a ExecutionContext can be shared among many threads. The most typical use pattern would be to obtain + the script session's systemic ExecutionContext and use it to wrap a query run in a thread created by the user. + """ + j_object_type = _JExecutionContext + + @property + def j_object(self) -> jpy.JType: + return self.j_exec_ctx + + def __init__(self, j_exec_ctx): + self.j_exec_ctx = j_exec_ctx + + def __enter__(self): + self._j_safe_closable = self.j_exec_ctx.open() + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._j_safe_closable.close() + + +def make_user_exec_ctx(freeze_vars: Union[str, Sequence[str]] = None) -> ExecutionContext: + """Makes a new ExecutionContext based off the current thread's ExecutionContext. The optional parameter + freeze_vars should be a list of names in the current query scope. If it is provided, the resulting ExecutionContext + will include a new query scope that is made up of only these names together with their current values. Future + changes to the values of these names will not be visible in the new ExecutionContext. + + Args: + freeze_vars(Union[str, Sequence[str]]): the names of the vars in the current query scope to be frozen in + the new one + + Returns: + a ExecutionContext + + Raises: + DHError + """ + freeze_vars = to_sequence(freeze_vars) + + if not freeze_vars: + return ExecutionContext(j_exec_ctx=_JExecutionContext.makeExecutionContext(False)) + else: + try: + j_exec_ctx = (_JExecutionContext.newBuilder() + .captureQueryCompiler() + .captureQueryLibrary() + .captureQueryScopeVars(*freeze_vars) + .build()) + return ExecutionContext(j_exec_ctx=j_exec_ctx) + except Exception as e: + raise DHError(message="failed to make a new ExecutionContext") from e + + +def get_exec_ctx() -> ExecutionContext: + """Returns the current thread's ExecutionContext. + + Returns: + a ExecutionContext + """ + return ExecutionContext(j_exec_ctx=_JExecutionContext.getContext()) + diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 014a9ba01e8..4f84627cc76 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -55,8 +55,11 @@ def _j_py_script_session() -> _JPythonScriptSession: j_execution_context = _JExecutionContext.getContext() j_query_scope = j_execution_context.getQueryScope() - j_script_session_query_scope = strict_cast(j_query_scope, _JScriptSessionQueryScope) - return strict_cast(j_script_session_query_scope.scriptSession(), _JPythonScriptSession) + try: + j_script_session_query_scope = strict_cast(j_query_scope, _JScriptSessionQueryScope) + return strict_cast(j_script_session_query_scope.scriptSession(), _JPythonScriptSession) + except DHError: + return None @contextlib.contextmanager @@ -73,10 +76,10 @@ def _query_scope_ctx(): # combine the immediate caller's globals and locals into a single dict and use it as the query scope caller_frame = outer_frames[i + 1].frame function = outer_frames[i + 1].function - if len(outer_frames) > i + 2 or function != "": + j_py_script_session = _j_py_script_session() + if j_py_script_session and (len(outer_frames) > i + 2 or function != ""): scope_dict = caller_frame.f_globals.copy() scope_dict.update(caller_frame.f_locals) - j_py_script_session = _j_py_script_session() try: j_py_script_session.pushScope(scope_dict) yield diff --git a/py/server/tests/test_exec_ctx.py b/py/server/tests/test_exec_ctx.py new file mode 100644 index 00000000000..eb2ca19d70f --- /dev/null +++ b/py/server/tests/test_exec_ctx.py @@ -0,0 +1,132 @@ +# +# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending +# +import concurrent.futures +import threading +import unittest + +from deephaven import DHError +from deephaven import empty_table +from deephaven.execution_context import get_exec_ctx, make_user_exec_ctx + + +class ExecCtxTestCase(unittest.TestCase): + def test_exec_ctx_threads(self): + + def assert_threads_ok(thread_func): + threads = [] + thread_results = {} + + for i in range(4): + threads.append(threading.Thread(target=thread_func, args=(i, thread_results))) + + for th in threads: + th.start() + th.join() + + self.assertTrue(thread_results) + for i, rlt in thread_results.items(): + self.assertIn(str(i * i), rlt) + + main_exec_ctx = get_exec_ctx() + + def thread_update1(p: int, thread_results): + t = empty_table(1) + with main_exec_ctx: + t2 = t.update("X = p*p") + thread_results[p] = t2.to_string() + + with self.assertRaises(DHError): + t3 = t.update("Y = p * p * p") + + assert_threads_ok(thread_update1) + + @main_exec_ctx + def thread_update2(p: int, thread_results): + t = empty_table(1) + t2 = t.update("X = p*p") + thread_results[p] = t2.to_string() + + t3 = t.update("Y = p * p * p") + + assert_threads_ok(thread_update2) + + def thread_update3(p: int, thread_results): + t = empty_table(1) + t2 = t.update("X = p*p") + thread_results[p] = t2.to_string() + + t3 = t.update("Y = p * p * p") + + assert_threads_ok(main_exec_ctx(thread_update3)) + + + def test_thread_pool_executor(self): + + def assert_executor_ok(thread_func): + thread_results = {} + + with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor: + future_table_updates = {executor.submit(thread_func, i): i for i in range(4)} + for future in concurrent.futures.as_completed(future_table_updates.keys()): + i = future_table_updates[future] + thread_results[i] = future.result() + + self.assertTrue(thread_results) + for i, rlt in thread_results.items(): + self.assertIn(str(i * i), rlt) + + main_exec_ctx = get_exec_ctx() + + def thread_update1(p: int): + t = empty_table(1) + with main_exec_ctx: + t2 = t.update("X = p*p") + return t2.to_string() + + assert_executor_ok(thread_update1) + + @main_exec_ctx + def thread_update2(p: int): + t = empty_table(1) + t2 = t.update("X = p*p") + return t2.to_string() + + assert_executor_ok(thread_update2) + + def thread_update3(p: int): + t = empty_table(1) + t2 = t.update("X = p*p") + return t2.to_string() + + assert_executor_ok(main_exec_ctx(thread_update3)) + + + def test_freeze_vars(self): + to_keep = "Foo" + to_drop = 2 + + def inner_func(): + nonlocal to_keep + nonlocal to_drop + user_exec_ctx = make_user_exec_ctx(freeze_vars=['to_keep']) + with self.assertRaises(DHError): + with user_exec_ctx: + t = empty_table(1).update("X = to_drop") + + with user_exec_ctx: + t = empty_table(1).update("X = to_keep") + self.assertIn("Foo", t.to_string()) + + to_keep = "Bar" + t1 = empty_table(1).update("X = to_keep") + self.assertNotIn("Bar", t1.to_string()) + + return 0 + + with make_user_exec_ctx(): + t = empty_table(1).update("X = inner_func()") + + +if __name__ == '__main__': + unittest.main() diff --git a/py/server/tests/test_partitioned_table.py b/py/server/tests/test_partitioned_table.py index 9200648ea1c..0dc6271c538 100644 --- a/py/server/tests/test_partitioned_table.py +++ b/py/server/tests/test_partitioned_table.py @@ -5,12 +5,13 @@ import unittest from deephaven.agg import partition +from deephaven.execution_context import make_user_exec_ctx from deephaven.table import Table, PartitionedTable from deephaven.filters import Filter from deephaven import read_csv, DHError, new_table, ugp, time_table -from tests.testbase import BaseTestCase, make_user_exec_ctx +from tests.testbase import BaseTestCase def transform_func(t: Table) -> Table: diff --git a/py/server/tests/test_pt_proxy.py b/py/server/tests/test_pt_proxy.py index e8c234fb4e0..5359d39f5cb 100644 --- a/py/server/tests/test_pt_proxy.py +++ b/py/server/tests/test_pt_proxy.py @@ -153,7 +153,6 @@ def test_natural_join(self): right_proxy = self.test_table.drop_columns(["b", "d"]).partition_by("c").proxy() joined_pt_proxy = pt_proxy.natural_join(right_proxy, on="a", joins="e") self.assertIn("join keys found in multiple constituents", str(cm.exception)) - print(cm.exception) with self.assertRaises(DHError) as cm: pt_proxy = self.test_table.drop_columns(["d", "e"]).partition_by("c").proxy(sanity_check_joins=False) diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index f3220f58d34..e7f2403c3ee 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -1,8 +1,6 @@ # # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # - -import jpy import unittest from types import SimpleNamespace from typing import List, Any @@ -10,10 +8,11 @@ from deephaven import DHError, read_csv, empty_table, SortDirection, AsOfMatchRule, time_table, ugp from deephaven.agg import sum_, weighted_avg, avg, pct, group, count_, first, last, max_, median, min_, std, abs_sum, \ var, formula, partition +from deephaven.execution_context import make_user_exec_ctx from deephaven.html import to_html from deephaven.pandas import to_pandas from deephaven.table import Table -from tests.testbase import BaseTestCase, make_user_exec_ctx +from tests.testbase import BaseTestCase class TableTestCase(BaseTestCase): diff --git a/py/server/tests/test_ugp.py b/py/server/tests/test_ugp.py index 76c2842d868..4b2897bca50 100644 --- a/py/server/tests/test_ugp.py +++ b/py/server/tests/test_ugp.py @@ -7,8 +7,9 @@ from deephaven import time_table, DHError, merge, merge_sorted from deephaven import ugp +from deephaven.execution_context import make_user_exec_ctx from deephaven.table import Table -from tests.testbase import BaseTestCase, make_user_exec_ctx +from tests.testbase import BaseTestCase def transform_func(t: Table) -> Table: @@ -238,7 +239,6 @@ def test_auto_locking_partitioned_table(self): with make_user_exec_ctx(): pt2 = pt.partitioned_transform(pt1, partitioned_transform_func) - def test_auto_locking_table_factory(self): with ugp.shared_lock(): test_table = time_table("00:00:00.001").update(["X=i", "Y=i%13", "Z=X*Y"]) diff --git a/py/server/tests/testbase.py b/py/server/tests/testbase.py index a42976016eb..736488cc5b2 100644 --- a/py/server/tests/testbase.py +++ b/py/server/tests/testbase.py @@ -8,6 +8,7 @@ import jpy from deephaven import DHError +from deephaven.execution_context import make_user_exec_ctx from deephaven.ugp import exclusive_lock from deephaven.table import Table @@ -17,6 +18,7 @@ _JTableTools = jpy.get_type("io.deephaven.engine.util.TableTools") _JExecutionContext = jpy.get_type("io.deephaven.engine.context.ExecutionContext") + def table_equals(table_a: Table, table_b: Table) -> bool: try: return False if _JTableTools.diff(table_a.j_table, table_b.j_table, 1) else True @@ -24,18 +26,6 @@ def table_equals(table_a: Table, table_b: Table) -> bool: raise DHError(e, "table equality test failed.") from e -# TODO(deephaven-core#2867): Wrap ExecutionContext in Python -# Jianfeng to remove this and introduce into deephaven execution_context module for users' convenience -@contextlib.contextmanager -def make_user_exec_ctx(): - j_execution_context = _JExecutionContext.makeExecutionContext(False).open() - try: - yield - except Exception as e: - raise DHError(e, "exception raised in the enclosed code block.") from e - finally: - j_execution_context.close() - class BaseTestCase(unittest.TestCase): @classmethod def setUpClass(cls) -> None: @@ -46,7 +36,7 @@ def tearDownClass(cls) -> None: ... def setUp(self) -> None: - self._execution_context = py_dh_session.getExecutionContext().open() + self._execution_context = make_user_exec_ctx().j_exec_ctx.open() def tearDown(self) -> None: self._execution_context.close() From 3ac2ee5568c5d5d40bf56c5b9c5888aaae708c63 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Thu, 22 Sep 2022 10:25:37 -0600 Subject: [PATCH 148/215] Fix eager formula initialization not seeing new columns (#2896) --- .../engine/table/impl/DeferredViewTable.java | 6 +-- .../PartitionedTableProxyImpl.java | 8 ++-- .../analyzers/SelectAndViewAnalyzer.java | 12 ++++++ .../table/impl/DeferredViewTableTest.java | 41 +++++++++++++++++++ .../table/impl/PartitionedTableTest.java | 1 + 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 engine/table/src/test/java/io/deephaven/engine/table/impl/DeferredViewTableTest.java diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java index a052accd486..744abcdecad 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/DeferredViewTable.java @@ -9,6 +9,7 @@ import io.deephaven.base.verify.Assert; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.*; +import io.deephaven.engine.table.impl.select.analyzers.SelectAndViewAnalyzer; import io.deephaven.util.QueryConstants; import io.deephaven.engine.liveness.LivenessArtifact; import io.deephaven.engine.liveness.LivenessReferent; @@ -42,9 +43,8 @@ public DeferredViewTable(@NotNull final TableDefinition definition, this.deferredViewColumns = deferredViewColumns == null ? SelectColumn.ZERO_LENGTH_SELECT_COLUMN_ARRAY : deferredViewColumns; final TableDefinition parentDefinition = tableReference.getDefinition(); - for (final SelectColumn sc : this.deferredViewColumns) { - sc.initDef(parentDefinition.getColumnNameMap()); - } + SelectAndViewAnalyzer.initializeSelectColumns( + parentDefinition.getColumnNameMap(), this.deferredViewColumns); this.deferredFilters = deferredFilters == null ? WhereFilter.ZERO_LENGTH_SELECT_FILTER_ARRAY : deferredFilters; for (final WhereFilter sf : this.deferredFilters) { sf.init(parentDefinition); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 4960878ec81..95d4a1a3119 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -11,7 +11,6 @@ import io.deephaven.api.updateby.UpdateByControl; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.liveness.LivenessArtifact; -import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.PartitionedTable; import io.deephaven.engine.table.Table; @@ -22,6 +21,7 @@ import io.deephaven.engine.table.impl.select.SelectColumn; import io.deephaven.engine.table.impl.select.SourceColumn; import io.deephaven.engine.table.impl.select.WhereFilter; +import io.deephaven.engine.table.impl.select.analyzers.SelectAndViewAnalyzer; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.TableTools; import org.jetbrains.annotations.NotNull; @@ -432,10 +432,8 @@ public PartitionedTable.Proxy whereNotIn(TableOperations rightTable, @NotNull private SelectColumn[] toSelectColumns(Collection columns) { final SelectColumn[] selectColumns = SelectColumn.from(columns); - Map> targetColumnMap = target.constituentDefinition().getColumnNameMap(); - for (SelectColumn column : selectColumns) { - column.initDef(targetColumnMap); - } + SelectAndViewAnalyzer.initializeSelectColumns( + target.constituentDefinition().getColumnNameMap(), selectColumns); return selectColumns; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java index 45a51dc78b6..a249ed69e53 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java @@ -43,6 +43,18 @@ public enum Mode { VIEW_LAZY, VIEW_EAGER, SELECT_STATIC, SELECT_REFRESHING, SELECT_REDIRECTED_REFRESHING } + public static void initializeSelectColumns( + final Map> parentColumnMap, + final SelectColumn[] selectColumns) { + final Map> targetColumnMap = new HashMap<>(parentColumnMap); + for (SelectColumn column : selectColumns) { + column.initDef(targetColumnMap); + final ColumnDefinition columnDefinition = + ColumnDefinition.fromGenericType(column.getName(), column.getReturnedType()); + targetColumnMap.put(column.getName(), columnDefinition); + } + } + public static SelectAndViewAnalyzer create(Mode mode, Map> columnSources, TrackingRowSet rowSet, ModifiedColumnSet parentMcs, boolean publishTheseSources, SelectColumn... selectColumns) { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/DeferredViewTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/DeferredViewTableTest.java new file mode 100644 index 00000000000..b47635b1c1d --- /dev/null +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/DeferredViewTableTest.java @@ -0,0 +1,41 @@ +package io.deephaven.engine.table.impl; + +import io.deephaven.api.Selectable; +import io.deephaven.datastructures.util.CollectionUtil; +import io.deephaven.engine.table.ColumnDefinition; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.TableDefinition; +import io.deephaven.engine.table.impl.select.SelectColumn; +import io.deephaven.engine.table.impl.select.WhereFilter; +import io.deephaven.engine.util.TableTools; +import io.deephaven.test.junit4.EngineCleanup; +import org.junit.Rule; +import org.junit.Test; + +public class DeferredViewTableTest { + @Rule + public final EngineCleanup cleanup = new EngineCleanup(); + + @Test + public void testDeferredViewTableCanUseIntermediateColumns() { + final TableDefinition resultDef = TableDefinition.of( + ColumnDefinition.fromGenericType("X", int.class), + ColumnDefinition.fromGenericType("Y", int.class)); + final Table sourceTable = TableTools.emptyTable(10); + final SelectColumn[] viewColumns = SelectColumn.from( + Selectable.parse("X = ii"), + Selectable.parse("Y = 2 * X")); + + final DeferredViewTable deferredTable = new DeferredViewTable( + resultDef, + "test", + new DeferredViewTable.SimpleTableReference(sourceTable), + CollectionUtil.ZERO_LENGTH_STRING_ARRAY, + viewColumns, + WhereFilter.ZERO_LENGTH_SELECT_FILTER_ARRAY); + + final Table resultTable = deferredTable.coalesce(); + final Table expectedTable = sourceTable.update(viewColumns); + TstUtils.assertTableEquals(expectedTable, resultTable); + } +} diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java index 9621858eaf1..5c1f022dcb7 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/PartitionedTableTest.java @@ -851,6 +851,7 @@ public void testExecutionContext() { newExecutionContextNugget(table, src -> src.select("K = queryScopeVar", "indices", "intCol")), newExecutionContextNugget(table, src -> src.view("K = queryScopeVar", "indices", "intCol")), newExecutionContextNugget(table, src -> src.where("intCol > queryScopeFilter")), + newExecutionContextNugget(table, src -> src.update("X = 0", "Y = X")), }; for (int i = 0; i < 100; i++) { From f5b1576f747714185bcc76ad15cbb057836edd8e Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:50:41 -0600 Subject: [PATCH 149/215] Wrap consumeToPartitionedTable in Python (#2904) * Wrap consumeToPartitionedTable in Python * Update docstring * More clarifying doc --- .../table/impl/SourcePartitionedTable.java | 5 ++ .../java/io/deephaven/kafka/KafkaTools.java | 17 +++- py/server/deephaven/stream/kafka/consumer.py | 88 +++++++++++++++++-- py/server/tests/test_kafka_consumer.py | 39 +++++++- 4 files changed, 137 insertions(+), 12 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SourcePartitionedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SourcePartitionedTable.java index ff4aae84c22..ea8f49ae306 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SourcePartitionedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SourcePartitionedTable.java @@ -172,8 +172,13 @@ private RowSet sortAndAddLocations(@NotNull final Stream location locations.sorted(Comparator.comparing(TableLocation::getKey)).forEach(tl -> { final long constituentRowKey = lastInsertedRowKey.incrementAndGet(); final Table constituentTable = makeConstituentTable(tl); + + resultTableLocationKeys.ensureCapacity(constituentRowKey + 1); resultTableLocationKeys.set(constituentRowKey, tl.getKey()); + + resultLocationTables.ensureCapacity(constituentRowKey + 1); resultLocationTables.set(constituentRowKey, constituentTable); + result.manage(constituentTable); }); return initialLastRowKey == lastInsertedRowKey.longValue() diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java b/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java index 5055ea2c04b..e25e8a511fc 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/KafkaTools.java @@ -1715,6 +1715,9 @@ private static class StreamPartitionedTable extends PartitionedTableImpl impleme @ReferentialIntegrity private final UpdateSourceCombiner refreshCombiner; + private final WritableColumnSource partitionColumn; + private final WritableColumnSource

    constituentColumn; + private volatile long lastAddedPartitionRowKey = -1L; // NULL_ROW_KEY private StreamPartitionedTable( @@ -1723,6 +1726,9 @@ private StreamPartitionedTable( super(makeResultTable(), Set.of(PARTITION_COLUMN_NAME), true, CONSTITUENT_COLUMN_NAME, constituentDefinition, true, false); this.refreshCombiner = refreshCombiner; + partitionColumn = (WritableColumnSource) table().getColumnSource(PARTITION_COLUMN_NAME, int.class); + constituentColumn = + (WritableColumnSource
    ) table().getColumnSource(CONSTITUENT_COLUMN_NAME, Table.class); manage(refreshCombiner); refreshCombiner.addSource(this); UpdateGraphProcessor.DEFAULT.addSource(refreshCombiner); @@ -1746,10 +1752,13 @@ public void run() { public synchronized void enqueueAdd(final int partition, @NotNull final Table partitionTable) { final long partitionRowKey = lastAddedPartitionRowKey + 1; - ((WritableColumnSource) table().getColumnSource(PARTITION_COLUMN_NAME, Integer.class)) - .set(partitionRowKey, partition); - ((WritableColumnSource
    ) table().getColumnSource(CONSTITUENT_COLUMN_NAME, Table.class)) - .set(partitionRowKey, partitionTable); + + partitionColumn.ensureCapacity(partitionRowKey + 1); + partitionColumn.set(partitionRowKey, partition); + + constituentColumn.ensureCapacity(partitionRowKey + 1); + constituentColumn.set(partitionRowKey, partitionTable); + lastAddedPartitionRowKey = partitionRowKey; } diff --git a/py/server/deephaven/stream/kafka/consumer.py b/py/server/deephaven/stream/kafka/consumer.py index a240038017d..0697a8ffd9e 100644 --- a/py/server/deephaven/stream/kafka/consumer.py +++ b/py/server/deephaven/stream/kafka/consumer.py @@ -4,7 +4,7 @@ """ The kafka.consumer module supports consuming a Kakfa topic as a Deephaven live table. """ from enum import Enum -from typing import Dict, Tuple, List, Callable +from typing import Dict, Tuple, List, Callable, Union import jpy @@ -14,7 +14,7 @@ from deephaven.column import Column from deephaven.dherror import DHError from deephaven.dtypes import DType -from deephaven.table import Table +from deephaven.table import Table, PartitionedTable _JKafkaTools = jpy.get_type("io.deephaven.kafka.KafkaTools") _JKafkaTools_Consume = jpy.get_type("io.deephaven.kafka.KafkaTools$Consume") @@ -59,6 +59,7 @@ def j_object(self) -> jpy.JType: in the properties as "key.column.name" or "value.column.name" in the config, and otherwise default to "key" or "value". """ + class TableType(JObjectWrapper): """An Enum that defines the supported Table Type for consuming Kafka.""" @@ -76,7 +77,7 @@ def append(): return TableType(TableType.j_object_type.append()) @staticmethod - def ring(capacity : int): + def ring(capacity: int): """ Consume all partitions into a single in-memory ring table.""" return TableType(TableType.j_object_type.ring(capacity)) @@ -95,6 +96,7 @@ def j_object(self) -> jpy.JType: TableType.Append = TableType.append() """ Deprecated, prefer TableType.append(). Consume all partitions into a single interleaved in-memory append-only table.""" + def j_partitions(partitions): if partitions is None: partitions = ALL_PARTITIONS @@ -161,6 +163,67 @@ def consume( DHError """ + return _consume(kafka_config, topic, partitions, offsets, key_spec, value_spec, table_type, to_partitioned=False) + + +def consume_to_partitioned_table( + kafka_config: Dict, + topic: str, + partitions: List[int] = None, + offsets: Dict[int, int] = None, + key_spec: KeyValueSpec = None, + value_spec: KeyValueSpec = None, + table_type: TableType = TableType.stream(), +) -> PartitionedTable: + """Consume from Kafka to a Deephaven partitioned table. + + Args: + kafka_config (Dict): configuration for the associated Kafka consumer and also the resulting table. + Once the table-specific properties are stripped, the remaining one is used to call the constructor of + org.apache.kafka.clients.consumer.KafkaConsumer; pass any KafkaConsumer specific desired configuration here + topic (str): the Kafka topic name + partitions (List[int]) : a list of integer partition numbers, default is None which means all partitions + offsets (Dict[int, int]) : a mapping between partition numbers and offset numbers, and can be one of the + predefined ALL_PARTITIONS_SEEK_TO_BEGINNING, ALL_PARTITIONS_SEEK_TO_END or ALL_PARTITIONS_DONT_SEEK. + The default is None which works the same as ALL_PARTITIONS_DONT_SEEK. The offset numbers may be one + of the predefined SEEK_TO_BEGINNING, SEEK_TO_END, or DONT_SEEK. + key_spec (KeyValueSpec): specifies how to map the Key field in Kafka messages to Deephaven column(s). + It can be the result of calling one of the functions: simple_spec(),avro_spec() or json_spec() in this + module, or the predefined KeyValueSpec.IGNORE or KeyValueSpec.FROM_PROPERTIES. The default is None which + works the same as KeyValueSpec.FROM_PROPERTIES, in which case, the kafka_config param should include values + for dictionary keys 'deephaven.key.column.name' and 'deephaven.key.column.type', for the single resulting + column name and type + value_spec (KeyValueSpec): specifies how to map the Value field in Kafka messages to Deephaven column(s). + It can be the result of calling one of the functions: simple_spec(),avro_spec() or json_spec() in this + module, or the predefined KeyValueSpec.IGNORE or KeyValueSpec.FROM_PROPERTIES. The default is None which + works the same as KeyValueSpec.FROM_PROPERTIES, in which case, the kafka_config param should include values + for dictionary keys 'deephaven.key.column.name' and 'deephaven.key.column.type', for the single resulting + column name and type + table_type (TableType): a TableType enum, specifying the type of the expected result's constituent tables, + default is TableType.stream() + + Returns: + a Deephaven live partitioned table that will update based on Kafka messages consumed for the given topic, + the keys of this partitioned table are the partition numbers of the topic, and its constituents are tables per + topic partition. + + Raises: + DHError + """ + + return _consume(kafka_config, topic, partitions, offsets, key_spec, value_spec, table_type, to_partitioned=True) + + +def _consume( + kafka_config: Dict, + topic: str, + partitions: List[int] = None, + offsets: Dict[int, int] = None, + key_spec: KeyValueSpec = None, + value_spec: KeyValueSpec = None, + table_type: TableType = TableType.stream(), + to_partitioned: bool = False, +) -> Union[Table, PartitionedTable]: try: partitions = j_partitions(partitions) @@ -184,8 +247,20 @@ def consume( raise ValueError("at least one argument for 'key' or 'value' must be different from KeyValueSpec.IGNORE") kafka_config = j_properties(kafka_config) - return Table( - j_table=_JKafkaTools.consumeToTable( + if not to_partitioned: + return Table( + j_table=_JKafkaTools.consumeToTable( + kafka_config, + topic, + partitions, + offsets, + key_spec.j_object, + value_spec.j_object, + table_type.j_object, + ) + ) + else: + return PartitionedTable(j_partitioned_table=_JKafkaTools.consumeToPartitionedTable( kafka_config, topic, partitions, @@ -193,8 +268,7 @@ def consume( key_spec.j_object, value_spec.j_object, table_type.j_object, - ) - ) + )) except Exception as e: raise DHError(e, "failed to consume a Kafka stream.") from e diff --git a/py/server/tests/test_kafka_consumer.py b/py/server/tests/test_kafka_consumer.py index 790c1beff59..88699b688a1 100644 --- a/py/server/tests/test_kafka_consumer.py +++ b/py/server/tests/test_kafka_consumer.py @@ -5,7 +5,7 @@ import os import unittest -from deephaven import kafka_consumer as ck +from deephaven import kafka_consumer as ck, ugp from deephaven.stream.kafka.consumer import TableType, KeyValueSpec from tests.testbase import BaseTestCase from deephaven import dtypes @@ -211,6 +211,43 @@ def test_table_types(self): _ = TableType.stream() _ = TableType.ring(4096) + def test_json_spec_partitioned_table(self): + pt = ck.consume_to_partitioned_table( + {'bootstrap.servers': 'redpanda:29092'}, + 'orders', + key_spec=KeyValueSpec.IGNORE, + value_spec=ck.json_spec( + [('Symbol', dtypes.string), + ('Side', dtypes.string), + ('Price', dtypes.double), + ('Qty', dtypes.int_), + ('Tstamp', dtypes.DateTime)], + mapping={ + 'jsymbol': 'Symbol', + 'jside': 'Side', + 'jprice': 'Price', + 'jqty': 'Qty', + 'jts': 'Tstamp' + } + ), + table_type=TableType.append() + ) + + cols = pt.constituent_table_columns + self.assertEqual(8, len(cols)) + self._assert_common_cols(cols) + + self.assertEqual("Symbol", cols[3].name) + self.assertEqual(dtypes.string, cols[3].data_type) + self.assertEqual("Side", cols[4].name) + self.assertEqual(dtypes.string, cols[4].data_type) + self.assertEqual("Price", cols[5].name) + self.assertEqual(dtypes.double, cols[5].data_type) + self.assertEqual("Qty", cols[6].name) + self.assertEqual(dtypes.int_, cols[6].data_type) + self.assertEqual("Tstamp", cols[7].name) + self.assertEqual(dtypes.DateTime, cols[7].data_type) + if __name__ == "__main__": unittest.main() From c1299924c15050a837fa860cf726b48e71926fc0 Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Sun, 25 Sep 2022 10:17:57 -0400 Subject: [PATCH 150/215] Address integer overflow in static NJ and AJ; clean up wider-than-necessary type usage and eliminate legacy chunked hashers in NJ and AJ (#2906) 1. Eliminate legacy chunked natural join and as-of join state managers and clean up code accordingly. 2. Fix position overflow bug in left hash slot gathering during natural join and as-of join instantiation. 3. Switch to a narrower type for hash slot gathering in NJ and AJ, since we no longer need space for overflow masking. --- .../engine/table/impl/AsOfJoinHelper.java | 105 +- .../engine/table/impl/BucketingContext.java | 10 +- ...ementalChunkedNaturalJoinStateManager.java | 2264 ----------------- .../IncrementalNaturalJoinStateManager.java | 6 +- .../engine/table/impl/JoinControl.java | 18 +- .../engine/table/impl/NaturalJoinHelper.java | 73 +- .../impl/NaturalJoinModifiedSlotTracker.java | 44 +- .../RightIncrementalAsOfJoinStateManager.java | 9 - ...ncrementalChunkedAsOfJoinStateManager.java | 2237 ---------------- ...ementalChunkedNaturalJoinStateManager.java | 1512 ----------- ...leUniqueStaticNaturalJoinStateManager.java | 2 + .../impl/StaticAsOfJoinStateManager.java | 9 - .../StaticChunkedAsOfJoinStateManager.java | 1919 -------------- .../StaticChunkedNaturalJoinStateManager.java | 1277 ---------- .../impl/StaticNaturalJoinStateManager.java | 1 - .../table/impl/SymbolTableCombiner.java | 90 - .../BucketedChunkedAjMergedListener.java | 24 +- .../{join => asofjoin}/ChunkedAjUtils.java | 2 +- ...rementalAsOfJoinStateManagerTypedBase.java | 157 +- ...IncrementalHashedAsOfJoinStateManager.java | 52 +- .../StaticAsOfJoinStateManagerTypedBase.java | 52 +- .../StaticHashedAsOfJoinStateManager.java | 17 +- .../impl/asofjoin/TypedAsOfJoinFactory.java | 18 +- .../ZeroKeyChunkedAjMergedListener.java | 3 +- .../RightIncrementalAsOfJoinHasherByte.java | 30 +- .../RightIncrementalAsOfJoinHasherChar.java | 30 +- .../RightIncrementalAsOfJoinHasherDouble.java | 30 +- .../RightIncrementalAsOfJoinHasherFloat.java | 30 +- .../RightIncrementalAsOfJoinHasherInt.java | 30 +- .../RightIncrementalAsOfJoinHasherLong.java | 30 +- .../RightIncrementalAsOfJoinHasherObject.java | 30 +- .../RightIncrementalAsOfJoinHasherShort.java | 30 +- .../gen/StaticAsOfJoinHasherByte.java | 8 +- .../gen/StaticAsOfJoinHasherChar.java | 8 +- .../gen/StaticAsOfJoinHasherDouble.java | 8 +- .../gen/StaticAsOfJoinHasherFloat.java | 8 +- .../gen/StaticAsOfJoinHasherInt.java | 8 +- .../gen/StaticAsOfJoinHasherLong.java | 8 +- .../gen/StaticAsOfJoinHasherObject.java | 8 +- .../gen/StaticAsOfJoinHasherShort.java | 8 +- .../impl/by/typed/TypedHasherFactory.java | 28 +- ...entalNaturalJoinStateManagerTypedBase.java | 11 +- ...entalNaturalJoinStateManagerTypedBase.java | 10 +- .../StaticHashedNaturalJoinStateManager.java | 17 +- ...taticNaturalJoinStateManagerTypedBase.java | 42 +- .../naturaljoin/TypedNaturalJoinFactory.java | 8 +- .../gen/StaticNaturalJoinHasherByte.java | 13 +- .../gen/StaticNaturalJoinHasherChar.java | 13 +- .../gen/StaticNaturalJoinHasherDouble.java | 13 +- .../gen/StaticNaturalJoinHasherFloat.java | 13 +- .../gen/StaticNaturalJoinHasherInt.java | 13 +- .../gen/StaticNaturalJoinHasherLong.java | 13 +- .../gen/StaticNaturalJoinHasherObject.java | 13 +- .../gen/StaticNaturalJoinHasherShort.java | 13 +- .../engine/table/impl/QueryTableAjTest.java | 14 +- .../table/impl/QueryTableNaturalJoinTest.java | 23 - ...QueryTableStaticNaturalJoinRandomTest.java | 23 - .../replicators/ReplicateHashTable.java | 41 +- 58 files changed, 513 insertions(+), 10013 deletions(-) delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedAsOfJoinStateManager.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedNaturalJoinStateManager.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedAsOfJoinStateManager.java delete mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedNaturalJoinStateManager.java rename engine/table/src/main/java/io/deephaven/engine/table/impl/{join => asofjoin}/BucketedChunkedAjMergedListener.java (98%) rename engine/table/src/main/java/io/deephaven/engine/table/impl/{join => asofjoin}/ChunkedAjUtils.java (98%) rename engine/table/src/main/java/io/deephaven/engine/table/impl/{join => asofjoin}/ZeroKeyChunkedAjMergedListener.java (99%) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/AsOfJoinHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/AsOfJoinHelper.java index a7cb148d805..56bcd081a04 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/AsOfJoinHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/AsOfJoinHelper.java @@ -12,7 +12,6 @@ import io.deephaven.chunk.sized.SizedChunk; import io.deephaven.chunk.sized.SizedLongChunk; import io.deephaven.chunk.util.hashing.ChunkEquals; -import io.deephaven.configuration.Configuration; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import io.deephaven.engine.table.*; @@ -21,9 +20,9 @@ import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; import io.deephaven.engine.table.impl.asofjoin.StaticHashedAsOfJoinStateManager; import io.deephaven.engine.table.impl.by.typed.TypedHasherFactory; -import io.deephaven.engine.table.impl.join.BucketedChunkedAjMergedListener; +import io.deephaven.engine.table.impl.asofjoin.BucketedChunkedAjMergedListener; import io.deephaven.engine.table.impl.join.JoinListenerRecorder; -import io.deephaven.engine.table.impl.join.ZeroKeyChunkedAjMergedListener; +import io.deephaven.engine.table.impl.asofjoin.ZeroKeyChunkedAjMergedListener; import io.deephaven.engine.table.impl.sort.LongSortKernel; import io.deephaven.engine.table.impl.sources.*; import io.deephaven.engine.table.impl.ssa.ChunkSsaStamp; @@ -45,10 +44,6 @@ import java.util.function.Supplier; public class AsOfJoinHelper { - static boolean USE_TYPED_STATE_MANAGER = - Configuration.getInstance().getBooleanWithDefault( - "AsOfJoinHelper.useTypedStateManager", - true); private AsOfJoinHelper() {} // static use only @@ -139,7 +134,7 @@ private static Table rightStaticAj(JoinControl control, ColumnSource rightStampSource, WritableRowRedirection rowRedirection) { - final LongArraySource slots = new LongArraySource(); + final IntegerArraySource slots = new IntegerArraySource(); final int slotCount; final boolean buildLeft; @@ -177,19 +172,15 @@ private static Table rightStaticAj(JoinControl control, final StaticHashedAsOfJoinStateManager asOfJoinStateManager; if (buildLeft) { - asOfJoinStateManager = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(StaticAsOfJoinStateManagerTypedBase.class, + asOfJoinStateManager = + TypedHasherFactory.make(StaticAsOfJoinStateManagerTypedBase.class, leftSources, originalLeftSources, size, - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new StaticChunkedAsOfJoinStateManager(leftSources, - size, originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); } else { - asOfJoinStateManager = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(StaticAsOfJoinStateManagerTypedBase.class, + asOfJoinStateManager = + TypedHasherFactory.make(StaticAsOfJoinStateManagerTypedBase.class, leftSources, originalLeftSources, size, - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new StaticChunkedAsOfJoinStateManager(leftSources, - size, originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); } @@ -256,7 +247,6 @@ private static Table rightStaticAj(JoinControl control, asOfJoinStateManager.convertRightBuildersToIndex(slots, slotCount); } arrayValuesCache = new ArrayValuesCache(asOfJoinStateManager.getTableSize()); - arrayValuesCache.ensureOverflow(asOfJoinStateManager.getOverflowSize()); } else { arrayValuesCache = null; if (rightGroupedSources != null) { @@ -273,7 +263,7 @@ private static Table rightStaticAj(JoinControl control, final ResettableWritableChunk valuesChunk = rightStampSource.getChunkType().makeResettableWritableChunk()) { for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); RowSet leftRowSet = asOfJoinStateManager.getLeftIndex(slot); if (leftRowSet == null || leftRowSet.isEmpty()) { continue; @@ -308,7 +298,7 @@ private static Table rightStaticAj(JoinControl control, final ModifiedColumnSet leftKeysOrStamps = leftTable.newModifiedColumnSet(MatchPair.getLeftColumns(columnsToMatch)); - final LongArraySource updatedSlots = new LongArraySource(); + final IntegerArraySource updatedSlots = new IntegerArraySource(); final ModifiedColumnSet allRightColumns = result.newModifiedColumnSet(MatchPair.getLeftColumns(columnsToAdd)); final ModifiedColumnSet.Transformer leftTransformer = leftTable.newModifiedColumnSetTransformer(result, leftTable.getDefinition().getColumnNamesArray()); @@ -353,7 +343,7 @@ public void onUpdate(TableUpdate upstream) { final ResettableWritableChunk valuesChunk = rightStampSource.getChunkType().makeResettableWritableChunk()) { for (int ii = 0; ii < slotCount; ++ii) { - final long slot = updatedSlots.getLong(ii); + final int slot = updatedSlots.getInt(ii); final RowSet leftRowSet = asOfJoinStateManager.getLeftIndex(slot); final RowSet rightRowSet = asOfJoinStateManager.getRightIndex(slot); @@ -392,54 +382,25 @@ private static class ArrayValuesCache { final ObjectArraySource cacheStampKeys; final ObjectArraySource cacheStampValues; - final ObjectArraySource overflowCachedStampKeys; - final ObjectArraySource overflowCachedStampValues; - private ArrayValuesCache(int size) { cacheStampKeys = new ObjectArraySource<>(long[].class); cacheStampValues = new ObjectArraySource<>(Object.class); cacheStampKeys.ensureCapacity(size); cacheStampValues.ensureCapacity(size); - - overflowCachedStampKeys = new ObjectArraySource<>(long[].class); - overflowCachedStampValues = new ObjectArraySource<>(Object.class); } long[] getKeys(long slot) { - if (StaticChunkedAsOfJoinStateManager.isOverflowLocation(slot)) { - return overflowCachedStampKeys - .get(StaticChunkedAsOfJoinStateManager.hashLocationToOverflowLocation(slot)); - } else { - return cacheStampKeys.get(slot); - } + return cacheStampKeys.get(slot); } Object getValues(long slot) { - if (StaticChunkedAsOfJoinStateManager.isOverflowLocation(slot)) { - return overflowCachedStampValues - .get(StaticChunkedAsOfJoinStateManager.hashLocationToOverflowLocation(slot)); - } else { - return cacheStampValues.get(slot); - } + return cacheStampValues.get(slot); } void setKeysAndValues(long slot, long[] keyIndices, Object StampArray) { - if (StaticChunkedAsOfJoinStateManager.isOverflowLocation(slot)) { - final long overflowLocation = StaticChunkedAsOfJoinStateManager.hashLocationToOverflowLocation(slot); - overflowCachedStampKeys.ensureCapacity(overflowLocation + 1); - overflowCachedStampValues.ensureCapacity(overflowLocation + 1); - overflowCachedStampKeys.set(overflowLocation, keyIndices); - overflowCachedStampValues.set(overflowLocation, StampArray); - } else { - cacheStampKeys.set(slot, keyIndices); - cacheStampValues.set(slot, StampArray); - } - } - - void ensureOverflow(int overflowSize) { - overflowCachedStampKeys.ensureCapacity(overflowSize); - overflowCachedStampValues.ensureCapacity(overflowSize); + cacheStampKeys.set(slot, keyIndices); + cacheStampValues.set(slot, StampArray); } } @@ -495,7 +456,7 @@ private static void getCachedLeftStampsAndKeys(RightIncrementalHashedAsOfJoinSta SizedSafeCloseable> sortContext, ResettableWritableLongChunk keyChunk, ResettableWritableChunk valuesChunk, ArrayValuesCache arrayValuesCache, - long slot) { + int slot) { final long[] leftStampKeys = arrayValuesCache.getKeys(slot); if (leftStampKeys == null) { if (leftRowSet == null) { @@ -572,19 +533,16 @@ private static Table rightTickingLeftStaticAj(JoinControl control, final int tableSize = control.initialBuildSize(); - final RightIncrementalHashedAsOfJoinStateManager asOfJoinStateManager = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(RightIncrementalAsOfJoinStateManagerTypedBase.class, + final RightIncrementalHashedAsOfJoinStateManager asOfJoinStateManager = + TypedHasherFactory.make(RightIncrementalAsOfJoinStateManagerTypedBase.class, leftSources, originalLeftSources, tableSize, - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new RightIncrementalChunkedAsOfJoinStateManager(leftSources, tableSize, originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); - final LongArraySource slots = new LongArraySource(); + final IntegerArraySource slots = new IntegerArraySource(); final int slotCount = asOfJoinStateManager.buildFromLeftSide(leftTable.getRowSet(), leftSources, slots); asOfJoinStateManager.probeRightInitial(rightTable.getRowSet(), rightSources); final ArrayValuesCache leftValuesCache = new ArrayValuesCache(asOfJoinStateManager.getTableSize()); - leftValuesCache.ensureOverflow(asOfJoinStateManager.getOverflowSize()); - final SizedSafeCloseable> sortContext = new SizedSafeCloseable<>(size -> LongSortKernel.makeContext(stampChunkType, order, size, true)); final SizedSafeCloseable leftStampFillContext = @@ -601,7 +559,7 @@ private static Table rightTickingLeftStaticAj(JoinControl control, final ResettableWritableChunk leftValuesChunk = rightStampSource.getChunkType().makeResettableWritableChunk()) { for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final RowSet leftRowSet = asOfJoinStateManager.getAndClearLeftIndex(slot); assert leftRowSet != null; assert leftRowSet.size() > 0; @@ -703,7 +661,7 @@ public void onUpdate(TableUpdate upstream) { rightStampSource.getChunkType().makeResettableWritableChunk(); final SizedLongChunk priorRedirections = new SizedLongChunk<>()) { for (int slotIndex = 0; slotIndex < removedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final SegmentedSortedArray rightSsa = asOfJoinStateManager.getRightSsa(slot); @@ -757,7 +715,7 @@ public void onUpdate(TableUpdate upstream) { rowSetToShift.close(); for (int slotIndex = 0; slotIndex < shiftedSlots; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); try (final RowSet slotShiftRowSet = sequentialBuilders.get(slotIndex).build()) { sequentialBuilders.set(slotIndex, null); @@ -827,7 +785,7 @@ public void onUpdate(TableUpdate upstream) { // be // restamped with our value for (int slotIndex = 0; slotIndex < addedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final SegmentedSortedArray rightSsa = asOfJoinStateManager.getRightSsa(slot); @@ -883,7 +841,7 @@ public void onUpdate(TableUpdate upstream) { rightSources, slots, sequentialBuilders); for (int slotIndex = 0; slotIndex < modifiedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); try (final RowSet rightModified = sequentialBuilders.get(slotIndex).build()) { sequentialBuilders.set(slotIndex, null); @@ -957,13 +915,12 @@ private static Table bothIncrementalAj(JoinControl control, final int tableSize = control.initialBuildSize(); - final RightIncrementalHashedAsOfJoinStateManager asOfJoinStateManager = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(RightIncrementalAsOfJoinStateManagerTypedBase.class, + final RightIncrementalHashedAsOfJoinStateManager asOfJoinStateManager = + TypedHasherFactory.make(RightIncrementalAsOfJoinStateManagerTypedBase.class, leftSources, originalLeftSources, tableSize, - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new RightIncrementalChunkedAsOfJoinStateManager(leftSources, tableSize, originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); - final LongArraySource slots = new LongArraySource(); + final IntegerArraySource slots = new IntegerArraySource(); int slotCount = asOfJoinStateManager.buildFromLeftSide(leftTable.getRowSet(), leftSources, slots); slotCount = asOfJoinStateManager.buildFromRightSide(rightTable.getRowSet(), rightSources, slots, slotCount); @@ -1031,7 +988,7 @@ public SegmentedSortedArray apply(RowSet leftIndex) { // if we are successful, then the mergedJoinListener will own them and be responsible for closing them try (final SafeCloseableList closeableList = new SafeCloseableList(leftSsaFactory, rightSsaFactory)) { for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); // if either initial state is empty, we would prefer to leave things as a RowSet rather than process // them into an ssa diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketingContext.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketingContext.java index 5442cc3ca16..32299831648 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketingContext.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/BucketingContext.java @@ -83,7 +83,7 @@ class BucketingContext implements SafeCloseable { maximumUniqueValue = BooleanUtils.TRUE_BOOLEAN_AS_BYTE; minimumUniqueValue = BooleanUtils.NULL_BOOLEAN_AS_BYTE; uniqueFunctor = ToIntegerCast.makeToIntegerCast(ChunkType.Byte, - StaticNaturalJoinStateManager.CHUNK_SIZE, -BooleanUtils.NULL_BOOLEAN_AS_BYTE); + JoinControl.CHUNK_SIZE, -BooleanUtils.NULL_BOOLEAN_AS_BYTE); } } else if (leftType == String.class) { if (control.considerSymbolTables(leftTable, rightTable, useLeftGrouping, useRightGrouping, @@ -126,7 +126,7 @@ class BucketingContext implements SafeCloseable { maximumUniqueValue = symbolTableCombiner.getMaximumIdentifier(); minimumUniqueValue = 0; uniqueFunctor = ToIntegerCast.makeToIntegerCast(ChunkType.Int, - StaticNaturalJoinStateManager.CHUNK_SIZE, 0); + JoinControl.CHUNK_SIZE, 0); } } } @@ -136,7 +136,7 @@ class BucketingContext implements SafeCloseable { maximumUniqueValue = Byte.MAX_VALUE; minimumUniqueValue = Byte.MIN_VALUE; uniqueFunctor = ToIntegerCast.makeToIntegerCast(ChunkType.Byte, - StaticNaturalJoinStateManager.CHUNK_SIZE, -Byte.MIN_VALUE); + JoinControl.CHUNK_SIZE, -Byte.MIN_VALUE); } } else if (leftType == char.class) { if (leftSources.length == 1) { @@ -144,7 +144,7 @@ class BucketingContext implements SafeCloseable { maximumUniqueValue = Character.MAX_VALUE; minimumUniqueValue = Character.MIN_VALUE; uniqueFunctor = ToIntegerCast.makeToIntegerCast(ChunkType.Char, - StaticNaturalJoinStateManager.CHUNK_SIZE, -Character.MIN_VALUE); + JoinControl.CHUNK_SIZE, -Character.MIN_VALUE); } } else if (leftType == short.class) { if (leftSources.length == 1) { @@ -152,7 +152,7 @@ class BucketingContext implements SafeCloseable { maximumUniqueValue = Short.MAX_VALUE; minimumUniqueValue = Short.MIN_VALUE; uniqueFunctor = ToIntegerCast.makeToIntegerCast(ChunkType.Short, - StaticNaturalJoinStateManager.CHUNK_SIZE, -Short.MIN_VALUE); + JoinControl.CHUNK_SIZE, -Short.MIN_VALUE); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java deleted file mode 100644 index 8fb55ec1984..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java +++ /dev/null @@ -1,2264 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from LongChunk -import io.deephaven.chunk.util.hashing.LongChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from Long -import io.deephaven.engine.table.impl.sort.permute.LongPermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -// endregion class visibility -class IncrementalChunkedNaturalJoinStateManager - // region extensions - extends StaticNaturalJoinStateManager - implements IncrementalNaturalJoinStateManager, BothIncrementalNaturalJoinStateManager - // endregion extensions -{ - // region constants - public static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = 1L << 30; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from QueryConstants.NULL_LONG, @StateValueType@ from long - private static final long EMPTY_RIGHT_VALUE = QueryConstants.NULL_LONG; - - // mixin getStateValue - // region overflow pivot - private static final long OVERFLOW_PIVOT_VALUE = DUPLICATE_RIGHT_VALUE; - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

    When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

    - * - *

    This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

    - */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from LongArraySource - private final LongArraySource rightIndexSource - // @StateColumnSourceConstructor@ from LongArraySource\(\) - = new LongArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from LongArraySource - private final LongArraySource overflowRightIndexSource - // @StateColumnSourceConstructor@ from LongArraySource\(\) - = new LongArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - // we assume that our right indices are going to be unique; in which case we do not actually want to store a RowSet - // however, for inactive states, we must store the complete RowSet value, so that we can remove values from it in - // case it does become active at some point. If we have duplicate right hand side values, we store a reference - // into this table - private final ObjectArraySource rightRowSetStorage; - private int nextRightIndexLocation; - private final WritableRowSet freeRightRowSetLocations = RowSetFactory.empty(); - - // we always store left RowSet values parallel to the keys; we may want to optimize for single left indices to avoid - // object allocation, but we do have fairly efficient single range indices at this point - private final ObjectArraySource leftRowSetSource; - private final ObjectArraySource overflowLeftRowSetource; - - // we must maintain our cookie for modified state tracking - private final LongArraySource modifiedTrackerCookieSource; - private final LongArraySource overflowModifiedTrackerCookieSource; - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - IncrementalChunkedNaturalJoinStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , ColumnSource[] tableKeySourcesForErrors - , double maximumLoadFactor - , double targetLoadFactor - // endregion constructor arguments - ) { - // region super - super(tableKeySourcesForErrors); - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - rightRowSetStorage = new ObjectArraySource<>(WritableRowSet.class); - leftRowSetSource = new ObjectArraySource<>(WritableRowSet.class); - overflowLeftRowSetource = new ObjectArraySource<>(WritableRowSet.class); - modifiedTrackerCookieSource = new LongArraySource(); - overflowModifiedTrackerCookieSource = new LongArraySource(); - setMaximumLoadFactor(maximumLoadFactor); - setTargetLoadFactor(targetLoadFactor); - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - rightIndexSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - leftRowSetSource.ensureCapacity(tableSize); - modifiedTrackerCookieSource.ensureCapacity(tableSize); - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowRightIndexSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - overflowLeftRowSetource.ensureCapacity(newCapacity); - overflowModifiedTrackerCookieSource.ensureCapacity(newCapacity); - // endregion ensureOverflowCapacity - } - - // region build wrappers - private static class RedirectionsInitialBuildContext implements InitialBuildContext { - LongArraySource leftRedirections = new LongArraySource(); - } - - @Override - public InitialBuildContext makeInitialBuildContext() { - return new RedirectionsInitialBuildContext(); - } - - @Override - public void addRightSide(final Context bc, RowSequence rightIndex, ColumnSource [] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (rightIndex.isEmpty()) { - return; - } - buildTable((BuildContext)bc, rightIndex, rightSources, null, modifiedSlotTracker); - } - - public void addLeftSide(final Context bc, RowSequence leftIndex, ColumnSource[] leftSources, LongArraySource leftRedirections, NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (leftIndex.isEmpty()) { - return; - } - buildTable((BuildContext)bc, leftIndex, leftSources, leftRedirections, modifiedSlotTracker); - } - - protected void decorateLeftSide(RowSet leftRowSet, ColumnSource[] leftSources, final LongArraySource leftRedirections) { - throw new UnsupportedOperationException(); - } - - @Override - public void decorateLeftSide(RowSet leftRowSet, ColumnSource[] leftSources, InitialBuildContext ibc) { - if (leftRowSet.isEmpty()) { - return; - } - final LongArraySource leftRedirections = ((RedirectionsInitialBuildContext)ibc).leftRedirections; - try (final BuildContext bc = makeBuildContext(leftSources, leftRowSet.size())) { - leftRedirections.ensureCapacity(leftRowSet.size()); - buildTable(bc, leftRowSet, leftSources, leftRedirections, null); - } - } - - public void buildFromRightSide(final Table rightTable, ColumnSource [] rightSources) { - if (rightTable.isEmpty()) { - return; - } - try (final BuildContext bc = makeBuildContext(rightSources, rightTable.size())) { - buildTable(bc, rightTable.getRowSet(), rightSources, null, null); - } - } - - private long allocateRightIndexSlot() { - if (freeRightRowSetLocations.size() > 0) { - final long allocatedKey = freeRightRowSetLocations.lastRowKey(); - freeRightRowSetLocations.remove(allocatedKey); - return allocatedKey; - } - return nextRightIndexLocation++; - } - - private void ensureRightIndexCapacity() { - final long freeSlots = freeRightRowSetLocations.size(); - if (freeSlots > CHUNK_SIZE) { - return; - } - rightRowSetStorage.ensureCapacity(nextRightIndexLocation + CHUNK_SIZE - freeSlots); - } - - private void addLeftIndex(long tableLocation, long keyToAdd) { - final WritableRowSet rowSet = leftRowSetSource.get(tableLocation); - if (rowSet == null) { - leftRowSetSource.set(tableLocation, RowSetFactory.fromKeys(keyToAdd)); - } else { - rowSet.insert(keyToAdd); - } - } - - /** - * Do we have multiple right indices for this value? - * - * @param existingRightIndex the value in our rightRowSet column source - * @return true if we should reference our rightRowSetStorage column source - */ - private boolean isDuplicateRightIndex(long existingRightIndex) { - return existingRightIndex < DUPLICATE_RIGHT_VALUE; - } - - /** - * Given a reference in our state source, {@code isDuplicateRightIndex(existingRightIndex) == true}, produce the - * location integer we can use to reference rightRowSetStorage. - * - * @param existingRightIndex an entry from our state source - * @return the location in rightRowSetStorage - */ - private long getRightIndexSlot(long existingRightIndex) { - return -existingRightIndex - 1 + DUPLICATE_RIGHT_VALUE; - } - - /** - * Given a location in rightRowSetStorage, produce a reference for use in the rightIndexSource - * - * @param rightIndexSlot a location in rightRowSetStorage - * @return a reference to rightRowSetStorage that can be recovered by calling getRightIndexSlot - */ - private long rightIndexSlotToStorage(long rightIndexSlot) { - return DUPLICATE_RIGHT_VALUE - rightIndexSlot - 1; - } - - private void addRightIndex(long tableLocation, long keyToAdd) { - final long existingRightIndex = rightIndexSource.getUnsafe(tableLocation); - if (existingRightIndex == NO_RIGHT_ENTRY_VALUE) { - rightIndexSource.set(tableLocation, keyToAdd); - } - else if (isDuplicateRightIndex(existingRightIndex)) { - final long rightIndexSlot = getRightIndexSlot(existingRightIndex); - final WritableRowSet rowSetToUpdate = rightRowSetStorage.getUnsafe(rightIndexSlot); - rowSetToUpdate.insert(keyToAdd); - } else { - final long rightIndexSlot = allocateRightIndexSlot(); - rightIndexSource.set(tableLocation, rightIndexSlotToStorage(rightIndexSlot)); - rightRowSetStorage.set(rightIndexSlot, RowSetFactory.fromKeys(existingRightIndex, keyToAdd)); - } - } - - private void removeRightIndex(long tableLocation, long keyToRemove) { - final long existingRightIndex = rightIndexSource.getUnsafe(tableLocation); - if (existingRightIndex == keyToRemove) { - rightIndexSource.set(tableLocation, NO_RIGHT_ENTRY_VALUE); - } else { - removeFromDuplicateIndex(rightIndexSource, tableLocation, keyToRemove, existingRightIndex); - } - } - - private void shiftRightIndex(long tableLocation, long shiftedKey, long shiftDelta) { - final long existingRightIndex = rightIndexSource.getUnsafe(tableLocation); - if (existingRightIndex == shiftedKey - shiftDelta) { - rightIndexSource.set(tableLocation, shiftedKey); - } else { - if (!isDuplicateRightIndex(existingRightIndex)) { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + ", shiftedKey" + shiftedKey + ", shiftDelta=" + shiftDelta + ", key=" + keyString(tableLocation)); - } - - shiftDuplicateRightIndex(shiftedKey, shiftDelta, existingRightIndex); - } - } - - private void shiftLeftIndex(long tableLocation, long shiftedKey, long shiftDelta) { - final WritableRowSet existingLeftRowSet = leftRowSetSource.get(tableLocation); - final long sizeBefore = existingLeftRowSet.size(); - existingLeftRowSet.remove(shiftedKey - shiftDelta); - existingLeftRowSet.insert(shiftedKey); - Assert.eq(existingLeftRowSet.size(), "existingLeftRowSet.size()", sizeBefore, "sizeBefore"); - } - - private void shiftLeftIndexOverflow(long overflowLocation, long shiftedKey, long shiftDelta) { - final WritableRowSet existingLeftRowSet = overflowLeftRowSetource.get(overflowLocation); - final long sizeBefore = existingLeftRowSet.size(); - existingLeftRowSet.remove(shiftedKey - shiftDelta); - existingLeftRowSet.insert(shiftedKey); - Assert.eq(existingLeftRowSet.size(), "existingLeftRowSet.size()", sizeBefore, "sizeBefore"); - } - - private void removeRightIndexOverflow(long overflowLocation, long keyToRemove) { - final long existingRightIndex = overflowRightIndexSource.getUnsafe(overflowLocation); - if (existingRightIndex == keyToRemove) { - overflowRightIndexSource.set(overflowLocation, NO_RIGHT_ENTRY_VALUE); - } else { - removeFromDuplicateIndex(overflowRightIndexSource, overflowLocation, keyToRemove, existingRightIndex); - } - } - - private void shiftRightIndexOverflow(long overflowLocation, long shiftedKey, long shiftDelta) { - final long existingRightIndex = overflowRightIndexSource.getUnsafe(overflowLocation); - if (existingRightIndex == shiftedKey - shiftDelta) { - overflowRightIndexSource.set(overflowLocation, shiftedKey); - } else { - shiftDuplicateRightIndex(shiftedKey, shiftDelta, existingRightIndex); - } - } - - private void shiftDuplicateRightIndex(long shiftedKey, long shiftDelta, long existingRightIndex) { - if (!isDuplicateRightIndex(existingRightIndex)) { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + ", shiftedKey" + shiftedKey + ", shiftDelta=" + shiftDelta); - } - - final long rightIndexSlot = getRightIndexSlot(existingRightIndex); - final WritableRowSet rowSetToUpdate = rightRowSetStorage.get(rightIndexSlot); - rowSetToUpdate.remove(shiftedKey - shiftDelta); - rowSetToUpdate.insert(shiftedKey); - } - - private void removeFromDuplicateIndex(LongArraySource rowSetSource, long location, long keyToRemove, long existingRightIndex) { - if (!isDuplicateRightIndex(existingRightIndex)) { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + ", keyToRemove=" + keyToRemove); - } - - final long rightIndexSlot = getRightIndexSlot(existingRightIndex); - final WritableRowSet rowSetToUpdate = rightRowSetStorage.get(rightIndexSlot); - rowSetToUpdate.remove(keyToRemove); - if (rowSetToUpdate.isEmpty()) { - throw Assert.statementNeverExecuted(); - } else if (rowSetToUpdate.size() == 1) { - rowSetSource.set(location, rowSetToUpdate.firstRowKey()); - rightRowSetStorage.set(rightIndexSlot, null); - freeRightRowSetLocations.insert(rightIndexSlot); - } - } - - private void addLeftIndexOverflow(long overflowLocation, long keyToAdd) { - final WritableRowSet rowSet = overflowLeftRowSetource.get(overflowLocation); - if (rowSet == null) { - overflowLeftRowSetource.set(overflowLocation, RowSetFactory.fromKeys(keyToAdd)); - } else { - rowSet.insert(keyToAdd); - } - } - - private void addRightIndexOverflow(long overflowLocation, long keyToAdd) { - final long existingRightIndex = overflowRightIndexSource.getUnsafe(overflowLocation); - if (existingRightIndex == NO_RIGHT_ENTRY_VALUE) { - overflowRightIndexSource.set(overflowLocation, keyToAdd); - } - else if (isDuplicateRightIndex(existingRightIndex)) { - final long rightIndexSlot = getRightIndexSlot(existingRightIndex); - final WritableRowSet rowSetToUpdate = rightRowSetStorage.get(rightIndexSlot); - rowSetToUpdate.insert(keyToAdd); - } else { - final long rightIndexSlot = allocateRightIndexSlot(); - overflowRightIndexSource.set(overflowLocation, rightIndexSlotToStorage(rightIndexSlot)); - rightRowSetStorage.set(rightIndexSlot, RowSetFactory.fromKeys(existingRightIndex, keyToAdd)); - } - } - - private void addModifiedMain(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long tableLocation, byte flag) { - if (modifiedSlotTracker != null) { - final long originalIndex = rightIndexSource.getUnsafe(tableLocation); - modifiedTrackerCookieSource.set(tableLocation, modifiedSlotTracker.addMain(modifiedTrackerCookieSource.getUnsafe(tableLocation), tableLocation, originalIndex, flag)); - } - } - - private void addModifiedOverflow(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long overflowLocation, byte flag) { - if (modifiedSlotTracker != null) { - final long originalIndex = overflowRightIndexSource.getUnsafe(overflowLocation); - overflowModifiedTrackerCookieSource.set(overflowLocation, modifiedSlotTracker.addOverflow(overflowModifiedTrackerCookieSource.getUnsafe(overflowLocation), overflowLocation, originalIndex, flag)); - } - } - - private void moveModifiedSlot(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long oldHashLocation, long newHashLocation) { - if (modifiedSlotTracker != null) { - final long cookie = modifiedTrackerCookieSource.getUnsafe(oldHashLocation); - modifiedTrackerCookieSource.set(oldHashLocation, QueryConstants.NULL_LONG); - modifiedSlotTracker.moveTableLocation(cookie, oldHashLocation, newHashLocation); - modifiedTrackerCookieSource.set(newHashLocation, cookie); - } - } - - private void promoteModified(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long overflowLocation, long tableLocation) { - if (modifiedSlotTracker != null) { - final long cookie = overflowModifiedTrackerCookieSource.getUnsafe(overflowLocation); - overflowModifiedTrackerCookieSource.set(overflowLocation, QueryConstants.NULL_LONG); - modifiedSlotTracker.promoteFromOverflow(cookie, overflowLocation, tableLocation); - modifiedTrackerCookieSource.set(tableLocation, cookie); - } - } - - public void compactAll() { - for (int ii = 0; ii < tableSize; ++ii) { - final WritableRowSet rowSet = leftRowSetSource.get(ii); - if (rowSet != null) { - rowSet.compact(); - } - } - for (int ii = 0; ii < nextOverflowLocation; ++ii) { - final WritableRowSet rowSet = overflowLeftRowSetource.get(ii); - if (rowSet != null) { - rowSet.compact(); - } - } - } - - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from WritableLongChunk - final WritableLongChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from WritableLongChunk, @WritableStateChunkName@ from WritableLongChunk - final ResettableWritableLongChunk writeThroughState = ResettableWritableLongChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - final WritableLongChunk sourceIndexKeys; - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - sourceIndexKeys = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = rightIndexSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from WritableLongChunk - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowRightIndexSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - sourceIndexKeys.close(); - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final LongArraySource leftRedirections - , final NaturalJoinModifiedSlotTracker modifiedSlotTracker - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - final boolean isLeftSide = leftRedirections != null; - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // the chunk of source indices that are parallel to the sourceChunks - final WritableLongChunk workingLeftRedirections = isLeftSide ? WritableLongChunk.makeWritableChunk(bc.chunkSize) : null - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - chunkOk.fillRowKeyChunk(bc.sourceIndexKeys); - if (isLeftSide) { - workingLeftRedirections.setSize(bc.sourceIndexKeys.size()); - } else { - // we may or may not overflow, but we would like to ensure that we can overflow if necessary - ensureRightIndexCapacity(); - } - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - rightIndexSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from LongChunk - LongChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final long keyToAdd = bc.sourceIndexKeys.get(ii); - if (isLeftSide) { - workingLeftRedirections.set(ii, getResultRightIndex(tableLocation)); - addLeftIndex(tableLocation, keyToAdd); - } else { - addModifiedMain(modifiedSlotTracker, tableLocation, NaturalJoinModifiedSlotTracker.FLAG_RIGHT_CHANGE); - addRightIndex(tableLocation, keyToAdd); - } - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - final long keyToAdd = bc.sourceIndexKeys.get(firstChunkPositionForHashLocation); - if (isLeftSide) { - rightIndexSource.set(currentHashLocation, NO_RIGHT_ENTRY_VALUE); - addLeftIndex(currentHashLocation, keyToAdd); - workingLeftRedirections.set(firstChunkPositionForHashLocation, NO_RIGHT_ENTRY_VALUE); - } else { - rightIndexSource.set(currentHashLocation, keyToAdd); - // there was no left hand side, so we should not worry about modifying it - } - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - // we match the first element, so should use it - workingLeftRedirections.set(chunkPosition, NO_RIGHT_ENTRY_VALUE); - addLeftIndex(tableLocation, keyToAdd); - } else { - // we match the first element, so need to mark this key as a duplicate - addRightIndex(tableLocation, keyToAdd); - // we should already have added it to the modifiedMain builder above - } - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - // if we are equal, then it's great and we know what our left-hand side is - final long hashSlot = overflowLocationToHashLocation(overflowLocation); - workingLeftRedirections.set(chunkPosition, getResultRightIndex(hashSlot)); - addLeftIndexOverflow(overflowLocation, keyToAdd); - } else { - addModifiedOverflow(modifiedSlotTracker, overflowLocation, NaturalJoinModifiedSlotTracker.FLAG_RIGHT_CHANGE); - addRightIndexOverflow(overflowLocation, keyToAdd); - } - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final long rightValue; - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - workingLeftRedirections.set(chunkPosition, NO_RIGHT_ENTRY_VALUE); - // we set the right RowSet to indicate it is empty, but exists - rightValue = NO_RIGHT_ENTRY_VALUE; - addLeftIndexOverflow(allocatedOverflowLocation, keyToAdd); - } else { - rightValue = keyToAdd; - // we are inserting the value, so there is no left hand side to care about - } - overflowRightIndexSource.set(allocatedOverflowLocation, rightValue); - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - // we match the first element, so should use the overflow slow we allocated for it - if (isLeftSide) { - workingLeftRedirections.set(chunkPosition, NO_RIGHT_ENTRY_VALUE); - addLeftIndexOverflow(insertedOverflowLocation, keyToAdd); - } else { - addRightIndexOverflow(insertedOverflowLocation, keyToAdd); - // we are inserting the value, so there is no left hand side to care about - } - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc, modifiedSlotTracker); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - if (isLeftSide) { - for (int ii = 0; ii < workingLeftRedirections.size(); ++ii) { - leftRedirections.set(hashSlotOffset + ii, workingLeftRedirections.get(ii)); - } - } - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - , NaturalJoinModifiedSlotTracker modifiedSlotTracker - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - rightIndexSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from LongChunk - LongChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from long - final long stateValueToMove = rightIndexSource.getUnsafe(oldHashLocation); - rightIndexSource.set(newHashLocation, stateValueToMove); - rightIndexSource.set(oldHashLocation, EMPTY_RIGHT_VALUE); - // region rehash move values - final WritableRowSet oldLeftRowSetValue = leftRowSetSource.get(oldHashLocation); - leftRowSetSource.set(newHashLocation, oldLeftRowSetValue); - leftRowSetSource.set(oldHashLocation, null); - moveModifiedSlot(modifiedSlotTracker, oldHashLocation, newHashLocation); - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowRightIndexSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from Long - LongPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - final long overflowLocation = bc.overflowLocationsAsKeyIndices.get(ii); - leftRowSetSource.set(tableLocation, overflowLeftRowSetource.get(overflowLocation)); - overflowLeftRowSetource.set(overflowLocation, null); - promoteModified(modifiedSlotTracker, overflowLocation, tableLocation); - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from Long - LongPermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from LongChunk - final WritableLongChunk stateChunk = WritableLongChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = rightIndexSource.makeFillContext(maxSize)) { - - rightIndexSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from LongChunk - LongChunkEquals.notEqual(stateChunk, EMPTY_RIGHT_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from WritableLongChunk - private void updateWriteThroughState(ResettableWritableLongChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = rightIndexSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - overflowLeftRowSetource.set(locationsToNull.get(ii), null); - } - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - // mixin prev - private void getPrevKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getPrevChunk(contexts[ii], rowSequence); - } - } - // endmixin prev - - // region probe wrappers - public void removeLeft(final Context pc, RowSequence leftIndex, ColumnSource [] leftSources) { - if (leftIndex.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, leftIndex, leftSources, true, false, true, false, false, false, 0, null); - } - - public void removeRight(final Context pc, RowSequence rightIndex, ColumnSource[] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (rightIndex.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, rightIndex, rightSources, true, false, false, true, false, false, 0, modifiedSlotTracker); - } - - - public void modifyByRight(final Context pc, RowSet modified, ColumnSource[] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (modified.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, modified, rightSources, false, true, false, false, false, false, 0, modifiedSlotTracker); - } - - public void applyLeftShift(Context pc, ColumnSource[] leftSources, RowSet shiftedRowSet, long shiftDelta) { - if (shiftedRowSet.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, shiftedRowSet, leftSources, false, false, false, false, true, false, shiftDelta, null); - } - - public void applyRightShift(Context pc, ColumnSource [] rightSources, RowSet shiftedRowSet, long shiftDelta, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (shiftedRowSet.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, shiftedRowSet, rightSources, false, false, false, false, false, true, shiftDelta, modifiedSlotTracker); - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from WritableLongChunk - final WritableLongChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - - // the chunk of indices created from our RowSequence, used to write into the hash table - final WritableLongChunk keyIndices; - - final LongArraySource pendingShifts = new LongArraySource(); - - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - keyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion probe context constructor - stateSourceFillContext = rightIndexSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from WritableLongChunk - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - keyIndices.close(); - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // mixin prev - , boolean usePrev - // endmixin prev - // region additional probe arguments - , final boolean probeOnly - , final boolean removeLeft - , final boolean removeRight - , final boolean shiftLeft - , final boolean shiftRight - , final long shiftDelta - , final NaturalJoinModifiedSlotTracker modifiedSlotTracker - // endregion additional probe arguments - ) { - // region probe start - int pendingShiftPointer = 0; - if (shiftDelta > 0) { - pc.pendingShifts.ensureCapacity(probeIndex.size() * 2); - } - Assert.assertion(probeOnly ^ shiftLeft ^ shiftRight ^ removeLeft ^ removeRight, "probeOnly ^ shiftLeft ^ shiftRight ^ removeLeft ^ removeRight"); - if (shiftLeft || shiftRight) { - Assert.neqZero(shiftDelta, "shiftDelta"); - } - final byte flag; - if (probeOnly) { - flag = NaturalJoinModifiedSlotTracker.FLAG_RIGHT_MODIFY_PROBE; - } else if (shiftRight) { - flag = NaturalJoinModifiedSlotTracker.FLAG_RIGHT_SHIFT; - } else if (removeRight) { - flag = NaturalJoinModifiedSlotTracker.FLAG_RIGHT_CHANGE; - } else if (shiftLeft || removeLeft) { - Assert.eqNull(modifiedSlotTracker, "modifiedSlotTracker"); - flag = 0; - } else { - throw Assert.statementNeverExecuted(); - } - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - chunkOk.fillRowKeyChunk(pc.keyIndices); - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - // mixin prev - if (usePrev) { - getPrevKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - } else { - // endmixin prev - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - // mixin prev - } - // endmixin prev - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - rightIndexSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from LongChunk - LongChunkEquals.notEqual(pc.workingStateEntries, EMPTY_RIGHT_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final long tableLocation = pc.tableLocationsChunk.get(ii); - addModifiedMain(modifiedSlotTracker, tableLocation, flag); - - if (probeOnly) { - continue; - } - - final long indexKey = pc.keyIndices.get(ii); - if (removeLeft) { - leftRowSetSource.get(tableLocation).remove(indexKey); - } else if (removeRight) { - removeRightIndex(tableLocation, indexKey); - } else if (shiftLeft) { - if (shiftDelta < 0) { - shiftLeftIndex(tableLocation, indexKey, shiftDelta); - } else { - pc.pendingShifts.set(pendingShiftPointer++, tableLocation); - pc.pendingShifts.set(pendingShiftPointer++, indexKey); - } - } else if (shiftRight) { - if (shiftDelta < 0) { - shiftRightIndex(tableLocation, indexKey, shiftDelta); - } else { - pc.pendingShifts.set(pendingShiftPointer++, tableLocation); - pc.pendingShifts.set(pendingShiftPointer++, indexKey); - } - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_RIGHT_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - addModifiedOverflow(modifiedSlotTracker, overflowLocation, flag); - - if (probeOnly) { - continue; - } - - final long indexKey = pc.keyIndices.get(chunkPosition); - - if (removeLeft) { - overflowLeftRowSetource.get(overflowLocation).remove(indexKey); - } else if (removeRight) { - removeRightIndexOverflow(overflowLocation, indexKey); - } else if (shiftLeft) { - if (shiftDelta < 0) { - shiftLeftIndexOverflow(overflowLocation, indexKey, shiftDelta); - } else { - pc.pendingShifts.set(pendingShiftPointer++, overflowLocationToHashLocation(overflowLocation)); - pc.pendingShifts.set(pendingShiftPointer++, indexKey); - } - } else if (shiftRight) { - if (shiftDelta < 0) { - shiftRightIndexOverflow(overflowLocation, indexKey, shiftDelta); - } else { - pc.pendingShifts.set(pendingShiftPointer++, overflowLocationToHashLocation(overflowLocation)); - pc.pendingShifts.set(pendingShiftPointer++, indexKey); - } - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - if (pendingShiftPointer > 0) { - if (shiftLeft) { - for (int ii = pendingShiftPointer - 2; ii >= 0; ii -= 2) { - final long slot = pc.pendingShifts.getUnsafe(ii); - final long indexKey = pc.pendingShifts.getUnsafe(ii + 1); - if (isOverflowLocation(slot)) { - shiftLeftIndexOverflow(hashLocationToOverflowLocation(slot), indexKey, shiftDelta); - } else { - shiftLeftIndex(slot, indexKey, shiftDelta); - } - } - } else { - for (int ii = pendingShiftPointer - 2; ii >= 0; ii -= 2) { - final long slot = pc.pendingShifts.getUnsafe(ii); - final long indexKey = pc.pendingShifts.getUnsafe(ii + 1); - if (isOverflowLocation(slot)) { - shiftRightIndexOverflow(hashLocationToOverflowLocation(slot), indexKey, shiftDelta); - } else { - shiftRightIndex(slot, indexKey, shiftDelta); - } - } - } - } - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - public WritableRowRedirection buildRowRedirectionFromRedirections(QueryTable leftTable, boolean exactMatch, InitialBuildContext ibc, JoinControl.RedirectionType redirectionType) { - final LongArraySource leftRedirections = ((RedirectionsInitialBuildContext)ibc).leftRedirections; - return buildRowRedirection(leftTable, exactMatch, leftRedirections::getUnsafe, redirectionType); - } - - static long overflowToSlot(long overflow) { - return overflowLocationToHashLocation(overflow); - } - - @Override - public RowSet getLeftIndex(long slot) { - if (isOverflowLocation(slot)) { - return overflowLeftRowSetource.get(hashLocationToOverflowLocation(slot)); - } else { - return leftRowSetSource.get(slot); - } - } - - private long getResultRightIndex(long hashSlot) { - final long rightIndex = getRightIndex(hashSlot); - if (rightIndex == DUPLICATE_RIGHT_VALUE) { - throw new IllegalStateException("Natural Join found duplicate right key for " + keyString(hashSlot)); - } - return rightIndex; - } - - @Override - public long getRightIndex(long slot) { - final long rightIndex; - if (isOverflowLocation(slot)) { - rightIndex = overflowRightIndexSource.getUnsafe(hashLocationToOverflowLocation(slot)); - } else { - rightIndex = rightIndexSource.getUnsafe(slot); - } - - if (isDuplicateRightIndex(rightIndex)) { - return DUPLICATE_RIGHT_VALUE; - } - - return rightIndex; - } - - @Override - public String keyString(long slot) { - final WritableChunk[] keyChunk = getWritableKeyChunks(1); - try (final WritableLongChunk slotChunk = WritableLongChunk.makeWritableChunk(1)) { - if (isOverflowLocation(slot)) { - slotChunk.set(0, hashLocationToOverflowLocation(slot)); - final ColumnSource.FillContext[] contexts = makeFillContexts(overflowKeySources, null, 1); - try { - fillOverflowKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } else { - slotChunk.set(0, slot); - final ColumnSource.FillContext[] contexts = makeFillContexts(keySources, null, 1); - try { - fillKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } - return ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, keyChunk, 0); - } finally { - for (WritableChunk chunk : keyChunk) { - chunk.close(); - } - } - } - - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - private long getStateValue(LongArraySource hashSlots, long locationInHashSlots) { - final long hashSlot = hashSlots.getUnsafe(locationInHashSlots); - if (isOverflowLocation(hashSlot)) { - return overflowRightIndexSource.getUnsafe(hashLocationToOverflowLocation(hashSlot)); - } - else { - return rightIndexSource.getUnsafe(hashSlot); - } - } - // endregion getStateValue - - // region overflowLocationToHashLocation - static boolean isOverflowLocation(long hashSlot) { - return hashSlot < OVERFLOW_PIVOT_VALUE; - } - - static long hashLocationToOverflowLocation(long hashSlot) { - return -hashSlot - 1 + OVERFLOW_PIVOT_VALUE; - } - - private static long overflowLocationToHashLocation(long overflowSlot) { - return OVERFLOW_PIVOT_VALUE - (1 + overflowSlot); - } - // endregion overflowLocationToHashLocation - - // mixin dumpTable - @SuppressWarnings("unused") - private void dumpTable() { - dumpTable(true, true); - } - - @SuppressWarnings("SameParameterValue") - private void dumpTable(boolean showBadMain, boolean showBadOverflow) { - //noinspection unchecked - final WritableChunk [] dumpChunks = new WritableChunk[keyColumnCount]; - //noinspection unchecked - final WritableChunk [] overflowDumpChunks = new WritableChunk[keyColumnCount]; - // @WritableStateChunkType@ from WritableLongChunk, @WritableStateChunkName@ from WritableLongChunk - final WritableLongChunk stateChunk = WritableLongChunk.makeWritableChunk(tableSize); - final WritableIntChunk overflowLocationChunk = WritableIntChunk.makeWritableChunk(tableSize); - // @WritableStateChunkType@ from WritableLongChunk, @WritableStateChunkName@ from WritableLongChunk - final WritableLongChunk overflowStateChunk = WritableLongChunk.makeWritableChunk(nextOverflowLocation); - final WritableIntChunk overflowOverflowLocationChunk = WritableIntChunk.makeWritableChunk(nextOverflowLocation); - - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(tableSize); - final WritableIntChunk overflowHashChunk = WritableIntChunk.makeWritableChunk(nextOverflowLocation); - - - final RowSequence tableLocations = RowSetFactory.fromRange(0, tableSize - 1); - final RowSequence overflowLocations = nextOverflowLocation > 0 ? RowSetFactory.fromRange(0, nextOverflowLocation - 1) : RowSequenceFactory.EMPTY; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - dumpChunks[ii] = keyChunkTypes[ii].makeWritableChunk(tableSize); - overflowDumpChunks[ii] = keyChunkTypes[ii].makeWritableChunk(nextOverflowLocation); - - try (final ColumnSource.FillContext fillContext = keySources[ii].makeFillContext(tableSize)) { - keySources[ii].fillChunk(fillContext, dumpChunks[ii], tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowKeySources[ii].makeFillContext(nextOverflowLocation)) { - overflowKeySources[ii].fillChunk(fillContext, overflowDumpChunks[ii], overflowLocations); - } - - if (ii == 0) { - chunkHashers[ii].hashInitial(dumpChunks[ii], hashChunk); - chunkHashers[ii].hashInitial(overflowDumpChunks[ii], overflowHashChunk); - } else { - chunkHashers[ii].hashUpdate(dumpChunks[ii], hashChunk); - chunkHashers[ii].hashUpdate(overflowDumpChunks[ii], overflowHashChunk); - } - } - - try (final ColumnSource.FillContext fillContext = rightIndexSource.makeFillContext(tableSize)) { - rightIndexSource.fillChunk(fillContext, stateChunk, tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowLocationSource.makeFillContext(tableSize)) { - overflowLocationSource.fillChunk(fillContext, overflowLocationChunk, tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowOverflowLocationSource.makeFillContext(nextOverflowLocation)) { - overflowOverflowLocationSource.fillChunk(fillContext, overflowOverflowLocationChunk, overflowLocations); - } - try (final ColumnSource.FillContext fillContext = overflowRightIndexSource.makeFillContext(nextOverflowLocation)) { - overflowRightIndexSource.fillChunk(fillContext, overflowStateChunk, overflowLocations); - } - - for (int ii = 0; ii < tableSize; ++ii) { - System.out.print("Bucket[" + ii + "] "); - // @StateValueType@ from long - final long stateValue = stateChunk.get(ii); - int overflowLocation = overflowLocationChunk.get(ii); - - if (stateValue == EMPTY_RIGHT_VALUE) { - System.out.println(""); - } else { - final int hashCode = hashChunk.get(ii); - System.out.println(ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, dumpChunks, ii) + " (hash=" + hashCode + ") = " + stateValue); - final int expectedPosition = hashToTableLocation(tableHashPivot, hashCode); - if (showBadMain && expectedPosition != ii) { - System.out.println("***** BAD HASH POSITION **** (computed " + expectedPosition + ")"); - } - } - - while (overflowLocation != QueryConstants.NULL_INT) { - // @StateValueType@ from long - final long overflowStateValue = overflowStateChunk.get(overflowLocation); - final int overflowHashCode = overflowHashChunk.get(overflowLocation); - System.out.println("\tOF[" + overflowLocation + "] " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, overflowDumpChunks, overflowLocation) + " (hash=" + overflowHashCode + ") = " + overflowStateValue); - final int expectedPosition = hashToTableLocation(tableHashPivot, overflowHashCode); - if (showBadOverflow && expectedPosition != ii) { - System.out.println("***** BAD HASH POSITION FOR OVERFLOW **** (computed " + expectedPosition + ")"); - } - overflowLocation = overflowOverflowLocationChunk.get(overflowLocation); - } - } - } - // endmixin dumpTable - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalNaturalJoinStateManager.java index bf3fdcb2a8e..6b4b77ec461 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalNaturalJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalNaturalJoinStateManager.java @@ -6,8 +6,8 @@ import io.deephaven.engine.rowset.RowSet; public interface IncrementalNaturalJoinStateManager { - long getRightIndex(long slot); - RowSet getLeftIndex(long slot); - String keyString(long slot); + long getRightIndex(int slot); + RowSet getLeftIndex(int slot); + String keyString(int slot); void checkExactMatch(boolean exactMatch, long leftKeyIndex, long rightSide); } \ No newline at end of file diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/JoinControl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/JoinControl.java index bc2af7dc8d8..1f75b0fa797 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/JoinControl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/JoinControl.java @@ -17,12 +17,20 @@ public enum RedirectionType { Contiguous, Sparse, Hash } + public static final int CHUNK_SIZE = 1 << 12; + private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; + public static final long MAX_TABLE_SIZE = 1L << 30; + private static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; + private static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; + int initialBuildSize() { - return IncrementalChunkedNaturalJoinStateManager.CHUNK_SIZE; + return MINIMUM_INITIAL_HASH_SIZE; } - int tableSize(long groupingSize) { - return StaticChunkedNaturalJoinStateManager.hashTableSize(groupingSize); + int tableSize(final long initialCapacity) { + return Math.toIntExact( + Math.max(MINIMUM_INITIAL_HASH_SIZE, + Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2))); } int tableSizeForRightBuild(Table rightTable) { @@ -34,11 +42,11 @@ int tableSizeForLeftBuild(Table leftTable) { } double getMaximumLoadFactor() { - return IncrementalChunkedNaturalJoinStateManager.DEFAULT_MAX_LOAD_FACTOR; + return DEFAULT_MAX_LOAD_FACTOR; } double getTargetLoadFactor() { - return IncrementalChunkedNaturalJoinStateManager.DEFAULT_TARGET_LOAD_FACTOR; + return DEFAULT_TARGET_LOAD_FACTOR; } static boolean useGrouping(Table leftTable, ColumnSource[] leftSources) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java index cef2ddc91c3..d8163017529 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinHelper.java @@ -5,7 +5,6 @@ import io.deephaven.base.Pair; import io.deephaven.base.verify.Assert; -import io.deephaven.configuration.Configuration; import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.table.*; @@ -25,10 +24,6 @@ import java.util.*; class NaturalJoinHelper { - static boolean USE_TYPED_STATE_MANAGER = - Configuration.getInstance().getBooleanWithDefault( - "NaturalJoinHelper.useTypedStateManager", - true); private NaturalJoinHelper() {} // static use only @@ -81,10 +76,7 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT bucketingContext.listenerDescription); } - final LongArraySource leftHashSlots = new LongArraySource(); - final WritableRowRedirection rowRedirection; - if (rightTable.isRefreshing()) { if (leftTable.isRefreshing()) { if (bucketingContext.useLeftGrouping) { @@ -98,15 +90,10 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT final int tableSize = control.tableSizeForRightBuild(rightTable); final BothIncrementalNaturalJoinStateManager jsm = - USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(IncrementalNaturalJoinStateManagerTypedBase.class, - bucketingContext.leftSources, bucketingContext.originalLeftSources, - tableSize, control.getMaximumLoadFactor(), - control.getTargetLoadFactor()) - : new IncrementalChunkedNaturalJoinStateManager( - bucketingContext.leftSources, tableSize, - bucketingContext.originalLeftSources, control.getMaximumLoadFactor(), - control.getTargetLoadFactor()); + TypedHasherFactory.make(IncrementalNaturalJoinStateManagerTypedBase.class, + bucketingContext.leftSources, bucketingContext.originalLeftSources, + tableSize, control.getMaximumLoadFactor(), + control.getTargetLoadFactor()); jsm.buildFromRightSide(rightTable, bucketingContext.rightSources); try (final BothIncrementalNaturalJoinStateManager.InitialBuildContext ibc = @@ -142,15 +129,11 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT return result; } else { // right is live, left is static - final RightIncrementalNaturalJoinStateManager jsm = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(RightIncrementalNaturalJoinStateManagerTypedBase.class, + final RightIncrementalNaturalJoinStateManager jsm = + TypedHasherFactory.make(RightIncrementalNaturalJoinStateManagerTypedBase.class, bucketingContext.leftSources, bucketingContext.originalLeftSources, control.tableSizeForLeftBuild(leftTable), - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new RightIncrementalChunkedNaturalJoinStateManager( - bucketingContext.leftSources, control.tableSizeForLeftBuild(leftTable), - bucketingContext.originalLeftSources); - + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); RightIncrementalNaturalJoinStateManager.InitialBuildContext initialBuildContext = jsm.makeInitialBuildContext(leftTable); @@ -222,14 +205,12 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT Collections.singletonMap(columnsToMatch[0].leftColumn(), groupSource)); final ColumnSource[] groupedSourceArray = {groupSource}; - final StaticHashedNaturalJoinStateManager jsm = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, groupedSourceArray, + final StaticHashedNaturalJoinStateManager jsm = + TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, groupedSourceArray, groupedSourceArray, - StaticChunkedNaturalJoinStateManager.hashTableSize(groupingSize.intValue()), - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new StaticChunkedNaturalJoinStateManager(groupedSourceArray, - StaticChunkedNaturalJoinStateManager.hashTableSize(groupingSize.intValue()), - groupedSourceArray); + control.tableSize(groupingSize.intValue()), + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); + final IntegerArraySource leftHashSlots = new IntegerArraySource(); jsm.buildFromLeftSide(leftTableGrouped, groupedSourceArray, leftHashSlots); try { jsm.decorateWithRightSide(rightTable, bucketingContext.rightSources); @@ -239,13 +220,12 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT rowRedirection = jsm.buildGroupedRowRedirection(leftTable, exactMatch, leftTableGrouped.size(), leftHashSlots, rowSetSource, control.getRedirectionType(leftTable)); } else if (control.buildLeft(leftTable, rightTable)) { - final StaticHashedNaturalJoinStateManager jsm = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, + final StaticHashedNaturalJoinStateManager jsm = + TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, bucketingContext.leftSources, bucketingContext.originalLeftSources, control.tableSizeForLeftBuild(leftTable), - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new StaticChunkedNaturalJoinStateManager(bucketingContext.leftSources, - control.tableSizeForLeftBuild(leftTable), bucketingContext.originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); + final IntegerArraySource leftHashSlots = new IntegerArraySource(); jsm.buildFromLeftSide(leftTable, bucketingContext.leftSources, leftHashSlots); try { jsm.decorateWithRightSide(rightTable, bucketingContext.rightSources); @@ -255,16 +235,15 @@ private static Table naturalJoinInternal(QueryTable leftTable, QueryTable rightT rowRedirection = jsm.buildRowRedirectionFromHashSlot(leftTable, exactMatch, leftHashSlots, control.getRedirectionType(leftTable)); } else { - final StaticHashedNaturalJoinStateManager jsm = USE_TYPED_STATE_MANAGER - ? TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, + final LongArraySource leftRedirections = new LongArraySource(); + final StaticHashedNaturalJoinStateManager jsm = + TypedHasherFactory.make(StaticNaturalJoinStateManagerTypedBase.class, bucketingContext.leftSources, bucketingContext.originalLeftSources, control.tableSizeForRightBuild(rightTable), - control.getMaximumLoadFactor(), control.getTargetLoadFactor()) - : new StaticChunkedNaturalJoinStateManager(bucketingContext.leftSources, - control.tableSizeForRightBuild(rightTable), bucketingContext.originalLeftSources); + control.getMaximumLoadFactor(), control.getTargetLoadFactor()); jsm.buildFromRightSide(rightTable, bucketingContext.rightSources); - jsm.decorateLeftSide(leftTable.getRowSet(), bucketingContext.leftSources, leftHashSlots); - rowRedirection = jsm.buildRowRedirectionFromRedirections(leftTable, exactMatch, leftHashSlots, + jsm.decorateLeftSide(leftTable.getRowSet(), bucketingContext.leftSources, leftRedirections); + rowRedirection = jsm.buildRowRedirectionFromRedirections(leftTable, exactMatch, leftRedirections, control.getRedirectionType(leftTable)); final QueryTable result = makeResult(leftTable, rightTable, columnsToAdd, rowRedirection, true); @@ -642,7 +621,7 @@ public void onUpdate(final TableUpdate upstream) { final boolean addedRightColumnsChanged; final int maxSize = - UpdateSizeCalculator.chunkSize(upstream, IncrementalChunkedNaturalJoinStateManager.CHUNK_SIZE); + UpdateSizeCalculator.chunkSize(upstream, JoinControl.CHUNK_SIZE); if (maxSize == 0) { Assert.assertion(upstream.empty(), "upstream.empty()"); return; @@ -739,7 +718,7 @@ private ModifiedSlotUpdater(IncrementalNaturalJoinStateManager jsm, RowSetBuilde } @Override - public void accept(long updatedSlot, long originalRightValue, byte flag) { + public void accept(int updatedSlot, long originalRightValue, byte flag) { final RowSet leftIndices = jsm.getLeftIndex(updatedSlot); if (leftIndices == null || leftIndices.isEmpty()) { return; @@ -852,7 +831,7 @@ protected void process() { final long probeSize = UpdateSizeCalculator.chunkSize(Math.max(rightRemoved.size(), rightModified.size()), - rightRecorder.getShifted(), IncrementalChunkedNaturalJoinStateManager.CHUNK_SIZE); + rightRecorder.getShifted(), JoinControl.CHUNK_SIZE); final long buildSize = Math.max(rightAdded.size(), rightKeysModified ? rightModified.size() : 0); // process right updates @@ -933,7 +912,7 @@ protected void process() { final long buildSize = Math.max(leftAdded.size(), leftKeyModifications ? leftModified.size() : 0); final long probeSize = UpdateSizeCalculator.chunkSize( Math.max(leftRemoved.size(), leftKeyModifications ? leftModified.size() : 0), leftShifted, - IncrementalChunkedNaturalJoinStateManager.CHUNK_SIZE); + JoinControl.CHUNK_SIZE); final LongArraySource leftRedirections = newLeftRedirections ? new LongArraySource() : null; if (leftRedirections != null) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinModifiedSlotTracker.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinModifiedSlotTracker.java index f0bb9101cc1..d90c0d06e89 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinModifiedSlotTracker.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/NaturalJoinModifiedSlotTracker.java @@ -88,7 +88,7 @@ private long getPointerFromCookie(long cookie) { * * @return the cookie for future access */ - public long addMain(final long cookie, final long slot, final long originalRightValue, byte flags) { + public long addMain(final long cookie, final int slot, final long originalRightValue, byte flags) { if (originalRightValue < 0) { flags |= FLAG_RIGHT_ADD; } @@ -100,34 +100,13 @@ public long addMain(final long cookie, final long slot, final long originalRight } - /** - * Add a slot in the overflow table. - * - * @param overflow the slot to add (0...n in the overflow table). - * @param originalRightValue if we are the addition of the slot, what the right value was before our modification - * (otherwise ignored) - * - * @return the cookie for future access - */ - long addOverflow(final long cookie, final long overflow, final long originalRightValue, byte flags) { - final long slot = IncrementalChunkedNaturalJoinStateManager.overflowToSlot(overflow); - if (originalRightValue < 0) { - flags |= FLAG_RIGHT_ADD; - } - if (!isValidCookie(cookie)) { - return doAddition(slot, originalRightValue, flags); - } else { - return updateFlags(cookie, flags); - } - } - - private long doAddition(final long slot, final long originalRightValue, byte flags) { + private long doAddition(final int slot, final long originalRightValue, byte flags) { if (pointer == allocated) { allocated += CHUNK_SIZE; modifiedSlots.ensureCapacity(allocated); originalRightValues.ensureCapacity(allocated); } - modifiedSlots.set(pointer, (slot << FLAG_SHIFT) | flags); + modifiedSlots.set(pointer, ((long) slot << FLAG_SHIFT) | flags); originalRightValues.set(pointer, originalRightValue); return getCookieFromPointer(pointer++); } @@ -142,15 +121,12 @@ private long updateFlags(final long cookie, byte flags) { /** * For each main and overflow value, call slotConsumer. * - * Main values are represented as values >= 0. Overflow values are represented as negative values according to - * {@link IncrementalChunkedNaturalJoinStateManager#overflowToSlot(long)}. - * * @param slotConsumer the consumer of our values */ void forAllModifiedSlots(ModifiedSlotConsumer slotConsumer) { for (int ii = 0; ii < pointer; ++ii) { final long slotAndFlag = modifiedSlots.getLong(ii); - final long slot = slotAndFlag >> FLAG_SHIFT; + final int slot = (int) (slotAndFlag >> FLAG_SHIFT); final byte flag = (byte) (slotAndFlag & FLAG_MASK); slotConsumer.accept(slot, originalRightValues.getLong(ii), flag); } @@ -162,13 +138,13 @@ void forAllModifiedSlots(ModifiedSlotConsumer slotConsumer) { * @param oldTableLocation the old hash slot * @param newTableLocation the new hash slot */ - public void moveTableLocation(long cookie, @SuppressWarnings("unused") long oldTableLocation, - long newTableLocation) { + public void moveTableLocation(long cookie, @SuppressWarnings("unused") int oldTableLocation, + int newTableLocation) { if (isValidCookie(cookie)) { final long pointer = getPointerFromCookie(cookie); final long existingSlotAndFlag = modifiedSlots.getLong(pointer); final byte flag = (byte) (existingSlotAndFlag & FLAG_MASK); - final long newSlotAndFlag = (newTableLocation << FLAG_SHIFT) | flag; + final long newSlotAndFlag = ((long) newTableLocation << FLAG_SHIFT) | flag; modifiedSlots.set(pointer, newSlotAndFlag); } } @@ -179,17 +155,17 @@ public void moveTableLocation(long cookie, @SuppressWarnings("unused") long oldT * @param overflowLocation the old overflow location * @param tableLocation the new table location */ - void promoteFromOverflow(long cookie, @SuppressWarnings("unused") long overflowLocation, long tableLocation) { + void promoteFromOverflow(long cookie, @SuppressWarnings("unused") int overflowLocation, int tableLocation) { if (isValidCookie(cookie)) { final long pointer = getPointerFromCookie(cookie); final long existingSlotAndFlag = modifiedSlots.getLong(pointer); final byte flag = (byte) (existingSlotAndFlag & FLAG_MASK); - final long newSlotAndFlag = (tableLocation << FLAG_SHIFT) | flag; + final long newSlotAndFlag = ((long) tableLocation << FLAG_SHIFT) | flag; modifiedSlots.set(pointer, newSlotAndFlag); } } interface ModifiedSlotConsumer { - void accept(long slot, long originalRightValue, byte flag); + void accept(int slot, long originalRightValue, byte flag); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalAsOfJoinStateManager.java index 2bf5016cbfd..49b1447b5e4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalAsOfJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalAsOfJoinStateManager.java @@ -3,22 +3,13 @@ */ package io.deephaven.engine.table.impl; -import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.table.impl.sources.LongSparseArraySource; -import io.deephaven.engine.table.impl.util.ContiguousWritableRowRedirection; -import io.deephaven.engine.table.impl.util.LongColumnSourceWritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirectionLockFree; import java.util.Arrays; import java.util.Objects; -import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public abstract class RightIncrementalAsOfJoinStateManager { - public static final long NO_RIGHT_ENTRY_VALUE = RowSequence.NULL_ROW_KEY; protected final ColumnSource[] keySourcesForErrorMessages; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedAsOfJoinStateManager.java deleted file mode 100644 index 06fedf57553..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedAsOfJoinStateManager.java +++ /dev/null @@ -1,2237 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QByteChunk\E -import io.deephaven.chunk.util.hashing.ByteChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QByte\E -import io.deephaven.engine.table.impl.sort.permute.BytePermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.engine.table.impl.ssa.SegmentedSortedArray; -import org.apache.commons.lang3.mutable.MutableInt; -import org.apache.commons.lang3.mutable.MutableObject; -import org.jetbrains.annotations.Nullable; -import io.deephaven.engine.table.impl.asofjoin.RightIncrementalHashedAsOfJoinStateManager; - -import java.util.function.Function; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -public -// endregion class visibility -class RightIncrementalChunkedAsOfJoinStateManager - // region extensions - extends RightIncrementalHashedAsOfJoinStateManager - // endregion extensions -{ - // region constants - private static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = 1L << 30; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_BYTE\E, @StateValueType@ from \Qbyte\E - private static final byte EMPTY_VALUE = QueryConstants.NULL_BYTE; - - // mixin getStateValue - // region overflow pivot - private static final long OVERFLOW_PIVOT_VALUE = -1; - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

    When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

    - * - *

    This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

    - */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QByteArraySource\E - private final ByteArraySource stateSource - // @StateColumnSourceConstructor@ from \QByteArraySource()\E - = new ByteArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QByteArraySource\E - private final ByteArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QByteArraySource()\E - = new ByteArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - /** - * We use our side source to originally build the RowSet using builders. When a state is activated (meaning we - * have a corresponding entry for it on the other side); we'll turn it into an SSA. If we have updates for an - * inactive state, then we turn it into a WritableRowSet. The entry state tells us what we have on each side, using - * a nibble for the left and a nibble for the right. - */ - private final ObjectArraySource leftSideSource; - private final ObjectArraySource overflowLeftSideSource; - private final ObjectArraySource rightSideSource; - private final ObjectArraySource overflowRightSideSource; - - /** - * Each slot in the hash table has a 'cookie', which we reset by incrementing the cookie generation. The cookie - * allows us to index into an array source that is passed in for each operation; serving as an intrusive set - * of modified states (we'll add relevant indices in the probe/build to a RowSet builder). - */ - private final LongArraySource cookieSource; - private final LongArraySource overflowCookieSource; - private long cookieGeneration; - private int nextCookie; - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - RightIncrementalChunkedAsOfJoinStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , ColumnSource[] tableKeySourcesForErrors - // endregion constructor arguments - ) { - // region super - super(tableKeySourcesForErrors); - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - leftSideSource = new ObjectArraySource<>(Object.class); - overflowLeftSideSource = new ObjectArraySource<>(Object.class); - rightSideSource = new ObjectArraySource<>(Object.class); - overflowRightSideSource = new ObjectArraySource<>(Object.class); - cookieSource = new LongArraySource(); - overflowCookieSource = new LongArraySource(); - - resetCookie(); - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - leftSideSource.ensureCapacity(tableSize); - rightSideSource.ensureCapacity(tableSize); - cookieSource.ensureCapacity(tableSize); - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - overflowLeftSideSource.ensureCapacity(newCapacity); - overflowRightSideSource.ensureCapacity(newCapacity); - overflowCookieSource.ensureCapacity(newCapacity); - // endregion ensureOverflowCapacity - } - - // region build wrappers - @Override - public int buildFromLeftSide(RowSequence leftIndex, ColumnSource[] leftSources, @NotNull final LongArraySource addedSlots) { - if (leftIndex.isEmpty()) { - return 0; - } - try (final BuildContext bc = makeBuildContext(leftSources, leftIndex.size())) { - final MutableInt slotCount = new MutableInt(0); - buildTable(bc, leftIndex, leftSources, true, addedSlots, slotCount, null); - return slotCount.intValue(); - } - } - - @Override - public int buildFromRightSide(RowSequence rightIndex, ColumnSource[] rightSources, @NotNull final LongArraySource addedSlots, int usedSlots) { - if (rightIndex.isEmpty()) { - return usedSlots; - } - try (final BuildContext bc = makeBuildContext(rightSources, rightIndex.size())) { - final MutableInt slotCount = new MutableInt(usedSlots); - buildTable(bc, rightIndex, rightSources, false, addedSlots, slotCount, null); - return slotCount.intValue(); - } - } - - public int buildAdditions(boolean isLeftSide, RowSet additions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders) { - final MutableInt slotCount = new MutableInt(0); - - resetCookie(); - - if (additions.isEmpty()) { - return 0; - } - - try (final BuildContext bc = makeBuildContext(sources, additions.size())) { - buildTable(bc, additions, sources, isLeftSide, slots, slotCount, sequentialBuilders); - return slotCount.intValue(); - } - } - - private static void createBuilder(ObjectArraySource source, long location, long keyToAdd) { - final RowSetBuilderSequential builder; - source.set(location, builder = RowSetFactory.builderSequential()); - builder.appendKey(keyToAdd); - } - - private static void addToBuilder(ObjectArraySource source, long location, long keyToAdd) { - source.getUnsafe(location).appendKey(keyToAdd); - } - - private void addLeftIndex(long tableLocation, long keyToAdd, byte currentState) { - final boolean isEmpty = (currentState & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_EMPTY; - if (isEmpty) { - final byte newState = (byte)((currentState & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_BUILDER); - stateSource.set(tableLocation, newState); - //noinspection unchecked - createBuilder((ObjectArraySource)leftSideSource, tableLocation, keyToAdd); - } else { - //noinspection unchecked - addToBuilder((ObjectArraySource)leftSideSource, tableLocation, keyToAdd); - } - } - - /** - * Returns true if this is the first left RowSet added to this slot. - */ - private void addLeftIndexOverflow(long overflowLocation, long keyToAdd, byte currentState) { - final boolean isEmpty = (currentState & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_EMPTY; - if (isEmpty) { - final byte newState = (byte)((currentState & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_BUILDER); - overflowStateSource.set(overflowLocation, newState); - //noinspection unchecked - createBuilder((ObjectArraySource)overflowLeftSideSource, overflowLocation, keyToAdd); - } else { - //noinspection unchecked - addToBuilder((ObjectArraySource)overflowLeftSideSource, overflowLocation, keyToAdd); - } - } - - private void addRightIndex(long tableLocation, long keyToAdd, byte currentState) { - final boolean isEmpty = (currentState & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_EMPTY; - if (isEmpty) { - final byte newState = (byte)((currentState & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_BUILDER); - stateSource.set(tableLocation, newState); - //noinspection unchecked - createBuilder((ObjectArraySource)rightSideSource, tableLocation, keyToAdd); - } else { - //noinspection unchecked - addToBuilder((ObjectArraySource)rightSideSource, tableLocation, keyToAdd); - } - } - - private void addRightIndexOverflow(long overflowLocation, long keyToAdd, byte currentState) { - final boolean isEmpty = (currentState & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_EMPTY; - if (isEmpty) { - final byte newState = (byte)((currentState & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_BUILDER); - overflowStateSource.set(overflowLocation, newState); - //noinspection unchecked - createBuilder((ObjectArraySource)overflowRightSideSource, overflowLocation, keyToAdd); - } else { - //noinspection unchecked - addToBuilder((ObjectArraySource)overflowRightSideSource, overflowLocation, keyToAdd); - } - } - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableByteChunk\E - final WritableByteChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableByteChunk\E, @WritableStateChunkName@ from \QWritableByteChunk\E - final ResettableWritableByteChunk writeThroughState = ResettableWritableByteChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - final WritableLongChunk sourceIndexKeys; - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - sourceIndexKeys = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableByteChunk\E - workingStateEntries = WritableByteChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - sourceIndexKeys.close(); - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , boolean isLeftSide - , @NotNull final LongArraySource addedSlots - , final MutableInt slotCount - , final ObjectArraySource sequentialBuilders - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - // TODO: make chunkOk.fillRowKeyChunk ignore the input size - bc.sourceIndexKeys.setSize(bc.chunkSize); - chunkOk.fillRowKeyChunk(bc.sourceIndexKeys); - - addedSlots.ensureCapacity(nextCookie + bc.chunkSize); - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(bc.workingStateEntries, EMPTY_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final long cookie = getCookieMain(tableLocation); - addedSlots.set(cookie, tableLocation); - - final byte currentState = stateSource.getUnsafe(tableLocation); - final long keyToAdd = bc.sourceIndexKeys.get(ii); - if (sequentialBuilders == null) { - if (isLeftSide) { - addLeftIndex(tableLocation, keyToAdd, currentState); - } else { - addRightIndex(tableLocation, keyToAdd, currentState); - } - } - else { - addToSequentialBuilder(cookie, sequentialBuilders, keyToAdd); - } - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - final long cookie = getCookieMain(currentHashLocation); - addedSlots.set(cookie, currentHashLocation); - - final long keyToAdd = bc.sourceIndexKeys.get(firstChunkPositionForHashLocation); - if (sequentialBuilders == null) { - if (isLeftSide) { - addLeftIndex(currentHashLocation, keyToAdd, (byte) 0); - } else { - addRightIndex(currentHashLocation, keyToAdd, (byte) 0); - } - } else { - // the state is actually empty, we'll create the SSA from the outside - stateSource.set(currentHashLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); - addToSequentialBuilder(cookie, sequentialBuilders, keyToAdd); - } - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (sequentialBuilders == null) { - if (isLeftSide) { - addLeftIndex(tableLocation, keyToAdd, ENTRY_INITIAL_STATE_LEFT); - } else { - addRightIndex(tableLocation, keyToAdd, ENTRY_INITIAL_STATE_RIGHT); - } - } else { - addToSequentialBuilder(cookieSource.getLong(tableLocation) - cookieGeneration, sequentialBuilders, keyToAdd); - } - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final long cookie = getCookieOverflow(overflowLocation); - addedSlots.set(cookie, overflowLocationToHashLocation(overflowLocation)); - - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - final byte currentState = overflowStateSource.getUnsafe(overflowLocation); - if (sequentialBuilders == null) { - if (isLeftSide) { - addLeftIndexOverflow(overflowLocation, keyToAdd, currentState); - } else { - addRightIndexOverflow(overflowLocation, keyToAdd, currentState); - } - } else { - addToSequentialBuilder(cookie, sequentialBuilders, keyToAdd); - } - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final long cookie = getCookieOverflow(allocatedOverflowLocation); - addedSlots.set(cookie, overflowLocationToHashLocation(allocatedOverflowLocation)); - - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - - // TODO: why are we not checking sequential builders here? - - if (isLeftSide) { - addLeftIndexOverflow(allocatedOverflowLocation, keyToAdd, (byte)0); - } else { - addRightIndexOverflow(allocatedOverflowLocation, keyToAdd, (byte)0); - } - - if (sequentialBuilders != null) { - addToSequentialBuilder(cookie, sequentialBuilders, keyToAdd); - } - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - - // TODO: why are we not checking sequential builders here? - - // we match the first element, so should use the overflow slow we allocated for it - if (isLeftSide) { - addLeftIndexOverflow(insertedOverflowLocation, keyToAdd, ENTRY_INITIAL_STATE_LEFT); - } else { - addRightIndexOverflow(insertedOverflowLocation, keyToAdd, ENTRY_INITIAL_STATE_RIGHT); - } - if (sequentialBuilders != null) { - addToSequentialBuilder(overflowCookieSource.getLong(insertedOverflowLocation) - cookieGeneration, sequentialBuilders, keyToAdd); - } - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc, addedSlots); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - slotCount.setValue(nextCookie); - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - , LongArraySource addedSlots - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(bc.workingStateEntries, EMPTY_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qbyte\E - final byte stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_VALUE); - // region rehash move values - leftSideSource.set(newHashLocation, leftSideSource.getUnsafe(oldHashLocation)); - rightSideSource.set(newHashLocation, rightSideSource.getUnsafe(oldHashLocation)); - leftSideSource.set(oldHashLocation, null); - rightSideSource.set(oldHashLocation, null); - final long cookie = cookieSource.getUnsafe(oldHashLocation); - cookieSource.set(newHashLocation, cookie); - cookieSource.set(oldHashLocation, QueryConstants.NULL_LONG); - if (cookie >= cookieGeneration) { - addedSlots.set(cookie - cookieGeneration, newHashLocation); - } - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QByte\E - BytePermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - - final long overflowLocation = bc.overflowLocationsAsKeyIndices.get(ii); - leftSideSource.set(tableLocation, overflowLeftSideSource.getUnsafe(overflowLocation)); - rightSideSource.set(tableLocation, overflowRightSideSource.getUnsafe(overflowLocation)); - final long cookie = overflowCookieSource.getUnsafe(overflowLocation); - overflowCookieSource.set(overflowLocation, QueryConstants.NULL_LONG); - cookieSource.set(tableLocation, cookie); - if (cookie >= cookieGeneration) { - addedSlots.set(cookie - cookieGeneration, tableLocation); - } - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QByte\E - BytePermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QByteChunk\E - final WritableByteChunk stateChunk = WritableByteChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(stateChunk, EMPTY_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableByteChunk\E - private void updateWriteThroughState(ResettableWritableByteChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = stateSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - overflowLeftSideSource.set(locationsToNull.get(ii), null); - overflowRightSideSource.set(locationsToNull.get(ii), null); - } - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - // mixin prev - private void getPrevKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getPrevChunk(contexts[ii], rowSequence); - } - } - // endmixin prev - - // region probe wrappers - - private void resetCookie() { - cookieGeneration += (10 + nextCookie); - nextCookie = 0; - } - - private long getCookieMain(long slot) { - return getCookie(cookieSource, slot); - } - - private long getCookieOverflow(long overflowLocation) { - return getCookie(overflowCookieSource, overflowLocation); - } - - private long getCookie(LongArraySource cookieSource, long slot) { - long cookie = cookieSource.getLong(slot); - if (cookie == QueryConstants.NULL_LONG || cookie < cookieGeneration) { - cookieSource.set(slot, cookie = cookieGeneration + nextCookie); - nextCookie++; - } - return cookie - cookieGeneration; - } - - @Override - public int markForRemoval(RowSet restampRemovals, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders) { - return accumulateIndices(restampRemovals, sources, slots, sequentialBuilders, true); - } - - @Override - public int probeAdditions(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders) { - return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, false); - } - - @Override - public int gatherShiftIndex(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders) { - return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, true); - } - - public int gatherModifications(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders) { - return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, false); - } - - private int accumulateIndices(RowSet restampAdditions, ColumnSource[] rightSources, LongArraySource slots, ObjectArraySource sequentialBuilders, boolean usePrev) { - final MutableInt slotCount = new MutableInt(0); - - resetCookie(); - - if (restampAdditions.isNonempty()) { - try (final ProbeContext pc = makeProbeContext(rightSources, restampAdditions.size())) { - decorationProbe(pc, restampAdditions, rightSources, usePrev, slotCount, slots, sequentialBuilders); - } - } - - return slotCount.intValue(); - } - - @Override - public void probeRightInitial(RowSequence rightIndex, ColumnSource[] rightSources) { - if (rightIndex.isEmpty()) { - return; - } - try (final ProbeContext pc = makeProbeContext(rightSources, rightIndex.size())) { - decorationProbe(pc, rightIndex, rightSources, false, null, null, null); - } - } - - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableByteChunk\E - final WritableByteChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - - // the chunk of indices created from our RowSequence, used to write into the hash table - final WritableLongChunk keyIndices; - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - keyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion probe context constructor - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableByteChunk\E - workingStateEntries = WritableByteChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - keyIndices.close(); - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // mixin prev - , boolean usePrev - // endmixin prev - // region additional probe arguments - , final MutableInt slotCount - , final LongArraySource slots - , final ObjectArraySource sequentialBuilders // if sequential builders is null, then we are assumed to be adding an initial right hand side (for the left static case) - // endregion additional probe arguments - ) { - // region probe start - if (slots != null) { - Assert.neqNull(slotCount, "slotCount"); - Assert.neqNull(sequentialBuilders, "sequentialBuilders"); - } else { - Assert.eqNull(slotCount, "slotCount"); - Assert.eqNull(sequentialBuilders, "sequentialBuilders"); - } - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - chunkOk.fillRowKeyChunk(pc.keyIndices); - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - // mixin prev - if (usePrev) { - getPrevKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - } else { - // endmixin prev - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - // mixin prev - } - // endmixin prev - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - stateSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(pc.workingStateEntries, EMPTY_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final long tableLocation = pc.tableLocationsChunk.get(ii); - final long indexKey = pc.keyIndices.get(ii); - if (sequentialBuilders != null) { - final long cookie = getCookieMain(tableLocation); - assert slots != null; - slots.set(cookie, tableLocation); - addToSequentialBuilder(cookie, sequentialBuilders, indexKey); - } else { - addRightIndex(tableLocation, indexKey, stateSource.getUnsafe(tableLocation)); - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - final long indexKey = pc.keyIndices.get(chunkPosition); - if (sequentialBuilders != null) { - final long cookie = getCookieOverflow(overflowLocation); - assert slots != null; - slots.set(cookie, overflowLocationToHashLocation(overflowLocation)); - addToSequentialBuilder(cookie, sequentialBuilders, indexKey); - } else { - addRightIndexOverflow(overflowLocation, indexKey, overflowStateSource.getUnsafe(overflowLocation)); - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - if (slotCount != null) { - slotCount.setValue(nextCookie); - } - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - public int getTableSize() { - return tableSize; - } - - public int getOverflowSize() { - return nextOverflowLocation; - } - - /** - * When we get the left RowSet out of our source (after a build or probe); we do it by pulling a sequential builder - * and then calling build(). We also null out the value in the column source, thus freeing the builder's - * memory. - * - * This also results in clearing out the left hand side of the table between each probe phase for the - * left refreshing case. - * - * @param slot the slot in the table (either positive for a main slot, or negative for overflow) - * @return the WritableRowSet for this slot - */ - @Override - public WritableRowSet getAndClearLeftIndex(long slot) { - final RowSetBuilderSequential builder; - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - builder = (RowSetBuilderSequential)overflowLeftSideSource.getUnsafe(overflowLocation); - overflowLeftSideSource.set(overflowLocation, null); - } else { - builder = (RowSetBuilderSequential)leftSideSource.getUnsafe(slot); - leftSideSource.set(slot, null); - } - if (builder == null) { - return null; - } - return builder.build(); - } - - @Override - public byte getState(long slot) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - return overflowStateSource.getUnsafe(overflowLocation); - } else { - return stateSource.getUnsafe(slot); - } - } - - @Override - public SegmentedSortedArray getRightSsa(long slot, Function ssaFactory) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - switch (entryType & ENTRY_RIGHT_MASK) { - case ENTRY_RIGHT_IS_EMPTY: - return makeSsaFromEmpty(overflowLocation, ssaFactory, overflowRightSideSource, overflowStateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_INDEX: - return makeSsaFromIndex(overflowLocation, ssaFactory, overflowRightSideSource, overflowStateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_BUILDER: - return makeSsaFromBuilder(overflowLocation, ssaFactory, overflowRightSideSource, overflowStateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_SSA: - return (SegmentedSortedArray)overflowRightSideSource.getUnsafe(overflowLocation); - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - switch (entryType & ENTRY_RIGHT_MASK) { - case ENTRY_RIGHT_IS_EMPTY: - return makeSsaFromEmpty(slot, ssaFactory, rightSideSource, stateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_INDEX: - return makeSsaFromIndex(slot, ssaFactory, rightSideSource, stateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_BUILDER: - return makeSsaFromBuilder(slot, ssaFactory, rightSideSource, stateSource, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_SSA)); - case ENTRY_RIGHT_IS_SSA: - return (SegmentedSortedArray)rightSideSource.getUnsafe(slot); - } - } - throw new IllegalStateException(); - } - - @Override - public SegmentedSortedArray getRightSsa(long slot) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_SSA) { - return (SegmentedSortedArray) overflowRightSideSource.getUnsafe(overflowLocation); - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_SSA) { - return (SegmentedSortedArray) rightSideSource.getUnsafe(slot); - } - } - throw new IllegalStateException(); - } - - public WritableRowSet getRightIndex(long slot) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_INDEX) { - return (WritableRowSet) overflowRightSideSource.getUnsafe(overflowLocation); - } - else if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_BUILDER) { - final WritableRowSet rowSet = ((RowSetBuilderSequential)overflowRightSideSource.getUnsafe(overflowLocation)).build(); - overflowRightSideSource.set(overflowLocation, rowSet); - overflowStateSource.set(overflowLocation, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX)); - return rowSet; - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_INDEX) { - return (WritableRowSet) rightSideSource.getUnsafe(slot); - } - else if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_BUILDER) { - final WritableRowSet rowSet = ((RowSetBuilderSequential)rightSideSource.getUnsafe(slot)).build(); - rightSideSource.set(slot, rowSet); - stateSource.set(slot, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX)); - return rowSet; - } - } - throw new IllegalStateException(); - } - - public WritableRowSet getLeftIndex(long slot) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_INDEX) { - return (WritableRowSet) overflowLeftSideSource.getUnsafe(overflowLocation); - } - else if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_BUILDER) { - final WritableRowSet rowSet = ((RowSetBuilderSequential)overflowLeftSideSource.getUnsafe(overflowLocation)).build(); - overflowLeftSideSource.set(overflowLocation, rowSet); - overflowStateSource.set(overflowLocation, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_INDEX)); - return rowSet; - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_INDEX) { - return (WritableRowSet) leftSideSource.getUnsafe(slot); - } - else if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_BUILDER) { - final WritableRowSet rowSet = ((RowSetBuilderSequential)leftSideSource.getUnsafe(slot)).build(); - leftSideSource.set(slot, rowSet); - stateSource.set(slot, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_INDEX)); - return rowSet; - } - } - throw new IllegalStateException(); - } - - @Override - public void setLeftIndex(long slot, RowSet rowSet) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_EMPTY) { - overflowStateSource.set(overflowLocation, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_INDEX)); - overflowLeftSideSource.set(overflowLocation, rowSet); - return; - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_EMPTY) { - stateSource.set(slot, (byte)((entryType & ENTRY_RIGHT_MASK ) | ENTRY_LEFT_IS_INDEX)); - leftSideSource.set(slot, rowSet); - return; - } - } - throw new IllegalStateException(); - } - - @Override - public void setRightIndex(long slot, RowSet rowSet) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_EMPTY) { - overflowStateSource.set(overflowLocation, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX)); - overflowRightSideSource.set(overflowLocation, rowSet); - return; - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_EMPTY) { - stateSource.set(slot, (byte)((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX)); - rightSideSource.set(slot, rowSet); - return; - } - } - throw new IllegalStateException(); - } - - @Override - public SegmentedSortedArray getLeftSsa(long slot) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_SSA) { - return (SegmentedSortedArray) overflowLeftSideSource.getUnsafe(overflowLocation); - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_SSA) { - return (SegmentedSortedArray) leftSideSource.getUnsafe(slot); - } - } - throw new IllegalStateException(); - } - - @Override - public SegmentedSortedArray getLeftSsa(long slot, Function ssaFactory) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - switch (entryType & ENTRY_LEFT_MASK) { - case ENTRY_LEFT_IS_EMPTY: - return makeSsaFromEmpty(overflowLocation, ssaFactory, overflowLeftSideSource, overflowStateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_BUILDER: - return makeSsaFromBuilder(overflowLocation, ssaFactory, overflowLeftSideSource, overflowStateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_INDEX: - return makeSsaFromIndex(overflowLocation, ssaFactory, overflowLeftSideSource, overflowStateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_SSA: - return (SegmentedSortedArray)overflowLeftSideSource.getUnsafe(overflowLocation); - } - } else { - final byte entryType = stateSource.getUnsafe(slot); - switch (entryType & ENTRY_LEFT_MASK) { - case ENTRY_LEFT_IS_EMPTY: - return makeSsaFromEmpty(slot, ssaFactory, leftSideSource, stateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_BUILDER: - return makeSsaFromBuilder(slot, ssaFactory, leftSideSource, stateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_INDEX: - return makeSsaFromIndex(slot, ssaFactory, leftSideSource, stateSource, (byte)((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_SSA)); - case ENTRY_LEFT_IS_SSA: - return (SegmentedSortedArray)leftSideSource.getUnsafe(slot); - } - } - throw new IllegalStateException(); - } - - @Override - public SegmentedSortedArray getLeftSsaOrIndex(long slot, MutableObject indexOutput) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - final byte stateValueForIndex = (byte) ((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_INDEX); - return getSsaOrIndex(indexOutput, overflowLocation, leftEntryAsRightType(entryType), overflowLeftSideSource, overflowStateSource, stateValueForIndex); - } else { - final byte entryType = stateSource.getUnsafe(slot); - final byte stateValueForIndex = (byte) ((entryType & ENTRY_RIGHT_MASK) | ENTRY_LEFT_IS_INDEX); - return getSsaOrIndex(indexOutput, slot, leftEntryAsRightType(entryType), leftSideSource, stateSource, stateValueForIndex); - } - } - - public SegmentedSortedArray getRightSsaOrIndex(long slot, MutableObject indexOutput) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final byte entryType = overflowStateSource.getUnsafe(overflowLocation); - final byte stateValueForIndex = (byte) ((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX); - return getSsaOrIndex(indexOutput, overflowLocation, getRightEntryType(entryType), overflowRightSideSource, overflowStateSource, stateValueForIndex); - } else { - final byte entryType = stateSource.getUnsafe(slot); - final byte stateValueForIndex = (byte) ((entryType & ENTRY_LEFT_MASK) | ENTRY_RIGHT_IS_INDEX); - return getSsaOrIndex(indexOutput, slot, getRightEntryType(entryType), rightSideSource, stateSource, stateValueForIndex); - } - } - - @Nullable - private static SegmentedSortedArray getSsaOrIndex(MutableObject indexOutput, long location, byte entryType, ObjectArraySource sideSource, ByteArraySource stateSource, byte stateValueForIndex) { - switch (entryType) { - case ENTRY_RIGHT_IS_SSA: - return (SegmentedSortedArray) sideSource.getUnsafe(location); - case ENTRY_RIGHT_IS_INDEX: - indexOutput.setValue((WritableRowSet) sideSource.getUnsafe(location)); - return null; - case ENTRY_RIGHT_IS_EMPTY: { - final WritableRowSet emptyRowSet = RowSetFactory.empty(); - sideSource.set(location, emptyRowSet); - stateSource.set(location, stateValueForIndex); - indexOutput.setValue(emptyRowSet); - return null; - } - case ENTRY_RIGHT_IS_BUILDER: { - final WritableRowSet rowSet = ((RowSetBuilderSequential) sideSource.getUnsafe(location)).build(); - sideSource.set(location, rowSet); - stateSource.set(location, stateValueForIndex); - indexOutput.setValue(rowSet); - return null; - } - default: - throw new IllegalStateException(); - } - } - - @Nullable - private SegmentedSortedArray makeSsaFromBuilder(long slot, Function ssaFactory, ObjectArraySource ssaSource, ByteArraySource stateSource, byte newState) { - final RowSetBuilderSequential builder = (RowSetBuilderSequential) ssaSource.getUnsafe(slot); - final RowSet rowSet; - if (builder == null) { - rowSet = RowSetFactory.empty(); - } else { - rowSet = builder.build(); - } - return makeSsaFromIndex(slot, ssaFactory, ssaSource, stateSource, newState, rowSet); - } - - @Nullable - private SegmentedSortedArray makeSsaFromEmpty(long slot, Function ssaFactory, ObjectArraySource ssaSource, ByteArraySource stateSource, byte newState) { - return makeSsaFromIndex(slot, ssaFactory, ssaSource, stateSource, newState, RowSetFactory.empty()); - } - - @Nullable - private SegmentedSortedArray makeSsaFromIndex(long slot, Function ssaFactory, ObjectArraySource ssaSource, ByteArraySource stateSource, byte newState) { - return makeSsaFromIndex(slot, ssaFactory, ssaSource, stateSource, newState, (RowSet) ssaSource.getUnsafe(slot)); - } - - private SegmentedSortedArray makeSsaFromIndex(long slot, Function ssaFactory, ObjectArraySource ssaSource, ByteArraySource stateSource, byte newState, RowSet rowSet) { - stateSource.set(slot, newState); - final SegmentedSortedArray ssa = ssaFactory.apply(rowSet); - rowSet.close(); - ssaSource.set(slot, ssa); - return ssa; - } - - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - static boolean isOverflowLocation(long hashSlot) { - return hashSlot < OVERFLOW_PIVOT_VALUE; - } - - static long hashLocationToOverflowLocation(long hashSlot) { - return -hashSlot - 1 + OVERFLOW_PIVOT_VALUE; - } - - private static long overflowLocationToHashLocation(long overflowSlot) { - return OVERFLOW_PIVOT_VALUE - (1 + overflowSlot); - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedNaturalJoinStateManager.java deleted file mode 100644 index 942acc70df0..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedNaturalJoinStateManager.java +++ /dev/null @@ -1,1512 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QLongChunk\E -import io.deephaven.chunk.util.hashing.LongChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import org.jetbrains.annotations.Nullable; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -// endregion class visibility -class RightIncrementalChunkedNaturalJoinStateManager - // region extensions - extends RightIncrementalNaturalJoinStateManager - implements IncrementalNaturalJoinStateManager - // endregion extensions -{ - // region constants - private static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = 1L << 30; - // endregion constants - - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_LONG\E, @StateValueType@ from \Qlong\E - private static final long EMPTY_RIGHT_VALUE = QueryConstants.NULL_LONG; - - // mixin getStateValue - // region overflow pivot - private static final long OVERFLOW_PIVOT_VALUE = DUPLICATE_RIGHT_VALUE; - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QLongArraySource\E - private final LongArraySource rightRowSetSource - // @StateColumnSourceConstructor@ from \QLongArraySource()\E - = new LongArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QLongArraySource\E - private final LongArraySource overflowRightRowSetSource - // @StateColumnSourceConstructor@ from \QLongArraySource()\E - = new LongArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - - // region extra variables - // we always store left RowSet values parallel to the keys; we may want to optimize for single left indices to avoid - // object allocation, but we do have fairly efficient single range indices at this point - private final ObjectArraySource leftRowSetSource; - private final ObjectArraySource overflowLeftRowSetSource; - - // we must maintain our cookie for modified state tracking - private final LongArraySource modifiedTrackerCookieSource; - private final LongArraySource overflowModifiedTrackerCookieSource; - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - RightIncrementalChunkedNaturalJoinStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , ColumnSource[] tableKeySourcesForErrors - // endregion constructor arguments - ) { - // region super - super(tableKeySourcesForErrors); - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - - // region constructor - leftRowSetSource = new ObjectArraySource<>(WritableRowSet.class); - overflowLeftRowSetSource = new ObjectArraySource<>(WritableRowSet.class); - modifiedTrackerCookieSource = new LongArraySource(); - overflowModifiedTrackerCookieSource = new LongArraySource(); - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - rightRowSetSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - leftRowSetSource.ensureCapacity(tableSize); - modifiedTrackerCookieSource.ensureCapacity(tableSize); - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowRightRowSetSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - overflowLeftRowSetSource.ensureCapacity(newCapacity); - overflowModifiedTrackerCookieSource.ensureCapacity(newCapacity); - // endregion ensureOverflowCapacity - } - - // region build wrappers - private static class InitialBuildContext implements RightIncrementalNaturalJoinStateManager.InitialBuildContext { - final LongArraySource leftHashSlots = new LongArraySource(); - - @Override - public void close() { - } - } - - @Override - public RightIncrementalNaturalJoinStateManager.InitialBuildContext makeInitialBuildContext(Table leftTable) { - return new InitialBuildContext(); - } - - @Override - public void buildFromLeftSide(final Table leftTable, ColumnSource[] leftSources, final RightIncrementalNaturalJoinStateManager.InitialBuildContext initialBuildContext) { - if (leftTable.isEmpty()) { - return; - } - final InitialBuildContext ibc = (InitialBuildContext)initialBuildContext; - ibc.leftHashSlots.ensureCapacity(leftTable.size()); - try (final BuildContext bc = makeBuildContext(leftSources, leftTable.size())) { - buildTable(bc, leftTable.getRowSet(), leftSources, ibc.leftHashSlots); - } - } - - private void addLeftIndex(long tableLocation, long keyToAdd) { - final WritableRowSet rowSet = leftRowSetSource.get(tableLocation); - if (rowSet == null) { - leftRowSetSource.set(tableLocation, RowSetFactory.fromKeys(keyToAdd)); - } else { - rowSet.insert(keyToAdd); - } - } - - - private void addRightIndex(long tableLocation, long keyToAdd) { - final long existingRightIndex = rightRowSetSource.getLong(tableLocation); - if (existingRightIndex == NO_RIGHT_ENTRY_VALUE) { - rightRowSetSource.set(tableLocation, keyToAdd); - } else { - rightRowSetSource.set(tableLocation, DUPLICATE_RIGHT_VALUE); - } - } - - private void removeRightIndex(long tableLocation, long keyToRemove) { - final long existingRightIndex = rightRowSetSource.getLong(tableLocation); - if (existingRightIndex == keyToRemove) { - rightRowSetSource.set(tableLocation, NO_RIGHT_ENTRY_VALUE); - } else { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + " remove of " + keyToRemove + ", key=" + keyString(tableLocation)); - } - } - - private void shiftRightIndex(long tableLocation, long shiftedKey, long shiftDelta) { - final long existingRightIndex = rightRowSetSource.getLong(tableLocation); - if (existingRightIndex == shiftedKey - shiftDelta) { - rightRowSetSource.set(tableLocation, shiftedKey); - } else { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + " shift of " + (shiftedKey - shiftDelta) + ", key=" + keyString(tableLocation)); - } - } - - private void removeRightIndexOverflow(long overflowLocation, long keyToRemove) { - final long existingRightIndex = overflowRightRowSetSource.getLong(overflowLocation); - if (existingRightIndex == keyToRemove) { - overflowRightRowSetSource.set(overflowLocation, NO_RIGHT_ENTRY_VALUE); - } else { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + " remove of " + keyToRemove + ", key=" + keyString(overflowLocationToHashLocation(overflowLocation))); - } - } - - private void shiftRightIndexOverflow(long overflowLocation, long shiftedKey, long shiftDelta) { - final long existingRightIndex = overflowRightRowSetSource.getLong(overflowLocation); - if (existingRightIndex == shiftedKey - shiftDelta) { - overflowRightRowSetSource.set(overflowLocation, shiftedKey); - } else { - throw Assert.statementNeverExecuted("Existing Right TrackingWritableRowSet: " + existingRightIndex + " shift of " + (shiftedKey - shiftDelta) + ", key=" + keyString(overflowLocationToHashLocation(overflowLocation))); - } - } - - private void addLeftIndexOverflow(long overflowLocation, long keyToAdd) { - final WritableRowSet rowSet = overflowLeftRowSetSource.get(overflowLocation); - if (rowSet == null) { - overflowLeftRowSetSource.set(overflowLocation, RowSetFactory.fromKeys(keyToAdd)); - } else { - rowSet.insert(keyToAdd); - } - } - - private void addRightIndexOverflow(long overflowLocation, long keyToAdd) { - final long existingRightIndex = overflowRightRowSetSource.getLong(overflowLocation); - if (existingRightIndex == NO_RIGHT_ENTRY_VALUE) { - overflowRightRowSetSource.set(overflowLocation, keyToAdd); - } else { - overflowRightRowSetSource.set(overflowLocation, DUPLICATE_RIGHT_VALUE); - } - } - - private void addModifiedMain(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long tableLocation, byte flag) { - if (modifiedSlotTracker != null) { - final long originalIndex = rightRowSetSource.getLong(tableLocation); - modifiedTrackerCookieSource.set(tableLocation, modifiedSlotTracker.addMain(modifiedTrackerCookieSource.getLong(tableLocation), tableLocation, originalIndex, flag)); - } - } - - private void addModifiedOverflow(NaturalJoinModifiedSlotTracker modifiedSlotTracker, long overflowLocation, byte flag) { - if (modifiedSlotTracker != null) { - final long originalIndex = overflowRightRowSetSource.getLong(overflowLocation); - overflowModifiedTrackerCookieSource.set(overflowLocation, modifiedSlotTracker.addOverflow(overflowModifiedTrackerCookieSource.getLong(overflowLocation), overflowLocation, originalIndex, flag)); - } - } - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableLongChunk\E - final WritableLongChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = rightRowSetSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableLongChunk\E - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // region build context close - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final LongArraySource resultSource - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // the destination hash slots for each left-hand-side entry - final WritableLongChunk sourceChunkLeftHashSlots = WritableLongChunk.makeWritableChunk(bc.chunkSize); - // the chunk of source indices that are parallel to the sourceChunks - final WritableLongChunk sourceIndexKeys = WritableLongChunk.makeWritableChunk(bc.chunkSize); - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - chunkOk.fillRowKeyChunk(sourceIndexKeys); - sourceChunkLeftHashSlots.setSize(bc.hashChunk.size()); - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - rightRowSetSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QLongChunk\E - LongChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - // we know what hash slot this maps to - sourceChunkLeftHashSlots.set(ii, tableLocation); - addLeftIndex(tableLocation, sourceIndexKeys.get(ii)); - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - final long keyToAdd = sourceIndexKeys.get(firstChunkPositionForHashLocation); - rightRowSetSource.set(currentHashLocation, NO_RIGHT_ENTRY_VALUE); - addLeftIndex(currentHashLocation, keyToAdd); - sourceChunkLeftHashSlots.set(firstChunkPositionForHashLocation, currentHashLocation); - // endregion main insert - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - // we match the first element, so should use it - sourceChunkLeftHashSlots.set(chunkPosition, tableLocation); - addLeftIndex(tableLocation, sourceIndexKeys.get(chunkPosition)); - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - // if we are equal, then it's great and we know what our left-hand side slot is - // (represented as a negative number to indicate overflow) - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(overflowLocation)); - addLeftIndexOverflow(overflowLocation, sourceIndexKeys.get(chunkPosition)); - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(allocatedOverflowLocation)); - // we set the right RowSet to indicate it is empty, but exists - addLeftIndexOverflow(allocatedOverflowLocation, sourceIndexKeys.get(chunkPosition)); - overflowRightRowSetSource.set(allocatedOverflowLocation, NO_RIGHT_ENTRY_VALUE); - // endregion build overflow insert - - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - // we match the first element, so should use the overflow slow we allocated for it - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(insertedOverflowLocation)); - addLeftIndexOverflow(insertedOverflowLocation, sourceIndexKeys.get(chunkPosition)); - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - // region copy hash slots - for (int ii = 0; ii < sourceChunkLeftHashSlots.size(); ++ii) { - resultSource.set(hashSlotOffset + ii, sourceChunkLeftHashSlots.get(ii)); - } - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - sourceChunkLeftHashSlots.close(); - sourceIndexKeys.close(); - - // compact indices that were possibly built piecemeal - for (int ii = 0; ii < tableSize; ++ii) { - final WritableRowSet rowSet = leftRowSetSource.get(ii); - if (rowSet != null) { - rowSet.compact(); - } - } - for (int ii = 0; ii < nextOverflowLocation; ++ii) { - final WritableRowSet rowSet = overflowLeftRowSetSource.get(ii); - if (rowSet != null) { - rowSet.compact(); - } - } - // endregion post build loop - } - } - - - private int allocateOverflowLocation() { - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - // mixin prev - private void getPrevKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getPrevChunk(contexts[ii], rowSequence); - } - } - // endmixin prev - - // region probe wrappers - @Override - protected void decorateLeftSide(RowSet leftRowSet, ColumnSource[] leftSources, LongArraySource leftRedirections) { - // TODO: FIGURE OUT THE RIGHT INTERFACE HERE - throw new UnsupportedOperationException(); - } - - @Override - public void addRightSide(RowSequence rightIndex, ColumnSource [] rightSources) { - if (rightIndex.isEmpty()) { - return; - } - try (final ProbeContext pc = makeProbeContext(rightSources, rightIndex.size())) { - decorationProbe(pc, rightIndex, rightSources, false, false, true, false, false, 0, null); - } - } - - @Override - public void addRightSide(final Context pc, RowSequence rightIndex, ColumnSource [] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (rightIndex.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, rightIndex, rightSources, false, false, true, false, false, 0, modifiedSlotTracker); - } - - @Override - public void removeRight(final Context pc, RowSequence rightIndex, ColumnSource [] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (rightIndex.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, rightIndex, rightSources, true, false, false, true, false, 0, modifiedSlotTracker); - } - - @Override - public void modifyByRight(final Context pc, RowSet modified, ColumnSource[] rightSources, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (modified.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, modified, rightSources, false, true, false, false, false, 0, modifiedSlotTracker); - } - - @Override - public void applyRightShift(Context pc, ColumnSource [] rightSources, RowSet shiftedRowSet, long shiftDelta, @NotNull final NaturalJoinModifiedSlotTracker modifiedSlotTracker) { - if (shiftedRowSet.isEmpty()) { - return; - } - decorationProbe((ProbeContext)pc, shiftedRowSet, rightSources, false, false, false, false, true, shiftDelta, modifiedSlotTracker); - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableLongChunk\E - final WritableLongChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - - // the chunk of indices created from our RowSequence, used to write into the hash table - final WritableLongChunk keyIndices; - - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - keyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion probe context constructor - stateSourceFillContext = rightRowSetSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableLongChunk\E - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - keyIndices.close(); - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // mixin prev - , boolean usePrev - // endmixin prev - // region additional probe arguments - , final boolean probeOnly - , final boolean addRight - , final boolean removeRight - , final boolean shiftRight - , final long shiftDelta - , @Nullable final NaturalJoinModifiedSlotTracker modifiedSlotTracker - // endregion additional probe arguments - ) { - // region probe start - Assert.assertion(probeOnly ^ addRight ^ removeRight ^ shiftRight, "probeOnly ^ addRight ^ removeRight ^ shiftRight"); - if (shiftRight) { - Assert.neqZero(shiftDelta, "shiftDelta"); - } - final byte modifiedFlag = shiftRight ? NaturalJoinModifiedSlotTracker.FLAG_RIGHT_SHIFT : probeOnly ? NaturalJoinModifiedSlotTracker.FLAG_RIGHT_MODIFY_PROBE : NaturalJoinModifiedSlotTracker.FLAG_RIGHT_CHANGE; - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - chunkOk.fillRowKeyChunk(pc.keyIndices); - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - // mixin prev - if (usePrev) { - getPrevKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - } else { - // endmixin prev - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - // mixin prev - } - // endmixin prev - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - rightRowSetSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QLongChunk\E - LongChunkEquals.notEqual(pc.workingStateEntries, EMPTY_RIGHT_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final long tableLocation = pc.tableLocationsChunk.get(ii); - addModifiedMain(modifiedSlotTracker, tableLocation, modifiedFlag); - - if (probeOnly) { - continue; - } - - final long indexKey = pc.keyIndices.get(ii); - if (addRight) { - addRightIndex(tableLocation, indexKey); - } else if (removeRight) { - removeRightIndex(tableLocation, indexKey); - } else if (shiftRight) { - shiftRightIndex(tableLocation, indexKey, shiftDelta); - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_RIGHT_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - addModifiedOverflow(modifiedSlotTracker, overflowLocation, modifiedFlag); - if (probeOnly) { - continue; - } - - final long indexKey = pc.keyIndices.get(chunkPosition); - - if (addRight) { - addRightIndexOverflow(overflowLocation, indexKey); - } else if (removeRight) { - removeRightIndexOverflow(overflowLocation, indexKey); - } else if (shiftRight) { - shiftRightIndexOverflow(overflowLocation, indexKey, shiftDelta); - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - int hash) { - final int location = hash & (tableSize - 1); - return location; - } - - // region extraction functions - static long overflowToSlot(long overflow) { - return overflowLocationToHashLocation(overflow); - } - - @Override - public RowSet getLeftIndex(long slot) { - if (isOverflowLocation(slot)) { - return overflowLeftRowSetSource.get(hashLocationToOverflowLocation(slot)); - } else { - return leftRowSetSource.get(slot); - } - } - - @Override - public long getRightIndex(long slot) { - final long rightIndex; - if (isOverflowLocation(slot)) { - rightIndex = overflowRightRowSetSource.getLong(hashLocationToOverflowLocation(slot)); - } else { - rightIndex = rightRowSetSource.getLong(slot); - } - - return rightIndex; - } - - @Override - public String keyString(long slot) { - final WritableChunk[] keyChunk = getWritableKeyChunks(1); - try (final WritableLongChunk slotChunk = WritableLongChunk.makeWritableChunk(1)) { - if (isOverflowLocation(slot)) { - slotChunk.set(0, hashLocationToOverflowLocation(slot)); - final ColumnSource.FillContext[] contexts = makeFillContexts(overflowKeySources, null, 1); - try { - fillOverflowKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } else { - slotChunk.set(0, slot); - final ColumnSource.FillContext[] contexts = makeFillContexts(keySources, null, 1); - try { - fillKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } - return ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, keyChunk, 0); - } finally { - for (WritableChunk chunk : keyChunk) { - chunk.close(); - } - } - } - - @Override - public WritableRowRedirection buildRowRedirectionFromHashSlot(QueryTable leftTable, boolean exactMatch, RightIncrementalNaturalJoinStateManager.InitialBuildContext initialBuildContext, JoinControl.RedirectionType redirectionType) { - final LongArraySource leftHashSlots = ((InitialBuildContext) initialBuildContext).leftHashSlots; - return buildRowRedirection(leftTable, exactMatch, position -> getRightSide(leftHashSlots, position), redirectionType); - } - - private long getRightSide(final LongArraySource leftHashSlots, final long position) { - final long stateValue = getStateValue(leftHashSlots, position); - if (stateValue == DUPLICATE_RIGHT_VALUE) { - final long hashSlot = leftHashSlots.getLong(position); - throw new IllegalStateException("Natural Join found duplicate right key for " + keyString(hashSlot)); - } - return stateValue; - } - - @Override - public WritableRowRedirection buildRowRedirectionFromHashSlotGrouped(QueryTable leftTable, ObjectArraySource rowSetSource, int groupingSize, boolean exactMatch, RightIncrementalNaturalJoinStateManager.InitialBuildContext initialBuildContext, JoinControl.RedirectionType redirectionType) { - final LongArraySource leftHashSlots = ((InitialBuildContext) initialBuildContext).leftHashSlots; - switch (redirectionType) { - case Contiguous: { - if (!leftTable.isFlat()) { - throw new IllegalStateException("Left table is not flat for contiguous row redirection build!"); - } - // we can use an array, which is perfect for a small enough flat table - final long[] innerIndex = new long[leftTable.intSize("contiguous redirection build")]; - for (int ii = 0; ii < groupingSize; ++ii) { - final long rightSide = getStateValue(leftHashSlots, ii); - final RowSet leftRowSet = rowSetSource.get(ii); - assert leftRowSet != null; - if (leftRowSet.isNonempty()) { - checkExactMatch(exactMatch, leftRowSet.firstRowKey(), rightSide); - leftRowSet.forAllRowKeys(li -> { - innerIndex[(int)li] = rightSide; - }); - } - } - return new ContiguousWritableRowRedirection(innerIndex); - } - case Sparse: { - final LongSparseArraySource sparseRedirections = new LongSparseArraySource(); - - for (int ii = 0; ii < groupingSize; ++ii) { - final long rightSide = getStateValue(leftHashSlots, ii); - final RowSet leftRowSet = rowSetSource.get(ii); - assert leftRowSet != null; - if (leftRowSet.isNonempty()) { - checkExactMatch(exactMatch, leftRowSet.firstRowKey(), rightSide); - if (rightSide != NO_RIGHT_ENTRY_VALUE) { - leftRowSet.forAllRowKeys(li -> { - sparseRedirections.set(li, rightSide); - }); - } - } - } - return new LongColumnSourceWritableRowRedirection(sparseRedirections); - } - case Hash: { - final WritableRowRedirection rowRedirection = WritableRowRedirectionLockFree.FACTORY.createRowRedirection(leftTable.intSize()); - - for (int ii = 0; ii < groupingSize; ++ii) { - final long rightSide = getStateValue(leftHashSlots, ii); - final RowSet leftRowSet = rowSetSource.get(ii); - assert leftRowSet != null; - if (leftRowSet.isNonempty()) { - checkExactMatch(exactMatch, leftRowSet.firstRowKey(), rightSide); - if (rightSide != NO_RIGHT_ENTRY_VALUE) { - leftRowSet.forAllRowKeys(li -> { - rowRedirection.put(li, rightSide); - }); - } - } - } - - return rowRedirection; - } - } - throw new IllegalStateException("Bad redirectionType: " + redirectionType); - } - - public void convertLeftGroups(int groupingSize, RightIncrementalNaturalJoinStateManager.InitialBuildContext initialBuildContext, ObjectArraySource rowSetSource) { - final InitialBuildContext ibc = (InitialBuildContext) initialBuildContext; - for (int ii = 0; ii < groupingSize; ++ii) { - final long slot = ibc.leftHashSlots.getUnsafe(ii); - final RowSet oldRowSet; - if (isOverflowLocation(slot)) { - oldRowSet = overflowLeftRowSetSource.getAndSetUnsafe(hashLocationToOverflowLocation(slot), rowSetSource.get(ii)); - } else { - oldRowSet = leftRowSetSource.getAndSetUnsafe(slot, rowSetSource.get(ii)); - } - Assert.eq(oldRowSet.size(), "oldRowSet.size()", 1); - Assert.eq(oldRowSet.get(0), "oldRowSet.get(0)", ii, "ii"); - } - } - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - private long getStateValue(final LongArraySource hashSlots, final long locationInHashSlots) { - final long hashSlot = hashSlots.getLong(locationInHashSlots); - if (isOverflowLocation(hashSlot)) { - return overflowRightRowSetSource.getLong(hashLocationToOverflowLocation(hashSlot)); - } - else { - return rightRowSetSource.getLong(hashSlot); - } - } - // endregion getStateValue - - // region overflowLocationToHashLocation - static boolean isOverflowLocation(long hashSlot) { - return hashSlot < OVERFLOW_PIVOT_VALUE; - } - - static long hashLocationToOverflowLocation(long hashSlot) { - return -hashSlot - 1 + OVERFLOW_PIVOT_VALUE; - } - - private static long overflowLocationToHashLocation(long overflowSlot) { - return OVERFLOW_PIVOT_VALUE - (1 + overflowSlot); - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleUniqueStaticNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleUniqueStaticNaturalJoinStateManager.java index d103747e4f5..570895e7864 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleUniqueStaticNaturalJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SimpleUniqueStaticNaturalJoinStateManager.java @@ -16,6 +16,8 @@ import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; + /** * A static natural join manager that only maintains a single array source for the right indices. * diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticAsOfJoinStateManager.java index 63ac1f5782f..121aef06d5e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticAsOfJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticAsOfJoinStateManager.java @@ -3,19 +3,10 @@ */ package io.deephaven.engine.table.impl; -import io.deephaven.engine.rowset.RowSequence; -import io.deephaven.engine.rowset.RowSet; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; -import io.deephaven.engine.table.impl.sources.LongSparseArraySource; -import io.deephaven.engine.table.impl.util.ContiguousWritableRowRedirection; -import io.deephaven.engine.table.impl.util.LongColumnSourceWritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirectionLockFree; import java.util.Arrays; import java.util.Objects; -import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public abstract class StaticAsOfJoinStateManager { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedAsOfJoinStateManager.java deleted file mode 100644 index ee5aec28220..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedAsOfJoinStateManager.java +++ /dev/null @@ -1,1919 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QByteChunk\E -import io.deephaven.chunk.util.hashing.ByteChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - -// mixin rehash -import java.util.Arrays; -import io.deephaven.engine.table.impl.sort.permute.IntPermuteKernel; -// @StateChunkTypeEnum@ from \QByte\E -import io.deephaven.engine.table.impl.sort.permute.BytePermuteKernel; -import io.deephaven.engine.table.impl.util.compact.IntCompactKernel; -import io.deephaven.engine.table.impl.util.compact.LongCompactKernel; -// endmixin rehash - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import org.apache.commons.lang3.mutable.MutableInt; -import io.deephaven.engine.table.impl.asofjoin.StaticHashedAsOfJoinStateManager; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -// endregion class visibility -class StaticChunkedAsOfJoinStateManager - // region extensions - extends StaticHashedAsOfJoinStateManager - // endregion extensions -{ - // region constants - private static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = 1L << 30; - // endregion constants - - // mixin rehash - static final double DEFAULT_MAX_LOAD_FACTOR = 0.75; - static final double DEFAULT_TARGET_LOAD_FACTOR = 0.70; - // endmixin rehash - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_BYTE\E, @StateValueType@ from \Qbyte\E - private static final byte EMPTY_VALUE = QueryConstants.NULL_BYTE; - - // mixin getStateValue - // region overflow pivot - private static final long OVERFLOW_PIVOT_VALUE = -1; - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - // mixin rehash - private int tableSize; - // endmixin rehash - // altmixin rehash: private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - // mixin rehash - private long numEntries = 0; - - /** Our table size must be 2^L (i.e. a power of two); and the pivot is between 2^(L-1) and 2^L. - * - *

    When hashing a value, if hashCode % 2^L < tableHashPivot; then the destination location is hashCode % 2^L. - * If hashCode % 2^L >= tableHashPivot, then the destination location is hashCode % 2^(L-1). Once the pivot reaches - * the table size, we can simply double the table size and repeat the process.

    - * - *

    This has the effect of only using hash table locations < hashTablePivot. When we want to expand the table - * we can move some of the entries from the location {@code tableHashPivot - 2^(L-1)} to tableHashPivot. This - * provides for incremental expansion of the hash table, without the need for a full rehash.

    - */ - private int tableHashPivot; - - // the table will be rehashed to a load factor of targetLoadFactor if our loadFactor exceeds maximumLoadFactor - // or if it falls below minimum load factor we will instead contract the table - private double targetLoadFactor = DEFAULT_TARGET_LOAD_FACTOR; - private double maximumLoadFactor = DEFAULT_MAX_LOAD_FACTOR; - // TODO: We do not yet support contraction - // private final double minimumLoadFactor = 0.5; - - private final IntegerArraySource freeOverflowLocations = new IntegerArraySource(); - private int freeOverflowCount = 0; - // endmixin rehash - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QByteArraySource\E - private final ByteArraySource stateSource - // @StateColumnSourceConstructor@ from \QByteArraySource()\E - = new ByteArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QByteArraySource\E - private final ByteArraySource overflowStateSource - // @StateColumnSourceConstructor@ from \QByteArraySource()\E - = new ByteArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - // mixin rehash - // If we have objects in our key columns, then we should null them out if we delete an overflow row, this only - // applies to ObjectArraySources, for primitives we are content to leave the dead entries in the tables, because - // they will not affect GC. - private final ObjectArraySource[] overflowKeyColumnsToNull; - // endmixin rehash - - // region extra variables - private static final byte ENTRY_EXISTS = 1; - - - private final ObjectArraySource leftRowSetSource; - private final ObjectArraySource overflowLeftRowSetSource; - - /** - * For the ticking case we need to reuse our right indices for more than one update. We convert the - * SequentialBuilders into actual RowSet objects. Before the conversion (which must be during the build phase) - * we put the sequential builders into rightRowSetSource and overflowRightRowSetSource. After the conversion, the - * sources store actual indices. - */ - private boolean rightBuildersConverted = false; - - private final ObjectArraySource rightRowSetSource; - private final ObjectArraySource overflowRightRowSetSource; - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - StaticChunkedAsOfJoinStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , ColumnSource[] tableKeySourcesForErrors - // endregion constructor arguments - ) { - // region super - super(tableKeySourcesForErrors); - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - // mixin rehash - this.tableHashPivot = tableSize; - // endmixin rehash - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - // mixin rehash - overflowKeyColumnsToNull = Arrays.stream(overflowKeySources).filter(x -> x instanceof ObjectArraySource).map(x -> (ObjectArraySource)x).toArray(ObjectArraySource[]::new); - // endmixin rehash - - // region constructor - leftRowSetSource = new ObjectArraySource<>(RowSetBuilderSequential.class); - overflowLeftRowSetSource = new ObjectArraySource<>(RowSetBuilderSequential.class); - rightRowSetSource = new ObjectArraySource<>(Object.class); - overflowRightRowSetSource = new ObjectArraySource<>(Object.class); - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - stateSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - leftRowSetSource.ensureCapacity(tableSize); - rightRowSetSource.ensureCapacity(tableSize); - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - // mixin rehash - if (freeOverflowCount >= locationsToAllocate) { - return; - } - final int newCapacity = nextOverflowLocation + locationsToAllocate - freeOverflowCount; - // endmixin rehash - // altmixin rehash: final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowStateSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - overflowLeftRowSetSource.ensureCapacity(newCapacity); - overflowRightRowSetSource.ensureCapacity(newCapacity); - // endregion ensureOverflowCapacity - } - - // region build wrappers - @Override - public int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, @NotNull final LongArraySource addedSlots) { - if (rightRowSet.isEmpty()) { - return 0; - } - try (final BuildContext bc = makeBuildContext(rightSources, rightRowSet.size())) { - final MutableInt slotCount = new MutableInt(0); - buildTable(bc, rightRowSet, rightSources, false, addedSlots, slotCount); - return slotCount.intValue(); - } - } - - @Override - public int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull final LongArraySource addedSlots) { - if (leftRowSet.isEmpty()) { - return 0; - } - try (final BuildContext bc = makeBuildContext(leftSources, leftRowSet.size())) { - final MutableInt slotCount = new MutableInt(0); - buildTable(bc, leftRowSet, leftSources, true, addedSlots, slotCount); - return slotCount.intValue(); - } - } - - private static boolean addIndex(ObjectArraySource source, long location, long keyToAdd) { - boolean addedSlot = false; - RowSetBuilderSequential builder = source.getUnsafe(location); - if (builder == null) { - source.set(location, builder = RowSetFactory.builderSequential()); - addedSlot = true; - } - builder.appendKey(keyToAdd); - return addedSlot; - } - - /** - * Returns true if this is the first left row key added to this slot. - */ - private boolean addLeftIndex(long tableLocation, long keyToAdd) { - return addIndex(leftRowSetSource, tableLocation, keyToAdd); - } - - /** - * Returns true if this is the first left row key added to this slot. - */ - private boolean addLeftIndexOverflow(long overflowLocation, long keyToAdd) { - return addIndex(overflowLeftRowSetSource, overflowLocation, keyToAdd); - } - - private void addRightIndex(long tableLocation, long keyToAdd) { - //noinspection unchecked - addIndex((ObjectArraySource) rightRowSetSource, tableLocation, keyToAdd); - } - - private void addRightIndexOverflow(long overflowLocation, long keyToAdd) { - //noinspection unchecked - addIndex((ObjectArraySource) overflowRightRowSetSource, overflowLocation, keyToAdd); - } - - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - // mixin rehash - final ColumnSource.FillContext overflowStateSourceFillContext; - // endmixin rehash - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableByteChunk\E - final WritableByteChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - // mixin rehash - final WritableLongChunk rehashLocations; - final WritableIntChunk overflowLocationsToMigrate; - final WritableLongChunk overflowLocationsAsKeyIndices; - final WritableBooleanChunk shouldMoveBucket; - - final ResettableWritableLongChunk overflowLocationForPromotionLoop = ResettableWritableLongChunk.makeResettableChunk(); - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableByteChunk\E, @WritableStateChunkName@ from \QWritableByteChunk\E - final ResettableWritableByteChunk writeThroughState = ResettableWritableByteChunk.makeResettableChunk(); - // endmixin allowUpdateWriteThroughState - final ResettableWritableIntChunk writeThroughOverflowLocations = ResettableWritableIntChunk.makeResettableChunk(); - // endmixin rehash - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - final WritableLongChunk sourceIndexKeys; - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - sourceIndexKeys = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableByteChunk\E - workingStateEntries = WritableByteChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - // mixin rehash - rehashLocations = WritableLongChunk.makeWritableChunk(chunkSize); - overflowStateSourceFillContext = overflowStateSource.makeFillContext(chunkSize); - overflowLocationsToMigrate = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocationsAsKeyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - shouldMoveBucket = WritableBooleanChunk.makeWritableChunk(chunkSize); - // endmixin rehash - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - // mixin rehash - overflowStateSourceFillContext.close(); - // endmixin rehash - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // mixin rehash - rehashLocations.close(); - overflowLocationsToMigrate.close(); - overflowLocationsAsKeyIndices.close(); - shouldMoveBucket.close(); - overflowLocationForPromotionLoop.close(); - // mixin allowUpdateWriteThroughState - writeThroughState.close(); - // endmixin allowUpdateWriteThroughState - writeThroughOverflowLocations.close(); - // endmixin rehash - // region build context close - sourceIndexKeys.close(); - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , boolean isLeftSide - , @NotNull final LongArraySource addedSlots - , final MutableInt slotCount - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - final IntegerArraySource buildCookieSource = new IntegerArraySource(); - final IntegerArraySource overflowBuildCookieSource = new IntegerArraySource(); - buildCookieSource.ensureCapacity(tableSize); - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - // TODO: make chunkOk.fillRowKeyChunk ignore the input size - bc.sourceIndexKeys.setSize(bc.chunkSize); - chunkOk.fillRowKeyChunk(bc.sourceIndexKeys); - - addedSlots.ensureCapacity(slotCount.intValue() + bc.chunkSize); - overflowBuildCookieSource.ensureCapacity(nextOverflowLocation + bc.chunkSize); - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(bc.workingStateEntries, EMPTY_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - final long keyToAdd = bc.sourceIndexKeys.get(ii); - if (isLeftSide) { - addLeftIndex(tableLocation, keyToAdd); - } else { - addRightIndex(tableLocation, keyToAdd); - } - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - addedSlots.set(slotCount.intValue(), currentHashLocation); - buildCookieSource.set(currentHashLocation, slotCount.intValue()); - slotCount.increment(); - final long keyToAdd = bc.sourceIndexKeys.get(firstChunkPositionForHashLocation); - stateSource.set(currentHashLocation, ENTRY_EXISTS); - if (isLeftSide) { - addLeftIndex(currentHashLocation, keyToAdd); - } else { - addRightIndex(currentHashLocation, keyToAdd); - } - - // endregion main insert - // mixin rehash - numEntries++; - // endmixin rehash - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - addLeftIndex(tableLocation, keyToAdd); - } else { - addRightIndex(tableLocation, keyToAdd); - } - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - addLeftIndexOverflow(overflowLocation, keyToAdd); - } else { - addRightIndexOverflow(overflowLocation, keyToAdd); - } - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final long slot = overflowLocationToHashLocation(allocatedOverflowLocation); - addedSlots.set(slotCount.intValue(), slot); - overflowBuildCookieSource.set(allocatedOverflowLocation, slotCount.intValue()); - slotCount.increment(); - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - if (isLeftSide) { - addLeftIndexOverflow(allocatedOverflowLocation, keyToAdd); - } else { - addRightIndexOverflow(allocatedOverflowLocation, keyToAdd); - } - overflowStateSource.set(allocatedOverflowLocation, ENTRY_EXISTS); - - // endregion build overflow insert - - // mixin rehash - numEntries++; - // endmixin rehash - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - final long keyToAdd = bc.sourceIndexKeys.get(chunkPosition); - // we match the first element, so should use the overflow slow we allocated for it - if (isLeftSide) { - addLeftIndexOverflow(insertedOverflowLocation, keyToAdd); - } else { - addRightIndexOverflow(insertedOverflowLocation, keyToAdd); - } - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - // mixin rehash - // region post-build rehash - doRehash(bc, buildCookieSource, overflowBuildCookieSource, addedSlots); - // endregion post-build rehash - // endmixin rehash - } - - // region copy hash slots - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - // endregion post build loop - } - } - - // mixin rehash - public void doRehash(BuildContext bc - // region extra rehash arguments - , IntegerArraySource buildCookieSource - , IntegerArraySource overflowBuildCookieSource - , LongArraySource addedSlots - // endregion extra rehash arguments - ) { - long firstBackingChunkLocation; - long lastBackingChunkLocation;// mixin rehash - // region rehash start - // endregion rehash start - while (rehashRequired()) { - // region rehash loop start - // endregion rehash loop start - if (tableHashPivot == tableSize) { - tableSize *= 2; - ensureCapacity(tableSize); - // region rehash ensure capacity - buildCookieSource.ensureCapacity(tableSize); - // endregion rehash ensure capacity - } - - final long targetBuckets = Math.min(MAX_TABLE_SIZE, (long)(numEntries / targetLoadFactor)); - final int bucketsToAdd = Math.max(1, (int)Math.min(Math.min(targetBuckets, tableSize) - tableHashPivot, bc.chunkSize)); - - initializeRehashLocations(bc.rehashLocations, bucketsToAdd); - - // fill the overflow bucket locations - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(LongChunk.downcast(bc.rehashLocations))); - // null out the overflow locations in the table - setOverflowLocationsToNull(tableHashPivot - (tableSize >> 1), bucketsToAdd); - - while (bc.overflowLocations.size() > 0) { - // figure out which table location each overflow location maps to - compactOverflowLocations(bc.overflowLocations, bc.overflowLocationsToFetch); - if (bc.overflowLocationsToFetch.size() == 0) { - break; - } - - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsToFetch); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // read the next chunk of overflow locations, which we will be overwriting in the next step - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - - // swap the table's overflow pointer with our location - swapOverflowPointers(bc.tableLocationsChunk, bc.overflowLocationsToFetch); - } - - // now rehash the main entries - - stateSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.rehashLocations); - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(bc.workingStateEntries, EMPTY_VALUE, bc.shouldMoveBucket); - - // crush down things that don't exist - LongCompactKernel.compact(bc.rehashLocations, bc.shouldMoveBucket); - - // get the keys from the table - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.rehashLocations); - hashKeyChunks(bc.hashChunk, bc.workingKeyChunks); - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk, tableHashPivot + bucketsToAdd); - - // figure out which ones must move - LongChunkEquals.notEqual(bc.tableLocationsChunk, bc.rehashLocations, bc.shouldMoveBucket); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - // flushWriteThrough will have zero-ed out the sourcePositions and destinationLocationPositionInWriteThrough size - - int moves = 0; - for (int ii = 0; ii < bc.shouldMoveBucket.size(); ++ii) { - if (bc.shouldMoveBucket.get(ii)) { - moves++; - final long newHashLocation = bc.tableLocationsChunk.get(ii); - final long oldHashLocation = bc.rehashLocations.get(ii); - - if (newHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, newHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // @StateValueType@ from \Qbyte\E - final byte stateValueToMove = stateSource.getUnsafe(oldHashLocation); - stateSource.set(newHashLocation, stateValueToMove); - stateSource.set(oldHashLocation, EMPTY_VALUE); - // region rehash move values - - leftRowSetSource.set(newHashLocation, leftRowSetSource.get(oldHashLocation)); - leftRowSetSource.set(oldHashLocation, null); - - rightRowSetSource.set(newHashLocation, rightRowSetSource.get(oldHashLocation)); - rightRowSetSource.set(oldHashLocation, null); - - final int cookie = buildCookieSource.getInt(oldHashLocation); - addedSlots.set(cookie, newHashLocation); - buildCookieSource.set(newHashLocation, cookie); - buildCookieSource.set(oldHashLocation, QueryConstants.NULL_INT); - // endregion rehash move values - - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(newHashLocation - firstBackingChunkLocation)); - } - } - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // everything has been rehashed now, but we have some table locations that might have an overflow, - // without actually having a main entry. We walk through the empty main entries, pulling non-empty - // overflow locations into the main table - - // figure out which of the two possible locations is empty, because (1) we moved something from it - // or (2) we did not move something to it - bc.overflowLocationsToFetch.setSize(bc.shouldMoveBucket.size()); - final int totalPromotionsToProcess = bc.shouldMoveBucket.size(); - createOverflowPartitions(bc.overflowLocationsToFetch, bc.rehashLocations, bc.shouldMoveBucket, moves); - - for (int loop = 0; loop < 2; loop++) { - final boolean firstLoop = loop == 0; - - if (firstLoop) { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, 0, moves); - } else { - bc.overflowLocationForPromotionLoop.resetFromTypedChunk(bc.overflowLocationsToFetch, moves, totalPromotionsToProcess - moves); - } - - overflowLocationSource.fillChunk(bc.overflowFillContext, bc.overflowLocations, RowSequenceFactory.wrapRowKeysChunkAsRowSequence(bc.overflowLocationForPromotionLoop)); - IntChunkEquals.notEqual(bc.overflowLocations, QueryConstants.NULL_INT, bc.shouldMoveBucket); - - // crunch the chunk down to relevant locations - LongCompactKernel.compact(bc.overflowLocationForPromotionLoop, bc.shouldMoveBucket); - IntCompactKernel.compact(bc.overflowLocations, bc.shouldMoveBucket); - - IntToLongCast.castInto(IntChunk.downcast(bc.overflowLocations), bc.overflowLocationsAsKeyIndices); - - // now fetch the overflow key values - fillOverflowKeys(bc.overflowContexts, bc.workingKeyChunks, bc.overflowLocationsAsKeyIndices); - // and their state values - overflowStateSource.fillChunkUnordered(bc.overflowStateSourceFillContext, bc.workingStateEntries, bc.overflowLocationsAsKeyIndices); - // and where their next pointer is - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocationsToMigrate, bc.overflowLocationsAsKeyIndices); - - // we'll have two sorted regions intermingled in the overflowLocationsToFetch, one of them is before the pivot, the other is after the pivot - // so that we can use our write through chunks, we first process the things before the pivot; then have a separate loop for those - // that go after - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - - for (int ii = 0; ii < bc.overflowLocationForPromotionLoop.size(); ++ii) { - final long tableLocation = bc.overflowLocationForPromotionLoop.get(ii); - if ((firstLoop && tableLocation < tableHashPivot) || (!firstLoop && tableLocation >= tableHashPivot)) { - if (tableLocation > lastBackingChunkLocation) { - if (bc.sourcePositions.size() > 0) { - // the permutes here are flushing the write through for the state and overflow locations - - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QByte\E - BytePermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, tableLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - // mixin allowUpdateWriteThroughState - updateWriteThroughState(bc.writeThroughState, firstBackingChunkLocation, lastBackingChunkLocation); - // endmixin allowUpdateWriteThroughState - updateWriteThroughOverflow(bc.writeThroughOverflowLocations, firstBackingChunkLocation, lastBackingChunkLocation); - } - bc.sourcePositions.add(ii); - bc.destinationLocationPositionInWriteThrough.add((int)(tableLocation - firstBackingChunkLocation)); - // region promotion move - final long overflowLocation = bc.overflowLocationsAsKeyIndices.get(ii); - leftRowSetSource.set(tableLocation, overflowLeftRowSetSource.get(overflowLocation)); - overflowLeftRowSetSource.set(overflowLocation, null); - - rightRowSetSource.set(tableLocation, overflowRightRowSetSource.get(overflowLocation)); - overflowRightRowSetSource.set(overflowLocation, null); - - final int cookie = overflowBuildCookieSource.getInt(overflowLocation); - addedSlots.set(cookie, tableLocation); - buildCookieSource.set(tableLocation, cookie); - overflowBuildCookieSource.set(overflowLocation, QueryConstants.NULL_INT); - // endregion promotion move - } - } - - // the permutes are completing the state and overflow promotions write through - // mixin allowUpdateWriteThroughState - // @StateChunkTypeEnum@ from \QByte\E - BytePermuteKernel.permute(bc.sourcePositions, bc.workingStateEntries, bc.destinationLocationPositionInWriteThrough, bc.writeThroughState); - // endmixin allowUpdateWriteThroughState - IntPermuteKernel.permute(bc.sourcePositions, bc.overflowLocationsToMigrate, bc.destinationLocationPositionInWriteThrough, bc.writeThroughOverflowLocations); - flushWriteThrough(bc.sourcePositions, bc.workingKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - // now mark these overflow locations as free, so that we can reuse them - freeOverflowLocations.ensureCapacity(freeOverflowCount + bc.overflowLocations.size()); - // by sorting them, they will be more likely to be in the same write through chunk when we pull them from the free list - bc.overflowLocations.sort(); - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - freeOverflowLocations.set(freeOverflowCount++, bc.overflowLocations.get(ii)); - } - nullOverflowObjectSources(bc.overflowLocations); - } - - tableHashPivot += bucketsToAdd; - // region rehash loop end - // endregion rehash loop end - } - // region rehash final - // endregion rehash final - } - - public boolean rehashRequired() { - return numEntries > (tableHashPivot * maximumLoadFactor) && tableHashPivot < MAX_TABLE_SIZE; - } - - /** - * This function can be stuck in for debugging if you are breaking the table to make sure each slot still corresponds - * to the correct location. - */ - @SuppressWarnings({"unused", "unchecked"}) - private void verifyKeyHashes() { - final int maxSize = tableHashPivot; - - final ChunkSource.FillContext [] keyFillContext = makeFillContexts(keySources, SharedContext.makeSharedContext(), maxSize); - final WritableChunk [] keyChunks = getWritableKeyChunks(maxSize); - - try (final WritableLongChunk positions = WritableLongChunk.makeWritableChunk(maxSize); - final WritableBooleanChunk exists = WritableBooleanChunk.makeWritableChunk(maxSize); - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(maxSize); - final WritableLongChunk tableLocationsChunk = WritableLongChunk.makeWritableChunk(maxSize); - final SafeCloseableArray ignored = new SafeCloseableArray<>(keyFillContext); - final SafeCloseableArray ignored2 = new SafeCloseableArray<>(keyChunks); - // @StateChunkName@ from \QByteChunk\E - final WritableByteChunk stateChunk = WritableByteChunk.makeWritableChunk(maxSize); - final ChunkSource.FillContext fillContext = stateSource.makeFillContext(maxSize)) { - - stateSource.fillChunk(fillContext, stateChunk, RowSetFactory.flat(tableHashPivot)); - - ChunkUtils.fillInOrder(positions); - - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(stateChunk, EMPTY_VALUE, exists); - - // crush down things that don't exist - LongCompactKernel.compact(positions, exists); - - // get the keys from the table - fillKeys(keyFillContext, keyChunks, positions); - hashKeyChunks(hashChunk, keyChunks); - convertHashToTableLocations(hashChunk, tableLocationsChunk, tableHashPivot); - - for (int ii = 0; ii < positions.size(); ++ii) { - if (tableLocationsChunk.get(ii) != positions.get(ii)) { - throw new IllegalStateException(); - } - } - } - } - - void setTargetLoadFactor(final double targetLoadFactor) { - this.targetLoadFactor = targetLoadFactor; - } - - void setMaximumLoadFactor(final double maximumLoadFactor) { - this.maximumLoadFactor = maximumLoadFactor; - } - - private void createOverflowPartitions(WritableLongChunk overflowLocationsToFetch, WritableLongChunk rehashLocations, WritableBooleanChunk shouldMoveBucket, int moves) { - int startWritePosition = 0; - int endWritePosition = moves; - for (int ii = 0; ii < shouldMoveBucket.size(); ++ii) { - if (shouldMoveBucket.get(ii)) { - final long oldHashLocation = rehashLocations.get(ii); - // this needs to be promoted, because we moved it - overflowLocationsToFetch.set(startWritePosition++, oldHashLocation); - } else { - // we didn't move anything into the destination slot; so we need to promote its overflow - final long newEmptyHashLocation = rehashLocations.get(ii) + (tableSize >> 1); - overflowLocationsToFetch.set(endWritePosition++, newEmptyHashLocation); - } - } - } - - private void setOverflowLocationsToNull(long start, int count) { - for (int ii = 0; ii < count; ++ii) { - overflowLocationSource.set(start + ii, QueryConstants.NULL_INT); - } - } - - private void initializeRehashLocations(WritableLongChunk rehashLocations, int bucketsToAdd) { - rehashLocations.setSize(bucketsToAdd); - for (int ii = 0; ii < bucketsToAdd; ++ii) { - rehashLocations.set(ii, tableHashPivot + ii - (tableSize >> 1)); - } - } - - private void compactOverflowLocations(IntChunk overflowLocations, WritableLongChunk overflowLocationsToFetch) { - overflowLocationsToFetch.setSize(0); - for (int ii = 0; ii < overflowLocations.size(); ++ii) { - final int overflowLocation = overflowLocations.get(ii); - if (overflowLocation != QueryConstants.NULL_INT) { - overflowLocationsToFetch.add(overflowLocation); - } - } - } - - private void swapOverflowPointers(LongChunk tableLocationsChunk, LongChunk overflowLocationsToFetch) { - for (int ii = 0; ii < overflowLocationsToFetch.size(); ++ii) { - final long newLocation = tableLocationsChunk.get(ii); - final int existingOverflow = overflowLocationSource.getUnsafe(newLocation); - final long overflowLocation = overflowLocationsToFetch.get(ii); - overflowOverflowLocationSource.set(overflowLocation, existingOverflow); - overflowLocationSource.set(newLocation, (int)overflowLocation); - } - } - - // mixin allowUpdateWriteThroughState - // @WritableStateChunkType@ from \QWritableByteChunk\E - private void updateWriteThroughState(ResettableWritableByteChunk writeThroughState, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = stateSource.resetWritableChunkToBackingStore(writeThroughState, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughState.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - // endmixin allowUpdateWriteThroughState - - private void updateWriteThroughOverflow(ResettableWritableIntChunk writeThroughOverflow, long firstPosition, long expectedLastPosition) { - final long firstBackingChunkPosition = overflowLocationSource.resetWritableChunkToBackingStore(writeThroughOverflow, firstPosition); - if (firstBackingChunkPosition != firstPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (firstBackingChunkPosition + writeThroughOverflow.size() - 1 != expectedLastPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - - // endmixin rehash - - private int allocateOverflowLocation() { - // mixin rehash - if (freeOverflowCount > 0) { - return freeOverflowLocations.getUnsafe(--freeOverflowCount); - } - // endmixin rehash - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - // mixin rehash - private void nullOverflowObjectSources(IntChunk locationsToNull) { - for (ObjectArraySource objectArraySource : overflowKeyColumnsToNull) { - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - objectArraySource.set(locationsToNull.get(ii), null); - } - } - // region nullOverflowObjectSources - for (int ii = 0; ii < locationsToNull.size(); ++ii) { - overflowLeftRowSetSource.set(locationsToNull.get(ii), null); - } - // endregion nullOverflowObjectSources - } - // endmixin rehash - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - - // region probe wrappers - @Override - public void probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources) { - if (leftRowSet.isEmpty()) { - return; - } - try (final ProbeContext pc = makeProbeContext(leftSources, leftRowSet.size())) { - decorationProbe(pc, leftRowSet, leftSources, true, null, null,null); - } - } - - @Override - public int probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources, LongArraySource slots, RowSetBuilderRandom foundBuilder) { - if (leftRowSet.isEmpty()) { - return 0; - } - try (final ProbeContext pc = makeProbeContext(leftSources, leftRowSet.size())) { - final MutableInt slotCount = new MutableInt(); - decorationProbe(pc, leftRowSet, leftSources, true, slots, slotCount, foundBuilder); - return slotCount.intValue(); - } - } - - @Override - public void probeRight(RowSequence rightRowSet, ColumnSource[] rightSources) { - if (rightRowSet.isEmpty()) { - return; - } - try (final ProbeContext pc = makeProbeContext(rightSources, rightRowSet.size())) { - decorationProbe(pc, rightRowSet, rightSources, false, null, null, null); - } - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableByteChunk\E - final WritableByteChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - - // the chunk of indices created from our RowSequence, used to write into the hash table - final WritableLongChunk keyIndices; - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - keyIndices = WritableLongChunk.makeWritableChunk(chunkSize); - // endregion probe context constructor - stateSourceFillContext = stateSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableByteChunk\E - workingStateEntries = WritableByteChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - keyIndices.close(); - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // region additional probe arguments - , final boolean isLeftSide - , final LongArraySource slots - , final MutableInt slotCount - , final RowSetBuilderRandom foundBuilder - // endregion additional probe arguments - ) { - // region probe start - if (slots != null) { - Assert.neqNull(slotCount, "slotCount"); - Assert.neqNull(foundBuilder, "foundBuilder"); - } else { - Assert.eqNull(slotCount, "slotCount"); - Assert.eqNull(foundBuilder, "foundBuilder"); - } - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - chunkOk.fillRowKeyChunk(pc.keyIndices); - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - stateSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QByteChunk\E - ByteChunkEquals.notEqual(pc.workingStateEntries, EMPTY_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - final long tableLocation = pc.tableLocationsChunk.get(ii); - final long indexKey = pc.keyIndices.get(ii); - if (isLeftSide) { - if (addLeftIndex(tableLocation, indexKey) && slots != null) { - slots.set(slotCount.intValue(), tableLocation); - slotCount.increment(); - foundBuilder.addKey(indexKey); - } - } else { - addRightIndex(tableLocation, indexKey); - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - final long indexKey = pc.keyIndices.get(chunkPosition); - if (isLeftSide) { - if (addLeftIndexOverflow(overflowLocation, indexKey) && slots != null) { - slots.set(slotCount.intValue(), overflowLocationToHashLocation(overflowLocation)); - slotCount.increment(); - foundBuilder.addKey(indexKey); - } - } else { - addRightIndexOverflow(overflowLocation, indexKey); - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - // mixin rehash - // NOTE that this mixin section is a bit ugly, we are spanning the two functions so that we can avoid using tableHashPivot and having the unused pivotPoint parameter - convertHashToTableLocations(hashChunk, tablePositionsChunk, tableHashPivot); - } - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk, int pivotPoint) { - // endmixin rehash - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - // mixin rehash - final int location = hashToTableLocation(pivotPoint, hash); - // endmixin rehash - // altmixin rehash: final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - // mixin rehash - int pivotPoint, - // endmixin rehash - int hash) { - // altmixin rehash: final \ - int location = hash & (tableSize - 1); - // mixin rehash - if (location >= pivotPoint) { - location -= (tableSize >> 1); - } - // endmixin rehash - return location; - } - - // region extraction functions - @Override - public int getTableSize() { - return tableSize; - } - - @Override - public int getOverflowSize() { - return nextOverflowLocation; - } - - /** - * When we get the left RowSet out of our source (after a build or probe); we do it by pulling a sequential builder - * and then calling build(). We also null out the value in the column source, thus freeing the builder's - * memory. - * - * This also results in clearing out the left hand side of the table between each probe phase for the - * left refreshing case. - * - * @param slot the slot in the table (either positive for a main slot, or negative for overflow) - * @return the RowSet for this slot - */ - @Override - public RowSet getLeftIndex(long slot) { - final RowSetBuilderSequential builder; - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - builder = overflowLeftRowSetSource.getUnsafe(overflowLocation); - overflowLeftRowSetSource.set(overflowLocation, null); - } else { - builder = leftRowSetSource.getUnsafe(slot); - leftRowSetSource.set(slot, null); - } - if (builder == null) { - return null; - } - return builder.build(); - } - - @Override - public void convertRightBuildersToIndex(LongArraySource slots, int slotCount) { - for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential)overflowRightRowSetSource.getUnsafe(overflowLocation); - if (sequentialBuilder != null) { - overflowRightRowSetSource.set(overflowLocation, sequentialBuilder.build()); - } - } else { - final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential)rightRowSetSource.getUnsafe(slot); - if (sequentialBuilder != null) { - rightRowSetSource.set(slot, sequentialBuilder.build()); - } - } - } - rightBuildersConverted = true; - } - - protected String extractKeyStringFromSourceTable(long leftKey) { - return super.extractKeyStringFromSourceTable(leftKey); - } - - @Override - public void convertRightGrouping(LongArraySource slots, int slotCount, ObjectArraySource rowSetSource) { - for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential)overflowRightRowSetSource.getUnsafe(overflowLocation); - if (sequentialBuilder != null) { - overflowRightRowSetSource.set(overflowLocation, getGroupedIndex(rowSetSource, sequentialBuilder)); - } - } else { - final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential)rightRowSetSource.getUnsafe(slot); - if (sequentialBuilder != null) { - rightRowSetSource.set(slot, getGroupedIndex(rowSetSource, sequentialBuilder)); - } - } - } - rightBuildersConverted = true; - } - - private RowSet getGroupedIndex(ObjectArraySource rowSetSource, RowSetBuilderSequential sequentialBuilder) { - final RowSet groupedRowSet = sequentialBuilder.build(); - if (groupedRowSet.size() != 1) { - throw new IllegalStateException("Grouped rowSet should have exactly one value: " + groupedRowSet); - } - return rowSetSource.getUnsafe(groupedRowSet.get(0)); - } - - @Override - public RowSet getRightIndex(long slot) { - if (rightBuildersConverted) { - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - return (RowSet)overflowRightRowSetSource.getUnsafe(overflowLocation); - } else { - return (RowSet)rightRowSetSource.getUnsafe(slot); - } - } - - final RowSetBuilderSequential builder; - if (isOverflowLocation(slot)) { - final long overflowLocation = hashLocationToOverflowLocation(slot); - builder = (RowSetBuilderSequential)overflowRightRowSetSource.getUnsafe(overflowLocation); - overflowRightRowSetSource.set(overflowLocation, null); - } else { - builder = (RowSetBuilderSequential)rightRowSetSource.getUnsafe(slot); - rightRowSetSource.set(slot, null); - } - if (builder == null) { - return null; - } - return builder.build(); - } - - String keyString(long slot) { - final WritableChunk[] keyChunk = getWritableKeyChunks(1); - final WritableLongChunk slotChunk = WritableLongChunk.makeWritableChunk(1); - if (isOverflowLocation(slot)) { - slotChunk.set(0, hashLocationToOverflowLocation(slot)); - final ColumnSource.FillContext[] contexts = makeFillContexts(overflowKeySources, null, 1); - try { - fillOverflowKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } else { - slotChunk.set(0, slot); - final ColumnSource.FillContext[] contexts = makeFillContexts(keySources, null, 1); - try { - fillKeys(contexts, keyChunk, slotChunk); - } finally { - for (Context c : contexts) { - c.close(); - } - } - } - try { - return ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, keyChunk, 0); - } finally { - closeArray(keyChunk); - slotChunk.close(); - } - } - - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - // endregion getStateValue - - // region overflowLocationToHashLocation - static boolean isOverflowLocation(long hashSlot) { - return hashSlot < OVERFLOW_PIVOT_VALUE; - } - - static long hashLocationToOverflowLocation(long hashSlot) { - return -hashSlot - 1 + OVERFLOW_PIVOT_VALUE; - } - - private static long overflowLocationToHashLocation(long overflowSlot) { - return OVERFLOW_PIVOT_VALUE - (1 + overflowSlot); - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedNaturalJoinStateManager.java deleted file mode 100644 index 557a3cb1273..00000000000 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedNaturalJoinStateManager.java +++ /dev/null @@ -1,1277 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.engine.table.impl; - -import io.deephaven.base.verify.Require; -import io.deephaven.base.verify.Assert; -import io.deephaven.chunk.*; -import io.deephaven.chunk.attributes.Any; -import io.deephaven.chunk.attributes.ChunkPositions; -import io.deephaven.chunk.attributes.HashCodes; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.*; -import io.deephaven.engine.table.*; -import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; -import io.deephaven.engine.rowset.chunkattributes.RowKeys; -import io.deephaven.util.QueryConstants; -import io.deephaven.chunk.util.hashing.*; -// this is ugly to have twice, but we do need it twice for replication -// @StateChunkIdentityName@ from \QLongChunk\E -import io.deephaven.chunk.util.hashing.LongChunkEquals; -import io.deephaven.engine.table.impl.sort.permute.PermuteKernel; -import io.deephaven.engine.table.impl.sort.timsort.LongIntTimsortKernel; -import io.deephaven.engine.table.impl.sources.*; -import io.deephaven.engine.table.impl.util.*; - - -import io.deephaven.util.SafeCloseableArray; -import org.jetbrains.annotations.NotNull; - -// region extra imports -import io.deephaven.util.SafeCloseableList; -import org.jetbrains.annotations.Nullable; -import io.deephaven.engine.table.impl.naturaljoin.StaticHashedNaturalJoinStateManager; -// endregion extra imports - -import static io.deephaven.util.SafeCloseable.closeArray; - -// region class visibility -// endregion class visibility -class StaticChunkedNaturalJoinStateManager - // region extensions - extends StaticHashedNaturalJoinStateManager - // endregion extensions -{ - // region constants - private static final int CHUNK_SIZE = 4096; - private static final int MINIMUM_INITIAL_HASH_SIZE = CHUNK_SIZE; - private static final long MAX_TABLE_SIZE = 1L << 30; - // endregion constants - - - // region preamble variables - // endregion preamble variables - - @HashTableAnnotations.EmptyStateValue - // @NullStateValue@ from \QQueryConstants.NULL_LONG\E, @StateValueType@ from \Qlong\E - private static final long EMPTY_RIGHT_VALUE = QueryConstants.NULL_LONG; - - // mixin getStateValue - // region overflow pivot - private static final long OVERFLOW_PIVOT_VALUE = DUPLICATE_RIGHT_VALUE; - // endregion overflow pivot - // endmixin getStateValue - - // the number of slots in our table - private final int tableSize; - - // how many key columns we have - private final int keyColumnCount; - - - // the keys for our hash entries - private final ArrayBackedColumnSource[] keySources; - // the location of any overflow entry in this bucket - private final IntegerArraySource overflowLocationSource = new IntegerArraySource(); - - // we are going to also reuse this for our state entry, so that we do not need additional storage - @HashTableAnnotations.StateColumnSource - // @StateColumnSourceType@ from \QLongArraySource\E - private final LongArraySource rightRowSetSource - // @StateColumnSourceConstructor@ from \QLongArraySource()\E - = new LongArraySource(); - - // the keys for overflow - private int nextOverflowLocation = 0; - private final ArrayBackedColumnSource [] overflowKeySources; - // the location of the next key in an overflow bucket - private final IntegerArraySource overflowOverflowLocationSource = new IntegerArraySource(); - // the overflow buckets for the state source - @HashTableAnnotations.OverflowStateColumnSource - // @StateColumnSourceType@ from \QLongArraySource\E - private final LongArraySource overflowRightRowSetSource - // @StateColumnSourceConstructor@ from \QLongArraySource()\E - = new LongArraySource(); - - // the type of each of our key chunks - private final ChunkType[] keyChunkTypes; - - // the operators for hashing and various equality methods - private final ChunkHasher[] chunkHashers; - private final ChunkEquals[] chunkEquals; - private final PermuteKernel[] chunkCopiers; - - - // region extra variables - // endregion extra variables - - // region constructor visibility - // endregion constructor visibility - StaticChunkedNaturalJoinStateManager(ColumnSource[] tableKeySources - , int tableSize - // region constructor arguments - , ColumnSource[] tableKeySourcesForErrors - // endregion constructor arguments - ) { - // region super - super(tableKeySourcesForErrors); - // endregion super - keyColumnCount = tableKeySources.length; - - this.tableSize = tableSize; - Require.leq(tableSize, "tableSize", MAX_TABLE_SIZE); - Require.gtZero(tableSize, "tableSize"); - Require.eq(Integer.bitCount(tableSize), "Integer.bitCount(tableSize)", 1); - - overflowKeySources = new ArrayBackedColumnSource[keyColumnCount]; - keySources = new ArrayBackedColumnSource[keyColumnCount]; - - keyChunkTypes = new ChunkType[keyColumnCount]; - chunkHashers = new ChunkHasher[keyColumnCount]; - chunkEquals = new ChunkEquals[keyColumnCount]; - chunkCopiers = new PermuteKernel[keyColumnCount]; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - // the sources that we will use to store our hash table - keySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(tableSize, tableKeySources[ii].getType()); - keyChunkTypes[ii] = tableKeySources[ii].getChunkType(); - - overflowKeySources[ii] = ArrayBackedColumnSource.getMemoryColumnSource(CHUNK_SIZE, tableKeySources[ii].getType()); - - chunkHashers[ii] = ChunkHasher.makeHasher(keyChunkTypes[ii]); - chunkEquals[ii] = ChunkEquals.makeEqual(keyChunkTypes[ii]); - chunkCopiers[ii] = PermuteKernel.makePermuteKernel(keyChunkTypes[ii]); - } - - - // region constructor - // endregion constructor - - ensureCapacity(tableSize); - } - - private void ensureCapacity(int tableSize) { - rightRowSetSource.ensureCapacity(tableSize); - overflowLocationSource.ensureCapacity(tableSize); - for (int ii = 0; ii < keyColumnCount; ++ii) { - keySources[ii].ensureCapacity(tableSize); - } - // region ensureCapacity - // endregion ensureCapacity - } - - private void ensureOverflowCapacity(WritableIntChunk chunkPositionsToInsertInOverflow) { - final int locationsToAllocate = chunkPositionsToInsertInOverflow.size(); - final int newCapacity = nextOverflowLocation + locationsToAllocate; - overflowOverflowLocationSource.ensureCapacity(newCapacity); - overflowRightRowSetSource.ensureCapacity(newCapacity); - //noinspection ForLoopReplaceableByForEach - for (int ii = 0; ii < overflowKeySources.length; ++ii) { - overflowKeySources[ii].ensureCapacity(newCapacity); - } - // region ensureOverflowCapacity - // endregion ensureOverflowCapacity - } - - // region build wrappers - @Override - public void buildFromLeftSide(final Table leftTable, ColumnSource[] leftSources, final LongArraySource leftHashSlots) { - if (leftTable.isEmpty()) { - return; - } - leftHashSlots.ensureCapacity(leftTable.size()); - try (final BuildContext bc = makeBuildContext(leftSources, leftTable.size())) { - buildTable(bc, leftTable.getRowSet(), leftSources, leftHashSlots); - } - } - - @Override - public void buildFromRightSide(final Table rightTable, ColumnSource [] rightSources) { - if (rightTable.isEmpty()) { - return; - } - try (final BuildContext bc = makeBuildContext(rightSources, rightTable.size())) { - buildTable(bc, rightTable.getRowSet(), rightSources, null); - } - } - // endregion build wrappers - - class BuildContext implements Context { - final int chunkSize; - - final LongIntTimsortKernel.LongIntSortKernelContext sortContext; - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - final ResettableWritableChunk[] writeThroughChunks = getResettableWritableKeyChunks(); - final WritableIntChunk sourcePositions; - final WritableIntChunk destinationLocationPositionInWriteThrough; - - final WritableBooleanChunk filledValues; - final WritableBooleanChunk equalValues; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working key chunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInSourceChunk; - - // the position with our hash table that we should insert a value into - final WritableLongChunk insertTableLocations; - // the position in our chunk, parallel to the workingChunkInsertTablePositions - final WritableIntChunk insertPositionsInSourceChunk; - - // we sometimes need to check two positions within a single chunk for equality, this contains those positions as pairs - final WritableIntChunk chunkPositionsToCheckForEquality; - // While processing overflow insertions, parallel to the chunkPositions to check for equality, the overflow location that - // is represented by the first of the pairs in chunkPositionsToCheckForEquality - final WritableLongChunk overflowLocationForEqualityCheck; - - // the chunk of state values that we read from the hash table - // @WritableStateChunkType@ from \QWritableLongChunk\E - final WritableLongChunk workingStateEntries; - - // the chunks for getting key values from the hash table - final WritableChunk[] workingKeyChunks; - final WritableChunk[] overflowKeyChunks; - - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - // which positions in the chunk we are inserting into the overflow - final WritableIntChunk chunkPositionsToInsertInOverflow; - // which table locations we are inserting into the overflow - final WritableLongChunk tableLocationsToInsertInOverflow; - - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - final SharedContext sharedBuildContext; - final ChunkSource.GetContext[] buildContexts; - - // region build context - // endregion build context - - final boolean haveSharedContexts; - - private BuildContext(ColumnSource[] buildSources, - int chunkSize - // region build context constructor args - // endregion build context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = buildSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedBuildContext = SharedContext.makeSharedContext(); - } else { - // no point in the additional work implied by these not being null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedBuildContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - buildContexts = makeGetContexts(buildSources, sharedBuildContext, chunkSize); - // region build context constructor - // endregion build context constructor - sortContext = LongIntTimsortKernel.createContext(chunkSize); - stateSourceFillContext = rightRowSetSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - sourcePositions = WritableIntChunk.makeWritableChunk(chunkSize); - destinationLocationPositionInWriteThrough = WritableIntChunk.makeWritableChunk(chunkSize); - filledValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - insertTableLocations = WritableLongChunk.makeWritableChunk(chunkSize); - insertPositionsInSourceChunk = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToCheckForEquality = WritableIntChunk.makeWritableChunk(chunkSize * 2); - overflowLocationForEqualityCheck = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableLongChunk\E - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - overflowKeyChunks = getWritableKeyChunks(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsToInsertInOverflow = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsToInsertInOverflow = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedBuildContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedBuildContext.close(); - } - - @Override - public void close() { - sortContext.close(); - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(buildContexts); - - hashChunk.close(); - tableLocationsChunk.close(); - closeArray(writeThroughChunks); - - sourcePositions.close(); - destinationLocationPositionInWriteThrough.close(); - filledValues.close(); - equalValues.close(); - overflowLocationsToFetch.close(); - overflowPositionInSourceChunk.close(); - insertTableLocations.close(); - insertPositionsInSourceChunk.close(); - chunkPositionsToCheckForEquality.close(); - overflowLocationForEqualityCheck.close(); - workingStateEntries.close(); - closeArray(workingKeyChunks); - closeArray(overflowKeyChunks); - chunkPositionsForFetches.close(); - chunkPositionsToInsertInOverflow.close(); - tableLocationsToInsertInOverflow.close(); - overflowLocations.close(); - // region build context close - // endregion build context close - closeSharedContexts(); - } - - } - - public BuildContext makeBuildContext(ColumnSource[] buildSources, - long maxSize - // region makeBuildContext args - // endregion makeBuildContext args - ) { - return new BuildContext(buildSources, (int)Math.min(CHUNK_SIZE, maxSize) - // region makeBuildContext arg pass - // endregion makeBuildContext arg pass - ); - } - - private void buildTable(final BuildContext bc, - final RowSequence buildIndex, - ColumnSource[] buildSources - // region extra build arguments - , final LongArraySource resultSource - // endregion extra build arguments - ) { - long hashSlotOffset = 0; - // region build start - final boolean isLeftSide = resultSource != null; - // endregion build start - - try (final RowSequence.Iterator rsIt = buildIndex.getRowSequenceIterator(); - // region build initialization try - // endregion build initialization try - ) { - // region build initialization - // the chunk of right indices that are parallel to the sourceChunks - final WritableLongChunk rightSourceIndexKeys; - - // the destination hash slots for each left-hand-side entry - final WritableLongChunk sourceChunkLeftHashSlots; - - if (isLeftSide) { - sourceChunkLeftHashSlots = WritableLongChunk.makeWritableChunk(bc.chunkSize); - rightSourceIndexKeys = null; - } - else { - sourceChunkLeftHashSlots = null; - rightSourceIndexKeys = WritableLongChunk.makeWritableChunk(bc.chunkSize); - } - // endregion build initialization - - // chunks to write through to the table key sources - - - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[buildSources.length]; - - while (rsIt.hasMore()) { - // we reset early to avoid carrying around state for old RowSequence which can't be reused. - bc.resetSharedContexts(); - - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(bc.chunkSize); - - getKeyChunks(buildSources, bc.buildContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(bc.hashChunk, sourceKeyChunks); - - // region build loop initialization - if (isLeftSide) { - sourceChunkLeftHashSlots.setSize(bc.hashChunk.size()); - } else { - chunkOk.fillRowKeyChunk(rightSourceIndexKeys); - } - // endregion build loop initialization - - // turn hash codes into indices within our table - convertHashToTableLocations(bc.hashChunk, bc.tableLocationsChunk); - - // now fetch the values from the table, note that we do not order these fetches - fillKeys(bc.workingFillContexts, bc.workingKeyChunks, bc.tableLocationsChunk); - - // and the corresponding states, if a value is null, we've found our insertion point - rightRowSetSource.fillChunkUnordered(bc.stateSourceFillContext, bc.workingStateEntries, bc.tableLocationsChunk); - - // find things that exist - // @StateChunkIdentityName@ from \QLongChunk\E - LongChunkEquals.notEqual(bc.workingStateEntries, EMPTY_RIGHT_VALUE, bc.filledValues); - - // to be equal, the location must exist; and each of the keyChunks must match - bc.equalValues.setSize(bc.filledValues.size()); - bc.equalValues.copyFromChunk(bc.filledValues, 0, 0, bc.filledValues.size()); - checkKeyEquality(bc.equalValues, bc.workingKeyChunks, sourceKeyChunks); - - bc.overflowPositionInSourceChunk.setSize(0); - bc.overflowLocationsToFetch.setSize(0); - bc.insertPositionsInSourceChunk.setSize(0); - bc.insertTableLocations.setSize(0); - - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final long tableLocation = bc.tableLocationsChunk.get(ii); - if (bc.equalValues.get(ii)) { - // region build found main - if (isLeftSide) { - // we know what hash slot this maps to - sourceChunkLeftHashSlots.set(ii, tableLocation); - } else { - rightRowSetSource.set(tableLocation, DUPLICATE_RIGHT_VALUE); - } - // endregion build found main - } else if (bc.filledValues.get(ii)) { - // we must handle this as part of the overflow bucket - bc.overflowPositionInSourceChunk.add(ii); - bc.overflowLocationsToFetch.add(tableLocation); - } else { - // for the values that are empty, we record them in the insert chunks - bc.insertPositionsInSourceChunk.add(ii); - bc.insertTableLocations.add(tableLocation); - } - } - - // we first sort by position; so that we'll not insert things into the table twice or overwrite - // collisions - LongIntTimsortKernel.sort(bc.sortContext, bc.insertPositionsInSourceChunk, bc.insertTableLocations); - - // the first and last valid table location in our writeThroughChunks - long firstBackingChunkLocation = -1; - long lastBackingChunkLocation = -1; - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - for (int ii = 0; ii < bc.insertPositionsInSourceChunk.size(); ) { - final int firstChunkPositionForHashLocation = bc.insertPositionsInSourceChunk.get(ii); - final long currentHashLocation = bc.insertTableLocations.get(ii); - - // region main insert - if (isLeftSide) { - rightRowSetSource.set(currentHashLocation, NO_RIGHT_ENTRY_VALUE); - sourceChunkLeftHashSlots.set(firstChunkPositionForHashLocation, currentHashLocation); - } else { - final long rightValue = rightSourceIndexKeys.get(firstChunkPositionForHashLocation); - rightRowSetSource.set(currentHashLocation, rightValue); - } - // endregion main insert - - if (currentHashLocation > lastBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, currentHashLocation, keySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - bc.sourcePositions.add(firstChunkPositionForHashLocation); - bc.destinationLocationPositionInWriteThrough.add((int)(currentHashLocation - firstBackingChunkLocation)); - - final int currentHashValue = bc.hashChunk.get(firstChunkPositionForHashLocation); - - while (++ii < bc.insertTableLocations.size() && bc.insertTableLocations.get(ii) == currentHashLocation) { - // if this thing is equal to the first one; we should mark the appropriate slot, we don't - // know the types and don't want to make the virtual calls, so we need to just accumulate - // the things to check for equality afterwards - final int chunkPosition = bc.insertPositionsInSourceChunk.get(ii); - if (bc.hashChunk.get(chunkPosition) != currentHashValue) { - // we must be an overflow - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(currentHashLocation); - } else { - // we need to check equality, equal things are the same slot; unequal things are overflow - bc.chunkPositionsToCheckForEquality.add(firstChunkPositionForHashLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - } - } - } - - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - // region build main duplicate - if (isLeftSide) { - // we match the first element, so should use it - sourceChunkLeftHashSlots.set(chunkPosition, tableLocation); - } else { - // we match the first element, so need to mark this key as a duplicate - rightRowSetSource.set(tableLocation, DUPLICATE_RIGHT_VALUE); - } - // endregion build main duplicate - } else { - // we are an overflow element - bc.overflowPositionInSourceChunk.add(chunkPosition); - bc.overflowLocationsToFetch.add(tableLocation); - } - } - - // now handle overflow - if (bc.overflowPositionInSourceChunk.size() > 0) { - // on the first pass we fill from the table's locations - overflowLocationSource.fillChunkUnordered(bc.overflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - bc.chunkPositionsToInsertInOverflow.setSize(0); - bc.tableLocationsToInsertInOverflow.setSize(0); - - // overflow slots now contains the positions in the overflow columns - - while (bc.overflowPositionInSourceChunk.size() > 0) { - // now we have the overflow slot for each of the things we are interested in. - // if the slot is null, then we can insert it and we are complete. - - bc.overflowLocationsToFetch.setSize(0); - bc.chunkPositionsForFetches.setSize(0); - - // TODO: Crunch it down - for (int ii = 0; ii < bc.overflowLocations.size(); ++ii) { - final int overflowLocation = bc.overflowLocations.get(ii); - final int chunkPosition = bc.overflowPositionInSourceChunk.get(ii); - if (overflowLocation == QueryConstants.NULL_INT) { - // insert me into overflow in the next free overflow slot - bc.chunkPositionsToInsertInOverflow.add(chunkPosition); - bc.tableLocationsToInsertInOverflow.add(bc.tableLocationsChunk.get(chunkPosition)); - } else { - // add to the key positions to fetch - bc.chunkPositionsForFetches.add(chunkPosition); - bc.overflowLocationsToFetch.add(overflowLocation); - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(bc.overflowContexts, bc.overflowKeyChunks, bc.overflowLocationsToFetch); - - // now compare the value in our overflowKeyChunk to the value in the sourceChunk - checkLhsPermutedEquality(bc.chunkPositionsForFetches, sourceKeyChunks, bc.overflowKeyChunks, bc.equalValues); - - int writePosition = 0; - for (int ii = 0; ii < bc.equalValues.size(); ++ii) { - final int chunkPosition = bc.chunkPositionsForFetches.get(ii); - final long overflowLocation = bc.overflowLocationsToFetch.get(ii); - if (bc.equalValues.get(ii)) { - // region build overflow found - if (isLeftSide) { - // if we are equal, then it's great and we know what our left-hand side slot is - // (represented as a negative number to indicate overflow) - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(overflowLocation)); - } else { - overflowRightRowSetSource.set(overflowLocation, DUPLICATE_RIGHT_VALUE); - } - // endregion build overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - bc.overflowLocationsToFetch.set(writePosition, overflowLocation); - bc.overflowPositionInSourceChunk.set(writePosition++, chunkPosition); - } - } - bc.overflowLocationsToFetch.setSize(writePosition); - bc.overflowPositionInSourceChunk.setSize(writePosition); - - // on subsequent iterations, we are following the overflow chains, so we fill from the overflowOverflowLocationSource - if (bc.overflowPositionInSourceChunk.size() > 0) { - overflowOverflowLocationSource.fillChunkUnordered(bc.overflowOverflowFillContext, bc.overflowLocations, bc.overflowLocationsToFetch); - } - } - - // make sure we actually have enough room to insert stuff where we would like - ensureOverflowCapacity(bc.chunkPositionsToInsertInOverflow); - - firstBackingChunkLocation = -1; - lastBackingChunkLocation = -1; - bc.destinationLocationPositionInWriteThrough.setSize(0); - bc.sourcePositions.setSize(0); - - // do the overflow insertions, one per table position at a time; until we have no insertions left - while (bc.chunkPositionsToInsertInOverflow.size() > 0) { - // sort by table position - LongIntTimsortKernel.sort(bc.sortContext, bc.chunkPositionsToInsertInOverflow, bc.tableLocationsToInsertInOverflow); - - bc.chunkPositionsToCheckForEquality.setSize(0); - bc.overflowLocationForEqualityCheck.setSize(0); - - for (int ii = 0; ii < bc.chunkPositionsToInsertInOverflow.size(); ) { - final long tableLocation = bc.tableLocationsToInsertInOverflow.get(ii); - final int chunkPosition = bc.chunkPositionsToInsertInOverflow.get(ii); - - final int allocatedOverflowLocation = allocateOverflowLocation(); - - // we are inserting into the head of the list, so we move the existing overflow into our overflow - overflowOverflowLocationSource.set(allocatedOverflowLocation, overflowLocationSource.getUnsafe(tableLocation)); - // and we point the overflow at our slot - overflowLocationSource.set(tableLocation, allocatedOverflowLocation); - - // region build overflow insert - final long rightValue; - if (isLeftSide) { - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(allocatedOverflowLocation)); - // we set the right RowSet to indicate it is empty, but exists - rightValue = NO_RIGHT_ENTRY_VALUE; - } else { - rightValue = rightSourceIndexKeys.get(chunkPosition); - } - overflowRightRowSetSource.set(allocatedOverflowLocation, rightValue); - // endregion build overflow insert - - - // get the backing chunk from the overflow keys - if (allocatedOverflowLocation > lastBackingChunkLocation || allocatedOverflowLocation < firstBackingChunkLocation) { - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - firstBackingChunkLocation = updateWriteThroughChunks(bc.writeThroughChunks, allocatedOverflowLocation, overflowKeySources); - lastBackingChunkLocation = firstBackingChunkLocation + bc.writeThroughChunks[0].size() - 1; - } - - // now we must set all of our key values in the overflow - bc.sourcePositions.add(chunkPosition); - bc.destinationLocationPositionInWriteThrough.add((int)(allocatedOverflowLocation - firstBackingChunkLocation)); - - while (++ii < bc.tableLocationsToInsertInOverflow.size() && bc.tableLocationsToInsertInOverflow.get(ii) == tableLocation) { - bc.overflowLocationForEqualityCheck.add(allocatedOverflowLocation); - bc.chunkPositionsToCheckForEquality.add(chunkPosition); - bc.chunkPositionsToCheckForEquality.add(bc.chunkPositionsToInsertInOverflow.get(ii)); - } - } - - // now we need to do the equality check; so that we can mark things appropriately - int remainingInserts = 0; - - checkPairEquality(bc.chunkPositionsToCheckForEquality, sourceKeyChunks, bc.equalValues); - for (int ii = 0; ii < bc.equalValues.size(); ii++) { - final int chunkPosition = bc.chunkPositionsToCheckForEquality.get(ii * 2 + 1); - final long tableLocation = bc.tableLocationsChunk.get(chunkPosition); - - if (bc.equalValues.get(ii)) { - final long insertedOverflowLocation = bc.overflowLocationForEqualityCheck.get(ii); - // region build overflow duplicate - // we match the first element, so should use the overflow slow we allocated for it - if (isLeftSide) { - sourceChunkLeftHashSlots.set(chunkPosition, overflowLocationToHashLocation(insertedOverflowLocation)); - } else { - overflowRightRowSetSource.set(insertedOverflowLocation, DUPLICATE_RIGHT_VALUE); - } - // endregion build overflow duplicate - } else { - // we need to try this element again in the next round - bc.chunkPositionsToInsertInOverflow.set(remainingInserts, chunkPosition); - bc.tableLocationsToInsertInOverflow.set(remainingInserts++, tableLocation); - } - } - - bc.chunkPositionsToInsertInOverflow.setSize(remainingInserts); - bc.tableLocationsToInsertInOverflow.setSize(remainingInserts); - } - flushWriteThrough(bc.sourcePositions, sourceKeyChunks, bc.destinationLocationPositionInWriteThrough, bc.writeThroughChunks); - } - - // region copy hash slots - if (isLeftSide) { - for (int ii = 0; ii < sourceChunkLeftHashSlots.size(); ++ii) { - resultSource.set(hashSlotOffset + ii, sourceChunkLeftHashSlots.get(ii)); - } - } - // endregion copy hash slots - hashSlotOffset += chunkOk.size(); - } - // region post build loop - if (isLeftSide) { - sourceChunkLeftHashSlots.close(); - } else { - rightSourceIndexKeys.close(); - } - // endregion post build loop - } - } - - - private int allocateOverflowLocation() { - return nextOverflowLocation++; - } - - private static long updateWriteThroughChunks(ResettableWritableChunk[] writeThroughChunks, long currentHashLocation, ArrayBackedColumnSource[] sources) { - final long firstBackingChunkPosition = sources[0].resetWritableChunkToBackingStore(writeThroughChunks[0], currentHashLocation); - for (int jj = 1; jj < sources.length; ++jj) { - if (sources[jj].resetWritableChunkToBackingStore(writeThroughChunks[jj], currentHashLocation) != firstBackingChunkPosition) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - if (writeThroughChunks[jj].size() != writeThroughChunks[0].size()) { - throw new IllegalStateException("ArrayBackedColumnSources have different block sizes!"); - } - } - return firstBackingChunkPosition; - } - - private void flushWriteThrough(WritableIntChunk sourcePositions, Chunk[] sourceKeyChunks, WritableIntChunk destinationLocationPositionInWriteThrough, WritableChunk[] writeThroughChunks) { - if (sourcePositions.size() < 0) { - return; - } - for (int jj = 0; jj < keySources.length; ++jj) { - chunkCopiers[jj].permute(sourcePositions, sourceKeyChunks[jj], destinationLocationPositionInWriteThrough, writeThroughChunks[jj]); - } - sourcePositions.setSize(0); - destinationLocationPositionInWriteThrough.setSize(0); - } - - - private void checkKeyEquality(WritableBooleanChunk equalValues, WritableChunk[] workingKeyChunks, Chunk[] sourceKeyChunks) { - for (int ii = 0; ii < sourceKeyChunks.length; ++ii) { - chunkEquals[ii].andEqual(workingKeyChunks[ii], sourceKeyChunks[ii], equalValues); - } - } - - private void checkLhsPermutedEquality(WritableIntChunk chunkPositionsForFetches, Chunk[] sourceKeyChunks, WritableChunk[] overflowKeyChunks, WritableBooleanChunk equalValues) { - chunkEquals[0].equalLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[0], overflowKeyChunks[0], equalValues); - for (int ii = 1; ii < overflowKeySources.length; ++ii) { - chunkEquals[ii].andEqualLhsPermuted(chunkPositionsForFetches, sourceKeyChunks[ii], overflowKeyChunks[ii], equalValues); - } - } - - private void checkPairEquality(WritableIntChunk chunkPositionsToCheckForEquality, Chunk[] sourceKeyChunks, WritableBooleanChunk equalPairs) { - chunkEquals[0].equalPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[0], equalPairs); - for (int ii = 1; ii < keyColumnCount; ++ii) { - chunkEquals[ii].andEqualPairs(chunkPositionsToCheckForEquality, sourceKeyChunks[ii], equalPairs); - } - } - - private void fillKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk tableLocationsChunk) { - fillKeys(keySources, fillContexts, keyChunks, tableLocationsChunk); - } - - private void fillOverflowKeys(ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk overflowLocationsChunk) { - fillKeys(overflowKeySources, fillContexts, keyChunks, overflowLocationsChunk); - } - - private static void fillKeys(ArrayBackedColumnSource[] keySources, ColumnSource.FillContext[] fillContexts, WritableChunk[] keyChunks, WritableLongChunk keyIndices) { - for (int ii = 0; ii < keySources.length; ++ii) { - keySources[ii].fillChunkUnordered(fillContexts[ii], keyChunks[ii], keyIndices); - } - } - - private void hashKeyChunks(WritableIntChunk hashChunk, Chunk[] sourceKeyChunks) { - chunkHashers[0].hashInitial(sourceKeyChunks[0], hashChunk); - for (int ii = 1; ii < sourceKeyChunks.length; ++ii) { - chunkHashers[ii].hashUpdate(sourceKeyChunks[ii], hashChunk); - } - } - - private void getKeyChunks(ColumnSource[] sources, ColumnSource.GetContext[] contexts, Chunk[] chunks, RowSequence rowSequence) { - for (int ii = 0; ii < chunks.length; ++ii) { - chunks[ii] = sources[ii].getChunk(contexts[ii], rowSequence); - } - } - - - // region probe wrappers - public void decorateWithRightSide(Table rightTable, ColumnSource [] rightSources) { - if (rightTable.isEmpty()) { - return; - } - try (final ProbeContext pc = makeProbeContext(rightSources, rightTable.size(), false)) { - decorationProbe(pc, rightTable.getRowSet(), rightSources, null); - } - } - - @Override - public void decorateLeftSide(RowSet leftRowSet, ColumnSource [] leftSources, final LongArraySource leftRedirections) { - if (leftRowSet.isEmpty()) { - return; - } - leftRedirections.ensureCapacity(leftRowSet.size()); - try (final ProbeContext pc = makeProbeContext(leftSources, leftRowSet.size(), true)) { - decorationProbe(pc, leftRowSet, leftSources, leftRedirections); - } - } - // endregion probe wrappers - - // mixin decorationProbe - class ProbeContext implements Context { - final int chunkSize; - - final ColumnSource.FillContext stateSourceFillContext; - final ColumnSource.FillContext overflowFillContext; - final ColumnSource.FillContext overflowOverflowFillContext; - - final SharedContext sharedFillContext; - final ColumnSource.FillContext[] workingFillContexts; - final SharedContext sharedOverflowContext; - final ColumnSource.FillContext[] overflowContexts; - - // the chunk of hashcodes - final WritableIntChunk hashChunk; - // the chunk of positions within our table - final WritableLongChunk tableLocationsChunk; - - // the chunk of right indices that we read from the hash table, the empty right index is used as a sentinel that the - // state exists; otherwise when building from the left it is always null - // @WritableStateChunkType@ from \QWritableLongChunk\E - final WritableLongChunk workingStateEntries; - - // the overflow locations that we need to get from the overflowLocationSource (or overflowOverflowLocationSource) - final WritableLongChunk overflowLocationsToFetch; - // the overflow position in the working keychunks, parallel to the overflowLocationsToFetch - final WritableIntChunk overflowPositionInWorkingChunk; - // values we have read from the overflow locations sources - final WritableIntChunk overflowLocations; - // when fetching from the overflow, we record which chunk position we are fetching for - final WritableIntChunk chunkPositionsForFetches; - - final WritableBooleanChunk equalValues; - final WritableChunk[] workingKeyChunks; - - final SharedContext sharedProbeContext; - // the contexts for filling from our key columns - final ChunkSource.GetContext[] probeContexts; - - // region probe context - final ColumnSource.FillContext overflowStateFillContext; - // endregion probe context - final boolean haveSharedContexts; - - private ProbeContext(ColumnSource[] probeSources, - int chunkSize - // region probe context constructor args - , boolean isLeftSide - // endregion probe context constructor args - ) { - Assert.gtZero(chunkSize, "chunkSize"); - this.chunkSize = chunkSize; - haveSharedContexts = probeSources.length > 1; - if (haveSharedContexts) { - sharedFillContext = SharedContext.makeSharedContext(); - sharedOverflowContext = SharedContext.makeSharedContext(); - sharedProbeContext = SharedContext.makeSharedContext(); - } else { - // No point in the additional work implied by these being non null. - sharedFillContext = null; - sharedOverflowContext = null; - sharedProbeContext = null; - } - workingFillContexts = makeFillContexts(keySources, sharedFillContext, chunkSize); - overflowContexts = makeFillContexts(overflowKeySources, sharedOverflowContext, chunkSize); - probeContexts = makeGetContexts(probeSources, sharedProbeContext, chunkSize); - // region probe context constructor - if (isLeftSide) { - overflowStateFillContext = overflowRightRowSetSource.makeFillContext(chunkSize); - } else { - overflowStateFillContext = null; - } - // endregion probe context constructor - stateSourceFillContext = rightRowSetSource.makeFillContext(chunkSize); - overflowFillContext = overflowLocationSource.makeFillContext(chunkSize); - overflowOverflowFillContext = overflowOverflowLocationSource.makeFillContext(chunkSize); - hashChunk = WritableIntChunk.makeWritableChunk(chunkSize); - tableLocationsChunk = WritableLongChunk.makeWritableChunk(chunkSize); - // @WritableStateChunkName@ from \QWritableLongChunk\E - workingStateEntries = WritableLongChunk.makeWritableChunk(chunkSize); - overflowLocationsToFetch = WritableLongChunk.makeWritableChunk(chunkSize); - overflowPositionInWorkingChunk = WritableIntChunk.makeWritableChunk(chunkSize); - overflowLocations = WritableIntChunk.makeWritableChunk(chunkSize); - chunkPositionsForFetches = WritableIntChunk.makeWritableChunk(chunkSize); - equalValues = WritableBooleanChunk.makeWritableChunk(chunkSize); - workingKeyChunks = getWritableKeyChunks(chunkSize); - } - - private void resetSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.reset(); - sharedOverflowContext.reset(); - sharedProbeContext.reset(); - } - - private void closeSharedContexts() { - if (!haveSharedContexts) { - return; - } - sharedFillContext.close(); - sharedOverflowContext.close(); - sharedProbeContext.close(); - } - - @Override - public void close() { - stateSourceFillContext.close(); - overflowFillContext.close(); - overflowOverflowFillContext.close(); - closeArray(workingFillContexts); - closeArray(overflowContexts); - closeArray(probeContexts); - hashChunk.close(); - tableLocationsChunk.close(); - workingStateEntries.close(); - overflowLocationsToFetch.close(); - overflowPositionInWorkingChunk.close(); - overflowLocations.close(); - chunkPositionsForFetches.close(); - equalValues.close(); - closeArray(workingKeyChunks); - closeSharedContexts(); - // region probe context close - if (overflowStateFillContext != null) { - overflowStateFillContext.close(); - } - // endregion probe context close - closeSharedContexts(); - } - } - - public ProbeContext makeProbeContext(ColumnSource[] probeSources, - long maxSize - // region makeProbeContext args - , boolean isLeftSide - // endregion makeProbeContext args - ) { - return new ProbeContext(probeSources, (int)Math.min(maxSize, CHUNK_SIZE) - // region makeProbeContext arg pass - , isLeftSide - // endregion makeProbeContext arg pass - ); - } - - private void decorationProbe(ProbeContext pc - , RowSequence probeIndex - , final ColumnSource[] probeSources - // region additional probe arguments - , @Nullable final LongArraySource leftRedirections - // endregion additional probe arguments - ) { - // region probe start - final boolean isLeftSide = leftRedirections != null; - // endregion probe start - long hashSlotOffset = 0; - - try (final RowSequence.Iterator rsIt = probeIndex.getRowSequenceIterator(); - // region probe additional try resources - final SafeCloseableList chunksToClose = new SafeCloseableList(); - // endregion probe additional try resources - ) { - //noinspection unchecked - final Chunk [] sourceKeyChunks = new Chunk[keyColumnCount]; - - // region probe initialization - - // the chunk of right indices created from our RowSequence, used to write into the hash table - final WritableLongChunk rightKeyIndices; - // the destination hash slots for each left-hand-side entry - final WritableLongChunk workingLeftRedirections; - if (isLeftSide) { - workingLeftRedirections = WritableLongChunk.makeWritableChunk(pc.chunkSize); - chunksToClose.add(workingLeftRedirections); - rightKeyIndices = null; - } else { - rightKeyIndices = WritableLongChunk.makeWritableChunk(pc.chunkSize); - chunksToClose.add(rightKeyIndices); - workingLeftRedirections = null; - } - - // endregion probe initialization - - while (rsIt.hasMore()) { - // we reset shared contexts early to avoid carrying around state that can't be reused. - pc.resetSharedContexts(); - final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(pc.chunkSize); - final int chunkSize = chunkOk.intSize(); - - // region probe loop initialization - if (isLeftSide) { - workingLeftRedirections.fillWithValue(0, chunkSize, RowSequence.NULL_ROW_KEY); - workingLeftRedirections.setSize(chunkSize); - } else { - chunkOk.fillRowKeyChunk(rightKeyIndices); - } - // endregion probe loop initialization - - // get our keys, hash them, and convert them to table locations - getKeyChunks(probeSources, pc.probeContexts, sourceKeyChunks, chunkOk); - hashKeyChunks(pc.hashChunk, sourceKeyChunks); - convertHashToTableLocations(pc.hashChunk, pc.tableLocationsChunk); - - // get the keys from the table - fillKeys(pc.workingFillContexts, pc.workingKeyChunks, pc.tableLocationsChunk); - - // and the corresponding states - // - if a value is empty; we don't care about it - // - otherwise we check for equality; if we are equal, we have found our thing to set - // (or to complain if we are already set) - // - if we are not equal, then we are an overflow block - rightRowSetSource.fillChunkUnordered(pc.stateSourceFillContext, pc.workingStateEntries, pc.tableLocationsChunk); - - // @StateChunkIdentityName@ from \QLongChunk\E - LongChunkEquals.notEqual(pc.workingStateEntries, EMPTY_RIGHT_VALUE, pc.equalValues); - checkKeyEquality(pc.equalValues, pc.workingKeyChunks, sourceKeyChunks); - - pc.overflowPositionInWorkingChunk.setSize(0); - pc.overflowLocationsToFetch.setSize(0); - - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - if (pc.equalValues.get(ii)) { - // region probe main found - if (isLeftSide) { - workingLeftRedirections.set(ii, pc.workingStateEntries.get(ii)); - } else { - // this is the correct slot, we need to ensure that we have not already written a RHS to the slot - - // I don't love this individual access approach; but we don't otherwise know if we are going - // to be writing to the thing twice. We could alternatively sort these. - if (rightRowSetSource.getLong(pc.tableLocationsChunk.get(ii)) != NO_RIGHT_ENTRY_VALUE) { - throw new IllegalStateException("Natural Join found duplicate right key for " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, ii)); - } - - // we know that there is no right hand side, so we should set it to our value! - rightRowSetSource.set(pc.tableLocationsChunk.get(ii), rightKeyIndices.get(ii)); - } - // endregion probe main found - } else if (pc.workingStateEntries.get(ii) != EMPTY_RIGHT_VALUE) { - // we must handle this as part of the overflow bucket - pc.overflowPositionInWorkingChunk.add(ii); - pc.overflowLocationsToFetch.add(pc.tableLocationsChunk.get(ii)); - } else { - // region probe main not found - // endregion probe main not found - } - } - - overflowLocationSource.fillChunkUnordered(pc.overflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - - while (pc.overflowLocationsToFetch.size() > 0) { - pc.overflowLocationsToFetch.setSize(0); - pc.chunkPositionsForFetches.setSize(0); - for (int ii = 0; ii < pc.overflowLocations.size(); ++ii) { - final int overflowLocation = pc.overflowLocations.get(ii); - final int chunkPosition = pc.overflowPositionInWorkingChunk.get(ii); - - // if the overflow slot is null, this state is not responsive to the join so we can ignore it - if (overflowLocation != QueryConstants.NULL_INT) { - pc.overflowLocationsToFetch.add(overflowLocation); - pc.chunkPositionsForFetches.add(chunkPosition); - } else { - // region probe overflow not found - // endregion probe overflow not found - } - } - - // if the slot is non-null, then we need to fetch the overflow values for comparison - fillOverflowKeys(pc.overflowContexts, pc.workingKeyChunks, pc.overflowLocationsToFetch); - - // region probe overflow state source fill - if (isLeftSide) { - // It would be possible to filter for equality before looking up the answers, but we are - // optimistic that we should find things in the overflow and there will not be overly long - // chains. - overflowRightRowSetSource.fillChunkUnordered(pc.overflowStateFillContext, pc.workingStateEntries, pc.overflowLocationsToFetch); - } - // endregion probe overflow state source fill - - // now compare the value in our workingKeyChunks to the value in the sourceChunk - checkLhsPermutedEquality(pc.chunkPositionsForFetches, sourceKeyChunks, pc.workingKeyChunks, pc.equalValues); - - // we write back into the overflowLocationsToFetch, so we can't set its size to zero. Instead - // we overwrite the elements in the front of the chunk referenced by a position cursor - int overflowPosition = 0; - for (int ii = 0; ii < pc.equalValues.size(); ++ii) { - final long overflowLocation = pc.overflowLocationsToFetch.get(ii); - final int chunkPosition = pc.chunkPositionsForFetches.get(ii); - - if (pc.equalValues.get(ii)) { - // region probe overflow found - if (isLeftSide) { - workingLeftRedirections.set(pc.chunkPositionsForFetches.get(ii), pc.workingStateEntries.get(ii)); - } else { - // if we are equal, then it's great and we can set our right hand side value - final long rightValue = rightKeyIndices.get(pc.chunkPositionsForFetches.get(ii)); - final long existingRightValue = overflowRightRowSetSource.getLong(overflowLocation); - if (existingRightValue != NO_RIGHT_ENTRY_VALUE) { - throw new IllegalStateException("Natural Join found duplicate right key for " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, pc.chunkPositionsForFetches.get(ii))); - } - overflowRightRowSetSource.set(overflowLocation, rightValue); - } - // endregion probe overflow found - } else { - // otherwise, we need to repeat the overflow calculation, with our next overflow fetch - pc.overflowLocationsToFetch.set(overflowPosition, overflowLocation); - pc.overflowPositionInWorkingChunk.set(overflowPosition, chunkPosition); - overflowPosition++; - } - } - pc.overflowLocationsToFetch.setSize(overflowPosition); - pc.overflowPositionInWorkingChunk.setSize(overflowPosition); - - overflowOverflowLocationSource.fillChunkUnordered(pc.overflowOverflowFillContext, pc.overflowLocations, pc.overflowLocationsToFetch); - } - - // region probe complete - if (isLeftSide) { - for (int ii = 0; ii < workingLeftRedirections.size(); ++ii) { - final long leftRedirection = workingLeftRedirections.get(ii); - if (leftRedirection == DUPLICATE_RIGHT_VALUE) { - throw new IllegalStateException("Natural Join found duplicate right key for " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, sourceKeyChunks, ii)); - } - leftRedirections.set(hashSlotOffset + ii, leftRedirection); - } - } - // endregion probe complete - hashSlotOffset += chunkSize; - } - - // region probe cleanup - // endregion probe cleanup - } - // region probe final - // endregion probe final - } - // endmixin decorationProbe - - private void convertHashToTableLocations(WritableIntChunk hashChunk, WritableLongChunk tablePositionsChunk) { - - // turn hash codes into indices within our table - for (int ii = 0; ii < hashChunk.size(); ++ii) { - final int hash = hashChunk.get(ii); - final int location = hashToTableLocation(hash); - tablePositionsChunk.set(ii, location); - } - tablePositionsChunk.setSize(hashChunk.size()); - } - - private int hashToTableLocation( - int hash) { - final int location = hash & (tableSize - 1); - return location; - } - - // region extraction functions - @Override - public WritableRowRedirection buildRowRedirectionFromHashSlot(QueryTable leftTable, boolean exactMatch, LongArraySource leftHashSlots, JoinControl.RedirectionType redirectionType) { - return buildRowRedirection(leftTable, exactMatch, position -> getStateValue(leftHashSlots, position), redirectionType); - } - - @Override - public WritableRowRedirection buildRowRedirectionFromRedirections(QueryTable leftTable, boolean exactMatch, LongArraySource leftRedirections, JoinControl.RedirectionType redirectionType) { - return buildRowRedirection(leftTable, exactMatch, leftRedirections::getLong, redirectionType); - } - - public WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable, boolean exactMatch, long groupingSize, LongArraySource leftHashSlots, ArrayBackedColumnSource leftIndices, JoinControl.RedirectionType redirectionType) { - return buildGroupedRowRedirection(leftTable, exactMatch, groupingSize, (long ii) -> getStateValue(leftHashSlots, ii), leftIndices, redirectionType); - } - // endregion extraction functions - - @NotNull - private static ColumnSource.FillContext[] makeFillContexts(ColumnSource[] keySources, final SharedContext sharedContext, int chunkSize) { - final ColumnSource.FillContext[] workingFillContexts = new ColumnSource.FillContext[keySources.length]; - for (int ii = 0; ii < keySources.length; ++ii) { - workingFillContexts[ii] = keySources[ii].makeFillContext(chunkSize, sharedContext); - } - return workingFillContexts; - } - - private static ColumnSource.GetContext[] makeGetContexts(ColumnSource [] sources, final SharedContext sharedState, int chunkSize) { - final ColumnSource.GetContext[] contexts = new ColumnSource.GetContext[sources.length]; - for (int ii = 0; ii < sources.length; ++ii) { - contexts[ii] = sources[ii].makeGetContext(chunkSize, sharedState); - } - return contexts; - } - - @NotNull - private WritableChunk[] getWritableKeyChunks(int chunkSize) { - //noinspection unchecked - final WritableChunk[] workingKeyChunks = new WritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeWritableChunk(chunkSize); - } - return workingKeyChunks; - } - - @NotNull - private ResettableWritableChunk[] getResettableWritableKeyChunks() { - //noinspection unchecked - final ResettableWritableChunk[] workingKeyChunks = new ResettableWritableChunk[keyChunkTypes.length]; - for (int ii = 0; ii < keyChunkTypes.length; ++ii) { - workingKeyChunks[ii] = keyChunkTypes[ii].makeResettableWritableChunk(); - } - return workingKeyChunks; - } - - // region getStateValue - private long getStateValue(LongArraySource hashSlots, long locationInHashSlots) { - final long hashSlot = hashSlots.getLong(locationInHashSlots); - if (isOverflowLocation(hashSlot)) { - return overflowRightRowSetSource.getLong(hashLocationToOverflowLocation(hashSlot)); - } - else { - return rightRowSetSource.getLong(hashSlot); - } - } - // endregion getStateValue - - // region overflowLocationToHashLocation - static boolean isOverflowLocation(long hashSlot) { - return hashSlot < OVERFLOW_PIVOT_VALUE; - } - - static long hashLocationToOverflowLocation(long hashSlot) { - return -hashSlot - 1 + OVERFLOW_PIVOT_VALUE; - } - - private static long overflowLocationToHashLocation(long overflowSlot) { - return OVERFLOW_PIVOT_VALUE - (1 + overflowSlot); - } - // endregion overflowLocationToHashLocation - - - static int hashTableSize(long initialCapacity) { - return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); - } - -} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticNaturalJoinStateManager.java index 73d78667744..74c378830f5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticNaturalJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/StaticNaturalJoinStateManager.java @@ -16,7 +16,6 @@ import java.util.stream.Collectors; public abstract class StaticNaturalJoinStateManager { - static final int CHUNK_SIZE = 4096; public static final long DUPLICATE_RIGHT_VALUE = -2; public static final long NO_RIGHT_ENTRY_VALUE = RowSequence.NULL_ROW_KEY; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java index 40928010c00..7c17212444d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java @@ -1599,96 +1599,6 @@ private ResettableWritableChunk[] getResettableWritableKeyChunks() { // region overflowLocationToHashLocation // endregion overflowLocationToHashLocation - // mixin dumpTable - @SuppressWarnings("unused") - private void dumpTable() { - dumpTable(true, true); - } - - @SuppressWarnings("SameParameterValue") - private void dumpTable(boolean showBadMain, boolean showBadOverflow) { - //noinspection unchecked - final WritableChunk [] dumpChunks = new WritableChunk[keyColumnCount]; - //noinspection unchecked - final WritableChunk [] overflowDumpChunks = new WritableChunk[keyColumnCount]; - // @WritableStateChunkType@ from \QWritableIntChunk\E, @WritableStateChunkName@ from \QWritableIntChunk\E - final WritableIntChunk stateChunk = WritableIntChunk.makeWritableChunk(tableSize); - final WritableIntChunk overflowLocationChunk = WritableIntChunk.makeWritableChunk(tableSize); - // @WritableStateChunkType@ from \QWritableIntChunk\E, @WritableStateChunkName@ from \QWritableIntChunk\E - final WritableIntChunk overflowStateChunk = WritableIntChunk.makeWritableChunk(nextOverflowLocation); - final WritableIntChunk overflowOverflowLocationChunk = WritableIntChunk.makeWritableChunk(nextOverflowLocation); - - final WritableIntChunk hashChunk = WritableIntChunk.makeWritableChunk(tableSize); - final WritableIntChunk overflowHashChunk = WritableIntChunk.makeWritableChunk(nextOverflowLocation); - - - final RowSequence tableLocations = RowSetFactory.fromRange(0, tableSize - 1); - final RowSequence overflowLocations = nextOverflowLocation > 0 ? RowSetFactory.fromRange(0, nextOverflowLocation - 1) : RowSequenceFactory.EMPTY; - - for (int ii = 0; ii < keyColumnCount; ++ii) { - dumpChunks[ii] = keyChunkTypes[ii].makeWritableChunk(tableSize); - overflowDumpChunks[ii] = keyChunkTypes[ii].makeWritableChunk(nextOverflowLocation); - - try (final ColumnSource.FillContext fillContext = keySources[ii].makeFillContext(tableSize)) { - keySources[ii].fillChunk(fillContext, dumpChunks[ii], tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowKeySources[ii].makeFillContext(nextOverflowLocation)) { - overflowKeySources[ii].fillChunk(fillContext, overflowDumpChunks[ii], overflowLocations); - } - - if (ii == 0) { - chunkHashers[ii].hashInitial(dumpChunks[ii], hashChunk); - chunkHashers[ii].hashInitial(overflowDumpChunks[ii], overflowHashChunk); - } else { - chunkHashers[ii].hashUpdate(dumpChunks[ii], hashChunk); - chunkHashers[ii].hashUpdate(overflowDumpChunks[ii], overflowHashChunk); - } - } - - try (final ColumnSource.FillContext fillContext = uniqueIdentifierSource.makeFillContext(tableSize)) { - uniqueIdentifierSource.fillChunk(fillContext, stateChunk, tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowLocationSource.makeFillContext(tableSize)) { - overflowLocationSource.fillChunk(fillContext, overflowLocationChunk, tableLocations); - } - try (final ColumnSource.FillContext fillContext = overflowOverflowLocationSource.makeFillContext(nextOverflowLocation)) { - overflowOverflowLocationSource.fillChunk(fillContext, overflowOverflowLocationChunk, overflowLocations); - } - try (final ColumnSource.FillContext fillContext = overflowUniqueIdentifierSource.makeFillContext(nextOverflowLocation)) { - overflowUniqueIdentifierSource.fillChunk(fillContext, overflowStateChunk, overflowLocations); - } - - for (int ii = 0; ii < tableSize; ++ii) { - System.out.print("Bucket[" + ii + "] "); - // @StateValueType@ from \Qint\E - final int stateValue = stateChunk.get(ii); - int overflowLocation = overflowLocationChunk.get(ii); - - if (stateValue == EMPTY_SYMBOL_VALUE) { - System.out.println(""); - } else { - final int hashCode = hashChunk.get(ii); - System.out.println(ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, dumpChunks, ii) + " (hash=" + hashCode + ") = " + stateValue); - final int expectedPosition = hashToTableLocation(tableHashPivot, hashCode); - if (showBadMain && expectedPosition != ii) { - System.out.println("***** BAD HASH POSITION **** (computed " + expectedPosition + ")"); - } - } - - while (overflowLocation != QueryConstants.NULL_INT) { - // @StateValueType@ from \Qint\E - final int overflowStateValue = overflowStateChunk.get(overflowLocation); - final int overflowHashCode = overflowHashChunk.get(overflowLocation); - System.out.println("\tOF[" + overflowLocation + "] " + ChunkUtils.extractKeyStringFromChunks(keyChunkTypes, overflowDumpChunks, overflowLocation) + " (hash=" + overflowHashCode + ") = " + overflowStateValue); - final int expectedPosition = hashToTableLocation(tableHashPivot, overflowHashCode); - if (showBadOverflow && expectedPosition != ii) { - System.out.println("***** BAD HASH POSITION FOR OVERFLOW **** (computed " + expectedPosition + ")"); - } - overflowLocation = overflowOverflowLocationChunk.get(overflowLocation); - } - } - } - // endmixin dumpTable static int hashTableSize(long initialCapacity) { return (int)Math.max(MINIMUM_INITIAL_HASH_SIZE, Math.min(MAX_TABLE_SIZE, Long.highestOneBit(initialCapacity) * 2)); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/BucketedChunkedAjMergedListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/BucketedChunkedAjMergedListener.java similarity index 98% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/join/BucketedChunkedAjMergedListener.java rename to engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/BucketedChunkedAjMergedListener.java index bdfb1cac0fe..776a796295f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/BucketedChunkedAjMergedListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/BucketedChunkedAjMergedListener.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.impl.join; +package io.deephaven.engine.table.impl.asofjoin; import io.deephaven.base.verify.Assert; import io.deephaven.chunk.attributes.Any; @@ -14,10 +14,10 @@ import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.*; import io.deephaven.chunk.util.hashing.ChunkEquals; -import io.deephaven.engine.table.impl.asofjoin.RightIncrementalHashedAsOfJoinStateManager; +import io.deephaven.engine.table.impl.join.JoinListenerRecorder; import io.deephaven.engine.table.impl.sort.LongSortKernel; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.chunk.*; import io.deephaven.chunk.sized.SizedChunk; @@ -35,7 +35,7 @@ import java.util.Arrays; import java.util.Collections; -import static io.deephaven.engine.table.impl.RightIncrementalChunkedAsOfJoinStateManager.*; +import static io.deephaven.engine.table.impl.asofjoin.RightIncrementalHashedAsOfJoinStateManager.*; public class BucketedChunkedAjMergedListener extends MergedListener { private final JoinListenerRecorder leftRecorder; @@ -76,7 +76,7 @@ public class BucketedChunkedAjMergedListener extends MergedListener { private final ObjectArraySource sequentialBuilders = new ObjectArraySource<>(RowSetBuilderSequential.class); - private final LongArraySource slots = new LongArraySource(); + private final IntegerArraySource slots = new IntegerArraySource(); public BucketedChunkedAjMergedListener(JoinListenerRecorder leftRecorder, JoinListenerRecorder rightRecorder, @@ -188,7 +188,7 @@ public void process() { final MutableObject leftIndexOutput = new MutableObject<>(); for (int slotIndex = 0; slotIndex < removedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final RowSet leftRemoved = indexFromBuilder(slotIndex); leftRemoved.forAllRowKeys(rowRedirection::removeVoid); @@ -245,7 +245,7 @@ public void process() { for (int slotIndex = 0; slotIndex < shiftedSlotCount; ++slotIndex) { final RowSet shiftedRowSet = indexFromBuilder(slotIndex); - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final byte state = asOfJoinStateManager.getState(slot); final RowSetShiftData shiftDataForSlot = leftShifted.intersect(shiftedRowSet); @@ -319,7 +319,7 @@ public void process() { final WritableLongChunk rightStampKeys = WritableLongChunk.makeWritableChunk(rightChunkSize)) { for (int slotIndex = 0; slotIndex < removedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); try (final RowSet rightRemoved = indexFromBuilder(slotIndex)) { final SegmentedSortedArray rightSsa = @@ -378,7 +378,7 @@ public void process() { for (int slotIndex = 0; slotIndex < shiftedSlotCount; ++slotIndex) { final RowSet shiftedRowSet = indexFromBuilder(slotIndex); - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final byte state = asOfJoinStateManager.getState(slot); final SegmentedSortedArray leftSsa; @@ -464,7 +464,7 @@ public void process() { final WritableBooleanChunk retainStamps = WritableBooleanChunk.makeWritableChunk(rightChunkSize)) { for (int slotIndex = 0; slotIndex < addedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final RowSet rightAdded = indexFromBuilder(slotIndex); @@ -578,7 +578,7 @@ public void process() { final WritableLongChunk rightStampIndices = WritableLongChunk.makeWritableChunk(rightChunkSize)) { for (int slotIndex = 0; slotIndex < modifiedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final RowSet rightModified = indexFromBuilder(slotIndex); @@ -633,7 +633,7 @@ public void process() { slots, sequentialBuilders); for (int slotIndex = 0; slotIndex < addedSlotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); boolean makeLeftIndex = false; boolean updateLeftIndex = false; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/ChunkedAjUtils.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ChunkedAjUtils.java similarity index 98% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/join/ChunkedAjUtils.java rename to engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ChunkedAjUtils.java index d3a08a2cda8..91963fad48b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/ChunkedAjUtils.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ChunkedAjUtils.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.impl.join; +package io.deephaven.engine.table.impl.asofjoin; import io.deephaven.engine.table.impl.SortingOrder; import io.deephaven.engine.table.impl.QueryTable; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java index e7912328591..7357366c231 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalAsOfJoinStateManagerTypedBase.java @@ -13,7 +13,7 @@ import io.deephaven.engine.table.WritableColumnSource; import io.deephaven.engine.table.impl.by.alternatingcolumnsource.AlternatingColumnSource; import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -29,14 +29,16 @@ import java.util.function.Function; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; +import static io.deephaven.engine.table.impl.JoinControl.MAX_TABLE_SIZE; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; public abstract class RightIncrementalAsOfJoinStateManagerTypedBase extends RightIncrementalHashedAsOfJoinStateManager { - public static final int CHUNK_SIZE = 4096; - private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size public static final byte ENTRY_EMPTY_STATE = QueryConstants.NULL_BYTE; + private static final int ALTERNATE_SWITCH_MASK = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + private static final int ALTERNATE_INNER_MASK = (int) AlternatingColumnSource.ALTERNATE_INNER_MASK; // the number of slots in our table protected int tableSize; @@ -76,7 +78,7 @@ public abstract class RightIncrementalAsOfJoinStateManagerTypedBase extends Righ // the mask for insertion into the main table (this is used so that we can identify whether a slot belongs to the // main or alternate table) protected int mainInsertMask = 0; - protected int alternateInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + protected int alternateInsertMask = ALTERNATE_SWITCH_MASK; /** * Each slot in the hash table has a 'cookie', which we reset by incrementing the cookie generation. The cookie @@ -93,15 +95,15 @@ protected void resetCookie() { nextCookie = 0; } - protected long getCookieMain(long slot) { + protected long getCookieMain(int slot) { return getCookie(mainCookieSource, slot); } - protected long getCookieAlternate(long slot) { + protected long getCookieAlternate(int slot) { return getCookie(alternateCookieSource, slot); } - protected long getCookie(ImmutableLongArraySource cookieSource, long slot) { + protected long getCookie(ImmutableLongArraySource cookieSource, int slot) { long cookie = cookieSource.getUnsafe(slot); if (cookie == QueryConstants.NULL_LONG || cookie < cookieGeneration) { cookieSource.set(slot, cookie = cookieGeneration + nextCookie); @@ -110,18 +112,18 @@ protected long getCookie(ImmutableLongArraySource cookieSource, long slot) { return cookie - cookieGeneration; } - protected long makeCookieMain(long slot) { + protected long makeCookieMain(int slot) { return makeCookie(mainCookieSource, slot); } - protected long makeCookie(ImmutableLongArraySource cookieSource, long slot) { + protected long makeCookie(ImmutableLongArraySource cookieSource, int slot) { long cookie = cookieGeneration + nextCookie; cookieSource.set(slot, cookie); nextCookie++; return cookie - cookieGeneration; } - protected void migrateCookie(long cookie, long destinationLocation, LongArraySource hashSlots) { + protected void migrateCookie(long cookie, int destinationLocation, IntegerArraySource hashSlots) { if (cookie >= cookieGeneration && cookie - cookieGeneration < nextCookie) { hashSlots.set(cookie, destinationLocation | mainInsertMask); mainCookieSource.set(destinationLocation, cookie); @@ -258,7 +260,7 @@ protected void buildTable( final BuildContext bc, final RowSequence buildRows, final ColumnSource[] buildSources, - final LongArraySource hashSlots, + final IntegerArraySource hashSlots, final TypedHasherUtil.BuildHandler buildHandler) { try (final RowSequence.Iterator rsIt = buildRows.getRowSequenceIterator()) { // noinspection unchecked @@ -281,15 +283,15 @@ protected void buildTable( } private class LeftBuildHandler implements TypedHasherUtil.BuildHandler { - final LongArraySource hashSlots; + final IntegerArraySource hashSlots; final ObjectArraySource sequentialBuilders; - private LeftBuildHandler(final LongArraySource hashSlots) { + private LeftBuildHandler(final IntegerArraySource hashSlots) { this.hashSlots = hashSlots; this.sequentialBuilders = null; } - private LeftBuildHandler(final LongArraySource hashSlots, + private LeftBuildHandler(final IntegerArraySource hashSlots, final ObjectArraySource sequentialBuilders) { this.hashSlots = hashSlots; this.sequentialBuilders = sequentialBuilders; @@ -303,15 +305,15 @@ public void doBuild(RowSequence chunkOk, Chunk[] sourceKeyChunks) { } private class RightBuildHandler implements TypedHasherUtil.BuildHandler { - final LongArraySource hashSlots; + final IntegerArraySource hashSlots; final ObjectArraySource sequentialBuilders; - private RightBuildHandler(final LongArraySource hashSlots) { + private RightBuildHandler(final IntegerArraySource hashSlots) { this.hashSlots = hashSlots; this.sequentialBuilders = null; } - private RightBuildHandler(final LongArraySource hashSlots, + private RightBuildHandler(final IntegerArraySource hashSlots, final ObjectArraySource sequentialBuilders) { this.hashSlots = hashSlots; this.sequentialBuilders = sequentialBuilders; @@ -326,7 +328,7 @@ public void doBuild(RowSequence chunkOk, Chunk[] sourceKeyChunks) { @Override public int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, - @NotNull final LongArraySource addedSlots) { + @NotNull final IntegerArraySource addedSlots) { if (leftRowSet.isEmpty()) { return 0; } @@ -339,7 +341,7 @@ public int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSourc @Override public int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, - @NotNull final LongArraySource addedSlots, int usedSlots) { + @NotNull final IntegerArraySource addedSlots, int usedSlots) { if (rightRowSet.isEmpty()) { return usedSlots; } @@ -351,24 +353,24 @@ public int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSo } @Override - public int markForRemoval(RowSet restampRemovals, ColumnSource[] sources, LongArraySource slots, + public int markForRemoval(RowSet restampRemovals, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders) { return accumulateIndices(restampRemovals, sources, slots, sequentialBuilders, true); } @Override - public int probeAdditions(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, + public int probeAdditions(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders) { return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, false); } @Override - public int gatherShiftIndex(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, + public int gatherShiftIndex(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders) { return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, true); } - public int gatherModifications(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, + public int gatherModifications(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders) { return accumulateIndices(restampAdditions, sources, slots, sequentialBuilders, false); } @@ -400,7 +402,7 @@ protected void probeTable( } private class RightProbeHandler implements TypedHasherUtil.ProbeHandler { - final LongArraySource hashSlots; + final IntegerArraySource hashSlots; final ObjectArraySource sequentialBuilders; private RightProbeHandler() { @@ -408,7 +410,7 @@ private RightProbeHandler() { this.sequentialBuilders = null; } - private RightProbeHandler(final LongArraySource hashSlots, + private RightProbeHandler(final IntegerArraySource hashSlots, final ObjectArraySource sequentialBuilders) { this.hashSlots = hashSlots; this.sequentialBuilders = sequentialBuilders; @@ -430,7 +432,7 @@ public void probeRightInitial(RowSequence rightIndex, ColumnSource[] rightSou } } - private int accumulateIndices(RowSet rowSet, ColumnSource[] sources, LongArraySource slots, + private int accumulateIndices(RowSet rowSet, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders, boolean usePrev) { resetCookie(); @@ -446,8 +448,8 @@ private int accumulateIndices(RowSet rowSet, ColumnSource[] sources, LongArra } @Override - public int buildAdditions(boolean isLeftSide, RowSet additions, ColumnSource[] sources, LongArraySource slots, - ObjectArraySource sequentialBuilders) { + public int buildAdditions(boolean isLeftSide, RowSet additions, ColumnSource[] sources, + IntegerArraySource slots, ObjectArraySource sequentialBuilders) { resetCookie(); @@ -471,12 +473,7 @@ public int getTableSize() { } @Override - public int getOverflowSize() { - return 0; - } - - @Override - public WritableRowSet getAndClearLeftIndex(long slot) { + public WritableRowSet getAndClearLeftIndex(int slot) { final RowSetBuilderSequential builder = (RowSetBuilderSequential) leftRowSetSource.getUnsafe(slot); leftRowSetSource.set(slot, null); if (builder == null) { @@ -486,24 +483,24 @@ public WritableRowSet getAndClearLeftIndex(long slot) { } @Override - public byte getState(long slot) { + public byte getState(int slot) { final ImmutableByteArraySource source; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; } else { source = alternateStateSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; return source.getUnsafe(slot); } @Override - public SegmentedSortedArray getRightSsa(long slot) { + public SegmentedSortedArray getRightSsa(int slot) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = rightRowSetSource; } else { @@ -511,7 +508,7 @@ public SegmentedSortedArray getRightSsa(long slot) { rowSetSource = alternateRightRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_SSA) { @@ -521,10 +518,10 @@ public SegmentedSortedArray getRightSsa(long slot) { } @Override - public SegmentedSortedArray getRightSsa(long slot, Function ssaFactory) { + public SegmentedSortedArray getRightSsa(int slot, Function ssaFactory) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = rightRowSetSource; } else { @@ -532,7 +529,7 @@ public SegmentedSortedArray getRightSsa(long slot, Function rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = rightRowSetSource; } else { @@ -563,7 +560,7 @@ public WritableRowSet getRightIndex(long slot) { rowSetSource = alternateRightRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_INDEX) { @@ -578,10 +575,10 @@ public WritableRowSet getRightIndex(long slot) { } @Override - public WritableRowSet getLeftIndex(long slot) { + public WritableRowSet getLeftIndex(int slot) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = leftRowSetSource; } else { @@ -589,7 +586,7 @@ public WritableRowSet getLeftIndex(long slot) { rowSetSource = alternateLeftRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_INDEX) { @@ -604,10 +601,10 @@ public WritableRowSet getLeftIndex(long slot) { } @Override - public void setLeftIndex(long slot, RowSet rowSet) { + public void setLeftIndex(int slot, RowSet rowSet) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = leftRowSetSource; } else { @@ -615,7 +612,7 @@ public void setLeftIndex(long slot, RowSet rowSet) { rowSetSource = alternateLeftRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_EMPTY) { @@ -627,10 +624,10 @@ public void setLeftIndex(long slot, RowSet rowSet) { } @Override - public void setRightIndex(long slot, RowSet rowSet) { + public void setRightIndex(int slot, RowSet rowSet) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = rightRowSetSource; } else { @@ -638,7 +635,7 @@ public void setRightIndex(long slot, RowSet rowSet) { rowSetSource = alternateRightRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_RIGHT_MASK) == ENTRY_RIGHT_IS_EMPTY) { @@ -650,10 +647,10 @@ public void setRightIndex(long slot, RowSet rowSet) { } @Override - public SegmentedSortedArray getLeftSsa(long slot) { + public SegmentedSortedArray getLeftSsa(int slot) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = leftRowSetSource; } else { @@ -661,7 +658,7 @@ public SegmentedSortedArray getLeftSsa(long slot) { rowSetSource = alternateLeftRowSetSource; } // clear the mask bits - slot = slot & AlternatingColumnSource.ALTERNATE_INNER_MASK; + slot = slot & ALTERNATE_INNER_MASK; final byte entryType = source.getUnsafe(slot); if ((entryType & ENTRY_LEFT_MASK) == ENTRY_LEFT_IS_SSA) { @@ -671,10 +668,10 @@ public SegmentedSortedArray getLeftSsa(long slot) { } @Override - public SegmentedSortedArray getLeftSsa(long slot, Function ssaFactory) { + public SegmentedSortedArray getLeftSsa(int slot, Function ssaFactory) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = leftRowSetSource; } else { @@ -682,7 +679,7 @@ public SegmentedSortedArray getLeftSsa(long slot, Function indexOutput) { + public SegmentedSortedArray getLeftSsaOrIndex(int slot, MutableObject indexOutput) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = leftRowSetSource; } else { @@ -713,7 +710,7 @@ public SegmentedSortedArray getLeftSsaOrIndex(long slot, MutableObject indexOutput) { + public SegmentedSortedArray getRightSsaOrIndex(int slot, MutableObject indexOutput) { final ImmutableByteArraySource source; final ImmutableObjectArraySource rowSetSource; - if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { + if ((slot & ALTERNATE_SWITCH_MASK) == mainInsertMask) { source = stateSource; rowSetSource = rightRowSetSource; } else { @@ -733,7 +730,7 @@ public SegmentedSortedArray getRightSsaOrIndex(long slot, MutableObject } @Nullable - private SegmentedSortedArray makeSsaFromBuilder(long slot, Function ssaFactory, + private SegmentedSortedArray makeSsaFromBuilder(int slot, Function ssaFactory, ImmutableObjectArraySource ssaSource, ImmutableByteArraySource stateSource, byte newState) { final RowSetBuilderSequential builder = (RowSetBuilderSequential) ssaSource.getUnsafe(slot); final RowSet rowSet; @@ -784,18 +781,18 @@ private SegmentedSortedArray makeSsaFromBuilder(long slot, Function ssaFactory, + private SegmentedSortedArray makeSsaFromEmpty(int slot, Function ssaFactory, ImmutableObjectArraySource ssaSource, ImmutableByteArraySource stateSource, byte newState) { return makeSsaFromIndex(slot, ssaFactory, ssaSource, stateSource, newState, RowSetFactory.empty()); } @Nullable - private SegmentedSortedArray makeSsaFromIndex(long slot, Function ssaFactory, + private SegmentedSortedArray makeSsaFromIndex(int slot, Function ssaFactory, ImmutableObjectArraySource ssaSource, ImmutableByteArraySource stateSource, byte newState) { return makeSsaFromIndex(slot, ssaFactory, ssaSource, stateSource, newState, (RowSet) ssaSource.getUnsafe(slot)); } - private SegmentedSortedArray makeSsaFromIndex(long slot, Function ssaFactory, + private SegmentedSortedArray makeSsaFromIndex(int slot, Function ssaFactory, ImmutableObjectArraySource ssaSource, ImmutableByteArraySource stateSource, byte newState, RowSet rowSet) { stateSource.set(slot, newState); @@ -823,11 +820,11 @@ protected void newAlternate() { mainCookieSource.ensureCapacity(tableSize); if (mainInsertMask == 0) { - mainInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + mainInsertMask = ALTERNATE_SWITCH_MASK; alternateInsertMask = 0; } else { mainInsertMask = 0; - alternateInsertMask = (int) AlternatingColumnSource.ALTERNATE_SWITCH_MASK; + alternateInsertMask = ALTERNATE_SWITCH_MASK; } } @@ -845,7 +842,7 @@ protected void clearAlternate() { * @return true if a front migration is required */ public boolean doRehash(boolean fullRehash, MutableInt rehashCredits, int nextChunkSize, - LongArraySource hashSlots) { + IntegerArraySource hashSlots) { if (rehashPointer > 0) { final int requiredRehash = nextChunkSize - rehashCredits.intValue(); if (requiredRehash <= 0) { @@ -920,17 +917,17 @@ protected int hashToTableLocationAlternate(int hash) { } abstract protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - final LongArraySource hashSlots, final ObjectArraySource sequentialBuilders); + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders); abstract protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - final LongArraySource hashSlots, final ObjectArraySource sequentialBuilders); + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders); abstract protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - final LongArraySource hashSlots, final ObjectArraySource sequentialBuilders); + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders); - abstract protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots); + abstract protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots); - abstract protected void migrateFront(LongArraySource hashSlots); + abstract protected void migrateFront(IntegerArraySource hashSlots); - abstract protected void rehashInternalFull(final int oldSize); + abstract protected void rehashInternalFull(int oldSize); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalHashedAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalHashedAsOfJoinStateManager.java index 48940d60bb2..ba368c1f9d3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalHashedAsOfJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/RightIncrementalHashedAsOfJoinStateManager.java @@ -5,23 +5,13 @@ import io.deephaven.engine.rowset.*; import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.table.impl.JoinControl; -import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.RightIncrementalAsOfJoinStateManager; -import io.deephaven.engine.table.impl.StaticAsOfJoinStateManager; import io.deephaven.engine.table.impl.sources.*; import io.deephaven.engine.table.impl.ssa.SegmentedSortedArray; -import io.deephaven.engine.table.impl.util.ContiguousWritableRowRedirection; -import io.deephaven.engine.table.impl.util.LongColumnSourceWritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirection; -import io.deephaven.engine.table.impl.util.WritableRowRedirectionLockFree; -import io.deephaven.util.QueryConstants; import org.apache.commons.lang3.mutable.MutableObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.function.Function; -import java.util.function.LongUnaryOperator; public abstract class RightIncrementalHashedAsOfJoinStateManager extends RightIncrementalAsOfJoinStateManager { protected RightIncrementalHashedAsOfJoinStateManager(ColumnSource[] keySourcesForErrorMessages) { @@ -40,9 +30,6 @@ protected RightIncrementalHashedAsOfJoinStateManager(ColumnSource[] keySource public static final byte ENTRY_LEFT_IS_SSA = 0x20; public static final byte ENTRY_LEFT_IS_INDEX = 0x30; - public static final byte ENTRY_INITIAL_STATE_LEFT = ENTRY_LEFT_IS_BUILDER|ENTRY_RIGHT_IS_EMPTY; - public static final byte ENTRY_INITIAL_STATE_RIGHT = ENTRY_LEFT_IS_EMPTY|ENTRY_RIGHT_IS_BUILDER; - protected void addToSequentialBuilder(long slot, @NotNull ObjectArraySource sequentialBuilders, long indexKey) { RowSetBuilderSequential builder = sequentialBuilders.getUnsafe(slot); if (builder == null) { @@ -60,35 +47,34 @@ protected byte getRightEntryType(byte entryType) { return (byte)(entryType & ENTRY_RIGHT_MASK); } - public abstract int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull final LongArraySource addedSlots); - public abstract int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, @NotNull final LongArraySource addedSlots, int usedSlots); + public abstract int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull IntegerArraySource addedSlots); + public abstract int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, @NotNull IntegerArraySource addedSlots, int usedSlots); public abstract void probeRightInitial(RowSequence rightIndex, ColumnSource[] rightSources); - public abstract int probeAdditions(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders); - public abstract int buildAdditions(boolean isLeftSide, RowSet additions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders); + public abstract int probeAdditions(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders); + public abstract int buildAdditions(boolean isLeftSide, RowSet additions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders); - public abstract SegmentedSortedArray getRightSsa(long slot); - public abstract SegmentedSortedArray getRightSsa(long slot, Function ssaFactory); - public abstract SegmentedSortedArray getLeftSsa(long slot); - public abstract SegmentedSortedArray getLeftSsa(long slot, Function ssaFactory); + public abstract SegmentedSortedArray getRightSsa(int slot); + public abstract SegmentedSortedArray getRightSsa(int slot, Function ssaFactory); + public abstract SegmentedSortedArray getLeftSsa(int slot); + public abstract SegmentedSortedArray getLeftSsa(int slot, Function ssaFactory); - public abstract SegmentedSortedArray getLeftSsaOrIndex(long slot, MutableObject indexOutput); - public abstract SegmentedSortedArray getRightSsaOrIndex(long slot, MutableObject indexOutput); - public abstract void setRightIndex(long slot, RowSet rowSet); - public abstract void setLeftIndex(long slot, RowSet rowSet); - public abstract WritableRowSet getLeftIndex(long slot); - public abstract WritableRowSet getRightIndex(long slot); + public abstract SegmentedSortedArray getLeftSsaOrIndex(int slot, MutableObject indexOutput); + public abstract SegmentedSortedArray getRightSsaOrIndex(int slot, MutableObject indexOutput); + public abstract void setRightIndex(int slot, RowSet rowSet); + public abstract void setLeftIndex(int slot, RowSet rowSet); + public abstract WritableRowSet getLeftIndex(int slot); + public abstract WritableRowSet getRightIndex(int slot); - public abstract WritableRowSet getAndClearLeftIndex(long slot); + public abstract WritableRowSet getAndClearLeftIndex(int slot); - public abstract int markForRemoval(RowSet restampRemovals, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders); + public abstract int markForRemoval(RowSet restampRemovals, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders); - public abstract int gatherShiftIndex(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders); + public abstract int gatherShiftIndex(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders); - public abstract int gatherModifications(RowSet restampAdditions, ColumnSource[] sources, LongArraySource slots, ObjectArraySource sequentialBuilders); + public abstract int gatherModifications(RowSet restampAdditions, ColumnSource[] sources, IntegerArraySource slots, ObjectArraySource sequentialBuilders); - public abstract byte getState(long slot); + public abstract byte getState(int slot); public abstract int getTableSize(); - public abstract int getOverflowSize(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java index e5344edd2c7..4ad93dbf0e6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticAsOfJoinStateManagerTypedBase.java @@ -10,22 +10,23 @@ import io.deephaven.engine.rowset.*; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.WritableColumnSource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; import io.deephaven.engine.table.impl.util.TypedHasherUtil; import io.deephaven.engine.table.impl.util.TypedHasherUtil.BuildOrProbeContext.BuildContext; import io.deephaven.engine.table.impl.util.TypedHasherUtil.BuildOrProbeContext.ProbeContext; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.NotNull; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; +import static io.deephaven.engine.table.impl.JoinControl.MAX_TABLE_SIZE; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; public abstract class StaticAsOfJoinStateManagerTypedBase extends StaticHashedAsOfJoinStateManager { - public static final int CHUNK_SIZE = 4096; - private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size + public static final Object EMPTY_RIGHT_STATE = null; // the number of slots in our table @@ -100,7 +101,7 @@ ProbeContext makeProbeContext(ColumnSource[] buildSources, long maxSize) { return new ProbeContext(buildSources, (int) Math.min(CHUNK_SIZE, maxSize)); } - static boolean addIndex(ImmutableObjectArraySource source, long location, long keyToAdd) { + static boolean addIndex(ImmutableObjectArraySource source, int location, long keyToAdd) { boolean addedSlot = false; RowSetBuilderSequential builder = source.getUnsafe(location); if (builder == null) { @@ -114,11 +115,11 @@ static boolean addIndex(ImmutableObjectArraySource sour /** * Returns true if this is the first left row key added to this slot. */ - protected boolean addLeftIndex(long tableLocation, long keyToAdd) { + protected boolean addLeftIndex(int tableLocation, long keyToAdd) { return addIndex(leftRowSetSource, tableLocation, keyToAdd); } - protected void addRightIndex(long tableLocation, long keyToAdd) { + protected void addRightIndex(int tableLocation, long keyToAdd) { // noinspection unchecked addIndex((ImmutableObjectArraySource) rightRowSetSource, tableLocation, keyToAdd); } @@ -160,10 +161,10 @@ public void doBuild(RowSequence chunkOk, Chunk[] sourceKeyChunks) { } } - private int fillSlotsFromHashTable(@NotNull final LongArraySource slotArray) { + private int fillSlotsFromHashTable(@NotNull final IntegerArraySource slotArray) { slotArray.ensureCapacity(tableSize); long slotCount = 0; - for (long slotIdx = 0; slotIdx < tableSize; slotIdx++) { + for (int slotIdx = 0; slotIdx < tableSize; slotIdx++) { if (rightRowSetSource.get(slotIdx) != EMPTY_RIGHT_STATE) { slotArray.set(slotCount++, slotIdx); } @@ -173,7 +174,7 @@ private int fillSlotsFromHashTable(@NotNull final LongArraySource slotArray) { @Override public int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, - @NotNull final LongArraySource addedSlots) { + @NotNull final IntegerArraySource addedSlots) { if (leftRowSet.isEmpty()) { return 0; } @@ -185,7 +186,7 @@ public int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSourc @Override public int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, - @NotNull final LongArraySource addedSlots) { + @NotNull final IntegerArraySource addedSlots) { if (rightRowSet.isEmpty()) { return 0; } @@ -222,8 +223,8 @@ protected void probeTable( } private class LeftProbeHandler implements TypedHasherUtil.ProbeHandler { - final LongArraySource hashSlots; - final MutableInt hashOffset; + final IntegerArraySource hashSlots; + final MutableLong hashOffset; final RowSetBuilderRandom foundBuilder; private LeftProbeHandler() { @@ -232,7 +233,7 @@ private LeftProbeHandler() { this.foundBuilder = null; } - private LeftProbeHandler(final LongArraySource hashSlots, final MutableInt hashOffset, + private LeftProbeHandler(final IntegerArraySource hashSlots, final MutableLong hashOffset, RowSetBuilderRandom foundBuilder) { this.hashSlots = hashSlots; this.hashOffset = hashOffset; @@ -263,13 +264,13 @@ public void probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources) { } @Override - public int probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull final LongArraySource slots, + public int probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull final IntegerArraySource slots, RowSetBuilderRandom foundBuilder) { if (leftRowSet.isEmpty()) { return 0; } try (final ProbeContext pc = makeProbeContext(leftSources, leftRowSet.size())) { - final MutableInt slotCount = new MutableInt(); + final MutableLong slotCount = new MutableLong(); probeTable(pc, leftRowSet, false, leftSources, new LeftProbeHandler(slots, slotCount, foundBuilder)); return slotCount.intValue(); } @@ -290,11 +291,6 @@ public int getTableSize() { return tableSize; } - @Override - public int getOverflowSize() { - return 0; - } - /** * When we get the left RowSet out of our source (after a build or probe); we do it by pulling a sequential builder * and then calling build(). We also null out the value in the column source, thus freeing the builder's memory. @@ -306,7 +302,7 @@ public int getOverflowSize() { * @return the RowSet for this slot */ @Override - public RowSet getLeftIndex(long slot) { + public RowSet getLeftIndex(int slot) { RowSetBuilderSequential builder = (RowSetBuilderSequential) leftRowSetSource.getAndSetUnsafe(slot, null); if (builder == null) { return null; @@ -315,7 +311,7 @@ public RowSet getLeftIndex(long slot) { } @Override - public RowSet getRightIndex(long slot) { + public RowSet getRightIndex(int slot) { if (rightBuildersConverted) { return (RowSet) rightRowSetSource.getUnsafe(slot); } @@ -324,9 +320,9 @@ public RowSet getRightIndex(long slot) { } @Override - public void convertRightBuildersToIndex(LongArraySource slots, int slotCount) { + public void convertRightBuildersToIndex(IntegerArraySource slots, int slotCount) { for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); // this might be empty, if so then set null final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential) rightRowSetSource.getUnsafe(slot); @@ -344,9 +340,9 @@ public void convertRightBuildersToIndex(LongArraySource slots, int slotCount) { } @Override - public void convertRightGrouping(LongArraySource slots, int slotCount, ObjectArraySource rowSetSource) { + public void convertRightGrouping(IntegerArraySource slots, int slotCount, ObjectArraySource rowSetSource) { for (int slotIndex = 0; slotIndex < slotCount; ++slotIndex) { - final long slot = slots.getLong(slotIndex); + final int slot = slots.getInt(slotIndex); final RowSetBuilderSequential sequentialBuilder = (RowSetBuilderSequential) rightRowSetSource.getUnsafe(slot); @@ -376,7 +372,7 @@ private RowSet getGroupedIndex(ObjectArraySource rowSetSource, RowSetBui abstract protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks); abstract protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, RowSetBuilderRandom foundBuilder); + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder); abstract protected void decorateWithRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticHashedAsOfJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticHashedAsOfJoinStateManager.java index c4795c06f4c..cb84f836bdd 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticHashedAsOfJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/StaticHashedAsOfJoinStateManager.java @@ -8,7 +8,7 @@ import io.deephaven.engine.rowset.RowSetBuilderRandom; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.StaticAsOfJoinStateManager; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import org.jetbrains.annotations.NotNull; @@ -17,18 +17,17 @@ protected StaticHashedAsOfJoinStateManager(ColumnSource[] keySourcesForErrorM super(keySourcesForErrorMessages); } - public abstract int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull final LongArraySource addedSlots); - public abstract int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, @NotNull final LongArraySource addedSlots); + public abstract int buildFromLeftSide(RowSequence leftRowSet, ColumnSource[] leftSources, @NotNull IntegerArraySource addedSlots); + public abstract int buildFromRightSide(RowSequence rightRowSet, ColumnSource[] rightSources, @NotNull IntegerArraySource addedSlots); public abstract void probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources); - public abstract int probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources, LongArraySource slots, RowSetBuilderRandom foundBuilder); + public abstract int probeLeft(RowSequence leftRowSet, ColumnSource[] leftSources, IntegerArraySource slots, RowSetBuilderRandom foundBuilder); public abstract void probeRight(RowSequence rightRowSet, ColumnSource[] rightSources); public abstract int getTableSize(); - public abstract int getOverflowSize(); - public abstract RowSet getLeftIndex(long slot); - public abstract RowSet getRightIndex(long slot); + public abstract RowSet getLeftIndex(int slot); + public abstract RowSet getRightIndex(int slot); - public abstract void convertRightBuildersToIndex(LongArraySource slots, int slotCount); - public abstract void convertRightGrouping(LongArraySource slots, int slotCount, ObjectArraySource rowSetSource); + public abstract void convertRightBuildersToIndex(IntegerArraySource slots, int slotCount); + public abstract void convertRightGrouping(IntegerArraySource slots, int slotCount, ObjectArraySource rowSetSource); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/TypedAsOfJoinFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/TypedAsOfJoinFactory.java index cef8e5d8ac5..24ec0ace6bf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/TypedAsOfJoinFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/TypedAsOfJoinFactory.java @@ -33,7 +33,7 @@ public static void staticProbeDecorateLeftFound(HasherConfig hasherConfig, bo CodeBlock.Builder builder) { builder.addStatement("final long indexKey = rowKeyChunk.get(chunkPosition)"); builder.beginControlFlow("if (addLeftIndex(tableLocation, indexKey) && hashSlots != null)"); - builder.addStatement("hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation)"); + builder.addStatement("hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation)"); builder.addStatement("foundBuilder.addKey(indexKey)"); builder.endControlFlow(); } @@ -91,7 +91,7 @@ public static void rightIncrementalBuildLeftFound(HasherConfig hasherConfig, if (!alternate) { builder.addStatement("final long cookie = getCookieMain(tableLocation)"); builder.addStatement("assert hashSlots != null"); - builder.addStatement("hashSlots.set(cookie, (long)tableLocation | mainInsertMask)"); + builder.addStatement("hashSlots.set(cookie, tableLocation | mainInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -100,7 +100,7 @@ public static void rightIncrementalBuildLeftFound(HasherConfig hasherConfig, builder.endControlFlow(); } else { builder.addStatement("final long cookie = getCookieAlternate(alternateTableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask)"); + builder.addStatement("hashSlots.set(cookie, alternateTableLocation | alternateInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -113,7 +113,7 @@ public static void rightIncrementalBuildLeftFound(HasherConfig hasherConfig, public static void rightIncrementalBuildLeftInsert(HasherConfig hasherConfig, CodeBlock.Builder builder) { builder.addStatement("final long cookie = makeCookieMain(tableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)tableLocation | mainInsertMask)"); + builder.addStatement("hashSlots.set(cookie, tableLocation | mainInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -127,7 +127,7 @@ public static void rightIncrementalRightFound(HasherConfig hasherConfig, bool CodeBlock.Builder builder) { if (!alternate) { builder.addStatement("final long cookie = getCookieMain(tableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)tableLocation | mainInsertMask)"); + builder.addStatement("hashSlots.set(cookie, tableLocation | mainInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -136,7 +136,7 @@ public static void rightIncrementalRightFound(HasherConfig hasherConfig, bool builder.endControlFlow(); } else { builder.addStatement("final long cookie = getCookieAlternate(alternateTableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask)"); + builder.addStatement("hashSlots.set(cookie, alternateTableLocation | alternateInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -149,7 +149,7 @@ public static void rightIncrementalRightFound(HasherConfig hasherConfig, bool public static void rightIncrementalRightInsert(HasherConfig hasherConfig, CodeBlock.Builder builder) { builder.addStatement("final long cookie = makeCookieMain(tableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)tableLocation | mainInsertMask)"); + builder.addStatement("hashSlots.set(cookie, tableLocation | mainInsertMask)"); builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); @@ -164,7 +164,7 @@ public static void rightIncrementalProbeDecorateRightFound(HasherConfig hashe if (!alternate) { builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("final long cookie = getCookieMain(tableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)tableLocation | mainInsertMask)"); + builder.addStatement("hashSlots.set(cookie, tableLocation | mainInsertMask)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); builder.nextControlFlow("else"); builder.addStatement("addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState)"); @@ -172,7 +172,7 @@ public static void rightIncrementalProbeDecorateRightFound(HasherConfig hashe } else { builder.beginControlFlow("if (sequentialBuilders != null)"); builder.addStatement("final long cookie = getCookieAlternate(alternateTableLocation)"); - builder.addStatement("hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask)"); + builder.addStatement("hashSlots.set(cookie, alternateTableLocation | alternateInsertMask)"); builder.addStatement("addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition))"); builder.nextControlFlow("else"); builder.addStatement( diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/ZeroKeyChunkedAjMergedListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ZeroKeyChunkedAjMergedListener.java similarity index 99% rename from engine/table/src/main/java/io/deephaven/engine/table/impl/join/ZeroKeyChunkedAjMergedListener.java rename to engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ZeroKeyChunkedAjMergedListener.java index 8ebfc204d88..b53cbdd2074 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/join/ZeroKeyChunkedAjMergedListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/ZeroKeyChunkedAjMergedListener.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending */ -package io.deephaven.engine.table.impl.join; +package io.deephaven.engine.table.impl.asofjoin; import io.deephaven.engine.rowset.*; import io.deephaven.engine.rowset.RowSetFactory; @@ -11,6 +11,7 @@ import io.deephaven.engine.table.MatchPair; import io.deephaven.engine.table.impl.*; import io.deephaven.chunk.util.hashing.ChunkEquals; +import io.deephaven.engine.table.impl.join.JoinListenerRecorder; import io.deephaven.engine.table.impl.sort.LongSortKernel; import io.deephaven.engine.table.ColumnSource; import io.deephaven.chunk.*; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherByte.java index ae86402b39a..51311ec0073 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherByte.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(byte k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherChar.java index e94767067ce..9e6a55d4e96 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherChar.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(char k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherDouble.java index 6ed4d7b2e93..0d75bab75e8 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherDouble.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(double k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherFloat.java index 0f2413ecd52..fd8dc4c24a4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherFloat.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(float k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherInt.java index 510a07e34b8..0d64fd7c88a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherInt.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(int k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherLong.java index 5333696c4eb..280681441eb 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherLong.java @@ -14,7 +14,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; import io.deephaven.util.QueryConstants; @@ -43,7 +43,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -63,7 +63,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -78,7 +78,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -89,7 +89,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -105,7 +105,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -125,7 +125,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -140,7 +140,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -150,7 +150,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -166,7 +166,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -181,7 +181,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -200,7 +200,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -220,7 +220,7 @@ private static int hash(long k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -244,7 +244,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -268,7 +268,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherObject.java index 19a3d59ddfd..8aef0ba35a6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherObject.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; import io.deephaven.util.QueryConstants; @@ -45,7 +45,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -65,7 +65,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -80,7 +80,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -91,7 +91,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -107,7 +107,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -127,7 +127,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -142,7 +142,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -152,7 +152,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -168,7 +168,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -183,7 +183,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -202,7 +202,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -222,7 +222,7 @@ private static int hash(Object k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -247,7 +247,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -271,7 +271,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherShort.java index 01d678fa0e5..36392b4c23c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/rightincopen/gen/RightIncrementalAsOfJoinHasherShort.java @@ -15,7 +15,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.ObjectArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; import io.deephaven.util.QueryConstants; @@ -44,7 +44,7 @@ private int alternateNextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -64,7 +64,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -79,7 +79,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -90,7 +90,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); assert hashSlots != null; - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -106,7 +106,7 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk } protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final int chunkSize = keyChunk0.size(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -126,7 +126,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -141,7 +141,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun numEntries++; mainKeySource0.set(tableLocation, k0); final long cookie = makeCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); stateSource.set(tableLocation, (byte)(ENTRY_RIGHT_IS_EMPTY | ENTRY_LEFT_IS_EMPTY)); @@ -151,7 +151,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); if (sequentialBuilders != null) { addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { @@ -167,7 +167,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, ObjectArraySource sequentialBuilders) { + IntegerArraySource hashSlots, ObjectArraySource sequentialBuilders) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); final int chunkSize = keyChunk0.size(); @@ -182,7 +182,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieMain(tableLocation); - hashSlots.set(cookie, (long)tableLocation | mainInsertMask); + hashSlots.set(cookie, tableLocation | mainInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addRightIndex(tableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -201,7 +201,7 @@ protected void probeRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, if (eq(alternateKeySource0.getUnsafe(alternateTableLocation), k0)) { if (sequentialBuilders != null) { final long cookie = getCookieAlternate(alternateTableLocation); - hashSlots.set(cookie, (long)alternateTableLocation | alternateInsertMask); + hashSlots.set(cookie, alternateTableLocation | alternateInsertMask); addToSequentialBuilder(cookie, sequentialBuilders, rowKeyChunk.get(chunkPosition)); } else { addAlternateRightIndex(alternateTableLocation, rowKeyChunk.get(chunkPosition), rowState); @@ -221,7 +221,7 @@ private static int hash(short k0) { return hash; } - private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSlots) { + private boolean migrateOneLocation(int locationToMigrate, IntegerArraySource hashSlots) { final byte currentStateValue = alternateStateSource.getUnsafe(locationToMigrate); if (currentStateValue == ENTRY_EMPTY_STATE) { return false; @@ -245,7 +245,7 @@ private boolean migrateOneLocation(int locationToMigrate, LongArraySource hashSl } @Override - protected int rehashInternalPartial(int entriesToRehash, LongArraySource hashSlots) { + protected int rehashInternalPartial(int entriesToRehash, IntegerArraySource hashSlots) { int rehashedEntries = 0; while (rehashPointer > 0 && rehashedEntries < entriesToRehash) { if (migrateOneLocation(--rehashPointer, hashSlots)) { @@ -269,7 +269,7 @@ protected void clearAlternate() { } @Override - protected void migrateFront(LongArraySource hashSlots) { + protected void migrateFront(IntegerArraySource hashSlots) { int location = 0; while (migrateOneLocation(location++, hashSlots)); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherByte.java index 052ed6b67f6..e7165d5229d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherByte.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherByte extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableByteArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherChar.java index 17824945283..2bc4090b732 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherChar.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherChar extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableCharArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherDouble.java index da0fb1c3ee3..f4e644f5f1c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherDouble.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherDouble extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableDoubleArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherFloat.java index f31d17923be..a1082e2d32b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherFloat.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherFloat extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableFloatArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherInt.java index 386d65110e4..38c19db55c7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherInt.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherInt extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableIntArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherLong.java index 22ca3935651..4a3b36253db 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherLong.java @@ -16,12 +16,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherLong extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableLongArraySource mainKeySource0; @@ -94,7 +94,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -108,7 +108,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherObject.java index f3761d59b87..9ba5264036e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherObject.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherObject extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableObjectArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherShort.java index 709a4cd161d..f684e2e89a2 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/asofjoin/typed/staticopen/gen/StaticAsOfJoinHasherShort.java @@ -17,12 +17,12 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase; -import io.deephaven.engine.table.impl.sources.LongArraySource; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; import java.lang.Object; import java.lang.Override; import java.util.Arrays; -import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; final class StaticAsOfJoinHasherShort extends StaticAsOfJoinStateManagerTypedBase { private final ImmutableShortArraySource mainKeySource0; @@ -95,7 +95,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource hashSlots, MutableInt hashSlotOffset, + IntegerArraySource hashSlots, MutableLong hashSlotOffset, RowSetBuilderRandom foundBuilder) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); @@ -109,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { final long indexKey = rowKeyChunk.get(chunkPosition); if (addLeftIndex(tableLocation, indexKey) && hashSlots != null) { - hashSlots.set(hashSlotOffset.getAndIncrement(), (long)tableLocation); + hashSlots.set(hashSlotOffset.getAndIncrement(), tableLocation); foundBuilder.addKey(indexKey); } break; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java index 88931d732da..b372c2dab79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/TypedHasherFactory.java @@ -32,6 +32,7 @@ import io.deephaven.util.QueryConstants; import io.deephaven.util.compare.CharComparisons; import org.apache.commons.lang3.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.NotNull; import javax.lang.model.element.Modifier; @@ -117,19 +118,17 @@ public static HasherConfig hasherConfigForBase(Class baseClass) { .includeOriginalSources(true) .supportRehash(false); - final TypeName longArraySource = TypeName.get(LongArraySource.class); - final ParameterSpec leftHashSlots = ParameterSpec.builder(longArraySource, "leftHashSlots").build(); - final ParameterSpec hashSlotOffset = ParameterSpec.builder(int.class, "hashSlotOffset").build(); - builder.addBuild(new HasherConfig.BuildSpec("buildFromLeftSide", "rightSideSentinel", false, true, TypedNaturalJoinFactory::staticBuildLeftFound, TypedNaturalJoinFactory::staticBuildLeftInsert, - leftHashSlots, hashSlotOffset)); + ParameterSpec.builder(TypeName.get(IntegerArraySource.class), "leftHashSlots").build(), + ParameterSpec.builder(long.class, "hashSlotOffset").build())); builder.addProbe(new HasherConfig.ProbeSpec("decorateLeftSide", "rightRowKey", false, TypedNaturalJoinFactory::staticProbeDecorateLeftFound, TypedNaturalJoinFactory::staticProbeDecorateLeftMissing, - ParameterSpec.builder(longArraySource, "leftRedirections").build(), hashSlotOffset)); + ParameterSpec.builder(TypeName.get(LongArraySource.class), "leftRedirections").build(), + ParameterSpec.builder(long.class, "redirectionOffset").build())); builder.addBuild(new HasherConfig.BuildSpec("buildFromRightSide", "rightSideSentinel", true, true, TypedNaturalJoinFactory::staticBuildRightFound, @@ -260,18 +259,15 @@ public static HasherConfig hasherConfigForBase(Class baseClass) { .alwaysMoveMain(true) .rehashFullSetup(TypedAsOfJoinFactory::staticRehashSetup); - final TypeName longArraySource = TypeName.get(LongArraySource.class); - final ParameterSpec hashSlots = ParameterSpec.builder(longArraySource, "hashSlots").build(); - final ParameterSpec hashSlotOffset = ParameterSpec.builder(MutableInt.class, "hashSlotOffset").build(); - final ParameterSpec foundBuilder = ParameterSpec.builder(RowSetBuilderRandom.class, "foundBuilder").build(); - builder.addBuild(new HasherConfig.BuildSpec("buildFromLeftSide", "rightSideSentinel", true, true, TypedAsOfJoinFactory::staticBuildLeftFound, TypedAsOfJoinFactory::staticBuildLeftInsert)); - builder.addProbe(new HasherConfig.ProbeSpec("decorateLeftSide", null, - true, TypedAsOfJoinFactory::staticProbeDecorateLeftFound, - null, hashSlots, hashSlotOffset, foundBuilder)); + builder.addProbe(new HasherConfig.ProbeSpec("decorateLeftSide", null, true, + TypedAsOfJoinFactory::staticProbeDecorateLeftFound, null, + ParameterSpec.builder(TypeName.get(IntegerArraySource.class), "hashSlots").build(), + ParameterSpec.builder(MutableLong.class, "hashSlotOffset").build(), + ParameterSpec.builder(RowSetBuilderRandom.class, "foundBuilder").build())); builder.addBuild(new HasherConfig.BuildSpec("buildFromRightSide", "rightSideSentinel", true, true, TypedAsOfJoinFactory::staticBuildRightFound, @@ -281,8 +277,8 @@ public static HasherConfig hasherConfigForBase(Class baseClass) { true, TypedAsOfJoinFactory::staticProbeDecorateRightFound, null)); } else if (baseClass.equals(RightIncrementalAsOfJoinStateManagerTypedBase.class)) { - final TypeName longArraySource = TypeName.get(LongArraySource.class); - final ParameterSpec hashSlots = ParameterSpec.builder(longArraySource, "hashSlots").build(); + final ParameterSpec hashSlots = ParameterSpec.builder(TypeName.get(IntegerArraySource.class), "hashSlots") + .build(); final ParameterSpec sequentialBuilders = ParameterSpec.builder(ObjectArraySource.class, "sequentialBuilders").build(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/IncrementalNaturalJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/IncrementalNaturalJoinStateManagerTypedBase.java index ee85201d22d..d45b19a960a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/IncrementalNaturalJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/IncrementalNaturalJoinStateManagerTypedBase.java @@ -24,13 +24,14 @@ import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.NotNull; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; +import static io.deephaven.engine.table.impl.JoinControl.MAX_TABLE_SIZE; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; public abstract class IncrementalNaturalJoinStateManagerTypedBase extends StaticNaturalJoinStateManager implements IncrementalNaturalJoinStateManager, BothIncrementalNaturalJoinStateManager { - public static final int CHUNK_SIZE = 4096; - private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size + public static final long EMPTY_RIGHT_STATE = QueryConstants.NULL_LONG; // the number of slots in our table @@ -356,7 +357,7 @@ protected void freeDuplicateLocation(long duplicateLocation) { } @Override - public long getRightIndex(long slot) { + public long getRightIndex(int slot) { final long rightRowKey; if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { // slot needs to represent whether we are in the main or alternate using main insert mask! @@ -371,7 +372,7 @@ public long getRightIndex(long slot) { } @Override - public RowSet getLeftIndex(long slot) { + public RowSet getLeftIndex(int slot) { if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { return mainLeftRowSet.getUnsafe(slot & AlternatingColumnSource.ALTERNATE_INNER_MASK); } else { @@ -380,7 +381,7 @@ public RowSet getLeftIndex(long slot) { } @Override - public String keyString(long slot) { + public String keyString(int slot) { final long firstLeftRowKey; if ((slot & AlternatingColumnSource.ALTERNATE_SWITCH_MASK) == mainInsertMask) { firstLeftRowKey = diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java index 9ee256f8c6c..8e49aba0d94 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/RightIncrementalNaturalJoinStateManagerTypedBase.java @@ -26,12 +26,12 @@ import io.deephaven.engine.table.impl.util.TypedHasherUtil.BuildOrProbeContext.ProbeContext; import org.jetbrains.annotations.NotNull; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; +import static io.deephaven.engine.table.impl.JoinControl.MAX_TABLE_SIZE; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; public abstract class RightIncrementalNaturalJoinStateManagerTypedBase extends RightIncrementalNaturalJoinStateManager { - public static final int CHUNK_SIZE = 4096; - private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size // the number of slots in our table protected int tableSize; @@ -168,17 +168,17 @@ protected int hashToTableLocation(int hash) { } @Override - public long getRightIndex(long slot) { + public long getRightIndex(int slot) { return rightRowKey.getUnsafe(slot); } @Override - public RowSet getLeftIndex(long slot) { + public RowSet getLeftIndex(int slot) { return leftRowSet.getUnsafe(slot); } @Override - public String keyString(long slot) { + public String keyString(int slot) { throw new UnsupportedOperationException(); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticHashedNaturalJoinStateManager.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticHashedNaturalJoinStateManager.java index f204356aea0..a1c2384ac17 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticHashedNaturalJoinStateManager.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticHashedNaturalJoinStateManager.java @@ -9,10 +9,7 @@ import io.deephaven.engine.table.impl.JoinControl; import io.deephaven.engine.table.impl.QueryTable; import io.deephaven.engine.table.impl.StaticNaturalJoinStateManager; -import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; -import io.deephaven.engine.table.impl.sources.LongSparseArraySource; -import io.deephaven.engine.table.impl.sources.ObjectArraySource; +import io.deephaven.engine.table.impl.sources.*; import io.deephaven.engine.table.impl.util.ContiguousWritableRowRedirection; import io.deephaven.engine.table.impl.util.LongColumnSourceWritableRowRedirection; import io.deephaven.engine.table.impl.util.WritableRowRedirection; @@ -25,14 +22,14 @@ protected StaticHashedNaturalJoinStateManager(ColumnSource[] keySourcesForErr super(keySourcesForErrorMessages); } - public abstract void buildFromLeftSide(final Table leftTable, ColumnSource[] leftSources, final LongArraySource leftHashSlots); + public abstract void buildFromLeftSide(final Table leftTable, ColumnSource[] leftSources, final IntegerArraySource leftHashSlots); public abstract void buildFromRightSide(final Table rightTable, ColumnSource [] rightSources); public abstract void decorateLeftSide(RowSet leftRowSet, ColumnSource [] leftSources, final LongArraySource leftRedirections); public abstract void decorateWithRightSide(Table rightTable, ColumnSource [] rightSources); - public abstract WritableRowRedirection buildRowRedirectionFromHashSlot(QueryTable leftTable, boolean exactMatch, LongArraySource leftHashSlots, JoinControl.RedirectionType redirectionType); + public abstract WritableRowRedirection buildRowRedirectionFromHashSlot(QueryTable leftTable, boolean exactMatch, IntegerArraySource leftHashSlots, JoinControl.RedirectionType redirectionType); public abstract WritableRowRedirection buildRowRedirectionFromRedirections(QueryTable leftTable, boolean exactMatch, LongArraySource leftRedirections, JoinControl.RedirectionType redirectionType); - public abstract WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable, boolean exactMatch, long groupingSize, LongArraySource leftHashSlots, ArrayBackedColumnSource leftIndices, JoinControl.RedirectionType redirectionType); + public abstract WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable, boolean exactMatch, long groupingSize, IntegerArraySource leftHashSlots, ArrayBackedColumnSource leftIndices, JoinControl.RedirectionType redirectionType); protected WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable, boolean exactMatch, long groupingSize, LongUnaryOperator groupPositionToRightSide, ArrayBackedColumnSource leftIndices, JoinControl.RedirectionType redirectionType) { switch (redirectionType) { @@ -83,7 +80,7 @@ protected WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable throw new IllegalStateException("Bad redirectionType: " + redirectionType); } - public void errorOnDuplicates(LongArraySource leftHashSlots, long size, LongUnaryOperator groupPositionToRightSide, LongUnaryOperator firstLeftKey) { + public void errorOnDuplicates(IntegerArraySource leftHashSlots, long size, LongUnaryOperator groupPositionToRightSide, LongUnaryOperator firstLeftKey) { for (int ii = 0; ii < size; ++ii) { final long rightSide = groupPositionToRightSide.applyAsLong(ii); if (rightSide == DUPLICATE_RIGHT_VALUE) { @@ -92,11 +89,11 @@ public void errorOnDuplicates(LongArraySource leftHashSlots, long size, LongUnar } } - public void errorOnDuplicatesGrouped(LongArraySource leftHashSlots, long size, ObjectArraySource rowSetSource) { + public void errorOnDuplicatesGrouped(IntegerArraySource leftHashSlots, long size, ObjectArraySource rowSetSource) { throw new UnsupportedOperationException(); } - public void errorOnDuplicatesSingle(LongArraySource leftHashSlots, long size, RowSet rowSet) { + public void errorOnDuplicatesSingle(IntegerArraySource leftHashSlots, long size, RowSet rowSet) { throw new UnsupportedOperationException(); } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java index 72d1e6f68e8..38f22fb273e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/StaticNaturalJoinStateManagerTypedBase.java @@ -12,10 +12,7 @@ import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.JoinControl; import io.deephaven.engine.table.impl.QueryTable; -import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; -import io.deephaven.engine.table.impl.sources.InMemoryColumnSource; -import io.deephaven.engine.table.impl.sources.LongArraySource; -import io.deephaven.engine.table.impl.sources.ObjectArraySource; +import io.deephaven.engine.table.impl.sources.*; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; import io.deephaven.engine.table.impl.util.TypedHasherUtil; import io.deephaven.engine.table.impl.util.TypedHasherUtil.BuildOrProbeContext.BuildContext; @@ -23,12 +20,13 @@ import io.deephaven.engine.table.impl.util.WritableRowRedirection; import io.deephaven.util.QueryConstants; +import static io.deephaven.engine.table.impl.JoinControl.CHUNK_SIZE; +import static io.deephaven.engine.table.impl.JoinControl.MAX_TABLE_SIZE; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getKeyChunks; import static io.deephaven.engine.table.impl.util.TypedHasherUtil.getPrevKeyChunks; public abstract class StaticNaturalJoinStateManagerTypedBase extends StaticHashedNaturalJoinStateManager { - public static final int CHUNK_SIZE = 4096; - private static final long MAX_TABLE_SIZE = 1 << 30; // maximum array size + public static final long NO_RIGHT_STATE_VALUE = RowSet.NULL_ROW_KEY; public static final long EMPTY_RIGHT_STATE = QueryConstants.NULL_LONG; public static final long DUPLICATE_RIGHT_STATE = -2; @@ -88,10 +86,10 @@ ProbeContext makeProbeContext(ColumnSource[] buildSources, long maxSize) { } private class LeftBuildHandler implements TypedHasherUtil.BuildHandler { - final LongArraySource leftHashSlots; - int offset = 0; + final IntegerArraySource leftHashSlots; + long offset = 0; - private LeftBuildHandler(LongArraySource leftHashSlots) { + private LeftBuildHandler(IntegerArraySource leftHashSlots) { this.leftHashSlots = leftHashSlots; } @@ -104,23 +102,23 @@ public void doBuild(RowSequence chunkOk, Chunk[] sourceKeyChunks) { } private class LeftProbeHandler implements TypedHasherUtil.ProbeHandler { - final LongArraySource leftHashSlots; - int offset = 0; + final LongArraySource leftRedirections; + long offset = 0; - private LeftProbeHandler(LongArraySource leftHashSlots) { - this.leftHashSlots = leftHashSlots; + private LeftProbeHandler(LongArraySource leftRedirections) { + this.leftRedirections = leftRedirections; } @Override public void doProbe(RowSequence chunkOk, Chunk[] sourceKeyChunks) { - leftHashSlots.ensureCapacity(offset + chunkOk.intSize()); - decorateLeftSide(chunkOk, sourceKeyChunks, leftHashSlots, offset); + leftRedirections.ensureCapacity(offset + chunkOk.intSize()); + decorateLeftSide(chunkOk, sourceKeyChunks, leftRedirections, offset); offset += chunkOk.intSize(); } } @Override - public void buildFromLeftSide(Table leftTable, ColumnSource[] leftSources, LongArraySource leftHashSlots) { + public void buildFromLeftSide(Table leftTable, ColumnSource[] leftSources, IntegerArraySource leftHashSlots) { if (leftTable.isEmpty()) { return; } @@ -130,7 +128,7 @@ public void buildFromLeftSide(Table leftTable, ColumnSource[] leftSources, Lo } abstract protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset); + IntegerArraySource leftHashSlots, long hashSlotOffset); @Override public void buildFromRightSide(Table rightTable, ColumnSource[] rightSources) { @@ -155,7 +153,7 @@ public void decorateLeftSide(RowSet leftRowSet, ColumnSource[] leftSources, L } abstract protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset); + LongArraySource leftRedirections, long redirectionsOffset); @Override public void decorateWithRightSide(Table rightTable, ColumnSource[] rightSources) { @@ -232,7 +230,7 @@ protected int hashToTableLocation(int hash) { } public WritableRowRedirection buildRowRedirectionFromHashSlot(QueryTable leftTable, boolean exactMatch, - LongArraySource leftHashSlots, JoinControl.RedirectionType redirectionType) { + IntegerArraySource leftHashSlots, JoinControl.RedirectionType redirectionType) { return buildRowRedirection(leftTable, exactMatch, position -> mainRightRowKey.getUnsafe(leftHashSlots.getUnsafe(position)), redirectionType); } @@ -243,21 +241,21 @@ public WritableRowRedirection buildRowRedirectionFromRedirections(QueryTable lef } public WritableRowRedirection buildGroupedRowRedirection(QueryTable leftTable, boolean exactMatch, - long groupingSize, LongArraySource leftHashSlots, ArrayBackedColumnSource leftIndices, + long groupingSize, IntegerArraySource leftHashSlots, ArrayBackedColumnSource leftIndices, JoinControl.RedirectionType redirectionType) { return buildGroupedRowRedirection(leftTable, exactMatch, groupingSize, (long groupPosition) -> mainRightRowKey.getUnsafe(leftHashSlots.getUnsafe(groupPosition)), leftIndices, redirectionType); } - public void errorOnDuplicatesGrouped(LongArraySource leftHashSlots, long size, + public void errorOnDuplicatesGrouped(IntegerArraySource leftHashSlots, long size, ObjectArraySource rowSetSource) { errorOnDuplicates(leftHashSlots, size, (long groupPosition) -> mainRightRowKey.getUnsafe(leftHashSlots.getUnsafe(groupPosition)), (long row) -> rowSetSource.getUnsafe(row).firstRowKey()); } - public void errorOnDuplicatesSingle(LongArraySource leftHashSlots, long size, RowSet rowSet) { + public void errorOnDuplicatesSingle(IntegerArraySource leftHashSlots, long size, RowSet rowSet) { errorOnDuplicates(leftHashSlots, size, (long position) -> mainRightRowKey.getUnsafe(leftHashSlots.getUnsafe(position)), rowSet::get); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/TypedNaturalJoinFactory.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/TypedNaturalJoinFactory.java index 61ff7b0b514..41a9029a223 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/TypedNaturalJoinFactory.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/TypedNaturalJoinFactory.java @@ -19,12 +19,12 @@ public class TypedNaturalJoinFactory { public static void staticBuildLeftFound(HasherConfig hasherConfig, boolean alternate, CodeBlock.Builder builder) { - builder.addStatement("leftHashSlots.set(hashSlotOffset++, (long)tableLocation)"); + builder.addStatement("leftHashSlots.set(hashSlotOffset++, tableLocation)"); } public static void staticBuildLeftInsert(HasherConfig hasherConfig, CodeBlock.Builder builder) { builder.addStatement("mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE)"); - builder.addStatement("leftHashSlots.set(hashSlotOffset++, (long)tableLocation)"); + builder.addStatement("leftHashSlots.set(hashSlotOffset++, tableLocation)"); } public static void staticBuildRightFound(HasherConfig hasherConfig, boolean alternate, @@ -46,11 +46,11 @@ public static void staticProbeDecorateLeftFound(HasherConfig hasherConfig, bo builder.addStatement( "throw new IllegalStateException(\"Natural Join found duplicate right key for \" + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition)))"); builder.endControlFlow(); - builder.addStatement("leftRedirections.set(hashSlotOffset++, rightRowKey)"); + builder.addStatement("leftRedirections.set(redirectionOffset++, rightRowKey)"); } public static void staticProbeDecorateLeftMissing(CodeBlock.Builder builder) { - builder.addStatement("leftRedirections.set(hashSlotOffset++, $T.NULL_ROW_KEY)", RowSet.class); + builder.addStatement("leftRedirections.set(redirectionOffset++, $T.NULL_ROW_KEY)", RowSet.class); } public static void staticProbeDecorateRightFound(HasherConfig hasherConfig, boolean alternate, diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherByte.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherByte.java index 3f9f36ab2d0..689079b4f3a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherByte.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherByte.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableByteArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final ByteChunk keyChunk0 = sourceKeyChunks[0].asByteChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherChar.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherChar.java index e40668f84fa..3211698b6c4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherChar.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherChar.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableCharArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final CharChunk keyChunk0 = sourceKeyChunks[0].asCharChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherDouble.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherDouble.java index 5445412fd62..4eef63ab75c 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherDouble.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherDouble.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableDoubleArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final DoubleChunk keyChunk0 = sourceKeyChunks[0].asDoubleChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherFloat.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherFloat.java index 2008ab10d5f..5251b01ccaf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherFloat.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherFloat.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final FloatChunk keyChunk0 = sourceKeyChunks[0].asFloatChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherInt.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherInt.java index dcb45965852..ceb8e7d65d4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherInt.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherInt.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableIntArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final IntChunk keyChunk0 = sourceKeyChunks[0].asIntChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherLong.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherLong.java index 93a23d288af..0177c6b5c27 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherLong.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherLong.java @@ -16,6 +16,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableLongArraySource; @@ -35,7 +36,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -49,10 +50,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -91,7 +92,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final LongChunk keyChunk0 = sourceKeyChunks[0].asLongChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -107,7 +108,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -115,7 +116,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherObject.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherObject.java index 7eed70f3459..e0d53d03127 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherObject.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherObject.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableObjectArraySource; import java.lang.Object; @@ -37,7 +38,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -51,10 +52,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -93,7 +94,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final ObjectChunk keyChunk0 = sourceKeyChunks[0].asObjectChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -109,7 +110,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -117,7 +118,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherShort.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherShort.java index 9fbc8335015..e58babf8186 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherShort.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/naturaljoin/typed/staticopen/gen/StaticNaturalJoinHasherShort.java @@ -17,6 +17,7 @@ import io.deephaven.engine.table.ColumnSource; import io.deephaven.engine.table.impl.naturaljoin.DuplicateRightRowDecorationException; import io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase; +import io.deephaven.engine.table.impl.sources.IntegerArraySource; import io.deephaven.engine.table.impl.sources.LongArraySource; import io.deephaven.engine.table.impl.sources.immutable.ImmutableShortArraySource; @@ -36,7 +37,7 @@ private int nextTableLocation(int tableLocation) { } protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftHashSlots, int hashSlotOffset) { + IntegerArraySource leftHashSlots, long hashSlotOffset) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -50,10 +51,10 @@ protected void buildFromLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunk numEntries++; mainKeySource0.set(tableLocation, k0); mainRightRowKey.set(tableLocation, NO_RIGHT_STATE_VALUE); - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else if (eq(mainKeySource0.getUnsafe(tableLocation), k0)) { - leftHashSlots.set(hashSlotOffset++, (long)tableLocation); + leftHashSlots.set(hashSlotOffset++, tableLocation); break; } else { tableLocation = nextTableLocation(tableLocation); @@ -92,7 +93,7 @@ protected void buildFromRightSide(RowSequence rowSequence, Chunk[] sourceKeyChun } protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, - LongArraySource leftRedirections, int hashSlotOffset) { + LongArraySource leftRedirections, long redirectionOffset) { final ShortChunk keyChunk0 = sourceKeyChunks[0].asShortChunk(); final int chunkSize = keyChunk0.size(); for (int chunkPosition = 0; chunkPosition < chunkSize; ++chunkPosition) { @@ -108,7 +109,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks final LongChunk rowKeyChunk = rowSequence.asRowKeyChunk(); throw new IllegalStateException("Natural Join found duplicate right key for " + extractKeyStringFromSourceTable(rowKeyChunk.get(chunkPosition))); } - leftRedirections.set(hashSlotOffset++, rightRowKey); + leftRedirections.set(redirectionOffset++, rightRowKey); found = true; break; } @@ -116,7 +117,7 @@ protected void decorateLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks Assert.neq(tableLocation, "tableLocation", firstTableLocation, "firstTableLocation"); } if (!found) { - leftRedirections.set(hashSlotOffset++, RowSet.NULL_ROW_KEY); + leftRedirections.set(redirectionOffset++, RowSet.NULL_ROW_KEY); } } } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java index a7f13f36573..bd8e9329ee6 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java @@ -769,22 +769,12 @@ int tableSizeForLeftBuild(Table leftTable) { @Override double getMaximumLoadFactor() { - if (AsOfJoinHelper.USE_TYPED_STATE_MANAGER) { - // allow this test to function for OA - return 0.75; - } else { - return 20.0; - } + return 0.75; } @Override int initialBuildSize() { - if (AsOfJoinHelper.USE_TYPED_STATE_MANAGER) { - // allow this test to function for OA - return 1 << 3; - } else { - return super.initialBuildSize(); - } + return 1 << 3; } @Override diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableNaturalJoinTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableNaturalJoinTest.java index d187ba9de36..ec71bfae513 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableNaturalJoinTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableNaturalJoinTest.java @@ -172,29 +172,6 @@ public void testNaturalJoinIncremental() { } } - public void testNaturalJoinIncrementalOverflow() { - if (NaturalJoinHelper.USE_TYPED_STATE_MANAGER) { - // the typed state manager does not do overflow, there must be enough space in the open addressed hash table - // to contain all of our entries - return; - } - setExpectError(false); - - final int maxSteps = 5; - final int[] leftSizes = new int[] {10000}; - final int[] rightSizes = new int[] {10000}; - for (long seed = 0; seed < 5; seed++) { - for (int leftSize : leftSizes) { - for (int rightSize : rightSizes) { - for (JoinIncrement joinIncrement : new JoinIncrement[] {leftRightConcurrentStepShift}) { - testNaturalJoinIncremental(false, false, leftSize, rightSize, joinIncrement, seed, maxSteps, - QueryTableJoinTest.HIGH_LOAD_FACTOR_CONTROL); - } - } - } - } - } - public void testNaturalJoinLeftIncrementalRightStatic() { for (JoinIncrement joinIncrement : new JoinIncrement[] {leftStepShift, leftStep}) { final int sz = 5; diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java index 085ccbe52cd..76c069a536e 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableStaticNaturalJoinRandomTest.java @@ -255,29 +255,6 @@ public void testNaturalJoinRandomSmallTypes() { } } - // let's force some collisions by making our table small - public void testNaturalJoinRandomStaticOverflow() { - // we can not make our table small with the typed state manager, as it does not support overflow - if (NaturalJoinHelper.USE_TYPED_STATE_MANAGER) { - return; - } - - for (int leftSize = 10_000; leftSize <= 100_000; leftSize *= 10) { - for (int rightSize = 10_000; rightSize <= 100_000; rightSize *= 10) { - for (int seed = 0; seed < 2; ++seed) { - for (Class dataType : Arrays.asList(String.class, int.class, ArrayTuple.class)) { - System.out.println("Seed = " + seed + ", leftSize=" + leftSize + ", rightSize=" + rightSize - + ", type=" + dataType); - testNaturalJoinRandomStatic(seed, leftSize, rightSize, dataType, false, false, - QueryTableJoinTest.SMALL_LEFT_CONTROL); - testNaturalJoinRandomStatic(seed, leftSize, rightSize, dataType, false, false, - QueryTableJoinTest.SMALL_RIGHT_CONTROL); - } - } - } - } - } - // let's force some collisions by making our table small public void testNaturalJoinRandomStaticRedirectionBuild() { for (int leftSize = 10_000; leftSize <= 10_000; leftSize *= 10) { diff --git a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java index 9be1b0d6c4b..f4a9a163903 100644 --- a/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java +++ b/replication/reflective/src/main/java/io/deephaven/replicators/ReplicateHashTable.java @@ -74,49 +74,22 @@ public class ReplicateHashTable { public static void main(String[] args) throws IOException, ClassNotFoundException { final boolean allowMissingDestinations = false; - // Incremental NJ -> Right-Incremental NJ + // Left-Only-Incremental Cross Join-> Symbol Table Combiner doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedNaturalJoinStateManager.java", - allowMissingDestinations, Arrays.asList("rehash", "allowUpdateWriteThroughState", "dumpTable")); - // Incremental NJ -> Static NJ - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedNaturalJoinStateManager.java", - allowMissingDestinations, Arrays.asList("rehash", "allowUpdateWriteThroughState", "dumpTable", "prev")); - - // Incremental NJ -> Static AJ - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedAsOfJoinStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "prev")); - // Incremental NJ -> Right-Incremental AJ - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", - "engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedAsOfJoinStateManager.java", - allowMissingDestinations, Collections.singletonList("dumpTable")); - - // Incremental NJ -> Symbol Table Combiner - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", + "engine/table/src/main/java/io/deephaven/engine/table/impl/LeftOnlyIncrementalChunkedCrossJoinStateManager.java", "engine/table/src/main/java/io/deephaven/engine/table/impl/SymbolTableCombiner.java", allowMissingDestinations, Arrays.asList("overflowLocationToHashLocation", "getStateValue", "prev")); - // Incremental NJ -> Left-Only-Incremental Cross Join + // Left-Only-Incremental Cross Join -> Right-Incremental Cross Join doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", "engine/table/src/main/java/io/deephaven/engine/table/impl/LeftOnlyIncrementalChunkedCrossJoinStateManager.java", - allowMissingDestinations, Collections.singletonList("dumpTable")); - // Incremental NJ -> Right-Incremental Cross Join - doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", "engine/table/src/main/java/io/deephaven/engine/table/impl/RightIncrementalChunkedCrossJoinStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "allowUpdateWriteThroughState")); - // Incremental NJ -> Static Cross Join + allowMissingDestinations, Arrays.asList("allowUpdateWriteThroughState")); + // Left-Only-Incremental Cross Join -> Static Cross Join doReplicate( - "engine/table/src/main/java/io/deephaven/engine/table/impl/IncrementalChunkedNaturalJoinStateManager.java", + "engine/table/src/main/java/io/deephaven/engine/table/impl/LeftOnlyIncrementalChunkedCrossJoinStateManager.java", "engine/table/src/main/java/io/deephaven/engine/table/impl/StaticChunkedCrossJoinStateManager.java", - allowMissingDestinations, Arrays.asList("dumpTable", "prev")); + allowMissingDestinations, Arrays.asList("prev")); } private static class RegionedFile { From a23b5e96dbbc9841c5577f8f4cd04eb08d065d2e Mon Sep 17 00:00:00 2001 From: Larry Booker Date: Mon, 26 Sep 2022 12:49:06 -0700 Subject: [PATCH 151/215] Use builders for `GroupBy` initialization and updates (#2886) * use RowSetBuilderRandom instead of RowSet.insert calls * PT tests passing, spotless applied * wip * updated PT to use builders * minor cleanup * bugfix, re-scope setter for initialized flag * ported Builder improvements * PR comments round 1 addressed * can we get auto-spotless? * add'l PR comments addressed * fixed a silly comment * extracted the local class to allow general usage * Using sequential builders to accelerate initial GroupBy creation * bugfix: enable tracking on rowset after build() * changes to allow more efficient updates (WIP) * WIP * COB WIP * Aggregation Tests passing, still a little messy * cleaned up a bit, tests still passing * removed anyKeysModified from propagateUpdates() in chunked aggregation * revert changes to resetForStep * spotless for the win * another round of comments addressed * more spotless * Moved BitmapRandomBuilder to a better home --- .../table/impl/by/AggregationContext.java | 9 +- .../table/impl/by/BitmapRandomBuilder.java | 96 ++++++ ...treamSortedFirstOrLastChunkedOperator.java | 2 +- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- .../by/ChunkedOperatorAggregationHelper.java | 94 +----- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- .../table/impl/by/FormulaChunkedOperator.java | 17 +- .../table/impl/by/GroupByChunkedOperator.java | 281 +++++++++++++++--- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- .../IterativeChunkedAggregationOperator.java | 6 +- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- .../impl/by/PartitionByChunkedOperator.java | 2 +- ...treamSortedFirstOrLastChunkedOperator.java | 2 +- .../impl/by/StreamFirstChunkedOperator.java | 2 +- .../impl/by/StreamLastChunkedOperator.java | 2 +- .../impl/by/TDigestPercentileOperator.java | 4 +- .../distinct/LongChunkedDistinctOperator.java | 1 - .../distinct/LongRollupDistinctOperator.java | 1 - .../unique/LongChunkedUniqueOperator.java | 1 - .../unique/LongRollupUniqueOperator.java | 1 - 22 files changed, 371 insertions(+), 162 deletions(-) create mode 100644 engine/table/src/main/java/io/deephaven/engine/table/impl/by/BitmapRandomBuilder.java diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java index 711b2aae192..bde0c7694b6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/AggregationContext.java @@ -234,10 +234,11 @@ ModifiedColumnSet[] getInputModifiedColumnSets(QueryTable input) { * initialization. * * @param resultTable The result {@link QueryTable} after initialization + * @param startingDestinationsCount The number of used destinations at the beginning of this step */ - void propagateInitialStateToOperators(@NotNull final QueryTable resultTable) { + void propagateInitialStateToOperators(@NotNull final QueryTable resultTable, final int startingDestinationsCount) { for (final IterativeChunkedAggregationOperator operator : operators) { - operator.propagateInitialState(resultTable); + operator.propagateInitialState(resultTable, startingDestinationsCount); } } @@ -266,7 +267,7 @@ UnaryOperator[] initializeRefreshing(@NotNull final QueryTabl /** * Allow all operators to reset any per-step internal state. Note that the arguments to this method should not be * mutated in any way. - * + * * @param upstream The upstream {@link TableUpdateImpl} * @param startingDestinationsCount The number of used destinations at the beginning of this step */ @@ -280,7 +281,7 @@ void resetOperatorsForStep(@NotNull final TableUpdate upstream, final int starti * Allow all operators to perform any internal state keeping needed for destinations that were added (went from 0 * keys to > 0), removed (went from > 0 keys to 0), or modified (keys added or removed, or keys modified) by * this iteration. Note that the arguments to this method should not be mutated in any way. - * + * * @param downstream The downstream {@link TableUpdate} (which does not have its {@link ModifiedColumnSet} * finalized yet) * @param newDestinations New destinations added on this update diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BitmapRandomBuilder.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BitmapRandomBuilder.java new file mode 100644 index 00000000000..2ded5be0150 --- /dev/null +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/BitmapRandomBuilder.java @@ -0,0 +1,96 @@ +package io.deephaven.engine.table.impl.by; + +import io.deephaven.engine.rowset.RowSetBuilderRandom; +import io.deephaven.engine.rowset.RowSetBuilderSequential; +import io.deephaven.engine.rowset.RowSetFactory; +import io.deephaven.engine.rowset.WritableRowSet; + +import java.util.Arrays; + +/** + * The output RowSet of an aggregation is fairly special. It is always from zero to the number of output rows, and while + * modifying states we randomly add rows to it, potentially touching the same state many times. The normal index random + * builder does not guarantee those values are de-duplicated and requires O(lg n) operations for each insertion and + * building the RowSet. + *

    + * This version is O(1) for updating a modified slot, then linear in the number of output positions (not the number of + * result values) to build the RowSet. The memory usage is 1 bit per output position, vs. the standard builder is 128 + * bits per used value (though with the possibility of collapsing adjacent ranges when they are modified back-to-back). + * For random access patterns, this version will be more efficient; for friendly patterns the default random builder is + * likely more efficient. + *

    + * We also know that we will only modify the rows that existed when we start, so that we can clamp the maximum key for + * the builder to the maximum output position without loss of fidelity. + */ +public class BitmapRandomBuilder implements RowSetBuilderRandom { + + /** + * An upper bound on {@code lastUsed}. That is, the highest bit index that may be used in {@code bitset}. + */ + final int maxKey; + + /** + * The lowest set bit index in {@code bitset}. + */ + int firstUsed = Integer.MAX_VALUE; + + /** + * The highest set bit index in {@code bitset}. + */ + int lastUsed = -1; + + /** + * The bitset itself. + */ + long[] bitset; + + public BitmapRandomBuilder(int maxKey) { + this.maxKey = maxKey; + } + + private static int rowKeyToArrayIndex(long rowKey) { + return (int) (rowKey / 64); + } + + @Override + public WritableRowSet build() { + final RowSetBuilderSequential seqBuilder = RowSetFactory.builderSequential(); + for (int ii = firstUsed; ii <= lastUsed; ++ii) { + long word = bitset[ii]; + long rowKey = ii * 64L; + + while (word != 0) { + if ((word & 1) != 0) { + seqBuilder.appendKey(rowKey); + } + rowKey++; + word >>>= 1; + } + } + return seqBuilder.build(); + } + + @Override + public void addKey(final long rowKey) { + if (rowKey >= maxKey) { + return; + } + int index = rowKeyToArrayIndex(rowKey); + if (bitset == null) { + final int maxSize = (maxKey + 63) / 64; + bitset = new long[Math.min(maxSize, (index + 1) * 2)]; + } else if (index >= bitset.length) { + final int maxSize = (maxKey + 63) / 64; + bitset = Arrays.copyOf(bitset, Math.min(maxSize, Math.max(bitset.length * 2, index + 1))); + } + bitset[index] |= 1L << rowKey; + firstUsed = Math.min(index, firstUsed); + lastUsed = Math.max(index, lastUsed); + } + + @Override + public void addRange(final long firstRowKey, final long lastRowKey) { + // This class is used only with aggregation state managers, which never call addRange. + throw new UnsupportedOperationException(); + } +} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java index 2b67c7d4e17..923dfded2a6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ByteStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final ByteChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java index c993b44ee86..e8fa4672a25 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/CharStreamSortedFirstOrLastChunkedOperator.java @@ -133,7 +133,7 @@ private boolean addChunk(@NotNull final CharChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java index 280df34f166..2bca15a0c77 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ChunkedOperatorAggregationHelper.java @@ -219,7 +219,7 @@ private static QueryTable aggregation( // Construct the result table final QueryTable result = new QueryTable(resultRowSet, resultColumnSourceMap); - ac.propagateInitialStateToOperators(result); + ac.propagateInitialStateToOperators(result, outputPosition.intValue()); if (input.isRefreshing()) { assert keyColumnsCopied != null; @@ -1593,7 +1593,7 @@ private static QueryTable staticGroupedAggregation(QueryTable withView, String k final QueryTable result = new QueryTable(RowSetFactory.flat(responsiveGroups).toTracking(), resultColumnSourceMap); - ac.propagateInitialStateToOperators(result); + ac.propagateInitialStateToOperators(result, responsiveGroups); final ReverseLookupListener rll = ReverseLookupListener.makeReverseLookupListenerWithSnapshot(result, keyName); ac.setReverseLookupFunction(k -> (int) rll.get(k)); @@ -1957,7 +1957,8 @@ private static QueryTable noKeyAggregation( final QueryTable result = new QueryTable(RowSetFactory.flat(initialResultSize).toTracking(), resultColumnSourceMap); - ac.propagateInitialStateToOperators(result); + // always will create one result for zerokey + ac.propagateInitialStateToOperators(result, 1); if (table.isRefreshing()) { ac.startTrackingPrevValues(); @@ -2397,92 +2398,5 @@ public void addRange(final long firstRowKey, final long lastRowKey) { } } - /** - * The output RowSet of an aggregation is fairly special. It is always from zero to the number of output rows, and - * while modifying states we randomly add rows to it, potentially touching the same state many times. The normal - * index random builder does not guarantee those values are de-duplicated and requires O(lg n) operations for each - * insertion and building the RowSet. - * - * This version is O(1) for updating a modified slot, then linear in the number of output positions (not the number - * of result values) to build the RowSet. The memory usage is 1 bit per output position, vs. the standard builder is - * 128 bits per used value (though with the possibility of collapsing adjacent ranges when they are modified - * back-to-back). For random access patterns, this version will be more efficient; for friendly patterns the default - * random builder is likely more efficient. - * - * We also know that we will only modify the rows that existed when we start, so that we can clamp the maximum key - * for the builder to the maximum output position without loss of fidelity. - */ - private static class BitmapRandomBuilder implements RowSetBuilderRandom { - - /** - * An upper bound on {@code lastUsed}. That is, the highest bit index that may be used in {@code bitset}. - */ - final int maxKey; - - /** - * The lowest set bit index in {@code bitset}. - */ - int firstUsed = Integer.MAX_VALUE; - - /** - * The highest set bit index in {@code bitset}. - */ - int lastUsed = -1; - - /** - * The bitset itself. - */ - long[] bitset; - - private BitmapRandomBuilder(int maxKey) { - this.maxKey = maxKey; - } - - private static int rowKeyToArrayIndex(long rowKey) { - return (int) (rowKey / 64); - } - - @Override - public WritableRowSet build() { - final RowSetBuilderSequential seqBuilder = RowSetFactory.builderSequential(); - for (int ii = firstUsed; ii <= lastUsed; ++ii) { - long word = bitset[ii]; - long rowKey = ii * 64L; - - while (word != 0) { - if ((word & 1) != 0) { - seqBuilder.appendKey(rowKey); - } - rowKey++; - word >>>= 1; - } - } - return seqBuilder.build(); - } - - @Override - public void addKey(final long rowKey) { - if (rowKey >= maxKey) { - return; - } - int index = rowKeyToArrayIndex(rowKey); - if (bitset == null) { - final int maxSize = (maxKey + 63) / 64; - bitset = new long[Math.min(maxSize, (index + 1) * 2)]; - } else if (index >= bitset.length) { - final int maxSize = (maxKey + 63) / 64; - bitset = Arrays.copyOf(bitset, Math.min(maxSize, Math.max(bitset.length * 2, index + 1))); - } - bitset[index] |= 1L << rowKey; - firstUsed = Math.min(index, firstUsed); - lastUsed = Math.max(index, lastUsed); - } - - @Override - public void addRange(final long firstRowKey, final long lastRowKey) { - // This class is used only with aggregation state managers, which never call addRange. - throw new UnsupportedOperationException(); - } - } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java index 5598e6b07e7..4410267e9a9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/DoubleStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final DoubleChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java index bd9171b5954..a6834cbc9ea 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FloatStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final FloatChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java index 0b5b64950ed..203d8eb6451 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/FormulaChunkedOperator.java @@ -28,7 +28,6 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import java.util.function.LongConsumer; import java.util.function.UnaryOperator; import static io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource.BLOCK_SIZE; @@ -36,7 +35,7 @@ /** * An {@link IterativeChunkedAggregationOperator} used in the implementation of {@link Table#applyToAllBy}. */ -class FormulaChunkedOperator implements StateChangeRecorder, IterativeChunkedAggregationOperator { +class FormulaChunkedOperator implements IterativeChunkedAggregationOperator { private final GroupByChunkedOperator groupBy; private final boolean delegateToBy; @@ -101,16 +100,6 @@ class FormulaChunkedOperator implements StateChangeRecorder, IterativeChunkedAgg } } - @Override - public void startRecording(LongConsumer reincarnatedDestinationCallback, LongConsumer emptiedDestinationCallback) { - groupBy.startRecording(reincarnatedDestinationCallback, emptiedDestinationCallback); - } - - @Override - public void finishRecording() { - groupBy.finishRecording(); - } - @Override public void addChunk(final BucketedContext bucketedContext, final Chunk values, @NotNull final LongChunk inputRowKeys, @@ -257,9 +246,9 @@ public void ensureCapacity(final long tableSize) { } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { if (delegateToBy) { - groupBy.propagateInitialState(resultTable); + groupBy.propagateInitialState(resultTable, startingDestinationsCount); } final Map> byResultColumns = groupBy.getResultColumns(); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java index fb8018e0ddf..1a860953f3a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/GroupByChunkedOperator.java @@ -20,6 +20,7 @@ import io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys; import io.deephaven.engine.rowset.chunkattributes.RowKeys; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Arrays; import java.util.LinkedHashMap; @@ -34,20 +35,25 @@ * {@link io.deephaven.api.agg.spec.AggSpecGroup}, and {@link io.deephaven.api.agg.Aggregation#AggGroup(String...)}. */ public final class GroupByChunkedOperator - extends BasicStateChangeRecorder implements IterativeChunkedAggregationOperator { private final QueryTable inputTable; private final boolean registeredWithHelper; private final boolean live; private final ObjectArraySource rowSets; + private final ObjectArraySource addedBuilders; + private final ObjectArraySource removedBuilders; + private final String[] inputColumnNames; private final Map> resultColumns; private final ModifiedColumnSet resultInputsModifiedColumnSet; + private RowSetBuilderRandom stepDestinationsModified; + private boolean stepValuesModified; private boolean someKeyHasAddsOrRemoves; private boolean someKeyHasModifies; + private boolean initialized; GroupByChunkedOperator(@NotNull final QueryTable inputTable, final boolean registeredWithHelper, @NotNull final MatchPair... resultColumnPairs) { @@ -55,6 +61,7 @@ public final class GroupByChunkedOperator this.registeredWithHelper = registeredWithHelper; live = inputTable.isRefreshing(); rowSets = new ObjectArraySource<>(WritableRowSet.class); + addedBuilders = new ObjectArraySource<>(Object.class); resultColumns = Arrays.stream(resultColumnPairs).collect(Collectors.toMap(MatchPair::leftColumn, matchPair -> AggregateColumnSource .make(inputTable.getColumnSource(matchPair.rightColumn()), rowSets), @@ -62,9 +69,12 @@ public final class GroupByChunkedOperator inputColumnNames = MatchPair.getRightColumns(resultColumnPairs); if (live) { resultInputsModifiedColumnSet = inputTable.newModifiedColumnSet(inputColumnNames); + removedBuilders = new ObjectArraySource<>(Object.class); } else { resultInputsModifiedColumnSet = null; + removedBuilders = null; } + initialized = false; } @Override @@ -75,13 +85,12 @@ public void addChunk(final BucketedContext bucketedContext, final Chunk 0; // noinspection unchecked - final LongChunk inputIndicesAsOrdered = (LongChunk) inputRowKeys; + final LongChunk inputRowKeysAsOrdered = (LongChunk) inputRowKeys; for (int ii = 0; ii < startPositions.size(); ++ii) { final int startPosition = startPositions.get(ii); final int runLength = length.get(ii); final long destination = destinations.get(startPosition); - - addChunk(inputIndicesAsOrdered, startPosition, runLength, destination); + addChunk(inputRowKeysAsOrdered, startPosition, runLength, destination); } stateModified.fillWithValue(0, startPositions.size(), true); } @@ -94,13 +103,12 @@ public void removeChunk(final BucketedContext bucketedContext, final Chunk 0; // noinspection unchecked - final LongChunk inputIndicesAsOrdered = (LongChunk) inputRowKeys; + final LongChunk inputRowKeysAsOrdered = (LongChunk) inputRowKeys; for (int ii = 0; ii < startPositions.size(); ++ii) { final int startPosition = startPositions.get(ii); final int runLength = length.get(ii); final long destination = destinations.get(startPosition); - - removeChunk(inputIndicesAsOrdered, startPosition, runLength, destination); + removeChunk(inputRowKeysAsOrdered, startPosition, runLength, destination); } stateModified.fillWithValue(0, startPositions.size(), true); } @@ -214,53 +222,145 @@ public boolean modifyRowKeys(final SingletonContext context, @NotNull final Long private void addChunk(@NotNull final LongChunk indices, final int start, final int length, final long destination) { - final WritableRowSet rowSet = rowSetForSlot(destination); - final boolean wasEmpty = rowSet.isEmpty(); - rowSet.insert(indices, start, length); - if (wasEmpty && rowSet.isNonempty()) { - onReincarnated(destination); + if (length == 0) { + return; + } + if (!initialized) { + // during initialization, all rows are guaranteed to be in-order + accumulateToBuilderSequential(addedBuilders, indices, start, length, destination); + } else { + accumulateToBuilderRandom(addedBuilders, indices, start, length, destination); + } + if (stepDestinationsModified != null) { + stepDestinationsModified.addKey(destination); } } private void addRowsToSlot(@NotNull final RowSet addRowSet, final long destination) { - final WritableRowSet rowSet = rowSetForSlot(destination); - final boolean wasEmpty = rowSet.isEmpty(); - rowSet.insert(addRowSet); - if (wasEmpty && rowSet.isNonempty()) { - onReincarnated(destination); + if (addRowSet.isEmpty()) { + return; + } + if (!initialized) { + // during initialization, all rows are guaranteed to be in-order + accumulateToBuilderSequential(addedBuilders, addRowSet, destination); + } else { + accumulateToBuilderRandom(addedBuilders, addRowSet, destination); } } private void removeChunk(@NotNull final LongChunk indices, final int start, final int length, final long destination) { - final WritableRowSet rowSet = rowSetForSlot(destination); - final boolean wasNonEmpty = rowSet.isNonempty(); - rowSet.remove(indices, start, length); - if (wasNonEmpty && rowSet.isEmpty()) { - onEmptied(destination); + if (length == 0) { + return; } + accumulateToBuilderRandom(removedBuilders, indices, start, length, destination); + stepDestinationsModified.addKey(destination); } - private void doShift(@NotNull final LongChunk preShiftIndices, - @NotNull final LongChunk postShiftIndices, + private void doShift(@NotNull final LongChunk preShiftRowKeys, + @NotNull final LongChunk postShiftRowKeys, final int startPosition, final int runLength, final long destination) { - final WritableRowSet rowSet = rowSetForSlot(destination); - rowSet.remove(preShiftIndices, startPosition, runLength); - rowSet.insert(postShiftIndices, startPosition, runLength); + // treat shift as remove + add + removeChunk(preShiftRowKeys, startPosition, runLength, destination); + addChunk(postShiftRowKeys, startPosition, runLength, destination); + } + + private static void accumulateToBuilderSequential( + @NotNull final ObjectArraySource builderColumn, + @NotNull final LongChunk rowKeysToAdd, + final int start, final int length, final long destination) { + final RowSetBuilderSequential builder = (RowSetBuilderSequential) builderColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with these keys + final RowSetBuilderSequential newBuilder = RowSetFactory.builderSequential(); + newBuilder.appendOrderedRowKeysChunk(rowKeysToAdd, start, length); + builderColumn.set(destination, newBuilder); + return; + } + // add the keys to the stored builder + builder.appendOrderedRowKeysChunk(rowKeysToAdd, start, length); + } + + private static void accumulateToBuilderSequential( + @NotNull final ObjectArraySource builderColumn, + @NotNull final RowSet rowSetToAdd, final long destination) { + final RowSetBuilderSequential builder = (RowSetBuilderSequential) builderColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with this rowset + final RowSetBuilderSequential newBuilder = RowSetFactory.builderSequential(); + newBuilder.appendRowSequence(rowSetToAdd); + builderColumn.set(destination, newBuilder); + return; + } + // add the rowset to the stored builder + builder.appendRowSequence(rowSetToAdd); + } + + + private static void accumulateToBuilderRandom(@NotNull final ObjectArraySource builderColumn, + @NotNull final LongChunk rowKeysToAdd, + final int start, final int length, final long destination) { + final RowSetBuilderRandom builder = (RowSetBuilderRandom) builderColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with these keys + final RowSetBuilderRandom newBuilder = RowSetFactory.builderRandom(); + newBuilder.addOrderedRowKeysChunk(rowKeysToAdd, start, length); + builderColumn.set(destination, newBuilder); + return; + } + // add the keys to the stored builder + builder.addOrderedRowKeysChunk(rowKeysToAdd, start, length); + } + + private static void accumulateToBuilderRandom(@NotNull final ObjectArraySource builderColumn, + @NotNull final RowSet rowSetToAdd, final long destination) { + final RowSetBuilderRandom builder = (RowSetBuilderRandom) builderColumn.getUnsafe(destination); + if (builder == null) { + // create (and store) a new builder, fill with this rowset + final RowSetBuilderRandom newBuilder = RowSetFactory.builderRandom(); + newBuilder.addRowSet(rowSetToAdd); + builderColumn.set(destination, newBuilder); + return; + } + // add the rowset to the stored builder + builder.addRowSet(rowSetToAdd); } - private WritableRowSet rowSetForSlot(final long destination) { - WritableRowSet rowSet = rowSets.getUnsafe(destination); - if (rowSet == null) { - final WritableRowSet empty = RowSetFactory.empty(); - rowSets.set(destination, rowSet = live ? empty.toTracking() : empty); + private static WritableRowSet extractAndClearBuilderRandom( + @NotNull final WritableObjectChunk builderChunk, + final int offset) { + final RowSetBuilderRandom builder = builderChunk.get(offset); + if (builder != null) { + final WritableRowSet rowSet = builder.build(); + builderChunk.set(offset, null); + return rowSet; } - return rowSet; + return null; + } + + private static WritableRowSet extractAndClearBuilderSequential( + @NotNull final WritableObjectChunk builderChunk, + final int offset) { + final RowSetBuilderSequential builder = builderChunk.get(offset); + if (builder != null) { + final WritableRowSet rowSet = builder.build(); + builderChunk.set(offset, null); + return rowSet; + } + return null; + } + + private static WritableRowSet nullToEmpty(@Nullable final WritableRowSet rowSet) { + return rowSet == null ? RowSetFactory.empty() : rowSet; } @Override public void ensureCapacity(final long tableSize) { rowSets.ensureCapacity(tableSize); + addedBuilders.ensureCapacity(tableSize); + if (live) { + removedBuilders.ensureCapacity(tableSize); + } } @Override @@ -335,11 +435,122 @@ public void resetForStep(@NotNull final TableUpdate upstream, final int starting && upstream.modifiedColumnSet().containsAny(resultInputsModifiedColumnSet); someKeyHasAddsOrRemoves = false; someKeyHasModifies = false; + stepDestinationsModified = new BitmapRandomBuilder(startingDestinationsCount); + } + + @Override + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { + Assert.neqTrue(initialized, "initialized"); + + // use the builders to create the initial rowsets + try (final RowSet initialDestinations = RowSetFactory.flat(startingDestinationsCount); + final ResettableWritableObjectChunk rowSetResettableChunk = + ResettableWritableObjectChunk.makeResettableChunk(); + final ResettableWritableObjectChunk addedBuildersResettableChunk = + ResettableWritableObjectChunk.makeResettableChunk(); + final RowSequence.Iterator destinationsIterator = + initialDestinations.getRowSequenceIterator()) { + + // noinspection unchecked + final WritableObjectChunk rowSetBackingChunk = + rowSetResettableChunk.asWritableObjectChunk(); + // noinspection unchecked + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); + + while (destinationsIterator.hasMore()) { + final long firstSliceDestination = destinationsIterator.peekNextKey(); + final long firstBackingChunkDestination = + rowSets.resetWritableChunkToBackingStore(rowSetResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, firstSliceDestination); + + final long lastBackingChunkDestination = + firstBackingChunkDestination + rowSetBackingChunk.size() - 1; + final RowSequence initialDestinationsSlice = + destinationsIterator.getNextRowSequenceThrough(lastBackingChunkDestination); + + initialDestinationsSlice.forAllRowKeys((final long destination) -> { + final int backingChunkOffset = + Math.toIntExact(destination - firstBackingChunkDestination); + final WritableRowSet addRowSet = nullToEmpty( + extractAndClearBuilderSequential(addedBuildersBackingChunk, backingChunkOffset)); + rowSetBackingChunk.set(backingChunkOffset, live ? addRowSet.toTracking() : addRowSet); + }); + } + } + initialized = true; } @Override - public void propagateUpdates(@NotNull final TableUpdate downstream, - @NotNull final RowSet newDestinations) { + public void propagateUpdates(@NotNull final TableUpdate downstream, @NotNull final RowSet newDestinations) { + // get the rowset for the updated items + try (final WritableRowSet stepDestinations = stepDestinationsModified.build()) { + // add the new destinations so a rowset will get created if it doesn't exist + stepDestinations.insert(newDestinations); + + if (stepDestinations.isEmpty()) { + return; + } + + // use the builders to modify the rowsets + try (final ResettableWritableObjectChunk rowSetResettableChunk = + ResettableWritableObjectChunk.makeResettableChunk(); + final ResettableWritableObjectChunk addedBuildersResettableChunk = + ResettableWritableObjectChunk.makeResettableChunk(); + final ResettableWritableObjectChunk removedBuildersResettableChunk = + ResettableWritableObjectChunk.makeResettableChunk(); + final RowSequence.Iterator destinationsIterator = + stepDestinations.getRowSequenceIterator()) { + + // noinspection unchecked + final WritableObjectChunk rowSetBackingChunk = + rowSetResettableChunk.asWritableObjectChunk(); + // noinspection unchecked + final WritableObjectChunk addedBuildersBackingChunk = + addedBuildersResettableChunk.asWritableObjectChunk(); + // noinspection unchecked + final WritableObjectChunk removedBuildersBackingChunk = + removedBuildersResettableChunk.asWritableObjectChunk(); + + while (destinationsIterator.hasMore()) { + final long firstSliceDestination = destinationsIterator.peekNextKey(); + final long firstBackingChunkDestination = + rowSets.resetWritableChunkToBackingStore(rowSetResettableChunk, firstSliceDestination); + addedBuilders.resetWritableChunkToBackingStore(addedBuildersResettableChunk, + firstSliceDestination); + removedBuilders.resetWritableChunkToBackingStore(removedBuildersResettableChunk, + firstSliceDestination); + + final long lastBackingChunkDestination = + firstBackingChunkDestination + rowSetBackingChunk.size() - 1; + final RowSequence initialDestinationsSlice = + destinationsIterator.getNextRowSequenceThrough(lastBackingChunkDestination); + + initialDestinationsSlice.forAllRowKeys((final long destination) -> { + final int backingChunkOffset = + Math.toIntExact(destination - firstBackingChunkDestination); + final WritableRowSet workingRowSet = rowSetBackingChunk.get(backingChunkOffset); + if (workingRowSet == null) { + // use the addRowSet as the new rowset + final WritableRowSet addRowSet = nullToEmpty( + extractAndClearBuilderRandom(addedBuildersBackingChunk, backingChunkOffset)); + rowSetBackingChunk.set(backingChunkOffset, live ? addRowSet.toTracking() : addRowSet); + } else { + try (final WritableRowSet addRowSet = + nullToEmpty(extractAndClearBuilderRandom(addedBuildersBackingChunk, + backingChunkOffset)); + final WritableRowSet removeRowSet = + nullToEmpty(extractAndClearBuilderRandom(removedBuildersBackingChunk, + backingChunkOffset))) { + workingRowSet.remove(removeRowSet); + workingRowSet.insert(addRowSet); + } + } + }); + } + } + stepDestinationsModified = null; + } initializeNewIndexPreviousValues(newDestinations); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java index c3abd87b3a7..206055bf83a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IntStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final IntChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java index 3baad4f4be6..13cad9b5b51 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/IterativeChunkedAggregationOperator.java @@ -275,8 +275,9 @@ default boolean addRowSet(SingletonContext context, RowSet rowSet, long destinat * Perform any internal state keeping needed for destinations that were added during initialization. * * @param resultTable The result {@link QueryTable} after initialization + * @param startingDestinationsCount The number of used destinations at the beginning of this step */ - default void propagateInitialState(@NotNull final QueryTable resultTable) {} + default void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) {} /** * Called after initialization; when the operator's result columns must have previous tracking enabled. @@ -301,7 +302,7 @@ default UnaryOperator initializeRefreshing(@NotNull final Que /** * Reset any per-step internal state. Note that the arguments to this method should not be mutated in any way. - * + * * @param upstream The upstream ShiftAwareListener.Update * @param startingDestinationsCount The number of used destinations at the beginning of this step */ @@ -315,6 +316,7 @@ default void resetForStep(@NotNull TableUpdate upstream, int startingDestination * @param downstream The downstream TableUpdate (which does not have its {@link ModifiedColumnSet} * finalized yet) * @param newDestinations New destinations added on this update + * */ default void propagateUpdates(@NotNull final TableUpdate downstream, @NotNull final RowSet newDestinations) {} diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java index 0434a9023e7..3a457850f1a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/LongStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final LongChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java index 0ae2bf8270a..b1d164da2df 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ObjectStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final ObjectChunk va } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java index e12f155c060..43f448ae049 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/PartitionByChunkedOperator.java @@ -529,7 +529,7 @@ public void ensureCapacity(final long tableSize) { public void startTrackingPrevValues() {} @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { Assert.neqTrue(initialized, "initialized"); final RowSet initialDestinations = resultTable.getRowSet(); if (initialDestinations.isNonempty()) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java index 76bc6b23a25..305a6d189fe 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ShortStreamSortedFirstOrLastChunkedOperator.java @@ -138,7 +138,7 @@ private boolean addChunk(@NotNull final ShortChunk values, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamFirstChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamFirstChunkedOperator.java index 1e090e089da..bd5d0ab77a5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamFirstChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamFirstChunkedOperator.java @@ -149,7 +149,7 @@ private boolean maybeAssignFirst(final long destination, final long sourceIndexK } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; Assert.eq(resultTable.size(), "resultTable.size()", nextDestination, "nextDestination"); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamLastChunkedOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamLastChunkedOperator.java index b37fef1356a..8363824d2af 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamLastChunkedOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/StreamLastChunkedOperator.java @@ -75,7 +75,7 @@ public boolean addRowSet(final SingletonContext context, } @Override - public void propagateInitialState(@NotNull final QueryTable resultTable) { + public void propagateInitialState(@NotNull final QueryTable resultTable, int startingDestinationsCount) { copyStreamToResult(resultTable.getRowSet()); redirections = null; } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java index e3baa25cd91..a24475410e7 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/TDigestPercentileOperator.java @@ -184,7 +184,7 @@ public boolean modifyChunk(SingletonContext context, int chunkSize, Chunk Date: Tue, 27 Sep 2022 10:58:51 -0700 Subject: [PATCH 152/215] Bump node and protoc base images (#2915) --- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- .../pydeephaven/proto/application_pb2.py | 32 +- py/client/pydeephaven/proto/console_pb2.py | 390 +----------- py/client/pydeephaven/proto/inputtable_pb2.py | 40 +- py/client/pydeephaven/proto/object_pb2.py | 24 +- .../pydeephaven/proto/partitionedtable_pb2.py | 48 +- py/client/pydeephaven/proto/session_pb2.py | 114 +--- py/client/pydeephaven/proto/table_pb2.py | 584 +----------------- py/client/pydeephaven/proto/ticket_pb2.py | 23 +- 10 files changed, 26 insertions(+), 1233 deletions(-) diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index fda873af989..a562ba75c0f 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:6adfb0c2a9db12a06893974bb140493a7482e2b3df59c058590594ceecd0c99b +deephaven.registry.imageId=node@sha256:500c729bf9b75de8aee647d70b68dc16eb14991d74bbf033c5ffdb667bbef704 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 3dc06f82c69..f2314091bc8 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:228b372ed0e528657f4a6b805d2c30e1db788936536b11816592699dff883a9c +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:64195abea37d59c7f9c9beff8661b11e06d2e3a001c980033b09ff61d960c8b9 diff --git a/py/client/pydeephaven/proto/application_pb2.py b/py/client/pydeephaven/proto/application_pb2.py index 97aa0134969..cb0a5ef9b6d 100644 --- a/py/client/pydeephaven/proto/application_pb2.py +++ b/py/client/pydeephaven/proto/application_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: deephaven/proto/application.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,33 +16,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!deephaven/proto/application.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x13\n\x11ListFieldsRequest\"\xd1\x01\n\x12\x46ieldsChangeUpdate\x12=\n\x07\x63reated\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07updated\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\x12=\n\x07removed\x18\x03 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.FieldInfo\"\xb2\x01\n\tFieldInfo\x12\x44\n\x0ctyped_ticket\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12\x19\n\x11\x66ield_description\x18\x03 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t2\x93\x01\n\x12\x41pplicationService\x12}\n\nListFields\x12\x34.io.deephaven.proto.backplane.grpc.ListFieldsRequest\x1a\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\x00\x30\x01\x42GH\x01P\x01ZAgithub.com/deephaven/deephaven-core/go/internal/proto/applicationb\x06proto3') - - -_LISTFIELDSREQUEST = DESCRIPTOR.message_types_by_name['ListFieldsRequest'] -_FIELDSCHANGEUPDATE = DESCRIPTOR.message_types_by_name['FieldsChangeUpdate'] -_FIELDINFO = DESCRIPTOR.message_types_by_name['FieldInfo'] -ListFieldsRequest = _reflection.GeneratedProtocolMessageType('ListFieldsRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTFIELDSREQUEST, - '__module__' : 'pydeephaven.proto.application_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ListFieldsRequest) - }) -_sym_db.RegisterMessage(ListFieldsRequest) - -FieldsChangeUpdate = _reflection.GeneratedProtocolMessageType('FieldsChangeUpdate', (_message.Message,), { - 'DESCRIPTOR' : _FIELDSCHANGEUPDATE, - '__module__' : 'pydeephaven.proto.application_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FieldsChangeUpdate) - }) -_sym_db.RegisterMessage(FieldsChangeUpdate) - -FieldInfo = _reflection.GeneratedProtocolMessageType('FieldInfo', (_message.Message,), { - 'DESCRIPTOR' : _FIELDINFO, - '__module__' : 'pydeephaven.proto.application_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FieldInfo) - }) -_sym_db.RegisterMessage(FieldInfo) - -_APPLICATIONSERVICE = DESCRIPTOR.services_by_name['ApplicationService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.application_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/py/client/pydeephaven/proto/console_pb2.py b/py/client/pydeephaven/proto/console_pb2.py index f5f4975301a..d5b4c4f51c6 100644 --- a/py/client/pydeephaven/proto/console_pb2.py +++ b/py/client/pydeephaven/proto/console_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: deephaven/proto/console.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -18,391 +17,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/console.proto\x12(io.deephaven.proto.backplane.script.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\x1a!deephaven/proto/application.proto\"\x18\n\x16GetConsoleTypesRequest\"0\n\x17GetConsoleTypesResponse\x12\x15\n\rconsole_types\x18\x01 \x03(\t\"i\n\x13StartConsoleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x14\n\x0csession_type\x18\x02 \x01(\t\"T\n\x14StartConsoleResponse\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x14\n\x12GetHeapInfoRequest\"`\n\x13GetHeapInfoResponse\x12\x16\n\nmax_memory\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x18\n\x0ctotal_memory\x18\x02 \x01(\x03\x42\x02\x30\x01\x12\x17\n\x0b\x66ree_memory\x18\x03 \x01(\x03\x42\x02\x30\x01\"M\n\x16LogSubscriptionRequest\x12#\n\x17last_seen_log_timestamp\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x0e\n\x06levels\x18\x02 \x03(\t\"S\n\x13LogSubscriptionData\x12\x12\n\x06micros\x18\x01 \x01(\x03\x42\x02\x30\x01\x12\x11\n\tlog_level\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05\"j\n\x15\x45xecuteCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04\x63ode\x18\x03 \x01(\tJ\x04\x08\x02\x10\x03\"w\n\x16\x45xecuteCommandResponse\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x46\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FieldsChangeUpdate\"\xb5\x01\n\x1a\x42indTableToVariableRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x15\n\rvariable_name\x18\x03 \x01(\t\x12;\n\x08table_id\x18\x04 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.TicketJ\x04\x08\x02\x10\x03\"\x1d\n\x1b\x42indTableToVariableResponse\"\x94\x01\n\x14\x43\x61ncelCommandRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12=\n\ncommand_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x17\n\x15\x43\x61ncelCommandResponse\"\x93\x03\n\x13\x41utoCompleteRequest\x12V\n\ropen_document\x18\x01 \x01(\x0b\x32=.io.deephaven.proto.backplane.script.grpc.OpenDocumentRequestH\x00\x12Z\n\x0f\x63hange_document\x18\x02 \x01(\x0b\x32?.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequestH\x00\x12\x63\n\x14get_completion_items\x18\x03 \x01(\x0b\x32\x43.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequestH\x00\x12X\n\x0e\x63lose_document\x18\x04 \x01(\x0b\x32>.io.deephaven.proto.backplane.script.grpc.CloseDocumentRequestH\x00\x42\t\n\x07request\"\x84\x01\n\x14\x41utoCompleteResponse\x12`\n\x10\x63ompletion_items\x18\x01 \x01(\x0b\x32\x44.io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponseH\x00\x42\n\n\x08response\"\x15\n\x13\x42rowserNextResponse\"\xa7\x01\n\x13OpenDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\rtext_document\x18\x02 \x01(\x0b\x32:.io.deephaven.proto.backplane.script.grpc.TextDocumentItem\"S\n\x10TextDocumentItem\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0blanguage_id\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x0c\n\x04text\x18\x04 \x01(\t\"\xb7\x01\n\x14\x43loseDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\"\xc0\x03\n\x15\x43hangeDocumentRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12`\n\rtext_document\x18\x02 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12w\n\x0f\x63ontent_changes\x18\x03 \x03(\x0b\x32^.io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent\x1a\x8c\x01\n\x1eTextDocumentContentChangeEvent\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x14\n\x0crange_length\x18\x02 \x01(\x05\x12\x0c\n\x04text\x18\x03 \x01(\t\"\x93\x01\n\rDocumentRange\x12\x41\n\x05start\x18\x01 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12?\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\"?\n\x1fVersionedTextDocumentIdentifier\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"+\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x05\x12\x11\n\tcharacter\x18\x02 \x01(\x05\"\xe4\x02\n\x19GetCompletionItemsRequest\x12=\n\nconsole_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x07\x63ontext\x18\x02 \x01(\x0b\x32;.io.deephaven.proto.backplane.script.grpc.CompletionContext\x12`\n\rtext_document\x18\x03 \x01(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier\x12\x44\n\x08position\x18\x04 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.Position\x12\x12\n\nrequest_id\x18\x05 \x01(\x05\"D\n\x11\x43ompletionContext\x12\x14\n\x0ctrigger_kind\x18\x01 \x01(\x05\x12\x19\n\x11trigger_character\x18\x02 \x01(\t\"\x8a\x01\n\x1aGetCompletionItemsResponse\x12G\n\x05items\x18\x01 \x03(\x0b\x32\x38.io.deephaven.proto.backplane.script.grpc.CompletionItem\x12\x12\n\nrequest_id\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x08\"\x93\x03\n\x0e\x43ompletionItem\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0e\n\x06length\x18\x02 \x01(\x05\x12\r\n\x05label\x18\x03 \x01(\t\x12\x0c\n\x04kind\x18\x04 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x15\n\rdocumentation\x18\x06 \x01(\t\x12\x12\n\ndeprecated\x18\x07 \x01(\x08\x12\x11\n\tpreselect\x18\x08 \x01(\x08\x12\x45\n\ttext_edit\x18\t \x01(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x11\n\tsort_text\x18\n \x01(\t\x12\x13\n\x0b\x66ilter_text\x18\x0b \x01(\t\x12\x1a\n\x12insert_text_format\x18\x0c \x01(\x05\x12Q\n\x15\x61\x64\x64itional_text_edits\x18\r \x03(\x0b\x32\x32.io.deephaven.proto.backplane.script.grpc.TextEdit\x12\x19\n\x11\x63ommit_characters\x18\x0e \x03(\t\"`\n\x08TextEdit\x12\x46\n\x05range\x18\x01 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.script.grpc.DocumentRange\x12\x0c\n\x04text\x18\x02 \x01(\t\"\xc5\x30\n\x10\x46igureDescriptor\x12\x12\n\x05title\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x02 \x01(\t\x12\x13\n\x0btitle_color\x18\x03 \x01(\t\x12\x1b\n\x0fupdate_interval\x18\x07 \x01(\x03\x42\x02\x30\x01\x12\x0c\n\x04\x63ols\x18\x08 \x01(\x05\x12\x0c\n\x04rows\x18\t \x01(\x05\x12Z\n\x06\x63harts\x18\n \x03(\x0b\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor\x12\x0e\n\x06\x65rrors\x18\r \x03(\t\x1a\xad\x05\n\x0f\x43hartDescriptor\x12\x0f\n\x07\x63olspan\x18\x01 \x01(\x05\x12\x0f\n\x07rowspan\x18\x02 \x01(\x05\x12[\n\x06series\x18\x03 \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor\x12\x66\n\x0cmulti_series\x18\x04 \x03(\x0b\x32P.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor\x12W\n\x04\x61xes\x18\x05 \x03(\x0b\x32I.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor\x12h\n\nchart_type\x18\x06 \x01(\x0e\x32T.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor.ChartType\x12\x12\n\x05title\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x12\n\ntitle_font\x18\x08 \x01(\t\x12\x13\n\x0btitle_color\x18\t \x01(\t\x12\x13\n\x0bshow_legend\x18\n \x01(\x08\x12\x13\n\x0blegend_font\x18\x0b \x01(\t\x12\x14\n\x0clegend_color\x18\x0c \x01(\t\x12\x0c\n\x04is3d\x18\r \x01(\x08\"[\n\tChartType\x12\x06\n\x02XY\x10\x00\x12\x07\n\x03PIE\x10\x01\x12\x08\n\x04OHLC\x10\x02\x12\x0c\n\x08\x43\x41TEGORY\x10\x03\x12\x07\n\x03XYZ\x10\x04\x12\x0f\n\x0b\x43\x41TEGORY_3D\x10\x05\x12\x0b\n\x07TREEMAP\x10\x06\x42\x08\n\x06_title\x1a\xfe\x04\n\x10SeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1a\n\rlines_visible\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0eshapes_visible\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x18\n\x10gradient_visible\x18\x05 \x01(\x08\x12\x12\n\nline_color\x18\x06 \x01(\t\x12\x1f\n\x12point_label_format\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1f\n\x12x_tool_tip_pattern\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12y_tool_tip_pattern\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x0bshape_label\x18\x0b \x01(\t\x12\x17\n\nshape_size\x18\x0c \x01(\x01H\x05\x88\x01\x01\x12\x13\n\x0bshape_color\x18\r \x01(\t\x12\r\n\x05shape\x18\x0e \x01(\t\x12\x61\n\x0c\x64\x61ta_sources\x18\x0f \x03(\x0b\x32K.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptorB\x10\n\x0e_lines_visibleB\x11\n\x0f_shapes_visibleB\x15\n\x13_point_label_formatB\x15\n\x13_x_tool_tip_patternB\x15\n\x13_y_tool_tip_patternB\r\n\x0b_shape_sizeJ\x04\x08\x07\x10\x08\x1a\xec\n\n\x15MultiSeriesDescriptor\x12^\n\nplot_style\x18\x01 \x01(\x0e\x32J.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesPlotStyle\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x63\n\nline_color\x18\x03 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_color\x18\x04 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\rlines_visible\x18\x05 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12\x65\n\x0epoints_visible\x18\x06 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12g\n\x10gradient_visible\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault\x12k\n\x12point_label_format\x18\x08 \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12x_tool_tip_pattern\x18\t \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12k\n\x12y_tool_tip_pattern\x18\n \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x64\n\x0bpoint_label\x18\x0b \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12\x63\n\npoint_size\x18\x0c \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault\x12\x64\n\x0bpoint_shape\x18\r \x01(\x0b\x32O.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault\x12l\n\x0c\x64\x61ta_sources\x18\x0e \x03(\x0b\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor\x1a\x64\n\x14StringMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_string\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\tB\x11\n\x0f_default_string\x1a\x64\n\x14\x44oubleMapWithDefault\x12\x1b\n\x0e\x64\x65\x66\x61ult_double\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x01\x42\x11\n\x0f_default_double\x1a^\n\x12\x42oolMapWithDefault\x12\x19\n\x0c\x64\x65\x66\x61ult_bool\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x02 \x03(\t\x12\x0e\n\x06values\x18\x03 \x03(\x08\x42\x0f\n\r_default_bool\x1a\xa6\x08\n\x0e\x41xisDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12m\n\x0b\x66ormat_type\x18\x02 \x01(\x0e\x32X.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisFormatType\x12`\n\x04type\x18\x03 \x01(\x0e\x32R.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisType\x12h\n\x08position\x18\x04 \x01(\x0e\x32V.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor.AxisPosition\x12\x0b\n\x03log\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t\x12\x12\n\nlabel_font\x18\x07 \x01(\t\x12\x12\n\nticks_font\x18\x08 \x01(\t\x12\x1b\n\x0e\x66ormat_pattern\x18\t \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\n \x01(\t\x12\x11\n\tmin_range\x18\x0b \x01(\x01\x12\x11\n\tmax_range\x18\x0c \x01(\x01\x12\x1b\n\x13minor_ticks_visible\x18\r \x01(\x08\x12\x1b\n\x13major_ticks_visible\x18\x0e \x01(\x08\x12\x18\n\x10minor_tick_count\x18\x0f \x01(\x05\x12$\n\x17gap_between_major_ticks\x18\x10 \x01(\x01H\x01\x88\x01\x01\x12\x1c\n\x14major_tick_locations\x18\x11 \x03(\x01\x12\x18\n\x10tick_label_angle\x18\x12 \x01(\x01\x12\x0e\n\x06invert\x18\x13 \x01(\x08\x12\x14\n\x0cis_time_axis\x18\x14 \x01(\x08\x12{\n\x1c\x62usiness_calendar_descriptor\x18\x15 \x01(\x0b\x32U.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor\"*\n\x0e\x41xisFormatType\x12\x0c\n\x08\x43\x41TEGORY\x10\x00\x12\n\n\x06NUMBER\x10\x01\"C\n\x08\x41xisType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\t\n\x05SHAPE\x10\x02\x12\x08\n\x04SIZE\x10\x03\x12\t\n\x05LABEL\x10\x04\x12\t\n\x05\x43OLOR\x10\x05\"B\n\x0c\x41xisPosition\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x42OTTOM\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\x11\n\x0f_format_patternB\x1a\n\x18_gap_between_major_ticks\x1a\xf0\x06\n\x1a\x42usinessCalendarDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12v\n\rbusiness_days\x18\x03 \x03(\x0e\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.DayOfWeek\x12~\n\x10\x62usiness_periods\x18\x04 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x12o\n\x08holidays\x18\x05 \x03(\x0b\x32].io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday\x1a-\n\x0e\x42usinessPeriod\x12\x0c\n\x04open\x18\x01 \x01(\t\x12\r\n\x05\x63lose\x18\x02 \x01(\t\x1a\xf8\x01\n\x07Holiday\x12m\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32_.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate\x12~\n\x10\x62usiness_periods\x18\x02 \x03(\x0b\x32\x64.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod\x1a\x35\n\tLocalDate\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\"g\n\tDayOfWeek\x12\n\n\x06SUNDAY\x10\x00\x12\n\n\x06MONDAY\x10\x01\x12\x0b\n\x07TUESDAY\x10\x02\x12\r\n\tWEDNESDAY\x10\x03\x12\x0c\n\x08THURSDAY\x10\x04\x12\n\n\x06\x46RIDAY\x10\x05\x12\x0c\n\x08SATURDAY\x10\x06\x1a\xb6\x01\n\x1bMultiSeriesSourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x1c\n\x14partitioned_table_id\x18\x03 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x04 \x01(\t\x1a\xb4\x02\n\x10SourceDescriptor\x12\x0f\n\x07\x61xis_id\x18\x01 \x01(\t\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceType\x12\x10\n\x08table_id\x18\x03 \x01(\x05\x12\x1c\n\x14partitioned_table_id\x18\x04 \x01(\x05\x12\x13\n\x0b\x63olumn_name\x18\x05 \x01(\t\x12\x13\n\x0b\x63olumn_type\x18\x06 \x01(\t\x12`\n\tone_click\x18\x07 \x01(\x0b\x32M.io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor\x1a\x63\n\x12OneClickDescriptor\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\x14\n\x0c\x63olumn_types\x18\x02 \x03(\t\x12&\n\x1erequire_all_filters_to_display\x18\x03 \x01(\x08\"\xa6\x01\n\x0fSeriesPlotStyle\x12\x07\n\x03\x42\x41R\x10\x00\x12\x0f\n\x0bSTACKED_BAR\x10\x01\x12\x08\n\x04LINE\x10\x02\x12\x08\n\x04\x41REA\x10\x03\x12\x10\n\x0cSTACKED_AREA\x10\x04\x12\x07\n\x03PIE\x10\x05\x12\r\n\tHISTOGRAM\x10\x06\x12\x08\n\x04OHLC\x10\x07\x12\x0b\n\x07SCATTER\x10\x08\x12\x08\n\x04STEP\x10\t\x12\r\n\tERROR_BAR\x10\n\x12\x0b\n\x07TREEMAP\x10\x0b\"\xd2\x01\n\nSourceType\x12\x05\n\x01X\x10\x00\x12\x05\n\x01Y\x10\x01\x12\x05\n\x01Z\x10\x02\x12\t\n\x05X_LOW\x10\x03\x12\n\n\x06X_HIGH\x10\x04\x12\t\n\x05Y_LOW\x10\x05\x12\n\n\x06Y_HIGH\x10\x06\x12\x08\n\x04TIME\x10\x07\x12\x08\n\x04OPEN\x10\x08\x12\x08\n\x04HIGH\x10\t\x12\x07\n\x03LOW\x10\n\x12\t\n\x05\x43LOSE\x10\x0b\x12\t\n\x05SHAPE\x10\x0c\x12\x08\n\x04SIZE\x10\r\x12\t\n\x05LABEL\x10\x0e\x12\t\n\x05\x43OLOR\x10\x0f\x12\n\n\x06PARENT\x10\x10\x12\x0e\n\nHOVER_TEXT\x10\x11\x12\x08\n\x04TEXT\x10\x12\x42\x08\n\x06_titleJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\r2\x8e\x0c\n\x0e\x43onsoleService\x12\x98\x01\n\x0fGetConsoleTypes\x12@.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest\x1a\x41.io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse\"\x00\x12\x8f\x01\n\x0cStartConsole\x12=.io.deephaven.proto.backplane.script.grpc.StartConsoleRequest\x1a>.io.deephaven.proto.backplane.script.grpc.StartConsoleResponse\"\x00\x12\x8c\x01\n\x0bGetHeapInfo\x12<.io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest\x1a=.io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse\"\x00\x12\x96\x01\n\x0fSubscribeToLogs\x12@.io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest\x1a=.io.deephaven.proto.backplane.script.grpc.LogSubscriptionData\"\x00\x30\x01\x12\x95\x01\n\x0e\x45xecuteCommand\x12?.io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest\x1a@.io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse\"\x00\x12\x92\x01\n\rCancelCommand\x12>.io.deephaven.proto.backplane.script.grpc.CancelCommandRequest\x1a?.io.deephaven.proto.backplane.script.grpc.CancelCommandResponse\"\x00\x12\xa4\x01\n\x13\x42indTableToVariable\x12\x44.io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest\x1a\x45.io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse\"\x00\x12\x99\x01\n\x12\x41utoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00(\x01\x30\x01\x12\x9b\x01\n\x16OpenAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a>.io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse\"\x00\x30\x01\x12\x98\x01\n\x16NextAutoCompleteStream\x12=.io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest\x1a=.io.deephaven.proto.backplane.script.grpc.BrowserNextResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/consoleb\x06proto3') - - -_GETCONSOLETYPESREQUEST = DESCRIPTOR.message_types_by_name['GetConsoleTypesRequest'] -_GETCONSOLETYPESRESPONSE = DESCRIPTOR.message_types_by_name['GetConsoleTypesResponse'] -_STARTCONSOLEREQUEST = DESCRIPTOR.message_types_by_name['StartConsoleRequest'] -_STARTCONSOLERESPONSE = DESCRIPTOR.message_types_by_name['StartConsoleResponse'] -_GETHEAPINFOREQUEST = DESCRIPTOR.message_types_by_name['GetHeapInfoRequest'] -_GETHEAPINFORESPONSE = DESCRIPTOR.message_types_by_name['GetHeapInfoResponse'] -_LOGSUBSCRIPTIONREQUEST = DESCRIPTOR.message_types_by_name['LogSubscriptionRequest'] -_LOGSUBSCRIPTIONDATA = DESCRIPTOR.message_types_by_name['LogSubscriptionData'] -_EXECUTECOMMANDREQUEST = DESCRIPTOR.message_types_by_name['ExecuteCommandRequest'] -_EXECUTECOMMANDRESPONSE = DESCRIPTOR.message_types_by_name['ExecuteCommandResponse'] -_BINDTABLETOVARIABLEREQUEST = DESCRIPTOR.message_types_by_name['BindTableToVariableRequest'] -_BINDTABLETOVARIABLERESPONSE = DESCRIPTOR.message_types_by_name['BindTableToVariableResponse'] -_CANCELCOMMANDREQUEST = DESCRIPTOR.message_types_by_name['CancelCommandRequest'] -_CANCELCOMMANDRESPONSE = DESCRIPTOR.message_types_by_name['CancelCommandResponse'] -_AUTOCOMPLETEREQUEST = DESCRIPTOR.message_types_by_name['AutoCompleteRequest'] -_AUTOCOMPLETERESPONSE = DESCRIPTOR.message_types_by_name['AutoCompleteResponse'] -_BROWSERNEXTRESPONSE = DESCRIPTOR.message_types_by_name['BrowserNextResponse'] -_OPENDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['OpenDocumentRequest'] -_TEXTDOCUMENTITEM = DESCRIPTOR.message_types_by_name['TextDocumentItem'] -_CLOSEDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['CloseDocumentRequest'] -_CHANGEDOCUMENTREQUEST = DESCRIPTOR.message_types_by_name['ChangeDocumentRequest'] -_CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT = _CHANGEDOCUMENTREQUEST.nested_types_by_name['TextDocumentContentChangeEvent'] -_DOCUMENTRANGE = DESCRIPTOR.message_types_by_name['DocumentRange'] -_VERSIONEDTEXTDOCUMENTIDENTIFIER = DESCRIPTOR.message_types_by_name['VersionedTextDocumentIdentifier'] -_POSITION = DESCRIPTOR.message_types_by_name['Position'] -_GETCOMPLETIONITEMSREQUEST = DESCRIPTOR.message_types_by_name['GetCompletionItemsRequest'] -_COMPLETIONCONTEXT = DESCRIPTOR.message_types_by_name['CompletionContext'] -_GETCOMPLETIONITEMSRESPONSE = DESCRIPTOR.message_types_by_name['GetCompletionItemsResponse'] -_COMPLETIONITEM = DESCRIPTOR.message_types_by_name['CompletionItem'] -_TEXTEDIT = DESCRIPTOR.message_types_by_name['TextEdit'] -_FIGUREDESCRIPTOR = DESCRIPTOR.message_types_by_name['FigureDescriptor'] -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['ChartDescriptor'] -_FIGUREDESCRIPTOR_SERIESDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['SeriesDescriptor'] -_FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['MultiSeriesDescriptor'] -_FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['StringMapWithDefault'] -_FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['DoubleMapWithDefault'] -_FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT = _FIGUREDESCRIPTOR.nested_types_by_name['BoolMapWithDefault'] -_FIGUREDESCRIPTOR_AXISDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['AxisDescriptor'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['BusinessCalendarDescriptor'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['BusinessPeriod'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['Holiday'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.nested_types_by_name['LocalDate'] -_FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['MultiSeriesSourceDescriptor'] -_FIGUREDESCRIPTOR_SOURCEDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['SourceDescriptor'] -_FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR = _FIGUREDESCRIPTOR.nested_types_by_name['OneClickDescriptor'] -_FIGUREDESCRIPTOR_CHARTDESCRIPTOR_CHARTTYPE = _FIGUREDESCRIPTOR_CHARTDESCRIPTOR.enum_types_by_name['ChartType'] -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISFORMATTYPE = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisFormatType'] -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISTYPE = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisType'] -_FIGUREDESCRIPTOR_AXISDESCRIPTOR_AXISPOSITION = _FIGUREDESCRIPTOR_AXISDESCRIPTOR.enum_types_by_name['AxisPosition'] -_FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_DAYOFWEEK = _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR.enum_types_by_name['DayOfWeek'] -_FIGUREDESCRIPTOR_SERIESPLOTSTYLE = _FIGUREDESCRIPTOR.enum_types_by_name['SeriesPlotStyle'] -_FIGUREDESCRIPTOR_SOURCETYPE = _FIGUREDESCRIPTOR.enum_types_by_name['SourceType'] -GetConsoleTypesRequest = _reflection.GeneratedProtocolMessageType('GetConsoleTypesRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETCONSOLETYPESREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesRequest) - }) -_sym_db.RegisterMessage(GetConsoleTypesRequest) - -GetConsoleTypesResponse = _reflection.GeneratedProtocolMessageType('GetConsoleTypesResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETCONSOLETYPESRESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetConsoleTypesResponse) - }) -_sym_db.RegisterMessage(GetConsoleTypesResponse) - -StartConsoleRequest = _reflection.GeneratedProtocolMessageType('StartConsoleRequest', (_message.Message,), { - 'DESCRIPTOR' : _STARTCONSOLEREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.StartConsoleRequest) - }) -_sym_db.RegisterMessage(StartConsoleRequest) - -StartConsoleResponse = _reflection.GeneratedProtocolMessageType('StartConsoleResponse', (_message.Message,), { - 'DESCRIPTOR' : _STARTCONSOLERESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.StartConsoleResponse) - }) -_sym_db.RegisterMessage(StartConsoleResponse) - -GetHeapInfoRequest = _reflection.GeneratedProtocolMessageType('GetHeapInfoRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETHEAPINFOREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetHeapInfoRequest) - }) -_sym_db.RegisterMessage(GetHeapInfoRequest) - -GetHeapInfoResponse = _reflection.GeneratedProtocolMessageType('GetHeapInfoResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETHEAPINFORESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetHeapInfoResponse) - }) -_sym_db.RegisterMessage(GetHeapInfoResponse) - -LogSubscriptionRequest = _reflection.GeneratedProtocolMessageType('LogSubscriptionRequest', (_message.Message,), { - 'DESCRIPTOR' : _LOGSUBSCRIPTIONREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.LogSubscriptionRequest) - }) -_sym_db.RegisterMessage(LogSubscriptionRequest) - -LogSubscriptionData = _reflection.GeneratedProtocolMessageType('LogSubscriptionData', (_message.Message,), { - 'DESCRIPTOR' : _LOGSUBSCRIPTIONDATA, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.LogSubscriptionData) - }) -_sym_db.RegisterMessage(LogSubscriptionData) - -ExecuteCommandRequest = _reflection.GeneratedProtocolMessageType('ExecuteCommandRequest', (_message.Message,), { - 'DESCRIPTOR' : _EXECUTECOMMANDREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.ExecuteCommandRequest) - }) -_sym_db.RegisterMessage(ExecuteCommandRequest) - -ExecuteCommandResponse = _reflection.GeneratedProtocolMessageType('ExecuteCommandResponse', (_message.Message,), { - 'DESCRIPTOR' : _EXECUTECOMMANDRESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.ExecuteCommandResponse) - }) -_sym_db.RegisterMessage(ExecuteCommandResponse) - -BindTableToVariableRequest = _reflection.GeneratedProtocolMessageType('BindTableToVariableRequest', (_message.Message,), { - 'DESCRIPTOR' : _BINDTABLETOVARIABLEREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.BindTableToVariableRequest) - }) -_sym_db.RegisterMessage(BindTableToVariableRequest) - -BindTableToVariableResponse = _reflection.GeneratedProtocolMessageType('BindTableToVariableResponse', (_message.Message,), { - 'DESCRIPTOR' : _BINDTABLETOVARIABLERESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.BindTableToVariableResponse) - }) -_sym_db.RegisterMessage(BindTableToVariableResponse) - -CancelCommandRequest = _reflection.GeneratedProtocolMessageType('CancelCommandRequest', (_message.Message,), { - 'DESCRIPTOR' : _CANCELCOMMANDREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CancelCommandRequest) - }) -_sym_db.RegisterMessage(CancelCommandRequest) - -CancelCommandResponse = _reflection.GeneratedProtocolMessageType('CancelCommandResponse', (_message.Message,), { - 'DESCRIPTOR' : _CANCELCOMMANDRESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CancelCommandResponse) - }) -_sym_db.RegisterMessage(CancelCommandResponse) - -AutoCompleteRequest = _reflection.GeneratedProtocolMessageType('AutoCompleteRequest', (_message.Message,), { - 'DESCRIPTOR' : _AUTOCOMPLETEREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.AutoCompleteRequest) - }) -_sym_db.RegisterMessage(AutoCompleteRequest) - -AutoCompleteResponse = _reflection.GeneratedProtocolMessageType('AutoCompleteResponse', (_message.Message,), { - 'DESCRIPTOR' : _AUTOCOMPLETERESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.AutoCompleteResponse) - }) -_sym_db.RegisterMessage(AutoCompleteResponse) - -BrowserNextResponse = _reflection.GeneratedProtocolMessageType('BrowserNextResponse', (_message.Message,), { - 'DESCRIPTOR' : _BROWSERNEXTRESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.BrowserNextResponse) - }) -_sym_db.RegisterMessage(BrowserNextResponse) - -OpenDocumentRequest = _reflection.GeneratedProtocolMessageType('OpenDocumentRequest', (_message.Message,), { - 'DESCRIPTOR' : _OPENDOCUMENTREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.OpenDocumentRequest) - }) -_sym_db.RegisterMessage(OpenDocumentRequest) - -TextDocumentItem = _reflection.GeneratedProtocolMessageType('TextDocumentItem', (_message.Message,), { - 'DESCRIPTOR' : _TEXTDOCUMENTITEM, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.TextDocumentItem) - }) -_sym_db.RegisterMessage(TextDocumentItem) - -CloseDocumentRequest = _reflection.GeneratedProtocolMessageType('CloseDocumentRequest', (_message.Message,), { - 'DESCRIPTOR' : _CLOSEDOCUMENTREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CloseDocumentRequest) - }) -_sym_db.RegisterMessage(CloseDocumentRequest) - -ChangeDocumentRequest = _reflection.GeneratedProtocolMessageType('ChangeDocumentRequest', (_message.Message,), { - - 'TextDocumentContentChangeEvent' : _reflection.GeneratedProtocolMessageType('TextDocumentContentChangeEvent', (_message.Message,), { - 'DESCRIPTOR' : _CHANGEDOCUMENTREQUEST_TEXTDOCUMENTCONTENTCHANGEEVENT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest.TextDocumentContentChangeEvent) - }) - , - 'DESCRIPTOR' : _CHANGEDOCUMENTREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.ChangeDocumentRequest) - }) -_sym_db.RegisterMessage(ChangeDocumentRequest) -_sym_db.RegisterMessage(ChangeDocumentRequest.TextDocumentContentChangeEvent) - -DocumentRange = _reflection.GeneratedProtocolMessageType('DocumentRange', (_message.Message,), { - 'DESCRIPTOR' : _DOCUMENTRANGE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.DocumentRange) - }) -_sym_db.RegisterMessage(DocumentRange) - -VersionedTextDocumentIdentifier = _reflection.GeneratedProtocolMessageType('VersionedTextDocumentIdentifier', (_message.Message,), { - 'DESCRIPTOR' : _VERSIONEDTEXTDOCUMENTIDENTIFIER, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.VersionedTextDocumentIdentifier) - }) -_sym_db.RegisterMessage(VersionedTextDocumentIdentifier) - -Position = _reflection.GeneratedProtocolMessageType('Position', (_message.Message,), { - 'DESCRIPTOR' : _POSITION, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.Position) - }) -_sym_db.RegisterMessage(Position) - -GetCompletionItemsRequest = _reflection.GeneratedProtocolMessageType('GetCompletionItemsRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETCOMPLETIONITEMSREQUEST, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsRequest) - }) -_sym_db.RegisterMessage(GetCompletionItemsRequest) - -CompletionContext = _reflection.GeneratedProtocolMessageType('CompletionContext', (_message.Message,), { - 'DESCRIPTOR' : _COMPLETIONCONTEXT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CompletionContext) - }) -_sym_db.RegisterMessage(CompletionContext) - -GetCompletionItemsResponse = _reflection.GeneratedProtocolMessageType('GetCompletionItemsResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETCOMPLETIONITEMSRESPONSE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.GetCompletionItemsResponse) - }) -_sym_db.RegisterMessage(GetCompletionItemsResponse) - -CompletionItem = _reflection.GeneratedProtocolMessageType('CompletionItem', (_message.Message,), { - 'DESCRIPTOR' : _COMPLETIONITEM, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.CompletionItem) - }) -_sym_db.RegisterMessage(CompletionItem) - -TextEdit = _reflection.GeneratedProtocolMessageType('TextEdit', (_message.Message,), { - 'DESCRIPTOR' : _TEXTEDIT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.TextEdit) - }) -_sym_db.RegisterMessage(TextEdit) - -FigureDescriptor = _reflection.GeneratedProtocolMessageType('FigureDescriptor', (_message.Message,), { - - 'ChartDescriptor' : _reflection.GeneratedProtocolMessageType('ChartDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_CHARTDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.ChartDescriptor) - }) - , - - 'SeriesDescriptor' : _reflection.GeneratedProtocolMessageType('SeriesDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_SERIESDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SeriesDescriptor) - }) - , - - 'MultiSeriesDescriptor' : _reflection.GeneratedProtocolMessageType('MultiSeriesDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_MULTISERIESDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesDescriptor) - }) - , - - 'StringMapWithDefault' : _reflection.GeneratedProtocolMessageType('StringMapWithDefault', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_STRINGMAPWITHDEFAULT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.StringMapWithDefault) - }) - , - - 'DoubleMapWithDefault' : _reflection.GeneratedProtocolMessageType('DoubleMapWithDefault', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_DOUBLEMAPWITHDEFAULT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.DoubleMapWithDefault) - }) - , - - 'BoolMapWithDefault' : _reflection.GeneratedProtocolMessageType('BoolMapWithDefault', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_BOOLMAPWITHDEFAULT, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BoolMapWithDefault) - }) - , - - 'AxisDescriptor' : _reflection.GeneratedProtocolMessageType('AxisDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_AXISDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.AxisDescriptor) - }) - , - - 'BusinessCalendarDescriptor' : _reflection.GeneratedProtocolMessageType('BusinessCalendarDescriptor', (_message.Message,), { - - 'BusinessPeriod' : _reflection.GeneratedProtocolMessageType('BusinessPeriod', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_BUSINESSPERIOD, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) - }) - , - - 'Holiday' : _reflection.GeneratedProtocolMessageType('Holiday', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_HOLIDAY, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.Holiday) - }) - , - - 'LocalDate' : _reflection.GeneratedProtocolMessageType('LocalDate', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR_LOCALDATE, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor.LocalDate) - }) - , - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_BUSINESSCALENDARDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.BusinessCalendarDescriptor) - }) - , - - 'MultiSeriesSourceDescriptor' : _reflection.GeneratedProtocolMessageType('MultiSeriesSourceDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_MULTISERIESSOURCEDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.MultiSeriesSourceDescriptor) - }) - , - - 'SourceDescriptor' : _reflection.GeneratedProtocolMessageType('SourceDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_SOURCEDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.SourceDescriptor) - }) - , - - 'OneClickDescriptor' : _reflection.GeneratedProtocolMessageType('OneClickDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _FIGUREDESCRIPTOR_ONECLICKDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor.OneClickDescriptor) - }) - , - 'DESCRIPTOR' : _FIGUREDESCRIPTOR, - '__module__' : 'pydeephaven.proto.console_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.script.grpc.FigureDescriptor) - }) -_sym_db.RegisterMessage(FigureDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.ChartDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.SeriesDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.MultiSeriesDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.StringMapWithDefault) -_sym_db.RegisterMessage(FigureDescriptor.DoubleMapWithDefault) -_sym_db.RegisterMessage(FigureDescriptor.BoolMapWithDefault) -_sym_db.RegisterMessage(FigureDescriptor.AxisDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.BusinessCalendarDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.BusinessCalendarDescriptor.BusinessPeriod) -_sym_db.RegisterMessage(FigureDescriptor.BusinessCalendarDescriptor.Holiday) -_sym_db.RegisterMessage(FigureDescriptor.BusinessCalendarDescriptor.LocalDate) -_sym_db.RegisterMessage(FigureDescriptor.MultiSeriesSourceDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.SourceDescriptor) -_sym_db.RegisterMessage(FigureDescriptor.OneClickDescriptor) - -_CONSOLESERVICE = DESCRIPTOR.services_by_name['ConsoleService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.console_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/py/client/pydeephaven/proto/inputtable_pb2.py b/py/client/pydeephaven/proto/inputtable_pb2.py index 400b20ca1c7..a24e03aed53 100644 --- a/py/client/pydeephaven/proto/inputtable_pb2.py +++ b/py/client/pydeephaven/proto/inputtable_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: deephaven/proto/inputtable.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,41 +16,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n deephaven/proto/inputtable.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"\x92\x01\n\x0f\x41\x64\x64TableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12?\n\x0ctable_to_add\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x12\n\x10\x41\x64\x64TableResponse\"\x98\x01\n\x12\x44\x65leteTableRequest\x12>\n\x0binput_table\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x42\n\x0ftable_to_remove\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x15\n\x13\x44\x65leteTableResponse2\xa6\x02\n\x11InputTableService\x12\x81\x01\n\x14\x41\x64\x64TableToInputTable\x12\x32.io.deephaven.proto.backplane.grpc.AddTableRequest\x1a\x33.io.deephaven.proto.backplane.grpc.AddTableResponse\"\x00\x12\x8c\x01\n\x19\x44\x65leteTableFromInputTable\x12\x35.io.deephaven.proto.backplane.grpc.DeleteTableRequest\x1a\x36.io.deephaven.proto.backplane.grpc.DeleteTableResponse\"\x00\x42\x46H\x01P\x01Z@github.com/deephaven/deephaven-core/go/internal/proto/inputtableb\x06proto3') - - -_ADDTABLEREQUEST = DESCRIPTOR.message_types_by_name['AddTableRequest'] -_ADDTABLERESPONSE = DESCRIPTOR.message_types_by_name['AddTableResponse'] -_DELETETABLEREQUEST = DESCRIPTOR.message_types_by_name['DeleteTableRequest'] -_DELETETABLERESPONSE = DESCRIPTOR.message_types_by_name['DeleteTableResponse'] -AddTableRequest = _reflection.GeneratedProtocolMessageType('AddTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _ADDTABLEREQUEST, - '__module__' : 'pydeephaven.proto.inputtable_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.AddTableRequest) - }) -_sym_db.RegisterMessage(AddTableRequest) - -AddTableResponse = _reflection.GeneratedProtocolMessageType('AddTableResponse', (_message.Message,), { - 'DESCRIPTOR' : _ADDTABLERESPONSE, - '__module__' : 'pydeephaven.proto.inputtable_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.AddTableResponse) - }) -_sym_db.RegisterMessage(AddTableResponse) - -DeleteTableRequest = _reflection.GeneratedProtocolMessageType('DeleteTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _DELETETABLEREQUEST, - '__module__' : 'pydeephaven.proto.inputtable_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.DeleteTableRequest) - }) -_sym_db.RegisterMessage(DeleteTableRequest) - -DeleteTableResponse = _reflection.GeneratedProtocolMessageType('DeleteTableResponse', (_message.Message,), { - 'DESCRIPTOR' : _DELETETABLERESPONSE, - '__module__' : 'pydeephaven.proto.inputtable_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.DeleteTableResponse) - }) -_sym_db.RegisterMessage(DeleteTableResponse) - -_INPUTTABLESERVICE = DESCRIPTOR.services_by_name['InputTableService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.inputtable_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/py/client/pydeephaven/proto/object_pb2.py b/py/client/pydeephaven/proto/object_pb2.py index 82181242185..03970207a77 100644 --- a/py/client/pydeephaven/proto/object_pb2.py +++ b/py/client/pydeephaven/proto/object_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: deephaven/proto/object.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,25 +16,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/object.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"W\n\x12\x46\x65tchObjectRequest\x12\x41\n\tsource_id\x18\x01 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket\"z\n\x13\x46\x65tchObjectResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12G\n\x0ftyped_export_id\x18\x03 \x03(\x0b\x32..io.deephaven.proto.backplane.grpc.TypedTicket2\x8f\x01\n\rObjectService\x12~\n\x0b\x46\x65tchObject\x12\x35.io.deephaven.proto.backplane.grpc.FetchObjectRequest\x1a\x36.io.deephaven.proto.backplane.grpc.FetchObjectResponse\"\x00\x42\x42H\x01P\x01Z\n\x03\x61nd\x18\x01 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.AndConditionH\x00\x12<\n\x02or\x18\x02 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.OrConditionH\x00\x12>\n\x03not\x18\x03 \x01(\x0b\x32/.io.deephaven.proto.backplane.grpc.NotConditionH\x00\x12\x46\n\x07\x63ompare\x18\x04 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.CompareConditionH\x00\x12<\n\x02in\x18\x05 \x01(\x0b\x32..io.deephaven.proto.backplane.grpc.InConditionH\x00\x12\x44\n\x06invoke\x18\x06 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.InvokeConditionH\x00\x12\x45\n\x07is_null\x18\x07 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.IsNullConditionH\x00\x12\x46\n\x07matches\x18\x08 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.MatchesConditionH\x00\x12H\n\x08\x63ontains\x18\t \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.ContainsConditionH\x00\x12\x44\n\x06search\x18\n \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.SearchConditionH\x00\x42\x06\n\x04\x64\x61ta\"M\n\x0c\x41ndCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0bOrCondition\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"L\n\x0cNotCondition\x12<\n\x06\x66ilter\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Condition\"\xac\x03\n\x10\x43ompareCondition\x12W\n\toperation\x18\x01 \x01(\x0e\x32\x44.io.deephaven.proto.backplane.grpc.CompareCondition.CompareOperation\x12L\n\x10\x63\x61se_sensitivity\x18\x02 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12\x35\n\x03lhs\x18\x03 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12\x35\n\x03rhs\x18\x04 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"\x82\x01\n\x10\x43ompareOperation\x12\r\n\tLESS_THAN\x10\x00\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\"\x95\x02\n\x0bInCondition\x12\x38\n\x06target\x18\x01 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12<\n\ncandidates\x18\x02 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\x98\x01\n\x0fInvokeCondition\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x38\n\x06target\x18\x02 \x01(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\x12;\n\targuments\x18\x03 \x03(\x0b\x32(.io.deephaven.proto.backplane.grpc.Value\"R\n\x0fIsNullCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\xf2\x01\n\x10MatchesCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\r\n\x05regex\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"\xfb\x01\n\x11\x43ontainsCondition\x12?\n\treference\x18\x01 \x01(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\x12\x15\n\rsearch_string\x18\x02 \x01(\t\x12L\n\x10\x63\x61se_sensitivity\x18\x03 \x01(\x0e\x32\x32.io.deephaven.proto.backplane.grpc.CaseSensitivity\x12@\n\nmatch_type\x18\x04 \x01(\x0e\x32,.io.deephaven.proto.backplane.grpc.MatchType\"s\n\x0fSearchCondition\x12\x15\n\rsearch_string\x18\x01 \x01(\t\x12I\n\x13optional_references\x18\x02 \x03(\x0b\x32,.io.deephaven.proto.backplane.grpc.Reference\"\x94\x01\n\x0e\x46lattenRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\"\xb4\x03\n\x19RunChartDownsampleRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x44\n\tsource_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReference\x12\x13\n\x0bpixel_count\x18\x03 \x01(\x05\x12Z\n\nzoom_range\x18\x04 \x01(\x0b\x32\x46.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange\x12\x15\n\rx_column_name\x18\x05 \x01(\t\x12\x16\n\x0ey_column_names\x18\x06 \x03(\t\x1as\n\tZoomRange\x12\x1f\n\x0emin_date_nanos\x18\x01 \x01(\x03\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x1f\n\x0emax_date_nanos\x18\x02 \x01(\x03\x42\x02\x30\x01H\x01\x88\x01\x01\x42\x11\n\x0f_min_date_nanosB\x11\n\x0f_max_date_nanos\"\xf5\x04\n\x17\x43reateInputTableRequest\x12<\n\tresult_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12L\n\x0fsource_table_id\x18\x02 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.TableReferenceH\x00\x12\x10\n\x06schema\x18\x03 \x01(\x0cH\x00\x12W\n\x04kind\x18\x04 \x01(\x0b\x32I.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind\x1a\xd4\x02\n\x0eInputTableKind\x12}\n\x15in_memory_append_only\x18\x01 \x01(\x0b\x32\\.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnlyH\x00\x12{\n\x14in_memory_key_backed\x18\x02 \x01(\x0b\x32[.io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBackedH\x00\x1a\x14\n\x12InMemoryAppendOnly\x1a(\n\x11InMemoryKeyBacked\x12\x13\n\x0bkey_columns\x18\x01 \x03(\tB\x06\n\x04kindB\x0c\n\ndefinition\"\xda\x14\n\x11\x42\x61tchTableRequest\x12K\n\x03ops\x18\x01 \x03(\x0b\x32>.io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation\x1a\xf7\x13\n\tOperation\x12K\n\x0b\x65mpty_table\x18\x01 \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequestH\x00\x12I\n\ntime_table\x18\x02 \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.TimeTableRequestH\x00\x12M\n\x0c\x64rop_columns\x18\x03 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequestH\x00\x12J\n\x06update\x18\x04 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0blazy_update\x18\x05 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12H\n\x04view\x18\x06 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12O\n\x0bupdate_view\x18\x07 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12J\n\x06select\x18\x08 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequestH\x00\x12S\n\x0fselect_distinct\x18\t \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequestH\x00\x12G\n\x06\x66ilter\x18\n \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.FilterTableRequestH\x00\x12`\n\x13unstructured_filter\x18\x0b \x01(\x0b\x32\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequestH\x00\x12\x43\n\x04sort\x18\x0c \x01(\x0b\x32\x33.io.deephaven.proto.backplane.grpc.SortTableRequestH\x00\x12\x44\n\x04head\x18\r \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12\x44\n\x04tail\x18\x0e \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequestH\x00\x12I\n\x07head_by\x18\x0f \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12I\n\x07tail_by\x18\x10 \x01(\x0b\x32\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequestH\x00\x12\x44\n\x07ungroup\x18\x11 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.UngroupRequestH\x00\x12\x46\n\x05merge\x18\x12 \x01(\x0b\x32\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequestH\x00\x12S\n\x0f\x63ombo_aggregate\x18\x13 \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequestH\x00\x12K\n\x08snapshot\x18\x14 \x01(\x0b\x32\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequestH\x00\x12\x44\n\x07\x66latten\x18\x15 \x01(\x0b\x32\x31.io.deephaven.proto.backplane.grpc.FlattenRequestH\x00\x12\\\n\x14run_chart_downsample\x18\x16 \x01(\x0b\x32<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequestH\x00\x12O\n\ncross_join\x18\x17 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequestH\x00\x12S\n\x0cnatural_join\x18\x18 \x01(\x0b\x32;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequestH\x00\x12O\n\nexact_join\x18\x19 \x01(\x0b\x32\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequestH\x00\x12M\n\tleft_join\x18\x1a \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequestH\x00\x12N\n\nas_of_join\x18\x1b \x01(\x0b\x32\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequestH\x00\x12K\n\x0b\x66\x65tch_table\x18\x1c \x01(\x0b\x32\x34.io.deephaven.proto.backplane.grpc.FetchTableRequestH\x00\x12X\n\x12\x66\x65tch_pandas_table\x18\x1d \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequestH\x00\x12^\n\x15\x61pply_preview_columns\x18\x1e \x01(\x0b\x32=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequestH\x00\x12X\n\x12\x63reate_input_table\x18\x1f \x01(\x0b\x32:.io.deephaven.proto.backplane.grpc.CreateInputTableRequestH\x00\x12G\n\tupdate_by\x18 \x01(\x0b\x32\x32.io.deephaven.proto.backplane.grpc.UpdateByRequestH\x00\x42\x04\n\x02op*=\n\x0f\x42\x61\x64\x44\x61taBehavior\x12\t\n\x05THROW\x10\x00\x12\t\n\x05RESET\x10\x01\x12\x08\n\x04SKIP\x10\x02\x12\n\n\x06POISON\x10\x03*2\n\x0f\x43\x61seSensitivity\x12\x0e\n\nMATCH_CASE\x10\x00\x12\x0f\n\x0bIGNORE_CASE\x10\x01*&\n\tMatchType\x12\x0b\n\x07REGULAR\x10\x00\x12\x0c\n\x08INVERTED\x10\x01\x32\xd3&\n\x0cTableService\x12\x91\x01\n GetExportedTableCreationResponse\x12).io.deephaven.proto.backplane.grpc.Ticket\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nFetchTable\x12\x34.io.deephaven.proto.backplane.grpc.FetchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x46\x65tchPandasTable\x12:.io.deephaven.proto.backplane.grpc.FetchPandasTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x98\x01\n\x13\x41pplyPreviewColumns\x12=.io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\nEmptyTable\x12\x34.io.deephaven.proto.backplane.grpc.EmptyTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\tTimeTable\x12\x33.io.deephaven.proto.backplane.grpc.TimeTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0b\x44ropColumns\x12\x35.io.deephaven.proto.backplane.grpc.DropColumnsRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Update\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nLazyUpdate\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x04View\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8a\x01\n\nUpdateView\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x86\x01\n\x06Select\x12\x38.io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x82\x01\n\x08UpdateBy\x12\x32.io.deephaven.proto.backplane.grpc.UpdateByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eSelectDistinct\x12\x38.io.deephaven.proto.backplane.grpc.SelectDistinctRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x06\x46ilter\x12\x35.io.deephaven.proto.backplane.grpc.FilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x9b\x01\n\x12UnstructuredFilter\x12\x41.io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x7f\n\x04Sort\x12\x33.io.deephaven.proto.backplane.grpc.SortTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Head\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x04Tail\x12\x34.io.deephaven.proto.backplane.grpc.HeadOrTailRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06HeadBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x84\x01\n\x06TailBy\x12\x36.io.deephaven.proto.backplane.grpc.HeadOrTailByRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07Ungroup\x12\x31.io.deephaven.proto.backplane.grpc.UngroupRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x88\x01\n\x0bMergeTables\x12\x35.io.deephaven.proto.backplane.grpc.MergeTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x43rossJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x94\x01\n\x11NaturalJoinTables\x12;.io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x90\x01\n\x0f\x45xactJoinTables\x12\x39.io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0eLeftJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x41sOfJoinTables\x12\x38.io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x8e\x01\n\x0e\x43omboAggregate\x12\x38.io.deephaven.proto.backplane.grpc.ComboAggregateRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x87\x01\n\x08Snapshot\x12\x37.io.deephaven.proto.backplane.grpc.SnapshotTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x80\x01\n\x07\x46latten\x12\x31.io.deephaven.proto.backplane.grpc.FlattenRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x96\x01\n\x12RunChartDownsample\x12<.io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x92\x01\n\x10\x43reateInputTable\x12:.io.deephaven.proto.backplane.grpc.CreateInputTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x12\x83\x01\n\x05\x42\x61tch\x12\x34.io.deephaven.proto.backplane.grpc.BatchTableRequest\x1a@.io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse\"\x00\x30\x01\x12\x99\x01\n\x14\x45xportedTableUpdates\x12>.io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest\x1a=.io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage\"\x00\x30\x01\x42\x41H\x01P\x01Z;github.com/deephaven/deephaven-core/go/internal/proto/tableb\x06proto3') -_BADDATABEHAVIOR = DESCRIPTOR.enum_types_by_name['BadDataBehavior'] -BadDataBehavior = enum_type_wrapper.EnumTypeWrapper(_BADDATABEHAVIOR) -_CASESENSITIVITY = DESCRIPTOR.enum_types_by_name['CaseSensitivity'] -CaseSensitivity = enum_type_wrapper.EnumTypeWrapper(_CASESENSITIVITY) -_MATCHTYPE = DESCRIPTOR.enum_types_by_name['MatchType'] -MatchType = enum_type_wrapper.EnumTypeWrapper(_MATCHTYPE) -THROW = 0 -RESET = 1 -SKIP = 2 -POISON = 3 -MATCH_CASE = 0 -IGNORE_CASE = 1 -REGULAR = 0 -INVERTED = 1 - - -_TABLEREFERENCE = DESCRIPTOR.message_types_by_name['TableReference'] -_EXPORTEDTABLECREATIONRESPONSE = DESCRIPTOR.message_types_by_name['ExportedTableCreationResponse'] -_FETCHTABLEREQUEST = DESCRIPTOR.message_types_by_name['FetchTableRequest'] -_APPLYPREVIEWCOLUMNSREQUEST = DESCRIPTOR.message_types_by_name['ApplyPreviewColumnsRequest'] -_FETCHPANDASTABLEREQUEST = DESCRIPTOR.message_types_by_name['FetchPandasTableRequest'] -_EXPORTEDTABLEUPDATESREQUEST = DESCRIPTOR.message_types_by_name['ExportedTableUpdatesRequest'] -_EXPORTEDTABLEUPDATEMESSAGE = DESCRIPTOR.message_types_by_name['ExportedTableUpdateMessage'] -_EMPTYTABLEREQUEST = DESCRIPTOR.message_types_by_name['EmptyTableRequest'] -_TIMETABLEREQUEST = DESCRIPTOR.message_types_by_name['TimeTableRequest'] -_SELECTORUPDATEREQUEST = DESCRIPTOR.message_types_by_name['SelectOrUpdateRequest'] -_MATHCONTEXT = DESCRIPTOR.message_types_by_name['MathContext'] -_UPDATEBYREQUEST = DESCRIPTOR.message_types_by_name['UpdateByRequest'] -_UPDATEBYREQUEST_UPDATEBYOPTIONS = _UPDATEBYREQUEST.nested_types_by_name['UpdateByOptions'] -_UPDATEBYREQUEST_UPDATEBYOPERATION = _UPDATEBYREQUEST.nested_types_by_name['UpdateByOperation'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN = _UPDATEBYREQUEST_UPDATEBYOPERATION.nested_types_by_name['UpdateByColumn'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN.nested_types_by_name['UpdateBySpec'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeSum'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeMin'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeMax'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByCumulativeProduct'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByFill'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC.nested_types_by_name['UpdateByEma'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA.nested_types_by_name['UpdateByEmaOptions'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA.nested_types_by_name['UpdateByEmaTimescale'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE.nested_types_by_name['UpdateByEmaTicks'] -_UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME = _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE.nested_types_by_name['UpdateByEmaTime'] -_SELECTDISTINCTREQUEST = DESCRIPTOR.message_types_by_name['SelectDistinctRequest'] -_DROPCOLUMNSREQUEST = DESCRIPTOR.message_types_by_name['DropColumnsRequest'] -_UNSTRUCTUREDFILTERTABLEREQUEST = DESCRIPTOR.message_types_by_name['UnstructuredFilterTableRequest'] -_HEADORTAILREQUEST = DESCRIPTOR.message_types_by_name['HeadOrTailRequest'] -_HEADORTAILBYREQUEST = DESCRIPTOR.message_types_by_name['HeadOrTailByRequest'] -_UNGROUPREQUEST = DESCRIPTOR.message_types_by_name['UngroupRequest'] -_MERGETABLESREQUEST = DESCRIPTOR.message_types_by_name['MergeTablesRequest'] -_SNAPSHOTTABLEREQUEST = DESCRIPTOR.message_types_by_name['SnapshotTableRequest'] -_CROSSJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['CrossJoinTablesRequest'] -_NATURALJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['NaturalJoinTablesRequest'] -_EXACTJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['ExactJoinTablesRequest'] -_LEFTJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['LeftJoinTablesRequest'] -_ASOFJOINTABLESREQUEST = DESCRIPTOR.message_types_by_name['AsOfJoinTablesRequest'] -_COMBOAGGREGATEREQUEST = DESCRIPTOR.message_types_by_name['ComboAggregateRequest'] -_COMBOAGGREGATEREQUEST_AGGREGATE = _COMBOAGGREGATEREQUEST.nested_types_by_name['Aggregate'] -_SORTDESCRIPTOR = DESCRIPTOR.message_types_by_name['SortDescriptor'] -_SORTTABLEREQUEST = DESCRIPTOR.message_types_by_name['SortTableRequest'] -_FILTERTABLEREQUEST = DESCRIPTOR.message_types_by_name['FilterTableRequest'] -_REFERENCE = DESCRIPTOR.message_types_by_name['Reference'] -_LITERAL = DESCRIPTOR.message_types_by_name['Literal'] -_VALUE = DESCRIPTOR.message_types_by_name['Value'] -_CONDITION = DESCRIPTOR.message_types_by_name['Condition'] -_ANDCONDITION = DESCRIPTOR.message_types_by_name['AndCondition'] -_ORCONDITION = DESCRIPTOR.message_types_by_name['OrCondition'] -_NOTCONDITION = DESCRIPTOR.message_types_by_name['NotCondition'] -_COMPARECONDITION = DESCRIPTOR.message_types_by_name['CompareCondition'] -_INCONDITION = DESCRIPTOR.message_types_by_name['InCondition'] -_INVOKECONDITION = DESCRIPTOR.message_types_by_name['InvokeCondition'] -_ISNULLCONDITION = DESCRIPTOR.message_types_by_name['IsNullCondition'] -_MATCHESCONDITION = DESCRIPTOR.message_types_by_name['MatchesCondition'] -_CONTAINSCONDITION = DESCRIPTOR.message_types_by_name['ContainsCondition'] -_SEARCHCONDITION = DESCRIPTOR.message_types_by_name['SearchCondition'] -_FLATTENREQUEST = DESCRIPTOR.message_types_by_name['FlattenRequest'] -_RUNCHARTDOWNSAMPLEREQUEST = DESCRIPTOR.message_types_by_name['RunChartDownsampleRequest'] -_RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE = _RUNCHARTDOWNSAMPLEREQUEST.nested_types_by_name['ZoomRange'] -_CREATEINPUTTABLEREQUEST = DESCRIPTOR.message_types_by_name['CreateInputTableRequest'] -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND = _CREATEINPUTTABLEREQUEST.nested_types_by_name['InputTableKind'] -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.nested_types_by_name['InMemoryAppendOnly'] -_CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED = _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND.nested_types_by_name['InMemoryKeyBacked'] -_BATCHTABLEREQUEST = DESCRIPTOR.message_types_by_name['BatchTableRequest'] -_BATCHTABLEREQUEST_OPERATION = _BATCHTABLEREQUEST.nested_types_by_name['Operation'] -_MATHCONTEXT_ROUNDINGMODE = _MATHCONTEXT.enum_types_by_name['RoundingMode'] -_ASOFJOINTABLESREQUEST_MATCHRULE = _ASOFJOINTABLESREQUEST.enum_types_by_name['MatchRule'] -_COMBOAGGREGATEREQUEST_AGGTYPE = _COMBOAGGREGATEREQUEST.enum_types_by_name['AggType'] -_SORTDESCRIPTOR_SORTDIRECTION = _SORTDESCRIPTOR.enum_types_by_name['SortDirection'] -_COMPARECONDITION_COMPAREOPERATION = _COMPARECONDITION.enum_types_by_name['CompareOperation'] -TableReference = _reflection.GeneratedProtocolMessageType('TableReference', (_message.Message,), { - 'DESCRIPTOR' : _TABLEREFERENCE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.TableReference) - }) -_sym_db.RegisterMessage(TableReference) - -ExportedTableCreationResponse = _reflection.GeneratedProtocolMessageType('ExportedTableCreationResponse', (_message.Message,), { - 'DESCRIPTOR' : _EXPORTEDTABLECREATIONRESPONSE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ExportedTableCreationResponse) - }) -_sym_db.RegisterMessage(ExportedTableCreationResponse) - -FetchTableRequest = _reflection.GeneratedProtocolMessageType('FetchTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _FETCHTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchTableRequest) - }) -_sym_db.RegisterMessage(FetchTableRequest) - -ApplyPreviewColumnsRequest = _reflection.GeneratedProtocolMessageType('ApplyPreviewColumnsRequest', (_message.Message,), { - 'DESCRIPTOR' : _APPLYPREVIEWCOLUMNSREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest) - }) -_sym_db.RegisterMessage(ApplyPreviewColumnsRequest) - -FetchPandasTableRequest = _reflection.GeneratedProtocolMessageType('FetchPandasTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _FETCHPANDASTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FetchPandasTableRequest) - }) -_sym_db.RegisterMessage(FetchPandasTableRequest) - -ExportedTableUpdatesRequest = _reflection.GeneratedProtocolMessageType('ExportedTableUpdatesRequest', (_message.Message,), { - 'DESCRIPTOR' : _EXPORTEDTABLEUPDATESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest) - }) -_sym_db.RegisterMessage(ExportedTableUpdatesRequest) - -ExportedTableUpdateMessage = _reflection.GeneratedProtocolMessageType('ExportedTableUpdateMessage', (_message.Message,), { - 'DESCRIPTOR' : _EXPORTEDTABLEUPDATEMESSAGE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ExportedTableUpdateMessage) - }) -_sym_db.RegisterMessage(ExportedTableUpdateMessage) - -EmptyTableRequest = _reflection.GeneratedProtocolMessageType('EmptyTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.EmptyTableRequest) - }) -_sym_db.RegisterMessage(EmptyTableRequest) - -TimeTableRequest = _reflection.GeneratedProtocolMessageType('TimeTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _TIMETABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.TimeTableRequest) - }) -_sym_db.RegisterMessage(TimeTableRequest) - -SelectOrUpdateRequest = _reflection.GeneratedProtocolMessageType('SelectOrUpdateRequest', (_message.Message,), { - 'DESCRIPTOR' : _SELECTORUPDATEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest) - }) -_sym_db.RegisterMessage(SelectOrUpdateRequest) - -MathContext = _reflection.GeneratedProtocolMessageType('MathContext', (_message.Message,), { - 'DESCRIPTOR' : _MATHCONTEXT, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MathContext) - }) -_sym_db.RegisterMessage(MathContext) - -UpdateByRequest = _reflection.GeneratedProtocolMessageType('UpdateByRequest', (_message.Message,), { - - 'UpdateByOptions' : _reflection.GeneratedProtocolMessageType('UpdateByOptions', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPTIONS, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOptions) - }) - , - - 'UpdateByOperation' : _reflection.GeneratedProtocolMessageType('UpdateByOperation', (_message.Message,), { - - 'UpdateByColumn' : _reflection.GeneratedProtocolMessageType('UpdateByColumn', (_message.Message,), { - - 'UpdateBySpec' : _reflection.GeneratedProtocolMessageType('UpdateBySpec', (_message.Message,), { - - 'UpdateByCumulativeSum' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeSum', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVESUM, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum) - }) - , - - 'UpdateByCumulativeMin' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeMin', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMIN, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin) - }) - , - - 'UpdateByCumulativeMax' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeMax', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEMAX, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax) - }) - , - - 'UpdateByCumulativeProduct' : _reflection.GeneratedProtocolMessageType('UpdateByCumulativeProduct', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYCUMULATIVEPRODUCT, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct) - }) - , - - 'UpdateByFill' : _reflection.GeneratedProtocolMessageType('UpdateByFill', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYFILL, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill) - }) - , - - 'UpdateByEma' : _reflection.GeneratedProtocolMessageType('UpdateByEma', (_message.Message,), { - - 'UpdateByEmaOptions' : _reflection.GeneratedProtocolMessageType('UpdateByEmaOptions', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMAOPTIONS, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions) - }) - , - - 'UpdateByEmaTimescale' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTimescale', (_message.Message,), { - - 'UpdateByEmaTicks' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTicks', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATICKS, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks) - }) - , - - 'UpdateByEmaTime' : _reflection.GeneratedProtocolMessageType('UpdateByEmaTime', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE_UPDATEBYEMATIME, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA_UPDATEBYEMATIMESCALE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC_UPDATEBYEMA, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN_UPDATEBYSPEC, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION_UPDATEBYCOLUMN, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation.UpdateByColumn) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST_UPDATEBYOPERATION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest.UpdateByOperation) - }) - , - 'DESCRIPTOR' : _UPDATEBYREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UpdateByRequest) - }) -_sym_db.RegisterMessage(UpdateByRequest) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOptions) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeSum) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMin) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeMax) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByCumulativeProduct) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByFill) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaOptions) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTicks) -_sym_db.RegisterMessage(UpdateByRequest.UpdateByOperation.UpdateByColumn.UpdateBySpec.UpdateByEma.UpdateByEmaTimescale.UpdateByEmaTime) - -SelectDistinctRequest = _reflection.GeneratedProtocolMessageType('SelectDistinctRequest', (_message.Message,), { - 'DESCRIPTOR' : _SELECTDISTINCTREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SelectDistinctRequest) - }) -_sym_db.RegisterMessage(SelectDistinctRequest) - -DropColumnsRequest = _reflection.GeneratedProtocolMessageType('DropColumnsRequest', (_message.Message,), { - 'DESCRIPTOR' : _DROPCOLUMNSREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.DropColumnsRequest) - }) -_sym_db.RegisterMessage(DropColumnsRequest) - -UnstructuredFilterTableRequest = _reflection.GeneratedProtocolMessageType('UnstructuredFilterTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _UNSTRUCTUREDFILTERTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest) - }) -_sym_db.RegisterMessage(UnstructuredFilterTableRequest) - -HeadOrTailRequest = _reflection.GeneratedProtocolMessageType('HeadOrTailRequest', (_message.Message,), { - 'DESCRIPTOR' : _HEADORTAILREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HeadOrTailRequest) - }) -_sym_db.RegisterMessage(HeadOrTailRequest) - -HeadOrTailByRequest = _reflection.GeneratedProtocolMessageType('HeadOrTailByRequest', (_message.Message,), { - 'DESCRIPTOR' : _HEADORTAILBYREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.HeadOrTailByRequest) - }) -_sym_db.RegisterMessage(HeadOrTailByRequest) - -UngroupRequest = _reflection.GeneratedProtocolMessageType('UngroupRequest', (_message.Message,), { - 'DESCRIPTOR' : _UNGROUPREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.UngroupRequest) - }) -_sym_db.RegisterMessage(UngroupRequest) - -MergeTablesRequest = _reflection.GeneratedProtocolMessageType('MergeTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _MERGETABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MergeTablesRequest) - }) -_sym_db.RegisterMessage(MergeTablesRequest) - -SnapshotTableRequest = _reflection.GeneratedProtocolMessageType('SnapshotTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _SNAPSHOTTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SnapshotTableRequest) - }) -_sym_db.RegisterMessage(SnapshotTableRequest) - -CrossJoinTablesRequest = _reflection.GeneratedProtocolMessageType('CrossJoinTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _CROSSJOINTABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest) - }) -_sym_db.RegisterMessage(CrossJoinTablesRequest) - -NaturalJoinTablesRequest = _reflection.GeneratedProtocolMessageType('NaturalJoinTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _NATURALJOINTABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest) - }) -_sym_db.RegisterMessage(NaturalJoinTablesRequest) - -ExactJoinTablesRequest = _reflection.GeneratedProtocolMessageType('ExactJoinTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _EXACTJOINTABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest) - }) -_sym_db.RegisterMessage(ExactJoinTablesRequest) - -LeftJoinTablesRequest = _reflection.GeneratedProtocolMessageType('LeftJoinTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _LEFTJOINTABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest) - }) -_sym_db.RegisterMessage(LeftJoinTablesRequest) - -AsOfJoinTablesRequest = _reflection.GeneratedProtocolMessageType('AsOfJoinTablesRequest', (_message.Message,), { - 'DESCRIPTOR' : _ASOFJOINTABLESREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest) - }) -_sym_db.RegisterMessage(AsOfJoinTablesRequest) - -ComboAggregateRequest = _reflection.GeneratedProtocolMessageType('ComboAggregateRequest', (_message.Message,), { - - 'Aggregate' : _reflection.GeneratedProtocolMessageType('Aggregate', (_message.Message,), { - 'DESCRIPTOR' : _COMBOAGGREGATEREQUEST_AGGREGATE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ComboAggregateRequest.Aggregate) - }) - , - 'DESCRIPTOR' : _COMBOAGGREGATEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ComboAggregateRequest) - }) -_sym_db.RegisterMessage(ComboAggregateRequest) -_sym_db.RegisterMessage(ComboAggregateRequest.Aggregate) - -SortDescriptor = _reflection.GeneratedProtocolMessageType('SortDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _SORTDESCRIPTOR, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SortDescriptor) - }) -_sym_db.RegisterMessage(SortDescriptor) - -SortTableRequest = _reflection.GeneratedProtocolMessageType('SortTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _SORTTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SortTableRequest) - }) -_sym_db.RegisterMessage(SortTableRequest) - -FilterTableRequest = _reflection.GeneratedProtocolMessageType('FilterTableRequest', (_message.Message,), { - 'DESCRIPTOR' : _FILTERTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FilterTableRequest) - }) -_sym_db.RegisterMessage(FilterTableRequest) - -Reference = _reflection.GeneratedProtocolMessageType('Reference', (_message.Message,), { - 'DESCRIPTOR' : _REFERENCE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.Reference) - }) -_sym_db.RegisterMessage(Reference) - -Literal = _reflection.GeneratedProtocolMessageType('Literal', (_message.Message,), { - 'DESCRIPTOR' : _LITERAL, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.Literal) - }) -_sym_db.RegisterMessage(Literal) - -Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), { - 'DESCRIPTOR' : _VALUE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.Value) - }) -_sym_db.RegisterMessage(Value) - -Condition = _reflection.GeneratedProtocolMessageType('Condition', (_message.Message,), { - 'DESCRIPTOR' : _CONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.Condition) - }) -_sym_db.RegisterMessage(Condition) - -AndCondition = _reflection.GeneratedProtocolMessageType('AndCondition', (_message.Message,), { - 'DESCRIPTOR' : _ANDCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.AndCondition) - }) -_sym_db.RegisterMessage(AndCondition) - -OrCondition = _reflection.GeneratedProtocolMessageType('OrCondition', (_message.Message,), { - 'DESCRIPTOR' : _ORCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.OrCondition) - }) -_sym_db.RegisterMessage(OrCondition) - -NotCondition = _reflection.GeneratedProtocolMessageType('NotCondition', (_message.Message,), { - 'DESCRIPTOR' : _NOTCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.NotCondition) - }) -_sym_db.RegisterMessage(NotCondition) - -CompareCondition = _reflection.GeneratedProtocolMessageType('CompareCondition', (_message.Message,), { - 'DESCRIPTOR' : _COMPARECONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CompareCondition) - }) -_sym_db.RegisterMessage(CompareCondition) - -InCondition = _reflection.GeneratedProtocolMessageType('InCondition', (_message.Message,), { - 'DESCRIPTOR' : _INCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.InCondition) - }) -_sym_db.RegisterMessage(InCondition) - -InvokeCondition = _reflection.GeneratedProtocolMessageType('InvokeCondition', (_message.Message,), { - 'DESCRIPTOR' : _INVOKECONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.InvokeCondition) - }) -_sym_db.RegisterMessage(InvokeCondition) - -IsNullCondition = _reflection.GeneratedProtocolMessageType('IsNullCondition', (_message.Message,), { - 'DESCRIPTOR' : _ISNULLCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.IsNullCondition) - }) -_sym_db.RegisterMessage(IsNullCondition) - -MatchesCondition = _reflection.GeneratedProtocolMessageType('MatchesCondition', (_message.Message,), { - 'DESCRIPTOR' : _MATCHESCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.MatchesCondition) - }) -_sym_db.RegisterMessage(MatchesCondition) - -ContainsCondition = _reflection.GeneratedProtocolMessageType('ContainsCondition', (_message.Message,), { - 'DESCRIPTOR' : _CONTAINSCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.ContainsCondition) - }) -_sym_db.RegisterMessage(ContainsCondition) - -SearchCondition = _reflection.GeneratedProtocolMessageType('SearchCondition', (_message.Message,), { - 'DESCRIPTOR' : _SEARCHCONDITION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.SearchCondition) - }) -_sym_db.RegisterMessage(SearchCondition) - -FlattenRequest = _reflection.GeneratedProtocolMessageType('FlattenRequest', (_message.Message,), { - 'DESCRIPTOR' : _FLATTENREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.FlattenRequest) - }) -_sym_db.RegisterMessage(FlattenRequest) - -RunChartDownsampleRequest = _reflection.GeneratedProtocolMessageType('RunChartDownsampleRequest', (_message.Message,), { - - 'ZoomRange' : _reflection.GeneratedProtocolMessageType('ZoomRange', (_message.Message,), { - 'DESCRIPTOR' : _RUNCHARTDOWNSAMPLEREQUEST_ZOOMRANGE, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest.ZoomRange) - }) - , - 'DESCRIPTOR' : _RUNCHARTDOWNSAMPLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest) - }) -_sym_db.RegisterMessage(RunChartDownsampleRequest) -_sym_db.RegisterMessage(RunChartDownsampleRequest.ZoomRange) - -CreateInputTableRequest = _reflection.GeneratedProtocolMessageType('CreateInputTableRequest', (_message.Message,), { - - 'InputTableKind' : _reflection.GeneratedProtocolMessageType('InputTableKind', (_message.Message,), { - - 'InMemoryAppendOnly' : _reflection.GeneratedProtocolMessageType('InMemoryAppendOnly', (_message.Message,), { - 'DESCRIPTOR' : _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYAPPENDONLY, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryAppendOnly) - }) - , - - 'InMemoryKeyBacked' : _reflection.GeneratedProtocolMessageType('InMemoryKeyBacked', (_message.Message,), { - 'DESCRIPTOR' : _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND_INMEMORYKEYBACKED, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) - }) - , - 'DESCRIPTOR' : _CREATEINPUTTABLEREQUEST_INPUTTABLEKIND, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CreateInputTableRequest.InputTableKind) - }) - , - 'DESCRIPTOR' : _CREATEINPUTTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.CreateInputTableRequest) - }) -_sym_db.RegisterMessage(CreateInputTableRequest) -_sym_db.RegisterMessage(CreateInputTableRequest.InputTableKind) -_sym_db.RegisterMessage(CreateInputTableRequest.InputTableKind.InMemoryAppendOnly) -_sym_db.RegisterMessage(CreateInputTableRequest.InputTableKind.InMemoryKeyBacked) - -BatchTableRequest = _reflection.GeneratedProtocolMessageType('BatchTableRequest', (_message.Message,), { - - 'Operation' : _reflection.GeneratedProtocolMessageType('Operation', (_message.Message,), { - 'DESCRIPTOR' : _BATCHTABLEREQUEST_OPERATION, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation) - }) - , - 'DESCRIPTOR' : _BATCHTABLEREQUEST, - '__module__' : 'pydeephaven.proto.table_pb2' - # @@protoc_insertion_point(class_scope:io.deephaven.proto.backplane.grpc.BatchTableRequest) - }) -_sym_db.RegisterMessage(BatchTableRequest) -_sym_db.RegisterMessage(BatchTableRequest.Operation) - -_TABLESERVICE = DESCRIPTOR.services_by_name['TableService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.table_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/py/client/pydeephaven/proto/ticket_pb2.py b/py/client/pydeephaven/proto/ticket_pb2.py index 840a53b4ce8..19094fcc9b7 100644 --- a/py/client/pydeephaven/proto/ticket_pb2.py +++ b/py/client/pydeephaven/proto/ticket_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: deephaven/proto/ticket.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,24 +15,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x64\x65\x65phaven/proto/ticket.proto\x12!io.deephaven.proto.backplane.grpc\"\x18\n\x06Ticket\x12\x0e\n\x06ticket\x18\x01 \x01(\x0c\"V\n\x0bTypedTicket\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12\x0c\n\x04type\x18\x02 \x01(\tBBH\x01P\x01Z Date: Wed, 28 Sep 2022 10:55:12 -0400 Subject: [PATCH 153/215] Try to Pool / re use compressors where possible. Fixes #2788 (#2792) * Rename DeephavenCompressor to COmpressorAdapter and try to pool / re-use compressors where possible * Make CompressorAdapter SafeCloseable * Apply spotless * spotless * Fix CR stuff * Fix from merge * Don't try to cache Decompressor. There is nowhere to close it easily --- .../parquet/base/ColumnChunkReaderImpl.java | 11 +- .../parquet/base/ColumnPageReaderImpl.java | 26 +++-- .../parquet/base/ColumnWriterImpl.java | 20 ++-- .../parquet/base/ParquetFileWriter.java | 15 +-- .../parquet/base/RowGroupWriterImpl.java | 18 ++-- extensions/parquet/benchmark/build.gradle | 94 ++++++++++++++++ .../parquet/benchmark/gradle.properties | 1 + .../parquet/table/TableWriteBenchmark.java | 101 ++++++++++++++++++ extensions/parquet/compression/build.gradle | 4 +- ...Compressor.java => CompressorAdapter.java} | 41 +++---- ...=> DeephavenCompressorAdapterFactory.java} | 80 +++++++++----- settings.gradle | 3 + 12 files changed, 327 insertions(+), 87 deletions(-) create mode 100644 extensions/parquet/benchmark/build.gradle create mode 100644 extensions/parquet/benchmark/gradle.properties create mode 100644 extensions/parquet/benchmark/src/benchmark/java/io/deephaven/benchmark/parquet/table/TableWriteBenchmark.java rename extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/{Compressor.java => CompressorAdapter.java} (71%) rename extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/{DeephavenCodecFactory.java => DeephavenCompressorAdapterFactory.java} (67%) diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnChunkReaderImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnChunkReaderImpl.java index e6fc3fb45f2..f56216ebe86 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnChunkReaderImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnChunkReaderImpl.java @@ -5,8 +5,8 @@ import io.deephaven.UncheckedDeephavenException; import io.deephaven.parquet.base.util.SeekableChannelsProvider; -import io.deephaven.parquet.compress.Compressor; -import io.deephaven.parquet.compress.DeephavenCodecFactory; +import io.deephaven.parquet.compress.CompressorAdapter; +import io.deephaven.parquet.compress.DeephavenCompressorAdapterFactory; import io.deephaven.util.datastructures.LazyCachingSupplier; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.ColumnDescriptor; @@ -38,7 +38,7 @@ public class ColumnChunkReaderImpl implements ColumnChunkReader { private final ColumnChunk columnChunk; private final SeekableChannelsProvider channelsProvider; private final Path rootPath; - private final Compressor decompressor; + private final CompressorAdapter decompressor; private final ColumnDescriptor path; private final OffsetIndex offsetIndex; private final List fieldTypes; @@ -56,9 +56,10 @@ public class ColumnChunkReaderImpl implements ColumnChunkReader { this.path = type .getColumnDescription(columnChunk.meta_data.getPath_in_schema().toArray(new String[0])); if (columnChunk.getMeta_data().isSetCodec()) { - decompressor = DeephavenCodecFactory.getInstance().getByName(columnChunk.getMeta_data().getCodec().name()); + decompressor = DeephavenCompressorAdapterFactory.getInstance() + .getByName(columnChunk.getMeta_data().getCodec().name()); } else { - decompressor = Compressor.PASSTHRU; + decompressor = CompressorAdapter.PASSTHRU; } this.offsetIndex = offsetIndex; this.fieldTypes = fieldTypes; diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java index ee8b64f0b40..b58375d2a3b 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java @@ -7,7 +7,7 @@ import io.deephaven.parquet.base.util.Helpers; import io.deephaven.parquet.base.util.RunLengthBitPackingHybridBufferDecoder; import io.deephaven.parquet.base.util.SeekableChannelsProvider; -import io.deephaven.parquet.compress.Compressor; +import io.deephaven.parquet.compress.CompressorAdapter; import org.apache.commons.io.IOUtils; import org.apache.parquet.bytes.ByteBufferInputStream; import org.apache.parquet.bytes.BytesInput; @@ -48,7 +48,7 @@ public class ColumnPageReaderImpl implements ColumnPageReader { public static final int NULL_OFFSET = -1; private final SeekableChannelsProvider channelsProvider; - private final Compressor compressor; + private final CompressorAdapter compressorAdapter; private final Supplier dictionarySupplier; private final PageMaterializer.Factory pageMaterializerFactory; private final ColumnDescriptor path; @@ -61,7 +61,7 @@ public class ColumnPageReaderImpl implements ColumnPageReader { private int rowCount = -1; ColumnPageReaderImpl(SeekableChannelsProvider channelsProvider, - Compressor compressor, + CompressorAdapter compressorAdapter, Supplier dictionarySupplier, PageMaterializer.Factory materializerFactory, ColumnDescriptor path, @@ -71,7 +71,7 @@ public class ColumnPageReaderImpl implements ColumnPageReader { PageHeader pageHeader, int numValues) { this.channelsProvider = channelsProvider; - this.compressor = compressor; + this.compressorAdapter = compressorAdapter; this.dictionarySupplier = dictionarySupplier; this.pageMaterializerFactory = materializerFactory; this.path = path; @@ -143,7 +143,8 @@ private int readRowCountFromDataPage(ReadableByteChannel file) throws IOExceptio switch (pageHeader.type) { case DATA_PAGE: final BytesInput decompressedInput = - compressor.decompress(Channels.newInputStream(file), compressedPageSize, uncompressedPageSize); + compressorAdapter.decompress(Channels.newInputStream(file), compressedPageSize, + uncompressedPageSize); DataPageHeader dataHeaderV1 = pageHeader.getData_page_header(); return readRowCountFromPageV1(new DataPageV1( @@ -170,7 +171,8 @@ private IntBuffer readKeyFromDataPage(IntBuffer keyDest, int nullPlaceholder, switch (pageHeader.type) { case DATA_PAGE: BytesInput decompressedInput = - compressor.decompress(Channels.newInputStream(file), compressedPageSize, uncompressedPageSize); + compressorAdapter.decompress(Channels.newInputStream(file), compressedPageSize, + uncompressedPageSize); DataPageHeader dataHeaderV1 = pageHeader.getData_page_header(); return readKeysFromPageV1(new DataPageV1( @@ -190,9 +192,10 @@ private IntBuffer readKeyFromDataPage(IntBuffer keyDest, int nullPlaceholder, Helpers.readBytes(file, dataHeaderV2.getRepetition_levels_byte_length()); BytesInput definitionLevels = Helpers.readBytes(file, dataHeaderV2.getDefinition_levels_byte_length()); - BytesInput data = compressor.decompress(Channels.newInputStream(file), dataSize, uncompressedPageSize - - dataHeaderV2.getRepetition_levels_byte_length() - - dataHeaderV2.getDefinition_levels_byte_length()); + BytesInput data = compressorAdapter.decompress(Channels.newInputStream(file), dataSize, + uncompressedPageSize + - dataHeaderV2.getRepetition_levels_byte_length() + - dataHeaderV2.getDefinition_levels_byte_length()); readKeysFromPageV2(new DataPageV2( dataHeaderV2.getNum_rows(), @@ -218,7 +221,8 @@ private Object readDataPage(Object nullValue, SeekableByteChannel file) throws I switch (pageHeader.type) { case DATA_PAGE: BytesInput decompressedInput = - compressor.decompress(Channels.newInputStream(file), compressedPageSize, uncompressedPageSize); + compressorAdapter.decompress(Channels.newInputStream(file), compressedPageSize, + uncompressedPageSize); DataPageHeader dataHeaderV1 = pageHeader.getData_page_header(); return readPageV1(new DataPageV1( @@ -235,7 +239,7 @@ private Object readDataPage(Object nullValue, SeekableByteChannel file) throws I - dataHeaderV2.getDefinition_levels_byte_length(); BytesInput repetitionLevels = Helpers.readBytes(file, dataHeaderV2.getRepetition_levels_byte_length()); BytesInput definitionLevels = Helpers.readBytes(file, dataHeaderV2.getDefinition_levels_byte_length()); - BytesInput data = compressor.decompress(Channels.newInputStream(file), dataSize, + BytesInput data = compressorAdapter.decompress(Channels.newInputStream(file), dataSize, pageHeader.getUncompressed_page_size() - dataHeaderV2.getRepetition_levels_byte_length() - dataHeaderV2.getDefinition_levels_byte_length()); diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java index 39d8969f9e1..abb3fe6df6c 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnWriterImpl.java @@ -4,7 +4,7 @@ package io.deephaven.parquet.base; import io.deephaven.parquet.base.tempfix.ParquetMetadataConverter; -import io.deephaven.parquet.compress.Compressor; +import io.deephaven.parquet.compress.CompressorAdapter; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.ColumnDescriptor; @@ -40,7 +40,7 @@ public class ColumnWriterImpl implements ColumnWriter { private final SeekableByteChannel writeChannel; private final ColumnDescriptor column; private final RowGroupWriterImpl owner; - private final Compressor compressor; + private final CompressorAdapter compressorAdapter; private boolean hasDictionary; private int pageCount = 0; private static final ParquetMetadataConverter metadataConverter = new ParquetMetadataConverter(); @@ -66,12 +66,12 @@ public class ColumnWriterImpl implements ColumnWriter { final RowGroupWriterImpl owner, final SeekableByteChannel writeChannel, final ColumnDescriptor column, - final Compressor compressor, + final CompressorAdapter compressorAdapter, final int targetPageSize, final ByteBufferAllocator allocator) { this.writeChannel = writeChannel; this.column = column; - this.compressor = compressor; + this.compressorAdapter = compressorAdapter; this.targetPageSize = targetPageSize; this.allocator = allocator; dlEncoder = column.getMaxDefinitionLevel() == 0 ? null @@ -136,8 +136,9 @@ public void writeDictionaryPage(final ByteBuffer dictionaryBuffer, final int val long currentChunkDictionaryPageOffset = writeChannel.position(); int uncompressedSize = dictionaryBuffer.remaining(); + compressorAdapter.reset(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (WritableByteChannel channel = Channels.newChannel(compressor.compress(baos))) { + try (WritableByteChannel channel = Channels.newChannel(compressorAdapter.compress(baos))) { channel.write(dictionaryBuffer); } BytesInput compressedBytes = BytesInput.from(baos); @@ -264,7 +265,7 @@ public void writePageV2( int uncompressedSize = (int) (uncompressedDataSize + repetitionLevels.size() + definitionLevels.size()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (WritableByteChannel channel = Channels.newChannel(compressor.compress(baos))) { + try (WritableByteChannel channel = Channels.newChannel(compressorAdapter.compress(baos))) { channel.write(data); } BytesInput compressedData = BytesInput.from(baos); @@ -303,8 +304,11 @@ private void writePage(final BytesInput bytes, final int valueCount, final Encod "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } + + compressorAdapter.reset(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (OutputStream cos = compressor.compress(baos)) { + try (OutputStream cos = compressorAdapter.compress(baos)) { bytes.writeAllTo(cos); } BytesInput compressedBytes = BytesInput.from(baos); @@ -395,7 +399,7 @@ public void close() { owner.releaseWriter(this, ColumnChunkMetaData.get(ColumnPath.get(column.getPath()), column.getPrimitiveType(), - compressor.getCodecName(), + compressorAdapter.getCodecName(), encodingStatsBuilder.build(), encodings, Statistics.createStats(column.getPrimitiveType()), diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java index 0deee61fbea..5ff4f393fcb 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ParquetFileWriter.java @@ -5,8 +5,8 @@ import io.deephaven.parquet.base.tempfix.ParquetMetadataConverter; import io.deephaven.parquet.base.util.SeekableChannelsProvider; -import io.deephaven.parquet.compress.Compressor; -import io.deephaven.parquet.compress.DeephavenCodecFactory; +import io.deephaven.parquet.compress.CompressorAdapter; +import io.deephaven.parquet.compress.DeephavenCompressorAdapterFactory; import org.apache.parquet.Version; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.bytes.BytesUtils; @@ -38,7 +38,7 @@ public class ParquetFileWriter { private final int targetPageSize; private final ByteBufferAllocator allocator; private final SeekableChannelsProvider channelsProvider; - private final Compressor compressor; + private final CompressorAdapter compressorAdapter; private final Map extraMetaData; private final List blocks = new ArrayList<>(); private final List> offsetIndexes = new ArrayList<>(); @@ -58,20 +58,21 @@ public ParquetFileWriter( writeChannel.write(ByteBuffer.wrap(ParquetFileReader.MAGIC)); this.type = type; this.channelsProvider = channelsProvider; - this.compressor = DeephavenCodecFactory.getInstance().getByName(codecName); + this.compressorAdapter = DeephavenCompressorAdapterFactory.getInstance().getByName(codecName); } @SuppressWarnings("unused") RowGroupWriter addRowGroup(final String path, final boolean append) throws IOException { RowGroupWriterImpl rowGroupWriter = - new RowGroupWriterImpl(path, append, channelsProvider, type, targetPageSize, allocator, compressor); + new RowGroupWriterImpl(path, append, channelsProvider, type, targetPageSize, allocator, + compressorAdapter); blocks.add(rowGroupWriter.getBlock()); return rowGroupWriter; } public RowGroupWriter addRowGroup(final long size) { RowGroupWriterImpl rowGroupWriter = - new RowGroupWriterImpl(writeChannel, type, targetPageSize, allocator, compressor); + new RowGroupWriterImpl(writeChannel, type, targetPageSize, allocator, compressorAdapter); rowGroupWriter.getBlock().setRowCount(size); blocks.add(rowGroupWriter.getBlock()); offsetIndexes.add(rowGroupWriter.offsetIndexes()); @@ -86,6 +87,8 @@ public void close() throws IOException { serializeFooter(footer, os); } // os (and thus writeChannel) are closed at this point. + + compressorAdapter.close(); } private void serializeFooter(final ParquetMetadata footer, final OutputStream os) throws IOException { diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java index feb6a962e6c..bdd30bfe4d5 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/RowGroupWriterImpl.java @@ -4,7 +4,7 @@ package io.deephaven.parquet.base; import io.deephaven.parquet.base.util.SeekableChannelsProvider; -import io.deephaven.parquet.compress.Compressor; +import io.deephaven.parquet.compress.CompressorAdapter; import org.apache.parquet.bytes.ByteBufferAllocator; import org.apache.parquet.hadoop.metadata.BlockMetaData; import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData; @@ -27,7 +27,7 @@ public class RowGroupWriterImpl implements RowGroupWriter { private ColumnWriterImpl activeWriter; private final BlockMetaData blockMetaData; private final List currentOffsetIndexes = new ArrayList<>(); - private final Compressor compressor; + private final CompressorAdapter compressorAdapter; RowGroupWriterImpl(String path, boolean append, @@ -35,10 +35,10 @@ public class RowGroupWriterImpl implements RowGroupWriter { MessageType type, int targetPageSize, ByteBufferAllocator allocator, - Compressor compressor) + CompressorAdapter compressorAdapter) throws IOException { this(channelsProvider.getWriteChannel(path, append), type, targetPageSize, allocator, blockWithPath(path), - compressor); + compressorAdapter); } private static BlockMetaData blockWithPath(String path) { @@ -51,8 +51,8 @@ private static BlockMetaData blockWithPath(String path) { MessageType type, int targetPageSize, ByteBufferAllocator allocator, - Compressor compressor) { - this(writeChannel, type, targetPageSize, allocator, new BlockMetaData(), compressor); + CompressorAdapter compressorAdapter) { + this(writeChannel, type, targetPageSize, allocator, new BlockMetaData(), compressorAdapter); } @@ -61,13 +61,13 @@ private RowGroupWriterImpl(SeekableByteChannel writeChannel, int targetPageSize, ByteBufferAllocator allocator, BlockMetaData blockMetaData, - Compressor compressor) { + CompressorAdapter compressorAdapter) { this.writeChannel = writeChannel; this.type = type; this.targetPageSize = targetPageSize; this.allocator = allocator; this.blockMetaData = blockMetaData; - this.compressor = compressor; + this.compressorAdapter = compressorAdapter; } String[] getPrimitivePath(String columnName) { @@ -95,7 +95,7 @@ public ColumnWriter addColumn(String columnName) { activeWriter = new ColumnWriterImpl(this, writeChannel, type.getColumnDescription(getPrimitivePath(columnName)), - compressor, + compressorAdapter, targetPageSize, allocator); return activeWriter; diff --git a/extensions/parquet/benchmark/build.gradle b/extensions/parquet/benchmark/build.gradle new file mode 100644 index 00000000000..0a1ebc9d674 --- /dev/null +++ b/extensions/parquet/benchmark/build.gradle @@ -0,0 +1,94 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + +description 'Parquet Benchmark: Benchmarks for Parquet modules' + +sourceSets { + test { + java { + srcDir 'src/benchmark/java' + } + } +} + +dependencies { + testImplementation project(':extensions-parquet-table'), + project(':engine-table'), + project(':BenchmarkSupport'), + TestTools.projectDependency(project, 'engine-rowset'), + TestTools.projectDependency(project, 'engine-table') + + testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.21' + testCompileOnly 'org.openjdk.jmh:jmh-generator-annprocess:1.21' + + testRuntimeOnly project(path: ':configs') + testRuntimeOnly project(path: ':test-configs') +} + +spotless { + java { + targetExclude( + '**/Boolean*Benchmark.java', + '**/Byte*Benchmark.java', + '**/Char*Benchmark.java', + '**/Short*Benchmark.java', + '**/Int*Benchmark.java', + '**/Long*Benchmark.java', + '**/Float*Benchmark.java', + '**/Double*Benchmark.java', + '**/Object*Benchmark.java', + ) + } +} + +task jmhRun(type: JavaExec) { + new File("$rootDir/tmp/workspace").mkdirs() + new File("$rootDir/tmp/logs").mkdirs() + workingDir "$rootDir/tmp/workspace" + + classpath = sourceSets.test.runtimeClasspath + + main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + + // arguments to pass to the application + jvmArgs '-DConfiguration.rootFile=dh-tests.prop', + "-Ddevroot=$rootDir", + "-Dworkspace=$rootDir/tmp/workspace", + '-Dconfiguration.quiet=true', + '-Djava.awt.headless=true', + '-DQueryTable.memoizeResults=false', + '-DUpdateGraphProcessor.checkTableOperations=false', + '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9500' +} + +def createJmhTask = { + taskName, cliArgs, jvmAddArgs=[], heapSize='8g' -> tasks.create(taskName, JavaExec, { JavaExec task -> + new File("$rootDir/tmp/workspace").mkdirs() + new File("$rootDir/tmp/logs").mkdirs() + + task.workingDir "$rootDir/tmp/workspace" + task.classpath = sourceSets.test.runtimeClasspath + task.main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + + // arguments to pass to the application + def jvmArgs = [ '-DConfiguration.rootFile=dh-tests.prop', + "-Ddevroot=$rootDir", + "-Dworkspace=$rootDir/tmp/workspace", + '-Dconfiguration.quiet=true', + '-Djava.awt.headless=true', + '-DQueryTable.memoizeResults=false', + '-DUpdateGraphProcessor.checkTableOperations=false', + "-Xmx$heapSize" + //'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9501' + ] + jvmArgs.addAll(jvmAddArgs) + task.jvmArgs jvmArgs + task.args cliArgs + + return + }) +} + +createJmhTask('jmhRunTableWrite', 'TableWriteBenchmark') \ No newline at end of file diff --git a/extensions/parquet/benchmark/gradle.properties b/extensions/parquet/benchmark/gradle.properties new file mode 100644 index 00000000000..eeac3e65888 --- /dev/null +++ b/extensions/parquet/benchmark/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_LOCAL diff --git a/extensions/parquet/benchmark/src/benchmark/java/io/deephaven/benchmark/parquet/table/TableWriteBenchmark.java b/extensions/parquet/benchmark/src/benchmark/java/io/deephaven/benchmark/parquet/table/TableWriteBenchmark.java new file mode 100644 index 00000000000..d3fed59474c --- /dev/null +++ b/extensions/parquet/benchmark/src/benchmark/java/io/deephaven/benchmark/parquet/table/TableWriteBenchmark.java @@ -0,0 +1,101 @@ +package io.deephaven.benchmark.parquet.table; + +import io.deephaven.base.FileUtils; +import io.deephaven.configuration.Configuration; +import io.deephaven.engine.context.ExecutionContext; +import io.deephaven.engine.context.QueryCompiler; +import io.deephaven.engine.context.QueryLibrary; +import io.deephaven.engine.context.QueryScope; +import io.deephaven.engine.table.Table; +import io.deephaven.engine.table.impl.sources.regioned.TestChunkedRegionedOperations; +import io.deephaven.engine.util.TableTools; +import io.deephaven.parquet.table.ParquetInstructions; +import io.deephaven.parquet.table.ParquetTools; +import io.deephaven.time.DateTimeUtils; +import io.deephaven.util.SafeCloseable; +import org.jetbrains.annotations.NotNull; +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.Blackhole; + +import java.io.IOException; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.TimeUnit; +import java.util.stream.IntStream; + +@State(Scope.Thread) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Warmup(iterations = 1, time = 2) +@Measurement(iterations = 1, time = 2) +@Fork(1) +public class TableWriteBenchmark { + private static final String[] LETTERS = IntStream.range('A', 'A' + 64) + .mapToObj(c -> String.valueOf((char) c)) + .toArray(String[]::new); + + @Param({"UNCOMPRESSED", "SNAPPY", "GZIP"}) + private String compressionCodec; + + private Table table; + private SafeCloseable exContextCloseable; + private Path rootPath; + + @Setup(Level.Trial) + public void setupEnv() throws IOException { + rootPath = Files.createTempDirectory(Paths.get(Configuration.getInstance().getWorkspacePath()), + "TableWriteBenchmark"); + final ExecutionContext context = ExecutionContext.newBuilder() + .newQueryLibrary() + .newQueryScope() + .setQueryCompiler( + QueryCompiler.create(rootPath.resolve("cache").toFile(), getClass().getClassLoader())) + .build(); + exContextCloseable = context.open(); + + final QueryScope queryScope = context.getQueryScope(); + queryScope.putParam("nowNanos", DateTimeUtils.currentTime().getNanos()); + queryScope.putParam("letters", LETTERS); + + QueryLibrary library = context.getQueryLibrary(); + library.importClass(TestChunkedRegionedOperations.SimpleExternalizable.class); + // Serializable is already very inefficient, however SNAPPY also has an O(n^2) block write pattern and compounds + // the terribleness. For now, we will exclude the serializable from the benchmark + // library.importClass(TestChunkedRegionedOperations.SimpleSerializable.class); + library.importClass(BigInteger.class); + + table = TableTools.emptyTable(1_000_000).updateView( + "B = ii % 1000 == 0 ? NULL_BYTE : (byte) ii", + "C = ii % 27 == 26 ? NULL_CHAR : (char) ('A' + ii % 27)", + "S = ii % 30000 == 0 ? NULL_SHORT : (short) ii", + "I = ii % 512 == 0 ? NULL_INT : (int) ii", + "L = ii % 1024 == 0 ? NULL_LONG : ii", + "F = ii % 2048 == 0 ? NULL_FLOAT : (float) (ii * 0.25)", + "D = ii % 4096 == 0 ? NULL_DOUBLE : ii * 1.25", + "Bl = ii % 8192 == 0 ? null : ii % 2 == 0", + "Sym = ii % 64 == 0 ? null : Long.toString(ii % 1000)", + "Str = ii % 128 == 0 ? null : Long.toString(ii)", + "DT = ii % 256 == 0 ? null : new DateTime(nowNanos + ii)", + // "Ser = ii % 1024 == 0 ? null : new SimpleSerializable(ii)", + "Ext = ii % 1024 == 0 ? null : new SimpleExternalizable(ii)", + "Fix = ii % 64 == 0 ? null : new BigInteger(Long.toString(ii % 1000), 10)", + "Var = Str == null ? null : new BigInteger(Str, 10)"); + } + + @TearDown(Level.Trial) + public void cleanUp() { + FileUtils.deleteRecursively(rootPath.toFile()); + exContextCloseable.close(); + } + + @Benchmark + public Table writeTable(@NotNull final Blackhole bh) { + final ParquetInstructions instructions = ParquetInstructions.builder() + .setCompressionCodecName(compressionCodec) + .build(); + ParquetTools.writeTable(table, rootPath.resolve("table.parquet").toFile(), instructions); + return table; + } +} diff --git a/extensions/parquet/compression/build.gradle b/extensions/parquet/compression/build.gradle index 7b4b7733fca..a3687f44bd7 100644 --- a/extensions/parquet/compression/build.gradle +++ b/extensions/parquet/compression/build.gradle @@ -4,7 +4,9 @@ plugins { } dependencies { - api project(':ParquetHadoop') + api project(':ParquetHadoop'), + project(':Util') + implementation project(':Configuration') implementation depCommonsIo diff --git a/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/Compressor.java b/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/CompressorAdapter.java similarity index 71% rename from extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/Compressor.java rename to extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/CompressorAdapter.java index 67f3e069370..cc4633ae96e 100644 --- a/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/Compressor.java +++ b/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/CompressorAdapter.java @@ -3,6 +3,7 @@ */ package io.deephaven.parquet.compress; +import io.deephaven.util.SafeCloseable; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.hadoop.metadata.CompressionCodecName; @@ -10,21 +11,19 @@ import java.io.InputStream; import java.io.OutputStream; -public interface Compressor { +/** + * An Intermediate adapter interface between Deephaven column writing and parquet compression. + */ +public interface CompressorAdapter extends SafeCloseable { /** - * Compressor instance that reads and writes uncompressed data directly. + * An {@link CompressorAdapter} instance that reads and writes uncompressed data directly. */ - Compressor PASSTHRU = new Compressor() { + CompressorAdapter PASSTHRU = new CompressorAdapter() { @Override - public OutputStream compress(OutputStream os) throws IOException { + public OutputStream compress(OutputStream os) { return os; } - @Override - public InputStream decompress(InputStream is) throws IOException { - return is; - } - @Override public CompressionCodecName getCodecName() { return CompressionCodecName.UNCOMPRESSED; @@ -34,8 +33,15 @@ public CompressionCodecName getCodecName() { public BytesInput decompress(InputStream inputStream, int compressedSize, int uncompressedSize) { return BytesInput.from(inputStream, compressedSize); } - }; + @Override + public void reset() {} + + @Override + public void close() { + + } + }; /** * Creates a new output stream that will take uncompressed writes, and flush data to the provided stream as @@ -47,16 +53,6 @@ public BytesInput decompress(InputStream inputStream, int compressedSize, int un */ OutputStream compress(OutputStream os) throws IOException; - /** - * Returns a new input stream that when read will provide the uncompressed data, by wrapping an input stream - * containing the compressed data. - * - * @param is an input stream that can be read to see compressed data - * @return an input stream that can be read to see uncompressed data - * @throws IOException thrown if an error occurs reading data - */ - InputStream decompress(InputStream is) throws IOException; - /** * Returns an in-memory instance of BytesInput containing the fully decompressed results of the input stream. * @@ -72,4 +68,9 @@ public BytesInput decompress(InputStream inputStream, int compressedSize, int un * @return the CompressionCodecName enum value that represents this compressor. */ CompressionCodecName getCodecName(); + + /** + * Reset the internal state of this {@link CompressorAdapter} so more rows can be read or written. + */ + void reset(); } diff --git a/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCodecFactory.java b/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCompressorAdapterFactory.java similarity index 67% rename from extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCodecFactory.java rename to extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCompressorAdapterFactory.java index a893796f650..c1439e7cd00 100644 --- a/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCodecFactory.java +++ b/extensions/parquet/compression/src/main/java/io/deephaven/parquet/compress/DeephavenCompressorAdapterFactory.java @@ -6,11 +6,7 @@ import com.google.common.io.ByteStreams; import org.apache.commons.io.IOUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.io.compress.CodecPool; -import org.apache.hadoop.io.compress.CompressionCodec; -import org.apache.hadoop.io.compress.CompressionCodecFactory; -import org.apache.hadoop.io.compress.CompressionInputStream; -import org.apache.hadoop.io.compress.Decompressor; +import org.apache.hadoop.io.compress.*; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.hadoop.metadata.CompressionCodecName; @@ -27,7 +23,7 @@ * configuration or from the classpath (via service loaders), while still offering the ability to get a * CompressionCodecName enum value having loaded the codec in this way. */ -public class DeephavenCodecFactory { +public class DeephavenCompressorAdapterFactory { // Default codecs to list in the configuration rather than rely on the classloader private static final Set DEFAULT_CODECS = Set.of( @@ -45,54 +41,68 @@ public class DeephavenCodecFactory { } }).collect(Collectors.toList()); - private static volatile DeephavenCodecFactory INSTANCE; + private static volatile DeephavenCompressorAdapterFactory INSTANCE; - public static synchronized void setInstance(DeephavenCodecFactory factory) { + public static synchronized void setInstance(DeephavenCompressorAdapterFactory factory) { if (INSTANCE != null) { throw new IllegalStateException("Can't assign an instance when one is already set"); } INSTANCE = factory; } - public static DeephavenCodecFactory getInstance() { + public static DeephavenCompressorAdapterFactory getInstance() { if (INSTANCE == null) { - synchronized (DeephavenCodecFactory.class) { + synchronized (DeephavenCompressorAdapterFactory.class) { if (INSTANCE == null) { - INSTANCE = new DeephavenCodecFactory(CODECS); + INSTANCE = new DeephavenCompressorAdapterFactory(CODECS); } } } return INSTANCE; } - public static class CodecWrappingCompressor implements Compressor { + public static class CodecWrappingCompressorAdapter implements CompressorAdapter { private final CompressionCodec compressionCodec; - private CodecWrappingCompressor(CompressionCodec compressionCodec) { + private boolean innerCompressorPooled; + private Compressor innerCompressor; + + private CodecWrappingCompressorAdapter(CompressionCodec compressionCodec) { this.compressionCodec = compressionCodec; } @Override public OutputStream compress(OutputStream os) throws IOException { - return compressionCodec.createOutputStream(os); - } + if (innerCompressor == null) { + innerCompressor = CodecPool.getCompressor(compressionCodec); + innerCompressorPooled = innerCompressor != null; + if (!innerCompressorPooled) { + // Some compressors are allowed to declare they cannot be pooled. If we fail to get one + // then fall back on just creating a new one to hang on to. + innerCompressor = compressionCodec.createCompressor(); + } - @Override - public InputStream decompress(InputStream is) throws IOException { - return compressionCodec.createInputStream(is); + if (innerCompressor == null) { + return compressionCodec.createOutputStream(os); + } + + innerCompressor.reset(); + } + return compressionCodec.createOutputStream(os, innerCompressor); } @Override public CompressionCodecName getCodecName() { return Stream.of(CompressionCodecName.values()) .filter(codec -> compressionCodec.getDefaultExtension().equals(codec.getExtension())) - .findAny().get(); + .findAny() + .get(); } @Override public BytesInput decompress(InputStream inputStream, int compressedSize, int uncompressedSize) throws IOException { - Decompressor decompressor = CodecPool.getDecompressor(compressionCodec); + final Decompressor decompressor = CodecPool.getDecompressor(compressionCodec); if (decompressor != null) { // It is permitted for a decompressor to be null, otherwise we want to reset() it to // be ready for a new stream. @@ -114,6 +124,20 @@ public BytesInput decompress(InputStream inputStream, int compressedSize, int un CodecPool.returnDecompressor(decompressor); } } + + @Override + public void reset() { + if (innerCompressor != null) { + innerCompressor.reset(); + } + } + + @Override + public void close() { + if (innerCompressor != null && innerCompressorPooled) { + CodecPool.returnCompressor(innerCompressor); + } + } } private static Configuration configurationWithCodecClasses(List> codecClasses) { @@ -125,27 +149,29 @@ private static Configuration configurationWithCodecClasses(List> codecC private final CompressionCodecFactory compressionCodecFactory; - public DeephavenCodecFactory(List> codecClasses) { + public DeephavenCompressorAdapterFactory(List> codecClasses) { this(configurationWithCodecClasses(codecClasses)); } - public DeephavenCodecFactory(Configuration configuration) { + public DeephavenCompressorAdapterFactory(Configuration configuration) { compressionCodecFactory = new CompressionCodecFactory(configuration); } /** - * Returns a compressor with the given codec name. Do not use this to get a "no-op" codec, instead use - * {@link Compressor#PASSTHRU}. Names are identified using the {@link CompressionCodecFactory} rules (roughly, the - * first word in the class's name). + * Returns a compressor with the given codec name. * * @param codecName the name of the codec to search for. * @return a compressor instance with a name matching the given codec. */ - public Compressor getByName(String codecName) { + public CompressorAdapter getByName(String codecName) { + if (codecName.equalsIgnoreCase("UNCOMPRESSED")) { + return CompressorAdapter.PASSTHRU; + } + CompressionCodec codec = compressionCodecFactory.getCodecByName(codecName); if (codec == null) { throw new IllegalArgumentException("Failed to find a compression codec with name " + codecName); } - return new CodecWrappingCompressor(codec); + return new CodecWrappingCompressorAdapter(codec); } } diff --git a/settings.gradle b/settings.gradle index 7147b44adae..6c3ed6ffba3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -211,6 +211,9 @@ project(':extensions-parquet-compression').projectDir = file('extensions/parquet include(':extensions-parquet-table') project(':extensions-parquet-table').projectDir = file('extensions/parquet/table') +include(':extensions-parquet-benchmark') +project(':extensions-parquet-benchmark').projectDir = file('extensions/parquet/benchmark') + include(':extensions-barrage') project(':extensions-barrage').projectDir = file('extensions/barrage') From c44d784b2b81b133412fb1ab2f8dbaae50cc77ea Mon Sep 17 00:00:00 2001 From: Chip Kent <5250374+chipkent@users.noreply.github.com> Date: Wed, 28 Sep 2022 11:03:21 -0600 Subject: [PATCH 154/215] Interchange the `vec` and `array` names in the query library (#2917) * Switch the names of vec and array in the query library to be consistent with how DBArray was renamed to Vector in the engine. * Update static imports. --- engine/function/src/templates/Basic.ftl | 30 ++++----- engine/function/src/templates/TestBasic.ftl | 30 ++++----- .../deephaven/libs/GroovyStaticImports.java | 64 +++++++++---------- 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/engine/function/src/templates/Basic.ftl b/engine/function/src/templates/Basic.ftl index f48b8839e3a..80075e0108e 100644 --- a/engine/function/src/templates/Basic.ftl +++ b/engine/function/src/templates/Basic.ftl @@ -291,12 +291,12 @@ public class Basic { } /** - * Converts a DB array to an array. + * Converts a Deephaven vector to an array. * - * @param values DB array + * @param values Deephaven vector * @return primitive array. */ - public static T[] vecObj(ObjectVector values) { + public static T[] arrayObj(ObjectVector values) { if(values == null) { return null; } @@ -305,13 +305,13 @@ public class Basic { } /** - * Converts an array to a DB array. + * Converts an array to a Deephaven vector. * * @param values primitive array - * @return DB array. + * @return Deephaven vector. */ @SafeVarargs - public static ObjectVector arrayObj(T... values){ + public static ObjectVector vecObj(T... values){ if(values == null) { return null; } @@ -961,7 +961,7 @@ public class Basic { return QueryConstants.${pt.null}; } - return last(array(values)); + return last(vec(values)); } /** @@ -989,7 +989,7 @@ public class Basic { return QueryConstants.${pt.null}; } - return first(array(values)); + return first(vec(values)); } /** @@ -1015,16 +1015,16 @@ public class Basic { * @return nth value from the array or null, if the index is outside of the array's index range. */ static public ${pt.primitive} nth(long index, ${pt.primitive}... values){ - return nth(index, array(values)); + return nth(index, vec(values)); } /** - * Converts a DB array to a primitive array. + * Converts a Deephaven vector to a primitive array. * - * @param values DB array + * @param values Deephaven vector * @return primitive array. */ - public static ${pt.primitive}[] vec(${pt.dbArray} values) { + public static ${pt.primitive}[] array(${pt.dbArray} values) { if(values == null){ return null; } @@ -1033,12 +1033,12 @@ public class Basic { } /** - * Converts a primitive array to a DB array. + * Converts a primitive array to a Deephaven vector. * * @param values primitive array - * @return DB array. + * @return Deephaven vector. */ - public static ${pt.dbArray} array(${pt.primitive}... values) { + public static ${pt.dbArray} vec(${pt.primitive}... values) { return new ${pt.dbArrayDirect}(values); } diff --git a/engine/function/src/templates/TestBasic.ftl b/engine/function/src/templates/TestBasic.ftl index ff530fae290..f85d0edb7a7 100644 --- a/engine/function/src/templates/TestBasic.ftl +++ b/engine/function/src/templates/TestBasic.ftl @@ -259,13 +259,13 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(Integer.valueOf(40), nthObj(0, 40, 50, 60)); } - public void testObjVec() { - assertEquals(new Character[]{new Character('1'), new Character('3'), new Character('5')}, vecObj(new ObjectVectorDirect(new Character('1'), new Character('3'), new Character('5')))); + public void testObjArray() { + assertEquals(new Character[]{new Character('1'), new Character('3'), new Character('5')}, arrayObj(new ObjectVectorDirect(new Character('1'), new Character('3'), new Character('5')))); } - public void testObjArray() { - assertEquals(null, arrayObj((Character[])null)); - assertEquals(new ObjectVectorDirect<>(new Character[]{new Character('1'), new Character('3'), new Character('5')}), arrayObj(new Character('1'), new Character('3'), new Character('5'))); + public void testObjVec() { + assertEquals(null, vecObj((Character[])null)); + assertEquals(new ObjectVectorDirect<>(new Character[]{new Character('1'), new Character('3'), new Character('5')}), vecObj(new Character('1'), new Character('3'), new Character('5'))); } public void testObjIn() { @@ -395,13 +395,13 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(QueryConstants.NULL_BOOLEAN, nthObj(10,new Boolean[]{true,false,true})); } - public void testBooleanVec(){ - assertEquals(null, vecObj((ObjectVector)null)); - assertEquals(new Boolean[]{true,false,true}, vecObj(new ObjectVectorDirect<>(true,false,true))); + public void testBooleanArray(){ + assertEquals(null, arrayObj((ObjectVector)null)); + assertEquals(new Boolean[]{true,false,true}, arrayObj(new ObjectVectorDirect<>(true,false,true))); } - public void testBooleanArray(){ - assertEquals(new ObjectVectorDirect(true,false,true), arrayObj(new Boolean[]{true,false,true})); + public void testBooleanVec(){ + assertEquals(new ObjectVectorDirect(true,false,true), vecObj(new Boolean[]{true,false,true})); } public void testBooleanIn(){ @@ -676,13 +676,13 @@ public class TestBasic extends BaseArrayTestCase { assertEquals(new ${pt.primitive}[]{3,1,2,4,${pt.null}}, distinct(new ${pt.primitive}[]{3,1,2,4,1, ${pt.null}, ${pt.null}}, true)); } - public void test${pt.boxed}Vec(){ - assertEquals(new ${pt.primitive}[]{(${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5}, vec(new ${pt.dbArrayDirect}((${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5))); - assertEquals(null, vec((${pt.dbArray})null)); + public void test${pt.boxed}Array(){ + assertEquals(new ${pt.primitive}[]{(${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5}, array(new ${pt.dbArrayDirect}((${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5))); + assertEquals(null, array((${pt.dbArray})null)); } - public void test${pt.boxed}Array(){ - assertEquals(new ${pt.dbArrayDirect}((${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5), array(new ${pt.primitive}[]{(${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5})); + public void test${pt.boxed}Vec(){ + assertEquals(new ${pt.dbArrayDirect}((${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5), vec(new ${pt.primitive}[]{(${pt.primitive})1,(${pt.primitive})3,(${pt.primitive})5})); } public void test${pt.boxed}In(){ diff --git a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java index 9302e692bd9..3eaca611974 100644 --- a/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java +++ b/engine/table/src/main/java/io/deephaven/libs/GroovyStaticImports.java @@ -114,22 +114,22 @@ public class GroovyStaticImports { public static java.lang.Boolean and( java.lang.Boolean[] values, java.lang.Boolean nullValue ) {return Logic.and( values, nullValue );} /** @see io.deephaven.function.Logic#and(io.deephaven.vector.BooleanVector,java.lang.Boolean) */ public static java.lang.Boolean and( io.deephaven.vector.BooleanVector values, java.lang.Boolean nullValue ) {return Logic.and( values, nullValue );} - /** @see io.deephaven.function.Basic#array(byte[]) */ - public static io.deephaven.vector.ByteVector array( byte[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(char[]) */ - public static io.deephaven.vector.CharVector array( char[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(double[]) */ - public static io.deephaven.vector.DoubleVector array( double[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(float[]) */ - public static io.deephaven.vector.FloatVector array( float[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(int[]) */ - public static io.deephaven.vector.IntVector array( int[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(long[]) */ - public static io.deephaven.vector.LongVector array( long[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#array(short[]) */ - public static io.deephaven.vector.ShortVector array( short[] values ) {return Basic.array( values );} - /** @see io.deephaven.function.Basic#arrayObj(T[]) */ - public static io.deephaven.vector.ObjectVector arrayObj( T[] values ) {return Basic.arrayObj( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.ByteVector) */ + public static byte[] array( io.deephaven.vector.ByteVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.CharVector) */ + public static char[] array( io.deephaven.vector.CharVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.DoubleVector) */ + public static double[] array( io.deephaven.vector.DoubleVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.FloatVector) */ + public static float[] array( io.deephaven.vector.FloatVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.IntVector) */ + public static int[] array( io.deephaven.vector.IntVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.LongVector) */ + public static long[] array( io.deephaven.vector.LongVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#array(io.deephaven.vector.ShortVector) */ + public static short[] array( io.deephaven.vector.ShortVector values ) {return Basic.array( values );} + /** @see io.deephaven.function.Basic#arrayObj(io.deephaven.vector.ObjectVector) */ + public static T[] arrayObj( io.deephaven.vector.ObjectVector values ) {return Basic.arrayObj( values );} /** @see io.deephaven.function.Numeric#asin(byte) */ public static double asin( byte value ) {return Numeric.asin( value );} /** @see io.deephaven.function.Numeric#asin(double) */ @@ -2768,22 +2768,22 @@ public class GroovyStaticImports { public static double var( io.deephaven.vector.LongVector values ) {return Numeric.var( values );} /** @see io.deephaven.function.Numeric#var(io.deephaven.vector.ShortVector) */ public static double var( io.deephaven.vector.ShortVector values ) {return Numeric.var( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.ByteVector) */ - public static byte[] vec( io.deephaven.vector.ByteVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.CharVector) */ - public static char[] vec( io.deephaven.vector.CharVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.DoubleVector) */ - public static double[] vec( io.deephaven.vector.DoubleVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.FloatVector) */ - public static float[] vec( io.deephaven.vector.FloatVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.IntVector) */ - public static int[] vec( io.deephaven.vector.IntVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.LongVector) */ - public static long[] vec( io.deephaven.vector.LongVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vec(io.deephaven.vector.ShortVector) */ - public static short[] vec( io.deephaven.vector.ShortVector values ) {return Basic.vec( values );} - /** @see io.deephaven.function.Basic#vecObj(io.deephaven.vector.ObjectVector) */ - public static T[] vecObj( io.deephaven.vector.ObjectVector values ) {return Basic.vecObj( values );} + /** @see io.deephaven.function.Basic#vec(byte[]) */ + public static io.deephaven.vector.ByteVector vec( byte[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(char[]) */ + public static io.deephaven.vector.CharVector vec( char[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(double[]) */ + public static io.deephaven.vector.DoubleVector vec( double[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(float[]) */ + public static io.deephaven.vector.FloatVector vec( float[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(int[]) */ + public static io.deephaven.vector.IntVector vec( int[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(long[]) */ + public static io.deephaven.vector.LongVector vec( long[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vec(short[]) */ + public static io.deephaven.vector.ShortVector vec( short[] values ) {return Basic.vec( values );} + /** @see io.deephaven.function.Basic#vecObj(T[]) */ + public static io.deephaven.vector.ObjectVector vecObj( T[] values ) {return Basic.vecObj( values );} /** @see io.deephaven.function.Numeric#wavg(byte[],byte[]) */ public static double wavg( byte[] values, byte[] weights ) {return Numeric.wavg( values, weights );} /** @see io.deephaven.function.Numeric#wavg(byte[],double[]) */ From ccd782cc1734fa7948a9d30eaf3c24b4045f4281 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 28 Sep 2022 12:31:16 -0700 Subject: [PATCH 155/215] Remove unused commons- dependencies (#2922) --- FishUtil/build.gradle | 2 - .../io/deephaven/util/PropertyRetriever.java | 125 ------------------ IO/build.gradle | 1 - buildSrc/src/main/groovy/Classpaths.groovy | 1 + ...eephaven.java-classpath-conventions.gradle | 13 +- extensions/barrage/build.gradle | 6 + java-client/flight/build.gradle | 6 + .../server/console/ScopeTicketResolver.java | 3 +- .../server/session/TicketResolverBase.java | 12 -- 9 files changed, 18 insertions(+), 151 deletions(-) delete mode 100644 FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java diff --git a/FishUtil/build.gradle b/FishUtil/build.gradle index c0a793b6ec7..bcadd9989db 100644 --- a/FishUtil/build.gradle +++ b/FishUtil/build.gradle @@ -9,8 +9,6 @@ dependencies { implementation project(':IO') implementation project(':Configuration') implementation project(':log-factory') - implementation depCommonsEmail - implementation depCommonsNet testImplementation project(path: ':Base', configuration: 'tests') } \ No newline at end of file diff --git a/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java b/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java deleted file mode 100644 index 2f1e360cd7e..00000000000 --- a/FishUtil/src/main/java/io/deephaven/util/PropertyRetriever.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.util; - -import io.deephaven.configuration.Configuration; -import io.deephaven.configuration.ConfigurationException; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.*; -import java.nio.file.Files; - -/** - * Class to assist with retrieving properties such as passwords from environment variables, files, and properties. - */ -public class PropertyRetriever { - - /** - * Return a property value from a set of possible locations, allowing for optional base64 decoding. The following - * order is used. - *
      - *
    • First, if an environment variable is provided, it is checked. if it exists, then it is returned, - * base64-decoded if requested.
    • - *
    • Next, the property file is checked if the property is provided (the configuration is checked for the provided - * property, and the resulting property value defines the filename). If it exists, the contents are read, - * base64-decoded if requested, then returned.
    • - *
    • Finally, the property is checked. If it exists it is base64-decoded if requested and returned.
    • - *
    • At least one of environmentVariable, fileProperty, or propertyName must be specified and exist.
    • - *
    • If both a property file and property name are provided and exist in the Configuration instance, an exception - * will be thrown.
    • - *
    - * - * @param configuration the Configuration instance to check - * @param propertyMeaning a user-friendly property meaning, included in thrown exceptions - * @param environmentVariable an optional environment variable to check for the value - * @param fileProperty an optional Configuration property that specifies the file that contains the value - * @param propertyName an optional Configuration property that specifies the value - * @param base64Encoded if true, the retrieved value is base64 decoded before being returned to the caller - * @return the found value, base64-decoded if requested - */ - public static String getProperty(@NotNull final Configuration configuration, - @NotNull final String propertyMeaning, - @Nullable final String environmentVariable, - @Nullable final String fileProperty, - @Nullable final String propertyName, - final boolean base64Encoded) { - // This means a coding error on the caller's part - if (environmentVariable == null && fileProperty == null && propertyName == null) { - throw new ConfigurationException( - "No environment variable or properties defined to retrieve property for " + propertyMeaning); - } - - // The environment variable takes precedence - String propertyValue = getPropertyFromEnvironmentVariable(environmentVariable); - - // If nothing was retrieved from the environment variable, then check the property and file - if (propertyValue == null) { - propertyValue = getPropertyFromFileOrProperty(configuration, propertyMeaning, fileProperty, propertyName); - } - - // If it's still null nothing could be found - if (propertyValue == null) { - final StringBuilder propertyPossibilities = new StringBuilder(); - if (environmentVariable != null) { - propertyPossibilities.append("environment variable ").append(environmentVariable); - } - - if (fileProperty != null) { - propertyPossibilities - .append(propertyPossibilities.length() == 0 ? "filename property " : " or filename property "); - propertyPossibilities.append(fileProperty); - } - if (propertyName != null) { - propertyPossibilities.append(propertyPossibilities.length() == 0 ? "property " : " or property "); - propertyPossibilities.append(propertyName); - } - throw new ConfigurationException( - "No " + propertyMeaning + " set, please set " + propertyPossibilities.toString()); - } - - if (base64Encoded) { - return new String(org.apache.commons.codec.binary.Base64.decodeBase64(propertyValue)); - } else { - return propertyValue; - } - } - - private static String getPropertyFromEnvironmentVariable(final String environmentVariable) { - return environmentVariable != null ? System.getenv(environmentVariable) : null; - } - - private static String getPropertyFromFileOrProperty( - final Configuration configuration, final String propertyMeaning, - final String fileProperty, final String propertyName) { - if (fileProperty != null && configuration.hasProperty(fileProperty)) { - if (propertyName != null && configuration.hasProperty(propertyName)) { - throw new IllegalArgumentException("Conflicting properties for " + propertyMeaning + " - both " - + fileProperty + " and " + propertyName + " are set."); - } - final String propertyFilename = configuration.getProperty(fileProperty); - final File propertyFile = new File(propertyFilename); - try { - return Files.readString(propertyFile.toPath()).trim(); - } catch (IOException e) { - try (InputStream resourceAsStream = - PropertyRetriever.class.getResourceAsStream("/" + propertyFilename)) { - if (resourceAsStream == null) { - throw new ConfigurationException("Unable to open file " + propertyFilename - + " specified by " + fileProperty + " for " + propertyMeaning); - } - final BufferedReader bufferedReader = - new BufferedReader(new InputStreamReader(resourceAsStream)); - return bufferedReader.readLine(); - } catch (IOException e2) { - throw new UncheckedIOException( - "Can not read property file " + propertyFilename + " for " + propertyMeaning, e2); - } - } - } else if (propertyName != null && configuration.hasProperty(propertyName)) { - return configuration.getProperty(propertyName); - } - return null; - } -} diff --git a/IO/build.gradle b/IO/build.gradle index 4610cfd22dd..16bc7c6bb25 100644 --- a/IO/build.gradle +++ b/IO/build.gradle @@ -5,7 +5,6 @@ plugins { dependencies { implementation project(':Base') implementation project(':SevenZip') - implementation depCommonsCodec implementation depCommonsCompress testImplementation project(path: ':Base', configuration: 'tests') Classpaths.inheritJUnitClassic(project, 'testImplementation') diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 87b1ffdc80a..808392c6bf7 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -46,6 +46,7 @@ class Classpaths { static final String COMMONS_GROUP = 'org.apache.commons' static final String ARROW_GROUP = 'org.apache.arrow' + // Note, when updated to 9.0.0+, fix deephaven-core#2923. static final String ARROW_VERSION = '7.0.0' static final String SLF4J_GROUP = 'org.slf4j' diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index 5e37ea490bb..60f3f9ca9fc 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -6,11 +6,8 @@ plugins { // TODO(deephaven-core#1162): Adopt java-platform to manage versions ext { depAnnotations = 'com.intellij:annotations:5.1' - depCommonsCodec = 'commons-codec:commons-codec:1.9' depCommonsCompress = 'org.apache.commons:commons-compress:1.18' depCommonsLang3 = 'org.apache.commons:commons-lang3:3.9' - depCommonsNet = 'commons-net:commons-net:3.2' - depCommonsEmail = 'org.apache.commons:commons-email:1.4' depCommonsIo = 'commons-io:commons-io:2.5' depJdom2 = 'org.jdom:jdom2:2.0.6' depTrove3 = 'net.sf.trove4j:trove4j:3.0.3' @@ -19,11 +16,10 @@ ext { configurations { commonsIo - commonsCsv.extendsFrom commonsIo jdom httpClient math3 - jama.extendsFrom math3, commonsCli + jama.extendsFrom math3 dxCompile dxRuntime.extendsFrom dxCompile mockrunner @@ -42,9 +38,9 @@ configurations { fishIoTest.extendsFrom fishBaseTest dhNumerics.extendsFrom fishNumerics, jama - dhUtil.extendsFrom commonsCli, commonsIo, commonsCsv, commonsLang3, commonsText, fishUtil, fishStats, jdom + dhUtil.extendsFrom commonsIo, commonsLang3, commonsText, fishUtil, fishStats, jdom dhPlot.extendsFrom dhUtil - dhBenchmarkSupport.extendsFrom fishData, commonsCsv + dhBenchmarkSupport.extendsFrom fishData dhIntegrations.extendsFrom math3 } @@ -56,11 +52,9 @@ dependencies { commonsLang3 'org.apache.commons:commons-lang3:3.9' commonsText 'org.apache.commons:commons-text:1.9' commonsIo 'commons-io:commons-io:2.6' - commonsCli 'commons-cli:commons-cli:1.4' math3 'org.apache.commons:commons-math3:3.6.1' jama 'gov.nist.math.jama:gov.nist.math.jama:1.1.1' mockrunner 'com.mockrunner:mockrunner-jdbc:1.0.4' - commonsCsv 'org.apache.commons:commons-csv:1.4' Classpaths.inheritJUnitClassic(project, 'junit') Classpaths.inheritJMock(project, 'junit') @@ -71,7 +65,6 @@ dependencies { fishBase project(':Base'), 'net.sf.trove4j:trove4j:3.0.3', 'com.intellij:annotations:5.1', - 'commons-codec:commons-codec:1.11', depCommonsCompress fishIo project(':IO') diff --git a/extensions/barrage/build.gradle b/extensions/barrage/build.gradle index cc7385612e4..8adb36df0e8 100644 --- a/extensions/barrage/build.gradle +++ b/extensions/barrage/build.gradle @@ -25,6 +25,12 @@ dependencies { Classpaths.inheritFlatbuffer(project, 'implementation') Classpaths.inheritArrow(project, 'arrow-vector', 'implementation') + // TODO(deephaven-core#2923): Remove explicit constraint on commons-codec #2923 + constraints { + implementation('commons-codec:commons-codec:1.15') { + because 'arrow-vector depends on outdated version' + } + } Classpaths.inheritArrow(project, 'arrow-format', 'implementation') Classpaths.inheritImmutables(project) diff --git a/java-client/flight/build.gradle b/java-client/flight/build.gradle index c01c9d4ce68..c42b3f73a56 100644 --- a/java-client/flight/build.gradle +++ b/java-client/flight/build.gradle @@ -12,6 +12,12 @@ dependencies { Classpaths.inheritArrow(project, 'flight-core', 'api') Classpaths.inheritArrow(project, 'flight-grpc', 'implementation') Classpaths.inheritArrow(project, 'arrow-vector', 'api') + // TODO(deephaven-core#2923): Remove explicit constraint on commons-codec #2923 + constraints { + implementation('commons-codec:commons-codec:1.15') { + because 'arrow-vector depends on outdated version' + } + } Classpaths.inheritAutoService(project) Classpaths.inheritJUnitPlatform(project) diff --git a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java index e6de82386e1..6b462eea410 100644 --- a/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java +++ b/server/src/main/java/io/deephaven/server/console/ScopeTicketResolver.java @@ -15,6 +15,7 @@ import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.proto.flight.util.TicketRouterHelper; +import io.deephaven.proto.util.ByteHelper; import io.deephaven.proto.util.ScopeTicketHelper; import io.deephaven.server.session.SessionState; import io.deephaven.server.session.TicketResolverBase; @@ -204,7 +205,7 @@ public static String nameForTicket(final ByteBuffer ticket, final String logId) if (ticket.remaining() < 3 || ticket.get(ticket.position()) != TICKET_PREFIX || ticket.get(ticket.position() + 1) != '/') { throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, - "Could not resolve '" + logId + "': found 0x" + byteBufToHex(ticket) + "' (hex)"); + "Could not resolve '" + logId + "': found 0x" + ByteHelper.byteBufToHex(ticket) + "' (hex)"); } final int initialLimit = ticket.limit(); diff --git a/server/src/main/java/io/deephaven/server/session/TicketResolverBase.java b/server/src/main/java/io/deephaven/server/session/TicketResolverBase.java index 775911f7975..c89d1b7da84 100644 --- a/server/src/main/java/io/deephaven/server/session/TicketResolverBase.java +++ b/server/src/main/java/io/deephaven/server/session/TicketResolverBase.java @@ -3,10 +3,6 @@ */ package io.deephaven.server.session; -import org.apache.commons.codec.binary.Hex; - -import java.nio.ByteBuffer; - public abstract class TicketResolverBase implements TicketResolver { private final byte ticketPrefix; private final String flightDescriptorRoute; @@ -25,12 +21,4 @@ public byte ticketRoute() { public String flightDescriptorRoute() { return flightDescriptorRoute; } - - protected static String byteBufToHex(final ByteBuffer ticket) { - final int initialPosition = ticket.position(); - final byte[] buf = new byte[ticket.remaining()]; - ticket.get(buf); - ticket.position(initialPosition); - return Hex.encodeHexString(buf); - } } From 387b97f9f0408053df6a7f544cd93f56247dd603 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 28 Sep 2022 13:51:47 -0700 Subject: [PATCH 156/215] Bump to jpy 0.12.0 (#2918) --- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/tensorflow-base/gradle.properties | 2 +- docker/server/src/main/server-nltk/requirements.txt | 3 ++- .../server/src/main/server-pytorch/requirements.txt | 11 ++++++----- .../server/src/main/server-sklearn/requirements.txt | 3 ++- .../src/main/server-tensorflow/requirements.txt | 11 ++++++----- docker/server/src/main/server/requirements.txt | 3 ++- py/embedded-server/setup.py | 3 ++- py/jpy-ext/build.gradle | 2 +- py/server/setup.py | 2 +- 14 files changed, 28 insertions(+), 22 deletions(-) diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index 05fa38f964a..6493355fa16 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:87138dec8f42ba200a711b7aa150ee9f7c8f0def8371c7aa28787f852b2304cb +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:7a510c2cfb528a53a6656e19b2c43eafddacb73d7305a996145051812d5e765b diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index f2314091bc8..56ad3b7f15b 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:64195abea37d59c7f9c9beff8661b11e06d2e3a001c980033b09ff61d960c8b9 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:3c76a38fe30a251c627446cedc4698b8ffd84cce1044f5d0bad04d38b54573c9 diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index bc22ea7188b..c3f20955b4d 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:58d386abae8e65c1a5e04987992683b430f72a6699bb320f1bd81b2170b217b3 +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:a21961f80b3f13cd7136a7378c4d51e51b01cf2455649f230495068a8497269d diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index 41293d29e4f..a518beb7e6b 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:014c9f24f95c16fc06b67fd376c6eba9a6d62264642929a8be63e55e61822ae9 +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:8b9222b7641be6d66a2444ab65a55e94a0e80fdcb2f8e37ddc52f78b5a561a24 diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index e96aba8bdc7..46c1095a177 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:d679d732f1e341629defec041646ab07859a178eb1cf9715191a366e36bf1d23 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:8b1202b4f83f5ca1a39e45ab917dd4067dd843d7c341a1ef0455f23eceaa2f22 diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index 2bb12b0c9c6..527d00b21e1 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:4e2d9a4803a9f910bd4478ef7f977e7dd8cbd1b86f53fcde2b9d5aab8184b9e1 +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:2598d07a3ac3b79dad27f69ca83b696c279df1cd1f2026d40483dc2a931f297b diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk/requirements.txt index b4412e7271e..cab4ba125de 100644 --- a/docker/server/src/main/server-nltk/requirements.txt +++ b/docker/server/src/main/server-nltk/requirements.txt @@ -1,8 +1,9 @@ click==8.1.3 deephaven-plugin==0.2.0 importlib-metadata==4.12.0 +java-utilities==0.2.0 joblib==1.2.0 -jpy==0.11.0 +jpy==0.12.0 llvmlite==0.39.1 nltk==3.6.7 numba==0.56.2 diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch/requirements.txt index 85d082abeae..65735451926 100644 --- a/docker/server/src/main/server-pytorch/requirements.txt +++ b/docker/server/src/main/server-pytorch/requirements.txt @@ -1,14 +1,15 @@ absl-py==1.2.0 cachetools==5.2.0 -certifi==2022.9.14 +certifi==2022.9.24 charset-normalizer==2.1.1 deephaven-plugin==0.2.0 -google-auth==2.11.1 +google-auth==2.12.0 google-auth-oauthlib==0.4.6 -grpcio==1.48.1 +grpcio==1.49.1 idna==3.4 importlib-metadata==4.12.0 -jpy==0.11.0 +java-utilities==0.2.0 +jpy==0.12.0 llvmlite==0.39.1 Markdown==3.4.1 MarkupSafe==2.1.1 @@ -25,7 +26,7 @@ requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 six==1.16.0 -tensorboard==2.10.0 +tensorboard==2.10.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 torch==1.10.2 diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn/requirements.txt index 491e076838f..733c260497f 100644 --- a/docker/server/src/main/server-sklearn/requirements.txt +++ b/docker/server/src/main/server-sklearn/requirements.txt @@ -1,7 +1,8 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 +java-utilities==0.2.0 joblib==1.2.0 -jpy==0.11.0 +jpy==0.12.0 llvmlite==0.39.1 numba==0.56.2 numpy==1.21.6 diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow/requirements.txt index 917be8a592b..ba30f9529ce 100644 --- a/docker/server/src/main/server-tensorflow/requirements.txt +++ b/docker/server/src/main/server-tensorflow/requirements.txt @@ -1,19 +1,20 @@ absl-py==1.2.0 astunparse==1.6.3 cachetools==5.2.0 -certifi==2022.9.14 +certifi==2022.9.24 charset-normalizer==2.1.1 deephaven-plugin==0.2.0 flatbuffers==2.0.7 gast==0.4.0 -google-auth==2.11.1 +google-auth==2.12.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 -grpcio==1.48.1 +grpcio==1.49.1 h5py==3.7.0 idna==3.4 importlib-metadata==4.12.0 -jpy==0.11.0 +java-utilities==0.2.0 +jpy==0.12.0 keras==2.7.0 Keras-Preprocessing==1.1.2 libclang==14.0.6 @@ -34,7 +35,7 @@ requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 six==1.16.0 -tensorboard==2.10.0 +tensorboard==2.10.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorflow==2.7.4 diff --git a/docker/server/src/main/server/requirements.txt b/docker/server/src/main/server/requirements.txt index 0be336a937b..3ba59ecbbab 100644 --- a/docker/server/src/main/server/requirements.txt +++ b/docker/server/src/main/server/requirements.txt @@ -1,6 +1,7 @@ deephaven-plugin==0.2.0 importlib-metadata==4.12.0 -jpy==0.11.0 +java-utilities==0.2.0 +jpy==0.12.0 llvmlite==0.39.1 numba==0.56.2 numpy==1.21.6 diff --git a/py/embedded-server/setup.py b/py/embedded-server/setup.py index b9283bb0212..cafd748586f 100644 --- a/py/embedded-server/setup.py +++ b/py/embedded-server/setup.py @@ -53,7 +53,8 @@ def normalize_version(version): keywords='Deephaven Development', python_requires='>=3.7', install_requires=[ - 'jpy>=0.11.0', + 'jpy>=0.12.0', + "java-utilities", f"deephaven-core=={__normalized_version__}", ] ) diff --git a/py/jpy-ext/build.gradle b/py/jpy-ext/build.gradle index 52552b83c82..9d30ec683d3 100644 --- a/py/jpy-ext/build.gradle +++ b/py/jpy-ext/build.gradle @@ -16,6 +16,6 @@ plugins { } dependencies { - api 'org.jpyconsortium:jpy:0.11.0' + api 'org.jpyconsortium:jpy:0.12.0' api project(':deephaven-jpy-config') } diff --git a/py/server/setup.py b/py/server/setup.py index a4a593ae5fb..f74848d351b 100644 --- a/py/server/setup.py +++ b/py/server/setup.py @@ -52,7 +52,7 @@ def normalize_version(version): keywords='Deephaven Development', python_requires='>=3.7', install_requires=[ - 'jpy>=0.11.0', + 'jpy>=0.12.0', 'deephaven-plugin', 'numpy', 'pandas', From fbd2e7610d930efbadac5d6323044bbd49486df8 Mon Sep 17 00:00:00 2001 From: Jianfeng Mao <4297243+jmao-denver@users.noreply.github.com> Date: Thu, 29 Sep 2022 05:30:24 +0800 Subject: [PATCH 157/215] Wrap the partitionedAggBy convenience mtd in py (#2907) * Wrap the partitionedAggBy convenience method and all of the aggBy overloads in py --- py/server/deephaven/table.py | 67 ++++++++++++++++++++++-- py/server/tests/test_table.py | 98 +++++++++++++++++++++++++++-------- 2 files changed, 138 insertions(+), 27 deletions(-) diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 4f84627cc76..b8abfa1ee94 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -16,7 +16,7 @@ from deephaven import DHError, dtypes from deephaven._jpy import strict_cast -from deephaven._wrapper import JObjectWrapper +from deephaven._wrapper import JObjectWrapper, unwrap from deephaven.agg import Aggregation from deephaven.column import Column, ColumnType from deephaven.filters import Filter @@ -1282,14 +1282,25 @@ def count_by(self, col: str, by: Union[str, Sequence[str]] = None) -> Table: except Exception as e: raise DHError(e, "table count_by operation failed.") from e - def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], by: Union[str, Sequence[str]] = None) -> Table: + def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], by: Union[str, Sequence[str]] = None, + preserve_empty: bool = False, initial_groups: Table = None) -> Table: """The agg_by method creates a new table containing grouping columns and grouped data. The resulting grouped data is defined by the aggregations specified. Args: aggs (Union[Aggregation, Sequence[Aggregation]]): the aggregation(s) - by (Union[str, Sequence[str]]): the group-by column name(s), default is None - + by (Union[str, Sequence[str]]): the group-by column name(s), if not provided, all rows from this table are + grouped into a single group of rows before the aggregations are applied to the result, default is None. + preserve_empty (bool): whether to keep result rows for groups that are initially empty or become empty as + a result of updates. Each aggregation operator defines its own value for empty groups. Default is False. + initial_groups (Table): a table whose distinct combinations of values for the group-by column(s) + should be used to create an initial set of aggregation groups. All other columns are ignored. This is + useful in combination with preserve_empty=True to ensure that particular groups appear in the result + table, or with preserve_empty=False to control the encounter order for a collection of groups and + thus their relative order in the result. Changes to this table are not expected or handled; if this + table is a refreshing table, only its contents at instantiation time will be used. Default is None, + the result will be the same as if a table is provided but no rows were supplied. When it is provided, + the 'by' argument must be provided to explicitly specify the grouping columns. Returns: a new table @@ -1299,11 +1310,57 @@ def agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], by: Union[str, try: aggs = to_sequence(aggs) by = to_sequence(by) + if not by and initial_groups: + raise ValueError("missing group-by column names when initial_groups is provided.") j_agg_list = j_array_list([agg.j_aggregation for agg in aggs]) - return Table(j_table=self.j_table.aggBy(j_agg_list, *by)) + if not by: + return Table(j_table=self.j_table.aggBy(j_agg_list, preserve_empty)) + else: + j_column_name_list = j_array_list([_JColumnName.of(col) for col in by]) + initial_groups = unwrap(initial_groups) + return Table( + j_table=self.j_table.aggBy(j_agg_list, preserve_empty, initial_groups, j_column_name_list)) except Exception as e: raise DHError(e, "table agg_by operation failed.") from e + def partitioned_agg_by(self, aggs: Union[Aggregation, Sequence[Aggregation]], + by: Union[str, Sequence[str]] = None, preserve_empty: bool = False, + initial_groups: Table = None) -> PartitionedTable: + """The partitioned_agg_by method is a convenience method that performs an agg_by operation on this table and + wraps the result in a PartitionedTable. If the argument 'aggs' does not include a partition aggregation + created by calling :py:func:`agg.partition`, one will be added automatically with the default constituent column + name __CONSTITUENT__. + + Args: + aggs (Union[Aggregation, Sequence[Aggregation]]): the aggregation(s) + by (Union[str, Sequence[str]]): the group-by column name(s), default is None + preserve_empty (bool): whether to keep result rows for groups that are initially empty or become empty as + a result of updates. Each aggregation operator defines its own value for empty groups. Default is False. + initial_groups (Table): a table whose distinct combinations of values for the group-by column(s) + should be used to create an initial set of aggregation groups. All other columns are ignored. This is + useful in combination with preserve_empty=True to ensure that particular groups appear in the result + table, or with preserve_empty=False to control the encounter order for a collection of groups and + thus their relative order in the result. Changes to this table are not expected or handled; if this + table is a refreshing table, only its contents at instantiation time will be used. Default is None, + the result will be the same as if a table is provided but no rows were supplied. When it is provided, + the 'by' argument must be provided to explicitly specify the grouping columns. + + Returns: + a PartitionedTable + + Raises: + DHError + """ + try: + aggs = to_sequence(aggs) + by = to_sequence(by) + j_agg_list = j_array_list([agg.j_aggregation for agg in aggs]) + initial_groups = unwrap(initial_groups) + return PartitionedTable( + j_partitioned_table=self.j_table.partitionedAggBy(j_agg_list, preserve_empty, initial_groups, *by)) + except Exception as e: + raise DHError(e, "table partitioned_agg_by operation failed.") from e + def agg_all_by(self, agg: Aggregation, by: Union[str, Sequence[str]] = None) -> Table: """The agg_all_by method creates a new table containing grouping columns and grouped data. The resulting grouped data is defined by the aggregation specified. diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index e7f2403c3ee..1bf0dd7a44c 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -19,6 +19,23 @@ class TableTestCase(BaseTestCase): def setUp(self): super().setUp() self.test_table = read_csv("tests/data/test_table.csv") + self.aggs = [ + group(["aggGroup=var"]), + avg(["aggAvg=var"]), + count_("aggCount"), + partition("aggPartition"), + first(["aggFirst=var"]), + last(["aggLast=var"]), + max_(["aggMax=var"]), + median(["aggMed=var"]), + min_(["aggMin=var"]), + pct(0.20, ["aggPct=var"]), + std(["aggStd=var"]), + sum_(["aggSum=var"]), + abs_sum(["aggAbsSum=var"]), + var(["aggVar=var"]), + weighted_avg("var", ["weights"]), + ] def tearDown(self) -> None: self.test_table = None @@ -406,30 +423,67 @@ def test_agg_by_2(self): ["grp_id=(int)(i/5)", "var=(int)i", "weights=(double)1.0/(i+1)"] ) - aggs = [ - group(["aggGroup=var"]), - avg(["aggAvg=var"]), - count_("aggCount"), - partition("aggPartition"), - first(["aggFirst=var"]), - last(["aggLast=var"]), - max_(["aggMax=var"]), - median(["aggMed=var"]), - min_(["aggMin=var"]), - pct(0.20, ["aggPct=var"]), - std(["aggStd=var"]), - sum_(["aggSum=var"]), - abs_sum(["aggAbsSum=var"]), - var(["aggVar=var"]), - weighted_avg("var", ["weights"]), - ] - - result_table = test_table.agg_by(aggs, ["grp_id"]) - self.assertGreaterEqual(result_table.size, 1) + result_table = test_table.agg_by(self.aggs, ["grp_id"]) + self.assertEqual(result_table.size, 2) - for agg in aggs: + for agg in self.aggs: result_table = test_table.agg_by(agg, "grp_id") - self.assertGreaterEqual(result_table.size, 1) + self.assertEqual(result_table.size, 2) + + def test_agg_by_initial_groups_preserve_empty(self): + test_table = empty_table(10) + test_table = test_table.update( + ["grp_id=(int)(i/5)", "var=(int)i", "weights=(double)1.0/(i+1)"] + ) + + with self.subTest("no-initial-groups, no-by, preserve_empty only"): + t = test_table.where("grp_id > 2") + result_table = t.agg_by(self.aggs, preserve_empty=False) + self.assertEqual(result_table.size, 0) + result_table = t.agg_by(self.aggs, preserve_empty=True) + self.assertEqual(result_table.size, 1) + print(result_table.to_string()) + + with self.subTest("with initial-groups, no-by, and preserve_empty"): + init_groups = test_table.update("grp_id=i") + # can't specify 'initial-groups' without also specifying 'by' + with self.assertRaises(DHError): + result_table = test_table.agg_by(self.aggs, initial_groups=init_groups) + + with self.subTest("with initial-groups, by, and preserve_empty"): + result_table = test_table.agg_by(self.aggs, by="grp_id", initial_groups=init_groups, preserve_empty=False) + self.assertEqual(result_table.size, 2) + result_table = test_table.agg_by(self.aggs, by="grp_id", initial_groups=init_groups, preserve_empty=True) + self.assertEqual(result_table.size, 10) + + def test_partitioned_agg_by(self): + test_table = empty_table(10) + test_table = test_table.update( + ["grp_id=(int)(i/5)", "var=(int)i", "weights=(double)1.0/(i+1)"] + ) + + with self.subTest("no-initial-groups"): + result_pt = test_table.partitioned_agg_by(aggs=self.aggs, by="grp_id") + self.assertGreaterEqual(result_pt.table.size, 2) + self.assertEqual(result_pt.constituent_column, "aggPartition") + self.assertEqual(result_pt.key_columns, ["grp_id"]) + for ct in result_pt.constituent_tables: + self.assertEqual(ct.size, 5) + + with self.subTest("initial-groups, preserve_empty=True"): + init_groups = test_table.update("grp_id=i") + result_pt1 = test_table.partitioned_agg_by(aggs=self.aggs, by="grp_id", preserve_empty=True, + initial_groups=init_groups) + self.assertGreaterEqual(result_pt1.table.size, 10) + self.assertTrue(any([ct.size == 0 for ct in result_pt1.constituent_tables])) + self.assertTrue(any([ct.size == 5 for ct in result_pt1.constituent_tables])) + + with self.subTest("initial-groups, preserve_empty=False, used to control constituent table order (reversed)"): + reversed_init_groups = test_table.update("grp_id=i").reverse() + result_pt2 = test_table.partitioned_agg_by(aggs=self.aggs, by="grp_id", initial_groups=reversed_init_groups) + + self.assertEqual(result_pt2.table.size, 2) + self.assertEqual(result_pt.keys().to_string(), result_pt2.keys().reverse().to_string()) def test_snapshot(self): with self.subTest("do_init is False"): From d379f90b2ec540692a281ec2d4f7abe3eafd5c9f Mon Sep 17 00:00:00 2001 From: Ryan Caudy Date: Wed, 28 Sep 2022 17:53:06 -0400 Subject: [PATCH 158/215] QueryTable.snapshot fix for modification propagation and row set cleanup. TableUpdateValidator enhancement. Port some DHE fixes. (#2921) * QueryTable.snapshot: Fix modification propagation (now always uses remove + add in shift-aware style) * QueryTable.snapshot: Avoid RowSet resource leaks when not notifying * TableUpdateValidator: Verify modified RowSet does not overlap added or removed * Port DH-11935: ModifiedColumnSet incorrectly propagates ALL to ALL * Port DH-12666: Remove unnecessary selectDistinct from whereIn and whereNotIn for Static Tables --- .../engine/table/ModifiedColumnSet.java | 22 +- .../engine/table/impl/QueryTable.java | 9 +- .../table/impl/TableUpdateValidator.java | 8 + .../table/impl/select/DynamicWhereFilter.java | 74 +++-- .../snapshot/SnapshotInternalListener.java | 40 +-- .../engine/table/impl/QueryTableTest.java | 311 ++++++++++-------- 6 files changed, 268 insertions(+), 196 deletions(-) diff --git a/engine/api/src/main/java/io/deephaven/engine/table/ModifiedColumnSet.java b/engine/api/src/main/java/io/deephaven/engine/table/ModifiedColumnSet.java index 7c8db5771ae..0008abc602f 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/ModifiedColumnSet.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/ModifiedColumnSet.java @@ -244,10 +244,6 @@ default void clearAndTransform(final ModifiedColumnSet input, final ModifiedColu * @param output result table's columns to propagate dirty columns to */ default void transform(final ModifiedColumnSet input, final ModifiedColumnSet output) { - if (input == ALL) { - output.setAllDirty(); - return; - } if (input == null || input.empty()) { return; } @@ -302,6 +298,11 @@ public ModifiedColumnSet(final ModifiedColumnSet other) { */ public Transformer newTransformer(final String[] columnNames, final ModifiedColumnSet[] columnSets) { Assert.eq(columnNames.length, "columnNames.length", columnSets.length, "columnSets.length"); + if (columnNames.length == 0) { + return (input, output) -> { + }; + } + final int[] columnBits = new int[columnNames.length]; for (int i = 0; i < columnNames.length; ++i) { final int bitIndex = idMap.get(columnNames[i]); @@ -313,7 +314,16 @@ public Transformer newTransformer(final String[] columnNames, final ModifiedColu Assert.eq(columnSets[0].columns, "columnSets[0].columns", columnSets[i].columns, "columnSets[i].columns"); } + final ModifiedColumnSet allColumns = new ModifiedColumnSet(columnSets[0]); + for (int i = 0; i < columnNames.length; ++i) { + allColumns.setAll(columnSets[i]); + } + return (input, output) -> { + if (input == ALL) { + output.setAll(allColumns); + return; + } verifyCompatibilityWith(input); for (int i = 0; i < columnBits.length; ++i) { if (input.dirtyColumns.get(columnBits[i])) { @@ -339,6 +349,10 @@ public Transformer newIdentityTransformer(final Map { + if (input == ALL) { + output.setAllDirty(); + return; + } if (input.columns != columns || output.columns != newColumns) { throw new IllegalArgumentException( "Provided ModifiedColumnSets are not compatible with this Transformer!"); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index cd1ec492937..0dda05cd6a9 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -1137,7 +1137,14 @@ private Table whereInInternal(final Table rightTable, final boolean inclusion, sizeForInstrumentation(), () -> { checkInitiateOperation(rightTable); - final Table distinctValues = rightTable.selectDistinct(MatchPair.getRightColumns(columnsToMatch)); + final Table distinctValues; + final boolean setRefreshing = rightTable.isRefreshing(); + if (setRefreshing) { + distinctValues = rightTable.selectDistinct(MatchPair.getRightColumns(columnsToMatch)); + } else { + distinctValues = rightTable; + } + final DynamicWhereFilter dynamicWhereFilter = new DynamicWhereFilter((QueryTable) distinctValues, inclusion, columnsToMatch); final Table where = whereInternal(dynamicWhereFilter); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableUpdateValidator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableUpdateValidator.java index 76e8dc985f1..6e42c3adfbf 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableUpdateValidator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableUpdateValidator.java @@ -195,6 +195,14 @@ private void onUpdate(final TableUpdate upstream) { // modified updateValues(upstream.modifiedColumnSet(), upstream.modified(), false); + if (upstream.added().overlaps(upstream.modified())) { + noteIssue(() -> "added contains rows that are modified (post-shift): " + + upstream.added().intersect(upstream.modified())); + } + if (upstream.removed().overlaps(upstream.getModifiedPreShift())) { + noteIssue(() -> "removed contains rows that are modified (pre-shift): " + + upstream.removed().intersect(upstream.getModifiedPreShift())); + } if (!issues.isEmpty()) { StringBuilder result = diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DynamicWhereFilter.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DynamicWhereFilter.java index 3d8c91db1b1..c0fdeee3f1b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DynamicWhereFilter.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/DynamicWhereFilter.java @@ -33,8 +33,9 @@ public class DynamicWhereFilter extends WhereFilterLivenessArtifactImpl implements NotificationQueue.Dependency { private static final int CHUNK_SIZE = 1 << 16; + private final boolean setRefreshing; private final MatchPair[] matchPairs; - private final TupleSource setTupleSource; + private final TupleSource setTupleSource; private final boolean inclusion; private final HashSet liveValues = new HashSet<>(); @@ -54,22 +55,22 @@ public class DynamicWhereFilter extends WhereFilterLivenessArtifactImpl implemen private QueryTable resultTable; public DynamicWhereFilter(final QueryTable setTable, final boolean inclusion, final MatchPair... setColumnsNames) { - if (setTable.isRefreshing()) { + setRefreshing = setTable.isRefreshing(); + if (setRefreshing) { UpdateGraphProcessor.DEFAULT.checkInitiateTableOperation(); } this.matchPairs = setColumnsNames; this.inclusion = inclusion; - this.setTable = setTable; - final ColumnSource[] setColumns = - Arrays.stream(matchPairs).map(mp -> setTable.getColumnSource(mp.rightColumn())) - .toArray(ColumnSource[]::new); - setTupleSource = TupleSourceFactory.makeTupleSource(setColumns); + final ColumnSource[] setColumns = Arrays.stream(matchPairs) + .map(mp -> setTable.getColumnSource(mp.rightColumn())).toArray(ColumnSource[]::new); - setTable.getRowSet().forAllRowKeys((final long v) -> addKey(makeKey(v))); + if (setRefreshing) { + this.setTable = setTable; + setTupleSource = TupleSourceFactory.makeTupleSource(setColumns); + setTable.getRowSet().forAllRowKeys((final long v) -> addKey(makeKey(v))); - if (DynamicNode.isDynamicAndIsRefreshing(setTable)) { final String[] columnNames = Arrays.stream(matchPairs).map(MatchPair::rightColumn).toArray(String[]::new); final ModifiedColumnSet modTokenSet = setTable.newModifiedColumnSet(columnNames); setUpdateListener = new InstrumentedTableUpdateListenerAdapter( @@ -128,12 +129,22 @@ public void onFailureInternal(Throwable originalException, Entry sourceEntry) { manage(setUpdateListener); } else { + this.setTable = null; + setTupleSource = null; + final TupleSource temporaryTupleSource = TupleSourceFactory.makeTupleSource(setColumns); + setTable.getRowSet().forAllRowKeys((final long v) -> addKeyUnchecked(makeKey(temporaryTupleSource, v))); + kernelValid = liveValuesArrayValid = false; + setInclusionKernel = null; setUpdateListener = null; } } private Object makeKey(long index) { - return setTupleSource.createTuple(index); + return makeKey(setTupleSource, index); + } + + private static Object makeKey(TupleSource tupleSource, long index) { + return tupleSource.createTuple(index); } private Object makePrevKey(long index) { @@ -158,6 +169,10 @@ private void addKey(Object key) { setInclusionKernel = null; } + private void addKeyUnchecked(Object key) { + liveValues.add(key); + } + @Override public List getColumns() { return Arrays.asList(MatchPair.getLeftColumns(matchPairs)); @@ -177,10 +192,9 @@ public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, bool throw new PreviousFilteringNotSupported(); } - final ColumnSource[] keyColumns = - Arrays.stream(matchPairs).map(mp -> table.getColumnSource(mp.leftColumn())) - .toArray(ColumnSource[]::new); - final TupleSource tupleSource = TupleSourceFactory.makeTupleSource(keyColumns); + final ColumnSource[] keyColumns = Arrays.stream(matchPairs) + .map(mp -> table.getColumnSource(mp.leftColumn())).toArray(ColumnSource[]::new); + final TupleSource tupleSource = TupleSourceFactory.makeTupleSource(keyColumns); final TrackingRowSet trackingSelection = selection.isTracking() ? selection.trackingCast() : null; if (matchPairs.length == 1) { @@ -208,12 +222,10 @@ public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, bool return filterGrouping(trackingSelection, selectionIndexer, tupleSource); } - final ColumnSource[] sourcesWithGroupings = - Arrays.stream(keyColumns).filter(selectionIndexer::hasGrouping) - .toArray(ColumnSource[]::new); - final OptionalInt minGroupCount = - Arrays.stream(sourcesWithGroupings).mapToInt(x -> selectionIndexer.getGrouping(x).size()) - .min(); + final ColumnSource[] sourcesWithGroupings = Arrays.stream(keyColumns) + .filter(selectionIndexer::hasGrouping).toArray(ColumnSource[]::new); + final OptionalInt minGroupCount = Arrays.stream(sourcesWithGroupings) + .mapToInt(x -> selectionIndexer.getGrouping(x).size()).min(); if (minGroupCount.isPresent() && (minGroupCount.getAsInt() * 4L) < selection.size()) { return filterGrouping(trackingSelection, selectionIndexer, tupleSource); } @@ -222,20 +234,19 @@ public WritableRowSet filter(RowSet selection, RowSet fullSet, Table table, bool } private WritableRowSet filterGrouping(TrackingRowSet selection, RowSetIndexer selectionIndexer, - TupleSource tupleSource) { + TupleSource tupleSource) { final RowSet matchingKeys = selectionIndexer.getSubSetForKeySet(liveValues, tupleSource); return (inclusion ? matchingKeys.copy() : selection.minus(matchingKeys)); } private WritableRowSet filterGrouping(TrackingRowSet selection, RowSetIndexer selectionIndexer, Table table) { - final ColumnSource[] keyColumns = - Arrays.stream(matchPairs).map(mp -> table.getColumnSource(mp.leftColumn())) - .toArray(ColumnSource[]::new); - final TupleSource tupleSource = TupleSourceFactory.makeTupleSource(keyColumns); + final ColumnSource[] keyColumns = Arrays.stream(matchPairs) + .map(mp -> table.getColumnSource(mp.leftColumn())).toArray(ColumnSource[]::new); + final TupleSource tupleSource = TupleSourceFactory.makeTupleSource(keyColumns); return filterGrouping(selection, selectionIndexer, tupleSource); } - private WritableRowSet filterLinear(RowSet selection, ColumnSource[] keyColumns, TupleSource tupleSource) { + private WritableRowSet filterLinear(RowSet selection, ColumnSource[] keyColumns, TupleSource tupleSource) { if (keyColumns.length == 1) { return filterLinearOne(selection, keyColumns[0]); } else { @@ -243,7 +254,7 @@ private WritableRowSet filterLinear(RowSet selection, ColumnSource[] keyColumns, } } - private WritableRowSet filterLinearOne(RowSet selection, ColumnSource keyColumn) { + private WritableRowSet filterLinearOne(RowSet selection, ColumnSource keyColumn) { if (selection.isEmpty()) { return RowSetFactory.empty(); } @@ -257,14 +268,13 @@ private WritableRowSet filterLinearOne(RowSet selection, ColumnSource keyColumn) try (final ColumnSource.GetContext getContext = keyColumn.makeGetContext(CHUNK_SIZE); final RowSequence.Iterator rsIt = selection.getRowSequenceIterator()) { - final WritableLongChunk keyIndices = - WritableLongChunk.makeWritableChunk(CHUNK_SIZE); + final WritableLongChunk keyIndices = WritableLongChunk.makeWritableChunk(CHUNK_SIZE); final WritableBooleanChunk matches = WritableBooleanChunk.makeWritableChunk(CHUNK_SIZE); while (rsIt.hasMore()) { final RowSequence chunkOk = rsIt.getNextRowSequenceWithLength(CHUNK_SIZE); - final Chunk chunk = keyColumn.getChunk(getContext, chunkOk); + final Chunk chunk = Chunk.downcast(keyColumn.getChunk(getContext, chunkOk)); setInclusionKernel.matchValues(chunk, matches); keyIndices.setSize(chunk.size()); @@ -282,7 +292,7 @@ private WritableRowSet filterLinearOne(RowSet selection, ColumnSource keyColumn) return indexBuilder.build(); } - private WritableRowSet filterLinearTuple(RowSet selection, TupleSource tupleSource) { + private WritableRowSet filterLinearTuple(RowSet selection, TupleSource tupleSource) { final RowSetBuilderSequential indexBuilder = RowSetFactory.builderSequential(); for (final RowSet.Iterator it = selection.iterator(); it.hasNext();) { @@ -304,7 +314,7 @@ public boolean isSimpleFilter() { @Override public boolean isRefreshing() { - return setTable.isRefreshing(); + return setRefreshing; } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java index 17b3703e1af..edc8b86e31d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/snapshot/SnapshotInternalListener.java @@ -4,17 +4,12 @@ package io.deephaven.engine.table.impl.snapshot; import io.deephaven.chunk.attributes.Values; -import io.deephaven.engine.rowset.RowSet; -import io.deephaven.engine.rowset.RowSetFactory; -import io.deephaven.engine.rowset.TrackingWritableRowSet; -import io.deephaven.engine.rowset.TrackingRowSet; -import io.deephaven.engine.table.ChunkSource; -import io.deephaven.engine.table.ColumnSource; -import io.deephaven.engine.table.Table; -import io.deephaven.engine.table.TableUpdate; +import io.deephaven.engine.rowset.*; +import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.BaseTable; import io.deephaven.engine.table.impl.LazySnapshotTable; import io.deephaven.engine.table.impl.QueryTable; +import io.deephaven.engine.table.impl.TableUpdateImpl; import io.deephaven.engine.table.impl.sources.ArrayBackedColumnSource; import io.deephaven.engine.table.impl.sources.SingleValueColumnSource; @@ -83,29 +78,14 @@ public void doSnapshot(final boolean notifyListeners, final boolean usePrev) { } } if (snapshotPrevLength < snapshotSize) { - // If the table got larger then: - // - added is (the suffix) - // - modified is (the old RowSet) - // resultRowSet updated (by including added) for next time - final RowSet addedRange = RowSetFactory.fromRange(snapshotPrevLength, snapshotSize - 1); - resultRowSet.insert(addedRange); - if (notifyListeners) { - result.notifyListeners(addedRange, RowSetFactory.empty(), resultRowSet.copy()); - } + resultRowSet.insertRange(snapshotPrevLength, snapshotSize - 1); } else if (snapshotPrevLength > snapshotSize) { - // If the table got smaller, then: - // - removed is (the suffix) - // - resultRowSet updated (by removing 'removed') for next time - // modified is (just use the new RowSet) - final RowSet removedRange = RowSetFactory.fromRange(snapshotSize, snapshotPrevLength - 1); - resultRowSet.remove(removedRange); - if (notifyListeners) { - result.notifyListeners(RowSetFactory.empty(), removedRange, resultRowSet.copy()); - } - } else if (notifyListeners) { - // If the table stayed the same size, then modified = the RowSet - result.notifyListeners(RowSetFactory.empty(), RowSetFactory.empty(), - resultRowSet.copy()); + resultRowSet.removeRange(snapshotSize, snapshotPrevLength - 1); + } + if (notifyListeners) { + result.notifyListeners(new TableUpdateImpl( + resultRowSet.copy(), resultRowSet.copyPrev(), + RowSetFactory.empty(), RowSetShiftData.EMPTY, ModifiedColumnSet.EMPTY)); } snapshotPrevLength = snapshotTable.size(); } diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java index 30953692f26..5c7b49b77ae 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableTest.java @@ -736,7 +736,7 @@ public void testRenameColumnsIncremental() { new TstUtils.IntGenerator(10, 100), new TstUtils.SetGenerator<>(10.1, 20.1, 30.1))); - final EvalNugget en[] = new EvalNugget[] { + final EvalNugget[] en = new EvalNugget[] { EvalNugget.from(() -> queryTable.renameColumns(List.of())), EvalNugget.from(() -> queryTable.renameColumns("Symbol=Sym")), EvalNugget.from(() -> queryTable.renameColumns("Symbol=Sym", "Symbols=Sym")), @@ -911,7 +911,7 @@ public void testDateTimeRangeFilter() { final DateTime lower = DateTimeUtils.plus(startTime, DateTimeUtils.SECOND); final DateTime upper = DateTimeUtils.plus(startTime, DateTimeUtils.SECOND * 2); - final EvalNuggetInterface en[] = new EvalNuggetInterface[] { + final EvalNuggetInterface[] en = new EvalNuggetInterface[] { new TableComparator( table.where(filter.apply( "Timestamp >= '" + lower.toString() + "' && Timestamp <= '" + upper.toString() + "'")), @@ -971,7 +971,7 @@ public void testDateTimeRangeFilterNulls() { final DateTime lower = DateTimeUtils.plus(startTime, DateTimeUtils.SECOND); final DateTime upper = DateTimeUtils.plus(startTime, DateTimeUtils.SECOND * 2); - final EvalNuggetInterface en[] = new EvalNuggetInterface[] { + final EvalNuggetInterface[] en = new EvalNuggetInterface[] { new TableComparator( table.where(filter.apply( "Timestamp >= '" + lower.toString() + "' && Timestamp <= '" + upper.toString() + "'")), @@ -1050,7 +1050,7 @@ public long getLong(long rowKey) { // noinspection unchecked final DataColumn licsr = bigReversed.getColumn("LICS"); assertEquals((long) Integer.MAX_VALUE * 2L, (long) licsr.get(0)); - assertEquals((long) Integer.MAX_VALUE, (long) licsr.get(1)); + assertEquals(Integer.MAX_VALUE, (long) licsr.get(1)); assertEquals(0, (long) licsr.get(2)); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { @@ -1062,7 +1062,7 @@ public long getLong(long rowKey) { assertEquals(Long.MAX_VALUE, (long) licsr.get(0)); assertEquals((long) Integer.MAX_VALUE * 2L, (long) licsr.get(1)); - assertEquals((long) Integer.MAX_VALUE, (long) licsr.get(2)); + assertEquals(Integer.MAX_VALUE, (long) licsr.get(2)); assertEquals(0, (long) licsr.get(3)); } @@ -1205,12 +1205,14 @@ public void testSnapshot() { final Table expected = right.naturalJoin(left1, "", "T"); TableTools.showWithRowSet(expected); final Table actual = left1.snapshot(right); + validateUpdates(actual); assertTableEquals(expected, actual); assertTableEquals(right.head(0).updateView("T=1"), left1.snapshot(right, false)); final QueryTable left2 = testRefreshingTable(c("T", 1, 2)); final Table snapshot = left2.snapshot(right); + validateUpdates(snapshot); final Table expect1 = newTable(c("A", 3, 1, 2), c("B", "c", "a", "b"), c("T", 2, 2, 2)); assertTableEquals(expect1, snapshot); @@ -1259,6 +1261,7 @@ public void testSnapshotArrayTrigger() { final Table expected = right.naturalJoin(leftBy, "", "T"); TableTools.showWithRowSet(expected); final Table actual = leftBy.snapshot(right); + validateUpdates(actual); assertTableEquals(expected, actual); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { @@ -1285,6 +1288,7 @@ public void testSnapshotArrayValues() { TableTools.showWithRowSet(ex1); final Table actual = left1.snapshot(rightBy); + validateUpdates(actual); assertTableEquals(ex1, actual); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { @@ -1398,52 +1402,108 @@ public void testSnapshotDependencies() { QueryScope.addParam("testSnapshotDependenciesCounter", new AtomicInteger()); final Table snappedFirst = left.snapshot(right); + validateUpdates(snappedFirst); final Table snappedDep = snappedFirst.select("B=testSnapshotDependenciesCounter.incrementAndGet()"); final Table snappedOfSnap = left.snapshot(snappedDep); + validateUpdates(snappedOfSnap); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); }); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { addToTable(left, i(2), c("T", 2)); left.notifyListeners(i(2), i(), i()); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); - // this will do the notification for left; at which point we can do the first snapshot + // This will do the notification for left; at which point we can do the first snapshot boolean flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); - // now we should flush the select + // This should flush the TUV and the select flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); + TestCase.assertTrue(flushed); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); - // now we should flush the second snapshot + // Now we should flush the second snapshot flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); + // This should flush the second TUV flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); - TestCase.assertFalse(flushed); + TestCase.assertTrue(flushed); + // And now we should be done + flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); + TestCase.assertFalse(flushed); }); TableTools.show(snappedOfSnap); - TestCase.assertEquals(snappedOfSnap.size(), 1); - TestCase.assertEquals(snappedOfSnap.getColumn("B").get(0), 1); + TestCase.assertEquals(1, snappedOfSnap.size()); + TestCase.assertEquals(2, snappedOfSnap.getColumn("B").get(0)); + } + + public void testSnapshotAdditions() { + final QueryTable right = testRefreshingTable(i(10).toTracking(), c("A", 1)); + final QueryTable left = testRefreshingTable(c("T", 1)); + + final Table snapshot = left.snapshot(right); + validateUpdates(snapshot); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + addToTable(right, i(20), c("A", 2)); + left.notifyListeners(i(), i(), i(0)); + }); + + TestCase.assertEquals(2, snapshot.size()); + assertTableEquals(testTable(c("A", 1, 2), c("T", 1, 1)), snapshot); + } + + public void testSnapshotRemovals() { + final QueryTable right = testRefreshingTable(i(10, 20).toTracking(), c("A", 1, 2)); + final QueryTable left = testRefreshingTable(c("T", 1)); + + final Table snapshot = left.snapshot(right); + validateUpdates(snapshot); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + removeRows(right, i(20)); + left.notifyListeners(i(), i(), i(0)); + }); + + TestCase.assertEquals(1, snapshot.size()); + assertTableEquals(testTable(c("A", 1), c("T", 1)), snapshot); + } + + public void testSnapshotModifies() { + final QueryTable right = testRefreshingTable(i(10).toTracking(), c("A", 1)); + final QueryTable left = testRefreshingTable(c("T", 1)); + + final Table snapshot = left.snapshot(right); + validateUpdates(snapshot); + + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + right.notifyListeners(i(), i(), i(20)); + left.notifyListeners(i(), i(), i(0)); + }); + + TestCase.assertEquals(1, snapshot.size()); + assertTableEquals(testTable(c("A", 1), c("T", 1)), snapshot); } public void testSnapshotIncrementalDependencies() { @@ -1458,9 +1518,9 @@ public void testSnapshotIncrementalDependencies() { UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { System.out.println("Checking everything is satisfied with no updates."); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Simple Update Cycle Complete."); }); @@ -1470,9 +1530,9 @@ public void testSnapshotIncrementalDependencies() { left.notifyListeners(i(2), i(), i()); System.out.println("Checking initial satisfaction."); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing first notification."); // this will do the notification for left @@ -1480,18 +1540,18 @@ public void testSnapshotIncrementalDependencies() { System.out.println("Checking satisfaction after #1."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing second notification, which should be our listener recorder"); flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #2."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing third notification, which should be our merged listener"); @@ -1499,30 +1559,30 @@ public void testSnapshotIncrementalDependencies() { flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); // this will do the merged notification; which means the snaphsot is satisfied TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the select flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the second snapshot recorder flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the second snapshot merged listener flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // nothing left flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); @@ -1539,9 +1599,9 @@ public void testSnapshotIncrementalDependencies() { right.notifyListeners(i(2), i(), i()); System.out.println("Checking initial satisfaction."); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing first notification."); // this will do the notification for right; at which point we can should get the update going through @@ -1549,18 +1609,18 @@ public void testSnapshotIncrementalDependencies() { System.out.println("Checking satisfaction after #1."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing second notification, which should be our merged listener"); flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #2."); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // nothing left flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); @@ -1581,65 +1641,65 @@ public void testSnapshotIncrementalDependencies() { left.notifyListeners(i(3), i(), i()); System.out.println("Checking initial satisfaction."); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing first notification."); boolean flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #1."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing second notification, which should be the recorder for our second snapshot"); flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #2."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing third notification, which should be our right recorder"); flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #3."); TestCase.assertTrue(flushed); - TestCase.assertFalse(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); System.out.println("Flushing fourth notification, which should be our MergedListener"); flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); System.out.println("Checking satisfaction after #4."); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the select flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the second snapshot recorder flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // now we should flush the second snapshot merged listener flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) snappedFirst).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedDep).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) snappedOfSnap).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedFirst.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedDep.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(snappedOfSnap.satisfied(LogicalClock.DEFAULT.currentStep())); // nothing left flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); @@ -1671,18 +1731,18 @@ public void testWhereInDependency() { UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { TestCase.assertTrue(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(composed.satisfied(LogicalClock.DEFAULT.currentStep())); }); UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { addToTable(setTable, i(103), c("A", 5), c("B", 8)); setTable.notifyListeners(i(103), i(), i()); - TestCase.assertFalse(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // this will do the notification for table; which should first fire the recorder for setTable1 UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); @@ -1692,52 +1752,52 @@ public void testWhereInDependency() { boolean flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // the next notification should be the merged listener for setTable2 flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // the dynamicFilter1 updates flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertFalse(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // the dynamicFilter2 updates flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertFalse(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertFalse(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // now that both filters are complete, we can run the composed listener flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); TestCase.assertTrue(flushed); - TestCase.assertTrue(((QueryTable) setTable1).satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) setTable2).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable1.satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(setTable2.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter1.satisfied(LogicalClock.DEFAULT.currentStep())); TestCase.assertTrue(dynamicFilter2.satisfied(LogicalClock.DEFAULT.currentStep())); - TestCase.assertTrue(((QueryTable) composed).satisfied(LogicalClock.DEFAULT.currentStep())); + TestCase.assertTrue(composed.satisfied(LogicalClock.DEFAULT.currentStep())); // and we are done flushed = UpdateGraphProcessor.DEFAULT.flushOneNotificationForUnitTests(); @@ -1900,19 +1960,7 @@ public void testSnapshotIncrementalPrev() { final QueryTable left = testRefreshingTable(c("T", 1, 2)); final QueryTable snapshot = (QueryTable) left.snapshotIncremental(right, true); - final TableUpdateValidator validator = TableUpdateValidator.make(snapshot); - final QueryTable validatorTable = validator.getResultTable(); - final TableUpdateListener validatorTableListener = - new InstrumentedTableUpdateListenerAdapter(validatorTable, false) { - @Override - public void onUpdate(TableUpdate upstream) {} - - @Override - public void onFailureInternal(Throwable originalException, Entry sourceEntry) { - TestCase.fail(originalException.getMessage()); - } - }; - validatorTable.listenForUpdates(validatorTableListener); + validateUpdates(snapshot); System.out.println("Initial table:"); show(snapshot); @@ -2534,20 +2582,7 @@ public void testUngroupWithRebase() { assertEquals(Arrays.asList(1, 1, 1, 2, 2), Ints.asList((int[]) t1.getColumn("X").getDirect())); assertEquals(Arrays.asList("a", "b", "c", "d", "e"), Arrays.asList((String[]) t1.getColumn("Y").getDirect())); - - final TableUpdateValidator validator = TableUpdateValidator.make(t1); - final QueryTable validatorTable = validator.getResultTable(); - final TableUpdateListener validatorTableListener = - new InstrumentedTableUpdateListenerAdapter(validatorTable, false) { - @Override - public void onUpdate(TableUpdate upstream) {} - - @Override - public void onFailureInternal(Throwable originalException, Entry sourceEntry) { - TestCase.fail(originalException.getMessage()); - } - }; - validatorTable.listenForUpdates(validatorTableListener); + validateUpdates(t1); // This is too big, we should fail UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { @@ -3284,4 +3319,22 @@ public void testDeferredGroupingPropagationDateTimeCol() { (DeferredGroupingColumnSource) t2.getColumnSource("T").reinterpret(long.class); assertSame(cs.groupingProvider, result.getGroupingProvider()); } + + private static void validateUpdates(final Table table) { + final TableUpdateValidator validator = TableUpdateValidator.make((QueryTable) table); + final QueryTable validatorTable = validator.getResultTable(); + final TableUpdateListener validatorTableListener = + // NB: We specify retain=true to ensure the listener is not GC'd. It will be dropped when + // the enclosing LivenessScope is released. + new InstrumentedTableUpdateListenerAdapter(validatorTable, true) { + @Override + public void onUpdate(TableUpdate upstream) {} + + @Override + public void onFailureInternal(Throwable originalException, Entry sourceEntry) { + TestCase.fail(originalException.getMessage()); + } + }; + validatorTable.listenForUpdates(validatorTableListener); + } } From e10215f1b69099cc08183b762dbd4d85f4f6e310 Mon Sep 17 00:00:00 2001 From: Chip Kent <5250374+chipkent@users.noreply.github.com> Date: Wed, 28 Sep 2022 19:40:00 -0600 Subject: [PATCH 159/215] Fix failing tests (#2924) --- .../java/io/deephaven/engine/table/impl/TestAggBy.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java index b3748e3e0a3..55926b0466d 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/TestAggBy.java @@ -332,10 +332,10 @@ public Table e() { "ddi=countDistinct(doubleCol)", "cdiN=countDistinct(intColNulls, true)", "ddiN=countDistinct(doubleColNulls, true)", - "dic=array(sort(distinct(intCol, false)))", - "did=array(sort(distinct(doubleCol, false)))", - "dicN=array(sort(distinct(intColNulls, true)))", - "didN=array(sort(distinct(doubleColNulls, true)))", + "dic=vec(sort(distinct(intCol, false)))", + "did=vec(sort(distinct(doubleCol, false)))", + "dicN=vec(sort(distinct(intColNulls, true)))", + "didN=vec(sort(distinct(doubleColNulls, true)))", "uic=TestAggBy.uniqueValue(intCol, false)", "uid=TestAggBy.uniqueValue(doubleCol, false)", "uicN=TestAggBy.uniqueValue(intColNulls, true)", From 2e5e9056462ec104b67747ce9962cfaad5e59528 Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Thu, 29 Sep 2022 01:48:17 -0400 Subject: [PATCH 160/215] Bring latest C++ client up to main (#2928) * Move underlying bitset implementation from Boost to Roaring * Bump Barrage version * Add a couple of ticking tests --- cpp-client/deephaven/client/CMakeLists.txt | 9 +- .../deephaven/client/build-dependencies.sh | 11 - .../deephaven/flatbuf/Barrage_generated.h | 119 +- .../client/immerutil/abstract_flex_vector.h | 23 +- .../client/subscription/batch_parser.h | 25 - .../client/subscription/immer_table_state.h | 30 +- .../client/subscription/space_mapper.h | 42 +- .../public/deephaven/client/chunk/chunk.h | 11 + .../deephaven/client/utility/table_maker.h | 27 +- .../client/src/subscription/batch_parser.cc | 56 - .../src/subscription/immer_table_state.cc | 70 +- .../client/src/subscription/index_decoder.cc | 9 +- .../client/src/subscription/space_mapper.cc | 116 +- .../src/subscription/update_processor.cc | 430 +- .../client/src/utility/table_maker.cc | 17 +- .../roaring/include/roaring/roaring.c | 19648 ++++++++++++++++ .../roaring/include/roaring/roaring.h | 1088 + .../roaring/include/roaring/roaring.hh | 2145 ++ cpp-client/tests/CMakeLists.txt | 2 +- cpp-client/tests/select_test.cc | 181 +- cpp-client/tests/test_util.cc | 26 +- cpp-client/tests/test_util.h | 6 +- cpp-client/tests/ticking_test.cc | 166 + 23 files changed, 23661 insertions(+), 596 deletions(-) delete mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h delete mode 100644 cpp-client/deephaven/client/src/subscription/batch_parser.cc create mode 100644 cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.c create mode 100644 cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.h create mode 100644 cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.hh create mode 100644 cpp-client/tests/ticking_test.cc diff --git a/cpp-client/deephaven/client/CMakeLists.txt b/cpp-client/deephaven/client/CMakeLists.txt index 9567eabf0e2..007302f06a1 100644 --- a/cpp-client/deephaven/client/CMakeLists.txt +++ b/cpp-client/deephaven/client/CMakeLists.txt @@ -8,7 +8,6 @@ include(GNUInstallDirs) find_package(Arrow REQUIRED) find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Boost REQUIRED) find_package(Immer REQUIRED) find_package(Protobuf REQUIRED) find_package(gRPC REQUIRED) @@ -72,7 +71,6 @@ set(ALL_FILES include/public/deephaven/client/container/row_sequence.h include/public/deephaven/client/table/table.h - include/private/deephaven/client/subscription/batch_parser.h include/private/deephaven/client/subscription/classic_table_state.h include/private/deephaven/client/subscription/immer_table_state.h include/private/deephaven/client/subscription/index_decoder.h @@ -81,7 +79,6 @@ set(ALL_FILES include/private/deephaven/client/subscription/subscribe_thread.h include/private/deephaven/client/subscription/subscription_handle.h include/private/deephaven/client/subscription/update_processor.h - src/subscription/batch_parser.cc src/subscription/classic_table_state.cc src/subscription/immer_table_state.cc src/subscription/index_decoder.cc @@ -162,6 +159,8 @@ set(ALL_FILES third_party/flatbuffers/include/flatbuffers/vector_downward.h third_party/flatbuffers/include/flatbuffers/vector.h third_party/flatbuffers/include/flatbuffers/verifier.h + + third_party/roaring/include/roaring/roaring.c ) add_library(client ${ALL_FILES}) @@ -170,9 +169,9 @@ add_library(client ${ALL_FILES}) add_library(deephaven::client ALIAS client) target_compile_options(client PRIVATE -Wall -Werror) -target_include_directories(client PRIVATE ${Boost_INCLUDE_DIR}) target_include_directories(client PRIVATE include/private) target_include_directories(client PRIVATE third_party/flatbuffers/include) +target_include_directories(client PRIVATE third_party/roaring/include) target_include_directories(client PUBLIC $) # Protos and flatbuf are doing their own thing. @@ -181,9 +180,7 @@ target_include_directories(client PRIVATE "./flatbuf") target_link_libraries(client PUBLIC arrow_flight_static) target_link_libraries(client PUBLIC arrow_static) -target_link_libraries(client PUBLIC Boost::boost) target_link_libraries(client PUBLIC immer) target_link_libraries(client PUBLIC protobuf::libprotobuf) target_link_libraries(client PUBLIC gRPC::grpc++) target_link_libraries(client PUBLIC Threads::Threads) - diff --git a/cpp-client/deephaven/client/build-dependencies.sh b/cpp-client/deephaven/client/build-dependencies.sh index e9f9d138821..f4b66c4630d 100755 --- a/cpp-client/deephaven/client/build-dependencies.sh +++ b/cpp-client/deephaven/client/build-dependencies.sh @@ -76,7 +76,6 @@ ${PFX}/re2:\ ${PFX}/zlib:\ ${PFX}/grpc:\ ${PFX}/arrow:\ -${PFX}/boost:\ ${PFX}/immer:\ ${PFX}/deephaven @@ -107,7 +106,6 @@ if [ "$CHECKOUT" = "yes" ]; then git clone $GIT_FLAGS -b v1.45.2 --depth 1 https://github.com/grpc/grpc git clone $GIT_FLAGS -b apache-arrow-7.0.0 --depth 1 https://github.com/apache/arrow git clone $GIT_FLAGS https://github.com/arximboldi/immer.git && (cd immer && git checkout "${IMMER_SHA}") - curl -sL https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_"${BOOST_VERSION}".tar.bz2 | tar jxf - # Apply apache arrow patch. (cd arrow && patch -p1 <(VT_BATCH_SIZE, 0); } + /// Specify a maximum allowed message size. Server will enforce this limit by reducing batch size (to a lower limit + /// of one row per batch). If the message size limit cannot be met due to large row sizes, the server will throw a + /// `Status.RESOURCE_EXHAUSTED` exception + int32_t max_message_size() const { + return GetField(VT_MAX_MESSAGE_SIZE, 0); + } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && VerifyField(verifier, VT_MIN_UPDATE_INTERVAL_MS, 4) && VerifyField(verifier, VT_BATCH_SIZE, 4) && + VerifyField(verifier, VT_MAX_MESSAGE_SIZE, 4) && verifier.EndTable(); } }; @@ -475,6 +483,9 @@ struct BarrageSubscriptionOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSubscriptionOptions::VT_BATCH_SIZE, batch_size, 0); } + void add_max_message_size(int32_t max_message_size) { + fbb_.AddElement(BarrageSubscriptionOptions::VT_MAX_MESSAGE_SIZE, max_message_size, 0); + } explicit BarrageSubscriptionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -491,8 +502,10 @@ inline flatbuffers::Offset CreateBarrageSubscription io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, int32_t min_update_interval_ms = 0, - int32_t batch_size = 0) { + int32_t batch_size = 0, + int32_t max_message_size = 0) { BarrageSubscriptionOptionsBuilder builder_(_fbb); + builder_.add_max_message_size(max_message_size); builder_.add_batch_size(batch_size); builder_.add_min_update_interval_ms(min_update_interval_ms); builder_.add_use_deephaven_nulls(use_deephaven_nulls); @@ -518,7 +531,8 @@ struct BarrageSubscriptionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers: const flatbuffers::Vector *columns() const { return GetPointer *>(VT_COLUMNS); } - /// This is an encoded and compressed RowSet in position-space to subscribe to. + /// This is an encoded and compressed RowSet in position-space to subscribe to. If not provided then the entire + /// table is requested. const flatbuffers::Vector *viewport() const { return GetPointer *>(VT_VIEWPORT); } @@ -616,7 +630,8 @@ struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_COLUMN_CONVERSION_MODE = 4, VT_USE_DEEPHAVEN_NULLS = 6, - VT_BATCH_SIZE = 8 + VT_BATCH_SIZE = 8, + VT_MAX_MESSAGE_SIZE = 10 }; /// see enum for details io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode() const { @@ -633,11 +648,18 @@ struct BarrageSnapshotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab int32_t batch_size() const { return GetField(VT_BATCH_SIZE, 0); } + /// Specify a maximum allowed message size. Server will enforce this limit by reducing batch size (to a lower limit + /// of one row per batch). If the message size limit cannot be met due to large row sizes, the server will throw a + /// `Status.RESOURCE_EXHAUSTED` exception + int32_t max_message_size() const { + return GetField(VT_MAX_MESSAGE_SIZE, 0); + } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_COLUMN_CONVERSION_MODE, 1) && VerifyField(verifier, VT_USE_DEEPHAVEN_NULLS, 1) && VerifyField(verifier, VT_BATCH_SIZE, 4) && + VerifyField(verifier, VT_MAX_MESSAGE_SIZE, 4) && verifier.EndTable(); } }; @@ -655,6 +677,9 @@ struct BarrageSnapshotOptionsBuilder { void add_batch_size(int32_t batch_size) { fbb_.AddElement(BarrageSnapshotOptions::VT_BATCH_SIZE, batch_size, 0); } + void add_max_message_size(int32_t max_message_size) { + fbb_.AddElement(BarrageSnapshotOptions::VT_MAX_MESSAGE_SIZE, max_message_size, 0); + } explicit BarrageSnapshotOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -670,8 +695,10 @@ inline flatbuffers::Offset CreateBarrageSnapshotOptions( flatbuffers::FlatBufferBuilder &_fbb, io::deephaven::barrage::flatbuf::ColumnConversionMode column_conversion_mode = io::deephaven::barrage::flatbuf::ColumnConversionMode_Stringify, bool use_deephaven_nulls = false, - int32_t batch_size = 0) { + int32_t batch_size = 0, + int32_t max_message_size = 0) { BarrageSnapshotOptionsBuilder builder_(_fbb); + builder_.add_max_message_size(max_message_size); builder_.add_batch_size(batch_size); builder_.add_use_deephaven_nulls(use_deephaven_nulls); builder_.add_column_conversion_mode(column_conversion_mode); @@ -902,7 +929,7 @@ inline flatbuffers::Offset CreateBarragePublicationRe publish_options); } -/// Holds all of the index data structures for the column being modified. +/// Holds all of the rowset data structures for the column being modified. struct BarrageModColumnMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageModColumnMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -961,28 +988,18 @@ inline flatbuffers::Offset CreateBarrageModColumnMetad struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef BarrageUpdateMetadataBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NUM_ADD_BATCHES = 4, - VT_NUM_MOD_BATCHES = 6, - VT_FIRST_SEQ = 8, - VT_LAST_SEQ = 10, - VT_IS_SNAPSHOT = 12, - VT_EFFECTIVE_VIEWPORT = 14, - VT_EFFECTIVE_COLUMN_SET = 16, - VT_ADDED_ROWS = 18, - VT_REMOVED_ROWS = 20, - VT_SHIFT_DATA = 22, - VT_ADDED_ROWS_INCLUDED = 24, - VT_MOD_COLUMN_NODES = 26, - VT_EFFECTIVE_REVERSE_VIEWPORT = 28 + VT_FIRST_SEQ = 4, + VT_LAST_SEQ = 6, + VT_IS_SNAPSHOT = 8, + VT_EFFECTIVE_VIEWPORT = 10, + VT_EFFECTIVE_REVERSE_VIEWPORT = 12, + VT_EFFECTIVE_COLUMN_SET = 14, + VT_ADDED_ROWS = 16, + VT_REMOVED_ROWS = 18, + VT_SHIFT_DATA = 20, + VT_ADDED_ROWS_INCLUDED = 22, + VT_MOD_COLUMN_NODES = 24 }; - /// The number of record batches that describe rows added (may be zero). - uint16_t num_add_batches() const { - return GetField(VT_NUM_ADD_BATCHES, 0); - } - /// The number of record batches that describe rows modified (may be zero). - uint16_t num_mod_batches() const { - return GetField(VT_NUM_MOD_BATCHES, 0); - } /// This batch is generated from an upstream table that ticks independently of the stream. If /// multiple events are coalesced into one update, the server may communicate that here for /// informational purposes. @@ -1001,6 +1018,11 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl const flatbuffers::Vector *effective_viewport() const { return GetPointer *>(VT_EFFECTIVE_VIEWPORT); } + /// When this is set the viewport RowSet will be inverted against the length of the table. That is to say + /// every position value is converted from `i` to `n - i - 1` if the table has `n` rows. + bool effective_reverse_viewport() const { + return GetField(VT_EFFECTIVE_REVERSE_VIEWPORT, 0) != 0; + } /// If this is a snapshot, then the effectively subscribed column set will be included in the payload. const flatbuffers::Vector *effective_column_set() const { return GetPointer *>(VT_EFFECTIVE_COLUMN_SET); @@ -1013,7 +1035,7 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl const flatbuffers::Vector *removed_rows() const { return GetPointer *>(VT_REMOVED_ROWS); } - /// This is an encoded and compressed IndexShiftData describing how the keyspace of unmodified rows changed. + /// This is an encoded and compressed RowSetShiftData describing how the keyspace of unmodified rows changed. const flatbuffers::Vector *shift_data() const { return GetPointer *>(VT_SHIFT_DATA); } @@ -1027,20 +1049,14 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl const flatbuffers::Vector> *mod_column_nodes() const { return GetPointer> *>(VT_MOD_COLUMN_NODES); } - /// When this is set the viewport RowSet will be inverted against the length of the table. That is to say - /// every position value is converted from `i` to `n - i - 1` if the table has `n` rows. - bool effective_reverse_viewport() const { - return GetField(VT_EFFECTIVE_REVERSE_VIEWPORT, 0) != 0; - } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_NUM_ADD_BATCHES, 2) && - VerifyField(verifier, VT_NUM_MOD_BATCHES, 2) && VerifyField(verifier, VT_FIRST_SEQ, 8) && VerifyField(verifier, VT_LAST_SEQ, 8) && VerifyField(verifier, VT_IS_SNAPSHOT, 1) && VerifyOffset(verifier, VT_EFFECTIVE_VIEWPORT) && verifier.VerifyVector(effective_viewport()) && + VerifyField(verifier, VT_EFFECTIVE_REVERSE_VIEWPORT, 1) && VerifyOffset(verifier, VT_EFFECTIVE_COLUMN_SET) && verifier.VerifyVector(effective_column_set()) && VerifyOffset(verifier, VT_ADDED_ROWS) && @@ -1054,7 +1070,6 @@ struct BarrageUpdateMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl VerifyOffset(verifier, VT_MOD_COLUMN_NODES) && verifier.VerifyVector(mod_column_nodes()) && verifier.VerifyVectorOfTables(mod_column_nodes()) && - VerifyField(verifier, VT_EFFECTIVE_REVERSE_VIEWPORT, 1) && verifier.EndTable(); } }; @@ -1063,12 +1078,6 @@ struct BarrageUpdateMetadataBuilder { typedef BarrageUpdateMetadata Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_num_add_batches(uint16_t num_add_batches) { - fbb_.AddElement(BarrageUpdateMetadata::VT_NUM_ADD_BATCHES, num_add_batches, 0); - } - void add_num_mod_batches(uint16_t num_mod_batches) { - fbb_.AddElement(BarrageUpdateMetadata::VT_NUM_MOD_BATCHES, num_mod_batches, 0); - } void add_first_seq(int64_t first_seq) { fbb_.AddElement(BarrageUpdateMetadata::VT_FIRST_SEQ, first_seq, 0); } @@ -1081,6 +1090,9 @@ struct BarrageUpdateMetadataBuilder { void add_effective_viewport(flatbuffers::Offset> effective_viewport) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_VIEWPORT, effective_viewport); } + void add_effective_reverse_viewport(bool effective_reverse_viewport) { + fbb_.AddElement(BarrageUpdateMetadata::VT_EFFECTIVE_REVERSE_VIEWPORT, static_cast(effective_reverse_viewport), 0); + } void add_effective_column_set(flatbuffers::Offset> effective_column_set) { fbb_.AddOffset(BarrageUpdateMetadata::VT_EFFECTIVE_COLUMN_SET, effective_column_set); } @@ -1099,9 +1111,6 @@ struct BarrageUpdateMetadataBuilder { void add_mod_column_nodes(flatbuffers::Offset>> mod_column_nodes) { fbb_.AddOffset(BarrageUpdateMetadata::VT_MOD_COLUMN_NODES, mod_column_nodes); } - void add_effective_reverse_viewport(bool effective_reverse_viewport) { - fbb_.AddElement(BarrageUpdateMetadata::VT_EFFECTIVE_REVERSE_VIEWPORT, static_cast(effective_reverse_viewport), 0); - } explicit BarrageUpdateMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -1115,19 +1124,17 @@ struct BarrageUpdateMetadataBuilder { inline flatbuffers::Offset CreateBarrageUpdateMetadata( flatbuffers::FlatBufferBuilder &_fbb, - uint16_t num_add_batches = 0, - uint16_t num_mod_batches = 0, int64_t first_seq = 0, int64_t last_seq = 0, bool is_snapshot = false, flatbuffers::Offset> effective_viewport = 0, + bool effective_reverse_viewport = false, flatbuffers::Offset> effective_column_set = 0, flatbuffers::Offset> added_rows = 0, flatbuffers::Offset> removed_rows = 0, flatbuffers::Offset> shift_data = 0, flatbuffers::Offset> added_rows_included = 0, - flatbuffers::Offset>> mod_column_nodes = 0, - bool effective_reverse_viewport = false) { + flatbuffers::Offset>> mod_column_nodes = 0) { BarrageUpdateMetadataBuilder builder_(_fbb); builder_.add_last_seq(last_seq); builder_.add_first_seq(first_seq); @@ -1138,8 +1145,6 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadata( builder_.add_added_rows(added_rows); builder_.add_effective_column_set(effective_column_set); builder_.add_effective_viewport(effective_viewport); - builder_.add_num_mod_batches(num_mod_batches); - builder_.add_num_add_batches(num_add_batches); builder_.add_effective_reverse_viewport(effective_reverse_viewport); builder_.add_is_snapshot(is_snapshot); return builder_.Finish(); @@ -1147,19 +1152,17 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadata( inline flatbuffers::Offset CreateBarrageUpdateMetadataDirect( flatbuffers::FlatBufferBuilder &_fbb, - uint16_t num_add_batches = 0, - uint16_t num_mod_batches = 0, int64_t first_seq = 0, int64_t last_seq = 0, bool is_snapshot = false, const std::vector *effective_viewport = nullptr, + bool effective_reverse_viewport = false, const std::vector *effective_column_set = nullptr, const std::vector *added_rows = nullptr, const std::vector *removed_rows = nullptr, const std::vector *shift_data = nullptr, const std::vector *added_rows_included = nullptr, - const std::vector> *mod_column_nodes = nullptr, - bool effective_reverse_viewport = false) { + const std::vector> *mod_column_nodes = nullptr) { auto effective_viewport__ = effective_viewport ? _fbb.CreateVector(*effective_viewport) : 0; auto effective_column_set__ = effective_column_set ? _fbb.CreateVector(*effective_column_set) : 0; auto added_rows__ = added_rows ? _fbb.CreateVector(*added_rows) : 0; @@ -1169,19 +1172,17 @@ inline flatbuffers::Offset CreateBarrageUpdateMetadataDir auto mod_column_nodes__ = mod_column_nodes ? _fbb.CreateVector>(*mod_column_nodes) : 0; return io::deephaven::barrage::flatbuf::CreateBarrageUpdateMetadata( _fbb, - num_add_batches, - num_mod_batches, first_seq, last_seq, is_snapshot, effective_viewport__, + effective_reverse_viewport, effective_column_set__, added_rows__, removed_rows__, shift_data__, added_rows_included__, - mod_column_nodes__, - effective_reverse_viewport); + mod_column_nodes__); } } // namespace flatbuf diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h index 112c2306bdf..e69fc990dba 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h @@ -64,23 +64,26 @@ struct CorrespondingArrowArrayType { struct FlexVectorAppender { template - static void append(const ARROW_SRC &src, immer::flex_vector *destData, - immer::flex_vector *optionalDestNulls) { + static void append(const ARROW_SRC &src, size_t offset, size_t count, + immer::flex_vector *destData, immer::flex_vector *optionalDestNulls) { auto transientData = destData->transient(); immer::flex_vector_transient transientNulls; if (optionalDestNulls != nullptr) { transientNulls = optionalDestNulls->transient(); } - for (auto optValue : src) { - bool isNull = !optValue.has_value(); + auto beginIt = src.begin() + offset; + auto endIt = beginIt + count; + for (auto it = beginIt; it != endIt; ++it) { + const auto &optElement = *it; + bool isNull = !optElement.has_value(); T value = T(); if (isNull) { if constexpr(deephaven::client::arrowutil::isNumericType()) { value = deephaven::client::DeephavenConstantsForType::NULL_VALUE; } } else { - deephaven::client::arrowutil::ArrowValueConverter::convert(*optValue, &value); + deephaven::client::arrowutil::ArrowValueConverter::convert(*optElement, &value); } transientData.push_back(std::move(value)); if (optionalDestNulls != nullptr) { @@ -108,7 +111,7 @@ class AbstractFlexVectorBase { virtual std::unique_ptr take(size_t n) = 0; virtual void inPlaceDrop(size_t n) = 0; virtual void inPlaceAppend(std::unique_ptr other) = 0; - virtual void inPlaceAppendArrow(const arrow::Array &data) = 0; + virtual void inPlaceAppendArrow(const arrow::Array &data, size_t offset, size_t count) = 0; virtual std::shared_ptr makeColumnSource() const = 0; }; @@ -138,11 +141,11 @@ class NumericAbstractFlexVector final : public AbstractFlexVectorBase { vec_ = std::move(temp); } - void inPlaceAppendArrow(const arrow::Array &data) final { + void inPlaceAppendArrow(const arrow::Array &data, size_t offset, size_t count) final { typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; auto *typedArrow = deephaven::client::utility::verboseCast( DEEPHAVEN_EXPR_MSG(&data)); - internal::FlexVectorAppender::append(*typedArrow, &vec_, nullptr); + internal::FlexVectorAppender::append(*typedArrow, offset, count, &vec_, nullptr); } std::shared_ptr makeColumnSource() const final { @@ -185,11 +188,11 @@ class GenericAbstractFlexVector final : public AbstractFlexVectorBase { nulls_ = std::move(tempNulls); } - void inPlaceAppendArrow(const arrow::Array &data) final { + void inPlaceAppendArrow(const arrow::Array &data, size_t offset, size_t count) final { typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; auto *typedArrow = deephaven::client::utility::verboseCast( DEEPHAVEN_EXPR_MSG(&data)); - internal::FlexVectorAppender::append(*typedArrow, &data_, &nulls_); + internal::FlexVectorAppender::append(*typedArrow, offset, count, &data_, &nulls_); } std::shared_ptr makeColumnSource() const final { diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h deleted file mode 100644 index dfc5ad373ca..00000000000 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/batch_parser.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#pragma once - -#include -#include -#include "deephaven/client/utility/misc.h" - -namespace deephaven::client::subscription { -class BatchParser { - typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; -public: - - BatchParser() = delete; - - static void parseBatches( - size_t expectedNumCols, - size_t numBatches, - bool allowInconsistentColumnSizes, - arrow::flight::FlightStreamReader *fsr, - arrow::flight::FlightStreamChunk *flightStreamChunk, - const std::function> &)> &callback); -}; -} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h index 7c1c86aa70e..fb085237b67 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/immer_table_state.h @@ -24,16 +24,32 @@ class ImmerTableState final { explicit ImmerTableState(std::shared_ptr colDefs); ~ImmerTableState(); + /** + * When the caller wants to add data to the ImmerTableState, they do it in two steps: + * addKeys and then addData. First, they call addKeys, which updates the (key space) -> + * (position space) mapping. Immediately after this call (but before addData), the key mapping + * will be inconsistent with respect to the data. But then, the caller calls addData (perhaps + * all at once, or perhaps in slices) to fill in the data. Once the caller is done, the keys + * and data will be consistent once again. Note that addKey/addData only support adding new keys. + * It is an error to try to re-add any existing key. + */ std::shared_ptr addKeys(const RowSequence &rowsToAddKeySpace); void addData(const std::vector> &data, - const RowSequence &rowsToAddIndexSpace); + size_t dataRowOffset, const RowSequence &rowsToAddIndexSpace); std::shared_ptr erase(const RowSequence &rowsToRemoveKeySpace); - std::vector> modifyKeys( - const std::vector> &rowsToModifyKeySpace); - void modifyData(const std::vector> &data, - const std::vector> &rowsToModifyIndexSpace); + /** + * When the caller wants to modify data in the ImmerTableState, they do it in two steps: + * modifyKeys and then modifyData. First, they call convertKeysToIndices, which gives them the + * (key space) -> (position space) mapping. Then, the caller calls modifyData (perhaps all at + * once, perhaps in slices) to fill in the data. Note that modifyKey/modifyData only support + * modifying rows. It is an error to try to use a key that is not already in the map. + */ + std::shared_ptr convertKeysToIndices(const RowSequence &keysRowSpace) const; + + void modifyData(size_t colNum, const arrow::Array &data, size_t srcOffset, + const RowSequence &rowsToModify); void applyShifts(const RowSequence &startIndex, const RowSequence &endIndex, const RowSequence &destIndex); @@ -41,10 +57,6 @@ class ImmerTableState final { std::shared_ptr

    snapshot() const; private: - void modifyColumn(size_t colNum, - std::unique_ptr modifiedData, - const RowSequence &rowsToModifyKeySpace); - std::shared_ptr colDefs_; std::shared_ptr schema_; std::vector> flexVectors_; diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h index 63615b493d4..2788dbcb505 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/space_mapper.h @@ -4,25 +4,12 @@ #pragma once #include "deephaven/client/container/row_sequence.h" -#include -#include -#include -#include -#include +#include "roaring/roaring.hh" namespace deephaven::client::subscription { class SpaceMapper { typedef deephaven::client::container::RowSequence RowSequence; - typedef boost::multi_index_container< - uint64_t, - boost::multi_index::indexed_by< - boost::multi_index::ranked_unique< - boost::multi_index::identity - > - > - > set_t; - public: SpaceMapper(); ~SpaceMapper(); @@ -31,14 +18,35 @@ class SpaceMapper { uint64_t eraseRange(uint64_t beginKey, uint64_t endKey); void applyShift(uint64_t beginKey, uint64_t endKey, uint64_t destKey); + /** + * Adds 'keys' (specified in key space) to the map, and returns the positions (in position + * space) of those keys after insertion. 'keys' are required to not already been in the map. + * The algorithm behaves as though all the keys are inserted in the map and then + * 'convertKeysToIndices' is called. + * + * Example: + * SpaceMapper currently holds [100 300] + * addKeys called with [1, 2, 200, 201, 400, 401] + * SpaceMapper final state is [1, 2, 100, 200, 201, 300, 400, 401] + * The returned result is [0, 1, 3, 4, 6, 7] + */ std::shared_ptr addKeys(const RowSequence &keys); + /** + * Looks up 'keys' (specified in key space) in the map, and returns the positions (in position + * space) of those keys. + */ std::shared_ptr convertKeysToIndices(const RowSequence &keys) const; - size_t size() const { - return set_.size(); + /** + * Note: this call iterates over the Roaring64Map and is not constant-time. + */ + size_t cardinality() const { + return set_.cardinality(); } + uint64_t zeroBasedRank(uint64_t value) const; + private: - set_t set_; + roaring::Roaring64Map set_; }; } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h index 1f1d6d61642..d218b662442 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/chunk/chunk.h @@ -53,6 +53,14 @@ class GenericChunk final : public Chunk { T *end() { return data_.get() + size_; } const T *end() const { return data_.get() + size_; } + T& operator[](size_t index) { + return data_.get()[index]; + } + + const T& operator[](size_t index) const { + return data_.get()[index]; + } + private: GenericChunk(std::shared_ptr data, size_t size); @@ -66,8 +74,11 @@ class GenericChunk final : public Chunk { typedef GenericChunk BooleanChunk; typedef GenericChunk Int8Chunk; +typedef GenericChunk UInt8Chunk; typedef GenericChunk Int16Chunk; +typedef GenericChunk UInt16Chunk; typedef GenericChunk Int32Chunk; +typedef GenericChunk UInt32Chunk; typedef GenericChunk Int64Chunk; typedef GenericChunk UInt64Chunk; typedef GenericChunk FloatChunk; diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h index 5050c020915..3d0046e7db9 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/table_maker.h @@ -121,60 +121,67 @@ struct TypeConverterTraits { static_assert(!std::is_same::value, "TableMaker doesn't know how to work with this type"); }; +template<> +struct TypeConverterTraits { + typedef arrow::UInt16Type arrowType_t; + typedef arrow::UInt16Builder arrowBuilder_t; + static const char * const deephavenTypeName; +}; + template<> struct TypeConverterTraits { typedef arrow::BooleanType arrowType_t; typedef arrow::BooleanBuilder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::Int8Type arrowType_t; typedef arrow::Int8Builder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::Int16Type arrowType_t; typedef arrow::Int16Builder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::Int32Type arrowType_t; typedef arrow::Int32Builder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::Int64Type arrowType_t; typedef arrow::Int64Builder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::FloatType arrowType_t; typedef arrow::FloatBuilder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::DoubleType arrowType_t; typedef arrow::DoubleBuilder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template<> struct TypeConverterTraits { typedef arrow::StringType arrowType_t; typedef arrow::StringBuilder arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template @@ -182,11 +189,11 @@ struct TypeConverterTraits> { typedef TypeConverterTraits inner_t; typedef typename inner_t::arrowType_t arrowType_t; typedef typename inner_t::arrowBuilder_t arrowBuilder_t; - static const char *deephavenTypeName; + static const char * const deephavenTypeName; }; template -const char *TypeConverterTraits>::deephavenTypeName = +const char * const TypeConverterTraits>::deephavenTypeName = TypeConverterTraits::deephavenTypeName; template diff --git a/cpp-client/deephaven/client/src/subscription/batch_parser.cc b/cpp-client/deephaven/client/src/subscription/batch_parser.cc deleted file mode 100644 index a5bec484f24..00000000000 --- a/cpp-client/deephaven/client/src/subscription/batch_parser.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -#include "deephaven/client/subscription/batch_parser.h" - -#include -#include -#include "deephaven/client/utility/utility.h" - -using deephaven::client::utility::okOrThrow; -using deephaven::client::utility::stringf; - -namespace deephaven::client::subscription { -// Processes all of the adds in this add batch. Will invoke (numAdds - 1) additional calls to GetNext(). -void BatchParser::parseBatches( - size_t expectedNumCols, - size_t numBatches, - bool allowInconsistentColumnSizes, - arrow::flight::FlightStreamReader *fsr, - arrow::flight::FlightStreamChunk *flightStreamChunk, - const std::function> &)> &callback) { - if (numBatches == 0) { - return; - } - - while (true) { - const auto &srcCols = flightStreamChunk->data->columns(); - auto ncols = srcCols.size(); - if (ncols != expectedNumCols) { - auto message = stringf("Expected %o columns, got %o", expectedNumCols, ncols); - throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); - } - - if (!allowInconsistentColumnSizes) { - auto numRows = srcCols[0]->length(); - for (size_t i = 1; i < ncols; ++i) { - const auto &srcColArrow = *srcCols[i]; - if (srcColArrow.length() != numRows) { - auto message = stringf( - "Inconsistent column lengths: Column 0 has %o rows, but column %o has %o rows", - numRows, i, srcColArrow.length()); - throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); - } - } - } - - callback(srcCols); - - if (--numBatches == 0) { - return; - } - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr->Next(flightStreamChunk))); - } -} - -} // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/immer_table_state.cc b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc index f354cbc4e92..8c8ac25eebf 100644 --- a/cpp-client/deephaven/client/src/subscription/immer_table_state.cc +++ b/cpp-client/deephaven/client/src/subscription/immer_table_state.cc @@ -68,8 +68,9 @@ class MyTable final : public Table { std::vector> makeFlexVectorsFromColDefs( const ColumnDefinitions &colDefs); -std::vector> makeFlexVectorsFromArrays( - const std::vector> &arrays); + +std::unique_ptr makeFlexVectorFromArray(const arrow::Array &array, + size_t offset, size_t count); } // namespace ImmerTableState::ImmerTableState(std::shared_ptr colDefs) : @@ -85,13 +86,25 @@ std::shared_ptr ImmerTableState::addKeys(const RowSequence &rowsToA } void ImmerTableState::addData(const std::vector> &data, - const RowSequence &rowsToAddIndexSpace) { + size_t dataRowOffset, const RowSequence &rowsToAddIndexSpace) { auto ncols = data.size(); + auto nrows = rowsToAddIndexSpace.size(); if (ncols != flexVectors_.size()) { throw std::runtime_error(stringf("ncols != flexVectors_.size() (%o != %o)", ncols, flexVectors_.size())); } - auto addedData = makeFlexVectorsFromArrays(data); + for (const auto &array : data) { + auto minLength = dataRowOffset + nrows; + if ((size_t)array->length() < minLength) { + auto message = stringf("Expected data array length to be at least %o, but got only %o", + minLength, array->length()); + throw std::runtime_error(message); + } + } + auto addedData = makeReservedVector>(ncols); + for (size_t colNum = 0; colNum != ncols; ++colNum) { + addedData.push_back(makeFlexVectorFromArray(*data[colNum], dataRowOffset, nrows)); + } auto addChunk = [this, &addedData](uint64_t beginIndex, uint64_t endIndex) { auto size = endIndex - beginIndex; @@ -135,33 +148,15 @@ std::shared_ptr ImmerTableState::erase(const RowSequence &rowsToRem return result; } -std::vector> ImmerTableState::modifyKeys( - const std::vector> &rowsToModifyKeySpace) { - auto ncols = rowsToModifyKeySpace.size(); - auto result = makeReservedVector>(ncols); - for (const auto &rs : rowsToModifyKeySpace) { - result.push_back(spaceMapper_.convertKeysToIndices(*rs)); - } - return result; +std::shared_ptr ImmerTableState::convertKeysToIndices( + const RowSequence &rowsToModifyKeySpace) const { + return spaceMapper_.convertKeysToIndices(rowsToModifyKeySpace); } -void ImmerTableState::modifyData(const std::vector> &data, - const std::vector> &rowsToModifyIndexSpace) { - auto ncols = data.size(); - if (ncols != rowsToModifyIndexSpace.size()) { - throw std::runtime_error(stringf("data.size() != rowsToModifyIndexSpace.size() (%o != %o)", - ncols, rowsToModifyIndexSpace.size())); - } - auto modifiedData = makeFlexVectorsFromArrays(data); +void ImmerTableState::modifyData(size_t colNum, const arrow::Array &data, + size_t srcOffset, const RowSequence &rowsToModifyIndexSpace) { + auto modifiedData = makeFlexVectorFromArray(data, srcOffset, rowsToModifyIndexSpace.size()); - for (size_t i = 0; i < ncols; ++i) { - modifyColumn(i, std::move(modifiedData[i]), *rowsToModifyIndexSpace[i]); - } -} - -void ImmerTableState::modifyColumn(size_t colNum, - std::unique_ptr modifiedData, - const RowSequence &rowsToModifyIndexSpace) { auto &fv = flexVectors_[colNum]; auto modifyChunk = [&fv, &modifiedData](uint64_t beginIndex, uint64_t endIndex) { auto size = endIndex - beginIndex; @@ -197,7 +192,7 @@ std::shared_ptr
    ImmerTableState::snapshot() const { for (const auto &fv : flexVectors_) { columnSources.push_back(fv->makeColumnSource()); } - return std::make_shared(schema_, std::move(columnSources), spaceMapper_.size()); + return std::make_shared(schema_, std::move(columnSources), spaceMapper_.cardinality()); } namespace { @@ -238,17 +233,12 @@ std::vector> makeFlexVectorsFromColDefs( return result; } -std::vector> makeFlexVectorsFromArrays( - const std::vector> &arrays) { - auto ncols = arrays.size(); - auto result = makeReservedVector>(ncols); - for (const auto &a : arrays) { - ArrowArrayTypeVisitor v; - okOrThrow(DEEPHAVEN_EXPR_MSG(a->Accept(&v))); - v.inner().result_->inPlaceAppendArrow(*a); - result.push_back(std::move(v.inner().result_)); - } - return result; +std::unique_ptr makeFlexVectorFromArray(const arrow::Array &array, + size_t offset, size_t count) { + ArrowArrayTypeVisitor v; + okOrThrow(DEEPHAVEN_EXPR_MSG(array.Accept(&v))); + v.inner().result_->inPlaceAppendArrow(array, offset, count); + return std::move(v.inner().result_); } } // namespace } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/index_decoder.cc b/cpp-client/deephaven/client/src/subscription/index_decoder.cc index 854e3f17867..75887225e52 100644 --- a/cpp-client/deephaven/client/src/subscription/index_decoder.cc +++ b/cpp-client/deephaven/client/src/subscription/index_decoder.cc @@ -94,8 +94,10 @@ std::shared_ptr IndexDecoder::readExternalCompressedDelta(DataInput return builder.build(); } - default: - throw std::runtime_error(stringf("Bad command: %o", command)); + default: { + auto message = stringf("Bad command: %o", command); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); + } } } } @@ -115,7 +117,8 @@ int64_t DataInput::readValue(int command) { return readByte(); } default: { - throw std::runtime_error(stringf("Bad command: %o", command)); + auto message = stringf("Bad command: %o", command); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } } } diff --git a/cpp-client/deephaven/client/src/subscription/space_mapper.cc b/cpp-client/deephaven/client/src/subscription/space_mapper.cc index 54890522a47..458677e0511 100644 --- a/cpp-client/deephaven/client/src/subscription/space_mapper.cc +++ b/cpp-client/deephaven/client/src/subscription/space_mapper.cc @@ -38,86 +38,28 @@ SpaceMapper::SpaceMapper() = default; SpaceMapper::~SpaceMapper() = default; uint64_t SpaceMapper::addRange(uint64_t beginKey, uint64_t endKey) { + roaring::Roaring64Map x; auto size = endKey - beginKey; - if (size == 0) { - return 0; // arbitrary + auto initialSize = set_.cardinality(); + set_.addRange(beginKey, endKey); + if (set_.cardinality() != initialSize + size) { + auto message = stringf("Some elements of [%o,%o) were already in the set", beginKey, + endKey); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } - auto initialSize = set_.size(); - set_.insert(SimpleRangeIterator(beginKey), SimpleRangeIterator(endKey)); - if (set_.size() != initialSize + size) { - throw std::runtime_error(stringf("Some elements of [%o,%o) were already in the set", beginKey, - endKey)); - } - return set_.find_rank(beginKey); + return zeroBasedRank(beginKey); } uint64_t SpaceMapper::eraseRange(uint64_t beginKey, uint64_t endKey) { - size_t size = endKey - beginKey; - if (size == 0) { - return 0; // arbitrary - } - auto ip = set_.find(beginKey); - // This is ok (I think) even in the not-found case because set_.rank(set_.end()) is defined, and - // is set_.size(). The not-found case will throw an exception shortly in the test inside the loop. - auto result = set_.rank(ip); - for (auto current = beginKey; current != endKey; ++current) { - if (ip == set_.end() || *ip != current) { - throw std::runtime_error(stringf("key %o was not in the set", current)); - } - ip = set_.erase(ip); - } + auto result = zeroBasedRank(beginKey); + set_.removeRange(beginKey, endKey); return result; } void SpaceMapper::applyShift(uint64_t beginKey, uint64_t endKey, uint64_t destKey) { - if (beginKey == endKey) { - return; - } - if (destKey > beginKey) { - auto amountToAdd = destKey - beginKey; - // positive shift: work backwards - auto ip = set_.lower_bound(endKey); - // ip is the first element >= endKey, or it is end() - if (ip == set_.begin()) { - return; - } - --ip; - // ip is the last element < endKey - while (true) { - if (*ip < beginKey) { - // exceeded range - return; - } - std::optional prev; - if (ip != set_.begin()) { - prev = std::prev(ip); - } - auto node = set_.extract(ip); - node.value() = node.value() + amountToAdd; - set_.insert(std::move(node)); - if (!prev.has_value()) { - return; - } - ip = *prev; - } - return; - } - - // destKey <= beginKey, shifts are negative, so work in the forward direction - auto amountToSubtract = beginKey - destKey; - // negative shift: work forwards - auto ip = set_.lower_bound(beginKey); - // ip == end, or the first element >= beginKey - while (true) { - if (ip == set_.end() || *ip >= endKey) { - return; - } - auto nextp = std::next(ip); - auto node = set_.extract(ip); - node.value() = node.value() - amountToSubtract; - set_.insert(std::move(node)); - ip = nextp; - } + auto size = endKey - beginKey; + set_.removeRange(beginKey, endKey); + set_.addRange(destKey, destKey + size); } std::shared_ptr SpaceMapper::addKeys(const RowSequence &keys) { @@ -132,25 +74,39 @@ std::shared_ptr SpaceMapper::addKeys(const RowSequence &keys) { } std::shared_ptr SpaceMapper::convertKeysToIndices(const RowSequence &keys) const { + if (keys.empty()) { + return RowSequence::createEmpty(); + } + RowSequenceBuilder builder; - auto convertChunk = [this, &builder](uint64_t begin, uint64_t end) { - auto beginp = set_.find(begin); - if (beginp == set_.end()) { - throw std::runtime_error(stringf("begin key %o is not in the src map", begin)); + auto convertChunk = [this, &builder](uint64_t beginKey, uint64_t endKey) { + auto beginp = set_.begin(); + if (!beginp.move(beginKey)) { + auto message = stringf("begin key %o is not in the src map", beginKey); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } - auto nextRank = set_.rank(beginp); + auto nextRank = zeroBasedRank(beginKey); // Confirm we have entries for everything in the range. auto currentp = beginp; - for (auto current = begin; current != end; ++current) { - if (current != *currentp) { - throw std::runtime_error(stringf("current key %o is in not the src map", begin)); + for (auto currentKey = beginKey; currentKey != endKey; ++currentKey) { + if (currentKey != *currentp) { + auto message = stringf("current key %o is in not the src map", currentKey); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } ++currentp; } - auto size = end - begin; + auto size = endKey - beginKey; builder.addRange(nextRank, nextRank + size); }; keys.forEachChunk(convertChunk); return builder.build(); } + +uint64_t SpaceMapper::zeroBasedRank(uint64_t value) const { + // Roaring's convention for rank is to "Return the number of integers that are smaller or equal to x". + // But we would rather know the number of values that are strictly smaller than x. + auto result = set_.rank(value); + // Adjust if 'value' is in the set. + return set_.contains(value) ? result - 1 : result; +} } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/subscription/update_processor.cc b/cpp-client/deephaven/client/src/subscription/update_processor.cc index 98290d0fd3b..8386b6180b4 100644 --- a/cpp-client/deephaven/client/src/subscription/update_processor.cc +++ b/cpp-client/deephaven/client/src/subscription/update_processor.cc @@ -3,6 +3,7 @@ */ #include "deephaven/client/subscription/update_processor.h" +#include #include #include #include "deephaven/client/chunk/chunk_filler.h" @@ -11,7 +12,6 @@ #include "deephaven/client/container/row_sequence.h" #include "deephaven/client/immerutil/abstract_flex_vector.h" #include "deephaven/client/immerutil/immer_column_source.h" -#include "deephaven/client/subscription/batch_parser.h" #include "deephaven/client/subscription/classic_table_state.h" #include "deephaven/client/subscription/immer_table_state.h" #include "deephaven/client/subscription/index_decoder.h" @@ -26,7 +26,6 @@ using deephaven::client::column::MutableColumnSource; using deephaven::client::container::RowSequence; using deephaven::client::container::RowSequenceBuilder; using deephaven::client::immerutil::AbstractFlexVectorBase; -using deephaven::client::subscription::BatchParser; using deephaven::client::table::Table; using deephaven::client::utility::ColumnDefinitions; using deephaven::client::utility::makeReservedVector; @@ -45,29 +44,43 @@ using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionRequest; namespace deephaven::client::subscription { namespace { -struct ExtractedMetadata { - ExtractedMetadata(size_t numAdds, - size_t numMods, - std::shared_ptr removedRows, - std::shared_ptr shiftStartIndex, - std::shared_ptr shiftEndIndex, - std::shared_ptr shiftDestIndex, - std::shared_ptr addedRows, - std::vector> modifiedRows); - ~ExtractedMetadata(); - - size_t numAdds_ = 0; - size_t numMods_ = 0; +class FlightStreamState final { +public: + FlightStreamState(size_t numCols, arrow::flight::FlightStreamReader *fsr, + arrow::flight::FlightStreamChunk *flightStreamChunk, ImmerTableState *tableState); + ~FlightStreamState(); + + void readFirst(); + void readNext(); + + void processMetadata(); + + std::pair, std::shared_ptr
    > processRemoves( + const std::shared_ptr
    &beforeRemoves); + + void processShifts(); + + std::pair, std::shared_ptr
    > processAdds( + const std::shared_ptr
    &beforeAdds); + + std::pair>, std::shared_ptr
    > processModifies( + const std::shared_ptr
    &beforeModifies); + +private: + size_t numCols_ = 0; + // Does not own. + arrow::flight::FlightStreamReader *fsr_ = nullptr; + arrow::flight::FlightStreamChunk *flightStreamChunk_ = nullptr; + ImmerTableState *tableState_ = nullptr; + std::vector srcChunkOffset_; + std::vector srcChunkSize_; std::shared_ptr removedRows_; std::shared_ptr shiftStartIndex_; std::shared_ptr shiftEndIndex_; std::shared_ptr shiftDestIndex_; std::shared_ptr addedRows_; - std::vector> modifiedRows_; + std::vector> perColumnModifies_; }; - -std::optional extractMetadata( - const arrow::flight::FlightStreamChunk &flightStreamChunk); } // namespace std::shared_ptr UpdateProcessor::startThread( @@ -94,145 +107,46 @@ void UpdateProcessor::cancel() { } void UpdateProcessor::runForever(const std::shared_ptr &self) { - std::cerr << "UpdateProcessor is starting.\n"; - std::exception_ptr eptr; try { self->runForeverHelper(); } catch (...) { // If the thread was been cancelled via explicit user action, then swallow all errors. if (!self->cancelled_) { - eptr = std::current_exception(); - self->callback_->onFailure(eptr); + self->callback_->onFailure(std::current_exception()); } } } -std::pair, std::shared_ptr
    > processRemoves( - const std::shared_ptr
    &beforeRemoves, ImmerTableState *state, - const ExtractedMetadata &md) { - if (md.removedRows_->empty()) { - auto empty = RowSequence::createEmpty(); - auto afterRemoves = beforeRemoves; - return {std::move(empty), std::move(afterRemoves)}; - } - - auto removedRowsIndexSpace = state->erase(*md.removedRows_); - auto afterRemoves = state->snapshot(); - return {std::move(removedRowsIndexSpace), std::move(afterRemoves)}; -} - -std::pair, std::shared_ptr
    > processAdds( - const std::shared_ptr
    &beforeAdds, ImmerTableState *state, - const ExtractedMetadata &md, size_t numCols, - arrow::flight::FlightStreamReader *fsr, arrow::flight::FlightStreamChunk *flightStreamChunk) { - if (md.numAdds_ == 0) { - auto empty = RowSequence::createEmpty(); - auto afterAdds = beforeAdds; - return {std::move(empty), std::move(afterAdds)}; - } - - auto addedRowsIndexSpace = state->addKeys(*md.addedRows_); - - // Copy everything. - auto rowsRemaining = addedRowsIndexSpace->take(addedRowsIndexSpace->size()); - - auto processAddBatch = [state, &rowsRemaining]( - const std::vector> &data) { - if (data.empty()) { - return; - } - auto size = data[0]->length(); - auto rowsToAddThisTime = rowsRemaining->take(size); - rowsRemaining = rowsRemaining->drop(size); - state->addData(data, *rowsToAddThisTime); - }; - BatchParser::parseBatches(numCols, md.numAdds_, false, fsr, flightStreamChunk, - processAddBatch); - - if (md.numMods_ != 0) { - // Currently the FlightStreamReader is pointing to the last add record. We need to advance - // it so it points to the first mod record. - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr->Next(flightStreamChunk))); - } - auto afterAdds = state->snapshot(); - return {std::move(addedRowsIndexSpace), std::move(afterAdds)}; -} - -std::pair>, std::shared_ptr
    > processModifies( - const std::shared_ptr
    &beforeModifies, ImmerTableState *state, - const ExtractedMetadata &md, size_t numCols, arrow::flight::FlightStreamReader *fsr, - arrow::flight::FlightStreamChunk *flightStreamChunk) { - if (md.numMods_ == 0) { - auto afterModifies = beforeModifies; - return {{}, std::move(afterModifies)}; - } - auto modifiedRowsIndexSpace = state->modifyKeys(md.modifiedRows_); - // Local copy of modifiedRowsIndexSpace - auto keysRemaining = makeReservedVector>(numCols); - for (const auto &keys: modifiedRowsIndexSpace) { - keysRemaining.push_back(keys->take(keys->size())); - } - - std::vector> keysToModifyThisTime(numCols); - - auto processModifyBatch = [state, &keysRemaining, &keysToModifyThisTime, numCols]( - const std::vector> &data) { - if (data.size() != numCols) { - auto message = stringf("Expected % cols, got %o", numCols, data.size()); - throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); - } - for (size_t i = 0; i < data.size(); ++i) { - const auto &src = data[i]; - auto &krm = keysRemaining[i]; - keysToModifyThisTime[i] = krm->take(src->length()); - krm = krm->drop(src->length()); - } - state->modifyData(data, keysToModifyThisTime); - }; - - BatchParser::parseBatches(numCols, md.numMods_, true, fsr, flightStreamChunk, processModifyBatch); - auto afterModifies = state->snapshot(); - return {std::move(modifiedRowsIndexSpace), std::move(afterModifies)}; -} - void UpdateProcessor::runForeverHelper() { - ImmerTableState state(colDefs_); + ImmerTableState tableState(colDefs_); + auto numCols = colDefs_->vec().size(); - // In this loop we process Arrow Flight messages until error or cancellation. + // Reuse the chunk for efficicency arrow::flight::FlightStreamChunk flightStreamChunk; + // In this loop we process Arrow Flight messages until error or cancellation. while (true) { - okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(&flightStreamChunk))); - - // Parse all the metadata out of the Barrage message before we advance the cursor past it. - auto mdo = extractMetadata(flightStreamChunk); - if (!mdo.has_value()) { - continue; - } - auto &md = *mdo; + FlightStreamState flightStreamState(numCols, fsr_.get(), &flightStreamChunk, &tableState); + // Get the first message of the Barrage batch. The first message always includes metadata, + // and it may also potentially include Arrow data. + flightStreamState.readFirst(); // Correct order to process all this info is: // 1. removes // 2. shifts // 3. adds // 4. modifies - - auto prev = state.snapshot(); + auto prev = tableState.snapshot(); // 1. Removes - auto [removes, afterRemoves] = processRemoves(prev, &state, md); + auto [removes, afterRemoves] = flightStreamState.processRemoves(prev); // 2. Shifts - state.applyShifts(*md.shiftStartIndex_, *md.shiftEndIndex_, *md.shiftDestIndex_); + flightStreamState.processShifts(); - // 3. Adds - auto [adds, afterAdds] = processAdds(afterRemoves, &state, md, colDefs_->size(), fsr_.get(), - &flightStreamChunk); + auto [adds, afterAdds] = flightStreamState.processAdds(afterRemoves); - // 4. Modifies - auto [modifies, afterModifies] = processModifies(afterAdds, &state, md, colDefs_->size(), - fsr_.get(), &flightStreamChunk); + auto [modifies, afterModifies] = flightStreamState.processModifies(afterAdds); - // These are convenience copies of the user which might TickingUpdate update(std::move(prev), std::move(removes), std::move(afterRemoves), std::move(adds), std::move(afterAdds), @@ -242,81 +156,221 @@ void UpdateProcessor::runForeverHelper() { } namespace { -std::optional extractMetadata( - const arrow::flight::FlightStreamChunk &flightStreamChunk) { - if (flightStreamChunk.app_metadata == nullptr) { - std::cerr << "TODO(kosak) -- unexpected - chunk.app_metdata == nullptr\n"; - return {}; +FlightStreamState::FlightStreamState(size_t numCols, arrow::flight::FlightStreamReader *fsr, + arrow::flight::FlightStreamChunk *flightStreamChunk, ImmerTableState *tableState) + : numCols_(numCols), fsr_(fsr), flightStreamChunk_(flightStreamChunk), tableState_(tableState) { + srcChunkOffset_.reserve(numCols); + srcChunkSize_.reserve(numCols); +} + +FlightStreamState::~FlightStreamState() = default; + +void FlightStreamState::readFirst() { + readNext(); + processMetadata(); +} + +void FlightStreamState::readNext() { + okOrThrow(DEEPHAVEN_EXPR_MSG(fsr_->Next(flightStreamChunk_))); + + const auto &cols = flightStreamChunk_->data->columns(); + + if (cols.size() != numCols_) { + auto message = stringf("Expected %o colummns, got %o", numCols_, cols.size()); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } - const auto *barrageWrapperRaw = flightStreamChunk.app_metadata->data(); + srcChunkOffset_.clear(); + srcChunkSize_.clear(); + for (size_t i = 0; i != numCols_; ++i) { + srcChunkOffset_.push_back(0); + srcChunkSize_.push_back(cols[i]->length()); + } +} + +void FlightStreamState::processMetadata() { + // Read the metadata from the first chunk. + if (flightStreamChunk_->app_metadata == nullptr) { + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG( + "Unexpected: flightStreamChunk_.app_metdata == nullptr")); + } + + const auto *barrageWrapperRaw = flightStreamChunk_->app_metadata->data(); const auto *barrageWrapper = flatbuffers::GetRoot(barrageWrapperRaw); + if (barrageWrapper->magic() != deephavenMagicNumber) { - return {}; + auto message = stringf("Expected magic number %o, got %o", deephavenMagicNumber, + barrageWrapper->magic()); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } + if (barrageWrapper->msg_type() != BarrageMessageType::BarrageMessageType_BarrageUpdateMetadata) { - return {}; + auto message = stringf("Expected Barrage Message Type %o, got %o", + BarrageMessageType::BarrageMessageType_BarrageUpdateMetadata, barrageWrapper->msg_type()); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } const auto *bmdRaw = barrageWrapper->msg_payload()->data(); const auto *bmd = flatbuffers::GetRoot(bmdRaw); - auto numAdds = bmd->num_add_batches(); - auto numMods = bmd->num_mod_batches(); - // streamf(std::cerr, "num_add_batches=%o, num_mod_batches=%o\n", numAdds, numMods); - // streamf(std::cerr, "FYI, my row sequence is currently %o\n", *tickingTable->getRowSequence()); DataInput diAdded(*bmd->added_rows()); DataInput diRemoved(*bmd->removed_rows()); DataInput diThreeShiftIndexes(*bmd->shift_data()); - auto addedRows = IndexDecoder::readExternalCompressedDelta(&diAdded); - auto removedRows = IndexDecoder::readExternalCompressedDelta(&diRemoved); - auto shiftStartIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); - auto shiftEndIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); - auto shiftDestIndex = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); - - std::vector> perColumnModifies; - if (numMods != 0) { - const auto &modColumnNodes = *bmd->mod_column_nodes(); - perColumnModifies.reserve(modColumnNodes.size()); - for (size_t i = 0; i < modColumnNodes.size(); ++i) { - const auto &elt = modColumnNodes.Get(i); - DataInput diModified(*elt->modified_rows()); - auto modRows = IndexDecoder::readExternalCompressedDelta(&diModified); - perColumnModifies.push_back(std::move(modRows)); + addedRows_ = IndexDecoder::readExternalCompressedDelta(&diAdded); + removedRows_ = IndexDecoder::readExternalCompressedDelta(&diRemoved); + shiftStartIndex_ = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + shiftEndIndex_ = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + shiftDestIndex_ = IndexDecoder::readExternalCompressedDelta(&diThreeShiftIndexes); + + const auto &modColumnNodes = *bmd->mod_column_nodes(); + perColumnModifies_.reserve(modColumnNodes.size()); + for (size_t i = 0; i < modColumnNodes.size(); ++i) { + const auto &elt = modColumnNodes.Get(i); + DataInput diModified(*elt->modified_rows()); + auto modRows = IndexDecoder::readExternalCompressedDelta(&diModified); + perColumnModifies_.push_back(std::move(modRows)); + } +} + +std::pair, std::shared_ptr
    > FlightStreamState::processRemoves( + const std::shared_ptr
    &beforeRemoves) { + // The reason we special-case "empty" is because when the tables are unchanged, we prefer + // to indicate this via pointer equality (e.g. beforeRemoves == afterRemoves). + if (removedRows_->empty()) { + auto empty = RowSequence::createEmpty(); + auto afterRemoves = beforeRemoves; + return {std::move(empty), std::move(afterRemoves)}; + } + + auto removedRowsIndexSpace = tableState_->erase(*removedRows_); + auto afterRemoves = tableState_->snapshot(); + return {std::move(removedRowsIndexSpace), std::move(afterRemoves)}; +} + +void FlightStreamState::processShifts() { + tableState_->applyShifts(*shiftStartIndex_, *shiftEndIndex_, *shiftDestIndex_); +} + +std::pair, std::shared_ptr
    > FlightStreamState::processAdds( + const std::shared_ptr
    &beforeAdds) { + // The reason we special-case "empty" is because when the tables are unchanged, we prefer + // to indicate this via pointer equality (e.g. beforeAdds == afterAdds). + if (addedRows_->empty()) { + auto empty = RowSequence::createEmpty(); + auto afterAdds = beforeAdds; + return {std::move(empty), std::move(afterAdds)}; + } + + if (numCols_ == 0) { + throw std::runtime_error("numRows != 0 but numCols == 0"); + } + + auto addedRowsIndexSpace = tableState_->addKeys(*addedRows_); + // Working copy that is consumed in the iterations of the loop. + auto addedRowsRemaining = addedRowsIndexSpace->drop(0); + while (true) { + auto numRowsToProcess = addedRowsRemaining->size(); + if (numRowsToProcess == 0) { + break; + } + size_t numColsWithData = 0; + for (size_t i = 0; i != numCols_; ++i) { + auto thisNumRowsAvailable = srcChunkSize_[i] - srcChunkOffset_[i]; + if (thisNumRowsAvailable != 0) { + ++numColsWithData; + } + numRowsToProcess = std::min(numRowsToProcess, thisNumRowsAvailable); + } + + if (numRowsToProcess == 0) { + if (numColsWithData != 0) { + throw std::runtime_error( + "Inconsistency in 'Add' case: Some columns in this chunk were exhausted but others " + "still have data."); + } + readNext(); + continue; + } + + auto indexRowsThisTime = addedRowsRemaining->take(numRowsToProcess); + addedRowsRemaining = addedRowsRemaining->drop(numRowsToProcess); + const auto &cols = flightStreamChunk_->data->columns(); + // In the add case, all the srcChunkOffsets have the same values. We do it this way + // to keep the code simple with respect to the 'modify' case, where they can start to diverge. + tableState_->addData(cols, srcChunkOffset_[0], *indexRowsThisTime); + + for (size_t i = 0; i < numCols_; ++i) { + srcChunkOffset_[i] += numRowsToProcess; } } -// streamf(std::cerr, "RemovedRows: {%o}\n", *removedRows); -// streamf(std::cerr, "AddedRows: {%o}\n", *addedRows); -// streamf(std::cerr, "shift start: {%o}\n", *shiftStartIndex); -// streamf(std::cerr, "shift end: {%o}\n", *shiftEndIndex); -// streamf(std::cerr, "shift dest: {%o}\n", *shiftDestIndex); - - return ExtractedMetadata(numAdds, - numMods, - std::move(removedRows), - std::move(shiftStartIndex), - std::move(shiftEndIndex), - std::move(shiftDestIndex), - std::move(addedRows), - std::move(perColumnModifies)); + + auto afterAdds = tableState_->snapshot(); + return {std::move(addedRowsIndexSpace), std::move(afterAdds)}; } -ExtractedMetadata::ExtractedMetadata(size_t numAdds, size_t numMods, - std::shared_ptr removedRows, std::shared_ptr shiftStartIndex, - std::shared_ptr shiftEndIndex, std::shared_ptr shiftDestIndex, - std::shared_ptr addedRows, - std::vector> modifiedRows) : - numAdds_(numAdds), numMods_(numMods), - removedRows_(std::move(removedRows)), shiftStartIndex_(std::move(shiftStartIndex)), - shiftEndIndex_(std::move(shiftEndIndex)), shiftDestIndex_(std::move(shiftDestIndex)), - addedRows_(std::move(addedRows)), modifiedRows_(std::move(modifiedRows)) {} - -ExtractedMetadata::~ExtractedMetadata() = default; - -//ThreadNubbin::ThreadNubbin(std::unique_ptr fsr, -// std::shared_ptr colDefs, std::shared_ptr callback) : -// fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)) {} +std::pair>, std::shared_ptr
    > +FlightStreamState::processModifies(const std::shared_ptr
    &beforeModifies) { + auto wantModifies = std::any_of(perColumnModifies_.begin(), perColumnModifies_.end(), + [](const std::shared_ptr &rs) { return !rs->empty(); }); + if (!wantModifies) { + auto afterModifies = beforeModifies; + return {{}, std::move(afterModifies)}; + } + + auto ncols = perColumnModifies_.size(); + auto modifiedRowsIndexSpace = makeReservedVector>(ncols); + auto modifiedRowsRemaining = makeReservedVector>(ncols); + for (size_t i = 0; i < ncols; ++i) { + auto rs = tableState_->convertKeysToIndices(*perColumnModifies_[i]); + modifiedRowsIndexSpace.push_back(rs->drop(0)); // make copy + modifiedRowsRemaining.push_back(std::move(rs)); + } + + while (true) { + const auto &cols = flightStreamChunk_->data->columns(); + auto completelySatisfied = true; + for (size_t i = 0; i < ncols; ++i) { + auto numRowsRemaining = modifiedRowsRemaining[i]->size(); + auto numRowsAvailable = srcChunkSize_[i] - srcChunkOffset_[i]; + + if (numRowsAvailable > numRowsRemaining) { + auto message = stringf("col %o: numRowsAvailable > numRowsRemaining (%o > %o)", + numRowsAvailable, numRowsRemaining); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); + } + + if (numRowsAvailable < numRowsRemaining) { + // Set a flag saying to advance Flight and run the outer loop again. + completelySatisfied = false; + } + + if (numRowsAvailable == 0) { + // Nothing needed for this column. Advance to next column. + continue; + } + + auto &mr = modifiedRowsRemaining[i]; + auto rowsAvailable = mr->take(numRowsAvailable); + mr = mr->drop(numRowsAvailable); + + auto indexRowsAvailable = tableState_->convertKeysToIndices(*rowsAvailable); + tableState_->modifyData(i, *cols[i], srcChunkOffset_[i], *indexRowsAvailable); + // This doesn't *really* matter because it will be reset by the readNext(). + srcChunkOffset_[i] += numRowsAvailable; + } + + if (completelySatisfied) { + // All done! + break; + } + + readNext(); + } + + auto afterModifies = tableState_->snapshot(); + return {std::move(modifiedRowsIndexSpace), std::move(afterModifies)}; +} } // namespace } // namespace deephaven::client::subscription diff --git a/cpp-client/deephaven/client/src/utility/table_maker.cc b/cpp-client/deephaven/client/src/utility/table_maker.cc index d251a7bf03f..dcfad9ac3b1 100644 --- a/cpp-client/deephaven/client/src/utility/table_maker.cc +++ b/cpp-client/deephaven/client/src/utility/table_maker.cc @@ -63,13 +63,14 @@ TypeConverter::TypeConverter(std::shared_ptr dataType, column_(std::move(column)) {} TypeConverter::~TypeConverter() = default; -const char *TypeConverterTraits::deephavenTypeName = "java.lang.Boolean"; -const char *TypeConverterTraits::deephavenTypeName = "byte"; -const char *TypeConverterTraits::deephavenTypeName = "short"; -const char *TypeConverterTraits::deephavenTypeName = "int"; -const char *TypeConverterTraits::deephavenTypeName = "long"; -const char *TypeConverterTraits::deephavenTypeName = "float"; -const char *TypeConverterTraits::deephavenTypeName = "double"; -const char *TypeConverterTraits::deephavenTypeName = "java.lang.String"; +const char * const TypeConverterTraits::deephavenTypeName = "char"; +const char * const TypeConverterTraits::deephavenTypeName = "java.lang.Boolean"; +const char * const TypeConverterTraits::deephavenTypeName = "byte"; +const char * const TypeConverterTraits::deephavenTypeName = "short"; +const char * const TypeConverterTraits::deephavenTypeName = "int"; +const char * const TypeConverterTraits::deephavenTypeName = "long"; +const char * const TypeConverterTraits::deephavenTypeName = "float"; +const char * const TypeConverterTraits::deephavenTypeName = "double"; +const char * const TypeConverterTraits::deephavenTypeName = "java.lang.String"; } // namespace internal } // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.c b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.c new file mode 100644 index 00000000000..c659c3a28c4 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.c @@ -0,0 +1,19648 @@ +// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! +// Created by amalgamation.sh on Sun 18 Sep 2022 02:41:22 PM EDT + +/* + * The CRoaring project is under a dual license (Apache/MIT). + * Users of the library may choose one or the other license. + */ +/* + * Copyright 2016-2022 The CRoaring authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* + * MIT License + * + * Copyright 2016-2022 The CRoaring authors + * + * Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the + * Software without restriction, including without + * limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software + * is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice + * shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + +#include "roaring.h" + +/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */ +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#include "roaring.h" /* include public API definitions */ +/* begin file include/roaring/isadetection.h */ +/* From +https://github.com/endorno/pytorch/blob/master/torch/lib/TH/generic/simd/simd.h +Highly modified. + +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, +Iain Melvin, Jason Weston) Copyright (c) 2006 Idiap Research Institute +(Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, +Samy Bengio, Johnny Mariethoz) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories +America and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ROARING_ISADETECTION_H +#define ROARING_ISADETECTION_H + +#include +#include +#include +#if CROARING_REGULAR_VISUAL_STUDIO +#include +#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) +#include +#endif // CROARING_REGULAR_VISUAL_STUDIO + + +enum croaring_instruction_set { + CROARING_DEFAULT = 0x0, + CROARING_NEON = 0x1, + CROARING_AVX2 = 0x4, + CROARING_SSE42 = 0x8, + CROARING_PCLMULQDQ = 0x10, + CROARING_BMI1 = 0x20, + CROARING_BMI2 = 0x40, + CROARING_ALTIVEC = 0x80, + CROARING_UNINITIALIZED = 0x8000 +}; + +#if defined(__PPC64__) + +static inline uint32_t dynamic_croaring_detect_supported_architectures() { + return CROARING_ALTIVEC; +} + +#elif defined(__arm__) || defined(__aarch64__) // incl. armel, armhf, arm64 + +#if defined(__ARM_NEON) + +static inline uint32_t dynamic_croaring_detect_supported_architectures() { + return CROARING_NEON; +} + +#else // ARM without NEON + +static inline uint32_t dynamic_croaring_detect_supported_architectures() { + return CROARING_DEFAULT; +} + +#endif + +#elif defined(__x86_64__) || defined(_M_AMD64) // x64 + + + + +static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, + uint32_t *edx) { + +#if CROARING_REGULAR_VISUAL_STUDIO + int cpu_info[4]; + __cpuid(cpu_info, *eax); + *eax = cpu_info[0]; + *ebx = cpu_info[1]; + *ecx = cpu_info[2]; + *edx = cpu_info[3]; +#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) + uint32_t level = *eax; + __get_cpuid(level, eax, ebx, ecx, edx); +#else + uint32_t a = *eax, b, c = *ecx, d; + __asm__("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d)); + *eax = a; + *ebx = b; + *ecx = c; + *edx = d; +#endif +} + +static inline uint32_t dynamic_croaring_detect_supported_architectures() { + uint32_t eax, ebx, ecx, edx; + uint32_t host_isa = 0x0; + // Can be found on Intel ISA Reference for CPUID + static uint32_t cpuid_avx2_bit = 1 << 5; ///< @private Bit 5 of EBX for EAX=0x7 + static uint32_t cpuid_bmi1_bit = 1 << 3; ///< @private bit 3 of EBX for EAX=0x7 + static uint32_t cpuid_bmi2_bit = 1 << 8; ///< @private bit 8 of EBX for EAX=0x7 + static uint32_t cpuid_sse42_bit = 1 << 20; ///< @private bit 20 of ECX for EAX=0x1 + static uint32_t cpuid_pclmulqdq_bit = 1 << 1; ///< @private bit 1 of ECX for EAX=0x1 + // ECX for EAX=0x7 + eax = 0x7; + ecx = 0x0; + cpuid(&eax, &ebx, &ecx, &edx); + if (ebx & cpuid_avx2_bit) { + host_isa |= CROARING_AVX2; + } + if (ebx & cpuid_bmi1_bit) { + host_isa |= CROARING_BMI1; + } + + if (ebx & cpuid_bmi2_bit) { + host_isa |= CROARING_BMI2; + } + + // EBX for EAX=0x1 + eax = 0x1; + cpuid(&eax, &ebx, &ecx, &edx); + + if (ecx & cpuid_sse42_bit) { + host_isa |= CROARING_SSE42; + } + + if (ecx & cpuid_pclmulqdq_bit) { + host_isa |= CROARING_PCLMULQDQ; + } + + return host_isa; +} +#else // fallback + + +static inline uint32_t dynamic_croaring_detect_supported_architectures() { + return CROARING_DEFAULT; +} + + +#endif // end SIMD extension detection code + + +#if defined(__x86_64__) || defined(_M_AMD64) // x64 + +#if defined(__cplusplus) +static inline uint32_t croaring_detect_supported_architectures() { + // thread-safe as per the C++11 standard. + static uint32_t buffer = dynamic_croaring_detect_supported_architectures(); + return buffer; +} +#elif CROARING_VISUAL_STUDIO +// Visual Studio does not support C11 atomics. +static inline uint32_t croaring_detect_supported_architectures() { + static int buffer = CROARING_UNINITIALIZED; + if (buffer == CROARING_UNINITIALIZED) { + buffer = dynamic_croaring_detect_supported_architectures(); + } + return buffer; +} +#else // CROARING_VISUAL_STUDIO +#include +static inline uint32_t croaring_detect_supported_architectures() { + // we use an atomic for thread safety + static _Atomic uint32_t buffer = CROARING_UNINITIALIZED; + if (buffer == CROARING_UNINITIALIZED) { + // atomicity is sufficient + buffer = dynamic_croaring_detect_supported_architectures(); + } + return buffer; +} +#endif // CROARING_REGULAR_VISUAL_STUDIO + +#ifdef ROARING_DISABLE_AVX +static inline bool croaring_avx2() { + return false; +} +#elif defined(__AVX2__) +static inline bool croaring_avx2() { + return true; +} +#else +static inline bool croaring_avx2() { + return (croaring_detect_supported_architectures() & CROARING_AVX2) == CROARING_AVX2; +} +#endif + + +#else // defined(__x86_64__) || defined(_M_AMD64) // x64 + +static inline bool croaring_avx2() { + return false; +} + +static inline uint32_t croaring_detect_supported_architectures() { + // no runtime dispatch + return dynamic_croaring_detect_supported_architectures(); +} +#endif // defined(__x86_64__) || defined(_M_AMD64) // x64 + +#endif // ROARING_ISADETECTION_H +/* end file include/roaring/isadetection.h */ +/* begin file include/roaring/portability.h */ +/* + * portability.h + * + */ + + /** + * All macros should be prefixed with either CROARING or ROARING. + * The library uses both ROARING_... + * as well as CROAIRING_ as prefixes. The ROARING_ prefix is for + * macros that are provided by the build system or that are closely + * related to the format. The header macros may also use ROARING_. + * The CROARING_ prefix is for internal macros that a user is unlikely + * to ever interact with. + */ + +#ifndef INCLUDE_PORTABILITY_H_ +#define INCLUDE_PORTABILITY_H_ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif // _GNU_SOURCE +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif // __STDC_FORMAT_MACROS + +#ifdef _MSC_VER +#define CROARING_VISUAL_STUDIO 1 +/** + * We want to differentiate carefully between + * clang under visual studio and regular visual + * studio. + */ +#ifdef __clang__ +// clang under visual studio +#define CROARING_CLANG_VISUAL_STUDIO 1 +#else +// just regular visual studio (best guess) +#define CROARING_REGULAR_VISUAL_STUDIO 1 +#endif // __clang__ +#endif // _MSC_VER + +#if !(defined(_POSIX_C_SOURCE)) || (_POSIX_C_SOURCE < 200809L) +#define _POSIX_C_SOURCE 200809L +#endif // !(defined(_POSIX_C_SOURCE)) || (_POSIX_C_SOURCE < 200809L) +#if !(defined(_XOPEN_SOURCE)) || (_XOPEN_SOURCE < 700) +#define _XOPEN_SOURCE 700 +#endif // !(defined(_XOPEN_SOURCE)) || (_XOPEN_SOURCE < 700) + +#include +#include +#include // will provide posix_memalign with _POSIX_C_SOURCE as defined above +#if !(defined(__APPLE__)) && !(defined(__FreeBSD__)) +#include // this should never be needed but there are some reports that it is needed. +#endif + +#ifdef __cplusplus +extern "C" { // portability definitions are in global scope, not a namespace +#endif + +#if CROARING_REGULAR_VISUAL_STUDIO && !defined(_WIN64) && !defined(CROARING_ACK_32BIT) +#pragma message( \ + "You appear to be attempting a 32-bit build under Visual Studio. We recommend a 64-bit build instead.") +#endif + +#if defined(__SIZEOF_LONG_LONG__) && __SIZEOF_LONG_LONG__ != 8 +#error This code assumes 64-bit long longs (by use of the GCC intrinsics). Your system is not currently supported. +#endif + +#if CROARING_REGULAR_VISUAL_STUDIO +#define __restrict__ __restrict +#endif // CROARING_REGULAR_VISUAL_STUDIO + + + +#if defined(__x86_64__) || defined(_M_X64) +// we have an x64 processor +#define CROARING_IS_X64 1 + +#if defined(_MSC_VER) && (_MSC_VER < 1910) +// Old visual studio systems won't support AVX2 well. +#undef CROARING_IS_X64 +#endif + +#if defined(__clang_major__) && (__clang_major__<= 8) && !defined(__AVX2__) +// Older versions of clang have a bug affecting us +// https://stackoverflow.com/questions/57228537/how-does-one-use-pragma-clang-attribute-push-with-c-namespaces +#undef CROARING_IS_X64 +#endif + +#ifdef CROARING_DISABLE_X64 +#undef CROARING_IS_X64 +#endif +// we include the intrinsic header +#if !CROARING_REGULAR_VISUAL_STUDIO +/* Non-Microsoft C/C++-compatible compiler */ +#include // on some recent GCC, this will declare posix_memalign + + + +#ifdef CROARING_CLANG_VISUAL_STUDIO + +/** + * You are not supposed, normally, to include these + * headers directly. Instead you should either include intrin.h + * or x86intrin.h. However, when compiling with clang + * under Windows (i.e., when _MSC_VER is set), these headers + * only get included *if* the corresponding features are detected + * from macros: + * e.g., if __AVX2__ is set... in turn, we normally set these + * macros by compiling against the corresponding architecture + * (e.g., arch:AVX2, -mavx2, etc.) which compiles the whole + * software with these advanced instructions. These headers would + * normally guard against such usage, but we carefully included + * (or ) before, so the headers + * are fooled. + */ +#include // for _blsr_u64 +#include // for __lzcnt64 +#include // for most things (AVX2, AVX512, _popcnt64) +#include +#include +#include +#include +#include +// unfortunately, we may not get _blsr_u64, but, thankfully, clang +// has it as a macro. +#ifndef _blsr_u64 +// we roll our own +#define _blsr_u64(n) ((n - 1) & n) +#endif // _blsr_u64 +#endif // SIMDJSON_CLANG_VISUAL_STUDIO + + +#endif // CROARING_REGULAR_VISUAL_STUDIO +#endif // defined(__x86_64__) || defined(_M_X64) + +#if !defined(USENEON) && !defined(DISABLENEON) && defined(__ARM_NEON) +# define USENEON +#endif +#if defined(USENEON) +# include +#endif + +#if !CROARING_REGULAR_VISUAL_STUDIO +/* Non-Microsoft C/C++-compatible compiler, assumes that it supports inline + * assembly */ +#define CROARING_INLINE_ASM 1 +#endif // _MSC_VER + +#if CROARING_REGULAR_VISUAL_STUDIO +/* Microsoft C/C++-compatible compiler */ +#include + +#ifndef __clang__ // if one compiles with MSVC *with* clang, then these + // intrinsics are defined!!! +// sadly there is no way to check whether we are missing these intrinsics +// specifically. + +/* wrappers for Visual Studio built-ins that look like gcc built-ins */ +/* result might be undefined when input_num is zero */ +inline int __builtin_ctzll(unsigned long long input_num) { + unsigned long index; +#ifdef _WIN64 // highly recommended!!! + _BitScanForward64(&index, input_num); +#else // if we must support 32-bit Windows + if ((uint32_t)input_num != 0) { + _BitScanForward(&index, (uint32_t)input_num); + } else { + _BitScanForward(&index, (uint32_t)(input_num >> 32)); + index += 32; + } +#endif + return index; +} + +/* result might be undefined when input_num is zero */ +inline int __builtin_clzll(unsigned long long input_num) { + unsigned long index; +#ifdef _WIN64 // highly recommended!!! + _BitScanReverse64(&index, input_num); +#else // if we must support 32-bit Windows + if (input_num > 0xFFFFFFFF) { + _BitScanReverse(&index, (uint32_t)(input_num >> 32)); + index += 32; + } else { + _BitScanReverse(&index, (uint32_t)(input_num)); + } +#endif + return 63 - index; +} + + +/* software implementation avoids POPCNT */ +/*static inline int __builtin_popcountll(unsigned long long input_num) { + const uint64_t m1 = 0x5555555555555555; //binary: 0101... + const uint64_t m2 = 0x3333333333333333; //binary: 00110011.. + const uint64_t m4 = 0x0f0f0f0f0f0f0f0f; //binary: 4 zeros, 4 ones ... + const uint64_t h01 = 0x0101010101010101; //the sum of 256 to the power of 0,1,2,3... + + input_num -= (input_num >> 1) & m1; + input_num = (input_num & m2) + ((input_num >> 2) & m2); + input_num = (input_num + (input_num >> 4)) & m4; + return (input_num * h01) >> 56; +}*/ + +/* Use #define so this is effective even under /Ob0 (no inline) */ +#define __builtin_unreachable() __assume(0) +#endif + +#endif + +#if CROARING_REGULAR_VISUAL_STUDIO +#define ALIGNED(x) __declspec(align(x)) +#elif defined(__GNUC__) || defined(__clang__) +#define ALIGNED(x) __attribute__((aligned(x))) +#else +#warning "Warning. Unrecognized compiler." +#define ALIGNED(x) +#endif + +#if defined(__GNUC__) || defined(__clang__) +#define WARN_UNUSED __attribute__((warn_unused_result)) +#else +#define WARN_UNUSED +#endif + +#define IS_BIG_ENDIAN (*(uint16_t *)"\0\xff" < 0x100) + +static inline int hammingbackup(uint64_t x) { + uint64_t c1 = UINT64_C(0x5555555555555555); + uint64_t c2 = UINT64_C(0x3333333333333333); + uint64_t c4 = UINT64_C(0x0F0F0F0F0F0F0F0F); + x -= (x >> 1) & c1; + x = (( x >> 2) & c2) + (x & c2); x=(x +(x>>4))&c4; + x *= UINT64_C(0x0101010101010101); + return x >> 56; +} + +static inline int hamming(uint64_t x) { +#if defined(_WIN64) && defined(CROARING_REGULAR_VISUAL_STUDIO) && CROARING_REGULAR_VISUAL_STUDIO +#ifdef _M_ARM64 + return hammingbackup(x); + // (int) _CountOneBits64(x); is unavailable +#else // _M_ARM64 + return (int) __popcnt64(x); +#endif // _M_ARM64 +#elif defined(_WIN32) && defined(CROARING_REGULAR_VISUAL_STUDIO) && CROARING_REGULAR_VISUAL_STUDIO +#ifdef _M_ARM + return hammingbackup(x); + // _CountOneBits is unavailable +#else // _M_ARM + return (int) __popcnt(( unsigned int)x) + (int) __popcnt(( unsigned int)(x>>32)); +#endif // _M_ARM +#else + return __builtin_popcountll(x); +#endif +} + +#ifndef UINT64_C +#define UINT64_C(c) (c##ULL) +#endif // UINT64_C + +#ifndef UINT32_C +#define UINT32_C(c) (c##UL) +#endif // UINT32_C + +#ifdef __cplusplus +} // extern "C" { +#endif // __cplusplus + + +// this is almost standard? +#undef STRINGIFY_IMPLEMENTATION_ +#undef STRINGIFY +#define STRINGIFY_IMPLEMENTATION_(a) #a +#define STRINGIFY(a) STRINGIFY_IMPLEMENTATION_(a) + +// Our fast kernels require 64-bit systems. +// +// On 32-bit x86, we lack 64-bit popcnt, lzcnt, blsr instructions. +// Furthermore, the number of SIMD registers is reduced. +// +// On 32-bit ARM, we would have smaller registers. +// +// The library should still have the fallback kernel. It is +// slower, but it should run everywhere. + +// +// Enable valid runtime implementations, and select CROARING_BUILTIN_IMPLEMENTATION +// + +// We are going to use runtime dispatch. +#ifdef CROARING_IS_X64 +#ifdef __clang__ +// clang does not have GCC push pop +// warning: clang attribute push can't be used within a namespace in clang up +// til 8.0 so CROARING_TARGET_REGION and CROARING_UNTARGET_REGION must be *outside* of a +// namespace. +#define CROARING_TARGET_REGION(T) \ + _Pragma(STRINGIFY( \ + clang attribute push(__attribute__((target(T))), apply_to = function))) +#define CROARING_UNTARGET_REGION _Pragma("clang attribute pop") +#elif defined(__GNUC__) +// GCC is easier +#define CROARING_TARGET_REGION(T) \ + _Pragma("GCC push_options") _Pragma(STRINGIFY(GCC target(T))) +#define CROARING_UNTARGET_REGION _Pragma("GCC pop_options") +#endif // clang then gcc + +#endif // CROARING_IS_X64 + +// Default target region macros don't do anything. +#ifndef CROARING_TARGET_REGION +#define CROARING_TARGET_REGION(T) +#define CROARING_UNTARGET_REGION +#endif + +#define CROARING_TARGET_AVX2 CROARING_TARGET_REGION("avx2,bmi,pclmul,lzcnt") + +#ifdef __AVX2__ +// No need for runtime dispatching. +// It is unnecessary and harmful to old clang to tag regions. +#undef CROARING_TARGET_AVX2 +#define CROARING_TARGET_AVX2 +#undef CROARING_UNTARGET_REGION +#define CROARING_UNTARGET_REGION +#endif + +#endif /* INCLUDE_PORTABILITY_H_ */ +/* end file include/roaring/portability.h */ +/* begin file include/roaring/containers/perfparameters.h */ +#ifndef PERFPARAMETERS_H_ +#define PERFPARAMETERS_H_ + +#include + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/** +During lazy computations, we can transform array containers into bitset +containers as +long as we can expect them to have ARRAY_LAZY_LOWERBOUND values. +*/ +enum { ARRAY_LAZY_LOWERBOUND = 1024 }; + +/* default initial size of a run container + setting it to zero delays the malloc.*/ +enum { RUN_DEFAULT_INIT_SIZE = 0 }; + +/* default initial size of an array container + setting it to zero delays the malloc */ +enum { ARRAY_DEFAULT_INIT_SIZE = 0 }; + +/* automatic bitset conversion during lazy or */ +#ifndef LAZY_OR_BITSET_CONVERSION +#define LAZY_OR_BITSET_CONVERSION true +#endif + +/* automatically attempt to convert a bitset to a full run during lazy + * evaluation */ +#ifndef LAZY_OR_BITSET_CONVERSION_TO_FULL +#define LAZY_OR_BITSET_CONVERSION_TO_FULL true +#endif + +/* automatically attempt to convert a bitset to a full run */ +#ifndef OR_BITSET_CONVERSION_TO_FULL +#define OR_BITSET_CONVERSION_TO_FULL true +#endif + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif +/* end file include/roaring/containers/perfparameters.h */ +/* begin file include/roaring/containers/container_defs.h */ +/* + * container_defs.h + * + * Unlike containers.h (which is a file aggregating all the container includes, + * like array.h, bitset.h, and run.h) this is a file included BY those headers + * to do things like define the container base class `container_t`. + */ + +#ifndef INCLUDE_CONTAINERS_CONTAINER_DEFS_H_ +#define INCLUDE_CONTAINERS_CONTAINER_DEFS_H_ + +#ifdef __cplusplus + #include // used by casting helper for compile-time check +#endif + +// The preferences are a separate file to separate out tweakable parameters + +#ifdef __cplusplus +namespace roaring { namespace internal { // No extern "C" (contains template) +#endif + + +/* + * Since roaring_array_t's definition is not opaque, the container type is + * part of the API. If it's not going to be `void*` then it needs a name, and + * expectations are to prefix C library-exported names with `roaring_` etc. + * + * Rather than force the whole codebase to use the name `roaring_container_t`, + * the few API appearances use the macro ROARING_CONTAINER_T. Those includes + * are prior to containers.h, so make a short private alias of `container_t`. + * Then undefine the awkward macro so it's not used any more than it has to be. + */ +typedef ROARING_CONTAINER_T container_t; +#undef ROARING_CONTAINER_T + + +/* + * See ROARING_CONTAINER_T for notes on using container_t as a base class. + * This macro helps make the following pattern look nicer: + * + * #ifdef __cplusplus + * struct roaring_array_s : public container_t { + * #else + * struct roaring_array_s { + * #endif + * int32_t cardinality; + * int32_t capacity; + * uint16_t *array; + * } + */ +#if defined(__cplusplus) + #define STRUCT_CONTAINER(name) \ + struct name : public container_t /* { ... } */ +#else + #define STRUCT_CONTAINER(name) \ + struct name /* { ... } */ +#endif + + +/** + * Since container_t* is not void* in C++, "dangerous" casts are not needed to + * downcast; only a static_cast<> is needed. Define a macro for static casting + * which helps make casts more visible, and catches problems at compile-time + * when building the C sources in C++ mode: + * + * void some_func(container_t **c, ...) { // double pointer, not single + * array_container_t *ac1 = (array_container_t *)(c); // uncaught!! + * + * array_container_t *ac2 = CAST(array_container_t *, c) // C++ errors + * array_container_t *ac3 = CAST_array(c); // shorthand for #2, errors + * } + * + * Trickier to do is a cast from `container**` to `array_container_t**`. This + * needs a reinterpret_cast<>, which sacrifices safety...so a template is used + * leveraging to make sure it's legal in the C++ build. + */ +#ifdef __cplusplus + #define CAST(type,value) static_cast(value) + #define movable_CAST(type,value) movable_CAST_HELPER(value) + + template + PPDerived movable_CAST_HELPER(Base **ptr_to_ptr) { + typedef typename std::remove_pointer::type PDerived; + typedef typename std::remove_pointer::type Derived; + static_assert( + std::is_base_of::value, + "use movable_CAST() for container_t** => xxx_container_t**" + ); + return reinterpret_cast(ptr_to_ptr); + } +#else + #define CAST(type,value) ((type)value) + #define movable_CAST(type, value) ((type)value) +#endif + +// Use for converting e.g. an `array_container_t**` to a `container_t**` +// +#define movable_CAST_base(c) movable_CAST(container_t **, c) + + +#ifdef __cplusplus +} } // namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_CONTAINER_DEFS_H_ */ +/* end file include/roaring/containers/container_defs.h */ +/* begin file include/roaring/array_util.h */ +#ifndef ARRAY_UTIL_H +#define ARRAY_UTIL_H + +#include // for size_t +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* + * Good old binary search. + * Assumes that array is sorted, has logarithmic complexity. + * if the result is x, then: + * if ( x>0 ) you have array[x] = ikey + * if ( x<0 ) then inserting ikey at position -x-1 in array (insuring that array[-x-1]=ikey) + * keys the array sorted. + */ +inline int32_t binarySearch(const uint16_t *array, int32_t lenarray, + uint16_t ikey) { + int32_t low = 0; + int32_t high = lenarray - 1; + while (low <= high) { + int32_t middleIndex = (low + high) >> 1; + uint16_t middleValue = array[middleIndex]; + if (middleValue < ikey) { + low = middleIndex + 1; + } else if (middleValue > ikey) { + high = middleIndex - 1; + } else { + return middleIndex; + } + } + return -(low + 1); +} + +/** + * Galloping search + * Assumes that array is sorted, has logarithmic complexity. + * if the result is x, then if x = length, you have that all values in array between pos and length + * are smaller than min. + * otherwise returns the first index x such that array[x] >= min. + */ +static inline int32_t advanceUntil(const uint16_t *array, int32_t pos, + int32_t length, uint16_t min) { + int32_t lower = pos + 1; + + if ((lower >= length) || (array[lower] >= min)) { + return lower; + } + + int32_t spansize = 1; + + while ((lower + spansize < length) && (array[lower + spansize] < min)) { + spansize <<= 1; + } + int32_t upper = (lower + spansize < length) ? lower + spansize : length - 1; + + if (array[upper] == min) { + return upper; + } + if (array[upper] < min) { + // means + // array + // has no + // item + // >= min + // pos = array.length; + return length; + } + + // we know that the next-smallest span was too small + lower += (spansize >> 1); + + int32_t mid = 0; + while (lower + 1 != upper) { + mid = (lower + upper) >> 1; + if (array[mid] == min) { + return mid; + } else if (array[mid] < min) { + lower = mid; + } else { + upper = mid; + } + } + return upper; +} + +/** + * Returns number of elements which are less then $ikey. + * Array elements must be unique and sorted. + */ +static inline int32_t count_less(const uint16_t *array, int32_t lenarray, + uint16_t ikey) { + if (lenarray == 0) return 0; + int32_t pos = binarySearch(array, lenarray, ikey); + return pos >= 0 ? pos : -(pos+1); +} + +/** + * Returns number of elements which are greater then $ikey. + * Array elements must be unique and sorted. + */ +static inline int32_t count_greater(const uint16_t *array, int32_t lenarray, + uint16_t ikey) { + if (lenarray == 0) return 0; + int32_t pos = binarySearch(array, lenarray, ikey); + if (pos >= 0) { + return lenarray - (pos+1); + } else { + return lenarray - (-pos-1); + } +} + +/** + * From Schlegel et al., Fast Sorted-Set Intersection using SIMD Instructions + * Optimized by D. Lemire on May 3rd 2013 + * + * C should have capacity greater than the minimum of s_1 and s_b + 8 + * where 8 is sizeof(__m128i)/sizeof(uint16_t). + */ +int32_t intersect_vector16(const uint16_t *__restrict__ A, size_t s_a, + const uint16_t *__restrict__ B, size_t s_b, + uint16_t *C); + +/** + * Compute the cardinality of the intersection using SSE4 instructions + */ +int32_t intersect_vector16_cardinality(const uint16_t *__restrict__ A, + size_t s_a, + const uint16_t *__restrict__ B, + size_t s_b); + +/* Computes the intersection between one small and one large set of uint16_t. + * Stores the result into buffer and return the number of elements. */ +int32_t intersect_skewed_uint16(const uint16_t *smallarray, size_t size_s, + const uint16_t *largearray, size_t size_l, + uint16_t *buffer); + +/* Computes the size of the intersection between one small and one large set of + * uint16_t. */ +int32_t intersect_skewed_uint16_cardinality(const uint16_t *smallarray, + size_t size_s, + const uint16_t *largearray, + size_t size_l); + + +/* Check whether the size of the intersection between one small and one large set of uint16_t is non-zero. */ +bool intersect_skewed_uint16_nonempty(const uint16_t *smallarray, size_t size_s, + const uint16_t *largearray, size_t size_l); +/** + * Generic intersection function. + */ +int32_t intersect_uint16(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB, uint16_t *out); +/** + * Compute the size of the intersection (generic). + */ +int32_t intersect_uint16_cardinality(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB); + +/** + * Checking whether the size of the intersection is non-zero. + */ +bool intersect_uint16_nonempty(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB); +/** + * Generic union function. + */ +size_t union_uint16(const uint16_t *set_1, size_t size_1, const uint16_t *set_2, + size_t size_2, uint16_t *buffer); + +/** + * Generic XOR function. + */ +int32_t xor_uint16(const uint16_t *array_1, int32_t card_1, + const uint16_t *array_2, int32_t card_2, uint16_t *out); + +/** + * Generic difference function (ANDNOT). + */ +int difference_uint16(const uint16_t *a1, int length1, const uint16_t *a2, + int length2, uint16_t *a_out); + +/** + * Generic intersection function. + */ +size_t intersection_uint32(const uint32_t *A, const size_t lenA, + const uint32_t *B, const size_t lenB, uint32_t *out); + +/** + * Generic intersection function, returns just the cardinality. + */ +size_t intersection_uint32_card(const uint32_t *A, const size_t lenA, + const uint32_t *B, const size_t lenB); + +/** + * Generic union function. + */ +size_t union_uint32(const uint32_t *set_1, size_t size_1, const uint32_t *set_2, + size_t size_2, uint32_t *buffer); + +/** + * A fast SSE-based union function. + */ +uint32_t union_vector16(const uint16_t *__restrict__ set_1, uint32_t size_1, + const uint16_t *__restrict__ set_2, uint32_t size_2, + uint16_t *__restrict__ buffer); +/** + * A fast SSE-based XOR function. + */ +uint32_t xor_vector16(const uint16_t *__restrict__ array1, uint32_t length1, + const uint16_t *__restrict__ array2, uint32_t length2, + uint16_t *__restrict__ output); + +/** + * A fast SSE-based difference function. + */ +int32_t difference_vector16(const uint16_t *__restrict__ A, size_t s_a, + const uint16_t *__restrict__ B, size_t s_b, + uint16_t *C); + +/** + * Generic union function, returns just the cardinality. + */ +size_t union_uint32_card(const uint32_t *set_1, size_t size_1, + const uint32_t *set_2, size_t size_2); + +/** +* combines union_uint16 and union_vector16 optimally +*/ +size_t fast_union_uint16(const uint16_t *set_1, size_t size_1, const uint16_t *set_2, + size_t size_2, uint16_t *buffer); + + +bool memequals(const void *s1, const void *s2, size_t n); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif +/* end file include/roaring/array_util.h */ +/* begin file include/roaring/utilasm.h */ +/* + * utilasm.h + * + */ + +#ifndef INCLUDE_UTILASM_H_ +#define INCLUDE_UTILASM_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { +#endif + +#if defined(CROARING_INLINE_ASM) +#define CROARING_ASMBITMANIPOPTIMIZATION // optimization flag + +#define ASM_SHIFT_RIGHT(srcReg, bitsReg, destReg) \ + __asm volatile("shrx %1, %2, %0" \ + : "=r"(destReg) \ + : /* write */ \ + "r"(bitsReg), /* read only */ \ + "r"(srcReg) /* read only */ \ + ) + +#define ASM_INPLACESHIFT_RIGHT(srcReg, bitsReg) \ + __asm volatile("shrx %1, %0, %0" \ + : "+r"(srcReg) \ + : /* read/write */ \ + "r"(bitsReg) /* read only */ \ + ) + +#define ASM_SHIFT_LEFT(srcReg, bitsReg, destReg) \ + __asm volatile("shlx %1, %2, %0" \ + : "=r"(destReg) \ + : /* write */ \ + "r"(bitsReg), /* read only */ \ + "r"(srcReg) /* read only */ \ + ) +// set bit at position testBit within testByte to 1 and +// copy cmovDst to cmovSrc if that bit was previously clear +#define ASM_SET_BIT_INC_WAS_CLEAR(testByte, testBit, count) \ + __asm volatile( \ + "bts %2, %0\n" \ + "sbb $-1, %1\n" \ + : "+r"(testByte), /* read/write */ \ + "+r"(count) \ + : /* read/write */ \ + "r"(testBit) /* read only */ \ + ) + +#define ASM_CLEAR_BIT_DEC_WAS_SET(testByte, testBit, count) \ + __asm volatile( \ + "btr %2, %0\n" \ + "sbb $0, %1\n" \ + : "+r"(testByte), /* read/write */ \ + "+r"(count) \ + : /* read/write */ \ + "r"(testBit) /* read only */ \ + ) + +#define ASM_BT64(testByte, testBit, count) \ + __asm volatile( \ + "bt %2,%1\n" \ + "sbb %0,%0" /*could use setb */ \ + : "=r"(count) \ + : /* write */ \ + "r"(testByte), /* read only */ \ + "r"(testBit) /* read only */ \ + ) + +#endif + +#ifdef __cplusplus +} } // extern "C" { namespace roaring { +#endif + +#endif /* INCLUDE_UTILASM_H_ */ +/* end file include/roaring/utilasm.h */ +/* begin file include/roaring/bitset_util.h */ +#ifndef BITSET_UTIL_H +#define BITSET_UTIL_H + +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* + * Set all bits in indexes [begin,end) to true. + */ +static inline void bitset_set_range(uint64_t *words, uint32_t start, + uint32_t end) { + if (start == end) return; + uint32_t firstword = start / 64; + uint32_t endword = (end - 1) / 64; + if (firstword == endword) { + words[firstword] |= ((~UINT64_C(0)) << (start % 64)) & + ((~UINT64_C(0)) >> ((~end + 1) % 64)); + return; + } + words[firstword] |= (~UINT64_C(0)) << (start % 64); + for (uint32_t i = firstword + 1; i < endword; i++) { + words[i] = ~UINT64_C(0); + } + words[endword] |= (~UINT64_C(0)) >> ((~end + 1) % 64); +} + + +/* + * Find the cardinality of the bitset in [begin,begin+lenminusone] + */ +static inline int bitset_lenrange_cardinality(const uint64_t *words, + uint32_t start, + uint32_t lenminusone) { + uint32_t firstword = start / 64; + uint32_t endword = (start + lenminusone) / 64; + if (firstword == endword) { + return hamming(words[firstword] & + ((~UINT64_C(0)) >> ((63 - lenminusone) % 64)) + << (start % 64)); + } + int answer = hamming(words[firstword] & ((~UINT64_C(0)) << (start % 64))); + for (uint32_t i = firstword + 1; i < endword; i++) { + answer += hamming(words[i]); + } + answer += + hamming(words[endword] & + (~UINT64_C(0)) >> (((~start + 1) - lenminusone - 1) % 64)); + return answer; +} + +/* + * Check whether the cardinality of the bitset in [begin,begin+lenminusone] is 0 + */ +static inline bool bitset_lenrange_empty(const uint64_t *words, uint32_t start, + uint32_t lenminusone) { + uint32_t firstword = start / 64; + uint32_t endword = (start + lenminusone) / 64; + if (firstword == endword) { + return (words[firstword] & ((~UINT64_C(0)) >> ((63 - lenminusone) % 64)) + << (start % 64)) == 0; + } + if (((words[firstword] & ((~UINT64_C(0)) << (start%64)))) != 0) { + return false; + } + for (uint32_t i = firstword + 1; i < endword; i++) { + if (words[i] != 0) { + return false; + } + } + if ((words[endword] & (~UINT64_C(0)) >> (((~start + 1) - lenminusone - 1) % 64)) != 0) { + return false; + } + return true; +} + + +/* + * Set all bits in indexes [begin,begin+lenminusone] to true. + */ +static inline void bitset_set_lenrange(uint64_t *words, uint32_t start, + uint32_t lenminusone) { + uint32_t firstword = start / 64; + uint32_t endword = (start + lenminusone) / 64; + if (firstword == endword) { + words[firstword] |= ((~UINT64_C(0)) >> ((63 - lenminusone) % 64)) + << (start % 64); + return; + } + uint64_t temp = words[endword]; + words[firstword] |= (~UINT64_C(0)) << (start % 64); + for (uint32_t i = firstword + 1; i < endword; i += 2) + words[i] = words[i + 1] = ~UINT64_C(0); + words[endword] = + temp | (~UINT64_C(0)) >> (((~start + 1) - lenminusone - 1) % 64); +} + +/* + * Flip all the bits in indexes [begin,end). + */ +static inline void bitset_flip_range(uint64_t *words, uint32_t start, + uint32_t end) { + if (start == end) return; + uint32_t firstword = start / 64; + uint32_t endword = (end - 1) / 64; + words[firstword] ^= ~((~UINT64_C(0)) << (start % 64)); + for (uint32_t i = firstword; i < endword; i++) { + words[i] = ~words[i]; + } + words[endword] ^= ((~UINT64_C(0)) >> ((~end + 1) % 64)); +} + +/* + * Set all bits in indexes [begin,end) to false. + */ +static inline void bitset_reset_range(uint64_t *words, uint32_t start, + uint32_t end) { + if (start == end) return; + uint32_t firstword = start / 64; + uint32_t endword = (end - 1) / 64; + if (firstword == endword) { + words[firstword] &= ~(((~UINT64_C(0)) << (start % 64)) & + ((~UINT64_C(0)) >> ((~end + 1) % 64))); + return; + } + words[firstword] &= ~((~UINT64_C(0)) << (start % 64)); + for (uint32_t i = firstword + 1; i < endword; i++) { + words[i] = UINT64_C(0); + } + words[endword] &= ~((~UINT64_C(0)) >> ((~end + 1) % 64)); +} + +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out", values start at "base". + * + * The "out" pointer should be sufficient to store the actual number of bits + * set. + * + * Returns how many values were actually decoded. + * + * This function should only be expected to be faster than + * bitset_extract_setbits + * when the density of the bitset is high. + * + * This function uses AVX2 decoding. + */ +size_t bitset_extract_setbits_avx2(const uint64_t *words, size_t length, + uint32_t *out, size_t outcapacity, + uint32_t base); + +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out", values start at "base". + * + * The "out" pointer should be sufficient to store the actual number of bits + *set. + * + * Returns how many values were actually decoded. + */ +size_t bitset_extract_setbits(const uint64_t *words, size_t length, + uint32_t *out, uint32_t base); + +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out" as 16-bit integers, values start at "base" (can + *be set to zero) + * + * The "out" pointer should be sufficient to store the actual number of bits + *set. + * + * Returns how many values were actually decoded. + * + * This function should only be expected to be faster than + *bitset_extract_setbits_uint16 + * when the density of the bitset is high. + * + * This function uses SSE decoding. + */ +size_t bitset_extract_setbits_sse_uint16(const uint64_t *words, size_t length, + uint16_t *out, size_t outcapacity, + uint16_t base); + +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out", values start at "base" + * (can be set to zero) + * + * The "out" pointer should be sufficient to store the actual number of bits + *set. + * + * Returns how many values were actually decoded. + */ +size_t bitset_extract_setbits_uint16(const uint64_t *words, size_t length, + uint16_t *out, uint16_t base); + +/* + * Given two bitsets containing "length" 64-bit words, write out the position + * of all the common set bits to "out", values start at "base" + * (can be set to zero) + * + * The "out" pointer should be sufficient to store the actual number of bits + * set. + * + * Returns how many values were actually decoded. + */ +size_t bitset_extract_intersection_setbits_uint16(const uint64_t * __restrict__ words1, + const uint64_t * __restrict__ words2, + size_t length, uint16_t *out, + uint16_t base); + +/* + * Given a bitset having cardinality card, set all bit values in the list (there + * are length of them) + * and return the updated cardinality. This evidently assumes that the bitset + * already contained data. + */ +uint64_t bitset_set_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length); +/* + * Given a bitset, set all bit values in the list (there + * are length of them). + */ +void bitset_set_list(uint64_t *words, const uint16_t *list, uint64_t length); + +/* + * Given a bitset having cardinality card, unset all bit values in the list + * (there are length of them) + * and return the updated cardinality. This evidently assumes that the bitset + * already contained data. + */ +uint64_t bitset_clear_list(uint64_t *words, uint64_t card, const uint16_t *list, + uint64_t length); + +/* + * Given a bitset having cardinality card, toggle all bit values in the list + * (there are length of them) + * and return the updated cardinality. This evidently assumes that the bitset + * already contained data. + */ + +uint64_t bitset_flip_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length); + +void bitset_flip_list(uint64_t *words, const uint16_t *list, uint64_t length); + +#ifdef CROARING_IS_X64 +/*** + * BEGIN Harley-Seal popcount functions. + */ +CROARING_TARGET_AVX2 +/** + * Compute the population count of a 256-bit word + * This is not especially fast, but it is convenient as part of other functions. + */ +static inline __m256i popcount256(__m256i v) { + const __m256i lookuppos = _mm256_setr_epi8( + /* 0 */ 4 + 0, /* 1 */ 4 + 1, /* 2 */ 4 + 1, /* 3 */ 4 + 2, + /* 4 */ 4 + 1, /* 5 */ 4 + 2, /* 6 */ 4 + 2, /* 7 */ 4 + 3, + /* 8 */ 4 + 1, /* 9 */ 4 + 2, /* a */ 4 + 2, /* b */ 4 + 3, + /* c */ 4 + 2, /* d */ 4 + 3, /* e */ 4 + 3, /* f */ 4 + 4, + + /* 0 */ 4 + 0, /* 1 */ 4 + 1, /* 2 */ 4 + 1, /* 3 */ 4 + 2, + /* 4 */ 4 + 1, /* 5 */ 4 + 2, /* 6 */ 4 + 2, /* 7 */ 4 + 3, + /* 8 */ 4 + 1, /* 9 */ 4 + 2, /* a */ 4 + 2, /* b */ 4 + 3, + /* c */ 4 + 2, /* d */ 4 + 3, /* e */ 4 + 3, /* f */ 4 + 4); + const __m256i lookupneg = _mm256_setr_epi8( + /* 0 */ 4 - 0, /* 1 */ 4 - 1, /* 2 */ 4 - 1, /* 3 */ 4 - 2, + /* 4 */ 4 - 1, /* 5 */ 4 - 2, /* 6 */ 4 - 2, /* 7 */ 4 - 3, + /* 8 */ 4 - 1, /* 9 */ 4 - 2, /* a */ 4 - 2, /* b */ 4 - 3, + /* c */ 4 - 2, /* d */ 4 - 3, /* e */ 4 - 3, /* f */ 4 - 4, + + /* 0 */ 4 - 0, /* 1 */ 4 - 1, /* 2 */ 4 - 1, /* 3 */ 4 - 2, + /* 4 */ 4 - 1, /* 5 */ 4 - 2, /* 6 */ 4 - 2, /* 7 */ 4 - 3, + /* 8 */ 4 - 1, /* 9 */ 4 - 2, /* a */ 4 - 2, /* b */ 4 - 3, + /* c */ 4 - 2, /* d */ 4 - 3, /* e */ 4 - 3, /* f */ 4 - 4); + const __m256i low_mask = _mm256_set1_epi8(0x0f); + + const __m256i lo = _mm256_and_si256(v, low_mask); + const __m256i hi = _mm256_and_si256(_mm256_srli_epi16(v, 4), low_mask); + const __m256i popcnt1 = _mm256_shuffle_epi8(lookuppos, lo); + const __m256i popcnt2 = _mm256_shuffle_epi8(lookupneg, hi); + return _mm256_sad_epu8(popcnt1, popcnt2); +} +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +/** + * Simple CSA over 256 bits + */ +static inline void CSA(__m256i *h, __m256i *l, __m256i a, __m256i b, + __m256i c) { + const __m256i u = _mm256_xor_si256(a, b); + *h = _mm256_or_si256(_mm256_and_si256(a, b), _mm256_and_si256(u, c)); + *l = _mm256_xor_si256(u, c); +} +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +/** + * Fast Harley-Seal AVX population count function + */ +inline static uint64_t avx2_harley_seal_popcount256(const __m256i *data, + const uint64_t size) { + __m256i total = _mm256_setzero_si256(); + __m256i ones = _mm256_setzero_si256(); + __m256i twos = _mm256_setzero_si256(); + __m256i fours = _mm256_setzero_si256(); + __m256i eights = _mm256_setzero_si256(); + __m256i sixteens = _mm256_setzero_si256(); + __m256i twosA, twosB, foursA, foursB, eightsA, eightsB; + + const uint64_t limit = size - size % 16; + uint64_t i = 0; + + for (; i < limit; i += 16) { + CSA(&twosA, &ones, ones, _mm256_lddqu_si256(data + i), + _mm256_lddqu_si256(data + i + 1)); + CSA(&twosB, &ones, ones, _mm256_lddqu_si256(data + i + 2), + _mm256_lddqu_si256(data + i + 3)); + CSA(&foursA, &twos, twos, twosA, twosB); + CSA(&twosA, &ones, ones, _mm256_lddqu_si256(data + i + 4), + _mm256_lddqu_si256(data + i + 5)); + CSA(&twosB, &ones, ones, _mm256_lddqu_si256(data + i + 6), + _mm256_lddqu_si256(data + i + 7)); + CSA(&foursB, &twos, twos, twosA, twosB); + CSA(&eightsA, &fours, fours, foursA, foursB); + CSA(&twosA, &ones, ones, _mm256_lddqu_si256(data + i + 8), + _mm256_lddqu_si256(data + i + 9)); + CSA(&twosB, &ones, ones, _mm256_lddqu_si256(data + i + 10), + _mm256_lddqu_si256(data + i + 11)); + CSA(&foursA, &twos, twos, twosA, twosB); + CSA(&twosA, &ones, ones, _mm256_lddqu_si256(data + i + 12), + _mm256_lddqu_si256(data + i + 13)); + CSA(&twosB, &ones, ones, _mm256_lddqu_si256(data + i + 14), + _mm256_lddqu_si256(data + i + 15)); + CSA(&foursB, &twos, twos, twosA, twosB); + CSA(&eightsB, &fours, fours, foursA, foursB); + CSA(&sixteens, &eights, eights, eightsA, eightsB); + + total = _mm256_add_epi64(total, popcount256(sixteens)); + } + + total = _mm256_slli_epi64(total, 4); // * 16 + total = _mm256_add_epi64( + total, _mm256_slli_epi64(popcount256(eights), 3)); // += 8 * ... + total = _mm256_add_epi64( + total, _mm256_slli_epi64(popcount256(fours), 2)); // += 4 * ... + total = _mm256_add_epi64( + total, _mm256_slli_epi64(popcount256(twos), 1)); // += 2 * ... + total = _mm256_add_epi64(total, popcount256(ones)); + for (; i < size; i++) + total = + _mm256_add_epi64(total, popcount256(_mm256_lddqu_si256(data + i))); + + return (uint64_t)(_mm256_extract_epi64(total, 0)) + + (uint64_t)(_mm256_extract_epi64(total, 1)) + + (uint64_t)(_mm256_extract_epi64(total, 2)) + + (uint64_t)(_mm256_extract_epi64(total, 3)); +} +CROARING_UNTARGET_REGION + +#define AVXPOPCNTFNC(opname, avx_intrinsic) \ + static inline uint64_t avx2_harley_seal_popcount256_##opname( \ + const __m256i *data1, const __m256i *data2, const uint64_t size) { \ + __m256i total = _mm256_setzero_si256(); \ + __m256i ones = _mm256_setzero_si256(); \ + __m256i twos = _mm256_setzero_si256(); \ + __m256i fours = _mm256_setzero_si256(); \ + __m256i eights = _mm256_setzero_si256(); \ + __m256i sixteens = _mm256_setzero_si256(); \ + __m256i twosA, twosB, foursA, foursB, eightsA, eightsB; \ + __m256i A1, A2; \ + const uint64_t limit = size - size % 16; \ + uint64_t i = 0; \ + for (; i < limit; i += 16) { \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i), \ + _mm256_lddqu_si256(data2 + i)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 1), \ + _mm256_lddqu_si256(data2 + i + 1)); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 2), \ + _mm256_lddqu_si256(data2 + i + 2)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 3), \ + _mm256_lddqu_si256(data2 + i + 3)); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursA, &twos, twos, twosA, twosB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 4), \ + _mm256_lddqu_si256(data2 + i + 4)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 5), \ + _mm256_lddqu_si256(data2 + i + 5)); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 6), \ + _mm256_lddqu_si256(data2 + i + 6)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 7), \ + _mm256_lddqu_si256(data2 + i + 7)); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursB, &twos, twos, twosA, twosB); \ + CSA(&eightsA, &fours, fours, foursA, foursB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 8), \ + _mm256_lddqu_si256(data2 + i + 8)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 9), \ + _mm256_lddqu_si256(data2 + i + 9)); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 10), \ + _mm256_lddqu_si256(data2 + i + 10)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 11), \ + _mm256_lddqu_si256(data2 + i + 11)); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursA, &twos, twos, twosA, twosB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 12), \ + _mm256_lddqu_si256(data2 + i + 12)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 13), \ + _mm256_lddqu_si256(data2 + i + 13)); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 14), \ + _mm256_lddqu_si256(data2 + i + 14)); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 15), \ + _mm256_lddqu_si256(data2 + i + 15)); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursB, &twos, twos, twosA, twosB); \ + CSA(&eightsB, &fours, fours, foursA, foursB); \ + CSA(&sixteens, &eights, eights, eightsA, eightsB); \ + total = _mm256_add_epi64(total, popcount256(sixteens)); \ + } \ + total = _mm256_slli_epi64(total, 4); \ + total = _mm256_add_epi64(total, \ + _mm256_slli_epi64(popcount256(eights), 3)); \ + total = \ + _mm256_add_epi64(total, _mm256_slli_epi64(popcount256(fours), 2)); \ + total = \ + _mm256_add_epi64(total, _mm256_slli_epi64(popcount256(twos), 1)); \ + total = _mm256_add_epi64(total, popcount256(ones)); \ + for (; i < size; i++) { \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i), \ + _mm256_lddqu_si256(data2 + i)); \ + total = _mm256_add_epi64(total, popcount256(A1)); \ + } \ + return (uint64_t)(_mm256_extract_epi64(total, 0)) + \ + (uint64_t)(_mm256_extract_epi64(total, 1)) + \ + (uint64_t)(_mm256_extract_epi64(total, 2)) + \ + (uint64_t)(_mm256_extract_epi64(total, 3)); \ + } \ + static inline uint64_t avx2_harley_seal_popcount256andstore_##opname( \ + const __m256i *__restrict__ data1, const __m256i *__restrict__ data2, \ + __m256i *__restrict__ out, const uint64_t size) { \ + __m256i total = _mm256_setzero_si256(); \ + __m256i ones = _mm256_setzero_si256(); \ + __m256i twos = _mm256_setzero_si256(); \ + __m256i fours = _mm256_setzero_si256(); \ + __m256i eights = _mm256_setzero_si256(); \ + __m256i sixteens = _mm256_setzero_si256(); \ + __m256i twosA, twosB, foursA, foursB, eightsA, eightsB; \ + __m256i A1, A2; \ + const uint64_t limit = size - size % 16; \ + uint64_t i = 0; \ + for (; i < limit; i += 16) { \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i), \ + _mm256_lddqu_si256(data2 + i)); \ + _mm256_storeu_si256(out + i, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 1), \ + _mm256_lddqu_si256(data2 + i + 1)); \ + _mm256_storeu_si256(out + i + 1, A2); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 2), \ + _mm256_lddqu_si256(data2 + i + 2)); \ + _mm256_storeu_si256(out + i + 2, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 3), \ + _mm256_lddqu_si256(data2 + i + 3)); \ + _mm256_storeu_si256(out + i + 3, A2); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursA, &twos, twos, twosA, twosB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 4), \ + _mm256_lddqu_si256(data2 + i + 4)); \ + _mm256_storeu_si256(out + i + 4, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 5), \ + _mm256_lddqu_si256(data2 + i + 5)); \ + _mm256_storeu_si256(out + i + 5, A2); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 6), \ + _mm256_lddqu_si256(data2 + i + 6)); \ + _mm256_storeu_si256(out + i + 6, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 7), \ + _mm256_lddqu_si256(data2 + i + 7)); \ + _mm256_storeu_si256(out + i + 7, A2); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursB, &twos, twos, twosA, twosB); \ + CSA(&eightsA, &fours, fours, foursA, foursB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 8), \ + _mm256_lddqu_si256(data2 + i + 8)); \ + _mm256_storeu_si256(out + i + 8, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 9), \ + _mm256_lddqu_si256(data2 + i + 9)); \ + _mm256_storeu_si256(out + i + 9, A2); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 10), \ + _mm256_lddqu_si256(data2 + i + 10)); \ + _mm256_storeu_si256(out + i + 10, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 11), \ + _mm256_lddqu_si256(data2 + i + 11)); \ + _mm256_storeu_si256(out + i + 11, A2); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursA, &twos, twos, twosA, twosB); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 12), \ + _mm256_lddqu_si256(data2 + i + 12)); \ + _mm256_storeu_si256(out + i + 12, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 13), \ + _mm256_lddqu_si256(data2 + i + 13)); \ + _mm256_storeu_si256(out + i + 13, A2); \ + CSA(&twosA, &ones, ones, A1, A2); \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 14), \ + _mm256_lddqu_si256(data2 + i + 14)); \ + _mm256_storeu_si256(out + i + 14, A1); \ + A2 = avx_intrinsic(_mm256_lddqu_si256(data1 + i + 15), \ + _mm256_lddqu_si256(data2 + i + 15)); \ + _mm256_storeu_si256(out + i + 15, A2); \ + CSA(&twosB, &ones, ones, A1, A2); \ + CSA(&foursB, &twos, twos, twosA, twosB); \ + CSA(&eightsB, &fours, fours, foursA, foursB); \ + CSA(&sixteens, &eights, eights, eightsA, eightsB); \ + total = _mm256_add_epi64(total, popcount256(sixteens)); \ + } \ + total = _mm256_slli_epi64(total, 4); \ + total = _mm256_add_epi64(total, \ + _mm256_slli_epi64(popcount256(eights), 3)); \ + total = \ + _mm256_add_epi64(total, _mm256_slli_epi64(popcount256(fours), 2)); \ + total = \ + _mm256_add_epi64(total, _mm256_slli_epi64(popcount256(twos), 1)); \ + total = _mm256_add_epi64(total, popcount256(ones)); \ + for (; i < size; i++) { \ + A1 = avx_intrinsic(_mm256_lddqu_si256(data1 + i), \ + _mm256_lddqu_si256(data2 + i)); \ + _mm256_storeu_si256(out + i, A1); \ + total = _mm256_add_epi64(total, popcount256(A1)); \ + } \ + return (uint64_t)(_mm256_extract_epi64(total, 0)) + \ + (uint64_t)(_mm256_extract_epi64(total, 1)) + \ + (uint64_t)(_mm256_extract_epi64(total, 2)) + \ + (uint64_t)(_mm256_extract_epi64(total, 3)); \ + } + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC(or, _mm256_or_si256) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC(union, _mm256_or_si256) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC(and, _mm256_and_si256) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC(intersection, _mm256_and_si256) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC (xor, _mm256_xor_si256) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVXPOPCNTFNC(andnot, _mm256_andnot_si256) +CROARING_UNTARGET_REGION + +/*** + * END Harley-Seal popcount functions. + */ + +#endif // CROARING_IS_X64 + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal +#endif + +#endif +/* end file include/roaring/bitset_util.h */ +/* begin file include/roaring/containers/array.h */ +/* + * array.h + * + */ + +#ifndef INCLUDE_CONTAINERS_ARRAY_H_ +#define INCLUDE_CONTAINERS_ARRAY_H_ + +#include + + + +#ifdef __cplusplus +extern "C" { namespace roaring { + +// Note: in pure C++ code, you should avoid putting `using` in header files +using api::roaring_iterator; +using api::roaring_iterator64; + +namespace internal { +#endif + +/* Containers with DEFAULT_MAX_SIZE or less integers should be arrays */ +enum { DEFAULT_MAX_SIZE = 4096 }; + +/* struct array_container - sparse representation of a bitmap + * + * @cardinality: number of indices in `array` (and the bitmap) + * @capacity: allocated size of `array` + * @array: sorted list of integers + */ +STRUCT_CONTAINER(array_container_s) { + int32_t cardinality; + int32_t capacity; + uint16_t *array; +}; + +typedef struct array_container_s array_container_t; + +#define CAST_array(c) CAST(array_container_t *, c) // safer downcast +#define const_CAST_array(c) CAST(const array_container_t *, c) +#define movable_CAST_array(c) movable_CAST(array_container_t **, c) + +/* Create a new array with default. Return NULL in case of failure. See also + * array_container_create_given_capacity. */ +array_container_t *array_container_create(void); + +/* Create a new array with a specified capacity size. Return NULL in case of + * failure. */ +array_container_t *array_container_create_given_capacity(int32_t size); + +/* Create a new array containing all values in [min,max). */ +array_container_t * array_container_create_range(uint32_t min, uint32_t max); + +/* + * Shrink the capacity to the actual size, return the number of bytes saved. + */ +int array_container_shrink_to_fit(array_container_t *src); + +/* Free memory owned by `array'. */ +void array_container_free(array_container_t *array); + +/* Duplicate container */ +array_container_t *array_container_clone(const array_container_t *src); + +/* Get the cardinality of `array'. */ +static inline int array_container_cardinality(const array_container_t *array) { + return array->cardinality; +} + +static inline bool array_container_nonzero_cardinality( + const array_container_t *array) { + return array->cardinality > 0; +} + +/* Copy one container into another. We assume that they are distinct. */ +void array_container_copy(const array_container_t *src, array_container_t *dst); + +/* Add all the values in [min,max) (included) at a distance k*step from min. + The container must have a size less or equal to DEFAULT_MAX_SIZE after this + addition. */ +void array_container_add_from_range(array_container_t *arr, uint32_t min, + uint32_t max, uint16_t step); + +/* Set the cardinality to zero (does not release memory). */ +static inline void array_container_clear(array_container_t *array) { + array->cardinality = 0; +} + +static inline bool array_container_empty(const array_container_t *array) { + return array->cardinality == 0; +} + +/* check whether the cardinality is equal to the capacity (this does not mean +* that it contains 1<<16 elements) */ +static inline bool array_container_full(const array_container_t *array) { + return array->cardinality == array->capacity; +} + + +/* Compute the union of `src_1' and `src_2' and write the result to `dst' + * It is assumed that `dst' is distinct from both `src_1' and `src_2'. */ +void array_container_union(const array_container_t *src_1, + const array_container_t *src_2, + array_container_t *dst); + +/* symmetric difference, see array_container_union */ +void array_container_xor(const array_container_t *array_1, + const array_container_t *array_2, + array_container_t *out); + +/* Computes the intersection of src_1 and src_2 and write the result to + * dst. It is assumed that dst is distinct from both src_1 and src_2. */ +void array_container_intersection(const array_container_t *src_1, + const array_container_t *src_2, + array_container_t *dst); + +/* Check whether src_1 and src_2 intersect. */ +bool array_container_intersect(const array_container_t *src_1, + const array_container_t *src_2); + + +/* computers the size of the intersection between two arrays. + */ +int array_container_intersection_cardinality(const array_container_t *src_1, + const array_container_t *src_2); + +/* computes the intersection of array1 and array2 and write the result to + * array1. + * */ +void array_container_intersection_inplace(array_container_t *src_1, + const array_container_t *src_2); + +/* + * Write out the 16-bit integers contained in this container as a list of 32-bit + * integers using base + * as the starting value (it might be expected that base has zeros in its 16 + * least significant bits). + * The function returns the number of values written. + * The caller is responsible for allocating enough memory in out. + */ +int array_container_to_uint32_array(void *vout, const array_container_t *cont, + uint32_t base); + +/* Compute the number of runs */ +int32_t array_container_number_of_runs(const array_container_t *ac); + +/* + * Print this container using printf (useful for debugging). + */ +void array_container_printf(const array_container_t *v); + +/* + * Print this container using printf as a comma-separated list of 32-bit + * integers starting at base. + */ +void array_container_printf_as_uint32_array(const array_container_t *v, + uint32_t base); + +/** + * Return the serialized size in bytes of a container having cardinality "card". + */ +static inline int32_t array_container_serialized_size_in_bytes(int32_t card) { + return card * 2 + 2; +} + +/** + * Increase capacity to at least min. + * Whether the existing data needs to be copied over depends on the "preserve" + * parameter. If preserve is false, then the new content will be uninitialized, + * otherwise the old content is copied. + */ +void array_container_grow(array_container_t *container, int32_t min, + bool preserve); + +bool array_container_iterate(const array_container_t *cont, uint32_t base, + roaring_iterator iterator, void *ptr); +bool array_container_iterate64(const array_container_t *cont, uint32_t base, + roaring_iterator64 iterator, uint64_t high_bits, + void *ptr); + +/** + * Writes the underlying array to buf, outputs how many bytes were written. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes written should be + * array_container_size_in_bytes(container). + * + */ +int32_t array_container_write(const array_container_t *container, char *buf); +/** + * Reads the instance from buf, outputs how many bytes were read. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes read should be array_container_size_in_bytes(container). + * You need to provide the (known) cardinality. + */ +int32_t array_container_read(int32_t cardinality, array_container_t *container, + const char *buf); + +/** + * Return the serialized size in bytes of a container (see + * bitset_container_write) + * This is meant to be compatible with the Java and Go versions of Roaring and + * assumes + * that the cardinality of the container is already known. + * + */ +static inline int32_t array_container_size_in_bytes( + const array_container_t *container) { + return container->cardinality * sizeof(uint16_t); +} + +/** + * Return true if the two arrays have the same content. + */ +static inline bool array_container_equals( + const array_container_t *container1, + const array_container_t *container2) { + + if (container1->cardinality != container2->cardinality) { + return false; + } + return memequals(container1->array, container2->array, container1->cardinality*2); +} + +/** + * Return true if container1 is a subset of container2. + */ +bool array_container_is_subset(const array_container_t *container1, + const array_container_t *container2); + +/** + * If the element of given rank is in this container, supposing that the first + * element has rank start_rank, then the function returns true and sets element + * accordingly. + * Otherwise, it returns false and update start_rank. + */ +static inline bool array_container_select(const array_container_t *container, + uint32_t *start_rank, uint32_t rank, + uint32_t *element) { + int card = array_container_cardinality(container); + if (*start_rank + card <= rank) { + *start_rank += card; + return false; + } else { + *element = container->array[rank - *start_rank]; + return true; + } +} + +/* Computes the difference of array1 and array2 and write the result + * to array out. + * Array out does not need to be distinct from array_1 + */ +void array_container_andnot(const array_container_t *array_1, + const array_container_t *array_2, + array_container_t *out); + +/* Append x to the set. Assumes that the value is larger than any preceding + * values. */ +static inline void array_container_append(array_container_t *arr, + uint16_t pos) { + const int32_t capacity = arr->capacity; + + if (array_container_full(arr)) { + array_container_grow(arr, capacity + 1, true); + } + + arr->array[arr->cardinality++] = pos; +} + +/** + * Add value to the set if final cardinality doesn't exceed max_cardinality. + * Return code: + * 1 -- value was added + * 0 -- value was already present + * -1 -- value was not added because cardinality would exceed max_cardinality + */ +static inline int array_container_try_add(array_container_t *arr, uint16_t value, + int32_t max_cardinality) { + const int32_t cardinality = arr->cardinality; + + // best case, we can append. + if ((array_container_empty(arr) || arr->array[cardinality - 1] < value) && + cardinality < max_cardinality) { + array_container_append(arr, value); + return 1; + } + + const int32_t loc = binarySearch(arr->array, cardinality, value); + + if (loc >= 0) { + return 0; + } else if (cardinality < max_cardinality) { + if (array_container_full(arr)) { + array_container_grow(arr, arr->capacity + 1, true); + } + const int32_t insert_idx = -loc - 1; + memmove(arr->array + insert_idx + 1, arr->array + insert_idx, + (cardinality - insert_idx) * sizeof(uint16_t)); + arr->array[insert_idx] = value; + arr->cardinality++; + return 1; + } else { + return -1; + } +} + +/* Add value to the set. Returns true if x was not already present. */ +static inline bool array_container_add(array_container_t *arr, uint16_t value) { + return array_container_try_add(arr, value, INT32_MAX) == 1; +} + +/* Remove x from the set. Returns true if x was present. */ +static inline bool array_container_remove(array_container_t *arr, + uint16_t pos) { + const int32_t idx = binarySearch(arr->array, arr->cardinality, pos); + const bool is_present = idx >= 0; + if (is_present) { + memmove(arr->array + idx, arr->array + idx + 1, + (arr->cardinality - idx - 1) * sizeof(uint16_t)); + arr->cardinality--; + } + + return is_present; +} + +/* Check whether x is present. */ +inline bool array_container_contains(const array_container_t *arr, + uint16_t pos) { + // return binarySearch(arr->array, arr->cardinality, pos) >= 0; + // binary search with fallback to linear search for short ranges + int32_t low = 0; + const uint16_t * carr = (const uint16_t *) arr->array; + int32_t high = arr->cardinality - 1; + // while (high - low >= 0) { + while(high >= low + 16) { + int32_t middleIndex = (low + high)>>1; + uint16_t middleValue = carr[middleIndex]; + if (middleValue < pos) { + low = middleIndex + 1; + } else if (middleValue > pos) { + high = middleIndex - 1; + } else { + return true; + } + } + + for (int i=low; i <= high; i++) { + uint16_t v = carr[i]; + if (v == pos) { + return true; + } + if ( v > pos ) return false; + } + return false; + +} + +void array_container_offset(const array_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset); + +//* Check whether a range of values from range_start (included) to range_end (excluded) is present. */ +static inline bool array_container_contains_range(const array_container_t *arr, + uint32_t range_start, uint32_t range_end) { + const int32_t range_count = range_end - range_start; + const uint16_t rs_included = range_start; + const uint16_t re_included = range_end - 1; + + // Empty range is always included + if (range_count <= 0) { + return true; + } + if (range_count > arr->cardinality) { + return false; + } + + const int32_t start = binarySearch(arr->array, arr->cardinality, rs_included); + // If this sorted array contains all items in the range: + // * the start item must be found + // * the last item in range range_count must exist, and be the expected end value + return (start >= 0) && (arr->cardinality >= start + range_count) && + (arr->array[start + range_count - 1] == re_included); +} + +/* Returns the smallest value (assumes not empty) */ +inline uint16_t array_container_minimum(const array_container_t *arr) { + if (arr->cardinality == 0) return 0; + return arr->array[0]; +} + +/* Returns the largest value (assumes not empty) */ +inline uint16_t array_container_maximum(const array_container_t *arr) { + if (arr->cardinality == 0) return 0; + return arr->array[arr->cardinality - 1]; +} + +/* Returns the number of values equal or smaller than x */ +inline int array_container_rank(const array_container_t *arr, uint16_t x) { + const int32_t idx = binarySearch(arr->array, arr->cardinality, x); + const bool is_present = idx >= 0; + if (is_present) { + return idx + 1; + } else { + return -idx - 1; + } +} + +/* Returns the index of the first value equal or smaller than x, or -1 */ +inline int array_container_index_equalorlarger(const array_container_t *arr, uint16_t x) { + const int32_t idx = binarySearch(arr->array, arr->cardinality, x); + const bool is_present = idx >= 0; + if (is_present) { + return idx; + } else { + int32_t candidate = - idx - 1; + if(candidate < arr->cardinality) return candidate; + return -1; + } +} + +/* + * Adds all values in range [min,max] using hint: + * nvals_less is the number of array values less than $min + * nvals_greater is the number of array values greater than $max + */ +static inline void array_container_add_range_nvals(array_container_t *array, + uint32_t min, uint32_t max, + int32_t nvals_less, + int32_t nvals_greater) { + int32_t union_cardinality = nvals_less + (max - min + 1) + nvals_greater; + if (union_cardinality > array->capacity) { + array_container_grow(array, union_cardinality, true); + } + memmove(&(array->array[union_cardinality - nvals_greater]), + &(array->array[array->cardinality - nvals_greater]), + nvals_greater * sizeof(uint16_t)); + for (uint32_t i = 0; i <= max - min; i++) { + array->array[nvals_less + i] = min + i; + } + array->cardinality = union_cardinality; +} + +/** + * Adds all values in range [min,max]. + */ +static inline void array_container_add_range(array_container_t *array, + uint32_t min, uint32_t max) { + int32_t nvals_greater = count_greater(array->array, array->cardinality, max); + int32_t nvals_less = count_less(array->array, array->cardinality - nvals_greater, min); + array_container_add_range_nvals(array, min, max, nvals_less, nvals_greater); +} + +/* + * Removes all elements array[pos] .. array[pos+count-1] + */ +static inline void array_container_remove_range(array_container_t *array, + uint32_t pos, uint32_t count) { + if (count != 0) { + memmove(&(array->array[pos]), &(array->array[pos+count]), + (array->cardinality - pos - count) * sizeof(uint16_t)); + array->cardinality -= count; + } +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_ARRAY_H_ */ +/* end file include/roaring/containers/array.h */ +/* begin file include/roaring/containers/bitset.h */ +/* + * bitset.h + * + */ + +#ifndef INCLUDE_CONTAINERS_BITSET_H_ +#define INCLUDE_CONTAINERS_BITSET_H_ + +#include +#include + + + +#ifdef __cplusplus +extern "C" { namespace roaring { + +// Note: in pure C++ code, you should avoid putting `using` in header files +using api::roaring_iterator; +using api::roaring_iterator64; + +namespace internal { +#endif + + + +enum { + BITSET_CONTAINER_SIZE_IN_WORDS = (1 << 16) / 64, + BITSET_UNKNOWN_CARDINALITY = -1 +}; + +STRUCT_CONTAINER(bitset_container_s) { + int32_t cardinality; + uint64_t *words; +}; + +typedef struct bitset_container_s bitset_container_t; + +#define CAST_bitset(c) CAST(bitset_container_t *, c) // safer downcast +#define const_CAST_bitset(c) CAST(const bitset_container_t *, c) +#define movable_CAST_bitset(c) movable_CAST(bitset_container_t **, c) + +/* Create a new bitset. Return NULL in case of failure. */ +bitset_container_t *bitset_container_create(void); + +/* Free memory. */ +void bitset_container_free(bitset_container_t *bitset); + +/* Clear bitset (sets bits to 0). */ +void bitset_container_clear(bitset_container_t *bitset); + +/* Set all bits to 1. */ +void bitset_container_set_all(bitset_container_t *bitset); + +/* Duplicate bitset */ +bitset_container_t *bitset_container_clone(const bitset_container_t *src); + +/* Set the bit in [begin,end). WARNING: as of April 2016, this method is slow + * and + * should not be used in performance-sensitive code. Ever. */ +void bitset_container_set_range(bitset_container_t *bitset, uint32_t begin, + uint32_t end); + +#if defined(CROARING_ASMBITMANIPOPTIMIZATION) && defined(__AVX2__) +/* Set the ith bit. */ +static inline void bitset_container_set(bitset_container_t *bitset, + uint16_t pos) { + uint64_t shift = 6; + uint64_t offset; + uint64_t p = pos; + ASM_SHIFT_RIGHT(p, shift, offset); + uint64_t load = bitset->words[offset]; + ASM_SET_BIT_INC_WAS_CLEAR(load, p, bitset->cardinality); + bitset->words[offset] = load; +} + +/* Unset the ith bit. */ +static inline void bitset_container_unset(bitset_container_t *bitset, + uint16_t pos) { + uint64_t shift = 6; + uint64_t offset; + uint64_t p = pos; + ASM_SHIFT_RIGHT(p, shift, offset); + uint64_t load = bitset->words[offset]; + ASM_CLEAR_BIT_DEC_WAS_SET(load, p, bitset->cardinality); + bitset->words[offset] = load; +} + +/* Add `pos' to `bitset'. Returns true if `pos' was not present. Might be slower + * than bitset_container_set. */ +static inline bool bitset_container_add(bitset_container_t *bitset, + uint16_t pos) { + uint64_t shift = 6; + uint64_t offset; + uint64_t p = pos; + ASM_SHIFT_RIGHT(p, shift, offset); + uint64_t load = bitset->words[offset]; + // could be possibly slightly further optimized + const int32_t oldcard = bitset->cardinality; + ASM_SET_BIT_INC_WAS_CLEAR(load, p, bitset->cardinality); + bitset->words[offset] = load; + return bitset->cardinality - oldcard; +} + +/* Remove `pos' from `bitset'. Returns true if `pos' was present. Might be + * slower than bitset_container_unset. */ +static inline bool bitset_container_remove(bitset_container_t *bitset, + uint16_t pos) { + uint64_t shift = 6; + uint64_t offset; + uint64_t p = pos; + ASM_SHIFT_RIGHT(p, shift, offset); + uint64_t load = bitset->words[offset]; + // could be possibly slightly further optimized + const int32_t oldcard = bitset->cardinality; + ASM_CLEAR_BIT_DEC_WAS_SET(load, p, bitset->cardinality); + bitset->words[offset] = load; + return oldcard - bitset->cardinality; +} + +/* Get the value of the ith bit. */ +inline bool bitset_container_get(const bitset_container_t *bitset, + uint16_t pos) { + uint64_t word = bitset->words[pos >> 6]; + const uint64_t p = pos; + ASM_INPLACESHIFT_RIGHT(word, p); + return word & 1; +} + +#else + +/* Set the ith bit. */ +static inline void bitset_container_set(bitset_container_t *bitset, + uint16_t pos) { + const uint64_t old_word = bitset->words[pos >> 6]; + const int index = pos & 63; + const uint64_t new_word = old_word | (UINT64_C(1) << index); + bitset->cardinality += (uint32_t)((old_word ^ new_word) >> index); + bitset->words[pos >> 6] = new_word; +} + +/* Unset the ith bit. */ +static inline void bitset_container_unset(bitset_container_t *bitset, + uint16_t pos) { + const uint64_t old_word = bitset->words[pos >> 6]; + const int index = pos & 63; + const uint64_t new_word = old_word & (~(UINT64_C(1) << index)); + bitset->cardinality -= (uint32_t)((old_word ^ new_word) >> index); + bitset->words[pos >> 6] = new_word; +} + +/* Add `pos' to `bitset'. Returns true if `pos' was not present. Might be slower + * than bitset_container_set. */ +static inline bool bitset_container_add(bitset_container_t *bitset, + uint16_t pos) { + const uint64_t old_word = bitset->words[pos >> 6]; + const int index = pos & 63; + const uint64_t new_word = old_word | (UINT64_C(1) << index); + const uint64_t increment = (old_word ^ new_word) >> index; + bitset->cardinality += (uint32_t)increment; + bitset->words[pos >> 6] = new_word; + return increment > 0; +} + +/* Remove `pos' from `bitset'. Returns true if `pos' was present. Might be + * slower than bitset_container_unset. */ +static inline bool bitset_container_remove(bitset_container_t *bitset, + uint16_t pos) { + const uint64_t old_word = bitset->words[pos >> 6]; + const int index = pos & 63; + const uint64_t new_word = old_word & (~(UINT64_C(1) << index)); + const uint64_t increment = (old_word ^ new_word) >> index; + bitset->cardinality -= (uint32_t)increment; + bitset->words[pos >> 6] = new_word; + return increment > 0; +} + +/* Get the value of the ith bit. */ +inline bool bitset_container_get(const bitset_container_t *bitset, + uint16_t pos) { + const uint64_t word = bitset->words[pos >> 6]; + return (word >> (pos & 63)) & 1; +} + +#endif + +/* +* Check if all bits are set in a range of positions from pos_start (included) to +* pos_end (excluded). +*/ +static inline bool bitset_container_get_range(const bitset_container_t *bitset, + uint32_t pos_start, uint32_t pos_end) { + + const uint32_t start = pos_start >> 6; + const uint32_t end = pos_end >> 6; + + const uint64_t first = ~((1ULL << (pos_start & 0x3F)) - 1); + const uint64_t last = (1ULL << (pos_end & 0x3F)) - 1; + + if (start == end) return ((bitset->words[end] & first & last) == (first & last)); + if ((bitset->words[start] & first) != first) return false; + + if ((end < BITSET_CONTAINER_SIZE_IN_WORDS) && ((bitset->words[end] & last) != last)){ + + return false; + } + + for (uint16_t i = start + 1; (i < BITSET_CONTAINER_SIZE_IN_WORDS) && (i < end); ++i){ + + if (bitset->words[i] != UINT64_C(0xFFFFFFFFFFFFFFFF)) return false; + } + + return true; +} + +/* Check whether `bitset' is present in `array'. Calls bitset_container_get. */ +inline bool bitset_container_contains(const bitset_container_t *bitset, + uint16_t pos) { + return bitset_container_get(bitset, pos); +} + +/* +* Check whether a range of bits from position `pos_start' (included) to `pos_end' (excluded) +* is present in `bitset'. Calls bitset_container_get_all. +*/ +static inline bool bitset_container_contains_range(const bitset_container_t *bitset, + uint32_t pos_start, uint32_t pos_end) { + return bitset_container_get_range(bitset, pos_start, pos_end); +} + +/* Get the number of bits set */ +static inline int bitset_container_cardinality( + const bitset_container_t *bitset) { + return bitset->cardinality; +} + + + + +/* Copy one container into another. We assume that they are distinct. */ +void bitset_container_copy(const bitset_container_t *source, + bitset_container_t *dest); + +/* Add all the values [min,max) at a distance k*step from min: min, + * min+step,.... */ +void bitset_container_add_from_range(bitset_container_t *bitset, uint32_t min, + uint32_t max, uint16_t step); + +/* Get the number of bits set (force computation). This does not modify bitset. + * To update the cardinality, you should do + * bitset->cardinality = bitset_container_compute_cardinality(bitset).*/ +int bitset_container_compute_cardinality(const bitset_container_t *bitset); + +/* Get whether there is at least one bit set (see bitset_container_empty for the reverse), + when the cardinality is unknown, it is computed and stored in the struct */ +static inline bool bitset_container_nonzero_cardinality( + bitset_container_t *bitset) { + // account for laziness + if (bitset->cardinality == BITSET_UNKNOWN_CARDINALITY) { + // could bail early instead with a nonzero result + bitset->cardinality = bitset_container_compute_cardinality(bitset); + } + return bitset->cardinality > 0; +} + +/* Check whether this bitset is empty (see bitset_container_nonzero_cardinality for the reverse), + * it never modifies the bitset struct. */ +static inline bool bitset_container_empty( + const bitset_container_t *bitset) { + if (bitset->cardinality == BITSET_UNKNOWN_CARDINALITY) { + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i ++) { + if((bitset->words[i]) != 0) return false; + } + return true; + } + return bitset->cardinality == 0; +} + + +/* Get whether there is at least one bit set (see bitset_container_empty for the reverse), + the bitset is never modified */ +static inline bool bitset_container_const_nonzero_cardinality( + const bitset_container_t *bitset) { + return !bitset_container_empty(bitset); +} + +/* + * Check whether the two bitsets intersect + */ +bool bitset_container_intersect(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the union of bitsets `src_1' and `src_2' into `dst' and return the + * cardinality. */ +int bitset_container_or(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the union of bitsets `src_1' and `src_2' and return the cardinality. + */ +int bitset_container_or_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the union of bitsets `src_1' and `src_2' into `dst' and return the + * cardinality. Same as bitset_container_or. */ +int bitset_container_union(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the union of bitsets `src_1' and `src_2' and return the + * cardinality. Same as bitset_container_or_justcard. */ +int bitset_container_union_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the union of bitsets `src_1' and `src_2' into `dst', but does not + * update the cardinality. Provided to optimize chained operations. */ +int bitset_container_or_nocard(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the intersection of bitsets `src_1' and `src_2' into `dst' and + * return the cardinality. */ +int bitset_container_and(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the intersection of bitsets `src_1' and `src_2' and return the + * cardinality. */ +int bitset_container_and_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the intersection of bitsets `src_1' and `src_2' into `dst' and + * return the cardinality. Same as bitset_container_and. */ +int bitset_container_intersection(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the intersection of bitsets `src_1' and `src_2' and return the + * cardinality. Same as bitset_container_and_justcard. */ +int bitset_container_intersection_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the intersection of bitsets `src_1' and `src_2' into `dst', but does + * not update the cardinality. Provided to optimize chained operations. */ +int bitset_container_and_nocard(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the exclusive or of bitsets `src_1' and `src_2' into `dst' and + * return the cardinality. */ +int bitset_container_xor(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the exclusive or of bitsets `src_1' and `src_2' and return the + * cardinality. */ +int bitset_container_xor_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the exclusive or of bitsets `src_1' and `src_2' into `dst', but does + * not update the cardinality. Provided to optimize chained operations. */ +int bitset_container_xor_nocard(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the and not of bitsets `src_1' and `src_2' into `dst' and return the + * cardinality. */ +int bitset_container_andnot(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Computes the and not of bitsets `src_1' and `src_2' and return the + * cardinality. */ +int bitset_container_andnot_justcard(const bitset_container_t *src_1, + const bitset_container_t *src_2); + +/* Computes the and not or of bitsets `src_1' and `src_2' into `dst', but does + * not update the cardinality. Provided to optimize chained operations. */ +int bitset_container_andnot_nocard(const bitset_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +void bitset_container_offset(const bitset_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset); +/* + * Write out the 16-bit integers contained in this container as a list of 32-bit + * integers using base + * as the starting value (it might be expected that base has zeros in its 16 + * least significant bits). + * The function returns the number of values written. + * The caller is responsible for allocating enough memory in out. + * The out pointer should point to enough memory (the cardinality times 32 + * bits). + */ +int bitset_container_to_uint32_array(uint32_t *out, + const bitset_container_t *bc, + uint32_t base); + +/* + * Print this container using printf (useful for debugging). + */ +void bitset_container_printf(const bitset_container_t *v); + +/* + * Print this container using printf as a comma-separated list of 32-bit + * integers starting at base. + */ +void bitset_container_printf_as_uint32_array(const bitset_container_t *v, + uint32_t base); + +/** + * Return the serialized size in bytes of a container. + */ +static inline int32_t bitset_container_serialized_size_in_bytes(void) { + return BITSET_CONTAINER_SIZE_IN_WORDS * 8; +} + +/** + * Return the the number of runs. + */ +int bitset_container_number_of_runs(bitset_container_t *bc); + +bool bitset_container_iterate(const bitset_container_t *cont, uint32_t base, + roaring_iterator iterator, void *ptr); +bool bitset_container_iterate64(const bitset_container_t *cont, uint32_t base, + roaring_iterator64 iterator, uint64_t high_bits, + void *ptr); + +/** + * Writes the underlying array to buf, outputs how many bytes were written. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes written should be + * bitset_container_size_in_bytes(container). + */ +int32_t bitset_container_write(const bitset_container_t *container, char *buf); + +/** + * Reads the instance from buf, outputs how many bytes were read. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes read should be bitset_container_size_in_bytes(container). + * You need to provide the (known) cardinality. + */ +int32_t bitset_container_read(int32_t cardinality, + bitset_container_t *container, const char *buf); +/** + * Return the serialized size in bytes of a container (see + * bitset_container_write). + * This is meant to be compatible with the Java and Go versions of Roaring and + * assumes + * that the cardinality of the container is already known or can be computed. + */ +static inline int32_t bitset_container_size_in_bytes( + const bitset_container_t *container) { + (void)container; + return BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); +} + +/** + * Return true if the two containers have the same content. + */ +bool bitset_container_equals(const bitset_container_t *container1, + const bitset_container_t *container2); + +/** +* Return true if container1 is a subset of container2. +*/ +bool bitset_container_is_subset(const bitset_container_t *container1, + const bitset_container_t *container2); + +/** + * If the element of given rank is in this container, supposing that the first + * element has rank start_rank, then the function returns true and sets element + * accordingly. + * Otherwise, it returns false and update start_rank. + */ +bool bitset_container_select(const bitset_container_t *container, + uint32_t *start_rank, uint32_t rank, + uint32_t *element); + +/* Returns the smallest value (assumes not empty) */ +uint16_t bitset_container_minimum(const bitset_container_t *container); + +/* Returns the largest value (assumes not empty) */ +uint16_t bitset_container_maximum(const bitset_container_t *container); + +/* Returns the number of values equal or smaller than x */ +int bitset_container_rank(const bitset_container_t *container, uint16_t x); + +/* Returns the index of the first value equal or larger than x, or -1 */ +int bitset_container_index_equalorlarger(const bitset_container_t *container, uint16_t x); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_BITSET_H_ */ +/* end file include/roaring/containers/bitset.h */ +/* begin file include/roaring/containers/run.h */ +/* + * run.h + * + */ + +#ifndef INCLUDE_CONTAINERS_RUN_H_ +#define INCLUDE_CONTAINERS_RUN_H_ + +#include +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { namespace roaring { + +// Note: in pure C++ code, you should avoid putting `using` in header files +using api::roaring_iterator; +using api::roaring_iterator64; + +namespace internal { +#endif + +/* struct rle16_s - run length pair + * + * @value: start position of the run + * @length: length of the run is `length + 1` + * + * An RLE pair {v, l} would represent the integers between the interval + * [v, v+l+1], e.g. {3, 2} = [3, 4, 5]. + */ +struct rle16_s { + uint16_t value; + uint16_t length; +}; + +typedef struct rle16_s rle16_t; + +#ifdef __cplusplus + #define MAKE_RLE16(val,len) \ + {(uint16_t)(val), (uint16_t)(len)} // no tagged structs until c++20 +#else + #define MAKE_RLE16(val,len) \ + (rle16_t){.value = (uint16_t)(val), .length = (uint16_t)(len)} +#endif + +/* struct run_container_s - run container bitmap + * + * @n_runs: number of rle_t pairs in `runs`. + * @capacity: capacity in rle_t pairs `runs` can hold. + * @runs: pairs of rle_t. + */ +STRUCT_CONTAINER(run_container_s) { + int32_t n_runs; + int32_t capacity; + rle16_t *runs; +}; + +typedef struct run_container_s run_container_t; + +#define CAST_run(c) CAST(run_container_t *, c) // safer downcast +#define const_CAST_run(c) CAST(const run_container_t *, c) +#define movable_CAST_run(c) movable_CAST(run_container_t **, c) + +/* Create a new run container. Return NULL in case of failure. */ +run_container_t *run_container_create(void); + +/* Create a new run container with given capacity. Return NULL in case of + * failure. */ +run_container_t *run_container_create_given_capacity(int32_t size); + +/* + * Shrink the capacity to the actual size, return the number of bytes saved. + */ +int run_container_shrink_to_fit(run_container_t *src); + +/* Free memory owned by `run'. */ +void run_container_free(run_container_t *run); + +/* Duplicate container */ +run_container_t *run_container_clone(const run_container_t *src); + +/* + * Effectively deletes the value at index index, repacking data. + */ +static inline void recoverRoomAtIndex(run_container_t *run, uint16_t index) { + memmove(run->runs + index, run->runs + (1 + index), + (run->n_runs - index - 1) * sizeof(rle16_t)); + run->n_runs--; +} + +/** + * Good old binary search through rle data + */ +inline int32_t interleavedBinarySearch(const rle16_t *array, int32_t lenarray, + uint16_t ikey) { + int32_t low = 0; + int32_t high = lenarray - 1; + while (low <= high) { + int32_t middleIndex = (low + high) >> 1; + uint16_t middleValue = array[middleIndex].value; + if (middleValue < ikey) { + low = middleIndex + 1; + } else if (middleValue > ikey) { + high = middleIndex - 1; + } else { + return middleIndex; + } + } + return -(low + 1); +} + +/* + * Returns index of the run which contains $ikey + */ +static inline int32_t rle16_find_run(const rle16_t *array, int32_t lenarray, + uint16_t ikey) { + int32_t low = 0; + int32_t high = lenarray - 1; + while (low <= high) { + int32_t middleIndex = (low + high) >> 1; + uint16_t min = array[middleIndex].value; + uint16_t max = array[middleIndex].value + array[middleIndex].length; + if (ikey > max) { + low = middleIndex + 1; + } else if (ikey < min) { + high = middleIndex - 1; + } else { + return middleIndex; + } + } + return -(low + 1); +} + + +/** + * Returns number of runs which can'be be merged with the key because they + * are less than the key. + * Note that [5,6,7,8] can be merged with the key 9 and won't be counted. + */ +static inline int32_t rle16_count_less(const rle16_t* array, int32_t lenarray, + uint16_t key) { + if (lenarray == 0) return 0; + int32_t low = 0; + int32_t high = lenarray - 1; + while (low <= high) { + int32_t middleIndex = (low + high) >> 1; + uint16_t min_value = array[middleIndex].value; + uint16_t max_value = array[middleIndex].value + array[middleIndex].length; + if (max_value + UINT32_C(1) < key) { // uint32 arithmetic + low = middleIndex + 1; + } else if (key < min_value) { + high = middleIndex - 1; + } else { + return middleIndex; + } + } + return low; +} + +static inline int32_t rle16_count_greater(const rle16_t* array, int32_t lenarray, + uint16_t key) { + if (lenarray == 0) return 0; + int32_t low = 0; + int32_t high = lenarray - 1; + while (low <= high) { + int32_t middleIndex = (low + high) >> 1; + uint16_t min_value = array[middleIndex].value; + uint16_t max_value = array[middleIndex].value + array[middleIndex].length; + if (max_value < key) { + low = middleIndex + 1; + } else if (key + UINT32_C(1) < min_value) { // uint32 arithmetic + high = middleIndex - 1; + } else { + return lenarray - (middleIndex + 1); + } + } + return lenarray - low; +} + +/** + * increase capacity to at least min. Whether the + * existing data needs to be copied over depends on copy. If "copy" is false, + * then the new content will be uninitialized, otherwise a copy is made. + */ +void run_container_grow(run_container_t *run, int32_t min, bool copy); + +/** + * Moves the data so that we can write data at index + */ +static inline void makeRoomAtIndex(run_container_t *run, uint16_t index) { + /* This function calls realloc + memmove sequentially to move by one index. + * Potentially copying twice the array. + */ + if (run->n_runs + 1 > run->capacity) + run_container_grow(run, run->n_runs + 1, true); + memmove(run->runs + 1 + index, run->runs + index, + (run->n_runs - index) * sizeof(rle16_t)); + run->n_runs++; +} + +/* Add `pos' to `run'. Returns true if `pos' was not present. */ +bool run_container_add(run_container_t *run, uint16_t pos); + +/* Remove `pos' from `run'. Returns true if `pos' was present. */ +static inline bool run_container_remove(run_container_t *run, uint16_t pos) { + int32_t index = interleavedBinarySearch(run->runs, run->n_runs, pos); + if (index >= 0) { + int32_t le = run->runs[index].length; + if (le == 0) { + recoverRoomAtIndex(run, (uint16_t)index); + } else { + run->runs[index].value++; + run->runs[index].length--; + } + return true; + } + index = -index - 2; // points to preceding value, possibly -1 + if (index >= 0) { // possible match + int32_t offset = pos - run->runs[index].value; + int32_t le = run->runs[index].length; + if (offset < le) { + // need to break in two + run->runs[index].length = (uint16_t)(offset - 1); + // need to insert + uint16_t newvalue = pos + 1; + int32_t newlength = le - offset - 1; + makeRoomAtIndex(run, (uint16_t)(index + 1)); + run->runs[index + 1].value = newvalue; + run->runs[index + 1].length = (uint16_t)newlength; + return true; + + } else if (offset == le) { + run->runs[index].length--; + return true; + } + } + // no match + return false; +} + +/* Check whether `pos' is present in `run'. */ +inline bool run_container_contains(const run_container_t *run, uint16_t pos) { + int32_t index = interleavedBinarySearch(run->runs, run->n_runs, pos); + if (index >= 0) return true; + index = -index - 2; // points to preceding value, possibly -1 + if (index != -1) { // possible match + int32_t offset = pos - run->runs[index].value; + int32_t le = run->runs[index].length; + if (offset <= le) return true; + } + return false; +} + +/* +* Check whether all positions in a range of positions from pos_start (included) +* to pos_end (excluded) is present in `run'. +*/ +static inline bool run_container_contains_range(const run_container_t *run, + uint32_t pos_start, uint32_t pos_end) { + uint32_t count = 0; + int32_t index = interleavedBinarySearch(run->runs, run->n_runs, pos_start); + if (index < 0) { + index = -index - 2; + if ((index == -1) || ((pos_start - run->runs[index].value) > run->runs[index].length)){ + return false; + } + } + for (int32_t i = index; i < run->n_runs; ++i) { + const uint32_t stop = run->runs[i].value + run->runs[i].length; + if (run->runs[i].value >= pos_end) break; + if (stop >= pos_end) { + count += (((pos_end - run->runs[i].value) > 0) ? (pos_end - run->runs[i].value) : 0); + break; + } + const uint32_t min = (stop - pos_start) > 0 ? (stop - pos_start) : 0; + count += (min < run->runs[i].length) ? min : run->runs[i].length; + } + return count >= (pos_end - pos_start - 1); +} + +/* Get the cardinality of `run'. Requires an actual computation. */ +int run_container_cardinality(const run_container_t *run); + +/* Card > 0?, see run_container_empty for the reverse */ +static inline bool run_container_nonzero_cardinality( + const run_container_t *run) { + return run->n_runs > 0; // runs never empty +} + +/* Card == 0?, see run_container_nonzero_cardinality for the reverse */ +static inline bool run_container_empty( + const run_container_t *run) { + return run->n_runs == 0; // runs never empty +} + + + +/* Copy one container into another. We assume that they are distinct. */ +void run_container_copy(const run_container_t *src, run_container_t *dst); + +/* Set the cardinality to zero (does not release memory). */ +static inline void run_container_clear(run_container_t *run) { + run->n_runs = 0; +} + +/** + * Append run described by vl to the run container, possibly merging. + * It is assumed that the run would be inserted at the end of the container, no + * check is made. + * It is assumed that the run container has the necessary capacity: caller is + * responsible for checking memory capacity. + * + * + * This is not a safe function, it is meant for performance: use with care. + */ +static inline void run_container_append(run_container_t *run, rle16_t vl, + rle16_t *previousrl) { + const uint32_t previousend = previousrl->value + previousrl->length; + if (vl.value > previousend + 1) { // we add a new one + run->runs[run->n_runs] = vl; + run->n_runs++; + *previousrl = vl; + } else { + uint32_t newend = vl.value + vl.length + UINT32_C(1); + if (newend > previousend) { // we merge + previousrl->length = (uint16_t)(newend - 1 - previousrl->value); + run->runs[run->n_runs - 1] = *previousrl; + } + } +} + +/** + * Like run_container_append but it is assumed that the content of run is empty. + */ +static inline rle16_t run_container_append_first(run_container_t *run, + rle16_t vl) { + run->runs[run->n_runs] = vl; + run->n_runs++; + return vl; +} + +/** + * append a single value given by val to the run container, possibly merging. + * It is assumed that the value would be inserted at the end of the container, + * no check is made. + * It is assumed that the run container has the necessary capacity: caller is + * responsible for checking memory capacity. + * + * This is not a safe function, it is meant for performance: use with care. + */ +static inline void run_container_append_value(run_container_t *run, + uint16_t val, + rle16_t *previousrl) { + const uint32_t previousend = previousrl->value + previousrl->length; + if (val > previousend + 1) { // we add a new one + *previousrl = MAKE_RLE16(val, 0); + run->runs[run->n_runs] = *previousrl; + run->n_runs++; + } else if (val == previousend + 1) { // we merge + previousrl->length++; + run->runs[run->n_runs - 1] = *previousrl; + } +} + +/** + * Like run_container_append_value but it is assumed that the content of run is + * empty. + */ +static inline rle16_t run_container_append_value_first(run_container_t *run, + uint16_t val) { + rle16_t newrle = MAKE_RLE16(val, 0); + run->runs[run->n_runs] = newrle; + run->n_runs++; + return newrle; +} + +/* Check whether the container spans the whole chunk (cardinality = 1<<16). + * This check can be done in constant time (inexpensive). */ +static inline bool run_container_is_full(const run_container_t *run) { + rle16_t vl = run->runs[0]; + return (run->n_runs == 1) && (vl.value == 0) && (vl.length == 0xFFFF); +} + +/* Compute the union of `src_1' and `src_2' and write the result to `dst' + * It is assumed that `dst' is distinct from both `src_1' and `src_2'. */ +void run_container_union(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst); + +/* Compute the union of `src_1' and `src_2' and write the result to `src_1' */ +void run_container_union_inplace(run_container_t *src_1, + const run_container_t *src_2); + +/* Compute the intersection of src_1 and src_2 and write the result to + * dst. It is assumed that dst is distinct from both src_1 and src_2. */ +void run_container_intersection(const run_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst); + +/* Compute the size of the intersection of src_1 and src_2 . */ +int run_container_intersection_cardinality(const run_container_t *src_1, + const run_container_t *src_2); + +/* Check whether src_1 and src_2 intersect. */ +bool run_container_intersect(const run_container_t *src_1, + const run_container_t *src_2); + +/* Compute the symmetric difference of `src_1' and `src_2' and write the result + * to `dst' + * It is assumed that `dst' is distinct from both `src_1' and `src_2'. */ +void run_container_xor(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst); + +/* + * Write out the 16-bit integers contained in this container as a list of 32-bit + * integers using base + * as the starting value (it might be expected that base has zeros in its 16 + * least significant bits). + * The function returns the number of values written. + * The caller is responsible for allocating enough memory in out. + */ +int run_container_to_uint32_array(void *vout, const run_container_t *cont, + uint32_t base); + +/* + * Print this container using printf (useful for debugging). + */ +void run_container_printf(const run_container_t *v); + +/* + * Print this container using printf as a comma-separated list of 32-bit + * integers starting at base. + */ +void run_container_printf_as_uint32_array(const run_container_t *v, + uint32_t base); + +/** + * Return the serialized size in bytes of a container having "num_runs" runs. + */ +static inline int32_t run_container_serialized_size_in_bytes(int32_t num_runs) { + return sizeof(uint16_t) + + sizeof(rle16_t) * num_runs; // each run requires 2 2-byte entries. +} + +bool run_container_iterate(const run_container_t *cont, uint32_t base, + roaring_iterator iterator, void *ptr); +bool run_container_iterate64(const run_container_t *cont, uint32_t base, + roaring_iterator64 iterator, uint64_t high_bits, + void *ptr); + +/** + * Writes the underlying array to buf, outputs how many bytes were written. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes written should be run_container_size_in_bytes(container). + */ +int32_t run_container_write(const run_container_t *container, char *buf); + +/** + * Reads the instance from buf, outputs how many bytes were read. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes read should be bitset_container_size_in_bytes(container). + * The cardinality parameter is provided for consistency with other containers, + * but + * it might be effectively ignored.. + */ +int32_t run_container_read(int32_t cardinality, run_container_t *container, + const char *buf); + +/** + * Return the serialized size in bytes of a container (see run_container_write). + * This is meant to be compatible with the Java and Go versions of Roaring. + */ +static inline int32_t run_container_size_in_bytes( + const run_container_t *container) { + return run_container_serialized_size_in_bytes(container->n_runs); +} + +/** + * Return true if the two containers have the same content. + */ +static inline bool run_container_equals(const run_container_t *container1, + const run_container_t *container2) { + if (container1->n_runs != container2->n_runs) { + return false; + } + return memequals(container1->runs, container2->runs, + container1->n_runs * sizeof(rle16_t)); +} + +/** +* Return true if container1 is a subset of container2. +*/ +bool run_container_is_subset(const run_container_t *container1, + const run_container_t *container2); + +/** + * Used in a start-finish scan that appends segments, for XOR and NOT + */ + +void run_container_smart_append_exclusive(run_container_t *src, + const uint16_t start, + const uint16_t length); + +/** +* The new container consists of a single run [start,stop). +* It is required that stop>start, the caller is responsability for this check. +* It is required that stop <= (1<<16), the caller is responsability for this check. +* The cardinality of the created container is stop - start. +* Returns NULL on failure +*/ +static inline run_container_t *run_container_create_range(uint32_t start, + uint32_t stop) { + run_container_t *rc = run_container_create_given_capacity(1); + if (rc) { + rle16_t r; + r.value = (uint16_t)start; + r.length = (uint16_t)(stop - start - 1); + run_container_append_first(rc, r); + } + return rc; +} + +/** + * If the element of given rank is in this container, supposing that the first + * element has rank start_rank, then the function returns true and sets element + * accordingly. + * Otherwise, it returns false and update start_rank. + */ +bool run_container_select(const run_container_t *container, + uint32_t *start_rank, uint32_t rank, + uint32_t *element); + +/* Compute the difference of src_1 and src_2 and write the result to + * dst. It is assumed that dst is distinct from both src_1 and src_2. */ + +void run_container_andnot(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst); + +void run_container_offset(const run_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset); + +/* Returns the smallest value (assumes not empty) */ +inline uint16_t run_container_minimum(const run_container_t *run) { + if (run->n_runs == 0) return 0; + return run->runs[0].value; +} + +/* Returns the largest value (assumes not empty) */ +inline uint16_t run_container_maximum(const run_container_t *run) { + if (run->n_runs == 0) return 0; + return run->runs[run->n_runs - 1].value + run->runs[run->n_runs - 1].length; +} + +/* Returns the number of values equal or smaller than x */ +int run_container_rank(const run_container_t *arr, uint16_t x); + +/* Returns the index of the first run containing a value at least as large as x, or -1 */ +inline int run_container_index_equalorlarger(const run_container_t *arr, uint16_t x) { + int32_t index = interleavedBinarySearch(arr->runs, arr->n_runs, x); + if (index >= 0) return index; + index = -index - 2; // points to preceding run, possibly -1 + if (index != -1) { // possible match + int32_t offset = x - arr->runs[index].value; + int32_t le = arr->runs[index].length; + if (offset <= le) return index; + } + index += 1; + if(index < arr->n_runs) { + return index; + } + return -1; +} + +/* + * Add all values in range [min, max] using hint. + */ +static inline void run_container_add_range_nruns(run_container_t* run, + uint32_t min, uint32_t max, + int32_t nruns_less, + int32_t nruns_greater) { + int32_t nruns_common = run->n_runs - nruns_less - nruns_greater; + if (nruns_common == 0) { + makeRoomAtIndex(run, nruns_less); + run->runs[nruns_less].value = min; + run->runs[nruns_less].length = max - min; + } else { + uint32_t common_min = run->runs[nruns_less].value; + uint32_t common_max = run->runs[nruns_less + nruns_common - 1].value + + run->runs[nruns_less + nruns_common - 1].length; + uint32_t result_min = (common_min < min) ? common_min : min; + uint32_t result_max = (common_max > max) ? common_max : max; + + run->runs[nruns_less].value = result_min; + run->runs[nruns_less].length = result_max - result_min; + + memmove(&(run->runs[nruns_less + 1]), + &(run->runs[run->n_runs - nruns_greater]), + nruns_greater*sizeof(rle16_t)); + run->n_runs = nruns_less + 1 + nruns_greater; + } +} + +/** + * Add all values in range [min, max] + */ +static inline void run_container_add_range(run_container_t* run, + uint32_t min, uint32_t max) { + int32_t nruns_greater = rle16_count_greater(run->runs, run->n_runs, max); + int32_t nruns_less = rle16_count_less(run->runs, run->n_runs - nruns_greater, min); + run_container_add_range_nruns(run, min, max, nruns_less, nruns_greater); +} + +/** + * Shifts last $count elements either left (distance < 0) or right (distance > 0) + */ +static inline void run_container_shift_tail(run_container_t* run, + int32_t count, int32_t distance) { + if (distance > 0) { + if (run->capacity < count+distance) { + run_container_grow(run, count+distance, true); + } + } + int32_t srcpos = run->n_runs - count; + int32_t dstpos = srcpos + distance; + memmove(&(run->runs[dstpos]), &(run->runs[srcpos]), sizeof(rle16_t) * count); + run->n_runs += distance; +} + +/** + * Remove all elements in range [min, max] + */ +static inline void run_container_remove_range(run_container_t *run, uint32_t min, uint32_t max) { + int32_t first = rle16_find_run(run->runs, run->n_runs, min); + int32_t last = rle16_find_run(run->runs, run->n_runs, max); + + if (first >= 0 && min > run->runs[first].value && + max < ((uint32_t)run->runs[first].value + (uint32_t)run->runs[first].length)) { + // split this run into two adjacent runs + + // right subinterval + makeRoomAtIndex(run, first+1); + run->runs[first+1].value = max + 1; + run->runs[first+1].length = (run->runs[first].value + run->runs[first].length) - (max + 1); + + // left subinterval + run->runs[first].length = (min - 1) - run->runs[first].value; + + return; + } + + // update left-most partial run + if (first >= 0) { + if (min > run->runs[first].value) { + run->runs[first].length = (min - 1) - run->runs[first].value; + first++; + } + } else { + first = -first-1; + } + + // update right-most run + if (last >= 0) { + uint16_t run_max = run->runs[last].value + run->runs[last].length; + if (run_max > max) { + run->runs[last].value = max + 1; + run->runs[last].length = run_max - (max + 1); + last--; + } + } else { + last = (-last-1) - 1; + } + + // remove intermediate runs + if (first <= last) { + run_container_shift_tail(run, run->n_runs - (last+1), -(last-first+1)); + } +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_RUN_H_ */ +/* end file include/roaring/containers/run.h */ +/* begin file include/roaring/containers/convert.h */ +/* + * convert.h + * + */ + +#ifndef INCLUDE_CONTAINERS_CONVERT_H_ +#define INCLUDE_CONTAINERS_CONVERT_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Convert an array into a bitset. The input container is not freed or modified. + */ +bitset_container_t *bitset_container_from_array(const array_container_t *arr); + +/* Convert a run into a bitset. The input container is not freed or modified. */ +bitset_container_t *bitset_container_from_run(const run_container_t *arr); + +/* Convert a run into an array. The input container is not freed or modified. */ +array_container_t *array_container_from_run(const run_container_t *arr); + +/* Convert a bitset into an array. The input container is not freed or modified. + */ +array_container_t *array_container_from_bitset(const bitset_container_t *bits); + +/* Convert an array into a run. The input container is not freed or modified. + */ +run_container_t *run_container_from_array(const array_container_t *c); + +/* convert a run into either an array or a bitset + * might free the container. This does not free the input run container. */ +container_t *convert_to_bitset_or_array_container( + run_container_t *rc, int32_t card, + uint8_t *resulttype); + +/* convert containers to and from runcontainers, as is most space efficient. + * The container might be freed. */ +container_t *convert_run_optimize( + container_t *c, uint8_t typecode_original, + uint8_t *typecode_after); + +/* converts a run container to either an array or a bitset, IF it saves space. + */ +/* If a conversion occurs, the caller is responsible to free the original + * container and + * he becomes reponsible to free the new one. */ +container_t *convert_run_to_efficient_container( + run_container_t *c, uint8_t *typecode_after); + +// like convert_run_to_efficient_container but frees the old result if needed +container_t *convert_run_to_efficient_container_and_free( + run_container_t *c, uint8_t *typecode_after); + +/** + * Create new container which is a union of run container and + * range [min, max]. Caller is responsible for freeing run container. + */ +container_t *container_from_run_range( + const run_container_t *run, + uint32_t min, uint32_t max, + uint8_t *typecode_after); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_CONVERT_H_ */ +/* end file include/roaring/containers/convert.h */ +/* begin file include/roaring/containers/mixed_equal.h */ +/* + * mixed_equal.h + * + */ + +#ifndef CONTAINERS_MIXED_EQUAL_H_ +#define CONTAINERS_MIXED_EQUAL_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/** + * Return true if the two containers have the same content. + */ +bool array_container_equal_bitset(const array_container_t* container1, + const bitset_container_t* container2); + +/** + * Return true if the two containers have the same content. + */ +bool run_container_equals_array(const run_container_t* container1, + const array_container_t* container2); +/** + * Return true if the two containers have the same content. + */ +bool run_container_equals_bitset(const run_container_t* container1, + const bitset_container_t* container2); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* CONTAINERS_MIXED_EQUAL_H_ */ +/* end file include/roaring/containers/mixed_equal.h */ +/* begin file include/roaring/containers/mixed_subset.h */ +/* + * mixed_subset.h + * + */ + +#ifndef CONTAINERS_MIXED_SUBSET_H_ +#define CONTAINERS_MIXED_SUBSET_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/** + * Return true if container1 is a subset of container2. + */ +bool array_container_is_subset_bitset(const array_container_t* container1, + const bitset_container_t* container2); + +/** +* Return true if container1 is a subset of container2. + */ +bool run_container_is_subset_array(const run_container_t* container1, + const array_container_t* container2); + +/** +* Return true if container1 is a subset of container2. + */ +bool array_container_is_subset_run(const array_container_t* container1, + const run_container_t* container2); + +/** +* Return true if container1 is a subset of container2. + */ +bool run_container_is_subset_bitset(const run_container_t* container1, + const bitset_container_t* container2); + +/** +* Return true if container1 is a subset of container2. +*/ +bool bitset_container_is_subset_run(const bitset_container_t* container1, + const run_container_t* container2); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* CONTAINERS_MIXED_SUBSET_H_ */ +/* end file include/roaring/containers/mixed_subset.h */ +/* begin file include/roaring/containers/mixed_andnot.h */ +/* + * mixed_andnot.h + */ +#ifndef INCLUDE_CONTAINERS_MIXED_ANDNOT_H_ +#define INCLUDE_CONTAINERS_MIXED_ANDNOT_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst, a valid array container that could be the same as dst.*/ +void array_bitset_container_andnot(const array_container_t *src_1, + const bitset_container_t *src_2, + array_container_t *dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * src_1 */ + +void array_bitset_container_iandnot(array_container_t *src_1, + const bitset_container_t *src_2); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst, which does not initially have a valid container. + * Return true for a bitset result; false for array + */ + +bool bitset_array_container_andnot( + const bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_array_container_iandnot( + bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_andnot( + const run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_iandnot( + run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool bitset_run_container_andnot( + const bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_run_container_iandnot( + bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* dst does not indicate a valid container initially. Eventually it + * can become any type of container. + */ + +int run_array_container_andnot( + const run_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +int run_array_container_iandnot( + run_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* dst must be a valid array container, allowed to be src_1 */ + +void array_run_container_andnot(const array_container_t *src_1, + const run_container_t *src_2, + array_container_t *dst); + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +void array_run_container_iandnot(array_container_t *src_1, + const run_container_t *src_2); + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int run_run_container_andnot( + const run_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +int run_run_container_iandnot( + run_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* + * dst is a valid array container and may be the same as src_1 + */ + +void array_array_container_andnot(const array_container_t *src_1, + const array_container_t *src_2, + array_container_t *dst); + +/* inplace array-array andnot will always be able to reuse the space of + * src_1 */ +void array_array_container_iandnot(array_container_t *src_1, + const array_container_t *src_2); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). Return value is + * "dst is a bitset" + */ + +bool bitset_bitset_container_andnot( + const bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_bitset_container_iandnot( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif +/* end file include/roaring/containers/mixed_andnot.h */ +/* begin file include/roaring/containers/mixed_intersection.h */ +/* + * mixed_intersection.h + * + */ + +#ifndef INCLUDE_CONTAINERS_MIXED_INTERSECTION_H_ +#define INCLUDE_CONTAINERS_MIXED_INTERSECTION_H_ + +/* These functions appear to exclude cases where the + * inputs have the same type and the output is guaranteed + * to have the same type as the inputs. Eg, array intersection + */ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the intersection of src_1 and src_2 and write the result to + * dst. It is allowed for dst to be equal to src_1. We assume that dst is a + * valid container. */ +void array_bitset_container_intersection(const array_container_t *src_1, + const bitset_container_t *src_2, + array_container_t *dst); + +/* Compute the size of the intersection of src_1 and src_2. */ +int array_bitset_container_intersection_cardinality( + const array_container_t *src_1, const bitset_container_t *src_2); + + + +/* Checking whether src_1 and src_2 intersect. */ +bool array_bitset_container_intersect(const array_container_t *src_1, + const bitset_container_t *src_2); + +/* + * Compute the intersection between src_1 and src_2 and write the result + * to *dst. If the return function is true, the result is a bitset_container_t + * otherwise is a array_container_t. We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool bitset_bitset_container_intersection(const bitset_container_t *src_1, + const bitset_container_t *src_2, + container_t **dst); + +/* Compute the intersection between src_1 and src_2 and write the result to + * dst. It is allowed for dst to be equal to src_1. We assume that dst is a + * valid container. */ +void array_run_container_intersection(const array_container_t *src_1, + const run_container_t *src_2, + array_container_t *dst); + +/* Compute the intersection between src_1 and src_2 and write the result to + * *dst. If the result is true then the result is a bitset_container_t + * otherwise is a array_container_t. + * If *dst == src_2, then an in-place intersection is attempted + **/ +bool run_bitset_container_intersection(const run_container_t *src_1, + const bitset_container_t *src_2, + container_t **dst); + +/* Compute the size of the intersection between src_1 and src_2 . */ +int array_run_container_intersection_cardinality(const array_container_t *src_1, + const run_container_t *src_2); + +/* Compute the size of the intersection between src_1 and src_2 + **/ +int run_bitset_container_intersection_cardinality(const run_container_t *src_1, + const bitset_container_t *src_2); + + +/* Check that src_1 and src_2 intersect. */ +bool array_run_container_intersect(const array_container_t *src_1, + const run_container_t *src_2); + +/* Check that src_1 and src_2 intersect. + **/ +bool run_bitset_container_intersect(const run_container_t *src_1, + const bitset_container_t *src_2); + +/* + * Same as bitset_bitset_container_intersection except that if the output is to + * be a + * bitset_container_t, then src_1 is modified and no allocation is made. + * If the output is to be an array_container_t, then caller is responsible + * to free the container. + * In all cases, the result is in *dst. + */ +bool bitset_bitset_container_intersection_inplace( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_MIXED_INTERSECTION_H_ */ +/* end file include/roaring/containers/mixed_intersection.h */ +/* begin file include/roaring/containers/mixed_negation.h */ +/* + * mixed_negation.h + * + */ + +#ifndef INCLUDE_CONTAINERS_MIXED_NEGATION_H_ +#define INCLUDE_CONTAINERS_MIXED_NEGATION_H_ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Negation across the entire range of the container. + * Compute the negation of src and write the result + * to *dst. The complement of a + * sufficiently sparse set will always be dense and a hence a bitmap + * We assume that dst is pre-allocated and a valid bitset container + * There can be no in-place version. + */ +void array_container_negation(const array_container_t *src, + bitset_container_t *dst); + +/* Negation across the entire range of the container + * Compute the negation of src and write the result + * to *dst. A true return value indicates a bitset result, + * otherwise the result is an array container. + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool bitset_container_negation( + const bitset_container_t *src, + container_t **dst); + +/* inplace version */ +/* + * Same as bitset_container_negation except that if the output is to + * be a + * bitset_container_t, then src is modified and no allocation is made. + * If the output is to be an array_container_t, then caller is responsible + * to free the container. + * In all cases, the result is in *dst. + */ +bool bitset_container_negation_inplace( + bitset_container_t *src, + container_t **dst); + +/* Negation across the entire range of container + * Compute the negation of src and write the result + * to *dst. + * Return values are the *_TYPECODES as defined * in containers.h + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +int run_container_negation(const run_container_t *src, container_t **dst); + +/* + * Same as run_container_negation except that if the output is to + * be a + * run_container_t, and has the capacity to hold the result, + * then src is modified and no allocation is made. + * In all cases, the result is in *dst. + */ +int run_container_negation_inplace(run_container_t *src, container_t **dst); + +/* Negation across a range of the container. + * Compute the negation of src and write the result + * to *dst. Returns true if the result is a bitset container + * and false for an array container. *dst is not preallocated. + */ +bool array_container_negation_range( + const array_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +/* Even when the result would fit, it is unclear how to make an + * inplace version without inefficient copying. Thus this routine + * may be a wrapper for the non-in-place version + */ +bool array_container_negation_range_inplace( + array_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +/* Negation across a range of the container + * Compute the negation of src and write the result + * to *dst. A true return value indicates a bitset result, + * otherwise the result is an array container. + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool bitset_container_negation_range( + const bitset_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +/* inplace version */ +/* + * Same as bitset_container_negation except that if the output is to + * be a + * bitset_container_t, then src is modified and no allocation is made. + * If the output is to be an array_container_t, then caller is responsible + * to free the container. + * In all cases, the result is in *dst. + */ +bool bitset_container_negation_range_inplace( + bitset_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +/* Negation across a range of container + * Compute the negation of src and write the result + * to *dst. Return values are the *_TYPECODES as defined * in containers.h + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +int run_container_negation_range( + const run_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +/* + * Same as run_container_negation except that if the output is to + * be a + * run_container_t, and has the capacity to hold the result, + * then src is modified and no allocation is made. + * In all cases, the result is in *dst. + */ +int run_container_negation_range_inplace( + run_container_t *src, + const int range_start, const int range_end, + container_t **dst); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_MIXED_NEGATION_H_ */ +/* end file include/roaring/containers/mixed_negation.h */ +/* begin file include/roaring/containers/mixed_union.h */ +/* + * mixed_intersection.h + * + */ + +#ifndef INCLUDE_CONTAINERS_MIXED_UNION_H_ +#define INCLUDE_CONTAINERS_MIXED_UNION_H_ + +/* These functions appear to exclude cases where the + * inputs have the same type and the output is guaranteed + * to have the same type as the inputs. Eg, bitset unions + */ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the union of src_1 and src_2 and write the result to + * dst. It is allowed for src_2 to be dst. */ +void array_bitset_container_union(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Compute the union of src_1 and src_2 and write the result to + * dst. It is allowed for src_2 to be dst. This version does not + * update the cardinality of dst (it is set to BITSET_UNKNOWN_CARDINALITY). */ +void array_bitset_container_lazy_union(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* + * Compute the union between src_1 and src_2 and write the result + * to *dst. If the return function is true, the result is a bitset_container_t + * otherwise is a array_container_t. We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool array_array_container_union( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* + * Compute the union between src_1 and src_2 and write the result + * to *dst if it cannot be written to src_1. If the return function is true, + * the result is a bitset_container_t + * otherwise is a array_container_t. When the result is an array_container_t, it + * it either written to src_1 (if *dst is null) or to *dst. + * If the result is a bitset_container_t and *dst is null, then there was a failure. + */ +bool array_array_container_inplace_union( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* + * Same as array_array_container_union except that it will more eagerly produce + * a bitset. + */ +bool array_array_container_lazy_union( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* + * Same as array_array_container_inplace_union except that it will more eagerly produce + * a bitset. + */ +bool array_array_container_lazy_inplace_union( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* Compute the union of src_1 and src_2 and write the result to + * dst. We assume that dst is a + * valid container. The result might need to be further converted to array or + * bitset container, + * the caller is responsible for the eventual conversion. */ +void array_run_container_union(const array_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst); + +/* Compute the union of src_1 and src_2 and write the result to + * src2. The result might need to be further converted to array or + * bitset container, + * the caller is responsible for the eventual conversion. */ +void array_run_container_inplace_union(const array_container_t *src_1, + run_container_t *src_2); + +/* Compute the union of src_1 and src_2 and write the result to + * dst. It is allowed for dst to be src_2. + * If run_container_is_full(src_1) is true, you must not be calling this + *function. + **/ +void run_bitset_container_union(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* Compute the union of src_1 and src_2 and write the result to + * dst. It is allowed for dst to be src_2. This version does not + * update the cardinality of dst (it is set to BITSET_UNKNOWN_CARDINALITY). + * If run_container_is_full(src_1) is true, you must not be calling this + * function. + * */ +void run_bitset_container_lazy_union(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif /* INCLUDE_CONTAINERS_MIXED_UNION_H_ */ +/* end file include/roaring/containers/mixed_union.h */ +/* begin file include/roaring/containers/mixed_xor.h */ +/* + * mixed_xor.h + * + */ + +#ifndef INCLUDE_CONTAINERS_MIXED_XOR_H_ +#define INCLUDE_CONTAINERS_MIXED_XOR_H_ + +/* These functions appear to exclude cases where the + * inputs have the same type and the output is guaranteed + * to have the same type as the inputs. Eg, bitset unions + */ + +/* + * Java implementation (as of May 2016) for array_run, run_run + * and bitset_run don't do anything different for inplace. + * (They are not truly in place.) + */ + + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). + * Result is true iff dst is a bitset */ +bool array_bitset_container_xor( + const array_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. It is allowed for src_2 to be dst. This version does not + * update the cardinality of dst (it is set to BITSET_UNKNOWN_CARDINALITY). + */ + +void array_bitset_container_lazy_xor(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). Return value is + * "dst is a bitset" + */ + +bool bitset_bitset_container_xor( + const bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_xor( + const run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* lazy xor. Dst is initialized and may be equal to src_2. + * Result is left as a bitset container, even if actual + * cardinality would dictate an array container. + */ + +void run_bitset_container_lazy_xor(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst); + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int array_run_container_xor( + const array_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* dst does not initially have a valid container. Creates either + * an array or a bitset container, indicated by return code + */ + +bool array_array_container_xor( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* dst does not initially have a valid container. Creates either + * an array or a bitset container, indicated by return code. + * A bitset container will not have a valid cardinality and the + * container type might not be correct for the actual cardinality + */ + +bool array_array_container_lazy_xor( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +/* Dst is a valid run container. (Can it be src_2? Let's say not.) + * Leaves result as run container, even if other options are + * smaller. + */ + +void array_run_container_lazy_xor(const array_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst); + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int run_run_container_xor( + const run_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* INPLACE versions (initial implementation may not exploit all inplace + * opportunities (if any...) + */ + +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_array_container_ixor( + bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +bool bitset_bitset_container_ixor( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +bool array_bitset_container_ixor( + array_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_ixor( + run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst); + +bool bitset_run_container_ixor( + bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int array_run_container_ixor( + array_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +int run_array_container_ixor( + run_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +bool array_array_container_ixor( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst); + +int run_run_container_ixor( + run_container_t *src_1, const run_container_t *src_2, + container_t **dst); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif +/* end file include/roaring/containers/mixed_xor.h */ +/* begin file include/roaring/containers/containers.h */ +#ifndef CONTAINERS_CONTAINERS_H +#define CONTAINERS_CONTAINERS_H + +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +// would enum be possible or better? + +/** + * The switch case statements follow + * BITSET_CONTAINER_TYPE -- ARRAY_CONTAINER_TYPE -- RUN_CONTAINER_TYPE + * so it makes more sense to number them 1, 2, 3 (in the vague hope that the + * compiler might exploit this ordering). + */ + +#define BITSET_CONTAINER_TYPE 1 +#define ARRAY_CONTAINER_TYPE 2 +#define RUN_CONTAINER_TYPE 3 +#define SHARED_CONTAINER_TYPE 4 + +/** + * Macros for pairing container type codes, suitable for switch statements. + * Use PAIR_CONTAINER_TYPES() for the switch, CONTAINER_PAIR() for the cases: + * + * switch (PAIR_CONTAINER_TYPES(type1, type2)) { + * case CONTAINER_PAIR(BITSET,ARRAY): + * ... + * } + */ +#define PAIR_CONTAINER_TYPES(type1,type2) \ + (4 * (type1) + (type2)) + +#define CONTAINER_PAIR(name1,name2) \ + (4 * (name1##_CONTAINER_TYPE) + (name2##_CONTAINER_TYPE)) + +/** + * A shared container is a wrapper around a container + * with reference counting. + */ + +STRUCT_CONTAINER(shared_container_s) { + container_t *container; + uint8_t typecode; + uint32_t counter; // to be managed atomically +}; + +typedef struct shared_container_s shared_container_t; + +#define CAST_shared(c) CAST(shared_container_t *, c) // safer downcast +#define const_CAST_shared(c) CAST(const shared_container_t *, c) +#define movable_CAST_shared(c) movable_CAST(shared_container_t **, c) + +/* + * With copy_on_write = true + * Create a new shared container if the typecode is not SHARED_CONTAINER_TYPE, + * otherwise, increase the count + * If copy_on_write = false, then clone. + * Return NULL in case of failure. + **/ +container_t *get_copy_of_container(container_t *container, uint8_t *typecode, + bool copy_on_write); + +/* Frees a shared container (actually decrement its counter and only frees when + * the counter falls to zero). */ +void shared_container_free(shared_container_t *container); + +/* extract a copy from the shared container, freeing the shared container if +there is just one instance left, +clone instances when the counter is higher than one +*/ +container_t *shared_container_extract_copy(shared_container_t *container, + uint8_t *typecode); + +/* access to container underneath */ +static inline const container_t *container_unwrap_shared( + const container_t *candidate_shared_container, uint8_t *type +){ + if (*type == SHARED_CONTAINER_TYPE) { + *type = const_CAST_shared(candidate_shared_container)->typecode; + assert(*type != SHARED_CONTAINER_TYPE); + return const_CAST_shared(candidate_shared_container)->container; + } else { + return candidate_shared_container; + } +} + + +/* access to container underneath */ +static inline container_t *container_mutable_unwrap_shared( + container_t *c, uint8_t *type +) { + if (*type == SHARED_CONTAINER_TYPE) { // the passed in container is shared + *type = CAST_shared(c)->typecode; + assert(*type != SHARED_CONTAINER_TYPE); + return CAST_shared(c)->container; // return the enclosed container + } else { + return c; // wasn't shared, so return as-is + } +} + +/* access to container underneath and queries its type */ +static inline uint8_t get_container_type( + const container_t *c, uint8_t type +){ + if (type == SHARED_CONTAINER_TYPE) { + return const_CAST_shared(c)->typecode; + } else { + return type; + } +} + +/** + * Copies a container, requires a typecode. This allocates new memory, caller + * is responsible for deallocation. If the container is not shared, then it is + * physically cloned. Sharable containers are not cloneable. + */ +container_t *container_clone(const container_t *container, uint8_t typecode); + +/* access to container underneath, cloning it if needed */ +static inline container_t *get_writable_copy_if_shared( + container_t *c, uint8_t *type +){ + if (*type == SHARED_CONTAINER_TYPE) { // shared, return enclosed container + return shared_container_extract_copy(CAST_shared(c), type); + } else { + return c; // not shared, so return as-is + } +} + +/** + * End of shared container code + */ + +static const char *container_names[] = {"bitset", "array", "run", "shared"}; +static const char *shared_container_names[] = { + "bitset (shared)", "array (shared)", "run (shared)"}; + +// no matter what the initial container was, convert it to a bitset +// if a new container is produced, caller responsible for freeing the previous +// one +// container should not be a shared container +static inline bitset_container_t *container_to_bitset( + container_t *c, uint8_t typecode +){ + bitset_container_t *result = NULL; + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return CAST_bitset(c); // nothing to do + case ARRAY_CONTAINER_TYPE: + result = bitset_container_from_array(CAST_array(c)); + return result; + case RUN_CONTAINER_TYPE: + result = bitset_container_from_run(CAST_run(c)); + return result; + case SHARED_CONTAINER_TYPE: + assert(false); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * Get the container name from the typecode + * (unused at time of writing) + */ +static inline const char *get_container_name(uint8_t typecode) { + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return container_names[0]; + case ARRAY_CONTAINER_TYPE: + return container_names[1]; + case RUN_CONTAINER_TYPE: + return container_names[2]; + case SHARED_CONTAINER_TYPE: + return container_names[3]; + default: + assert(false); + __builtin_unreachable(); + return "unknown"; + } +} + +static inline const char *get_full_container_name( + const container_t *c, uint8_t typecode +){ + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return container_names[0]; + case ARRAY_CONTAINER_TYPE: + return container_names[1]; + case RUN_CONTAINER_TYPE: + return container_names[2]; + case SHARED_CONTAINER_TYPE: + switch (const_CAST_shared(c)->typecode) { + case BITSET_CONTAINER_TYPE: + return shared_container_names[0]; + case ARRAY_CONTAINER_TYPE: + return shared_container_names[1]; + case RUN_CONTAINER_TYPE: + return shared_container_names[2]; + default: + assert(false); + __builtin_unreachable(); + return "unknown"; + } + break; + default: + assert(false); + __builtin_unreachable(); + return "unknown"; + } + __builtin_unreachable(); + return NULL; +} + +/** + * Get the container cardinality (number of elements), requires a typecode + */ +static inline int container_get_cardinality( + const container_t *c, uint8_t typecode +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_cardinality(const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_cardinality(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_cardinality(const_CAST_run(c)); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + + + +// returns true if a container is known to be full. Note that a lazy bitset +// container +// might be full without us knowing +static inline bool container_is_full(const container_t *c, uint8_t typecode) { + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_cardinality( + const_CAST_bitset(c)) == (1 << 16); + case ARRAY_CONTAINER_TYPE: + return array_container_cardinality( + const_CAST_array(c)) == (1 << 16); + case RUN_CONTAINER_TYPE: + return run_container_is_full(const_CAST_run(c)); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +static inline int container_shrink_to_fit( + container_t *c, uint8_t type +){ + c = container_mutable_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return 0; // no shrinking possible + case ARRAY_CONTAINER_TYPE: + return array_container_shrink_to_fit(CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_shrink_to_fit(CAST_run(c)); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + + +/** + * make a container with a run of ones + */ +/* initially always use a run container, even if an array might be + * marginally + * smaller */ +static inline container_t *container_range_of_ones( + uint32_t range_start, uint32_t range_end, + uint8_t *result_type +){ + assert(range_end >= range_start); + uint64_t cardinality = range_end - range_start + 1; + if(cardinality <= 2) { + *result_type = ARRAY_CONTAINER_TYPE; + return array_container_create_range(range_start, range_end); + } else { + *result_type = RUN_CONTAINER_TYPE; + return run_container_create_range(range_start, range_end); + } +} + + +/* Create a container with all the values between in [min,max) at a + distance k*step from min. */ +static inline container_t *container_from_range( + uint8_t *type, uint32_t min, + uint32_t max, uint16_t step +){ + if (step == 0) return NULL; // being paranoid + if (step == 1) { + return container_range_of_ones(min,max,type); + // Note: the result is not always a run (need to check the cardinality) + //*type = RUN_CONTAINER_TYPE; + //return run_container_create_range(min, max); + } + int size = (max - min + step - 1) / step; + if (size <= DEFAULT_MAX_SIZE) { // array container + *type = ARRAY_CONTAINER_TYPE; + array_container_t *array = array_container_create_given_capacity(size); + array_container_add_from_range(array, min, max, step); + assert(array->cardinality == size); + return array; + } else { // bitset container + *type = BITSET_CONTAINER_TYPE; + bitset_container_t *bitset = bitset_container_create(); + bitset_container_add_from_range(bitset, min, max, step); + assert(bitset->cardinality == size); + return bitset; + } +} + +/** + * "repair" the container after lazy operations. + */ +static inline container_t *container_repair_after_lazy( + container_t *c, uint8_t *type +){ + c = get_writable_copy_if_shared(c, type); // !!! unnecessary cloning + container_t *result = NULL; + switch (*type) { + case BITSET_CONTAINER_TYPE: { + bitset_container_t *bc = CAST_bitset(c); + bc->cardinality = bitset_container_compute_cardinality(bc); + if (bc->cardinality <= DEFAULT_MAX_SIZE) { + result = array_container_from_bitset(bc); + bitset_container_free(bc); + *type = ARRAY_CONTAINER_TYPE; + return result; + } + return c; } + case ARRAY_CONTAINER_TYPE: + return c; // nothing to do + case RUN_CONTAINER_TYPE: + return convert_run_to_efficient_container_and_free( + CAST_run(c), type); + case SHARED_CONTAINER_TYPE: + assert(false); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * Writes the underlying array to buf, outputs how many bytes were written. + * This is meant to be byte-by-byte compatible with the Java and Go versions of + * Roaring. + * The number of bytes written should be + * container_write(container, buf). + * + */ +static inline int32_t container_write( + const container_t *c, uint8_t typecode, + char *buf +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_write(const_CAST_bitset(c), buf); + case ARRAY_CONTAINER_TYPE: + return array_container_write(const_CAST_array(c), buf); + case RUN_CONTAINER_TYPE: + return run_container_write(const_CAST_run(c), buf); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * Get the container size in bytes under portable serialization (see + * container_write), requires a + * typecode + */ +static inline int32_t container_size_in_bytes( + const container_t *c, uint8_t typecode +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_size_in_bytes(const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_size_in_bytes(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_size_in_bytes(const_CAST_run(c)); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * print the container (useful for debugging), requires a typecode + */ +void container_printf(const container_t *container, uint8_t typecode); + +/** + * print the content of the container as a comma-separated list of 32-bit values + * starting at base, requires a typecode + */ +void container_printf_as_uint32_array(const container_t *container, + uint8_t typecode, uint32_t base); + +/** + * Checks whether a container is not empty, requires a typecode + */ +static inline bool container_nonzero_cardinality( + const container_t *c, uint8_t typecode +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_const_nonzero_cardinality( + const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_nonzero_cardinality(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_nonzero_cardinality(const_CAST_run(c)); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * Recover memory from a container, requires a typecode + */ +void container_free(container_t *container, uint8_t typecode); + +/** + * Convert a container to an array of values, requires a typecode as well as a + * "base" (most significant values) + * Returns number of ints added. + */ +static inline int container_to_uint32_array( + uint32_t *output, + const container_t *c, uint8_t typecode, + uint32_t base +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_to_uint32_array( + output, const_CAST_bitset(c), base); + case ARRAY_CONTAINER_TYPE: + return array_container_to_uint32_array( + output, const_CAST_array(c), base); + case RUN_CONTAINER_TYPE: + return run_container_to_uint32_array( + output, const_CAST_run(c), base); + } + assert(false); + __builtin_unreachable(); + return 0; // unreached +} + +/** + * Add a value to a container, requires a typecode, fills in new_typecode and + * return (possibly different) container. + * This function may allocate a new container, and caller is responsible for + * memory deallocation + */ +static inline container_t *container_add( + container_t *c, uint16_t val, + uint8_t typecode, // !!! should be second argument? + uint8_t *new_typecode +){ + c = get_writable_copy_if_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + bitset_container_set(CAST_bitset(c), val); + *new_typecode = BITSET_CONTAINER_TYPE; + return c; + case ARRAY_CONTAINER_TYPE: { + array_container_t *ac = CAST_array(c); + if (array_container_try_add(ac, val, DEFAULT_MAX_SIZE) != -1) { + *new_typecode = ARRAY_CONTAINER_TYPE; + return ac; + } else { + bitset_container_t* bitset = bitset_container_from_array(ac); + bitset_container_add(bitset, val); + *new_typecode = BITSET_CONTAINER_TYPE; + return bitset; + } + } break; + case RUN_CONTAINER_TYPE: + // per Java, no container type adjustments are done (revisit?) + run_container_add(CAST_run(c), val); + *new_typecode = RUN_CONTAINER_TYPE; + return c; + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Remove a value from a container, requires a typecode, fills in new_typecode + * and + * return (possibly different) container. + * This function may allocate a new container, and caller is responsible for + * memory deallocation + */ +static inline container_t *container_remove( + container_t *c, uint16_t val, + uint8_t typecode, // !!! should be second argument? + uint8_t *new_typecode +){ + c = get_writable_copy_if_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + if (bitset_container_remove(CAST_bitset(c), val)) { + int card = bitset_container_cardinality(CAST_bitset(c)); + if (card <= DEFAULT_MAX_SIZE) { + *new_typecode = ARRAY_CONTAINER_TYPE; + return array_container_from_bitset(CAST_bitset(c)); + } + } + *new_typecode = typecode; + return c; + case ARRAY_CONTAINER_TYPE: + *new_typecode = typecode; + array_container_remove(CAST_array(c), val); + return c; + case RUN_CONTAINER_TYPE: + // per Java, no container type adjustments are done (revisit?) + run_container_remove(CAST_run(c), val); + *new_typecode = RUN_CONTAINER_TYPE; + return c; + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Check whether a value is in a container, requires a typecode + */ +static inline bool container_contains( + const container_t *c, + uint16_t val, + uint8_t typecode // !!! should be second argument? +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_get(const_CAST_bitset(c), val); + case ARRAY_CONTAINER_TYPE: + return array_container_contains(const_CAST_array(c), val); + case RUN_CONTAINER_TYPE: + return run_container_contains(const_CAST_run(c), val); + default: + assert(false); + __builtin_unreachable(); + return false; + } +} + +/** + * Check whether a range of values from range_start (included) to range_end (excluded) + * is in a container, requires a typecode + */ +static inline bool container_contains_range( + const container_t *c, + uint32_t range_start, uint32_t range_end, + uint8_t typecode // !!! should be second argument? +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_get_range(const_CAST_bitset(c), + range_start, range_end); + case ARRAY_CONTAINER_TYPE: + return array_container_contains_range(const_CAST_array(c), + range_start, range_end); + case RUN_CONTAINER_TYPE: + return run_container_contains_range(const_CAST_run(c), + range_start, range_end); + default: + assert(false); + __builtin_unreachable(); + return false; + } +} + +/** + * Returns true if the two containers have the same content. Note that + * two containers having different types can be "equal" in this sense. + */ +static inline bool container_equals( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2 +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + return bitset_container_equals(const_CAST_bitset(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,RUN): + return run_container_equals_bitset(const_CAST_run(c2), + const_CAST_bitset(c1)); + + case CONTAINER_PAIR(RUN,BITSET): + return run_container_equals_bitset(const_CAST_run(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,ARRAY): + // java would always return false? + return array_container_equal_bitset(const_CAST_array(c2), + const_CAST_bitset(c1)); + + case CONTAINER_PAIR(ARRAY,BITSET): + // java would always return false? + return array_container_equal_bitset(const_CAST_array(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,RUN): + return run_container_equals_array(const_CAST_run(c2), + const_CAST_array(c1)); + + case CONTAINER_PAIR(RUN,ARRAY): + return run_container_equals_array(const_CAST_run(c1), + const_CAST_array(c2)); + + case CONTAINER_PAIR(ARRAY,ARRAY): + return array_container_equals(const_CAST_array(c1), + const_CAST_array(c2)); + + case CONTAINER_PAIR(RUN,RUN): + return run_container_equals(const_CAST_run(c1), + const_CAST_run(c2)); + + default: + assert(false); + __builtin_unreachable(); + return false; + } +} + +/** + * Returns true if the container c1 is a subset of the container c2. Note that + * c1 can be a subset of c2 even if they have a different type. + */ +static inline bool container_is_subset( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2 +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + return bitset_container_is_subset(const_CAST_bitset(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,RUN): + return bitset_container_is_subset_run(const_CAST_bitset(c1), + const_CAST_run(c2)); + + case CONTAINER_PAIR(RUN,BITSET): + return run_container_is_subset_bitset(const_CAST_run(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,ARRAY): + return false; // by construction, size(c1) > size(c2) + + case CONTAINER_PAIR(ARRAY,BITSET): + return array_container_is_subset_bitset(const_CAST_array(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,RUN): + return array_container_is_subset_run(const_CAST_array(c1), + const_CAST_run(c2)); + + case CONTAINER_PAIR(RUN,ARRAY): + return run_container_is_subset_array(const_CAST_run(c1), + const_CAST_array(c2)); + + case CONTAINER_PAIR(ARRAY,ARRAY): + return array_container_is_subset(const_CAST_array(c1), + const_CAST_array(c2)); + + case CONTAINER_PAIR(RUN,RUN): + return run_container_is_subset(const_CAST_run(c1), + const_CAST_run(c2)); + + default: + assert(false); + __builtin_unreachable(); + return false; + } +} + +// macro-izations possibilities for generic non-inplace binary-op dispatch + +/** + * Compute intersection between two containers, generate a new container (having + * type result_type), requires a typecode. This allocates new memory, caller + * is responsible for deallocation. + */ +static inline container_t *container_and( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = bitset_bitset_container_intersection( + const_CAST_bitset(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + result = array_container_create(); + array_container_intersection(const_CAST_array(c1), + const_CAST_array(c2), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + return result; + + case CONTAINER_PAIR(RUN,RUN): + result = run_container_create(); + run_container_intersection(const_CAST_run(c1), + const_CAST_run(c2), + CAST_run(result)); + return convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + + case CONTAINER_PAIR(BITSET,ARRAY): + result = array_container_create(); + array_bitset_container_intersection(const_CAST_array(c2), + const_CAST_bitset(c1), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_bitset_container_intersection(const_CAST_array(c1), + const_CAST_bitset(c2), + CAST_array(result)); + return result; + + case CONTAINER_PAIR(BITSET,RUN): + *result_type = run_bitset_container_intersection( + const_CAST_run(c2), + const_CAST_bitset(c1), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_intersection( + const_CAST_run(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_run_container_intersection(const_CAST_array(c1), + const_CAST_run(c2), + CAST_array(result)); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_run_container_intersection(const_CAST_array(c2), + const_CAST_run(c1), + CAST_array(result)); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Compute the size of the intersection between two containers. + */ +static inline int container_and_cardinality( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2 +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + return bitset_container_and_justcard( + const_CAST_bitset(c1), const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,ARRAY): + return array_container_intersection_cardinality( + const_CAST_array(c1), const_CAST_array(c2)); + + case CONTAINER_PAIR(RUN,RUN): + return run_container_intersection_cardinality( + const_CAST_run(c1), const_CAST_run(c2)); + + case CONTAINER_PAIR(BITSET,ARRAY): + return array_bitset_container_intersection_cardinality( + const_CAST_array(c2), const_CAST_bitset(c1)); + + case CONTAINER_PAIR(ARRAY,BITSET): + return array_bitset_container_intersection_cardinality( + const_CAST_array(c1), const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,RUN): + return run_bitset_container_intersection_cardinality( + const_CAST_run(c2), const_CAST_bitset(c1)); + + case CONTAINER_PAIR(RUN,BITSET): + return run_bitset_container_intersection_cardinality( + const_CAST_run(c1), const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,RUN): + return array_run_container_intersection_cardinality( + const_CAST_array(c1), const_CAST_run(c2)); + + case CONTAINER_PAIR(RUN,ARRAY): + return array_run_container_intersection_cardinality( + const_CAST_array(c2), const_CAST_run(c1)); + + default: + assert(false); + __builtin_unreachable(); + return 0; + } +} + +/** + * Check whether two containers intersect. + */ +static inline bool container_intersect( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2 +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + return bitset_container_intersect(const_CAST_bitset(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,ARRAY): + return array_container_intersect(const_CAST_array(c1), + const_CAST_array(c2)); + + case CONTAINER_PAIR(RUN,RUN): + return run_container_intersect(const_CAST_run(c1), + const_CAST_run(c2)); + + case CONTAINER_PAIR(BITSET,ARRAY): + return array_bitset_container_intersect(const_CAST_array(c2), + const_CAST_bitset(c1)); + + case CONTAINER_PAIR(ARRAY,BITSET): + return array_bitset_container_intersect(const_CAST_array(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(BITSET,RUN): + return run_bitset_container_intersect(const_CAST_run(c2), + const_CAST_bitset(c1)); + + case CONTAINER_PAIR(RUN,BITSET): + return run_bitset_container_intersect(const_CAST_run(c1), + const_CAST_bitset(c2)); + + case CONTAINER_PAIR(ARRAY,RUN): + return array_run_container_intersect(const_CAST_array(c1), + const_CAST_run(c2)); + + case CONTAINER_PAIR(RUN,ARRAY): + return array_run_container_intersect(const_CAST_array(c2), + const_CAST_run(c1)); + + default: + assert(false); + __builtin_unreachable(); + return 0; + } +} + +/** + * Compute intersection between two containers, with result in the first + container if possible. If the returned pointer is identical to c1, + then the container has been modified. If the returned pointer is different + from c1, then a new container has been created and the caller is responsible + for freeing it. + The type of the first container may change. Returns the modified + (and possibly new) container. +*/ +static inline container_t *container_iand( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = get_writable_copy_if_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = + bitset_bitset_container_intersection_inplace( + CAST_bitset(c1), const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + array_container_intersection_inplace(CAST_array(c1), + const_CAST_array(c2)); + *result_type = ARRAY_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(RUN,RUN): + result = run_container_create(); + run_container_intersection(const_CAST_run(c1), + const_CAST_run(c2), + CAST_run(result)); + // as of January 2016, Java code used non-in-place intersection for + // two runcontainers + return convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + + case CONTAINER_PAIR(BITSET,ARRAY): + // c1 is a bitmap so no inplace possible + result = array_container_create(); + array_bitset_container_intersection(const_CAST_array(c2), + const_CAST_bitset(c1), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_bitset_container_intersection( + const_CAST_array(c1), const_CAST_bitset(c2), + CAST_array(c1)); // result is allowed to be same as c1 + return c1; + + case CONTAINER_PAIR(BITSET,RUN): + // will attempt in-place computation + *result_type = run_bitset_container_intersection( + const_CAST_run(c2), + const_CAST_bitset(c1), &c1) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_intersection( + const_CAST_run(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_run_container_intersection(const_CAST_array(c1), + const_CAST_run(c2), + CAST_array(result)); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; // never bitset + array_run_container_intersection(const_CAST_array(c2), + const_CAST_run(c1), + CAST_array(result)); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Compute union between two containers, generate a new container (having type + * result_type), requires a typecode. This allocates new memory, caller + * is responsible for deallocation. + */ +static inline container_t *container_or( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + result = bitset_container_create(); + bitset_container_or(const_CAST_bitset(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_union( + const_CAST_array(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + result = run_container_create(); + run_container_union(const_CAST_run(c1), + const_CAST_run(c2), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // todo: could be optimized since will never convert to array + result = convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + result = bitset_container_create(); + array_bitset_container_union(const_CAST_array(c2), + const_CAST_bitset(c1), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + result = bitset_container_create(); + array_bitset_container_union(const_CAST_array(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(BITSET,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c2), + CAST_run(result)); + return result; + } + result = bitset_container_create(); + run_bitset_container_union(const_CAST_run(c2), + const_CAST_bitset(c1), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + if (run_container_is_full(const_CAST_run(c1))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c1), + CAST_run(result)); + return result; + } + result = bitset_container_create(); + run_bitset_container_union(const_CAST_run(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = run_container_create(); + array_run_container_union(const_CAST_array(c1), + const_CAST_run(c2), + CAST_run(result)); + result = convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + result = run_container_create(); + array_run_container_union(const_CAST_array(c2), + const_CAST_run(c1), + CAST_run(result)); + result = convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; // unreached + } +} + +/** + * Compute union between two containers, generate a new container (having type + * result_type), requires a typecode. This allocates new memory, caller + * is responsible for deallocation. + * + * This lazy version delays some operations such as the maintenance of the + * cardinality. It requires repair later on the generated containers. + */ +static inline container_t *container_lazy_or( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + result = bitset_container_create(); + bitset_container_or_nocard( + const_CAST_bitset(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_lazy_union( + const_CAST_array(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + result = run_container_create(); + run_container_union(const_CAST_run(c1), + const_CAST_run(c2), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // we are being lazy + result = convert_run_to_efficient_container( + CAST_run(result), result_type); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + result = bitset_container_create(); + array_bitset_container_lazy_union( + const_CAST_array(c2), const_CAST_bitset(c1), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + result = bitset_container_create(); + array_bitset_container_lazy_union( + const_CAST_array(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(BITSET,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c2), CAST_run(result)); + return result; + } + result = bitset_container_create(); + run_bitset_container_lazy_union( + const_CAST_run(c2), const_CAST_bitset(c1), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + if (run_container_is_full(const_CAST_run(c1))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c1), CAST_run(result)); + return result; + } + result = bitset_container_create(); + run_bitset_container_lazy_union( + const_CAST_run(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = run_container_create(); + array_run_container_union(const_CAST_array(c1), + const_CAST_run(c2), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container(result, result_type); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + result = run_container_create(); + array_run_container_union( + const_CAST_array(c2), const_CAST_run(c1), + CAST_run(result)); // TODO make lazy + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container(result, result_type); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; // unreached + } +} + +/** + * Compute the union between two containers, with result in the first container. + * If the returned pointer is identical to c1, then the container has been + * modified. + * If the returned pointer is different from c1, then a new container has been + * created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container +*/ +static inline container_t *container_ior( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = get_writable_copy_if_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + bitset_container_or(const_CAST_bitset(c1), + const_CAST_bitset(c2), + CAST_bitset(c1)); +#ifdef OR_BITSET_CONVERSION_TO_FULL + if (CAST_bitset(c1)->cardinality == (1 << 16)) { // we convert + result = run_container_create_range(0, (1 << 16)); + *result_type = RUN_CONTAINER_TYPE; + return result; + } +#endif + *result_type = BITSET_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_inplace_union( + CAST_array(c1), const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + if((result == NULL) + && (*result_type == ARRAY_CONTAINER_TYPE)) { + return c1; // the computation was done in-place! + } + return result; + + case CONTAINER_PAIR(RUN,RUN): + run_container_union_inplace(CAST_run(c1), const_CAST_run(c2)); + return convert_run_to_efficient_container(CAST_run(c1), + result_type); + + case CONTAINER_PAIR(BITSET,ARRAY): + array_bitset_container_union(const_CAST_array(c2), + const_CAST_bitset(c1), + CAST_bitset(c1)); + *result_type = BITSET_CONTAINER_TYPE; // never array + return c1; + + case CONTAINER_PAIR(ARRAY,BITSET): + // c1 is an array, so no in-place possible + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_bitset_container_union(const_CAST_array(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + return result; + + case CONTAINER_PAIR(BITSET,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c2), CAST_run(result)); + return result; + } + run_bitset_container_union(const_CAST_run(c2), + const_CAST_bitset(c1), + CAST_bitset(c1)); // allowed + *result_type = BITSET_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(RUN,BITSET): + if (run_container_is_full(const_CAST_run(c1))) { + *result_type = RUN_CONTAINER_TYPE; + return c1; + } + result = bitset_container_create(); + run_bitset_container_union(const_CAST_run(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = run_container_create(); + array_run_container_union(const_CAST_array(c1), + const_CAST_run(c2), + CAST_run(result)); + result = convert_run_to_efficient_container_and_free( + CAST_run(result), result_type); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + array_run_container_inplace_union(const_CAST_array(c2), + CAST_run(c1)); + c1 = convert_run_to_efficient_container(CAST_run(c1), + result_type); + return c1; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Compute the union between two containers, with result in the first container. + * If the returned pointer is identical to c1, then the container has been + * modified. + * If the returned pointer is different from c1, then a new container has been + * created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container + * + * This lazy version delays some operations such as the maintenance of the + * cardinality. It requires repair later on the generated containers. +*/ +static inline container_t *container_lazy_ior( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + assert(type1 != SHARED_CONTAINER_TYPE); + // c1 = get_writable_copy_if_shared(c1,&type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): +#ifdef LAZY_OR_BITSET_CONVERSION_TO_FULL + // if we have two bitsets, we might as well compute the cardinality + bitset_container_or(const_CAST_bitset(c1), + const_CAST_bitset(c2), + CAST_bitset(c1)); + // it is possible that two bitsets can lead to a full container + if (CAST_bitset(c1)->cardinality == (1 << 16)) { // we convert + result = run_container_create_range(0, (1 << 16)); + *result_type = RUN_CONTAINER_TYPE; + return result; + } +#else + bitset_container_or_nocard(const_CAST_bitset(c1), + const_CAST_bitset(c2), + CAST_bitset(c1)); + +#endif + *result_type = BITSET_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_lazy_inplace_union( + CAST_array(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + if((result == NULL) + && (*result_type == ARRAY_CONTAINER_TYPE)) { + return c1; // the computation was done in-place! + } + return result; + + case CONTAINER_PAIR(RUN,RUN): + run_container_union_inplace(CAST_run(c1), + const_CAST_run(c2)); + *result_type = RUN_CONTAINER_TYPE; + return convert_run_to_efficient_container(CAST_run(c1), + result_type); + + case CONTAINER_PAIR(BITSET,ARRAY): + array_bitset_container_lazy_union( + const_CAST_array(c2), const_CAST_bitset(c1), + CAST_bitset(c1)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; // never array + return c1; + + case CONTAINER_PAIR(ARRAY,BITSET): + // c1 is an array, so no in-place possible + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_bitset_container_lazy_union( + const_CAST_array(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // is lazy + return result; + + case CONTAINER_PAIR(BITSET,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = run_container_create(); + *result_type = RUN_CONTAINER_TYPE; + run_container_copy(const_CAST_run(c2), + CAST_run(result)); + return result; + } + run_bitset_container_lazy_union( + const_CAST_run(c2), const_CAST_bitset(c1), + CAST_bitset(c1)); // allowed // lazy + *result_type = BITSET_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(RUN,BITSET): + if (run_container_is_full(const_CAST_run(c1))) { + *result_type = RUN_CONTAINER_TYPE; + return c1; + } + result = bitset_container_create(); + run_bitset_container_lazy_union( + const_CAST_run(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = run_container_create(); + array_run_container_union(const_CAST_array(c1), + const_CAST_run(c2), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container_and_free(result, + // result_type); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + array_run_container_inplace_union(const_CAST_array(c2), + CAST_run(c1)); + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container_and_free(result, + // result_type); + return c1; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Compute symmetric difference (xor) between two containers, generate a new + * container (having type result_type), requires a typecode. This allocates new + * memory, caller is responsible for deallocation. + */ +static inline container_t* container_xor( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = bitset_bitset_container_xor( + const_CAST_bitset(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_xor( + const_CAST_array(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + *result_type = + run_run_container_xor(const_CAST_run(c1), + const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + *result_type = array_bitset_container_xor( + const_CAST_array(c2), + const_CAST_bitset(c1), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + *result_type = array_bitset_container_xor( + const_CAST_array(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(BITSET,RUN): + *result_type = run_bitset_container_xor( + const_CAST_run(c2), + const_CAST_bitset(c1), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_xor( + const_CAST_run(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + *result_type = + array_run_container_xor(const_CAST_array(c1), + const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + *result_type = + array_run_container_xor(const_CAST_array(c2), + const_CAST_run(c1), &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; // unreached + } +} + +/* Applies an offset to the non-empty container 'c'. + * The results are stored in new containers returned via 'lo' and 'hi', for the + * low and high halves of the result (where the low half matches the original key + * and the high one corresponds to values for the following key). + * Either one of 'lo' and 'hi' are allowed to be 'NULL', but not both. + * Whenever one of them is not 'NULL', it should point to a 'NULL' container. + * Whenever one of them is 'NULL' the shifted elements for that part will not be + * computed. + * If either of the resulting containers turns out to be empty, the pointed + * container will remain 'NULL'. + */ +static inline void container_add_offset(const container_t *c, uint8_t type, + container_t **lo, container_t **hi, + uint16_t offset) { + assert(offset != 0); + assert(container_nonzero_cardinality(c, type)); + assert(lo != NULL || hi != NULL); + assert(lo == NULL || *lo == NULL); + assert(hi == NULL || *hi == NULL); + + switch (type) { + case BITSET_CONTAINER_TYPE: + bitset_container_offset(const_CAST_bitset(c), lo, hi, offset); + break; + case ARRAY_CONTAINER_TYPE: + array_container_offset(const_CAST_array(c), lo, hi, offset); + break; + case RUN_CONTAINER_TYPE: + run_container_offset(const_CAST_run(c), lo, hi, offset); + break; + default: + assert(false); + __builtin_unreachable(); + break; + } +} + +/** + * Compute xor between two containers, generate a new container (having type + * result_type), requires a typecode. This allocates new memory, caller + * is responsible for deallocation. + * + * This lazy version delays some operations such as the maintenance of the + * cardinality. It requires repair later on the generated containers. + */ +static inline container_t *container_lazy_xor( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + result = bitset_container_create(); + bitset_container_xor_nocard( + const_CAST_bitset(c1), const_CAST_bitset(c2), + CAST_bitset(result)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_lazy_xor( + const_CAST_array(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + // nothing special done yet. + *result_type = + run_run_container_xor(const_CAST_run(c1), + const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_bitset_container_lazy_xor(const_CAST_array(c2), + const_CAST_bitset(c1), + CAST_bitset(result)); + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_bitset_container_lazy_xor(const_CAST_array(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + return result; + + case CONTAINER_PAIR(BITSET,RUN): + result = bitset_container_create(); + run_bitset_container_lazy_xor(const_CAST_run(c2), + const_CAST_bitset(c1), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + result = bitset_container_create(); + run_bitset_container_lazy_xor(const_CAST_run(c1), + const_CAST_bitset(c2), + CAST_bitset(result)); + *result_type = BITSET_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + result = run_container_create(); + array_run_container_lazy_xor(const_CAST_array(c1), + const_CAST_run(c2), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container(result, result_type); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + result = run_container_create(); + array_run_container_lazy_xor(const_CAST_array(c2), + const_CAST_run(c1), + CAST_run(result)); + *result_type = RUN_CONTAINER_TYPE; + // next line skipped since we are lazy + // result = convert_run_to_efficient_container(result, result_type); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; // unreached + } +} + +/** + * Compute the xor between two containers, with result in the first container. + * If the returned pointer is identical to c1, then the container has been + * modified. + * If the returned pointer is different from c1, then a new container has been + * created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container +*/ +static inline container_t *container_ixor( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = get_writable_copy_if_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = bitset_bitset_container_ixor( + CAST_bitset(c1), const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + *result_type = array_array_container_ixor( + CAST_array(c1), const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + *result_type = run_run_container_ixor( + CAST_run(c1), const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + *result_type = bitset_array_container_ixor( + CAST_bitset(c1), const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + *result_type = array_bitset_container_ixor( + CAST_array(c1), const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(BITSET,RUN): + *result_type = + bitset_run_container_ixor( + CAST_bitset(c1), const_CAST_run(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + + return result; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_ixor( + CAST_run(c1), const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + *result_type = array_run_container_ixor( + CAST_array(c1), const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + *result_type = run_array_container_ixor( + CAST_run(c1), const_CAST_array(c2), &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Compute the xor between two containers, with result in the first container. + * If the returned pointer is identical to c1, then the container has been + * modified. + * If the returned pointer is different from c1, then a new container has been + * created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container + * + * This lazy version delays some operations such as the maintenance of the + * cardinality. It requires repair later on the generated containers. +*/ +static inline container_t *container_lazy_ixor( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + assert(type1 != SHARED_CONTAINER_TYPE); + // c1 = get_writable_copy_if_shared(c1,&type1); + c2 = container_unwrap_shared(c2, &type2); + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + bitset_container_xor_nocard(CAST_bitset(c1), + const_CAST_bitset(c2), + CAST_bitset(c1)); // is lazy + *result_type = BITSET_CONTAINER_TYPE; + return c1; + + // TODO: other cases being lazy, esp. when we know inplace not likely + // could see the corresponding code for union + default: + // we may have a dirty bitset (without a precomputed cardinality) + // and calling container_ixor on it might be unsafe. + if (type1 == BITSET_CONTAINER_TYPE) { + bitset_container_t *bc = CAST_bitset(c1); + if (bc->cardinality == BITSET_UNKNOWN_CARDINALITY) { + bc->cardinality = bitset_container_compute_cardinality(bc); + } + } + return container_ixor(c1, type1, c2, type2, result_type); + } +} + +/** + * Compute difference (andnot) between two containers, generate a new + * container (having type result_type), requires a typecode. This allocates new + * memory, caller is responsible for deallocation. + */ +static inline container_t *container_andnot( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = container_unwrap_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = bitset_bitset_container_andnot( + const_CAST_bitset(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + result = array_container_create(); + array_array_container_andnot(const_CAST_array(c1), + const_CAST_array(c2), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + } + *result_type = + run_run_container_andnot(const_CAST_run(c1), + const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + *result_type = bitset_array_container_andnot( + const_CAST_bitset(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + result = array_container_create(); + array_bitset_container_andnot(const_CAST_array(c1), + const_CAST_bitset(c2), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(BITSET,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + } + *result_type = bitset_run_container_andnot( + const_CAST_bitset(c1), + const_CAST_run(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_andnot( + const_CAST_run(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + if (run_container_is_full(const_CAST_run(c2))) { + result = array_container_create(); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + } + result = array_container_create(); + array_run_container_andnot(const_CAST_array(c1), + const_CAST_run(c2), + CAST_array(result)); + *result_type = ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,ARRAY): + *result_type = run_array_container_andnot( + const_CAST_run(c1), const_CAST_array(c2), + &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; // unreached + } +} + +/** + * Compute the andnot between two containers, with result in the first + * container. + * If the returned pointer is identical to c1, then the container has been + * modified. + * If the returned pointer is different from c1, then a new container has been + * created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container +*/ +static inline container_t *container_iandnot( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type +){ + c1 = get_writable_copy_if_shared(c1, &type1); + c2 = container_unwrap_shared(c2, &type2); + container_t *result = NULL; + switch (PAIR_CONTAINER_TYPES(type1, type2)) { + case CONTAINER_PAIR(BITSET,BITSET): + *result_type = bitset_bitset_container_iandnot( + CAST_bitset(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,ARRAY): + array_array_container_iandnot(CAST_array(c1), + const_CAST_array(c2)); + *result_type = ARRAY_CONTAINER_TYPE; + return c1; + + case CONTAINER_PAIR(RUN,RUN): + *result_type = run_run_container_iandnot( + CAST_run(c1), const_CAST_run(c2), &result); + return result; + + case CONTAINER_PAIR(BITSET,ARRAY): + *result_type = bitset_array_container_iandnot( + CAST_bitset(c1), + const_CAST_array(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,BITSET): + *result_type = ARRAY_CONTAINER_TYPE; + array_bitset_container_iandnot(CAST_array(c1), + const_CAST_bitset(c2)); + return c1; + + case CONTAINER_PAIR(BITSET,RUN): + *result_type = bitset_run_container_iandnot( + CAST_bitset(c1), + const_CAST_run(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(RUN,BITSET): + *result_type = run_bitset_container_iandnot( + CAST_run(c1), + const_CAST_bitset(c2), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + + case CONTAINER_PAIR(ARRAY,RUN): + *result_type = ARRAY_CONTAINER_TYPE; + array_run_container_iandnot(CAST_array(c1), + const_CAST_run(c2)); + return c1; + + case CONTAINER_PAIR(RUN,ARRAY): + *result_type = run_array_container_iandnot( + CAST_run(c1), const_CAST_array(c2), &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +/** + * Visit all values x of the container once, passing (base+x,ptr) + * to iterator. You need to specify a container and its type. + * Returns true if the iteration should continue. + */ +static inline bool container_iterate( + const container_t *c, uint8_t type, + uint32_t base, + roaring_iterator iterator, void *ptr +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_iterate(const_CAST_bitset(c), + base, iterator, ptr); + case ARRAY_CONTAINER_TYPE: + return array_container_iterate(const_CAST_array(c), + base, iterator, ptr); + case RUN_CONTAINER_TYPE: + return run_container_iterate(const_CAST_run(c), + base, iterator, ptr); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +static inline bool container_iterate64( + const container_t *c, uint8_t type, + uint32_t base, + roaring_iterator64 iterator, + uint64_t high_bits, void *ptr +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_iterate64(const_CAST_bitset(c), base, + iterator, high_bits, ptr); + case ARRAY_CONTAINER_TYPE: + return array_container_iterate64(const_CAST_array(c), base, + iterator, high_bits, ptr); + case RUN_CONTAINER_TYPE: + return run_container_iterate64(const_CAST_run(c), base, + iterator, high_bits, ptr); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +static inline container_t *container_not( + const container_t *c, uint8_t type, + uint8_t *result_type +){ + c = container_unwrap_shared(c, &type); + container_t *result = NULL; + switch (type) { + case BITSET_CONTAINER_TYPE: + *result_type = bitset_container_negation( + const_CAST_bitset(c), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case ARRAY_CONTAINER_TYPE: + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_container_negation(const_CAST_array(c), + CAST_bitset(result)); + return result; + case RUN_CONTAINER_TYPE: + *result_type = + run_container_negation(const_CAST_run(c), &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return NULL; +} + +static inline container_t *container_not_range( + const container_t *c, uint8_t type, + uint32_t range_start, uint32_t range_end, + uint8_t *result_type +){ + c = container_unwrap_shared(c, &type); + container_t *result = NULL; + switch (type) { + case BITSET_CONTAINER_TYPE: + *result_type = + bitset_container_negation_range( + const_CAST_bitset(c), range_start, range_end, &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case ARRAY_CONTAINER_TYPE: + *result_type = + array_container_negation_range( + const_CAST_array(c), range_start, range_end, &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case RUN_CONTAINER_TYPE: + *result_type = run_container_negation_range( + const_CAST_run(c), range_start, range_end, &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return NULL; +} + +static inline container_t *container_inot( + container_t *c, uint8_t type, + uint8_t *result_type +){ + c = get_writable_copy_if_shared(c, &type); + container_t *result = NULL; + switch (type) { + case BITSET_CONTAINER_TYPE: + *result_type = bitset_container_negation_inplace( + CAST_bitset(c), &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case ARRAY_CONTAINER_TYPE: + // will never be inplace + result = bitset_container_create(); + *result_type = BITSET_CONTAINER_TYPE; + array_container_negation(CAST_array(c), + CAST_bitset(result)); + array_container_free(CAST_array(c)); + return result; + case RUN_CONTAINER_TYPE: + *result_type = + run_container_negation_inplace(CAST_run(c), &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return NULL; +} + +static inline container_t *container_inot_range( + container_t *c, uint8_t type, + uint32_t range_start, uint32_t range_end, + uint8_t *result_type +){ + c = get_writable_copy_if_shared(c, &type); + container_t *result = NULL; + switch (type) { + case BITSET_CONTAINER_TYPE: + *result_type = + bitset_container_negation_range_inplace( + CAST_bitset(c), range_start, range_end, &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case ARRAY_CONTAINER_TYPE: + *result_type = + array_container_negation_range_inplace( + CAST_array(c), range_start, range_end, &result) + ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + return result; + case RUN_CONTAINER_TYPE: + *result_type = run_container_negation_range_inplace( + CAST_run(c), range_start, range_end, &result); + return result; + + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return NULL; +} + +/** + * If the element of given rank is in this container, supposing that + * the first + * element has rank start_rank, then the function returns true and + * sets element + * accordingly. + * Otherwise, it returns false and update start_rank. + */ +static inline bool container_select( + const container_t *c, uint8_t type, + uint32_t *start_rank, uint32_t rank, + uint32_t *element +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_select(const_CAST_bitset(c), + start_rank, rank, element); + case ARRAY_CONTAINER_TYPE: + return array_container_select(const_CAST_array(c), + start_rank, rank, element); + case RUN_CONTAINER_TYPE: + return run_container_select(const_CAST_run(c), + start_rank, rank, element); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +static inline uint16_t container_maximum( + const container_t *c, uint8_t type +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_maximum(const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_maximum(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_maximum(const_CAST_run(c)); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +static inline uint16_t container_minimum( + const container_t *c, uint8_t type +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_minimum(const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_minimum(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_minimum(const_CAST_run(c)); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +// number of values smaller or equal to x +static inline int container_rank( + const container_t *c, uint8_t type, + uint16_t x +){ + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + return bitset_container_rank(const_CAST_bitset(c), x); + case ARRAY_CONTAINER_TYPE: + return array_container_rank(const_CAST_array(c), x); + case RUN_CONTAINER_TYPE: + return run_container_rank(const_CAST_run(c), x); + default: + assert(false); + __builtin_unreachable(); + } + assert(false); + __builtin_unreachable(); + return false; +} + +/** + * Add all values in range [min, max] to a given container. + * + * If the returned pointer is different from $container, then a new container + * has been created and the caller is responsible for freeing it. + * The type of the first container may change. Returns the modified + * (and possibly new) container. + */ +static inline container_t *container_add_range( + container_t *c, uint8_t type, + uint32_t min, uint32_t max, + uint8_t *result_type +){ + // NB: when selecting new container type, we perform only inexpensive checks + switch (type) { + case BITSET_CONTAINER_TYPE: { + bitset_container_t *bitset = CAST_bitset(c); + + int32_t union_cardinality = 0; + union_cardinality += bitset->cardinality; + union_cardinality += max - min + 1; + union_cardinality -= bitset_lenrange_cardinality(bitset->words, + min, max-min); + + if (union_cardinality == INT32_C(0x10000)) { + *result_type = RUN_CONTAINER_TYPE; + return run_container_create_range(0, INT32_C(0x10000)); + } else { + *result_type = BITSET_CONTAINER_TYPE; + bitset_set_lenrange(bitset->words, min, max - min); + bitset->cardinality = union_cardinality; + return bitset; + } + } + case ARRAY_CONTAINER_TYPE: { + array_container_t *array = CAST_array(c); + + int32_t nvals_greater = count_greater(array->array, array->cardinality, max); + int32_t nvals_less = count_less(array->array, array->cardinality - nvals_greater, min); + int32_t union_cardinality = nvals_less + (max - min + 1) + nvals_greater; + + if (union_cardinality == INT32_C(0x10000)) { + *result_type = RUN_CONTAINER_TYPE; + return run_container_create_range(0, INT32_C(0x10000)); + } else if (union_cardinality <= DEFAULT_MAX_SIZE) { + *result_type = ARRAY_CONTAINER_TYPE; + array_container_add_range_nvals(array, min, max, nvals_less, nvals_greater); + return array; + } else { + *result_type = BITSET_CONTAINER_TYPE; + bitset_container_t *bitset = bitset_container_from_array(array); + bitset_set_lenrange(bitset->words, min, max - min); + bitset->cardinality = union_cardinality; + return bitset; + } + } + case RUN_CONTAINER_TYPE: { + run_container_t *run = CAST_run(c); + + int32_t nruns_greater = rle16_count_greater(run->runs, run->n_runs, max); + int32_t nruns_less = rle16_count_less(run->runs, run->n_runs - nruns_greater, min); + + int32_t run_size_bytes = (nruns_less + 1 + nruns_greater) * sizeof(rle16_t); + int32_t bitset_size_bytes = BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + + if (run_size_bytes <= bitset_size_bytes) { + run_container_add_range_nruns(run, min, max, nruns_less, nruns_greater); + *result_type = RUN_CONTAINER_TYPE; + return run; + } else { + return container_from_run_range(run, min, max, result_type); + } + } + default: + __builtin_unreachable(); + } +} + +/* + * Removes all elements in range [min, max]. + * Returns one of: + * - NULL if no elements left + * - pointer to the original container + * - pointer to a newly-allocated container (if it is more efficient) + * + * If the returned pointer is different from $container, then a new container + * has been created and the caller is responsible for freeing the original container. + */ +static inline container_t *container_remove_range( + container_t *c, uint8_t type, + uint32_t min, uint32_t max, + uint8_t *result_type +){ + switch (type) { + case BITSET_CONTAINER_TYPE: { + bitset_container_t *bitset = CAST_bitset(c); + + int32_t result_cardinality = bitset->cardinality - + bitset_lenrange_cardinality(bitset->words, min, max-min); + + if (result_cardinality == 0) { + return NULL; + } else if (result_cardinality < DEFAULT_MAX_SIZE) { + *result_type = ARRAY_CONTAINER_TYPE; + bitset_reset_range(bitset->words, min, max+1); + bitset->cardinality = result_cardinality; + return array_container_from_bitset(bitset); + } else { + *result_type = BITSET_CONTAINER_TYPE; + bitset_reset_range(bitset->words, min, max+1); + bitset->cardinality = result_cardinality; + return bitset; + } + } + case ARRAY_CONTAINER_TYPE: { + array_container_t *array = CAST_array(c); + + int32_t nvals_greater = count_greater(array->array, array->cardinality, max); + int32_t nvals_less = count_less(array->array, array->cardinality - nvals_greater, min); + int32_t result_cardinality = nvals_less + nvals_greater; + + if (result_cardinality == 0) { + return NULL; + } else { + *result_type = ARRAY_CONTAINER_TYPE; + array_container_remove_range(array, nvals_less, + array->cardinality - result_cardinality); + return array; + } + } + case RUN_CONTAINER_TYPE: { + run_container_t *run = CAST_run(c); + + if (run->n_runs == 0) { + return NULL; + } + if (min <= run_container_minimum(run) && max >= run_container_maximum(run)) { + return NULL; + } + + run_container_remove_range(run, min, max); + + if (run_container_serialized_size_in_bytes(run->n_runs) <= + bitset_container_serialized_size_in_bytes()) { + *result_type = RUN_CONTAINER_TYPE; + return run; + } else { + *result_type = BITSET_CONTAINER_TYPE; + return bitset_container_from_run(run); + } + } + default: + __builtin_unreachable(); + } +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif + +#endif +/* end file include/roaring/containers/containers.h */ +/* begin file include/roaring/roaring_array.h */ +#ifndef INCLUDE_ROARING_ARRAY_H +#define INCLUDE_ROARING_ARRAY_H + +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { + +// Note: in pure C++ code, you should avoid putting `using` in header files +using api::roaring_array_t; + +namespace internal { +#endif + +enum { + SERIAL_COOKIE_NO_RUNCONTAINER = 12346, + SERIAL_COOKIE = 12347, + FROZEN_COOKIE = 13766, + NO_OFFSET_THRESHOLD = 4 +}; + +/** + * Create a new roaring array + */ +roaring_array_t *ra_create(void); + +/** + * Initialize an existing roaring array with the specified capacity (in number + * of containers) + */ +bool ra_init_with_capacity(roaring_array_t *new_ra, uint32_t cap); + +/** + * Initialize with zero capacity + */ +void ra_init(roaring_array_t *t); + +/** + * Copies this roaring array, we assume that dest is not initialized + */ +bool ra_copy(const roaring_array_t *source, roaring_array_t *dest, + bool copy_on_write); + +/* + * Shrinks the capacity, returns the number of bytes saved. + */ +int ra_shrink_to_fit(roaring_array_t *ra); + +/** + * Copies this roaring array, we assume that dest is initialized + */ +bool ra_overwrite(const roaring_array_t *source, roaring_array_t *dest, + bool copy_on_write); + +/** + * Frees the memory used by a roaring array + */ +void ra_clear(roaring_array_t *r); + +/** + * Frees the memory used by a roaring array, but does not free the containers + */ +void ra_clear_without_containers(roaring_array_t *r); + +/** + * Frees just the containers + */ +void ra_clear_containers(roaring_array_t *ra); + +/** + * Get the index corresponding to a 16-bit key + */ +inline int32_t ra_get_index(const roaring_array_t *ra, uint16_t x) { + if ((ra->size == 0) || ra->keys[ra->size - 1] == x) return ra->size - 1; + return binarySearch(ra->keys, (int32_t)ra->size, x); +} + +/** + * Retrieves the container at index i, filling in the typecode + */ +inline container_t *ra_get_container_at_index( + const roaring_array_t *ra, uint16_t i, uint8_t *typecode +){ + *typecode = ra->typecodes[i]; + return ra->containers[i]; +} + +/** + * Retrieves the key at index i + */ +inline uint16_t ra_get_key_at_index(const roaring_array_t *ra, uint16_t i) { + return ra->keys[i]; +} + +/** + * Add a new key-value pair at index i + */ +void ra_insert_new_key_value_at( + roaring_array_t *ra, int32_t i, uint16_t key, + container_t *c, uint8_t typecode); + +/** + * Append a new key-value pair + */ +void ra_append( + roaring_array_t *ra, uint16_t key, + container_t *c, uint8_t typecode); + +/** + * Append a new key-value pair to ra, cloning (in COW sense) a value from sa + * at index index + */ +void ra_append_copy(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t index, bool copy_on_write); + +/** + * Append new key-value pairs to ra, cloning (in COW sense) values from sa + * at indexes + * [start_index, end_index) + */ +void ra_append_copy_range(roaring_array_t *ra, const roaring_array_t *sa, + int32_t start_index, int32_t end_index, + bool copy_on_write); + +/** appends from sa to ra, ending with the greatest key that is + * is less or equal stopping_key + */ +void ra_append_copies_until(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t stopping_key, bool copy_on_write); + +/** appends from sa to ra, starting with the smallest key that is + * is strictly greater than before_start + */ + +void ra_append_copies_after(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t before_start, bool copy_on_write); + +/** + * Move the key-value pairs to ra from sa at indexes + * [start_index, end_index), old array should not be freed + * (use ra_clear_without_containers) + **/ +void ra_append_move_range(roaring_array_t *ra, roaring_array_t *sa, + int32_t start_index, int32_t end_index); +/** + * Append new key-value pairs to ra, from sa at indexes + * [start_index, end_index) + */ +void ra_append_range(roaring_array_t *ra, roaring_array_t *sa, + int32_t start_index, int32_t end_index, + bool copy_on_write); + +/** + * Set the container at the corresponding index using the specified + * typecode. + */ +inline void ra_set_container_at_index( + const roaring_array_t *ra, int32_t i, + container_t *c, uint8_t typecode +){ + assert(i < ra->size); + ra->containers[i] = c; + ra->typecodes[i] = typecode; +} + +/** + * If needed, increase the capacity of the array so that it can fit k values + * (at + * least); + */ +bool extend_array(roaring_array_t *ra, int32_t k); + +inline int32_t ra_get_size(const roaring_array_t *ra) { return ra->size; } + +static inline int32_t ra_advance_until(const roaring_array_t *ra, uint16_t x, + int32_t pos) { + return advanceUntil(ra->keys, pos, ra->size, x); +} + +int32_t ra_advance_until_freeing(roaring_array_t *ra, uint16_t x, int32_t pos); + +void ra_downsize(roaring_array_t *ra, int32_t new_length); + +inline void ra_replace_key_and_container_at_index( + roaring_array_t *ra, int32_t i, uint16_t key, + container_t *c, uint8_t typecode +){ + assert(i < ra->size); + + ra->keys[i] = key; + ra->containers[i] = c; + ra->typecodes[i] = typecode; +} + +// write set bits to an array +void ra_to_uint32_array(const roaring_array_t *ra, uint32_t *ans); + +bool ra_range_uint32_array(const roaring_array_t *ra, size_t offset, size_t limit, uint32_t *ans); + +/** + * write a bitmap to a buffer. This is meant to be compatible with + * the + * Java and Go versions. Return the size in bytes of the serialized + * output (which should be ra_portable_size_in_bytes(ra)). + */ +size_t ra_portable_serialize(const roaring_array_t *ra, char *buf); + +/** + * read a bitmap from a serialized version. This is meant to be compatible + * with the Java and Go versions. + * maxbytes indicates how many bytes available from buf. + * When the function returns true, roaring_array_t is populated with the data + * and *readbytes indicates how many bytes were read. In all cases, if the function + * returns true, then maxbytes >= *readbytes. + */ +bool ra_portable_deserialize(roaring_array_t *ra, const char *buf, const size_t maxbytes, size_t * readbytes); + +/** + * Quickly checks whether there is a serialized bitmap at the pointer, + * not exceeding size "maxbytes" in bytes. This function does not allocate + * memory dynamically. + * + * This function returns 0 if and only if no valid bitmap is found. + * Otherwise, it returns how many bytes are occupied by the bitmap data. + */ +size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes); + +/** + * How many bytes are required to serialize this bitmap (meant to be + * compatible + * with Java and Go versions) + */ +size_t ra_portable_size_in_bytes(const roaring_array_t *ra); + +/** + * return true if it contains at least one run container. + */ +bool ra_has_run_container(const roaring_array_t *ra); + +/** + * Size of the header when serializing (meant to be compatible + * with Java and Go versions) + */ +uint32_t ra_portable_header_size(const roaring_array_t *ra); + +/** + * If the container at the index i is share, unshare it (creating a local + * copy if needed). + */ +static inline void ra_unshare_container_at_index(roaring_array_t *ra, + uint16_t i) { + assert(i < ra->size); + ra->containers[i] = get_writable_copy_if_shared(ra->containers[i], + &ra->typecodes[i]); +} + +/** + * remove at index i, sliding over all entries after i + */ +void ra_remove_at_index(roaring_array_t *ra, int32_t i); + + +/** +* clears all containers, sets the size at 0 and shrinks the memory usage. +*/ +void ra_reset(roaring_array_t *ra); + +/** + * remove at index i, sliding over all entries after i. Free removed container. + */ +void ra_remove_at_index_and_free(roaring_array_t *ra, int32_t i); + +/** + * remove a chunk of indices, sliding over entries after it + */ +// void ra_remove_index_range(roaring_array_t *ra, int32_t begin, int32_t end); + +// used in inplace andNot only, to slide left the containers from +// the mutated RoaringBitmap that are after the largest container of +// the argument RoaringBitmap. It is followed by a call to resize. +// +void ra_copy_range(roaring_array_t *ra, uint32_t begin, uint32_t end, + uint32_t new_begin); + +/** + * Shifts rightmost $count containers to the left (distance < 0) or + * to the right (distance > 0). + * Allocates memory if necessary. + * This function doesn't free or create new containers. + * Caller is responsible for that. + */ +void ra_shift_tail(roaring_array_t *ra, int32_t count, int32_t distance); + +#ifdef __cplusplus +} // namespace internal +} } // extern "C" { namespace roaring { +#endif + +#endif +/* end file include/roaring/roaring_array.h */ +/* begin file include/roaring/misc/configreport.h */ +/* + * configreport.h + * + */ + +#ifndef INCLUDE_MISC_CONFIGREPORT_H_ +#define INCLUDE_MISC_CONFIGREPORT_H_ + +#include // for size_t +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace misc { +#endif + +#ifdef CROARING_IS_X64 +// useful for basic info (0) +static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) { +#ifdef CROARING_INLINE_ASM + __asm volatile("cpuid" + : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) + : "0"(*eax), "2"(*ecx)); +#endif /* not sure what to do when inline assembly is unavailable*/ +} + +// CPUID instruction takes no parameters as CPUID implicitly uses the EAX +// register. +// The EAX register should be loaded with a value specifying what information to +// return +static inline void cpuinfo(int code, int *eax, int *ebx, int *ecx, int *edx) { +#ifdef CROARING_INLINE_ASM + __asm__ volatile("cpuid;" // call cpuid instruction + : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), + "=d"(*edx) // output equal to "movl %%eax %1" + : "a"(code) // input equal to "movl %1, %%eax" + //:"%eax","%ebx","%ecx","%edx"// clobbered register + ); +#endif /* not sure what to do when inline assembly is unavailable*/ +} + +static inline int computecacheline() { + int eax = 0, ebx = 0, ecx = 0, edx = 0; + cpuinfo((int)0x80000006, &eax, &ebx, &ecx, &edx); + return ecx & 0xFF; +} + +// this is quite imperfect, but can be handy +static inline const char *guessprocessor() { + unsigned eax = 1, ebx = 0, ecx = 0, edx = 0; + native_cpuid(&eax, &ebx, &ecx, &edx); + const char *codename; + switch (eax >> 4) { + case 0x506E: + codename = "Skylake"; + break; + case 0x406C: + codename = "CherryTrail"; + break; + case 0x306D: + codename = "Broadwell"; + break; + case 0x306C: + codename = "Haswell"; + break; + case 0x306A: + codename = "IvyBridge"; + break; + case 0x206A: + case 0x206D: + codename = "SandyBridge"; + break; + case 0x2065: + case 0x206C: + case 0x206F: + codename = "Westmere"; + break; + case 0x106E: + case 0x106A: + case 0x206E: + codename = "Nehalem"; + break; + case 0x1067: + case 0x106D: + codename = "Penryn"; + break; + case 0x006F: + case 0x1066: + codename = "Merom"; + break; + case 0x0066: + codename = "Presler"; + break; + case 0x0063: + case 0x0064: + codename = "Prescott"; + break; + case 0x006D: + codename = "Dothan"; + break; + case 0x0366: + codename = "Cedarview"; + break; + case 0x0266: + codename = "Lincroft"; + break; + case 0x016C: + codename = "Pineview"; + break; + default: + codename = "UNKNOWN"; + break; + } + return codename; +} + +static inline void tellmeall() { + printf("x64 processor: %s\t", guessprocessor()); + +#ifdef __VERSION__ + printf(" compiler version: %s\t", __VERSION__); +#endif + uint32_t config = croaring_detect_supported_architectures(); + if((config & CROARING_NEON) == CROARING_NEON) { + printf(" NEON detected\t"); + } + #ifdef __AVX2__ + printf(" Building for AVX2\t"); + #endif + if(croaring_avx2()) { + printf( "AVX2 usable\t"); + } + if((config & CROARING_AVX2) == CROARING_AVX2) { + printf( "AVX2 detected\t"); + if(!croaring_avx2()) { + printf( "AVX2 not used\t"); + } + } + if((config & CROARING_SSE42) == CROARING_SSE42) { + printf(" SSE4.2 detected\t"); + } + if((config & CROARING_BMI1) == CROARING_BMI1) { + printf(" BMI1 detected\t"); + } + if((config & CROARING_BMI2) == CROARING_BMI2) { + printf(" BMI2 detected\t"); + } + printf("\n"); + if ((sizeof(int) != 4) || (sizeof(long) != 8)) { + printf("number of bytes: int = %lu long = %lu \n", + (long unsigned int)sizeof(size_t), + (long unsigned int)sizeof(int)); + } +#if __LITTLE_ENDIAN__ +// This is what we expect! +// printf("you have little endian machine"); +#endif +#if __BIG_ENDIAN__ + printf("you have a big endian machine"); +#endif +#if __CHAR_BIT__ + if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???"); +#endif + if (computecacheline() != 64) + printf("cache line: %d bytes\n", computecacheline()); +} +#else + +static inline void tellmeall() { + printf("Non-X64 processor\n"); +#ifdef __arm__ + printf("ARM processor detected\n"); +#endif +#ifdef __VERSION__ + printf(" compiler version: %s\t", __VERSION__); +#endif + uint32_t config = croaring_detect_supported_architectures(); + if((config & CROARING_NEON) == CROARING_NEON) { + printf(" NEON detected\t"); + } + if((config & CROARING_ALTIVEC) == CROARING_ALTIVEC) { + printf("Altivec detected\n"); + } + + if ((sizeof(int) != 4) || (sizeof(long) != 8)) { + printf("number of bytes: int = %lu long = %lu \n", + (long unsigned int)sizeof(size_t), + (long unsigned int)sizeof(int)); + } +#if __LITTLE_ENDIAN__ +// This is what we expect! +// printf("you have little endian machine"); +#endif +#if __BIG_ENDIAN__ + printf("you have a big endian machine"); +#endif +#if __CHAR_BIT__ + if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???"); +#endif +} + +#endif + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace misc { +#endif + +#endif /* INCLUDE_MISC_CONFIGREPORT_H_ */ +/* end file include/roaring/misc/configreport.h */ +/* begin file src/array_util.c */ +#include +#include +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +extern inline int32_t binarySearch(const uint16_t *array, int32_t lenarray, + uint16_t ikey); + +#ifdef CROARING_IS_X64 +// used by intersect_vector16 +ALIGNED(0x1000) +static const uint8_t shuffle_mask16[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 8, 9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 8, 9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 6, 7, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, 8, 9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, + 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 6, 7, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, 8, 9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 6, 7, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 6, 7, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 10, 11, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 10, 11, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 6, 7, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 6, 7, 10, 11, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 6, 7, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 6, 7, 10, 11, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 6, 7, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, 10, 11, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 8, 9, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, 10, 11, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 8, 9, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 8, 9, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 8, 9, 10, 11, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 6, 7, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 8, 9, + 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 0xFF, 0xFF, 0xFF, 0xFF, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 6, 7, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 6, 7, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 6, 7, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 6, 7, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 8, 9, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 8, 9, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 8, 9, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 8, 9, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 8, 9, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, + 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 6, 7, 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 6, 7, 8, 9, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, + 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 6, 7, 8, 9, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 6, 7, 8, 9, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 10, 11, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 10, 11, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 10, 11, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 6, 7, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, + 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 8, 9, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, + 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 8, 9, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 6, 7, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, 8, 9, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, + 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 0xFF, 0xFF, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 6, 7, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 6, 7, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 6, 7, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 6, 7, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 6, 7, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 8, 9, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 8, 9, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 8, 9, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 8, 9, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 6, 7, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 8, 9, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 8, 9, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 10, 11, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 10, 11, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 6, 7, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, + 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 6, 7, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 6, 7, 10, 11, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, + 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 8, 9, 10, 11, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 8, 9, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 8, 9, 10, 11, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 8, 9, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, + 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 6, 7, 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 6, 7, 8, 9, + 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, + 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 0xFF, 0xFF, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 12, 13, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 12, 13, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 6, 7, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 8, 9, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 8, 9, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 6, 7, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, 8, 9, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, + 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, 8, 9, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 6, 7, 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 12, 13, 14, 15, 0xFF, 0xFF, 10, 11, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 4, 5, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 10, 11, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 6, 7, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 6, 7, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 6, 7, 10, 11, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 6, 7, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 4, 5, 6, 7, 10, 11, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, + 8, 9, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 8, 9, 10, 11, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 8, 9, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 4, 5, 8, 9, 10, 11, 12, 13, + 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, + 8, 9, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, + 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 8, 9, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 2, 3, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}; + +/** + * From Schlegel et al., Fast Sorted-Set Intersection using SIMD Instructions + * Optimized by D. Lemire on May 3rd 2013 + */ +CROARING_TARGET_AVX2 +int32_t intersect_vector16(const uint16_t *__restrict__ A, size_t s_a, + const uint16_t *__restrict__ B, size_t s_b, + uint16_t *C) { + size_t count = 0; + size_t i_a = 0, i_b = 0; + const int vectorlength = sizeof(__m128i) / sizeof(uint16_t); + const size_t st_a = (s_a / vectorlength) * vectorlength; + const size_t st_b = (s_b / vectorlength) * vectorlength; + __m128i v_a, v_b; + if ((i_a < st_a) && (i_b < st_b)) { + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + while ((A[i_a] == 0) || (B[i_b] == 0)) { + const __m128i res_v = _mm_cmpestrm( + v_b, vectorlength, v_a, vectorlength, + _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK); + const int r = _mm_extract_epi32(res_v, 0); + __m128i sm16 = _mm_load_si128((const __m128i *)shuffle_mask16 + r); + __m128i p = _mm_shuffle_epi8(v_a, sm16); + _mm_storeu_si128((__m128i *)&C[count], p); // can overflow + count += _mm_popcnt_u32(r); + const uint16_t a_max = A[i_a + vectorlength - 1]; + const uint16_t b_max = B[i_b + vectorlength - 1]; + if (a_max <= b_max) { + i_a += vectorlength; + if (i_a == st_a) break; + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + } + if (b_max <= a_max) { + i_b += vectorlength; + if (i_b == st_b) break; + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + } + } + if ((i_a < st_a) && (i_b < st_b)) + while (true) { + const __m128i res_v = _mm_cmpistrm( + v_b, v_a, + _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK); + const int r = _mm_extract_epi32(res_v, 0); + __m128i sm16 = + _mm_load_si128((const __m128i *)shuffle_mask16 + r); + __m128i p = _mm_shuffle_epi8(v_a, sm16); + _mm_storeu_si128((__m128i *)&C[count], p); // can overflow + count += _mm_popcnt_u32(r); + const uint16_t a_max = A[i_a + vectorlength - 1]; + const uint16_t b_max = B[i_b + vectorlength - 1]; + if (a_max <= b_max) { + i_a += vectorlength; + if (i_a == st_a) break; + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + } + if (b_max <= a_max) { + i_b += vectorlength; + if (i_b == st_b) break; + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + } + } + } + // intersect the tail using scalar intersection + while (i_a < s_a && i_b < s_b) { + uint16_t a = A[i_a]; + uint16_t b = B[i_b]; + if (a < b) { + i_a++; + } else if (b < a) { + i_b++; + } else { + C[count] = a; //==b; + count++; + i_a++; + i_b++; + } + } + return (int32_t)count; +} +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +int32_t intersect_vector16_cardinality(const uint16_t *__restrict__ A, + size_t s_a, + const uint16_t *__restrict__ B, + size_t s_b) { + size_t count = 0; + size_t i_a = 0, i_b = 0; + const int vectorlength = sizeof(__m128i) / sizeof(uint16_t); + const size_t st_a = (s_a / vectorlength) * vectorlength; + const size_t st_b = (s_b / vectorlength) * vectorlength; + __m128i v_a, v_b; + if ((i_a < st_a) && (i_b < st_b)) { + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + while ((A[i_a] == 0) || (B[i_b] == 0)) { + const __m128i res_v = _mm_cmpestrm( + v_b, vectorlength, v_a, vectorlength, + _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK); + const int r = _mm_extract_epi32(res_v, 0); + count += _mm_popcnt_u32(r); + const uint16_t a_max = A[i_a + vectorlength - 1]; + const uint16_t b_max = B[i_b + vectorlength - 1]; + if (a_max <= b_max) { + i_a += vectorlength; + if (i_a == st_a) break; + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + } + if (b_max <= a_max) { + i_b += vectorlength; + if (i_b == st_b) break; + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + } + } + if ((i_a < st_a) && (i_b < st_b)) + while (true) { + const __m128i res_v = _mm_cmpistrm( + v_b, v_a, + _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK); + const int r = _mm_extract_epi32(res_v, 0); + count += _mm_popcnt_u32(r); + const uint16_t a_max = A[i_a + vectorlength - 1]; + const uint16_t b_max = B[i_b + vectorlength - 1]; + if (a_max <= b_max) { + i_a += vectorlength; + if (i_a == st_a) break; + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + } + if (b_max <= a_max) { + i_b += vectorlength; + if (i_b == st_b) break; + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + } + } + } + // intersect the tail using scalar intersection + while (i_a < s_a && i_b < s_b) { + uint16_t a = A[i_a]; + uint16_t b = B[i_b]; + if (a < b) { + i_a++; + } else if (b < a) { + i_b++; + } else { + count++; + i_a++; + i_b++; + } + } + return (int32_t)count; +} +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +///////// +// Warning: +// This function may not be safe if A == C or B == C. +///////// +int32_t difference_vector16(const uint16_t *__restrict__ A, size_t s_a, + const uint16_t *__restrict__ B, size_t s_b, + uint16_t *C) { + // we handle the degenerate case + if (s_a == 0) return 0; + if (s_b == 0) { + if (A != C) memcpy(C, A, sizeof(uint16_t) * s_a); + return (int32_t)s_a; + } + // handle the leading zeroes, it is messy but it allows us to use the fast + // _mm_cmpistrm instrinsic safely + int32_t count = 0; + if ((A[0] == 0) || (B[0] == 0)) { + if ((A[0] == 0) && (B[0] == 0)) { + A++; + s_a--; + B++; + s_b--; + } else if (A[0] == 0) { + C[count++] = 0; + A++; + s_a--; + } else { + B++; + s_b--; + } + } + // at this point, we have two non-empty arrays, made of non-zero + // increasing values. + size_t i_a = 0, i_b = 0; + const size_t vectorlength = sizeof(__m128i) / sizeof(uint16_t); + const size_t st_a = (s_a / vectorlength) * vectorlength; + const size_t st_b = (s_b / vectorlength) * vectorlength; + if ((i_a < st_a) && (i_b < st_b)) { // this is the vectorized code path + __m128i v_a, v_b; //, v_bmax; + // we load a vector from A and a vector from B + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + // we have a runningmask which indicates which values from A have been + // spotted in B, these don't get written out. + __m128i runningmask_a_found_in_b = _mm_setzero_si128(); + /**** + * start of the main vectorized loop + *****/ + while (true) { + // afoundinb will contain a mask indicate for each entry in A + // whether it is seen + // in B + const __m128i a_found_in_b = + _mm_cmpistrm(v_b, v_a, _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | + _SIDD_BIT_MASK); + runningmask_a_found_in_b = + _mm_or_si128(runningmask_a_found_in_b, a_found_in_b); + // we always compare the last values of A and B + const uint16_t a_max = A[i_a + vectorlength - 1]; + const uint16_t b_max = B[i_b + vectorlength - 1]; + if (a_max <= b_max) { + // Ok. In this code path, we are ready to write our v_a + // because there is no need to read more from B, they will + // all be large values. + const int bitmask_belongs_to_difference = + _mm_extract_epi32(runningmask_a_found_in_b, 0) ^ 0xFF; + /*** next few lines are probably expensive *****/ + __m128i sm16 = _mm_load_si128((const __m128i *)shuffle_mask16 + + bitmask_belongs_to_difference); + __m128i p = _mm_shuffle_epi8(v_a, sm16); + _mm_storeu_si128((__m128i *)&C[count], p); // can overflow + count += _mm_popcnt_u32(bitmask_belongs_to_difference); + // we advance a + i_a += vectorlength; + if (i_a == st_a) // no more + break; + runningmask_a_found_in_b = _mm_setzero_si128(); + v_a = _mm_lddqu_si128((__m128i *)&A[i_a]); + } + if (b_max <= a_max) { + // in this code path, the current v_b has become useless + i_b += vectorlength; + if (i_b == st_b) break; + v_b = _mm_lddqu_si128((__m128i *)&B[i_b]); + } + } + // at this point, either we have i_a == st_a, which is the end of the + // vectorized processing, + // or we have i_b == st_b, and we are not done processing the vector... + // so we need to finish it off. + if (i_a < st_a) { // we have unfinished business... + uint16_t buffer[8]; // buffer to do a masked load + memset(buffer, 0, 8 * sizeof(uint16_t)); + memcpy(buffer, B + i_b, (s_b - i_b) * sizeof(uint16_t)); + v_b = _mm_lddqu_si128((__m128i *)buffer); + const __m128i a_found_in_b = + _mm_cmpistrm(v_b, v_a, _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | + _SIDD_BIT_MASK); + runningmask_a_found_in_b = + _mm_or_si128(runningmask_a_found_in_b, a_found_in_b); + const int bitmask_belongs_to_difference = + _mm_extract_epi32(runningmask_a_found_in_b, 0) ^ 0xFF; + __m128i sm16 = _mm_load_si128((const __m128i *)shuffle_mask16 + + bitmask_belongs_to_difference); + __m128i p = _mm_shuffle_epi8(v_a, sm16); + _mm_storeu_si128((__m128i *)&C[count], p); // can overflow + count += _mm_popcnt_u32(bitmask_belongs_to_difference); + i_a += vectorlength; + } + // at this point we should have i_a == st_a and i_b == st_b + } + // do the tail using scalar code + while (i_a < s_a && i_b < s_b) { + uint16_t a = A[i_a]; + uint16_t b = B[i_b]; + if (b < a) { + i_b++; + } else if (a < b) { + C[count] = a; + count++; + i_a++; + } else { //== + i_a++; + i_b++; + } + } + if (i_a < s_a) { + if(C == A) { + assert((size_t)count <= i_a); + if((size_t)count < i_a) { + memmove(C + count, A + i_a, sizeof(uint16_t) * (s_a - i_a)); + } + } else { + for(size_t i = 0; i < (s_a - i_a); i++) { + C[count + i] = A[i + i_a]; + } + } + count += (int32_t)(s_a - i_a); + } + return count; +} +CROARING_UNTARGET_REGION +#endif // CROARING_IS_X64 + + + +/** +* Branchless binary search going after 4 values at once. +* Assumes that array is sorted. +* You have that array[*index1] >= target1, array[*index12] >= target2, ... +* except when *index1 = n, in which case you know that all values in array are +* smaller than target1, and so forth. +* It has logarithmic complexity. +*/ +static void binarySearch4(const uint16_t *array, int32_t n, uint16_t target1, + uint16_t target2, uint16_t target3, uint16_t target4, + int32_t *index1, int32_t *index2, int32_t *index3, + int32_t *index4) { + const uint16_t *base1 = array; + const uint16_t *base2 = array; + const uint16_t *base3 = array; + const uint16_t *base4 = array; + if (n == 0) + return; + while (n > 1) { + int32_t half = n >> 1; + base1 = (base1[half] < target1) ? &base1[half] : base1; + base2 = (base2[half] < target2) ? &base2[half] : base2; + base3 = (base3[half] < target3) ? &base3[half] : base3; + base4 = (base4[half] < target4) ? &base4[half] : base4; + n -= half; + } + *index1 = (int32_t)((*base1 < target1) + base1 - array); + *index2 = (int32_t)((*base2 < target2) + base2 - array); + *index3 = (int32_t)((*base3 < target3) + base3 - array); + *index4 = (int32_t)((*base4 < target4) + base4 - array); +} + +/** +* Branchless binary search going after 2 values at once. +* Assumes that array is sorted. +* You have that array[*index1] >= target1, array[*index12] >= target2. +* except when *index1 = n, in which case you know that all values in array are +* smaller than target1, and so forth. +* It has logarithmic complexity. +*/ +static void binarySearch2(const uint16_t *array, int32_t n, uint16_t target1, + uint16_t target2, int32_t *index1, int32_t *index2) { + const uint16_t *base1 = array; + const uint16_t *base2 = array; + if (n == 0) + return; + while (n > 1) { + int32_t half = n >> 1; + base1 = (base1[half] < target1) ? &base1[half] : base1; + base2 = (base2[half] < target2) ? &base2[half] : base2; + n -= half; + } + *index1 = (int32_t)((*base1 < target1) + base1 - array); + *index2 = (int32_t)((*base2 < target2) + base2 - array); +} + +/* Computes the intersection between one small and one large set of uint16_t. + * Stores the result into buffer and return the number of elements. + * Processes the small set in blocks of 4 values calling binarySearch4 + * and binarySearch2. This approach can be slightly superior to a conventional + * galloping search in some instances. + */ +int32_t intersect_skewed_uint16(const uint16_t *small, size_t size_s, + const uint16_t *large, size_t size_l, + uint16_t *buffer) { + size_t pos = 0, idx_l = 0, idx_s = 0; + + if (0 == size_s) { + return 0; + } + int32_t index1 = 0, index2 = 0, index3 = 0, index4 = 0; + while ((idx_s + 4 <= size_s) && (idx_l < size_l)) { + uint16_t target1 = small[idx_s]; + uint16_t target2 = small[idx_s + 1]; + uint16_t target3 = small[idx_s + 2]; + uint16_t target4 = small[idx_s + 3]; + binarySearch4(large + idx_l, (int32_t)(size_l - idx_l), target1, target2, target3, + target4, &index1, &index2, &index3, &index4); + if ((index1 + idx_l < size_l) && (large[idx_l + index1] == target1)) { + buffer[pos++] = target1; + } + if ((index2 + idx_l < size_l) && (large[idx_l + index2] == target2)) { + buffer[pos++] = target2; + } + if ((index3 + idx_l < size_l) && (large[idx_l + index3] == target3)) { + buffer[pos++] = target3; + } + if ((index4 + idx_l < size_l) && (large[idx_l + index4] == target4)) { + buffer[pos++] = target4; + } + idx_s += 4; + idx_l += index4; + } + if ((idx_s + 2 <= size_s) && (idx_l < size_l)) { + uint16_t target1 = small[idx_s]; + uint16_t target2 = small[idx_s + 1]; + binarySearch2(large + idx_l, (int32_t)(size_l - idx_l), target1, target2, &index1, + &index2); + if ((index1 + idx_l < size_l) && (large[idx_l + index1] == target1)) { + buffer[pos++] = target1; + } + if ((index2 + idx_l < size_l) && (large[idx_l + index2] == target2)) { + buffer[pos++] = target2; + } + idx_s += 2; + idx_l += index2; + } + if ((idx_s < size_s) && (idx_l < size_l)) { + uint16_t val_s = small[idx_s]; + int32_t index = binarySearch(large + idx_l, (int32_t)(size_l - idx_l), val_s); + if (index >= 0) + buffer[pos++] = val_s; + } + return (int32_t)pos; +} + + + +// TODO: this could be accelerated, possibly, by using binarySearch4 as above. +int32_t intersect_skewed_uint16_cardinality(const uint16_t *small, + size_t size_s, + const uint16_t *large, + size_t size_l) { + size_t pos = 0, idx_l = 0, idx_s = 0; + + if (0 == size_s) { + return 0; + } + + uint16_t val_l = large[idx_l], val_s = small[idx_s]; + + while (true) { + if (val_l < val_s) { + idx_l = advanceUntil(large, (int32_t)idx_l, (int32_t)size_l, val_s); + if (idx_l == size_l) break; + val_l = large[idx_l]; + } else if (val_s < val_l) { + idx_s++; + if (idx_s == size_s) break; + val_s = small[idx_s]; + } else { + pos++; + idx_s++; + if (idx_s == size_s) break; + val_s = small[idx_s]; + idx_l = advanceUntil(large, (int32_t)idx_l, (int32_t)size_l, val_s); + if (idx_l == size_l) break; + val_l = large[idx_l]; + } + } + + return (int32_t)pos; +} + +bool intersect_skewed_uint16_nonempty(const uint16_t *small, size_t size_s, + const uint16_t *large, size_t size_l) { + size_t idx_l = 0, idx_s = 0; + + if (0 == size_s) { + return false; + } + + uint16_t val_l = large[idx_l], val_s = small[idx_s]; + + while (true) { + if (val_l < val_s) { + idx_l = advanceUntil(large, (int32_t)idx_l, (int32_t)size_l, val_s); + if (idx_l == size_l) break; + val_l = large[idx_l]; + } else if (val_s < val_l) { + idx_s++; + if (idx_s == size_s) break; + val_s = small[idx_s]; + } else { + return true; + } + } + + return false; +} + +/** + * Generic intersection function. + */ +int32_t intersect_uint16(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB, uint16_t *out) { + const uint16_t *initout = out; + if (lenA == 0 || lenB == 0) return 0; + const uint16_t *endA = A + lenA; + const uint16_t *endB = B + lenB; + + while (1) { + while (*A < *B) { + SKIP_FIRST_COMPARE: + if (++A == endA) return (int32_t)(out - initout); + } + while (*A > *B) { + if (++B == endB) return (int32_t)(out - initout); + } + if (*A == *B) { + *out++ = *A; + if (++A == endA || ++B == endB) return (int32_t)(out - initout); + } else { + goto SKIP_FIRST_COMPARE; + } + } + return (int32_t)(out - initout); // NOTREACHED +} + +int32_t intersect_uint16_cardinality(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB) { + int32_t answer = 0; + if (lenA == 0 || lenB == 0) return 0; + const uint16_t *endA = A + lenA; + const uint16_t *endB = B + lenB; + + while (1) { + while (*A < *B) { + SKIP_FIRST_COMPARE: + if (++A == endA) return answer; + } + while (*A > *B) { + if (++B == endB) return answer; + } + if (*A == *B) { + ++answer; + if (++A == endA || ++B == endB) return answer; + } else { + goto SKIP_FIRST_COMPARE; + } + } + return answer; // NOTREACHED +} + + +bool intersect_uint16_nonempty(const uint16_t *A, const size_t lenA, + const uint16_t *B, const size_t lenB) { + if (lenA == 0 || lenB == 0) return 0; + const uint16_t *endA = A + lenA; + const uint16_t *endB = B + lenB; + + while (1) { + while (*A < *B) { + SKIP_FIRST_COMPARE: + if (++A == endA) return false; + } + while (*A > *B) { + if (++B == endB) return false; + } + if (*A == *B) { + return true; + } else { + goto SKIP_FIRST_COMPARE; + } + } + return false; // NOTREACHED +} + + + +/** + * Generic intersection function. + */ +size_t intersection_uint32(const uint32_t *A, const size_t lenA, + const uint32_t *B, const size_t lenB, + uint32_t *out) { + const uint32_t *initout = out; + if (lenA == 0 || lenB == 0) return 0; + const uint32_t *endA = A + lenA; + const uint32_t *endB = B + lenB; + + while (1) { + while (*A < *B) { + SKIP_FIRST_COMPARE: + if (++A == endA) return (out - initout); + } + while (*A > *B) { + if (++B == endB) return (out - initout); + } + if (*A == *B) { + *out++ = *A; + if (++A == endA || ++B == endB) return (out - initout); + } else { + goto SKIP_FIRST_COMPARE; + } + } + return (out - initout); // NOTREACHED +} + +size_t intersection_uint32_card(const uint32_t *A, const size_t lenA, + const uint32_t *B, const size_t lenB) { + if (lenA == 0 || lenB == 0) return 0; + size_t card = 0; + const uint32_t *endA = A + lenA; + const uint32_t *endB = B + lenB; + + while (1) { + while (*A < *B) { + SKIP_FIRST_COMPARE: + if (++A == endA) return card; + } + while (*A > *B) { + if (++B == endB) return card; + } + if (*A == *B) { + card++; + if (++A == endA || ++B == endB) return card; + } else { + goto SKIP_FIRST_COMPARE; + } + } + return card; // NOTREACHED +} + +// can one vectorize the computation of the union? (Update: Yes! See +// union_vector16). + +size_t union_uint16(const uint16_t *set_1, size_t size_1, const uint16_t *set_2, + size_t size_2, uint16_t *buffer) { + size_t pos = 0, idx_1 = 0, idx_2 = 0; + + if (0 == size_2) { + memmove(buffer, set_1, size_1 * sizeof(uint16_t)); + return size_1; + } + if (0 == size_1) { + memmove(buffer, set_2, size_2 * sizeof(uint16_t)); + return size_2; + } + + uint16_t val_1 = set_1[idx_1], val_2 = set_2[idx_2]; + + while (true) { + if (val_1 < val_2) { + buffer[pos++] = val_1; + ++idx_1; + if (idx_1 >= size_1) break; + val_1 = set_1[idx_1]; + } else if (val_2 < val_1) { + buffer[pos++] = val_2; + ++idx_2; + if (idx_2 >= size_2) break; + val_2 = set_2[idx_2]; + } else { + buffer[pos++] = val_1; + ++idx_1; + ++idx_2; + if (idx_1 >= size_1 || idx_2 >= size_2) break; + val_1 = set_1[idx_1]; + val_2 = set_2[idx_2]; + } + } + + if (idx_1 < size_1) { + const size_t n_elems = size_1 - idx_1; + memmove(buffer + pos, set_1 + idx_1, n_elems * sizeof(uint16_t)); + pos += n_elems; + } else if (idx_2 < size_2) { + const size_t n_elems = size_2 - idx_2; + memmove(buffer + pos, set_2 + idx_2, n_elems * sizeof(uint16_t)); + pos += n_elems; + } + + return pos; +} + +int difference_uint16(const uint16_t *a1, int length1, const uint16_t *a2, + int length2, uint16_t *a_out) { + int out_card = 0; + int k1 = 0, k2 = 0; + if (length1 == 0) return 0; + if (length2 == 0) { + if (a1 != a_out) memcpy(a_out, a1, sizeof(uint16_t) * length1); + return length1; + } + uint16_t s1 = a1[k1]; + uint16_t s2 = a2[k2]; + while (true) { + if (s1 < s2) { + a_out[out_card++] = s1; + ++k1; + if (k1 >= length1) { + break; + } + s1 = a1[k1]; + } else if (s1 == s2) { + ++k1; + ++k2; + if (k1 >= length1) { + break; + } + if (k2 >= length2) { + memmove(a_out + out_card, a1 + k1, + sizeof(uint16_t) * (length1 - k1)); + return out_card + length1 - k1; + } + s1 = a1[k1]; + s2 = a2[k2]; + } else { // if (val1>val2) + ++k2; + if (k2 >= length2) { + memmove(a_out + out_card, a1 + k1, + sizeof(uint16_t) * (length1 - k1)); + return out_card + length1 - k1; + } + s2 = a2[k2]; + } + } + return out_card; +} + +int32_t xor_uint16(const uint16_t *array_1, int32_t card_1, + const uint16_t *array_2, int32_t card_2, uint16_t *out) { + int32_t pos1 = 0, pos2 = 0, pos_out = 0; + while (pos1 < card_1 && pos2 < card_2) { + const uint16_t v1 = array_1[pos1]; + const uint16_t v2 = array_2[pos2]; + if (v1 == v2) { + ++pos1; + ++pos2; + continue; + } + if (v1 < v2) { + out[pos_out++] = v1; + ++pos1; + } else { + out[pos_out++] = v2; + ++pos2; + } + } + if (pos1 < card_1) { + const size_t n_elems = card_1 - pos1; + memcpy(out + pos_out, array_1 + pos1, n_elems * sizeof(uint16_t)); + pos_out += (int32_t)n_elems; + } else if (pos2 < card_2) { + const size_t n_elems = card_2 - pos2; + memcpy(out + pos_out, array_2 + pos2, n_elems * sizeof(uint16_t)); + pos_out += (int32_t)n_elems; + } + return pos_out; +} + +#ifdef CROARING_IS_X64 + +/*** + * start of the SIMD 16-bit union code + * + */ +CROARING_TARGET_AVX2 + +// Assuming that vInput1 and vInput2 are sorted, produces a sorted output going +// from vecMin all the way to vecMax +// developed originally for merge sort using SIMD instructions. +// Standard merge. See, e.g., Inoue and Taura, SIMD- and Cache-Friendly +// Algorithm for Sorting an Array of Structures +static inline void sse_merge(const __m128i *vInput1, + const __m128i *vInput2, // input 1 & 2 + __m128i *vecMin, __m128i *vecMax) { // output + __m128i vecTmp; + vecTmp = _mm_min_epu16(*vInput1, *vInput2); + *vecMax = _mm_max_epu16(*vInput1, *vInput2); + vecTmp = _mm_alignr_epi8(vecTmp, vecTmp, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + vecTmp = _mm_alignr_epi8(*vecMin, *vecMin, 2); + *vecMin = _mm_min_epu16(vecTmp, *vecMax); + *vecMax = _mm_max_epu16(vecTmp, *vecMax); + *vecMin = _mm_alignr_epi8(*vecMin, *vecMin, 2); +} +CROARING_UNTARGET_REGION +// used by store_unique, generated by simdunion.py +static uint8_t uniqshuf[] = { + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, + 0xc, 0xd, 0xe, 0xf, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xa, 0xb, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0xa, 0xb, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xa, 0xb, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, + 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8, 0x9, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0xc, 0xd, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0xc, 0xd, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x8, 0x9, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x8, 0x9, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, 0xa, 0xb, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6, 0x7, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0xa, 0xb, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xa, 0xb, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x8, 0x9, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xe, 0xf, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, + 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8, 0x9, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0xa, 0xb, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0xa, 0xb, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0x8, 0x9, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x8, 0x9, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x8, 0x9, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6, 0x7, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xc, 0xd, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0xc, 0xd, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xc, 0xd, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xa, 0xb, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x8, 0x9, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xa, 0xb, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0xa, 0xb, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xa, 0xb, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xa, 0xb, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x6, 0x7, + 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x8, 0x9, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, + 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8, 0x9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, + 0x6, 0x7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x4, 0x5, 0x6, 0x7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0x6, 0x7, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x6, 0x7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6, 0x7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x2, 0x3, + 0x4, 0x5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2, 0x3, 0x4, 0x5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0x4, 0x5, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4, 0x5, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0, 0x1, 0x2, 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x2, 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x1, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF}; +CROARING_TARGET_AVX2 +// write vector new, while omitting repeated values assuming that previously +// written vector was "old" +static inline int store_unique(__m128i old, __m128i newval, uint16_t *output) { + __m128i vecTmp = _mm_alignr_epi8(newval, old, 16 - 2); + // lots of high latency instructions follow (optimize?) + int M = _mm_movemask_epi8( + _mm_packs_epi16(_mm_cmpeq_epi16(vecTmp, newval), _mm_setzero_si128())); + int numberofnewvalues = 8 - _mm_popcnt_u32(M); + __m128i key = _mm_lddqu_si128((const __m128i *)uniqshuf + M); + __m128i val = _mm_shuffle_epi8(newval, key); + _mm_storeu_si128((__m128i *)output, val); + return numberofnewvalues; +} +CROARING_UNTARGET_REGION + +// working in-place, this function overwrites the repeated values +// could be avoided? +static inline uint32_t unique(uint16_t *out, uint32_t len) { + uint32_t pos = 1; + for (uint32_t i = 1; i < len; ++i) { + if (out[i] != out[i - 1]) { + out[pos++] = out[i]; + } + } + return pos; +} + +// use with qsort, could be avoided +static int uint16_compare(const void *a, const void *b) { + return (*(uint16_t *)a - *(uint16_t *)b); +} + +CROARING_TARGET_AVX2 +// a one-pass SSE union algorithm +// This function may not be safe if array1 == output or array2 == output. +uint32_t union_vector16(const uint16_t *__restrict__ array1, uint32_t length1, + const uint16_t *__restrict__ array2, uint32_t length2, + uint16_t *__restrict__ output) { + if ((length1 < 8) || (length2 < 8)) { + return (uint32_t)union_uint16(array1, length1, array2, length2, output); + } + __m128i vA, vB, V, vecMin, vecMax; + __m128i laststore; + uint16_t *initoutput = output; + uint32_t len1 = length1 / 8; + uint32_t len2 = length2 / 8; + uint32_t pos1 = 0; + uint32_t pos2 = 0; + // we start the machine + vA = _mm_lddqu_si128((const __m128i *)array1 + pos1); + pos1++; + vB = _mm_lddqu_si128((const __m128i *)array2 + pos2); + pos2++; + sse_merge(&vA, &vB, &vecMin, &vecMax); + laststore = _mm_set1_epi16(-1); + output += store_unique(laststore, vecMin, output); + laststore = vecMin; + if ((pos1 < len1) && (pos2 < len2)) { + uint16_t curA, curB; + curA = array1[8 * pos1]; + curB = array2[8 * pos2]; + while (true) { + if (curA <= curB) { + V = _mm_lddqu_si128((const __m128i *)array1 + pos1); + pos1++; + if (pos1 < len1) { + curA = array1[8 * pos1]; + } else { + break; + } + } else { + V = _mm_lddqu_si128((const __m128i *)array2 + pos2); + pos2++; + if (pos2 < len2) { + curB = array2[8 * pos2]; + } else { + break; + } + } + sse_merge(&V, &vecMax, &vecMin, &vecMax); + output += store_unique(laststore, vecMin, output); + laststore = vecMin; + } + sse_merge(&V, &vecMax, &vecMin, &vecMax); + output += store_unique(laststore, vecMin, output); + laststore = vecMin; + } + // we finish the rest off using a scalar algorithm + // could be improved? + // + // copy the small end on a tmp buffer + uint32_t len = (uint32_t)(output - initoutput); + uint16_t buffer[16]; + uint32_t leftoversize = store_unique(laststore, vecMax, buffer); + if (pos1 == len1) { + memcpy(buffer + leftoversize, array1 + 8 * pos1, + (length1 - 8 * len1) * sizeof(uint16_t)); + leftoversize += length1 - 8 * len1; + qsort(buffer, leftoversize, sizeof(uint16_t), uint16_compare); + + leftoversize = unique(buffer, leftoversize); + len += (uint32_t)union_uint16(buffer, leftoversize, array2 + 8 * pos2, + length2 - 8 * pos2, output); + } else { + memcpy(buffer + leftoversize, array2 + 8 * pos2, + (length2 - 8 * len2) * sizeof(uint16_t)); + leftoversize += length2 - 8 * len2; + qsort(buffer, leftoversize, sizeof(uint16_t), uint16_compare); + leftoversize = unique(buffer, leftoversize); + len += (uint32_t)union_uint16(buffer, leftoversize, array1 + 8 * pos1, + length1 - 8 * pos1, output); + } + return len; +} +CROARING_UNTARGET_REGION + +/** + * End of the SIMD 16-bit union code + * + */ + +/** + * Start of SIMD 16-bit XOR code + */ + +CROARING_TARGET_AVX2 +// write vector new, while omitting repeated values assuming that previously +// written vector was "old" +static inline int store_unique_xor(__m128i old, __m128i newval, + uint16_t *output) { + __m128i vecTmp1 = _mm_alignr_epi8(newval, old, 16 - 4); + __m128i vecTmp2 = _mm_alignr_epi8(newval, old, 16 - 2); + __m128i equalleft = _mm_cmpeq_epi16(vecTmp2, vecTmp1); + __m128i equalright = _mm_cmpeq_epi16(vecTmp2, newval); + __m128i equalleftoright = _mm_or_si128(equalleft, equalright); + int M = _mm_movemask_epi8( + _mm_packs_epi16(equalleftoright, _mm_setzero_si128())); + int numberofnewvalues = 8 - _mm_popcnt_u32(M); + __m128i key = _mm_lddqu_si128((const __m128i *)uniqshuf + M); + __m128i val = _mm_shuffle_epi8(vecTmp2, key); + _mm_storeu_si128((__m128i *)output, val); + return numberofnewvalues; +} +CROARING_UNTARGET_REGION + +// working in-place, this function overwrites the repeated values +// could be avoided? Warning: assumes len > 0 +static inline uint32_t unique_xor(uint16_t *out, uint32_t len) { + uint32_t pos = 1; + for (uint32_t i = 1; i < len; ++i) { + if (out[i] != out[i - 1]) { + out[pos++] = out[i]; + } else + pos--; // if it is identical to previous, delete it + } + return pos; +} +CROARING_TARGET_AVX2 +// a one-pass SSE xor algorithm +uint32_t xor_vector16(const uint16_t *__restrict__ array1, uint32_t length1, + const uint16_t *__restrict__ array2, uint32_t length2, + uint16_t *__restrict__ output) { + if ((length1 < 8) || (length2 < 8)) { + return xor_uint16(array1, length1, array2, length2, output); + } + __m128i vA, vB, V, vecMin, vecMax; + __m128i laststore; + uint16_t *initoutput = output; + uint32_t len1 = length1 / 8; + uint32_t len2 = length2 / 8; + uint32_t pos1 = 0; + uint32_t pos2 = 0; + // we start the machine + vA = _mm_lddqu_si128((const __m128i *)array1 + pos1); + pos1++; + vB = _mm_lddqu_si128((const __m128i *)array2 + pos2); + pos2++; + sse_merge(&vA, &vB, &vecMin, &vecMax); + laststore = _mm_set1_epi16(-1); + uint16_t buffer[17]; + output += store_unique_xor(laststore, vecMin, output); + + laststore = vecMin; + if ((pos1 < len1) && (pos2 < len2)) { + uint16_t curA, curB; + curA = array1[8 * pos1]; + curB = array2[8 * pos2]; + while (true) { + if (curA <= curB) { + V = _mm_lddqu_si128((const __m128i *)array1 + pos1); + pos1++; + if (pos1 < len1) { + curA = array1[8 * pos1]; + } else { + break; + } + } else { + V = _mm_lddqu_si128((const __m128i *)array2 + pos2); + pos2++; + if (pos2 < len2) { + curB = array2[8 * pos2]; + } else { + break; + } + } + sse_merge(&V, &vecMax, &vecMin, &vecMax); + // conditionally stores the last value of laststore as well as all + // but the + // last value of vecMin + output += store_unique_xor(laststore, vecMin, output); + laststore = vecMin; + } + sse_merge(&V, &vecMax, &vecMin, &vecMax); + // conditionally stores the last value of laststore as well as all but + // the + // last value of vecMin + output += store_unique_xor(laststore, vecMin, output); + laststore = vecMin; + } + uint32_t len = (uint32_t)(output - initoutput); + + // we finish the rest off using a scalar algorithm + // could be improved? + // conditionally stores the last value of laststore as well as all but the + // last value of vecMax, + // we store to "buffer" + int leftoversize = store_unique_xor(laststore, vecMax, buffer); + uint16_t vec7 = _mm_extract_epi16(vecMax, 7); + uint16_t vec6 = _mm_extract_epi16(vecMax, 6); + if (vec7 != vec6) buffer[leftoversize++] = vec7; + if (pos1 == len1) { + memcpy(buffer + leftoversize, array1 + 8 * pos1, + (length1 - 8 * len1) * sizeof(uint16_t)); + leftoversize += length1 - 8 * len1; + if (leftoversize == 0) { // trivial case + memcpy(output, array2 + 8 * pos2, + (length2 - 8 * pos2) * sizeof(uint16_t)); + len += (length2 - 8 * pos2); + } else { + qsort(buffer, leftoversize, sizeof(uint16_t), uint16_compare); + leftoversize = unique_xor(buffer, leftoversize); + len += xor_uint16(buffer, leftoversize, array2 + 8 * pos2, + length2 - 8 * pos2, output); + } + } else { + memcpy(buffer + leftoversize, array2 + 8 * pos2, + (length2 - 8 * len2) * sizeof(uint16_t)); + leftoversize += length2 - 8 * len2; + if (leftoversize == 0) { // trivial case + memcpy(output, array1 + 8 * pos1, + (length1 - 8 * pos1) * sizeof(uint16_t)); + len += (length1 - 8 * pos1); + } else { + qsort(buffer, leftoversize, sizeof(uint16_t), uint16_compare); + leftoversize = unique_xor(buffer, leftoversize); + len += xor_uint16(buffer, leftoversize, array1 + 8 * pos1, + length1 - 8 * pos1, output); + } + } + return len; +} +CROARING_UNTARGET_REGION +/** + * End of SIMD 16-bit XOR code + */ + +#endif // CROARING_IS_X64 + +size_t union_uint32(const uint32_t *set_1, size_t size_1, const uint32_t *set_2, + size_t size_2, uint32_t *buffer) { + size_t pos = 0, idx_1 = 0, idx_2 = 0; + + if (0 == size_2) { + memmove(buffer, set_1, size_1 * sizeof(uint32_t)); + return size_1; + } + if (0 == size_1) { + memmove(buffer, set_2, size_2 * sizeof(uint32_t)); + return size_2; + } + + uint32_t val_1 = set_1[idx_1], val_2 = set_2[idx_2]; + + while (true) { + if (val_1 < val_2) { + buffer[pos++] = val_1; + ++idx_1; + if (idx_1 >= size_1) break; + val_1 = set_1[idx_1]; + } else if (val_2 < val_1) { + buffer[pos++] = val_2; + ++idx_2; + if (idx_2 >= size_2) break; + val_2 = set_2[idx_2]; + } else { + buffer[pos++] = val_1; + ++idx_1; + ++idx_2; + if (idx_1 >= size_1 || idx_2 >= size_2) break; + val_1 = set_1[idx_1]; + val_2 = set_2[idx_2]; + } + } + + if (idx_1 < size_1) { + const size_t n_elems = size_1 - idx_1; + memmove(buffer + pos, set_1 + idx_1, n_elems * sizeof(uint32_t)); + pos += n_elems; + } else if (idx_2 < size_2) { + const size_t n_elems = size_2 - idx_2; + memmove(buffer + pos, set_2 + idx_2, n_elems * sizeof(uint32_t)); + pos += n_elems; + } + + return pos; +} + +size_t union_uint32_card(const uint32_t *set_1, size_t size_1, + const uint32_t *set_2, size_t size_2) { + size_t pos = 0, idx_1 = 0, idx_2 = 0; + + if (0 == size_2) { + return size_1; + } + if (0 == size_1) { + return size_2; + } + + uint32_t val_1 = set_1[idx_1], val_2 = set_2[idx_2]; + + while (true) { + if (val_1 < val_2) { + ++idx_1; + ++pos; + if (idx_1 >= size_1) break; + val_1 = set_1[idx_1]; + } else if (val_2 < val_1) { + ++idx_2; + ++pos; + if (idx_2 >= size_2) break; + val_2 = set_2[idx_2]; + } else { + ++idx_1; + ++idx_2; + ++pos; + if (idx_1 >= size_1 || idx_2 >= size_2) break; + val_1 = set_1[idx_1]; + val_2 = set_2[idx_2]; + } + } + + if (idx_1 < size_1) { + const size_t n_elems = size_1 - idx_1; + pos += n_elems; + } else if (idx_2 < size_2) { + const size_t n_elems = size_2 - idx_2; + pos += n_elems; + } + return pos; +} + + + +size_t fast_union_uint16(const uint16_t *set_1, size_t size_1, const uint16_t *set_2, + size_t size_2, uint16_t *buffer) { +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + // compute union with smallest array first + if (size_1 < size_2) { + return union_vector16(set_1, (uint32_t)size_1, + set_2, (uint32_t)size_2, buffer); + } else { + return union_vector16(set_2, (uint32_t)size_2, + set_1, (uint32_t)size_1, buffer); + } + } else { + // compute union with smallest array first + if (size_1 < size_2) { + return union_uint16( + set_1, size_1, set_2, size_2, buffer); + } else { + return union_uint16( + set_2, size_2, set_1, size_1, buffer); + } + } +#else + // compute union with smallest array first + if (size_1 < size_2) { + return union_uint16( + set_1, size_1, set_2, size_2, buffer); + } else { + return union_uint16( + set_2, size_2, set_1, size_1, buffer); + } +#endif +} +#ifdef CROARING_IS_X64 +CROARING_TARGET_AVX2 +static inline bool _avx2_memequals(const void *s1, const void *s2, size_t n) { + const uint8_t *ptr1 = (const uint8_t *)s1; + const uint8_t *ptr2 = (const uint8_t *)s2; + const uint8_t *end1 = ptr1 + n; + const uint8_t *end8 = ptr1 + n/8*8; + const uint8_t *end32 = ptr1 + n/32*32; + + while (ptr1 < end32) { + __m256i r1 = _mm256_loadu_si256((const __m256i*)ptr1); + __m256i r2 = _mm256_loadu_si256((const __m256i*)ptr2); + int mask = _mm256_movemask_epi8(_mm256_cmpeq_epi8(r1, r2)); + if ((uint32_t)mask != UINT32_MAX) { + return false; + } + ptr1 += 32; + ptr2 += 32; + } + + while (ptr1 < end8) { + uint64_t v1, v2; + memcpy(&v1,ptr1,sizeof(uint64_t)); + memcpy(&v2,ptr2,sizeof(uint64_t)); + if (v1 != v2) { + return false; + } + ptr1 += 8; + ptr2 += 8; + } + + while (ptr1 < end1) { + if (*ptr1 != *ptr2) { + return false; + } + ptr1++; + ptr2++; + } + + return true; +} +CROARING_UNTARGET_REGION +#endif + +bool memequals(const void *s1, const void *s2, size_t n) { + if (n == 0) { + return true; + } +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + return _avx2_memequals(s1, s2, n); + } else { + return memcmp(s1, s2, n) == 0; + } +#else + return memcmp(s1, s2, n) == 0; +#endif +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/array_util.c */ +/* begin file src/bitset_util.c */ +#include +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +#ifdef CROARING_IS_X64 +static uint8_t lengthTable[256] = { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, + 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, + 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, + 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, + 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, + 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; +#endif + +#ifdef CROARING_IS_X64 +ALIGNED(32) +static uint32_t vecDecodeTable[256][8] = { + {0, 0, 0, 0, 0, 0, 0, 0}, /* 0x00 (00000000) */ + {1, 0, 0, 0, 0, 0, 0, 0}, /* 0x01 (00000001) */ + {2, 0, 0, 0, 0, 0, 0, 0}, /* 0x02 (00000010) */ + {1, 2, 0, 0, 0, 0, 0, 0}, /* 0x03 (00000011) */ + {3, 0, 0, 0, 0, 0, 0, 0}, /* 0x04 (00000100) */ + {1, 3, 0, 0, 0, 0, 0, 0}, /* 0x05 (00000101) */ + {2, 3, 0, 0, 0, 0, 0, 0}, /* 0x06 (00000110) */ + {1, 2, 3, 0, 0, 0, 0, 0}, /* 0x07 (00000111) */ + {4, 0, 0, 0, 0, 0, 0, 0}, /* 0x08 (00001000) */ + {1, 4, 0, 0, 0, 0, 0, 0}, /* 0x09 (00001001) */ + {2, 4, 0, 0, 0, 0, 0, 0}, /* 0x0A (00001010) */ + {1, 2, 4, 0, 0, 0, 0, 0}, /* 0x0B (00001011) */ + {3, 4, 0, 0, 0, 0, 0, 0}, /* 0x0C (00001100) */ + {1, 3, 4, 0, 0, 0, 0, 0}, /* 0x0D (00001101) */ + {2, 3, 4, 0, 0, 0, 0, 0}, /* 0x0E (00001110) */ + {1, 2, 3, 4, 0, 0, 0, 0}, /* 0x0F (00001111) */ + {5, 0, 0, 0, 0, 0, 0, 0}, /* 0x10 (00010000) */ + {1, 5, 0, 0, 0, 0, 0, 0}, /* 0x11 (00010001) */ + {2, 5, 0, 0, 0, 0, 0, 0}, /* 0x12 (00010010) */ + {1, 2, 5, 0, 0, 0, 0, 0}, /* 0x13 (00010011) */ + {3, 5, 0, 0, 0, 0, 0, 0}, /* 0x14 (00010100) */ + {1, 3, 5, 0, 0, 0, 0, 0}, /* 0x15 (00010101) */ + {2, 3, 5, 0, 0, 0, 0, 0}, /* 0x16 (00010110) */ + {1, 2, 3, 5, 0, 0, 0, 0}, /* 0x17 (00010111) */ + {4, 5, 0, 0, 0, 0, 0, 0}, /* 0x18 (00011000) */ + {1, 4, 5, 0, 0, 0, 0, 0}, /* 0x19 (00011001) */ + {2, 4, 5, 0, 0, 0, 0, 0}, /* 0x1A (00011010) */ + {1, 2, 4, 5, 0, 0, 0, 0}, /* 0x1B (00011011) */ + {3, 4, 5, 0, 0, 0, 0, 0}, /* 0x1C (00011100) */ + {1, 3, 4, 5, 0, 0, 0, 0}, /* 0x1D (00011101) */ + {2, 3, 4, 5, 0, 0, 0, 0}, /* 0x1E (00011110) */ + {1, 2, 3, 4, 5, 0, 0, 0}, /* 0x1F (00011111) */ + {6, 0, 0, 0, 0, 0, 0, 0}, /* 0x20 (00100000) */ + {1, 6, 0, 0, 0, 0, 0, 0}, /* 0x21 (00100001) */ + {2, 6, 0, 0, 0, 0, 0, 0}, /* 0x22 (00100010) */ + {1, 2, 6, 0, 0, 0, 0, 0}, /* 0x23 (00100011) */ + {3, 6, 0, 0, 0, 0, 0, 0}, /* 0x24 (00100100) */ + {1, 3, 6, 0, 0, 0, 0, 0}, /* 0x25 (00100101) */ + {2, 3, 6, 0, 0, 0, 0, 0}, /* 0x26 (00100110) */ + {1, 2, 3, 6, 0, 0, 0, 0}, /* 0x27 (00100111) */ + {4, 6, 0, 0, 0, 0, 0, 0}, /* 0x28 (00101000) */ + {1, 4, 6, 0, 0, 0, 0, 0}, /* 0x29 (00101001) */ + {2, 4, 6, 0, 0, 0, 0, 0}, /* 0x2A (00101010) */ + {1, 2, 4, 6, 0, 0, 0, 0}, /* 0x2B (00101011) */ + {3, 4, 6, 0, 0, 0, 0, 0}, /* 0x2C (00101100) */ + {1, 3, 4, 6, 0, 0, 0, 0}, /* 0x2D (00101101) */ + {2, 3, 4, 6, 0, 0, 0, 0}, /* 0x2E (00101110) */ + {1, 2, 3, 4, 6, 0, 0, 0}, /* 0x2F (00101111) */ + {5, 6, 0, 0, 0, 0, 0, 0}, /* 0x30 (00110000) */ + {1, 5, 6, 0, 0, 0, 0, 0}, /* 0x31 (00110001) */ + {2, 5, 6, 0, 0, 0, 0, 0}, /* 0x32 (00110010) */ + {1, 2, 5, 6, 0, 0, 0, 0}, /* 0x33 (00110011) */ + {3, 5, 6, 0, 0, 0, 0, 0}, /* 0x34 (00110100) */ + {1, 3, 5, 6, 0, 0, 0, 0}, /* 0x35 (00110101) */ + {2, 3, 5, 6, 0, 0, 0, 0}, /* 0x36 (00110110) */ + {1, 2, 3, 5, 6, 0, 0, 0}, /* 0x37 (00110111) */ + {4, 5, 6, 0, 0, 0, 0, 0}, /* 0x38 (00111000) */ + {1, 4, 5, 6, 0, 0, 0, 0}, /* 0x39 (00111001) */ + {2, 4, 5, 6, 0, 0, 0, 0}, /* 0x3A (00111010) */ + {1, 2, 4, 5, 6, 0, 0, 0}, /* 0x3B (00111011) */ + {3, 4, 5, 6, 0, 0, 0, 0}, /* 0x3C (00111100) */ + {1, 3, 4, 5, 6, 0, 0, 0}, /* 0x3D (00111101) */ + {2, 3, 4, 5, 6, 0, 0, 0}, /* 0x3E (00111110) */ + {1, 2, 3, 4, 5, 6, 0, 0}, /* 0x3F (00111111) */ + {7, 0, 0, 0, 0, 0, 0, 0}, /* 0x40 (01000000) */ + {1, 7, 0, 0, 0, 0, 0, 0}, /* 0x41 (01000001) */ + {2, 7, 0, 0, 0, 0, 0, 0}, /* 0x42 (01000010) */ + {1, 2, 7, 0, 0, 0, 0, 0}, /* 0x43 (01000011) */ + {3, 7, 0, 0, 0, 0, 0, 0}, /* 0x44 (01000100) */ + {1, 3, 7, 0, 0, 0, 0, 0}, /* 0x45 (01000101) */ + {2, 3, 7, 0, 0, 0, 0, 0}, /* 0x46 (01000110) */ + {1, 2, 3, 7, 0, 0, 0, 0}, /* 0x47 (01000111) */ + {4, 7, 0, 0, 0, 0, 0, 0}, /* 0x48 (01001000) */ + {1, 4, 7, 0, 0, 0, 0, 0}, /* 0x49 (01001001) */ + {2, 4, 7, 0, 0, 0, 0, 0}, /* 0x4A (01001010) */ + {1, 2, 4, 7, 0, 0, 0, 0}, /* 0x4B (01001011) */ + {3, 4, 7, 0, 0, 0, 0, 0}, /* 0x4C (01001100) */ + {1, 3, 4, 7, 0, 0, 0, 0}, /* 0x4D (01001101) */ + {2, 3, 4, 7, 0, 0, 0, 0}, /* 0x4E (01001110) */ + {1, 2, 3, 4, 7, 0, 0, 0}, /* 0x4F (01001111) */ + {5, 7, 0, 0, 0, 0, 0, 0}, /* 0x50 (01010000) */ + {1, 5, 7, 0, 0, 0, 0, 0}, /* 0x51 (01010001) */ + {2, 5, 7, 0, 0, 0, 0, 0}, /* 0x52 (01010010) */ + {1, 2, 5, 7, 0, 0, 0, 0}, /* 0x53 (01010011) */ + {3, 5, 7, 0, 0, 0, 0, 0}, /* 0x54 (01010100) */ + {1, 3, 5, 7, 0, 0, 0, 0}, /* 0x55 (01010101) */ + {2, 3, 5, 7, 0, 0, 0, 0}, /* 0x56 (01010110) */ + {1, 2, 3, 5, 7, 0, 0, 0}, /* 0x57 (01010111) */ + {4, 5, 7, 0, 0, 0, 0, 0}, /* 0x58 (01011000) */ + {1, 4, 5, 7, 0, 0, 0, 0}, /* 0x59 (01011001) */ + {2, 4, 5, 7, 0, 0, 0, 0}, /* 0x5A (01011010) */ + {1, 2, 4, 5, 7, 0, 0, 0}, /* 0x5B (01011011) */ + {3, 4, 5, 7, 0, 0, 0, 0}, /* 0x5C (01011100) */ + {1, 3, 4, 5, 7, 0, 0, 0}, /* 0x5D (01011101) */ + {2, 3, 4, 5, 7, 0, 0, 0}, /* 0x5E (01011110) */ + {1, 2, 3, 4, 5, 7, 0, 0}, /* 0x5F (01011111) */ + {6, 7, 0, 0, 0, 0, 0, 0}, /* 0x60 (01100000) */ + {1, 6, 7, 0, 0, 0, 0, 0}, /* 0x61 (01100001) */ + {2, 6, 7, 0, 0, 0, 0, 0}, /* 0x62 (01100010) */ + {1, 2, 6, 7, 0, 0, 0, 0}, /* 0x63 (01100011) */ + {3, 6, 7, 0, 0, 0, 0, 0}, /* 0x64 (01100100) */ + {1, 3, 6, 7, 0, 0, 0, 0}, /* 0x65 (01100101) */ + {2, 3, 6, 7, 0, 0, 0, 0}, /* 0x66 (01100110) */ + {1, 2, 3, 6, 7, 0, 0, 0}, /* 0x67 (01100111) */ + {4, 6, 7, 0, 0, 0, 0, 0}, /* 0x68 (01101000) */ + {1, 4, 6, 7, 0, 0, 0, 0}, /* 0x69 (01101001) */ + {2, 4, 6, 7, 0, 0, 0, 0}, /* 0x6A (01101010) */ + {1, 2, 4, 6, 7, 0, 0, 0}, /* 0x6B (01101011) */ + {3, 4, 6, 7, 0, 0, 0, 0}, /* 0x6C (01101100) */ + {1, 3, 4, 6, 7, 0, 0, 0}, /* 0x6D (01101101) */ + {2, 3, 4, 6, 7, 0, 0, 0}, /* 0x6E (01101110) */ + {1, 2, 3, 4, 6, 7, 0, 0}, /* 0x6F (01101111) */ + {5, 6, 7, 0, 0, 0, 0, 0}, /* 0x70 (01110000) */ + {1, 5, 6, 7, 0, 0, 0, 0}, /* 0x71 (01110001) */ + {2, 5, 6, 7, 0, 0, 0, 0}, /* 0x72 (01110010) */ + {1, 2, 5, 6, 7, 0, 0, 0}, /* 0x73 (01110011) */ + {3, 5, 6, 7, 0, 0, 0, 0}, /* 0x74 (01110100) */ + {1, 3, 5, 6, 7, 0, 0, 0}, /* 0x75 (01110101) */ + {2, 3, 5, 6, 7, 0, 0, 0}, /* 0x76 (01110110) */ + {1, 2, 3, 5, 6, 7, 0, 0}, /* 0x77 (01110111) */ + {4, 5, 6, 7, 0, 0, 0, 0}, /* 0x78 (01111000) */ + {1, 4, 5, 6, 7, 0, 0, 0}, /* 0x79 (01111001) */ + {2, 4, 5, 6, 7, 0, 0, 0}, /* 0x7A (01111010) */ + {1, 2, 4, 5, 6, 7, 0, 0}, /* 0x7B (01111011) */ + {3, 4, 5, 6, 7, 0, 0, 0}, /* 0x7C (01111100) */ + {1, 3, 4, 5, 6, 7, 0, 0}, /* 0x7D (01111101) */ + {2, 3, 4, 5, 6, 7, 0, 0}, /* 0x7E (01111110) */ + {1, 2, 3, 4, 5, 6, 7, 0}, /* 0x7F (01111111) */ + {8, 0, 0, 0, 0, 0, 0, 0}, /* 0x80 (10000000) */ + {1, 8, 0, 0, 0, 0, 0, 0}, /* 0x81 (10000001) */ + {2, 8, 0, 0, 0, 0, 0, 0}, /* 0x82 (10000010) */ + {1, 2, 8, 0, 0, 0, 0, 0}, /* 0x83 (10000011) */ + {3, 8, 0, 0, 0, 0, 0, 0}, /* 0x84 (10000100) */ + {1, 3, 8, 0, 0, 0, 0, 0}, /* 0x85 (10000101) */ + {2, 3, 8, 0, 0, 0, 0, 0}, /* 0x86 (10000110) */ + {1, 2, 3, 8, 0, 0, 0, 0}, /* 0x87 (10000111) */ + {4, 8, 0, 0, 0, 0, 0, 0}, /* 0x88 (10001000) */ + {1, 4, 8, 0, 0, 0, 0, 0}, /* 0x89 (10001001) */ + {2, 4, 8, 0, 0, 0, 0, 0}, /* 0x8A (10001010) */ + {1, 2, 4, 8, 0, 0, 0, 0}, /* 0x8B (10001011) */ + {3, 4, 8, 0, 0, 0, 0, 0}, /* 0x8C (10001100) */ + {1, 3, 4, 8, 0, 0, 0, 0}, /* 0x8D (10001101) */ + {2, 3, 4, 8, 0, 0, 0, 0}, /* 0x8E (10001110) */ + {1, 2, 3, 4, 8, 0, 0, 0}, /* 0x8F (10001111) */ + {5, 8, 0, 0, 0, 0, 0, 0}, /* 0x90 (10010000) */ + {1, 5, 8, 0, 0, 0, 0, 0}, /* 0x91 (10010001) */ + {2, 5, 8, 0, 0, 0, 0, 0}, /* 0x92 (10010010) */ + {1, 2, 5, 8, 0, 0, 0, 0}, /* 0x93 (10010011) */ + {3, 5, 8, 0, 0, 0, 0, 0}, /* 0x94 (10010100) */ + {1, 3, 5, 8, 0, 0, 0, 0}, /* 0x95 (10010101) */ + {2, 3, 5, 8, 0, 0, 0, 0}, /* 0x96 (10010110) */ + {1, 2, 3, 5, 8, 0, 0, 0}, /* 0x97 (10010111) */ + {4, 5, 8, 0, 0, 0, 0, 0}, /* 0x98 (10011000) */ + {1, 4, 5, 8, 0, 0, 0, 0}, /* 0x99 (10011001) */ + {2, 4, 5, 8, 0, 0, 0, 0}, /* 0x9A (10011010) */ + {1, 2, 4, 5, 8, 0, 0, 0}, /* 0x9B (10011011) */ + {3, 4, 5, 8, 0, 0, 0, 0}, /* 0x9C (10011100) */ + {1, 3, 4, 5, 8, 0, 0, 0}, /* 0x9D (10011101) */ + {2, 3, 4, 5, 8, 0, 0, 0}, /* 0x9E (10011110) */ + {1, 2, 3, 4, 5, 8, 0, 0}, /* 0x9F (10011111) */ + {6, 8, 0, 0, 0, 0, 0, 0}, /* 0xA0 (10100000) */ + {1, 6, 8, 0, 0, 0, 0, 0}, /* 0xA1 (10100001) */ + {2, 6, 8, 0, 0, 0, 0, 0}, /* 0xA2 (10100010) */ + {1, 2, 6, 8, 0, 0, 0, 0}, /* 0xA3 (10100011) */ + {3, 6, 8, 0, 0, 0, 0, 0}, /* 0xA4 (10100100) */ + {1, 3, 6, 8, 0, 0, 0, 0}, /* 0xA5 (10100101) */ + {2, 3, 6, 8, 0, 0, 0, 0}, /* 0xA6 (10100110) */ + {1, 2, 3, 6, 8, 0, 0, 0}, /* 0xA7 (10100111) */ + {4, 6, 8, 0, 0, 0, 0, 0}, /* 0xA8 (10101000) */ + {1, 4, 6, 8, 0, 0, 0, 0}, /* 0xA9 (10101001) */ + {2, 4, 6, 8, 0, 0, 0, 0}, /* 0xAA (10101010) */ + {1, 2, 4, 6, 8, 0, 0, 0}, /* 0xAB (10101011) */ + {3, 4, 6, 8, 0, 0, 0, 0}, /* 0xAC (10101100) */ + {1, 3, 4, 6, 8, 0, 0, 0}, /* 0xAD (10101101) */ + {2, 3, 4, 6, 8, 0, 0, 0}, /* 0xAE (10101110) */ + {1, 2, 3, 4, 6, 8, 0, 0}, /* 0xAF (10101111) */ + {5, 6, 8, 0, 0, 0, 0, 0}, /* 0xB0 (10110000) */ + {1, 5, 6, 8, 0, 0, 0, 0}, /* 0xB1 (10110001) */ + {2, 5, 6, 8, 0, 0, 0, 0}, /* 0xB2 (10110010) */ + {1, 2, 5, 6, 8, 0, 0, 0}, /* 0xB3 (10110011) */ + {3, 5, 6, 8, 0, 0, 0, 0}, /* 0xB4 (10110100) */ + {1, 3, 5, 6, 8, 0, 0, 0}, /* 0xB5 (10110101) */ + {2, 3, 5, 6, 8, 0, 0, 0}, /* 0xB6 (10110110) */ + {1, 2, 3, 5, 6, 8, 0, 0}, /* 0xB7 (10110111) */ + {4, 5, 6, 8, 0, 0, 0, 0}, /* 0xB8 (10111000) */ + {1, 4, 5, 6, 8, 0, 0, 0}, /* 0xB9 (10111001) */ + {2, 4, 5, 6, 8, 0, 0, 0}, /* 0xBA (10111010) */ + {1, 2, 4, 5, 6, 8, 0, 0}, /* 0xBB (10111011) */ + {3, 4, 5, 6, 8, 0, 0, 0}, /* 0xBC (10111100) */ + {1, 3, 4, 5, 6, 8, 0, 0}, /* 0xBD (10111101) */ + {2, 3, 4, 5, 6, 8, 0, 0}, /* 0xBE (10111110) */ + {1, 2, 3, 4, 5, 6, 8, 0}, /* 0xBF (10111111) */ + {7, 8, 0, 0, 0, 0, 0, 0}, /* 0xC0 (11000000) */ + {1, 7, 8, 0, 0, 0, 0, 0}, /* 0xC1 (11000001) */ + {2, 7, 8, 0, 0, 0, 0, 0}, /* 0xC2 (11000010) */ + {1, 2, 7, 8, 0, 0, 0, 0}, /* 0xC3 (11000011) */ + {3, 7, 8, 0, 0, 0, 0, 0}, /* 0xC4 (11000100) */ + {1, 3, 7, 8, 0, 0, 0, 0}, /* 0xC5 (11000101) */ + {2, 3, 7, 8, 0, 0, 0, 0}, /* 0xC6 (11000110) */ + {1, 2, 3, 7, 8, 0, 0, 0}, /* 0xC7 (11000111) */ + {4, 7, 8, 0, 0, 0, 0, 0}, /* 0xC8 (11001000) */ + {1, 4, 7, 8, 0, 0, 0, 0}, /* 0xC9 (11001001) */ + {2, 4, 7, 8, 0, 0, 0, 0}, /* 0xCA (11001010) */ + {1, 2, 4, 7, 8, 0, 0, 0}, /* 0xCB (11001011) */ + {3, 4, 7, 8, 0, 0, 0, 0}, /* 0xCC (11001100) */ + {1, 3, 4, 7, 8, 0, 0, 0}, /* 0xCD (11001101) */ + {2, 3, 4, 7, 8, 0, 0, 0}, /* 0xCE (11001110) */ + {1, 2, 3, 4, 7, 8, 0, 0}, /* 0xCF (11001111) */ + {5, 7, 8, 0, 0, 0, 0, 0}, /* 0xD0 (11010000) */ + {1, 5, 7, 8, 0, 0, 0, 0}, /* 0xD1 (11010001) */ + {2, 5, 7, 8, 0, 0, 0, 0}, /* 0xD2 (11010010) */ + {1, 2, 5, 7, 8, 0, 0, 0}, /* 0xD3 (11010011) */ + {3, 5, 7, 8, 0, 0, 0, 0}, /* 0xD4 (11010100) */ + {1, 3, 5, 7, 8, 0, 0, 0}, /* 0xD5 (11010101) */ + {2, 3, 5, 7, 8, 0, 0, 0}, /* 0xD6 (11010110) */ + {1, 2, 3, 5, 7, 8, 0, 0}, /* 0xD7 (11010111) */ + {4, 5, 7, 8, 0, 0, 0, 0}, /* 0xD8 (11011000) */ + {1, 4, 5, 7, 8, 0, 0, 0}, /* 0xD9 (11011001) */ + {2, 4, 5, 7, 8, 0, 0, 0}, /* 0xDA (11011010) */ + {1, 2, 4, 5, 7, 8, 0, 0}, /* 0xDB (11011011) */ + {3, 4, 5, 7, 8, 0, 0, 0}, /* 0xDC (11011100) */ + {1, 3, 4, 5, 7, 8, 0, 0}, /* 0xDD (11011101) */ + {2, 3, 4, 5, 7, 8, 0, 0}, /* 0xDE (11011110) */ + {1, 2, 3, 4, 5, 7, 8, 0}, /* 0xDF (11011111) */ + {6, 7, 8, 0, 0, 0, 0, 0}, /* 0xE0 (11100000) */ + {1, 6, 7, 8, 0, 0, 0, 0}, /* 0xE1 (11100001) */ + {2, 6, 7, 8, 0, 0, 0, 0}, /* 0xE2 (11100010) */ + {1, 2, 6, 7, 8, 0, 0, 0}, /* 0xE3 (11100011) */ + {3, 6, 7, 8, 0, 0, 0, 0}, /* 0xE4 (11100100) */ + {1, 3, 6, 7, 8, 0, 0, 0}, /* 0xE5 (11100101) */ + {2, 3, 6, 7, 8, 0, 0, 0}, /* 0xE6 (11100110) */ + {1, 2, 3, 6, 7, 8, 0, 0}, /* 0xE7 (11100111) */ + {4, 6, 7, 8, 0, 0, 0, 0}, /* 0xE8 (11101000) */ + {1, 4, 6, 7, 8, 0, 0, 0}, /* 0xE9 (11101001) */ + {2, 4, 6, 7, 8, 0, 0, 0}, /* 0xEA (11101010) */ + {1, 2, 4, 6, 7, 8, 0, 0}, /* 0xEB (11101011) */ + {3, 4, 6, 7, 8, 0, 0, 0}, /* 0xEC (11101100) */ + {1, 3, 4, 6, 7, 8, 0, 0}, /* 0xED (11101101) */ + {2, 3, 4, 6, 7, 8, 0, 0}, /* 0xEE (11101110) */ + {1, 2, 3, 4, 6, 7, 8, 0}, /* 0xEF (11101111) */ + {5, 6, 7, 8, 0, 0, 0, 0}, /* 0xF0 (11110000) */ + {1, 5, 6, 7, 8, 0, 0, 0}, /* 0xF1 (11110001) */ + {2, 5, 6, 7, 8, 0, 0, 0}, /* 0xF2 (11110010) */ + {1, 2, 5, 6, 7, 8, 0, 0}, /* 0xF3 (11110011) */ + {3, 5, 6, 7, 8, 0, 0, 0}, /* 0xF4 (11110100) */ + {1, 3, 5, 6, 7, 8, 0, 0}, /* 0xF5 (11110101) */ + {2, 3, 5, 6, 7, 8, 0, 0}, /* 0xF6 (11110110) */ + {1, 2, 3, 5, 6, 7, 8, 0}, /* 0xF7 (11110111) */ + {4, 5, 6, 7, 8, 0, 0, 0}, /* 0xF8 (11111000) */ + {1, 4, 5, 6, 7, 8, 0, 0}, /* 0xF9 (11111001) */ + {2, 4, 5, 6, 7, 8, 0, 0}, /* 0xFA (11111010) */ + {1, 2, 4, 5, 6, 7, 8, 0}, /* 0xFB (11111011) */ + {3, 4, 5, 6, 7, 8, 0, 0}, /* 0xFC (11111100) */ + {1, 3, 4, 5, 6, 7, 8, 0}, /* 0xFD (11111101) */ + {2, 3, 4, 5, 6, 7, 8, 0}, /* 0xFE (11111110) */ + {1, 2, 3, 4, 5, 6, 7, 8} /* 0xFF (11111111) */ +}; + +#endif // #ifdef CROARING_IS_X64 + +#ifdef CROARING_IS_X64 +// same as vecDecodeTable but in 16 bits +ALIGNED(32) +static uint16_t vecDecodeTable_uint16[256][8] = { + {0, 0, 0, 0, 0, 0, 0, 0}, /* 0x00 (00000000) */ + {1, 0, 0, 0, 0, 0, 0, 0}, /* 0x01 (00000001) */ + {2, 0, 0, 0, 0, 0, 0, 0}, /* 0x02 (00000010) */ + {1, 2, 0, 0, 0, 0, 0, 0}, /* 0x03 (00000011) */ + {3, 0, 0, 0, 0, 0, 0, 0}, /* 0x04 (00000100) */ + {1, 3, 0, 0, 0, 0, 0, 0}, /* 0x05 (00000101) */ + {2, 3, 0, 0, 0, 0, 0, 0}, /* 0x06 (00000110) */ + {1, 2, 3, 0, 0, 0, 0, 0}, /* 0x07 (00000111) */ + {4, 0, 0, 0, 0, 0, 0, 0}, /* 0x08 (00001000) */ + {1, 4, 0, 0, 0, 0, 0, 0}, /* 0x09 (00001001) */ + {2, 4, 0, 0, 0, 0, 0, 0}, /* 0x0A (00001010) */ + {1, 2, 4, 0, 0, 0, 0, 0}, /* 0x0B (00001011) */ + {3, 4, 0, 0, 0, 0, 0, 0}, /* 0x0C (00001100) */ + {1, 3, 4, 0, 0, 0, 0, 0}, /* 0x0D (00001101) */ + {2, 3, 4, 0, 0, 0, 0, 0}, /* 0x0E (00001110) */ + {1, 2, 3, 4, 0, 0, 0, 0}, /* 0x0F (00001111) */ + {5, 0, 0, 0, 0, 0, 0, 0}, /* 0x10 (00010000) */ + {1, 5, 0, 0, 0, 0, 0, 0}, /* 0x11 (00010001) */ + {2, 5, 0, 0, 0, 0, 0, 0}, /* 0x12 (00010010) */ + {1, 2, 5, 0, 0, 0, 0, 0}, /* 0x13 (00010011) */ + {3, 5, 0, 0, 0, 0, 0, 0}, /* 0x14 (00010100) */ + {1, 3, 5, 0, 0, 0, 0, 0}, /* 0x15 (00010101) */ + {2, 3, 5, 0, 0, 0, 0, 0}, /* 0x16 (00010110) */ + {1, 2, 3, 5, 0, 0, 0, 0}, /* 0x17 (00010111) */ + {4, 5, 0, 0, 0, 0, 0, 0}, /* 0x18 (00011000) */ + {1, 4, 5, 0, 0, 0, 0, 0}, /* 0x19 (00011001) */ + {2, 4, 5, 0, 0, 0, 0, 0}, /* 0x1A (00011010) */ + {1, 2, 4, 5, 0, 0, 0, 0}, /* 0x1B (00011011) */ + {3, 4, 5, 0, 0, 0, 0, 0}, /* 0x1C (00011100) */ + {1, 3, 4, 5, 0, 0, 0, 0}, /* 0x1D (00011101) */ + {2, 3, 4, 5, 0, 0, 0, 0}, /* 0x1E (00011110) */ + {1, 2, 3, 4, 5, 0, 0, 0}, /* 0x1F (00011111) */ + {6, 0, 0, 0, 0, 0, 0, 0}, /* 0x20 (00100000) */ + {1, 6, 0, 0, 0, 0, 0, 0}, /* 0x21 (00100001) */ + {2, 6, 0, 0, 0, 0, 0, 0}, /* 0x22 (00100010) */ + {1, 2, 6, 0, 0, 0, 0, 0}, /* 0x23 (00100011) */ + {3, 6, 0, 0, 0, 0, 0, 0}, /* 0x24 (00100100) */ + {1, 3, 6, 0, 0, 0, 0, 0}, /* 0x25 (00100101) */ + {2, 3, 6, 0, 0, 0, 0, 0}, /* 0x26 (00100110) */ + {1, 2, 3, 6, 0, 0, 0, 0}, /* 0x27 (00100111) */ + {4, 6, 0, 0, 0, 0, 0, 0}, /* 0x28 (00101000) */ + {1, 4, 6, 0, 0, 0, 0, 0}, /* 0x29 (00101001) */ + {2, 4, 6, 0, 0, 0, 0, 0}, /* 0x2A (00101010) */ + {1, 2, 4, 6, 0, 0, 0, 0}, /* 0x2B (00101011) */ + {3, 4, 6, 0, 0, 0, 0, 0}, /* 0x2C (00101100) */ + {1, 3, 4, 6, 0, 0, 0, 0}, /* 0x2D (00101101) */ + {2, 3, 4, 6, 0, 0, 0, 0}, /* 0x2E (00101110) */ + {1, 2, 3, 4, 6, 0, 0, 0}, /* 0x2F (00101111) */ + {5, 6, 0, 0, 0, 0, 0, 0}, /* 0x30 (00110000) */ + {1, 5, 6, 0, 0, 0, 0, 0}, /* 0x31 (00110001) */ + {2, 5, 6, 0, 0, 0, 0, 0}, /* 0x32 (00110010) */ + {1, 2, 5, 6, 0, 0, 0, 0}, /* 0x33 (00110011) */ + {3, 5, 6, 0, 0, 0, 0, 0}, /* 0x34 (00110100) */ + {1, 3, 5, 6, 0, 0, 0, 0}, /* 0x35 (00110101) */ + {2, 3, 5, 6, 0, 0, 0, 0}, /* 0x36 (00110110) */ + {1, 2, 3, 5, 6, 0, 0, 0}, /* 0x37 (00110111) */ + {4, 5, 6, 0, 0, 0, 0, 0}, /* 0x38 (00111000) */ + {1, 4, 5, 6, 0, 0, 0, 0}, /* 0x39 (00111001) */ + {2, 4, 5, 6, 0, 0, 0, 0}, /* 0x3A (00111010) */ + {1, 2, 4, 5, 6, 0, 0, 0}, /* 0x3B (00111011) */ + {3, 4, 5, 6, 0, 0, 0, 0}, /* 0x3C (00111100) */ + {1, 3, 4, 5, 6, 0, 0, 0}, /* 0x3D (00111101) */ + {2, 3, 4, 5, 6, 0, 0, 0}, /* 0x3E (00111110) */ + {1, 2, 3, 4, 5, 6, 0, 0}, /* 0x3F (00111111) */ + {7, 0, 0, 0, 0, 0, 0, 0}, /* 0x40 (01000000) */ + {1, 7, 0, 0, 0, 0, 0, 0}, /* 0x41 (01000001) */ + {2, 7, 0, 0, 0, 0, 0, 0}, /* 0x42 (01000010) */ + {1, 2, 7, 0, 0, 0, 0, 0}, /* 0x43 (01000011) */ + {3, 7, 0, 0, 0, 0, 0, 0}, /* 0x44 (01000100) */ + {1, 3, 7, 0, 0, 0, 0, 0}, /* 0x45 (01000101) */ + {2, 3, 7, 0, 0, 0, 0, 0}, /* 0x46 (01000110) */ + {1, 2, 3, 7, 0, 0, 0, 0}, /* 0x47 (01000111) */ + {4, 7, 0, 0, 0, 0, 0, 0}, /* 0x48 (01001000) */ + {1, 4, 7, 0, 0, 0, 0, 0}, /* 0x49 (01001001) */ + {2, 4, 7, 0, 0, 0, 0, 0}, /* 0x4A (01001010) */ + {1, 2, 4, 7, 0, 0, 0, 0}, /* 0x4B (01001011) */ + {3, 4, 7, 0, 0, 0, 0, 0}, /* 0x4C (01001100) */ + {1, 3, 4, 7, 0, 0, 0, 0}, /* 0x4D (01001101) */ + {2, 3, 4, 7, 0, 0, 0, 0}, /* 0x4E (01001110) */ + {1, 2, 3, 4, 7, 0, 0, 0}, /* 0x4F (01001111) */ + {5, 7, 0, 0, 0, 0, 0, 0}, /* 0x50 (01010000) */ + {1, 5, 7, 0, 0, 0, 0, 0}, /* 0x51 (01010001) */ + {2, 5, 7, 0, 0, 0, 0, 0}, /* 0x52 (01010010) */ + {1, 2, 5, 7, 0, 0, 0, 0}, /* 0x53 (01010011) */ + {3, 5, 7, 0, 0, 0, 0, 0}, /* 0x54 (01010100) */ + {1, 3, 5, 7, 0, 0, 0, 0}, /* 0x55 (01010101) */ + {2, 3, 5, 7, 0, 0, 0, 0}, /* 0x56 (01010110) */ + {1, 2, 3, 5, 7, 0, 0, 0}, /* 0x57 (01010111) */ + {4, 5, 7, 0, 0, 0, 0, 0}, /* 0x58 (01011000) */ + {1, 4, 5, 7, 0, 0, 0, 0}, /* 0x59 (01011001) */ + {2, 4, 5, 7, 0, 0, 0, 0}, /* 0x5A (01011010) */ + {1, 2, 4, 5, 7, 0, 0, 0}, /* 0x5B (01011011) */ + {3, 4, 5, 7, 0, 0, 0, 0}, /* 0x5C (01011100) */ + {1, 3, 4, 5, 7, 0, 0, 0}, /* 0x5D (01011101) */ + {2, 3, 4, 5, 7, 0, 0, 0}, /* 0x5E (01011110) */ + {1, 2, 3, 4, 5, 7, 0, 0}, /* 0x5F (01011111) */ + {6, 7, 0, 0, 0, 0, 0, 0}, /* 0x60 (01100000) */ + {1, 6, 7, 0, 0, 0, 0, 0}, /* 0x61 (01100001) */ + {2, 6, 7, 0, 0, 0, 0, 0}, /* 0x62 (01100010) */ + {1, 2, 6, 7, 0, 0, 0, 0}, /* 0x63 (01100011) */ + {3, 6, 7, 0, 0, 0, 0, 0}, /* 0x64 (01100100) */ + {1, 3, 6, 7, 0, 0, 0, 0}, /* 0x65 (01100101) */ + {2, 3, 6, 7, 0, 0, 0, 0}, /* 0x66 (01100110) */ + {1, 2, 3, 6, 7, 0, 0, 0}, /* 0x67 (01100111) */ + {4, 6, 7, 0, 0, 0, 0, 0}, /* 0x68 (01101000) */ + {1, 4, 6, 7, 0, 0, 0, 0}, /* 0x69 (01101001) */ + {2, 4, 6, 7, 0, 0, 0, 0}, /* 0x6A (01101010) */ + {1, 2, 4, 6, 7, 0, 0, 0}, /* 0x6B (01101011) */ + {3, 4, 6, 7, 0, 0, 0, 0}, /* 0x6C (01101100) */ + {1, 3, 4, 6, 7, 0, 0, 0}, /* 0x6D (01101101) */ + {2, 3, 4, 6, 7, 0, 0, 0}, /* 0x6E (01101110) */ + {1, 2, 3, 4, 6, 7, 0, 0}, /* 0x6F (01101111) */ + {5, 6, 7, 0, 0, 0, 0, 0}, /* 0x70 (01110000) */ + {1, 5, 6, 7, 0, 0, 0, 0}, /* 0x71 (01110001) */ + {2, 5, 6, 7, 0, 0, 0, 0}, /* 0x72 (01110010) */ + {1, 2, 5, 6, 7, 0, 0, 0}, /* 0x73 (01110011) */ + {3, 5, 6, 7, 0, 0, 0, 0}, /* 0x74 (01110100) */ + {1, 3, 5, 6, 7, 0, 0, 0}, /* 0x75 (01110101) */ + {2, 3, 5, 6, 7, 0, 0, 0}, /* 0x76 (01110110) */ + {1, 2, 3, 5, 6, 7, 0, 0}, /* 0x77 (01110111) */ + {4, 5, 6, 7, 0, 0, 0, 0}, /* 0x78 (01111000) */ + {1, 4, 5, 6, 7, 0, 0, 0}, /* 0x79 (01111001) */ + {2, 4, 5, 6, 7, 0, 0, 0}, /* 0x7A (01111010) */ + {1, 2, 4, 5, 6, 7, 0, 0}, /* 0x7B (01111011) */ + {3, 4, 5, 6, 7, 0, 0, 0}, /* 0x7C (01111100) */ + {1, 3, 4, 5, 6, 7, 0, 0}, /* 0x7D (01111101) */ + {2, 3, 4, 5, 6, 7, 0, 0}, /* 0x7E (01111110) */ + {1, 2, 3, 4, 5, 6, 7, 0}, /* 0x7F (01111111) */ + {8, 0, 0, 0, 0, 0, 0, 0}, /* 0x80 (10000000) */ + {1, 8, 0, 0, 0, 0, 0, 0}, /* 0x81 (10000001) */ + {2, 8, 0, 0, 0, 0, 0, 0}, /* 0x82 (10000010) */ + {1, 2, 8, 0, 0, 0, 0, 0}, /* 0x83 (10000011) */ + {3, 8, 0, 0, 0, 0, 0, 0}, /* 0x84 (10000100) */ + {1, 3, 8, 0, 0, 0, 0, 0}, /* 0x85 (10000101) */ + {2, 3, 8, 0, 0, 0, 0, 0}, /* 0x86 (10000110) */ + {1, 2, 3, 8, 0, 0, 0, 0}, /* 0x87 (10000111) */ + {4, 8, 0, 0, 0, 0, 0, 0}, /* 0x88 (10001000) */ + {1, 4, 8, 0, 0, 0, 0, 0}, /* 0x89 (10001001) */ + {2, 4, 8, 0, 0, 0, 0, 0}, /* 0x8A (10001010) */ + {1, 2, 4, 8, 0, 0, 0, 0}, /* 0x8B (10001011) */ + {3, 4, 8, 0, 0, 0, 0, 0}, /* 0x8C (10001100) */ + {1, 3, 4, 8, 0, 0, 0, 0}, /* 0x8D (10001101) */ + {2, 3, 4, 8, 0, 0, 0, 0}, /* 0x8E (10001110) */ + {1, 2, 3, 4, 8, 0, 0, 0}, /* 0x8F (10001111) */ + {5, 8, 0, 0, 0, 0, 0, 0}, /* 0x90 (10010000) */ + {1, 5, 8, 0, 0, 0, 0, 0}, /* 0x91 (10010001) */ + {2, 5, 8, 0, 0, 0, 0, 0}, /* 0x92 (10010010) */ + {1, 2, 5, 8, 0, 0, 0, 0}, /* 0x93 (10010011) */ + {3, 5, 8, 0, 0, 0, 0, 0}, /* 0x94 (10010100) */ + {1, 3, 5, 8, 0, 0, 0, 0}, /* 0x95 (10010101) */ + {2, 3, 5, 8, 0, 0, 0, 0}, /* 0x96 (10010110) */ + {1, 2, 3, 5, 8, 0, 0, 0}, /* 0x97 (10010111) */ + {4, 5, 8, 0, 0, 0, 0, 0}, /* 0x98 (10011000) */ + {1, 4, 5, 8, 0, 0, 0, 0}, /* 0x99 (10011001) */ + {2, 4, 5, 8, 0, 0, 0, 0}, /* 0x9A (10011010) */ + {1, 2, 4, 5, 8, 0, 0, 0}, /* 0x9B (10011011) */ + {3, 4, 5, 8, 0, 0, 0, 0}, /* 0x9C (10011100) */ + {1, 3, 4, 5, 8, 0, 0, 0}, /* 0x9D (10011101) */ + {2, 3, 4, 5, 8, 0, 0, 0}, /* 0x9E (10011110) */ + {1, 2, 3, 4, 5, 8, 0, 0}, /* 0x9F (10011111) */ + {6, 8, 0, 0, 0, 0, 0, 0}, /* 0xA0 (10100000) */ + {1, 6, 8, 0, 0, 0, 0, 0}, /* 0xA1 (10100001) */ + {2, 6, 8, 0, 0, 0, 0, 0}, /* 0xA2 (10100010) */ + {1, 2, 6, 8, 0, 0, 0, 0}, /* 0xA3 (10100011) */ + {3, 6, 8, 0, 0, 0, 0, 0}, /* 0xA4 (10100100) */ + {1, 3, 6, 8, 0, 0, 0, 0}, /* 0xA5 (10100101) */ + {2, 3, 6, 8, 0, 0, 0, 0}, /* 0xA6 (10100110) */ + {1, 2, 3, 6, 8, 0, 0, 0}, /* 0xA7 (10100111) */ + {4, 6, 8, 0, 0, 0, 0, 0}, /* 0xA8 (10101000) */ + {1, 4, 6, 8, 0, 0, 0, 0}, /* 0xA9 (10101001) */ + {2, 4, 6, 8, 0, 0, 0, 0}, /* 0xAA (10101010) */ + {1, 2, 4, 6, 8, 0, 0, 0}, /* 0xAB (10101011) */ + {3, 4, 6, 8, 0, 0, 0, 0}, /* 0xAC (10101100) */ + {1, 3, 4, 6, 8, 0, 0, 0}, /* 0xAD (10101101) */ + {2, 3, 4, 6, 8, 0, 0, 0}, /* 0xAE (10101110) */ + {1, 2, 3, 4, 6, 8, 0, 0}, /* 0xAF (10101111) */ + {5, 6, 8, 0, 0, 0, 0, 0}, /* 0xB0 (10110000) */ + {1, 5, 6, 8, 0, 0, 0, 0}, /* 0xB1 (10110001) */ + {2, 5, 6, 8, 0, 0, 0, 0}, /* 0xB2 (10110010) */ + {1, 2, 5, 6, 8, 0, 0, 0}, /* 0xB3 (10110011) */ + {3, 5, 6, 8, 0, 0, 0, 0}, /* 0xB4 (10110100) */ + {1, 3, 5, 6, 8, 0, 0, 0}, /* 0xB5 (10110101) */ + {2, 3, 5, 6, 8, 0, 0, 0}, /* 0xB6 (10110110) */ + {1, 2, 3, 5, 6, 8, 0, 0}, /* 0xB7 (10110111) */ + {4, 5, 6, 8, 0, 0, 0, 0}, /* 0xB8 (10111000) */ + {1, 4, 5, 6, 8, 0, 0, 0}, /* 0xB9 (10111001) */ + {2, 4, 5, 6, 8, 0, 0, 0}, /* 0xBA (10111010) */ + {1, 2, 4, 5, 6, 8, 0, 0}, /* 0xBB (10111011) */ + {3, 4, 5, 6, 8, 0, 0, 0}, /* 0xBC (10111100) */ + {1, 3, 4, 5, 6, 8, 0, 0}, /* 0xBD (10111101) */ + {2, 3, 4, 5, 6, 8, 0, 0}, /* 0xBE (10111110) */ + {1, 2, 3, 4, 5, 6, 8, 0}, /* 0xBF (10111111) */ + {7, 8, 0, 0, 0, 0, 0, 0}, /* 0xC0 (11000000) */ + {1, 7, 8, 0, 0, 0, 0, 0}, /* 0xC1 (11000001) */ + {2, 7, 8, 0, 0, 0, 0, 0}, /* 0xC2 (11000010) */ + {1, 2, 7, 8, 0, 0, 0, 0}, /* 0xC3 (11000011) */ + {3, 7, 8, 0, 0, 0, 0, 0}, /* 0xC4 (11000100) */ + {1, 3, 7, 8, 0, 0, 0, 0}, /* 0xC5 (11000101) */ + {2, 3, 7, 8, 0, 0, 0, 0}, /* 0xC6 (11000110) */ + {1, 2, 3, 7, 8, 0, 0, 0}, /* 0xC7 (11000111) */ + {4, 7, 8, 0, 0, 0, 0, 0}, /* 0xC8 (11001000) */ + {1, 4, 7, 8, 0, 0, 0, 0}, /* 0xC9 (11001001) */ + {2, 4, 7, 8, 0, 0, 0, 0}, /* 0xCA (11001010) */ + {1, 2, 4, 7, 8, 0, 0, 0}, /* 0xCB (11001011) */ + {3, 4, 7, 8, 0, 0, 0, 0}, /* 0xCC (11001100) */ + {1, 3, 4, 7, 8, 0, 0, 0}, /* 0xCD (11001101) */ + {2, 3, 4, 7, 8, 0, 0, 0}, /* 0xCE (11001110) */ + {1, 2, 3, 4, 7, 8, 0, 0}, /* 0xCF (11001111) */ + {5, 7, 8, 0, 0, 0, 0, 0}, /* 0xD0 (11010000) */ + {1, 5, 7, 8, 0, 0, 0, 0}, /* 0xD1 (11010001) */ + {2, 5, 7, 8, 0, 0, 0, 0}, /* 0xD2 (11010010) */ + {1, 2, 5, 7, 8, 0, 0, 0}, /* 0xD3 (11010011) */ + {3, 5, 7, 8, 0, 0, 0, 0}, /* 0xD4 (11010100) */ + {1, 3, 5, 7, 8, 0, 0, 0}, /* 0xD5 (11010101) */ + {2, 3, 5, 7, 8, 0, 0, 0}, /* 0xD6 (11010110) */ + {1, 2, 3, 5, 7, 8, 0, 0}, /* 0xD7 (11010111) */ + {4, 5, 7, 8, 0, 0, 0, 0}, /* 0xD8 (11011000) */ + {1, 4, 5, 7, 8, 0, 0, 0}, /* 0xD9 (11011001) */ + {2, 4, 5, 7, 8, 0, 0, 0}, /* 0xDA (11011010) */ + {1, 2, 4, 5, 7, 8, 0, 0}, /* 0xDB (11011011) */ + {3, 4, 5, 7, 8, 0, 0, 0}, /* 0xDC (11011100) */ + {1, 3, 4, 5, 7, 8, 0, 0}, /* 0xDD (11011101) */ + {2, 3, 4, 5, 7, 8, 0, 0}, /* 0xDE (11011110) */ + {1, 2, 3, 4, 5, 7, 8, 0}, /* 0xDF (11011111) */ + {6, 7, 8, 0, 0, 0, 0, 0}, /* 0xE0 (11100000) */ + {1, 6, 7, 8, 0, 0, 0, 0}, /* 0xE1 (11100001) */ + {2, 6, 7, 8, 0, 0, 0, 0}, /* 0xE2 (11100010) */ + {1, 2, 6, 7, 8, 0, 0, 0}, /* 0xE3 (11100011) */ + {3, 6, 7, 8, 0, 0, 0, 0}, /* 0xE4 (11100100) */ + {1, 3, 6, 7, 8, 0, 0, 0}, /* 0xE5 (11100101) */ + {2, 3, 6, 7, 8, 0, 0, 0}, /* 0xE6 (11100110) */ + {1, 2, 3, 6, 7, 8, 0, 0}, /* 0xE7 (11100111) */ + {4, 6, 7, 8, 0, 0, 0, 0}, /* 0xE8 (11101000) */ + {1, 4, 6, 7, 8, 0, 0, 0}, /* 0xE9 (11101001) */ + {2, 4, 6, 7, 8, 0, 0, 0}, /* 0xEA (11101010) */ + {1, 2, 4, 6, 7, 8, 0, 0}, /* 0xEB (11101011) */ + {3, 4, 6, 7, 8, 0, 0, 0}, /* 0xEC (11101100) */ + {1, 3, 4, 6, 7, 8, 0, 0}, /* 0xED (11101101) */ + {2, 3, 4, 6, 7, 8, 0, 0}, /* 0xEE (11101110) */ + {1, 2, 3, 4, 6, 7, 8, 0}, /* 0xEF (11101111) */ + {5, 6, 7, 8, 0, 0, 0, 0}, /* 0xF0 (11110000) */ + {1, 5, 6, 7, 8, 0, 0, 0}, /* 0xF1 (11110001) */ + {2, 5, 6, 7, 8, 0, 0, 0}, /* 0xF2 (11110010) */ + {1, 2, 5, 6, 7, 8, 0, 0}, /* 0xF3 (11110011) */ + {3, 5, 6, 7, 8, 0, 0, 0}, /* 0xF4 (11110100) */ + {1, 3, 5, 6, 7, 8, 0, 0}, /* 0xF5 (11110101) */ + {2, 3, 5, 6, 7, 8, 0, 0}, /* 0xF6 (11110110) */ + {1, 2, 3, 5, 6, 7, 8, 0}, /* 0xF7 (11110111) */ + {4, 5, 6, 7, 8, 0, 0, 0}, /* 0xF8 (11111000) */ + {1, 4, 5, 6, 7, 8, 0, 0}, /* 0xF9 (11111001) */ + {2, 4, 5, 6, 7, 8, 0, 0}, /* 0xFA (11111010) */ + {1, 2, 4, 5, 6, 7, 8, 0}, /* 0xFB (11111011) */ + {3, 4, 5, 6, 7, 8, 0, 0}, /* 0xFC (11111100) */ + {1, 3, 4, 5, 6, 7, 8, 0}, /* 0xFD (11111101) */ + {2, 3, 4, 5, 6, 7, 8, 0}, /* 0xFE (11111110) */ + {1, 2, 3, 4, 5, 6, 7, 8} /* 0xFF (11111111) */ +}; + +#endif + +#ifdef CROARING_IS_X64 +CROARING_TARGET_AVX2 +size_t bitset_extract_setbits_avx2(const uint64_t *words, size_t length, + uint32_t *out, size_t outcapacity, + uint32_t base) { + uint32_t *initout = out; + __m256i baseVec = _mm256_set1_epi32(base - 1); + __m256i incVec = _mm256_set1_epi32(64); + __m256i add8 = _mm256_set1_epi32(8); + uint32_t *safeout = out + outcapacity; + size_t i = 0; + for (; (i < length) && (out + 64 <= safeout); ++i) { + uint64_t w = words[i]; + if (w == 0) { + baseVec = _mm256_add_epi32(baseVec, incVec); + } else { + for (int k = 0; k < 4; ++k) { + uint8_t byteA = (uint8_t)w; + uint8_t byteB = (uint8_t)(w >> 8); + w >>= 16; + __m256i vecA = + _mm256_load_si256((const __m256i *)vecDecodeTable[byteA]); + __m256i vecB = + _mm256_load_si256((const __m256i *)vecDecodeTable[byteB]); + uint8_t advanceA = lengthTable[byteA]; + uint8_t advanceB = lengthTable[byteB]; + vecA = _mm256_add_epi32(baseVec, vecA); + baseVec = _mm256_add_epi32(baseVec, add8); + vecB = _mm256_add_epi32(baseVec, vecB); + baseVec = _mm256_add_epi32(baseVec, add8); + _mm256_storeu_si256((__m256i *)out, vecA); + out += advanceA; + _mm256_storeu_si256((__m256i *)out, vecB); + out += advanceB; + } + } + } + base += i * 64; + for (; (i < length) && (out < safeout); ++i) { + uint64_t w = words[i]; + while ((w != 0) && (out < safeout)) { + uint64_t t = w & (~w + 1); // on x64, should compile to BLSI (careful: the Intel compiler seems to fail) + int r = __builtin_ctzll(w); // on x64, should compile to TZCNT + uint32_t val = r + base; + memcpy(out, &val, + sizeof(uint32_t)); // should be compiled as a MOV on x64 + out++; + w ^= t; + } + base += 64; + } + return out - initout; +} +CROARING_UNTARGET_REGION +#endif // CROARING_IS_X64 + +size_t bitset_extract_setbits(const uint64_t *words, size_t length, + uint32_t *out, uint32_t base) { + int outpos = 0; + for (size_t i = 0; i < length; ++i) { + uint64_t w = words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); // on x64, should compile to BLSI (careful: the Intel compiler seems to fail) + int r = __builtin_ctzll(w); // on x64, should compile to TZCNT + uint32_t val = r + base; + memcpy(out + outpos, &val, + sizeof(uint32_t)); // should be compiled as a MOV on x64 + outpos++; + w ^= t; + } + base += 64; + } + return outpos; +} + +size_t bitset_extract_intersection_setbits_uint16(const uint64_t * __restrict__ words1, + const uint64_t * __restrict__ words2, + size_t length, uint16_t *out, + uint16_t base) { + int outpos = 0; + for (size_t i = 0; i < length; ++i) { + uint64_t w = words1[i] & words2[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + out[outpos++] = r + base; + w ^= t; + } + base += 64; + } + return outpos; +} + +#ifdef CROARING_IS_X64 +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out" as 16-bit integers, values start at "base" (can + *be set to zero). + * + * The "out" pointer should be sufficient to store the actual number of bits + *set. + * + * Returns how many values were actually decoded. + * + * This function uses SSE decoding. + */ +CROARING_TARGET_AVX2 +size_t bitset_extract_setbits_sse_uint16(const uint64_t *words, size_t length, + uint16_t *out, size_t outcapacity, + uint16_t base) { + uint16_t *initout = out; + __m128i baseVec = _mm_set1_epi16(base - 1); + __m128i incVec = _mm_set1_epi16(64); + __m128i add8 = _mm_set1_epi16(8); + uint16_t *safeout = out + outcapacity; + const int numberofbytes = 2; // process two bytes at a time + size_t i = 0; + for (; (i < length) && (out + numberofbytes * 8 <= safeout); ++i) { + uint64_t w = words[i]; + if (w == 0) { + baseVec = _mm_add_epi16(baseVec, incVec); + } else { + for (int k = 0; k < 4; ++k) { + uint8_t byteA = (uint8_t)w; + uint8_t byteB = (uint8_t)(w >> 8); + w >>= 16; + __m128i vecA = _mm_load_si128( + (const __m128i *)vecDecodeTable_uint16[byteA]); + __m128i vecB = _mm_load_si128( + (const __m128i *)vecDecodeTable_uint16[byteB]); + uint8_t advanceA = lengthTable[byteA]; + uint8_t advanceB = lengthTable[byteB]; + vecA = _mm_add_epi16(baseVec, vecA); + baseVec = _mm_add_epi16(baseVec, add8); + vecB = _mm_add_epi16(baseVec, vecB); + baseVec = _mm_add_epi16(baseVec, add8); + _mm_storeu_si128((__m128i *)out, vecA); + out += advanceA; + _mm_storeu_si128((__m128i *)out, vecB); + out += advanceB; + } + } + } + base += (uint16_t)(i * 64); + for (; (i < length) && (out < safeout); ++i) { + uint64_t w = words[i]; + while ((w != 0) && (out < safeout)) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + *out = r + base; + out++; + w ^= t; + } + base += 64; + } + return out - initout; +} +CROARING_UNTARGET_REGION +#endif + +/* + * Given a bitset containing "length" 64-bit words, write out the position + * of all the set bits to "out", values start at "base" (can be set to zero). + * + * The "out" pointer should be sufficient to store the actual number of bits + *set. + * + * Returns how many values were actually decoded. + */ +size_t bitset_extract_setbits_uint16(const uint64_t *words, size_t length, + uint16_t *out, uint16_t base) { + int outpos = 0; + for (size_t i = 0; i < length; ++i) { + uint64_t w = words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + out[outpos++] = r + base; + w ^= t; + } + base += 64; + } + return outpos; +} + +#if defined(CROARING_ASMBITMANIPOPTIMIZATION) && defined(CROARING_IS_X64) + +static inline uint64_t _asm_bitset_set_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length) { + uint64_t offset, load, pos; + uint64_t shift = 6; + const uint16_t *end = list + length; + if (!length) return card; + // TODO: could unroll for performance, see bitset_set_list + // bts is not available as an intrinsic in GCC + __asm volatile( + "1:\n" + "movzwq (%[list]), %[pos]\n" + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)\n" + "sbb $-1, %[card]\n" + "add $2, %[list]\n" + "cmp %[list], %[end]\n" + "jnz 1b" + : [card] "+&r"(card), [list] "+&r"(list), [load] "=&r"(load), + [pos] "=&r"(pos), [offset] "=&r"(offset) + : [end] "r"(end), [words] "r"(words), [shift] "r"(shift)); + return card; +} + +static inline void _asm_bitset_set_list(uint64_t *words, const uint16_t *list, uint64_t length) { + uint64_t pos; + const uint16_t *end = list + length; + + uint64_t shift = 6; + uint64_t offset; + uint64_t load; + for (; list + 3 < end; list += 4) { + pos = list[0]; + __asm volatile( + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)" + : [load] "=&r"(load), [offset] "=&r"(offset) + : [words] "r"(words), [shift] "r"(shift), [pos] "r"(pos)); + pos = list[1]; + __asm volatile( + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)" + : [load] "=&r"(load), [offset] "=&r"(offset) + : [words] "r"(words), [shift] "r"(shift), [pos] "r"(pos)); + pos = list[2]; + __asm volatile( + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)" + : [load] "=&r"(load), [offset] "=&r"(offset) + : [words] "r"(words), [shift] "r"(shift), [pos] "r"(pos)); + pos = list[3]; + __asm volatile( + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)" + : [load] "=&r"(load), [offset] "=&r"(offset) + : [words] "r"(words), [shift] "r"(shift), [pos] "r"(pos)); + } + + while (list != end) { + pos = list[0]; + __asm volatile( + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "bts %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)" + : [load] "=&r"(load), [offset] "=&r"(offset) + : [words] "r"(words), [shift] "r"(shift), [pos] "r"(pos)); + list++; + } +} + +static inline uint64_t _asm_bitset_clear_list(uint64_t *words, uint64_t card, const uint16_t *list, + uint64_t length) { + uint64_t offset, load, pos; + uint64_t shift = 6; + const uint16_t *end = list + length; + if (!length) return card; + // btr is not available as an intrinsic in GCC + __asm volatile( + "1:\n" + "movzwq (%[list]), %[pos]\n" + "shrx %[shift], %[pos], %[offset]\n" + "mov (%[words],%[offset],8), %[load]\n" + "btr %[pos], %[load]\n" + "mov %[load], (%[words],%[offset],8)\n" + "sbb $0, %[card]\n" + "add $2, %[list]\n" + "cmp %[list], %[end]\n" + "jnz 1b" + : [card] "+&r"(card), [list] "+&r"(list), [load] "=&r"(load), + [pos] "=&r"(pos), [offset] "=&r"(offset) + : [end] "r"(end), [words] "r"(words), [shift] "r"(shift) + : + /* clobbers */ "memory"); + return card; +} + +static inline uint64_t _scalar_bitset_clear_list(uint64_t *words, uint64_t card, const uint16_t *list, + uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *(const uint16_t *)list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load & ~(UINT64_C(1) << index); + card -= (load ^ newload) >> index; + words[offset] = newload; + list++; + } + return card; +} + +static inline uint64_t _scalar_bitset_set_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load | (UINT64_C(1) << index); + card += (load ^ newload) >> index; + words[offset] = newload; + list++; + } + return card; +} + +static inline void _scalar_bitset_set_list(uint64_t *words, const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load | (UINT64_C(1) << index); + words[offset] = newload; + list++; + } +} + +uint64_t bitset_clear_list(uint64_t *words, uint64_t card, const uint16_t *list, + uint64_t length) { + if( croaring_avx2() ) { + return _asm_bitset_clear_list(words, card, list, length); + } else { + return _scalar_bitset_clear_list(words, card, list, length); + } +} + +uint64_t bitset_set_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length) { + if( croaring_avx2() ) { + return _asm_bitset_set_list_withcard(words, card, list, length); + } else { + return _scalar_bitset_set_list_withcard(words, card, list, length); + } +} + +void bitset_set_list(uint64_t *words, const uint16_t *list, uint64_t length) { + if( croaring_avx2() ) { + _asm_bitset_set_list(words, list, length); + } else { + _scalar_bitset_set_list(words, list, length); + } +} +#else +uint64_t bitset_clear_list(uint64_t *words, uint64_t card, const uint16_t *list, + uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *(const uint16_t *)list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load & ~(UINT64_C(1) << index); + card -= (load ^ newload) >> index; + words[offset] = newload; + list++; + } + return card; +} + +uint64_t bitset_set_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load | (UINT64_C(1) << index); + card += (load ^ newload) >> index; + words[offset] = newload; + list++; + } + return card; +} + +void bitset_set_list(uint64_t *words, const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load | (UINT64_C(1) << index); + words[offset] = newload; + list++; + } +} + +#endif + +/* flip specified bits */ +/* TODO: consider whether worthwhile to make an asm version */ + +uint64_t bitset_flip_list_withcard(uint64_t *words, uint64_t card, + const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load ^ (UINT64_C(1) << index); + // todo: is a branch here all that bad? + card += + (1 - 2 * (((UINT64_C(1) << index) & load) >> index)); // +1 or -1 + words[offset] = newload; + list++; + } + return card; +} + +void bitset_flip_list(uint64_t *words, const uint16_t *list, uint64_t length) { + uint64_t offset, load, newload, pos, index; + const uint16_t *end = list + length; + while (list != end) { + pos = *list; + offset = pos >> 6; + index = pos % 64; + load = words[offset]; + newload = load ^ (UINT64_C(1) << index); + words[offset] = newload; + list++; + } +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/bitset_util.c */ +/* begin file src/containers/array.c */ +/* + * array.c + * + */ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +extern inline uint16_t array_container_minimum(const array_container_t *arr); +extern inline uint16_t array_container_maximum(const array_container_t *arr); +extern inline int array_container_index_equalorlarger(const array_container_t *arr, uint16_t x); + +extern inline int array_container_rank(const array_container_t *arr, + uint16_t x); +extern inline bool array_container_contains(const array_container_t *arr, + uint16_t pos); +extern inline int array_container_cardinality(const array_container_t *array); +extern inline bool array_container_nonzero_cardinality(const array_container_t *array); +extern inline void array_container_clear(array_container_t *array); +extern inline int32_t array_container_serialized_size_in_bytes(int32_t card); +extern inline bool array_container_empty(const array_container_t *array); +extern inline bool array_container_full(const array_container_t *array); + +/* Create a new array with capacity size. Return NULL in case of failure. */ +array_container_t *array_container_create_given_capacity(int32_t size) { + array_container_t *container; + + if ((container = (array_container_t *)roaring_malloc(sizeof(array_container_t))) == + NULL) { + return NULL; + } + + if( size <= 0 ) { // we don't want to rely on malloc(0) + container->array = NULL; + } else if ((container->array = (uint16_t *)roaring_malloc(sizeof(uint16_t) * size)) == + NULL) { + roaring_free(container); + return NULL; + } + + container->capacity = size; + container->cardinality = 0; + + return container; +} + +/* Create a new array. Return NULL in case of failure. */ +array_container_t *array_container_create() { + return array_container_create_given_capacity(ARRAY_DEFAULT_INIT_SIZE); +} + +/* Create a new array containing all values in [min,max). */ +array_container_t * array_container_create_range(uint32_t min, uint32_t max) { + array_container_t * answer = array_container_create_given_capacity(max - min + 1); + if(answer == NULL) return answer; + answer->cardinality = 0; + for(uint32_t k = min; k < max; k++) { + answer->array[answer->cardinality++] = k; + } + return answer; +} + +/* Duplicate container */ +array_container_t *array_container_clone(const array_container_t *src) { + array_container_t *newcontainer = + array_container_create_given_capacity(src->capacity); + if (newcontainer == NULL) return NULL; + + newcontainer->cardinality = src->cardinality; + + memcpy(newcontainer->array, src->array, + src->cardinality * sizeof(uint16_t)); + + return newcontainer; +} + +void array_container_offset(const array_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset) { + array_container_t *lo = NULL, *hi = NULL; + int top, lo_cap, hi_cap; + + top = (1 << 16) - offset; + + lo_cap = count_less(c->array, c->cardinality, top); + if (loc && lo_cap) { + lo = array_container_create_given_capacity(lo_cap); + for (int i = 0; i < lo_cap; ++i) { + array_container_add(lo, c->array[i] + offset); + } + *loc = (container_t*)lo; + } + + hi_cap = c->cardinality - lo_cap; + if (hic && hi_cap) { + hi = array_container_create_given_capacity(hi_cap); + for (int i = lo_cap; i < c->cardinality; ++i) { + array_container_add(hi, c->array[i] + offset); + } + *hic = (container_t*)hi; + } +} + +int array_container_shrink_to_fit(array_container_t *src) { + if (src->cardinality == src->capacity) return 0; // nothing to do + int savings = src->capacity - src->cardinality; + src->capacity = src->cardinality; + if( src->capacity == 0) { // we do not want to rely on realloc for zero allocs + roaring_free(src->array); + src->array = NULL; + } else { + uint16_t *oldarray = src->array; + src->array = + (uint16_t *)roaring_realloc(oldarray, src->capacity * sizeof(uint16_t)); + if (src->array == NULL) roaring_free(oldarray); // should never happen? + } + return savings; +} + +/* Free memory. */ +void array_container_free(array_container_t *arr) { + if(arr->array != NULL) {// Jon Strabala reports that some tools complain otherwise + roaring_free(arr->array); + arr->array = NULL; // pedantic + } + roaring_free(arr); +} + +static inline int32_t grow_capacity(int32_t capacity) { + return (capacity <= 0) ? ARRAY_DEFAULT_INIT_SIZE + : capacity < 64 ? capacity * 2 + : capacity < 1024 ? capacity * 3 / 2 + : capacity * 5 / 4; +} + +static inline int32_t clamp(int32_t val, int32_t min, int32_t max) { + return ((val < min) ? min : (val > max) ? max : val); +} + +void array_container_grow(array_container_t *container, int32_t min, + bool preserve) { + + int32_t max = (min <= DEFAULT_MAX_SIZE ? DEFAULT_MAX_SIZE : 65536); + int32_t new_capacity = clamp(grow_capacity(container->capacity), min, max); + + container->capacity = new_capacity; + uint16_t *array = container->array; + + if (preserve) { + container->array = + (uint16_t *)roaring_realloc(array, new_capacity * sizeof(uint16_t)); + if (container->array == NULL) roaring_free(array); + } else { + // Jon Strabala reports that some tools complain otherwise + if (array != NULL) { + roaring_free(array); + } + container->array = (uint16_t *)roaring_malloc(new_capacity * sizeof(uint16_t)); + } + + // handle the case where realloc fails + if (container->array == NULL) { + fprintf(stderr, "could not allocate memory\n"); + } + assert(container->array != NULL); +} + +/* Copy one container into another. We assume that they are distinct. */ +void array_container_copy(const array_container_t *src, + array_container_t *dst) { + const int32_t cardinality = src->cardinality; + if (cardinality > dst->capacity) { + array_container_grow(dst, cardinality, false); + } + + dst->cardinality = cardinality; + memcpy(dst->array, src->array, cardinality * sizeof(uint16_t)); +} + +void array_container_add_from_range(array_container_t *arr, uint32_t min, + uint32_t max, uint16_t step) { + for (uint32_t value = min; value < max; value += step) { + array_container_append(arr, value); + } +} + +/* Computes the union of array1 and array2 and write the result to arrayout. + * It is assumed that arrayout is distinct from both array1 and array2. + */ +void array_container_union(const array_container_t *array_1, + const array_container_t *array_2, + array_container_t *out) { + const int32_t card_1 = array_1->cardinality, card_2 = array_2->cardinality; + const int32_t max_cardinality = card_1 + card_2; + + if (out->capacity < max_cardinality) { + array_container_grow(out, max_cardinality, false); + } + out->cardinality = (int32_t)fast_union_uint16(array_1->array, card_1, + array_2->array, card_2, out->array); + +} + +/* Computes the difference of array1 and array2 and write the result + * to array out. + * Array out does not need to be distinct from array_1 + */ +void array_container_andnot(const array_container_t *array_1, + const array_container_t *array_2, + array_container_t *out) { + if (out->capacity < array_1->cardinality) + array_container_grow(out, array_1->cardinality, false); +#ifdef CROARING_IS_X64 + if(( croaring_avx2() ) && (out != array_1) && (out != array_2)) { + out->cardinality = + difference_vector16(array_1->array, array_1->cardinality, + array_2->array, array_2->cardinality, out->array); + } else { + out->cardinality = + difference_uint16(array_1->array, array_1->cardinality, array_2->array, + array_2->cardinality, out->array); + } +#else + out->cardinality = + difference_uint16(array_1->array, array_1->cardinality, array_2->array, + array_2->cardinality, out->array); +#endif +} + +/* Computes the symmetric difference of array1 and array2 and write the + * result + * to arrayout. + * It is assumed that arrayout is distinct from both array1 and array2. + */ +void array_container_xor(const array_container_t *array_1, + const array_container_t *array_2, + array_container_t *out) { + const int32_t card_1 = array_1->cardinality, card_2 = array_2->cardinality; + const int32_t max_cardinality = card_1 + card_2; + if (out->capacity < max_cardinality) { + array_container_grow(out, max_cardinality, false); + } + +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + out->cardinality = + xor_vector16(array_1->array, array_1->cardinality, array_2->array, + array_2->cardinality, out->array); + } else { + out->cardinality = + xor_uint16(array_1->array, array_1->cardinality, array_2->array, + array_2->cardinality, out->array); + } +#else + out->cardinality = + xor_uint16(array_1->array, array_1->cardinality, array_2->array, + array_2->cardinality, out->array); +#endif +} + +static inline int32_t minimum_int32(int32_t a, int32_t b) { + return (a < b) ? a : b; +} + +/* computes the intersection of array1 and array2 and write the result to + * arrayout. + * It is assumed that arrayout is distinct from both array1 and array2. + * */ +void array_container_intersection(const array_container_t *array1, + const array_container_t *array2, + array_container_t *out) { + int32_t card_1 = array1->cardinality, card_2 = array2->cardinality, + min_card = minimum_int32(card_1, card_2); + const int threshold = 64; // subject to tuning +#ifdef CROARING_IS_X64 + if (out->capacity < min_card) { + array_container_grow(out, min_card + sizeof(__m128i) / sizeof(uint16_t), + false); + } +#else + if (out->capacity < min_card) { + array_container_grow(out, min_card, false); + } +#endif + + if (card_1 * threshold < card_2) { + out->cardinality = intersect_skewed_uint16( + array1->array, card_1, array2->array, card_2, out->array); + } else if (card_2 * threshold < card_1) { + out->cardinality = intersect_skewed_uint16( + array2->array, card_2, array1->array, card_1, out->array); + } else { +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + out->cardinality = intersect_vector16( + array1->array, card_1, array2->array, card_2, out->array); + } else { + out->cardinality = intersect_uint16(array1->array, card_1, + array2->array, card_2, out->array); + } +#else + out->cardinality = intersect_uint16(array1->array, card_1, + array2->array, card_2, out->array); +#endif + } +} + +/* computes the size of the intersection of array1 and array2 + * */ +int array_container_intersection_cardinality(const array_container_t *array1, + const array_container_t *array2) { + int32_t card_1 = array1->cardinality, card_2 = array2->cardinality; + const int threshold = 64; // subject to tuning + if (card_1 * threshold < card_2) { + return intersect_skewed_uint16_cardinality(array1->array, card_1, + array2->array, card_2); + } else if (card_2 * threshold < card_1) { + return intersect_skewed_uint16_cardinality(array2->array, card_2, + array1->array, card_1); + } else { +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + return intersect_vector16_cardinality(array1->array, card_1, + array2->array, card_2); + } else { + return intersect_uint16_cardinality(array1->array, card_1, + array2->array, card_2); + } +#else + return intersect_uint16_cardinality(array1->array, card_1, + array2->array, card_2); +#endif + } +} + +bool array_container_intersect(const array_container_t *array1, + const array_container_t *array2) { + int32_t card_1 = array1->cardinality, card_2 = array2->cardinality; + const int threshold = 64; // subject to tuning + if (card_1 * threshold < card_2) { + return intersect_skewed_uint16_nonempty( + array1->array, card_1, array2->array, card_2); + } else if (card_2 * threshold < card_1) { + return intersect_skewed_uint16_nonempty( + array2->array, card_2, array1->array, card_1); + } else { + // we do not bother vectorizing + return intersect_uint16_nonempty(array1->array, card_1, + array2->array, card_2); + } +} + +/* computes the intersection of array1 and array2 and write the result to + * array1. + * */ +void array_container_intersection_inplace(array_container_t *src_1, + const array_container_t *src_2) { + // todo: can any of this be vectorized? + int32_t card_1 = src_1->cardinality, card_2 = src_2->cardinality; + const int threshold = 64; // subject to tuning + if (card_1 * threshold < card_2) { + src_1->cardinality = intersect_skewed_uint16( + src_1->array, card_1, src_2->array, card_2, src_1->array); + } else if (card_2 * threshold < card_1) { + src_1->cardinality = intersect_skewed_uint16( + src_2->array, card_2, src_1->array, card_1, src_1->array); + } else { + src_1->cardinality = intersect_uint16( + src_1->array, card_1, src_2->array, card_2, src_1->array); + } +} + +int array_container_to_uint32_array(void *vout, const array_container_t *cont, + uint32_t base) { + int outpos = 0; + uint32_t *out = (uint32_t *)vout; + for (int i = 0; i < cont->cardinality; ++i) { + const uint32_t val = base + cont->array[i]; + memcpy(out + outpos, &val, + sizeof(uint32_t)); // should be compiled as a MOV on x64 + outpos++; + } + return outpos; +} + +void array_container_printf(const array_container_t *v) { + if (v->cardinality == 0) { + printf("{}"); + return; + } + printf("{"); + printf("%d", v->array[0]); + for (int i = 1; i < v->cardinality; ++i) { + printf(",%d", v->array[i]); + } + printf("}"); +} + +void array_container_printf_as_uint32_array(const array_container_t *v, + uint32_t base) { + if (v->cardinality == 0) { + return; + } + printf("%u", v->array[0] + base); + for (int i = 1; i < v->cardinality; ++i) { + printf(",%u", v->array[i] + base); + } +} + +/* Compute the number of runs */ +int32_t array_container_number_of_runs(const array_container_t *ac) { + // Can SIMD work here? + int32_t nr_runs = 0; + int32_t prev = -2; + for (const uint16_t *p = ac->array; p != ac->array + ac->cardinality; ++p) { + if (*p != prev + 1) nr_runs++; + prev = *p; + } + return nr_runs; +} + +/** + * Writes the underlying array to buf, outputs how many bytes were written. + * The number of bytes written should be + * array_container_size_in_bytes(container). + * + */ +int32_t array_container_write(const array_container_t *container, char *buf) { + memcpy(buf, container->array, container->cardinality * sizeof(uint16_t)); + return array_container_size_in_bytes(container); +} + +bool array_container_is_subset(const array_container_t *container1, + const array_container_t *container2) { + if (container1->cardinality > container2->cardinality) { + return false; + } + int i1 = 0, i2 = 0; + while (i1 < container1->cardinality && i2 < container2->cardinality) { + if (container1->array[i1] == container2->array[i2]) { + i1++; + i2++; + } else if (container1->array[i1] > container2->array[i2]) { + i2++; + } else { // container1->array[i1] < container2->array[i2] + return false; + } + } + if (i1 == container1->cardinality) { + return true; + } else { + return false; + } +} + +int32_t array_container_read(int32_t cardinality, array_container_t *container, + const char *buf) { + if (container->capacity < cardinality) { + array_container_grow(container, cardinality, false); + } + container->cardinality = cardinality; + memcpy(container->array, buf, container->cardinality * sizeof(uint16_t)); + + return array_container_size_in_bytes(container); +} + +bool array_container_iterate(const array_container_t *cont, uint32_t base, + roaring_iterator iterator, void *ptr) { + for (int i = 0; i < cont->cardinality; i++) + if (!iterator(cont->array[i] + base, ptr)) return false; + return true; +} + +bool array_container_iterate64(const array_container_t *cont, uint32_t base, + roaring_iterator64 iterator, uint64_t high_bits, + void *ptr) { + for (int i = 0; i < cont->cardinality; i++) + if (!iterator(high_bits | (uint64_t)(cont->array[i] + base), ptr)) + return false; + return true; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/array.c */ +/* begin file src/containers/bitset.c */ +/* + * bitset.c + * + */ +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +extern inline int bitset_container_cardinality(const bitset_container_t *bitset); +extern inline bool bitset_container_nonzero_cardinality(bitset_container_t *bitset); +extern inline void bitset_container_set(bitset_container_t *bitset, uint16_t pos); +extern inline void bitset_container_unset(bitset_container_t *bitset, uint16_t pos); +extern inline bool bitset_container_get(const bitset_container_t *bitset, + uint16_t pos); +extern inline int32_t bitset_container_serialized_size_in_bytes(void); +extern inline bool bitset_container_add(bitset_container_t *bitset, uint16_t pos); +extern inline bool bitset_container_remove(bitset_container_t *bitset, uint16_t pos); +extern inline bool bitset_container_contains(const bitset_container_t *bitset, + uint16_t pos); + +void bitset_container_clear(bitset_container_t *bitset) { + memset(bitset->words, 0, sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); + bitset->cardinality = 0; +} + +void bitset_container_set_all(bitset_container_t *bitset) { + memset(bitset->words, INT64_C(-1), + sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); + bitset->cardinality = (1 << 16); +} + + + +/* Create a new bitset. Return NULL in case of failure. */ +bitset_container_t *bitset_container_create(void) { + bitset_container_t *bitset = + (bitset_container_t *)roaring_malloc(sizeof(bitset_container_t)); + + if (!bitset) { + return NULL; + } + // sizeof(__m256i) == 32 + bitset->words = (uint64_t *)roaring_aligned_malloc( + 32, sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); + if (!bitset->words) { + roaring_free(bitset); + return NULL; + } + bitset_container_clear(bitset); + return bitset; +} + +/* Copy one container into another. We assume that they are distinct. */ +void bitset_container_copy(const bitset_container_t *source, + bitset_container_t *dest) { + dest->cardinality = source->cardinality; + memcpy(dest->words, source->words, + sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); +} + +void bitset_container_add_from_range(bitset_container_t *bitset, uint32_t min, + uint32_t max, uint16_t step) { + if (step == 0) return; // refuse to crash + if ((64 % step) == 0) { // step divides 64 + uint64_t mask = 0; // construct the repeated mask + for (uint32_t value = (min % step); value < 64; value += step) { + mask |= ((uint64_t)1 << value); + } + uint32_t firstword = min / 64; + uint32_t endword = (max - 1) / 64; + bitset->cardinality = (max - min + step - 1) / step; + if (firstword == endword) { + bitset->words[firstword] |= + mask & (((~UINT64_C(0)) << (min % 64)) & + ((~UINT64_C(0)) >> ((~max + 1) % 64))); + return; + } + bitset->words[firstword] = mask & ((~UINT64_C(0)) << (min % 64)); + for (uint32_t i = firstword + 1; i < endword; i++) + bitset->words[i] = mask; + bitset->words[endword] = mask & ((~UINT64_C(0)) >> ((~max + 1) % 64)); + } else { + for (uint32_t value = min; value < max; value += step) { + bitset_container_add(bitset, value); + } + } +} + +/* Free memory. */ +void bitset_container_free(bitset_container_t *bitset) { + if(bitset->words != NULL) {// Jon Strabala reports that some tools complain otherwise + roaring_aligned_free(bitset->words); + bitset->words = NULL; // pedantic + } + roaring_free(bitset); +} + +/* duplicate container. */ +bitset_container_t *bitset_container_clone(const bitset_container_t *src) { + bitset_container_t *bitset = + (bitset_container_t *)roaring_malloc(sizeof(bitset_container_t)); + + if (!bitset) { + return NULL; + } + // sizeof(__m256i) == 32 + bitset->words = (uint64_t *)roaring_aligned_malloc( + 32, sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); + if (!bitset->words) { + roaring_free(bitset); + return NULL; + } + bitset->cardinality = src->cardinality; + memcpy(bitset->words, src->words, + sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS); + return bitset; +} + +void bitset_container_offset(const bitset_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset) { + bitset_container_t *bc = NULL; + uint64_t val; + uint16_t b, i, end; + + b = offset >> 6; + i = offset % 64; + end = 1024 - b; + + if (loc != NULL) { + bc = bitset_container_create(); + if (i == 0) { + memcpy(bc->words+b, c->words, 8*end); + } else { + bc->words[b] = c->words[0] << i; + for (uint32_t k = 1; k < end; ++k) { + val = c->words[k] << i; + val |= c->words[k-1] >> (64 - i); + bc->words[b+k] = val; + } + } + + bc->cardinality = bitset_container_compute_cardinality(bc); + if (bc->cardinality != 0) { + *loc = bc; + } + if (bc->cardinality == c->cardinality) { + return; + } + } + + if (hic == NULL) { + // Both hic and loc can't be NULL, so bc is never NULL here + if (bc->cardinality == 0) { + bitset_container_free(bc); + } + return; + } + + if (bc == NULL || bc->cardinality != 0) { + bc = bitset_container_create(); + } + + if (i == 0) { + memcpy(bc->words, c->words+end, 8*b); + } else { + for (uint32_t k = end; k < 1024; ++k) { + val = c->words[k] << i; + val |= c->words[k-1] >> (64 - i); + bc->words[k-end] = val; + } + bc->words[b] = c->words[1023] >> (64 - i); + } + + bc->cardinality = bitset_container_compute_cardinality(bc); + if (bc->cardinality == 0) { + bitset_container_free(bc); + return; + } + *hic = bc; +} + +void bitset_container_set_range(bitset_container_t *bitset, uint32_t begin, + uint32_t end) { + bitset_set_range(bitset->words, begin, end); + bitset->cardinality = + bitset_container_compute_cardinality(bitset); // could be smarter +} + + +bool bitset_container_intersect(const bitset_container_t *src_1, + const bitset_container_t *src_2) { + // could vectorize, but this is probably already quite fast in practice + const uint64_t * __restrict__ words_1 = src_1->words; + const uint64_t * __restrict__ words_2 = src_2->words; + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i ++) { + if((words_1[i] & words_2[i]) != 0) return true; + } + return false; +} + + +#ifdef CROARING_IS_X64 +#ifndef WORDS_IN_AVX2_REG +#define WORDS_IN_AVX2_REG sizeof(__m256i) / sizeof(uint64_t) +#endif +/* Get the number of bits set (force computation) */ +static inline int _scalar_bitset_container_compute_cardinality(const bitset_container_t *bitset) { + const uint64_t *words = bitset->words; + int32_t sum = 0; + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 4) { + sum += hamming(words[i]); + sum += hamming(words[i + 1]); + sum += hamming(words[i + 2]); + sum += hamming(words[i + 3]); + } + return sum; +} +/* Get the number of bits set (force computation) */ +int bitset_container_compute_cardinality(const bitset_container_t *bitset) { + if( croaring_avx2() ) { + return (int) avx2_harley_seal_popcount256( + (const __m256i *)bitset->words, + BITSET_CONTAINER_SIZE_IN_WORDS / (WORDS_IN_AVX2_REG)); + } else { + return _scalar_bitset_container_compute_cardinality(bitset); + + } +} + +#elif defined(USENEON) +int bitset_container_compute_cardinality(const bitset_container_t *bitset) { + uint16x8_t n0 = vdupq_n_u16(0); + uint16x8_t n1 = vdupq_n_u16(0); + uint16x8_t n2 = vdupq_n_u16(0); + uint16x8_t n3 = vdupq_n_u16(0); + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 8) { + uint64x2_t c0 = vld1q_u64(&bitset->words[i + 0]); + n0 = vaddq_u16(n0, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c0)))); + uint64x2_t c1 = vld1q_u64(&bitset->words[i + 2]); + n1 = vaddq_u16(n1, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c1)))); + uint64x2_t c2 = vld1q_u64(&bitset->words[i + 4]); + n2 = vaddq_u16(n2, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c2)))); + uint64x2_t c3 = vld1q_u64(&bitset->words[i + 6]); + n3 = vaddq_u16(n3, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c3)))); + } + uint64x2_t n = vdupq_n_u64(0); + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n0))); + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n1))); + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n2))); + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n3))); + return vgetq_lane_u64(n, 0) + vgetq_lane_u64(n, 1); +} + +#else // CROARING_IS_X64 + +/* Get the number of bits set (force computation) */ +int bitset_container_compute_cardinality(const bitset_container_t *bitset) { + const uint64_t *words = bitset->words; + int32_t sum = 0; + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 4) { + sum += hamming(words[i]); + sum += hamming(words[i + 1]); + sum += hamming(words[i + 2]); + sum += hamming(words[i + 3]); + } + return sum; +} + +#endif // CROARING_IS_X64 + +#ifdef CROARING_IS_X64 + +#define BITSET_CONTAINER_FN_REPEAT 8 +#ifndef WORDS_IN_AVX2_REG +#define WORDS_IN_AVX2_REG sizeof(__m256i) / sizeof(uint64_t) +#endif // WORDS_IN_AVX2_REG +#define LOOP_SIZE \ + BITSET_CONTAINER_SIZE_IN_WORDS / \ + ((WORDS_IN_AVX2_REG)*BITSET_CONTAINER_FN_REPEAT) + +/* Computes a binary operation (eg union) on bitset1 and bitset2 and write the + result to bitsetout */ +// clang-format off +#define AVX_BITSET_CONTAINER_FN1(before, opname, opsymbol, avx_intrinsic, \ + neon_intrinsic, after) \ + static inline int _avx2_bitset_container_##opname##_nocard( \ + const bitset_container_t *src_1, const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint8_t *__restrict__ words_1 = (const uint8_t *)src_1->words; \ + const uint8_t *__restrict__ words_2 = (const uint8_t *)src_2->words; \ + /* not using the blocking optimization for some reason*/ \ + uint8_t *out = (uint8_t *)dst->words; \ + const int innerloop = 8; \ + for (size_t i = 0; \ + i < BITSET_CONTAINER_SIZE_IN_WORDS / (WORDS_IN_AVX2_REG); \ + i += innerloop) { \ + __m256i A1, A2, AO; \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)out, AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 32)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 32)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 32), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 64)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 64)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 64), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 96)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 96)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 96), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 128)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 128)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 128), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 160)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 160)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 160), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 192)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 192)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 192), AO); \ + A1 = _mm256_lddqu_si256((const __m256i *)(words_1 + 224)); \ + A2 = _mm256_lddqu_si256((const __m256i *)(words_2 + 224)); \ + AO = avx_intrinsic(A2, A1); \ + _mm256_storeu_si256((__m256i *)(out + 224), AO); \ + out += 256; \ + words_1 += 256; \ + words_2 += 256; \ + } \ + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; \ + return dst->cardinality; \ + } + +#define AVX_BITSET_CONTAINER_FN2(before, opname, opsymbol, avx_intrinsic, \ + neon_intrinsic, after) \ + /* next, a version that updates cardinality*/ \ + static inline int _avx2_bitset_container_##opname(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const __m256i *__restrict__ words_1 = (const __m256i *)src_1->words; \ + const __m256i *__restrict__ words_2 = (const __m256i *)src_2->words; \ + __m256i *out = (__m256i *)dst->words; \ + dst->cardinality = (int32_t)avx2_harley_seal_popcount256andstore_##opname( \ + words_2, words_1, out, \ + BITSET_CONTAINER_SIZE_IN_WORDS / (WORDS_IN_AVX2_REG)); \ + return dst->cardinality; \ + } \ + +#define AVX_BITSET_CONTAINER_FN3(before, opname, opsymbol, avx_intrinsic, \ + neon_intrinsic, after) \ + /* next, a version that just computes the cardinality*/ \ + static inline int _avx2_bitset_container_##opname##_justcard( \ + const bitset_container_t *src_1, const bitset_container_t *src_2) { \ + const __m256i *__restrict__ data1 = (const __m256i *)src_1->words; \ + const __m256i *__restrict__ data2 = (const __m256i *)src_2->words; \ + return (int)avx2_harley_seal_popcount256_##opname( \ + data2, data1, BITSET_CONTAINER_SIZE_IN_WORDS / (WORDS_IN_AVX2_REG)); \ + } + + +// we duplicate the function because other containers use the "or" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, or, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, union, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +// we duplicate the function because other containers use the "intersection" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, and, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, intersection, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, xor, ^, _mm256_xor_si256, veorq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN1(CROARING_TARGET_AVX2, andnot, &~, _mm256_andnot_si256, vbicq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +// we duplicate the function because other containers use the "or" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, or, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, union, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +// we duplicate the function because other containers use the "intersection" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, and, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, intersection, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, xor, ^, _mm256_xor_si256, veorq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN2(CROARING_TARGET_AVX2, andnot, &~, _mm256_andnot_si256, vbicq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +// we duplicate the function because other containers use the "or" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, or, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, union, |, _mm256_or_si256, vorrq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +// we duplicate the function because other containers use the "intersection" term, makes API more consistent +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, and, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, intersection, &, _mm256_and_si256, vandq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, xor, ^, _mm256_xor_si256, veorq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION +CROARING_TARGET_AVX2 +AVX_BITSET_CONTAINER_FN3(CROARING_TARGET_AVX2, andnot, &~, _mm256_andnot_si256, vbicq_u64, CROARING_UNTARGET_REGION) +CROARING_UNTARGET_REGION + + +#define SCALAR_BITSET_CONTAINER_FN(opname, opsymbol, avx_intrinsic, \ + neon_intrinsic) \ + static inline int _scalar_bitset_container_##opname(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t *__restrict__ words_1 = src_1->words; \ + const uint64_t *__restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + int32_t sum = 0; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 2) { \ + const uint64_t word_1 = (words_1[i])opsymbol(words_2[i]), \ + word_2 = (words_1[i + 1]) opsymbol(words_2[i + 1]); \ + out[i] = word_1; \ + out[i + 1] = word_2; \ + sum += hamming(word_1); \ + sum += hamming(word_2); \ + } \ + dst->cardinality = sum; \ + return dst->cardinality; \ + } \ + static inline int _scalar_bitset_container_##opname##_nocard( \ + const bitset_container_t *src_1, const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t *__restrict__ words_1 = src_1->words; \ + const uint64_t *__restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i++) { \ + out[i] = (words_1[i])opsymbol(words_2[i]); \ + } \ + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; \ + return dst->cardinality; \ + } \ + static inline int _scalar_bitset_container_##opname##_justcard( \ + const bitset_container_t *src_1, const bitset_container_t *src_2) { \ + const uint64_t *__restrict__ words_1 = src_1->words; \ + const uint64_t *__restrict__ words_2 = src_2->words; \ + int32_t sum = 0; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 2) { \ + const uint64_t word_1 = (words_1[i])opsymbol(words_2[i]), \ + word_2 = (words_1[i + 1]) opsymbol(words_2[i + 1]); \ + sum += hamming(word_1); \ + sum += hamming(word_2); \ + } \ + return sum; \ + } + +// we duplicate the function because other containers use the "or" term, makes API more consistent +SCALAR_BITSET_CONTAINER_FN(or, |, _mm256_or_si256, vorrq_u64) +SCALAR_BITSET_CONTAINER_FN(union, |, _mm256_or_si256, vorrq_u64) + +// we duplicate the function because other containers use the "intersection" term, makes API more consistent +SCALAR_BITSET_CONTAINER_FN(and, &, _mm256_and_si256, vandq_u64) +SCALAR_BITSET_CONTAINER_FN(intersection, &, _mm256_and_si256, vandq_u64) + +SCALAR_BITSET_CONTAINER_FN(xor, ^, _mm256_xor_si256, veorq_u64) +SCALAR_BITSET_CONTAINER_FN(andnot, &~, _mm256_andnot_si256, vbicq_u64) + + +#define BITSET_CONTAINER_FN(opname, opsymbol, avx_intrinsic, neon_intrinsic) \ + int bitset_container_##opname(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + if ( croaring_avx2() ) { \ + return _avx2_bitset_container_##opname(src_1, src_2, dst); \ + } else { \ + return _scalar_bitset_container_##opname(src_1, src_2, dst); \ + } \ + } \ + int bitset_container_##opname##_nocard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + if ( croaring_avx2() ) { \ + return _avx2_bitset_container_##opname##_nocard(src_1, src_2, dst); \ + } else { \ + return _scalar_bitset_container_##opname##_nocard(src_1, src_2, dst); \ + } \ + } \ + int bitset_container_##opname##_justcard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2) { \ + if ((croaring_detect_supported_architectures() & CROARING_AVX2) == \ + CROARING_AVX2) { \ + return _avx2_bitset_container_##opname##_justcard(src_1, src_2); \ + } else { \ + return _scalar_bitset_container_##opname##_justcard(src_1, src_2); \ + } \ + } + + + +#elif defined(USENEON) + +#define BITSET_CONTAINER_FN(opname, opsymbol, avx_intrinsic, neon_intrinsic) \ +int bitset_container_##opname(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + uint16x8_t n0 = vdupq_n_u16(0); \ + uint16x8_t n1 = vdupq_n_u16(0); \ + uint16x8_t n2 = vdupq_n_u16(0); \ + uint16x8_t n3 = vdupq_n_u16(0); \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 8) { \ + uint64x2_t c0 = neon_intrinsic(vld1q_u64(&words_1[i + 0]), \ + vld1q_u64(&words_2[i + 0])); \ + n0 = vaddq_u16(n0, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c0)))); \ + vst1q_u64(&out[i + 0], c0); \ + uint64x2_t c1 = neon_intrinsic(vld1q_u64(&words_1[i + 2]), \ + vld1q_u64(&words_2[i + 2])); \ + n1 = vaddq_u16(n1, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c1)))); \ + vst1q_u64(&out[i + 2], c1); \ + uint64x2_t c2 = neon_intrinsic(vld1q_u64(&words_1[i + 4]), \ + vld1q_u64(&words_2[i + 4])); \ + n2 = vaddq_u16(n2, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c2)))); \ + vst1q_u64(&out[i + 4], c2); \ + uint64x2_t c3 = neon_intrinsic(vld1q_u64(&words_1[i + 6]), \ + vld1q_u64(&words_2[i + 6])); \ + n3 = vaddq_u16(n3, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c3)))); \ + vst1q_u64(&out[i + 6], c3); \ + } \ + uint64x2_t n = vdupq_n_u64(0); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n0))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n1))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n2))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n3))); \ + dst->cardinality = vgetq_lane_u64(n, 0) + vgetq_lane_u64(n, 1); \ + return dst->cardinality; \ +} \ +int bitset_container_##opname##_nocard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 8) { \ + vst1q_u64(&out[i + 0], neon_intrinsic(vld1q_u64(&words_1[i + 0]), \ + vld1q_u64(&words_2[i + 0]))); \ + vst1q_u64(&out[i + 2], neon_intrinsic(vld1q_u64(&words_1[i + 2]), \ + vld1q_u64(&words_2[i + 2]))); \ + vst1q_u64(&out[i + 4], neon_intrinsic(vld1q_u64(&words_1[i + 4]), \ + vld1q_u64(&words_2[i + 4]))); \ + vst1q_u64(&out[i + 6], neon_intrinsic(vld1q_u64(&words_1[i + 6]), \ + vld1q_u64(&words_2[i + 6]))); \ + } \ + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; \ + return dst->cardinality; \ +} \ +int bitset_container_##opname##_justcard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + uint16x8_t n0 = vdupq_n_u16(0); \ + uint16x8_t n1 = vdupq_n_u16(0); \ + uint16x8_t n2 = vdupq_n_u16(0); \ + uint16x8_t n3 = vdupq_n_u16(0); \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 8) { \ + uint64x2_t c0 = neon_intrinsic(vld1q_u64(&words_1[i + 0]), \ + vld1q_u64(&words_2[i + 0])); \ + n0 = vaddq_u16(n0, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c0)))); \ + uint64x2_t c1 = neon_intrinsic(vld1q_u64(&words_1[i + 2]), \ + vld1q_u64(&words_2[i + 2])); \ + n1 = vaddq_u16(n1, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c1)))); \ + uint64x2_t c2 = neon_intrinsic(vld1q_u64(&words_1[i + 4]), \ + vld1q_u64(&words_2[i + 4])); \ + n2 = vaddq_u16(n2, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c2)))); \ + uint64x2_t c3 = neon_intrinsic(vld1q_u64(&words_1[i + 6]), \ + vld1q_u64(&words_2[i + 6])); \ + n3 = vaddq_u16(n3, vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(c3)))); \ + } \ + uint64x2_t n = vdupq_n_u64(0); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n0))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n1))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n2))); \ + n = vaddq_u64(n, vpaddlq_u32(vpaddlq_u16(n3))); \ + return vgetq_lane_u64(n, 0) + vgetq_lane_u64(n, 1); \ +} + +#else + +#define BITSET_CONTAINER_FN(opname, opsymbol, avx_intrinsic, neon_intrinsic) \ +int bitset_container_##opname(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + int32_t sum = 0; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 2) { \ + const uint64_t word_1 = (words_1[i])opsymbol(words_2[i]), \ + word_2 = (words_1[i + 1])opsymbol(words_2[i + 1]); \ + out[i] = word_1; \ + out[i + 1] = word_2; \ + sum += hamming(word_1); \ + sum += hamming(word_2); \ + } \ + dst->cardinality = sum; \ + return dst->cardinality; \ +} \ +int bitset_container_##opname##_nocard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2, \ + bitset_container_t *dst) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + uint64_t *out = dst->words; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i++) { \ + out[i] = (words_1[i])opsymbol(words_2[i]); \ + } \ + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; \ + return dst->cardinality; \ +} \ +int bitset_container_##opname##_justcard(const bitset_container_t *src_1, \ + const bitset_container_t *src_2) { \ + const uint64_t * __restrict__ words_1 = src_1->words; \ + const uint64_t * __restrict__ words_2 = src_2->words; \ + int32_t sum = 0; \ + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 2) { \ + const uint64_t word_1 = (words_1[i])opsymbol(words_2[i]), \ + word_2 = (words_1[i + 1])opsymbol(words_2[i + 1]); \ + sum += hamming(word_1); \ + sum += hamming(word_2); \ + } \ + return sum; \ +} + +#endif // CROARING_IS_X64 + +// we duplicate the function because other containers use the "or" term, makes API more consistent +BITSET_CONTAINER_FN(or, |, _mm256_or_si256, vorrq_u64) +BITSET_CONTAINER_FN(union, |, _mm256_or_si256, vorrq_u64) + +// we duplicate the function because other containers use the "intersection" term, makes API more consistent +BITSET_CONTAINER_FN(and, &, _mm256_and_si256, vandq_u64) +BITSET_CONTAINER_FN(intersection, &, _mm256_and_si256, vandq_u64) + +BITSET_CONTAINER_FN(xor, ^, _mm256_xor_si256, veorq_u64) +BITSET_CONTAINER_FN(andnot, &~, _mm256_andnot_si256, vbicq_u64) +// clang-format On + + +int bitset_container_to_uint32_array( + uint32_t *out, + const bitset_container_t *bc, + uint32_t base +){ +#ifdef CROARING_IS_X64 + if(( croaring_avx2() ) && (bc->cardinality >= 8192)) // heuristic + return (int) bitset_extract_setbits_avx2(bc->words, + BITSET_CONTAINER_SIZE_IN_WORDS, out, bc->cardinality, base); + else + return (int) bitset_extract_setbits(bc->words, + BITSET_CONTAINER_SIZE_IN_WORDS, out, base); +#else + return (int) bitset_extract_setbits(bc->words, + BITSET_CONTAINER_SIZE_IN_WORDS, out, base); +#endif +} + +/* + * Print this container using printf (useful for debugging). + */ +void bitset_container_printf(const bitset_container_t * v) { + printf("{"); + uint32_t base = 0; + bool iamfirst = true;// TODO: rework so that this is not necessary yet still readable + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i) { + uint64_t w = v->words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + if(iamfirst) {// predicted to be false + printf("%u",base + r); + iamfirst = false; + } else { + printf(",%u",base + r); + } + w ^= t; + } + base += 64; + } + printf("}"); +} + + +/* + * Print this container using printf as a comma-separated list of 32-bit integers starting at base. + */ +void bitset_container_printf_as_uint32_array(const bitset_container_t * v, uint32_t base) { + bool iamfirst = true;// TODO: rework so that this is not necessary yet still readable + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i) { + uint64_t w = v->words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + if(iamfirst) {// predicted to be false + printf("%u", r + base); + iamfirst = false; + } else { + printf(",%u",r + base); + } + w ^= t; + } + base += 64; + } +} + + +// TODO: use the fast lower bound, also +int bitset_container_number_of_runs(bitset_container_t *bc) { + int num_runs = 0; + uint64_t next_word = bc->words[0]; + + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS-1; ++i) { + uint64_t word = next_word; + next_word = bc->words[i+1]; + num_runs += hamming((~word) & (word << 1)) + ( (word >> 63) & ~next_word); + } + + uint64_t word = next_word; + num_runs += hamming((~word) & (word << 1)); + if((word & 0x8000000000000000ULL) != 0) + num_runs++; + return num_runs; +} + + +int32_t bitset_container_write(const bitset_container_t *container, + char *buf) { + memcpy(buf, container->words, BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t)); + return bitset_container_size_in_bytes(container); +} + + +int32_t bitset_container_read(int32_t cardinality, bitset_container_t *container, + const char *buf) { + container->cardinality = cardinality; + memcpy(container->words, buf, BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t)); + return bitset_container_size_in_bytes(container); +} + +bool bitset_container_iterate(const bitset_container_t *cont, uint32_t base, roaring_iterator iterator, void *ptr) { + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i ) { + uint64_t w = cont->words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + if(!iterator(r + base, ptr)) return false; + w ^= t; + } + base += 64; + } + return true; +} + +bool bitset_container_iterate64(const bitset_container_t *cont, uint32_t base, roaring_iterator64 iterator, uint64_t high_bits, void *ptr) { + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i ) { + uint64_t w = cont->words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + if(!iterator(high_bits | (uint64_t)(r + base), ptr)) return false; + w ^= t; + } + base += 64; + } + return true; +} + +#ifdef CROARING_IS_X64 +CROARING_TARGET_AVX2 +static inline bool _avx2_bitset_container_equals(const bitset_container_t *container1, const bitset_container_t *container2) { + const __m256i *ptr1 = (const __m256i*)container1->words; + const __m256i *ptr2 = (const __m256i*)container2->words; + for (size_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS*sizeof(uint64_t)/32; i++) { + __m256i r1 = _mm256_load_si256(ptr1+i); + __m256i r2 = _mm256_load_si256(ptr2+i); + int mask = _mm256_movemask_epi8(_mm256_cmpeq_epi8(r1, r2)); + if ((uint32_t)mask != UINT32_MAX) { + return false; + } + } + return true; +} +CROARING_UNTARGET_REGION +#endif // CROARING_IS_X64 + +bool bitset_container_equals(const bitset_container_t *container1, const bitset_container_t *container2) { + if((container1->cardinality != BITSET_UNKNOWN_CARDINALITY) && (container2->cardinality != BITSET_UNKNOWN_CARDINALITY)) { + if(container1->cardinality != container2->cardinality) { + return false; + } + if (container1->cardinality == INT32_C(0x10000)) { + return true; + } + } +#ifdef CROARING_IS_X64 + if( croaring_avx2() ) { + return _avx2_bitset_container_equals(container1, container2); + } +#endif + return memcmp(container1->words, + container2->words, + BITSET_CONTAINER_SIZE_IN_WORDS*sizeof(uint64_t)) == 0; +} + +bool bitset_container_is_subset(const bitset_container_t *container1, + const bitset_container_t *container2) { + if((container1->cardinality != BITSET_UNKNOWN_CARDINALITY) && (container2->cardinality != BITSET_UNKNOWN_CARDINALITY)) { + if(container1->cardinality > container2->cardinality) { + return false; + } + } + for(int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i ) { + if((container1->words[i] & container2->words[i]) != container1->words[i]) { + return false; + } + } + return true; +} + +bool bitset_container_select(const bitset_container_t *container, uint32_t *start_rank, uint32_t rank, uint32_t *element) { + int card = bitset_container_cardinality(container); + if(rank >= *start_rank + card) { + *start_rank += card; + return false; + } + const uint64_t *words = container->words; + int32_t size; + for (int i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; i += 1) { + size = hamming(words[i]); + if(rank <= *start_rank + size) { + uint64_t w = container->words[i]; + uint16_t base = i*64; + while (w != 0) { + uint64_t t = w & (~w + 1); + int r = __builtin_ctzll(w); + if(*start_rank == rank) { + *element = r+base; + return true; + } + w ^= t; + *start_rank += 1; + } + } + else + *start_rank += size; + } + assert(false); + __builtin_unreachable(); +} + + +/* Returns the smallest value (assumes not empty) */ +uint16_t bitset_container_minimum(const bitset_container_t *container) { + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i ) { + uint64_t w = container->words[i]; + if (w != 0) { + int r = __builtin_ctzll(w); + return r + i * 64; + } + } + return UINT16_MAX; +} + +/* Returns the largest value (assumes not empty) */ +uint16_t bitset_container_maximum(const bitset_container_t *container) { + for (int32_t i = BITSET_CONTAINER_SIZE_IN_WORDS - 1; i > 0; --i ) { + uint64_t w = container->words[i]; + if (w != 0) { + int r = __builtin_clzll(w); + return i * 64 + 63 - r; + } + } + return 0; +} + +/* Returns the number of values equal or smaller than x */ +int bitset_container_rank(const bitset_container_t *container, uint16_t x) { + // credit: aqrit + int sum = 0; + int i = 0; + for (int end = x / 64; i < end; i++){ + sum += hamming(container->words[i]); + } + uint64_t lastword = container->words[i]; + uint64_t lastpos = UINT64_C(1) << (x % 64); + uint64_t mask = lastpos + lastpos - 1; // smear right + sum += hamming(lastword & mask); + return sum; +} + +/* Returns the index of the first value equal or larger than x, or -1 */ +int bitset_container_index_equalorlarger(const bitset_container_t *container, uint16_t x) { + uint32_t x32 = x; + uint32_t k = x32 / 64; + uint64_t word = container->words[k]; + const int diff = x32 - k * 64; // in [0,64) + word = (word >> diff) << diff; // a mask is faster, but we don't care + while(word == 0) { + k++; + if(k == BITSET_CONTAINER_SIZE_IN_WORDS) return -1; + word = container->words[k]; + } + return k * 64 + __builtin_ctzll(word); +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/bitset.c */ +/* begin file src/containers/containers.c */ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +extern inline const container_t *container_unwrap_shared( + const container_t *candidate_shared_container, uint8_t *type); + +extern inline container_t *container_mutable_unwrap_shared( + container_t *candidate_shared_container, uint8_t *type); + +extern inline int container_get_cardinality( + const container_t *c, uint8_t typecode); + +extern inline container_t *container_iand( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_ior( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_ixor( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_iandnot( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +void container_free(container_t *c, uint8_t type) { + switch (type) { + case BITSET_CONTAINER_TYPE: + bitset_container_free(CAST_bitset(c)); + break; + case ARRAY_CONTAINER_TYPE: + array_container_free(CAST_array(c)); + break; + case RUN_CONTAINER_TYPE: + run_container_free(CAST_run(c)); + break; + case SHARED_CONTAINER_TYPE: + shared_container_free(CAST_shared(c)); + break; + default: + assert(false); + __builtin_unreachable(); + } +} + +void container_printf(const container_t *c, uint8_t type) { + c = container_unwrap_shared(c, &type); + switch (type) { + case BITSET_CONTAINER_TYPE: + bitset_container_printf(const_CAST_bitset(c)); + return; + case ARRAY_CONTAINER_TYPE: + array_container_printf(const_CAST_array(c)); + return; + case RUN_CONTAINER_TYPE: + run_container_printf(const_CAST_run(c)); + return; + default: + __builtin_unreachable(); + } +} + +void container_printf_as_uint32_array( + const container_t *c, uint8_t typecode, + uint32_t base +){ + c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + bitset_container_printf_as_uint32_array( + const_CAST_bitset(c), base); + return; + case ARRAY_CONTAINER_TYPE: + array_container_printf_as_uint32_array( + const_CAST_array(c), base); + return; + case RUN_CONTAINER_TYPE: + run_container_printf_as_uint32_array( + const_CAST_run(c), base); + return; + default: + __builtin_unreachable(); + } +} + +extern inline bool container_nonzero_cardinality( + const container_t *c, uint8_t typecode); + +extern inline int container_to_uint32_array( + uint32_t *output, + const container_t *c, uint8_t typecode, + uint32_t base); + +extern inline container_t *container_add( + container_t *c, + uint16_t val, + uint8_t typecode, // !!! 2nd arg? + uint8_t *new_typecode); + +extern inline bool container_contains( + const container_t *c, + uint16_t val, + uint8_t typecode); // !!! 2nd arg? + +extern inline container_t *container_and( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_or( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_xor( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +container_t *get_copy_of_container( + container_t *c, uint8_t *typecode, + bool copy_on_write +){ + if (copy_on_write) { + shared_container_t *shared_container; + if (*typecode == SHARED_CONTAINER_TYPE) { + shared_container = CAST_shared(c); + shared_container->counter += 1; + return shared_container; + } + assert(*typecode != SHARED_CONTAINER_TYPE); + + if ((shared_container = (shared_container_t *)roaring_malloc( + sizeof(shared_container_t))) == NULL) { + return NULL; + } + + shared_container->container = c; + shared_container->typecode = *typecode; + + shared_container->counter = 2; + *typecode = SHARED_CONTAINER_TYPE; + + return shared_container; + } // copy_on_write + // otherwise, no copy on write... + const container_t *actual_container = container_unwrap_shared(c, typecode); + assert(*typecode != SHARED_CONTAINER_TYPE); + return container_clone(actual_container, *typecode); +} + +/** + * Copies a container, requires a typecode. This allocates new memory, caller + * is responsible for deallocation. + */ +container_t *container_clone(const container_t *c, uint8_t typecode) { + // We do not want to allow cloning of shared containers. + // c = container_unwrap_shared(c, &typecode); + switch (typecode) { + case BITSET_CONTAINER_TYPE: + return bitset_container_clone(const_CAST_bitset(c)); + case ARRAY_CONTAINER_TYPE: + return array_container_clone(const_CAST_array(c)); + case RUN_CONTAINER_TYPE: + return run_container_clone(const_CAST_run(c)); + case SHARED_CONTAINER_TYPE: + // Shared containers are not cloneable. Are you mixing COW and non-COW bitmaps? + return NULL; + default: + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +container_t *shared_container_extract_copy( + shared_container_t *sc, uint8_t *typecode +){ + assert(sc->counter > 0); + assert(sc->typecode != SHARED_CONTAINER_TYPE); + sc->counter--; + *typecode = sc->typecode; + container_t *answer; + if (sc->counter == 0) { + answer = sc->container; + sc->container = NULL; // paranoid + roaring_free(sc); + } else { + answer = container_clone(sc->container, *typecode); + } + assert(*typecode != SHARED_CONTAINER_TYPE); + return answer; +} + +void shared_container_free(shared_container_t *container) { + assert(container->counter > 0); + container->counter--; + if (container->counter == 0) { + assert(container->typecode != SHARED_CONTAINER_TYPE); + container_free(container->container, container->typecode); + container->container = NULL; // paranoid + roaring_free(container); + } +} + +extern inline container_t *container_not( + const container_t *c1, uint8_t type1, + uint8_t *result_type); + +extern inline container_t *container_not_range( + const container_t *c1, uint8_t type1, + uint32_t range_start, uint32_t range_end, + uint8_t *result_type); + +extern inline container_t *container_inot( + container_t *c1, uint8_t type1, + uint8_t *result_type); + +extern inline container_t *container_inot_range( + container_t *c1, uint8_t type1, + uint32_t range_start, uint32_t range_end, + uint8_t *result_type); + +extern inline container_t *container_range_of_ones( + uint32_t range_start, uint32_t range_end, + uint8_t *result_type); + +// where are the correponding things for union and intersection?? +extern inline container_t *container_lazy_xor( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_lazy_ixor( + container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +extern inline container_t *container_andnot( + const container_t *c1, uint8_t type1, + const container_t *c2, uint8_t type2, + uint8_t *result_type); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/containers.c */ +/* begin file src/containers/convert.c */ +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +// file contains grubby stuff that must know impl. details of all container +// types. +bitset_container_t *bitset_container_from_array(const array_container_t *ac) { + bitset_container_t *ans = bitset_container_create(); + int limit = array_container_cardinality(ac); + for (int i = 0; i < limit; ++i) bitset_container_set(ans, ac->array[i]); + return ans; +} + +bitset_container_t *bitset_container_from_run(const run_container_t *arr) { + int card = run_container_cardinality(arr); + bitset_container_t *answer = bitset_container_create(); + for (int rlepos = 0; rlepos < arr->n_runs; ++rlepos) { + rle16_t vl = arr->runs[rlepos]; + bitset_set_lenrange(answer->words, vl.value, vl.length); + } + answer->cardinality = card; + return answer; +} + +array_container_t *array_container_from_run(const run_container_t *arr) { + array_container_t *answer = + array_container_create_given_capacity(run_container_cardinality(arr)); + answer->cardinality = 0; + for (int rlepos = 0; rlepos < arr->n_runs; ++rlepos) { + int run_start = arr->runs[rlepos].value; + int run_end = run_start + arr->runs[rlepos].length; + + for (int run_value = run_start; run_value <= run_end; ++run_value) { + answer->array[answer->cardinality++] = (uint16_t)run_value; + } + } + return answer; +} + +array_container_t *array_container_from_bitset(const bitset_container_t *bits) { + array_container_t *result = + array_container_create_given_capacity(bits->cardinality); + result->cardinality = bits->cardinality; + // sse version ends up being slower here + // (bitset_extract_setbits_sse_uint16) + // because of the sparsity of the data + bitset_extract_setbits_uint16(bits->words, BITSET_CONTAINER_SIZE_IN_WORDS, + result->array, 0); + return result; +} + +/* assumes that container has adequate space. Run from [s,e] (inclusive) */ +static void add_run(run_container_t *rc, int s, int e) { + rc->runs[rc->n_runs].value = s; + rc->runs[rc->n_runs].length = e - s; + rc->n_runs++; +} + +run_container_t *run_container_from_array(const array_container_t *c) { + int32_t n_runs = array_container_number_of_runs(c); + run_container_t *answer = run_container_create_given_capacity(n_runs); + int prev = -2; + int run_start = -1; + int32_t card = c->cardinality; + if (card == 0) return answer; + for (int i = 0; i < card; ++i) { + const uint16_t cur_val = c->array[i]; + if (cur_val != prev + 1) { + // new run starts; flush old one, if any + if (run_start != -1) add_run(answer, run_start, prev); + run_start = cur_val; + } + prev = c->array[i]; + } + // now prev is the last seen value + add_run(answer, run_start, prev); + // assert(run_container_cardinality(answer) == c->cardinality); + return answer; +} + +/** + * Convert the runcontainer to either a Bitmap or an Array Container, depending + * on the cardinality. Frees the container. + * Allocates and returns new container, which caller is responsible for freeing. + * It does not free the run container. + */ +container_t *convert_to_bitset_or_array_container( + run_container_t *rc, int32_t card, + uint8_t *resulttype +){ + if (card <= DEFAULT_MAX_SIZE) { + array_container_t *answer = array_container_create_given_capacity(card); + answer->cardinality = 0; + for (int rlepos = 0; rlepos < rc->n_runs; ++rlepos) { + uint16_t run_start = rc->runs[rlepos].value; + uint16_t run_end = run_start + rc->runs[rlepos].length; + for (uint16_t run_value = run_start; run_value < run_end; + ++run_value) { + answer->array[answer->cardinality++] = run_value; + } + answer->array[answer->cardinality++] = run_end; + } + assert(card == answer->cardinality); + *resulttype = ARRAY_CONTAINER_TYPE; + //run_container_free(r); + return answer; + } + bitset_container_t *answer = bitset_container_create(); + for (int rlepos = 0; rlepos < rc->n_runs; ++rlepos) { + uint16_t run_start = rc->runs[rlepos].value; + bitset_set_lenrange(answer->words, run_start, rc->runs[rlepos].length); + } + answer->cardinality = card; + *resulttype = BITSET_CONTAINER_TYPE; + //run_container_free(r); + return answer; +} + +/* Converts a run container to either an array or a bitset, IF it saves space. + */ +/* If a conversion occurs, the caller is responsible to free the original + * container and + * he becomes responsible to free the new one. */ +container_t *convert_run_to_efficient_container( + run_container_t *c, + uint8_t *typecode_after +){ + int32_t size_as_run_container = + run_container_serialized_size_in_bytes(c->n_runs); + + int32_t size_as_bitset_container = + bitset_container_serialized_size_in_bytes(); + int32_t card = run_container_cardinality(c); + int32_t size_as_array_container = + array_container_serialized_size_in_bytes(card); + + int32_t min_size_non_run = + size_as_bitset_container < size_as_array_container + ? size_as_bitset_container + : size_as_array_container; + if (size_as_run_container <= min_size_non_run) { // no conversion + *typecode_after = RUN_CONTAINER_TYPE; + return c; + } + if (card <= DEFAULT_MAX_SIZE) { + // to array + array_container_t *answer = array_container_create_given_capacity(card); + answer->cardinality = 0; + for (int rlepos = 0; rlepos < c->n_runs; ++rlepos) { + int run_start = c->runs[rlepos].value; + int run_end = run_start + c->runs[rlepos].length; + + for (int run_value = run_start; run_value <= run_end; ++run_value) { + answer->array[answer->cardinality++] = (uint16_t)run_value; + } + } + *typecode_after = ARRAY_CONTAINER_TYPE; + return answer; + } + + // else to bitset + bitset_container_t *answer = bitset_container_create(); + + for (int rlepos = 0; rlepos < c->n_runs; ++rlepos) { + int start = c->runs[rlepos].value; + int end = start + c->runs[rlepos].length; + bitset_set_range(answer->words, start, end + 1); + } + answer->cardinality = card; + *typecode_after = BITSET_CONTAINER_TYPE; + return answer; +} + +// like convert_run_to_efficient_container but frees the old result if needed +container_t *convert_run_to_efficient_container_and_free( + run_container_t *c, + uint8_t *typecode_after +){ + container_t *answer = convert_run_to_efficient_container(c, typecode_after); + if (answer != c) run_container_free(c); + return answer; +} + +/* once converted, the original container is disposed here, rather than + in roaring_array +*/ + +// TODO: split into run- array- and bitset- subfunctions for sanity; +// a few function calls won't really matter. + +container_t *convert_run_optimize( + container_t *c, uint8_t typecode_original, + uint8_t *typecode_after +){ + if (typecode_original == RUN_CONTAINER_TYPE) { + container_t *newc = convert_run_to_efficient_container( + CAST_run(c), typecode_after); + if (newc != c) { + container_free(c, typecode_original); + } + return newc; + } else if (typecode_original == ARRAY_CONTAINER_TYPE) { + // it might need to be converted to a run container. + array_container_t *c_qua_array = CAST_array(c); + int32_t n_runs = array_container_number_of_runs(c_qua_array); + int32_t size_as_run_container = + run_container_serialized_size_in_bytes(n_runs); + int32_t card = array_container_cardinality(c_qua_array); + int32_t size_as_array_container = + array_container_serialized_size_in_bytes(card); + + if (size_as_run_container >= size_as_array_container) { + *typecode_after = ARRAY_CONTAINER_TYPE; + return c; + } + // else convert array to run container + run_container_t *answer = run_container_create_given_capacity(n_runs); + int prev = -2; + int run_start = -1; + + assert(card > 0); + for (int i = 0; i < card; ++i) { + uint16_t cur_val = c_qua_array->array[i]; + if (cur_val != prev + 1) { + // new run starts; flush old one, if any + if (run_start != -1) add_run(answer, run_start, prev); + run_start = cur_val; + } + prev = c_qua_array->array[i]; + } + assert(run_start >= 0); + // now prev is the last seen value + add_run(answer, run_start, prev); + *typecode_after = RUN_CONTAINER_TYPE; + array_container_free(c_qua_array); + return answer; + } else if (typecode_original == + BITSET_CONTAINER_TYPE) { // run conversions on bitset + // does bitset need conversion to run? + bitset_container_t *c_qua_bitset = CAST_bitset(c); + int32_t n_runs = bitset_container_number_of_runs(c_qua_bitset); + int32_t size_as_run_container = + run_container_serialized_size_in_bytes(n_runs); + int32_t size_as_bitset_container = + bitset_container_serialized_size_in_bytes(); + + if (size_as_bitset_container <= size_as_run_container) { + // no conversion needed. + *typecode_after = BITSET_CONTAINER_TYPE; + return c; + } + // bitset to runcontainer (ported from Java RunContainer( + // BitmapContainer bc, int nbrRuns)) + assert(n_runs > 0); // no empty bitmaps + run_container_t *answer = run_container_create_given_capacity(n_runs); + + int long_ctr = 0; + uint64_t cur_word = c_qua_bitset->words[0]; + int run_count = 0; + while (true) { + while (cur_word == UINT64_C(0) && + long_ctr < BITSET_CONTAINER_SIZE_IN_WORDS - 1) + cur_word = c_qua_bitset->words[++long_ctr]; + + if (cur_word == UINT64_C(0)) { + bitset_container_free(c_qua_bitset); + *typecode_after = RUN_CONTAINER_TYPE; + return answer; + } + + int local_run_start = __builtin_ctzll(cur_word); + int run_start = local_run_start + 64 * long_ctr; + uint64_t cur_word_with_1s = cur_word | (cur_word - 1); + + int run_end = 0; + while (cur_word_with_1s == UINT64_C(0xFFFFFFFFFFFFFFFF) && + long_ctr < BITSET_CONTAINER_SIZE_IN_WORDS - 1) + cur_word_with_1s = c_qua_bitset->words[++long_ctr]; + + if (cur_word_with_1s == UINT64_C(0xFFFFFFFFFFFFFFFF)) { + run_end = 64 + long_ctr * 64; // exclusive, I guess + add_run(answer, run_start, run_end - 1); + bitset_container_free(c_qua_bitset); + *typecode_after = RUN_CONTAINER_TYPE; + return answer; + } + int local_run_end = __builtin_ctzll(~cur_word_with_1s); + run_end = local_run_end + long_ctr * 64; + add_run(answer, run_start, run_end - 1); + run_count++; + cur_word = cur_word_with_1s & (cur_word_with_1s + 1); + } + return answer; + } else { + assert(false); + __builtin_unreachable(); + return NULL; + } +} + +container_t *container_from_run_range( + const run_container_t *run, + uint32_t min, uint32_t max, uint8_t *typecode_after +){ + // We expect most of the time to end up with a bitset container + bitset_container_t *bitset = bitset_container_create(); + *typecode_after = BITSET_CONTAINER_TYPE; + int32_t union_cardinality = 0; + for (int32_t i = 0; i < run->n_runs; ++i) { + uint32_t rle_min = run->runs[i].value; + uint32_t rle_max = rle_min + run->runs[i].length; + bitset_set_lenrange(bitset->words, rle_min, rle_max - rle_min); + union_cardinality += run->runs[i].length + 1; + } + union_cardinality += max - min + 1; + union_cardinality -= bitset_lenrange_cardinality(bitset->words, min, max-min); + bitset_set_lenrange(bitset->words, min, max - min); + bitset->cardinality = union_cardinality; + if(bitset->cardinality <= DEFAULT_MAX_SIZE) { + // we need to convert to an array container + array_container_t * array = array_container_from_bitset(bitset); + *typecode_after = ARRAY_CONTAINER_TYPE; + bitset_container_free(bitset); + return array; + } + return bitset; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/convert.c */ +/* begin file src/containers/mixed_andnot.c */ +/* + * mixed_andnot.c. More methods since operation is not symmetric, + * except no "wide" andnot , so no lazy options motivated. + */ + +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst, a valid array container that could be the same as dst.*/ +void array_bitset_container_andnot(const array_container_t *src_1, + const bitset_container_t *src_2, + array_container_t *dst) { + // follows Java implementation as of June 2016 + if (dst->capacity < src_1->cardinality) { + array_container_grow(dst, src_1->cardinality, false); + } + int32_t newcard = 0; + const int32_t origcard = src_1->cardinality; + for (int i = 0; i < origcard; ++i) { + uint16_t key = src_1->array[i]; + dst->array[newcard] = key; + newcard += 1 - bitset_container_contains(src_2, key); + } + dst->cardinality = newcard; +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * src_1 */ + +void array_bitset_container_iandnot(array_container_t *src_1, + const bitset_container_t *src_2) { + array_bitset_container_andnot(src_1, src_2, src_1); +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst, which does not initially have a valid container. + * Return true for a bitset result; false for array + */ + +bool bitset_array_container_andnot( + const bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + // Java did this directly, but we have option of asm or avx + bitset_container_t *result = bitset_container_create(); + bitset_container_copy(src_1, result); + result->cardinality = + (int32_t)bitset_clear_list(result->words, (uint64_t)result->cardinality, + src_2->array, (uint64_t)src_2->cardinality); + + // do required type conversions. + if (result->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(result); + bitset_container_free(result); + return false; + } + *dst = result; + return true; +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_array_container_iandnot( + bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + *dst = src_1; + src_1->cardinality = + (int32_t)bitset_clear_list(src_1->words, (uint64_t)src_1->cardinality, + src_2->array, (uint64_t)src_2->cardinality); + + if (src_1->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(src_1); + bitset_container_free(src_1); + return false; // not bitset + } else + return true; +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_andnot( + const run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + // follows the Java implementation as of June 2016 + int card = run_container_cardinality(src_1); + if (card <= DEFAULT_MAX_SIZE) { + // must be an array + array_container_t *answer = array_container_create_given_capacity(card); + answer->cardinality = 0; + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + for (int run_value = rle.value; run_value <= rle.value + rle.length; + ++run_value) { + if (!bitset_container_get(src_2, (uint16_t)run_value)) { + answer->array[answer->cardinality++] = (uint16_t)run_value; + } + } + } + *dst = answer; + return false; + } else { // we guess it will be a bitset, though have to check guess when + // done + bitset_container_t *answer = bitset_container_clone(src_2); + + uint32_t last_pos = 0; + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + + uint32_t start = rle.value; + uint32_t end = start + rle.length + 1; + bitset_reset_range(answer->words, last_pos, start); + bitset_flip_range(answer->words, start, end); + last_pos = end; + } + bitset_reset_range(answer->words, last_pos, (uint32_t)(1 << 16)); + + answer->cardinality = bitset_container_compute_cardinality(answer); + + if (answer->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(answer); + bitset_container_free(answer); + return false; // not bitset + } + *dst = answer; + return true; // bitset + } +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_iandnot( + run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + // dummy implementation + bool ans = run_bitset_container_andnot(src_1, src_2, dst); + run_container_free(src_1); + return ans; +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool bitset_run_container_andnot( + const bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + // follows Java implementation + bitset_container_t *result = bitset_container_create(); + + bitset_container_copy(src_1, result); + for (int32_t rlepos = 0; rlepos < src_2->n_runs; ++rlepos) { + rle16_t rle = src_2->runs[rlepos]; + bitset_reset_range(result->words, rle.value, + rle.value + rle.length + UINT32_C(1)); + } + result->cardinality = bitset_container_compute_cardinality(result); + + if (result->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(result); + bitset_container_free(result); + return false; // not bitset + } + *dst = result; + return true; // bitset +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_run_container_iandnot( + bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + *dst = src_1; + + for (int32_t rlepos = 0; rlepos < src_2->n_runs; ++rlepos) { + rle16_t rle = src_2->runs[rlepos]; + bitset_reset_range(src_1->words, rle.value, + rle.value + rle.length + UINT32_C(1)); + } + src_1->cardinality = bitset_container_compute_cardinality(src_1); + + if (src_1->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(src_1); + bitset_container_free(src_1); + return false; // not bitset + } else + return true; +} + +/* helper. a_out must be a valid array container with adequate capacity. + * Returns the cardinality of the output container. Partly Based on Java + * implementation Util.unsignedDifference. + * + * TODO: Util.unsignedDifference does not use advanceUntil. Is it cheaper + * to avoid advanceUntil? + */ + +static int run_array_array_subtract(const run_container_t *rc, + const array_container_t *a_in, + array_container_t *a_out) { + int out_card = 0; + int32_t in_array_pos = + -1; // since advanceUntil always assumes we start the search AFTER this + + for (int rlepos = 0; rlepos < rc->n_runs; rlepos++) { + int32_t start = rc->runs[rlepos].value; + int32_t end = start + rc->runs[rlepos].length + 1; + + in_array_pos = advanceUntil(a_in->array, in_array_pos, + a_in->cardinality, (uint16_t)start); + + if (in_array_pos >= a_in->cardinality) { // run has no items subtracted + for (int32_t i = start; i < end; ++i) + a_out->array[out_card++] = (uint16_t)i; + } else { + uint16_t next_nonincluded = a_in->array[in_array_pos]; + if (next_nonincluded >= end) { + // another case when run goes unaltered + for (int32_t i = start; i < end; ++i) + a_out->array[out_card++] = (uint16_t)i; + in_array_pos--; // ensure we see this item again if necessary + } else { + for (int32_t i = start; i < end; ++i) + if (i != next_nonincluded) + a_out->array[out_card++] = (uint16_t)i; + else // 0 should ensure we don't match + next_nonincluded = + (in_array_pos + 1 >= a_in->cardinality) + ? 0 + : a_in->array[++in_array_pos]; + in_array_pos--; // see again + } + } + } + return out_card; +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any type of container. + */ + +int run_array_container_andnot( + const run_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + // follows the Java impl as of June 2016 + + int card = run_container_cardinality(src_1); + const int arbitrary_threshold = 32; + + if (card <= arbitrary_threshold) { + if (src_2->cardinality == 0) { + *dst = run_container_clone(src_1); + return RUN_CONTAINER_TYPE; + } + // Java's "lazyandNot.toEfficientContainer" thing + run_container_t *answer = run_container_create_given_capacity( + card + array_container_cardinality(src_2)); + + int rlepos = 0; + int xrlepos = 0; // "x" is src_2 + rle16_t rle = src_1->runs[rlepos]; + int32_t start = rle.value; + int32_t end = start + rle.length + 1; + int32_t xstart = src_2->array[xrlepos]; + + while ((rlepos < src_1->n_runs) && (xrlepos < src_2->cardinality)) { + if (end <= xstart) { + // output the first run + answer->runs[answer->n_runs++] = + MAKE_RLE16(start, end - start - 1); + rlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + } else if (xstart + 1 <= start) { + // exit the second run + xrlepos++; + if (xrlepos < src_2->cardinality) { + xstart = src_2->array[xrlepos]; + } + } else { + if (start < xstart) { + answer->runs[answer->n_runs++] = + MAKE_RLE16(start, xstart - start - 1); + } + if (xstart + 1 < end) { + start = xstart + 1; + } else { + rlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + } + } + } + if (rlepos < src_1->n_runs) { + answer->runs[answer->n_runs++] = MAKE_RLE16(start, end - start - 1); + rlepos++; + if (rlepos < src_1->n_runs) { + memcpy(answer->runs + answer->n_runs, src_1->runs + rlepos, + (src_1->n_runs - rlepos) * sizeof(rle16_t)); + answer->n_runs += (src_1->n_runs - rlepos); + } + } + uint8_t return_type; + *dst = convert_run_to_efficient_container(answer, &return_type); + if (answer != *dst) run_container_free(answer); + return return_type; + } + // else it's a bitmap or array + + if (card <= DEFAULT_MAX_SIZE) { + array_container_t *ac = array_container_create_given_capacity(card); + // nb Java code used a generic iterator-based merge to compute + // difference + ac->cardinality = run_array_array_subtract(src_1, src_2, ac); + *dst = ac; + return ARRAY_CONTAINER_TYPE; + } + bitset_container_t *ans = bitset_container_from_run(src_1); + bool result_is_bitset = bitset_array_container_iandnot(ans, src_2, dst); + return (result_is_bitset ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE); +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +int run_array_container_iandnot( + run_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + // dummy implementation same as June 2016 Java + int ans = run_array_container_andnot(src_1, src_2, dst); + run_container_free(src_1); + return ans; +} + +/* dst must be a valid array container, allowed to be src_1 */ + +void array_run_container_andnot(const array_container_t *src_1, + const run_container_t *src_2, + array_container_t *dst) { + // basically following Java impl as of June 2016 + if (src_1->cardinality > dst->capacity) { + array_container_grow(dst, src_1->cardinality, false); + } + + if (src_2->n_runs == 0) { + memmove(dst->array, src_1->array, + sizeof(uint16_t) * src_1->cardinality); + dst->cardinality = src_1->cardinality; + return; + } + int32_t run_start = src_2->runs[0].value; + int32_t run_end = run_start + src_2->runs[0].length; + int which_run = 0; + + uint16_t val = 0; + int dest_card = 0; + for (int i = 0; i < src_1->cardinality; ++i) { + val = src_1->array[i]; + if (val < run_start) + dst->array[dest_card++] = val; + else if (val <= run_end) { + ; // omitted item + } else { + do { + if (which_run + 1 < src_2->n_runs) { + ++which_run; + run_start = src_2->runs[which_run].value; + run_end = run_start + src_2->runs[which_run].length; + + } else + run_start = run_end = (1 << 16) + 1; + } while (val > run_end); + --i; + } + } + dst->cardinality = dest_card; +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +void array_run_container_iandnot(array_container_t *src_1, + const run_container_t *src_2) { + array_run_container_andnot(src_1, src_2, src_1); +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int run_run_container_andnot( + const run_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + run_container_t *ans = run_container_create(); + run_container_andnot(src_1, src_2, ans); + uint8_t typecode_after; + *dst = convert_run_to_efficient_container_and_free(ans, &typecode_after); + return typecode_after; +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +int run_run_container_iandnot( + run_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + // following Java impl as of June 2016 (dummy) + int ans = run_run_container_andnot(src_1, src_2, dst); + run_container_free(src_1); + return ans; +} + +/* + * dst is a valid array container and may be the same as src_1 + */ + +void array_array_container_andnot(const array_container_t *src_1, + const array_container_t *src_2, + array_container_t *dst) { + array_container_andnot(src_1, src_2, dst); +} + +/* inplace array-array andnot will always be able to reuse the space of + * src_1 */ +void array_array_container_iandnot(array_container_t *src_1, + const array_container_t *src_2) { + array_container_andnot(src_1, src_2, src_1); +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). Return value is + * "dst is a bitset" + */ + +bool bitset_bitset_container_andnot( + const bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bitset_container_t *ans = bitset_container_create(); + int card = bitset_container_andnot(src_1, src_2, ans); + if (card <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(ans); + bitset_container_free(ans); + return false; // not bitset + } else { + *dst = ans; + return true; + } +} + +/* Compute the andnot of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_bitset_container_iandnot( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + int card = bitset_container_andnot(src_1, src_2, src_1); + if (card <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(src_1); + bitset_container_free(src_1); + return false; // not bitset + } else { + *dst = src_1; + return true; + } +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_andnot.c */ +/* begin file src/containers/mixed_equal.c */ + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +bool array_container_equal_bitset(const array_container_t* container1, + const bitset_container_t* container2) { + if (container2->cardinality != BITSET_UNKNOWN_CARDINALITY) { + if (container2->cardinality != container1->cardinality) { + return false; + } + } + int32_t pos = 0; + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i) { + uint64_t w = container2->words[i]; + while (w != 0) { + uint64_t t = w & (~w + 1); + uint16_t r = i * 64 + __builtin_ctzll(w); + if (pos >= container1->cardinality) { + return false; + } + if (container1->array[pos] != r) { + return false; + } + ++pos; + w ^= t; + } + } + return (pos == container1->cardinality); +} + +bool run_container_equals_array(const run_container_t* container1, + const array_container_t* container2) { + if (run_container_cardinality(container1) != container2->cardinality) + return false; + int32_t pos = 0; + for (int i = 0; i < container1->n_runs; ++i) { + const uint32_t run_start = container1->runs[i].value; + const uint32_t le = container1->runs[i].length; + + if (container2->array[pos] != run_start) { + return false; + } + + if (container2->array[pos + le] != run_start + le) { + return false; + } + + pos += le + 1; + } + return true; +} + +bool run_container_equals_bitset(const run_container_t* container1, + const bitset_container_t* container2) { + + int run_card = run_container_cardinality(container1); + int bitset_card = (container2->cardinality != BITSET_UNKNOWN_CARDINALITY) ? + container2->cardinality : + bitset_container_compute_cardinality(container2); + if (bitset_card != run_card) { + return false; + } + + for (int32_t i = 0; i < container1->n_runs; i++) { + uint32_t begin = container1->runs[i].value; + if (container1->runs[i].length) { + uint32_t end = begin + container1->runs[i].length + 1; + if (!bitset_container_contains_range(container2, begin, end)) { + return false; + } + } else { + if (!bitset_container_contains(container2, begin)) { + return false; + } + } + } + + return true; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_equal.c */ +/* begin file src/containers/mixed_intersection.c */ +/* + * mixed_intersection.c + * + */ + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the intersection of src_1 and src_2 and write the result to + * dst. */ +void array_bitset_container_intersection(const array_container_t *src_1, + const bitset_container_t *src_2, + array_container_t *dst) { + if (dst->capacity < src_1->cardinality) { + array_container_grow(dst, src_1->cardinality, false); + } + int32_t newcard = 0; // dst could be src_1 + const int32_t origcard = src_1->cardinality; + for (int i = 0; i < origcard; ++i) { + uint16_t key = src_1->array[i]; + // this branchless approach is much faster... + dst->array[newcard] = key; + newcard += bitset_container_contains(src_2, key); + /** + * we could do it this way instead... + * if (bitset_container_contains(src_2, key)) { + * dst->array[newcard++] = key; + * } + * but if the result is unpredictible, the processor generates + * many mispredicted branches. + * Difference can be huge (from 3 cycles when predictible all the way + * to 16 cycles when unpredictible. + * See + * https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/extra/bitset/c/arraybitsetintersection.c + */ + } + dst->cardinality = newcard; +} + +/* Compute the size of the intersection of src_1 and src_2. */ +int array_bitset_container_intersection_cardinality( + const array_container_t *src_1, const bitset_container_t *src_2) { + int32_t newcard = 0; + const int32_t origcard = src_1->cardinality; + for (int i = 0; i < origcard; ++i) { + uint16_t key = src_1->array[i]; + newcard += bitset_container_contains(src_2, key); + } + return newcard; +} + + +bool array_bitset_container_intersect(const array_container_t *src_1, + const bitset_container_t *src_2) { + const int32_t origcard = src_1->cardinality; + for (int i = 0; i < origcard; ++i) { + uint16_t key = src_1->array[i]; + if(bitset_container_contains(src_2, key)) return true; + } + return false; +} + +/* Compute the intersection of src_1 and src_2 and write the result to + * dst. It is allowed for dst to be equal to src_1. We assume that dst is a + * valid container. */ +void array_run_container_intersection(const array_container_t *src_1, + const run_container_t *src_2, + array_container_t *dst) { + if (run_container_is_full(src_2)) { + if (dst != src_1) array_container_copy(src_1, dst); + return; + } + if (dst->capacity < src_1->cardinality) { + array_container_grow(dst, src_1->cardinality, false); + } + if (src_2->n_runs == 0) { + return; + } + int32_t rlepos = 0; + int32_t arraypos = 0; + rle16_t rle = src_2->runs[rlepos]; + int32_t newcard = 0; + while (arraypos < src_1->cardinality) { + const uint16_t arrayval = src_1->array[arraypos]; + while (rle.value + rle.length < + arrayval) { // this will frequently be false + ++rlepos; + if (rlepos == src_2->n_runs) { + dst->cardinality = newcard; + return; // we are done + } + rle = src_2->runs[rlepos]; + } + if (rle.value > arrayval) { + arraypos = advanceUntil(src_1->array, arraypos, src_1->cardinality, + rle.value); + } else { + dst->array[newcard] = arrayval; + newcard++; + arraypos++; + } + } + dst->cardinality = newcard; +} + +/* Compute the intersection of src_1 and src_2 and write the result to + * *dst. If the result is true then the result is a bitset_container_t + * otherwise is a array_container_t. If *dst == src_2, an in-place processing + * is attempted.*/ +bool run_bitset_container_intersection( + const run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + if (run_container_is_full(src_1)) { + if (*dst != src_2) *dst = bitset_container_clone(src_2); + return true; + } + int32_t card = run_container_cardinality(src_1); + if (card <= DEFAULT_MAX_SIZE) { + // result can only be an array (assuming that we never make a + // RunContainer) + if (card > src_2->cardinality) { + card = src_2->cardinality; + } + array_container_t *answer = array_container_create_given_capacity(card); + *dst = answer; + if (*dst == NULL) { + return false; + } + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + uint32_t endofrun = (uint32_t)rle.value + rle.length; + for (uint32_t runValue = rle.value; runValue <= endofrun; + ++runValue) { + answer->array[answer->cardinality] = (uint16_t)runValue; + answer->cardinality += + bitset_container_contains(src_2, runValue); + } + } + return false; + } + if (*dst == src_2) { // we attempt in-place + bitset_container_t *answer = CAST_bitset(*dst); + uint32_t start = 0; + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + const rle16_t rle = src_1->runs[rlepos]; + uint32_t end = rle.value; + bitset_reset_range(src_2->words, start, end); + + start = end + rle.length + 1; + } + bitset_reset_range(src_2->words, start, UINT32_C(1) << 16); + answer->cardinality = bitset_container_compute_cardinality(answer); + if (src_2->cardinality > DEFAULT_MAX_SIZE) { + return true; + } else { + array_container_t *newanswer = array_container_from_bitset(src_2); + if (newanswer == NULL) { + *dst = NULL; + return false; + } + *dst = newanswer; + return false; + } + } else { // no inplace + // we expect the answer to be a bitmap (if we are lucky) + bitset_container_t *answer = bitset_container_clone(src_2); + + *dst = answer; + if (answer == NULL) { + return true; + } + uint32_t start = 0; + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + const rle16_t rle = src_1->runs[rlepos]; + uint32_t end = rle.value; + bitset_reset_range(answer->words, start, end); + start = end + rle.length + 1; + } + bitset_reset_range(answer->words, start, UINT32_C(1) << 16); + answer->cardinality = bitset_container_compute_cardinality(answer); + + if (answer->cardinality > DEFAULT_MAX_SIZE) { + return true; + } else { + array_container_t *newanswer = array_container_from_bitset(answer); + bitset_container_free(CAST_bitset(*dst)); + if (newanswer == NULL) { + *dst = NULL; + return false; + } + *dst = newanswer; + return false; + } + } +} + +/* Compute the size of the intersection between src_1 and src_2 . */ +int array_run_container_intersection_cardinality(const array_container_t *src_1, + const run_container_t *src_2) { + if (run_container_is_full(src_2)) { + return src_1->cardinality; + } + if (src_2->n_runs == 0) { + return 0; + } + int32_t rlepos = 0; + int32_t arraypos = 0; + rle16_t rle = src_2->runs[rlepos]; + int32_t newcard = 0; + while (arraypos < src_1->cardinality) { + const uint16_t arrayval = src_1->array[arraypos]; + while (rle.value + rle.length < + arrayval) { // this will frequently be false + ++rlepos; + if (rlepos == src_2->n_runs) { + return newcard; // we are done + } + rle = src_2->runs[rlepos]; + } + if (rle.value > arrayval) { + arraypos = advanceUntil(src_1->array, arraypos, src_1->cardinality, + rle.value); + } else { + newcard++; + arraypos++; + } + } + return newcard; +} + +/* Compute the intersection between src_1 and src_2 + **/ +int run_bitset_container_intersection_cardinality( + const run_container_t *src_1, const bitset_container_t *src_2) { + if (run_container_is_full(src_1)) { + return bitset_container_cardinality(src_2); + } + int answer = 0; + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + answer += + bitset_lenrange_cardinality(src_2->words, rle.value, rle.length); + } + return answer; +} + + +bool array_run_container_intersect(const array_container_t *src_1, + const run_container_t *src_2) { + if( run_container_is_full(src_2) ) { + return !array_container_empty(src_1); + } + if (src_2->n_runs == 0) { + return false; + } + int32_t rlepos = 0; + int32_t arraypos = 0; + rle16_t rle = src_2->runs[rlepos]; + while (arraypos < src_1->cardinality) { + const uint16_t arrayval = src_1->array[arraypos]; + while (rle.value + rle.length < + arrayval) { // this will frequently be false + ++rlepos; + if (rlepos == src_2->n_runs) { + return false; // we are done + } + rle = src_2->runs[rlepos]; + } + if (rle.value > arrayval) { + arraypos = advanceUntil(src_1->array, arraypos, src_1->cardinality, + rle.value); + } else { + return true; + } + } + return false; +} + +/* Compute the intersection between src_1 and src_2 + **/ +bool run_bitset_container_intersect(const run_container_t *src_1, + const bitset_container_t *src_2) { + if( run_container_is_full(src_1) ) { + return !bitset_container_empty(src_2); + } + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + if(!bitset_lenrange_empty(src_2->words, rle.value,rle.length)) return true; + } + return false; +} + +/* + * Compute the intersection between src_1 and src_2 and write the result + * to *dst. If the return function is true, the result is a bitset_container_t + * otherwise is a array_container_t. + */ +bool bitset_bitset_container_intersection( + const bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + const int newCardinality = bitset_container_and_justcard(src_1, src_2); + if (newCardinality > DEFAULT_MAX_SIZE) { + *dst = bitset_container_create(); + if (*dst != NULL) { + bitset_container_and_nocard(src_1, src_2, CAST_bitset(*dst)); + CAST_bitset(*dst)->cardinality = newCardinality; + } + return true; // it is a bitset + } + *dst = array_container_create_given_capacity(newCardinality); + if (*dst != NULL) { + CAST_array(*dst)->cardinality = newCardinality; + bitset_extract_intersection_setbits_uint16( + src_1->words, src_2->words, BITSET_CONTAINER_SIZE_IN_WORDS, + CAST_array(*dst)->array, 0); + } + return false; // not a bitset +} + +bool bitset_bitset_container_intersection_inplace( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + const int newCardinality = bitset_container_and_justcard(src_1, src_2); + if (newCardinality > DEFAULT_MAX_SIZE) { + *dst = src_1; + bitset_container_and_nocard(src_1, src_2, src_1); + CAST_bitset(*dst)->cardinality = newCardinality; + return true; // it is a bitset + } + *dst = array_container_create_given_capacity(newCardinality); + if (*dst != NULL) { + CAST_array(*dst)->cardinality = newCardinality; + bitset_extract_intersection_setbits_uint16( + src_1->words, src_2->words, BITSET_CONTAINER_SIZE_IN_WORDS, + CAST_array(*dst)->array, 0); + } + return false; // not a bitset +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_intersection.c */ +/* begin file src/containers/mixed_negation.c */ +/* + * mixed_negation.c + * + */ + +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +// TODO: make simplified and optimized negation code across +// the full range. + +/* Negation across the entire range of the container. + * Compute the negation of src and write the result + * to *dst. The complement of a + * sufficiently sparse set will always be dense and a hence a bitmap +' * We assume that dst is pre-allocated and a valid bitset container + * There can be no in-place version. + */ +void array_container_negation(const array_container_t *src, + bitset_container_t *dst) { + uint64_t card = UINT64_C(1 << 16); + bitset_container_set_all(dst); + + if (src->cardinality == 0) { + return; + } + + dst->cardinality = (int32_t)bitset_clear_list(dst->words, card, src->array, + (uint64_t)src->cardinality); +} + +/* Negation across the entire range of the container + * Compute the negation of src and write the result + * to *dst. A true return value indicates a bitset result, + * otherwise the result is an array container. + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool bitset_container_negation( + const bitset_container_t *src, container_t **dst +){ + return bitset_container_negation_range(src, 0, (1 << 16), dst); +} + +/* inplace version */ +/* + * Same as bitset_container_negation except that if the output is to + * be a + * bitset_container_t, then src is modified and no allocation is made. + * If the output is to be an array_container_t, then caller is responsible + * to free the container. + * In all cases, the result is in *dst. + */ +bool bitset_container_negation_inplace( + bitset_container_t *src, container_t **dst +){ + return bitset_container_negation_range_inplace(src, 0, (1 << 16), dst); +} + +/* Negation across the entire range of container + * Compute the negation of src and write the result + * to *dst. Return values are the *_TYPECODES as defined * in containers.h + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +int run_container_negation(const run_container_t *src, container_t **dst) { + return run_container_negation_range(src, 0, (1 << 16), dst); +} + +/* + * Same as run_container_negation except that if the output is to + * be a + * run_container_t, and has the capacity to hold the result, + * then src is modified and no allocation is made. + * In all cases, the result is in *dst. + */ +int run_container_negation_inplace(run_container_t *src, container_t **dst) { + return run_container_negation_range_inplace(src, 0, (1 << 16), dst); +} + +/* Negation across a range of the container. + * Compute the negation of src and write the result + * to *dst. Returns true if the result is a bitset container + * and false for an array container. *dst is not preallocated. + */ +bool array_container_negation_range( + const array_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + /* close port of the Java implementation */ + if (range_start >= range_end) { + *dst = array_container_clone(src); + return false; + } + + int32_t start_index = + binarySearch(src->array, src->cardinality, (uint16_t)range_start); + if (start_index < 0) start_index = -start_index - 1; + + int32_t last_index = + binarySearch(src->array, src->cardinality, (uint16_t)(range_end - 1)); + if (last_index < 0) last_index = -last_index - 2; + + const int32_t current_values_in_range = last_index - start_index + 1; + const int32_t span_to_be_flipped = range_end - range_start; + const int32_t new_values_in_range = + span_to_be_flipped - current_values_in_range; + const int32_t cardinality_change = + new_values_in_range - current_values_in_range; + const int32_t new_cardinality = src->cardinality + cardinality_change; + + if (new_cardinality > DEFAULT_MAX_SIZE) { + bitset_container_t *temp = bitset_container_from_array(src); + bitset_flip_range(temp->words, (uint32_t)range_start, + (uint32_t)range_end); + temp->cardinality = new_cardinality; + *dst = temp; + return true; + } + + array_container_t *arr = + array_container_create_given_capacity(new_cardinality); + *dst = (container_t *)arr; + if(new_cardinality == 0) { + arr->cardinality = new_cardinality; + return false; // we are done. + } + // copy stuff before the active area + memcpy(arr->array, src->array, start_index * sizeof(uint16_t)); + + // work on the range + int32_t out_pos = start_index, in_pos = start_index; + int32_t val_in_range = range_start; + for (; val_in_range < range_end && in_pos <= last_index; ++val_in_range) { + if ((uint16_t)val_in_range != src->array[in_pos]) { + arr->array[out_pos++] = (uint16_t)val_in_range; + } else { + ++in_pos; + } + } + for (; val_in_range < range_end; ++val_in_range) + arr->array[out_pos++] = (uint16_t)val_in_range; + + // content after the active range + memcpy(arr->array + out_pos, src->array + (last_index + 1), + (src->cardinality - (last_index + 1)) * sizeof(uint16_t)); + arr->cardinality = new_cardinality; + return false; +} + +/* Even when the result would fit, it is unclear how to make an + * inplace version without inefficient copying. + */ + +bool array_container_negation_range_inplace( + array_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + bool ans = array_container_negation_range(src, range_start, range_end, dst); + // TODO : try a real inplace version + array_container_free(src); + return ans; +} + +/* Negation across a range of the container + * Compute the negation of src and write the result + * to *dst. A true return value indicates a bitset result, + * otherwise the result is an array container. + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +bool bitset_container_negation_range( + const bitset_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + // TODO maybe consider density-based estimate + // and sometimes build result directly as array, with + // conversion back to bitset if wrong. Or determine + // actual result cardinality, then go directly for the known final cont. + + // keep computation using bitsets as long as possible. + bitset_container_t *t = bitset_container_clone(src); + bitset_flip_range(t->words, (uint32_t)range_start, (uint32_t)range_end); + t->cardinality = bitset_container_compute_cardinality(t); + + if (t->cardinality > DEFAULT_MAX_SIZE) { + *dst = t; + return true; + } else { + *dst = array_container_from_bitset(t); + bitset_container_free(t); + return false; + } +} + +/* inplace version */ +/* + * Same as bitset_container_negation except that if the output is to + * be a + * bitset_container_t, then src is modified and no allocation is made. + * If the output is to be an array_container_t, then caller is responsible + * to free the container. + * In all cases, the result is in *dst. + */ +bool bitset_container_negation_range_inplace( + bitset_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + bitset_flip_range(src->words, (uint32_t)range_start, (uint32_t)range_end); + src->cardinality = bitset_container_compute_cardinality(src); + if (src->cardinality > DEFAULT_MAX_SIZE) { + *dst = src; + return true; + } + *dst = array_container_from_bitset(src); + bitset_container_free(src); + return false; +} + +/* Negation across a range of container + * Compute the negation of src and write the result + * to *dst. Return values are the *_TYPECODES as defined * in containers.h + * We assume that dst is not pre-allocated. In + * case of failure, *dst will be NULL. + */ +int run_container_negation_range( + const run_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + uint8_t return_typecode; + + // follows the Java implementation + if (range_end <= range_start) { + *dst = run_container_clone(src); + return RUN_CONTAINER_TYPE; + } + + run_container_t *ans = run_container_create_given_capacity( + src->n_runs + 1); // src->n_runs + 1); + int k = 0; + for (; k < src->n_runs && src->runs[k].value < range_start; ++k) { + ans->runs[k] = src->runs[k]; + ans->n_runs++; + } + + run_container_smart_append_exclusive( + ans, (uint16_t)range_start, (uint16_t)(range_end - range_start - 1)); + + for (; k < src->n_runs; ++k) { + run_container_smart_append_exclusive(ans, src->runs[k].value, + src->runs[k].length); + } + + *dst = convert_run_to_efficient_container(ans, &return_typecode); + if (return_typecode != RUN_CONTAINER_TYPE) run_container_free(ans); + + return return_typecode; +} + +/* + * Same as run_container_negation except that if the output is to + * be a + * run_container_t, and has the capacity to hold the result, + * then src is modified and no allocation is made. + * In all cases, the result is in *dst. + */ +int run_container_negation_range_inplace( + run_container_t *src, + const int range_start, const int range_end, + container_t **dst +){ + uint8_t return_typecode; + + if (range_end <= range_start) { + *dst = src; + return RUN_CONTAINER_TYPE; + } + + // TODO: efficient special case when range is 0 to 65535 inclusive + + if (src->capacity == src->n_runs) { + // no excess room. More checking to see if result can fit + bool last_val_before_range = false; + bool first_val_in_range = false; + bool last_val_in_range = false; + bool first_val_past_range = false; + + if (range_start > 0) + last_val_before_range = + run_container_contains(src, (uint16_t)(range_start - 1)); + first_val_in_range = run_container_contains(src, (uint16_t)range_start); + + if (last_val_before_range == first_val_in_range) { + last_val_in_range = + run_container_contains(src, (uint16_t)(range_end - 1)); + if (range_end != 0x10000) + first_val_past_range = + run_container_contains(src, (uint16_t)range_end); + + if (last_val_in_range == + first_val_past_range) { // no space for inplace + int ans = run_container_negation_range(src, range_start, + range_end, dst); + run_container_free(src); + return ans; + } + } + } + // all other cases: result will fit + + run_container_t *ans = src; + int my_nbr_runs = src->n_runs; + + ans->n_runs = 0; + int k = 0; + for (; (k < my_nbr_runs) && (src->runs[k].value < range_start); ++k) { + // ans->runs[k] = src->runs[k]; (would be self-copy) + ans->n_runs++; + } + + // as with Java implementation, use locals to give self a buffer of depth 1 + rle16_t buffered = MAKE_RLE16(0, 0); + rle16_t next = buffered; + if (k < my_nbr_runs) buffered = src->runs[k]; + + run_container_smart_append_exclusive( + ans, (uint16_t)range_start, (uint16_t)(range_end - range_start - 1)); + + for (; k < my_nbr_runs; ++k) { + if (k + 1 < my_nbr_runs) next = src->runs[k + 1]; + + run_container_smart_append_exclusive(ans, buffered.value, + buffered.length); + buffered = next; + } + + *dst = convert_run_to_efficient_container(ans, &return_typecode); + if (return_typecode != RUN_CONTAINER_TYPE) run_container_free(ans); + + return return_typecode; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_negation.c */ +/* begin file src/containers/mixed_subset.c */ + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +bool array_container_is_subset_bitset(const array_container_t* container1, + const bitset_container_t* container2) { + if (container2->cardinality != BITSET_UNKNOWN_CARDINALITY) { + if (container2->cardinality < container1->cardinality) { + return false; + } + } + for (int i = 0; i < container1->cardinality; ++i) { + if (!bitset_container_contains(container2, container1->array[i])) { + return false; + } + } + return true; +} + +bool run_container_is_subset_array(const run_container_t* container1, + const array_container_t* container2) { + if (run_container_cardinality(container1) > container2->cardinality) + return false; + int32_t start_pos = -1, stop_pos = -1; + for (int i = 0; i < container1->n_runs; ++i) { + int32_t start = container1->runs[i].value; + int32_t stop = start + container1->runs[i].length; + start_pos = advanceUntil(container2->array, stop_pos, + container2->cardinality, start); + stop_pos = advanceUntil(container2->array, stop_pos, + container2->cardinality, stop); + if (start_pos == container2->cardinality) { + return false; + } else if (stop_pos - start_pos != stop - start || + container2->array[start_pos] != start || + container2->array[stop_pos] != stop) { + return false; + } + } + return true; +} + +bool array_container_is_subset_run(const array_container_t* container1, + const run_container_t* container2) { + if (container1->cardinality > run_container_cardinality(container2)) + return false; + int i_array = 0, i_run = 0; + while (i_array < container1->cardinality && i_run < container2->n_runs) { + uint32_t start = container2->runs[i_run].value; + uint32_t stop = start + container2->runs[i_run].length; + if (container1->array[i_array] < start) { + return false; + } else if (container1->array[i_array] > stop) { + i_run++; + } else { // the value of the array is in the run + i_array++; + } + } + if (i_array == container1->cardinality) { + return true; + } else { + return false; + } +} + +bool run_container_is_subset_bitset(const run_container_t* container1, + const bitset_container_t* container2) { + // todo: this code could be much faster + if (container2->cardinality != BITSET_UNKNOWN_CARDINALITY) { + if (container2->cardinality < run_container_cardinality(container1)) { + return false; + } + } else { + int32_t card = bitset_container_compute_cardinality( + container2); // modify container2? + if (card < run_container_cardinality(container1)) { + return false; + } + } + for (int i = 0; i < container1->n_runs; ++i) { + uint32_t run_start = container1->runs[i].value; + uint32_t le = container1->runs[i].length; + for (uint32_t j = run_start; j <= run_start + le; ++j) { + if (!bitset_container_contains(container2, j)) { + return false; + } + } + } + return true; +} + +bool bitset_container_is_subset_run(const bitset_container_t* container1, + const run_container_t* container2) { + // todo: this code could be much faster + if (container1->cardinality != BITSET_UNKNOWN_CARDINALITY) { + if (container1->cardinality > run_container_cardinality(container2)) { + return false; + } + } + int32_t i_bitset = 0, i_run = 0; + while (i_bitset < BITSET_CONTAINER_SIZE_IN_WORDS && + i_run < container2->n_runs) { + uint64_t w = container1->words[i_bitset]; + while (w != 0 && i_run < container2->n_runs) { + uint32_t start = container2->runs[i_run].value; + uint32_t stop = start + container2->runs[i_run].length; + uint64_t t = w & (~w + 1); + uint16_t r = i_bitset * 64 + __builtin_ctzll(w); + if (r < start) { + return false; + } else if (r > stop) { + i_run++; + continue; + } else { + w ^= t; + } + } + if (w == 0) { + i_bitset++; + } else { + return false; + } + } + if (i_bitset < BITSET_CONTAINER_SIZE_IN_WORDS) { + // terminated iterating on the run containers, check that rest of bitset + // is empty + for (; i_bitset < BITSET_CONTAINER_SIZE_IN_WORDS; i_bitset++) { + if (container1->words[i_bitset] != 0) { + return false; + } + } + } + return true; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_subset.c */ +/* begin file src/containers/mixed_union.c */ +/* + * mixed_union.c + * + */ + +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the union of src_1 and src_2 and write the result to + * dst. */ +void array_bitset_container_union(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + if (src_2 != dst) bitset_container_copy(src_2, dst); + dst->cardinality = (int32_t)bitset_set_list_withcard( + dst->words, dst->cardinality, src_1->array, src_1->cardinality); +} + +/* Compute the union of src_1 and src_2 and write the result to + * dst. It is allowed for src_2 to be dst. This version does not + * update the cardinality of dst (it is set to BITSET_UNKNOWN_CARDINALITY). */ +void array_bitset_container_lazy_union(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + if (src_2 != dst) bitset_container_copy(src_2, dst); + bitset_set_list(dst->words, src_1->array, src_1->cardinality); + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; +} + +void run_bitset_container_union(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + assert(!run_container_is_full(src_1)); // catch this case upstream + if (src_2 != dst) bitset_container_copy(src_2, dst); + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + bitset_set_lenrange(dst->words, rle.value, rle.length); + } + dst->cardinality = bitset_container_compute_cardinality(dst); +} + +void run_bitset_container_lazy_union(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + assert(!run_container_is_full(src_1)); // catch this case upstream + if (src_2 != dst) bitset_container_copy(src_2, dst); + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + bitset_set_lenrange(dst->words, rle.value, rle.length); + } + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; +} + +// why do we leave the result as a run container?? +void array_run_container_union(const array_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst) { + if (run_container_is_full(src_2)) { + run_container_copy(src_2, dst); + return; + } + // TODO: see whether the "2*" is spurious + run_container_grow(dst, 2 * (src_1->cardinality + src_2->n_runs), false); + int32_t rlepos = 0; + int32_t arraypos = 0; + rle16_t previousrle; + if (src_2->runs[rlepos].value <= src_1->array[arraypos]) { + previousrle = run_container_append_first(dst, src_2->runs[rlepos]); + rlepos++; + } else { + previousrle = + run_container_append_value_first(dst, src_1->array[arraypos]); + arraypos++; + } + while ((rlepos < src_2->n_runs) && (arraypos < src_1->cardinality)) { + if (src_2->runs[rlepos].value <= src_1->array[arraypos]) { + run_container_append(dst, src_2->runs[rlepos], &previousrle); + rlepos++; + } else { + run_container_append_value(dst, src_1->array[arraypos], + &previousrle); + arraypos++; + } + } + if (arraypos < src_1->cardinality) { + while (arraypos < src_1->cardinality) { + run_container_append_value(dst, src_1->array[arraypos], + &previousrle); + arraypos++; + } + } else { + while (rlepos < src_2->n_runs) { + run_container_append(dst, src_2->runs[rlepos], &previousrle); + rlepos++; + } + } +} + +void array_run_container_inplace_union(const array_container_t *src_1, + run_container_t *src_2) { + if (run_container_is_full(src_2)) { + return; + } + const int32_t maxoutput = src_1->cardinality + src_2->n_runs; + const int32_t neededcapacity = maxoutput + src_2->n_runs; + if (src_2->capacity < neededcapacity) + run_container_grow(src_2, neededcapacity, true); + memmove(src_2->runs + maxoutput, src_2->runs, + src_2->n_runs * sizeof(rle16_t)); + rle16_t *inputsrc2 = src_2->runs + maxoutput; + int32_t rlepos = 0; + int32_t arraypos = 0; + int src2nruns = src_2->n_runs; + src_2->n_runs = 0; + + rle16_t previousrle; + + if (inputsrc2[rlepos].value <= src_1->array[arraypos]) { + previousrle = run_container_append_first(src_2, inputsrc2[rlepos]); + rlepos++; + } else { + previousrle = + run_container_append_value_first(src_2, src_1->array[arraypos]); + arraypos++; + } + + while ((rlepos < src2nruns) && (arraypos < src_1->cardinality)) { + if (inputsrc2[rlepos].value <= src_1->array[arraypos]) { + run_container_append(src_2, inputsrc2[rlepos], &previousrle); + rlepos++; + } else { + run_container_append_value(src_2, src_1->array[arraypos], + &previousrle); + arraypos++; + } + } + if (arraypos < src_1->cardinality) { + while (arraypos < src_1->cardinality) { + run_container_append_value(src_2, src_1->array[arraypos], + &previousrle); + arraypos++; + } + } else { + while (rlepos < src2nruns) { + run_container_append(src_2, inputsrc2[rlepos], &previousrle); + rlepos++; + } + } +} + +bool array_array_container_union( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = src_1->cardinality + src_2->cardinality; + if (totalCardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_create_given_capacity(totalCardinality); + if (*dst != NULL) { + array_container_union(src_1, src_2, CAST_array(*dst)); + } else { + return true; // otherwise failure won't be caught + } + return false; // not a bitset + } + *dst = bitset_container_create(); + bool returnval = true; // expect a bitset + if (*dst != NULL) { + bitset_container_t *ourbitset = CAST_bitset(*dst); + bitset_set_list(ourbitset->words, src_1->array, src_1->cardinality); + ourbitset->cardinality = (int32_t)bitset_set_list_withcard( + ourbitset->words, src_1->cardinality, src_2->array, + src_2->cardinality); + if (ourbitset->cardinality <= DEFAULT_MAX_SIZE) { + // need to convert! + *dst = array_container_from_bitset(ourbitset); + bitset_container_free(ourbitset); + returnval = false; // not going to be a bitset + } + } + return returnval; +} + +bool array_array_container_inplace_union( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = src_1->cardinality + src_2->cardinality; + *dst = NULL; + if (totalCardinality <= DEFAULT_MAX_SIZE) { + if(src_1->capacity < totalCardinality) { + *dst = array_container_create_given_capacity(2 * totalCardinality); // be purposefully generous + if (*dst != NULL) { + array_container_union(src_1, src_2, CAST_array(*dst)); + } else { + return true; // otherwise failure won't be caught + } + return false; // not a bitset + } else { + memmove(src_1->array + src_2->cardinality, src_1->array, src_1->cardinality * sizeof(uint16_t)); + src_1->cardinality = (int32_t)union_uint16(src_1->array + src_2->cardinality, src_1->cardinality, + src_2->array, src_2->cardinality, src_1->array); + return false; // not a bitset + } + } + *dst = bitset_container_create(); + bool returnval = true; // expect a bitset + if (*dst != NULL) { + bitset_container_t *ourbitset = CAST_bitset(*dst); + bitset_set_list(ourbitset->words, src_1->array, src_1->cardinality); + ourbitset->cardinality = (int32_t)bitset_set_list_withcard( + ourbitset->words, src_1->cardinality, src_2->array, + src_2->cardinality); + if (ourbitset->cardinality <= DEFAULT_MAX_SIZE) { + // need to convert! + if(src_1->capacity < ourbitset->cardinality) { + array_container_grow(src_1, ourbitset->cardinality, false); + } + + bitset_extract_setbits_uint16(ourbitset->words, BITSET_CONTAINER_SIZE_IN_WORDS, + src_1->array, 0); + src_1->cardinality = ourbitset->cardinality; + *dst = src_1; + bitset_container_free(ourbitset); + returnval = false; // not going to be a bitset + } + } + return returnval; +} + + +bool array_array_container_lazy_union( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = src_1->cardinality + src_2->cardinality; + if (totalCardinality <= ARRAY_LAZY_LOWERBOUND) { + *dst = array_container_create_given_capacity(totalCardinality); + if (*dst != NULL) { + array_container_union(src_1, src_2, CAST_array(*dst)); + } else { + return true; // otherwise failure won't be caught + } + return false; // not a bitset + } + *dst = bitset_container_create(); + bool returnval = true; // expect a bitset + if (*dst != NULL) { + bitset_container_t *ourbitset = CAST_bitset(*dst); + bitset_set_list(ourbitset->words, src_1->array, src_1->cardinality); + bitset_set_list(ourbitset->words, src_2->array, src_2->cardinality); + ourbitset->cardinality = BITSET_UNKNOWN_CARDINALITY; + } + return returnval; +} + + +bool array_array_container_lazy_inplace_union( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = src_1->cardinality + src_2->cardinality; + *dst = NULL; + if (totalCardinality <= ARRAY_LAZY_LOWERBOUND) { + if(src_1->capacity < totalCardinality) { + *dst = array_container_create_given_capacity(2 * totalCardinality); // be purposefully generous + if (*dst != NULL) { + array_container_union(src_1, src_2, CAST_array(*dst)); + } else { + return true; // otherwise failure won't be caught + } + return false; // not a bitset + } else { + memmove(src_1->array + src_2->cardinality, src_1->array, src_1->cardinality * sizeof(uint16_t)); + src_1->cardinality = (int32_t)union_uint16(src_1->array + src_2->cardinality, src_1->cardinality, + src_2->array, src_2->cardinality, src_1->array); + return false; // not a bitset + } + } + *dst = bitset_container_create(); + bool returnval = true; // expect a bitset + if (*dst != NULL) { + bitset_container_t *ourbitset = CAST_bitset(*dst); + bitset_set_list(ourbitset->words, src_1->array, src_1->cardinality); + bitset_set_list(ourbitset->words, src_2->array, src_2->cardinality); + ourbitset->cardinality = BITSET_UNKNOWN_CARDINALITY; + } + return returnval; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_union.c */ +/* begin file src/containers/mixed_xor.c */ +/* + * mixed_xor.c + */ + +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). + * Result is true iff dst is a bitset */ +bool array_bitset_container_xor( + const array_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bitset_container_t *result = bitset_container_create(); + bitset_container_copy(src_2, result); + result->cardinality = (int32_t)bitset_flip_list_withcard( + result->words, result->cardinality, src_1->array, src_1->cardinality); + + // do required type conversions. + if (result->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(result); + bitset_container_free(result); + return false; // not bitset + } + *dst = result; + return true; // bitset +} + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. It is allowed for src_2 to be dst. This version does not + * update the cardinality of dst (it is set to BITSET_UNKNOWN_CARDINALITY). + */ + +void array_bitset_container_lazy_xor(const array_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + if (src_2 != dst) bitset_container_copy(src_2, dst); + bitset_flip_list(dst->words, src_1->array, src_1->cardinality); + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; +} + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_xor( + const run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bitset_container_t *result = bitset_container_create(); + + bitset_container_copy(src_2, result); + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + bitset_flip_range(result->words, rle.value, + rle.value + rle.length + UINT32_C(1)); + } + result->cardinality = bitset_container_compute_cardinality(result); + + if (result->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(result); + bitset_container_free(result); + return false; // not bitset + } + *dst = result; + return true; // bitset +} + +/* lazy xor. Dst is initialized and may be equal to src_2. + * Result is left as a bitset container, even if actual + * cardinality would dictate an array container. + */ + +void run_bitset_container_lazy_xor(const run_container_t *src_1, + const bitset_container_t *src_2, + bitset_container_t *dst) { + if (src_2 != dst) bitset_container_copy(src_2, dst); + for (int32_t rlepos = 0; rlepos < src_1->n_runs; ++rlepos) { + rle16_t rle = src_1->runs[rlepos]; + bitset_flip_range(dst->words, rle.value, + rle.value + rle.length + UINT32_C(1)); + } + dst->cardinality = BITSET_UNKNOWN_CARDINALITY; +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int array_run_container_xor( + const array_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + // semi following Java XOR implementation as of May 2016 + // the C OR implementation works quite differently and can return a run + // container + // TODO could optimize for full run containers. + + // use of lazy following Java impl. + const int arbitrary_threshold = 32; + if (src_1->cardinality < arbitrary_threshold) { + run_container_t *ans = run_container_create(); + array_run_container_lazy_xor(src_1, src_2, ans); // keeps runs. + uint8_t typecode_after; + *dst = + convert_run_to_efficient_container_and_free(ans, &typecode_after); + return typecode_after; + } + + int card = run_container_cardinality(src_2); + if (card <= DEFAULT_MAX_SIZE) { + // Java implementation works with the array, xoring the run elements via + // iterator + array_container_t *temp = array_container_from_run(src_2); + bool ret_is_bitset = array_array_container_xor(temp, src_1, dst); + array_container_free(temp); + return ret_is_bitset ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE; + + } else { // guess that it will end up as a bitset + bitset_container_t *result = bitset_container_from_run(src_2); + bool is_bitset = bitset_array_container_ixor(result, src_1, dst); + // any necessary type conversion has been done by the ixor + int retval = (is_bitset ? BITSET_CONTAINER_TYPE + : ARRAY_CONTAINER_TYPE); + return retval; + } +} + +/* Dst is a valid run container. (Can it be src_2? Let's say not.) + * Leaves result as run container, even if other options are + * smaller. + */ + +void array_run_container_lazy_xor(const array_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst) { + run_container_grow(dst, src_1->cardinality + src_2->n_runs, false); + int32_t rlepos = 0; + int32_t arraypos = 0; + dst->n_runs = 0; + + while ((rlepos < src_2->n_runs) && (arraypos < src_1->cardinality)) { + if (src_2->runs[rlepos].value <= src_1->array[arraypos]) { + run_container_smart_append_exclusive(dst, src_2->runs[rlepos].value, + src_2->runs[rlepos].length); + rlepos++; + } else { + run_container_smart_append_exclusive(dst, src_1->array[arraypos], + 0); + arraypos++; + } + } + while (arraypos < src_1->cardinality) { + run_container_smart_append_exclusive(dst, src_1->array[arraypos], 0); + arraypos++; + } + while (rlepos < src_2->n_runs) { + run_container_smart_append_exclusive(dst, src_2->runs[rlepos].value, + src_2->runs[rlepos].length); + rlepos++; + } +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int run_run_container_xor( + const run_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + run_container_t *ans = run_container_create(); + run_container_xor(src_1, src_2, ans); + uint8_t typecode_after; + *dst = convert_run_to_efficient_container_and_free(ans, &typecode_after); + return typecode_after; +} + +/* + * Java implementation (as of May 2016) for array_run, run_run + * and bitset_run don't do anything different for inplace. + * Could adopt the mixed_union.c approach instead (ie, using + * smart_append_exclusive) + * + */ + +bool array_array_container_xor( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = + src_1->cardinality + src_2->cardinality; // upper bound + if (totalCardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_create_given_capacity(totalCardinality); + array_container_xor(src_1, src_2, CAST_array(*dst)); + return false; // not a bitset + } + *dst = bitset_container_from_array(src_1); + bool returnval = true; // expect a bitset + bitset_container_t *ourbitset = CAST_bitset(*dst); + ourbitset->cardinality = (uint32_t)bitset_flip_list_withcard( + ourbitset->words, src_1->cardinality, src_2->array, src_2->cardinality); + if (ourbitset->cardinality <= DEFAULT_MAX_SIZE) { + // need to convert! + *dst = array_container_from_bitset(ourbitset); + bitset_container_free(ourbitset); + returnval = false; // not going to be a bitset + } + + return returnval; +} + +bool array_array_container_lazy_xor( + const array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int totalCardinality = src_1->cardinality + src_2->cardinality; + // upper bound, but probably poor estimate for xor + if (totalCardinality <= ARRAY_LAZY_LOWERBOUND) { + *dst = array_container_create_given_capacity(totalCardinality); + if (*dst != NULL) + array_container_xor(src_1, src_2, CAST_array(*dst)); + return false; // not a bitset + } + *dst = bitset_container_from_array(src_1); + bool returnval = true; // expect a bitset (maybe, for XOR??) + if (*dst != NULL) { + bitset_container_t *ourbitset = CAST_bitset(*dst); + bitset_flip_list(ourbitset->words, src_2->array, src_2->cardinality); + ourbitset->cardinality = BITSET_UNKNOWN_CARDINALITY; + } + return returnval; +} + +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). Return value is + * "dst is a bitset" + */ + +bool bitset_bitset_container_xor( + const bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bitset_container_t *ans = bitset_container_create(); + int card = bitset_container_xor(src_1, src_2, ans); + if (card <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(ans); + bitset_container_free(ans); + return false; // not bitset + } else { + *dst = ans; + return true; + } +} + +/* Compute the xor of src_1 and src_2 and write the result to + * dst (which has no container initially). It will modify src_1 + * to be dst if the result is a bitset. Otherwise, it will + * free src_1 and dst will be a new array container. In both + * cases, the caller is responsible for deallocating dst. + * Returns true iff dst is a bitset */ + +bool bitset_array_container_ixor( + bitset_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + *dst = src_1; + src_1->cardinality = (uint32_t)bitset_flip_list_withcard( + src_1->words, src_1->cardinality, src_2->array, src_2->cardinality); + + if (src_1->cardinality <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(src_1); + bitset_container_free(src_1); + return false; // not bitset + } else + return true; +} + +/* a bunch of in-place, some of which may not *really* be inplace. + * TODO: write actual inplace routine if efficiency warrants it + * Anything inplace with a bitset is a good candidate + */ + +bool bitset_bitset_container_ixor( + bitset_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + int card = bitset_container_xor(src_1, src_2, src_1); + if (card <= DEFAULT_MAX_SIZE) { + *dst = array_container_from_bitset(src_1); + bitset_container_free(src_1); + return false; // not bitset + } else { + *dst = src_1; + return true; + } +} + +bool array_bitset_container_ixor( + array_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bool ans = array_bitset_container_xor(src_1, src_2, dst); + array_container_free(src_1); + return ans; +} + +/* Compute the xor of src_1 and src_2 and write the result to + * dst. Result may be either a bitset or an array container + * (returns "result is bitset"). dst does not initially have + * any container, but becomes either a bitset container (return + * result true) or an array container. + */ + +bool run_bitset_container_ixor( + run_container_t *src_1, const bitset_container_t *src_2, + container_t **dst +){ + bool ans = run_bitset_container_xor(src_1, src_2, dst); + run_container_free(src_1); + return ans; +} + +bool bitset_run_container_ixor( + bitset_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + bool ans = run_bitset_container_xor(src_2, src_1, dst); + bitset_container_free(src_1); + return ans; +} + +/* dst does not indicate a valid container initially. Eventually it + * can become any kind of container. + */ + +int array_run_container_ixor( + array_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + int ans = array_run_container_xor(src_1, src_2, dst); + array_container_free(src_1); + return ans; +} + +int run_array_container_ixor( + run_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + int ans = array_run_container_xor(src_2, src_1, dst); + run_container_free(src_1); + return ans; +} + +bool array_array_container_ixor( + array_container_t *src_1, const array_container_t *src_2, + container_t **dst +){ + bool ans = array_array_container_xor(src_1, src_2, dst); + array_container_free(src_1); + return ans; +} + +int run_run_container_ixor( + run_container_t *src_1, const run_container_t *src_2, + container_t **dst +){ + int ans = run_run_container_xor(src_1, src_2, dst); + run_container_free(src_1); + return ans; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/mixed_xor.c */ +/* begin file src/containers/run.c */ +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +extern inline uint16_t run_container_minimum(const run_container_t *run); +extern inline uint16_t run_container_maximum(const run_container_t *run); +extern inline int32_t interleavedBinarySearch(const rle16_t *array, + int32_t lenarray, uint16_t ikey); +extern inline bool run_container_contains(const run_container_t *run, + uint16_t pos); +extern inline int run_container_index_equalorlarger(const run_container_t *arr, uint16_t x); +extern inline bool run_container_is_full(const run_container_t *run); +extern inline bool run_container_nonzero_cardinality(const run_container_t *rc); +extern inline void run_container_clear(run_container_t *run); +extern inline int32_t run_container_serialized_size_in_bytes(int32_t num_runs); +extern inline run_container_t *run_container_create_range(uint32_t start, + uint32_t stop); +extern inline int run_container_cardinality(const run_container_t *run); + + +bool run_container_add(run_container_t *run, uint16_t pos) { + int32_t index = interleavedBinarySearch(run->runs, run->n_runs, pos); + if (index >= 0) return false; // already there + index = -index - 2; // points to preceding value, possibly -1 + if (index >= 0) { // possible match + int32_t offset = pos - run->runs[index].value; + int32_t le = run->runs[index].length; + if (offset <= le) return false; // already there + if (offset == le + 1) { + // we may need to fuse + if (index + 1 < run->n_runs) { + if (run->runs[index + 1].value == pos + 1) { + // indeed fusion is needed + run->runs[index].length = run->runs[index + 1].value + + run->runs[index + 1].length - + run->runs[index].value; + recoverRoomAtIndex(run, (uint16_t)(index + 1)); + return true; + } + } + run->runs[index].length++; + return true; + } + if (index + 1 < run->n_runs) { + // we may need to fuse + if (run->runs[index + 1].value == pos + 1) { + // indeed fusion is needed + run->runs[index + 1].value = pos; + run->runs[index + 1].length = run->runs[index + 1].length + 1; + return true; + } + } + } + if (index == -1) { + // we may need to extend the first run + if (0 < run->n_runs) { + if (run->runs[0].value == pos + 1) { + run->runs[0].length++; + run->runs[0].value--; + return true; + } + } + } + makeRoomAtIndex(run, (uint16_t)(index + 1)); + run->runs[index + 1].value = pos; + run->runs[index + 1].length = 0; + return true; +} + +/* Create a new run container. Return NULL in case of failure. */ +run_container_t *run_container_create_given_capacity(int32_t size) { + run_container_t *run; + /* Allocate the run container itself. */ + if ((run = (run_container_t *)roaring_malloc(sizeof(run_container_t))) == NULL) { + return NULL; + } + if (size <= 0 ) { // we don't want to rely on malloc(0) + run->runs = NULL; + } else if ((run->runs = (rle16_t *)roaring_malloc(sizeof(rle16_t) * size)) == NULL) { + roaring_free(run); + return NULL; + } + run->capacity = size; + run->n_runs = 0; + return run; +} + +int run_container_shrink_to_fit(run_container_t *src) { + if (src->n_runs == src->capacity) return 0; // nothing to do + int savings = src->capacity - src->n_runs; + src->capacity = src->n_runs; + rle16_t *oldruns = src->runs; + src->runs = (rle16_t *)roaring_realloc(oldruns, src->capacity * sizeof(rle16_t)); + if (src->runs == NULL) roaring_free(oldruns); // should never happen? + return savings; +} +/* Create a new run container. Return NULL in case of failure. */ +run_container_t *run_container_create(void) { + return run_container_create_given_capacity(RUN_DEFAULT_INIT_SIZE); +} + +run_container_t *run_container_clone(const run_container_t *src) { + run_container_t *run = run_container_create_given_capacity(src->capacity); + if (run == NULL) return NULL; + run->capacity = src->capacity; + run->n_runs = src->n_runs; + memcpy(run->runs, src->runs, src->n_runs * sizeof(rle16_t)); + return run; +} + +void run_container_offset(const run_container_t *c, + container_t **loc, container_t **hic, + uint16_t offset) { + run_container_t *lo = NULL, *hi = NULL; + + bool split; + int lo_cap, hi_cap; + int top, pivot; + + top = (1 << 16) - offset; + pivot = run_container_index_equalorlarger(c, top); + + if (pivot == -1) { + split = false; + lo_cap = c->n_runs; + hi_cap = 0; + } else { + split = c->runs[pivot].value <= top; + lo_cap = pivot + (split ? 1 : 0); + hi_cap = c->n_runs - pivot; + } + + if (loc && lo_cap) { + lo = run_container_create_given_capacity(lo_cap); + memcpy(lo->runs, c->runs, lo_cap*sizeof(rle16_t)); + lo->n_runs = lo_cap; + for (int i = 0; i < lo_cap; ++i) { + lo->runs[i].value += offset; + } + *loc = (container_t*)lo; + } + + if (hic && hi_cap) { + hi = run_container_create_given_capacity(hi_cap); + memcpy(hi->runs, c->runs+pivot, hi_cap*sizeof(rle16_t)); + hi->n_runs = hi_cap; + for (int i = 0; i < hi_cap; ++i) { + hi->runs[i].value += offset; + } + *hic = (container_t*)hi; + } + + // Fix the split. + if (split) { + if (lo != NULL) { + // Add the missing run to 'lo', exhausting length. + lo->runs[lo->n_runs-1].length = (1 << 16) - lo->runs[lo->n_runs-1].value - 1; + } + + if (hi != NULL) { + // Fix the first run in 'hi'. + hi->runs[0].length -= UINT16_MAX - hi->runs[0].value + 1; + hi->runs[0].value = 0; + } + } +} + +/* Free memory. */ +void run_container_free(run_container_t *run) { + if(run->runs != NULL) {// Jon Strabala reports that some tools complain otherwise + roaring_free(run->runs); + run->runs = NULL; // pedantic + } + roaring_free(run); +} + +void run_container_grow(run_container_t *run, int32_t min, bool copy) { + int32_t newCapacity = + (run->capacity == 0) + ? RUN_DEFAULT_INIT_SIZE + : run->capacity < 64 ? run->capacity * 2 + : run->capacity < 1024 ? run->capacity * 3 / 2 + : run->capacity * 5 / 4; + if (newCapacity < min) newCapacity = min; + run->capacity = newCapacity; + assert(run->capacity >= min); + if (copy) { + rle16_t *oldruns = run->runs; + run->runs = + (rle16_t *)roaring_realloc(oldruns, run->capacity * sizeof(rle16_t)); + if (run->runs == NULL) roaring_free(oldruns); + } else { + // Jon Strabala reports that some tools complain otherwise + if (run->runs != NULL) { + roaring_free(run->runs); + } + run->runs = (rle16_t *)roaring_malloc(run->capacity * sizeof(rle16_t)); + } + // handle the case where realloc fails + if (run->runs == NULL) { + fprintf(stderr, "could not allocate memory\n"); + } + assert(run->runs != NULL); +} + +/* copy one container into another */ +void run_container_copy(const run_container_t *src, run_container_t *dst) { + const int32_t n_runs = src->n_runs; + if (src->n_runs > dst->capacity) { + run_container_grow(dst, n_runs, false); + } + dst->n_runs = n_runs; + memcpy(dst->runs, src->runs, sizeof(rle16_t) * n_runs); +} + +/* Compute the union of `src_1' and `src_2' and write the result to `dst' + * It is assumed that `dst' is distinct from both `src_1' and `src_2'. */ +void run_container_union(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst) { + // TODO: this could be a lot more efficient + + // we start out with inexpensive checks + const bool if1 = run_container_is_full(src_1); + const bool if2 = run_container_is_full(src_2); + if (if1 || if2) { + if (if1) { + run_container_copy(src_1, dst); + return; + } + if (if2) { + run_container_copy(src_2, dst); + return; + } + } + const int32_t neededcapacity = src_1->n_runs + src_2->n_runs; + if (dst->capacity < neededcapacity) + run_container_grow(dst, neededcapacity, false); + dst->n_runs = 0; + int32_t rlepos = 0; + int32_t xrlepos = 0; + + rle16_t previousrle; + if (src_1->runs[rlepos].value <= src_2->runs[xrlepos].value) { + previousrle = run_container_append_first(dst, src_1->runs[rlepos]); + rlepos++; + } else { + previousrle = run_container_append_first(dst, src_2->runs[xrlepos]); + xrlepos++; + } + + while ((xrlepos < src_2->n_runs) && (rlepos < src_1->n_runs)) { + rle16_t newrl; + if (src_1->runs[rlepos].value <= src_2->runs[xrlepos].value) { + newrl = src_1->runs[rlepos]; + rlepos++; + } else { + newrl = src_2->runs[xrlepos]; + xrlepos++; + } + run_container_append(dst, newrl, &previousrle); + } + while (xrlepos < src_2->n_runs) { + run_container_append(dst, src_2->runs[xrlepos], &previousrle); + xrlepos++; + } + while (rlepos < src_1->n_runs) { + run_container_append(dst, src_1->runs[rlepos], &previousrle); + rlepos++; + } +} + +/* Compute the union of `src_1' and `src_2' and write the result to `src_1' + */ +void run_container_union_inplace(run_container_t *src_1, + const run_container_t *src_2) { + // TODO: this could be a lot more efficient + + // we start out with inexpensive checks + const bool if1 = run_container_is_full(src_1); + const bool if2 = run_container_is_full(src_2); + if (if1 || if2) { + if (if1) { + return; + } + if (if2) { + run_container_copy(src_2, src_1); + return; + } + } + // we move the data to the end of the current array + const int32_t maxoutput = src_1->n_runs + src_2->n_runs; + const int32_t neededcapacity = maxoutput + src_1->n_runs; + if (src_1->capacity < neededcapacity) + run_container_grow(src_1, neededcapacity, true); + memmove(src_1->runs + maxoutput, src_1->runs, + src_1->n_runs * sizeof(rle16_t)); + rle16_t *inputsrc1 = src_1->runs + maxoutput; + const int32_t input1nruns = src_1->n_runs; + src_1->n_runs = 0; + int32_t rlepos = 0; + int32_t xrlepos = 0; + + rle16_t previousrle; + if (inputsrc1[rlepos].value <= src_2->runs[xrlepos].value) { + previousrle = run_container_append_first(src_1, inputsrc1[rlepos]); + rlepos++; + } else { + previousrle = run_container_append_first(src_1, src_2->runs[xrlepos]); + xrlepos++; + } + while ((xrlepos < src_2->n_runs) && (rlepos < input1nruns)) { + rle16_t newrl; + if (inputsrc1[rlepos].value <= src_2->runs[xrlepos].value) { + newrl = inputsrc1[rlepos]; + rlepos++; + } else { + newrl = src_2->runs[xrlepos]; + xrlepos++; + } + run_container_append(src_1, newrl, &previousrle); + } + while (xrlepos < src_2->n_runs) { + run_container_append(src_1, src_2->runs[xrlepos], &previousrle); + xrlepos++; + } + while (rlepos < input1nruns) { + run_container_append(src_1, inputsrc1[rlepos], &previousrle); + rlepos++; + } +} + +/* Compute the symmetric difference of `src_1' and `src_2' and write the result + * to `dst' + * It is assumed that `dst' is distinct from both `src_1' and `src_2'. */ +void run_container_xor(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst) { + // don't bother to convert xor with full range into negation + // since negation is implemented similarly + + const int32_t neededcapacity = src_1->n_runs + src_2->n_runs; + if (dst->capacity < neededcapacity) + run_container_grow(dst, neededcapacity, false); + + int32_t pos1 = 0; + int32_t pos2 = 0; + dst->n_runs = 0; + + while ((pos1 < src_1->n_runs) && (pos2 < src_2->n_runs)) { + if (src_1->runs[pos1].value <= src_2->runs[pos2].value) { + run_container_smart_append_exclusive(dst, src_1->runs[pos1].value, + src_1->runs[pos1].length); + pos1++; + } else { + run_container_smart_append_exclusive(dst, src_2->runs[pos2].value, + src_2->runs[pos2].length); + pos2++; + } + } + while (pos1 < src_1->n_runs) { + run_container_smart_append_exclusive(dst, src_1->runs[pos1].value, + src_1->runs[pos1].length); + pos1++; + } + + while (pos2 < src_2->n_runs) { + run_container_smart_append_exclusive(dst, src_2->runs[pos2].value, + src_2->runs[pos2].length); + pos2++; + } +} + +/* Compute the intersection of src_1 and src_2 and write the result to + * dst. It is assumed that dst is distinct from both src_1 and src_2. */ +void run_container_intersection(const run_container_t *src_1, + const run_container_t *src_2, + run_container_t *dst) { + const bool if1 = run_container_is_full(src_1); + const bool if2 = run_container_is_full(src_2); + if (if1 || if2) { + if (if1) { + run_container_copy(src_2, dst); + return; + } + if (if2) { + run_container_copy(src_1, dst); + return; + } + } + // TODO: this could be a lot more efficient, could use SIMD optimizations + const int32_t neededcapacity = src_1->n_runs + src_2->n_runs; + if (dst->capacity < neededcapacity) + run_container_grow(dst, neededcapacity, false); + dst->n_runs = 0; + int32_t rlepos = 0; + int32_t xrlepos = 0; + int32_t start = src_1->runs[rlepos].value; + int32_t end = start + src_1->runs[rlepos].length + 1; + int32_t xstart = src_2->runs[xrlepos].value; + int32_t xend = xstart + src_2->runs[xrlepos].length + 1; + while ((rlepos < src_1->n_runs) && (xrlepos < src_2->n_runs)) { + if (end <= xstart) { + ++rlepos; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + } else if (xend <= start) { + ++xrlepos; + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } else { // they overlap + const int32_t lateststart = start > xstart ? start : xstart; + int32_t earliestend; + if (end == xend) { // improbable + earliestend = end; + rlepos++; + xrlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } else if (end < xend) { + earliestend = end; + rlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + + } else { // end > xend + earliestend = xend; + xrlepos++; + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } + dst->runs[dst->n_runs].value = (uint16_t)lateststart; + dst->runs[dst->n_runs].length = + (uint16_t)(earliestend - lateststart - 1); + dst->n_runs++; + } + } +} + +/* Compute the size of the intersection of src_1 and src_2 . */ +int run_container_intersection_cardinality(const run_container_t *src_1, + const run_container_t *src_2) { + const bool if1 = run_container_is_full(src_1); + const bool if2 = run_container_is_full(src_2); + if (if1 || if2) { + if (if1) { + return run_container_cardinality(src_2); + } + if (if2) { + return run_container_cardinality(src_1); + } + } + int answer = 0; + int32_t rlepos = 0; + int32_t xrlepos = 0; + int32_t start = src_1->runs[rlepos].value; + int32_t end = start + src_1->runs[rlepos].length + 1; + int32_t xstart = src_2->runs[xrlepos].value; + int32_t xend = xstart + src_2->runs[xrlepos].length + 1; + while ((rlepos < src_1->n_runs) && (xrlepos < src_2->n_runs)) { + if (end <= xstart) { + ++rlepos; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + } else if (xend <= start) { + ++xrlepos; + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } else { // they overlap + const int32_t lateststart = start > xstart ? start : xstart; + int32_t earliestend; + if (end == xend) { // improbable + earliestend = end; + rlepos++; + xrlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } else if (end < xend) { + earliestend = end; + rlepos++; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + + } else { // end > xend + earliestend = xend; + xrlepos++; + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } + answer += earliestend - lateststart; + } + } + return answer; +} + +bool run_container_intersect(const run_container_t *src_1, + const run_container_t *src_2) { + const bool if1 = run_container_is_full(src_1); + const bool if2 = run_container_is_full(src_2); + if (if1 || if2) { + if (if1) { + return !run_container_empty(src_2); + } + if (if2) { + return !run_container_empty(src_1); + } + } + int32_t rlepos = 0; + int32_t xrlepos = 0; + int32_t start = src_1->runs[rlepos].value; + int32_t end = start + src_1->runs[rlepos].length + 1; + int32_t xstart = src_2->runs[xrlepos].value; + int32_t xend = xstart + src_2->runs[xrlepos].length + 1; + while ((rlepos < src_1->n_runs) && (xrlepos < src_2->n_runs)) { + if (end <= xstart) { + ++rlepos; + if (rlepos < src_1->n_runs) { + start = src_1->runs[rlepos].value; + end = start + src_1->runs[rlepos].length + 1; + } + } else if (xend <= start) { + ++xrlepos; + if (xrlepos < src_2->n_runs) { + xstart = src_2->runs[xrlepos].value; + xend = xstart + src_2->runs[xrlepos].length + 1; + } + } else { // they overlap + return true; + } + } + return false; +} + + +/* Compute the difference of src_1 and src_2 and write the result to + * dst. It is assumed that dst is distinct from both src_1 and src_2. */ +void run_container_andnot(const run_container_t *src_1, + const run_container_t *src_2, run_container_t *dst) { + // following Java implementation as of June 2016 + + if (dst->capacity < src_1->n_runs + src_2->n_runs) + run_container_grow(dst, src_1->n_runs + src_2->n_runs, false); + + dst->n_runs = 0; + + int rlepos1 = 0; + int rlepos2 = 0; + int32_t start = src_1->runs[rlepos1].value; + int32_t end = start + src_1->runs[rlepos1].length + 1; + int32_t start2 = src_2->runs[rlepos2].value; + int32_t end2 = start2 + src_2->runs[rlepos2].length + 1; + + while ((rlepos1 < src_1->n_runs) && (rlepos2 < src_2->n_runs)) { + if (end <= start2) { + // output the first run + dst->runs[dst->n_runs++] = MAKE_RLE16(start, end - start - 1); + rlepos1++; + if (rlepos1 < src_1->n_runs) { + start = src_1->runs[rlepos1].value; + end = start + src_1->runs[rlepos1].length + 1; + } + } else if (end2 <= start) { + // exit the second run + rlepos2++; + if (rlepos2 < src_2->n_runs) { + start2 = src_2->runs[rlepos2].value; + end2 = start2 + src_2->runs[rlepos2].length + 1; + } + } else { + if (start < start2) { + dst->runs[dst->n_runs++] = + MAKE_RLE16(start, start2 - start - 1); + } + if (end2 < end) { + start = end2; + } else { + rlepos1++; + if (rlepos1 < src_1->n_runs) { + start = src_1->runs[rlepos1].value; + end = start + src_1->runs[rlepos1].length + 1; + } + } + } + } + if (rlepos1 < src_1->n_runs) { + dst->runs[dst->n_runs++] = MAKE_RLE16(start, end - start - 1); + rlepos1++; + if (rlepos1 < src_1->n_runs) { + memcpy(dst->runs + dst->n_runs, src_1->runs + rlepos1, + sizeof(rle16_t) * (src_1->n_runs - rlepos1)); + dst->n_runs += src_1->n_runs - rlepos1; + } + } +} + +int run_container_to_uint32_array(void *vout, const run_container_t *cont, + uint32_t base) { + int outpos = 0; + uint32_t *out = (uint32_t *)vout; + for (int i = 0; i < cont->n_runs; ++i) { + uint32_t run_start = base + cont->runs[i].value; + uint16_t le = cont->runs[i].length; + for (int j = 0; j <= le; ++j) { + uint32_t val = run_start + j; + memcpy(out + outpos, &val, + sizeof(uint32_t)); // should be compiled as a MOV on x64 + outpos++; + } + } + return outpos; +} + +/* + * Print this container using printf (useful for debugging). + */ +void run_container_printf(const run_container_t *cont) { + for (int i = 0; i < cont->n_runs; ++i) { + uint16_t run_start = cont->runs[i].value; + uint16_t le = cont->runs[i].length; + printf("[%d,%d]", run_start, run_start + le); + } +} + +/* + * Print this container using printf as a comma-separated list of 32-bit + * integers starting at base. + */ +void run_container_printf_as_uint32_array(const run_container_t *cont, + uint32_t base) { + if (cont->n_runs == 0) return; + { + uint32_t run_start = base + cont->runs[0].value; + uint16_t le = cont->runs[0].length; + printf("%u", run_start); + for (uint32_t j = 1; j <= le; ++j) printf(",%u", run_start + j); + } + for (int32_t i = 1; i < cont->n_runs; ++i) { + uint32_t run_start = base + cont->runs[i].value; + uint16_t le = cont->runs[i].length; + for (uint32_t j = 0; j <= le; ++j) printf(",%u", run_start + j); + } +} + +int32_t run_container_write(const run_container_t *container, char *buf) { + memcpy(buf, &container->n_runs, sizeof(uint16_t)); + memcpy(buf + sizeof(uint16_t), container->runs, + container->n_runs * sizeof(rle16_t)); + return run_container_size_in_bytes(container); +} + +int32_t run_container_read(int32_t cardinality, run_container_t *container, + const char *buf) { + (void)cardinality; + memcpy(&container->n_runs, buf, sizeof(uint16_t)); + if (container->n_runs > container->capacity) + run_container_grow(container, container->n_runs, false); + if(container->n_runs > 0) { + memcpy(container->runs, buf + sizeof(uint16_t), + container->n_runs * sizeof(rle16_t)); + } + return run_container_size_in_bytes(container); +} + +bool run_container_iterate(const run_container_t *cont, uint32_t base, + roaring_iterator iterator, void *ptr) { + for (int i = 0; i < cont->n_runs; ++i) { + uint32_t run_start = base + cont->runs[i].value; + uint16_t le = cont->runs[i].length; + + for (int j = 0; j <= le; ++j) + if (!iterator(run_start + j, ptr)) return false; + } + return true; +} + +bool run_container_iterate64(const run_container_t *cont, uint32_t base, + roaring_iterator64 iterator, uint64_t high_bits, + void *ptr) { + for (int i = 0; i < cont->n_runs; ++i) { + uint32_t run_start = base + cont->runs[i].value; + uint16_t le = cont->runs[i].length; + + for (int j = 0; j <= le; ++j) + if (!iterator(high_bits | (uint64_t)(run_start + j), ptr)) + return false; + } + return true; +} + +bool run_container_is_subset(const run_container_t *container1, + const run_container_t *container2) { + int i1 = 0, i2 = 0; + while (i1 < container1->n_runs && i2 < container2->n_runs) { + int start1 = container1->runs[i1].value; + int stop1 = start1 + container1->runs[i1].length; + int start2 = container2->runs[i2].value; + int stop2 = start2 + container2->runs[i2].length; + if (start1 < start2) { + return false; + } else { // start1 >= start2 + if (stop1 < stop2) { + i1++; + } else if (stop1 == stop2) { + i1++; + i2++; + } else { // stop1 > stop2 + i2++; + } + } + } + if (i1 == container1->n_runs) { + return true; + } else { + return false; + } +} + +// TODO: write smart_append_exclusive version to match the overloaded 1 param +// Java version (or is it even used?) + +// follows the Java implementation closely +// length is the rle-value. Ie, run [10,12) uses a length value 1. +void run_container_smart_append_exclusive(run_container_t *src, + const uint16_t start, + const uint16_t length) { + int old_end; + rle16_t *last_run = src->n_runs ? src->runs + (src->n_runs - 1) : NULL; + rle16_t *appended_last_run = src->runs + src->n_runs; + + if (!src->n_runs || + (start > (old_end = last_run->value + last_run->length + 1))) { + *appended_last_run = MAKE_RLE16(start, length); + src->n_runs++; + return; + } + if (old_end == start) { + // we merge + last_run->length += (length + 1); + return; + } + int new_end = start + length + 1; + + if (start == last_run->value) { + // wipe out previous + if (new_end < old_end) { + *last_run = MAKE_RLE16(new_end, old_end - new_end - 1); + return; + } else if (new_end > old_end) { + *last_run = MAKE_RLE16(old_end, new_end - old_end - 1); + return; + } else { + src->n_runs--; + return; + } + } + last_run->length = start - last_run->value - 1; + if (new_end < old_end) { + *appended_last_run = MAKE_RLE16(new_end, old_end - new_end - 1); + src->n_runs++; + } else if (new_end > old_end) { + *appended_last_run = MAKE_RLE16(old_end, new_end - old_end - 1); + src->n_runs++; + } +} + +bool run_container_select(const run_container_t *container, + uint32_t *start_rank, uint32_t rank, + uint32_t *element) { + for (int i = 0; i < container->n_runs; i++) { + uint16_t length = container->runs[i].length; + if (rank <= *start_rank + length) { + uint16_t value = container->runs[i].value; + *element = value + rank - (*start_rank); + return true; + } else + *start_rank += length + 1; + } + return false; +} + +int run_container_rank(const run_container_t *container, uint16_t x) { + int sum = 0; + uint32_t x32 = x; + for (int i = 0; i < container->n_runs; i++) { + uint32_t startpoint = container->runs[i].value; + uint32_t length = container->runs[i].length; + uint32_t endpoint = length + startpoint; + if (x <= endpoint) { + if (x < startpoint) break; + return sum + (x32 - startpoint) + 1; + } else { + sum += length + 1; + } + } + return sum; +} + +#ifdef CROARING_IS_X64 + +CROARING_TARGET_AVX2 +/* Get the cardinality of `run'. Requires an actual computation. */ +static inline int _avx2_run_container_cardinality(const run_container_t *run) { + const int32_t n_runs = run->n_runs; + const rle16_t *runs = run->runs; + + /* by initializing with n_runs, we omit counting the +1 for each pair. */ + int sum = n_runs; + int32_t k = 0; + const int32_t step = sizeof(__m256i) / sizeof(rle16_t); + if (n_runs > step) { + __m256i total = _mm256_setzero_si256(); + for (; k + step <= n_runs; k += step) { + __m256i ymm1 = _mm256_lddqu_si256((const __m256i *)(runs + k)); + __m256i justlengths = _mm256_srli_epi32(ymm1, 16); + total = _mm256_add_epi32(total, justlengths); + } + // a store might be faster than extract? + uint32_t buffer[sizeof(__m256i) / sizeof(rle16_t)]; + _mm256_storeu_si256((__m256i *)buffer, total); + sum += (buffer[0] + buffer[1]) + (buffer[2] + buffer[3]) + + (buffer[4] + buffer[5]) + (buffer[6] + buffer[7]); + } + for (; k < n_runs; ++k) { + sum += runs[k].length; + } + + return sum; +} + +CROARING_UNTARGET_REGION + +/* Get the cardinality of `run'. Requires an actual computation. */ +static inline int _scalar_run_container_cardinality(const run_container_t *run) { + const int32_t n_runs = run->n_runs; + const rle16_t *runs = run->runs; + + /* by initializing with n_runs, we omit counting the +1 for each pair. */ + int sum = n_runs; + for (int k = 0; k < n_runs; ++k) { + sum += runs[k].length; + } + + return sum; +} + +int run_container_cardinality(const run_container_t *run) { + if( croaring_avx2() ) { + return _avx2_run_container_cardinality(run); + } else { + return _scalar_run_container_cardinality(run); + } +} +#else + +/* Get the cardinality of `run'. Requires an actual computation. */ +int run_container_cardinality(const run_container_t *run) { + const int32_t n_runs = run->n_runs; + const rle16_t *runs = run->runs; + + /* by initializing with n_runs, we omit counting the +1 for each pair. */ + int sum = n_runs; + for (int k = 0; k < n_runs; ++k) { + sum += runs[k].length; + } + + return sum; +} +#endif + + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/containers/run.c */ +/* begin file src/memory.c */ +#include + +// without the following, we get lots of warnings about posix_memalign +#ifndef __cplusplus +extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size); +#endif //__cplusplus // C++ does not have a well defined signature + +// portable version of posix_memalign +static void *roaring_bitmap_aligned_malloc(size_t alignment, size_t size) { + void *p; +#ifdef _MSC_VER + p = _aligned_malloc(size, alignment); +#elif defined(__MINGW32__) || defined(__MINGW64__) + p = __mingw_aligned_malloc(size, alignment); +#else + // somehow, if this is used before including "x86intrin.h", it creates an + // implicit defined warning. + if (posix_memalign(&p, alignment, size) != 0) return NULL; +#endif + return p; +} + +static void roaring_bitmap_aligned_free(void *memblock) { +#ifdef _MSC_VER + _aligned_free(memblock); +#elif defined(__MINGW32__) || defined(__MINGW64__) + __mingw_aligned_free(memblock); +#else + free(memblock); +#endif +} + +static roaring_memory_t global_memory_hook = { + .malloc = malloc, + .realloc = realloc, + .calloc = calloc, + .free = free, + .aligned_malloc = roaring_bitmap_aligned_malloc, + .aligned_free = roaring_bitmap_aligned_free, +}; + +void roaring_init_memory_hook(roaring_memory_t memory_hook) { + global_memory_hook = memory_hook; +} + +void* roaring_malloc(size_t n) { + return global_memory_hook.malloc(n); +} + +void* roaring_realloc(void* p, size_t new_sz) { + return global_memory_hook.realloc(p, new_sz); +} + +void* roaring_calloc(size_t n_elements, size_t element_size) { + return global_memory_hook.calloc(n_elements, element_size); +} + +void roaring_free(void* p) { + global_memory_hook.free(p); +} + +void* roaring_aligned_malloc(size_t alignment, size_t size) { + return global_memory_hook.aligned_malloc(alignment, size); +} + +void roaring_aligned_free(void* p) { + global_memory_hook.aligned_free(p); +} +/* end file src/memory.c */ +/* begin file src/roaring.c */ +#include +#include +#include +#include +#include +#include + + + +#ifdef __cplusplus +using namespace ::roaring::internal; + +extern "C" { namespace roaring { namespace api { +#endif + +#define CROARING_SERIALIZATION_ARRAY_UINT32 1 +#define CROARING_SERIALIZATION_CONTAINER 2 + +extern inline bool roaring_bitmap_get_copy_on_write(const roaring_bitmap_t* r); +extern inline void roaring_bitmap_set_copy_on_write(roaring_bitmap_t* r, bool cow); + +static inline bool is_cow(const roaring_bitmap_t *r) { + return r->high_low_container.flags & ROARING_FLAG_COW; +} +static inline bool is_frozen(const roaring_bitmap_t *r) { + return r->high_low_container.flags & ROARING_FLAG_FROZEN; +} + +// this is like roaring_bitmap_add, but it populates pointer arguments in such a +// way +// that we can recover the container touched, which, in turn can be used to +// accelerate some functions (when you repeatedly need to add to the same +// container) +static inline container_t *containerptr_roaring_bitmap_add( + roaring_bitmap_t *r, uint32_t val, + uint8_t *type, int *index +){ + roaring_array_t *ra = &r->high_low_container; + + uint16_t hb = val >> 16; + const int i = ra_get_index(ra, hb); + if (i >= 0) { + ra_unshare_container_at_index(ra, i); + container_t *c = ra_get_container_at_index(ra, i, type); + uint8_t new_type = *type; + container_t *c2 = container_add(c, val & 0xFFFF, *type, &new_type); + *index = i; + if (c2 != c) { + container_free(c, *type); + ra_set_container_at_index(ra, i, c2, new_type); + *type = new_type; + return c2; + } else { + return c; + } + } else { + array_container_t *new_ac = array_container_create(); + container_t *c = container_add(new_ac, val & 0xFFFF, + ARRAY_CONTAINER_TYPE, type); + // we could just assume that it stays an array container + ra_insert_new_key_value_at(ra, -i - 1, hb, c, *type); + *index = -i - 1; + return c; + } +} + +roaring_bitmap_t *roaring_bitmap_create_with_capacity(uint32_t cap) { + roaring_bitmap_t *ans = + (roaring_bitmap_t *)roaring_malloc(sizeof(roaring_bitmap_t)); + if (!ans) { + return NULL; + } + bool is_ok = ra_init_with_capacity(&ans->high_low_container, cap); + if (!is_ok) { + roaring_free(ans); + return NULL; + } + return ans; +} + +bool roaring_bitmap_init_with_capacity(roaring_bitmap_t *r, uint32_t cap) { + return ra_init_with_capacity(&r->high_low_container, cap); +} + +static inline void add_bulk_impl(roaring_bitmap_t *r, + roaring_bulk_context_t *context, + uint32_t val) { + uint16_t key = val >> 16; + if (context->container == NULL || context->key != key) { + uint8_t typecode; + int idx; + context->container = containerptr_roaring_bitmap_add( + r, val, &typecode, &idx); + context->typecode = typecode; + context->idx = idx; + context->key = key; + } else { + // no need to seek the container, it is at hand + // because we already have the container at hand, we can do the + // insertion directly, bypassing the roaring_bitmap_add call + uint8_t new_typecode; + container_t *container2 = container_add( + context->container, val & 0xFFFF, context->typecode, &new_typecode); + if (container2 != context->container) { + // rare instance when we need to change the container type + container_free(context->container, context->typecode); + ra_set_container_at_index(&r->high_low_container, context->idx, + container2, new_typecode); + context->typecode = new_typecode; + context->container = container2; + } + } +} + +void roaring_bitmap_add_many(roaring_bitmap_t *r, size_t n_args, + const uint32_t *vals) { + uint32_t val; + const uint32_t *start = vals; + const uint32_t *end = vals + n_args; + const uint32_t *current_val = start; + + if (n_args == 0) { + return; + } + + uint8_t typecode; + int idx; + container_t *container; + val = *current_val; + container = containerptr_roaring_bitmap_add(r, val, &typecode, &idx); + roaring_bulk_context_t context = {container, idx, (uint16_t)(val >> 16), typecode}; + + for (; current_val != end; current_val++) { + memcpy(&val, current_val, sizeof(val)); + add_bulk_impl(r, &context, val); + } +} + +void roaring_bitmap_add_bulk(roaring_bitmap_t *r, + roaring_bulk_context_t *context, uint32_t val) { + add_bulk_impl(r, context, val); +} + +bool roaring_bitmap_contains_bulk(const roaring_bitmap_t *r, + roaring_bulk_context_t *context, + uint32_t val) +{ + uint16_t key = val >> 16; + if (context->container == NULL || context->key != key) { + int32_t start_idx = -1; + if (context->container != NULL && context->key < key) { + start_idx = context->idx; + } + int idx = ra_advance_until(&r->high_low_container, key, start_idx); + if (idx == ra_get_size(&r->high_low_container)) { + return false; + } + uint8_t typecode; + context->container = ra_get_container_at_index(&r->high_low_container, idx, &typecode); + context->typecode = typecode; + context->idx = idx; + context->key = ra_get_key_at_index(&r->high_low_container, idx); + // ra_advance_until finds the next key >= the target, we found a later container. + if (context->key != key) { + return false; + } + } + // context is now set up + return container_contains(context->container, val & 0xFFFF, context->typecode); +} + +roaring_bitmap_t *roaring_bitmap_of_ptr(size_t n_args, const uint32_t *vals) { + roaring_bitmap_t *answer = roaring_bitmap_create(); + roaring_bitmap_add_many(answer, n_args, vals); + return answer; +} + +roaring_bitmap_t *roaring_bitmap_of(size_t n_args, ...) { + // todo: could be greatly optimized but we do not expect this call to ever + // include long lists + roaring_bitmap_t *answer = roaring_bitmap_create(); + roaring_bulk_context_t context = {0}; + va_list ap; + va_start(ap, n_args); + for (size_t i = 0; i < n_args; i++) { + uint32_t val = va_arg(ap, uint32_t); + roaring_bitmap_add_bulk(answer, &context, val); + } + va_end(ap); + return answer; +} + +static inline uint32_t minimum_uint32(uint32_t a, uint32_t b) { + return (a < b) ? a : b; +} + +static inline uint64_t minimum_uint64(uint64_t a, uint64_t b) { + return (a < b) ? a : b; +} + +roaring_bitmap_t *roaring_bitmap_from_range(uint64_t min, uint64_t max, + uint32_t step) { + if(max >= UINT64_C(0x100000000)) { + max = UINT64_C(0x100000000); + } + if (step == 0) return NULL; + if (max <= min) return NULL; + roaring_bitmap_t *answer = roaring_bitmap_create(); + if (step >= (1 << 16)) { + for (uint32_t value = (uint32_t)min; value < max; value += step) { + roaring_bitmap_add(answer, value); + } + return answer; + } + uint64_t min_tmp = min; + do { + uint32_t key = (uint32_t)min_tmp >> 16; + uint32_t container_min = min_tmp & 0xFFFF; + uint32_t container_max = (uint32_t)minimum_uint64(max - (key << 16), 1 << 16); + uint8_t type; + container_t *container = container_from_range(&type, container_min, + container_max, (uint16_t)step); + ra_append(&answer->high_low_container, key, container, type); + uint32_t gap = container_max - container_min + step - 1; + min_tmp += gap - (gap % step); + } while (min_tmp < max); + // cardinality of bitmap will be ((uint64_t) max - min + step - 1 ) / step + return answer; +} + +void roaring_bitmap_add_range_closed(roaring_bitmap_t *r, uint32_t min, uint32_t max) { + if (min > max) { + return; + } + + roaring_array_t *ra = &r->high_low_container; + + uint32_t min_key = min >> 16; + uint32_t max_key = max >> 16; + + int32_t num_required_containers = max_key - min_key + 1; + int32_t suffix_length = count_greater(ra->keys, ra->size, max_key); + int32_t prefix_length = count_less(ra->keys, ra->size - suffix_length, + min_key); + int32_t common_length = ra->size - prefix_length - suffix_length; + + if (num_required_containers > common_length) { + ra_shift_tail(ra, suffix_length, + num_required_containers - common_length); + } + + int32_t src = prefix_length + common_length - 1; + int32_t dst = ra->size - suffix_length - 1; + for (uint32_t key = max_key; key != min_key-1; key--) { // beware of min_key==0 + uint32_t container_min = (min_key == key) ? (min & 0xffff) : 0; + uint32_t container_max = (max_key == key) ? (max & 0xffff) : 0xffff; + container_t* new_container; + uint8_t new_type; + + if (src >= 0 && ra->keys[src] == key) { + ra_unshare_container_at_index(ra, src); + new_container = container_add_range(ra->containers[src], + ra->typecodes[src], + container_min, container_max, + &new_type); + if (new_container != ra->containers[src]) { + container_free(ra->containers[src], + ra->typecodes[src]); + } + src--; + } else { + new_container = container_from_range(&new_type, container_min, + container_max+1, 1); + } + ra_replace_key_and_container_at_index(ra, dst, key, new_container, + new_type); + dst--; + } +} + +void roaring_bitmap_remove_range_closed(roaring_bitmap_t *r, uint32_t min, uint32_t max) { + if (min > max) { + return; + } + + roaring_array_t *ra = &r->high_low_container; + + uint32_t min_key = min >> 16; + uint32_t max_key = max >> 16; + + int32_t src = count_less(ra->keys, ra->size, min_key); + int32_t dst = src; + while (src < ra->size && ra->keys[src] <= max_key) { + uint32_t container_min = (min_key == ra->keys[src]) ? (min & 0xffff) : 0; + uint32_t container_max = (max_key == ra->keys[src]) ? (max & 0xffff) : 0xffff; + ra_unshare_container_at_index(ra, src); + container_t *new_container; + uint8_t new_type; + new_container = container_remove_range(ra->containers[src], + ra->typecodes[src], + container_min, container_max, + &new_type); + if (new_container != ra->containers[src]) { + container_free(ra->containers[src], + ra->typecodes[src]); + } + if (new_container) { + ra_replace_key_and_container_at_index(ra, dst, ra->keys[src], + new_container, new_type); + dst++; + } + src++; + } + if (src > dst) { + ra_shift_tail(ra, ra->size - src, dst - src); + } +} + +extern inline void roaring_bitmap_add_range(roaring_bitmap_t *r, uint64_t min, uint64_t max); +extern inline void roaring_bitmap_remove_range(roaring_bitmap_t *r, uint64_t min, uint64_t max); + +void roaring_bitmap_printf(const roaring_bitmap_t *r) { + const roaring_array_t *ra = &r->high_low_container; + + printf("{"); + for (int i = 0; i < ra->size; ++i) { + container_printf_as_uint32_array(ra->containers[i], ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16); + + if (i + 1 < ra->size) { + printf(","); + } + } + printf("}"); +} + +void roaring_bitmap_printf_describe(const roaring_bitmap_t *r) { + const roaring_array_t *ra = &r->high_low_container; + + printf("{"); + for (int i = 0; i < ra->size; ++i) { + printf("%d: %s (%d)", ra->keys[i], + get_full_container_name(ra->containers[i], ra->typecodes[i]), + container_get_cardinality(ra->containers[i], ra->typecodes[i])); + if (ra->typecodes[i] == SHARED_CONTAINER_TYPE) { + printf( + "(shared count = %" PRIu32 " )", + CAST_shared(ra->containers[i])->counter); + } + + if (i + 1 < ra->size) { + printf(", "); + } + } + printf("}"); +} + +typedef struct min_max_sum_s { + uint32_t min; + uint32_t max; + uint64_t sum; +} min_max_sum_t; + +static bool min_max_sum_fnc(uint32_t value, void *param) { + min_max_sum_t *mms = (min_max_sum_t *)param; + if (value > mms->max) mms->max = value; + if (value < mms->min) mms->min = value; + mms->sum += value; + return true; // we always process all data points +} + +/** +* (For advanced users.) +* Collect statistics about the bitmap +*/ +void roaring_bitmap_statistics(const roaring_bitmap_t *r, + roaring_statistics_t *stat) { + const roaring_array_t *ra = &r->high_low_container; + + memset(stat, 0, sizeof(*stat)); + stat->n_containers = ra->size; + stat->cardinality = roaring_bitmap_get_cardinality(r); + min_max_sum_t mms; + mms.min = UINT32_C(0xFFFFFFFF); + mms.max = UINT32_C(0); + mms.sum = 0; + roaring_iterate(r, &min_max_sum_fnc, &mms); + stat->min_value = mms.min; + stat->max_value = mms.max; + stat->sum_value = mms.sum; + + for (int i = 0; i < ra->size; ++i) { + uint8_t truetype = + get_container_type(ra->containers[i], ra->typecodes[i]); + uint32_t card = + container_get_cardinality(ra->containers[i], ra->typecodes[i]); + uint32_t sbytes = + container_size_in_bytes(ra->containers[i], ra->typecodes[i]); + switch (truetype) { + case BITSET_CONTAINER_TYPE: + stat->n_bitset_containers++; + stat->n_values_bitset_containers += card; + stat->n_bytes_bitset_containers += sbytes; + break; + case ARRAY_CONTAINER_TYPE: + stat->n_array_containers++; + stat->n_values_array_containers += card; + stat->n_bytes_array_containers += sbytes; + break; + case RUN_CONTAINER_TYPE: + stat->n_run_containers++; + stat->n_values_run_containers += card; + stat->n_bytes_run_containers += sbytes; + break; + default: + assert(false); + __builtin_unreachable(); + } + } +} + +roaring_bitmap_t *roaring_bitmap_copy(const roaring_bitmap_t *r) { + roaring_bitmap_t *ans = + (roaring_bitmap_t *)roaring_malloc(sizeof(roaring_bitmap_t)); + if (!ans) { + return NULL; + } + if (!ra_init_with_capacity( // allocation of list of containers can fail + &ans->high_low_container, r->high_low_container.size) + ){ + roaring_free(ans); + return NULL; + } + if (!ra_overwrite( // memory allocation of individual containers may fail + &r->high_low_container, &ans->high_low_container, is_cow(r)) + ){ + roaring_bitmap_free(ans); // overwrite should leave in freeable state + return NULL; + } + roaring_bitmap_set_copy_on_write(ans, is_cow(r)); + return ans; +} + +bool roaring_bitmap_overwrite(roaring_bitmap_t *dest, + const roaring_bitmap_t *src) { + roaring_bitmap_set_copy_on_write(dest, is_cow(src)); + return ra_overwrite(&src->high_low_container, &dest->high_low_container, + is_cow(src)); +} + +void roaring_bitmap_free(const roaring_bitmap_t *r) { + if (!is_frozen(r)) { + ra_clear((roaring_array_t*)&r->high_low_container); + } + roaring_free((roaring_bitmap_t*)r); +} + +void roaring_bitmap_clear(roaring_bitmap_t *r) { + ra_reset(&r->high_low_container); +} + +void roaring_bitmap_add(roaring_bitmap_t *r, uint32_t val) { + roaring_array_t *ra = &r->high_low_container; + + const uint16_t hb = val >> 16; + const int i = ra_get_index(ra, hb); + uint8_t typecode; + if (i >= 0) { + ra_unshare_container_at_index(ra, i); + container_t *container = + ra_get_container_at_index(ra, i, &typecode); + uint8_t newtypecode = typecode; + container_t *container2 = + container_add(container, val & 0xFFFF, typecode, &newtypecode); + if (container2 != container) { + container_free(container, typecode); + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + } + } else { + array_container_t *newac = array_container_create(); + container_t *container = container_add(newac, val & 0xFFFF, + ARRAY_CONTAINER_TYPE, &typecode); + // we could just assume that it stays an array container + ra_insert_new_key_value_at(&r->high_low_container, -i - 1, hb, + container, typecode); + } +} + +bool roaring_bitmap_add_checked(roaring_bitmap_t *r, uint32_t val) { + const uint16_t hb = val >> 16; + const int i = ra_get_index(&r->high_low_container, hb); + uint8_t typecode; + bool result = false; + if (i >= 0) { + ra_unshare_container_at_index(&r->high_low_container, i); + container_t *container = + ra_get_container_at_index(&r->high_low_container, i, &typecode); + + const int oldCardinality = + container_get_cardinality(container, typecode); + + uint8_t newtypecode = typecode; + container_t *container2 = + container_add(container, val & 0xFFFF, typecode, &newtypecode); + if (container2 != container) { + container_free(container, typecode); + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + result = true; + } else { + const int newCardinality = + container_get_cardinality(container, newtypecode); + + result = oldCardinality != newCardinality; + } + } else { + array_container_t *newac = array_container_create(); + container_t *container = container_add(newac, val & 0xFFFF, + ARRAY_CONTAINER_TYPE, &typecode); + // we could just assume that it stays an array container + ra_insert_new_key_value_at(&r->high_low_container, -i - 1, hb, + container, typecode); + result = true; + } + + return result; +} + +void roaring_bitmap_remove(roaring_bitmap_t *r, uint32_t val) { + const uint16_t hb = val >> 16; + const int i = ra_get_index(&r->high_low_container, hb); + uint8_t typecode; + if (i >= 0) { + ra_unshare_container_at_index(&r->high_low_container, i); + container_t *container = + ra_get_container_at_index(&r->high_low_container, i, &typecode); + uint8_t newtypecode = typecode; + container_t *container2 = + container_remove(container, val & 0xFFFF, typecode, &newtypecode); + if (container2 != container) { + container_free(container, typecode); + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + } + if (container_get_cardinality(container2, newtypecode) != 0) { + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + } else { + ra_remove_at_index_and_free(&r->high_low_container, i); + } + } +} + +bool roaring_bitmap_remove_checked(roaring_bitmap_t *r, uint32_t val) { + const uint16_t hb = val >> 16; + const int i = ra_get_index(&r->high_low_container, hb); + uint8_t typecode; + bool result = false; + if (i >= 0) { + ra_unshare_container_at_index(&r->high_low_container, i); + container_t *container = + ra_get_container_at_index(&r->high_low_container, i, &typecode); + + const int oldCardinality = + container_get_cardinality(container, typecode); + + uint8_t newtypecode = typecode; + container_t *container2 = + container_remove(container, val & 0xFFFF, typecode, &newtypecode); + if (container2 != container) { + container_free(container, typecode); + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + } + + const int newCardinality = + container_get_cardinality(container2, newtypecode); + + if (newCardinality != 0) { + ra_set_container_at_index(&r->high_low_container, i, container2, + newtypecode); + } else { + ra_remove_at_index_and_free(&r->high_low_container, i); + } + + result = oldCardinality != newCardinality; + } + return result; +} + +void roaring_bitmap_remove_many(roaring_bitmap_t *r, size_t n_args, + const uint32_t *vals) { + if (n_args == 0 || r->high_low_container.size == 0) { + return; + } + int32_t pos = -1; // position of the container used in the previous iteration + for (size_t i = 0; i < n_args; i++) { + uint16_t key = (uint16_t)(vals[i] >> 16); + if (pos < 0 || key != r->high_low_container.keys[pos]) { + pos = ra_get_index(&r->high_low_container, key); + } + if (pos >= 0) { + uint8_t new_typecode; + container_t *new_container; + new_container = container_remove(r->high_low_container.containers[pos], + vals[i] & 0xffff, + r->high_low_container.typecodes[pos], + &new_typecode); + if (new_container != r->high_low_container.containers[pos]) { + container_free(r->high_low_container.containers[pos], + r->high_low_container.typecodes[pos]); + ra_replace_key_and_container_at_index(&r->high_low_container, + pos, key, new_container, + new_typecode); + } + if (!container_nonzero_cardinality(new_container, new_typecode)) { + container_free(new_container, new_typecode); + ra_remove_at_index(&r->high_low_container, pos); + pos = -1; + } + } + } +} + +// there should be some SIMD optimizations possible here +roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + uint32_t neededcap = length1 > length2 ? length2 : length1; + roaring_bitmap_t *answer = roaring_bitmap_create_with_capacity(neededcap); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + + int pos1 = 0, pos2 = 0; + + while (pos1 < length1 && pos2 < length2) { + const uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + const uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + if (s1 == s2) { + uint8_t type1, type2; + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_and(c1, type1, c2, type2, &result_type); + + if (container_nonzero_cardinality(c, result_type)) { + ra_append(&answer->high_low_container, s1, c, result_type); + } else { + container_free(c, result_type); // otherwise: memory leak! + } + ++pos1; + ++pos2; + } else if (s1 < s2) { // s1 < s2 + pos1 = ra_advance_until(&x1->high_low_container, s2, pos1); + } else { // s1 > s2 + pos2 = ra_advance_until(&x2->high_low_container, s1, pos2); + } + } + return answer; +} + +/** + * Compute the union of 'number' bitmaps. + */ +roaring_bitmap_t *roaring_bitmap_or_many(size_t number, + const roaring_bitmap_t **x) { + if (number == 0) { + return roaring_bitmap_create(); + } + if (number == 1) { + return roaring_bitmap_copy(x[0]); + } + roaring_bitmap_t *answer = + roaring_bitmap_lazy_or(x[0], x[1], LAZY_OR_BITSET_CONVERSION); + for (size_t i = 2; i < number; i++) { + roaring_bitmap_lazy_or_inplace(answer, x[i], LAZY_OR_BITSET_CONVERSION); + } + roaring_bitmap_repair_after_lazy(answer); + return answer; +} + +/** + * Compute the xor of 'number' bitmaps. + */ +roaring_bitmap_t *roaring_bitmap_xor_many(size_t number, + const roaring_bitmap_t **x) { + if (number == 0) { + return roaring_bitmap_create(); + } + if (number == 1) { + return roaring_bitmap_copy(x[0]); + } + roaring_bitmap_t *answer = roaring_bitmap_lazy_xor(x[0], x[1]); + for (size_t i = 2; i < number; i++) { + roaring_bitmap_lazy_xor_inplace(answer, x[i]); + } + roaring_bitmap_repair_after_lazy(answer); + return answer; +} + +// inplace and (modifies its first argument). +void roaring_bitmap_and_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + if (x1 == x2) return; + int pos1 = 0, pos2 = 0, intersection_size = 0; + const int length1 = ra_get_size(&x1->high_low_container); + const int length2 = ra_get_size(&x2->high_low_container); + + // any skipped-over or newly emptied containers in x1 + // have to be freed. + while (pos1 < length1 && pos2 < length2) { + const uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + const uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + if (s1 == s2) { + uint8_t type1, type2, result_type; + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + + // We do the computation "in place" only when c1 is not a shared container. + // Rationale: using a shared container safely with in place computation would + // require making a copy and then doing the computation in place which is likely + // less efficient than avoiding in place entirely and always generating a new + // container. + container_t *c = + (type1 == SHARED_CONTAINER_TYPE) + ? container_and(c1, type1, c2, type2, &result_type) + : container_iand(c1, type1, c2, type2, &result_type); + + if (c != c1) { // in this instance a new container was created, and + // we need to free the old one + container_free(c1, type1); + } + if (container_nonzero_cardinality(c, result_type)) { + ra_replace_key_and_container_at_index(&x1->high_low_container, + intersection_size, s1, c, + result_type); + intersection_size++; + } else { + container_free(c, result_type); + } + ++pos1; + ++pos2; + } else if (s1 < s2) { + pos1 = ra_advance_until_freeing(&x1->high_low_container, s2, pos1); + } else { // s1 > s2 + pos2 = ra_advance_until(&x2->high_low_container, s1, pos2); + } + } + + // if we ended early because x2 ran out, then all remaining in x1 should be + // freed + while (pos1 < length1) { + container_free(x1->high_low_container.containers[pos1], + x1->high_low_container.typecodes[pos1]); + ++pos1; + } + + // all containers after this have either been copied or freed + ra_downsize(&x1->high_low_container, intersection_size); +} + +roaring_bitmap_t *roaring_bitmap_or(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + if (0 == length1) { + return roaring_bitmap_copy(x2); + } + if (0 == length2) { + return roaring_bitmap_copy(x1); + } + roaring_bitmap_t *answer = + roaring_bitmap_create_with_capacity(length1 + length2); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_or(c1, type1, c2, type2, &result_type); + + // since we assume that the initial containers are non-empty, the + // result here + // can only be non-empty + ra_append(&answer->high_low_container, s1, c, result_type); + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + // c1 = container_clone(c1, type1); + c1 = get_copy_of_container(c1, &type1, is_cow(x1)); + if (is_cow(x1)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c1, + type1); + } + ra_append(&answer->high_low_container, s1, c1, type1); + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + // c2 = container_clone(c2, type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_append(&answer->high_low_container, s2, c2, type2); + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&answer->high_low_container, + &x2->high_low_container, pos2, length2, + is_cow(x2)); + } else if (pos2 == length2) { + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1, + is_cow(x1)); + } + return answer; +} + +// inplace or (modifies its first argument). +void roaring_bitmap_or_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + int length1 = x1->high_low_container.size; + const int length2 = x2->high_low_container.size; + + if (0 == length2) return; + + if (0 == length1) { + roaring_bitmap_overwrite(x1, x2); + return; + } + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + if (!container_is_full(c1, type1)) { + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = + (type1 == SHARED_CONTAINER_TYPE) + ? container_or(c1, type1, c2, type2, &result_type) + : container_ior(c1, type1, c2, type2, &result_type); + + if (c != c1) { // in this instance a new container was created, + // and we need to free the old one + container_free(c1, type1); + } + ra_set_container_at_index(&x1->high_low_container, pos1, c, + result_type); + } + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index(&x2->high_low_container, + pos2, &type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + + // container_t *c2_clone = container_clone(c2, type2); + ra_insert_new_key_value_at(&x1->high_low_container, pos1, s2, c2, + type2); + pos1++; + length1++; + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&x1->high_low_container, &x2->high_low_container, + pos2, length2, is_cow(x2)); + } +} + +roaring_bitmap_t *roaring_bitmap_xor(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + if (0 == length1) { + return roaring_bitmap_copy(x2); + } + if (0 == length2) { + return roaring_bitmap_copy(x1); + } + roaring_bitmap_t *answer = + roaring_bitmap_create_with_capacity(length1 + length2); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_xor(c1, type1, c2, type2, &result_type); + + if (container_nonzero_cardinality(c, result_type)) { + ra_append(&answer->high_low_container, s1, c, result_type); + } else { + container_free(c, result_type); + } + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + c1 = get_copy_of_container(c1, &type1, is_cow(x1)); + if (is_cow(x1)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c1, + type1); + } + ra_append(&answer->high_low_container, s1, c1, type1); + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_append(&answer->high_low_container, s2, c2, type2); + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&answer->high_low_container, + &x2->high_low_container, pos2, length2, + is_cow(x2)); + } else if (pos2 == length2) { + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1, + is_cow(x1)); + } + return answer; +} + +// inplace xor (modifies its first argument). + +void roaring_bitmap_xor_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + assert(x1 != x2); + uint8_t result_type = 0; + int length1 = x1->high_low_container.size; + const int length2 = x2->high_low_container.size; + + if (0 == length2) return; + + if (0 == length1) { + roaring_bitmap_overwrite(x1, x2); + return; + } + + // XOR can have new containers inserted from x2, but can also + // lose containers when x1 and x2 are nonempty and identical. + + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + + // We do the computation "in place" only when c1 is not a shared container. + // Rationale: using a shared container safely with in place computation would + // require making a copy and then doing the computation in place which is likely + // less efficient than avoiding in place entirely and always generating a new + // container. + + container_t *c; + if (type1 == SHARED_CONTAINER_TYPE) { + c = container_xor(c1, type1, c2, type2, &result_type); + shared_container_free(CAST_shared(c1)); // so release + } + else { + c = container_ixor(c1, type1, c2, type2, &result_type); + } + + if (container_nonzero_cardinality(c, result_type)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c, + result_type); + ++pos1; + } else { + container_free(c, result_type); + ra_remove_at_index(&x1->high_low_container, pos1); + --length1; + } + + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + + ra_insert_new_key_value_at(&x1->high_low_container, pos1, s2, c2, + type2); + pos1++; + length1++; + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&x1->high_low_container, &x2->high_low_container, + pos2, length2, is_cow(x2)); + } +} + +roaring_bitmap_t *roaring_bitmap_andnot(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + if (0 == length1) { + roaring_bitmap_t *empty_bitmap = roaring_bitmap_create(); + roaring_bitmap_set_copy_on_write(empty_bitmap, is_cow(x1) || is_cow(x2)); + return empty_bitmap; + } + if (0 == length2) { + return roaring_bitmap_copy(x1); + } + roaring_bitmap_t *answer = roaring_bitmap_create_with_capacity(length1); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = 0; + uint16_t s2 = 0; + while (true) { + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_andnot(c1, type1, c2, type2, + &result_type); + + if (container_nonzero_cardinality(c, result_type)) { + ra_append(&answer->high_low_container, s1, c, result_type); + } else { + container_free(c, result_type); + } + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + } else if (s1 < s2) { // s1 < s2 + const int next_pos1 = + ra_advance_until(&x1->high_low_container, s2, pos1); + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, next_pos1, + is_cow(x1)); + // TODO : perhaps some of the copy_on_write should be based on + // answer rather than x1 (more stringent?). Many similar cases + pos1 = next_pos1; + if (pos1 == length1) break; + } else { // s1 > s2 + pos2 = ra_advance_until(&x2->high_low_container, s1, pos2); + if (pos2 == length2) break; + } + } + if (pos2 == length2) { + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1, + is_cow(x1)); + } + return answer; +} + +// inplace andnot (modifies its first argument). + +void roaring_bitmap_andnot_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + assert(x1 != x2); + + uint8_t result_type = 0; + int length1 = x1->high_low_container.size; + const int length2 = x2->high_low_container.size; + int intersection_size = 0; + + if (0 == length2) return; + + if (0 == length1) { + roaring_bitmap_clear(x1); + return; + } + + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + + // We do the computation "in place" only when c1 is not a shared container. + // Rationale: using a shared container safely with in place computation would + // require making a copy and then doing the computation in place which is likely + // less efficient than avoiding in place entirely and always generating a new + // container. + + container_t *c; + if (type1 == SHARED_CONTAINER_TYPE) { + c = container_andnot(c1, type1, c2, type2, &result_type); + shared_container_free(CAST_shared(c1)); // release + } + else { + c = container_iandnot(c1, type1, c2, type2, &result_type); + } + + if (container_nonzero_cardinality(c, result_type)) { + ra_replace_key_and_container_at_index(&x1->high_low_container, + intersection_size++, s1, + c, result_type); + } else { + container_free(c, result_type); + } + + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + if (pos1 != intersection_size) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + + ra_replace_key_and_container_at_index(&x1->high_low_container, + intersection_size, s1, c1, + type1); + } + intersection_size++; + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + pos2 = ra_advance_until(&x2->high_low_container, s1, pos2); + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + + if (pos1 < length1) { + // all containers between intersection_size and + // pos1 are junk. However, they have either been moved + // (thus still referenced) or involved in an iandnot + // that will clean up all containers that could not be reused. + // Thus we should not free the junk containers between + // intersection_size and pos1. + if (pos1 > intersection_size) { + // left slide of remaining items + ra_copy_range(&x1->high_low_container, pos1, length1, + intersection_size); + } + // else current placement is fine + intersection_size += (length1 - pos1); + } + ra_downsize(&x1->high_low_container, intersection_size); +} + +uint64_t roaring_bitmap_get_cardinality(const roaring_bitmap_t *r) { + const roaring_array_t *ra = &r->high_low_container; + + uint64_t card = 0; + for (int i = 0; i < ra->size; ++i) + card += container_get_cardinality(ra->containers[i], ra->typecodes[i]); + return card; +} + +uint64_t roaring_bitmap_range_cardinality(const roaring_bitmap_t *r, + uint64_t range_start, + uint64_t range_end) { + const roaring_array_t *ra = &r->high_low_container; + + if (range_end > UINT32_MAX) { + range_end = UINT32_MAX + UINT64_C(1); + } + if (range_start >= range_end) { + return 0; + } + range_end--; // make range_end inclusive + // now we have: 0 <= range_start <= range_end <= UINT32_MAX + + uint16_t minhb = range_start >> 16; + uint16_t maxhb = range_end >> 16; + + uint64_t card = 0; + + int i = ra_get_index(ra, minhb); + if (i >= 0) { + if (minhb == maxhb) { + card += container_rank(ra->containers[i], ra->typecodes[i], + range_end & 0xffff); + } else { + card += container_get_cardinality(ra->containers[i], + ra->typecodes[i]); + } + if ((range_start & 0xffff) != 0) { + card -= container_rank(ra->containers[i], ra->typecodes[i], + (range_start & 0xffff) - 1); + } + i++; + } else { + i = -i - 1; + } + + for (; i < ra->size; i++) { + uint16_t key = ra->keys[i]; + if (key < maxhb) { + card += container_get_cardinality(ra->containers[i], + ra->typecodes[i]); + } else if (key == maxhb) { + card += container_rank(ra->containers[i], ra->typecodes[i], + range_end & 0xffff); + break; + } else { + break; + } + } + + return card; +} + + +bool roaring_bitmap_is_empty(const roaring_bitmap_t *r) { + return r->high_low_container.size == 0; +} + +void roaring_bitmap_to_uint32_array(const roaring_bitmap_t *r, uint32_t *ans) { + ra_to_uint32_array(&r->high_low_container, ans); +} + +bool roaring_bitmap_range_uint32_array(const roaring_bitmap_t *r, + size_t offset, size_t limit, + uint32_t *ans) { + return ra_range_uint32_array(&r->high_low_container, offset, limit, ans); +} + +/** convert array and bitmap containers to run containers when it is more + * efficient; + * also convert from run containers when more space efficient. Returns + * true if the result has at least one run container. +*/ +bool roaring_bitmap_run_optimize(roaring_bitmap_t *r) { + bool answer = false; + for (int i = 0; i < r->high_low_container.size; i++) { + uint8_t type_original, type_after; + ra_unshare_container_at_index( + &r->high_low_container, i); // TODO: this introduces extra cloning! + container_t *c = ra_get_container_at_index(&r->high_low_container, i, + &type_original); + container_t *c1 = convert_run_optimize(c, type_original, &type_after); + if (type_after == RUN_CONTAINER_TYPE) { + answer = true; + } + ra_set_container_at_index(&r->high_low_container, i, c1, type_after); + } + return answer; +} + +size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r) { + size_t answer = 0; + for (int i = 0; i < r->high_low_container.size; i++) { + uint8_t type_original; + container_t *c = ra_get_container_at_index(&r->high_low_container, i, + &type_original); + answer += container_shrink_to_fit(c, type_original); + } + answer += ra_shrink_to_fit(&r->high_low_container); + return answer; +} + +/** + * Remove run-length encoding even when it is more space efficient + * return whether a change was applied + */ +bool roaring_bitmap_remove_run_compression(roaring_bitmap_t *r) { + bool answer = false; + for (int i = 0; i < r->high_low_container.size; i++) { + uint8_t type_original, type_after; + container_t *c = ra_get_container_at_index(&r->high_low_container, i, + &type_original); + if (get_container_type(c, type_original) == RUN_CONTAINER_TYPE) { + answer = true; + if (type_original == SHARED_CONTAINER_TYPE) { + run_container_t *truec = CAST_run(CAST_shared(c)->container); + int32_t card = run_container_cardinality(truec); + container_t *c1 = convert_to_bitset_or_array_container( + truec, card, &type_after); + shared_container_free(CAST_shared(c)); // frees run as needed + ra_set_container_at_index(&r->high_low_container, i, c1, + type_after); + + } else { + int32_t card = run_container_cardinality(CAST_run(c)); + container_t *c1 = convert_to_bitset_or_array_container( + CAST_run(c), card, &type_after); + run_container_free(CAST_run(c)); + ra_set_container_at_index(&r->high_low_container, i, c1, + type_after); + } + } + } + return answer; +} + +size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf) { + size_t portablesize = roaring_bitmap_portable_size_in_bytes(r); + uint64_t cardinality = roaring_bitmap_get_cardinality(r); + uint64_t sizeasarray = cardinality * sizeof(uint32_t) + sizeof(uint32_t); + if (portablesize < sizeasarray) { + buf[0] = CROARING_SERIALIZATION_CONTAINER; + return roaring_bitmap_portable_serialize(r, buf + 1) + 1; + } else { + buf[0] = CROARING_SERIALIZATION_ARRAY_UINT32; + memcpy(buf + 1, &cardinality, sizeof(uint32_t)); + roaring_bitmap_to_uint32_array( + r, (uint32_t *)(buf + 1 + sizeof(uint32_t))); + return 1 + (size_t)sizeasarray; + } +} + +size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r) { + size_t portablesize = roaring_bitmap_portable_size_in_bytes(r); + uint64_t sizeasarray = roaring_bitmap_get_cardinality(r) * sizeof(uint32_t) + + sizeof(uint32_t); + return portablesize < sizeasarray ? portablesize + 1 : (size_t)sizeasarray + 1; +} + +size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r) { + return ra_portable_size_in_bytes(&r->high_low_container); +} + + +roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf, size_t maxbytes) { + roaring_bitmap_t *ans = + (roaring_bitmap_t *)roaring_malloc(sizeof(roaring_bitmap_t)); + if (ans == NULL) { + return NULL; + } + size_t bytesread; + bool is_ok = ra_portable_deserialize(&ans->high_low_container, buf, maxbytes, &bytesread); + if(is_ok) assert(bytesread <= maxbytes); + roaring_bitmap_set_copy_on_write(ans, false); + if (!is_ok) { + roaring_free(ans); + return NULL; + } + return ans; +} + +roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf) { + return roaring_bitmap_portable_deserialize_safe(buf, SIZE_MAX); +} + + +size_t roaring_bitmap_portable_deserialize_size(const char *buf, size_t maxbytes) { + return ra_portable_deserialize_size(buf, maxbytes); +} + + +size_t roaring_bitmap_portable_serialize(const roaring_bitmap_t *r, + char *buf) { + return ra_portable_serialize(&r->high_low_container, buf); +} + +roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf) { + const char *bufaschar = (const char *)buf; + if (bufaschar[0] == CROARING_SERIALIZATION_ARRAY_UINT32) { + /* This looks like a compressed set of uint32_t elements */ + uint32_t card; + memcpy(&card, bufaschar + 1, sizeof(uint32_t)); + const uint32_t *elems = + (const uint32_t *)(bufaschar + 1 + sizeof(uint32_t)); + roaring_bitmap_t *bitmap = roaring_bitmap_create(); + if (bitmap == NULL) { + return NULL; + } + roaring_bulk_context_t context = {0}; + for (uint32_t i = 0; i < card; i++) { + // elems may not be aligned, read with memcpy + uint32_t elem; + memcpy(&elem, elems + i, sizeof(elem)); + roaring_bitmap_add_bulk(bitmap, &context, elem); + } + return bitmap; + } else if (bufaschar[0] == CROARING_SERIALIZATION_CONTAINER) { + return roaring_bitmap_portable_deserialize(bufaschar + 1); + } else + return (NULL); +} + +bool roaring_iterate(const roaring_bitmap_t *r, roaring_iterator iterator, + void *ptr) { + const roaring_array_t *ra = &r->high_low_container; + + for (int i = 0; i < ra->size; ++i) + if (!container_iterate(ra->containers[i], ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16, + iterator, ptr)) { + return false; + } + return true; +} + +bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator, + uint64_t high_bits, void *ptr) { + const roaring_array_t *ra = &r->high_low_container; + + for (int i = 0; i < ra->size; ++i) + if (!container_iterate64( + ra->containers[i], ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16, iterator, + high_bits, ptr)) { + return false; + } + return true; +} + +/**** +* begin roaring_uint32_iterator_t +*****/ + +// Partially initializes the roaring iterator when it begins looking at +// a new container. +static bool iter_new_container_partial_init(roaring_uint32_iterator_t *newit) { + newit->in_container_index = 0; + newit->run_index = 0; + newit->current_value = 0; + if (newit->container_index >= newit->parent->high_low_container.size || + newit->container_index < 0) { + newit->current_value = UINT32_MAX; + return (newit->has_value = false); + } + // assume not empty + newit->has_value = true; + // we precompute container, typecode and highbits so that successive + // iterators do not have to grab them from odd memory locations + // and have to worry about the (easily predicted) container_unwrap_shared + // call. + newit->container = + newit->parent->high_low_container.containers[newit->container_index]; + newit->typecode = + newit->parent->high_low_container.typecodes[newit->container_index]; + newit->highbits = + ((uint32_t) + newit->parent->high_low_container.keys[newit->container_index]) + << 16; + newit->container = + container_unwrap_shared(newit->container, &(newit->typecode)); + return newit->has_value; +} + +static bool loadfirstvalue(roaring_uint32_iterator_t *newit) { + if (!iter_new_container_partial_init(newit)) + return newit->has_value; + + switch (newit->typecode) { + case BITSET_CONTAINER_TYPE: { + const bitset_container_t *bc = const_CAST_bitset(newit->container); + + uint32_t wordindex = 0; + uint64_t word; + while ((word = bc->words[wordindex]) == 0) { + wordindex++; // advance + } + // here "word" is non-zero + newit->in_container_index = wordindex * 64 + __builtin_ctzll(word); + newit->current_value = newit->highbits | newit->in_container_index; + break; } + + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = const_CAST_array(newit->container); + newit->current_value = newit->highbits | ac->array[0]; + break; } + + case RUN_CONTAINER_TYPE: { + const run_container_t *rc = const_CAST_run(newit->container); + newit->current_value = newit->highbits | rc->runs[0].value; + break; } + + default: + // if this ever happens, bug! + assert(false); + } // switch (typecode) + return true; +} + +static bool loadlastvalue(roaring_uint32_iterator_t* newit) { + if (!iter_new_container_partial_init(newit)) + return newit->has_value; + + switch(newit->typecode) { + case BITSET_CONTAINER_TYPE: { + uint32_t wordindex = BITSET_CONTAINER_SIZE_IN_WORDS - 1; + uint64_t word; + const bitset_container_t* bitset_container = (const bitset_container_t*)newit->container; + while ((word = bitset_container->words[wordindex]) == 0) + --wordindex; + + int num_leading_zeros = __builtin_clzll(word); + newit->in_container_index = (wordindex * 64) + (63 - num_leading_zeros); + newit->current_value = newit->highbits | newit->in_container_index; + break; + } + case ARRAY_CONTAINER_TYPE: { + const array_container_t* array_container = (const array_container_t*)newit->container; + newit->in_container_index = array_container->cardinality - 1; + newit->current_value = newit->highbits | array_container->array[newit->in_container_index]; + break; + } + case RUN_CONTAINER_TYPE: { + const run_container_t* run_container = (const run_container_t*)newit->container; + newit->run_index = run_container->n_runs - 1; + const rle16_t* last_run = &run_container->runs[newit->run_index]; + newit->current_value = newit->highbits | (last_run->value + last_run->length); + break; + } + default: + // if this ever happens, bug! + assert(false); + } + return true; +} + +// prerequesite: the value should be in range of the container +static bool loadfirstvalue_largeorequal(roaring_uint32_iterator_t *newit, uint32_t val) { + // Don't have to check return value because of prerequisite + iter_new_container_partial_init(newit); + uint16_t lb = val & 0xFFFF; + + switch (newit->typecode) { + case BITSET_CONTAINER_TYPE: { + const bitset_container_t *bc = const_CAST_bitset(newit->container); + newit->in_container_index = + bitset_container_index_equalorlarger(bc, lb); + newit->current_value = newit->highbits | newit->in_container_index; + break; } + + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = const_CAST_array(newit->container); + newit->in_container_index = + array_container_index_equalorlarger(ac, lb); + newit->current_value = + newit->highbits | ac->array[newit->in_container_index]; + break; } + + case RUN_CONTAINER_TYPE: { + const run_container_t *rc = const_CAST_run(newit->container); + newit->run_index = run_container_index_equalorlarger(rc, lb); + if (rc->runs[newit->run_index].value <= lb) { + newit->current_value = val; + } else { + newit->current_value = + newit->highbits | rc->runs[newit->run_index].value; + } + break; } + + default: + __builtin_unreachable(); + } + + return true; +} + +void roaring_init_iterator(const roaring_bitmap_t *r, + roaring_uint32_iterator_t *newit) { + newit->parent = r; + newit->container_index = 0; + newit->has_value = loadfirstvalue(newit); +} + +void roaring_init_iterator_last(const roaring_bitmap_t *r, + roaring_uint32_iterator_t *newit) { + newit->parent = r; + newit->container_index = newit->parent->high_low_container.size - 1; + newit->has_value = loadlastvalue(newit); +} + +roaring_uint32_iterator_t *roaring_create_iterator(const roaring_bitmap_t *r) { + roaring_uint32_iterator_t *newit = + (roaring_uint32_iterator_t *)roaring_malloc(sizeof(roaring_uint32_iterator_t)); + if (newit == NULL) return NULL; + roaring_init_iterator(r, newit); + return newit; +} + +roaring_uint32_iterator_t *roaring_copy_uint32_iterator( + const roaring_uint32_iterator_t *it) { + roaring_uint32_iterator_t *newit = + (roaring_uint32_iterator_t *)roaring_malloc(sizeof(roaring_uint32_iterator_t)); + memcpy(newit, it, sizeof(roaring_uint32_iterator_t)); + return newit; +} + +bool roaring_move_uint32_iterator_equalorlarger(roaring_uint32_iterator_t *it, uint32_t val) { + uint16_t hb = val >> 16; + const int i = ra_get_index(& it->parent->high_low_container, hb); + if (i >= 0) { + uint32_t lowvalue = container_maximum(it->parent->high_low_container.containers[i], it->parent->high_low_container.typecodes[i]); + uint16_t lb = val & 0xFFFF; + if(lowvalue < lb ) { + it->container_index = i+1; // will have to load first value of next container + } else {// the value is necessarily within the range of the container + it->container_index = i; + it->has_value = loadfirstvalue_largeorequal(it, val); + return it->has_value; + } + } else { + // there is no matching, so we are going for the next container + it->container_index = -i-1; + } + it->has_value = loadfirstvalue(it); + return it->has_value; +} + + +bool roaring_advance_uint32_iterator(roaring_uint32_iterator_t *it) { + if (it->container_index >= it->parent->high_low_container.size) { + return (it->has_value = false); + } + if (it->container_index < 0) { + it->container_index = 0; + return (it->has_value = loadfirstvalue(it)); + } + + switch (it->typecode) { + case BITSET_CONTAINER_TYPE: { + const bitset_container_t *bc = const_CAST_bitset(it->container); + it->in_container_index++; + + uint32_t wordindex = it->in_container_index / 64; + if (wordindex >= BITSET_CONTAINER_SIZE_IN_WORDS) break; + + uint64_t word = bc->words[wordindex] & + (UINT64_MAX << (it->in_container_index % 64)); + // next part could be optimized/simplified + while ((word == 0) && + (wordindex + 1 < BITSET_CONTAINER_SIZE_IN_WORDS)) { + wordindex++; + word = bc->words[wordindex]; + } + if (word != 0) { + it->in_container_index = wordindex * 64 + __builtin_ctzll(word); + it->current_value = it->highbits | it->in_container_index; + return (it->has_value = true); + } + break; } + + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = const_CAST_array(it->container); + it->in_container_index++; + if (it->in_container_index < ac->cardinality) { + it->current_value = + it->highbits | ac->array[it->in_container_index]; + return (it->has_value = true); + } + break; } + + case RUN_CONTAINER_TYPE: { + if(it->current_value == UINT32_MAX) { // avoid overflow to zero + return (it->has_value = false); + } + + const run_container_t* rc = const_CAST_run(it->container); + uint32_t limit = (it->highbits | (rc->runs[it->run_index].value + + rc->runs[it->run_index].length)); + if (++it->current_value <= limit) { + return (it->has_value = true); + } + + if (++it->run_index < rc->n_runs) { // Assume the run has a value + it->current_value = + it->highbits | rc->runs[it->run_index].value; + return (it->has_value = true); + } + break; + } + + default: + __builtin_unreachable(); + } + + // moving to next container + it->container_index++; + return (it->has_value = loadfirstvalue(it)); +} + +bool roaring_previous_uint32_iterator(roaring_uint32_iterator_t *it) { + if (it->container_index < 0) { + return (it->has_value = false); + } + if (it->container_index >= it->parent->high_low_container.size) { + it->container_index = it->parent->high_low_container.size - 1; + return (it->has_value = loadlastvalue(it)); + } + + switch (it->typecode) { + case BITSET_CONTAINER_TYPE: { + if (--it->in_container_index < 0) + break; + + const bitset_container_t* bitset_container = (const bitset_container_t*)it->container; + int32_t wordindex = it->in_container_index / 64; + uint64_t word = bitset_container->words[wordindex] & (UINT64_MAX >> (63 - (it->in_container_index % 64))); + + while (word == 0 && --wordindex >= 0) { + word = bitset_container->words[wordindex]; + } + if (word == 0) + break; + + int num_leading_zeros = __builtin_clzll(word); + it->in_container_index = (wordindex * 64) + (63 - num_leading_zeros); + it->current_value = it->highbits | it->in_container_index; + return (it->has_value = true); + } + case ARRAY_CONTAINER_TYPE: { + if (--it->in_container_index < 0) + break; + + const array_container_t* array_container = (const array_container_t*)it->container; + it->current_value = it->highbits | array_container->array[it->in_container_index]; + return (it->has_value = true); + } + case RUN_CONTAINER_TYPE: { + if(it->current_value == 0) + return (it->has_value = false); + + const run_container_t* run_container = (const run_container_t*)it->container; + if (--it->current_value >= (it->highbits | run_container->runs[it->run_index].value)) { + return (it->has_value = true); + } + + if (--it->run_index < 0) + break; + + it->current_value = it->highbits | (run_container->runs[it->run_index].value + + run_container->runs[it->run_index].length); + return (it->has_value = true); + } + default: + // if this ever happens, bug! + assert(false); + } // switch (typecode) + + // moving to previous container + it->container_index--; + return (it->has_value = loadlastvalue(it)); +} + +uint32_t roaring_read_uint32_iterator(roaring_uint32_iterator_t *it, uint32_t* buf, uint32_t count) { + uint32_t ret = 0; + uint32_t num_values; + uint32_t wordindex; // used for bitsets + uint64_t word; // used for bitsets + const array_container_t* acont; //TODO remove + const run_container_t* rcont; //TODO remove + const bitset_container_t* bcont; //TODO remove + + while (it->has_value && ret < count) { + switch (it->typecode) { + case BITSET_CONTAINER_TYPE: + bcont = const_CAST_bitset(it->container); + wordindex = it->in_container_index / 64; + word = bcont->words[wordindex] & (UINT64_MAX << (it->in_container_index % 64)); + do { + while (word != 0 && ret < count) { + buf[0] = it->highbits | (wordindex * 64 + __builtin_ctzll(word)); + word = word & (word - 1); + buf++; + ret++; + } + while (word == 0 && wordindex+1 < BITSET_CONTAINER_SIZE_IN_WORDS) { + wordindex++; + word = bcont->words[wordindex]; + } + } while (word != 0 && ret < count); + it->has_value = (word != 0); + if (it->has_value) { + it->in_container_index = wordindex * 64 + __builtin_ctzll(word); + it->current_value = it->highbits | it->in_container_index; + } + break; + case ARRAY_CONTAINER_TYPE: + acont = const_CAST_array(it->container); + num_values = minimum_uint32(acont->cardinality - it->in_container_index, count - ret); + for (uint32_t i = 0; i < num_values; i++) { + buf[i] = it->highbits | acont->array[it->in_container_index + i]; + } + buf += num_values; + ret += num_values; + it->in_container_index += num_values; + it->has_value = (it->in_container_index < acont->cardinality); + if (it->has_value) { + it->current_value = it->highbits | acont->array[it->in_container_index]; + } + break; + case RUN_CONTAINER_TYPE: + rcont = const_CAST_run(it->container); + //"in_run_index" name is misleading, read it as "max_value_in_current_run" + do { + uint32_t largest_run_value = it->highbits | (rcont->runs[it->run_index].value + rcont->runs[it->run_index].length); + num_values = minimum_uint32(largest_run_value - it->current_value + 1, count - ret); + for (uint32_t i = 0; i < num_values; i++) { + buf[i] = it->current_value + i; + } + it->current_value += num_values; // this can overflow to zero: UINT32_MAX+1=0 + buf += num_values; + ret += num_values; + + if (it->current_value > largest_run_value || it->current_value == 0) { + it->run_index++; + if (it->run_index < rcont->n_runs) { + it->current_value = it->highbits | rcont->runs[it->run_index].value; + } else { + it->has_value = false; + } + } + } while ((ret < count) && it->has_value); + break; + default: + assert(false); + } + if (it->has_value) { + assert(ret == count); + return ret; + } + it->container_index++; + it->has_value = loadfirstvalue(it); + } + return ret; +} + + + +void roaring_free_uint32_iterator(roaring_uint32_iterator_t *it) { roaring_free(it); } + +/**** +* end of roaring_uint32_iterator_t +*****/ + +bool roaring_bitmap_equals(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2) { + const roaring_array_t *ra1 = &r1->high_low_container; + const roaring_array_t *ra2 = &r2->high_low_container; + + if (ra1->size != ra2->size) { + return false; + } + for (int i = 0; i < ra1->size; ++i) { + if (ra1->keys[i] != ra2->keys[i]) { + return false; + } + } + for (int i = 0; i < ra1->size; ++i) { + bool areequal = container_equals(ra1->containers[i], + ra1->typecodes[i], + ra2->containers[i], + ra2->typecodes[i]); + if (!areequal) { + return false; + } + } + return true; +} + +bool roaring_bitmap_is_subset(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2) { + const roaring_array_t *ra1 = &r1->high_low_container; + const roaring_array_t *ra2 = &r2->high_low_container; + + const int length1 = ra1->size, + length2 = ra2->size; + + int pos1 = 0, pos2 = 0; + + while (pos1 < length1 && pos2 < length2) { + const uint16_t s1 = ra_get_key_at_index(ra1, pos1); + const uint16_t s2 = ra_get_key_at_index(ra2, pos2); + + if (s1 == s2) { + uint8_t type1, type2; + container_t *c1 = ra_get_container_at_index(ra1, pos1, &type1); + container_t *c2 = ra_get_container_at_index(ra2, pos2, &type2); + if (!container_is_subset(c1, type1, c2, type2)) + return false; + ++pos1; + ++pos2; + } else if (s1 < s2) { // s1 < s2 + return false; + } else { // s1 > s2 + pos2 = ra_advance_until(ra2, s1, pos2); + } + } + if (pos1 == length1) + return true; + else + return false; +} + +static void insert_flipped_container(roaring_array_t *ans_arr, + const roaring_array_t *x1_arr, uint16_t hb, + uint16_t lb_start, uint16_t lb_end) { + const int i = ra_get_index(x1_arr, hb); + const int j = ra_get_index(ans_arr, hb); + uint8_t ctype_in, ctype_out; + container_t *flipped_container = NULL; + if (i >= 0) { + container_t *container_to_flip = + ra_get_container_at_index(x1_arr, i, &ctype_in); + flipped_container = + container_not_range(container_to_flip, ctype_in, (uint32_t)lb_start, + (uint32_t)(lb_end + 1), &ctype_out); + + if (container_get_cardinality(flipped_container, ctype_out)) + ra_insert_new_key_value_at(ans_arr, -j - 1, hb, flipped_container, + ctype_out); + else { + container_free(flipped_container, ctype_out); + } + } else { + flipped_container = container_range_of_ones( + (uint32_t)lb_start, (uint32_t)(lb_end + 1), &ctype_out); + ra_insert_new_key_value_at(ans_arr, -j - 1, hb, flipped_container, + ctype_out); + } +} + +static void inplace_flip_container(roaring_array_t *x1_arr, uint16_t hb, + uint16_t lb_start, uint16_t lb_end) { + const int i = ra_get_index(x1_arr, hb); + uint8_t ctype_in, ctype_out; + container_t *flipped_container = NULL; + if (i >= 0) { + container_t *container_to_flip = + ra_get_container_at_index(x1_arr, i, &ctype_in); + flipped_container = container_inot_range( + container_to_flip, ctype_in, (uint32_t)lb_start, + (uint32_t)(lb_end + 1), &ctype_out); + // if a new container was created, the old one was already freed + if (container_get_cardinality(flipped_container, ctype_out)) { + ra_set_container_at_index(x1_arr, i, flipped_container, ctype_out); + } else { + container_free(flipped_container, ctype_out); + ra_remove_at_index(x1_arr, i); + } + + } else { + flipped_container = container_range_of_ones( + (uint32_t)lb_start, (uint32_t)(lb_end + 1), &ctype_out); + ra_insert_new_key_value_at(x1_arr, -i - 1, hb, flipped_container, + ctype_out); + } +} + +static void insert_fully_flipped_container(roaring_array_t *ans_arr, + const roaring_array_t *x1_arr, + uint16_t hb) { + const int i = ra_get_index(x1_arr, hb); + const int j = ra_get_index(ans_arr, hb); + uint8_t ctype_in, ctype_out; + container_t *flipped_container = NULL; + if (i >= 0) { + container_t *container_to_flip = + ra_get_container_at_index(x1_arr, i, &ctype_in); + flipped_container = + container_not(container_to_flip, ctype_in, &ctype_out); + if (container_get_cardinality(flipped_container, ctype_out)) + ra_insert_new_key_value_at(ans_arr, -j - 1, hb, flipped_container, + ctype_out); + else { + container_free(flipped_container, ctype_out); + } + } else { + flipped_container = container_range_of_ones(0U, 0x10000U, &ctype_out); + ra_insert_new_key_value_at(ans_arr, -j - 1, hb, flipped_container, + ctype_out); + } +} + +static void inplace_fully_flip_container(roaring_array_t *x1_arr, uint16_t hb) { + const int i = ra_get_index(x1_arr, hb); + uint8_t ctype_in, ctype_out; + container_t *flipped_container = NULL; + if (i >= 0) { + container_t *container_to_flip = + ra_get_container_at_index(x1_arr, i, &ctype_in); + flipped_container = + container_inot(container_to_flip, ctype_in, &ctype_out); + + if (container_get_cardinality(flipped_container, ctype_out)) { + ra_set_container_at_index(x1_arr, i, flipped_container, ctype_out); + } else { + container_free(flipped_container, ctype_out); + ra_remove_at_index(x1_arr, i); + } + + } else { + flipped_container = container_range_of_ones(0U, 0x10000U, &ctype_out); + ra_insert_new_key_value_at(x1_arr, -i - 1, hb, flipped_container, + ctype_out); + } +} + +roaring_bitmap_t *roaring_bitmap_flip(const roaring_bitmap_t *x1, + uint64_t range_start, + uint64_t range_end) { + if (range_start >= range_end) { + return roaring_bitmap_copy(x1); + } + if(range_end >= UINT64_C(0x100000000)) { + range_end = UINT64_C(0x100000000); + } + + roaring_bitmap_t *ans = roaring_bitmap_create(); + roaring_bitmap_set_copy_on_write(ans, is_cow(x1)); + + uint16_t hb_start = (uint16_t)(range_start >> 16); + const uint16_t lb_start = (uint16_t)range_start; // & 0xFFFF; + uint16_t hb_end = (uint16_t)((range_end - 1) >> 16); + const uint16_t lb_end = (uint16_t)(range_end - 1); // & 0xFFFF; + + ra_append_copies_until(&ans->high_low_container, &x1->high_low_container, + hb_start, is_cow(x1)); + if (hb_start == hb_end) { + insert_flipped_container(&ans->high_low_container, + &x1->high_low_container, hb_start, lb_start, + lb_end); + } else { + // start and end containers are distinct + if (lb_start > 0) { + // handle first (partial) container + insert_flipped_container(&ans->high_low_container, + &x1->high_low_container, hb_start, + lb_start, 0xFFFF); + ++hb_start; // for the full containers. Can't wrap. + } + + if (lb_end != 0xFFFF) --hb_end; // later we'll handle the partial block + + for (uint32_t hb = hb_start; hb <= hb_end; ++hb) { + insert_fully_flipped_container(&ans->high_low_container, + &x1->high_low_container, hb); + } + + // handle a partial final container + if (lb_end != 0xFFFF) { + insert_flipped_container(&ans->high_low_container, + &x1->high_low_container, hb_end + 1, 0, + lb_end); + ++hb_end; + } + } + ra_append_copies_after(&ans->high_low_container, &x1->high_low_container, + hb_end, is_cow(x1)); + return ans; +} + +void roaring_bitmap_flip_inplace(roaring_bitmap_t *x1, uint64_t range_start, + uint64_t range_end) { + if (range_start >= range_end) { + return; // empty range + } + if(range_end >= UINT64_C(0x100000000)) { + range_end = UINT64_C(0x100000000); + } + + uint16_t hb_start = (uint16_t)(range_start >> 16); + const uint16_t lb_start = (uint16_t)range_start; + uint16_t hb_end = (uint16_t)((range_end - 1) >> 16); + const uint16_t lb_end = (uint16_t)(range_end - 1); + + if (hb_start == hb_end) { + inplace_flip_container(&x1->high_low_container, hb_start, lb_start, + lb_end); + } else { + // start and end containers are distinct + if (lb_start > 0) { + // handle first (partial) container + inplace_flip_container(&x1->high_low_container, hb_start, lb_start, + 0xFFFF); + ++hb_start; // for the full containers. Can't wrap. + } + + if (lb_end != 0xFFFF) --hb_end; + + for (uint32_t hb = hb_start; hb <= hb_end; ++hb) { + inplace_fully_flip_container(&x1->high_low_container, hb); + } + // handle a partial final container + if (lb_end != 0xFFFF) { + inplace_flip_container(&x1->high_low_container, hb_end + 1, 0, + lb_end); + ++hb_end; + } + } +} + +static void offset_append_with_merge(roaring_array_t *ra, int k, container_t *c, uint8_t t) { + int size = ra_get_size(ra); + if (size == 0 || ra_get_key_at_index(ra, size-1) != k) { + // No merge. + ra_append(ra, k, c, t); + return; + } + + uint8_t last_t, new_t; + container_t *last_c, *new_c; + + // NOTE: we don't need to unwrap here, since we added last_c ourselves + // we have the certainty it's not a shared container. + // The same applies to c, as it's the result of calling container_offset. + last_c = ra_get_container_at_index(ra, size-1, &last_t); + new_c = container_ior(last_c, last_t, c, t, &new_t); + + ra_set_container_at_index(ra, size-1, new_c, new_t); + + // Comparison of pointers of different origin is UB (or so claim some compiler + // makers), so we compare their bit representation only. + if ((uintptr_t)last_c != (uintptr_t)new_c) { + container_free(last_c, last_t); + } + container_free(c, t); +} + +// roaring_bitmap_add_offset adds the value 'offset' to each and every value in +// a bitmap, generating a new bitmap in the process. If offset + element is +// outside of the range [0,2^32), that the element will be dropped. +// We need "offset" to be 64 bits because we want to support values +// between -0xFFFFFFFF up to +0xFFFFFFFF. +roaring_bitmap_t *roaring_bitmap_add_offset(const roaring_bitmap_t *bm, + int64_t offset) { + roaring_bitmap_t *answer; + roaring_array_t *ans_ra; + int64_t container_offset; + uint16_t in_offset; + + const roaring_array_t *bm_ra = &bm->high_low_container; + int length = bm_ra->size; + + if (offset == 0) { + return roaring_bitmap_copy(bm); + } + + container_offset = offset >> 16; + in_offset = (uint16_t)(offset - container_offset * (1 << 16)); + + answer = roaring_bitmap_create(); + roaring_bitmap_set_copy_on_write(answer, is_cow(bm)); + + ans_ra = &answer->high_low_container; + + if (in_offset == 0) { + ans_ra = &answer->high_low_container; + + for (int i = 0, j = 0; i < length; ++i) { + int64_t key = ra_get_key_at_index(bm_ra, i); + key += container_offset; + + if (key < 0 || key >= (1 << 16)) { + continue; + } + + ra_append_copy(ans_ra, bm_ra, i, false); + ans_ra->keys[j++] = key; + } + + return answer; + } + + uint8_t t; + const container_t *c; + container_t *lo, *hi, **lo_ptr, **hi_ptr; + int64_t k; + + for (int i = 0; i < length; ++i) { + lo = hi = NULL; + lo_ptr = hi_ptr = NULL; + + k = ra_get_key_at_index(bm_ra, i)+container_offset; + if (k >= 0 && k < (1 << 16)) { + lo_ptr = &lo; + } + if (k+1 >= 0 && k+1 < (1 << 16)) { + hi_ptr = &hi; + } + if (lo_ptr == NULL && hi_ptr == NULL) { + continue; + } + + c = ra_get_container_at_index(bm_ra, i, &t); + c = container_unwrap_shared(c, &t); + + container_add_offset(c, t, lo_ptr, hi_ptr, in_offset); + if (lo != NULL) { + offset_append_with_merge(ans_ra, k, lo, t); + } + if (hi != NULL) { + ra_append(ans_ra, k+1, hi, t); + } + } + + return answer; +} + +roaring_bitmap_t *roaring_bitmap_lazy_or(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2, + const bool bitsetconversion) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + if (0 == length1) { + return roaring_bitmap_copy(x2); + } + if (0 == length2) { + return roaring_bitmap_copy(x1); + } + roaring_bitmap_t *answer = + roaring_bitmap_create_with_capacity(length1 + length2); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c; + if (bitsetconversion && + (get_container_type(c1, type1) != BITSET_CONTAINER_TYPE) && + (get_container_type(c2, type2) != BITSET_CONTAINER_TYPE) + ){ + container_t *newc1 = + container_mutable_unwrap_shared(c1, &type1); + newc1 = container_to_bitset(newc1, type1); + type1 = BITSET_CONTAINER_TYPE; + c = container_lazy_ior(newc1, type1, c2, type2, + &result_type); + if (c != newc1) { // should not happen + container_free(newc1, type1); + } + } else { + c = container_lazy_or(c1, type1, c2, type2, &result_type); + } + // since we assume that the initial containers are non-empty, + // the + // result here + // can only be non-empty + ra_append(&answer->high_low_container, s1, c, result_type); + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + c1 = get_copy_of_container(c1, &type1, is_cow(x1)); + if (is_cow(x1)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c1, + type1); + } + ra_append(&answer->high_low_container, s1, c1, type1); + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_append(&answer->high_low_container, s2, c2, type2); + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&answer->high_low_container, + &x2->high_low_container, pos2, length2, + is_cow(x2)); + } else if (pos2 == length2) { + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1, + is_cow(x1)); + } + return answer; +} + +void roaring_bitmap_lazy_or_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2, + const bool bitsetconversion) { + uint8_t result_type = 0; + int length1 = x1->high_low_container.size; + const int length2 = x2->high_low_container.size; + + if (0 == length2) return; + + if (0 == length1) { + roaring_bitmap_overwrite(x1, x2); + return; + } + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + if (!container_is_full(c1, type1)) { + if ((bitsetconversion == false) || + (get_container_type(c1, type1) == BITSET_CONTAINER_TYPE) + ){ + c1 = get_writable_copy_if_shared(c1, &type1); + } else { + // convert to bitset + container_t *old_c1 = c1; + uint8_t old_type1 = type1; + c1 = container_mutable_unwrap_shared(c1, &type1); + c1 = container_to_bitset(c1, type1); + container_free(old_c1, old_type1); + type1 = BITSET_CONTAINER_TYPE; + } + + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_lazy_ior(c1, type1, c2, type2, + &result_type); + + if (c != c1) { // in this instance a new container was created, + // and we need to free the old one + container_free(c1, type1); + } + + ra_set_container_at_index(&x1->high_low_container, pos1, c, + result_type); + } + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + // container_t *c2_clone = container_clone(c2, type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_insert_new_key_value_at(&x1->high_low_container, pos1, s2, c2, + type2); + pos1++; + length1++; + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&x1->high_low_container, &x2->high_low_container, + pos2, length2, is_cow(x2)); + } +} + +roaring_bitmap_t *roaring_bitmap_lazy_xor(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + if (0 == length1) { + return roaring_bitmap_copy(x2); + } + if (0 == length2) { + return roaring_bitmap_copy(x1); + } + roaring_bitmap_t *answer = + roaring_bitmap_create_with_capacity(length1 + length2); + roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2)); + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + container_t *c = container_lazy_xor( + c1, type1, c2, type2, &result_type); + + if (container_nonzero_cardinality(c, result_type)) { + ra_append(&answer->high_low_container, s1, c, result_type); + } else { + container_free(c, result_type); + } + + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + c1 = get_copy_of_container(c1, &type1, is_cow(x1)); + if (is_cow(x1)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c1, + type1); + } + ra_append(&answer->high_low_container, s1, c1, type1); + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_append(&answer->high_low_container, s2, c2, type2); + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&answer->high_low_container, + &x2->high_low_container, pos2, length2, + is_cow(x2)); + } else if (pos2 == length2) { + ra_append_copy_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1, + is_cow(x1)); + } + return answer; +} + +void roaring_bitmap_lazy_xor_inplace(roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + assert(x1 != x2); + uint8_t result_type = 0; + int length1 = x1->high_low_container.size; + const int length2 = x2->high_low_container.size; + + if (0 == length2) return; + + if (0 == length1) { + roaring_bitmap_overwrite(x1, x2); + return; + } + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + + // We do the computation "in place" only when c1 is not a shared container. + // Rationale: using a shared container safely with in place computation would + // require making a copy and then doing the computation in place which is likely + // less efficient than avoiding in place entirely and always generating a new + // container. + + container_t *c; + if (type1 == SHARED_CONTAINER_TYPE) { + c = container_lazy_xor(c1, type1, c2, type2, &result_type); + shared_container_free(CAST_shared(c1)); // release + } + else { + c = container_lazy_ixor(c1, type1, c2, type2, &result_type); + } + + if (container_nonzero_cardinality(c, result_type)) { + ra_set_container_at_index(&x1->high_low_container, pos1, c, + result_type); + ++pos1; + } else { + container_free(c, result_type); + ra_remove_at_index(&x1->high_low_container, pos1); + --length1; + } + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + // container_t *c2_clone = container_clone(c2, type2); + c2 = get_copy_of_container(c2, &type2, is_cow(x2)); + if (is_cow(x2)) { + ra_set_container_at_index(&x2->high_low_container, pos2, c2, + type2); + } + ra_insert_new_key_value_at(&x1->high_low_container, pos1, s2, c2, + type2); + pos1++; + length1++; + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_copy_range(&x1->high_low_container, &x2->high_low_container, + pos2, length2, is_cow(x2)); + } +} + +void roaring_bitmap_repair_after_lazy(roaring_bitmap_t *r) { + roaring_array_t *ra = &r->high_low_container; + + for (int i = 0; i < ra->size; ++i) { + const uint8_t old_type = ra->typecodes[i]; + container_t *old_c = ra->containers[i]; + uint8_t new_type = old_type; + container_t *new_c = container_repair_after_lazy(old_c, &new_type); + ra->containers[i] = new_c; + ra->typecodes[i] = new_type; + } +} + + + +/** +* roaring_bitmap_rank returns the number of integers that are smaller or equal +* to x. +*/ +uint64_t roaring_bitmap_rank(const roaring_bitmap_t *bm, uint32_t x) { + uint64_t size = 0; + uint32_t xhigh = x >> 16; + for (int i = 0; i < bm->high_low_container.size; i++) { + uint32_t key = bm->high_low_container.keys[i]; + if (xhigh > key) { + size += + container_get_cardinality(bm->high_low_container.containers[i], + bm->high_low_container.typecodes[i]); + } else if (xhigh == key) { + return size + container_rank(bm->high_low_container.containers[i], + bm->high_low_container.typecodes[i], + x & 0xFFFF); + } else { + return size; + } + } + return size; +} + +/** +* roaring_bitmap_smallest returns the smallest value in the set. +* Returns UINT32_MAX if the set is empty. +*/ +uint32_t roaring_bitmap_minimum(const roaring_bitmap_t *bm) { + if (bm->high_low_container.size > 0) { + container_t *c = bm->high_low_container.containers[0]; + uint8_t type = bm->high_low_container.typecodes[0]; + uint32_t key = bm->high_low_container.keys[0]; + uint32_t lowvalue = container_minimum(c, type); + return lowvalue | (key << 16); + } + return UINT32_MAX; +} + +/** +* roaring_bitmap_smallest returns the greatest value in the set. +* Returns 0 if the set is empty. +*/ +uint32_t roaring_bitmap_maximum(const roaring_bitmap_t *bm) { + if (bm->high_low_container.size > 0) { + container_t *container = + bm->high_low_container.containers[bm->high_low_container.size - 1]; + uint8_t typecode = + bm->high_low_container.typecodes[bm->high_low_container.size - 1]; + uint32_t key = + bm->high_low_container.keys[bm->high_low_container.size - 1]; + uint32_t lowvalue = container_maximum(container, typecode); + return lowvalue | (key << 16); + } + return 0; +} + +bool roaring_bitmap_select(const roaring_bitmap_t *bm, uint32_t rank, + uint32_t *element) { + container_t *container; + uint8_t typecode; + uint16_t key; + uint32_t start_rank = 0; + int i = 0; + bool valid = false; + while (!valid && i < bm->high_low_container.size) { + container = bm->high_low_container.containers[i]; + typecode = bm->high_low_container.typecodes[i]; + valid = + container_select(container, typecode, &start_rank, rank, element); + i++; + } + + if (valid) { + key = bm->high_low_container.keys[i - 1]; + *element |= (((uint32_t)key) << 16); // w/o cast, key promotes signed + return true; + } else + return false; +} + +bool roaring_bitmap_intersect(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + uint64_t answer = 0; + int pos1 = 0, pos2 = 0; + + while (pos1 < length1 && pos2 < length2) { + const uint16_t s1 = ra_get_key_at_index(& x1->high_low_container, pos1); + const uint16_t s2 = ra_get_key_at_index(& x2->high_low_container, pos2); + + if (s1 == s2) { + uint8_t type1, type2; + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + if (container_intersect(c1, type1, c2, type2)) + return true; + ++pos1; + ++pos2; + } else if (s1 < s2) { // s1 < s2 + pos1 = ra_advance_until(& x1->high_low_container, s2, pos1); + } else { // s1 > s2 + pos2 = ra_advance_until(& x2->high_low_container, s1, pos2); + } + } + return answer != 0; +} + +bool roaring_bitmap_intersect_with_range(const roaring_bitmap_t *bm, + uint64_t x, uint64_t y) { + if (x >= y) { + // Empty range. + return false; + } + roaring_uint32_iterator_t it; + roaring_init_iterator(bm, &it); + if (!roaring_move_uint32_iterator_equalorlarger(&it, x)) { + // No values above x. + return false; + } + if (it.current_value >= y) { + // No values below y. + return false; + } + return true; +} + + +uint64_t roaring_bitmap_and_cardinality(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const int length1 = x1->high_low_container.size, + length2 = x2->high_low_container.size; + uint64_t answer = 0; + int pos1 = 0, pos2 = 0; + + while (pos1 < length1 && pos2 < length2) { + const uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + const uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + if (s1 == s2) { + uint8_t type1, type2; + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + answer += container_and_cardinality(c1, type1, c2, type2); + ++pos1; + ++pos2; + } else if (s1 < s2) { // s1 < s2 + pos1 = ra_advance_until(&x1->high_low_container, s2, pos1); + } else { // s1 > s2 + pos2 = ra_advance_until(&x2->high_low_container, s1, pos2); + } + } + return answer; +} + +double roaring_bitmap_jaccard_index(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const uint64_t c1 = roaring_bitmap_get_cardinality(x1); + const uint64_t c2 = roaring_bitmap_get_cardinality(x2); + const uint64_t inter = roaring_bitmap_and_cardinality(x1, x2); + return (double)inter / (double)(c1 + c2 - inter); +} + +uint64_t roaring_bitmap_or_cardinality(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const uint64_t c1 = roaring_bitmap_get_cardinality(x1); + const uint64_t c2 = roaring_bitmap_get_cardinality(x2); + const uint64_t inter = roaring_bitmap_and_cardinality(x1, x2); + return c1 + c2 - inter; +} + +uint64_t roaring_bitmap_andnot_cardinality(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const uint64_t c1 = roaring_bitmap_get_cardinality(x1); + const uint64_t inter = roaring_bitmap_and_cardinality(x1, x2); + return c1 - inter; +} + +uint64_t roaring_bitmap_xor_cardinality(const roaring_bitmap_t *x1, + const roaring_bitmap_t *x2) { + const uint64_t c1 = roaring_bitmap_get_cardinality(x1); + const uint64_t c2 = roaring_bitmap_get_cardinality(x2); + const uint64_t inter = roaring_bitmap_and_cardinality(x1, x2); + return c1 + c2 - 2 * inter; +} + + +bool roaring_bitmap_contains(const roaring_bitmap_t *r, uint32_t val) { + const uint16_t hb = val >> 16; + /* + * the next function call involves a binary search and lots of branching. + */ + int32_t i = ra_get_index(&r->high_low_container, hb); + if (i < 0) return false; + + uint8_t typecode; + // next call ought to be cheap + container_t *container = + ra_get_container_at_index(&r->high_low_container, i, &typecode); + // rest might be a tad expensive, possibly involving another round of binary search + return container_contains(container, val & 0xFFFF, typecode); +} + + +/** + * Check whether a range of values from range_start (included) to range_end (excluded) is present + */ +bool roaring_bitmap_contains_range(const roaring_bitmap_t *r, uint64_t range_start, uint64_t range_end) { + if(range_end >= UINT64_C(0x100000000)) { + range_end = UINT64_C(0x100000000); + } + if (range_start >= range_end) return true; // empty range are always contained! + if (range_end - range_start == 1) return roaring_bitmap_contains(r, (uint32_t)range_start); + uint16_t hb_rs = (uint16_t)(range_start >> 16); + uint16_t hb_re = (uint16_t)((range_end - 1) >> 16); + const int32_t span = hb_re - hb_rs; + const int32_t hlc_sz = ra_get_size(&r->high_low_container); + if (hlc_sz < span + 1) { + return false; + } + int32_t is = ra_get_index(&r->high_low_container, hb_rs); + int32_t ie = ra_get_index(&r->high_low_container, hb_re); + ie = (ie < 0 ? -ie - 1 : ie); + if ((is < 0) || ((ie - is) != span)) { + return false; + } + const uint32_t lb_rs = range_start & 0xFFFF; + const uint32_t lb_re = ((range_end - 1) & 0xFFFF) + 1; + uint8_t type; + container_t *c = ra_get_container_at_index(&r->high_low_container, is, + &type); + if (hb_rs == hb_re) { + return container_contains_range(c, lb_rs, lb_re, type); + } + if (!container_contains_range(c, lb_rs, 1 << 16, type)) { + return false; + } + assert(ie < hlc_sz); // would indicate an algorithmic bug + c = ra_get_container_at_index(&r->high_low_container, ie, &type); + if (!container_contains_range(c, 0, lb_re, type)) { + return false; + } + for (int32_t i = is + 1; i < ie; ++i) { + c = ra_get_container_at_index(&r->high_low_container, i, &type); + if (!container_is_full(c, type) ) { + return false; + } + } + return true; +} + + +bool roaring_bitmap_is_strict_subset(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2) { + return (roaring_bitmap_get_cardinality(r2) > + roaring_bitmap_get_cardinality(r1) && + roaring_bitmap_is_subset(r1, r2)); +} + + +/* + * FROZEN SERIALIZATION FORMAT DESCRIPTION + * + * -- (beginning must be aligned by 32 bytes) -- + * uint64_t[BITSET_CONTAINER_SIZE_IN_WORDS * num_bitset_containers] + * rle16_t[total number of rle elements in all run containers] + * uint16_t[total number of array elements in all array containers] + * uint16_t[num_containers] + * uint16_t[num_containers] + * uint8_t[num_containers] + *
    uint32_t + * + *
    is a 4-byte value which is a bit union of FROZEN_COOKIE (15 bits) + * and the number of containers (17 bits). + * + * stores number of elements for every container. + * Its meaning depends on container type. + * For array and bitset containers, this value is the container cardinality minus one. + * For run container, it is the number of rle_t elements (n_runs). + * + * ,, are flat arrays of elements of + * all containers of respective type. + * + * <*_data> and are kept close together because they are not accessed + * during deserilization. This may reduce IO in case of large mmaped bitmaps. + * All members have their native alignments during deserilization except
    , + * which is not guaranteed to be aligned by 4 bytes. + */ + +size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *rb) { + const roaring_array_t *ra = &rb->high_low_container; + size_t num_bytes = 0; + for (int32_t i = 0; i < ra->size; i++) { + switch (ra->typecodes[i]) { + case BITSET_CONTAINER_TYPE: { + num_bytes += BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + break; + } + case RUN_CONTAINER_TYPE: { + const run_container_t *rc = const_CAST_run(ra->containers[i]); + num_bytes += rc->n_runs * sizeof(rle16_t); + break; + } + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = + const_CAST_array(ra->containers[i]); + num_bytes += ac->cardinality * sizeof(uint16_t); + break; + } + default: + __builtin_unreachable(); + } + } + num_bytes += (2 + 2 + 1) * ra->size; // keys, counts, typecodes + num_bytes += 4; // header + return num_bytes; +} + +inline static void *arena_alloc(char **arena, size_t num_bytes) { + char *res = *arena; + *arena += num_bytes; + return res; +} + +void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *rb, char *buf) { + /* + * Note: we do not require user to supply a specifically aligned buffer. + * Thus we have to use memcpy() everywhere. + */ + + const roaring_array_t *ra = &rb->high_low_container; + + size_t bitset_zone_size = 0; + size_t run_zone_size = 0; + size_t array_zone_size = 0; + for (int32_t i = 0; i < ra->size; i++) { + switch (ra->typecodes[i]) { + case BITSET_CONTAINER_TYPE: { + bitset_zone_size += + BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + break; + } + case RUN_CONTAINER_TYPE: { + const run_container_t *rc = const_CAST_run(ra->containers[i]); + run_zone_size += rc->n_runs * sizeof(rle16_t); + break; + } + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = + const_CAST_array(ra->containers[i]); + array_zone_size += ac->cardinality * sizeof(uint16_t); + break; + } + default: + __builtin_unreachable(); + } + } + + uint64_t *bitset_zone = (uint64_t *)arena_alloc(&buf, bitset_zone_size); + rle16_t *run_zone = (rle16_t *)arena_alloc(&buf, run_zone_size); + uint16_t *array_zone = (uint16_t *)arena_alloc(&buf, array_zone_size); + uint16_t *key_zone = (uint16_t *)arena_alloc(&buf, 2*ra->size); + uint16_t *count_zone = (uint16_t *)arena_alloc(&buf, 2*ra->size); + uint8_t *typecode_zone = (uint8_t *)arena_alloc(&buf, ra->size); + uint32_t *header_zone = (uint32_t *)arena_alloc(&buf, 4); + + for (int32_t i = 0; i < ra->size; i++) { + uint16_t count; + switch (ra->typecodes[i]) { + case BITSET_CONTAINER_TYPE: { + const bitset_container_t *bc = + const_CAST_bitset(ra->containers[i]); + memcpy(bitset_zone, bc->words, + BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t)); + bitset_zone += BITSET_CONTAINER_SIZE_IN_WORDS; + if (bc->cardinality != BITSET_UNKNOWN_CARDINALITY) { + count = bc->cardinality - 1; + } else { + count = bitset_container_compute_cardinality(bc) - 1; + } + break; + } + case RUN_CONTAINER_TYPE: { + const run_container_t *rc = const_CAST_run(ra->containers[i]); + size_t num_bytes = rc->n_runs * sizeof(rle16_t); + memcpy(run_zone, rc->runs, num_bytes); + run_zone += rc->n_runs; + count = rc->n_runs; + break; + } + case ARRAY_CONTAINER_TYPE: { + const array_container_t *ac = + const_CAST_array(ra->containers[i]); + size_t num_bytes = ac->cardinality * sizeof(uint16_t); + memcpy(array_zone, ac->array, num_bytes); + array_zone += ac->cardinality; + count = ac->cardinality - 1; + break; + } + default: + __builtin_unreachable(); + } + memcpy(&count_zone[i], &count, 2); + } + memcpy(key_zone, ra->keys, ra->size * sizeof(uint16_t)); + memcpy(typecode_zone, ra->typecodes, ra->size * sizeof(uint8_t)); + uint32_t header = ((uint32_t)ra->size << 15) | FROZEN_COOKIE; + memcpy(header_zone, &header, 4); +} + +const roaring_bitmap_t * +roaring_bitmap_frozen_view(const char *buf, size_t length) { + if ((uintptr_t)buf % 32 != 0) { + return NULL; + } + + // cookie and num_containers + if (length < 4) { + return NULL; + } + uint32_t header; + memcpy(&header, buf + length - 4, 4); // header may be misaligned + if ((header & 0x7FFF) != FROZEN_COOKIE) { + return NULL; + } + int32_t num_containers = (header >> 15); + + // typecodes, counts and keys + if (length < 4 + (size_t)num_containers * (1 + 2 + 2)) { + return NULL; + } + uint16_t *keys = (uint16_t *)(buf + length - 4 - num_containers * 5); + uint16_t *counts = (uint16_t *)(buf + length - 4 - num_containers * 3); + uint8_t *typecodes = (uint8_t *)(buf + length - 4 - num_containers * 1); + + // {bitset,array,run}_zone + int32_t num_bitset_containers = 0; + int32_t num_run_containers = 0; + int32_t num_array_containers = 0; + size_t bitset_zone_size = 0; + size_t run_zone_size = 0; + size_t array_zone_size = 0; + for (int32_t i = 0; i < num_containers; i++) { + switch (typecodes[i]) { + case BITSET_CONTAINER_TYPE: + num_bitset_containers++; + bitset_zone_size += BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + break; + case RUN_CONTAINER_TYPE: + num_run_containers++; + run_zone_size += counts[i] * sizeof(rle16_t); + break; + case ARRAY_CONTAINER_TYPE: + num_array_containers++; + array_zone_size += (counts[i] + UINT32_C(1)) * sizeof(uint16_t); + break; + default: + return NULL; + } + } + if (length != bitset_zone_size + run_zone_size + array_zone_size + + 5 * num_containers + 4) { + return NULL; + } + uint64_t *bitset_zone = (uint64_t*) (buf); + rle16_t *run_zone = (rle16_t*) (buf + bitset_zone_size); + uint16_t *array_zone = (uint16_t*) (buf + bitset_zone_size + run_zone_size); + + size_t alloc_size = 0; + alloc_size += sizeof(roaring_bitmap_t); + alloc_size += num_containers * sizeof(container_t*); + alloc_size += num_bitset_containers * sizeof(bitset_container_t); + alloc_size += num_run_containers * sizeof(run_container_t); + alloc_size += num_array_containers * sizeof(array_container_t); + + char *arena = (char *)roaring_malloc(alloc_size); + if (arena == NULL) { + return NULL; + } + + roaring_bitmap_t *rb = (roaring_bitmap_t *) + arena_alloc(&arena, sizeof(roaring_bitmap_t)); + rb->high_low_container.flags = ROARING_FLAG_FROZEN; + rb->high_low_container.allocation_size = num_containers; + rb->high_low_container.size = num_containers; + rb->high_low_container.keys = (uint16_t *)keys; + rb->high_low_container.typecodes = (uint8_t *)typecodes; + rb->high_low_container.containers = + (container_t **)arena_alloc(&arena, + sizeof(container_t*) * num_containers); + // Ensure offset of high_low_container.containers is known distance used in + // C++ wrapper. sizeof(roaring_bitmap_t) is used as it is the size of the + // only allocation that precedes high_low_container.containers. If this is + // changed (new allocation or changed order), this offset will also need to + // be changed in the C++ wrapper. + assert(rb == + (roaring_bitmap_t *)((char *)rb->high_low_container.containers - + sizeof(roaring_bitmap_t))); + for (int32_t i = 0; i < num_containers; i++) { + switch (typecodes[i]) { + case BITSET_CONTAINER_TYPE: { + bitset_container_t *bitset = (bitset_container_t *) + arena_alloc(&arena, sizeof(bitset_container_t)); + bitset->words = bitset_zone; + bitset->cardinality = counts[i] + UINT32_C(1); + rb->high_low_container.containers[i] = bitset; + bitset_zone += BITSET_CONTAINER_SIZE_IN_WORDS; + break; + } + case RUN_CONTAINER_TYPE: { + run_container_t *run = (run_container_t *) + arena_alloc(&arena, sizeof(run_container_t)); + run->capacity = counts[i]; + run->n_runs = counts[i]; + run->runs = run_zone; + rb->high_low_container.containers[i] = run; + run_zone += run->n_runs; + break; + } + case ARRAY_CONTAINER_TYPE: { + array_container_t *array = (array_container_t *) + arena_alloc(&arena, sizeof(array_container_t)); + array->capacity = counts[i] + UINT32_C(1); + array->cardinality = counts[i] + UINT32_C(1); + array->array = array_zone; + rb->high_low_container.containers[i] = array; + array_zone += counts[i] + UINT32_C(1); + break; + } + default: + roaring_free(arena); + return NULL; + } + } + + return rb; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { +#endif +/* end file src/roaring.c */ +/* begin file src/roaring_array.c */ +#include +#include +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace internal { +#endif + +// Convention: [0,ra->size) all elements are initialized +// [ra->size, ra->allocation_size) is junk and contains nothing needing freeing + +extern inline int32_t ra_get_size(const roaring_array_t *ra); +extern inline int32_t ra_get_index(const roaring_array_t *ra, uint16_t x); + +extern inline container_t *ra_get_container_at_index( + const roaring_array_t *ra, uint16_t i, + uint8_t *typecode); + +extern inline void ra_unshare_container_at_index(roaring_array_t *ra, + uint16_t i); + +extern inline void ra_replace_key_and_container_at_index( + roaring_array_t *ra, int32_t i, uint16_t key, + container_t *c, uint8_t typecode); + +extern inline void ra_set_container_at_index( + const roaring_array_t *ra, int32_t i, + container_t *c, uint8_t typecode); + +static bool realloc_array(roaring_array_t *ra, int32_t new_capacity) { + // + // Note: not implemented using C's realloc(), because the memory layout is + // Struct-of-Arrays vs. Array-of-Structs: + // https://github.com/RoaringBitmap/CRoaring/issues/256 + + if ( new_capacity == 0 ) { + roaring_free(ra->containers); + ra->containers = NULL; + ra->keys = NULL; + ra->typecodes = NULL; + ra->allocation_size = 0; + return true; + } + const size_t memoryneeded = new_capacity * ( + sizeof(uint16_t) + sizeof(container_t *) + sizeof(uint8_t)); + void *bigalloc = roaring_malloc(memoryneeded); + if (!bigalloc) return false; + void *oldbigalloc = ra->containers; + container_t **newcontainers = (container_t **)bigalloc; + uint16_t *newkeys = (uint16_t *)(newcontainers + new_capacity); + uint8_t *newtypecodes = (uint8_t *)(newkeys + new_capacity); + assert((char *)(newtypecodes + new_capacity) == + (char *)bigalloc + memoryneeded); + if(ra->size > 0) { + memcpy(newcontainers, ra->containers, sizeof(container_t *) * ra->size); + memcpy(newkeys, ra->keys, sizeof(uint16_t) * ra->size); + memcpy(newtypecodes, ra->typecodes, sizeof(uint8_t) * ra->size); + } + ra->containers = newcontainers; + ra->keys = newkeys; + ra->typecodes = newtypecodes; + ra->allocation_size = new_capacity; + roaring_free(oldbigalloc); + return true; +} + +bool ra_init_with_capacity(roaring_array_t *new_ra, uint32_t cap) { + if (!new_ra) return false; + ra_init(new_ra); + + if (cap > INT32_MAX) { return false; } + + if(cap > 0) { + void *bigalloc = roaring_malloc(cap * + (sizeof(uint16_t) + sizeof(container_t *) + sizeof(uint8_t))); + if( bigalloc == NULL ) return false; + new_ra->containers = (container_t **)bigalloc; + new_ra->keys = (uint16_t *)(new_ra->containers + cap); + new_ra->typecodes = (uint8_t *)(new_ra->keys + cap); + // Narrowing is safe because of above check + new_ra->allocation_size = (int32_t)cap; + } + return true; +} + +int ra_shrink_to_fit(roaring_array_t *ra) { + int savings = (ra->allocation_size - ra->size) * + (sizeof(uint16_t) + sizeof(container_t *) + sizeof(uint8_t)); + if (!realloc_array(ra, ra->size)) { + return 0; + } + ra->allocation_size = ra->size; + return savings; +} + +void ra_init(roaring_array_t *new_ra) { + if (!new_ra) { return; } + new_ra->keys = NULL; + new_ra->containers = NULL; + new_ra->typecodes = NULL; + + new_ra->allocation_size = 0; + new_ra->size = 0; + new_ra->flags = 0; +} + +bool ra_overwrite(const roaring_array_t *source, roaring_array_t *dest, + bool copy_on_write) { + ra_clear_containers(dest); // we are going to overwrite them + if (source->size == 0) { // Note: can't call memcpy(NULL), even w/size + dest->size = 0; // <--- This is important. + return true; // output was just cleared, so they match + } + if (dest->allocation_size < source->size) { + if (!realloc_array(dest, source->size)) { + return false; + } + } + dest->size = source->size; + memcpy(dest->keys, source->keys, dest->size * sizeof(uint16_t)); + // we go through the containers, turning them into shared containers... + if (copy_on_write) { + for (int32_t i = 0; i < dest->size; ++i) { + source->containers[i] = get_copy_of_container( + source->containers[i], &source->typecodes[i], copy_on_write); + } + // we do a shallow copy to the other bitmap + memcpy(dest->containers, source->containers, + dest->size * sizeof(container_t *)); + memcpy(dest->typecodes, source->typecodes, + dest->size * sizeof(uint8_t)); + } else { + memcpy(dest->typecodes, source->typecodes, + dest->size * sizeof(uint8_t)); + for (int32_t i = 0; i < dest->size; i++) { + dest->containers[i] = + container_clone(source->containers[i], source->typecodes[i]); + if (dest->containers[i] == NULL) { + for (int32_t j = 0; j < i; j++) { + container_free(dest->containers[j], dest->typecodes[j]); + } + ra_clear_without_containers(dest); + return false; + } + } + } + return true; +} + +void ra_clear_containers(roaring_array_t *ra) { + for (int32_t i = 0; i < ra->size; ++i) { + container_free(ra->containers[i], ra->typecodes[i]); + } +} + +void ra_reset(roaring_array_t *ra) { + ra_clear_containers(ra); + ra->size = 0; + ra_shrink_to_fit(ra); +} + +void ra_clear_without_containers(roaring_array_t *ra) { + roaring_free(ra->containers); // keys and typecodes are allocated with containers + ra->size = 0; + ra->allocation_size = 0; + ra->containers = NULL; + ra->keys = NULL; + ra->typecodes = NULL; +} + +void ra_clear(roaring_array_t *ra) { + ra_clear_containers(ra); + ra_clear_without_containers(ra); +} + +bool extend_array(roaring_array_t *ra, int32_t k) { + int32_t desired_size = ra->size + k; + const int32_t max_containers = 65536; + assert(desired_size <= max_containers); + if (desired_size > ra->allocation_size) { + int32_t new_capacity = + (ra->size < 1024) ? 2 * desired_size : 5 * desired_size / 4; + if (new_capacity > max_containers) { + new_capacity = max_containers; + } + + return realloc_array(ra, new_capacity); + } + return true; +} + +void ra_append( + roaring_array_t *ra, uint16_t key, + container_t *c, uint8_t typecode +){ + extend_array(ra, 1); + const int32_t pos = ra->size; + + ra->keys[pos] = key; + ra->containers[pos] = c; + ra->typecodes[pos] = typecode; + ra->size++; +} + +void ra_append_copy(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t index, bool copy_on_write) { + extend_array(ra, 1); + const int32_t pos = ra->size; + + // old contents is junk not needing freeing + ra->keys[pos] = sa->keys[index]; + // the shared container will be in two bitmaps + if (copy_on_write) { + sa->containers[index] = get_copy_of_container( + sa->containers[index], &sa->typecodes[index], copy_on_write); + ra->containers[pos] = sa->containers[index]; + ra->typecodes[pos] = sa->typecodes[index]; + } else { + ra->containers[pos] = + container_clone(sa->containers[index], sa->typecodes[index]); + ra->typecodes[pos] = sa->typecodes[index]; + } + ra->size++; +} + +void ra_append_copies_until(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t stopping_key, bool copy_on_write) { + for (int32_t i = 0; i < sa->size; ++i) { + if (sa->keys[i] >= stopping_key) break; + ra_append_copy(ra, sa, i, copy_on_write); + } +} + +void ra_append_copy_range(roaring_array_t *ra, const roaring_array_t *sa, + int32_t start_index, int32_t end_index, + bool copy_on_write) { + extend_array(ra, end_index - start_index); + for (int32_t i = start_index; i < end_index; ++i) { + const int32_t pos = ra->size; + ra->keys[pos] = sa->keys[i]; + if (copy_on_write) { + sa->containers[i] = get_copy_of_container( + sa->containers[i], &sa->typecodes[i], copy_on_write); + ra->containers[pos] = sa->containers[i]; + ra->typecodes[pos] = sa->typecodes[i]; + } else { + ra->containers[pos] = + container_clone(sa->containers[i], sa->typecodes[i]); + ra->typecodes[pos] = sa->typecodes[i]; + } + ra->size++; + } +} + +void ra_append_copies_after(roaring_array_t *ra, const roaring_array_t *sa, + uint16_t before_start, bool copy_on_write) { + int start_location = ra_get_index(sa, before_start); + if (start_location >= 0) + ++start_location; + else + start_location = -start_location - 1; + ra_append_copy_range(ra, sa, start_location, sa->size, copy_on_write); +} + +void ra_append_move_range(roaring_array_t *ra, roaring_array_t *sa, + int32_t start_index, int32_t end_index) { + extend_array(ra, end_index - start_index); + + for (int32_t i = start_index; i < end_index; ++i) { + const int32_t pos = ra->size; + + ra->keys[pos] = sa->keys[i]; + ra->containers[pos] = sa->containers[i]; + ra->typecodes[pos] = sa->typecodes[i]; + ra->size++; + } +} + +void ra_append_range(roaring_array_t *ra, roaring_array_t *sa, + int32_t start_index, int32_t end_index, + bool copy_on_write) { + extend_array(ra, end_index - start_index); + + for (int32_t i = start_index; i < end_index; ++i) { + const int32_t pos = ra->size; + ra->keys[pos] = sa->keys[i]; + if (copy_on_write) { + sa->containers[i] = get_copy_of_container( + sa->containers[i], &sa->typecodes[i], copy_on_write); + ra->containers[pos] = sa->containers[i]; + ra->typecodes[pos] = sa->typecodes[i]; + } else { + ra->containers[pos] = + container_clone(sa->containers[i], sa->typecodes[i]); + ra->typecodes[pos] = sa->typecodes[i]; + } + ra->size++; + } +} + +container_t *ra_get_container( + roaring_array_t *ra, uint16_t x, uint8_t *typecode +){ + int i = binarySearch(ra->keys, (int32_t)ra->size, x); + if (i < 0) return NULL; + *typecode = ra->typecodes[i]; + return ra->containers[i]; +} + +extern inline container_t *ra_get_container_at_index( + const roaring_array_t *ra, uint16_t i, + uint8_t *typecode); + +extern inline uint16_t ra_get_key_at_index(const roaring_array_t *ra, + uint16_t i); + +extern inline int32_t ra_get_index(const roaring_array_t *ra, uint16_t x); + +extern inline int32_t ra_advance_until(const roaring_array_t *ra, uint16_t x, + int32_t pos); + +// everything skipped over is freed +int32_t ra_advance_until_freeing(roaring_array_t *ra, uint16_t x, int32_t pos) { + while (pos < ra->size && ra->keys[pos] < x) { + container_free(ra->containers[pos], ra->typecodes[pos]); + ++pos; + } + return pos; +} + +void ra_insert_new_key_value_at( + roaring_array_t *ra, int32_t i, uint16_t key, + container_t *c, uint8_t typecode +){ + extend_array(ra, 1); + // May be an optimization opportunity with DIY memmove + memmove(&(ra->keys[i + 1]), &(ra->keys[i]), + sizeof(uint16_t) * (ra->size - i)); + memmove(&(ra->containers[i + 1]), &(ra->containers[i]), + sizeof(container_t *) * (ra->size - i)); + memmove(&(ra->typecodes[i + 1]), &(ra->typecodes[i]), + sizeof(uint8_t) * (ra->size - i)); + ra->keys[i] = key; + ra->containers[i] = c; + ra->typecodes[i] = typecode; + ra->size++; +} + +// note: Java routine set things to 0, enabling GC. +// Java called it "resize" but it was always used to downsize. +// Allowing upsize would break the conventions about +// valid containers below ra->size. + +void ra_downsize(roaring_array_t *ra, int32_t new_length) { + assert(new_length <= ra->size); + ra->size = new_length; +} + +void ra_remove_at_index(roaring_array_t *ra, int32_t i) { + memmove(&(ra->containers[i]), &(ra->containers[i + 1]), + sizeof(container_t *) * (ra->size - i - 1)); + memmove(&(ra->keys[i]), &(ra->keys[i + 1]), + sizeof(uint16_t) * (ra->size - i - 1)); + memmove(&(ra->typecodes[i]), &(ra->typecodes[i + 1]), + sizeof(uint8_t) * (ra->size - i - 1)); + ra->size--; +} + +void ra_remove_at_index_and_free(roaring_array_t *ra, int32_t i) { + container_free(ra->containers[i], ra->typecodes[i]); + ra_remove_at_index(ra, i); +} + +// used in inplace andNot only, to slide left the containers from +// the mutated RoaringBitmap that are after the largest container of +// the argument RoaringBitmap. In use it should be followed by a call to +// downsize. +// +void ra_copy_range(roaring_array_t *ra, uint32_t begin, uint32_t end, + uint32_t new_begin) { + assert(begin <= end); + assert(new_begin < begin); + + const int range = end - begin; + + // We ensure to previously have freed overwritten containers + // that are not copied elsewhere + + memmove(&(ra->containers[new_begin]), &(ra->containers[begin]), + sizeof(container_t *) * range); + memmove(&(ra->keys[new_begin]), &(ra->keys[begin]), + sizeof(uint16_t) * range); + memmove(&(ra->typecodes[new_begin]), &(ra->typecodes[begin]), + sizeof(uint8_t) * range); +} + +void ra_shift_tail(roaring_array_t *ra, int32_t count, int32_t distance) { + if (distance > 0) { + extend_array(ra, distance); + } + int32_t srcpos = ra->size - count; + int32_t dstpos = srcpos + distance; + memmove(&(ra->keys[dstpos]), &(ra->keys[srcpos]), + sizeof(uint16_t) * count); + memmove(&(ra->containers[dstpos]), &(ra->containers[srcpos]), + sizeof(container_t *) * count); + memmove(&(ra->typecodes[dstpos]), &(ra->typecodes[srcpos]), + sizeof(uint8_t) * count); + ra->size += distance; +} + + +void ra_to_uint32_array(const roaring_array_t *ra, uint32_t *ans) { + size_t ctr = 0; + for (int32_t i = 0; i < ra->size; ++i) { + int num_added = container_to_uint32_array( + ans + ctr, ra->containers[i], ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16); + ctr += num_added; + } +} + +bool ra_range_uint32_array(const roaring_array_t *ra, size_t offset, size_t limit, uint32_t *ans) { + size_t ctr = 0; + size_t dtr = 0; + + size_t t_limit = 0; + + bool first = false; + size_t first_skip = 0; + + uint32_t *t_ans = NULL; + size_t cur_len = 0; + + for (int i = 0; i < ra->size; ++i) { + + const container_t *c = container_unwrap_shared( + ra->containers[i], &ra->typecodes[i]); + switch (ra->typecodes[i]) { + case BITSET_CONTAINER_TYPE: + t_limit = (const_CAST_bitset(c))->cardinality; + break; + case ARRAY_CONTAINER_TYPE: + t_limit = (const_CAST_array(c))->cardinality; + break; + case RUN_CONTAINER_TYPE: + t_limit = run_container_cardinality(const_CAST_run(c)); + break; + } + if (ctr + t_limit - 1 >= offset && ctr < offset + limit){ + if (!first){ + //first_skip = t_limit - (ctr + t_limit - offset); + first_skip = offset - ctr; + first = true; + t_ans = (uint32_t *)roaring_malloc(sizeof(*t_ans) * (first_skip + limit)); + if(t_ans == NULL) { + return false; + } + memset(t_ans, 0, sizeof(*t_ans) * (first_skip + limit)) ; + cur_len = first_skip + limit; + } + if (dtr + t_limit > cur_len){ + uint32_t * append_ans = (uint32_t *)roaring_malloc(sizeof(*append_ans) * (cur_len + t_limit)); + if(append_ans == NULL) { + if(t_ans != NULL) roaring_free(t_ans); + return false; + } + memset(append_ans, 0, sizeof(*append_ans) * (cur_len + t_limit)); + cur_len = cur_len + t_limit; + memcpy(append_ans, t_ans, dtr * sizeof(uint32_t)); + roaring_free(t_ans); + t_ans = append_ans; + } + switch (ra->typecodes[i]) { + case BITSET_CONTAINER_TYPE: + container_to_uint32_array( + t_ans + dtr, + const_CAST_bitset(c), ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16); + break; + case ARRAY_CONTAINER_TYPE: + container_to_uint32_array( + t_ans + dtr, + const_CAST_array(c), ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16); + break; + case RUN_CONTAINER_TYPE: + container_to_uint32_array( + t_ans + dtr, + const_CAST_run(c), ra->typecodes[i], + ((uint32_t)ra->keys[i]) << 16); + break; + } + dtr += t_limit; + } + ctr += t_limit; + if (dtr-first_skip >= limit) break; + } + if(t_ans != NULL) { + memcpy(ans, t_ans+first_skip, limit * sizeof(uint32_t)); + free(t_ans); + } + return true; +} + +bool ra_has_run_container(const roaring_array_t *ra) { + for (int32_t k = 0; k < ra->size; ++k) { + if (get_container_type(ra->containers[k], ra->typecodes[k]) == + RUN_CONTAINER_TYPE) + return true; + } + return false; +} + +uint32_t ra_portable_header_size(const roaring_array_t *ra) { + if (ra_has_run_container(ra)) { + if (ra->size < + NO_OFFSET_THRESHOLD) { // for small bitmaps, we omit the offsets + return 4 + (ra->size + 7) / 8 + 4 * ra->size; + } + return 4 + (ra->size + 7) / 8 + + 8 * ra->size; // - 4 because we pack the size with the cookie + } else { + return 4 + 4 + 8 * ra->size; + } +} + +size_t ra_portable_size_in_bytes(const roaring_array_t *ra) { + size_t count = ra_portable_header_size(ra); + + for (int32_t k = 0; k < ra->size; ++k) { + count += container_size_in_bytes(ra->containers[k], ra->typecodes[k]); + } + return count; +} + +size_t ra_portable_serialize(const roaring_array_t *ra, char *buf) { + char *initbuf = buf; + uint32_t startOffset = 0; + bool hasrun = ra_has_run_container(ra); + if (hasrun) { + uint32_t cookie = SERIAL_COOKIE | ((ra->size - 1) << 16); + memcpy(buf, &cookie, sizeof(cookie)); + buf += sizeof(cookie); + uint32_t s = (ra->size + 7) / 8; + uint8_t *bitmapOfRunContainers = (uint8_t *)roaring_calloc(s, 1); + assert(bitmapOfRunContainers != NULL); // todo: handle + for (int32_t i = 0; i < ra->size; ++i) { + if (get_container_type(ra->containers[i], ra->typecodes[i]) == + RUN_CONTAINER_TYPE) { + bitmapOfRunContainers[i / 8] |= (1 << (i % 8)); + } + } + memcpy(buf, bitmapOfRunContainers, s); + buf += s; + roaring_free(bitmapOfRunContainers); + if (ra->size < NO_OFFSET_THRESHOLD) { + startOffset = 4 + 4 * ra->size + s; + } else { + startOffset = 4 + 8 * ra->size + s; + } + } else { // backwards compatibility + uint32_t cookie = SERIAL_COOKIE_NO_RUNCONTAINER; + + memcpy(buf, &cookie, sizeof(cookie)); + buf += sizeof(cookie); + memcpy(buf, &ra->size, sizeof(ra->size)); + buf += sizeof(ra->size); + + startOffset = 4 + 4 + 4 * ra->size + 4 * ra->size; + } + for (int32_t k = 0; k < ra->size; ++k) { + memcpy(buf, &ra->keys[k], sizeof(ra->keys[k])); + buf += sizeof(ra->keys[k]); + // get_cardinality returns a value in [1,1<<16], subtracting one + // we get [0,1<<16 - 1] which fits in 16 bits + uint16_t card = (uint16_t)( + container_get_cardinality(ra->containers[k], ra->typecodes[k]) - 1); + memcpy(buf, &card, sizeof(card)); + buf += sizeof(card); + } + if ((!hasrun) || (ra->size >= NO_OFFSET_THRESHOLD)) { + // writing the containers offsets + for (int32_t k = 0; k < ra->size; k++) { + memcpy(buf, &startOffset, sizeof(startOffset)); + buf += sizeof(startOffset); + startOffset = + startOffset + + container_size_in_bytes(ra->containers[k], ra->typecodes[k]); + } + } + for (int32_t k = 0; k < ra->size; ++k) { + buf += container_write(ra->containers[k], ra->typecodes[k], buf); + } + return buf - initbuf; +} + +// Quickly checks whether there is a serialized bitmap at the pointer, +// not exceeding size "maxbytes" in bytes. This function does not allocate +// memory dynamically. +// +// This function returns 0 if and only if no valid bitmap is found. +// Otherwise, it returns how many bytes are occupied. +// +size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { + size_t bytestotal = sizeof(int32_t);// for cookie + if(bytestotal > maxbytes) return 0; + uint32_t cookie; + memcpy(&cookie, buf, sizeof(int32_t)); + buf += sizeof(uint32_t); + if ((cookie & 0xFFFF) != SERIAL_COOKIE && + cookie != SERIAL_COOKIE_NO_RUNCONTAINER) { + return 0; + } + int32_t size; + + if ((cookie & 0xFFFF) == SERIAL_COOKIE) + size = (cookie >> 16) + 1; + else { + bytestotal += sizeof(int32_t); + if(bytestotal > maxbytes) return 0; + memcpy(&size, buf, sizeof(int32_t)); + buf += sizeof(uint32_t); + } + if (size > (1<<16)) { + return 0; // logically impossible + } + char *bitmapOfRunContainers = NULL; + bool hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE; + if (hasrun) { + int32_t s = (size + 7) / 8; + bytestotal += s; + if(bytestotal > maxbytes) return 0; + bitmapOfRunContainers = (char *)buf; + buf += s; + } + bytestotal += size * 2 * sizeof(uint16_t); + if(bytestotal > maxbytes) return 0; + uint16_t *keyscards = (uint16_t *)buf; + buf += size * 2 * sizeof(uint16_t); + if ((!hasrun) || (size >= NO_OFFSET_THRESHOLD)) { + // skipping the offsets + bytestotal += size * 4; + if(bytestotal > maxbytes) return 0; + buf += size * 4; + } + // Reading the containers + for (int32_t k = 0; k < size; ++k) { + uint16_t tmp; + memcpy(&tmp, keyscards + 2*k+1, sizeof(tmp)); + uint32_t thiscard = tmp + 1; + bool isbitmap = (thiscard > DEFAULT_MAX_SIZE); + bool isrun = false; + if(hasrun) { + if((bitmapOfRunContainers[k / 8] & (1 << (k % 8))) != 0) { + isbitmap = false; + isrun = true; + } + } + if (isbitmap) { + size_t containersize = BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + bytestotal += containersize; + if(bytestotal > maxbytes) return 0; + buf += containersize; + } else if (isrun) { + bytestotal += sizeof(uint16_t); + if(bytestotal > maxbytes) return 0; + uint16_t n_runs; + memcpy(&n_runs, buf, sizeof(uint16_t)); + buf += sizeof(uint16_t); + size_t containersize = n_runs * sizeof(rle16_t); + bytestotal += containersize; + if(bytestotal > maxbytes) return 0; + buf += containersize; + } else { + size_t containersize = thiscard * sizeof(uint16_t); + bytestotal += containersize; + if(bytestotal > maxbytes) return 0; + buf += containersize; + } + } + return bytestotal; +} + + +// this function populates answer from the content of buf (reading up to maxbytes bytes). +// The function returns false if a properly serialized bitmap cannot be found. +// if it returns true, readbytes is populated by how many bytes were read, we have that *readbytes <= maxbytes. +bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, const size_t maxbytes, size_t * readbytes) { + *readbytes = sizeof(int32_t);// for cookie + if(*readbytes > maxbytes) { + fprintf(stderr, "Ran out of bytes while reading first 4 bytes.\n"); + return false; + } + uint32_t cookie; + memcpy(&cookie, buf, sizeof(int32_t)); + buf += sizeof(uint32_t); + if ((cookie & 0xFFFF) != SERIAL_COOKIE && + cookie != SERIAL_COOKIE_NO_RUNCONTAINER) { + fprintf(stderr, "I failed to find one of the right cookies. Found %" PRIu32 "\n", + cookie); + return false; + } + int32_t size; + + if ((cookie & 0xFFFF) == SERIAL_COOKIE) + size = (cookie >> 16) + 1; + else { + *readbytes += sizeof(int32_t); + if(*readbytes > maxbytes) { + fprintf(stderr, "Ran out of bytes while reading second part of the cookie.\n"); + return false; + } + memcpy(&size, buf, sizeof(int32_t)); + buf += sizeof(uint32_t); + } + if (size < 0) { + fprintf(stderr, "You cannot have a negative number of containers, the data must be corrupted: %" PRId32 "\n", + size); + return false; // logically impossible + } + if (size > (1<<16)) { + fprintf(stderr, "You cannot have so many containers, the data must be corrupted: %" PRId32 "\n", + size); + return false; // logically impossible + } + const char *bitmapOfRunContainers = NULL; + bool hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE; + if (hasrun) { + int32_t s = (size + 7) / 8; + *readbytes += s; + if(*readbytes > maxbytes) {// data is corrupted? + fprintf(stderr, "Ran out of bytes while reading run bitmap.\n"); + return false; + } + bitmapOfRunContainers = buf; + buf += s; + } + uint16_t *keyscards = (uint16_t *)buf; + + *readbytes += size * 2 * sizeof(uint16_t); + if(*readbytes > maxbytes) { + fprintf(stderr, "Ran out of bytes while reading key-cardinality array.\n"); + return false; + } + buf += size * 2 * sizeof(uint16_t); + + bool is_ok = ra_init_with_capacity(answer, size); + if (!is_ok) { + fprintf(stderr, "Failed to allocate memory for roaring array. Bailing out.\n"); + return false; + } + + for (int32_t k = 0; k < size; ++k) { + uint16_t tmp; + memcpy(&tmp, keyscards + 2*k, sizeof(tmp)); + answer->keys[k] = tmp; + } + if ((!hasrun) || (size >= NO_OFFSET_THRESHOLD)) { + *readbytes += size * 4; + if(*readbytes > maxbytes) {// data is corrupted? + fprintf(stderr, "Ran out of bytes while reading offsets.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + + // skipping the offsets + buf += size * 4; + } + // Reading the containers + for (int32_t k = 0; k < size; ++k) { + uint16_t tmp; + memcpy(&tmp, keyscards + 2*k+1, sizeof(tmp)); + uint32_t thiscard = tmp + 1; + bool isbitmap = (thiscard > DEFAULT_MAX_SIZE); + bool isrun = false; + if(hasrun) { + if((bitmapOfRunContainers[k / 8] & (1 << (k % 8))) != 0) { + isbitmap = false; + isrun = true; + } + } + if (isbitmap) { + // we check that the read is allowed + size_t containersize = BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t); + *readbytes += containersize; + if(*readbytes > maxbytes) { + fprintf(stderr, "Running out of bytes while reading a bitset container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + // it is now safe to read + bitset_container_t *c = bitset_container_create(); + if(c == NULL) {// memory allocation failure + fprintf(stderr, "Failed to allocate memory for a bitset container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + answer->size++; + buf += bitset_container_read(thiscard, c, buf); + answer->containers[k] = c; + answer->typecodes[k] = BITSET_CONTAINER_TYPE; + } else if (isrun) { + // we check that the read is allowed + *readbytes += sizeof(uint16_t); + if(*readbytes > maxbytes) { + fprintf(stderr, "Running out of bytes while reading a run container (header).\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + uint16_t n_runs; + memcpy(&n_runs, buf, sizeof(uint16_t)); + size_t containersize = n_runs * sizeof(rle16_t); + *readbytes += containersize; + if(*readbytes > maxbytes) {// data is corrupted? + fprintf(stderr, "Running out of bytes while reading a run container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + // it is now safe to read + + run_container_t *c = run_container_create(); + if(c == NULL) {// memory allocation failure + fprintf(stderr, "Failed to allocate memory for a run container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + answer->size++; + buf += run_container_read(thiscard, c, buf); + answer->containers[k] = c; + answer->typecodes[k] = RUN_CONTAINER_TYPE; + } else { + // we check that the read is allowed + size_t containersize = thiscard * sizeof(uint16_t); + *readbytes += containersize; + if(*readbytes > maxbytes) {// data is corrupted? + fprintf(stderr, "Running out of bytes while reading an array container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + // it is now safe to read + array_container_t *c = + array_container_create_given_capacity(thiscard); + if(c == NULL) {// memory allocation failure + fprintf(stderr, "Failed to allocate memory for an array container.\n"); + ra_clear(answer);// we need to clear the containers already allocated, and the roaring array + return false; + } + answer->size++; + buf += array_container_read(thiscard, c, buf); + answer->containers[k] = c; + answer->typecodes[k] = ARRAY_CONTAINER_TYPE; + } + } + return true; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace internal { +#endif +/* end file src/roaring_array.c */ +/* begin file src/roaring_priority_queue.c */ + + +#ifdef __cplusplus +using namespace ::roaring::internal; + +extern "C" { namespace roaring { namespace api { +#endif + +struct roaring_pq_element_s { + uint64_t size; + bool is_temporary; + roaring_bitmap_t *bitmap; +}; + +typedef struct roaring_pq_element_s roaring_pq_element_t; + +struct roaring_pq_s { + roaring_pq_element_t *elements; + uint64_t size; +}; + +typedef struct roaring_pq_s roaring_pq_t; + +static inline bool compare(roaring_pq_element_t *t1, roaring_pq_element_t *t2) { + return t1->size < t2->size; +} + +static void pq_add(roaring_pq_t *pq, roaring_pq_element_t *t) { + uint64_t i = pq->size; + pq->elements[pq->size++] = *t; + while (i > 0) { + uint64_t p = (i - 1) >> 1; + roaring_pq_element_t ap = pq->elements[p]; + if (!compare(t, &ap)) break; + pq->elements[i] = ap; + i = p; + } + pq->elements[i] = *t; +} + +static void pq_free(roaring_pq_t *pq) { + roaring_free(pq); +} + +static void percolate_down(roaring_pq_t *pq, uint32_t i) { + uint32_t size = (uint32_t)pq->size; + uint32_t hsize = size >> 1; + roaring_pq_element_t ai = pq->elements[i]; + while (i < hsize) { + uint32_t l = (i << 1) + 1; + uint32_t r = l + 1; + roaring_pq_element_t bestc = pq->elements[l]; + if (r < size) { + if (compare(pq->elements + r, &bestc)) { + l = r; + bestc = pq->elements[r]; + } + } + if (!compare(&bestc, &ai)) { + break; + } + pq->elements[i] = bestc; + i = l; + } + pq->elements[i] = ai; +} + +static roaring_pq_t *create_pq(const roaring_bitmap_t **arr, uint32_t length) { + size_t alloc_size = sizeof(roaring_pq_t) + sizeof(roaring_pq_element_t) * length; + roaring_pq_t *answer = (roaring_pq_t *)roaring_malloc(alloc_size); + answer->elements = (roaring_pq_element_t *)(answer + 1); + answer->size = length; + for (uint32_t i = 0; i < length; i++) { + answer->elements[i].bitmap = (roaring_bitmap_t *)arr[i]; + answer->elements[i].is_temporary = false; + answer->elements[i].size = + roaring_bitmap_portable_size_in_bytes(arr[i]); + } + for (int32_t i = (length >> 1); i >= 0; i--) { + percolate_down(answer, i); + } + return answer; +} + +static roaring_pq_element_t pq_poll(roaring_pq_t *pq) { + roaring_pq_element_t ans = *pq->elements; + if (pq->size > 1) { + pq->elements[0] = pq->elements[--pq->size]; + percolate_down(pq, 0); + } else + --pq->size; + // memmove(pq->elements,pq->elements+1,(pq->size-1)*sizeof(roaring_pq_element_t));--pq->size; + return ans; +} + +// this function consumes and frees the inputs +static roaring_bitmap_t *lazy_or_from_lazy_inputs(roaring_bitmap_t *x1, + roaring_bitmap_t *x2) { + uint8_t result_type = 0; + const int length1 = ra_get_size(&x1->high_low_container), + length2 = ra_get_size(&x2->high_low_container); + if (0 == length1) { + roaring_bitmap_free(x1); + return x2; + } + if (0 == length2) { + roaring_bitmap_free(x2); + return x1; + } + uint32_t neededcap = length1 > length2 ? length2 : length1; + roaring_bitmap_t *answer = roaring_bitmap_create_with_capacity(neededcap); + int pos1 = 0, pos2 = 0; + uint8_t type1, type2; + uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + uint16_t s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + while (true) { + if (s1 == s2) { + // todo: unsharing can be inefficient as it may create a clone where + // none + // is needed, but it has the benefit of being easy to reason about. + + ra_unshare_container_at_index(&x1->high_low_container, pos1); + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + assert(type1 != SHARED_CONTAINER_TYPE); + + ra_unshare_container_at_index(&x2->high_low_container, pos2); + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + assert(type2 != SHARED_CONTAINER_TYPE); + + container_t *c; + + if ((type2 == BITSET_CONTAINER_TYPE) && + (type1 != BITSET_CONTAINER_TYPE) + ){ + c = container_lazy_ior(c2, type2, c1, type1, &result_type); + container_free(c1, type1); + if (c != c2) { + container_free(c2, type2); + } + } else { + c = container_lazy_ior(c1, type1, c2, type2, &result_type); + container_free(c2, type2); + if (c != c1) { + container_free(c1, type1); + } + } + // since we assume that the initial containers are non-empty, the + // result here + // can only be non-empty + ra_append(&answer->high_low_container, s1, c, result_type); + ++pos1; + ++pos2; + if (pos1 == length1) break; + if (pos2 == length2) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + + } else if (s1 < s2) { // s1 < s2 + container_t *c1 = ra_get_container_at_index( + &x1->high_low_container, pos1, &type1); + ra_append(&answer->high_low_container, s1, c1, type1); + pos1++; + if (pos1 == length1) break; + s1 = ra_get_key_at_index(&x1->high_low_container, pos1); + + } else { // s1 > s2 + container_t *c2 = ra_get_container_at_index( + &x2->high_low_container, pos2, &type2); + ra_append(&answer->high_low_container, s2, c2, type2); + pos2++; + if (pos2 == length2) break; + s2 = ra_get_key_at_index(&x2->high_low_container, pos2); + } + } + if (pos1 == length1) { + ra_append_move_range(&answer->high_low_container, + &x2->high_low_container, pos2, length2); + } else if (pos2 == length2) { + ra_append_move_range(&answer->high_low_container, + &x1->high_low_container, pos1, length1); + } + ra_clear_without_containers(&x1->high_low_container); + ra_clear_without_containers(&x2->high_low_container); + roaring_free(x1); + roaring_free(x2); + return answer; +} + +/** + * Compute the union of 'number' bitmaps using a heap. This can + * sometimes be faster than roaring_bitmap_or_many which uses + * a naive algorithm. Caller is responsible for freeing the + * result. + */ +roaring_bitmap_t *roaring_bitmap_or_many_heap(uint32_t number, + const roaring_bitmap_t **x) { + if (number == 0) { + return roaring_bitmap_create(); + } + if (number == 1) { + return roaring_bitmap_copy(x[0]); + } + roaring_pq_t *pq = create_pq(x, number); + while (pq->size > 1) { + roaring_pq_element_t x1 = pq_poll(pq); + roaring_pq_element_t x2 = pq_poll(pq); + + if (x1.is_temporary && x2.is_temporary) { + roaring_bitmap_t *newb = + lazy_or_from_lazy_inputs(x1.bitmap, x2.bitmap); + // should normally return a fresh new bitmap *except* that + // it can return x1.bitmap or x2.bitmap in degenerate cases + bool temporary = !((newb == x1.bitmap) && (newb == x2.bitmap)); + uint64_t bsize = roaring_bitmap_portable_size_in_bytes(newb); + roaring_pq_element_t newelement = { + .size = bsize, .is_temporary = temporary, .bitmap = newb}; + pq_add(pq, &newelement); + } else if (x2.is_temporary) { + roaring_bitmap_lazy_or_inplace(x2.bitmap, x1.bitmap, false); + x2.size = roaring_bitmap_portable_size_in_bytes(x2.bitmap); + pq_add(pq, &x2); + } else if (x1.is_temporary) { + roaring_bitmap_lazy_or_inplace(x1.bitmap, x2.bitmap, false); + x1.size = roaring_bitmap_portable_size_in_bytes(x1.bitmap); + + pq_add(pq, &x1); + } else { + roaring_bitmap_t *newb = + roaring_bitmap_lazy_or(x1.bitmap, x2.bitmap, false); + uint64_t bsize = roaring_bitmap_portable_size_in_bytes(newb); + roaring_pq_element_t newelement = { + .size = bsize, .is_temporary = true, .bitmap = newb}; + + pq_add(pq, &newelement); + } + } + roaring_pq_element_t X = pq_poll(pq); + roaring_bitmap_t *answer = X.bitmap; + roaring_bitmap_repair_after_lazy(answer); + pq_free(pq); + return answer; +} + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace api { +#endif +/* end file src/roaring_priority_queue.c */ diff --git a/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.h b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.h new file mode 100644 index 00000000000..970682b74de --- /dev/null +++ b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.h @@ -0,0 +1,1088 @@ +// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! +// Created by amalgamation.sh on Sun 18 Sep 2022 02:41:22 PM EDT + +/* + * The CRoaring project is under a dual license (Apache/MIT). + * Users of the library may choose one or the other license. + */ +/* + * Copyright 2016-2022 The CRoaring authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* + * MIT License + * + * Copyright 2016-2022 The CRoaring authors + * + * Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the + * Software without restriction, including without + * limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software + * is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice + * shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + +/* begin file include/roaring/roaring_version.h */ +// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand +#ifndef ROARING_INCLUDE_ROARING_VERSION +#define ROARING_INCLUDE_ROARING_VERSION +#define ROARING_VERSION "0.7.1" +enum { + ROARING_VERSION_MAJOR = 0, + ROARING_VERSION_MINOR = 7, + ROARING_VERSION_REVISION = 1 +}; +#endif // ROARING_INCLUDE_ROARING_VERSION +/* end file include/roaring/roaring_version.h */ +/* begin file include/roaring/roaring_types.h */ +/* + Typedefs used by various components +*/ + +#ifndef ROARING_TYPES_H +#define ROARING_TYPES_H + +#include +#include + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace api { +#endif + + +/** + * When building .c files as C++, there's added compile-time checking if the + * container types are derived from a `container_t` base class. So long as + * such a base class is empty, the struct will behave compatibly with C structs + * despite the derivation. This is due to the Empty Base Class Optimization: + * + * https://en.cppreference.com/w/cpp/language/ebo + * + * But since C isn't namespaced, taking `container_t` globally might collide + * with other projects. So roaring.h uses ROARING_CONTAINER_T, while internal + * code #undefs that after declaring `typedef ROARING_CONTAINER_T container_t;` + */ +#if defined(__cplusplus) + extern "C++" { + struct container_s {}; + } + #define ROARING_CONTAINER_T ::roaring::api::container_s +#else + #define ROARING_CONTAINER_T void // no compile-time checking +#endif + +#define ROARING_FLAG_COW UINT8_C(0x1) +#define ROARING_FLAG_FROZEN UINT8_C(0x2) + +/** + * Roaring arrays are array-based key-value pairs having containers as values + * and 16-bit integer keys. A roaring bitmap might be implemented as such. + */ + +// parallel arrays. Element sizes quite different. +// Alternative is array +// of structs. Which would have better +// cache performance through binary searches? + +typedef struct roaring_array_s { + int32_t size; + int32_t allocation_size; + ROARING_CONTAINER_T **containers; // Use container_t in non-API files! + uint16_t *keys; + uint8_t *typecodes; + uint8_t flags; +} roaring_array_t; + + +typedef bool (*roaring_iterator)(uint32_t value, void *param); +typedef bool (*roaring_iterator64)(uint64_t value, void *param); + +/** +* (For advanced users.) +* The roaring_statistics_t can be used to collect detailed statistics about +* the composition of a roaring bitmap. +*/ +typedef struct roaring_statistics_s { + uint32_t n_containers; /* number of containers */ + + uint32_t n_array_containers; /* number of array containers */ + uint32_t n_run_containers; /* number of run containers */ + uint32_t n_bitset_containers; /* number of bitmap containers */ + + uint32_t + n_values_array_containers; /* number of values in array containers */ + uint32_t n_values_run_containers; /* number of values in run containers */ + uint32_t + n_values_bitset_containers; /* number of values in bitmap containers */ + + uint32_t n_bytes_array_containers; /* number of allocated bytes in array + containers */ + uint32_t n_bytes_run_containers; /* number of allocated bytes in run + containers */ + uint32_t n_bytes_bitset_containers; /* number of allocated bytes in bitmap + containers */ + + uint32_t + max_value; /* the maximal value, undefined if cardinality is zero */ + uint32_t + min_value; /* the minimal value, undefined if cardinality is zero */ + uint64_t sum_value; /* the sum of all values (could be used to compute + average) */ + + uint64_t cardinality; /* total number of values stored in the bitmap */ + + // and n_values_arrays, n_values_rle, n_values_bitmap +} roaring_statistics_t; + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace api { +#endif + +#endif /* ROARING_TYPES_H */ +/* end file include/roaring/roaring_types.h */ +/* begin file include/roaring/roaring.h */ +/* + * An implementation of Roaring Bitmaps in C. + */ + +#ifndef ROARING_H +#define ROARING_H + +#include +#include +#include // for `size_t` + + +#ifdef __cplusplus +extern "C" { namespace roaring { namespace api { +#endif + +typedef struct roaring_bitmap_s { + roaring_array_t high_low_container; +} roaring_bitmap_t; + +/** + * Dynamically allocates a new bitmap (initially empty). + * Returns NULL if the allocation fails. + * Capacity is a performance hint for how many "containers" the data will need. + * Client is responsible for calling `roaring_bitmap_free()`. + */ +roaring_bitmap_t *roaring_bitmap_create_with_capacity(uint32_t cap); + +/** + * Dynamically allocates a new bitmap (initially empty). + * Returns NULL if the allocation fails. + * Client is responsible for calling `roaring_bitmap_free()`. + */ +static inline roaring_bitmap_t *roaring_bitmap_create(void) + { return roaring_bitmap_create_with_capacity(0); } + +/** + * Initialize a roaring bitmap structure in memory controlled by client. + * Capacity is a performance hint for how many "containers" the data will need. + * Can return false if auxiliary allocations fail when capacity greater than 0. + */ +bool roaring_bitmap_init_with_capacity(roaring_bitmap_t *r, uint32_t cap); + +/** + * Initialize a roaring bitmap structure in memory controlled by client. + * The bitmap will be in a "clear" state, with no auxiliary allocations. + * Since this performs no allocations, the function will not fail. + */ +static inline void roaring_bitmap_init_cleared(roaring_bitmap_t *r) + { roaring_bitmap_init_with_capacity(r, 0); } + +/** + * Add all the values between min (included) and max (excluded) that are at a + * distance k*step from min. +*/ +roaring_bitmap_t *roaring_bitmap_from_range(uint64_t min, uint64_t max, + uint32_t step); + +/** + * Creates a new bitmap from a pointer of uint32_t integers + */ +roaring_bitmap_t *roaring_bitmap_of_ptr(size_t n_args, const uint32_t *vals); + +/* + * Whether you want to use copy-on-write. + * Saves memory and avoids copies, but needs more care in a threaded context. + * Most users should ignore this flag. + * + * Note: If you do turn this flag to 'true', enabling COW, then ensure that you + * do so for all of your bitmaps, since interactions between bitmaps with and + * without COW is unsafe. + */ +static inline bool roaring_bitmap_get_copy_on_write(const roaring_bitmap_t* r) { + return r->high_low_container.flags & ROARING_FLAG_COW; +} +static inline void roaring_bitmap_set_copy_on_write(roaring_bitmap_t* r, + bool cow) { + if (cow) { + r->high_low_container.flags |= ROARING_FLAG_COW; + } else { + r->high_low_container.flags &= ~ROARING_FLAG_COW; + } +} + +roaring_bitmap_t *roaring_bitmap_add_offset(const roaring_bitmap_t *bm, + int64_t offset); +/** + * Describe the inner structure of the bitmap. + */ +void roaring_bitmap_printf_describe(const roaring_bitmap_t *r); + +/** + * Creates a new bitmap from a list of uint32_t integers + */ +roaring_bitmap_t *roaring_bitmap_of(size_t n, ...); + +/** + * Copies a bitmap (this does memory allocation). + * The caller is responsible for memory management. + */ +roaring_bitmap_t *roaring_bitmap_copy(const roaring_bitmap_t *r); + +/** + * Copies a bitmap from src to dest. It is assumed that the pointer dest + * is to an already allocated bitmap. The content of the dest bitmap is + * freed/deleted. + * + * It might be preferable and simpler to call roaring_bitmap_copy except + * that roaring_bitmap_overwrite can save on memory allocations. + */ +bool roaring_bitmap_overwrite(roaring_bitmap_t *dest, + const roaring_bitmap_t *src); + +/** + * Print the content of the bitmap. + */ +void roaring_bitmap_printf(const roaring_bitmap_t *r); + +/** + * Computes the intersection between two bitmaps and returns new bitmap. The + * caller is responsible for memory management. + */ +roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Computes the size of the intersection between two bitmaps. + */ +uint64_t roaring_bitmap_and_cardinality(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Check whether two bitmaps intersect. + */ +bool roaring_bitmap_intersect(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Check whether a bitmap and a closed range intersect. + */ +bool roaring_bitmap_intersect_with_range(const roaring_bitmap_t *bm, + uint64_t x, uint64_t y); + +/** + * Computes the Jaccard index between two bitmaps. (Also known as the Tanimoto + * distance, or the Jaccard similarity coefficient) + * + * The Jaccard index is undefined if both bitmaps are empty. + */ +double roaring_bitmap_jaccard_index(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Computes the size of the union between two bitmaps. + */ +uint64_t roaring_bitmap_or_cardinality(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Computes the size of the difference (andnot) between two bitmaps. + */ +uint64_t roaring_bitmap_andnot_cardinality(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Computes the size of the symmetric difference (xor) between two bitmaps. + */ +uint64_t roaring_bitmap_xor_cardinality(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Inplace version of `roaring_bitmap_and()`, modifies r1 + * r1 == r2 is allowed + */ +void roaring_bitmap_and_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Computes the union between two bitmaps and returns new bitmap. The caller is + * responsible for memory management. + */ +roaring_bitmap_t *roaring_bitmap_or(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Inplace version of `roaring_bitmap_or(), modifies r1. + * TODO: decide whether r1 == r2 ok + */ +void roaring_bitmap_or_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Compute the union of 'number' bitmaps. + * Caller is responsible for freeing the result. + * See also `roaring_bitmap_or_many_heap()` + */ +roaring_bitmap_t *roaring_bitmap_or_many(size_t number, + const roaring_bitmap_t **rs); + +/** + * Compute the union of 'number' bitmaps using a heap. This can sometimes be + * faster than `roaring_bitmap_or_many() which uses a naive algorithm. + * Caller is responsible for freeing the result. + */ +roaring_bitmap_t *roaring_bitmap_or_many_heap(uint32_t number, + const roaring_bitmap_t **rs); + +/** + * Computes the symmetric difference (xor) between two bitmaps + * and returns new bitmap. The caller is responsible for memory management. + */ +roaring_bitmap_t *roaring_bitmap_xor(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Inplace version of roaring_bitmap_xor, modifies r1, r1 != r2. + */ +void roaring_bitmap_xor_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Compute the xor of 'number' bitmaps. + * Caller is responsible for freeing the result. + */ +roaring_bitmap_t *roaring_bitmap_xor_many(size_t number, + const roaring_bitmap_t **rs); + +/** + * Computes the difference (andnot) between two bitmaps and returns new bitmap. + * Caller is responsible for freeing the result. + */ +roaring_bitmap_t *roaring_bitmap_andnot(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Inplace version of roaring_bitmap_andnot, modifies r1, r1 != r2. + */ +void roaring_bitmap_andnot_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * TODO: consider implementing: + * + * "Compute the xor of 'number' bitmaps using a heap. This can sometimes be + * faster than roaring_bitmap_xor_many which uses a naive algorithm. Caller is + * responsible for freeing the result."" + * + * roaring_bitmap_t *roaring_bitmap_xor_many_heap(uint32_t number, + * const roaring_bitmap_t **rs); + */ + +/** + * Frees the memory. + */ +void roaring_bitmap_free(const roaring_bitmap_t *r); + +/** + * A bit of context usable with `roaring_bitmap_*_bulk()` functions + * + * Should be initialized with `{0}` (or `memset()` to all zeros). + * Callers should treat it as an opaque type. + * + * A context may only be used with a single bitmap + * (unless re-initialized to zero), and any modification to a bitmap + * (other than modifications performed with `_bulk()` functions with the context + * passed) will invalidate any contexts associated with that bitmap. + */ +typedef struct roaring_bulk_context_s { + ROARING_CONTAINER_T *container; + int idx; + uint16_t key; + uint8_t typecode; +} roaring_bulk_context_t; + +/** + * Add an item, using context from a previous insert for speed optimization. + * + * `context` will be used to store information between calls to make bulk + * operations faster. `*context` should be zero-initialized before the first + * call to this function. + * + * Modifying the bitmap in any way (other than `-bulk` suffixed functions) + * will invalidate the stored context, calling this function with a non-zero + * context after doing any modification invokes undefined behavior. + * + * In order to exploit this optimization, the caller should call this function + * with values with the same "key" (high 16 bits of the value) consecutively. + */ +void roaring_bitmap_add_bulk(roaring_bitmap_t *r, + roaring_bulk_context_t *context, uint32_t val); + +/** + * Add value n_args from pointer vals, faster than repeatedly calling + * `roaring_bitmap_add()` + * + * In order to exploit this optimization, the caller should attempt to keep + * values with the same "key" (high 16 bits of the value) as consecutive + * elements in `vals` + */ +void roaring_bitmap_add_many(roaring_bitmap_t *r, size_t n_args, + const uint32_t *vals); + +/** + * Add value x + */ +void roaring_bitmap_add(roaring_bitmap_t *r, uint32_t x); + +/** + * Add value x + * Returns true if a new value was added, false if the value already existed. + */ +bool roaring_bitmap_add_checked(roaring_bitmap_t *r, uint32_t x); + +/** + * Add all values in range [min, max] + */ +void roaring_bitmap_add_range_closed(roaring_bitmap_t *r, + uint32_t min, uint32_t max); + +/** + * Add all values in range [min, max) + */ +static inline void roaring_bitmap_add_range(roaring_bitmap_t *r, + uint64_t min, uint64_t max) { + if(max == min) return; + roaring_bitmap_add_range_closed(r, (uint32_t)min, (uint32_t)(max - 1)); +} + +/** + * Remove value x + */ +void roaring_bitmap_remove(roaring_bitmap_t *r, uint32_t x); + +/** + * Remove all values in range [min, max] + */ +void roaring_bitmap_remove_range_closed(roaring_bitmap_t *r, + uint32_t min, uint32_t max); + +/** + * Remove all values in range [min, max) + */ +static inline void roaring_bitmap_remove_range(roaring_bitmap_t *r, + uint64_t min, uint64_t max) { + if(max == min) return; + roaring_bitmap_remove_range_closed(r, (uint32_t)min, (uint32_t)(max - 1)); +} + +/** + * Remove multiple values + */ +void roaring_bitmap_remove_many(roaring_bitmap_t *r, size_t n_args, + const uint32_t *vals); + +/** + * Remove value x + * Returns true if a new value was removed, false if the value was not existing. + */ +bool roaring_bitmap_remove_checked(roaring_bitmap_t *r, uint32_t x); + +/** + * Check if value is present + */ +bool roaring_bitmap_contains(const roaring_bitmap_t *r, uint32_t val); + +/** + * Check whether a range of values from range_start (included) + * to range_end (excluded) is present + */ +bool roaring_bitmap_contains_range(const roaring_bitmap_t *r, + uint64_t range_start, + uint64_t range_end); + +/** + * Check if an items is present, using context from a previous insert for speed + * optimization. + * + * `context` will be used to store information between calls to make bulk + * operations faster. `*context` should be zero-initialized before the first + * call to this function. + * + * Modifying the bitmap in any way (other than `-bulk` suffixed functions) + * will invalidate the stored context, calling this function with a non-zero + * context after doing any modification invokes undefined behavior. + * + * In order to exploit this optimization, the caller should call this function + * with values with the same "key" (high 16 bits of the value) consecutively. + */ +bool roaring_bitmap_contains_bulk(const roaring_bitmap_t *r, + roaring_bulk_context_t *context, + uint32_t val); + +/** + * Get the cardinality of the bitmap (number of elements). + */ +uint64_t roaring_bitmap_get_cardinality(const roaring_bitmap_t *r); + +/** + * Returns the number of elements in the range [range_start, range_end). + */ +uint64_t roaring_bitmap_range_cardinality(const roaring_bitmap_t *r, + uint64_t range_start, + uint64_t range_end); + +/** +* Returns true if the bitmap is empty (cardinality is zero). +*/ +bool roaring_bitmap_is_empty(const roaring_bitmap_t *r); + + +/** + * Empties the bitmap. It will have no auxiliary allocations (so if the bitmap + * was initialized in client memory via roaring_bitmap_init(), then a call to + * roaring_bitmap_clear() would be enough to "free" it) + */ +void roaring_bitmap_clear(roaring_bitmap_t *r); + +/** + * Convert the bitmap to a sorted array, output in `ans`. + * + * Caller is responsible to ensure that there is enough memory allocated, e.g. + * + * ans = malloc(roaring_bitmap_get_cardinality(bitmap) * sizeof(uint32_t)); + */ +void roaring_bitmap_to_uint32_array(const roaring_bitmap_t *r, uint32_t *ans); + + +/** + * Convert the bitmap to a sorted array from `offset` by `limit`, output in `ans`. + * + * Caller is responsible to ensure that there is enough memory allocated, e.g. + * + * ans = malloc(roaring_bitmap_get_cardinality(limit) * sizeof(uint32_t)); + * + * Return false in case of failure (e.g., insufficient memory) + */ +bool roaring_bitmap_range_uint32_array(const roaring_bitmap_t *r, + size_t offset, size_t limit, + uint32_t *ans); + +/** + * Remove run-length encoding even when it is more space efficient. + * Return whether a change was applied. + */ +bool roaring_bitmap_remove_run_compression(roaring_bitmap_t *r); + +/** + * Convert array and bitmap containers to run containers when it is more + * efficient; also convert from run containers when more space efficient. + * + * Returns true if the result has at least one run container. + * Additional savings might be possible by calling `shrinkToFit()`. + */ +bool roaring_bitmap_run_optimize(roaring_bitmap_t *r); + +/** + * If needed, reallocate memory to shrink the memory usage. + * Returns the number of bytes saved. + */ +size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r); + +/** + * Write the bitmap to an output pointer, this output buffer should refer to + * at least `roaring_bitmap_size_in_bytes(r)` allocated bytes. + * + * See `roaring_bitmap_portable_serialize()` if you want a format that's + * compatible with Java and Go implementations. This format can sometimes be + * more space efficient than the portable form, e.g. when the data is sparse. + * + * Returns how many bytes written, should be `roaring_bitmap_size_in_bytes(r)`. + */ +size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf); + +/** + * Use with `roaring_bitmap_serialize()`. + * + * (See `roaring_bitmap_portable_deserialize()` if you want a format that's + * compatible with Java and Go implementations) + */ +roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf); + +/** + * How many bytes are required to serialize this bitmap (NOT compatible + * with Java and Go versions) + */ +size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r); + +/** + * Read bitmap from a serialized buffer. + * In case of failure, NULL is returned. + * + * This function is unsafe in the sense that if there is no valid serialized + * bitmap at the pointer, then many bytes could be read, possibly causing a + * buffer overflow. See also roaring_bitmap_portable_deserialize_safe(). + * + * This is meant to be compatible with the Java and Go versions: + * https://github.com/RoaringBitmap/RoaringFormatSpec + */ +roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf); + +/** + * Read bitmap from a serialized buffer safely (reading up to maxbytes). + * In case of failure, NULL is returned. + * + * This is meant to be compatible with the Java and Go versions: + * https://github.com/RoaringBitmap/RoaringFormatSpec + */ +roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf, + size_t maxbytes); + +/** + * Check how many bytes would be read (up to maxbytes) at this pointer if there + * is a bitmap, returns zero if there is no valid bitmap. + * + * This is meant to be compatible with the Java and Go versions: + * https://github.com/RoaringBitmap/RoaringFormatSpec + */ +size_t roaring_bitmap_portable_deserialize_size(const char *buf, + size_t maxbytes); + +/** + * How many bytes are required to serialize this bitmap. + * + * This is meant to be compatible with the Java and Go versions: + * https://github.com/RoaringBitmap/RoaringFormatSpec + */ +size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r); + +/** + * Write a bitmap to a char buffer. The output buffer should refer to at least + * `roaring_bitmap_portable_size_in_bytes(r)` bytes of allocated memory. + * + * Returns how many bytes were written which should match + * `roaring_bitmap_portable_size_in_bytes(r)`. + * + * This is meant to be compatible with the Java and Go versions: + * https://github.com/RoaringBitmap/RoaringFormatSpec + */ +size_t roaring_bitmap_portable_serialize(const roaring_bitmap_t *r, char *buf); + +/* + * "Frozen" serialization format imitates memory layout of roaring_bitmap_t. + * Deserialized bitmap is a constant view of the underlying buffer. + * This significantly reduces amount of allocations and copying required during + * deserialization. + * It can be used with memory mapped files. + * Example can be found in benchmarks/frozen_benchmark.c + * + * [#####] const roaring_bitmap_t * + * | | | + * +----+ | +-+ + * | | | + * [#####################################] underlying buffer + * + * Note that because frozen serialization format imitates C memory layout + * of roaring_bitmap_t, it is not fixed. It is different on big/little endian + * platforms and can be changed in future. + */ + +/** + * Returns number of bytes required to serialize bitmap using frozen format. + */ +size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *r); + +/** + * Serializes bitmap using frozen format. + * Buffer size must be at least roaring_bitmap_frozen_size_in_bytes(). + */ +void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf); + +/** + * Creates constant bitmap that is a view of a given buffer. + * Buffer data should have been written by `roaring_bitmap_frozen_serialize()` + * Its beginning must also be aligned by 32 bytes. + * Length must be equal exactly to `roaring_bitmap_frozen_size_in_bytes()`. + * In case of failure, NULL is returned. + * + * Bitmap returned by this function can be used in all readonly contexts. + * Bitmap must be freed as usual, by calling roaring_bitmap_free(). + * Underlying buffer must not be freed or modified while it backs any bitmaps. + */ +const roaring_bitmap_t *roaring_bitmap_frozen_view(const char *buf, + size_t length); + +/** + * Iterate over the bitmap elements. The function iterator is called once for + * all the values with ptr (can be NULL) as the second parameter of each call. + * + * `roaring_iterator` is simply a pointer to a function that returns bool + * (true means that the iteration should continue while false means that it + * should stop), and takes (uint32_t,void*) as inputs. + * + * Returns true if the roaring_iterator returned true throughout (so that all + * data points were necessarily visited). + * + * Iteration is ordered: from the smallest to the largest elements. + */ +bool roaring_iterate(const roaring_bitmap_t *r, roaring_iterator iterator, + void *ptr); + +bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator, + uint64_t high_bits, void *ptr); + +/** + * Return true if the two bitmaps contain the same elements. + */ +bool roaring_bitmap_equals(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Return true if all the elements of r1 are also in r2. + */ +bool roaring_bitmap_is_subset(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Return true if all the elements of r1 are also in r2, and r2 is strictly + * greater than r1. + */ +bool roaring_bitmap_is_strict_subset(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * (For expert users who seek high performance.) + * + * Computes the union between two bitmaps and returns new bitmap. The caller is + * responsible for memory management. + * + * The lazy version defers some computations such as the maintenance of the + * cardinality counts. Thus you must call `roaring_bitmap_repair_after_lazy()` + * after executing "lazy" computations. + * + * It is safe to repeatedly call roaring_bitmap_lazy_or_inplace on the result. + * + * `bitsetconversion` is a flag which determines whether container-container + * operations force a bitset conversion. + */ +roaring_bitmap_t *roaring_bitmap_lazy_or(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2, + const bool bitsetconversion); + +/** + * (For expert users who seek high performance.) + * + * Inplace version of roaring_bitmap_lazy_or, modifies r1. + * + * `bitsetconversion` is a flag which determines whether container-container + * operations force a bitset conversion. + */ +void roaring_bitmap_lazy_or_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2, + const bool bitsetconversion); + +/** + * (For expert users who seek high performance.) + * + * Execute maintenance on a bitmap created from `roaring_bitmap_lazy_or()` + * or modified with `roaring_bitmap_lazy_or_inplace()`. + */ +void roaring_bitmap_repair_after_lazy(roaring_bitmap_t *r1); + +/** + * Computes the symmetric difference between two bitmaps and returns new bitmap. + * The caller is responsible for memory management. + * + * The lazy version defers some computations such as the maintenance of the + * cardinality counts. Thus you must call `roaring_bitmap_repair_after_lazy()` + * after executing "lazy" computations. + * + * It is safe to repeatedly call `roaring_bitmap_lazy_xor_inplace()` on + * the result. + */ +roaring_bitmap_t *roaring_bitmap_lazy_xor(const roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * (For expert users who seek high performance.) + * + * Inplace version of roaring_bitmap_lazy_xor, modifies r1. r1 != r2 + */ +void roaring_bitmap_lazy_xor_inplace(roaring_bitmap_t *r1, + const roaring_bitmap_t *r2); + +/** + * Compute the negation of the bitmap in the interval [range_start, range_end). + * The number of negated values is range_end - range_start. + * Areas outside the range are passed through unchanged. + */ +roaring_bitmap_t *roaring_bitmap_flip(const roaring_bitmap_t *r1, + uint64_t range_start, uint64_t range_end); + +/** + * compute (in place) the negation of the roaring bitmap within a specified + * interval: [range_start, range_end). The number of negated values is + * range_end - range_start. + * Areas outside the range are passed through unchanged. + */ +void roaring_bitmap_flip_inplace(roaring_bitmap_t *r1, uint64_t range_start, + uint64_t range_end); + +/** + * Selects the element at index 'rank' where the smallest element is at index 0. + * If the size of the roaring bitmap is strictly greater than rank, then this + * function returns true and sets element to the element of given rank. + * Otherwise, it returns false. + */ +bool roaring_bitmap_select(const roaring_bitmap_t *r, uint32_t rank, + uint32_t *element); + +/** + * roaring_bitmap_rank returns the number of integers that are smaller or equal + * to x. Thus if x is the first element, this function will return 1. If + * x is smaller than the smallest element, this function will return 0. + * + * The indexing convention differs between roaring_bitmap_select and + * roaring_bitmap_rank: roaring_bitmap_select refers to the smallest value + * as having index 0, whereas roaring_bitmap_rank returns 1 when ranking + * the smallest value. + */ +uint64_t roaring_bitmap_rank(const roaring_bitmap_t *r, uint32_t x); + +/** + * Returns the smallest value in the set, or UINT32_MAX if the set is empty. + */ +uint32_t roaring_bitmap_minimum(const roaring_bitmap_t *r); + +/** + * Returns the greatest value in the set, or 0 if the set is empty. + */ +uint32_t roaring_bitmap_maximum(const roaring_bitmap_t *r); + +/** + * (For advanced users.) + * + * Collect statistics about the bitmap, see roaring_types.h for + * a description of roaring_statistics_t + */ +void roaring_bitmap_statistics(const roaring_bitmap_t *r, + roaring_statistics_t *stat); + +/********************* +* What follows is code use to iterate through values in a roaring bitmap + +roaring_bitmap_t *r =... +roaring_uint32_iterator_t i; +roaring_create_iterator(r, &i); +while(i.has_value) { + printf("value = %d\n", i.current_value); + roaring_advance_uint32_iterator(&i); +} + +Obviously, if you modify the underlying bitmap, the iterator +becomes invalid. So don't. +*/ + +typedef struct roaring_uint32_iterator_s { + const roaring_bitmap_t *parent; // owner + int32_t container_index; // point to the current container index + int32_t in_container_index; // for bitset and array container, this is out + // index + int32_t run_index; // for run container, this points at the run + + uint32_t current_value; + bool has_value; + + const ROARING_CONTAINER_T + *container; // should be: + // parent->high_low_container.containers[container_index]; + uint8_t typecode; // should be: + // parent->high_low_container.typecodes[container_index]; + uint32_t highbits; // should be: + // parent->high_low_container.keys[container_index]) << + // 16; + +} roaring_uint32_iterator_t; + +/** + * Initialize an iterator object that can be used to iterate through the + * values. If there is a value, then this iterator points to the first value + * and `it->has_value` is true. The value is in `it->current_value`. + */ +void roaring_init_iterator(const roaring_bitmap_t *r, + roaring_uint32_iterator_t *newit); + +/** + * Initialize an iterator object that can be used to iterate through the + * values. If there is a value, then this iterator points to the last value + * and `it->has_value` is true. The value is in `it->current_value`. + */ +void roaring_init_iterator_last(const roaring_bitmap_t *r, + roaring_uint32_iterator_t *newit); + +/** + * Create an iterator object that can be used to iterate through the values. + * Caller is responsible for calling `roaring_free_iterator()`. + * + * The iterator is initialized (this function calls `roaring_init_iterator()`) + * If there is a value, then this iterator points to the first value and + * `it->has_value` is true. The value is in `it->current_value`. + */ +roaring_uint32_iterator_t *roaring_create_iterator(const roaring_bitmap_t *r); + +/** +* Advance the iterator. If there is a new value, then `it->has_value` is true. +* The new value is in `it->current_value`. Values are traversed in increasing +* orders. For convenience, returns `it->has_value`. +*/ +bool roaring_advance_uint32_iterator(roaring_uint32_iterator_t *it); + +/** +* Decrement the iterator. If there's a new value, then `it->has_value` is true. +* The new value is in `it->current_value`. Values are traversed in decreasing +* order. For convenience, returns `it->has_value`. +*/ +bool roaring_previous_uint32_iterator(roaring_uint32_iterator_t *it); + +/** + * Move the iterator to the first value >= `val`. If there is a such a value, + * then `it->has_value` is true. The new value is in `it->current_value`. + * For convenience, returns `it->has_value`. + */ +bool roaring_move_uint32_iterator_equalorlarger(roaring_uint32_iterator_t *it, + uint32_t val); + +/** + * Creates a copy of an iterator. + * Caller must free it. + */ +roaring_uint32_iterator_t *roaring_copy_uint32_iterator( + const roaring_uint32_iterator_t *it); + +/** + * Free memory following `roaring_create_iterator()` + */ +void roaring_free_uint32_iterator(roaring_uint32_iterator_t *it); + +/* + * Reads next ${count} values from iterator into user-supplied ${buf}. + * Returns the number of read elements. + * This number can be smaller than ${count}, which means that iterator is drained. + * + * This function satisfies semantics of iteration and can be used together with + * other iterator functions. + * - first value is copied from ${it}->current_value + * - after function returns, iterator is positioned at the next element + */ +uint32_t roaring_read_uint32_iterator(roaring_uint32_iterator_t *it, + uint32_t* buf, uint32_t count); + +#ifdef __cplusplus +} } } // extern "C" { namespace roaring { namespace api { +#endif + +#endif /* ROARING_H */ + +#ifdef __cplusplus + /** + * Best practices for C++ headers is to avoid polluting global scope. + * But for C compatibility when just `roaring.h` is included building as + * C++, default to global access for the C public API. + * + * BUT when `roaring.hh` is included instead, it sets this flag. That way + * explicit namespacing must be used to get the C functions. + * + * This is outside the include guard so that if you include BOTH headers, + * the order won't matter; you still get the global definitions. + */ + #if !defined(ROARING_API_NOT_IN_GLOBAL_NAMESPACE) + using namespace ::roaring::api; + #endif +#endif +/* end file include/roaring/roaring.h */ +/* begin file include/roaring/memory.h */ +#ifndef INCLUDE_ROARING_MEMORY_H_ +#define INCLUDE_ROARING_MEMORY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include // for size_t + +typedef void* (*roaring_malloc_p)(size_t); +typedef void* (*roaring_realloc_p)(void*, size_t); +typedef void* (*roaring_calloc_p)(size_t, size_t); +typedef void (*roaring_free_p)(void*); +typedef void* (*roaring_aligned_malloc_p)(size_t, size_t); +typedef void (*roaring_aligned_free_p)(void*); + +typedef struct roaring_memory_s { + roaring_malloc_p malloc; + roaring_realloc_p realloc; + roaring_calloc_p calloc; + roaring_free_p free; + roaring_aligned_malloc_p aligned_malloc; + roaring_aligned_free_p aligned_free; +} roaring_memory_t; + +void roaring_init_memory_hook(roaring_memory_t memory_hook); + +void* roaring_malloc(size_t); +void* roaring_realloc(void*, size_t); +void* roaring_calloc(size_t, size_t); +void roaring_free(void*); +void* roaring_aligned_malloc(size_t, size_t); +void roaring_aligned_free(void*); + +#ifdef __cplusplus +} +#endif + +#endif // INCLUDE_ROARING_MEMORY_H_ +/* end file include/roaring/memory.h */ diff --git a/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.hh b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.hh new file mode 100644 index 00000000000..315a63bb495 --- /dev/null +++ b/cpp-client/deephaven/client/third_party/roaring/include/roaring/roaring.hh @@ -0,0 +1,2145 @@ +// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! +// Created by amalgamation.sh on Sun 18 Sep 2022 02:41:22 PM EDT + +/* + * The CRoaring project is under a dual license (Apache/MIT). + * Users of the library may choose one or the other license. + */ +/* + * Copyright 2016-2022 The CRoaring authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* + * MIT License + * + * Copyright 2016-2022 The CRoaring authors + * + * Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the + * Software without restriction, including without + * limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software + * is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice + * shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + +#define ROARING_API_NOT_IN_GLOBAL_NAMESPACE // see remarks in roaring.h +#include "roaring.h" +#undef ROARING_API_NOT_IN_GLOBAL_NAMESPACE +/* begin file cpp/roaring.hh */ +/* +A C++ header for Roaring Bitmaps. +*/ +#ifndef INCLUDE_ROARING_HH_ +#define INCLUDE_ROARING_HH_ + +#include + +#include +#include +#include +#include + +#if !defined(ROARING_EXCEPTIONS) +// __cpp_exceptions is required by C++98 and we require C++11 or better. +#ifndef __cpp_exceptions +#error "__cpp_exceptions should be defined" +#endif +# if __cpp_exceptions +# define ROARING_EXCEPTIONS 1 +# else +# define ROARING_EXCEPTIONS 0 +# endif +#endif + +#ifndef ROARING_TERMINATE +# if ROARING_EXCEPTIONS +# define ROARING_TERMINATE(_s) throw std::runtime_error(_s) +# else +# define ROARING_TERMINATE(_s) std::terminate() +# endif +#endif + +#define ROARING_API_NOT_IN_GLOBAL_NAMESPACE // see remarks in roaring.h +#undef ROARING_API_NOT_IN_GLOBAL_NAMESPACE + + +namespace roaring { + +class RoaringSetBitForwardIterator; + +class Roaring { + typedef api::roaring_bitmap_t roaring_bitmap_t; // class-local name alias + +public: + /** + * Create an empty bitmap in the existing memory for the class. + * The bitmap will be in the "clear" state with no auxiliary allocations. + */ + Roaring() : roaring{} { + // The empty constructor roaring{} silences warnings from pedantic static analyzers. + api::roaring_bitmap_init_cleared(&roaring); + } + + /** + * Construct a bitmap from a list of integer values. + */ + Roaring(size_t n, const uint32_t *data) : Roaring() { + api::roaring_bitmap_add_many(&roaring, n, data); + } + + /** + * Copy constructor + */ + Roaring(const Roaring &r) : Roaring() { + if (!api::roaring_bitmap_overwrite(&roaring, &r.roaring)) { + ROARING_TERMINATE("failed roaring_bitmap_overwrite in constructor"); + } + api::roaring_bitmap_set_copy_on_write( + &roaring, + api::roaring_bitmap_get_copy_on_write(&r.roaring)); + } + + /** + * Move constructor. The moved object remains valid, i.e. + * all methods can still be called on it. + */ + Roaring(Roaring &&r) noexcept : roaring(r.roaring) { + // + // !!! This clones the bits of the roaring structure to a new location + // and then overwrites the old bits...assuming that this will still + // work. There are scenarios where this could break; e.g. if some of + // those bits were pointers into the structure memory itself. If such + // things were possible, a roaring_bitmap_move() API would be needed. + // + api::roaring_bitmap_init_cleared(&r.roaring); + } + + /** + * Construct a roaring object by taking control of a malloc()'d C struct. + * + * Passing a NULL pointer is unsafe. + * The pointer to the C struct will be invalid after the call. + */ + explicit Roaring(roaring_bitmap_t *s) noexcept : roaring (*s) { + roaring_free(s); // deallocate the passed-in pointer + } + + /** + * Construct a bitmap from a list of integer values. + */ + static Roaring bitmapOf(size_t n, ...) { + Roaring ans; + va_list vl; + va_start(vl, n); + for (size_t i = 0; i < n; i++) { + ans.add(va_arg(vl, uint32_t)); + } + va_end(vl); + return ans; + } + + /** + * Add value x + */ + void add(uint32_t x) { api::roaring_bitmap_add(&roaring, x); } + + /** + * Add value x + * Returns true if a new value was added, false if the value was already + * existing. + */ + bool addChecked(uint32_t x) { + return api::roaring_bitmap_add_checked(&roaring, x); + } + + /** + * Add all values in range [min, max) + */ + void addRange(const uint64_t min, const uint64_t max) { + return api::roaring_bitmap_add_range(&roaring, min, max); + } + + /** + * Add all values in range [min, max] + */ + void addRangeClosed(const uint32_t min, const uint32_t max) { + return api::roaring_bitmap_add_range_closed(&roaring, min, max); + } + + /** + * Add value n_args from pointer vals + */ + void addMany(size_t n_args, const uint32_t *vals) { + api::roaring_bitmap_add_many(&roaring, n_args, vals); + } + + /** + * Remove value x + */ + void remove(uint32_t x) { api::roaring_bitmap_remove(&roaring, x); } + + /** + * Remove value x + * Returns true if a new value was removed, false if the value was not + * existing. + */ + bool removeChecked(uint32_t x) { + return api::roaring_bitmap_remove_checked(&roaring, x); + } + + /** + * Remove all values in range [min, max) + */ + void removeRange(uint64_t min, uint64_t max) { + return api::roaring_bitmap_remove_range(&roaring, min, max); + } + + /** + * Remove all values in range [min, max] + */ + void removeRangeClosed(uint32_t min, uint32_t max) { + return api::roaring_bitmap_remove_range_closed(&roaring, min, max); + } + + /** + * Return the largest value (if not empty) + */ + uint32_t maximum() const { return api::roaring_bitmap_maximum(&roaring); } + + /** + * Return the smallest value (if not empty) + */ + uint32_t minimum() const { return api::roaring_bitmap_minimum(&roaring); } + + /** + * Check if value x is present + */ + bool contains(uint32_t x) const { + return api::roaring_bitmap_contains(&roaring, x); + } + + /** + * Check if all values from x (included) to y (excluded) are present + */ + bool containsRange(const uint64_t x, const uint64_t y) const { + return api::roaring_bitmap_contains_range(&roaring, x, y); + } + + /** + * Destructor. By contract, calling roaring_bitmap_clear() is enough to + * release all auxiliary memory used by the structure. + */ + ~Roaring() { + if (!(roaring.high_low_container.flags & ROARING_FLAG_FROZEN)) { + api::roaring_bitmap_clear(&roaring); + } else { + // The roaring member variable copies the `roaring_bitmap_t` and + // nested `roaring_array_t` structures by value and is freed in the + // constructor, however the underlying memory arena used for the + // container data is not freed with it. Here we derive the arena + // pointer from the second arena allocation in + // `roaring_bitmap_frozen_view` and free it as well. + roaring_bitmap_free( + (roaring_bitmap_t *)((char *) + roaring.high_low_container.containers - + sizeof(roaring_bitmap_t))); + } + } + + /** + * Copies the content of the provided bitmap, and + * discard the current content. + */ + Roaring &operator=(const Roaring &r) { + if (!api::roaring_bitmap_overwrite(&roaring, &r.roaring)) { + ROARING_TERMINATE("failed memory alloc in assignment"); + } + api::roaring_bitmap_set_copy_on_write( + &roaring, + api::roaring_bitmap_get_copy_on_write(&r.roaring)); + return *this; + } + + /** + * Moves the content of the provided bitmap, and + * discard the current content. + */ + Roaring &operator=(Roaring &&r) noexcept { + api::roaring_bitmap_clear(&roaring); // free this class's allocations + + // !!! See notes in the Move Constructor regarding roaring_bitmap_move() + // + roaring = r.roaring; + api::roaring_bitmap_init_cleared(&r.roaring); + + return *this; + } + + /** + * Compute the intersection between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring &operator&=(const Roaring &r) { + api::roaring_bitmap_and_inplace(&roaring, &r.roaring); + return *this; + } + + /** + * Compute the difference between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring &operator-=(const Roaring &r) { + api::roaring_bitmap_andnot_inplace(&roaring, &r.roaring); + return *this; + } + + /** + * Compute the union between the current bitmap and the provided bitmap, + * writing the result in the current bitmap. The provided bitmap is not + * modified. + * + * See also the fastunion function to aggregate many bitmaps more quickly. + */ + Roaring &operator|=(const Roaring &r) { + api::roaring_bitmap_or_inplace(&roaring, &r.roaring); + return *this; + } + + /** + * Compute the symmetric union between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring &operator^=(const Roaring &r) { + api::roaring_bitmap_xor_inplace(&roaring, &r.roaring); + return *this; + } + + /** + * Exchange the content of this bitmap with another. + */ + void swap(Roaring &r) { std::swap(r.roaring, roaring); } + + /** + * Get the cardinality of the bitmap (number of elements). + */ + uint64_t cardinality() const { + return api::roaring_bitmap_get_cardinality(&roaring); + } + + /** + * Returns true if the bitmap is empty (cardinality is zero). + */ + bool isEmpty() const { return api::roaring_bitmap_is_empty(&roaring); } + + /** + * Returns true if the bitmap is subset of the other. + */ + bool isSubset(const Roaring &r) const { + return api::roaring_bitmap_is_subset(&roaring, &r.roaring); + } + + /** + * Returns true if the bitmap is strict subset of the other. + */ + bool isStrictSubset(const Roaring &r) const { + return api::roaring_bitmap_is_strict_subset(&roaring, &r.roaring); + } + + /** + * Convert the bitmap to an array. Write the output to "ans", caller is + * responsible to ensure that there is enough memory allocated + * (e.g., ans = new uint32[mybitmap.cardinality()];) + */ + void toUint32Array(uint32_t *ans) const { + api::roaring_bitmap_to_uint32_array(&roaring, ans); + } + /** + * To int array with pagination + */ + void rangeUint32Array(uint32_t *ans, size_t offset, size_t limit) const { + api::roaring_bitmap_range_uint32_array(&roaring, offset, limit, ans); + } + + /** + * Return true if the two bitmaps contain the same elements. + */ + bool operator==(const Roaring &r) const { + return api::roaring_bitmap_equals(&roaring, &r.roaring); + } + + /** + * Compute the negation of the roaring bitmap within a specified interval. + * interval: [range_start, range_end). + * Areas outside the range are passed through unchanged. + */ + void flip(uint64_t range_start, uint64_t range_end) { + api::roaring_bitmap_flip_inplace(&roaring, range_start, range_end); + } + + /** + * Remove run-length encoding even when it is more space efficient. + * Return whether a change was applied. + */ + bool removeRunCompression() { + return api::roaring_bitmap_remove_run_compression(&roaring); + } + + /** + * Convert array and bitmap containers to run containers when it is more + * efficient; also convert from run containers when more space efficient. + * Returns true if the result has at least one run container. Additional + * savings might be possible by calling shrinkToFit(). + */ + bool runOptimize() { return api::roaring_bitmap_run_optimize(&roaring); } + + /** + * If needed, reallocate memory to shrink the memory usage. Returns + * the number of bytes saved. + */ + size_t shrinkToFit() { return api::roaring_bitmap_shrink_to_fit(&roaring); } + + /** + * Iterate over the bitmap elements. The function iterator is called once + * for all the values with ptr (can be NULL) as the second parameter of + * each call. + * + * roaring_iterator is simply a pointer to a function that returns bool + * (true means that the iteration should continue while false means that it + * should stop), and takes (uint32_t,void*) as inputs. + */ + void iterate(api::roaring_iterator iterator, void *ptr) const { + api::roaring_iterate(&roaring, iterator, ptr); + } + + /** + * Selects the value at index rnk in the bitmap, where the smallest value + * is at index 0. + * + * If the size of the roaring bitmap is strictly greater than rank, then + * this function returns true and sets element to the element of given rank. + * Otherwise, it returns false. + */ + bool select(uint32_t rnk, uint32_t *element) const { + return api::roaring_bitmap_select(&roaring, rnk, element); + } + + /** + * Computes the size of the intersection between two bitmaps. + */ + uint64_t and_cardinality(const Roaring &r) const { + return api::roaring_bitmap_and_cardinality(&roaring, &r.roaring); + } + + /** + * Check whether the two bitmaps intersect. + */ + bool intersect(const Roaring &r) const { + return api::roaring_bitmap_intersect(&roaring, &r.roaring); + } + + /** + * Computes the Jaccard index between two bitmaps. (Also known as the + * Tanimoto distance, + * or the Jaccard similarity coefficient) + * + * The Jaccard index is undefined if both bitmaps are empty. + */ + double jaccard_index(const Roaring &r) const { + return api::roaring_bitmap_jaccard_index(&roaring, &r.roaring); + } + + /** + * Computes the size of the union between two bitmaps. + */ + uint64_t or_cardinality(const Roaring &r) const { + return api::roaring_bitmap_or_cardinality(&roaring, &r.roaring); + } + + /** + * Computes the size of the difference (andnot) between two bitmaps. + */ + uint64_t andnot_cardinality(const Roaring &r) const { + return api::roaring_bitmap_andnot_cardinality(&roaring, &r.roaring); + } + + /** + * Computes the size of the symmetric difference (andnot) between two + * bitmaps. + */ + uint64_t xor_cardinality(const Roaring &r) const { + return api::roaring_bitmap_xor_cardinality(&roaring, &r.roaring); + } + + /** + * Returns the number of integers that are smaller or equal to x. + * Thus the rank of the smallest element is one. If + * x is smaller than the smallest element, this function will return 0. + * The rank and select functions differ in convention: this function returns + * 1 when ranking the smallest value, but the select function returns the + * smallest value when using index 0. + */ + uint64_t rank(uint32_t x) const { + return api::roaring_bitmap_rank(&roaring, x); + } + + /** + * Write a bitmap to a char buffer. This is meant to be compatible with + * the Java and Go versions. Returns how many bytes were written which + * should be getSizeInBytes(). + * + * Setting the portable flag to false enable a custom format that + * can save space compared to the portable format (e.g., for very + * sparse bitmaps). + * + * Boost users can serialize bitmaps in this manner: + * + * BOOST_SERIALIZATION_SPLIT_FREE(Roaring) + * namespace boost { + * namespace serialization { + * + * template + * void save(Archive& ar, const Roaring& bitmask, + * const unsigned int version) { + * std::size_t expected_size_in_bytes = bitmask.getSizeInBytes(); + * std::vector buffer(expected_size_in_bytes); + * std::size_t size_in_bytes = bitmask.write(buffer.data()); + * + * ar& size_in_bytes; + * ar& boost::serialization::make_binary_object(buffer.data(), + * size_in_bytes); + * } + * template + * void load(Archive& ar, Roaring& bitmask, + * const unsigned int version) { + * std::size_t size_in_bytes = 0; + * ar& size_in_bytes; + * std::vector buffer(size_in_bytes); + * ar& boost::serialization::make_binary_object(buffer.data(), + * size_in_bytes); + * bitmask = Roaring::readSafe(buffer.data(), size_in_bytes); + * } + * } // namespace serialization + * } // namespace boost + */ + size_t write(char *buf, bool portable = true) const { + if (portable) + return api::roaring_bitmap_portable_serialize(&roaring, buf); + else + return api::roaring_bitmap_serialize(&roaring, buf); + } + + /** + * Read a bitmap from a serialized version. This is meant to be compatible + * with the Java and Go versions. + * + * Setting the portable flag to false enable a custom format that + * can save space compared to the portable format (e.g., for very + * sparse bitmaps). + * + * This function is unsafe in the sense that if you provide bad data, + * many, many bytes could be read. See also readSafe. + */ + static Roaring read(const char *buf, bool portable = true) { + roaring_bitmap_t * r = portable + ? api::roaring_bitmap_portable_deserialize(buf) + : api::roaring_bitmap_deserialize(buf); + if (r == NULL) { + ROARING_TERMINATE("failed alloc while reading"); + } + return Roaring(r); + } + + /** + * Read a bitmap from a serialized version, reading no more than maxbytes + * bytes. This is meant to be compatible with the Java and Go versions. + * + */ + static Roaring readSafe(const char *buf, size_t maxbytes) { + roaring_bitmap_t * r = + api::roaring_bitmap_portable_deserialize_safe(buf,maxbytes); + if (r == NULL) { + ROARING_TERMINATE("failed alloc while reading"); + } + return Roaring(r); + } + + /** + * How many bytes are required to serialize this bitmap (meant to be + * compatible with Java and Go versions) + * + * Setting the portable flag to false enable a custom format that + * can save space compared to the portable format (e.g., for very + * sparse bitmaps). + */ + size_t getSizeInBytes(bool portable = true) const { + if (portable) + return api::roaring_bitmap_portable_size_in_bytes(&roaring); + else + return api::roaring_bitmap_size_in_bytes(&roaring); + } + + static const Roaring frozenView(const char *buf, size_t length) { + const roaring_bitmap_t *s = + api::roaring_bitmap_frozen_view(buf, length); + if (s == NULL) { + ROARING_TERMINATE("failed to read frozen bitmap"); + } + Roaring r; + r.roaring = *s; + return r; + } + + void writeFrozen(char *buf) const { + roaring_bitmap_frozen_serialize(&roaring, buf); + } + + size_t getFrozenSizeInBytes() const { + return roaring_bitmap_frozen_size_in_bytes(&roaring); + } + + /** + * Computes the intersection between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring operator&(const Roaring &o) const { + roaring_bitmap_t *r = api::roaring_bitmap_and(&roaring, &o.roaring); + if (r == NULL) { + ROARING_TERMINATE("failed materalization in and"); + } + return Roaring(r); + } + + /** + * Computes the difference between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring operator-(const Roaring &o) const { + roaring_bitmap_t *r = api::roaring_bitmap_andnot(&roaring, &o.roaring); + if (r == NULL) { + ROARING_TERMINATE("failed materalization in andnot"); + } + return Roaring(r); + } + + /** + * Computes the union between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring operator|(const Roaring &o) const { + roaring_bitmap_t *r = api::roaring_bitmap_or(&roaring, &o.roaring); + if (r == NULL) { + ROARING_TERMINATE("failed materalization in or"); + } + return Roaring(r); + } + + /** + * Computes the symmetric union between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring operator^(const Roaring &o) const { + roaring_bitmap_t *r = api::roaring_bitmap_xor(&roaring, &o.roaring); + if (r == NULL) { + ROARING_TERMINATE("failed materalization in xor"); + } + return Roaring(r); + } + + /** + * Whether or not we apply copy and write. + */ + void setCopyOnWrite(bool val) { + api::roaring_bitmap_set_copy_on_write(&roaring, val); + } + + /** + * Print the content of the bitmap + */ + void printf() const { api::roaring_bitmap_printf(&roaring); } + + /** + * Print the content of the bitmap into a string + */ + std::string toString() const { + struct iter_data { + std::string str{}; // The empty constructor silences warnings from pedantic static analyzers. + char first_char = '{'; + } outer_iter_data; + if (!isEmpty()) { + iterate( + [](uint32_t value, void *inner_iter_data) -> bool { + ((iter_data *)inner_iter_data)->str += + ((iter_data *)inner_iter_data)->first_char; + ((iter_data *)inner_iter_data)->str += + std::to_string(value); + ((iter_data *)inner_iter_data)->first_char = ','; + return true; + }, + (void *)&outer_iter_data); + } else + outer_iter_data.str = '{'; + outer_iter_data.str += '}'; + return outer_iter_data.str; + } + + /** + * Whether or not copy and write is active. + */ + bool getCopyOnWrite() const { + return api::roaring_bitmap_get_copy_on_write(&roaring); + } + + /** + * Computes the logical or (union) between "n" bitmaps (referenced by a + * pointer). + */ + static Roaring fastunion(size_t n, const Roaring **inputs) { + const roaring_bitmap_t **x = + (const roaring_bitmap_t **)roaring_malloc(n * sizeof(roaring_bitmap_t *)); + if (x == NULL) { + ROARING_TERMINATE("failed memory alloc in fastunion"); + } + for (size_t k = 0; k < n; ++k) x[k] = &inputs[k]->roaring; + + roaring_bitmap_t *c_ans = api::roaring_bitmap_or_many(n, x); + if (c_ans == NULL) { + roaring_free(x); + ROARING_TERMINATE("failed memory alloc in fastunion"); + } + Roaring ans(c_ans); + roaring_free(x); + return ans; + } + + typedef RoaringSetBitForwardIterator const_iterator; + + /** + * Returns an iterator that can be used to access the position of the set + * bits. The running time complexity of a full scan is proportional to the + * number of set bits: be aware that if you have long strings of 1s, this + * can be very inefficient. + * + * It can be much faster to use the toArray method if you want to retrieve + * the set bits. + */ + const_iterator begin() const; + + /** + * A bogus iterator that can be used together with begin() + * for constructions such as for (auto i = b.begin(); * i!=b.end(); ++i) {} + */ + const_iterator &end() const; + + roaring_bitmap_t roaring; +}; + +/** + * Used to go through the set bits. Not optimally fast, but convenient. + */ +class RoaringSetBitForwardIterator final { +public: + typedef std::forward_iterator_tag iterator_category; + typedef uint32_t *pointer; + typedef uint32_t &reference_type; + typedef uint32_t value_type; + typedef int32_t difference_type; + typedef RoaringSetBitForwardIterator type_of_iterator; + + /** + * Provides the location of the set bit. + */ + value_type operator*() const { return i.current_value; } + + bool operator<(const type_of_iterator &o) const { + if (!i.has_value) return false; + if (!o.i.has_value) return true; + return i.current_value < *o; + } + + bool operator<=(const type_of_iterator &o) const { + if (!o.i.has_value) return true; + if (!i.has_value) return false; + return i.current_value <= *o; + } + + bool operator>(const type_of_iterator &o) const { + if (!o.i.has_value) return false; + if (!i.has_value) return true; + return i.current_value > *o; + } + + bool operator>=(const type_of_iterator &o) const { + if (!i.has_value) return true; + if (!o.i.has_value) return false; + return i.current_value >= *o; + } + + /** + * Move the iterator to the first value >= val. + */ + void equalorlarger(uint32_t val) { + api::roaring_move_uint32_iterator_equalorlarger(&i,val); + } + + type_of_iterator &operator++() { // ++i, must returned inc. value + api::roaring_advance_uint32_iterator(&i); + return *this; + } + + type_of_iterator operator++(int) { // i++, must return orig. value + RoaringSetBitForwardIterator orig(*this); + api::roaring_advance_uint32_iterator(&i); + return orig; + } + + type_of_iterator& operator--() { // prefix -- + api::roaring_previous_uint32_iterator(&i); + return *this; + } + + type_of_iterator operator--(int) { // postfix -- + RoaringSetBitForwardIterator orig(*this); + api::roaring_previous_uint32_iterator(&i); + return orig; + } + + bool operator==(const RoaringSetBitForwardIterator &o) const { + return i.current_value == *o && i.has_value == o.i.has_value; + } + + bool operator!=(const RoaringSetBitForwardIterator &o) const { + return i.current_value != *o || i.has_value != o.i.has_value; + } + + explicit RoaringSetBitForwardIterator(const Roaring &parent, + bool exhausted = false) { + if (exhausted) { + i.parent = &parent.roaring; + i.container_index = INT32_MAX; + i.has_value = false; + i.current_value = UINT32_MAX; + } else { + api::roaring_init_iterator(&parent.roaring, &i); + } + } + + api::roaring_uint32_iterator_t i{}; // The empty constructor silences warnings from pedantic static analyzers. +}; + +inline RoaringSetBitForwardIterator Roaring::begin() const { + return RoaringSetBitForwardIterator(*this); +} + +inline RoaringSetBitForwardIterator &Roaring::end() const { + static RoaringSetBitForwardIterator e(*this, true); + return e; +} + +} // namespace roaring + +#endif /* INCLUDE_ROARING_HH_ */ +/* end file cpp/roaring.hh */ +/* begin file cpp/roaring64map.hh */ +/* +A C++ header for 64-bit Roaring Bitmaps, implemented by way of a map of many +32-bit Roaring Bitmaps. +*/ +#ifndef INCLUDE_ROARING_64_MAP_HH_ +#define INCLUDE_ROARING_64_MAP_HH_ + +#include +#include // for va_list handling in bitmapOf() +#include // for std::printf() in the printf() method +#include // for std::memcpy() +#include +#include +#include +#include +#include +#include +#include + + +namespace roaring { + +using roaring::Roaring; + +class Roaring64MapSetBitForwardIterator; +class Roaring64MapSetBitBiDirectionalIterator; + +class Roaring64Map { + typedef api::roaring_bitmap_t roaring_bitmap_t; + +public: + /** + * Create an empty bitmap + */ + Roaring64Map() = default; + + /** + * Construct a bitmap from a list of 32-bit integer values. + */ + Roaring64Map(size_t n, const uint32_t *data) { addMany(n, data); } + + /** + * Construct a bitmap from a list of 64-bit integer values. + */ + Roaring64Map(size_t n, const uint64_t *data) { addMany(n, data); } + + /** + * Construct a 64-bit map from a 32-bit one + */ + explicit Roaring64Map(const Roaring &r) { emplaceOrInsert(0, r); } + + /** + * Construct a 64-bit map from a 32-bit rvalue + */ + explicit Roaring64Map(Roaring &&r) { emplaceOrInsert(0, std::move(r)); } + + /** + * Construct a roaring object from the C struct. + * + * Passing a NULL point is unsafe. + */ + explicit Roaring64Map(roaring_bitmap_t *s) { + emplaceOrInsert(0, Roaring(s)); + } + + Roaring64Map(const Roaring64Map& r) = default; + + Roaring64Map(Roaring64Map&& r) noexcept = default; + + /** + * Copy assignment operator. + */ + Roaring64Map &operator=(const Roaring64Map &r) = default; + + /** + * Move assignment operator. + */ + Roaring64Map &operator=(Roaring64Map &&r) noexcept = default; + + /** + * Construct a bitmap from a list of integer values. + */ + static Roaring64Map bitmapOf(size_t n...) { + Roaring64Map ans; + va_list vl; + va_start(vl, n); + for (size_t i = 0; i < n; i++) { + ans.add(va_arg(vl, uint64_t)); + } + va_end(vl); + return ans; + } + + /** + * Add value x + */ + void add(uint32_t x) { + roarings[0].add(x); + roarings[0].setCopyOnWrite(copyOnWrite); + } + void add(uint64_t x) { + roarings[highBytes(x)].add(lowBytes(x)); + roarings[highBytes(x)].setCopyOnWrite(copyOnWrite); + } + + /** + * Add value x + * Returns true if a new value was added, false if the value was already existing. + */ + bool addChecked(uint32_t x) { + bool result = roarings[0].addChecked(x); + roarings[0].setCopyOnWrite(copyOnWrite); + return result; + } + bool addChecked(uint64_t x) { + bool result = roarings[highBytes(x)].addChecked(lowBytes(x)); + roarings[highBytes(x)].setCopyOnWrite(copyOnWrite); + return result; + } + + /** + * Add all values in range [min, max) + */ + void addRange(uint64_t min, uint64_t max) { + if (min >= max) { + return; + } + addRangeClosed(min, max - 1); + } + + /** + * Add all values in range [min, max] + */ + void addRangeClosed(uint32_t min, uint32_t max) { + roarings[0].addRangeClosed(min, max); + } + void addRangeClosed(uint64_t min, uint64_t max) { + if (min > max) { + return; + } + uint32_t start_high = highBytes(min); + uint32_t start_low = lowBytes(min); + uint32_t end_high = highBytes(max); + uint32_t end_low = lowBytes(max); + if (start_high == end_high) { + roarings[start_high].addRangeClosed(start_low, end_low); + roarings[start_high].setCopyOnWrite(copyOnWrite); + return; + } + // we put std::numeric_limits<>::max/min in parenthesis to avoid a clash + // with the Windows.h header under Windows + roarings[start_high].addRangeClosed( + start_low, (std::numeric_limits::max)()); + roarings[start_high].setCopyOnWrite(copyOnWrite); + start_high++; + for (; start_high < end_high; ++start_high) { + roarings[start_high].addRangeClosed( + (std::numeric_limits::min)(), + (std::numeric_limits::max)()); + roarings[start_high].setCopyOnWrite(copyOnWrite); + } + roarings[end_high].addRangeClosed( + (std::numeric_limits::min)(), end_low); + roarings[end_high].setCopyOnWrite(copyOnWrite); + } + + /** + * Add value n_args from pointer vals + */ + void addMany(size_t n_args, const uint32_t *vals) { + Roaring &roaring = roarings[0]; + roaring.addMany(n_args, vals); + roaring.setCopyOnWrite(copyOnWrite); + } + + void addMany(size_t n_args, const uint64_t *vals) { + for (size_t lcv = 0; lcv < n_args; lcv++) { + roarings[highBytes(vals[lcv])].add(lowBytes(vals[lcv])); + roarings[highBytes(vals[lcv])].setCopyOnWrite(copyOnWrite); + } + } + + /** + * Remove value x + */ + void remove(uint32_t x) { roarings[0].remove(x); } + void remove(uint64_t x) { + auto roaring_iter = roarings.find(highBytes(x)); + if (roaring_iter != roarings.cend()) + roaring_iter->second.remove(lowBytes(x)); + } + + /** + * Remove value x + * Returns true if a new value was removed, false if the value was not existing. + */ + bool removeChecked(uint32_t x) { + return roarings[0].removeChecked(x); + } + bool removeChecked(uint64_t x) { + auto roaring_iter = roarings.find(highBytes(x)); + if (roaring_iter != roarings.cend()) + return roaring_iter->second.removeChecked(lowBytes(x)); + return false; + } + + /** + * Remove all values in range [min, max) + */ + void removeRange(uint64_t min, uint64_t max) { + if (min >= max) { + return; + } + return removeRangeClosed(min, max - 1); + } + + /** + * Remove all values in range [min, max] + */ + void removeRangeClosed(uint32_t min, uint32_t max) { + return roarings[0].removeRangeClosed(min, max); + } + void removeRangeClosed(uint64_t min, uint64_t max) { + if (min > max) { + return; + } + uint32_t start_high = highBytes(min); + uint32_t start_low = lowBytes(min); + uint32_t end_high = highBytes(max); + uint32_t end_low = lowBytes(max); + + if (roarings.empty() || end_high < roarings.cbegin()->first || + start_high > (roarings.crbegin())->first) { + return; + } + + auto start_iter = roarings.lower_bound(start_high); + auto end_iter = roarings.lower_bound(end_high); + if (start_iter->first == start_high) { + if (start_iter == end_iter) { + start_iter->second.removeRangeClosed(start_low, end_low); + return; + } + // we put std::numeric_limits<>::max/min in parenthesis + // to avoid a clash with the Windows.h header under Windows + start_iter->second.removeRangeClosed( + start_low, (std::numeric_limits::max)()); + start_iter++; + } + + roarings.erase(start_iter, end_iter); + + if (end_iter != roarings.cend() && end_iter->first == end_high) { + end_iter->second.removeRangeClosed( + (std::numeric_limits::min)(), end_low); + } + } + + /** + * Clear the bitmap + */ + void clear() { + roarings.clear(); + } + + /** + * Return the largest value (if not empty) + */ + uint64_t maximum() const { + for (auto roaring_iter = roarings.crbegin(); + roaring_iter != roarings.crend(); ++roaring_iter) { + if (!roaring_iter->second.isEmpty()) { + return uniteBytes(roaring_iter->first, + roaring_iter->second.maximum()); + } + } + // we put std::numeric_limits<>::max/min in parentheses + // to avoid a clash with the Windows.h header under Windows + return (std::numeric_limits::min)(); + } + + /** + * Return the smallest value (if not empty) + */ + uint64_t minimum() const { + for (auto roaring_iter = roarings.cbegin(); + roaring_iter != roarings.cend(); ++roaring_iter) { + if (!roaring_iter->second.isEmpty()) { + return uniteBytes(roaring_iter->first, + roaring_iter->second.minimum()); + } + } + // we put std::numeric_limits<>::max/min in parentheses + // to avoid a clash with the Windows.h header under Windows + return (std::numeric_limits::max)(); + } + + /** + * Check if value x is present + */ + bool contains(uint32_t x) const { + return roarings.count(0) == 0 ? false : roarings.at(0).contains(x); + } + bool contains(uint64_t x) const { + return roarings.count(highBytes(x)) == 0 + ? false + : roarings.at(highBytes(x)).contains(lowBytes(x)); + } + + /** + * Compute the intersection between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring64Map &operator&=(const Roaring64Map &r) { + for (auto &map_entry : roarings) { + if (r.roarings.count(map_entry.first) == 1) + map_entry.second &= r.roarings.at(map_entry.first); + else + map_entry.second = Roaring(); + } + return *this; + } + + /** + * Compute the difference between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring64Map &operator-=(const Roaring64Map &r) { + for (auto &map_entry : roarings) { + if (r.roarings.count(map_entry.first) == 1) + map_entry.second -= r.roarings.at(map_entry.first); + } + return *this; + } + + /** + * Compute the union between the current bitmap and the provided bitmap, + * writing the result in the current bitmap. The provided bitmap is not + * modified. + * + * See also the fastunion function to aggregate many bitmaps more quickly. + */ + Roaring64Map &operator|=(const Roaring64Map &r) { + for (const auto &map_entry : r.roarings) { + if (roarings.count(map_entry.first) == 0) { + roarings[map_entry.first] = map_entry.second; + roarings[map_entry.first].setCopyOnWrite(copyOnWrite); + } else + roarings[map_entry.first] |= map_entry.second; + } + return *this; + } + + /** + * Compute the symmetric union between the current bitmap and the provided + * bitmap, writing the result in the current bitmap. The provided bitmap + * is not modified. + */ + Roaring64Map &operator^=(const Roaring64Map &r) { + for (const auto &map_entry : r.roarings) { + if (roarings.count(map_entry.first) == 0) { + roarings[map_entry.first] = map_entry.second; + roarings[map_entry.first].setCopyOnWrite(copyOnWrite); + } else + roarings[map_entry.first] ^= map_entry.second; + } + return *this; + } + + /** + * Exchange the content of this bitmap with another. + */ + void swap(Roaring64Map &r) { roarings.swap(r.roarings); } + + /** + * Get the cardinality of the bitmap (number of elements). + * Throws std::length_error in the special case where the bitmap is full + * (cardinality() == 2^64). Check isFull() before calling to avoid + * exception. + */ + uint64_t cardinality() const { + if (isFull()) { +#if ROARING_EXCEPTIONS + throw std::length_error("bitmap is full, cardinality is 2^64, " + "unable to represent in a 64-bit integer"); +#else + ROARING_TERMINATE("bitmap is full, cardinality is 2^64, " + "unable to represent in a 64-bit integer"); +#endif + } + return std::accumulate( + roarings.cbegin(), roarings.cend(), (uint64_t)0, + [](uint64_t previous, + const std::pair &map_entry) { + return previous + map_entry.second.cardinality(); + }); + } + + /** + * Returns true if the bitmap is empty (cardinality is zero). + */ + bool isEmpty() const { + return std::all_of(roarings.cbegin(), roarings.cend(), + [](const std::pair &map_entry) { + return map_entry.second.isEmpty(); + }); + } + + /** + * Returns true if the bitmap is full (cardinality is max uint64_t + 1). + */ + bool isFull() const { + // only bother to check if map is fully saturated + // + // we put std::numeric_limits<>::max/min in parentheses + // to avoid a clash with the Windows.h header under Windows + return roarings.size() == + ((uint64_t)(std::numeric_limits::max)()) + 1 + ? std::all_of( + roarings.cbegin(), roarings.cend(), + [](const std::pair &roaring_map_entry) { + // roarings within map are saturated if cardinality + // is uint32_t max + 1 + return roaring_map_entry.second.cardinality() == + ((uint64_t) + (std::numeric_limits::max)()) + + 1; + }) + : false; + } + + /** + * Returns true if the bitmap is subset of the other. + */ + bool isSubset(const Roaring64Map &r) const { + for (const auto &map_entry : roarings) { + if (map_entry.second.isEmpty()) { + continue; + } + auto roaring_iter = r.roarings.find(map_entry.first); + if (roaring_iter == r.roarings.cend()) + return false; + else if (!map_entry.second.isSubset(roaring_iter->second)) + return false; + } + return true; + } + + /** + * Returns true if the bitmap is strict subset of the other. + * Throws std::length_error in the special case where the bitmap is full + * (cardinality() == 2^64). Check isFull() before calling to avoid exception. + */ + bool isStrictSubset(const Roaring64Map &r) const { + return isSubset(r) && cardinality() != r.cardinality(); + } + + /** + * Convert the bitmap to an array. Write the output to "ans", + * caller is responsible to ensure that there is enough memory + * allocated + * (e.g., ans = new uint32[mybitmap.cardinality()];) + */ + void toUint64Array(uint64_t *ans) const { + // Annoyingly, VS 2017 marks std::accumulate() as [[nodiscard]] + (void)std::accumulate(roarings.cbegin(), roarings.cend(), ans, + [](uint64_t *previous, + const std::pair &map_entry) { + for (uint32_t low_bits : map_entry.second) + *previous++ = + uniteBytes(map_entry.first, low_bits); + return previous; + }); + } + + /** + * Return true if the two bitmaps contain the same elements. + */ + bool operator==(const Roaring64Map &r) const { + // we cannot use operator == on the map because either side may contain + // empty Roaring Bitmaps + auto lhs_iter = roarings.cbegin(); + auto lhs_cend = roarings.cend(); + auto rhs_iter = r.roarings.cbegin(); + auto rhs_cend = r.roarings.cend(); + while (lhs_iter != lhs_cend && rhs_iter != rhs_cend) { + auto lhs_key = lhs_iter->first, rhs_key = rhs_iter->first; + const auto &lhs_map = lhs_iter->second, &rhs_map = rhs_iter->second; + if (lhs_map.isEmpty()) { + ++lhs_iter; + continue; + } + if (rhs_map.isEmpty()) { + ++rhs_iter; + continue; + } + if (!(lhs_key == rhs_key)) { + return false; + } + if (!(lhs_map == rhs_map)) { + return false; + } + ++lhs_iter; + ++rhs_iter; + } + while (lhs_iter != lhs_cend) { + if (!lhs_iter->second.isEmpty()) { + return false; + } + ++lhs_iter; + } + while (rhs_iter != rhs_cend) { + if (!rhs_iter->second.isEmpty()) { + return false; + } + ++rhs_iter; + } + return true; + } + + /** + * Compute the negation of the roaring bitmap within a specified interval. + * areas outside the range are passed through unchanged. + */ + void flip(uint64_t range_start, uint64_t range_end) { + if (range_start >= range_end) { + return; + } + uint32_t start_high = highBytes(range_start); + uint32_t start_low = lowBytes(range_start); + uint32_t end_high = highBytes(range_end); + uint32_t end_low = lowBytes(range_end); + + if (start_high == end_high) { + roarings[start_high].flip(start_low, end_low); + return; + } + // we put std::numeric_limits<>::max/min in parentheses + // to avoid a clash with the Windows.h header under Windows + // flip operates on the range [lower_bound, upper_bound) + const uint64_t max_upper_bound = + static_cast((std::numeric_limits::max)()) + 1; + roarings[start_high].flip(start_low, max_upper_bound); + roarings[start_high++].setCopyOnWrite(copyOnWrite); + + for (; start_high <= highBytes(range_end) - 1; ++start_high) { + roarings[start_high].flip((std::numeric_limits::min)(), + max_upper_bound); + roarings[start_high].setCopyOnWrite(copyOnWrite); + } + + roarings[start_high].flip((std::numeric_limits::min)(), + end_low); + roarings[start_high].setCopyOnWrite(copyOnWrite); + } + + /** + * Remove run-length encoding even when it is more space efficient + * return whether a change was applied + */ + bool removeRunCompression() { + return std::accumulate( + roarings.begin(), roarings.end(), true, + [](bool previous, std::pair &map_entry) { + return map_entry.second.removeRunCompression() && previous; + }); + } + + /** + * Convert array and bitmap containers to run containers when it is more + * efficient; also convert from run containers when more space efficient. + * Returns true if the result has at least one run container. + * Additional savings might be possible by calling shrinkToFit(). + */ + bool runOptimize() { + return std::accumulate( + roarings.begin(), roarings.end(), true, + [](bool previous, std::pair &map_entry) { + return map_entry.second.runOptimize() && previous; + }); + } + + /** + * If needed, reallocate memory to shrink the memory usage. + * Returns the number of bytes saved. + */ + size_t shrinkToFit() { + size_t savedBytes = 0; + auto iter = roarings.begin(); + while (iter != roarings.cend()) { + if (iter->second.isEmpty()) { + // empty Roarings are 84 bytes + savedBytes += 88; + roarings.erase(iter++); + } else { + savedBytes += iter->second.shrinkToFit(); + iter++; + } + } + return savedBytes; + } + + /** + * Iterate over the bitmap elements in order(start from the smallest one) + * and call iterator once for every element until the iterator function + * returns false. To iterate over all values, the iterator function should + * always return true. + * + * The roaring_iterator64 parameter is a pointer to a function that + * returns bool (true means that the iteration should continue while false + * means that it should stop), and takes (uint64_t element, void* ptr) as + * inputs. + */ + void iterate(api::roaring_iterator64 iterator, void *ptr) const { + for (const auto &map_entry : roarings) { + bool should_continue = + roaring_iterate64(&map_entry.second.roaring, iterator, + uint64_t(map_entry.first) << 32, ptr); + if (!should_continue) { + break; + } + } + } + + /** + * If the size of the roaring bitmap is strictly greater than rank, then + * this function returns true and set element to the element of given + * rank. Otherwise, it returns false. + */ + bool select(uint64_t rnk, uint64_t *element) const { + for (const auto &map_entry : roarings) { + uint64_t sub_cardinality = (uint64_t)map_entry.second.cardinality(); + if (rnk < sub_cardinality) { + *element = ((uint64_t)map_entry.first) << 32; + // assuming little endian + return map_entry.second.select((uint32_t)rnk, + ((uint32_t *)element)); + } + rnk -= sub_cardinality; + } + return false; + } + + /** + * Returns the number of integers that are smaller or equal to x. + */ + uint64_t rank(uint64_t x) const { + uint64_t result = 0; + auto roaring_destination = roarings.find(highBytes(x)); + if (roaring_destination != roarings.cend()) { + for (auto roaring_iter = roarings.cbegin(); + roaring_iter != roaring_destination; ++roaring_iter) { + result += roaring_iter->second.cardinality(); + } + result += roaring_destination->second.rank(lowBytes(x)); + return result; + } + roaring_destination = roarings.lower_bound(highBytes(x)); + for (auto roaring_iter = roarings.cbegin(); + roaring_iter != roaring_destination; ++roaring_iter) { + result += roaring_iter->second.cardinality(); + } + return result; + } + + /** + * Write a bitmap to a char buffer. This is meant to be compatible with + * the Java and Go versions. Returns how many bytes were written which + * should be getSizeInBytes(). + * + * Setting the portable flag to false enables a custom format that + * can save space compared to the portable format (e.g., for very + * sparse bitmaps). + */ + size_t write(char *buf, bool portable = true) const { + const char *orig = buf; + // push map size + uint64_t map_size = roarings.size(); + std::memcpy(buf, &map_size, sizeof(uint64_t)); + buf += sizeof(uint64_t); + std::for_each( + roarings.cbegin(), roarings.cend(), + [&buf, portable](const std::pair &map_entry) { + // push map key + std::memcpy(buf, &map_entry.first, sizeof(uint32_t)); + // ^-- Note: `*((uint32_t*)buf) = map_entry.first;` is undefined + + buf += sizeof(uint32_t); + // push map value Roaring + buf += map_entry.second.write(buf, portable); + }); + return buf - orig; + } + + /** + * Read a bitmap from a serialized version. This is meant to be compatible + * with the Java and Go versions. + * + * Setting the portable flag to false enable a custom format that + * can save space compared to the portable format (e.g., for very + * sparse bitmaps). + * + * This function is unsafe in the sense that if you provide bad data, many + * bytes could be read, possibly causing a buffer overflow. See also + * readSafe. + */ + static Roaring64Map read(const char *buf, bool portable = true) { + Roaring64Map result; + // get map size + uint64_t map_size; + std::memcpy(&map_size, buf, sizeof(uint64_t)); + buf += sizeof(uint64_t); + for (uint64_t lcv = 0; lcv < map_size; lcv++) { + // get map key + uint32_t key; + std::memcpy(&key, buf, sizeof(uint32_t)); + // ^-- Note: `uint32_t key = *((uint32_t*)buf);` is undefined + + buf += sizeof(uint32_t); + // read map value Roaring + Roaring read_var = Roaring::read(buf, portable); + // forward buffer past the last Roaring Bitmap + buf += read_var.getSizeInBytes(portable); + result.emplaceOrInsert(key, std::move(read_var)); + } + return result; + } + + /** + * Read a bitmap from a serialized version, reading no more than maxbytes + * bytes. This is meant to be compatible with the Java and Go versions. + * + * Setting the portable flag to false enable a custom format that can save + * space compared to the portable format (e.g., for very sparse bitmaps). + */ + static Roaring64Map readSafe(const char *buf, size_t maxbytes) { + if (maxbytes < sizeof(uint64_t)) { + ROARING_TERMINATE("ran out of bytes"); + } + Roaring64Map result; + uint64_t map_size; + std::memcpy(&map_size, buf, sizeof(uint64_t)); + buf += sizeof(uint64_t); + maxbytes -= sizeof(uint64_t); + for (uint64_t lcv = 0; lcv < map_size; lcv++) { + if(maxbytes < sizeof(uint32_t)) { + ROARING_TERMINATE("ran out of bytes"); + } + uint32_t key; + std::memcpy(&key, buf, sizeof(uint32_t)); + // ^-- Note: `uint32_t key = *((uint32_t*)buf);` is undefined + + buf += sizeof(uint32_t); + maxbytes -= sizeof(uint32_t); + // read map value Roaring + Roaring read_var = Roaring::readSafe(buf, maxbytes); + // forward buffer past the last Roaring Bitmap + size_t tz = read_var.getSizeInBytes(true); + buf += tz; + maxbytes -= tz; + result.emplaceOrInsert(key, std::move(read_var)); + } + return result; + } + + /** + * Return the number of bytes required to serialize this bitmap (meant to + * be compatible with Java and Go versions) + * + * Setting the portable flag to false enable a custom format that can save + * space compared to the portable format (e.g., for very sparse bitmaps). + */ + size_t getSizeInBytes(bool portable = true) const { + // start with, respectively, map size and size of keys for each map + // entry + return std::accumulate( + roarings.cbegin(), roarings.cend(), + sizeof(uint64_t) + roarings.size() * sizeof(uint32_t), + [=](size_t previous, + const std::pair &map_entry) { + // add in bytes used by each Roaring + return previous + map_entry.second.getSizeInBytes(portable); + }); + } + + static const Roaring64Map frozenView(const char *buf) { + // size of bitmap buffer and key + const size_t metadata_size = sizeof(size_t) + sizeof(uint32_t); + + Roaring64Map result; + + // get map size + uint64_t map_size; + memcpy(&map_size, buf, sizeof(uint64_t)); + buf += sizeof(uint64_t); + + for (uint64_t lcv = 0; lcv < map_size; lcv++) { + // pad to 32 bytes minus the metadata size + while (((uintptr_t)buf + metadata_size) % 32 != 0) buf++; + + // get bitmap size + size_t len; + memcpy(&len, buf, sizeof(size_t)); + buf += sizeof(size_t); + + // get map key + uint32_t key; + memcpy(&key, buf, sizeof(uint32_t)); + buf += sizeof(uint32_t); + + // read map value Roaring + const Roaring read = Roaring::frozenView(buf, len); + result.emplaceOrInsert(key, read); + + // forward buffer past the last Roaring Bitmap + buf += len; + } + return result; + } + + // As with serialized 64-bit bitmaps, 64-bit frozen bitmaps are serialized + // by concatenating one or more Roaring::write output buffers with the + // preceeding map key. Unlike standard bitmap serialization, frozen bitmaps + // must be 32-byte aligned and requires a buffer length to parse. As a + // result, each concatenated output of Roaring::writeFrozen is preceeded by + // padding, the buffer size (size_t), and the map key (uint32_t). The + // padding is used to ensure 32-byte alignment, but since it is followed by + // the buffer size and map key, it actually pads to `(x - sizeof(size_t) + + // sizeof(uint32_t)) mod 32` to leave room for the metadata. + void writeFrozen(char *buf) const { + // size of bitmap buffer and key + const size_t metadata_size = sizeof(size_t) + sizeof(uint32_t); + + // push map size + uint64_t map_size = roarings.size(); + memcpy(buf, &map_size, sizeof(uint64_t)); + buf += sizeof(uint64_t); + + for (auto &map_entry : roarings) { + size_t frozenSizeInBytes = map_entry.second.getFrozenSizeInBytes(); + + // pad to 32 bytes minus the metadata size + while (((uintptr_t)buf + metadata_size) % 32 != 0) buf++; + + // push bitmap size + memcpy(buf, &frozenSizeInBytes, sizeof(size_t)); + buf += sizeof(size_t); + + // push map key + memcpy(buf, &map_entry.first, sizeof(uint32_t)); + buf += sizeof(uint32_t); + + // push map value Roaring + map_entry.second.writeFrozen(buf); + buf += map_entry.second.getFrozenSizeInBytes(); + } + } + + size_t getFrozenSizeInBytes() const { + // size of bitmap size and map key + const size_t metadata_size = sizeof(size_t) + sizeof(uint32_t); + size_t ret = 0; + + // map size + ret += sizeof(uint64_t); + + for (auto &map_entry : roarings) { + // pad to 32 bytes minus the metadata size + while ((ret + metadata_size) % 32 != 0) ret++; + ret += metadata_size; + + // frozen bitmaps must be 32-byte aligned + ret += map_entry.second.getFrozenSizeInBytes(); + } + return ret; + } + + /** + * Computes the intersection between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring64Map operator&(const Roaring64Map &o) const { + return Roaring64Map(*this) &= o; + } + + /** + * Computes the difference between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring64Map operator-(const Roaring64Map &o) const { + return Roaring64Map(*this) -= o; + } + + /** + * Computes the union between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring64Map operator|(const Roaring64Map &o) const { + return Roaring64Map(*this) |= o; + } + + /** + * Computes the symmetric union between two bitmaps and returns new bitmap. + * The current bitmap and the provided bitmap are unchanged. + */ + Roaring64Map operator^(const Roaring64Map &o) const { + return Roaring64Map(*this) ^= o; + } + + /** + * Whether or not we apply copy and write. + */ + void setCopyOnWrite(bool val) { + if (copyOnWrite == val) return; + copyOnWrite = val; + std::for_each(roarings.begin(), roarings.end(), + [=](std::pair &map_entry) { + map_entry.second.setCopyOnWrite(val); + }); + } + + /** + * Print the content of the bitmap + */ + void printf() const { + if (!isEmpty()) { + auto map_iter = roarings.cbegin(); + while (map_iter->second.isEmpty()) ++map_iter; + struct iter_data { + uint32_t high_bits{}; + char first_char{'{'}; + } outer_iter_data; + outer_iter_data.high_bits = roarings.begin()->first; + map_iter->second.iterate( + [](uint32_t low_bits, void *inner_iter_data) -> bool { + std::printf("%c%llu", + ((iter_data *)inner_iter_data)->first_char, + (long long unsigned)uniteBytes( + ((iter_data *)inner_iter_data)->high_bits, + low_bits)); + ((iter_data *)inner_iter_data)->first_char = ','; + return true; + }, + (void *)&outer_iter_data); + std::for_each( + ++map_iter, roarings.cend(), + [](const std::pair &map_entry) { + map_entry.second.iterate( + [](uint32_t low_bits, void *high_bits) -> bool { + std::printf(",%llu", + (long long unsigned)uniteBytes( + *(uint32_t *)high_bits, low_bits)); + return true; + }, + (void *)&map_entry.first); + }); + } else + std::printf("{"); + std::printf("}\n"); + } + + /** + * Print the content of the bitmap into a string + */ + std::string toString() const { + struct iter_data { + std::string str{}; // The empty constructor silences warnings from pedantic static analyzers. + uint32_t high_bits{0}; + char first_char{'{'}; + } outer_iter_data; + if (!isEmpty()) { + auto map_iter = roarings.cbegin(); + while (map_iter->second.isEmpty()) ++map_iter; + outer_iter_data.high_bits = roarings.begin()->first; + map_iter->second.iterate( + [](uint32_t low_bits, void *inner_iter_data) -> bool { + ((iter_data *)inner_iter_data)->str += + ((iter_data *)inner_iter_data)->first_char; + ((iter_data *)inner_iter_data)->str += std::to_string( + uniteBytes(((iter_data *)inner_iter_data)->high_bits, + low_bits)); + ((iter_data *)inner_iter_data)->first_char = ','; + return true; + }, + (void *)&outer_iter_data); + std::for_each( + ++map_iter, roarings.cend(), + [&outer_iter_data]( + const std::pair &map_entry) { + outer_iter_data.high_bits = map_entry.first; + map_entry.second.iterate( + [](uint32_t low_bits, void *inner_iter_data) -> bool { + ((iter_data *)inner_iter_data)->str += + ((iter_data *)inner_iter_data)->first_char; + ((iter_data *)inner_iter_data)->str += + std::to_string(uniteBytes( + ((iter_data *)inner_iter_data)->high_bits, + low_bits)); + return true; + }, + (void *)&outer_iter_data); + }); + } else + outer_iter_data.str = '{'; + outer_iter_data.str += '}'; + return outer_iter_data.str; + } + + /** + * Whether or not copy and write is active. + */ + bool getCopyOnWrite() const { return copyOnWrite; } + + /** + * Computes the logical or (union) between "n" bitmaps (referenced by a + * pointer). + */ + static Roaring64Map fastunion(size_t n, const Roaring64Map **inputs) { + Roaring64Map ans; + // not particularly fast + for (size_t lcv = 0; lcv < n; ++lcv) { + ans |= *(inputs[lcv]); + } + return ans; + } + + friend class Roaring64MapSetBitForwardIterator; + friend class Roaring64MapSetBitBiDirectionalIterator; + typedef Roaring64MapSetBitForwardIterator const_iterator; + typedef Roaring64MapSetBitBiDirectionalIterator const_bidirectional_iterator; + + /** + * Returns an iterator that can be used to access the position of the set + * bits. The running time complexity of a full scan is proportional to the + * number of set bits: be aware that if you have long strings of 1s, this + * can be very inefficient. + * + * It can be much faster to use the toArray method if you want to + * retrieve the set bits. + */ + const_iterator begin() const; + + /** + * A bogus iterator that can be used together with begin() + * for constructions such as: for (auto i = b.begin(); * i!=b.end(); ++i) {} + */ + const_iterator end() const; + +private: + std::map roarings{}; // The empty constructor silences warnings from pedantic static analyzers. + bool copyOnWrite{false}; + static uint32_t highBytes(const uint64_t in) { return uint32_t(in >> 32); } + static uint32_t lowBytes(const uint64_t in) { return uint32_t(in); } + static uint64_t uniteBytes(const uint32_t highBytes, + const uint32_t lowBytes) { + return (uint64_t(highBytes) << 32) | uint64_t(lowBytes); + } + // this is needed to tolerate gcc's C++11 libstdc++ lacking emplace + // prior to version 4.8 + void emplaceOrInsert(const uint32_t key, const Roaring &value) { +#if defined(__GLIBCXX__) && __GLIBCXX__ < 20130322 + roarings.insert(std::make_pair(key, value)); +#else + roarings.emplace(std::make_pair(key, value)); +#endif + } + + void emplaceOrInsert(const uint32_t key, Roaring &&value) { +#if defined(__GLIBCXX__) && __GLIBCXX__ < 20130322 + roarings.insert(std::make_pair(key, std::move(value))); +#else + roarings.emplace(key, std::move(value)); +#endif + } +}; + +/** + * Used to go through the set bits. Not optimally fast, but convenient. + */ +class Roaring64MapSetBitForwardIterator { +public: + typedef std::forward_iterator_tag iterator_category; + typedef uint64_t *pointer; + typedef uint64_t &reference_type; + typedef uint64_t value_type; + typedef int64_t difference_type; + typedef Roaring64MapSetBitForwardIterator type_of_iterator; + + /** + * Provides the location of the set bit. + */ + value_type operator*() const { + return Roaring64Map::uniteBytes(map_iter->first, i.current_value); + } + + bool operator<(const type_of_iterator &o) const { + if (map_iter == map_end) return false; + if (o.map_iter == o.map_end) return true; + return **this < *o; + } + + bool operator<=(const type_of_iterator &o) const { + if (o.map_iter == o.map_end) return true; + if (map_iter == map_end) return false; + return **this <= *o; + } + + bool operator>(const type_of_iterator &o) const { + if (o.map_iter == o.map_end) return false; + if (map_iter == map_end) return true; + return **this > *o; + } + + bool operator>=(const type_of_iterator &o) const { + if (map_iter == map_end) return true; + if (o.map_iter == o.map_end) return false; + return **this >= *o; + } + + type_of_iterator &operator++() { // ++i, must returned inc. value + if (i.has_value == true) roaring_advance_uint32_iterator(&i); + while (!i.has_value) { + map_iter++; + if (map_iter == map_end) return *this; + roaring_init_iterator(&map_iter->second.roaring, &i); + } + return *this; + } + + type_of_iterator operator++(int) { // i++, must return orig. value + Roaring64MapSetBitForwardIterator orig(*this); + roaring_advance_uint32_iterator(&i); + while (!i.has_value) { + map_iter++; + if (map_iter == map_end) return orig; + roaring_init_iterator(&map_iter->second.roaring, &i); + } + return orig; + } + + bool move(const value_type& x) { + map_iter = p.lower_bound(Roaring64Map::highBytes(x)); + if (map_iter != p.cend()) { + roaring_init_iterator(&map_iter->second.roaring, &i); + if (map_iter->first == Roaring64Map::highBytes(x)) { + if (roaring_move_uint32_iterator_equalorlarger(&i, Roaring64Map::lowBytes(x))) + return true; + map_iter++; + if (map_iter == map_end) return false; + roaring_init_iterator(&map_iter->second.roaring, &i); + } + return true; + } + return false; + } + + bool operator==(const Roaring64MapSetBitForwardIterator &o) const { + if (map_iter == map_end && o.map_iter == o.map_end) return true; + if (o.map_iter == o.map_end) return false; + return **this == *o; + } + + bool operator!=(const Roaring64MapSetBitForwardIterator &o) const { + if (map_iter == map_end && o.map_iter == o.map_end) return false; + if (o.map_iter == o.map_end) return true; + return **this != *o; + } + + Roaring64MapSetBitForwardIterator &operator=(const Roaring64MapSetBitForwardIterator& r) { + map_iter = r.map_iter; + map_end = r.map_end; + i = r.i; + return *this; + } + + Roaring64MapSetBitForwardIterator(const Roaring64MapSetBitForwardIterator& r) + : p(r.p), + map_iter(r.map_iter), + map_end(r.map_end), + i(r.i) + {} + + Roaring64MapSetBitForwardIterator(const Roaring64Map &parent, + bool exhausted = false) + : p(parent.roarings), map_end(parent.roarings.cend()) { + if (exhausted || parent.roarings.empty()) { + map_iter = parent.roarings.cend(); + } else { + map_iter = parent.roarings.cbegin(); + roaring_init_iterator(&map_iter->second.roaring, &i); + while (!i.has_value) { + map_iter++; + if (map_iter == map_end) return; + roaring_init_iterator(&map_iter->second.roaring, &i); + } + } + } + +protected: + const std::map& p; + std::map::const_iterator map_iter{}; // The empty constructor silences warnings from pedantic static analyzers. + std::map::const_iterator map_end{}; // The empty constructor silences warnings from pedantic static analyzers. + api::roaring_uint32_iterator_t i{}; // The empty constructor silences warnings from pedantic static analyzers. +}; + +class Roaring64MapSetBitBiDirectionalIterator final :public Roaring64MapSetBitForwardIterator { +public: + explicit Roaring64MapSetBitBiDirectionalIterator(const Roaring64Map &parent, + bool exhausted = false) + : Roaring64MapSetBitForwardIterator(parent, exhausted), map_begin(parent.roarings.cbegin()) + {} + + Roaring64MapSetBitBiDirectionalIterator &operator=(const Roaring64MapSetBitForwardIterator& r) { + *(Roaring64MapSetBitForwardIterator*)this = r; + return *this; + } + + Roaring64MapSetBitBiDirectionalIterator& operator--() { // --i, must return dec.value + if (map_iter == map_end) { + --map_iter; + roaring_init_iterator_last(&map_iter->second.roaring, &i); + if (i.has_value) return *this; + } + + roaring_previous_uint32_iterator(&i); + while (!i.has_value) { + if (map_iter == map_begin) return *this; + map_iter--; + roaring_init_iterator_last(&map_iter->second.roaring, &i); + } + return *this; + } + + Roaring64MapSetBitBiDirectionalIterator operator--(int) { // i--, must return orig. value + Roaring64MapSetBitBiDirectionalIterator orig(*this); + if (map_iter == map_end) { + --map_iter; + roaring_init_iterator_last(&map_iter->second.roaring, &i); + return orig; + } + + roaring_previous_uint32_iterator(&i); + while (!i.has_value) { + if (map_iter == map_begin) return orig; + map_iter--; + roaring_init_iterator_last(&map_iter->second.roaring, &i); + } + return orig; + } + +protected: + std::map::const_iterator map_begin; +}; + +inline Roaring64MapSetBitForwardIterator Roaring64Map::begin() const { + return Roaring64MapSetBitForwardIterator(*this); +} + +inline Roaring64MapSetBitForwardIterator Roaring64Map::end() const { + return Roaring64MapSetBitForwardIterator(*this, true); +} + +} // namespace roaring + +#endif /* INCLUDE_ROARING_64_MAP_HH_ */ +/* end file cpp/roaring64map.hh */ diff --git a/cpp-client/tests/CMakeLists.txt b/cpp-client/tests/CMakeLists.txt index 8f39e2d0abb..c7aa038ec25 100644 --- a/cpp-client/tests/CMakeLists.txt +++ b/cpp-client/tests/CMakeLists.txt @@ -23,7 +23,7 @@ add_executable(tests view_test.cc third_party/catch.hpp - ) + ticking_test.cc) target_compile_options(tests PRIVATE -Wall -Werror) target_include_directories(tests PUBLIC "..") diff --git a/cpp-client/tests/select_test.cc b/cpp-client/tests/select_test.cc index 25fce15e145..c56e1a5997c 100644 --- a/cpp-client/tests/select_test.cc +++ b/cpp-client/tests/select_test.cc @@ -32,6 +32,62 @@ using deephaven::client::utility::stringf; using deephaven::client::utility::TableMaker; namespace deephaven::client::tests { +TEST_CASE("Support all types", "[select]") { + auto tm = TableMakerForTests::create(); + + // std::vector boolData; + std::vector charData; + std::vector byteData; + std::vector shortData; + std::vector intData; + std::vector longData; + std::vector floatData; + std::vector doubleData; + std::vector stringData; + + const int startValue = -8; + const int endValue = 8; + for (auto i = startValue; i != endValue; ++i) { + // boolData.push_back((i % 2) == 0); + charData.push_back(i * 10); + byteData.push_back(i * 11); + shortData.push_back(i * 1000); + intData.push_back(i * 1'000'000); + longData.push_back(i * 1'000'000'000); + floatData.push_back(i * 123.456f); + doubleData.push_back(i * 987654.321); + stringData.push_back(stringf("test %o", i)); + } + + TableMaker maker; + // maker.addColumn("boolData", boolData); + maker.addColumn("charData", charData); + maker.addColumn("byteData", byteData); + maker.addColumn("shortData", shortData); + maker.addColumn("intData", intData); + maker.addColumn("longData", longData); + maker.addColumn("floatData", floatData); + maker.addColumn("doubleData", doubleData); + maker.addColumn("stringData", stringData); + + auto t = maker.makeTable(tm.client().getManager()); + + std::cout << t.stream(true) << '\n'; + + compareTable( + t, + // "boolData", boolData, + "charData", charData, + "byteData", byteData, + "shortData", shortData, + "intData", intData, + "longData", longData, + "floatData", floatData, + "doubleData", doubleData, + "stringData", stringData + ); +} + TEST_CASE("Create / update / fetch a table", "[select]") { auto tm = TableMakerForTests::create(); @@ -67,30 +123,6 @@ TEST_CASE("Create / update / fetch a table", "[select]") { ); } -TEST_CASE("Simple where", "[select]") { - auto tm = TableMakerForTests::create(); - auto table = tm.table(); - auto updated = table.update("QQQ = i"); - // Symbolically - auto importDate = updated.getStrCol("ImportDate"); - auto ticker = updated.getStrCol("Ticker"); - auto volume = updated.getNumCol("Volume"); - // if we allowed C++17 we could do something like - // auto [importDate, ticker, volume] = table.getCol("ImportDate", "Ticker", "Volume"); - - auto t2 = updated.where(importDate == "2017-11-01" && ticker == "IBM") - .select(ticker, volume); - std::cout << t2.stream(true) << '\n'; - - std::vector tickerData = {"IBM"}; - std::vector volData = {138000}; - - compareTable( - t2, - "Ticker", tickerData, - "Volume", volData - ); -} TEST_CASE("Select a few columns", "[select]") { auto tm = TableMakerForTests::create(); @@ -121,22 +153,6 @@ TEST_CASE("Select a few columns", "[select]") { ); } -TEST_CASE("Simple 'where' with syntax error", "[select]") { - auto tm = TableMakerForTests::create(); - auto table = tm.table(); - - try { - // String literal - auto t1 = table.where(")))))"); - std::cout << t1.stream(true) << '\n'; - } catch (const std::exception &e) { - // Expected - streamf(std::cerr, "Caught *expected* exception %o\n", e.what()); - return; - } - throw std::runtime_error("Expected a failure, but didn't experience one"); -} - TEST_CASE("LastBy + Select", "[select]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); @@ -166,64 +182,105 @@ TEST_CASE("LastBy + Select", "[select]") { ); } -TEST_CASE("Formula Formula in the where clause", "[select]") { +TEST_CASE("New columns", "[select]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); - auto t1 = table.where("ImportDate == `2017-11-01` && Ticker == `AAPL` && Volume % 10 == Volume % 100") - .select("Ticker", "Volume"); + // A formula expression + auto t1 = table.where("ImportDate == `2017-11-01` && Ticker == `AAPL`") + .select("MV1 = Volume * Close", "V_plus_12 = Volume + 12"); std::cout << t1.stream(true) << '\n'; // Symbolically auto importDate = table.getStrCol("ImportDate"); auto ticker = table.getStrCol("Ticker"); + auto close = table.getNumCol("Close"); auto volume = table.getNumCol("Volume"); - auto t2 = table.where(importDate == "2017-11-01" && ticker == "AAPL" && volume % 10 == volume % 100) - .select(ticker, volume); + + auto t2 = table.where(importDate == "2017-11-01" && ticker == "AAPL") + .select((volume * close).as("MV1"), (volume + 12).as("V_plus_12")); std::cout << t2.stream(true) << '\n'; - std::vector tickerData = {"AAPL", "AAPL", "AAPL"}; - std::vector volData = {100000, 250000, 19000}; + std::vector mv1Data = {2350000, 6050000, 507300}; + std::vector mv2Data = {100012, 250012, 19012}; const TableHandle *tables[] = {&t1, &t2}; for (const auto *t : tables) { compareTable( *t, - "Ticker", tickerData, - "Volume", volData - ); + "MV1", mv1Data, + "V_plus_12", mv2Data + ); } } -TEST_CASE("New columns", "[select]") { +TEST_CASE("Simple where", "[select]") { auto tm = TableMakerForTests::create(); auto table = tm.table(); + auto updated = table.update("QQQ = i"); + // Symbolically + auto importDate = updated.getStrCol("ImportDate"); + auto ticker = updated.getStrCol("Ticker"); + auto volume = updated.getNumCol("Volume"); + // if we allowed C++17 we could do something like + // auto [importDate, ticker, volume] = table.getCol("ImportDate", "Ticker", "Volume"); - // A formula expression - auto t1 = table.where("ImportDate == `2017-11-01` && Ticker == `AAPL`") - .select("MV1 = Volume * Close", "V_plus_12 = Volume + 12"); + auto t2 = updated.where(importDate == "2017-11-01" && ticker == "IBM") + .select(ticker, volume); + std::cout << t2.stream(true) << '\n'; + + std::vector tickerData = {"IBM"}; + std::vector volData = {138000}; + + compareTable( + t2, + "Ticker", tickerData, + "Volume", volData + ); +} + +TEST_CASE("Formula in the where clause", "[select]") { + auto tm = TableMakerForTests::create(); + auto table = tm.table(); + + auto t1 = table.where("ImportDate == `2017-11-01` && Ticker == `AAPL` && Volume % 10 == Volume % 100") + .select("Ticker", "Volume"); std::cout << t1.stream(true) << '\n'; // Symbolically auto importDate = table.getStrCol("ImportDate"); auto ticker = table.getStrCol("Ticker"); - auto close = table.getNumCol("Close"); auto volume = table.getNumCol("Volume"); - - auto t2 = table.where(importDate == "2017-11-01" && ticker == "AAPL") - .select((volume * close).as("MV1"), (volume + 12).as("V_plus_12")); + auto t2 = table.where(importDate == "2017-11-01" && ticker == "AAPL" && volume % 10 == volume % 100) + .select(ticker, volume); std::cout << t2.stream(true) << '\n'; - std::vector mv1Data = {2350000, 6050000, 507300}; - std::vector mv2Data = {100012, 250012, 19012}; + std::vector tickerData = {"AAPL", "AAPL", "AAPL"}; + std::vector volData = {100000, 250000, 19000}; const TableHandle *tables[] = {&t1, &t2}; for (const auto *t : tables) { compareTable( *t, - "MV1", mv1Data, - "V_plus_12", mv2Data + "Ticker", tickerData, + "Volume", volData ); } } + +TEST_CASE("Simple 'where' with syntax error", "[select]") { + auto tm = TableMakerForTests::create(); + auto table = tm.table(); + + try { + // String literal + auto t1 = table.where(")))))"); + std::cout << t1.stream(true) << '\n'; + } catch (const std::exception &e) { + // Expected + streamf(std::cerr, "Caught *expected* exception %o\n", e.what()); + return; + } + throw std::runtime_error("Expected a failure, but didn't experience one"); +} } // namespace deephaven::client::tests diff --git a/cpp-client/tests/test_util.cc b/cpp-client/tests/test_util.cc index a5cc7ed9b75..7dd45ec2548 100644 --- a/cpp-client/tests/test_util.cc +++ b/cpp-client/tests/test_util.cc @@ -96,9 +96,7 @@ ColumnDataForTests &ColumnDataForTests::operator=(ColumnDataForTests &&other) no ColumnDataForTests::~ColumnDataForTests() = default; TableMakerForTests TableMakerForTests::create() { - std::string connectionString("localhost:10000"); - streamf(std::cerr, "Connecting to %o\n", connectionString); - auto client = Client::connect("localhost:10000"); + auto client = createClient(); auto manager = client.getManager(); ColumnNamesForTests cn; @@ -115,6 +113,13 @@ TableMakerForTests TableMakerForTests::create() { return TableMakerForTests(std::move(client), std::move(testTable), std::move(cn), std::move(cd)); } +Client TableMakerForTests::createClient() { + std::string connectionString("localhost:10000"); + streamf(std::cerr, "Connecting to %o\n", connectionString); + auto client = Client::connect(connectionString); + return client; +} + TableMakerForTests::TableMakerForTests(TableMakerForTests &&) noexcept = default; TableMakerForTests &TableMakerForTests::operator=(TableMakerForTests &&) noexcept = default; TableMakerForTests::~TableMakerForTests() = default; @@ -129,7 +134,7 @@ void compareTableHelper(int depth, const std::shared_ptr &table, if (field->name() != columnName) { auto message = stringf("Column %o: Expected column name %o, have %o", depth, columnName, field->name()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } arrow::ChunkedArray chunkedData(data); @@ -140,13 +145,13 @@ void compareTableHelper(int depth, const std::shared_ptr &table, if (column->length() != chunkedData.length()) { auto message = stringf("Column %o: Expected length %o, got %o", depth, chunkedData.length(), column->length()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } if (!column->type()->Equals(chunkedData.type())) { auto message = stringf("Column %o: Expected type %o, got %o", depth, chunkedData.type()->ToString(), column->type()->ToString()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } int64_t elementIndex = 0; @@ -156,7 +161,7 @@ void compareTableHelper(int depth, const std::shared_ptr &table, int rChunkIndex = 0; while (elementIndex < column->length()) { if (lChunkNum >= column->num_chunks() || rChunkNum >= chunkedData.num_chunks()) { - throw std::runtime_error("sad"); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Logic error")); } const auto &lChunk = column->chunk(lChunkNum); if (lChunkIndex == lChunk->length()) { @@ -178,7 +183,7 @@ void compareTableHelper(int depth, const std::shared_ptr &table, if (!lItem->Equals(rItem)) { auto message = stringf("Column %o: Columns differ at element %o: %o vs %o", depth, elementIndex, lItem->ToString(), rItem->ToString()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } ++elementIndex; @@ -186,7 +191,8 @@ void compareTableHelper(int depth, const std::shared_ptr &table, ++rChunkIndex; } - throw std::runtime_error("Some other difference (TODO(kosak): describe difference)"); + // TODO(kosak): describe difference + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG("Some other difference")); } std::shared_ptr basicValidate(const TableHandle &table, int expectedColumns) { @@ -197,7 +203,7 @@ std::shared_ptr basicValidate(const TableHandle &table, int expect if (expectedColumns != arrowTable->num_columns()) { auto message = stringf("Expected %o columns, but table actually has %o columns", expectedColumns, arrowTable->num_columns()); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } return arrowTable; diff --git a/cpp-client/tests/test_util.h b/cpp-client/tests/test_util.h index 8726b947fc7..042c24a84f7 100644 --- a/cpp-client/tests/test_util.h +++ b/cpp-client/tests/test_util.h @@ -70,6 +70,10 @@ class TableMakerForTests { typedef deephaven::client::TableHandle TableHandle; public: static TableMakerForTests create(); + /** + * If you just want the Client. + */ + static Client createClient(); TableMakerForTests(TableMakerForTests &&) noexcept; TableMakerForTests &operator=(TableMakerForTests &&) noexcept; @@ -99,7 +103,7 @@ void compareTableHelper(int depth, const std::shared_ptr &table, const std::string &columnName, const std::shared_ptr &data); // base case -inline void compareTableRecurse(int depth, const std::shared_ptr &table) { +inline void compareTableRecurse(int /*depth*/, const std::shared_ptr &/*table*/) { } template diff --git a/cpp-client/tests/ticking_test.cc b/cpp-client/tests/ticking_test.cc new file mode 100644 index 00000000000..4c3b5df5f5f --- /dev/null +++ b/cpp-client/tests/ticking_test.cc @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include +#include +#include +#include +#include +#include "tests/third_party/catch.hpp" +#include "tests/test_util.h" +#include "deephaven/client/client.h" +#include "deephaven/client/utility/utility.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::Client; +using deephaven::client::NumCol; +using deephaven::client::StrCol; +using deephaven::client::TableHandle; +using deephaven::client::utility::streamf; +using deephaven::client::utility::stringf; +using deephaven::client::utility::TableMaker; + +namespace deephaven::client::tests { +class CommonBase : public deephaven::client::TickingCallback { +public: + void onFailure(std::exception_ptr ep) final { + std::unique_lock guard(mutex_); + exceptionPtr_ = std::move(ep); + condVar_.notify_all(); + } + + std::pair waitForUpdate() { + std::unique_lock guard(mutex_); + while (true) { + if (done_ || exceptionPtr_ != nullptr) { + return std::make_pair(done_, exceptionPtr_); + } + condVar_.wait(guard); + } + } + +protected: + void notifyDone() { + std::unique_lock guard(mutex_); + done_ = true; + condVar_.notify_all(); + } + + std::mutex mutex_; + std::condition_variable condVar_; + bool done_ = false; + std::exception_ptr exceptionPtr_; + +}; + +class ReachesNRowsCallback final : public CommonBase { +public: + explicit ReachesNRowsCallback(size_t targetRows) : targetRows_(targetRows) {} + + void onTick(deephaven::client::TickingUpdate update) final { + std::cout << "=== The Full Table ===\n" + << update.current()->stream(true, true) + << '\n'; + if (update.current()->numRows() >= targetRows_) { + notifyDone(); + } + } + +private: + size_t targetRows_ = 0; +}; + +TEST_CASE("Ticking table eventually reaches 10 rows", "[ticking]") { + const auto maxRows = 10; + auto client = TableMakerForTests::createClient(); + auto tm = client.getManager(); + + auto table = tm.timeTable(0, 500'000'000).update("II = ii"); + table.bindToVariable("ticking"); + auto callback = std::make_shared(maxRows); + auto cookie = table.subscribe(callback); + + while (true) { + auto [done, eptr] = callback->waitForUpdate(); + if (done) { + break; + } + if (eptr != nullptr) { + std::rethrow_exception(eptr); + } + } + + table.unsubscribe(std::move(cookie)); +} + +class AllValuesGreaterThanNCallback final : public CommonBase { +public: + explicit AllValuesGreaterThanNCallback(int64_t target) : target_(target) {} + + void onTick(deephaven::client::TickingUpdate update) final { + const auto ¤t = update.current(); + std::cout << "=== The Full Table ===\n" + << current->stream(true, true) + << '\n'; + if (current->numRows() == 0) { + return; + } + auto col = current->getColumn("Value", true); + auto rs = current->getRowSequence(); + auto data = Int64Chunk::create(rs->size()); + col->fillChunk(*rs, &data, nullptr); + auto allGreater = true; + for (auto element : data) { + if (element < target_) { + allGreater = false; + break; + } + } + if (allGreater) { + notifyDone(); + } + } + +private: + int64_t target_ = 0; +}; + +TEST_CASE("Ticking table modified rows are eventually all greater than 10", "[ticking]") { + const int64_t target = 10; + auto client = TableMakerForTests::createClient(); + auto tm = client.getManager(); + + auto table = tm.timeTable(0, 500'000'000) + .view({"Key = (long)(ii % 10)", "Value = ii"}) + .lastBy("Key"); + table.bindToVariable("ticking"); + auto callback = std::make_shared(target); + auto cookie = table.subscribe(callback); + + while (true) { + auto [done, eptr] = callback->waitForUpdate(); + if (done) { + break; + } + if (eptr != nullptr) { + std::rethrow_exception(eptr); + } + } + + table.unsubscribe(std::move(cookie)); +} +} // namespace deephaven::client::tests From 4622b7cb1747ddc9ed455b094dfbb677bf9b7cc2 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 29 Sep 2022 07:00:14 -0700 Subject: [PATCH 161/215] Ensure python session execution context is used for python tests (#2926) --- py/server/test_helper/__init__.py | 1 - py/server/tests/test_exec_ctx.py | 3 +- py/server/tests/test_learn_gather.py | 32 +++++++++---------- .../tests/test_numba_vectorized_column.py | 4 +-- .../tests/test_numba_vectorized_filter.py | 4 +-- py/server/tests/testbase.py | 3 +- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/py/server/test_helper/__init__.py b/py/server/test_helper/__init__.py index 675b012a89b..76085f41632 100644 --- a/py/server/test_helper/__init__.py +++ b/py/server/test_helper/__init__.py @@ -99,7 +99,6 @@ def start_jvm(jvm_props: Dict[str, str] = None): py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals() global py_dh_session py_dh_session = jpy.get_type("io.deephaven.integrations.python.PythonDeephavenSession")(py_scope_jpy) - py_dh_session.getExecutionContext().open() def _expandWildcardsInList(elements): diff --git a/py/server/tests/test_exec_ctx.py b/py/server/tests/test_exec_ctx.py index eb2ca19d70f..778c117bc86 100644 --- a/py/server/tests/test_exec_ctx.py +++ b/py/server/tests/test_exec_ctx.py @@ -8,9 +8,10 @@ from deephaven import DHError from deephaven import empty_table from deephaven.execution_context import get_exec_ctx, make_user_exec_ctx +from tests.testbase import BaseTestCase -class ExecCtxTestCase(unittest.TestCase): +class ExecCtxTestCase(BaseTestCase): def test_exec_ctx_threads(self): def assert_threads_ok(thread_func): diff --git a/py/server/tests/test_learn_gather.py b/py/server/tests/test_learn_gather.py index 5370c641be0..611a3ebcb50 100644 --- a/py/server/tests/test_learn_gather.py +++ b/py/server/tests/test_learn_gather.py @@ -14,82 +14,82 @@ class LearnGatherTestCase(BaseTestCase): """ Test cases for deephaven.learn submodule. """ - @classmethod - def setUpClass(cls): + def setUp(self): + super().setUp() """ Inherited method allowing initialization of test environment. """ # Tables - cls.bool_table = empty_table(100).update([ + self.bool_table = empty_table(100).update([ "X = true", "Y = false", "Z = (i % 2 == 0) ? true : false", ] ) - cls.byte_table = empty_table(100).update([ + self.byte_table = empty_table(100).update([ "X = (byte)i", "Y = (byte)(100 - X)", "Z = (byte)(-101 + X)", ] ) - cls.short_table = empty_table(100).update([ + self.short_table = empty_table(100).update([ "X = (short)i", "Y = (short)(100 - X)", "Z = (short)(-101 + X)", ] ) - cls.int_table = empty_table(100).update([ + self.int_table = empty_table(100).update([ "X = (int)i", "Y = 100 - X", "Z = -101 + X", ] ) - cls.long_table = empty_table(100).update([ + self.long_table = empty_table(100).update([ "X = (long)i", "Y = 100 - X", "Z = -101 + X", ] ) - cls.float_table = empty_table(100).update([ + self.float_table = empty_table(100).update([ "X = (float)i", "Y = (float)sqrt(X)", "Z = (float)sqrt(Y)", ] ) - cls.double_table = empty_table(100).update([ + self.double_table = empty_table(100).update([ "X = (double)i", "Y = sqrt(X)", "Z = sqrt(Y)", ] ) # NumPy arrays - cls.bool_array = \ + self.bool_array = \ np.array([[True, False, True], [True, False, False]] * 50, dtype=np.bool_) - cls.byte_array = np.vstack(( + self.byte_array = np.vstack(( np.arange(0, 100, dtype=np.byte), np.arange(100, 0, -1, dtype=np.byte), np.arange(-101, -1, dtype=np.byte) )).T - cls.short_array = np.vstack(( + self.short_array = np.vstack(( np.arange(0, 100, dtype=np.short), np.arange(100, 0, -1, dtype=np.short), np.arange(-101, -1, dtype=np.short) )).T - cls.int_array = np.vstack(( + self.int_array = np.vstack(( np.arange(0, 100, dtype=np.intc), np.arange(100, 0, -1, dtype=np.intc), np.arange(-101, -1, dtype=np.intc) )).T - cls.long_array = np.vstack(( + self.long_array = np.vstack(( np.arange(0, 100, dtype=np.int_), np.arange(100, 0, -1, dtype=np.int_), np.arange(-101, -1, dtype=np.int_) )).T - cls.float_array = np.vstack(( + self.float_array = np.vstack(( np.arange(0, 100, dtype=np.single), np.sqrt(np.arange(0, 100, dtype=np.single)), np.sqrt(np.sqrt(np.arange(0, 100, dtype=np.single))) )).T - cls.double_array = np.vstack(( + self.double_array = np.vstack(( np.arange(0, 100, dtype=np.double), np.sqrt(np.arange(0, 100, dtype=np.double)), np.sqrt(np.sqrt(np.arange(0, 100, dtype=np.double))) diff --git a/py/server/tests/test_numba_vectorized_column.py b/py/server/tests/test_numba_vectorized_column.py index f1252b8b3ab..c04ec5e778c 100644 --- a/py/server/tests/test_numba_vectorized_column.py +++ b/py/server/tests/test_numba_vectorized_column.py @@ -8,14 +8,14 @@ from deephaven import empty_table from deephaven.html import to_html - +from tests.testbase import BaseTestCase @vectorize([int64(int64, int64)]) def vectorized_func(x, y): return x % 3 + y -class TestClass(unittest.TestCase): +class TestClass(BaseTestCase): def test_part_of_expr(self): with self.assertRaises(Exception): diff --git a/py/server/tests/test_numba_vectorized_filter.py b/py/server/tests/test_numba_vectorized_filter.py index ea296abc207..9d730812e6e 100644 --- a/py/server/tests/test_numba_vectorized_filter.py +++ b/py/server/tests/test_numba_vectorized_filter.py @@ -8,7 +8,7 @@ from deephaven import empty_table from deephaven.html import to_html - +from tests.testbase import BaseTestCase @vectorize([boolean(int64, int64)]) def vectorized_func(x, y): @@ -20,7 +20,7 @@ def vectorized_func_wrong_return_type(x, y): return x % 2 > y % 5 -class TestClass(unittest.TestCase): +class TestClass(BaseTestCase): def test_wrong_return_type(self): with self.assertRaises(Exception): diff --git a/py/server/tests/testbase.py b/py/server/tests/testbase.py index 736488cc5b2..a1d105b9811 100644 --- a/py/server/tests/testbase.py +++ b/py/server/tests/testbase.py @@ -8,7 +8,6 @@ import jpy from deephaven import DHError -from deephaven.execution_context import make_user_exec_ctx from deephaven.ugp import exclusive_lock from deephaven.table import Table @@ -36,7 +35,7 @@ def tearDownClass(cls) -> None: ... def setUp(self) -> None: - self._execution_context = make_user_exec_ctx().j_exec_ctx.open() + self._execution_context = py_dh_session.getExecutionContext().open() def tearDown(self) -> None: self._execution_context.close() From 2c24ae407ad4e09dea59d406cdbb0049b31c935e Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 29 Sep 2022 07:03:37 -0700 Subject: [PATCH 162/215] Fix QueryScope uri resolution from python (#2927) Fixes #2893 --- py/server/deephaven/uri.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/py/server/deephaven/uri.py b/py/server/deephaven/uri.py index 3530e90cf0c..a70181c1356 100644 --- a/py/server/deephaven/uri.py +++ b/py/server/deephaven/uri.py @@ -4,7 +4,7 @@ """ Tools for resolving Uniform Resource Identifiers (URIs) into objects. """ -from typing import Union +from typing import Any import jpy @@ -14,9 +14,9 @@ _JResolveTools = jpy.get_type("io.deephaven.uri.ResolveTools") -def resolve(uri: str) -> Union[jpy.JType, JObjectWrapper]: +def resolve(uri: str) -> Any: """Resolves a Uniform Resource Identifier (URI) string into an object. Objects with custom Python wrappers, - like Table, return an instance of the wrapper class; otherwise, the raw Java object is returned. + like Table, return an instance of the wrapper class; otherwise, the Java or Python object is returned. Args: @@ -30,6 +30,9 @@ def resolve(uri: str) -> Union[jpy.JType, JObjectWrapper]: """ try: - return wrap_j_object(_JResolveTools.resolve(uri)) + # When grabbing something out of the query scope, it may already be presented as a PyObject; in which case, + # when the value gets back into python, it's a native python type - in which case, we don't need to wrap it. + item = _JResolveTools.resolve(uri) + return wrap_j_object(item) if isinstance(item, jpy.JType) else item except Exception as e: raise DHError(e, "failed to resolve the URI.") from e From c3f413c44753a75f1a7b792a5f53fe653296793a Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 29 Sep 2022 07:06:50 -0700 Subject: [PATCH 163/215] Compute targetUrl based on ServerConfig (#2925) --- buildSrc/src/main/groovy/Classpaths.groovy | 6 +-- server/build.gradle | 2 + .../deephaven/server/config/ServerConfig.java | 45 +++++++++++++++++ .../server/runner/DeephavenApiServer.java | 13 ++--- ...avenApiServerInProcessGroovyComponent.java | 48 ------------------ ...avenApiServerInProcessPythonComponent.java | 50 ------------------- .../runner/ServerBuilderInProcessModule.java | 6 --- .../runner/DeephavenApiServerTestBase.java | 28 ++++++----- .../runner/DeephavenApiServerTestConfig.java | 18 +++++++ 9 files changed, 91 insertions(+), 125 deletions(-) delete mode 100644 server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java delete mode 100644 server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java create mode 100644 server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestConfig.java diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 808392c6bf7..1e208b6a8d1 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -211,10 +211,10 @@ class Classpaths { addDependency(ap, AUTOSERVICE_GROUP, AUTOSERVICE_COMPILER, AUTOSERVICE_VERSION) } - static void inheritImmutables(Project p) { - Configuration ap = p.configurations.getByName('annotationProcessor') + static void inheritImmutables(Project p, boolean test = false) { + Configuration ap = p.configurations.getByName(test ? 'testAnnotationProcessor' : 'annotationProcessor') addDependency(ap, IMMUTABLES_GROUP, IMMUTABLES_NAME, IMMUTABLES_VERSION) - p.getDependencies().add('compileOnly', p.project(':util-immutables')) + p.getDependencies().add(test ? 'testCompileOnly' : 'compileOnly', p.project(':util-immutables')) } static void inheritJUnitClassic(Project p, String configName) { diff --git a/server/build.gradle b/server/build.gradle index 84e2e811b9b..0d6dab7ca60 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -94,6 +94,8 @@ dependencies { testRuntimeOnly project(':log-to-slf4j') Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly') + + Classpaths.inheritImmutables(project, true) } TestTools.addEngineOutOfBandTest(project) diff --git a/server/src/main/java/io/deephaven/server/config/ServerConfig.java b/server/src/main/java/io/deephaven/server/config/ServerConfig.java index d52d04313d3..7d5bd7b834a 100644 --- a/server/src/main/java/io/deephaven/server/config/ServerConfig.java +++ b/server/src/main/java/io/deephaven/server/config/ServerConfig.java @@ -29,6 +29,8 @@ public interface ServerConfig { String HTTP_PORT = "http.port"; + String HTTP_TARGET_URL = "http.targetUrl"; + String SCHEDULER_POOL_SIZE = "scheduler.poolSize"; String GRPC_MAX_INBOUND_MESSAGE_SIZE = "grpc.maxInboundMessageSize"; @@ -56,6 +58,10 @@ public interface ServerConfig { *
    * * + * + * + * + * * * * @@ -82,6 +88,7 @@ static > B buildFromConfig(B builder, Configuration conf int httpSessionExpireMs = config.getIntegerWithDefault(HTTP_SESSION_DURATION_MS, -1); String httpHost = config.getStringWithDefault(HTTP_HOST, null); int httpPort = config.getIntegerWithDefault(HTTP_PORT, -1); + String httpTargetUrl = config.getStringWithDefault(HTTP_TARGET_URL, null); int schedulerPoolSize = config.getIntegerWithDefault(SCHEDULER_POOL_SIZE, -1); int maxInboundMessageSize = config.getIntegerWithDefault(GRPC_MAX_INBOUND_MESSAGE_SIZE, -1); String proxyHint = config.getStringWithDefault(PROXY_HINT, null); @@ -94,6 +101,9 @@ static > B buildFromConfig(B builder, Configuration conf if (httpPort != -1) { builder.port(httpPort); } + if (httpTargetUrl != null) { + builder.targetUrl(httpTargetUrl); + } if (schedulerPoolSize != -1) { builder.schedulerPoolSize(schedulerPoolSize); } @@ -119,6 +129,11 @@ static > B buildFromConfig(B builder, Configuration conf */ int port(); + /** + * The user-accessible target URL. + */ + Optional targetUrl(); + /** * The optional SSL configuration. */ @@ -160,11 +175,41 @@ default int maxInboundMessageSize() { @Nullable Boolean proxyHint(); + /** + * Returns {@link #targetUrl()} if set, otherwise computes a reasonable default based on {@link #host()}, + * {@link #port()}, and {@link #ssl()}. + * + * @return the target URL or default + */ + default String targetUrlOrDefault() { + final Optional targetUrl = targetUrl(); + if (targetUrl.isPresent()) { + return targetUrl.get(); + } + final String host = host().orElse("localhost"); + final int port = port(); + if (ssl().isPresent()) { + if (port == 443) { + return String.format("https://%s", host); + } else { + return String.format("https://%s:%d", host, port); + } + } else { + if (port == 80) { + return String.format("http://%s", host); + } else { + return String.format("http://%s:%d", host, port); + } + } + } + interface Builder> { B host(String host); B port(int port); + B targetUrl(String targetUrl); + B ssl(SSLConfig ssl); B outboundSsl(SSLConfig outboundSsl); diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index 5f47aa89fbc..b2c1e01f6bf 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -4,7 +4,6 @@ package io.deephaven.server.runner; import io.deephaven.auth.AuthenticationRequestHandler; -import io.deephaven.configuration.Configuration; import io.deephaven.engine.context.ExecutionContext; import io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder; import io.deephaven.engine.table.impl.perf.UpdatePerformanceTracker; @@ -16,6 +15,7 @@ import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; import io.deephaven.server.appmode.ApplicationInjector; +import io.deephaven.server.config.ServerConfig; import io.deephaven.server.log.LogInit; import io.deephaven.server.plugin.PluginRegistration; import io.deephaven.server.session.SessionService; @@ -40,9 +40,6 @@ public class DeephavenApiServer { private static final Logger log = LoggerFactory.getLogger(DeephavenApiServer.class); - private static final String TARGET_URL = Configuration.getInstance() - .getStringWithDefault("TargetUrl", "https://localhost:10000/"); - private final GrpcServer server; private final UpdateGraphProcessor ugp; private final LogInit logInit; @@ -53,6 +50,7 @@ public class DeephavenApiServer { private final SessionService sessionService; private final Map authenticationHandlers; private final Provider executionContextProvider; + private final ServerConfig serverConfig; @Inject public DeephavenApiServer( @@ -65,7 +63,8 @@ public DeephavenApiServer( final UriResolvers uriResolvers, final SessionService sessionService, final Map authenticationHandlers, - final Provider executionContextProvider) { + final Provider executionContextProvider, + final ServerConfig serverConfig) { this.server = server; this.ugp = ugp; this.logInit = logInit; @@ -76,6 +75,7 @@ public DeephavenApiServer( this.sessionService = sessionService; this.authenticationHandlers = authenticationHandlers; this.executionContextProvider = executionContextProvider; + this.serverConfig = serverConfig; } @VisibleForTesting @@ -145,7 +145,8 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time applicationInjector.run(); log.info().append("Initializing Authentication...").endl(); - authenticationHandlers.forEach((name, handler) -> handler.initialize(TARGET_URL)); + final String targetUrl = serverConfig.targetUrlOrDefault(); + authenticationHandlers.forEach((name, handler) -> handler.initialize(targetUrl)); log.info().append("Starting server...").endl(); server.start(); diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java deleted file mode 100644 index 346d4e59bb0..00000000000 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessGroovyComponent.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.runner; - -import dagger.BindsInstance; -import dagger.Component; -import io.deephaven.server.console.SessionToExecutionStateModule; -import io.deephaven.server.console.groovy.GroovyConsoleSessionModule; -import io.deephaven.server.log.LogModule; -import io.grpc.ManagedChannelBuilder; - -import javax.inject.Named; -import javax.inject.Singleton; -import java.io.PrintStream; - -@Singleton -@Component(modules = { - DeephavenApiServerModule.class, - LogModule.class, - GroovyConsoleSessionModule.class, - ServerBuilderInProcessModule.class, - SessionToExecutionStateModule.class, -}) -public interface DeephavenApiServerInProcessGroovyComponent { - - DeephavenApiServer getServer(); - - ManagedChannelBuilder channelBuilder(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder withSchedulerPoolSize(@Named("scheduler.poolSize") int numThreads); - - @BindsInstance - Builder withSessionTokenExpireTmMs(@Named("session.tokenExpireMs") long tokenExpireMs); - - @BindsInstance - Builder withOut(@Named("out") PrintStream out); - - @BindsInstance - Builder withErr(@Named("err") PrintStream err); - - DeephavenApiServerInProcessGroovyComponent build(); - } -} diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java deleted file mode 100644 index 83c84b4eb0c..00000000000 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerInProcessPythonComponent.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.server.runner; - -import dagger.BindsInstance; -import dagger.Component; -import io.deephaven.server.console.SessionToExecutionStateModule; -import io.deephaven.server.console.python.PythonConsoleSessionModule; -import io.deephaven.server.console.python.PythonGlobalScopeCopyModule; -import io.deephaven.server.log.LogModule; -import io.grpc.ManagedChannelBuilder; - -import javax.inject.Named; -import javax.inject.Singleton; -import java.io.PrintStream; - -@Singleton -@Component(modules = { - DeephavenApiServerModule.class, - LogModule.class, - PythonConsoleSessionModule.class, - PythonGlobalScopeCopyModule.class, - ServerBuilderInProcessModule.class, - SessionToExecutionStateModule.class, -}) -public interface DeephavenApiServerInProcessPythonComponent { - - DeephavenApiServer getServer(); - - ManagedChannelBuilder channelBuilder(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder withSchedulerPoolSize(@Named("scheduler.poolSize") int numThreads); - - @BindsInstance - Builder withSessionTokenExpireTmMs(@Named("session.tokenExpireMs") long tokenExpireMs); - - @BindsInstance - Builder withOut(@Named("out") PrintStream out); - - @BindsInstance - Builder withErr(@Named("err") PrintStream err); - - DeephavenApiServerInProcessPythonComponent build(); - } -} diff --git a/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java b/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java index 29c6fb410c4..fbee32ce019 100644 --- a/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java +++ b/server/src/main/java/io/deephaven/server/runner/ServerBuilderInProcessModule.java @@ -56,12 +56,6 @@ static ManagedChannelBuilder channelBuilder(@Named("serverName") String serve return InProcessChannelBuilder.forName(serverName); } - @Provides - @Named("client.sslConfig") - static SSLConfig providesSSLConfigForClient() { - return SSLConfig.empty(); - } - /** * Deephaven has some defensive implementations of Drainable / InputStream that don't actually implement the read * methods of InputStream. This works when going over the wire, but when doing an in-process exchange, the defensive diff --git a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java index af4a3f8d729..d2a0445e6ee 100644 --- a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java +++ b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestBase.java @@ -5,13 +5,13 @@ import dagger.BindsInstance; import dagger.Component; -import io.deephaven.engine.context.ExecutionContext; -import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.liveness.LivenessScopeStack; +import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.io.logger.LogBuffer; import io.deephaven.io.logger.LogBufferGlobal; import io.deephaven.proto.DeephavenChannel; +import io.deephaven.server.config.ServerConfig; import io.deephaven.server.console.NoConsoleSessionModule; import io.deephaven.server.log.LogModule; import io.deephaven.util.SafeCloseable; @@ -25,6 +25,7 @@ import javax.inject.Named; import javax.inject.Singleton; import java.io.PrintStream; +import java.time.Duration; import java.util.concurrent.TimeUnit; /** @@ -34,6 +35,7 @@ public abstract class DeephavenApiServerTestBase { @Singleton @Component(modules = { DeephavenApiServerModule.class, + DeephavenApiConfigModule.class, LogModule.class, NoConsoleSessionModule.class, ServerBuilderInProcessModule.class, @@ -49,10 +51,7 @@ public interface TestComponent { interface Builder { @BindsInstance - Builder withSchedulerPoolSize(@Named("scheduler.poolSize") int numThreads); - - @BindsInstance - Builder withSessionTokenExpireTmMs(@Named("session.tokenExpireMs") long tokenExpireMs); + Builder withServerConfig(ServerConfig serverConfig); @BindsInstance Builder withOut(@Named("out") PrintStream out); @@ -80,9 +79,14 @@ public void setUp() throws Exception { logBuffer = new LogBuffer(128); LogBufferGlobal.setInstance(logBuffer); + final DeephavenApiServerTestConfig config = DeephavenApiServerTestConfig.builder() + .schedulerPoolSize(4) + .tokenExpire(sessionTokenExpireTime()) + .port(-1) + .build(); + serverComponent = DaggerDeephavenApiServerTestBase_TestComponent.builder() - .withSchedulerPoolSize(4) - .withSessionTokenExpireTmMs(sessionTokenExpireTmMs()) + .withServerConfig(config) .withOut(System.out) .withErr(System.err) .build(); @@ -110,14 +114,14 @@ public DeephavenApiServer server() { } /** - * The session token expiration, in milliseconds. + * The session token expiration * - * @return the session token expiration, in milliseconds. + * @return the session token expiration */ - public long sessionTokenExpireTmMs() { + public Duration sessionTokenExpireTime() { // Long expiration is useful for debugging sessions, and the majority of tests should not worry about // re-authentication. Any test classes that need an explicit token expiration should override this method. - return TimeUnit.DAYS.toMillis(7); + return Duration.ofDays(7); } public ManagedChannelBuilder channelBuilder() { diff --git a/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestConfig.java b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestConfig.java new file mode 100644 index 00000000000..2d65fdf87d1 --- /dev/null +++ b/server/src/test/java/io/deephaven/server/runner/DeephavenApiServerTestConfig.java @@ -0,0 +1,18 @@ +package io.deephaven.server.runner; + +import io.deephaven.annotations.BuildableStyle; +import io.deephaven.server.config.ServerConfig; +import org.immutables.value.Value.Immutable; + +@Immutable +@BuildableStyle +public abstract class DeephavenApiServerTestConfig implements ServerConfig { + + public static Builder builder() { + return ImmutableDeephavenApiServerTestConfig.builder(); + } + + public interface Builder extends ServerConfig.Builder { + + } +} From 6d5684fcb6e2f6b8f94109f4c5d32065ea0ef0c9 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 29 Sep 2022 15:57:52 -0500 Subject: [PATCH 164/215] Always create an empty array, in case the provided columns are null (#2933) Fixes #2932 --- .../web/client/api/subscription/TableViewportSubscription.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java index 04767c8cd8e..c68d7f145d4 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/subscription/TableViewportSubscription.java @@ -122,7 +122,7 @@ public TableViewportSubscription(double firstRow, double lastRow, Column[] colum batcher.setFlat(true); }); // TODO handle updateInterval core#188 - Column[] columnsToSub = table.isStreamTable() ? table.getColumns().asArray(columns) : columns; + Column[] columnsToSub = table.isStreamTable() ? table.getColumns().asArray(new Column[0]) : columns; table.setInternalViewport(firstRow, lastRow, columnsToSub); // Listen for events and refire them on ourselves, optionally on the original table From 2616d2c0bd344f03cadeef00360b6b557079cc7a Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 29 Sep 2022 15:03:47 -0700 Subject: [PATCH 165/215] Remove anonymous authentication warning logging (#2935) --- .../auth/AnonymousAuthenticationHandler.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java b/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java index c5a422d12fa..073f86cfc40 100644 --- a/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java +++ b/authentication/src/main/java/io/deephaven/auth/AnonymousAuthenticationHandler.java @@ -20,16 +20,8 @@ public String getAuthType() { @Override public void initialize(String targetUrl) { - for (int ii = 0; ii < 5; ++ii) { - log.warn().endl(); - } - log.warn().append("================================================================================").endl(); - log.warn().append("WARNING! Anonymous authentication is enabled. This is not recommended!").endl(); - log.warn().append(" Listening on ").append(targetUrl).endl(); - log.warn().append("================================================================================").endl(); - for (int ii = 0; ii < 5; ++ii) { - log.warn().endl(); - } + // TODO(deephaven-core#2934): Enable anonymous authentication warning + log.info().append("Anonymous authentication is enabled. Listening on ").append(targetUrl).endl(); } @Override From c72a08d4fb4932285469d6cf5d3ed23ea1997051 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 30 Sep 2022 09:50:11 -0500 Subject: [PATCH 166/215] Set correct cache headers for js api/ui resources in jetty (#2937) --- .../io/deephaven/server/jetty/JettyBackedGrpcServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index 146de8434bd..2e3781ed243 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -66,8 +66,9 @@ public JettyBackedGrpcServer( // For the Web UI, cache everything in the static folder // https://create-react-app.dev/docs/production-build/#static-file-caching - context.addFilter(NoCacheFilter.class, "/iriside/*", EnumSet.noneOf(DispatcherType.class)); - context.addFilter(CacheFilter.class, "/iriside/static/*", EnumSet.noneOf(DispatcherType.class)); + context.addFilter(NoCacheFilter.class, "/ide/*", EnumSet.noneOf(DispatcherType.class)); + context.addFilter(NoCacheFilter.class, "/jsapi/*", EnumSet.noneOf(DispatcherType.class)); + context.addFilter(CacheFilter.class, "/ide/static/*", EnumSet.noneOf(DispatcherType.class)); // Always add eTags context.setInitParameter("org.eclipse.jetty.servlet.Default.etags", "true"); From e88a41a9f44e2c92df74f4c86b95ad9e2e273630 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 3 Oct 2022 10:38:15 -0500 Subject: [PATCH 167/215] Implement gRPC storage API for notebooks and layouts (#2843) This patch aims to replace existing WebDAV use cases with something that can be rolled into the main server process, and leaves room to establish additional authorization rules and use case conventions around this feature. The present implementation is built to allow the server implementation to be replaced by something else that would use deephaven-server dependencies and is backed by something other than the file system. The expectation is that this isn't specific to notebooks, but serves as a general storage API for clients, so they can read/write their own data/code, and possibly share some code. Likely, this would be read-only or largely unavailable by non-privileged users. It could be that different users see different contents to the same top-level directory in some future implementation, but for this version a single directory is made available to all users. Also introduces a JavaScript API for this and other upcoming features, in the form of dh.CoreClient, a starting point to connect to a deephaven-core instance or cluster. At this time authentication is not implemented, but will be soon - only the storage service is exposed. Fixes #1768 --- docker-compose-common.yml | 2 +- go/internal/proto/storage/storage.pb.go | 1128 +++++++++++++++++ go/internal/proto/storage/storage_grpc.pb.go | 299 +++++ proto/proto-backplane-grpc/Dockerfile | 12 +- .../main/proto/deephaven/proto/storage.proto | 124 ++ proto/raw-js-openapi/src/index.js | 4 + py/client/pydeephaven/proto/storage_pb2.py | 56 + .../pydeephaven/proto/storage_pb2_grpc.py | 256 ++++ server/jetty-app/build.gradle | 1 + .../FilesystemStorageServiceGrpcImpl.java | 296 +++++ .../FilesystemStorageServiceModule.java | 16 + .../runner/DeephavenApiServerModule.java | 2 + .../deephaven/web/client/api/CoreClient.java | 67 + .../web/client/api/LoginCredentials.java | 47 + .../io/deephaven/web/client/api/UserInfo.java | 4 + .../web/client/api/WorkerConnection.java | 7 + .../client/api/storage/JsFileContents.java | 72 ++ .../web/client/api/storage/JsItemDetails.java | 61 + .../client/api/storage/JsStorageService.java | 175 +++ .../io/deephaven/proto/Storage_pb.java | 13 + .../storage_pb/CreateDirectoryRequest.java | 63 + .../storage_pb/CreateDirectoryResponse.java | 26 + .../proto/storage_pb/DeleteItemRequest.java | 63 + .../proto/storage_pb/DeleteItemResponse.java | 26 + .../proto/storage_pb/FetchFileRequest.java | 83 ++ .../proto/storage_pb/FetchFileResponse.java | 233 ++++ .../deephaven/proto/storage_pb/ItemInfo.java | 113 ++ .../proto/storage_pb/ItemTypeMap.java | 37 + .../proto/storage_pb/ListItemsRequest.java | 83 ++ .../proto/storage_pb/ListItemsResponse.java | 156 +++ .../proto/storage_pb/MoveItemRequest.java | 95 ++ .../proto/storage_pb/MoveItemResponse.java | 26 + .../proto/storage_pb/SaveFileRequest.java | 245 ++++ .../proto/storage_pb/SaveFileResponse.java | 67 + .../BidirectionalStream.java | 19 + .../storage_pb_service/RequestStream.java | 55 + .../storage_pb_service/ResponseStream.java | 15 + .../storage_pb_service/StorageService.java | 286 +++++ .../StorageServiceClient.java | 894 +++++++++++++ .../storage_pb_service/UnaryResponse.java | 12 + 40 files changed, 5234 insertions(+), 5 deletions(-) create mode 100644 go/internal/proto/storage/storage.pb.go create mode 100644 go/internal/proto/storage/storage_grpc.pb.go create mode 100644 proto/proto-backplane-grpc/src/main/proto/deephaven/proto/storage.proto create mode 100644 py/client/pydeephaven/proto/storage_pb2.py create mode 100644 py/client/pydeephaven/proto/storage_pb2_grpc.py create mode 100644 server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceGrpcImpl.java create mode 100644 server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceModule.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/LoginCredentials.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/UserInfo.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsFileContents.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsItemDetails.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/Storage_pb.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemInfo.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemTypeMap.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileRequest.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileResponse.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/BidirectionalStream.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/RequestStream.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/ResponseStream.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageService.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageServiceClient.java create mode 100644 web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/UnaryResponse.java diff --git a/docker-compose-common.yml b/docker-compose-common.yml index 71e5afaa9ea..753211a5d60 100644 --- a/docker-compose-common.yml +++ b/docker-compose-common.yml @@ -14,7 +14,7 @@ services: # with max memory. # # To turn on debug logging, add: -Dlogback.configurationFile=logback-debug.xml - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} + - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} -Dstorage.path=/data # # For remote debugging switch the line above for the one below (and also change the ports below) # - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} diff --git a/go/internal/proto/storage/storage.pb.go b/go/internal/proto/storage/storage.pb.go new file mode 100644 index 00000000000..7e3333b5d6c --- /dev/null +++ b/go/internal/proto/storage/storage.pb.go @@ -0,0 +1,1128 @@ +// +// Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.17.3 +// source: deephaven/proto/storage.proto + +package storage + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ItemType int32 + +const ( + ItemType_UNKNOWN ItemType = 0 // Should not be used, exists only to indicate that this was left unset + ItemType_DIRECTORY ItemType = 1 + ItemType_FILE ItemType = 2 +) + +// Enum value maps for ItemType. +var ( + ItemType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "DIRECTORY", + 2: "FILE", + } + ItemType_value = map[string]int32{ + "UNKNOWN": 0, + "DIRECTORY": 1, + "FILE": 2, + } +) + +func (x ItemType) Enum() *ItemType { + p := new(ItemType) + *p = x + return p +} + +func (x ItemType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ItemType) Descriptor() protoreflect.EnumDescriptor { + return file_deephaven_proto_storage_proto_enumTypes[0].Descriptor() +} + +func (ItemType) Type() protoreflect.EnumType { + return &file_deephaven_proto_storage_proto_enumTypes[0] +} + +func (x ItemType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ItemType.Descriptor instead. +func (ItemType) EnumDescriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{0} +} + +type ListItemsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path to the directory to list. empty to list top level + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // A pattern to filter for, with "?" to match any one character, "*" to match any number of characters, and "{}"s + // to hold a comma-separated list of possible matches. The format follows Java's FileSystem.getPathMatcher (see + // https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-), + // except without allowing subdirectories with / or **. + FilterGlob *string `protobuf:"bytes,4,opt,name=filter_glob,json=filterGlob,proto3,oneof" json:"filter_glob,omitempty"` +} + +func (x *ListItemsRequest) Reset() { + *x = ListItemsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListItemsRequest) ProtoMessage() {} + +func (x *ListItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListItemsRequest.ProtoReflect.Descriptor instead. +func (*ListItemsRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{0} +} + +func (x *ListItemsRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ListItemsRequest) GetFilterGlob() string { + if x != nil && x.FilterGlob != nil { + return *x.FilterGlob + } + return "" +} + +type ItemInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path to the item that this message describes. + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // The type of this item, either file or directory. + Type ItemType `protobuf:"varint,2,opt,name=type,proto3,enum=io.deephaven.proto.backplane.grpc.ItemType" json:"type,omitempty"` + // If this message represents a file, this is the size of the file. + Size int64 `protobuf:"zigzag64,3,opt,name=size,proto3" json:"size,omitempty"` + // Opaque string value representing a hash of the contents of this file, if available. + Etag *string `protobuf:"bytes,4,opt,name=etag,proto3,oneof" json:"etag,omitempty"` +} + +func (x *ItemInfo) Reset() { + *x = ItemInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemInfo) ProtoMessage() {} + +func (x *ItemInfo) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ItemInfo.ProtoReflect.Descriptor instead. +func (*ItemInfo) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{1} +} + +func (x *ItemInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ItemInfo) GetType() ItemType { + if x != nil { + return x.Type + } + return ItemType_UNKNOWN +} + +func (x *ItemInfo) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *ItemInfo) GetEtag() string { + if x != nil && x.Etag != nil { + return *x.Etag + } + return "" +} + +type ListItemsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of items found in the specified directory. + Items []*ItemInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ListItemsResponse) Reset() { + *x = ListItemsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListItemsResponse) ProtoMessage() {} + +func (x *ListItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListItemsResponse.ProtoReflect.Descriptor instead. +func (*ListItemsResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{2} +} + +func (x *ListItemsResponse) GetItems() []*ItemInfo { + if x != nil { + return x.Items + } + return nil +} + +type FetchFileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path to the file to read + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // If present, tells the server to not send a result if the etag matches the current file's content. + Etag *string `protobuf:"bytes,2,opt,name=etag,proto3,oneof" json:"etag,omitempty"` +} + +func (x *FetchFileRequest) Reset() { + *x = FetchFileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchFileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchFileRequest) ProtoMessage() {} + +func (x *FetchFileRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchFileRequest.ProtoReflect.Descriptor instead. +func (*FetchFileRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{3} +} + +func (x *FetchFileRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *FetchFileRequest) GetEtag() string { + if x != nil && x.Etag != nil { + return *x.Etag + } + return "" +} + +type FetchFileResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Contains the contents of the file, unless the returned etag matches the requested etag. + Contents []byte `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"` + // Represents the current etag of the requested file. If an etag was in the request and this matches, + // contents should be ignored, and the existing client copy of the file is already correct. In all + // other cases, this etag can be used in future requests to see if the file's contents are different. + Etag *string `protobuf:"bytes,2,opt,name=etag,proto3,oneof" json:"etag,omitempty"` +} + +func (x *FetchFileResponse) Reset() { + *x = FetchFileResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchFileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchFileResponse) ProtoMessage() {} + +func (x *FetchFileResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchFileResponse.ProtoReflect.Descriptor instead. +func (*FetchFileResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{4} +} + +func (x *FetchFileResponse) GetContents() []byte { + if x != nil { + return x.Contents + } + return nil +} + +func (x *FetchFileResponse) GetEtag() string { + if x != nil && x.Etag != nil { + return *x.Etag + } + return "" +} + +type SaveFileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // True to permit replacing an existing file, false to require that no file already exists with that name. + AllowOverwrite bool `protobuf:"varint,1,opt,name=allow_overwrite,json=allowOverwrite,proto3" json:"allow_overwrite,omitempty"` + // The path to the file to write contents to + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + // The contents to use when creating then file, or to use to replace the file. + Contents []byte `protobuf:"bytes,3,opt,name=contents,proto3" json:"contents,omitempty"` +} + +func (x *SaveFileRequest) Reset() { + *x = SaveFileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveFileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveFileRequest) ProtoMessage() {} + +func (x *SaveFileRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveFileRequest.ProtoReflect.Descriptor instead. +func (*SaveFileRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{5} +} + +func (x *SaveFileRequest) GetAllowOverwrite() bool { + if x != nil { + return x.AllowOverwrite + } + return false +} + +func (x *SaveFileRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *SaveFileRequest) GetContents() []byte { + if x != nil { + return x.Contents + } + return nil +} + +type SaveFileResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Represents the etag of the saved contents, so the client can check for external changes. + Etag *string `protobuf:"bytes,1,opt,name=etag,proto3,oneof" json:"etag,omitempty"` +} + +func (x *SaveFileResponse) Reset() { + *x = SaveFileResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveFileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveFileResponse) ProtoMessage() {} + +func (x *SaveFileResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveFileResponse.ProtoReflect.Descriptor instead. +func (*SaveFileResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{6} +} + +func (x *SaveFileResponse) GetEtag() string { + if x != nil && x.Etag != nil { + return *x.Etag + } + return "" +} + +// Requests to move a file to a new path, which may be in a different directory. Presently it is not +// permitted to overwrite an existing file in this way. +type MoveItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path where the file currently exists + OldPath string `protobuf:"bytes,1,opt,name=old_path,json=oldPath,proto3" json:"old_path,omitempty"` + // The path where the file should be moved to + NewPath string `protobuf:"bytes,2,opt,name=new_path,json=newPath,proto3" json:"new_path,omitempty"` + // True to permit replacing an existing file, false to require that no file already exists with that name. + AllowOverwrite bool `protobuf:"varint,3,opt,name=allow_overwrite,json=allowOverwrite,proto3" json:"allow_overwrite,omitempty"` +} + +func (x *MoveItemRequest) Reset() { + *x = MoveItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoveItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveItemRequest) ProtoMessage() {} + +func (x *MoveItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MoveItemRequest.ProtoReflect.Descriptor instead. +func (*MoveItemRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{7} +} + +func (x *MoveItemRequest) GetOldPath() string { + if x != nil { + return x.OldPath + } + return "" +} + +func (x *MoveItemRequest) GetNewPath() string { + if x != nil { + return x.NewPath + } + return "" +} + +func (x *MoveItemRequest) GetAllowOverwrite() bool { + if x != nil { + return x.AllowOverwrite + } + return false +} + +type MoveItemResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MoveItemResponse) Reset() { + *x = MoveItemResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoveItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveItemResponse) ProtoMessage() {} + +func (x *MoveItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MoveItemResponse.ProtoReflect.Descriptor instead. +func (*MoveItemResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{8} +} + +type CreateDirectoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path to the directory to create + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *CreateDirectoryRequest) Reset() { + *x = CreateDirectoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDirectoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDirectoryRequest) ProtoMessage() {} + +func (x *CreateDirectoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDirectoryRequest.ProtoReflect.Descriptor instead. +func (*CreateDirectoryRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{9} +} + +func (x *CreateDirectoryRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type CreateDirectoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateDirectoryResponse) Reset() { + *x = CreateDirectoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDirectoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDirectoryResponse) ProtoMessage() {} + +func (x *CreateDirectoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDirectoryResponse.ProtoReflect.Descriptor instead. +func (*CreateDirectoryResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{10} +} + +type DeleteItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The path to the item to delete. + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *DeleteItemRequest) Reset() { + *x = DeleteItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteItemRequest) ProtoMessage() {} + +func (x *DeleteItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteItemRequest.ProtoReflect.Descriptor instead. +func (*DeleteItemRequest) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{11} +} + +func (x *DeleteItemRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type DeleteItemResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteItemResponse) Reset() { + *x = DeleteItemResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_deephaven_proto_storage_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteItemResponse) ProtoMessage() {} + +func (x *DeleteItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_deephaven_proto_storage_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteItemResponse.ProtoReflect.Descriptor instead. +func (*DeleteItemResponse) Descriptor() ([]byte, []int) { + return file_deephaven_proto_storage_proto_rawDescGZIP(), []int{12} +} + +var File_deephaven_proto_storage_proto protoreflect.FileDescriptor + +var file_deephaven_proto_storage_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x21, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x22, 0x5c, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0b, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x88, 0x01, 0x01, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x67, 0x6c, 0x6f, 0x62, + 0x22, 0x99, 0x01, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, + 0x42, 0x02, 0x30, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, + 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, + 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x65, 0x74, 0x61, 0x67, 0x22, 0x56, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x22, 0x48, 0x0a, 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x46, 0x69, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x04, + 0x65, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x65, 0x74, + 0x61, 0x67, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x65, 0x74, 0x61, 0x67, 0x22, 0x51, + 0x0a, 0x11, 0x46, 0x65, 0x74, 0x63, 0x68, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x04, 0x65, 0x74, 0x61, 0x67, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x65, 0x74, 0x61, + 0x67, 0x22, 0x6a, 0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x76, + 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x4f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x34, 0x0a, + 0x10, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x65, + 0x74, 0x61, 0x67, 0x22, 0x70, 0x0a, 0x0f, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x0f, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4f, 0x76, 0x65, 0x72, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x14, 0x0a, 0x12, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2a, 0x30, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x49, + 0x52, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x49, 0x4c, + 0x45, 0x10, 0x02, 0x32, 0xfc, 0x05, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x78, 0x0a, 0x09, 0x46, 0x65, 0x74, 0x63, 0x68, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x33, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x46, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x75, 0x0a, 0x08, 0x53, 0x61, + 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x46, + 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x75, 0x0a, 0x08, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x32, 0x2e, + 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x39, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7b, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x74, 0x65, 0x6d, 0x12, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, + 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, + 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_deephaven_proto_storage_proto_rawDescOnce sync.Once + file_deephaven_proto_storage_proto_rawDescData = file_deephaven_proto_storage_proto_rawDesc +) + +func file_deephaven_proto_storage_proto_rawDescGZIP() []byte { + file_deephaven_proto_storage_proto_rawDescOnce.Do(func() { + file_deephaven_proto_storage_proto_rawDescData = protoimpl.X.CompressGZIP(file_deephaven_proto_storage_proto_rawDescData) + }) + return file_deephaven_proto_storage_proto_rawDescData +} + +var file_deephaven_proto_storage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_deephaven_proto_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_deephaven_proto_storage_proto_goTypes = []interface{}{ + (ItemType)(0), // 0: io.deephaven.proto.backplane.grpc.ItemType + (*ListItemsRequest)(nil), // 1: io.deephaven.proto.backplane.grpc.ListItemsRequest + (*ItemInfo)(nil), // 2: io.deephaven.proto.backplane.grpc.ItemInfo + (*ListItemsResponse)(nil), // 3: io.deephaven.proto.backplane.grpc.ListItemsResponse + (*FetchFileRequest)(nil), // 4: io.deephaven.proto.backplane.grpc.FetchFileRequest + (*FetchFileResponse)(nil), // 5: io.deephaven.proto.backplane.grpc.FetchFileResponse + (*SaveFileRequest)(nil), // 6: io.deephaven.proto.backplane.grpc.SaveFileRequest + (*SaveFileResponse)(nil), // 7: io.deephaven.proto.backplane.grpc.SaveFileResponse + (*MoveItemRequest)(nil), // 8: io.deephaven.proto.backplane.grpc.MoveItemRequest + (*MoveItemResponse)(nil), // 9: io.deephaven.proto.backplane.grpc.MoveItemResponse + (*CreateDirectoryRequest)(nil), // 10: io.deephaven.proto.backplane.grpc.CreateDirectoryRequest + (*CreateDirectoryResponse)(nil), // 11: io.deephaven.proto.backplane.grpc.CreateDirectoryResponse + (*DeleteItemRequest)(nil), // 12: io.deephaven.proto.backplane.grpc.DeleteItemRequest + (*DeleteItemResponse)(nil), // 13: io.deephaven.proto.backplane.grpc.DeleteItemResponse +} +var file_deephaven_proto_storage_proto_depIdxs = []int32{ + 0, // 0: io.deephaven.proto.backplane.grpc.ItemInfo.type:type_name -> io.deephaven.proto.backplane.grpc.ItemType + 2, // 1: io.deephaven.proto.backplane.grpc.ListItemsResponse.items:type_name -> io.deephaven.proto.backplane.grpc.ItemInfo + 1, // 2: io.deephaven.proto.backplane.grpc.StorageService.ListItems:input_type -> io.deephaven.proto.backplane.grpc.ListItemsRequest + 4, // 3: io.deephaven.proto.backplane.grpc.StorageService.FetchFile:input_type -> io.deephaven.proto.backplane.grpc.FetchFileRequest + 6, // 4: io.deephaven.proto.backplane.grpc.StorageService.SaveFile:input_type -> io.deephaven.proto.backplane.grpc.SaveFileRequest + 8, // 5: io.deephaven.proto.backplane.grpc.StorageService.MoveItem:input_type -> io.deephaven.proto.backplane.grpc.MoveItemRequest + 10, // 6: io.deephaven.proto.backplane.grpc.StorageService.CreateDirectory:input_type -> io.deephaven.proto.backplane.grpc.CreateDirectoryRequest + 12, // 7: io.deephaven.proto.backplane.grpc.StorageService.DeleteItem:input_type -> io.deephaven.proto.backplane.grpc.DeleteItemRequest + 3, // 8: io.deephaven.proto.backplane.grpc.StorageService.ListItems:output_type -> io.deephaven.proto.backplane.grpc.ListItemsResponse + 5, // 9: io.deephaven.proto.backplane.grpc.StorageService.FetchFile:output_type -> io.deephaven.proto.backplane.grpc.FetchFileResponse + 7, // 10: io.deephaven.proto.backplane.grpc.StorageService.SaveFile:output_type -> io.deephaven.proto.backplane.grpc.SaveFileResponse + 9, // 11: io.deephaven.proto.backplane.grpc.StorageService.MoveItem:output_type -> io.deephaven.proto.backplane.grpc.MoveItemResponse + 11, // 12: io.deephaven.proto.backplane.grpc.StorageService.CreateDirectory:output_type -> io.deephaven.proto.backplane.grpc.CreateDirectoryResponse + 13, // 13: io.deephaven.proto.backplane.grpc.StorageService.DeleteItem:output_type -> io.deephaven.proto.backplane.grpc.DeleteItemResponse + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_deephaven_proto_storage_proto_init() } +func file_deephaven_proto_storage_proto_init() { + if File_deephaven_proto_storage_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_deephaven_proto_storage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListItemsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListItemsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchFileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchFileResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveFileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveFileResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoveItemRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoveItemResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDirectoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDirectoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteItemRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_deephaven_proto_storage_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteItemResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_deephaven_proto_storage_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_deephaven_proto_storage_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_deephaven_proto_storage_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_deephaven_proto_storage_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_deephaven_proto_storage_proto_msgTypes[6].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_deephaven_proto_storage_proto_rawDesc, + NumEnums: 1, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_deephaven_proto_storage_proto_goTypes, + DependencyIndexes: file_deephaven_proto_storage_proto_depIdxs, + EnumInfos: file_deephaven_proto_storage_proto_enumTypes, + MessageInfos: file_deephaven_proto_storage_proto_msgTypes, + }.Build() + File_deephaven_proto_storage_proto = out.File + file_deephaven_proto_storage_proto_rawDesc = nil + file_deephaven_proto_storage_proto_goTypes = nil + file_deephaven_proto_storage_proto_depIdxs = nil +} diff --git a/go/internal/proto/storage/storage_grpc.pb.go b/go/internal/proto/storage/storage_grpc.pb.go new file mode 100644 index 00000000000..340d2f2ecda --- /dev/null +++ b/go/internal/proto/storage/storage_grpc.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: deephaven/proto/storage.proto + +package storage + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StorageServiceClient is the client API for StorageService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StorageServiceClient interface { + // Lists the files and directories present in a given directory. Will return an error + ListItems(ctx context.Context, in *ListItemsRequest, opts ...grpc.CallOption) (*ListItemsResponse, error) + // Reads the file at the given path. Client can optionally specify an etag, asking the server + // not to send the file if it hasn't changed. + FetchFile(ctx context.Context, in *FetchFileRequest, opts ...grpc.CallOption) (*FetchFileResponse, error) + // Can create new files or modify existing with client provided contents. + SaveFile(ctx context.Context, in *SaveFileRequest, opts ...grpc.CallOption) (*SaveFileResponse, error) + // Moves a file from one path to another. + MoveItem(ctx context.Context, in *MoveItemRequest, opts ...grpc.CallOption) (*MoveItemResponse, error) + // Creates a directory at the given path. + CreateDirectory(ctx context.Context, in *CreateDirectoryRequest, opts ...grpc.CallOption) (*CreateDirectoryResponse, error) + // Deletes the file or directory at the given path. Directories must be empty to be deleted. + DeleteItem(ctx context.Context, in *DeleteItemRequest, opts ...grpc.CallOption) (*DeleteItemResponse, error) +} + +type storageServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStorageServiceClient(cc grpc.ClientConnInterface) StorageServiceClient { + return &storageServiceClient{cc} +} + +func (c *storageServiceClient) ListItems(ctx context.Context, in *ListItemsRequest, opts ...grpc.CallOption) (*ListItemsResponse, error) { + out := new(ListItemsResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/ListItems", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageServiceClient) FetchFile(ctx context.Context, in *FetchFileRequest, opts ...grpc.CallOption) (*FetchFileResponse, error) { + out := new(FetchFileResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/FetchFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageServiceClient) SaveFile(ctx context.Context, in *SaveFileRequest, opts ...grpc.CallOption) (*SaveFileResponse, error) { + out := new(SaveFileResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/SaveFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageServiceClient) MoveItem(ctx context.Context, in *MoveItemRequest, opts ...grpc.CallOption) (*MoveItemResponse, error) { + out := new(MoveItemResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/MoveItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageServiceClient) CreateDirectory(ctx context.Context, in *CreateDirectoryRequest, opts ...grpc.CallOption) (*CreateDirectoryResponse, error) { + out := new(CreateDirectoryResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/CreateDirectory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageServiceClient) DeleteItem(ctx context.Context, in *DeleteItemRequest, opts ...grpc.CallOption) (*DeleteItemResponse, error) { + out := new(DeleteItemResponse) + err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.StorageService/DeleteItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StorageServiceServer is the server API for StorageService service. +// All implementations must embed UnimplementedStorageServiceServer +// for forward compatibility +type StorageServiceServer interface { + // Lists the files and directories present in a given directory. Will return an error + ListItems(context.Context, *ListItemsRequest) (*ListItemsResponse, error) + // Reads the file at the given path. Client can optionally specify an etag, asking the server + // not to send the file if it hasn't changed. + FetchFile(context.Context, *FetchFileRequest) (*FetchFileResponse, error) + // Can create new files or modify existing with client provided contents. + SaveFile(context.Context, *SaveFileRequest) (*SaveFileResponse, error) + // Moves a file from one path to another. + MoveItem(context.Context, *MoveItemRequest) (*MoveItemResponse, error) + // Creates a directory at the given path. + CreateDirectory(context.Context, *CreateDirectoryRequest) (*CreateDirectoryResponse, error) + // Deletes the file or directory at the given path. Directories must be empty to be deleted. + DeleteItem(context.Context, *DeleteItemRequest) (*DeleteItemResponse, error) + mustEmbedUnimplementedStorageServiceServer() +} + +// UnimplementedStorageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStorageServiceServer struct { +} + +func (UnimplementedStorageServiceServer) ListItems(context.Context, *ListItemsRequest) (*ListItemsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListItems not implemented") +} +func (UnimplementedStorageServiceServer) FetchFile(context.Context, *FetchFileRequest) (*FetchFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchFile not implemented") +} +func (UnimplementedStorageServiceServer) SaveFile(context.Context, *SaveFileRequest) (*SaveFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SaveFile not implemented") +} +func (UnimplementedStorageServiceServer) MoveItem(context.Context, *MoveItemRequest) (*MoveItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MoveItem not implemented") +} +func (UnimplementedStorageServiceServer) CreateDirectory(context.Context, *CreateDirectoryRequest) (*CreateDirectoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDirectory not implemented") +} +func (UnimplementedStorageServiceServer) DeleteItem(context.Context, *DeleteItemRequest) (*DeleteItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteItem not implemented") +} +func (UnimplementedStorageServiceServer) mustEmbedUnimplementedStorageServiceServer() {} + +// UnsafeStorageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StorageServiceServer will +// result in compilation errors. +type UnsafeStorageServiceServer interface { + mustEmbedUnimplementedStorageServiceServer() +} + +func RegisterStorageServiceServer(s grpc.ServiceRegistrar, srv StorageServiceServer) { + s.RegisterService(&StorageService_ServiceDesc, srv) +} + +func _StorageService_ListItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).ListItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/ListItems", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).ListItems(ctx, req.(*ListItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageService_FetchFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).FetchFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/FetchFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).FetchFile(ctx, req.(*FetchFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageService_SaveFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).SaveFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/SaveFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).SaveFile(ctx, req.(*SaveFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageService_MoveItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MoveItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).MoveItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/MoveItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).MoveItem(ctx, req.(*MoveItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageService_CreateDirectory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDirectoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).CreateDirectory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/CreateDirectory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).CreateDirectory(ctx, req.(*CreateDirectoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageService_DeleteItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServiceServer).DeleteItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/io.deephaven.proto.backplane.grpc.StorageService/DeleteItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServiceServer).DeleteItem(ctx, req.(*DeleteItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StorageService_ServiceDesc is the grpc.ServiceDesc for StorageService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StorageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.deephaven.proto.backplane.grpc.StorageService", + HandlerType: (*StorageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListItems", + Handler: _StorageService_ListItems_Handler, + }, + { + MethodName: "FetchFile", + Handler: _StorageService_FetchFile_Handler, + }, + { + MethodName: "SaveFile", + Handler: _StorageService_SaveFile_Handler, + }, + { + MethodName: "MoveItem", + Handler: _StorageService_MoveItem_Handler, + }, + { + MethodName: "CreateDirectory", + Handler: _StorageService_CreateDirectory_Handler, + }, + { + MethodName: "DeleteItem", + Handler: _StorageService_DeleteItem_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "deephaven/proto/storage.proto", +} diff --git a/proto/proto-backplane-grpc/Dockerfile b/proto/proto-backplane-grpc/Dockerfile index 18d30a53064..d80aaf658b4 100644 --- a/proto/proto-backplane-grpc/Dockerfile +++ b/proto/proto-backplane-grpc/Dockerfile @@ -24,7 +24,8 @@ RUN set -eux; \ /includes/deephaven/proto/table.proto \ /includes/deephaven/proto/application.proto \ /includes/deephaven/proto/inputtable.proto \ - /includes/deephaven/proto/partitionedtable.proto; \ + /includes/deephaven/proto/partitionedtable.proto \ + /includes/deephaven/proto/storage.proto; \ /opt/protoc/bin/protoc \ --plugin=protoc-gen-ts=/usr/src/app/node_modules/.bin/protoc-gen-ts \ --js_out=import_style=commonjs:/generated/js \ @@ -40,7 +41,8 @@ RUN set -eux; \ /includes/deephaven/proto/table.proto \ /includes/deephaven/proto/application.proto \ /includes/deephaven/proto/inputtable.proto \ - /includes/deephaven/proto/partitionedtable.proto; \ + /includes/deephaven/proto/partitionedtable.proto \ + /includes/deephaven/proto/storage.proto; \ python3 -m grpc_tools.protoc \ --grpc_python_out=/generated/python \ --python_out=/generated/python \ @@ -52,7 +54,8 @@ RUN set -eux; \ /includes/deephaven/proto/table.proto \ /includes/deephaven/proto/application.proto \ /includes/deephaven/proto/inputtable.proto \ - /includes/deephaven/proto/partitionedtable.proto; \ + /includes/deephaven/proto/partitionedtable.proto \ + /includes/deephaven/proto/storage.proto; \ /opt/protoc/bin/protoc \ --plugin=protoc-gen-go=/opt/protoc-gen-go \ --plugin=protoc-gen-go-grpc=/opt/protoc-gen-go-grpc \ @@ -68,4 +71,5 @@ RUN set -eux; \ /includes/deephaven/proto/table.proto \ /includes/deephaven/proto/application.proto \ /includes/deephaven/proto/inputtable.proto \ - /includes/deephaven/proto/partitionedtable.proto; + /includes/deephaven/proto/partitionedtable.proto \ + /includes/deephaven/proto/storage.proto; diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/storage.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/storage.proto new file mode 100644 index 00000000000..10b39633aa5 --- /dev/null +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/storage.proto @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +syntax = "proto3"; + +package io.deephaven.proto.backplane.grpc; + +option java_multiple_files = true; +option optimize_for = SPEED; +option go_package = "github.com/deephaven/deephaven-core/go/internal/proto/storage"; + +/* + * Shared storage management service. + * + * Operations may fail (or omit data) if the current session does not have permission to read or write that resource. + * + * Paths will be "/" delimited and must start with a leading slash. +*/ +service StorageService { + // Lists the files and directories present in a given directory. Will return an error + rpc ListItems(ListItemsRequest) returns (ListItemsResponse) {} + // Reads the file at the given path. Client can optionally specify an etag, asking the server + // not to send the file if it hasn't changed. + rpc FetchFile(FetchFileRequest) returns (FetchFileResponse) {} + // Can create new files or modify existing with client provided contents. + rpc SaveFile(SaveFileRequest) returns (SaveFileResponse) {} + // Moves a file from one path to another. + rpc MoveItem(MoveItemRequest) returns (MoveItemResponse) {} + // Creates a directory at the given path. + rpc CreateDirectory(CreateDirectoryRequest) returns (CreateDirectoryResponse) {} + // Deletes the file or directory at the given path. Directories must be empty to be deleted. + rpc DeleteItem(DeleteItemRequest) returns (DeleteItemResponse) {} +} + +message ListItemsRequest { + // The path to the directory to list. empty to list top level + string path = 1; + // A pattern to filter for, with "?" to match any one character, "*" to match any number of characters, and "{}"s + // to hold a comma-separated list of possible matches. The format follows Java's FileSystem.getPathMatcher (see + // https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-), + // except without allowing subdirectories with / or **. + optional string filter_glob = 4; +} + +enum ItemType { + UNKNOWN = 0;// Should not be used, exists only to indicate that this was left unset + DIRECTORY = 1; + FILE = 2; +} + +message ItemInfo { + // The path to the item that this message describes. + string path = 1; + // The type of this item, either file or directory. + ItemType type = 2; + // If this message represents a file, this is the size of the file. + sint64 size = 3 [jstype=JS_STRING]; + // Opaque string value representing a hash of the contents of this file, if available. + optional string etag = 4; +} + +message ListItemsResponse { + // List of items found in the specified directory. + repeated ItemInfo items = 1; +} + +message FetchFileRequest { + // The path to the file to read + string path = 1; + // If present, tells the server to not send a result if the etag matches the current file's content. + optional string etag = 2; +} +message FetchFileResponse { + // Contains the contents of the file, unless the returned etag matches the requested etag. + bytes contents = 1; + // Represents the current etag of the requested file. If an etag was in the request and this matches, + // contents should be ignored, and the existing client copy of the file is already correct. In all + // other cases, this etag can be used in future requests to see if the file's contents are different. + optional string etag = 2; +} + +message SaveFileRequest { + // True to permit replacing an existing file, false to require that no file already exists with that name. + bool allow_overwrite = 1; + // The path to the file to write contents to + string path = 2; + + // The contents to use when creating then file, or to use to replace the file. + bytes contents = 3; +} +message SaveFileResponse { + // Represents the etag of the saved contents, so the client can check for external changes. + optional string etag = 1; +} + +// Requests to move a file to a new path, which may be in a different directory. Presently it is not +// permitted to overwrite an existing file in this way. +message MoveItemRequest { + // The path where the file currently exists + string old_path = 1; + // The path where the file should be moved to + string new_path = 2; + // True to permit replacing an existing file, false to require that no file already exists with that name. + bool allow_overwrite = 3; +} + +message MoveItemResponse { +} + +message CreateDirectoryRequest { + // The path to the directory to create + string path = 1; +} + +message CreateDirectoryResponse { + +} + +message DeleteItemRequest { + // The path to the item to delete. + string path = 1; +} +message DeleteItemResponse { +} \ No newline at end of file diff --git a/proto/raw-js-openapi/src/index.js b/proto/raw-js-openapi/src/index.js index 5b1a6f59d42..d5d3a3d330b 100644 --- a/proto/raw-js-openapi/src/index.js +++ b/proto/raw-js-openapi/src/index.js @@ -6,6 +6,7 @@ require("deephaven/proto/application_pb"); require("deephaven/proto/inputtable_pb"); require("deephaven/proto/object_pb"); require("deephaven/proto/partitionedtable_pb"); +require("deephaven/proto/storage_pb"); require("Flight_pb") require("BrowserFlight_pb") var sessionService = require("deephaven/proto/session_pb_service"); @@ -15,6 +16,7 @@ var applicationService = require("deephaven/proto/application_pb_service"); var inputTableService = require("deephaven/proto/inputtable_pb_service"); var objectService = require("deephaven/proto/object_pb_service"); var partitionedTableService = require("deephaven/proto/partitionedtable_pb_service"); +var storageService = require("deephaven/proto/storage_pb_service"); var browserFlightService = require("BrowserFlight_pb_service"); var flightService = require("Flight_pb_service"); @@ -45,6 +47,8 @@ var io = { deephaven: { object_pb_service: objectService, partitionedtable_pb: proto.io.deephaven.proto.backplane.grpc, partitionedtable_pb_service: partitionedTableService, + storage_pb: proto.io.deephaven.proto.backplane.grpc, + storage_pb_service: storageService, }, barrage: { "flatbuf": { diff --git a/py/client/pydeephaven/proto/storage_pb2.py b/py/client/pydeephaven/proto/storage_pb2.py new file mode 100644 index 00000000000..f5b8a5dd026 --- /dev/null +++ b/py/client/pydeephaven/proto/storage_pb2.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: deephaven/proto/storage.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/storage.proto\x12!io.deephaven.proto.backplane.grpc\"J\n\x10ListItemsRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x18\n\x0b\x66ilter_glob\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_filter_glob\"\x81\x01\n\x08ItemInfo\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x39\n\x04type\x18\x02 \x01(\x0e\x32+.io.deephaven.proto.backplane.grpc.ItemType\x12\x10\n\x04size\x18\x03 \x01(\x12\x42\x02\x30\x01\x12\x11\n\x04\x65tag\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_etag\"O\n\x11ListItemsResponse\x12:\n\x05items\x18\x01 \x03(\x0b\x32+.io.deephaven.proto.backplane.grpc.ItemInfo\"<\n\x10\x46\x65tchFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x11\n\x04\x65tag\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_etag\"A\n\x11\x46\x65tchFileResponse\x12\x10\n\x08\x63ontents\x18\x01 \x01(\x0c\x12\x11\n\x04\x65tag\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_etag\"J\n\x0fSaveFileRequest\x12\x17\n\x0f\x61llow_overwrite\x18\x01 \x01(\x08\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x10\n\x08\x63ontents\x18\x03 \x01(\x0c\".\n\x10SaveFileResponse\x12\x11\n\x04\x65tag\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_etag\"N\n\x0fMoveItemRequest\x12\x10\n\x08old_path\x18\x01 \x01(\t\x12\x10\n\x08new_path\x18\x02 \x01(\t\x12\x17\n\x0f\x61llow_overwrite\x18\x03 \x01(\x08\"\x12\n\x10MoveItemResponse\"&\n\x16\x43reateDirectoryRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\"\x19\n\x17\x43reateDirectoryResponse\"!\n\x11\x44\x65leteItemRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\"\x14\n\x12\x44\x65leteItemResponse*0\n\x08ItemType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tDIRECTORY\x10\x01\x12\x08\n\x04\x46ILE\x10\x02\x32\xfc\x05\n\x0eStorageService\x12x\n\tListItems\x12\x33.io.deephaven.proto.backplane.grpc.ListItemsRequest\x1a\x34.io.deephaven.proto.backplane.grpc.ListItemsResponse\"\x00\x12x\n\tFetchFile\x12\x33.io.deephaven.proto.backplane.grpc.FetchFileRequest\x1a\x34.io.deephaven.proto.backplane.grpc.FetchFileResponse\"\x00\x12u\n\x08SaveFile\x12\x32.io.deephaven.proto.backplane.grpc.SaveFileRequest\x1a\x33.io.deephaven.proto.backplane.grpc.SaveFileResponse\"\x00\x12u\n\x08MoveItem\x12\x32.io.deephaven.proto.backplane.grpc.MoveItemRequest\x1a\x33.io.deephaven.proto.backplane.grpc.MoveItemResponse\"\x00\x12\x8a\x01\n\x0f\x43reateDirectory\x12\x39.io.deephaven.proto.backplane.grpc.CreateDirectoryRequest\x1a:.io.deephaven.proto.backplane.grpc.CreateDirectoryResponse\"\x00\x12{\n\nDeleteItem\x12\x34.io.deephaven.proto.backplane.grpc.DeleteItemRequest\x1a\x35.io.deephaven.proto.backplane.grpc.DeleteItemResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/storageb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.storage_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001P\001Z=github.com/deephaven/deephaven-core/go/internal/proto/storage' + _ITEMINFO.fields_by_name['size']._options = None + _ITEMINFO.fields_by_name['size']._serialized_options = b'0\001' + _ITEMTYPE._serialized_start=834 + _ITEMTYPE._serialized_end=882 + _LISTITEMSREQUEST._serialized_start=68 + _LISTITEMSREQUEST._serialized_end=142 + _ITEMINFO._serialized_start=145 + _ITEMINFO._serialized_end=274 + _LISTITEMSRESPONSE._serialized_start=276 + _LISTITEMSRESPONSE._serialized_end=355 + _FETCHFILEREQUEST._serialized_start=357 + _FETCHFILEREQUEST._serialized_end=417 + _FETCHFILERESPONSE._serialized_start=419 + _FETCHFILERESPONSE._serialized_end=484 + _SAVEFILEREQUEST._serialized_start=486 + _SAVEFILEREQUEST._serialized_end=560 + _SAVEFILERESPONSE._serialized_start=562 + _SAVEFILERESPONSE._serialized_end=608 + _MOVEITEMREQUEST._serialized_start=610 + _MOVEITEMREQUEST._serialized_end=688 + _MOVEITEMRESPONSE._serialized_start=690 + _MOVEITEMRESPONSE._serialized_end=708 + _CREATEDIRECTORYREQUEST._serialized_start=710 + _CREATEDIRECTORYREQUEST._serialized_end=748 + _CREATEDIRECTORYRESPONSE._serialized_start=750 + _CREATEDIRECTORYRESPONSE._serialized_end=775 + _DELETEITEMREQUEST._serialized_start=777 + _DELETEITEMREQUEST._serialized_end=810 + _DELETEITEMRESPONSE._serialized_start=812 + _DELETEITEMRESPONSE._serialized_end=832 + _STORAGESERVICE._serialized_start=885 + _STORAGESERVICE._serialized_end=1649 +# @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/storage_pb2_grpc.py b/py/client/pydeephaven/proto/storage_pb2_grpc.py new file mode 100644 index 00000000000..ca9cba53814 --- /dev/null +++ b/py/client/pydeephaven/proto/storage_pb2_grpc.py @@ -0,0 +1,256 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from pydeephaven.proto import storage_pb2 as deephaven_dot_proto_dot_storage__pb2 + + +class StorageServiceStub(object): + """ + Shared storage management service. + + Operations may fail (or omit data) if the current session does not have permission to read or write that resource. + + Paths will be "/" delimited and must start with a leading slash. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListItems = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/ListItems', + request_serializer=deephaven_dot_proto_dot_storage__pb2.ListItemsRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.ListItemsResponse.FromString, + ) + self.FetchFile = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/FetchFile', + request_serializer=deephaven_dot_proto_dot_storage__pb2.FetchFileRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.FetchFileResponse.FromString, + ) + self.SaveFile = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/SaveFile', + request_serializer=deephaven_dot_proto_dot_storage__pb2.SaveFileRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.SaveFileResponse.FromString, + ) + self.MoveItem = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/MoveItem', + request_serializer=deephaven_dot_proto_dot_storage__pb2.MoveItemRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.MoveItemResponse.FromString, + ) + self.CreateDirectory = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/CreateDirectory', + request_serializer=deephaven_dot_proto_dot_storage__pb2.CreateDirectoryRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.CreateDirectoryResponse.FromString, + ) + self.DeleteItem = channel.unary_unary( + '/io.deephaven.proto.backplane.grpc.StorageService/DeleteItem', + request_serializer=deephaven_dot_proto_dot_storage__pb2.DeleteItemRequest.SerializeToString, + response_deserializer=deephaven_dot_proto_dot_storage__pb2.DeleteItemResponse.FromString, + ) + + +class StorageServiceServicer(object): + """ + Shared storage management service. + + Operations may fail (or omit data) if the current session does not have permission to read or write that resource. + + Paths will be "/" delimited and must start with a leading slash. + """ + + def ListItems(self, request, context): + """Lists the files and directories present in a given directory. Will return an error + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def FetchFile(self, request, context): + """Reads the file at the given path. Client can optionally specify an etag, asking the server + not to send the file if it hasn't changed. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SaveFile(self, request, context): + """Can create new files or modify existing with client provided contents. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def MoveItem(self, request, context): + """Moves a file from one path to another. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateDirectory(self, request, context): + """Creates a directory at the given path. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteItem(self, request, context): + """Deletes the file or directory at the given path. Directories must be empty to be deleted. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_StorageServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListItems': grpc.unary_unary_rpc_method_handler( + servicer.ListItems, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.ListItemsRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.ListItemsResponse.SerializeToString, + ), + 'FetchFile': grpc.unary_unary_rpc_method_handler( + servicer.FetchFile, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.FetchFileRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.FetchFileResponse.SerializeToString, + ), + 'SaveFile': grpc.unary_unary_rpc_method_handler( + servicer.SaveFile, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.SaveFileRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.SaveFileResponse.SerializeToString, + ), + 'MoveItem': grpc.unary_unary_rpc_method_handler( + servicer.MoveItem, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.MoveItemRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.MoveItemResponse.SerializeToString, + ), + 'CreateDirectory': grpc.unary_unary_rpc_method_handler( + servicer.CreateDirectory, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.CreateDirectoryRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.CreateDirectoryResponse.SerializeToString, + ), + 'DeleteItem': grpc.unary_unary_rpc_method_handler( + servicer.DeleteItem, + request_deserializer=deephaven_dot_proto_dot_storage__pb2.DeleteItemRequest.FromString, + response_serializer=deephaven_dot_proto_dot_storage__pb2.DeleteItemResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'io.deephaven.proto.backplane.grpc.StorageService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class StorageService(object): + """ + Shared storage management service. + + Operations may fail (or omit data) if the current session does not have permission to read or write that resource. + + Paths will be "/" delimited and must start with a leading slash. + """ + + @staticmethod + def ListItems(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/ListItems', + deephaven_dot_proto_dot_storage__pb2.ListItemsRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.ListItemsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def FetchFile(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/FetchFile', + deephaven_dot_proto_dot_storage__pb2.FetchFileRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.FetchFileResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SaveFile(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/SaveFile', + deephaven_dot_proto_dot_storage__pb2.SaveFileRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.SaveFileResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def MoveItem(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/MoveItem', + deephaven_dot_proto_dot_storage__pb2.MoveItemRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.MoveItemResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateDirectory(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/CreateDirectory', + deephaven_dot_proto_dot_storage__pb2.CreateDirectoryRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.CreateDirectoryResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteItem(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/io.deephaven.proto.backplane.grpc.StorageService/DeleteItem', + deephaven_dot_proto_dot_storage__pb2.DeleteItemRequest.SerializeToString, + deephaven_dot_proto_dot_storage__pb2.DeleteItemResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index 45692d9c810..beb799b4f9b 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -28,6 +28,7 @@ def extraJvmArgs = [ '-XX:MaxGCPauseMillis=100', '-XX:+UseStringDeduplication', '-XshowSettings:vm', + "-Dstorage.path=${rootDir}/data" ] if (hasProperty('groovy')) { diff --git a/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceGrpcImpl.java new file mode 100644 index 00000000000..21dabe43434 --- /dev/null +++ b/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceGrpcImpl.java @@ -0,0 +1,296 @@ +package io.deephaven.server.notebook; + +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import com.google.common.io.ByteSource; +import com.google.protobuf.ByteString; +import com.google.rpc.Code; +import io.deephaven.configuration.Configuration; +import io.deephaven.extensions.barrage.util.GrpcUtil; +import io.deephaven.internal.log.LoggerFactory; +import io.deephaven.io.logger.Logger; +import io.deephaven.proto.backplane.grpc.CreateDirectoryRequest; +import io.deephaven.proto.backplane.grpc.CreateDirectoryResponse; +import io.deephaven.proto.backplane.grpc.DeleteItemRequest; +import io.deephaven.proto.backplane.grpc.DeleteItemResponse; +import io.deephaven.proto.backplane.grpc.FetchFileRequest; +import io.deephaven.proto.backplane.grpc.FetchFileResponse; +import io.deephaven.proto.backplane.grpc.ItemInfo; +import io.deephaven.proto.backplane.grpc.ItemType; +import io.deephaven.proto.backplane.grpc.ListItemsRequest; +import io.deephaven.proto.backplane.grpc.ListItemsResponse; +import io.deephaven.proto.backplane.grpc.MoveItemRequest; +import io.deephaven.proto.backplane.grpc.MoveItemResponse; +import io.deephaven.proto.backplane.grpc.SaveFileRequest; +import io.deephaven.proto.backplane.grpc.SaveFileResponse; +import io.deephaven.proto.backplane.grpc.StorageServiceGrpc; +import io.deephaven.server.session.SessionService; +import io.grpc.stub.StreamObserver; + +import javax.inject.Inject; +import javax.inject.Singleton; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.DirectoryNotEmptyException; +import java.nio.file.DirectoryStream; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.PathMatcher; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.regex.PatternSyntaxException; +import java.util.stream.Stream; + +import static com.google.common.io.Files.asByteSource; + +/** + * Default implementation for the StorageService gRPC service, which will use the filesystem to store files on behalf of + * authenticated clients. + * + *

    + * Current implementation only checks if a user is logged in, and doesn't provide finer grained access controls to + * files. + *

    + */ +@Singleton +public class FilesystemStorageServiceGrpcImpl extends StorageServiceGrpc.StorageServiceImplBase { + private static final Logger log = LoggerFactory.getLogger(FilesystemStorageServiceGrpcImpl.class); + + private static final String STORAGE_PATH = + Configuration.getInstance().getStringWithDefault("storage.path", "/storage") + .replace("", Configuration.getInstance().getWorkspacePath()); + + private static final String WEB_LAYOUT_DIRECTORY = + Configuration.getInstance().getStringWithDefault("web.storage.layout.directory", "/layouts"); + private static final String WEB_NOTEBOOK_DIRECTORY = + Configuration.getInstance().getStringWithDefault("web.storage.notebook.directory", "/notebooks"); + private static final String[] PRE_CREATE_PATHS = Configuration.getInstance() + .getStringArrayFromPropertyWithDefault("storage.path.defaults", new String[] { + WEB_LAYOUT_DIRECTORY, + WEB_NOTEBOOK_DIRECTORY, + }); + + /** + * Non-cryptographic hash, not resistant to adversarial collisions, but should suffice for quickly checking for + * edits to files. We're circumventing the "change the seed each startup", as these hashes should be very low risk, + * and this ensures that clients will have a stable cache across server restarts. + */ + private static final HashFunction HASH_FUNCTION = Hashing.murmur3_128(0); + + private final Path root = Paths.get(STORAGE_PATH).normalize(); + private final SessionService sessionService; + + @Inject + public FilesystemStorageServiceGrpcImpl(SessionService sessionService) { + this.sessionService = sessionService; + try { + Files.createDirectories(root); + for (String path : PRE_CREATE_PATHS) { + Files.createDirectories(resolveOrThrow(path)); + } + } catch (IOException e) { + throw new UncheckedIOException("Failed to initialize storage", e); + } + } + + private Path resolveOrThrow(String incomingPath) { + if (incomingPath.startsWith("/")) { + Path resolved = root.resolve(incomingPath.substring(1)).normalize(); + if (resolved.startsWith(root)) { + return resolved; + } + } + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "Invalid path: " + incomingPath); + } + + private void requireNotRoot(Path path, String message) { + if (path.equals(root)) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, message); + } + } + + @Override + public void listItems(ListItemsRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + ListItemsResponse.Builder builder = ListItemsResponse.newBuilder(); + PathMatcher matcher = + request.hasFilterGlob() ? createPathFilter(request.getFilterGlob()) : ignore -> true; + Path dir = resolveOrThrow(request.getPath()); + try (Stream list = Files.list(dir)) { + for (Path p : (Iterable) list::iterator) { + if (!matcher.matches(dir.relativize(p))) { + continue; + } + BasicFileAttributes attrs = Files.readAttributes(p, BasicFileAttributes.class); + boolean isDirectory = attrs.isDirectory(); + ItemInfo.Builder info = ItemInfo.newBuilder() + .setPath("/" + root.relativize(p)); + if (isDirectory) { + info.setType(ItemType.DIRECTORY); + } else { + info.setSize(attrs.size()) + .setEtag(hash(p))// Note, there is a potential race here between the size and the hash + .setType(ItemType.FILE); + } + builder.addItems(info.build()); + } + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "Directory does not exist"); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + }); + } + + private static PathMatcher createPathFilter(String filterGlob) { + if (filterGlob.contains("**")) { + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, "Bad glob, only single `*`s are supported"); + } + if (filterGlob.contains("/")) { + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, + "Bad glob, only the same directory can be checked"); + } + try { + return FileSystems.getDefault().getPathMatcher("glob:" + filterGlob); + } catch (PatternSyntaxException e) { + throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT, + "Bad glob, can't parse expression: " + e.getMessage()); + } + } + + + /** + * Using the default hash function, read the file at the given path and return a hex string of its hash. + */ + private static String hash(Path path) throws IOException { + return asByteSource(path.toFile()).hash(HASH_FUNCTION).toString(); + } + + @Override + public void fetchFile(FetchFileRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + final byte[] bytes; + final String etag; + try { + bytes = Files.readAllBytes(resolveOrThrow(request.getPath())); + // Hash those bytes, as long as we are reading them to send, since we want the hash to be consistent + // with the contents we send. This avoids a race condition, at the cost of requiring that the server + // always read the full bytes + etag = ByteSource.wrap(bytes).hash(HASH_FUNCTION).toString(); + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "File does not exist"); + } + final FetchFileResponse.Builder response = FetchFileResponse.newBuilder(); + response.setEtag(etag); + if (!request.hasEtag() || !etag.equals(request.getEtag())) { + response.setContents(ByteString.copyFrom(bytes)); + } + responseObserver.onNext(response.build()); + responseObserver.onCompleted(); + }); + } + + @Override + public void saveFile(SaveFileRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + Path path = resolveOrThrow(request.getPath()); + requireNotRoot(path, "Can't overwrite the root directory"); + StandardOpenOption option = + request.getAllowOverwrite() ? StandardOpenOption.CREATE : StandardOpenOption.CREATE_NEW; + + byte[] bytes = request.getContents().toByteArray(); + String etag = ByteSource.wrap(bytes).hash(HASH_FUNCTION).toString(); + try { + Files.write(path, bytes, option); + } catch (FileAlreadyExistsException alreadyExistsException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "File already exists"); + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "Directory does not exist"); + } + responseObserver.onNext(SaveFileResponse.newBuilder().setEtag(etag).build()); + responseObserver.onCompleted(); + }); + } + + @Override + public void moveItem(MoveItemRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + Path source = resolveOrThrow(request.getOldPath()); + Path target = resolveOrThrow(request.getNewPath()); + requireNotRoot(target, "Can't overwrite the root directory"); + + StandardCopyOption[] options = + request.getAllowOverwrite() ? new StandardCopyOption[] {StandardCopyOption.REPLACE_EXISTING} + : new StandardCopyOption[0]; + + try { + Files.move(source, target, options); + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "File does not exist, cannot rename"); + } catch (FileAlreadyExistsException alreadyExistsException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, + "File already exists, cannot rename to replace"); + } catch (DirectoryNotEmptyException directoryNotEmptyException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "Cannot replace non-empty directory"); + } + responseObserver.onNext(MoveItemResponse.getDefaultInstance()); + responseObserver.onCompleted(); + }); + } + + @Override + public void createDirectory(CreateDirectoryRequest request, + StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + Path dir = resolveOrThrow(request.getPath()); + requireNotRoot(dir, "Can't overwrite the root directory"); + + try { + Files.createDirectory(dir); + } catch (FileAlreadyExistsException fileAlreadyExistsException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, + "Something already exists with that name"); + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, + "Can't create directory, parent directory doesn't exist"); + } + responseObserver.onNext(CreateDirectoryResponse.getDefaultInstance()); + responseObserver.onCompleted(); + }); + } + + @Override + public void deleteItem(DeleteItemRequest request, StreamObserver responseObserver) { + GrpcUtil.rpcWrapper(log, responseObserver, () -> { + sessionService.getCurrentSession(); + + Path path = resolveOrThrow(request.getPath()); + requireNotRoot(path, "Can't delete the root directory"); + + try { + Files.delete(path); + } catch (NoSuchFileException noSuchFileException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "Cannot delete, file does not exists"); + } catch (DirectoryNotEmptyException directoryNotEmptyException) { + throw GrpcUtil.statusRuntimeException(Code.FAILED_PRECONDITION, "Cannot delete non-empty directory"); + } + responseObserver.onNext(DeleteItemResponse.getDefaultInstance()); + responseObserver.onCompleted(); + }); + } +} diff --git a/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceModule.java b/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceModule.java new file mode 100644 index 00000000000..abbeb09a04f --- /dev/null +++ b/server/src/main/java/io/deephaven/server/notebook/FilesystemStorageServiceModule.java @@ -0,0 +1,16 @@ +package io.deephaven.server.notebook; + +import dagger.Binds; +import dagger.Module; +import dagger.multibindings.IntoSet; +import io.grpc.BindableService; + +/** + * gRPC Storage Service implementation based on the filesystem. + */ +@Module +public interface FilesystemStorageServiceModule { + @Binds + @IntoSet + BindableService bindNotebookServiceGrpcImpl(FilesystemStorageServiceGrpcImpl instance); +} diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java index a567f5f0e22..3221f6980e6 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java @@ -10,6 +10,7 @@ import io.deephaven.configuration.Configuration; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.ScriptSession; +import io.deephaven.server.notebook.FilesystemStorageServiceModule; import io.deephaven.server.object.ObjectServiceModule; import io.deephaven.server.partitionedtable.PartitionedTableServiceModule; import io.deephaven.server.plugin.PluginsModule; @@ -56,6 +57,7 @@ ObjectServiceModule.class, PluginsModule.class, PartitionedTableServiceModule.class, + FilesystemStorageServiceModule.class, }) public class DeephavenApiServerModule { diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java b/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java new file mode 100644 index 00000000000..9b997a7bc4c --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java @@ -0,0 +1,67 @@ +package io.deephaven.web.client.api; + +import elemental2.promise.Promise; +import io.deephaven.web.client.api.storage.JsStorageService; +import jsinterop.annotations.JsType; + +@JsType(namespace = "dh") +public class CoreClient extends QueryConnectable { + public static final String EVENT_CONNECT = "connect", + EVENT_DISCONNECT = "disconnect", + EVENT_RECONNECT = "reconnect", + EVENT_RECONNECT_AUTH_FAILED = "reconnectauthfailed", + EVENT_REFRESH_TOKEN_UPDATED = "refreshtokenupdated"; + + public static final String LOGIN_TYPE_PASSWORD = "password", + LOGIN_TYPE_SAML = "saml", + LOGIN_TYPE_REFRESH = "refresh", + LOGIN_TYPE_PSK = "psk", + LOGIN_TYPE_OIDC = "oidc", + LOGIN_TYPE_ANONYMOUS = "anonymous"; + + private final String serverUrl; + + public CoreClient(String serverUrl) { + super(AuthTokenPromiseSupplier.oneShot(null)); + this.serverUrl = serverUrl; + } + + @Override + public Promise running() { + // This assumes that once the connection has been initialized and left a usable state, it cannot be used again + if (!connection.isAvailable() || connection.get().isUsable()) { + return Promise.resolve(this); + } else { + return (Promise) Promise.reject("Cannot connect, session is dead."); + } + } + + @Override + public String getServerUrl() { + return serverUrl; + } + + public Promise getAuthConfigValues() { + return Promise.resolve(new String[0][]); + } + + public Promise login(LoginCredentials credentials) { + return connection.get().whenServerReady("login").then(ignore -> Promise.resolve((Void) null)); + } + + public Promise relogin(String token) { + return login(LoginCredentials.reconnect(token)); + } + + public Promise getServerConfigValues() { + return Promise.resolve(new String[0][]); + } + + public Promise getUserInfo() { + return Promise.resolve(new UserInfo()); + } + + public JsStorageService getStorageService() { + return new JsStorageService(connection.get()); + } +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/LoginCredentials.java b/web/client-api/src/main/java/io/deephaven/web/client/api/LoginCredentials.java new file mode 100644 index 00000000000..1c2719fa74b --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/LoginCredentials.java @@ -0,0 +1,47 @@ +package io.deephaven.web.client.api; + +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType(namespace = JsPackage.GLOBAL, name = "Object", isNative = true) +public class LoginCredentials { + + @JsOverlay + public static LoginCredentials reconnect(String token) { + return null; + } + + public String username, token, type, operateAs; + + @JsOverlay + public final String getUsername() { + return username; + } + + @JsOverlay + public final void setUsername(String username) { + this.username = username; + } + + @JsOverlay + public final String getToken() { + return token; + } + + @JsOverlay + public final void setToken(String token) { + this.token = token; + } + + @JsOverlay + public final String getType() { + return type; + } + + @JsOverlay + public final void setType(String type) { + this.type = type; + } + +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/UserInfo.java b/web/client-api/src/main/java/io/deephaven/web/client/api/UserInfo.java new file mode 100644 index 00000000000..7c49998395b --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/UserInfo.java @@ -0,0 +1,4 @@ +package io.deephaven.web.client.api; + +public class UserInfo { +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index ece1613f476..9e9e9896d3f 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -49,6 +49,7 @@ import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.TerminationNotificationRequest; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.terminationnotificationresponse.StackTrace; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb_service.SessionServiceClient; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service.StorageServiceClient; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ApplyPreviewColumnsRequest; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.EmptyTableRequest; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExportedTableCreationResponse; @@ -181,6 +182,7 @@ private enum State { private InputTableServiceClient inputTableServiceClient; private ObjectServiceClient objectServiceClient; private PartitionedTableServiceClient partitionedTableServiceClient; + private StorageServiceClient storageServiceClient; private final StateCache cache = new StateCache(); private final JsWeakMap batchers = new JsWeakMap<>(); @@ -224,6 +226,7 @@ public WorkerConnection(QueryConnectable info, Supplier objectServiceClient = new ObjectServiceClient(info.getServerUrl(), JsPropertyMap.of("debug", debugGrpc)); partitionedTableServiceClient = new PartitionedTableServiceClient(info.getServerUrl(), JsPropertyMap.of("debug", debugGrpc)); + storageServiceClient = new StorageServiceClient(info.getServerUrl(), JsPropertyMap.of("debug", debugGrpc)); // builder.setConnectionErrorHandler(msg -> info.failureHandled(String.valueOf(msg))); @@ -925,6 +928,10 @@ public PartitionedTableServiceClient partitionedTableServiceClient() { return partitionedTableServiceClient; } + public StorageServiceClient storageServiceClient() { + return storageServiceClient; + } + public BrowserHeaders metadata() { return metadata; } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsFileContents.java b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsFileContents.java new file mode 100644 index 00000000000..6a7cf336913 --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsFileContents.java @@ -0,0 +1,72 @@ +package io.deephaven.web.client.api.storage; + +import elemental2.core.ArrayBuffer; +import elemental2.core.JsArray; +import elemental2.dom.Blob; +import elemental2.promise.Promise; +import jsinterop.annotations.JsIgnore; +import jsinterop.annotations.JsMethod; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; + +import java.util.Objects; + +/** + * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test + * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should + * be used. + */ +@JsType(namespace = "dh.storage", name = "FileContents") +public class JsFileContents { + + public static JsFileContents blob(Blob blob) { + Objects.requireNonNull(blob, "Blob cannot be null"); + return new JsFileContents(blob, null); + } + + public static JsFileContents text(String... text) { + return new JsFileContents(new Blob(JsArray.from(text)), null); + } + + public static JsFileContents arrayBuffers(ArrayBuffer... buffers) { + return new JsFileContents(new Blob(JsArray.from(buffers)), null); + } + + private final Blob data; + + private final String etag; + + @JsIgnore + public JsFileContents(Blob data, String etag) { + this.data = data; + this.etag = etag; + } + + @JsIgnore + public JsFileContents(String etag) { + this.data = null; + this.etag = etag; + } + + private Promise contents() { + if (data != null) { + return Promise.resolve(data); + } + return Promise.reject("No contents available, please use provided etag"); + } + + @JsMethod + public Promise text() { + return contents().then(Blob::text); + } + + @JsMethod + public Promise arrayBuffer() { + return contents().then(Blob::arrayBuffer); + } + + @JsProperty + public String getEtag() { + return etag; + } +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsItemDetails.java b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsItemDetails.java new file mode 100644 index 00000000000..1ab4841ff82 --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsItemDetails.java @@ -0,0 +1,61 @@ +package io.deephaven.web.client.api.storage; + +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.Storage_pb; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ItemInfo; +import jsinterop.annotations.JsIgnore; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; + +/** + * Storage service metadata about files and folders. + */ +@JsType(namespace = "dh.storage", name = "ItemDetails") +public class JsItemDetails { + private final String path; + private final int type; + private final String size; + private final String etag; + + @JsIgnore + public JsItemDetails(String path, int kind, String size, String etag) { + this.path = path; + this.type = kind; + this.size = size; + this.etag = etag; + } + + @JsIgnore + public static JsItemDetails fromProto(ItemInfo item) { + return new JsItemDetails(item.getPath(), item.getType(), item.getSize(), item.getEtag()); + } + + @JsProperty + public String getFilename() { + return path; + } + + @JsProperty + public String getBasename() { + return path.substring(path.lastIndexOf('/') + 1); + } + + @JsProperty + public String getDirname() { + return path.substring(0, path.lastIndexOf('/')); + } + + @JsProperty + public String getType() { + return type == Storage_pb.ItemType.getDIRECTORY() ? "directory" : "file"; + } + + @JsProperty + public double getSize() { + return size == null ? 0 : Double.parseDouble(size); + } + + @JsProperty + public String getEtag() { + return etag; + } +} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java new file mode 100644 index 00000000000..f1984b3ef56 --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java @@ -0,0 +1,175 @@ +package io.deephaven.web.client.api.storage; + +import elemental2.core.JsArray; +import elemental2.core.Uint8Array; +import elemental2.dom.Blob; +import elemental2.promise.Promise; +import io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.DeleteItemRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.DeleteItemResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.FetchFileRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.FetchFileResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ListItemsRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ListItemsResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.MoveItemRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.MoveItemResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.SaveFileRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.SaveFileResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service.StorageServiceClient; +import io.deephaven.web.client.api.Callbacks; +import io.deephaven.web.client.api.WorkerConnection; +import jsinterop.annotations.JsIgnore; +import jsinterop.annotations.JsMethod; +import jsinterop.annotations.JsOptional; +import jsinterop.annotations.JsType; + +/** + * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/". + */ +@JsType(namespace = "dh.storage", name = "StorageService") +public class JsStorageService { + private final WorkerConnection connection; + + @JsIgnore + public JsStorageService(WorkerConnection connection) { + this.connection = connection; + } + + private StorageServiceClient client() { + return connection.storageServiceClient(); + } + + private BrowserHeaders metadata() { + return connection.metadata(); + } + + /** + * Lists items in a given directory, with an optional filter glob to only list files that match. The empty or "root" + * path should be specified as the empty string. + * + * @param path the path of the directory to list + * @param glob optional glob to filter the contents of the directory + * @return a promise containing the any items that are present in the given directory that match the glob, or an + * error. + */ + @JsMethod + public Promise> listItems(String path, @JsOptional String glob) { + ListItemsRequest req = new ListItemsRequest(); + req.setPath(path); + req.setFilterGlob(glob); + return Callbacks.grpcUnaryPromise(c -> client().listItems(req, metadata(), c::apply)) + .then(response -> Promise + .resolve(response.getItemsList().map((item, i, arr) -> JsItemDetails.fromProto(item)))); + } + + /** + * Downloads a file at the given path, unless an etag is provided that matches the file's current contents. + * + * @param path the path of the file to fetch + * @param etag an optional etag from the last time the client saw this file + * @return a promise containing details about the file's contents, or an error. + */ + @JsMethod + public Promise loadFile(String path, @JsOptional String etag) { + FetchFileRequest req = new FetchFileRequest(); + req.setPath(path); + if (etag != null) { + req.setEtag(etag); + } + return Callbacks.grpcUnaryPromise(c -> client().fetchFile(req, metadata(), c::apply)) + .then(response -> { + if (response.hasEtag() && response.getEtag().equals(etag)) { + return Promise.resolve(new JsFileContents(etag)); + } + Blob contents = new Blob(JsArray.of( + Blob.ConstructorBlobPartsArrayUnionType.of(response.getContents_asU8().slice().buffer))); + return Promise.resolve(new JsFileContents(contents, response.getEtag())); + }); + } + + /** + * Deletes the item at the given path. Directories must be empty to be deleted. + * + * @param path the path of the item to delete + * @return a promise with no value on success, or an error. + */ + @JsMethod + public Promise deleteItem(String path) { + DeleteItemRequest req = new DeleteItemRequest(); + req.setPath(path); + return Callbacks + .grpcUnaryPromise(c -> client().deleteItem(req, metadata(), c::apply)) + .then(response -> Promise.resolve((Void) null)); + } + + /** + * Saves the provided contents to the given path, creating a file or replacing an existing one. The optional newFile + * parameter can be passed to indicate that an existing file must not be overwritten, only a new file created. + * + * Note that directories must be empty to be overwritten. + * + * @param path the path of the file to write + * @param contents the contents to write to that path + * @param allowOverwrite true to allow an existing file to be overwritten, false or skip to require a new file + * @return a promise with a FileContents, holding only the new etag (if the server emitted one), or an error + */ + @JsMethod + public Promise saveFile(String path, JsFileContents contents, @JsOptional Boolean allowOverwrite) { + return contents.arrayBuffer().then(ab -> { + SaveFileRequest req = new SaveFileRequest(); + req.setContents(new Uint8Array(ab)); + req.setPath(path); + + if (allowOverwrite != null) { + req.setAllowOverwrite(allowOverwrite); + } + + return Callbacks + .grpcUnaryPromise(c -> client().saveFile(req, metadata(), c::apply)) + .then(response -> Promise.resolve(new JsFileContents(response.getEtag()))); + }); + } + + /** + * Moves (and/or renames) an item from its old path to its new path. The optional newFile parameter can be passed to + * enforce that an existing item must not be overwritten. + * + * Note that directories must be empty to be overwritten. + * + * @param oldPath the path of the existing item + * @param newPath the new path to move the item to + * @param allowOverwrite true to allow an existing file to be overwritten, false or skip to require a new file + * @return a promise with no value on success, or an error. + */ + @JsMethod + public Promise moveItem(String oldPath, String newPath, @JsOptional Boolean allowOverwrite) { + MoveItemRequest req = new MoveItemRequest(); + req.setOldPath(oldPath); + req.setNewPath(newPath); + + if (allowOverwrite != null) { + req.setAllowOverwrite(allowOverwrite); + } + + return Callbacks.grpcUnaryPromise(c -> client().moveItem(req, metadata(), c::apply)) + .then(response -> Promise.resolve((Void) null)); + } + + /** + * Creates a new directory at the specified path. + * + * @param path the path of the directory to create + * @return a promise with no value on success, or an error. + */ + @JsMethod + public Promise createDirectory(String path) { + CreateDirectoryRequest req = new CreateDirectoryRequest(); + req.setPath(path); + return Callbacks + .grpcUnaryPromise( + c -> client().createDirectory(req, metadata(), c::apply)) + .then(response -> Promise.resolve((Void) null)); + } +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/Storage_pb.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/Storage_pb.java new file mode 100644 index 00000000000..ac74d9f2268 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/Storage_pb.java @@ -0,0 +1,13 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto; + +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ItemTypeMap; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb", + namespace = JsPackage.GLOBAL) +public class Storage_pb { + public static ItemTypeMap ItemType; +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryRequest.java new file mode 100644 index 00000000000..bfe970850b8 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryRequest.java @@ -0,0 +1,63 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryRequest", + namespace = JsPackage.GLOBAL) +public class CreateDirectoryRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static CreateDirectoryRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getPath(); + + @JsProperty + void setPath(String path); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static CreateDirectoryRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getPath(); + + @JsProperty + void setPath(String path); + } + + public static native CreateDirectoryRequest deserializeBinary(Uint8Array bytes); + + public static native CreateDirectoryRequest deserializeBinaryFromReader( + CreateDirectoryRequest message, Object reader); + + public static native void serializeBinaryToWriter(CreateDirectoryRequest message, Object writer); + + public static native CreateDirectoryRequest.ToObjectReturnType toObject( + boolean includeInstance, CreateDirectoryRequest msg); + + public native String getPath(); + + public native Uint8Array serializeBinary(); + + public native void setPath(String value); + + public native CreateDirectoryRequest.ToObjectReturnType0 toObject(); + + public native CreateDirectoryRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryResponse.java new file mode 100644 index 00000000000..e6d271d2cd8 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/CreateDirectoryResponse.java @@ -0,0 +1,26 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryResponse", + namespace = JsPackage.GLOBAL) +public class CreateDirectoryResponse { + public static native CreateDirectoryResponse deserializeBinary(Uint8Array bytes); + + public static native CreateDirectoryResponse deserializeBinaryFromReader( + CreateDirectoryResponse message, Object reader); + + public static native void serializeBinaryToWriter(CreateDirectoryResponse message, Object writer); + + public static native Object toObject(boolean includeInstance, CreateDirectoryResponse msg); + + public native Uint8Array serializeBinary(); + + public native Object toObject(); + + public native Object toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemRequest.java new file mode 100644 index 00000000000..c3d1f2aefe6 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemRequest.java @@ -0,0 +1,63 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.DeleteItemRequest", + namespace = JsPackage.GLOBAL) +public class DeleteItemRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static DeleteItemRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getPath(); + + @JsProperty + void setPath(String path); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static DeleteItemRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getPath(); + + @JsProperty + void setPath(String path); + } + + public static native DeleteItemRequest deserializeBinary(Uint8Array bytes); + + public static native DeleteItemRequest deserializeBinaryFromReader( + DeleteItemRequest message, Object reader); + + public static native void serializeBinaryToWriter(DeleteItemRequest message, Object writer); + + public static native DeleteItemRequest.ToObjectReturnType toObject( + boolean includeInstance, DeleteItemRequest msg); + + public native String getPath(); + + public native Uint8Array serializeBinary(); + + public native void setPath(String value); + + public native DeleteItemRequest.ToObjectReturnType0 toObject(); + + public native DeleteItemRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemResponse.java new file mode 100644 index 00000000000..3f236917f22 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/DeleteItemResponse.java @@ -0,0 +1,26 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.DeleteItemResponse", + namespace = JsPackage.GLOBAL) +public class DeleteItemResponse { + public static native DeleteItemResponse deserializeBinary(Uint8Array bytes); + + public static native DeleteItemResponse deserializeBinaryFromReader( + DeleteItemResponse message, Object reader); + + public static native void serializeBinaryToWriter(DeleteItemResponse message, Object writer); + + public static native Object toObject(boolean includeInstance, DeleteItemResponse msg); + + public native Uint8Array serializeBinary(); + + public native Object toObject(); + + public native Object toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileRequest.java new file mode 100644 index 00000000000..ff0e07be18e --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileRequest.java @@ -0,0 +1,83 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.FetchFileRequest", + namespace = JsPackage.GLOBAL) +public class FetchFileRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static FetchFileRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static FetchFileRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + } + + public static native FetchFileRequest deserializeBinary(Uint8Array bytes); + + public static native FetchFileRequest deserializeBinaryFromReader( + FetchFileRequest message, Object reader); + + public static native void serializeBinaryToWriter(FetchFileRequest message, Object writer); + + public static native FetchFileRequest.ToObjectReturnType toObject( + boolean includeInstance, FetchFileRequest msg); + + public native void clearEtag(); + + public native String getEtag(); + + public native String getPath(); + + public native boolean hasEtag(); + + public native Uint8Array serializeBinary(); + + public native void setEtag(String value); + + public native void setPath(String value); + + public native FetchFileRequest.ToObjectReturnType0 toObject(); + + public native FetchFileRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileResponse.java new file mode 100644 index 00000000000..738957fdf33 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/FetchFileResponse.java @@ -0,0 +1,233 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.FetchFileResponse", + namespace = JsPackage.GLOBAL) +public class FetchFileResponse { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static FetchFileResponse.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface SetContentsValueUnionType { + @JsOverlay + static FetchFileResponse.SetContentsValueUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static FetchFileResponse.ToObjectReturnType.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsOverlay + static FetchFileResponse.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + FetchFileResponse.ToObjectReturnType.GetContentsUnionType getContents(); + + @JsProperty + String getEtag(); + + @JsProperty + void setContents(FetchFileResponse.ToObjectReturnType.GetContentsUnionType contents); + + @JsOverlay + default void setContents(String contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsOverlay + default void setContents(Uint8Array contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsProperty + void setEtag(String etag); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static FetchFileResponse.ToObjectReturnType0.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsOverlay + static FetchFileResponse.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + FetchFileResponse.ToObjectReturnType0.GetContentsUnionType getContents(); + + @JsProperty + String getEtag(); + + @JsProperty + void setContents(FetchFileResponse.ToObjectReturnType0.GetContentsUnionType contents); + + @JsOverlay + default void setContents(String contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsOverlay + default void setContents(Uint8Array contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsProperty + void setEtag(String etag); + } + + public static native FetchFileResponse deserializeBinary(Uint8Array bytes); + + public static native FetchFileResponse deserializeBinaryFromReader( + FetchFileResponse message, Object reader); + + public static native void serializeBinaryToWriter(FetchFileResponse message, Object writer); + + public static native FetchFileResponse.ToObjectReturnType toObject( + boolean includeInstance, FetchFileResponse msg); + + public native void clearEtag(); + + public native FetchFileResponse.GetContentsUnionType getContents(); + + public native String getContents_asB64(); + + public native Uint8Array getContents_asU8(); + + public native String getEtag(); + + public native boolean hasEtag(); + + public native Uint8Array serializeBinary(); + + public native void setContents(FetchFileResponse.SetContentsValueUnionType value); + + @JsOverlay + public final void setContents(String value) { + setContents(Js.uncheckedCast(value)); + } + + @JsOverlay + public final void setContents(Uint8Array value) { + setContents(Js.uncheckedCast(value)); + } + + public native void setEtag(String value); + + public native FetchFileResponse.ToObjectReturnType0 toObject(); + + public native FetchFileResponse.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemInfo.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemInfo.java new file mode 100644 index 00000000000..2159e7a2418 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemInfo.java @@ -0,0 +1,113 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.ItemInfo", + namespace = JsPackage.GLOBAL) +public class ItemInfo { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static ItemInfo.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + String getSize(); + + @JsProperty + double getType(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + + @JsProperty + void setSize(String size); + + @JsProperty + void setType(double type); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static ItemInfo.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + String getSize(); + + @JsProperty + double getType(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + + @JsProperty + void setSize(String size); + + @JsProperty + void setType(double type); + } + + public static native ItemInfo deserializeBinary(Uint8Array bytes); + + public static native ItemInfo deserializeBinaryFromReader(ItemInfo message, Object reader); + + public static native void serializeBinaryToWriter(ItemInfo message, Object writer); + + public static native ItemInfo.ToObjectReturnType toObject(boolean includeInstance, ItemInfo msg); + + public native void clearEtag(); + + public native String getEtag(); + + public native String getPath(); + + public native String getSize(); + + public native int getType(); + + public native boolean hasEtag(); + + public native Uint8Array serializeBinary(); + + public native void setEtag(String value); + + public native void setPath(String value); + + public native void setSize(String value); + + public native void setType(int value); + + public native ItemInfo.ToObjectReturnType0 toObject(); + + public native ItemInfo.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemTypeMap.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemTypeMap.java new file mode 100644 index 00000000000..01d1cef0d51 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ItemTypeMap.java @@ -0,0 +1,37 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.ItemTypeMap", + namespace = JsPackage.GLOBAL) +public interface ItemTypeMap { + @JsOverlay + static ItemTypeMap create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty(name = "DIRECTORY") + int getDIRECTORY(); + + @JsProperty(name = "FILE") + int getFILE(); + + @JsProperty(name = "UNKNOWN") + int getUNKNOWN(); + + @JsProperty(name = "DIRECTORY") + void setDIRECTORY(int DIRECTORY); + + @JsProperty(name = "FILE") + void setFILE(int FILE); + + @JsProperty(name = "UNKNOWN") + void setUNKNOWN(int UNKNOWN); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsRequest.java new file mode 100644 index 00000000000..88011947f9d --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsRequest.java @@ -0,0 +1,83 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.ListItemsRequest", + namespace = JsPackage.GLOBAL) +public class ListItemsRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static ListItemsRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getFilterGlob(); + + @JsProperty + String getPath(); + + @JsProperty + void setFilterGlob(String filterGlob); + + @JsProperty + void setPath(String path); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static ListItemsRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getFilterGlob(); + + @JsProperty + String getPath(); + + @JsProperty + void setFilterGlob(String filterGlob); + + @JsProperty + void setPath(String path); + } + + public static native ListItemsRequest deserializeBinary(Uint8Array bytes); + + public static native ListItemsRequest deserializeBinaryFromReader( + ListItemsRequest message, Object reader); + + public static native void serializeBinaryToWriter(ListItemsRequest message, Object writer); + + public static native ListItemsRequest.ToObjectReturnType toObject( + boolean includeInstance, ListItemsRequest msg); + + public native void clearFilterGlob(); + + public native String getFilterGlob(); + + public native String getPath(); + + public native boolean hasFilterGlob(); + + public native Uint8Array serializeBinary(); + + public native void setFilterGlob(String value); + + public native void setPath(String value); + + public native ListItemsRequest.ToObjectReturnType0 toObject(); + + public native ListItemsRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsResponse.java new file mode 100644 index 00000000000..eef7347a92d --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/ListItemsResponse.java @@ -0,0 +1,156 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.JsArray; +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.ListItemsResponse", + namespace = JsPackage.GLOBAL) +public class ListItemsResponse { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ItemsListFieldType { + @JsOverlay + static ListItemsResponse.ToObjectReturnType.ItemsListFieldType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + String getSize(); + + @JsProperty + double getType(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + + @JsProperty + void setSize(String size); + + @JsProperty + void setType(double type); + } + + @JsOverlay + static ListItemsResponse.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + JsArray getItemsList(); + + @JsOverlay + default void setItemsList(ListItemsResponse.ToObjectReturnType.ItemsListFieldType[] itemsList) { + setItemsList( + Js.>uncheckedCast( + itemsList)); + } + + @JsProperty + void setItemsList(JsArray itemsList); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ItemsListFieldType { + @JsOverlay + static ListItemsResponse.ToObjectReturnType0.ItemsListFieldType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + String getPath(); + + @JsProperty + String getSize(); + + @JsProperty + double getType(); + + @JsProperty + void setEtag(String etag); + + @JsProperty + void setPath(String path); + + @JsProperty + void setSize(String size); + + @JsProperty + void setType(double type); + } + + @JsOverlay + static ListItemsResponse.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + JsArray getItemsList(); + + @JsOverlay + default void setItemsList( + ListItemsResponse.ToObjectReturnType0.ItemsListFieldType[] itemsList) { + setItemsList( + Js.>uncheckedCast( + itemsList)); + } + + @JsProperty + void setItemsList(JsArray itemsList); + } + + public static native ListItemsResponse deserializeBinary(Uint8Array bytes); + + public static native ListItemsResponse deserializeBinaryFromReader( + ListItemsResponse message, Object reader); + + public static native void serializeBinaryToWriter(ListItemsResponse message, Object writer); + + public static native ListItemsResponse.ToObjectReturnType toObject( + boolean includeInstance, ListItemsResponse msg); + + public native ItemInfo addItems(); + + public native ItemInfo addItems(ItemInfo value, double index); + + public native ItemInfo addItems(ItemInfo value); + + public native void clearItemsList(); + + public native JsArray getItemsList(); + + public native Uint8Array serializeBinary(); + + @JsOverlay + public final void setItemsList(ItemInfo[] value) { + setItemsList(Js.>uncheckedCast(value)); + } + + public native void setItemsList(JsArray value); + + public native ListItemsResponse.ToObjectReturnType0 toObject(); + + public native ListItemsResponse.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemRequest.java new file mode 100644 index 00000000000..38a5c4814ac --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemRequest.java @@ -0,0 +1,95 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.MoveItemRequest", + namespace = JsPackage.GLOBAL) +public class MoveItemRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static MoveItemRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getNewPath(); + + @JsProperty + String getOldPath(); + + @JsProperty + boolean isAllowOverwrite(); + + @JsProperty + void setAllowOverwrite(boolean allowOverwrite); + + @JsProperty + void setNewPath(String newPath); + + @JsProperty + void setOldPath(String oldPath); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static MoveItemRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getNewPath(); + + @JsProperty + String getOldPath(); + + @JsProperty + boolean isAllowOverwrite(); + + @JsProperty + void setAllowOverwrite(boolean allowOverwrite); + + @JsProperty + void setNewPath(String newPath); + + @JsProperty + void setOldPath(String oldPath); + } + + public static native MoveItemRequest deserializeBinary(Uint8Array bytes); + + public static native MoveItemRequest deserializeBinaryFromReader( + MoveItemRequest message, Object reader); + + public static native void serializeBinaryToWriter(MoveItemRequest message, Object writer); + + public static native MoveItemRequest.ToObjectReturnType toObject( + boolean includeInstance, MoveItemRequest msg); + + public native boolean getAllowOverwrite(); + + public native String getNewPath(); + + public native String getOldPath(); + + public native Uint8Array serializeBinary(); + + public native void setAllowOverwrite(boolean value); + + public native void setNewPath(String value); + + public native void setOldPath(String value); + + public native MoveItemRequest.ToObjectReturnType0 toObject(); + + public native MoveItemRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemResponse.java new file mode 100644 index 00000000000..55468e7ebf2 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/MoveItemResponse.java @@ -0,0 +1,26 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.MoveItemResponse", + namespace = JsPackage.GLOBAL) +public class MoveItemResponse { + public static native MoveItemResponse deserializeBinary(Uint8Array bytes); + + public static native MoveItemResponse deserializeBinaryFromReader( + MoveItemResponse message, Object reader); + + public static native void serializeBinaryToWriter(MoveItemResponse message, Object writer); + + public static native Object toObject(boolean includeInstance, MoveItemResponse msg); + + public native Uint8Array serializeBinary(); + + public native Object toObject(); + + public native Object toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileRequest.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileRequest.java new file mode 100644 index 00000000000..9d36e5c1aff --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileRequest.java @@ -0,0 +1,245 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.SaveFileRequest", + namespace = JsPackage.GLOBAL) +public class SaveFileRequest { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static SaveFileRequest.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface SetContentsValueUnionType { + @JsOverlay + static SaveFileRequest.SetContentsValueUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static SaveFileRequest.ToObjectReturnType.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsOverlay + static SaveFileRequest.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + SaveFileRequest.ToObjectReturnType.GetContentsUnionType getContents(); + + @JsProperty + String getPath(); + + @JsProperty + boolean isAllowOverwrite(); + + @JsProperty + void setAllowOverwrite(boolean allowOverwrite); + + @JsProperty + void setContents(SaveFileRequest.ToObjectReturnType.GetContentsUnionType contents); + + @JsOverlay + default void setContents(String contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsOverlay + default void setContents(Uint8Array contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsProperty + void setPath(String path); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface GetContentsUnionType { + @JsOverlay + static SaveFileRequest.ToObjectReturnType0.GetContentsUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default String asString() { + return Js.asString(this); + } + + @JsOverlay + default Uint8Array asUint8Array() { + return Js.cast(this); + } + + @JsOverlay + default boolean isString() { + return (Object) this instanceof String; + } + + @JsOverlay + default boolean isUint8Array() { + return (Object) this instanceof Uint8Array; + } + } + + @JsOverlay + static SaveFileRequest.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + SaveFileRequest.ToObjectReturnType0.GetContentsUnionType getContents(); + + @JsProperty + String getPath(); + + @JsProperty + boolean isAllowOverwrite(); + + @JsProperty + void setAllowOverwrite(boolean allowOverwrite); + + @JsProperty + void setContents(SaveFileRequest.ToObjectReturnType0.GetContentsUnionType contents); + + @JsOverlay + default void setContents(String contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsOverlay + default void setContents(Uint8Array contents) { + setContents( + Js.uncheckedCast(contents)); + } + + @JsProperty + void setPath(String path); + } + + public static native SaveFileRequest deserializeBinary(Uint8Array bytes); + + public static native SaveFileRequest deserializeBinaryFromReader( + SaveFileRequest message, Object reader); + + public static native void serializeBinaryToWriter(SaveFileRequest message, Object writer); + + public static native SaveFileRequest.ToObjectReturnType toObject( + boolean includeInstance, SaveFileRequest msg); + + public native boolean getAllowOverwrite(); + + public native SaveFileRequest.GetContentsUnionType getContents(); + + public native String getContents_asB64(); + + public native Uint8Array getContents_asU8(); + + public native String getPath(); + + public native Uint8Array serializeBinary(); + + public native void setAllowOverwrite(boolean value); + + public native void setContents(SaveFileRequest.SetContentsValueUnionType value); + + @JsOverlay + public final void setContents(String value) { + setContents(Js.uncheckedCast(value)); + } + + @JsOverlay + public final void setContents(Uint8Array value) { + setContents(Js.uncheckedCast(value)); + } + + public native void setPath(String value); + + public native SaveFileRequest.ToObjectReturnType0 toObject(); + + public native SaveFileRequest.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileResponse.java new file mode 100644 index 00000000000..dcd33b1f656 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb/SaveFileResponse.java @@ -0,0 +1,67 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb; + +import elemental2.core.Uint8Array; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb.SaveFileResponse", + namespace = JsPackage.GLOBAL) +public class SaveFileResponse { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType { + @JsOverlay + static SaveFileResponse.ToObjectReturnType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + void setEtag(String etag); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ToObjectReturnType0 { + @JsOverlay + static SaveFileResponse.ToObjectReturnType0 create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getEtag(); + + @JsProperty + void setEtag(String etag); + } + + public static native SaveFileResponse deserializeBinary(Uint8Array bytes); + + public static native SaveFileResponse deserializeBinaryFromReader( + SaveFileResponse message, Object reader); + + public static native void serializeBinaryToWriter(SaveFileResponse message, Object writer); + + public static native SaveFileResponse.ToObjectReturnType toObject( + boolean includeInstance, SaveFileResponse msg); + + public native void clearEtag(); + + public native String getEtag(); + + public native boolean hasEtag(); + + public native Uint8Array serializeBinary(); + + public native void setEtag(String value); + + public native SaveFileResponse.ToObjectReturnType0 toObject(); + + public native SaveFileResponse.ToObjectReturnType0 toObject(boolean includeInstance); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/BidirectionalStream.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/BidirectionalStream.java new file mode 100644 index 00000000000..981f0131c7c --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/BidirectionalStream.java @@ -0,0 +1,19 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import elemental2.core.Function; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.BidirectionalStream", + namespace = JsPackage.GLOBAL) +public interface BidirectionalStream { + void cancel(); + + void end(); + + BidirectionalStream on(String type, Function handler); + + BidirectionalStream write(ReqT message); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/RequestStream.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/RequestStream.java new file mode 100644 index 00000000000..f91f220c6b9 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/RequestStream.java @@ -0,0 +1,55 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders; +import jsinterop.annotations.JsFunction; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.RequestStream", + namespace = JsPackage.GLOBAL) +public interface RequestStream { + @JsFunction + public interface OnHandlerFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static RequestStream.OnHandlerFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getDetails(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setDetails(String details); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(RequestStream.OnHandlerFn.P0Type p0); + } + + void cancel(); + + void end(); + + RequestStream on(String type, RequestStream.OnHandlerFn handler); + + RequestStream write(T message); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/ResponseStream.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/ResponseStream.java new file mode 100644 index 00000000000..5a28f789f9a --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/ResponseStream.java @@ -0,0 +1,15 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import elemental2.core.Function; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.ResponseStream", + namespace = JsPackage.GLOBAL) +public interface ResponseStream { + void cancel(); + + ResponseStream on(String type, Function handler); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageService.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageService.java new file mode 100644 index 00000000000..e24d283117c --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageService.java @@ -0,0 +1,286 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.StorageService", + namespace = JsPackage.GLOBAL) +public class StorageService { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface CreateDirectoryType { + @JsOverlay + static StorageService.CreateDirectoryType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface DeleteItemType { + @JsOverlay + static StorageService.DeleteItemType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface FetchFileType { + @JsOverlay + static StorageService.FetchFileType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ListItemsType { + @JsOverlay + static StorageService.ListItemsType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface MoveItemType { + @JsOverlay + static StorageService.MoveItemType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface SaveFileType { + @JsOverlay + static StorageService.SaveFileType create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + String getMethodName(); + + @JsProperty + Object getRequestType(); + + @JsProperty + Object getResponseType(); + + @JsProperty + Object getService(); + + @JsProperty + boolean isRequestStream(); + + @JsProperty + boolean isResponseStream(); + + @JsProperty + void setMethodName(String methodName); + + @JsProperty + void setRequestStream(boolean requestStream); + + @JsProperty + void setRequestType(Object requestType); + + @JsProperty + void setResponseStream(boolean responseStream); + + @JsProperty + void setResponseType(Object responseType); + + @JsProperty + void setService(Object service); + } + + public static StorageService.CreateDirectoryType CreateDirectory; + public static StorageService.DeleteItemType DeleteItem; + public static StorageService.FetchFileType FetchFile; + public static StorageService.ListItemsType ListItems; + public static StorageService.MoveItemType MoveItem; + public static StorageService.SaveFileType SaveFile; + public static String serviceName; +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageServiceClient.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageServiceClient.java new file mode 100644 index 00000000000..0a81a1abbb1 --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/StorageServiceClient.java @@ -0,0 +1,894 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.CreateDirectoryResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.DeleteItemRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.DeleteItemResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.FetchFileRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.FetchFileResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ListItemsRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.ListItemsResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.MoveItemRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.MoveItemResponse; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.SaveFileRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb.SaveFileResponse; +import jsinterop.annotations.JsFunction; +import jsinterop.annotations.JsOverlay; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import jsinterop.base.Js; +import jsinterop.base.JsPropertyMap; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.StorageServiceClient", + namespace = JsPackage.GLOBAL) +public class StorageServiceClient { + @JsFunction + public interface CreateDirectoryCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.CreateDirectoryCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.CreateDirectoryCallbackFn.P0Type p0, CreateDirectoryResponse p1); + } + + @JsFunction + public interface CreateDirectoryMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.CreateDirectoryMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.CreateDirectoryMetadata_or_callbackFn.P0Type p0, + CreateDirectoryResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface CreateDirectoryMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.CreateDirectoryMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.CreateDirectoryMetadata_or_callbackFn asCreateDirectoryMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isCreateDirectoryMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.CreateDirectoryMetadata_or_callbackFn; + } + } + + @JsFunction + public interface DeleteItemCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.DeleteItemCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(StorageServiceClient.DeleteItemCallbackFn.P0Type p0, DeleteItemResponse p1); + } + + @JsFunction + public interface DeleteItemMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.DeleteItemMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.DeleteItemMetadata_or_callbackFn.P0Type p0, DeleteItemResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface DeleteItemMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.DeleteItemMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.DeleteItemMetadata_or_callbackFn asDeleteItemMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isDeleteItemMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.DeleteItemMetadata_or_callbackFn; + } + } + + @JsFunction + public interface FetchFileCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.FetchFileCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(StorageServiceClient.FetchFileCallbackFn.P0Type p0, FetchFileResponse p1); + } + + @JsFunction + public interface FetchFileMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.FetchFileMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.FetchFileMetadata_or_callbackFn.P0Type p0, FetchFileResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface FetchFileMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.FetchFileMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.FetchFileMetadata_or_callbackFn asFetchFileMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isFetchFileMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.FetchFileMetadata_or_callbackFn; + } + } + + @JsFunction + public interface ListItemsCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.ListItemsCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(StorageServiceClient.ListItemsCallbackFn.P0Type p0, ListItemsResponse p1); + } + + @JsFunction + public interface ListItemsMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.ListItemsMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.ListItemsMetadata_or_callbackFn.P0Type p0, ListItemsResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface ListItemsMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.ListItemsMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.ListItemsMetadata_or_callbackFn asListItemsMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isListItemsMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.ListItemsMetadata_or_callbackFn; + } + } + + @JsFunction + public interface MoveItemCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.MoveItemCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(StorageServiceClient.MoveItemCallbackFn.P0Type p0, MoveItemResponse p1); + } + + @JsFunction + public interface MoveItemMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.MoveItemMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.MoveItemMetadata_or_callbackFn.P0Type p0, MoveItemResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface MoveItemMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.MoveItemMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.MoveItemMetadata_or_callbackFn asMoveItemMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isMoveItemMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.MoveItemMetadata_or_callbackFn; + } + } + + @JsFunction + public interface SaveFileCallbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.SaveFileCallbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke(StorageServiceClient.SaveFileCallbackFn.P0Type p0, SaveFileResponse p1); + } + + @JsFunction + public interface SaveFileMetadata_or_callbackFn { + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface P0Type { + @JsOverlay + static StorageServiceClient.SaveFileMetadata_or_callbackFn.P0Type create() { + return Js.uncheckedCast(JsPropertyMap.of()); + } + + @JsProperty + double getCode(); + + @JsProperty + String getMessage(); + + @JsProperty + BrowserHeaders getMetadata(); + + @JsProperty + void setCode(double code); + + @JsProperty + void setMessage(String message); + + @JsProperty + void setMetadata(BrowserHeaders metadata); + } + + void onInvoke( + StorageServiceClient.SaveFileMetadata_or_callbackFn.P0Type p0, SaveFileResponse p1); + } + + @JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL) + public interface SaveFileMetadata_or_callbackUnionType { + @JsOverlay + static StorageServiceClient.SaveFileMetadata_or_callbackUnionType of(Object o) { + return Js.cast(o); + } + + @JsOverlay + default BrowserHeaders asBrowserHeaders() { + return Js.cast(this); + } + + @JsOverlay + default StorageServiceClient.SaveFileMetadata_or_callbackFn asSaveFileMetadata_or_callbackFn() { + return Js.cast(this); + } + + @JsOverlay + default boolean isBrowserHeaders() { + return (Object) this instanceof BrowserHeaders; + } + + @JsOverlay + default boolean isSaveFileMetadata_or_callbackFn() { + return (Object) this instanceof StorageServiceClient.SaveFileMetadata_or_callbackFn; + } + } + + public String serviceHost; + + public StorageServiceClient(String serviceHost, Object options) {} + + public StorageServiceClient(String serviceHost) {} + + @JsOverlay + public final UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.CreateDirectoryCallbackFn callback) { + return createDirectory( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, BrowserHeaders metadata_or_callback) { + return createDirectory( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, + StorageServiceClient.CreateDirectoryMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.CreateDirectoryCallbackFn callback) { + return createDirectory( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, + StorageServiceClient.CreateDirectoryMetadata_or_callbackFn metadata_or_callback) { + return createDirectory( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, + StorageServiceClient.CreateDirectoryMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.CreateDirectoryCallbackFn callback); + + public native UnaryResponse createDirectory( + CreateDirectoryRequest requestMessage, + StorageServiceClient.CreateDirectoryMetadata_or_callbackUnionType metadata_or_callback); + + @JsOverlay + public final UnaryResponse deleteItem( + DeleteItemRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.DeleteItemCallbackFn callback) { + return deleteItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse deleteItem( + DeleteItemRequest requestMessage, BrowserHeaders metadata_or_callback) { + return deleteItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse deleteItem( + DeleteItemRequest requestMessage, + StorageServiceClient.DeleteItemMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.DeleteItemCallbackFn callback) { + return deleteItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse deleteItem( + DeleteItemRequest requestMessage, + StorageServiceClient.DeleteItemMetadata_or_callbackFn metadata_or_callback) { + return deleteItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse deleteItem( + DeleteItemRequest requestMessage, + StorageServiceClient.DeleteItemMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.DeleteItemCallbackFn callback); + + public native UnaryResponse deleteItem( + DeleteItemRequest requestMessage, + StorageServiceClient.DeleteItemMetadata_or_callbackUnionType metadata_or_callback); + + @JsOverlay + public final UnaryResponse fetchFile( + FetchFileRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.FetchFileCallbackFn callback) { + return fetchFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse fetchFile( + FetchFileRequest requestMessage, BrowserHeaders metadata_or_callback) { + return fetchFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse fetchFile( + FetchFileRequest requestMessage, + StorageServiceClient.FetchFileMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.FetchFileCallbackFn callback) { + return fetchFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse fetchFile( + FetchFileRequest requestMessage, + StorageServiceClient.FetchFileMetadata_or_callbackFn metadata_or_callback) { + return fetchFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse fetchFile( + FetchFileRequest requestMessage, + StorageServiceClient.FetchFileMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.FetchFileCallbackFn callback); + + public native UnaryResponse fetchFile( + FetchFileRequest requestMessage, + StorageServiceClient.FetchFileMetadata_or_callbackUnionType metadata_or_callback); + + @JsOverlay + public final UnaryResponse listItems( + ListItemsRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.ListItemsCallbackFn callback) { + return listItems( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse listItems( + ListItemsRequest requestMessage, BrowserHeaders metadata_or_callback) { + return listItems( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse listItems( + ListItemsRequest requestMessage, + StorageServiceClient.ListItemsMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.ListItemsCallbackFn callback) { + return listItems( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse listItems( + ListItemsRequest requestMessage, + StorageServiceClient.ListItemsMetadata_or_callbackFn metadata_or_callback) { + return listItems( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse listItems( + ListItemsRequest requestMessage, + StorageServiceClient.ListItemsMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.ListItemsCallbackFn callback); + + public native UnaryResponse listItems( + ListItemsRequest requestMessage, + StorageServiceClient.ListItemsMetadata_or_callbackUnionType metadata_or_callback); + + @JsOverlay + public final UnaryResponse moveItem( + MoveItemRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.MoveItemCallbackFn callback) { + return moveItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse moveItem( + MoveItemRequest requestMessage, BrowserHeaders metadata_or_callback) { + return moveItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse moveItem( + MoveItemRequest requestMessage, + StorageServiceClient.MoveItemMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.MoveItemCallbackFn callback) { + return moveItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse moveItem( + MoveItemRequest requestMessage, + StorageServiceClient.MoveItemMetadata_or_callbackFn metadata_or_callback) { + return moveItem( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse moveItem( + MoveItemRequest requestMessage, + StorageServiceClient.MoveItemMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.MoveItemCallbackFn callback); + + public native UnaryResponse moveItem( + MoveItemRequest requestMessage, + StorageServiceClient.MoveItemMetadata_or_callbackUnionType metadata_or_callback); + + @JsOverlay + public final UnaryResponse saveFile( + SaveFileRequest requestMessage, + BrowserHeaders metadata_or_callback, + StorageServiceClient.SaveFileCallbackFn callback) { + return saveFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse saveFile( + SaveFileRequest requestMessage, BrowserHeaders metadata_or_callback) { + return saveFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + @JsOverlay + public final UnaryResponse saveFile( + SaveFileRequest requestMessage, + StorageServiceClient.SaveFileMetadata_or_callbackFn metadata_or_callback, + StorageServiceClient.SaveFileCallbackFn callback) { + return saveFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback), + callback); + } + + @JsOverlay + public final UnaryResponse saveFile( + SaveFileRequest requestMessage, + StorageServiceClient.SaveFileMetadata_or_callbackFn metadata_or_callback) { + return saveFile( + requestMessage, + Js.uncheckedCast( + metadata_or_callback)); + } + + public native UnaryResponse saveFile( + SaveFileRequest requestMessage, + StorageServiceClient.SaveFileMetadata_or_callbackUnionType metadata_or_callback, + StorageServiceClient.SaveFileCallbackFn callback); + + public native UnaryResponse saveFile( + SaveFileRequest requestMessage, + StorageServiceClient.SaveFileMetadata_or_callbackUnionType metadata_or_callback); +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/UnaryResponse.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/UnaryResponse.java new file mode 100644 index 00000000000..8564246b53a --- /dev/null +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/storage_pb_service/UnaryResponse.java @@ -0,0 +1,12 @@ +package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.storage_pb_service; + +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType( + isNative = true, + name = "dhinternal.io.deephaven.proto.storage_pb_service.UnaryResponse", + namespace = JsPackage.GLOBAL) +public interface UnaryResponse { + void cancel(); +} From 2b95af76ccd38d98e1d46c3482c0d71eb59ed397 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Mon, 3 Oct 2022 12:25:23 -0400 Subject: [PATCH 168/215] Web version bump v0.19.0 (#2939) Release notes: https://github.com/deephaven/web-client-ui/releases/tag/v0.19.0 --- web/client-ui/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 498d26b891a..3430afa0200 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.17.0 +ARG WEB_VERSION=0.19.0 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ From 3061d61e17e657503a0fec143321072b2a54d3c1 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 3 Oct 2022 12:10:22 -0500 Subject: [PATCH 169/215] Only set storage path to $rootDir/data when run from gradle (#2940) Follow-up #1768 --- server/jetty-app/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index beb799b4f9b..89d3599f623 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -28,7 +28,6 @@ def extraJvmArgs = [ '-XX:MaxGCPauseMillis=100', '-XX:+UseStringDeduplication', '-XshowSettings:vm', - "-Dstorage.path=${rootDir}/data" ] if (hasProperty('groovy')) { @@ -69,6 +68,8 @@ if (hasProperty('gcApplication')) { tasks.withType(JavaExec).configureEach { // This appends to the existing jvm args, so that java-open-nio still takes effect jvmArgs extraJvmArgs + // For development in this repository via Gradle, use the top-level data directory + jvmArgs "-Dstorage.path=${rootDir}/data" } tasks.withType(CreateStartScripts).configureEach { From a3bc9dc54defd38187cf873fe836ef5f947cc530 Mon Sep 17 00:00:00 2001 From: James Nelson Date: Mon, 3 Oct 2022 11:35:49 -0600 Subject: [PATCH 170/215] De-root nginx (and grpc-proxy) (#2847) De-root nginx (and grpc-proxy) Add ci support for building nginx-noroot image Make grpc-proxy script for finding tls certs more robust Explain policy.d trick for installing sudo command Remove nginx-base, put in cache control for ide/* redirect Check if CA files exist before passing them to grpcproxy Change all web ports to 8080 --- .github/workflows/build-ci.yml | 2 +- containers/groovy-examples/docker-compose.yml | 2 +- containers/groovy/docker-compose.yml | 2 +- .../python-examples/NLTK/docker-compose.yml | 2 +- .../PyTorch/docker-compose.yml | 2 +- .../SciKit-Learn/docker-compose.yml | 2 +- .../TensorFlow/docker-compose.yml | 2 +- .../python-examples/base/docker-compose.yml | 2 +- containers/python/NLTK/docker-compose.yml | 2 +- containers/python/PyTorch/docker-compose.yml | 2 +- .../python/SciKit-Learn/docker-compose.yml | 2 +- .../python/TensorFlow/docker-compose.yml | 2 +- containers/python/base/docker-compose.yml | 2 +- docker-compose-common.yml | 2 +- docker/registry/nginx-base/gradle.properties | 3 -- .../build.gradle | 0 .../nginx-noroot-base/gradle.properties | 3 ++ docker/web/build.gradle | 6 +-- docker/web/src/main/docker/Dockerfile | 29 ++++++++++-- .../main/docker/nginx/99-init-notebooks.sh | 8 ++-- docker/web/src/main/docker/nginx/default.conf | 11 ++++- docker/web/src/main/docker/nginx/nginx.conf | 3 +- envoy/contents/envoy.yaml | 2 +- .../src/main/common/docker-entrypoint.sh | 46 ++++++++++++++++--- grpc-proxy/src/main/docker/Dockerfile | 2 +- web/client-ide/client-ide.gradle | 2 +- 26 files changed, 100 insertions(+), 43 deletions(-) delete mode 100644 docker/registry/nginx-base/gradle.properties rename docker/registry/{nginx-base => nginx-noroot-base}/build.gradle (100%) create mode 100644 docker/registry/nginx-noroot-base/gradle.properties diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 6bdc1f87c1e..fb59dacb74c 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -510,7 +510,7 @@ jobs: - name: Tag upstream images if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} run: | - ./docker/registry/nginx-base/build/crane/retag.sh + ./docker/registry/nginx-noroot-base/build/crane/retag.sh web-plugin-packager: runs-on: ubuntu-22.04 diff --git a/containers/groovy-examples/docker-compose.yml b/containers/groovy-examples/docker-compose.yml index f56eb8dc4a4..8ac7e9e7a3a 100644 --- a/containers/groovy-examples/docker-compose.yml +++ b/containers/groovy-examples/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/groovy/docker-compose.yml b/containers/groovy/docker-compose.yml index c6a8dec0839..0e22898c9ca 100644 --- a/containers/groovy/docker-compose.yml +++ b/containers/groovy/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python-examples/NLTK/docker-compose.yml b/containers/python-examples/NLTK/docker-compose.yml index 81804e69de4..8cb69624db0 100644 --- a/containers/python-examples/NLTK/docker-compose.yml +++ b/containers/python-examples/NLTK/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python-examples/PyTorch/docker-compose.yml b/containers/python-examples/PyTorch/docker-compose.yml index 924ca90b7b0..c515d6215e5 100644 --- a/containers/python-examples/PyTorch/docker-compose.yml +++ b/containers/python-examples/PyTorch/docker-compose.yml @@ -16,7 +16,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python-examples/SciKit-Learn/docker-compose.yml b/containers/python-examples/SciKit-Learn/docker-compose.yml index 02aadb1f92d..ea292c53f2a 100644 --- a/containers/python-examples/SciKit-Learn/docker-compose.yml +++ b/containers/python-examples/SciKit-Learn/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python-examples/TensorFlow/docker-compose.yml b/containers/python-examples/TensorFlow/docker-compose.yml index 4fac708b753..23b4bc00d3e 100644 --- a/containers/python-examples/TensorFlow/docker-compose.yml +++ b/containers/python-examples/TensorFlow/docker-compose.yml @@ -16,7 +16,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python-examples/base/docker-compose.yml b/containers/python-examples/base/docker-compose.yml index 81316659b00..ee1e969d323 100644 --- a/containers/python-examples/base/docker-compose.yml +++ b/containers/python-examples/base/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python/NLTK/docker-compose.yml b/containers/python/NLTK/docker-compose.yml index 1f948dec043..60877c52bec 100644 --- a/containers/python/NLTK/docker-compose.yml +++ b/containers/python/NLTK/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python/PyTorch/docker-compose.yml b/containers/python/PyTorch/docker-compose.yml index 804d9be28b6..e3cc3a28d99 100644 --- a/containers/python/PyTorch/docker-compose.yml +++ b/containers/python/PyTorch/docker-compose.yml @@ -16,7 +16,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python/SciKit-Learn/docker-compose.yml b/containers/python/SciKit-Learn/docker-compose.yml index 2093d85bfab..3839500dcaf 100644 --- a/containers/python/SciKit-Learn/docker-compose.yml +++ b/containers/python/SciKit-Learn/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python/TensorFlow/docker-compose.yml b/containers/python/TensorFlow/docker-compose.yml index edb52e5ae0a..83605868615 100644 --- a/containers/python/TensorFlow/docker-compose.yml +++ b/containers/python/TensorFlow/docker-compose.yml @@ -16,7 +16,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/containers/python/base/docker-compose.yml b/containers/python/base/docker-compose.yml index b55f58aa28d..b2c6f863699 100644 --- a/containers/python/base/docker-compose.yml +++ b/containers/python/base/docker-compose.yml @@ -14,7 +14,7 @@ services: web: image: ghcr.io/deephaven/web:${VERSION:-latest} expose: - - '80' + - '8080' volumes: - ./data:/data - web-tmp:/tmp diff --git a/docker-compose-common.yml b/docker-compose-common.yml index 753211a5d60..1f57e27d466 100644 --- a/docker-compose-common.yml +++ b/docker-compose-common.yml @@ -54,7 +54,7 @@ services: web: image: deephaven/web:local-build expose: - - "80" + - "8080" volumes: - ./data:/data deploy: diff --git a/docker/registry/nginx-base/gradle.properties b/docker/registry/nginx-base/gradle.properties deleted file mode 100644 index ed7f4187347..00000000000 --- a/docker/registry/nginx-base/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -io.deephaven.project.ProjectType=DOCKER_REGISTRY -deephaven.registry.imageName=ghcr.io/deephaven/nginx-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nginx-base@sha256:59e01d102c0137cd947583ad6add1a56629e7a2de26a2071745a3190bdf7b3be diff --git a/docker/registry/nginx-base/build.gradle b/docker/registry/nginx-noroot-base/build.gradle similarity index 100% rename from docker/registry/nginx-base/build.gradle rename to docker/registry/nginx-noroot-base/build.gradle diff --git a/docker/registry/nginx-noroot-base/gradle.properties b/docker/registry/nginx-noroot-base/gradle.properties new file mode 100644 index 00000000000..fbfeab2b943 --- /dev/null +++ b/docker/registry/nginx-noroot-base/gradle.properties @@ -0,0 +1,3 @@ +io.deephaven.project.ProjectType=DOCKER_REGISTRY +deephaven.registry.imageName=ghcr.io/deephaven/nginx-noroot-base:latest +deephaven.registry.imageId=ghcr.io/deephaven/nginx-noroot-base@sha256:292f757337a3946a175d128b652107cb12a6431ada8fc4397b290f9bff4c86e9 diff --git a/docker/web/build.gradle b/docker/web/build.gradle index 0c6208186f4..1e1c04a5167 100644 --- a/docker/web/build.gradle +++ b/docker/web/build.gradle @@ -12,7 +12,7 @@ dependencies { js project(path: ':web', targetConfiguration: 'js') } -evaluationDependsOn Docker.registryProject('nginx-base') +evaluationDependsOn Docker.registryProject('nginx-noroot-base') def dockerLicenses = License.createFrom(project).syncDockerLicense() @@ -23,7 +23,7 @@ def prepareDocker = project.tasks.register('prepareDocker', Sync) { // make sure that dockerCreateDockerfile has the proper dependencies. // If we change how our build works in the future (so that gradle is responsible for pushing the // image), we can remove this extra dependency. - dependsOn Docker.registryTask(project, 'nginx-base') + dependsOn Docker.registryTask(project, 'nginx-noroot-base') from layout.projectDirectory.dir('src/main/docker') from(configurations.js) { @@ -37,7 +37,7 @@ def prepareDocker = project.tasks.register('prepareDocker', Sync) { Docker.registerDockerImage(project, 'buildDocker') { inputDir.set syncDir - inputs.files Docker.registryFiles(project, 'nginx-base') + inputs.files Docker.registryFiles(project, 'nginx-noroot-base') inputs.files prepareDocker.get().outputs.files buildArgs.put('DEEPHAVEN_VERSION', project.version) images.add('deephaven/web:local-build') diff --git a/docker/web/src/main/docker/Dockerfile b/docker/web/src/main/docker/Dockerfile index 2b8a51d12fe..5d3590a7f8b 100644 --- a/docker/web/src/main/docker/Dockerfile +++ b/docker/web/src/main/docker/Dockerfile @@ -1,11 +1,30 @@ -FROM deephaven/nginx-base:local-build +FROM deephaven/nginx-noroot-base:local-build + +# In order to run without root, we start as root, install sudo w/ sudo rules, then switch to nginx user (id 101) +USER 0 + +# We want to install sudo, and start the sudo service (update policy-rc.d to exit 0, instead of 101) +RUN set -eux ; \ + ls -la /usr/sbin/policy-rc.d ; \ + printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d ; \ + apt update -y ; \ + apt install sudo -y ; \ + rm -rf /var/lib/apt/lists/* ; \ + printf '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d COPY licenses/ / -COPY nginx/default.conf /etc/nginx/conf.d/ -COPY nginx/nginx.conf /etc/nginx/ +COPY --chown=nginx nginx/default.conf /etc/nginx/conf.d/ +COPY --chown=nginx nginx/nginx.conf /etc/nginx/ COPY nginx/99-init-notebooks.sh /docker-entrypoint.d +COPY --chown=nginx static/ /usr/share/nginx/html + +RUN printf ' \n\ +nginx ALL=(ALL) NOPASSWD: /bin/mkdir -p /data/notebooks \n\ +nginx ALL=(ALL) NOPASSWD: /bin/chown nginx.nginx /data/notebooks \n\ +nginx ALL=(ALL) NOPASSWD: /bin/mkdir -p /data/layouts \n\ +nginx ALL=(ALL) NOPASSWD: /bin/chown nginx.nginx /data/layouts \n' > /etc/sudoers.d/deephaven; -COPY static/ /usr/share/nginx/html +USER 101 VOLUME /tmp ARG DEEPHAVEN_VERSION @@ -15,4 +34,4 @@ LABEL \ org.opencontainers.image.vendor="Deephaven Data Labs" \ org.opencontainers.image.title="Deephaven Web" \ org.opencontainers.image.description="Deephaven web" \ - org.opencontainers.image.licenses="Deephaven Community License Agreement 1.0" \ No newline at end of file + org.opencontainers.image.licenses="Deephaven Community License Agreement 1.0" diff --git a/docker/web/src/main/docker/nginx/99-init-notebooks.sh b/docker/web/src/main/docker/nginx/99-init-notebooks.sh index 0979efb993c..579b63e4b99 100755 --- a/docker/web/src/main/docker/nginx/99-init-notebooks.sh +++ b/docker/web/src/main/docker/nginx/99-init-notebooks.sh @@ -3,8 +3,8 @@ set -o errexit set -o pipefail set -o nounset -mkdir -p /data/notebooks -chown nginx /data/notebooks +test -d /data/notebooks || sudo -n -u root /bin/mkdir -p /data/notebooks +test "nginx" == "$(stat -c %U /data/notebooks)" || sudo -n -u root /bin/chown nginx.nginx /data/notebooks -mkdir -p /data/layouts -chown nginx /data/layouts \ No newline at end of file +test -d /data/layouts || sudo -n -u root /bin/mkdir -p /data/layouts +test "nginx" == "$(stat -c %U /data/layouts)" || sudo -n -u root /bin/chown nginx.nginx /data/layouts \ No newline at end of file diff --git a/docker/web/src/main/docker/nginx/default.conf b/docker/web/src/main/docker/nginx/default.conf index 75fdcdf5524..ae7b2f8b2fb 100644 --- a/docker/web/src/main/docker/nginx/default.conf +++ b/docker/web/src/main/docker/nginx/default.conf @@ -1,6 +1,6 @@ server { - listen 80; - listen [::]:80; + listen 8080; + listen [::]:8080; server_name localhost; # Disable redirect that breaks when passed through envoy @@ -18,6 +18,13 @@ server { add_header Cache-Control 'must-revalidate, max-age=0'; } + # Route /ide/whatever to serve ide/index.html but preserve user-supplied URL for js to process + location ~ ^/ide/ { + try_files $uri $uri/ /ide/index.html =404; + expires -1; + add_header Cache-Control 'must-revalidate, max-age=0'; + } + # .chunk.* files are safe to cache, as they contain a sha in their file name location ~* \.chunk.(?:css|js)$ { expires 1y; diff --git a/docker/web/src/main/docker/nginx/nginx.conf b/docker/web/src/main/docker/nginx/nginx.conf index ce87963d49f..1484d322976 100644 --- a/docker/web/src/main/docker/nginx/nginx.conf +++ b/docker/web/src/main/docker/nginx/nginx.conf @@ -1,11 +1,10 @@ -user nginx; worker_processes 1; # This is important! because it loads several dav module with this. include /etc/nginx/modules-enabled/*.conf; error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; +pid /tmp/nginx.pid; events { worker_connections 1024; diff --git a/envoy/contents/envoy.yaml b/envoy/contents/envoy.yaml index 914bf88de57..0110238fc47 100644 --- a/envoy/contents/envoy.yaml +++ b/envoy/contents/envoy.yaml @@ -121,4 +121,4 @@ static_resources: address: socket_address: address: web - port_value: 80 + port_value: 8080 diff --git a/grpc-proxy/src/main/common/docker-entrypoint.sh b/grpc-proxy/src/main/common/docker-entrypoint.sh index 65ba05d3e42..3bceba15879 100755 --- a/grpc-proxy/src/main/common/docker-entrypoint.sh +++ b/grpc-proxy/src/main/common/docker-entrypoint.sh @@ -2,10 +2,42 @@ set -o nounset -exec /app/dist/grpcwebproxy \ - --run_tls_server=false \ - --backend_addr="${BACKEND_ADDR}" \ - --backend_tls=false \ - --allow_all_origins \ - --use_websockets \ - --backend_max_call_recv_msg_size=104857600 +TLS_DIR="${TLS_DIR:-/etc/deephaven/certs}" +TLS_CRT="${TLS_CRT:-$TLS_DIR/tls.crt}" +TLS_KEY="${TLS_KEY:-$TLS_DIR/tls.key}" +TLS_CA="${TLS_CA:-$TLS_DIR/ca.crt}" + +PROXY_TLS_PORT="${PROXY_TLS_PORT:-8443}" +PROXY_DEBUG_PORT="${PROXY_DEBUG_PORT:-8080}" + +ALLOWED_ORIGINS="${ALLOWED_ORIGINS:+--allowed_origins=$ALLOWED_ORIGINS}" +ALLOWED_ORIGINS="${ALLOWED_ORIGINS:---allow_all_origins}" + +if [ -s "$TLS_CRT" ]; then + + CA_FILES="$TLS_CA" + [ -f /etc/ssl/certs/ca-certificates.crt ] && CA_FILES="${CA_FILES},/etc/ssl/certs/ca-certificates.crt" + [ -f /var/run/secrets/kubernetes.io/serviceaccount/ca.crt ] && CA_FILES="${CA_FILES},/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + + exec /app/dist/grpcwebproxy \ + --run_http_server=false \ + --server_http_debug_port="${PROXY_DEBUG_PORT}" \ + --backend_addr="${BACKEND_ADDR}" \ + --server_http_tls_port="${PROXY_TLS_PORT}" \ + --server_tls_cert_file="$TLS_CRT" \ + --server_tls_key_file="$TLS_KEY" \ + --server_tls_client_ca_files="$CA_FILES" \ + --backend_tls=true \ + "$ALLOWED_ORIGINS" \ + --use_websockets \ + --backend_max_call_recv_msg_size=104857600 +else + exec /app/dist/grpcwebproxy \ + --run_tls_server=false \ + --server_http_debug_port="${PROXY_DEBUG_PORT}" \ + --backend_addr="${BACKEND_ADDR}" \ + --backend_tls=false \ + "${ALLOWED_ORIGINS}" \ + --use_websockets \ + --backend_max_call_recv_msg_size=104857600 +fi diff --git a/grpc-proxy/src/main/docker/Dockerfile b/grpc-proxy/src/main/docker/Dockerfile index 1e696831975..74b35afafec 100644 --- a/grpc-proxy/src/main/docker/Dockerfile +++ b/grpc-proxy/src/main/docker/Dockerfile @@ -13,8 +13,8 @@ COPY contents/ . FROM deephaven/alpine:local-build COPY --from=install / / EXPOSE 8080 8443 +USER 1000 ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"] - ARG DEEPHAVEN_VERSION LABEL \ io.deephaven.image.type="grpc-proxy" \ diff --git a/web/client-ide/client-ide.gradle b/web/client-ide/client-ide.gradle index d02c52f48bb..370803d0e56 100644 --- a/web/client-ide/client-ide.gradle +++ b/web/client-ide/client-ide.gradle @@ -3,7 +3,7 @@ plugins { id 'io.deephaven.project.register' } -evaluationDependsOn Docker.registryProject('nginx-base') +evaluationDependsOn Docker.registryProject('nginx-noroot-base') apply from: "$rootDir/gradle/web-client.gradle" From 6a040d26371f2102bd33e852209ece68e07c09dd Mon Sep 17 00:00:00 2001 From: James Nelson Date: Mon, 3 Oct 2022 11:56:33 -0600 Subject: [PATCH 171/215] Add all-ai server docker image (#2849) Add all-ai server docker image --- .github/workflows/build-ci.yml | 27 +++++++++ containers/python-examples/All-AI/README.md | 29 +++++++++ .../python-examples/All-AI/docker-compose.yml | 50 ++++++++++++++++ containers/python/All-AI/README.md | 28 +++++++++ containers/python/All-AI/docker-compose.yml | 44 ++++++++++++++ docker/registry/all-ai-base/build.gradle | 3 + docker/registry/all-ai-base/gradle.properties | 3 + .../registry/scripts/update-requirements.sh | 4 +- docker/server/build.gradle | 1 + .../src/main/server-all-ai/requirements.txt | 59 +++++++++++++++++++ 10 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 containers/python-examples/All-AI/README.md create mode 100644 containers/python-examples/All-AI/docker-compose.yml create mode 100644 containers/python/All-AI/README.md create mode 100644 containers/python/All-AI/docker-compose.yml create mode 100644 docker/registry/all-ai-base/build.gradle create mode 100644 docker/registry/all-ai-base/gradle.properties create mode 100644 docker/server/src/main/server-all-ai/requirements.txt diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index fb59dacb74c..ccd0f5cb40f 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -116,6 +116,20 @@ jobs: type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest type=ref,event=branch + - name: Docker meta server all-ai + id: docker_meta_server_all_ai + uses: docker/metadata-action@v3 + with: + images: | + ghcr.io/${{ github.repository_owner }}/server-all-ai + flavor: | + latest=false + tags: | + type=edge,branch=main + type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=ref,event=branch + - name: Docker meta server slim id: docker_meta_server_slim uses: docker/metadata-action@v3 @@ -220,6 +234,18 @@ jobs: context: ./docker/server/build/context/ push: ${{ github.event_name != 'pull_request' }} + - name: Docker build server all-ai + uses: docker/build-push-action@v2 + with: + build-args: | + BASE=deephaven/all-ai-base:local-build + SERVER=server-all-ai + DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} + tags: ${{ steps.docker_meta_server_all_ai.outputs.tags }} + builder: ${{ steps.buildx.outputs.name }} + context: ./docker/server/build/context/ + push: ${{ github.event_name != 'pull_request' }} + # Note: server-slim does not need BASE/SERVER build-args like the other server images - name: Docker build server slim uses: docker/build-push-action@v2 @@ -241,6 +267,7 @@ jobs: ./docker/registry/pytorch-base/build/crane/retag.sh ./docker/registry/sklearn-base/build/crane/retag.sh ./docker/registry/tensorflow-base/build/crane/retag.sh + ./docker/registry/all-ai-base/build/crane/retag.sh grpc-proxy: runs-on: ubuntu-22.04 diff --git a/containers/python-examples/All-AI/README.md b/containers/python-examples/All-AI/README.md new file mode 100644 index 00000000000..9226185282f --- /dev/null +++ b/containers/python-examples/All-AI/README.md @@ -0,0 +1,29 @@ +# Overview + +A Docker Compose deployment for [Deephaven](https://deephaven.io). + +Contains all the python-based AI libraries together in one environment. + +## Features + +- [Deephaven](https://deephaven.io) +- [Python](https://python.org/) scripting +- [PyTorch](https://pytorch.org/) +- [TensorFlow](https://www.tensorflow.org/) +- [NLTK](https://www.nltk.org/) +- [SciKit-Learn](https://scikit-learn.org/stable/) +- [Deephaven Examples](https://github.com/deephaven/examples) + +## Launch Deephaven + +For launch instructions, see the [README](https://github.com/deephaven/deephaven-core#launch-python-with-example-data). For full instructions to work with Deephaven, see the [Quick start](https://deephaven.io/core/docs/tutorials/quickstart). + +To launch Deephaven, execute the following in your deployment directory: + +```bash +compose_file=https://raw.githubusercontent.com/deephaven/deephaven-core/main/containers/python-examples/All-AI/docker-compose.yml +curl -O "${compose_file}" + +docker-compose pull +docker-compose up -d +``` diff --git a/containers/python-examples/All-AI/docker-compose.yml b/containers/python-examples/All-AI/docker-compose.yml new file mode 100644 index 00000000000..8ea30148574 --- /dev/null +++ b/containers/python-examples/All-AI/docker-compose.yml @@ -0,0 +1,50 @@ +version: "3.4" + +services: + server: + image: ghcr.io/deephaven/server-all-ai:${VERSION:-latest} + expose: + - '8080' + volumes: + - ./data:/data + - api-cache:/cache + environment: + - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + ports: + - 6006:6006 + + web: + image: ghcr.io/deephaven/web:${VERSION:-latest} + expose: + - '8080' + volumes: + - ./data:/data + - web-tmp:/tmp + + grpc-proxy: + image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} + environment: + - BACKEND_ADDR=server:8080 + depends_on: + - server + expose: + - '8080' + + envoy: + image: ghcr.io/deephaven/envoy:${VERSION:-latest} + depends_on: + - web + - grpc-proxy + - server + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" + + examples: + image: ghcr.io/deephaven/examples:latest + volumes: + - ./data:/data + command: initialize + +volumes: + web-tmp: + api-cache: diff --git a/containers/python/All-AI/README.md b/containers/python/All-AI/README.md new file mode 100644 index 00000000000..cf175c740c4 --- /dev/null +++ b/containers/python/All-AI/README.md @@ -0,0 +1,28 @@ +# Overview + +A Docker Compose deployment for [Deephaven](https://deephaven.io). + +Contains all the python-based AI libraries together in one environment. + +## Features + +- [Deephaven](https://deephaven.io) +- [Python](https://python.org/) scripting +- [PyTorch](https://pytorch.org/) +- [TensorFlow](https://www.tensorflow.org/) +- [NLTK](https://www.nltk.org/) +- [SciKit-Learn](https://scikit-learn.org/stable/) + +## Launch Deephaven + +For launch instructions, see the [README](https://github.com/deephaven/deephaven-core#launch-python-with-example-data). For full instructions to work with Deephaven, see the [Quick start](https://deephaven.io/core/docs/tutorials/quickstart). + +To launch Deephaven, execute the following in your deployment directory: + +```bash +compose_file=https://raw.githubusercontent.com/deephaven/deephaven-core/main/containers/python/All-AI/docker-compose.yml +curl -O "${compose_file}" + +docker-compose pull +docker-compose up -d +``` diff --git a/containers/python/All-AI/docker-compose.yml b/containers/python/All-AI/docker-compose.yml new file mode 100644 index 00000000000..5a1fc96df25 --- /dev/null +++ b/containers/python/All-AI/docker-compose.yml @@ -0,0 +1,44 @@ +version: "3.4" + +services: + server: + image: ghcr.io/deephaven/server-all-ai:${VERSION:-latest} + expose: + - '8080' + volumes: + - ./data:/data + - api-cache:/cache + environment: + - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + ports: + - 6006:6006 + + web: + image: ghcr.io/deephaven/web:${VERSION:-latest} + expose: + - '8080' + volumes: + - ./data:/data + - web-tmp:/tmp + + grpc-proxy: + image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} + environment: + - BACKEND_ADDR=server:8080 + depends_on: + - server + expose: + - '8080' + + envoy: + image: ghcr.io/deephaven/envoy:${VERSION:-latest} + depends_on: + - web + - grpc-proxy + - server + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" + +volumes: + web-tmp: + api-cache: diff --git a/docker/registry/all-ai-base/build.gradle b/docker/registry/all-ai-base/build.gradle new file mode 100644 index 00000000000..a9bb1568cd2 --- /dev/null +++ b/docker/registry/all-ai-base/build.gradle @@ -0,0 +1,3 @@ +plugins { + id 'io.deephaven.project.register' +} diff --git a/docker/registry/all-ai-base/gradle.properties b/docker/registry/all-ai-base/gradle.properties new file mode 100644 index 00000000000..1e8727aee7b --- /dev/null +++ b/docker/registry/all-ai-base/gradle.properties @@ -0,0 +1,3 @@ +io.deephaven.project.ProjectType=DOCKER_REGISTRY +deephaven.registry.imageName=ghcr.io/deephaven/all-ai-base:latest +deephaven.registry.imageId=ghcr.io/deephaven/all-ai-base@sha256:5418714d66136d56fe93903e45c7f7f940cedc4ad360ecc504406db6a5ed6729 diff --git a/docker/registry/scripts/update-requirements.sh b/docker/registry/scripts/update-requirements.sh index 2b210490d39..d7edc617707 100755 --- a/docker/registry/scripts/update-requirements.sh +++ b/docker/registry/scripts/update-requirements.sh @@ -18,6 +18,7 @@ nltk_base_image_id="$(${__gradlew} -q docker-nltk-base:showImageId)" pytorch_base_image_id="$(${__gradlew} -q docker-pytorch-base:showImageId)" sklearn_base_image_id="$(${__gradlew} -q docker-sklearn-base:showImageId)" tensorflow_base_image_id="$(${__gradlew} -q docker-tensorflow-base:showImageId)" +all_ai_base_image_id="$(${__gradlew} -q docker-all-ai-base:showImageId)" # Write down the (potentially) new requirements # Need to manually remove pkg-resources @@ -26,4 +27,5 @@ docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > docker run --rm "${nltk_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-nltk/requirements.txt" docker run --rm "${pytorch_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-pytorch/requirements.txt" docker run --rm "${sklearn_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-sklearn/requirements.txt" -docker run --rm "${tensorflow_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-tensorflow/requirements.txt" \ No newline at end of file +docker run --rm "${tensorflow_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-tensorflow/requirements.txt" +docker run --rm "${all_ai_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-all-ai/requirements.txt" \ No newline at end of file diff --git a/docker/server/build.gradle b/docker/server/build.gradle index e5d495c9083..4bbef2dceee 100644 --- a/docker/server/build.gradle +++ b/docker/server/build.gradle @@ -14,6 +14,7 @@ def baseMapAmd64 = [ 'pytorch-base': 'server-pytorch', 'sklearn-base': 'server-sklearn', 'tensorflow-base': 'server-tensorflow', + 'all-ai-base': 'server-all-ai' ] // Only the server image is supported on arm64 diff --git a/docker/server/src/main/server-all-ai/requirements.txt b/docker/server/src/main/server-all-ai/requirements.txt new file mode 100644 index 00000000000..afb60eac87d --- /dev/null +++ b/docker/server/src/main/server-all-ai/requirements.txt @@ -0,0 +1,59 @@ +absl-py==1.2.0 +astunparse==1.6.3 +cachetools==5.2.0 +certifi==2022.9.24 +charset-normalizer==2.1.1 +click==8.1.3 +deephaven-plugin==0.2.0 +flatbuffers==2.0.7 +gast==0.4.0 +google-auth==2.12.0 +google-auth-oauthlib==0.4.6 +google-pasta==0.2.0 +grpcio==1.49.1 +h5py==3.7.0 +idna==3.4 +importlib-metadata==4.12.0 +java-utilities==0.2.0 +joblib==1.2.0 +jpy==0.12.0 +keras==2.7.0 +Keras-Preprocessing==1.1.2 +libclang==14.0.6 +llvmlite==0.39.1 +Markdown==3.4.1 +MarkupSafe==2.1.1 +nltk==3.7 +numba==0.56.2 +numpy==1.21.6 +oauthlib==3.2.1 +opt-einsum==3.3.0 +pandas==1.3.5 +pkg_resources==0.0.0 +protobuf==3.19.5 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +pytz==2022.2.1 +regex==2022.9.13 +requests==2.28.1 +requests-oauthlib==1.3.1 +rsa==4.9 +scikit-learn==1.0.2 +scipy==1.7.3 +six==1.16.0 +tensorboard==2.10.1 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorflow==2.7.4 +tensorflow-estimator==2.7.0 +tensorflow-io-gcs-filesystem==0.27.0 +termcolor==2.0.1 +threadpoolctl==3.1.0 +torch==1.12.1 +tqdm==4.64.1 +typing_extensions==4.3.0 +urllib3==1.26.12 +Werkzeug==2.2.2 +wrapt==1.14.1 +zipp==3.8.1 From d8f0c1134ccb05d2b4cc8b8de472f30a0a763b21 Mon Sep 17 00:00:00 2001 From: James Nelson Date: Mon, 3 Oct 2022 12:21:47 -0600 Subject: [PATCH 172/215] Add HealthStatusManager and correctly enterTerminalState (#2848) Add HealthStatusManager and correctly enterTerminalState --- .../server/healthcheck/HealthCheckModule.java | 4 ---- .../server/runner/DeephavenApiServer.java | 15 +++++++++++++-- .../server/runner/DeephavenApiServerModule.java | 7 +++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/io/deephaven/server/healthcheck/HealthCheckModule.java b/server/src/main/java/io/deephaven/server/healthcheck/HealthCheckModule.java index bdff99e5563..9029213d8c9 100644 --- a/server/src/main/java/io/deephaven/server/healthcheck/HealthCheckModule.java +++ b/server/src/main/java/io/deephaven/server/healthcheck/HealthCheckModule.java @@ -19,10 +19,6 @@ public class HealthCheckModule { @Singleton public HealthStatusManager bindHealthStatusManager() { HealthStatusManager healthStatusManager = new HealthStatusManager(); - ProcessEnvironment.getGlobalShutdownManager().registerTask( - ShutdownManager.OrderingCategory.FIRST, - healthStatusManager::enterTerminalState); - return healthStatusManager; } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java index b2c1e01f6bf..43cdbc4d10d 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java @@ -25,6 +25,8 @@ import io.deephaven.util.annotations.VisibleForTesting; import io.deephaven.util.process.ProcessEnvironment; import io.deephaven.util.process.ShutdownManager; +import io.grpc.health.v1.HealthCheckResponse; +import io.grpc.protobuf.services.HealthStatusManager; import javax.inject.Inject; import javax.inject.Provider; @@ -51,6 +53,7 @@ public class DeephavenApiServer { private final Map authenticationHandlers; private final Provider executionContextProvider; private final ServerConfig serverConfig; + private final HealthStatusManager healthStatusManager; @Inject public DeephavenApiServer( @@ -64,7 +67,8 @@ public DeephavenApiServer( final SessionService sessionService, final Map authenticationHandlers, final Provider executionContextProvider, - final ServerConfig serverConfig) { + final ServerConfig serverConfig, + final HealthStatusManager healthStatusManager) { this.server = server; this.ugp = ugp; this.logInit = logInit; @@ -76,6 +80,7 @@ public DeephavenApiServer( this.authenticationHandlers = authenticationHandlers; this.executionContextProvider = executionContextProvider; this.serverConfig = serverConfig; + this.healthStatusManager = healthStatusManager; } @VisibleForTesting @@ -100,7 +105,12 @@ SessionService sessionService() { public DeephavenApiServer run() throws IOException, ClassNotFoundException, TimeoutException { // Stop accepting new gRPC requests. ProcessEnvironment.getGlobalShutdownManager().registerTask(ShutdownManager.OrderingCategory.FIRST, - () -> server.stopWithTimeout(10, TimeUnit.SECONDS)); + () -> { + // healthStatusManager.enterTerminalState() must be called before server.stopWithTimeout(). + // If we add multiple `OrderingCategory.FIRST` callbacks, they'll execute in the wrong order. + healthStatusManager.enterTerminalState(); + server.stopWithTimeout(10, TimeUnit.SECONDS); + }); // Close outstanding sessions to give any gRPCs closure. ProcessEnvironment.getGlobalShutdownManager().registerTask(ShutdownManager.OrderingCategory.MIDDLE, @@ -151,6 +161,7 @@ public DeephavenApiServer run() throws IOException, ClassNotFoundException, Time log.info().append("Starting server...").endl(); server.start(); log.info().append("Server started on port ").append(server.getPort()).endl(); + healthStatusManager.setStatus("", HealthCheckResponse.ServingStatus.SERVING); return this; } diff --git a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java index 3221f6980e6..6ff4427280a 100644 --- a/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java +++ b/server/src/main/java/io/deephaven/server/runner/DeephavenApiServerModule.java @@ -11,6 +11,7 @@ import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.engine.util.ScriptSession; import io.deephaven.server.notebook.FilesystemStorageServiceModule; +import io.deephaven.server.healthcheck.HealthCheckModule; import io.deephaven.server.object.ObjectServiceModule; import io.deephaven.server.partitionedtable.PartitionedTableServiceModule; import io.deephaven.server.plugin.PluginsModule; @@ -27,6 +28,7 @@ import io.deephaven.util.thread.NamingThreadFactory; import io.grpc.BindableService; import io.grpc.ServerInterceptor; +import io.grpc.protobuf.services.HealthStatusManager; import org.jetbrains.annotations.NotNull; import javax.inject.Named; @@ -58,13 +60,14 @@ PluginsModule.class, PartitionedTableServiceModule.class, FilesystemStorageServiceModule.class, + HealthCheckModule.class, }) public class DeephavenApiServerModule { @Provides @ElementsIntoSet - static Set primeServices() { - return Collections.emptySet(); + static Set primeServices(HealthStatusManager healthStatusManager) { + return Collections.singleton(healthStatusManager.getHealthService()); } @Provides From e6c7d64fe73b3681b53ecc0de0771396632f1a46 Mon Sep 17 00:00:00 2001 From: Cristian Ferretti <37232625+jcferretti@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:05:12 -0400 Subject: [PATCH 173/215] In the cpp client, fix a compilation issue with optional definitions missing from table.cc. (#2914) --- cpp-client/README.md | 6 +++--- cpp-client/deephaven/client/src/table/table.cc | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp-client/README.md b/cpp-client/README.md index 01823519bd4..0db29007204 100644 --- a/cpp-client/README.md +++ b/cpp-client/README.md @@ -1,10 +1,10 @@ -# Building the C++ client from a base Ubuntu 20.04 image +# Building the C++ client from a base Ubuntu 20.04 or 22.04 image These instructions show how to install and run the Deephaven C++ client, its dependencies, -and its unit tests. We have tested these instructions in Ubuntu 20.04 with the default +and its unit tests. We have tested these instructions in Ubuntu 20.04 and 22.04 with the default C++ compiler and tool suite (cmake etc). -1. Start with an Ubuntu 20.04 install +1. Start with an Ubuntu 20.04 or 22.04 install 2. Get Deephaven running by following the instructions here: https://deephaven.io/core/docs/how-to-guides/launch-build/ diff --git a/cpp-client/deephaven/client/src/table/table.cc b/cpp-client/deephaven/client/src/table/table.cc index d37228f69f7..2defa7f9810 100644 --- a/cpp-client/deephaven/client/src/table/table.cc +++ b/cpp-client/deephaven/client/src/table/table.cc @@ -8,6 +8,8 @@ #include "deephaven/client/container/row_sequence.h" #include "deephaven/client/utility/utility.h" +#include + using deephaven::client::chunk::AnyChunk; using deephaven::client::chunk::BooleanChunk; using deephaven::client::chunk::ChunkMaker; From 24ea5231618f4fb5b03703124739c64184a46af7 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 4 Oct 2022 07:28:16 -0700 Subject: [PATCH 174/215] Switch over developer prepareCompose workflow to jetty (#2941) --- .env | 2 +- .github/workflows/build-ci.yml | 26 +++---- Integrations/build.gradle | 4 +- build.gradle | 7 +- .../docker/DeephavenInDockerExtension.groovy | 2 +- debezium/demo/.env | 2 +- debezium/demo/docker-compose.yml | 28 ------- docker-compose-common.yml | 47 +----------- docker-compose.yml | 28 ------- docker/README.md | 12 +-- docker/server-jetty/build.gradle | 76 +++++++++++++++++++ docker/server-jetty/gradle.properties | 1 + .../main/configure/image-bootstrap.properties | 6 ++ .../server-jetty/src/main/docker/Dockerfile | 44 +++++++++++ .../src/main/server-jetty}/requirements.txt | 0 docker/server/build.gradle | 14 ++-- .../main/configure/image-bootstrap.properties | 1 + .../requirements.txt | 0 .../src/main/server-netty/requirements.txt | 13 ++++ .../requirements.txt | 0 .../requirements.txt | 0 .../requirements.txt | 0 .../requirements.txt | 0 redpanda-apicurio/.env | 2 +- redpanda-apicurio/docker-compose.yml | 29 ------- redpanda/.env | 2 +- redpanda/docker-compose.yml | 28 ------- settings.gradle | 3 + sphinx/sphinx.gradle | 8 +- 29 files changed, 186 insertions(+), 199 deletions(-) create mode 100644 docker/server-jetty/build.gradle create mode 100644 docker/server-jetty/gradle.properties create mode 100644 docker/server-jetty/src/main/configure/image-bootstrap.properties create mode 100644 docker/server-jetty/src/main/docker/Dockerfile rename docker/{server/src/main/server => server-jetty/src/main/server-jetty}/requirements.txt (100%) rename docker/server/src/main/{server-all-ai => server-all-ai-netty}/requirements.txt (100%) create mode 100644 docker/server/src/main/server-netty/requirements.txt rename docker/server/src/main/{server-nltk => server-nltk-netty}/requirements.txt (100%) rename docker/server/src/main/{server-pytorch => server-pytorch-netty}/requirements.txt (100%) rename docker/server/src/main/{server-sklearn => server-sklearn-netty}/requirements.txt (100%) rename docker/server/src/main/{server-tensorflow => server-tensorflow-netty}/requirements.txt (100%) diff --git a/.env b/.env index fa38c714a55..3b24bb0cad5 100644 --- a/.env +++ b/.env @@ -6,4 +6,4 @@ COMPOSE_PROJECT_NAME=core DEEPHAVEN_PORT=10000 DEEPHAVEN_CONSOLE_TYPE=python DEEPHAVEN_APPLICATION_DIR=/data/app.d -DEEPHAVEN_SERVER_IMAGE=deephaven/server:local-build +DEEPHAVEN_SERVER_IMAGE=deephaven/server-jetty:local-build diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index ccd0f5cb40f..f1881b8f3fb 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -51,7 +51,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server + ghcr.io/${{ github.repository_owner }}/server-netty flavor: | latest=false tags: | @@ -65,7 +65,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-nltk + ghcr.io/${{ github.repository_owner }}/server-nltk-netty flavor: | latest=false tags: | @@ -79,7 +79,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-pytorch + ghcr.io/${{ github.repository_owner }}/server-pytorch-netty flavor: | latest=false tags: | @@ -93,7 +93,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-sklearn + ghcr.io/${{ github.repository_owner }}/server-sklearn-netty flavor: | latest=false tags: | @@ -107,7 +107,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-tensorflow + ghcr.io/${{ github.repository_owner }}/server-tensorflow-netty flavor: | latest=false tags: | @@ -121,7 +121,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-all-ai + ghcr.io/${{ github.repository_owner }}/server-all-ai-netty flavor: | latest=false tags: | @@ -135,7 +135,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - ghcr.io/${{ github.repository_owner }}/server-slim + ghcr.io/${{ github.repository_owner }}/server-slim-netty flavor: | latest=false tags: | @@ -179,7 +179,7 @@ jobs: with: build-args: | BASE=deephaven/server-base:local-build - SERVER=server + SERVER=server-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} @@ -191,7 +191,7 @@ jobs: with: build-args: | BASE=deephaven/nltk-base:local-build - SERVER=server-nltk + SERVER=server-nltk-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server_nltk.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} @@ -203,7 +203,7 @@ jobs: with: build-args: | BASE=deephaven/pytorch-base:local-build - SERVER=server-pytorch + SERVER=server-pytorch-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server_pytorch.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} @@ -215,7 +215,7 @@ jobs: with: build-args: | BASE=deephaven/sklearn-base:local-build - SERVER=server-sklearn + SERVER=server-sklearn-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server_sklearn.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} @@ -227,7 +227,7 @@ jobs: with: build-args: | BASE=deephaven/tensorflow-base:local-build - SERVER=server-tensorflow + SERVER=server-tensorflow-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server_tensorflow.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} @@ -239,7 +239,7 @@ jobs: with: build-args: | BASE=deephaven/all-ai-base:local-build - SERVER=server-all-ai + SERVER=server-all-ai-netty DEEPHAVEN_VERSION=${{ steps.deephaven_version.outputs.deephaven_version }} tags: ${{ steps.docker_meta_server_all_ai.outputs.tags }} builder: ${{ steps.buildx.outputs.name }} diff --git a/Integrations/build.gradle b/Integrations/build.gradle index 8055b8ad11b..ca41bb1c204 100644 --- a/Integrations/build.gradle +++ b/Integrations/build.gradle @@ -57,7 +57,7 @@ def runInDocker = { String name, String sourcePath, List command, Closur into 'python/configs' } } - parentContainers = [project(':docker-server').tasks.findByName('buildDocker-server')] // deephaven/server + parentContainers = [project(':docker-server').tasks.findByName('buildDocker-server-netty')] // deephaven/server-netty imageName = 'deephaven/py-integrations:local-build' @@ -65,7 +65,7 @@ def runInDocker = { String name, String sourcePath, List command, Closur dockerfile { // set up the container, env vars - things that aren't likely to change - from 'deephaven/server:local-build' + from 'deephaven/server-netty:local-build' runCommand '''set -eux; \\ pip3 install unittest-xml-reporting==3.0.4;\\ mkdir -p /out/report;\\ diff --git a/build.gradle b/build.gradle index afdfa20f8cc..708041cf6fd 100644 --- a/build.gradle +++ b/build.gradle @@ -59,11 +59,7 @@ tasks.register('nightly') { tasks.register('prepareCompose') { it.group 'Deephaven lifecycle' it.description 'A lifecycle task that prepares prerequisites for local docker-compose builds' - it.dependsOn project(':docker-server-slim').tasks.findByName('buildDocker-server-slim'), - project(':docker-server').tasks.findByName('buildDocker-server'), - project(':docker-web').tasks.findByName('buildDocker'), - project(':envoy').tasks.findByName('buildDocker'), - project(':grpc-proxy').tasks.findByName('buildDocker-grpc-proxy') + it.dependsOn project(':docker-server-jetty').tasks.findByName('buildDocker-server-jetty') } tasks.register('smoke') { @@ -77,6 +73,7 @@ tasks.register('smoke') { it.dependsOn project(':server').tasks.findByName(LifecycleBasePlugin.CHECK_TASK_NAME) it.dependsOn project(':docker-server-slim').tasks.findByName('prepareDocker') it.dependsOn project(':docker-server').tasks.findByName('prepareDocker') + it.dependsOn project(':docker-server-jetty').tasks.findByName('prepareDocker') it.dependsOn project(':web').tasks.findByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME) it.dependsOn project(':Generators').tasks.findByName(LifecycleBasePlugin.CHECK_TASK_NAME) } diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy index c43e9884e6a..c8b9084d10d 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DeephavenInDockerExtension.groovy @@ -45,7 +45,7 @@ public abstract class DeephavenInDockerExtension { // irritating configuration order of operations to work out here, so just leaving // these as constants until we decide they aren't any more deephavenServerProject = ':docker-server' - serverTask = 'buildDocker-server' + serverTask = 'buildDocker-server-netty' def serverProject = project.evaluationDependsOn(deephavenServerProject) def createDeephavenGrpcApiNetwork = project.tasks.register('createDeephavenGrpcApiNetwork', DockerCreateNetwork) { task -> diff --git a/debezium/demo/.env b/debezium/demo/.env index 3d48847613c..c915173dbc4 100644 --- a/debezium/demo/.env +++ b/debezium/demo/.env @@ -2,7 +2,7 @@ COMPOSE_PROJECT_NAME=core-debezium-demo DEEPHAVEN_PORT=10000 DEEPHAVEN_CONSOLE_TYPE=python DEEPHAVEN_APPLICATION_DIR=/data/app.d -DEEPHAVEN_SERVER_IMAGE=deephaven/server:local-build +DEEPHAVEN_SERVER_IMAGE=deephaven/server-jetty:local-build DEBEZIUM_VERSION=1.4 REDPANDA_VERSION=v21.9.5 REDPANDA_MEMORY=1G diff --git a/debezium/demo/docker-compose.yml b/debezium/demo/docker-compose.yml index e1abe7df828..569ad577f75 100644 --- a/debezium/demo/docker-compose.yml +++ b/debezium/demo/docker-compose.yml @@ -12,34 +12,6 @@ services: - ../scripts:/scripts - ./logs:/logs - web: - extends: - file: ../../docker-compose-common.yml - service: web - - # Should only be used for non-production deployments, see grpc-proxy/README.md for more info - grpc-proxy: - extends: - file: ../../docker-compose-common.yml - service: grpc-proxy - depends_on: - server: - condition: service_healthy - - envoy: - # A reverse proxy configured for no SSL on localhost. It fronts the requests - # for the static content and the websocket proxy. - extends: - file: ../../docker-compose-common.yml - service: envoy - depends_on: - server: - condition: service_healthy - grpc-proxy: - condition: service_started - web: - condition: service_started - redpanda: extends: file: ../docker-compose-debezium-common.yml diff --git a/docker-compose-common.yml b/docker-compose-common.yml index 1f57e27d466..e072231f451 100644 --- a/docker-compose-common.yml +++ b/docker-compose-common.yml @@ -14,7 +14,7 @@ services: # with max memory. # # To turn on debug logging, add: -Dlogback.configurationFile=logback-debug.xml - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} -Dstorage.path=/data + - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} # # For remote debugging switch the line above for the one below (and also change the ports below) # - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} @@ -22,13 +22,11 @@ services: # For jprofiler sessions (if you tweaked the jprofiler version in jprofiler-server/Dockerfile you need to tweak path) # - JAVA_TOOL_OPTIONS=-agentpath:/opt/jprofiler13.0/bin/linux-x64/libjprofilerti.so=port=8849,nowait -Xmx4g -Ddeephaven.console.type=${DEEPHAVEN_CONSOLE_TYPE} -Ddeephaven.application.dir=${DEEPHAVEN_APPLICATION_DIR} - expose: - - '8080' + ports: + - '10000:10000' # For remote debugging (change if using different port) -# ports: # - '5005:5005' # For jprofiler (change if using different port) -# ports: # - '8849:8849' # Note: using old-style volume mounts, so that the directories get created if they don't exist @@ -50,42 +48,3 @@ services: # $ docker exec core_server_1 tc qdisc add dev eth0 root netem delay 10ms cap_add: - SYS_PTRACE - - web: - image: deephaven/web:local-build - expose: - - "8080" - volumes: - - ./data:/data - deploy: - resources: - limits: - cpus: '1' - memory: 256M - - # Should only be used for non-production deployments, see grpc-proxy/README.md for more info - grpc-proxy: - image: deephaven/grpc-proxy:local-build - environment: - - BACKEND_ADDR=server:8080 - expose: - - '8080' -# - '8443' #unused - deploy: - resources: - limits: - cpus: '1' - memory: 256M - - envoy: - # A reverse proxy configured for no SSL on localhost. It fronts the requests - # for the static content and the websocket proxy. - image: deephaven/envoy:local-build - ports: - - "${DEEPHAVEN_PORT}:10000" -# - '9090:9090' #envoy admin - deploy: - resources: - limits: - cpus: '1' - memory: 256M diff --git a/docker-compose.yml b/docker-compose.yml index bbd721eac58..ff3b4f6ab6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,31 +16,3 @@ services: extends: file: docker-compose-common.yml service: server - - web: - extends: - file: docker-compose-common.yml - service: web - - # Should only be used for non-production deployments, see grpc-proxy/README.md for more info - grpc-proxy: - extends: - file: docker-compose-common.yml - service: grpc-proxy - depends_on: - server: - condition: service_healthy - - envoy: - # A reverse proxy configured for no SSL on localhost. It fronts the requests - # for the static content and the websocket proxy. - extends: - file: docker-compose-common.yml - service: envoy - depends_on: - server: - condition: service_healthy - grpc-proxy: - condition: service_started - web: - condition: service_started diff --git a/docker/README.md b/docker/README.md index 055ba0fa2f0..da848129c23 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,16 +2,16 @@ ## docker-server-slim -The `docker-server-slim` project produces the image `deephaven/server-slim:local-build`. +The `docker-server-slim` project produces the image `deephaven/server-slim-netty:local-build`. ## docker-server The `docker-server` project produces the images: -* `deephaven/server:local-build` -* `deephaven/server-nltk:local-build` -* `deephaven/server-pytorch:local-build` -* `deephaven/server-sklearn:local-build` -* `deephaven/server-tensorflow:local-build` +* `deephaven/server-netty:local-build` +* `deephaven/server-nltk-netty:local-build` +* `deephaven/server-pytorch-netty:local-build` +* `deephaven/server-sklearn-netty:local-build` +* `deephaven/server-tensorflow-netty:local-build` When the base images for `docker-server` are updated, the requirements.txt files may need to be updated. This can currently be done manually via: diff --git a/docker/server-jetty/build.gradle b/docker/server-jetty/build.gradle new file mode 100644 index 00000000000..a66fe027c33 --- /dev/null +++ b/docker/server-jetty/build.gradle @@ -0,0 +1,76 @@ +import io.deephaven.tools.docker.Architecture +import io.deephaven.tools.License + +plugins { + id 'com.bmuschko.docker-remote-api' + id 'io.deephaven.project.register' +} + +def targetArch = Architecture.targetArchitecture(project) + +def baseMapAmd64 = [ + 'server-base': 'server-jetty', +] + +// Only the server image is supported on arm64 +// TODO(deephaven-core#1702): Support arm64 builds for applicable extended images +def baseMapArm64 = baseMapAmd64.findAll { key, value -> value == 'server-jetty' } + +def baseMap = targetArch == Architecture.AMD64 ? baseMapAmd64 : baseMapArm64 + +baseMap.keySet().each {base -> + evaluationDependsOn Docker.registryProject(base) +} + +configurations { + serverApplicationDist + pythonWheel +} + +dependencies { + serverApplicationDist project(path: ':server-jetty-app', configuration: 'applicationDist') + + pythonWheel project(':py-server') +} + +def dockerLicenses = License.createFrom(project).syncDockerLicense().get() + +def context= project.layout.buildDirectory.dir('context') + +def prepareDocker = project.tasks.register('prepareDocker', Sync) { + + from 'src/main/docker' + baseMap.values().each { server -> + from("src/main/${server}") { + into server + } + } + from ('src/main/configure') { + into 'configure' + } + + from(configurations.pythonWheel) { + into 'wheels' + } + + from(configurations.serverApplicationDist) { + into 'serverApplicationDist' + } + from(dockerLicenses.outputs) { + into 'licenses' + } + into context +} + +def buildDockerClosure = { String base, String server -> + Docker.registerDockerTwoPhaseImage(project, server, 'install') { + dependsOn prepareDocker + inputDir.set context + inputs.files Docker.registryFiles(project, base) + buildArgs.put('BASE', "deephaven/${base}:local-build") + buildArgs.put('SERVER', server) + buildArgs.put('DEEPHAVEN_VERSION', project.version) + } +} + +assemble.dependsOn baseMap.collect { base, server -> buildDockerClosure(base, server) } diff --git a/docker/server-jetty/gradle.properties b/docker/server-jetty/gradle.properties new file mode 100644 index 00000000000..8f42cc0940f --- /dev/null +++ b/docker/server-jetty/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=BASIC diff --git a/docker/server-jetty/src/main/configure/image-bootstrap.properties b/docker/server-jetty/src/main/configure/image-bootstrap.properties new file mode 100644 index 00000000000..490d83f2e75 --- /dev/null +++ b/docker/server-jetty/src/main/configure/image-bootstrap.properties @@ -0,0 +1,6 @@ +Configuration.rootFile=dh-defaults.prop +workspace=. +devroot=. + +deephaven.cache.dir=/cache +storage.path=/data diff --git a/docker/server-jetty/src/main/docker/Dockerfile b/docker/server-jetty/src/main/docker/Dockerfile new file mode 100644 index 00000000000..d4a1213f97c --- /dev/null +++ b/docker/server-jetty/src/main/docker/Dockerfile @@ -0,0 +1,44 @@ +ARG BASE +FROM $BASE as install + +COPY licenses/ / + +# Note: all of the pip installs have the --no-index flag, with the expectation that all external dependencies are +# already satisfied via the base image. If that is not the case, we want the install to error out, and we'll need to +# update the base image with the extra requirements before proceeding here. + +ARG SERVER +COPY $SERVER/requirements.txt requirements.txt +RUN set -eux; \ + python -m pip install -q --no-index --no-cache-dir -r requirements.txt; \ + rm requirements.txt + +COPY wheels/ /wheels +RUN set -eux; \ + python -m pip install -q --no-index --no-cache-dir /wheels/*.whl; \ + rm -r /wheels + +ARG DEEPHAVEN_VERSION +ADD serverApplicationDist/server-jetty-${DEEPHAVEN_VERSION}.tar /opt/deephaven + +RUN set -eux; \ + ln -s /opt/deephaven/server-jetty-${DEEPHAVEN_VERSION} /opt/deephaven/server + +COPY configure/image-bootstrap.properties image-bootstrap.properties + +FROM $BASE +COPY --from=install / / +VOLUME /data +VOLUME /cache +HEALTHCHECK --interval=3s --retries=3 --timeout=11s CMD /bin/grpc_health_probe -addr=localhost:10000 -connect-timeout=10s || exit 1 +ENTRYPOINT [ "/opt/deephaven/server/bin/start", "image-bootstrap.properties" ] +ARG DEEPHAVEN_VERSION +ARG SERVER +LABEL \ + io.deephaven.image.type="server" \ + io.deephaven.server.flavor="${SERVER}" \ + io.deephaven.version="${DEEPHAVEN_VERSION}" \ + org.opencontainers.image.vendor="Deephaven Data Labs" \ + org.opencontainers.image.title="Deephaven Server - ${SERVER}" \ + org.opencontainers.image.description="Deephaven Community Core Server - ${SERVER}" \ + org.opencontainers.image.licenses="Deephaven Community License Agreement 1.0" \ No newline at end of file diff --git a/docker/server/src/main/server/requirements.txt b/docker/server-jetty/src/main/server-jetty/requirements.txt similarity index 100% rename from docker/server/src/main/server/requirements.txt rename to docker/server-jetty/src/main/server-jetty/requirements.txt diff --git a/docker/server/build.gradle b/docker/server/build.gradle index 4bbef2dceee..c26d608e04f 100644 --- a/docker/server/build.gradle +++ b/docker/server/build.gradle @@ -9,17 +9,17 @@ plugins { def targetArch = Architecture.targetArchitecture(project) def baseMapAmd64 = [ - 'server-base': 'server', - 'nltk-base': 'server-nltk', - 'pytorch-base': 'server-pytorch', - 'sklearn-base': 'server-sklearn', - 'tensorflow-base': 'server-tensorflow', - 'all-ai-base': 'server-all-ai' + 'server-base': 'server-netty', + 'nltk-base': 'server-nltk-netty', + 'pytorch-base': 'server-pytorch-netty', + 'sklearn-base': 'server-sklearn-netty', + 'tensorflow-base': 'server-tensorflow-netty', + 'all-ai-base': 'server-all-ai-netty' ] // Only the server image is supported on arm64 // TODO(deephaven-core#1702): Support arm64 builds for applicable extended images -def baseMapArm64 = baseMapAmd64.findAll { key, value -> value == 'server' } +def baseMapArm64 = baseMapAmd64.findAll { key, value -> value == 'server-netty' } def baseMap = targetArch == Architecture.AMD64 ? baseMapAmd64 : baseMapArm64 diff --git a/docker/server/src/main/configure/image-bootstrap.properties b/docker/server/src/main/configure/image-bootstrap.properties index 82dd16c79d4..490d83f2e75 100644 --- a/docker/server/src/main/configure/image-bootstrap.properties +++ b/docker/server/src/main/configure/image-bootstrap.properties @@ -3,3 +3,4 @@ workspace=. devroot=. deephaven.cache.dir=/cache +storage.path=/data diff --git a/docker/server/src/main/server-all-ai/requirements.txt b/docker/server/src/main/server-all-ai-netty/requirements.txt similarity index 100% rename from docker/server/src/main/server-all-ai/requirements.txt rename to docker/server/src/main/server-all-ai-netty/requirements.txt diff --git a/docker/server/src/main/server-netty/requirements.txt b/docker/server/src/main/server-netty/requirements.txt new file mode 100644 index 00000000000..3ba59ecbbab --- /dev/null +++ b/docker/server/src/main/server-netty/requirements.txt @@ -0,0 +1,13 @@ +deephaven-plugin==0.2.0 +importlib-metadata==4.12.0 +java-utilities==0.2.0 +jpy==0.12.0 +llvmlite==0.39.1 +numba==0.56.2 +numpy==1.21.6 +pandas==1.3.5 +python-dateutil==2.8.2 +pytz==2022.2.1 +six==1.16.0 +typing_extensions==4.3.0 +zipp==3.8.1 diff --git a/docker/server/src/main/server-nltk/requirements.txt b/docker/server/src/main/server-nltk-netty/requirements.txt similarity index 100% rename from docker/server/src/main/server-nltk/requirements.txt rename to docker/server/src/main/server-nltk-netty/requirements.txt diff --git a/docker/server/src/main/server-pytorch/requirements.txt b/docker/server/src/main/server-pytorch-netty/requirements.txt similarity index 100% rename from docker/server/src/main/server-pytorch/requirements.txt rename to docker/server/src/main/server-pytorch-netty/requirements.txt diff --git a/docker/server/src/main/server-sklearn/requirements.txt b/docker/server/src/main/server-sklearn-netty/requirements.txt similarity index 100% rename from docker/server/src/main/server-sklearn/requirements.txt rename to docker/server/src/main/server-sklearn-netty/requirements.txt diff --git a/docker/server/src/main/server-tensorflow/requirements.txt b/docker/server/src/main/server-tensorflow-netty/requirements.txt similarity index 100% rename from docker/server/src/main/server-tensorflow/requirements.txt rename to docker/server/src/main/server-tensorflow-netty/requirements.txt diff --git a/redpanda-apicurio/.env b/redpanda-apicurio/.env index 76597c029b6..0d77b06d744 100644 --- a/redpanda-apicurio/.env +++ b/redpanda-apicurio/.env @@ -2,4 +2,4 @@ COMPOSE_PROJECT_NAME=core-redpanda-apicurio DEEPHAVEN_PORT=10000 DEEPHAVEN_CONSOLE_TYPE=python DEEPHAVEN_APPLICATION_DIR=/data/app.d -DEEPHAVEN_SERVER_IMAGE=deephaven/server:local-build +DEEPHAVEN_SERVER_IMAGE=deephaven/server-jetty:local-build diff --git a/redpanda-apicurio/docker-compose.yml b/redpanda-apicurio/docker-compose.yml index d626d1cdd28..29b1eb1cfb8 100644 --- a/redpanda-apicurio/docker-compose.yml +++ b/redpanda-apicurio/docker-compose.yml @@ -9,35 +9,6 @@ services: file: ../docker-compose-common.yml service: server - web: - extends: - file: ../docker-compose-common.yml - service: web - - # Should only be used for non-production deployments, see grpc-proxy/README.md for more info - grpc-proxy: - extends: - file: ../docker-compose-common.yml - service: grpc-proxy - depends_on: - server: - condition: service_healthy - - - envoy: - # A reverse proxy configured for no SSL on localhost. It fronts the requests - # for the static content and the websocket proxy. - extends: - file: ../docker-compose-common.yml - service: envoy - depends_on: - server: - condition: service_healthy - grpc-proxy: - condition: service_started - web: - condition: service_started - redpanda: extends: file: ../redpanda-standalone/docker-compose.yml diff --git a/redpanda/.env b/redpanda/.env index 6bbb97443a3..b7bddf3c7f2 100644 --- a/redpanda/.env +++ b/redpanda/.env @@ -2,4 +2,4 @@ COMPOSE_PROJECT_NAME=core-redpanda DEEPHAVEN_PORT=10000 DEEPHAVEN_CONSOLE_TYPE=python DEEPHAVEN_APPLICATION_DIR=/data/app.d -DEEPHAVEN_SERVER_IMAGE=deephaven/server:local-build +DEEPHAVEN_SERVER_IMAGE=deephaven/server-jetty:local-build diff --git a/redpanda/docker-compose.yml b/redpanda/docker-compose.yml index 7730a8328b3..49519441f19 100644 --- a/redpanda/docker-compose.yml +++ b/redpanda/docker-compose.yml @@ -9,34 +9,6 @@ services: file: ../docker-compose-common.yml service: server - web: - extends: - file: ../docker-compose-common.yml - service: web - - # Should only be used for non-production deployments, see grpc-proxy/README.md for more info - grpc-proxy: - extends: - file: ../docker-compose-common.yml - service: grpc-proxy - depends_on: - server: - condition: service_healthy - - envoy: - # A reverse proxy configured for no SSL on localhost. It fronts the requests - # for the static content and the websocket proxy. - extends: - file: ../docker-compose-common.yml - service: envoy - depends_on: - server: - condition: service_healthy - grpc-proxy: - condition: service_started - web: - condition: service_started - redpanda: extends: file: ../redpanda-standalone/docker-compose.yml diff --git a/settings.gradle b/settings.gradle index 6c3ed6ffba3..83ac2a3d0f7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -314,6 +314,9 @@ project(':docker-runtime-base').projectDir = file('docker/runtime-base') include(':docker-server') project(':docker-server').projectDir = file('docker/server') +include(':docker-server-jetty') +project(':docker-server-jetty').projectDir = file('docker/server-jetty') + include(':docker-web') project(':docker-web').projectDir = file('docker/web') diff --git a/sphinx/sphinx.gradle b/sphinx/sphinx.gradle index 8380e07bc11..aae3e841277 100644 --- a/sphinx/sphinx.gradle +++ b/sphinx/sphinx.gradle @@ -29,7 +29,7 @@ def copySphinxLib = tasks.register('copySphinxLib', Sync) { def sphinxDockerfile = tasks.register('sphinxDockerfile', Dockerfile) { destFile.set layout.buildDirectory.file('sphinx-image/Dockerfile') // Deephaven server python API requires that the wheel be installed to build, so we share this image - from 'deephaven/server:local-build' + from 'deephaven/server-netty:local-build' copyFile "./wheel", "/wheel" copyFile "./lib", '${VIRTUAL_ENV}/lib/python3.7/site-packages/' @@ -52,7 +52,7 @@ def sphinxImage = Docker.registerDockerImage(project, 'sphinx') { inputs.files copyPyClientWhl.get().outputs.files inputs.files copySphinxLib.get().outputs.files inputDir.set layout.buildDirectory.dir('sphinx-image') - inputs.files project(':docker-server').tasks.findByName('buildDocker-server').outputs.files // deephaven/server + inputs.files project(':docker-server').tasks.findByName('buildDocker-server-netty').outputs.files // deephaven/server-netty images.add('deephaven/sphinx:local-build') } @@ -101,7 +101,7 @@ def cppClientDoxygenTask = Docker.registerDockerTask(project, 'cppClientDoxygen' } dockerfile { // share the common base image to keep it simple - from 'deephaven/server:local-build' + from 'deephaven/server-netty:local-build' runCommand('''set -eux; \\ apt-get update; \\ @@ -116,7 +116,7 @@ def cppClientDoxygenTask = Docker.registerDockerTask(project, 'cppClientDoxygen' doxygen ''') } - parentContainers = [project(':docker-server').tasks.findByName('buildDocker-server')] // deephaven/server + parentContainers = [project(':docker-server').tasks.findByName('buildDocker-server-netty')] // deephaven/server-netty containerOutPath = '/project/doc/doxygenoutput' copyOut { into "$buildDir/cppClientDoxygen" From 857b72068506a717370054892596a9ed9f411acc Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 4 Oct 2022 09:35:07 -0700 Subject: [PATCH 175/215] Post release bump from 0.17.0 to 0.18.0 (#2944) --- .github/workflows/build-ci.yml | 22 +++++++++---------- .../io.deephaven.common-conventions.gradle | 2 +- py/client/README.md | 2 +- py/client/pydeephaven/__init__.py | 2 +- py/client/setup.py | 2 +- .../deephaven_server/__init__.py | 2 +- py/server/deephaven/__init__.py | 2 +- server/jetty-app/README.md | 6 ++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index f1881b8f3fb..f6f88029713 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -57,7 +57,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server nltk @@ -71,7 +71,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server pytorch @@ -85,7 +85,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server sklearn @@ -99,7 +99,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server tensorflow @@ -113,7 +113,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server all-ai @@ -127,7 +127,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Docker meta server slim @@ -141,7 +141,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -316,7 +316,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -403,7 +403,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Set up Docker Buildx @@ -466,7 +466,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Setup JDK 11 @@ -562,7 +562,7 @@ jobs: tags: | type=edge,branch=main type=raw,priority=950,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }} - type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.17.') }},value=latest + type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v0.18.') }},value=latest type=ref,event=branch - name: Setup JDK 11 diff --git a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle index fdc968d246e..5917c3faed4 100644 --- a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle @@ -4,7 +4,7 @@ plugins { } group = 'io.deephaven' -version = '0.17.0' +version = '0.18.0' if (!name.startsWith('deephaven-')) { archivesBaseName = "deephaven-${name}" diff --git a/py/client/README.md b/py/client/README.md index 92c377d4dd4..6524b7e0ea7 100644 --- a/py/client/README.md +++ b/py/client/README.md @@ -35,7 +35,7 @@ $ python3 -m examples.demo_asof_join ``` ## Install ``` shell -$ pip3 install dist/pydeephaven-0.17.0-py3-none-any.whl +$ pip3 install dist/pydeephaven-0.18.0-py3-none-any.whl ``` ## Quick start diff --git a/py/client/pydeephaven/__init__.py b/py/client/pydeephaven/__init__.py index 53c1ed36750..fc17cce911f 100644 --- a/py/client/pydeephaven/__init__.py +++ b/py/client/pydeephaven/__init__.py @@ -30,4 +30,4 @@ from .constants import SortDirection, MatchRule from .query import Query -__version__ = "0.17.0" +__version__ = "0.18.0" diff --git a/py/client/setup.py b/py/client/setup.py index dd4a752decc..b657b487e47 100644 --- a/py/client/setup.py +++ b/py/client/setup.py @@ -12,7 +12,7 @@ setup( name='pydeephaven', - version='0.17.0', + version='0.18.0', description='The Deephaven Python Client', long_description=README, long_description_content_type="text/markdown", diff --git a/py/embedded-server/deephaven_server/__init__.py b/py/embedded-server/deephaven_server/__init__.py index f0a5f0fa961..9eb373d91a1 100644 --- a/py/embedded-server/deephaven_server/__init__.py +++ b/py/embedded-server/deephaven_server/__init__.py @@ -1,7 +1,7 @@ # # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # -__version__ = "0.17.0" +__version__ = "0.18.0" from .start_jvm import DEFAULT_JVM_PROPERTIES, DEFAULT_JVM_ARGS, start_jvm from .server import Server diff --git a/py/server/deephaven/__init__.py b/py/server/deephaven/__init__.py index 587cd0bbf17..b90c6e602dd 100644 --- a/py/server/deephaven/__init__.py +++ b/py/server/deephaven/__init__.py @@ -7,7 +7,7 @@ """ -__version__ = "0.17.0" +__version__ = "0.18.0" from deephaven_internal import jvm try: diff --git a/server/jetty-app/README.md b/server/jetty-app/README.md index 7192b083e79..cf63470da35 100644 --- a/server/jetty-app/README.md +++ b/server/jetty-app/README.md @@ -24,17 +24,17 @@ be sure to first set `PYTHON_CONFIGURE_OPTS="--enabled-shared"`. ```shell $ python -m pip install --upgrade pip # First upgrade pip $ pip install wheel - $ export DEEPHAVEN_VERSION=0.17.0 # this should match the current version of your git repo + $ export DEEPHAVEN_VERSION=0.18.0 # this should match the current version of your git repo $ cd py/jpy $ export JAVA_HOME=/path/to/your/java/home # Customize this to fit your computer $ python setup.py bdist_wheel - $ pip install dist/deephaven_jpy-0.17.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform + $ pip install dist/deephaven_jpy-0.18.0-cp39-cp39-linux_x86_64.whl # This will vary by version/platform $ cd - $ cd Integrations/python $ python setup.py bdist_wheel - $ pip install dist/deephaven-0.17.0-py2.py3-none-any.whl + $ pip install dist/deephaven-0.18.0-py2.py3-none-any.whl $ cd - ``` From a18abf46c1b75759c6437351fe74a097de53ac48 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 09:26:09 -0700 Subject: [PATCH 176/215] Bump commons-io (#2952) --- .../groovy/io.deephaven.java-classpath-conventions.gradle | 4 ++-- replication/util/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index 60f3f9ca9fc..c0c01f84a28 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -8,7 +8,7 @@ ext { depAnnotations = 'com.intellij:annotations:5.1' depCommonsCompress = 'org.apache.commons:commons-compress:1.18' depCommonsLang3 = 'org.apache.commons:commons-lang3:3.9' - depCommonsIo = 'commons-io:commons-io:2.5' + depCommonsIo = 'commons-io:commons-io:2.11.0' depJdom2 = 'org.jdom:jdom2:2.0.6' depTrove3 = 'net.sf.trove4j:trove4j:3.0.3' } @@ -51,7 +51,7 @@ dependencies { httpClient 'org.apache.httpcomponents:httpclient:4.5.6' commonsLang3 'org.apache.commons:commons-lang3:3.9' commonsText 'org.apache.commons:commons-text:1.9' - commonsIo 'commons-io:commons-io:2.6' + commonsIo 'commons-io:commons-io:2.11.0' math3 'org.apache.commons:commons-math3:3.6.1' jama 'gov.nist.math.jama:gov.nist.math.jama:1.1.1' mockrunner 'com.mockrunner:mockrunner-jdbc:1.0.4' diff --git a/replication/util/build.gradle b/replication/util/build.gradle index b42b4595ed7..9ee71496eae 100644 --- a/replication/util/build.gradle +++ b/replication/util/build.gradle @@ -7,7 +7,7 @@ description 'Replication Tools: Utilities for source code generation and replica dependencies { implementation project(':Base'), - 'commons-io:commons-io:2.6' + 'commons-io:commons-io:2.11.0' compileOnly 'com.google.code.findbugs:jsr305:3.0.2' } From b378b883f96d3720bfb69a75a8fe7c94e66c0ca8 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 09:29:22 -0700 Subject: [PATCH 177/215] Bump commons-compress to 1.21 (#2946) --- .../main/groovy/io.deephaven.java-classpath-conventions.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index c0c01f84a28..259ae9bb06f 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -6,7 +6,7 @@ plugins { // TODO(deephaven-core#1162): Adopt java-platform to manage versions ext { depAnnotations = 'com.intellij:annotations:5.1' - depCommonsCompress = 'org.apache.commons:commons-compress:1.18' + depCommonsCompress = 'org.apache.commons:commons-compress:1.21' depCommonsLang3 = 'org.apache.commons:commons-lang3:3.9' depCommonsIo = 'commons-io:commons-io:2.11.0' depJdom2 = 'org.jdom:jdom2:2.0.6' From e26b08285808870dbfacd3d2acfd97c97dfdd371 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 09:52:27 -0700 Subject: [PATCH 178/215] Bump woodstox dependency (#2951) --- ParquetHadoop/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ParquetHadoop/build.gradle b/ParquetHadoop/build.gradle index b999b2988f0..5ee3eba6cfb 100644 --- a/ParquetHadoop/build.gradle +++ b/ParquetHadoop/build.gradle @@ -48,7 +48,7 @@ dependencies { * lz4-pure-java - note that we can't _easily_ use aircompressor here, as the service loader sees * the copy in hadoop-common. TODO use config instead of service loader */ - runtimeOnly('com.fasterxml.woodstox:woodstox-core:5.2.1') { + runtimeOnly('com.fasterxml.woodstox:woodstox-core:6.3.1') { because 'hadoop-common required dependency for Configuration' } runtimeOnly('org.apache.hadoop.thirdparty:hadoop-shaded-guava:1.1.1') { From 25d61d41cfca5c1d071193bdd8708b7c76a2c51d Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 10:55:18 -0700 Subject: [PATCH 179/215] Bump jdom2 (#2954) See https://github.com/hunterhacker/jdom/releases/tag/JDOM-2.0.6.1 --- .../groovy/io.deephaven.java-classpath-conventions.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle index 259ae9bb06f..a188fc823bd 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-classpath-conventions.gradle @@ -9,7 +9,7 @@ ext { depCommonsCompress = 'org.apache.commons:commons-compress:1.21' depCommonsLang3 = 'org.apache.commons:commons-lang3:3.9' depCommonsIo = 'commons-io:commons-io:2.11.0' - depJdom2 = 'org.jdom:jdom2:2.0.6' + depJdom2 = 'org.jdom:jdom2:2.0.6.1' depTrove3 = 'net.sf.trove4j:trove4j:3.0.3' } @@ -47,7 +47,7 @@ configurations { dependencies { // First, one-off configurations for stuff we need "here and there" - jdom 'org.jdom:jdom2:2.0.6' + jdom 'org.jdom:jdom2:2.0.6.1' httpClient 'org.apache.httpcomponents:httpclient:4.5.6' commonsLang3 'org.apache.commons:commons-lang3:3.9' commonsText 'org.apache.commons:commons-text:1.9' From 422d216323993a55a7bdaa3df0b34516ac70deda Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 12:07:29 -0700 Subject: [PATCH 180/215] Bump base images (#2957) --- =0.3.0 | 0 docker/registry/all-ai-base/gradle.properties | 2 +- docker/registry/go/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/node/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/scripts/update-requirements.sh | 12 ++++++------ docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/slim-base/gradle.properties | 2 +- docker/registry/tensorflow-base/gradle.properties | 2 +- .../src/main/server-all-ai-netty/requirements.txt | 7 +++---- docker/server/src/main/server-netty/requirements.txt | 4 ++-- .../src/main/server-nltk-netty/requirements.txt | 4 ++-- .../src/main/server-pytorch-netty/requirements.txt | 6 +++--- .../src/main/server-sklearn-netty/requirements.txt | 4 ++-- .../main/server-tensorflow-netty/requirements.txt | 6 +++--- 19 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 =0.3.0 diff --git a/=0.3.0 b/=0.3.0 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docker/registry/all-ai-base/gradle.properties b/docker/registry/all-ai-base/gradle.properties index 1e8727aee7b..a477faf9555 100644 --- a/docker/registry/all-ai-base/gradle.properties +++ b/docker/registry/all-ai-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/all-ai-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/all-ai-base@sha256:5418714d66136d56fe93903e45c7f7f940cedc4ad360ecc504406db6a5ed6729 +deephaven.registry.imageId=ghcr.io/deephaven/all-ai-base@sha256:d92177b3fadc9f78282f96e9c8d1b54c5c03b8879164351f114446af92d12781 diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties index cf18db876ae..a4f656d8ee8 100644 --- a/docker/registry/go/gradle.properties +++ b/docker/registry/go/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=golang:1 -deephaven.registry.imageId=golang@sha256:2d17ffd12a2cdb25d4a633ad25f8dc29608ed84f31b3b983427d825280427095 +deephaven.registry.imageId=golang@sha256:c17baa6873e2deca671d240a654d716f76f6e1c7a264461a42eb3ee07eb718c9 diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index 6493355fa16..ad1a41fa05b 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:7a510c2cfb528a53a6656e19b2c43eafddacb73d7305a996145051812d5e765b +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:32d627476695bb0f0d8be99968135e96b17dfedb8dbcfacd3c839183fb845ecd diff --git a/docker/registry/node/gradle.properties b/docker/registry/node/gradle.properties index a562ba75c0f..1281ac46b92 100644 --- a/docker/registry/node/gradle.properties +++ b/docker/registry/node/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=node:14 -deephaven.registry.imageId=node@sha256:500c729bf9b75de8aee647d70b68dc16eb14991d74bbf033c5ffdb667bbef704 +deephaven.registry.imageId=node@sha256:d0634e5cde35cb312571cd007ae2270295bf2000ec489402325953bcee196ae2 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 56ad3b7f15b..64b19d85c8a 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:3c76a38fe30a251c627446cedc4698b8ffd84cce1044f5d0bad04d38b54573c9 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:1c6b9de6e47173a4b569496ac4efc3a33b6d0988e9a80a78050d36b397338a11 diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index 958e21a6528..78eecda3358 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:2341ac5eedd71f1e6481afe854af572f5ec1b78fa3aea2293dba65942108e663 +deephaven.registry.imageId=python@sha256:ab5e518c3bed5619d2170a6c3e6a1a341466688c367ebf2b102329d171691450 diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index c3f20955b4d..4ecc94c25ea 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:a21961f80b3f13cd7136a7378c4d51e51b01cf2455649f230495068a8497269d +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:e656a3a1b78cb547ef8b42d1ee7d4293f9efa1874d7d7bd6aa543b341ffe7c75 diff --git a/docker/registry/scripts/update-requirements.sh b/docker/registry/scripts/update-requirements.sh index d7edc617707..fe53be38031 100755 --- a/docker/registry/scripts/update-requirements.sh +++ b/docker/registry/scripts/update-requirements.sh @@ -23,9 +23,9 @@ all_ai_base_image_id="$(${__gradlew} -q docker-all-ai-base:showImageId)" # Write down the (potentially) new requirements # Need to manually remove pkg-resources # https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 -docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server/requirements.txt" -docker run --rm "${nltk_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-nltk/requirements.txt" -docker run --rm "${pytorch_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-pytorch/requirements.txt" -docker run --rm "${sklearn_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-sklearn/requirements.txt" -docker run --rm "${tensorflow_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-tensorflow/requirements.txt" -docker run --rm "${all_ai_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-all-ai/requirements.txt" \ No newline at end of file +docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-netty/requirements.txt" +docker run --rm "${nltk_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-nltk-netty/requirements.txt" +docker run --rm "${pytorch_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-pytorch-netty/requirements.txt" +docker run --rm "${sklearn_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-sklearn-netty/requirements.txt" +docker run --rm "${tensorflow_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-tensorflow-netty/requirements.txt" +docker run --rm "${all_ai_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-all-ai-netty/requirements.txt" \ No newline at end of file diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index a518beb7e6b..927b192c7e3 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:8b9222b7641be6d66a2444ab65a55e94a0e80fdcb2f8e37ddc52f78b5a561a24 +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:7752c3dbb4ad1f2b47ab16dea225e2229729aa4e95d97d6cd9ec9255a368b9ae diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index 46c1095a177..e275e758592 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:8b1202b4f83f5ca1a39e45ab917dd4067dd843d7c341a1ef0455f23eceaa2f22 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:f26b1e0fda4f5fb1e578d01d6b909a198b390d439ffc45aedc1143d7f1d10559 diff --git a/docker/registry/slim-base/gradle.properties b/docker/registry/slim-base/gradle.properties index febf340bb6f..a227744f22c 100644 --- a/docker/registry/slim-base/gradle.properties +++ b/docker/registry/slim-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/slim-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:c7aa71e7c9c22583e6a61592fa403d87190d987ef6a14f4f591455281c0b8ee0 +deephaven.registry.imageId=ghcr.io/deephaven/slim-base@sha256:110301dfa113fe9e921149868c544e399c72c6323dc755aa0eebf81c9d9c5117 diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index 527d00b21e1..d32ab4feabc 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:2598d07a3ac3b79dad27f69ca83b696c279df1cd1f2026d40483dc2a931f297b +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:3f9c9b403743b056a59d16c4982a165162a20ce6223251b810b5adc06affb991 diff --git a/docker/server/src/main/server-all-ai-netty/requirements.txt b/docker/server/src/main/server-all-ai-netty/requirements.txt index afb60eac87d..3f56b42550e 100644 --- a/docker/server/src/main/server-all-ai-netty/requirements.txt +++ b/docker/server/src/main/server-all-ai-netty/requirements.txt @@ -13,7 +13,7 @@ google-pasta==0.2.0 grpcio==1.49.1 h5py==3.7.0 idna==3.4 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 joblib==1.2.0 jpy==0.12.0 @@ -29,12 +29,11 @@ numpy==1.21.6 oauthlib==3.2.1 opt-einsum==3.3.0 pandas==1.3.5 -pkg_resources==0.0.0 -protobuf==3.19.5 +protobuf==3.19.6 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 regex==2022.9.13 requests==2.28.1 requests-oauthlib==1.3.1 diff --git a/docker/server/src/main/server-netty/requirements.txt b/docker/server/src/main/server-netty/requirements.txt index 3ba59ecbbab..0f53f784b8b 100644 --- a/docker/server/src/main/server-netty/requirements.txt +++ b/docker/server/src/main/server-netty/requirements.txt @@ -1,5 +1,5 @@ deephaven-plugin==0.2.0 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 llvmlite==0.39.1 @@ -7,7 +7,7 @@ numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 six==1.16.0 typing_extensions==4.3.0 zipp==3.8.1 diff --git a/docker/server/src/main/server-nltk-netty/requirements.txt b/docker/server/src/main/server-nltk-netty/requirements.txt index cab4ba125de..6a224d7b7ed 100644 --- a/docker/server/src/main/server-nltk-netty/requirements.txt +++ b/docker/server/src/main/server-nltk-netty/requirements.txt @@ -1,6 +1,6 @@ click==8.1.3 deephaven-plugin==0.2.0 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 joblib==1.2.0 jpy==0.12.0 @@ -10,7 +10,7 @@ numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 regex==2022.9.13 six==1.16.0 tqdm==4.64.1 diff --git a/docker/server/src/main/server-pytorch-netty/requirements.txt b/docker/server/src/main/server-pytorch-netty/requirements.txt index 65735451926..4d91ebcdfbf 100644 --- a/docker/server/src/main/server-pytorch-netty/requirements.txt +++ b/docker/server/src/main/server-pytorch-netty/requirements.txt @@ -7,7 +7,7 @@ google-auth==2.12.0 google-auth-oauthlib==0.4.6 grpcio==1.49.1 idna==3.4 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 llvmlite==0.39.1 @@ -17,11 +17,11 @@ numba==0.56.2 numpy==1.21.6 oauthlib==3.2.1 pandas==1.3.5 -protobuf==3.19.5 +protobuf==3.19.6 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 diff --git a/docker/server/src/main/server-sklearn-netty/requirements.txt b/docker/server/src/main/server-sklearn-netty/requirements.txt index 733c260497f..5e7a23ebf48 100644 --- a/docker/server/src/main/server-sklearn-netty/requirements.txt +++ b/docker/server/src/main/server-sklearn-netty/requirements.txt @@ -1,5 +1,5 @@ deephaven-plugin==0.2.0 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 joblib==1.2.0 jpy==0.12.0 @@ -8,7 +8,7 @@ numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 scikit-learn==0.24.2 scipy==1.7.3 six==1.16.0 diff --git a/docker/server/src/main/server-tensorflow-netty/requirements.txt b/docker/server/src/main/server-tensorflow-netty/requirements.txt index ba30f9529ce..7d44695d1f9 100644 --- a/docker/server/src/main/server-tensorflow-netty/requirements.txt +++ b/docker/server/src/main/server-tensorflow-netty/requirements.txt @@ -12,7 +12,7 @@ google-pasta==0.2.0 grpcio==1.49.1 h5py==3.7.0 idna==3.4 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 keras==2.7.0 @@ -26,11 +26,11 @@ numpy==1.21.6 oauthlib==3.2.1 opt-einsum==3.3.0 pandas==1.3.5 -protobuf==3.19.5 +protobuf==3.19.6 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 From 2ad707e3a75694b54d74fad4d2f7cabac171c4e0 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 13:17:14 -0700 Subject: [PATCH 181/215] Remove extra file (#2959) --- =0.3.0 | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 =0.3.0 diff --git a/=0.3.0 b/=0.3.0 deleted file mode 100644 index e69de29bb2d..00000000000 From 94edb0f4a8d2bde56192b21ef8bd964884b96179 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 13:17:29 -0700 Subject: [PATCH 182/215] Fix server jetty (#2960) --- docker/registry/scripts/update-requirements.sh | 1 + docker/server-jetty/src/main/server-jetty/requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/registry/scripts/update-requirements.sh b/docker/registry/scripts/update-requirements.sh index fe53be38031..9a9be09ac6c 100755 --- a/docker/registry/scripts/update-requirements.sh +++ b/docker/registry/scripts/update-requirements.sh @@ -23,6 +23,7 @@ all_ai_base_image_id="$(${__gradlew} -q docker-all-ai-base:showImageId)" # Write down the (potentially) new requirements # Need to manually remove pkg-resources # https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 +docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server-jetty/src/main/server-jetty/requirements.txt" docker run --rm "${server_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-netty/requirements.txt" docker run --rm "${nltk_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-nltk-netty/requirements.txt" docker run --rm "${pytorch_base_image_id}" pip freeze | grep -v "pkg.resources" > "${__dir}/../../server/src/main/server-pytorch-netty/requirements.txt" diff --git a/docker/server-jetty/src/main/server-jetty/requirements.txt b/docker/server-jetty/src/main/server-jetty/requirements.txt index 3ba59ecbbab..0f53f784b8b 100644 --- a/docker/server-jetty/src/main/server-jetty/requirements.txt +++ b/docker/server-jetty/src/main/server-jetty/requirements.txt @@ -1,5 +1,5 @@ deephaven-plugin==0.2.0 -importlib-metadata==4.12.0 +importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 llvmlite==0.39.1 @@ -7,7 +7,7 @@ numba==0.56.2 numpy==1.21.6 pandas==1.3.5 python-dateutil==2.8.2 -pytz==2022.2.1 +pytz==2022.4 six==1.16.0 typing_extensions==4.3.0 zipp==3.8.1 From 4b061d35cfa005161f228bcc4e120a9d6ee4921d Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 16:22:07 -0700 Subject: [PATCH 183/215] Upload error logs on pydoc failure (#2961) --- .github/workflows/docs-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index bdc35ee1e4d..1e375f5b951 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -140,6 +140,14 @@ jobs: remote_user: ${{ secrets.DOCS_USER }} remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }} + - name: Upload JVM Error Logs + uses: actions/upload-artifact@v3 + if: failure() + with: + name: docs-ci-pydoc-jvm-err + path: '**/*_pid*.log' + if-no-files-found: ignore + cppdoc: runs-on: ubuntu-22.04 steps: From 362523fbd9afe661da0c5fdfa7b7e31e5c096894 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 5 Oct 2022 20:29:41 -0700 Subject: [PATCH 184/215] Plumb ungroup through TableOperations. (#2936) --- .../java/io/deephaven/engine/table/Table.java | 16 ------ .../engine/table/impl/HierarchicalTable.java | 2 +- .../engine/table/impl/QueryTable.java | 14 ++++- .../engine/table/impl/TableDefaults.java | 23 -------- .../engine/table/impl/UncoalescedTable.java | 2 +- .../PartitionedTableProxyImpl.java | 5 ++ .../client/impl/BatchTableRequestBuilder.java | 14 +++++ .../io/deephaven/graphviz/LabelBuilder.java | 8 +++ .../io/deephaven/qst/TableAdapterImpl.java | 7 +++ .../deephaven/qst/table/ParentsVisitor.java | 5 ++ .../io/deephaven/qst/table/TableBase.java | 45 +++++++++++++++ .../io/deephaven/qst/table/TableSpec.java | 2 + .../qst/table/TableVisitorGeneric.java | 5 ++ .../io/deephaven/qst/table/UngroupTable.java | 49 ++++++++++++++++ .../server/table/ops/UngroupGrpcImpl.java | 10 ++-- .../io/deephaven/api/TableOperations.java | 57 +++++++++++++++++++ .../deephaven/api/TableOperationsAdapter.java | 25 ++++++++ .../api/TableOperationsDefaults.java | 22 +++++++ 18 files changed, 265 insertions(+), 46 deletions(-) create mode 100644 qst/src/main/java/io/deephaven/qst/table/UngroupTable.java diff --git a/engine/api/src/main/java/io/deephaven/engine/table/Table.java b/engine/api/src/main/java/io/deephaven/engine/table/Table.java index b049cc86322..b5768ca58b9 100644 --- a/engine/api/src/main/java/io/deephaven/engine/table/Table.java +++ b/engine/api/src/main/java/io/deephaven/engine/table/Table.java @@ -853,24 +853,8 @@ public static AsOfMatchRule of(ReverseAsOfJoinRule rule) { // Disaggregation Operations // ----------------------------------------------------------------------------------------------------------------- - /** - * Ungroups a table by converting arrays into columns. - * - * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with - * null values. If set to false, then all arrays should be the same length. - * @param columnsToUngroup the columns to ungroup - * @return the ungrouped table - */ - Table ungroup(boolean nullFill, String... columnsToUngroup); - - Table ungroup(String... columnsToUngroup); - Table ungroupAllBut(String... columnsNotToUngroup); - Table ungroup(); - - Table ungroup(boolean nullFill); - // ----------------------------------------------------------------------------------------------------------------- // PartitionBy Operations // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java index 145a27fda7e..f8297480ea3 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/HierarchicalTable.java @@ -161,7 +161,7 @@ public Table join(Table rightTable, MatchPair[] columnsToMatch, MatchPair[] colu } @Override - public Table ungroup(boolean nullFill, String... columnsToUngroup) { + public Table ungroup(boolean nullFill, Collection columnsToUngroup) { return throwUnsupported("ungroup()"); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index 0dda05cd6a9..29298785938 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -27,6 +27,7 @@ import io.deephaven.engine.rowset.RowSetFactory; import io.deephaven.engine.table.*; import io.deephaven.engine.table.impl.indexer.RowSetIndexer; +import io.deephaven.engine.table.impl.lang.QueryLanguageParser; import io.deephaven.engine.table.impl.partitioned.PartitionedTableImpl; import io.deephaven.engine.table.impl.perf.BasePerformanceEntry; import io.deephaven.engine.table.impl.perf.QueryPerformanceNugget; @@ -2295,8 +2296,19 @@ public Table reverse() { return getResult(new ReverseOperation(this)); } + @Override - public Table ungroup(boolean nullFill, String... columnsToUngroupBy) { + public Table ungroup(boolean nullFill, Collection columnsToUngroup) { + final String[] columnsToUngroupBy; + if (columnsToUngroup.isEmpty()) { + columnsToUngroupBy = getDefinition() + .getColumnStream() + .filter(c -> c.getDataType().isArray() || QueryLanguageParser.isTypedVector(c.getDataType())) + .map(ColumnDefinition::getName) + .toArray(String[]::new); + } else { + columnsToUngroupBy = columnsToUngroup.stream().map(ColumnName::name).toArray(String[]::new); + } return QueryPerformanceRecorder.withNugget("ungroup(" + Arrays.toString(columnsToUngroupBy) + ")", sizeForInstrumentation(), () -> { if (columnsToUngroupBy.length == 0) { diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java index c3cc31e963c..357066263e6 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/TableDefaults.java @@ -539,12 +539,6 @@ default Table applyToAllBy(String formulaColumn, String... groupByColumns) { // Disaggregation Operations // ----------------------------------------------------------------------------------------------------------------- - @Override - @FinalDefault - default Table ungroup(String... columnsToUngroup) { - return ungroup(false, columnsToUngroup); - } - @Override @FinalDefault default Table ungroupAllBut(String... columnsNotToUngroup) { @@ -555,23 +549,6 @@ default Table ungroupAllBut(String... columnsNotToUngroup) { .map(ColumnDefinition::getName).toArray(String[]::new)); } - @Override - @FinalDefault - default Table ungroup() { - return ungroup(getDefinition().getColumnStream() - .filter(c -> c.getDataType().isArray() || QueryLanguageParser.isTypedVector(c.getDataType())) - .map(ColumnDefinition::getName).toArray(String[]::new)); - } - - @Override - @FinalDefault - default Table ungroup(boolean nullFill) { - return ungroup(nullFill, - getDefinition().getColumnStream() - .filter(c -> c.getDataType().isArray() || QueryLanguageParser.isTypedVector(c.getDataType())) - .map(ColumnDefinition::getName).toArray(String[]::new)); - } - // ----------------------------------------------------------------------------------------------------------------- // PartitionBy Operations // ----------------------------------------------------------------------------------------------------------------- diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java index 9269a89dc61..eb4a425d37d 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/UncoalescedTable.java @@ -367,7 +367,7 @@ public Table tailBy(long nRows, String... groupByColumnNames) { } @Override - public Table ungroup(boolean nullFill, String... columnsToUngroup) { + public Table ungroup(boolean nullFill, Collection columnsToUngroup) { return coalesce().ungroup(nullFill, columnsToUngroup); } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java index 95d4a1a3119..bc74cd9952a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/partitioned/PartitionedTableProxyImpl.java @@ -541,5 +541,10 @@ public PartitionedTable.Proxy selectDistinct(Collection co return basicTransform(ct -> ct.selectDistinct(SelectColumn.copyFrom(selectColumns))); } + @Override + public PartitionedTable.Proxy ungroup(boolean nullFill, Collection columnsToUngroup) { + return basicTransform(ct -> ct.ungroup(nullFill, columnsToUngroup)); + } + // endregion TableOperations Implementation } diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java index c1fbdb93267..bb2060d407a 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/BatchTableRequestBuilder.java @@ -62,6 +62,7 @@ import io.deephaven.proto.backplane.grpc.TableReference; import io.deephaven.proto.backplane.grpc.Ticket; import io.deephaven.proto.backplane.grpc.TimeTableRequest; +import io.deephaven.proto.backplane.grpc.UngroupRequest; import io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest; import io.deephaven.proto.backplane.grpc.UpdateByRequest; import io.deephaven.proto.util.ExportTicketHelper; @@ -96,6 +97,7 @@ import io.deephaven.qst.table.TimeProvider.Visitor; import io.deephaven.qst.table.TimeProviderSystem; import io.deephaven.qst.table.TimeTable; +import io.deephaven.qst.table.UngroupTable; import io.deephaven.qst.table.UpdateByTable; import io.deephaven.qst.table.UpdateTable; import io.deephaven.qst.table.UpdateViewTable; @@ -466,6 +468,18 @@ public void visit(UpdateByTable updateByTable) { out = op(Builder::setUpdateBy, request); } + @Override + public void visit(UngroupTable ungroupTable) { + final UngroupRequest.Builder request = UngroupRequest.newBuilder() + .setResultId(ticket) + .setSourceId(ref(ungroupTable.parent())) + .setNullFill(ungroupTable.nullFill()); + for (ColumnName ungroupColumn : ungroupTable.ungroupColumns()) { + request.addColumnsToUngroup(ungroupColumn.name()); + } + out = op(Builder::setUngroup, request); + } + private SelectOrUpdateRequest selectOrUpdate(SingleParentTable x, Collection columns) { SelectOrUpdateRequest.Builder builder = diff --git a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java index f63256cfd36..093726ca99f 100644 --- a/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java +++ b/qst/graphviz/src/main/java/io/deephaven/graphviz/LabelBuilder.java @@ -27,6 +27,7 @@ import io.deephaven.qst.table.TailTable; import io.deephaven.qst.table.TicketTable; import io.deephaven.qst.table.TimeTable; +import io.deephaven.qst.table.UngroupTable; import io.deephaven.qst.table.UpdateByTable; import io.deephaven.qst.table.UpdateTable; import io.deephaven.qst.table.UpdateViewTable; @@ -198,6 +199,13 @@ public void visit(UpdateByTable updateByTable) { sb.append("],[ todo ])"); } + @Override + public void visit(UngroupTable ungroupTable) { + sb.append("ungroup(").append(ungroupTable.nullFill()).append(",["); + append(Strings::of, ungroupTable.ungroupColumns(), sb); + sb.append("])"); + } + private void join(String name, Join j) { sb.append(name).append("(["); append(Strings::of, j.matches(), sb); diff --git a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java index b9eff7fbc46..9b0764a5f67 100644 --- a/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java +++ b/qst/src/main/java/io/deephaven/qst/TableAdapterImpl.java @@ -33,6 +33,7 @@ import io.deephaven.qst.table.TailTable; import io.deephaven.qst.table.TicketTable; import io.deephaven.qst.table.TimeTable; +import io.deephaven.qst.table.UngroupTable; import io.deephaven.qst.table.UpdateByTable; import io.deephaven.qst.table.UpdateTable; import io.deephaven.qst.table.UpdateViewTable; @@ -310,6 +311,12 @@ public void visit(UpdateByTable updateByTable) { } } + @Override + public void visit(UngroupTable ungroupTable) { + addOp(ungroupTable, parentOps(ungroupTable) + .ungroup(ungroupTable.nullFill(), ungroupTable.ungroupColumns())); + } + private final class OutputTable implements Output { private final TABLE table; diff --git a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java index f6d455d7cad..a231bba604a 100644 --- a/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java +++ b/qst/src/main/java/io/deephaven/qst/table/ParentsVisitor.java @@ -296,6 +296,11 @@ public void visit(UpdateByTable updateByTable) { out = single(updateByTable); } + @Override + public void visit(UngroupTable ungroupTable) { + out = single(ungroupTable); + } + private static class Search { private final Predicate excludePaths; diff --git a/qst/src/main/java/io/deephaven/qst/table/TableBase.java b/qst/src/main/java/io/deephaven/qst/table/TableBase.java index fa69b5cc99a..b943919ab24 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableBase.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableBase.java @@ -857,6 +857,51 @@ public final AggregateAllByTable wavgBy(String weightColumn, Collection return aggAllBy(AggSpec.wavg(weightColumn), groupByColumns); } + @Override + public final UngroupTable ungroup() { + return UngroupTable.builder() + .parent(this) + .build(); + } + + @Override + public final UngroupTable ungroup(boolean nullFill) { + return UngroupTable.builder() + .parent(this) + .nullFill(nullFill) + .build(); + } + + @Override + public final UngroupTable ungroup(String... columnsToUngroup) { + final UngroupTable.Builder builder = UngroupTable.builder() + .parent(this); + for (String columnToUngroup : columnsToUngroup) { + builder.addUngroupColumns(ColumnName.of(columnToUngroup)); + } + return builder.build(); + } + + @Override + public final UngroupTable ungroup(boolean nullFill, String... columnsToUngroup) { + final UngroupTable.Builder builder = UngroupTable.builder() + .parent(this) + .nullFill(nullFill); + for (String columnToUngroup : columnsToUngroup) { + builder.addUngroupColumns(ColumnName.of(columnToUngroup)); + } + return builder.build(); + } + + @Override + public final UngroupTable ungroup(boolean nullFill, Collection columnsToUngroup) { + return UngroupTable.builder() + .parent(this) + .nullFill(nullFill) + .addAllUngroupColumns(columnsToUngroup) + .build(); + } + @Override public final V walk(V visitor) { visitor.visit(this); diff --git a/qst/src/main/java/io/deephaven/qst/table/TableSpec.java b/qst/src/main/java/io/deephaven/qst/table/TableSpec.java index 309ea51a63e..0564bb55f36 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableSpec.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableSpec.java @@ -157,5 +157,7 @@ interface Visitor { void visit(CountByTable countByTable); void visit(UpdateByTable updateByTable); + + void visit(UngroupTable ungroupTable); } } diff --git a/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java b/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java index 60d52a0fe47..c740ff07e32 100644 --- a/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java +++ b/qst/src/main/java/io/deephaven/qst/table/TableVisitorGeneric.java @@ -151,4 +151,9 @@ public void visit(CountByTable countByTable) { public void visit(UpdateByTable updateByTable) { accept(updateByTable); } + + @Override + public void visit(UngroupTable ungroupTable) { + accept(ungroupTable); + } } diff --git a/qst/src/main/java/io/deephaven/qst/table/UngroupTable.java b/qst/src/main/java/io/deephaven/qst/table/UngroupTable.java new file mode 100644 index 00000000000..938e603ac77 --- /dev/null +++ b/qst/src/main/java/io/deephaven/qst/table/UngroupTable.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.qst.table; + +import io.deephaven.annotations.NodeStyle; +import io.deephaven.api.ColumnName; +import org.immutables.value.Value.Default; +import org.immutables.value.Value.Immutable; + +import java.util.List; + +@Immutable +@NodeStyle +public abstract class UngroupTable extends TableBase implements SingleParentTable { + + public static Builder builder() { + return ImmutableUngroupTable.builder(); + } + + public abstract TableSpec parent(); + + public abstract List ungroupColumns(); + + @Default + public boolean nullFill() { + return false; + } + + @Override + public final V walk(V visitor) { + visitor.visit(this); + return visitor; + } + + interface Builder { + Builder parent(TableSpec parent); + + Builder addUngroupColumns(ColumnName element); + + Builder addUngroupColumns(ColumnName... elements); + + Builder addAllUngroupColumns(Iterable elements); + + Builder nullFill(boolean nullFill); + + UngroupTable build(); + } +} diff --git a/server/src/main/java/io/deephaven/server/table/ops/UngroupGrpcImpl.java b/server/src/main/java/io/deephaven/server/table/ops/UngroupGrpcImpl.java index 014fc9242a0..345ca68810a 100644 --- a/server/src/main/java/io/deephaven/server/table/ops/UngroupGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/table/ops/UngroupGrpcImpl.java @@ -3,8 +3,8 @@ */ package io.deephaven.server.table.ops; +import io.deephaven.api.ColumnName; import io.deephaven.base.verify.Assert; -import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.engine.table.Table; import io.deephaven.engine.updategraph.UpdateGraphProcessor; import io.deephaven.proto.backplane.grpc.BatchTableRequest; @@ -14,6 +14,7 @@ import javax.inject.Inject; import javax.inject.Singleton; import java.util.List; +import java.util.stream.Collectors; @Singleton public class UngroupGrpcImpl extends GrpcTableOperation { @@ -29,10 +30,11 @@ public UngroupGrpcImpl(final UpdateGraphProcessor updateGraphProcessor) { @Override public Table create(final UngroupRequest request, final List> sourceTables) { Assert.eq(sourceTables.size(), "sourceTables.size()", 1); - final Table parent = sourceTables.get(0).get(); - final String[] columnsToUngroup = - request.getColumnsToUngroupList().toArray(CollectionUtil.ZERO_LENGTH_STRING_ARRAY); + final List columnsToUngroup = request.getColumnsToUngroupList() + .stream() + .map(ColumnName::of) + .collect(Collectors.toList()); return updateGraphProcessor.sharedLock() .computeLocked(() -> parent.ungroup(request.getNullFill(), columnsToUngroup)); } diff --git a/table-api/src/main/java/io/deephaven/api/TableOperations.java b/table-api/src/main/java/io/deephaven/api/TableOperations.java index 8956d5ea02a..321901f6476 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperations.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperations.java @@ -1245,4 +1245,61 @@ TOPS updateBy(UpdateByControl control, Collection o TOPS wavgBy(String weightColumn, Collection groupByColumns); // ------------------------------------------------------------------------------------------- + + /** + * Ungroups a table by expanding all columns of arrays or vectors into columns of singular values, creating one row + * in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their + * values duplicated in each output row corresponding to a given input row. All arrays and vectors must be the same + * size. + * + * @return the ungrouped table + */ + TOPS ungroup(); + + /** + * Ungroups a table by expanding all columns of arrays or vectors into columns of singular values, creating one row + * in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their + * values duplicated in each output row corresponding to a given input row. + * + * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with + * null values. If set to false, then all arrays should be the same length. + * @return the ungrouped table + */ + TOPS ungroup(boolean nullFill); + + /** + * Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in + * the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values + * duplicated in each output row corresponding to a given input row. The arrays and vectors must be the same size. + * + * @param columnsToUngroup the columns to ungroup + * @return the ungrouped table + */ + TOPS ungroup(String... columnsToUngroup); + + /** + * Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in + * the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values + * duplicated in each output row corresponding to a given input row. + * + * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with + * null values. If set to false, then all arrays should be the same length. + * @param columnsToUngroup the columns to ungroup + * @return the ungrouped table + */ + TOPS ungroup(boolean nullFill, String... columnsToUngroup); + + /** + * Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in + * the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values + * duplicated in each output row corresponding to a given input row. + * + * @param nullFill indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with + * null values. If set to false, then all arrays should be the same length. + * @param columnsToUngroup the columns to ungroup + * @return the ungrouped table + */ + TOPS ungroup(boolean nullFill, Collection columnsToUngroup); + + // ------------------------------------------------------------------------------------------- } diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java index 40e4a9973d5..f5b69b42875 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsAdapter.java @@ -655,4 +655,29 @@ public final TOPS_1 wavgBy(String weightColumn, ColumnName... groupByColumns) { public final TOPS_1 wavgBy(String weightColumn, Collection groupByColumns) { return adapt(delegate.wavgBy(weightColumn, groupByColumns)); } + + @Override + public final TOPS_1 ungroup() { + return adapt(delegate.ungroup()); + } + + @Override + public final TOPS_1 ungroup(boolean nullFill) { + return adapt(delegate.ungroup(nullFill)); + } + + @Override + public final TOPS_1 ungroup(String... columnsToUngroup) { + return adapt(delegate.ungroup(columnsToUngroup)); + } + + @Override + public final TOPS_1 ungroup(boolean nullFill, String... columnsToUngroup) { + return adapt(delegate.ungroup(nullFill, columnsToUngroup)); + } + + @Override + public final TOPS_1 ungroup(boolean nullFill, Collection columnsToUngroup) { + return adapt(delegate.ungroup(nullFill, columnsToUngroup)); + } } diff --git a/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java b/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java index cf5913b8309..6471a64fe5b 100644 --- a/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java +++ b/table-api/src/main/java/io/deephaven/api/TableOperationsDefaults.java @@ -231,6 +231,28 @@ default TOPS groupBy(Collection groupByColumns) { // ------------------------------------------------------------------------------------------- + @Override + default TOPS ungroup() { + return ungroup(false, Collections.emptyList()); + } + + @Override + default TOPS ungroup(boolean nullFill) { + return ungroup(nullFill, Collections.emptyList()); + } + + @Override + default TOPS ungroup(String... columnsToUngroup) { + return ungroup(false, Arrays.stream(columnsToUngroup).map(ColumnName::of).collect(Collectors.toList())); + } + + @Override + default TOPS ungroup(boolean nullFill, String... columnsToUngroup) { + return ungroup(nullFill, Arrays.stream(columnsToUngroup).map(ColumnName::of).collect(Collectors.toList())); + } + + // ------------------------------------------------------------------------------------------- + @Override @ConcurrentMethod default TOPS aggAllBy(AggSpec spec) { From fa40d4e967becd26bbdc1cba32d0b3a07a81655d Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 6 Oct 2022 08:19:55 -0700 Subject: [PATCH 185/215] Bump guava (#2950) Previous dependency resolution inherited from: com.google.guava:guava:31.0.1-android +--- io.grpc:grpc-api:1.46.0 --- Plot/Plot.gradle | 2 +- buildSrc/src/main/groovy/Classpaths.groovy | 9 +++++++++ engine/api/build.gradle | 3 +-- engine/table/build.gradle | 2 +- extensions/jdbc/build.gradle | 2 +- extensions/parquet/compression/build.gradle | 2 +- grpc-java/grpc-servlet-jakarta/build.gradle | 2 +- grpc-java/grpc-servlet-websocket-jakarta/build.gradle | 2 +- web/shared-beans/shared-beans.gradle | 2 +- 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Plot/Plot.gradle b/Plot/Plot.gradle index 3037e66ba6a..3363cd76be8 100644 --- a/Plot/Plot.gradle +++ b/Plot/Plot.gradle @@ -23,7 +23,7 @@ dependencies { compileOnly 'javax.inject:javax.inject:1' - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) testImplementation TestTools.projectDependency(project, 'Util') testImplementation TestTools.projectDependency(project, 'engine-table') diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 1e208b6a8d1..dd0c7bbd2c1 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -119,6 +119,10 @@ class Classpaths { static final String JETTY11_NAME = 'jetty-bom' static final String JETTY11_VERSION = '11.0.11' + static final String GUAVA_GROUP = 'com.google.guava' + static final String GUAVA_NAME = 'guava' + static final String GUAVA_VERSION = '31.1-jre' + static boolean addDependency(Configuration conf, String group, String name, String version, Action configure = Actions.doNothing()) { if (!conf.dependencies.find { it.name == name && it.group == group}) { DefaultExternalModuleDependency dep = dependency group, name, version @@ -282,4 +286,9 @@ class Classpaths { Configuration config = p.configurations.getByName(configName) addDependency(config, p.getDependencies().platform("${JETTY11_GROUP}:${JETTY11_NAME}:${JETTY11_VERSION}")) } + + static void inheritGuava(Project p, String configName = JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME) { + Configuration config = p.configurations.getByName(configName) + addDependency(config, GUAVA_GROUP, GUAVA_NAME, GUAVA_VERSION) + } } diff --git a/engine/api/build.gradle b/engine/api/build.gradle index ef761aedff4..783f3d1cb8a 100644 --- a/engine/api/build.gradle +++ b/engine/api/build.gradle @@ -19,8 +19,7 @@ dependencies { implementation depTrove3 Classpaths.inheritImmutables(project) - - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) compileOnly 'com.google.code.findbugs:jsr305:3.0.2' diff --git a/engine/table/build.gradle b/engine/table/build.gradle index fd02bebaf78..9d10648394a 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -67,7 +67,7 @@ dependencies { runtimeOnly project(':engine-tuplesource') - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) testImplementation TestTools.projectDependency(project, 'Base') testImplementation TestTools.projectDependency(project, 'Util') diff --git a/extensions/jdbc/build.gradle b/extensions/jdbc/build.gradle index 8ee35af0567..4d217ffbdca 100644 --- a/extensions/jdbc/build.gradle +++ b/extensions/jdbc/build.gradle @@ -11,7 +11,7 @@ dependencies { implementation project(':engine-table'), project(':engine-base') - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) diff --git a/extensions/parquet/compression/build.gradle b/extensions/parquet/compression/build.gradle index a3687f44bd7..e4e9cbe9ce0 100644 --- a/extensions/parquet/compression/build.gradle +++ b/extensions/parquet/compression/build.gradle @@ -11,7 +11,7 @@ dependencies { implementation depCommonsIo - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) runtimeOnly('org.lz4:lz4-java:1.8.0') { // also consider lz4-pure-java to avoid native code diff --git a/grpc-java/grpc-servlet-jakarta/build.gradle b/grpc-java/grpc-servlet-jakarta/build.gradle index 864ce2118fe..a8b32749eb6 100644 --- a/grpc-java/grpc-servlet-jakarta/build.gradle +++ b/grpc-java/grpc-servlet-jakarta/build.gradle @@ -9,5 +9,5 @@ dependencies { compileOnly 'jakarta.servlet:jakarta.servlet-api:5.0.0', 'org.apache.tomcat:annotations-api:6.0.53' - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) } \ No newline at end of file diff --git a/grpc-java/grpc-servlet-websocket-jakarta/build.gradle b/grpc-java/grpc-servlet-websocket-jakarta/build.gradle index 2c4c48df78f..2c61b1e0b31 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/build.gradle +++ b/grpc-java/grpc-servlet-websocket-jakarta/build.gradle @@ -12,6 +12,6 @@ dependencies { // compileOnly 'javax.websocket:javax.websocket-api:1.1' implementation 'jakarta.websocket:jakarta.websocket-api:2.0.0' - implementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project) } \ No newline at end of file diff --git a/web/shared-beans/shared-beans.gradle b/web/shared-beans/shared-beans.gradle index a2fe2cd9ac5..fce2b3afde0 100644 --- a/web/shared-beans/shared-beans.gradle +++ b/web/shared-beans/shared-beans.gradle @@ -14,7 +14,7 @@ configurations { dependencies { api project(':open-api-shared-fu') - testImplementation 'com.google.guava:guava:19.0' + Classpaths.inheritGuava(project, 'testImplementation') } // non-transitive dependency From 81960cbeffe809814ef32fa894fe58766c7253a0 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 6 Oct 2022 08:20:24 -0700 Subject: [PATCH 186/215] Bump grpc version (#2953) --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index dd0c7bbd2c1..5cb4259c71b 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -96,7 +96,7 @@ class Classpaths { static final String GRPC_GROUP = 'io.grpc' static final String GRPC_NAME = 'grpc-bom' - static final String GRPC_VERSION = '1.46.0' + static final String GRPC_VERSION = '1.49.2' // TODO(deephaven-core#1685): Create strategy around updating and maintaining protoc version static final String PROTOBUF_GROUP = 'com.google.protobuf' From d0d90598d8462341e474f4589d0d4d95cc29aa78 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 6 Oct 2022 08:31:06 -0700 Subject: [PATCH 187/215] Bump jetty to 11.0.12 (#2956) --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 5cb4259c71b..71e7ed3bcd1 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -117,7 +117,7 @@ class Classpaths { static final String JETTY11_GROUP = 'org.eclipse.jetty' static final String JETTY11_NAME = 'jetty-bom' - static final String JETTY11_VERSION = '11.0.11' + static final String JETTY11_VERSION = '11.0.12' static final String GUAVA_GROUP = 'com.google.guava' static final String GUAVA_NAME = 'guava' From 935eb4b6f834f11d4dd2c68ba07cbb2198bf01b3 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 6 Oct 2022 11:43:57 -0500 Subject: [PATCH 188/215] Update to latest groovy 3.0.x, adding support for Java 19 (#2967) Fixes #2966 --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 71e7ed3bcd1..38d4f5f6155 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -92,7 +92,7 @@ class Classpaths { static final String LOGBACK_VERSION = '1.4.0' static final String GROOVY_GROUP = 'org.codehaus.groovy' - static final String GROOVY_VERSION = '3.0.9' + static final String GROOVY_VERSION = '3.0.12' static final String GRPC_GROUP = 'io.grpc' static final String GRPC_NAME = 'grpc-bom' From 9d97be67edf35e2d7d5969d52a4816330daffc18 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 6 Oct 2022 10:03:22 -0700 Subject: [PATCH 189/215] Bump dagger to 2.44 (#2968) The api dependency is a good find by dagger - GrpcFilter extends HttpFilter, so HttpFilter should be part of public api. For reference, this is the error without the api dependency: Dependency trace: => element (CLASS): io.deephaven.server.jetty.GrpcFilter => type (ERROR superclass): jakarta.servlet.http.HttpFilter If type 'jakarta.servlet.http.HttpFilter' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'jakarta.servlet.http.HttpFilter' is on your classpath. --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- server/jetty/build.gradle | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 38d4f5f6155..33d804ead0f 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -59,7 +59,7 @@ class Classpaths { static final String DAGGER_GROUP = 'com.google.dagger' static final String DAGGER_NAME = 'dagger' static final String DAGGER_COMPILER = 'dagger-compiler' - static final String DAGGER_VERSION = '2.31.1' + static final String DAGGER_VERSION = '2.44' static final String AUTOSERVICE_GROUP = 'com.google.auto.service' static final String AUTOSERVICE_NAME = 'auto-service-annotations' diff --git a/server/jetty/build.gradle b/server/jetty/build.gradle index b9883ec7569..12464bdde75 100644 --- a/server/jetty/build.gradle +++ b/server/jetty/build.gradle @@ -17,6 +17,7 @@ dependencies { Classpaths.inheritGrpcPlatform(project) Classpaths.inheritJetty11Platform(project) + api 'jakarta.servlet:jakarta.servlet-api:5.0.0' implementation 'org.eclipse.jetty:jetty-servlet' implementation 'org.eclipse.jetty:jetty-webapp' implementation 'org.eclipse.jetty.http2:http2-server' From bf247f115100e81557afe6d7e4150303ca538bb3 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 28 Jun 2022 12:34:36 -0500 Subject: [PATCH 190/215] Client streams to a service can share a websocket --- .../MultiplexedWebSocketServerStream.java | 231 ++++++++++++++ .../MultiplexedWebsocketStreamImpl.java | 296 ++++++++++++++++++ .../server/jetty/JettyBackedGrpcServer.java | 15 +- .../web/client/api/WorkerConnection.java | 3 +- .../grpc/MultiplexedWebsocketTransport.java | 171 ++++++++++ .../transport/TransportFactory.java | 9 +- 6 files changed, 716 insertions(+), 9 deletions(-) create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java create mode 100644 web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java new file mode 100644 index 00000000000..80bae549c19 --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.grpc.servlet.web.websocket; + +import io.grpc.Attributes; +import io.grpc.InternalLogId; +import io.grpc.InternalMetadata; +import io.grpc.Metadata; +import io.grpc.ServerStreamTracer; +import io.grpc.Status; +import io.grpc.internal.ReadableBuffers; +import io.grpc.internal.ServerTransportListener; +import io.grpc.internal.StatsTraceContext; +import jakarta.websocket.CloseReason; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Level; +import java.util.logging.Logger; + +import static io.grpc.internal.GrpcUtil.TIMEOUT_KEY; + +/** + * Each instance of this type represents a single active websocket, which maps to a single gRPC stream. + * + * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about + * runOnTransportThread while in onMessage, as we're already in the transport thread. + */ +@ServerEndpoint(value = "/{service}/{method}", subprotocols = "grpc-websockets-multiplex") +public class MultiplexedWebSocketServerStream { + private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); + + private final ServerTransportListener transportListener; + private final List streamTracerFactories; + private final int maxInboundMessageSize; + private final Attributes attributes; + + private final InternalLogId logId = InternalLogId.allocate(MultiplexedWebSocketServerStream.class, null); + + // assigned on open, always available + private Session websocketSession; + + // fields set after headers are decoded + private final Map streams = new ConcurrentHashMap<>(); + private boolean headersProcessed = false; + private final boolean isTextRequest = false;// not supported yet + + public MultiplexedWebSocketServerStream(ServerTransportListener transportListener, + List streamTracerFactories, int maxInboundMessageSize, + Attributes attributes) { + this.transportListener = transportListener; + this.streamTracerFactories = streamTracerFactories; + this.maxInboundMessageSize = maxInboundMessageSize; + this.attributes = attributes; + } + + @OnOpen + public void onOpen(Session websocketSession, EndpointConfig config) { + this.websocketSession = websocketSession; + + // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses + // can override this method to control those defaults on their own. + websocketSession.setMaxIdleTimeout(0); + websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); + } + + @OnMessage + public void onMessage(String message) { + for (MultiplexedWebsocketStreamImpl stream : streams.values()) { + // This means the stream opened correctly, then sent a text payload, which doesn't make sense. + // End the stream first. + stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); + } + try { + websocketSession + .close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Can't read string payloads")); + } catch (IOException ignored) { + // ignoring failure + } + } + + @OnMessage + public void onMessage(ByteBuffer message) throws IOException { + // Each message starts with an int, to indicate stream id + final int streamId = message.getInt(); + final MultiplexedWebsocketStreamImpl stream = streams.get(streamId); + + if (message.remaining() == 0) { + // message is empty (no control flow, no data), error + if (stream != null) { + stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); + } + websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Unexpected empty message")); + return; + } + + // if this is the first message on this websocket, it is the request headers + if (!headersProcessed) { + processHeaders(message, streamId); + headersProcessed = true; + return; + } + + // For every message after headers, the next byte is control flow + byte controlFlow = message.get(); + if (controlFlow == 1) { + // if first byte is 1, the client is finished sending + if (message.remaining() != 0) { + stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); + websocketSession.close( + new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Unexpected bytes in close message")); + return; + } + stream.inboundDataReceived(ReadableBuffers.empty(), true); + return; + } + + if (isTextRequest) { + throw new UnsupportedOperationException("text requests not yet supported"); + } + + // Having already stripped the control flow byte, the rest of the payload is our request message + stream.inboundDataReceived(ReadableBuffers.wrap(message), false); + } + + @OnError + public void onError(Throwable error) { + for (MultiplexedWebsocketStreamImpl stream : streams.values()) { + stream.transportReportStatus(Status.UNKNOWN);// transport failure of some kind + } + // onClose will be called automatically + if (error instanceof ClosedChannelException) { + // ignore this for now + // TODO need to understand why this is happening + } else { + logger.log(Level.SEVERE, "Error from websocket", error); + } + } + + private String methodName() { + return websocketSession.getRequestURI().getPath().substring(1); + } + + private void processHeaders(ByteBuffer headerPayload, int streamId) { + Metadata headers = readHeaders(headerPayload); + + Long timeoutNanos = headers.get(TIMEOUT_KEY); + if (timeoutNanos == null) { + timeoutNanos = 0L; + } + // TODO handle timeout + + StatsTraceContext statsTraceCtx = + StatsTraceContext.newServerContext(streamTracerFactories, methodName(), headers); + + MultiplexedWebsocketStreamImpl stream = + new MultiplexedWebsocketStreamImpl(statsTraceCtx, maxInboundMessageSize, websocketSession, logId, + attributes, streamId); + stream.createStream(transportListener, methodName(), headers); + streams.put(streamId, stream); + } + + private static Metadata readHeaders(ByteBuffer headerPayload) { + // Headers are passed as ascii (browsers don't support binary), ":"-separated key/value pairs, separated on + // "\r\n". The client implementation shows that values might be comma-separated, but we'll pass that through + // directly as a plain string. + // + List byteArrays = new ArrayList<>(); + while (headerPayload.hasRemaining()) { + int nameStart = headerPayload.position(); + while (headerPayload.hasRemaining() && headerPayload.get() != ':'); + int nameEnd = headerPayload.position() - 1; + int valueStart = headerPayload.position() + 1;// assumes that the colon is followed by a space + + while (headerPayload.hasRemaining() && headerPayload.get() != '\n'); + int valueEnd = headerPayload.position() - 2;// assumes that \n is preceded by a \r, this isnt generally + // safe? + if (valueEnd < valueStart) { + valueEnd = valueStart; + } + int endOfLinePosition = headerPayload.position(); + + byte[] headerBytes = new byte[nameEnd - nameStart]; + headerPayload.position(nameStart); + headerPayload.get(headerBytes); + + byteArrays.add(headerBytes); + if (Arrays.equals(headerBytes, "content-type".getBytes(StandardCharsets.US_ASCII))) { + // rewrite grpc-web content type to matching grpc content type + byteArrays.add("grpc+proto".getBytes(StandardCharsets.US_ASCII)); + // TODO support other formats like text, non-proto + headerPayload.position(valueEnd); + continue; + } + + // TODO check for binary header suffix + // if (headerBytes.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { + // + // } else { + byte[] valueBytes = new byte[valueEnd - valueStart]; + headerPayload.position(valueStart); + headerPayload.get(valueBytes); + byteArrays.add(valueBytes); + // } + + headerPayload.position(endOfLinePosition); + } + + // add a te:trailers, as gRPC will expect it + byteArrays.add("te".getBytes(StandardCharsets.US_ASCII)); + byteArrays.add("trailers".getBytes(StandardCharsets.US_ASCII)); + + // TODO to support text encoding + + return InternalMetadata.newMetadata(byteArrays.toArray(new byte[][] {})); + } +} diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java new file mode 100644 index 00000000000..6d67abfc913 --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -0,0 +1,296 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.grpc.servlet.web.websocket; + +import com.google.common.util.concurrent.MoreExecutors; +import io.grpc.Attributes; +import io.grpc.InternalLogId; +import io.grpc.InternalMetadata; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.internal.AbstractServerStream; +import io.grpc.internal.ReadableBuffer; +import io.grpc.internal.SerializingExecutor; +import io.grpc.internal.ServerTransportListener; +import io.grpc.internal.StatsTraceContext; +import io.grpc.internal.TransportTracer; +import io.grpc.internal.WritableBuffer; +import jakarta.websocket.Session; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +import static java.lang.Math.max; +import static java.lang.Math.min; + +public class MultiplexedWebsocketStreamImpl extends AbstractServerStream { + private static final Logger logger = Logger.getLogger(MultiplexedWebsocketStreamImpl.class.getName()); + + public final class WebsocketTransportState extends TransportState { + + private final SerializingExecutor transportThreadExecutor = + new SerializingExecutor(MoreExecutors.directExecutor()); + + protected WebsocketTransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, + TransportTracer transportTracer) { + super(maxMessageSize, statsTraceCtx, transportTracer); + } + + @Override + public void runOnTransportThread(Runnable r) { + transportThreadExecutor.execute(r); + } + + @Override + public void bytesRead(int numBytes) { + // no-op, no flow-control yet + } + + @Override + public void deframeFailed(Throwable cause) { + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, String.format("[{%s}] Exception processing message", logId), cause); + } + cancel(Status.fromThrowable(cause)); + } + } + private static final class ByteArrayWritableBuffer implements WritableBuffer { + + private final int capacity; + final byte[] bytes; + private int index; + + ByteArrayWritableBuffer(int capacityHint) { + this.bytes = new byte[min(1024 * 1024, max(4096, capacityHint))]; + this.capacity = bytes.length; + } + + @Override + public void write(byte[] src, int srcIndex, int length) { + System.arraycopy(src, srcIndex, bytes, index, length); + index += length; + } + + @Override + public void write(byte b) { + bytes[index++] = b; + } + + @Override + public int writableBytes() { + return capacity - index; + } + + @Override + public int readableBytes() { + return index; + } + + @Override + public void release() {} + } + + private final WebsocketTransportState transportState; + private final Sink sink = new Sink(); + private final Session websocketSession; + private final InternalLogId logId; + private final Attributes attributes; + private final int streamId; + + public MultiplexedWebsocketStreamImpl(StatsTraceContext statsTraceCtx, int maxInboundMessageSize, + Session websocketSession, + InternalLogId logId, Attributes attributes, int streamId) { + super(ByteArrayWritableBuffer::new, statsTraceCtx); + this.websocketSession = websocketSession; + this.logId = logId; + this.attributes = attributes; + this.streamId = streamId; + transportState = new WebsocketTransportState(maxInboundMessageSize, statsTraceCtx, new TransportTracer()); + } + + @Override + public Attributes getAttributes() { + return attributes; + } + + public void createStream(ServerTransportListener transportListener, String methodName, Metadata headers) { + transportListener.streamCreated(this, methodName, headers); + transportState().onStreamAllocated(); + } + + public void inboundDataReceived(ReadableBuffer message, boolean endOfStream) { + transportState().inboundDataReceived(message, endOfStream); + } + + public void transportReportStatus(Status status) { + transportState().transportReportStatus(status); + } + + @Override + public TransportState transportState() { + return transportState; + } + + @Override + protected Sink abstractServerStreamSink() { + return sink; + } + + @Override + public int streamId() { + return -1; + } + + private final class Sink implements AbstractServerStream.Sink { + + @Override + public void writeHeaders(Metadata headers) { + // headers/trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The + // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the length of the + // message + + byte[][] serializedHeaders = InternalMetadata.serialize(headers); + // Total up the size of the payload: 5 bytes for the prefix, and each header needs a colon delimiter, and to + // end with \r\n + int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); + ByteBuffer prefix = ByteBuffer.allocate(9); + prefix.putInt(streamId); + prefix.put((byte) 0x80); + prefix.putInt(headerLength); + prefix.flip(); + ByteBuffer message = ByteBuffer.allocate(headerLength + 4); + message.putInt(streamId); + for (int i = 0; i < serializedHeaders.length; i += 2) { + message.put(serializedHeaders[i]); + message.put((byte) ':'); + message.put((byte) ' '); + message.put(serializedHeaders[i + 1]); + message.put((byte) '\r'); + message.put((byte) '\n'); + } + message.flip(); + try { + // send in two separate payloads + websocketSession.getBasicRemote().sendBinary(prefix); + websocketSession.getBasicRemote().sendBinary(message); + } catch (IOException e) { + throw Status.fromThrowable(e).asRuntimeException(); + } + } + + @Override + public void writeFrame(@Nullable WritableBuffer frame, boolean flush, int numMessages) { + if (frame == null && !flush) { + return; + } + + if (logger.isLoggable(Level.FINEST)) { + logger.log( + Level.FINEST, + "[{0}] writeFrame: numBytes = {1}, flush = {2}, numMessages = {3}", + new Object[] {logId, frame == null ? 0 : frame.readableBytes(), flush, numMessages}); + } + + try { + if (frame != null) { + int numBytes = frame.readableBytes(); + if (numBytes > 0) { + onSendingBytes(numBytes); + } + + ByteBuffer payload = ByteBuffer.allocate(frame.readableBytes() + 4); + payload.putInt(streamId); + payload.put(((ByteArrayWritableBuffer) frame).bytes, 0, frame.readableBytes()); + payload.flip(); + + websocketSession.getBasicRemote().sendBinary(payload); + transportState.runOnTransportThread(() -> transportState.onSentBytes(numBytes)); + } + + } catch (IOException e) { + // TODO log this off-thread, doing logging about an error from sending a log to a client is a mess + // logger.log(WARNING, String.format("[{%s}] Exception writing message", logId), e); + cancel(Status.fromThrowable(e)); + } + } + + @Override + public void writeTrailers(Metadata trailers, boolean headersSent, Status status) { + if (logger.isLoggable(Level.FINE)) { + logger.log( + Level.FINE, + "[{0}] writeTrailers: {1}, headersSent = {2}, status = {3}", + new Object[] {logId, trailers, headersSent, status}); + } + + // Trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The + // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the size in a 4 byte int + + byte[][] serializedTrailers = InternalMetadata.serialize(trailers); + // Total up the size of the payload: 5 bytes for the prefix, and each trailer needs a colon+space delimiter, + // and to end with \r\n + int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); + ByteBuffer prefix = ByteBuffer.allocate(9); + prefix.putInt(streamId); + prefix.put((byte) 0x80); + prefix.putInt(trailerLength); + prefix.flip(); + ByteBuffer message = ByteBuffer.allocate(trailerLength + 4); + message.putInt(streamId); + for (int i = 0; i < serializedTrailers.length; i += 2) { + message.put(serializedTrailers[i]); + message.put((byte) ':'); + message.put((byte) ' '); + message.put(serializedTrailers[i + 1]); + message.put((byte) '\r'); + message.put((byte) '\n'); + } + message.flip(); + try { + // send in two separate messages + websocketSession.getBasicRemote().sendBinary(prefix); + websocketSession.getBasicRemote().sendBinary(message); + + // websocketSession.close();//don't close this, leave it up to the client, or use a timeout + } catch (IOException e) { + throw Status.fromThrowable(e).asRuntimeException(); + } + transportState().runOnTransportThread(() -> { + transportState().complete(); + }); + } + + @Override + public void cancel(Status status) { + if (!websocketSession.isOpen() && Status.Code.DEADLINE_EXCEEDED == status.getCode()) { + return; // let the servlet timeout, the container will sent RST_STREAM automatically + } + transportState.runOnTransportThread(() -> transportState.transportReportStatus(status)); + // There is no way to RST_STREAM with CANCEL code, so write trailers instead + close(Status.CANCELLED.withCause(status.asRuntimeException()), new Metadata()); + CountDownLatch countDownLatch = new CountDownLatch(1); + transportState.runOnTransportThread(() -> { + try { + websocketSession.close(); + } catch (IOException ioException) { + // already closing, ignore + } + countDownLatch.countDown(); + }); + try { + countDownLatch.await(5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } + } + +} diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index 2e3781ed243..fab1c0515bf 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -10,6 +10,7 @@ import io.deephaven.ssl.config.SSLConfig; import io.deephaven.ssl.config.TrustJdk; import io.deephaven.ssl.config.impl.KickstartUtils; +import io.grpc.servlet.web.websocket.MultiplexedWebSocketServerStream; import io.grpc.servlet.web.websocket.WebSocketServerStream; import io.grpc.servlet.jakarta.web.GrpcWebFilter; import jakarta.servlet.DispatcherType; @@ -89,13 +90,23 @@ public JettyBackedGrpcServer( // Set up websocket for grpc-web if (config.websocketsOrDefault()) { JakartaWebSocketServletContainerInitializer.configure(context, (servletContext, container) -> { +// container.addEndpoint( +// ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") +// .configurator(new ServerEndpointConfig.Configurator() { +// @Override +// public T getEndpointInstance(Class endpointClass) +// throws InstantiationException { +// return (T) filter.create(WebSocketServerStream::new); +// } +// }) +// .build()); container.addEndpoint( - ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") + ServerEndpointConfig.Builder.create(MultiplexedWebSocketServerStream.class, "/{service}/{method}") .configurator(new ServerEndpointConfig.Configurator() { @Override public T getEndpointInstance(Class endpointClass) throws InstantiationException { - return (T) filter.create(WebSocketServerStream::new); + return (T) filter.create(MultiplexedWebSocketServerStream::new); } }) .build()); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index 9e9e9896d3f..e2ba0ba9f1e 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -71,6 +71,7 @@ import io.deephaven.web.client.api.batch.TableConfig; import io.deephaven.web.client.api.console.JsVariableChanges; import io.deephaven.web.client.api.console.JsVariableDefinition; +import io.deephaven.web.client.api.grpc.MultiplexedWebsocketTransport; import io.deephaven.web.client.api.i18n.JsTimeZone; import io.deephaven.web.client.api.lifecycle.HasLifecycle; import io.deephaven.web.client.api.parse.JsDataHandler; @@ -133,7 +134,7 @@ public class WorkerConnection { // TODO configurable, let us support this even when ssl? if (DomGlobal.window.location.protocol.equals("http:")) { useWebsockets = true; - Grpc.setDefaultTransport.onInvoke(Grpc.WebsocketTransport.onInvoke()); + Grpc.setDefaultTransport.onInvoke(MultiplexedWebsocketTransport::new); } else { useWebsockets = false; } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java new file mode 100644 index 00000000000..2df612ac432 --- /dev/null +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.web.client.api.grpc; + +import elemental2.core.ArrayBuffer; +import elemental2.core.DataView; +import elemental2.core.Int32Array; +import elemental2.core.Int8Array; +import elemental2.core.Uint8Array; +import elemental2.dom.Event; +import elemental2.dom.MessageEvent; +import elemental2.dom.URL; +import elemental2.dom.WebSocket; +import io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders; +import io.deephaven.javascript.proto.dhinternal.grpcweb.transports.transport.Transport; +import io.deephaven.javascript.proto.dhinternal.grpcweb.transports.transport.TransportOptions; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MultiplexedWebsocketTransport implements Transport { + + private static Uint8Array encodeASCII(String str) { + Uint8Array encoded = new Uint8Array(str.length()); + for (int i = 0; i < str.length(); i++) { + char charCode = str.charAt(i); + // TODO validate + encoded.setAt(i, (double) charCode); + } + return encoded; + } + + private interface QueuedEntry { + void send(WebSocket webSocket, int streamId); + } + public static class HeaderFrame implements QueuedEntry { + private final Uint8Array headerBytes; + + public HeaderFrame(BrowserHeaders metadata) { + StringBuilder str = new StringBuilder(); + metadata.forEach((key, value) -> { + str.append(key).append(": ").append(value.join(", ")).append("\r\n"); + }); + headerBytes = encodeASCII(str.toString()); + } + + @Override + public void send(WebSocket webSocket, int streamId) { + Int8Array payload = new Int8Array(headerBytes.byteLength + 4); + new DataView(payload.buffer).setInt32(0, streamId); + payload.set(headerBytes, 4); + webSocket.send(payload); + } + } + private static class GrpcMessageFrame implements QueuedEntry { + private final Uint8Array msgBytes; + + public GrpcMessageFrame(Uint8Array msgBytes) { + this.msgBytes = msgBytes; + } + + @Override + public void send(WebSocket webSocket, int streamId) { + Int8Array payload = new Int8Array(msgBytes.byteLength + 5); + new DataView(payload.buffer).setInt32(0, streamId); + payload.setAt(4, 0d); + payload.set(msgBytes, 5); + webSocket.send(payload); + } + + } + private static class WebsocketFinishSignal implements QueuedEntry { + + @Override + public void send(WebSocket webSocket, int streamId) { + Uint8Array data = new Uint8Array(new double[] {0, 0, 0, 0, 1}); + new DataView(data.buffer).setInt32(0, streamId); + webSocket.send(data); + } + } + + private static int nextStreamId = 0; + private static final Map activeSockets = new HashMap<>(); + + private final WebSocket webSocket; + private final int streamId = nextStreamId++; + private final List sendQueue = new ArrayList<>(); + private final TransportOptions options; + + public MultiplexedWebsocketTransport(TransportOptions options) { + this.options = options; + String url = options.getUrl(); + URL urlWrapper = new URL(url); + if (urlWrapper.protocol.equals("http:")) { + urlWrapper.protocol = "ws:"; + } else { + urlWrapper.protocol = "wss:"; + } + url = urlWrapper.toString(); + webSocket = activeSockets.computeIfAbsent(url, u -> { + WebSocket ws = new WebSocket(u, "grpc-websockets-multiplex"); + ws.binaryType = "arraybuffer"; + return ws; + }); + } + + @Override + public void sendMessage(Uint8Array msgBytes) { + sendOrEnqueue(new GrpcMessageFrame(msgBytes)); + } + + @Override + public void finishSend() { + sendOrEnqueue(new WebsocketFinishSignal()); + } + + @Override + public void start(BrowserHeaders metadata) { + if (webSocket.readyState == WebSocket.CONNECTING) { + // if the socket isn't open already, wait until the socket is + // open, then flush the queue, otherwise everything will be + // fine to send right away on the already open socket. + webSocket.addEventListener("open", this::onOpen); + } + sendOrEnqueue(new HeaderFrame(metadata)); + + webSocket.addEventListener("close", this::onClose); + webSocket.addEventListener("error", this::onError); + webSocket.addEventListener("message", this::onMessage); + } + + + private void onClose(Event event) { + options.getOnEnd().onInvoke(null); + } + + private void onError(Event event) { + + } + + private void onMessage(Event event) { + MessageEvent messageEvent = (MessageEvent) event; + // read the message, make sure it is for us, if so strip the stream id and fwd it + if (new DataView(messageEvent.data, 0, 4).getInt32(0) == streamId) { + options.getOnChunk().onInvoke(new Uint8Array(messageEvent.data, 4), false); + } + } + + private void sendOrEnqueue(QueuedEntry e) { + if (webSocket.readyState == WebSocket.CONNECTING) { + sendQueue.add(e); + } else { + e.send(webSocket, streamId); + } + } + + private void onOpen(Event event) { + for (int i = 0; i < sendQueue.size(); i++) { + QueuedEntry queuedEntry = sendQueue.get(i); + queuedEntry.send(webSocket, streamId); + } + } + + @Override + public void cancel() { + // TODO remove handlers, and close if we're the last one out + } +} diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/grpcweb/transports/transport/TransportFactory.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/grpcweb/transports/transport/TransportFactory.java index 5a9135e4b5a..a0afdaff8c2 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/grpcweb/transports/transport/TransportFactory.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/grpcweb/transports/transport/TransportFactory.java @@ -3,12 +3,9 @@ */ package io.deephaven.javascript.proto.dhinternal.grpcweb.transports.transport; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsType; +import jsinterop.annotations.JsFunction; -@JsType( - isNative = true, - name = "dhinternal.grpcWeb.transports.Transport.TransportFactory", - namespace = JsPackage.GLOBAL) +@JsFunction public interface TransportFactory { + Transport onInvoke(TransportOptions options); } From bf324e65ba6823a2004b33ec56ac1d66e9f7e911 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 28 Jun 2022 19:35:32 -0500 Subject: [PATCH 191/215] Start sending a "close" bit --- .../websocket/MultiplexedWebSocketServerStream.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index 80bae549c19..dac8be7cd4a 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -95,8 +95,15 @@ public void onMessage(String message) { @OnMessage public void onMessage(ByteBuffer message) throws IOException { - // Each message starts with an int, to indicate stream id - final int streamId = message.getInt(); + // Each message starts with an int, to indicate stream id. If that int is negative, the other end has performed a half close (and this is the final message). + int streamId = message.getInt(); + final boolean closed; + if (streamId < 0) { + closed = true; + streamId = streamId ^ (1 << 31); + } else { + closed = false; + } final MultiplexedWebsocketStreamImpl stream = streams.get(streamId); if (message.remaining() == 0) { From 5cdceefd27c1fba26ea389df3e94d163d326a5a3 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 29 Jun 2022 15:55:32 -0500 Subject: [PATCH 192/215] try a single queue, and handle our own closing --- .../MultiplexedWebSocketServerStream.java | 22 +++++++++-------- .../MultiplexedWebsocketStreamImpl.java | 2 +- server/jetty-app/build.gradle | 1 + .../server/jetty/JettyBackedGrpcServer.java | 2 +- .../grpc/MultiplexedWebsocketTransport.java | 24 ++++++++++++++++--- 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index dac8be7cd4a..a63ee031516 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -40,9 +40,10 @@ * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ -@ServerEndpoint(value = "/{service}/{method}", subprotocols = "grpc-websockets-multiplex") +@ServerEndpoint(value = "/grpc-websocket", subprotocols = "grpc-websockets-multiplex") public class MultiplexedWebSocketServerStream { private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); + public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); private final ServerTransportListener transportListener; private final List streamTracerFactories; @@ -56,7 +57,6 @@ public class MultiplexedWebSocketServerStream { // fields set after headers are decoded private final Map streams = new ConcurrentHashMap<>(); - private boolean headersProcessed = false; private final boolean isTextRequest = false;// not supported yet public MultiplexedWebSocketServerStream(ServerTransportListener transportListener, @@ -116,15 +116,18 @@ public void onMessage(ByteBuffer message) throws IOException { } // if this is the first message on this websocket, it is the request headers - if (!headersProcessed) { + if (stream == null) { processHeaders(message, streamId); - headersProcessed = true; return; } +// if (stream == null) { +// websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "No stream with that ID: " + streamId)); +// } // For every message after headers, the next byte is control flow byte controlFlow = message.get(); if (controlFlow == 1) { + assert closed; // if first byte is 1, the client is finished sending if (message.remaining() != 0) { stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); @@ -135,6 +138,7 @@ public void onMessage(ByteBuffer message) throws IOException { stream.inboundDataReceived(ReadableBuffers.empty(), true); return; } + assert !closed; if (isTextRequest) { throw new UnsupportedOperationException("text requests not yet supported"); @@ -158,13 +162,11 @@ public void onError(Throwable error) { } } - private String methodName() { - return websocketSession.getRequestURI().getPath().substring(1); - } - private void processHeaders(ByteBuffer headerPayload, int streamId) { Metadata headers = readHeaders(headerPayload); + String path = headers.get(PATH); + Long timeoutNanos = headers.get(TIMEOUT_KEY); if (timeoutNanos == null) { timeoutNanos = 0L; @@ -172,12 +174,12 @@ private void processHeaders(ByteBuffer headerPayload, int streamId) { // TODO handle timeout StatsTraceContext statsTraceCtx = - StatsTraceContext.newServerContext(streamTracerFactories, methodName(), headers); + StatsTraceContext.newServerContext(streamTracerFactories, path, headers); MultiplexedWebsocketStreamImpl stream = new MultiplexedWebsocketStreamImpl(statsTraceCtx, maxInboundMessageSize, websocketSession, logId, attributes, streamId); - stream.createStream(transportListener, methodName(), headers); + stream.createStream(transportListener, path, headers); streams.put(streamId, stream); } diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index 6d67abfc913..f32622d6b46 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -244,7 +244,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) prefix.putInt(trailerLength); prefix.flip(); ByteBuffer message = ByteBuffer.allocate(trailerLength + 4); - message.putInt(streamId); + message.putInt(streamId ^ (1 << 31)); for (int i = 0; i < serializedTrailers.length; i += 2) { message.put(serializedTrailers[i]); message.put((byte) ':'); diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index 89d3599f623..2e2292016a1 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -28,6 +28,7 @@ def extraJvmArgs = [ '-XX:MaxGCPauseMillis=100', '-XX:+UseStringDeduplication', '-XshowSettings:vm', + '-ea', ] if (hasProperty('groovy')) { diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index fab1c0515bf..0b55acb9009 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -101,7 +101,7 @@ public JettyBackedGrpcServer( // }) // .build()); container.addEndpoint( - ServerEndpointConfig.Builder.create(MultiplexedWebSocketServerStream.class, "/{service}/{method}") + ServerEndpointConfig.Builder.create(MultiplexedWebSocketServerStream.class, "/grpc-websocket") .configurator(new ServerEndpointConfig.Configurator() { @Override public T getEndpointInstance(Class endpointClass) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java index 2df612ac432..36a4b2961e4 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java @@ -39,8 +39,9 @@ private interface QueuedEntry { public static class HeaderFrame implements QueuedEntry { private final Uint8Array headerBytes; - public HeaderFrame(BrowserHeaders metadata) { + public HeaderFrame(String path, BrowserHeaders metadata) { StringBuilder str = new StringBuilder(); + metadata.append("grpc-websockets-path", path); metadata.forEach((key, value) -> { str.append(key).append(": ").append(value.join(", ")).append("\r\n"); }); @@ -77,6 +78,7 @@ private static class WebsocketFinishSignal implements QueuedEntry { @Override public void send(WebSocket webSocket, int streamId) { Uint8Array data = new Uint8Array(new double[] {0, 0, 0, 0, 1}); + streamId = streamId ^ (1 << 31); new DataView(data.buffer).setInt32(0, streamId); webSocket.send(data); } @@ -89,6 +91,7 @@ public void send(WebSocket webSocket, int streamId) { private final int streamId = nextStreamId++; private final List sendQueue = new ArrayList<>(); private final TransportOptions options; + private final String path; public MultiplexedWebsocketTransport(TransportOptions options) { this.options = options; @@ -99,7 +102,10 @@ public MultiplexedWebsocketTransport(TransportOptions options) { } else { urlWrapper.protocol = "wss:"; } + path = urlWrapper.pathname.substring(1); + urlWrapper.pathname = "/grpc-websocket"; url = urlWrapper.toString(); + webSocket = activeSockets.computeIfAbsent(url, u -> { WebSocket ws = new WebSocket(u, "grpc-websockets-multiplex"); ws.binaryType = "arraybuffer"; @@ -125,7 +131,7 @@ public void start(BrowserHeaders metadata) { // fine to send right away on the already open socket. webSocket.addEventListener("open", this::onOpen); } - sendOrEnqueue(new HeaderFrame(metadata)); + sendOrEnqueue(new HeaderFrame(path, metadata)); webSocket.addEventListener("close", this::onClose); webSocket.addEventListener("error", this::onError); @@ -144,8 +150,19 @@ private void onError(Event event) { private void onMessage(Event event) { MessageEvent messageEvent = (MessageEvent) event; // read the message, make sure it is for us, if so strip the stream id and fwd it - if (new DataView(messageEvent.data, 0, 4).getInt32(0) == streamId) { + int streamId = new DataView(messageEvent.data, 0, 4).getInt32(0); + boolean closed; + if (streamId < 0) { + streamId = streamId ^ (1 << 31); + closed = true; + } else { + closed = false; + } + if (streamId == this.streamId) { options.getOnChunk().onInvoke(new Uint8Array(messageEvent.data, 4), false); + if (closed) { + options.getOnEnd().onInvoke(null); + } } } @@ -162,6 +179,7 @@ private void onOpen(Event event) { QueuedEntry queuedEntry = sendQueue.get(i); queuedEntry.send(webSocket, streamId); } + sendQueue.clear(); } @Override From 7d8213af71dddc6ec2669eeacde97318f4e9543d Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 29 Jun 2022 16:09:52 -0500 Subject: [PATCH 193/215] Sit spot, sit. --- .../MultiplexedWebSocketServerStream.java | 13 +++++++----- .../server/jetty/JettyBackedGrpcServer.java | 20 +++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index a63ee031516..a9ca417b1dd 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -43,7 +43,8 @@ @ServerEndpoint(value = "/grpc-websocket", subprotocols = "grpc-websockets-multiplex") public class MultiplexedWebSocketServerStream { private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); - public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); + public static final Metadata.Key PATH = + Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); private final ServerTransportListener transportListener; private final List streamTracerFactories; @@ -95,7 +96,8 @@ public void onMessage(String message) { @OnMessage public void onMessage(ByteBuffer message) throws IOException { - // Each message starts with an int, to indicate stream id. If that int is negative, the other end has performed a half close (and this is the final message). + // Each message starts with an int, to indicate stream id. If that int is negative, the other end has performed + // a half close (and this is the final message). int streamId = message.getInt(); final boolean closed; if (streamId < 0) { @@ -120,9 +122,10 @@ public void onMessage(ByteBuffer message) throws IOException { processHeaders(message, streamId); return; } -// if (stream == null) { -// websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "No stream with that ID: " + streamId)); -// } + // if (stream == null) { + // websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "No stream with that ID: " + + // streamId)); + // } // For every message after headers, the next byte is control flow byte controlFlow = message.get(); diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index 0b55acb9009..0df9a1ae6d3 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -90,16 +90,16 @@ public JettyBackedGrpcServer( // Set up websocket for grpc-web if (config.websocketsOrDefault()) { JakartaWebSocketServletContainerInitializer.configure(context, (servletContext, container) -> { -// container.addEndpoint( -// ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") -// .configurator(new ServerEndpointConfig.Configurator() { -// @Override -// public T getEndpointInstance(Class endpointClass) -// throws InstantiationException { -// return (T) filter.create(WebSocketServerStream::new); -// } -// }) -// .build()); + // container.addEndpoint( + // ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") + // .configurator(new ServerEndpointConfig.Configurator() { + // @Override + // public T getEndpointInstance(Class endpointClass) + // throws InstantiationException { + // return (T) filter.create(WebSocketServerStream::new); + // } + // }) + // .build()); container.addEndpoint( ServerEndpointConfig.Builder.create(MultiplexedWebSocketServerStream.class, "/grpc-websocket") .configurator(new ServerEndpointConfig.Configurator() { From 8f704ed0d41297254453f60070b1f928a5e0c3d9 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 1 Jul 2022 15:36:00 -0500 Subject: [PATCH 194/215] Add comments, simplify code slightly --- .../MultiplexedWebSocketServerStream.java | 23 +++++++++++-------- .../MultiplexedWebsocketStreamImpl.java | 22 ++++++------------ server/jetty-app/build.gradle | 1 - 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index a9ca417b1dd..1a07d2d774f 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -26,6 +26,7 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -35,7 +36,12 @@ import static io.grpc.internal.GrpcUtil.TIMEOUT_KEY; /** - * Each instance of this type represents a single active websocket, which maps to a single gRPC stream. + * Each instance of this type represents a single active websocket, which can allow several concurrent/overlapping gRPC + * streams. This is in contrast to the {@link WebSocketServerStream} type, which supports one websocket per gRPC stream. + * + * To achieve this, each frame starts with a 32 bit integer indicating the ID of the stream. If the MSB of that int is + * 1, then the request must be closed by this frame, and that MSB is set to zero to read the ID of the stream. On the + * initial request, an extra header is sent from the client, indicating the path to the service method, and each frame * * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. @@ -56,8 +62,9 @@ public class MultiplexedWebSocketServerStream { // assigned on open, always available private Session websocketSession; - // fields set after headers are decoded - private final Map streams = new ConcurrentHashMap<>(); + // fields set after headers are decoded. No need to be threadsafe, this will only be accessed from the transport + // thread. + private final Map streams = new HashMap<>(); private final boolean isTextRequest = false;// not supported yet public MultiplexedWebSocketServerStream(ServerTransportListener transportListener, @@ -106,6 +113,7 @@ public void onMessage(ByteBuffer message) throws IOException { } else { closed = false; } + // may be null if this is the first request for this streamId final MultiplexedWebsocketStreamImpl stream = streams.get(streamId); if (message.remaining() == 0) { @@ -122,12 +130,9 @@ public void onMessage(ByteBuffer message) throws IOException { processHeaders(message, streamId); return; } - // if (stream == null) { - // websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "No stream with that ID: " + - // streamId)); - // } - // For every message after headers, the next byte is control flow + // For every message after headers, the next byte is control flow - this is technically already managed by + // "closed", but this lets us stay somewhat closer to the underlying grpc/grpc-web format. byte controlFlow = message.get(); if (controlFlow == 1) { assert closed; @@ -174,7 +179,7 @@ private void processHeaders(ByteBuffer headerPayload, int streamId) { if (timeoutNanos == null) { timeoutNanos = 0L; } - // TODO handle timeout + // TODO handle timeout on a per-stream basis StatsTraceContext statsTraceCtx = StatsTraceContext.newServerContext(streamTracerFactories, path, headers); diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index f32622d6b46..0b0b4b2697a 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -161,13 +161,10 @@ public void writeHeaders(Metadata headers) { // Total up the size of the payload: 5 bytes for the prefix, and each header needs a colon delimiter, and to // end with \r\n int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); - ByteBuffer prefix = ByteBuffer.allocate(9); - prefix.putInt(streamId); - prefix.put((byte) 0x80); - prefix.putInt(headerLength); - prefix.flip(); - ByteBuffer message = ByteBuffer.allocate(headerLength + 4); + ByteBuffer message = ByteBuffer.allocate(headerLength + 9 + 4); message.putInt(streamId); + message.put((byte) 0x80); + message.putInt(headerLength); for (int i = 0; i < serializedHeaders.length; i += 2) { message.put(serializedHeaders[i]); message.put((byte) ':'); @@ -178,8 +175,6 @@ public void writeHeaders(Metadata headers) { } message.flip(); try { - // send in two separate payloads - websocketSession.getBasicRemote().sendBinary(prefix); websocketSession.getBasicRemote().sendBinary(message); } catch (IOException e) { throw Status.fromThrowable(e).asRuntimeException(); @@ -238,13 +233,11 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) // Total up the size of the payload: 5 bytes for the prefix, and each trailer needs a colon+space delimiter, // and to end with \r\n int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); - ByteBuffer prefix = ByteBuffer.allocate(9); - prefix.putInt(streamId); - prefix.put((byte) 0x80); - prefix.putInt(trailerLength); - prefix.flip(); - ByteBuffer message = ByteBuffer.allocate(trailerLength + 4); + + ByteBuffer message = ByteBuffer.allocate(9 + trailerLength); message.putInt(streamId ^ (1 << 31)); + message.put((byte) 0x80); + message.putInt(trailerLength); for (int i = 0; i < serializedTrailers.length; i += 2) { message.put(serializedTrailers[i]); message.put((byte) ':'); @@ -256,7 +249,6 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) message.flip(); try { // send in two separate messages - websocketSession.getBasicRemote().sendBinary(prefix); websocketSession.getBasicRemote().sendBinary(message); // websocketSession.close();//don't close this, leave it up to the client, or use a timeout diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index 2e2292016a1..89d3599f623 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -28,7 +28,6 @@ def extraJvmArgs = [ '-XX:MaxGCPauseMillis=100', '-XX:+UseStringDeduplication', '-XshowSettings:vm', - '-ea', ] if (hasProperty('groovy')) { From 8fe92fd3cb8492c8c87d9a3f69b07ae8a905351d Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 6 Jul 2022 11:03:53 -0500 Subject: [PATCH 195/215] Remove finished streams --- .../web/websocket/MultiplexedWebSocketServerStream.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index 1a07d2d774f..acced6c0c49 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -93,6 +93,7 @@ public void onMessage(String message) { // End the stream first. stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); } + streams.clear(); try { websocketSession .close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Can't read string payloads")); @@ -120,6 +121,7 @@ public void onMessage(ByteBuffer message) throws IOException { // message is empty (no control flow, no data), error if (stream != null) { stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); + streams.remove(streamId); } websocketSession.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Unexpected empty message")); return; @@ -139,11 +141,13 @@ public void onMessage(ByteBuffer message) throws IOException { // if first byte is 1, the client is finished sending if (message.remaining() != 0) { stream.transportReportStatus(Status.fromCode(Status.Code.UNKNOWN)); + streams.remove(streamId); websocketSession.close( new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Unexpected bytes in close message")); return; } stream.inboundDataReceived(ReadableBuffers.empty(), true); + streams.remove(streamId); return; } assert !closed; @@ -161,6 +165,7 @@ public void onError(Throwable error) { for (MultiplexedWebsocketStreamImpl stream : streams.values()) { stream.transportReportStatus(Status.UNKNOWN);// transport failure of some kind } + streams.clear(); // onClose will be called automatically if (error instanceof ClosedChannelException) { // ignore this for now From f1264de96c2f39de688869088a3c00af77cfd2e0 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 6 Jul 2022 16:33:14 -0500 Subject: [PATCH 196/215] Client and server should each support both ws mechanisms --- .../servlet/web/websocket/GrpcWebsocket.java | 50 ++++++ .../MultiplexedWebSocketServerStream.java | 27 +-- .../web/websocket/WebSocketServerStream.java | 26 +-- .../server/jetty/JettyBackedGrpcServer.java | 45 ++--- .../web/client/api/WorkerConnection.java | 4 +- .../grpc/MultiplexedWebsocketTransport.java | 161 ++++++++++++++---- 6 files changed, 232 insertions(+), 81 deletions(-) create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java new file mode 100644 index 00000000000..ae747dc85ba --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java @@ -0,0 +1,50 @@ +package io.grpc.servlet.web.websocket; + +import jakarta.websocket.CloseReason; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +/** + * Supports both grpc-websockets and grpc-websockets-multiplex subprotocols, and delegates to the correct implementation + * after protocol negotiation. + */ +public class GrpcWebsocket extends Endpoint { + private final Map> endpointFactories = new HashMap<>(); + private Endpoint endpoint; + + public GrpcWebsocket(Map> endpoints) { + endpointFactories.putAll(endpoints); + } + + public void onOpen(Session session, EndpointConfig endpointConfig) { + Supplier supplier = endpointFactories.get(session.getNegotiatedSubprotocol()); + if (supplier == null) { + try { + session.close(new CloseReason(CloseReason.CloseCodes.PROTOCOL_ERROR, "Unsupported subprotocol")); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return; + } + + endpoint = supplier.get(); + endpoint.onOpen(session, endpointConfig); + } + + @Override + public void onClose(Session session, CloseReason closeReason) { + endpoint.onClose(session, closeReason); + } + + @Override + public void onError(Session session, Throwable thr) { + endpoint.onError(session, thr); + } +} diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index acced6c0c49..6cf71eeb8c0 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -13,14 +13,12 @@ import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import jakarta.websocket.CloseReason; +import jakarta.websocket.Endpoint; import jakarta.websocket.EndpointConfig; -import jakarta.websocket.OnError; -import jakarta.websocket.OnMessage; -import jakarta.websocket.OnOpen; import jakarta.websocket.Session; -import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; +import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.charset.StandardCharsets; @@ -29,7 +27,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -46,8 +43,7 @@ * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ -@ServerEndpoint(value = "/grpc-websocket", subprotocols = "grpc-websockets-multiplex") -public class MultiplexedWebSocketServerStream { +public class MultiplexedWebSocketServerStream extends Endpoint { private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); @@ -76,17 +72,25 @@ public MultiplexedWebSocketServerStream(ServerTransportListener transportListene this.attributes = attributes; } - @OnOpen + @Override public void onOpen(Session websocketSession, EndpointConfig config) { this.websocketSession = websocketSession; + websocketSession.addMessageHandler(String.class, this::onMessage); + websocketSession.addMessageHandler(ByteBuffer.class, message -> { + try { + onMessage(message); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses // can override this method to control those defaults on their own. websocketSession.setMaxIdleTimeout(0); websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); } - @OnMessage public void onMessage(String message) { for (MultiplexedWebsocketStreamImpl stream : streams.values()) { // This means the stream opened correctly, then sent a text payload, which doesn't make sense. @@ -102,7 +106,6 @@ public void onMessage(String message) { } } - @OnMessage public void onMessage(ByteBuffer message) throws IOException { // Each message starts with an int, to indicate stream id. If that int is negative, the other end has performed // a half close (and this is the final message). @@ -160,8 +163,8 @@ public void onMessage(ByteBuffer message) throws IOException { stream.inboundDataReceived(ReadableBuffers.wrap(message), false); } - @OnError - public void onError(Throwable error) { + @Override + public void onError(Session session, Throwable error) { for (MultiplexedWebsocketStreamImpl stream : streams.values()) { stream.transportReportStatus(Status.UNKNOWN);// transport failure of some kind } diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java index c8adc2b53f7..c5c6c09e641 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java @@ -10,14 +10,12 @@ import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import jakarta.websocket.CloseReason; +import jakarta.websocket.Endpoint; import jakarta.websocket.EndpointConfig; -import jakarta.websocket.OnError; -import jakarta.websocket.OnMessage; -import jakarta.websocket.OnOpen; import jakarta.websocket.Session; -import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; +import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.charset.StandardCharsets; @@ -35,8 +33,7 @@ * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ -@ServerEndpoint(value = "/{service}/{method}", subprotocols = "grpc-websockets") -public class WebSocketServerStream { +public class WebSocketServerStream extends Endpoint { private static final Logger logger = Logger.getLogger(WebSocketServerStream.class.getName()); private final ServerTransportListener transportListener; @@ -63,17 +60,25 @@ public WebSocketServerStream(ServerTransportListener transportListener, this.attributes = attributes; } - @OnOpen + @Override public void onOpen(Session websocketSession, EndpointConfig config) { this.websocketSession = websocketSession; + websocketSession.addMessageHandler(String.class, this::onMessage); + websocketSession.addMessageHandler(ByteBuffer.class, message -> { + try { + onMessage(message); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses // can override this method to control those defaults on their own. websocketSession.setMaxIdleTimeout(0); websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); } - @OnMessage public void onMessage(String message) { if (stream != null) { // This means the stream opened correctly, then sent a text payload, which doesn't make sense. @@ -88,7 +93,6 @@ public void onMessage(String message) { } } - @OnMessage public void onMessage(ByteBuffer message) throws IOException { if (message.remaining() == 0) { // message is empty (no control flow, no data), error @@ -128,8 +132,8 @@ public void onMessage(ByteBuffer message) throws IOException { stream.inboundDataReceived(ReadableBuffers.wrap(message), false); } - @OnError - public void onError(Throwable error) { + @Override + public void onError(Session session, Throwable error) { stream.transportReportStatus(Status.UNKNOWN);// transport failure of some kind // onClose will be called automatically if (error instanceof ClosedChannelException) { diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index 0df9a1ae6d3..88924452f14 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -10,10 +10,12 @@ import io.deephaven.ssl.config.SSLConfig; import io.deephaven.ssl.config.TrustJdk; import io.deephaven.ssl.config.impl.KickstartUtils; +import io.grpc.servlet.web.websocket.GrpcWebsocket; import io.grpc.servlet.web.websocket.MultiplexedWebSocketServerStream; import io.grpc.servlet.web.websocket.WebSocketServerStream; import io.grpc.servlet.jakarta.web.GrpcWebFilter; import jakarta.servlet.DispatcherType; +import jakarta.websocket.Endpoint; import jakarta.websocket.server.ServerEndpointConfig; import nl.altindag.ssl.SSLFactory; import nl.altindag.ssl.util.JettySslUtils; @@ -39,8 +41,13 @@ import java.io.IOException; import java.io.UncheckedIOException; import java.net.URL; +import java.util.Arrays; +import java.util.Collections; import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import static org.eclipse.jetty.servlet.ServletContextHandler.SESSIONS; @@ -87,29 +94,25 @@ public JettyBackedGrpcServer( // Wire up the provided grpc filter context.addFilter(new FilterHolder(filter), "/*", EnumSet.noneOf(DispatcherType.class)); - // Set up websocket for grpc-web + // Set up websockets for grpc-web - we register both in case we encounter a client using "vanilla" + // grpc-websocket, that can't multiplex all streams on a single socket if (config.websocketsOrDefault()) { JakartaWebSocketServletContainerInitializer.configure(context, (servletContext, container) -> { - // container.addEndpoint( - // ServerEndpointConfig.Builder.create(WebSocketServerStream.class, "/{service}/{method}") - // .configurator(new ServerEndpointConfig.Configurator() { - // @Override - // public T getEndpointInstance(Class endpointClass) - // throws InstantiationException { - // return (T) filter.create(WebSocketServerStream::new); - // } - // }) - // .build()); - container.addEndpoint( - ServerEndpointConfig.Builder.create(MultiplexedWebSocketServerStream.class, "/grpc-websocket") - .configurator(new ServerEndpointConfig.Configurator() { - @Override - public T getEndpointInstance(Class endpointClass) - throws InstantiationException { - return (T) filter.create(MultiplexedWebSocketServerStream::new); - } - }) - .build()); + Map> endpoints = Map.of( + "grpc-websockets", () -> filter.create(WebSocketServerStream::new), + "grpc-websockets-multiplex", () -> filter.create(MultiplexedWebSocketServerStream::new)); + container.addEndpoint(ServerEndpointConfig.Builder.create(GrpcWebsocket.class, "/{service}/{method}") + .configurator(new ServerEndpointConfig.Configurator() { + @Override + public T getEndpointInstance(Class endpointClass) throws InstantiationException { + // noinspection unchecked + return (T) new GrpcWebsocket(endpoints); + } + }) + .subprotocols(Arrays.asList("grpc-websockets", "grpc-websockets-multiplex")) + .build() + + ); }); } jetty.setHandler(context); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index e2ba0ba9f1e..aa80cd1f909 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -134,7 +134,9 @@ public class WorkerConnection { // TODO configurable, let us support this even when ssl? if (DomGlobal.window.location.protocol.equals("http:")) { useWebsockets = true; - Grpc.setDefaultTransport.onInvoke(MultiplexedWebsocketTransport::new); + Grpc.setDefaultTransport.onInvoke(options -> new MultiplexedWebsocketTransport(options, () -> { + Grpc.setDefaultTransport.onInvoke(Grpc.WebsocketTransport.onInvoke()); + })); } else { useWebsockets = false; } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java index 36a4b2961e4..cff5f72826d 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/grpc/MultiplexedWebsocketTransport.java @@ -5,24 +5,37 @@ import elemental2.core.ArrayBuffer; import elemental2.core.DataView; -import elemental2.core.Int32Array; import elemental2.core.Int8Array; +import elemental2.core.JsError; import elemental2.core.Uint8Array; +import elemental2.dom.CloseEvent; import elemental2.dom.Event; import elemental2.dom.MessageEvent; import elemental2.dom.URL; import elemental2.dom.WebSocket; import io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders; +import io.deephaven.javascript.proto.dhinternal.grpcweb.Grpc; import io.deephaven.javascript.proto.dhinternal.grpcweb.transports.transport.Transport; import io.deephaven.javascript.proto.dhinternal.grpcweb.transports.transport.TransportOptions; +import io.deephaven.web.client.api.JsLazy; +import io.deephaven.web.shared.fu.JsRunnable; +import jsinterop.base.Js; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * Custom replacement for grpc-websockets transport that handles multiple grpc streams in a single websocket. All else + * equal, this transport should be preferred to the default grpc-websockets transport, and in turn the fetch based + * transport is usually superior to this. + */ public class MultiplexedWebsocketTransport implements Transport { + public static final String MULTIPLEX_PROTOCOL = "grpc-websockets-multiplex"; + public static final String SOCKET_PER_STREAM_PROTOCOL = "grpc-websockets"; + private static Uint8Array encodeASCII(String str) { Uint8Array encoded = new Uint8Array(str.length()); for (int i = 0; i < str.length(); i++) { @@ -35,27 +48,40 @@ private static Uint8Array encodeASCII(String str) { private interface QueuedEntry { void send(WebSocket webSocket, int streamId); + + void sendFallback(Transport transport); } + public static class HeaderFrame implements QueuedEntry { - private final Uint8Array headerBytes; + private final String path; + private final BrowserHeaders metadata; public HeaderFrame(String path, BrowserHeaders metadata) { - StringBuilder str = new StringBuilder(); + this.path = path; + this.metadata = metadata; + } + + @Override + public void send(WebSocket webSocket, int streamId) { + final Uint8Array headerBytes; + final StringBuilder str = new StringBuilder(); metadata.append("grpc-websockets-path", path); metadata.forEach((key, value) -> { str.append(key).append(": ").append(value.join(", ")).append("\r\n"); }); headerBytes = encodeASCII(str.toString()); - } - - @Override - public void send(WebSocket webSocket, int streamId) { Int8Array payload = new Int8Array(headerBytes.byteLength + 4); new DataView(payload.buffer).setInt32(0, streamId); payload.set(headerBytes, 4); webSocket.send(payload); } + + @Override + public void sendFallback(Transport transport) { + transport.start(metadata); + } } + private static class GrpcMessageFrame implements QueuedEntry { private final Uint8Array msgBytes; @@ -72,9 +98,13 @@ public void send(WebSocket webSocket, int streamId) { webSocket.send(payload); } + @Override + public void sendFallback(Transport transport) { + transport.sendMessage(msgBytes); + } } - private static class WebsocketFinishSignal implements QueuedEntry { + private static class WebsocketFinishSignal implements QueuedEntry { @Override public void send(WebSocket webSocket, int streamId) { Uint8Array data = new Uint8Array(new double[] {0, 0, 0, 0, 1}); @@ -82,6 +112,11 @@ public void send(WebSocket webSocket, int streamId) { new DataView(data.buffer).setInt32(0, streamId); webSocket.send(data); } + + @Override + public void sendFallback(Transport transport) { + transport.finishSend(); + } } private static int nextStreamId = 0; @@ -93,7 +128,9 @@ public void send(WebSocket webSocket, int streamId) { private final TransportOptions options; private final String path; - public MultiplexedWebsocketTransport(TransportOptions options) { + private final JsLazy alternativeTransport; + + public MultiplexedWebsocketTransport(TransportOptions options, JsRunnable avoidMultiplexCallback) { this.options = options; String url = options.getUrl(); URL urlWrapper = new URL(url); @@ -102,29 +139,34 @@ public MultiplexedWebsocketTransport(TransportOptions options) { } else { urlWrapper.protocol = "wss:"; } + // preserve the path to send as metadata, but still talk to the server with that path path = urlWrapper.pathname.substring(1); - urlWrapper.pathname = "/grpc-websocket"; - url = urlWrapper.toString(); + String actualUrl = urlWrapper.toString(); + urlWrapper.pathname = "/"; + String key = urlWrapper.toString(); - webSocket = activeSockets.computeIfAbsent(url, u -> { - WebSocket ws = new WebSocket(u, "grpc-websockets-multiplex"); + // note that we connect to the actual url so the server can inform us via subprotocols that it isn't supported, + // but the global map removes the path as the key for each websocket + webSocket = activeSockets.computeIfAbsent(key, ignore -> { + WebSocket ws = new WebSocket(actualUrl, new String[] {MULTIPLEX_PROTOCOL, SOCKET_PER_STREAM_PROTOCOL}); ws.binaryType = "arraybuffer"; return ws; }); - } - @Override - public void sendMessage(Uint8Array msgBytes) { - sendOrEnqueue(new GrpcMessageFrame(msgBytes)); - } - - @Override - public void finishSend() { - sendOrEnqueue(new WebsocketFinishSignal()); + // prepare a fallback + alternativeTransport = new JsLazy<>(() -> { + avoidMultiplexCallback.run(); + return Grpc.WebsocketTransport.onInvoke().onInvoke(options); + }); } @Override public void start(BrowserHeaders metadata) { + if (alternativeTransport.isAvailable()) { + alternativeTransport.get().start(metadata); + return; + } + if (webSocket.readyState == WebSocket.CONNECTING) { // if the socket isn't open already, wait until the socket is // open, then flush the queue, otherwise everything will be @@ -138,9 +180,69 @@ public void start(BrowserHeaders metadata) { webSocket.addEventListener("message", this::onMessage); } + private void onOpen(Event event) { + Object protocol = Js.asPropertyMap(webSocket).get("protocol"); + if (protocol.equals(SOCKET_PER_STREAM_PROTOCOL)) { + // delegate to plain websocket impl, try to dissuade future users of this server + Transport transport = alternativeTransport.get(); + + // close our own websocket + webSocket.close(); + + // flush the queued items, which are now the new transport's problems - we'll forward all future work there + // as well automatically + for (int i = 0; i < sendQueue.size(); i++) { + sendQueue.get(i).sendFallback(transport); + } + sendQueue.clear(); + return; + } else if (!protocol.equals(MULTIPLEX_PROTOCOL)) { + // give up, no way to handle this + // TODO throw so the user can see this + return; + } + for (int i = 0; i < sendQueue.size(); i++) { + sendQueue.get(i).send(webSocket, streamId); + } + sendQueue.clear(); + } + + @Override + public void sendMessage(Uint8Array msgBytes) { + if (alternativeTransport.isAvailable()) { + alternativeTransport.get().sendMessage(msgBytes); + return; + } + + sendOrEnqueue(new GrpcMessageFrame(msgBytes)); + } + + @Override + public void finishSend() { + if (alternativeTransport.isAvailable()) { + alternativeTransport.get().finishSend(); + return; + } + + sendOrEnqueue(new WebsocketFinishSignal()); + } + + @Override + public void cancel() { + if (alternativeTransport.isAvailable()) { + alternativeTransport.get().cancel(); + return; + } + // TODO remove handlers, and close if we're the last one out + } private void onClose(Event event) { - options.getOnEnd().onInvoke(null); + if (alternativeTransport.isAvailable()) { + // must be downgrading to fallback + return; + } + // each grpc transport will handle this as an error + options.getOnEnd().onInvoke(new JsError("Unexpectedly closed " + ((CloseEvent) event).reason)); } private void onError(Event event) { @@ -173,17 +275,4 @@ private void sendOrEnqueue(QueuedEntry e) { e.send(webSocket, streamId); } } - - private void onOpen(Event event) { - for (int i = 0; i < sendQueue.size(); i++) { - QueuedEntry queuedEntry = sendQueue.get(i); - queuedEntry.send(webSocket, streamId); - } - sendQueue.clear(); - } - - @Override - public void cancel() { - // TODO remove handlers, and close if we're the last one out - } } From 0c116b3eba3902725a571885bbe6f4bce5d50827 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 11 Jul 2022 12:55:08 -0500 Subject: [PATCH 197/215] Share code with the existing implementation --- .../AbstractWebSocketServerStream.java | 115 +++++++++++++ .../AbstractWebsocketStreamImpl.java | 133 +++++++++++++++ .../websocket/ByteArrayWritableBuffer.java | 42 +++++ .../MultiplexedWebSocketServerStream.java | 96 +---------- .../MultiplexedWebsocketStreamImpl.java | 161 +----------------- .../web/websocket/WebSocketServerStream.java | 96 +---------- .../web/websocket/WebsocketStreamImpl.java | 155 +---------------- 7 files changed, 310 insertions(+), 488 deletions(-) create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebsocketStreamImpl.java create mode 100644 grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/ByteArrayWritableBuffer.java diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java new file mode 100644 index 00000000000..9f70ba2e4d7 --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java @@ -0,0 +1,115 @@ +package io.grpc.servlet.web.websocket; + +import io.grpc.Attributes; +import io.grpc.InternalMetadata; +import io.grpc.Metadata; +import io.grpc.ServerStreamTracer; +import io.grpc.internal.ServerTransportListener; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public abstract class AbstractWebSocketServerStream extends Endpoint { + protected final ServerTransportListener transportListener; + protected final List streamTracerFactories; + protected final int maxInboundMessageSize; + protected final Attributes attributes; + + // assigned on open, always available + protected Session websocketSession; + + protected AbstractWebSocketServerStream(ServerTransportListener transportListener, + List streamTracerFactories, int maxInboundMessageSize, + Attributes attributes) { + this.transportListener = transportListener; + this.streamTracerFactories = streamTracerFactories; + this.maxInboundMessageSize = maxInboundMessageSize; + this.attributes = attributes; + } + + protected static Metadata readHeaders(ByteBuffer headerPayload) { + // Headers are passed as ascii (browsers don't support binary), ":"-separated key/value pairs, separated on + // "\r\n". The client implementation shows that values might be comma-separated, but we'll pass that through + // directly as a plain string. + // + List byteArrays = new ArrayList<>(); + while (headerPayload.hasRemaining()) { + int nameStart = headerPayload.position(); + while (headerPayload.hasRemaining() && headerPayload.get() != ':'); + int nameEnd = headerPayload.position() - 1; + int valueStart = headerPayload.position() + 1;// assumes that the colon is followed by a space + + while (headerPayload.hasRemaining() && headerPayload.get() != '\n'); + int valueEnd = headerPayload.position() - 2;// assumes that \n is preceded by a \r, this isnt generally + // safe? + if (valueEnd < valueStart) { + valueEnd = valueStart; + } + int endOfLinePosition = headerPayload.position(); + + byte[] headerBytes = new byte[nameEnd - nameStart]; + headerPayload.position(nameStart); + headerPayload.get(headerBytes); + + byteArrays.add(headerBytes); + if (Arrays.equals(headerBytes, "content-type".getBytes(StandardCharsets.US_ASCII))) { + // rewrite grpc-web content type to matching grpc content type + byteArrays.add("grpc+proto".getBytes(StandardCharsets.US_ASCII)); + // TODO support other formats like text, non-proto + headerPayload.position(valueEnd); + continue; + } + + // TODO check for binary header suffix + // if (headerBytes.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { + // + // } else { + byte[] valueBytes = new byte[valueEnd - valueStart]; + headerPayload.position(valueStart); + headerPayload.get(valueBytes); + byteArrays.add(valueBytes); + // } + + headerPayload.position(endOfLinePosition); + } + + // add a te:trailers, as gRPC will expect it + byteArrays.add("te".getBytes(StandardCharsets.US_ASCII)); + byteArrays.add("trailers".getBytes(StandardCharsets.US_ASCII)); + + // TODO to support text encoding + + return InternalMetadata.newMetadata(byteArrays.toArray(new byte[][] {})); + } + + @Override + public void onOpen(Session websocketSession, EndpointConfig config) { + this.websocketSession = websocketSession; + + websocketSession.addMessageHandler(String.class, this::onMessage); + websocketSession.addMessageHandler(ByteBuffer.class, message -> { + try { + onMessage(message); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + + // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses + // can override this method to control those defaults on their own. + websocketSession.setMaxIdleTimeout(0); + websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); + } + + public abstract void onMessage(String message); + + public abstract void onMessage(ByteBuffer message) throws IOException; +} diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebsocketStreamImpl.java new file mode 100644 index 00000000000..21f7f0382ee --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebsocketStreamImpl.java @@ -0,0 +1,133 @@ +package io.grpc.servlet.web.websocket; + +import com.google.common.util.concurrent.MoreExecutors; +import io.grpc.Attributes; +import io.grpc.InternalLogId; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.internal.AbstractServerStream; +import io.grpc.internal.ReadableBuffer; +import io.grpc.internal.SerializingExecutor; +import io.grpc.internal.ServerTransportListener; +import io.grpc.internal.StatsTraceContext; +import io.grpc.internal.TransportTracer; +import io.grpc.internal.WritableBufferAllocator; +import jakarta.websocket.Session; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +public abstract class AbstractWebsocketStreamImpl extends AbstractServerStream { + public final class WebsocketTransportState extends TransportState { + + private final SerializingExecutor transportThreadExecutor = + new SerializingExecutor(MoreExecutors.directExecutor()); + private final Logger logger; + + private WebsocketTransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, + TransportTracer transportTracer, Logger logger) { + super(maxMessageSize, statsTraceCtx, transportTracer); + this.logger = logger; + } + + @Override + public void runOnTransportThread(Runnable r) { + transportThreadExecutor.execute(r); + } + + @Override + public void bytesRead(int numBytes) { + // no-op, no flow-control yet + } + + @Override + public void deframeFailed(Throwable cause) { + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, String.format("[{%s}] Exception processing message", logId), cause); + } + cancel(Status.fromThrowable(cause)); + } + } + + protected final TransportState transportState; + protected final Session websocketSession; + protected final InternalLogId logId; + protected final Attributes attributes; + + public AbstractWebsocketStreamImpl(WritableBufferAllocator bufferAllocator, StatsTraceContext statsTraceCtx, + int maxInboundMessageSize, Session websocketSession, InternalLogId logId, Attributes attributes, + Logger logger) { + super(bufferAllocator, statsTraceCtx); + transportState = + new WebsocketTransportState(maxInboundMessageSize, statsTraceCtx, new TransportTracer(), logger); + this.websocketSession = websocketSession; + this.logId = logId; + this.attributes = attributes; + } + + protected static void writeAsciiHeadersToMessage(byte[][] serializedHeaders, ByteBuffer message) { + for (int i = 0; i < serializedHeaders.length; i += 2) { + message.put(serializedHeaders[i]); + message.put((byte) ':'); + message.put((byte) ' '); + message.put(serializedHeaders[i + 1]); + message.put((byte) '\r'); + message.put((byte) '\n'); + } + } + + @Override + public int streamId() { + return -1; + } + + @Override + public Attributes getAttributes() { + return attributes; + } + + public void createStream(ServerTransportListener transportListener, String methodName, Metadata headers) { + transportListener.streamCreated(this, methodName, headers); + transportState().onStreamAllocated(); + } + + public void inboundDataReceived(ReadableBuffer message, boolean endOfStream) { + transportState().inboundDataReceived(message, endOfStream); + } + + public void transportReportStatus(Status status) { + transportState().transportReportStatus(status); + } + + @Override + public TransportState transportState() { + return transportState; + } + + protected void cancelSink(Status status) { + if (!websocketSession.isOpen() && Status.Code.DEADLINE_EXCEEDED == status.getCode()) { + return; + } + transportState.runOnTransportThread(() -> transportState.transportReportStatus(status)); + // There is no way to RST_STREAM with CANCEL code, so write trailers instead + close(Status.CANCELLED.withCause(status.asRuntimeException()), new Metadata()); + CountDownLatch countDownLatch = new CountDownLatch(1); + transportState.runOnTransportThread(() -> { + try { + websocketSession.close(); + } catch (IOException ioException) { + // already closing, ignore + } + countDownLatch.countDown(); + }); + try { + countDownLatch.await(5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } +} diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/ByteArrayWritableBuffer.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/ByteArrayWritableBuffer.java new file mode 100644 index 00000000000..0cbd851f8a9 --- /dev/null +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/ByteArrayWritableBuffer.java @@ -0,0 +1,42 @@ +package io.grpc.servlet.web.websocket; + +import io.grpc.internal.WritableBuffer; + +import static java.lang.Math.max; +import static java.lang.Math.min; + +final class ByteArrayWritableBuffer implements WritableBuffer { + + private final int capacity; + final byte[] bytes; + private int index; + + ByteArrayWritableBuffer(int capacityHint) { + this.bytes = new byte[min(1024 * 1024, max(4096, capacityHint))]; + this.capacity = bytes.length; + } + + @Override + public void write(byte[] src, int srcIndex, int length) { + System.arraycopy(src, srcIndex, bytes, index, length); + index += length; + } + + @Override + public void write(byte b) { + bytes[index++] = b; + } + + @Override + public int writableBytes() { + return capacity - index; + } + + @Override + public int readableBytes() { + return index; + } + + @Override + public void release() {} +} diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index 6cf71eeb8c0..75f5ec1fc35 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -5,7 +5,6 @@ import io.grpc.Attributes; import io.grpc.InternalLogId; -import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.ServerStreamTracer; import io.grpc.Status; @@ -13,17 +12,11 @@ import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import jakarta.websocket.CloseReason; -import jakarta.websocket.Endpoint; -import jakarta.websocket.EndpointConfig; import jakarta.websocket.Session; import java.io.IOException; -import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -43,21 +36,13 @@ * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ -public class MultiplexedWebSocketServerStream extends Endpoint { +public class MultiplexedWebSocketServerStream extends AbstractWebSocketServerStream { private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); - private final ServerTransportListener transportListener; - private final List streamTracerFactories; - private final int maxInboundMessageSize; - private final Attributes attributes; - private final InternalLogId logId = InternalLogId.allocate(MultiplexedWebSocketServerStream.class, null); - // assigned on open, always available - private Session websocketSession; - // fields set after headers are decoded. No need to be threadsafe, this will only be accessed from the transport // thread. private final Map streams = new HashMap<>(); @@ -66,31 +51,10 @@ public class MultiplexedWebSocketServerStream extends Endpoint { public MultiplexedWebSocketServerStream(ServerTransportListener transportListener, List streamTracerFactories, int maxInboundMessageSize, Attributes attributes) { - this.transportListener = transportListener; - this.streamTracerFactories = streamTracerFactories; - this.maxInboundMessageSize = maxInboundMessageSize; - this.attributes = attributes; + super(transportListener, streamTracerFactories, maxInboundMessageSize, attributes); } @Override - public void onOpen(Session websocketSession, EndpointConfig config) { - this.websocketSession = websocketSession; - - websocketSession.addMessageHandler(String.class, this::onMessage); - websocketSession.addMessageHandler(ByteBuffer.class, message -> { - try { - onMessage(message); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }); - - // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses - // can override this method to control those defaults on their own. - websocketSession.setMaxIdleTimeout(0); - websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); - } - public void onMessage(String message) { for (MultiplexedWebsocketStreamImpl stream : streams.values()) { // This means the stream opened correctly, then sent a text payload, which doesn't make sense. @@ -106,6 +70,7 @@ public void onMessage(String message) { } } + @Override public void onMessage(ByteBuffer message) throws IOException { // Each message starts with an int, to indicate stream id. If that int is negative, the other end has performed // a half close (and this is the final message). @@ -198,59 +163,4 @@ private void processHeaders(ByteBuffer headerPayload, int streamId) { stream.createStream(transportListener, path, headers); streams.put(streamId, stream); } - - private static Metadata readHeaders(ByteBuffer headerPayload) { - // Headers are passed as ascii (browsers don't support binary), ":"-separated key/value pairs, separated on - // "\r\n". The client implementation shows that values might be comma-separated, but we'll pass that through - // directly as a plain string. - // - List byteArrays = new ArrayList<>(); - while (headerPayload.hasRemaining()) { - int nameStart = headerPayload.position(); - while (headerPayload.hasRemaining() && headerPayload.get() != ':'); - int nameEnd = headerPayload.position() - 1; - int valueStart = headerPayload.position() + 1;// assumes that the colon is followed by a space - - while (headerPayload.hasRemaining() && headerPayload.get() != '\n'); - int valueEnd = headerPayload.position() - 2;// assumes that \n is preceded by a \r, this isnt generally - // safe? - if (valueEnd < valueStart) { - valueEnd = valueStart; - } - int endOfLinePosition = headerPayload.position(); - - byte[] headerBytes = new byte[nameEnd - nameStart]; - headerPayload.position(nameStart); - headerPayload.get(headerBytes); - - byteArrays.add(headerBytes); - if (Arrays.equals(headerBytes, "content-type".getBytes(StandardCharsets.US_ASCII))) { - // rewrite grpc-web content type to matching grpc content type - byteArrays.add("grpc+proto".getBytes(StandardCharsets.US_ASCII)); - // TODO support other formats like text, non-proto - headerPayload.position(valueEnd); - continue; - } - - // TODO check for binary header suffix - // if (headerBytes.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { - // - // } else { - byte[] valueBytes = new byte[valueEnd - valueStart]; - headerPayload.position(valueStart); - headerPayload.get(valueBytes); - byteArrays.add(valueBytes); - // } - - headerPayload.position(endOfLinePosition); - } - - // add a te:trailers, as gRPC will expect it - byteArrays.add("te".getBytes(StandardCharsets.US_ASCII)); - byteArrays.add("trailers".getBytes(StandardCharsets.US_ASCII)); - - // TODO to support text encoding - - return InternalMetadata.newMetadata(byteArrays.toArray(new byte[][] {})); - } } diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index 0b0b4b2697a..dfb4a292640 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -3,152 +3,44 @@ */ package io.grpc.servlet.web.websocket; -import com.google.common.util.concurrent.MoreExecutors; import io.grpc.Attributes; import io.grpc.InternalLogId; import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.AbstractServerStream; -import io.grpc.internal.ReadableBuffer; -import io.grpc.internal.SerializingExecutor; -import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; -import io.grpc.internal.TransportTracer; import io.grpc.internal.WritableBuffer; import jakarta.websocket.Session; import javax.annotation.Nullable; import java.io.IOException; -import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.Arrays; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import static java.lang.Math.max; -import static java.lang.Math.min; - -public class MultiplexedWebsocketStreamImpl extends AbstractServerStream { +public class MultiplexedWebsocketStreamImpl extends AbstractWebsocketStreamImpl { private static final Logger logger = Logger.getLogger(MultiplexedWebsocketStreamImpl.class.getName()); - public final class WebsocketTransportState extends TransportState { - - private final SerializingExecutor transportThreadExecutor = - new SerializingExecutor(MoreExecutors.directExecutor()); - - protected WebsocketTransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, - TransportTracer transportTracer) { - super(maxMessageSize, statsTraceCtx, transportTracer); - } - - @Override - public void runOnTransportThread(Runnable r) { - transportThreadExecutor.execute(r); - } - - @Override - public void bytesRead(int numBytes) { - // no-op, no flow-control yet - } - - @Override - public void deframeFailed(Throwable cause) { - if (logger.isLoggable(Level.FINE)) { - logger.log(Level.FINE, String.format("[{%s}] Exception processing message", logId), cause); - } - cancel(Status.fromThrowable(cause)); - } - } - private static final class ByteArrayWritableBuffer implements WritableBuffer { - - private final int capacity; - final byte[] bytes; - private int index; - - ByteArrayWritableBuffer(int capacityHint) { - this.bytes = new byte[min(1024 * 1024, max(4096, capacityHint))]; - this.capacity = bytes.length; - } - - @Override - public void write(byte[] src, int srcIndex, int length) { - System.arraycopy(src, srcIndex, bytes, index, length); - index += length; - } - - @Override - public void write(byte b) { - bytes[index++] = b; - } - - @Override - public int writableBytes() { - return capacity - index; - } - - @Override - public int readableBytes() { - return index; - } - - @Override - public void release() {} - } - - private final WebsocketTransportState transportState; private final Sink sink = new Sink(); - private final Session websocketSession; - private final InternalLogId logId; - private final Attributes attributes; + + // Note that this isn't a "true" stream id in the h2 or grpc sense private final int streamId; public MultiplexedWebsocketStreamImpl(StatsTraceContext statsTraceCtx, int maxInboundMessageSize, Session websocketSession, InternalLogId logId, Attributes attributes, int streamId) { - super(ByteArrayWritableBuffer::new, statsTraceCtx); - this.websocketSession = websocketSession; - this.logId = logId; - this.attributes = attributes; + super(ByteArrayWritableBuffer::new, statsTraceCtx, maxInboundMessageSize, websocketSession, logId, attributes, + logger); this.streamId = streamId; - transportState = new WebsocketTransportState(maxInboundMessageSize, statsTraceCtx, new TransportTracer()); - } - - @Override - public Attributes getAttributes() { - return attributes; - } - - public void createStream(ServerTransportListener transportListener, String methodName, Metadata headers) { - transportListener.streamCreated(this, methodName, headers); - transportState().onStreamAllocated(); - } - - public void inboundDataReceived(ReadableBuffer message, boolean endOfStream) { - transportState().inboundDataReceived(message, endOfStream); - } - - public void transportReportStatus(Status status) { - transportState().transportReportStatus(status); } @Override - public TransportState transportState() { - return transportState; - } - - @Override - protected Sink abstractServerStreamSink() { + protected AbstractServerStream.Sink abstractServerStreamSink() { return sink; } - @Override - public int streamId() { - return -1; - } - private final class Sink implements AbstractServerStream.Sink { @Override @@ -165,14 +57,7 @@ public void writeHeaders(Metadata headers) { message.putInt(streamId); message.put((byte) 0x80); message.putInt(headerLength); - for (int i = 0; i < serializedHeaders.length; i += 2) { - message.put(serializedHeaders[i]); - message.put((byte) ':'); - message.put((byte) ' '); - message.put(serializedHeaders[i + 1]); - message.put((byte) '\r'); - message.put((byte) '\n'); - } + writeAsciiHeadersToMessage(serializedHeaders, message); message.flip(); try { websocketSession.getBasicRemote().sendBinary(message); @@ -238,17 +123,9 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) message.putInt(streamId ^ (1 << 31)); message.put((byte) 0x80); message.putInt(trailerLength); - for (int i = 0; i < serializedTrailers.length; i += 2) { - message.put(serializedTrailers[i]); - message.put((byte) ':'); - message.put((byte) ' '); - message.put(serializedTrailers[i + 1]); - message.put((byte) '\r'); - message.put((byte) '\n'); - } + writeAsciiHeadersToMessage(serializedTrailers, message); message.flip(); try { - // send in two separate messages websocketSession.getBasicRemote().sendBinary(message); // websocketSession.close();//don't close this, leave it up to the client, or use a timeout @@ -262,27 +139,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) @Override public void cancel(Status status) { - if (!websocketSession.isOpen() && Status.Code.DEADLINE_EXCEEDED == status.getCode()) { - return; // let the servlet timeout, the container will sent RST_STREAM automatically - } - transportState.runOnTransportThread(() -> transportState.transportReportStatus(status)); - // There is no way to RST_STREAM with CANCEL code, so write trailers instead - close(Status.CANCELLED.withCause(status.asRuntimeException()), new Metadata()); - CountDownLatch countDownLatch = new CountDownLatch(1); - transportState.runOnTransportThread(() -> { - try { - websocketSession.close(); - } catch (IOException ioException) { - // already closing, ignore - } - countDownLatch.countDown(); - }); - try { - countDownLatch.await(5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + cancelSink(status); } } - } diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java index c5c6c09e641..7f226a13923 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java @@ -2,7 +2,6 @@ import io.grpc.Attributes; import io.grpc.InternalLogId; -import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.ServerStreamTracer; import io.grpc.Status; @@ -10,17 +9,11 @@ import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import jakarta.websocket.CloseReason; -import jakarta.websocket.Endpoint; -import jakarta.websocket.EndpointConfig; import jakarta.websocket.Session; import java.io.IOException; -import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -33,19 +26,11 @@ * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ -public class WebSocketServerStream extends Endpoint { +public class WebSocketServerStream extends AbstractWebSocketServerStream { private static final Logger logger = Logger.getLogger(WebSocketServerStream.class.getName()); - private final ServerTransportListener transportListener; - private final List streamTracerFactories; - private final int maxInboundMessageSize; - private final Attributes attributes; - private final InternalLogId logId = InternalLogId.allocate(WebSocketServerStream.class, null); - // assigned on open, always available - private Session websocketSession; - // fields set after headers are decoded private WebsocketStreamImpl stream; private boolean headersProcessed = false; @@ -54,29 +39,7 @@ public class WebSocketServerStream extends Endpoint { public WebSocketServerStream(ServerTransportListener transportListener, List streamTracerFactories, int maxInboundMessageSize, Attributes attributes) { - this.transportListener = transportListener; - this.streamTracerFactories = streamTracerFactories; - this.maxInboundMessageSize = maxInboundMessageSize; - this.attributes = attributes; - } - - @Override - public void onOpen(Session websocketSession, EndpointConfig config) { - this.websocketSession = websocketSession; - - websocketSession.addMessageHandler(String.class, this::onMessage); - websocketSession.addMessageHandler(ByteBuffer.class, message -> { - try { - onMessage(message); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }); - - // Configure defaults present in some servlet containers to avoid some confusing limits. Subclasses - // can override this method to control those defaults on their own. - websocketSession.setMaxIdleTimeout(0); - websocketSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE); + super(transportListener, streamTracerFactories, maxInboundMessageSize, attributes); } public void onMessage(String message) { @@ -164,59 +127,4 @@ private void processHeaders(ByteBuffer headerPayload) { attributes); stream.createStream(transportListener, methodName(), headers); } - - private static Metadata readHeaders(ByteBuffer headerPayload) { - // Headers are passed as ascii (browsers don't support binary), ":"-separated key/value pairs, separated on - // "\r\n". The client implementation shows that values might be comma-separated, but we'll pass that through - // directly as a plain string. - // - List byteArrays = new ArrayList<>(); - while (headerPayload.hasRemaining()) { - int nameStart = headerPayload.position(); - while (headerPayload.hasRemaining() && headerPayload.get() != ':'); - int nameEnd = headerPayload.position() - 1; - int valueStart = headerPayload.position() + 1;// assumes that the colon is followed by a space - - while (headerPayload.hasRemaining() && headerPayload.get() != '\n'); - int valueEnd = headerPayload.position() - 2;// assumes that \n is preceded by a \r, this isnt generally - // safe? - if (valueEnd < valueStart) { - valueEnd = valueStart; - } - int endOfLinePosition = headerPayload.position(); - - byte[] headerBytes = new byte[nameEnd - nameStart]; - headerPayload.position(nameStart); - headerPayload.get(headerBytes); - - byteArrays.add(headerBytes); - if (Arrays.equals(headerBytes, "content-type".getBytes(StandardCharsets.US_ASCII))) { - // rewrite grpc-web content type to matching grpc content type - byteArrays.add("grpc+proto".getBytes(StandardCharsets.US_ASCII)); - // TODO support other formats like text, non-proto - headerPayload.position(valueEnd); - continue; - } - - // TODO check for binary header suffix - // if (headerBytes.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { - // - // } else { - byte[] valueBytes = new byte[valueEnd - valueStart]; - headerPayload.position(valueStart); - headerPayload.get(valueBytes); - byteArrays.add(valueBytes); - // } - - headerPayload.position(endOfLinePosition); - } - - // add a te:trailers, as gRPC will expect it - byteArrays.add("te".getBytes(StandardCharsets.US_ASCII)); - byteArrays.add("trailers".getBytes(StandardCharsets.US_ASCII)); - - // TODO to support text encoding - - return InternalMetadata.newMetadata(byteArrays.toArray(new byte[][] {})); - } } diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java index 2d492f34757..b9e9ed4164a 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java @@ -1,18 +1,13 @@ package io.grpc.servlet.web.websocket; -import com.google.common.util.concurrent.MoreExecutors; import io.grpc.Attributes; import io.grpc.InternalLogId; import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.AbstractServerStream; -import io.grpc.internal.ReadableBuffer; -import io.grpc.internal.SerializingExecutor; -import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import io.grpc.internal.TransportFrameUtil; -import io.grpc.internal.TransportTracer; import io.grpc.internal.WritableBuffer; import jakarta.websocket.Session; @@ -20,117 +15,18 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import static java.lang.Math.max; -import static java.lang.Math.min; - -public class WebsocketStreamImpl extends AbstractServerStream { +public class WebsocketStreamImpl extends AbstractWebsocketStreamImpl { private static final Logger logger = Logger.getLogger(WebsocketStreamImpl.class.getName()); - public final class WebsocketTransportState extends TransportState { - - private final SerializingExecutor transportThreadExecutor = - new SerializingExecutor(MoreExecutors.directExecutor()); - - protected WebsocketTransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, - TransportTracer transportTracer) { - super(maxMessageSize, statsTraceCtx, transportTracer); - } - - @Override - public void runOnTransportThread(Runnable r) { - transportThreadExecutor.execute(r); - } - - @Override - public void bytesRead(int numBytes) { - // no-op, no flow-control yet - } - - @Override - public void deframeFailed(Throwable cause) { - if (logger.isLoggable(Level.FINE)) { - logger.log(Level.FINE, String.format("[{%s}] Exception processing message", logId), cause); - } - cancel(Status.fromThrowable(cause)); - } - } - private static final class ByteArrayWritableBuffer implements WritableBuffer { - - private final int capacity; - final byte[] bytes; - private int index; - - ByteArrayWritableBuffer(int capacityHint) { - this.bytes = new byte[min(1024 * 1024, max(4096, capacityHint))]; - this.capacity = bytes.length; - } - - @Override - public void write(byte[] src, int srcIndex, int length) { - System.arraycopy(src, srcIndex, bytes, index, length); - index += length; - } - - @Override - public void write(byte b) { - bytes[index++] = b; - } - - @Override - public int writableBytes() { - return capacity - index; - } - - @Override - public int readableBytes() { - return index; - } - - @Override - public void release() {} - } - - private final WebsocketTransportState transportState; private final Sink sink = new Sink(); - private final Session websocketSession; - private final InternalLogId logId; - private final Attributes attributes; public WebsocketStreamImpl(StatsTraceContext statsTraceCtx, int maxInboundMessageSize, Session websocketSession, InternalLogId logId, Attributes attributes) { - super(ByteArrayWritableBuffer::new, statsTraceCtx); - this.websocketSession = websocketSession; - this.logId = logId; - this.attributes = attributes; - transportState = new WebsocketTransportState(maxInboundMessageSize, statsTraceCtx, new TransportTracer()); - } - - @Override - public Attributes getAttributes() { - return attributes; - } - - public void createStream(ServerTransportListener transportListener, String methodName, Metadata headers) { - transportListener.streamCreated(this, methodName, headers); - transportState().onStreamAllocated(); - } - - public void inboundDataReceived(ReadableBuffer message, boolean endOfStream) { - transportState().inboundDataReceived(message, endOfStream); - } - - public void transportReportStatus(Status status) { - transportState().transportReportStatus(status); - } - - @Override - public TransportState transportState() { - return transportState; + super(ByteArrayWritableBuffer::new, statsTraceCtx, maxInboundMessageSize, websocketSession, logId, attributes, + logger); } @Override @@ -138,11 +34,6 @@ protected Sink abstractServerStreamSink() { return sink; } - @Override - public int streamId() { - return -1; - } - private final class Sink implements AbstractServerStream.Sink { @Override @@ -160,14 +51,7 @@ public void writeHeaders(Metadata headers) { prefix.putInt(headerLength); prefix.flip(); ByteBuffer message = ByteBuffer.allocate(headerLength); - for (int i = 0; i < serializedHeaders.length; i += 2) { - message.put(serializedHeaders[i]); - message.put((byte) ':'); - message.put((byte) ' '); - message.put(serializedHeaders[i + 1]); - message.put((byte) '\r'); - message.put((byte) '\n'); - } + writeAsciiHeadersToMessage(serializedHeaders, message); message.flip(); try { // send in two separate payloads @@ -233,14 +117,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) prefix.putInt(trailerLength); prefix.flip(); ByteBuffer message = ByteBuffer.allocate(trailerLength); - for (int i = 0; i < serializedTrailers.length; i += 2) { - message.put(serializedTrailers[i]); - message.put((byte) ':'); - message.put((byte) ' '); - message.put(serializedTrailers[i + 1]); - message.put((byte) '\r'); - message.put((byte) '\n'); - } + writeAsciiHeadersToMessage(serializedTrailers, message); message.flip(); try { // send in two separate messages @@ -258,27 +135,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) @Override public void cancel(Status status) { - if (!websocketSession.isOpen() && Status.Code.DEADLINE_EXCEEDED == status.getCode()) { - return; // let the servlet timeout, the container will sent RST_STREAM automatically - } - transportState.runOnTransportThread(() -> transportState.transportReportStatus(status)); - // There is no way to RST_STREAM with CANCEL code, so write trailers instead - close(Status.CANCELLED.withCause(status.asRuntimeException()), new Metadata()); - CountDownLatch countDownLatch = new CountDownLatch(1); - transportState.runOnTransportThread(() -> { - try { - websocketSession.close(); - } catch (IOException ioException) { - // already closing, ignore - } - countDownLatch.countDown(); - }); - try { - countDownLatch.await(5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + cancelSink(status); } } - } From 5db55abbc20c45a19be3a4b07c92b13e18b8c20c Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 11 Jul 2022 13:05:29 -0500 Subject: [PATCH 198/215] Clarify docs --- .../websocket/MultiplexedWebsocketStreamImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index dfb4a292640..388ad75e130 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -25,12 +25,11 @@ public class MultiplexedWebsocketStreamImpl extends AbstractWebsocketStreamImpl private final Sink sink = new Sink(); - // Note that this isn't a "true" stream id in the h2 or grpc sense + // Note that this isn't a "true" stream id in the h2 or grpc sense, this shouldn't be returned via streamId() private final int streamId; public MultiplexedWebsocketStreamImpl(StatsTraceContext statsTraceCtx, int maxInboundMessageSize, - Session websocketSession, - InternalLogId logId, Attributes attributes, int streamId) { + Session websocketSession, InternalLogId logId, Attributes attributes, int streamId) { super(ByteArrayWritableBuffer::new, statsTraceCtx, maxInboundMessageSize, websocketSession, logId, attributes, logger); this.streamId = streamId; @@ -50,8 +49,8 @@ public void writeHeaders(Metadata headers) { // message byte[][] serializedHeaders = InternalMetadata.serialize(headers); - // Total up the size of the payload: 5 bytes for the prefix, and each header needs a colon delimiter, and to - // end with \r\n + // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the prefix, and each + // header needs a colon delimiter, and to end with \r\n int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); ByteBuffer message = ByteBuffer.allocate(headerLength + 9 + 4); message.putInt(streamId); @@ -115,8 +114,8 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the size in a 4 byte int byte[][] serializedTrailers = InternalMetadata.serialize(trailers); - // Total up the size of the payload: 5 bytes for the prefix, and each trailer needs a colon+space delimiter, - // and to end with \r\n + // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the grpc payload prefix, + // and each trailer needs a colon+space delimiter, and to end with \r\n int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); ByteBuffer message = ByteBuffer.allocate(9 + trailerLength); From a6e850b65eaa25bc883a33e625e9a8de6c42316f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 6 Oct 2022 14:05:05 -0500 Subject: [PATCH 199/215] Correct metadata serialization --- .../web/websocket/MultiplexedWebsocketStreamImpl.java | 6 +++--- .../io/grpc/servlet/web/websocket/WebsocketStreamImpl.java | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index 388ad75e130..d4e0ea7c530 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -5,11 +5,11 @@ import io.grpc.Attributes; import io.grpc.InternalLogId; -import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.AbstractServerStream; import io.grpc.internal.StatsTraceContext; +import io.grpc.internal.TransportFrameUtil; import io.grpc.internal.WritableBuffer; import jakarta.websocket.Session; @@ -48,7 +48,7 @@ public void writeHeaders(Metadata headers) { // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the length of the // message - byte[][] serializedHeaders = InternalMetadata.serialize(headers); + byte[][] serializedHeaders = TransportFrameUtil.toHttp2Headers(headers); // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the prefix, and each // header needs a colon delimiter, and to end with \r\n int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); @@ -113,7 +113,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) // Trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the size in a 4 byte int - byte[][] serializedTrailers = InternalMetadata.serialize(trailers); + byte[][] serializedTrailers = TransportFrameUtil.toHttp2Headers(trailers); // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the grpc payload prefix, // and each trailer needs a colon+space delimiter, and to end with \r\n int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java index b9e9ed4164a..31dfd4497e1 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebsocketStreamImpl.java @@ -2,7 +2,6 @@ import io.grpc.Attributes; import io.grpc.InternalLogId; -import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.AbstractServerStream; @@ -42,7 +41,7 @@ public void writeHeaders(Metadata headers) { // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the length of the // message - byte[][] serializedHeaders = InternalMetadata.serialize(headers); + byte[][] serializedHeaders = TransportFrameUtil.toHttp2Headers(headers); // Total up the size of the payload: 5 bytes for the prefix, and each header needs a colon delimiter, and to // end with \r\n int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); From e0b2f6e5c6cc0f86dc89da29391c1b5f1068bd04 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 7 Oct 2022 11:46:13 -0500 Subject: [PATCH 200/215] Add comments and dedup, plus handle binary headers --- .../AbstractWebSocketServerStream.java | 37 +++++++++++----- .../MultiplexedWebSocketServerStream.java | 5 ++- .../MultiplexedWebsocketStreamImpl.java | 44 ++++++++----------- 3 files changed, 47 insertions(+), 39 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java index 9f70ba2e4d7..f2b0597233f 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/AbstractWebSocketServerStream.java @@ -1,5 +1,6 @@ package io.grpc.servlet.web.websocket; +import com.google.common.io.BaseEncoding; import io.grpc.Attributes; import io.grpc.InternalMetadata; import io.grpc.Metadata; @@ -18,6 +19,8 @@ import java.util.List; public abstract class AbstractWebSocketServerStream extends Endpoint { + private static final byte[] BINARY_HEADER_SUFFIX_ARR = + Metadata.BINARY_HEADER_SUFFIX.getBytes(StandardCharsets.US_ASCII); protected final ServerTransportListener transportListener; protected final List streamTracerFactories; protected final int maxInboundMessageSize; @@ -36,10 +39,9 @@ protected AbstractWebSocketServerStream(ServerTransportListener transportListene } protected static Metadata readHeaders(ByteBuffer headerPayload) { - // Headers are passed as ascii (browsers don't support binary), ":"-separated key/value pairs, separated on - // "\r\n". The client implementation shows that values might be comma-separated, but we'll pass that through - // directly as a plain string. - // + // Headers are passed as ascii, ":"-separated key/value pairs, separated on "\r\n". The client + // implementation shows that values might be comma-separated, but we'll pass that through directly as a plain + // string. List byteArrays = new ArrayList<>(); while (headerPayload.hasRemaining()) { int nameStart = headerPayload.position(); @@ -61,22 +63,21 @@ protected static Metadata readHeaders(ByteBuffer headerPayload) { byteArrays.add(headerBytes); if (Arrays.equals(headerBytes, "content-type".getBytes(StandardCharsets.US_ASCII))) { - // rewrite grpc-web content type to matching grpc content type + // rewrite grpc-web content type to matching grpc content type, regardless of what it said byteArrays.add("grpc+proto".getBytes(StandardCharsets.US_ASCII)); // TODO support other formats like text, non-proto headerPayload.position(valueEnd); continue; } - // TODO check for binary header suffix - // if (headerBytes.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { - // - // } else { byte[] valueBytes = new byte[valueEnd - valueStart]; headerPayload.position(valueStart); headerPayload.get(valueBytes); - byteArrays.add(valueBytes); - // } + if (endsWithBinHeaderSuffix(headerBytes)) { + byteArrays.add(BaseEncoding.base64().decode(ByteBuffer.wrap(valueBytes).asCharBuffer())); + } else { + byteArrays.add(valueBytes); + } headerPayload.position(endOfLinePosition); } @@ -90,6 +91,20 @@ protected static Metadata readHeaders(ByteBuffer headerPayload) { return InternalMetadata.newMetadata(byteArrays.toArray(new byte[][] {})); } + private static boolean endsWithBinHeaderSuffix(byte[] headerBytes) { + // This is intended to be equiv to + // header.endsWith(Metadata.BINARY_HEADER_SUFFIX), without actually making a string for it + if (headerBytes.length < BINARY_HEADER_SUFFIX_ARR.length) { + return false; + } + for (int i = 0; i < BINARY_HEADER_SUFFIX_ARR.length; i++) { + if (headerBytes[headerBytes.length - 3 + i] != BINARY_HEADER_SUFFIX_ARR[i]) { + return false; + } + } + return true; + } + @Override public void onOpen(Session websocketSession, EndpointConfig config) { this.websocketSession = websocketSession; diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index 75f5ec1fc35..21350ba8cd4 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -38,13 +38,13 @@ */ public class MultiplexedWebSocketServerStream extends AbstractWebSocketServerStream { private static final Logger logger = Logger.getLogger(MultiplexedWebSocketServerStream.class.getName()); + /** Custom metadata to hold the path requested by the incoming stream */ public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); private final InternalLogId logId = InternalLogId.allocate(MultiplexedWebSocketServerStream.class, null); - // fields set after headers are decoded. No need to be threadsafe, this will only be accessed from the transport - // thread. + // No need to be thread-safe, this will only be accessed from the transport thread. private final Map streams = new HashMap<>(); private final boolean isTextRequest = false;// not supported yet @@ -78,6 +78,7 @@ public void onMessage(ByteBuffer message) throws IOException { final boolean closed; if (streamId < 0) { closed = true; + // unset the msb, extract the actual streamid streamId = streamId ^ (1 << 31); } else { closed = false; diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index d4e0ea7c530..4fcb0e7b663 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -44,19 +44,31 @@ private final class Sink implements AbstractServerStream.Sink { @Override public void writeHeaders(Metadata headers) { - // headers/trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The - // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the length of the - // message + writeMetadataToStream(headers, false); + } + /** + * Usual multiplexing framing applies - before writing metadata, we write the 32-bit int streamId, with the top + * bit to represent if this stream (over the shared transport) should be closed or not. + *

    + *

    + * Headers/trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The trailer + * response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the length of the message. + */ + private void writeMetadataToStream(Metadata headers, boolean closeBitSet) { byte[][] serializedHeaders = TransportFrameUtil.toHttp2Headers(headers); // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the prefix, and each // header needs a colon delimiter, and to end with \r\n int headerLength = Arrays.stream(serializedHeaders).mapToInt(arr -> arr.length + 2).sum(); - ByteBuffer message = ByteBuffer.allocate(headerLength + 9 + 4); - message.putInt(streamId); + ByteBuffer message = ByteBuffer.allocate(headerLength + 9); + // If this is the final write, set the highest bit on the streamid + message.putInt(closeBitSet ? streamId ^ (1 << 31) : streamId); message.put((byte) 0x80); message.putInt(headerLength); writeAsciiHeadersToMessage(serializedHeaders, message); + if (message.hasRemaining()) { + throw new IllegalStateException("Incorrectly sized buffer, header/trailer payload will be sized wrong"); + } message.flip(); try { websocketSession.getBasicRemote().sendBinary(message); @@ -110,27 +122,7 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) new Object[] {logId, trailers, headersSent, status}); } - // Trailers are always sent as asci, colon-delimited pairs, with \r\n separating them. The - // trailer response must be prefixed with 0x80 (0r 0x81 if compressed), followed by the size in a 4 byte int - - byte[][] serializedTrailers = TransportFrameUtil.toHttp2Headers(trailers); - // Total up the size of the payload: 4 bytes for multiplexing framing, 5 bytes for the grpc payload prefix, - // and each trailer needs a colon+space delimiter, and to end with \r\n - int trailerLength = Arrays.stream(serializedTrailers).mapToInt(arr -> arr.length + 2).sum(); - - ByteBuffer message = ByteBuffer.allocate(9 + trailerLength); - message.putInt(streamId ^ (1 << 31)); - message.put((byte) 0x80); - message.putInt(trailerLength); - writeAsciiHeadersToMessage(serializedTrailers, message); - message.flip(); - try { - websocketSession.getBasicRemote().sendBinary(message); - - // websocketSession.close();//don't close this, leave it up to the client, or use a timeout - } catch (IOException e) { - throw Status.fromThrowable(e).asRuntimeException(); - } + writeMetadataToStream(trailers, true); transportState().runOnTransportThread(() -> { transportState().complete(); }); From 3839108fb1277f9d21df883ada03f654a6a9d5f1 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 7 Oct 2022 12:59:07 -0400 Subject: [PATCH 201/215] Update web code studio to v0.19.1 (#2973) - Needed to split up web versions, as we don't always publish 3 different packages with each version bump --- web/client-ui/Dockerfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 3430afa0200..db69d6fc4b4 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -1,7 +1,10 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_VERSION=0.19.0 +# Most of the time, these versions are the same, except in cases where a patch only affects one of the packages +ARG WEB_VERSION=0.19.1 +ARG GRID_VERSION=0.19.0 +ARG CHART_VERSION=0.19.0 # Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ @@ -13,18 +16,18 @@ RUN set -eux; \ # Pull in the published embed-grid package from npmjs and extract is RUN set -eux; \ - npm pack @deephaven/embed-grid@${WEB_VERSION}; \ - tar --touch -xf deephaven-embed-grid-${WEB_VERSION}.tgz; \ + npm pack @deephaven/embed-grid@${GRID_VERSION}; \ + tar --touch -xf deephaven-embed-grid-${GRID_VERSION}.tgz; \ mkdir -p iframe; \ mv package/build iframe/table; \ rm -r package; \ - rm deephaven-embed-grid-${WEB_VERSION}.tgz; + rm deephaven-embed-grid-${GRID_VERSION}.tgz; # Pull in the published embed-chart package from npmjs and extract is RUN set -eux; \ - npm pack @deephaven/embed-chart@${WEB_VERSION}; \ - tar --touch -xf deephaven-embed-chart-${WEB_VERSION}.tgz; \ + npm pack @deephaven/embed-chart@${CHART_VERSION}; \ + tar --touch -xf deephaven-embed-chart-${CHART_VERSION}.tgz; \ mkdir -p iframe; \ mv package/build iframe/chart; \ rm -r package; \ - rm deephaven-embed-chart-${WEB_VERSION}.tgz; + rm deephaven-embed-chart-${CHART_VERSION}.tgz; From 275cc5fbfd822e457cea88882a9b616091fe34f5 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 7 Oct 2022 11:16:37 -0700 Subject: [PATCH 202/215] Update slf4j and logback dependencies (#2969) --- buildSrc/src/main/groovy/Classpaths.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 33d804ead0f..0d77d7096fb 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -50,7 +50,7 @@ class Classpaths { static final String ARROW_VERSION = '7.0.0' static final String SLF4J_GROUP = 'org.slf4j' - static final String SLF4J_VERSION = '2.0.0' + static final String SLF4J_VERSION = '2.0.3' static final String FLATBUFFER_GROUP = 'com.google.flatbuffers' static final String FLATBUFFER_NAME = 'flatbuffers-java' @@ -89,7 +89,7 @@ class Classpaths { static final String LOGBACK_GROUP = 'ch.qos.logback' static final String LOGBACK_NAME = 'logback-classic' - static final String LOGBACK_VERSION = '1.4.0' + static final String LOGBACK_VERSION = '1.4.3' static final String GROOVY_GROUP = 'org.codehaus.groovy' static final String GROOVY_VERSION = '3.0.12' From ae73171a7686fcf0deac685abe8b6d0fa319852c Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Fri, 7 Oct 2022 14:52:51 -0400 Subject: [PATCH 203/215] Parse date times correctly when importing CSV (#2824) - Wasn't taking into account subsecond patterns and time zones - Copied logic over from CsvTypeParser in Enterprise - Added additional short code time zones to match what is on Enterprise - Optimize by only changing the pattern if the existing pattern fails to parse - Fixes #2814 --- .../web/client/api/i18n/JsTimeZone.java | 10 +++ .../web/client/api/parse/JsDataHandler.java | 71 ++++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/i18n/JsTimeZone.java b/web/client-api/src/main/java/io/deephaven/web/client/api/i18n/JsTimeZone.java index fb62157dcb3..070390dcf39 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/i18n/JsTimeZone.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/i18n/JsTimeZone.java @@ -502,6 +502,16 @@ private static void initTimeZones() { addMapping("MOS", "Europe/Moscow"); addMapping("SHG", "Asia/Shanghai"); + // Add short time codes from Deephaven Enterprise + addMapping("NY", "America/New_York"); + addMapping("MTL", "America/Toronto"); + addMapping("MEX", "America/Mexico_City"); + addMapping("SKM", "Europe/Stockholm"); + addMapping("OSL", "Europe/Oslo"); + addMapping("MAD", "Europe/Madrid"); + addMapping("JNB", "Africa/Johannesburg"); + addMapping("KL", "Asia/Kuala_Lumpur"); + // Add GMT mappings TimeZone gmtTimeZone = TimeZone.createTimeZone(0); addMapping("UTC", gmtTimeZone); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/parse/JsDataHandler.java b/web/client-api/src/main/java/io/deephaven/web/client/api/parse/JsDataHandler.java index 5edf8248239..1e5abc5bc00 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/parse/JsDataHandler.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/parse/JsDataHandler.java @@ -3,6 +3,7 @@ */ package io.deephaven.web.client.api.parse; +import com.google.gwt.i18n.client.TimeZone; import elemental2.core.ArrayBuffer; import elemental2.core.Float32Array; import elemental2.core.Float64Array; @@ -92,6 +93,68 @@ public void write(Object[] data, ParseContext context, JsConsumer addNode, } }, DATE_TIME(Type.Int, "io.deephaven.time.DateTime", "datetime") { + // Ensures that the 'T' separator character is in the date time + private String ensureSeparator(String s) { + if (s.charAt(SEPARATOR_INDEX) == ' ') { + StringBuilder stringBuilder = new StringBuilder(s); + stringBuilder.setCharAt(SEPARATOR_INDEX, 'T'); + return stringBuilder.toString(); + } + return s; + } + + // Guess the pattern for the correct number of subsecond digits 'S' + private String getSubsecondPattern(String s) { + final int decimalIndex = s.indexOf('.'); + if (decimalIndex == -1) { + // No subsecond digits + return DEFAULT_DATE_TIME_PATTERN; + } + final int numDigits = s.length() - decimalIndex - 1; + final StringBuilder stringBuilder = new StringBuilder(numDigits); + for (int i = 0; i < numDigits; i++) { + stringBuilder.append('S'); + } + return DEFAULT_DATE_TIME_PATTERN + "." + stringBuilder; + } + + private long parseDateString(String str, ParseContext context) { + final String s = ensureSeparator(str); + final int spaceIndex = s.indexOf(' '); + final String dateTimeString; + final String timeZoneString; + if (spaceIndex == -1) { + // Zulu is an exception to the space rule + if (s.endsWith("Z")) { + dateTimeString = s.substring(0, s.length() - 1); + timeZoneString = "Z"; + } else { + dateTimeString = s; + timeZoneString = null; + } + } else { + dateTimeString = s.substring(0, spaceIndex); + timeZoneString = s.substring(spaceIndex + 1); + } + + final TimeZone timeZone = timeZoneString == null + ? context.timeZone.unwrap() + : JsTimeZone.getTimeZone(timeZoneString).unwrap(); + boolean needsAdjustment = JsTimeZone.needsDstAdjustment(timeZoneString); + + try { + // First try with the pattern we already have + return JsDateTimeFormat.getFormat(context.dateTimePattern).parseWithTimezoneAsLong(dateTimeString, + timeZone, needsAdjustment); + } catch (IllegalArgumentException e) { + // We failed to parse with the existing context pattern, try and update the pattern from the string of + // text and do it again + context.dateTimePattern = getSubsecondPattern(dateTimeString); + return JsDateTimeFormat.getFormat(context.dateTimePattern).parseWithTimezoneAsLong(dateTimeString, + timeZone, needsAdjustment); + } + } + @Override public double writeType(Builder builder) { return Int.createInt(builder, 64, true); @@ -121,7 +184,7 @@ public void write(Object[] data, ParseContext context, JsConsumer addNode, dateValue = NULL_LONG; } else { // take the format string and the timezone, and solve for a date - dateValue = JsDateTimeFormat.parse(context.dateTimePattern, str, context.timeZone).getWrapped(); + dateValue = parseDateString(str, context); } } @@ -427,6 +490,10 @@ private static class HandlersHolder { private static final Uint8Array EMPTY = new Uint8Array(0); + private static final String DEFAULT_DATE_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss"; + + private static final int SEPARATOR_INDEX = DEFAULT_DATE_TIME_PATTERN.indexOf('T'); + private final int arrowTypeType; private final String deephavenType; @@ -456,7 +523,7 @@ public void write(Object[] data, ParseContext context, JsConsumer addNode, public static class ParseContext { public JsTimeZone timeZone; - public String dateTimePattern = "yyyy-MM-dd'T'HH:mm:ss"; + public String dateTimePattern = DEFAULT_DATE_TIME_PATTERN; } public static class Node { From ee93592b46ac88a7f95d24a366fa1124ff2ddd00 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 7 Oct 2022 13:21:52 -0700 Subject: [PATCH 204/215] Devroot cleanup (#2974) This removes the necessity for the `devroot` property to be set - it doesn't make sense for end-users. In code-generation or test cases where access to the source is still necessary, the appropriate system properties can be set as necessary. --- Configuration/build.gradle | 1 - .../configuration/Configuration.java | 47 ------------------- .../configuration/TestConfiguration.java | 14 ++---- Generators/Generators.gradle | 13 +---- .../libs/GroovyStaticImportGenerator.java | 7 +-- .../plot/util/GenerateAxesPlotMethods.java | 7 +-- .../plot/util/GenerateFigureImmutable.java | 7 +-- .../plot/util/GenerateMultiSeries.java | 7 +-- .../util/GeneratePlottingConvenience.java | 7 +-- Integrations/build.gradle | 1 - .../python/PythonDeephavenSession.java | 4 +- Net/build.gradle | 1 - Stats/build.gradle | 1 - .../utils/test/PropertySaverTest.java | 2 +- .../io.deephaven.java-test-conventions.gradle | 4 +- .../main/configure/image-bootstrap.properties | 1 - .../main/docker/image-bootstrap.properties | 1 - .../main/configure/image-bootstrap.properties | 1 - engine/benchmark/build.gradle | 3 -- engine/table/build.gradle | 1 + .../groovy/core/deephaven_core_utils.groovy | 1 - engine/table/groovy/groovy/0-base.groovy | 1 - .../engine/util/GroovyDeephavenSession.java | 4 +- .../deephaven/engine/util/ScriptFinder.java | 1 + .../engine/table/impl/FuzzerTest.java | 33 +++---------- .../table/impl/util/ModelFileGenerator.java | 5 +- .../engine/table/impl/fuzzertest.groovy | 0 .../kafka/ingest/TestAvroAdapter.java | 20 ++++---- extensions/parquet/benchmark/build.gradle | 2 - .../src/main/resources/dh-defaults.prop | 4 -- .../src/main/resources/dh-tests.prop | 7 --- .../deephaven_server/start_jvm.py | 2 - .../src/main/resources/bootstrap.properties | 1 - py/server/test_helper/__init__.py | 8 ---- .../engine/util/WorkerPythonEnvironment.java | 4 +- server/build.gradle | 4 ++ .../src/main/resources/bootstrap.properties | 1 - .../src/main/resources/bootstrap.properties | 1 - .../server/appmode/ApplicationConfigs.java | 2 +- sphinx/source/conf.py | 2 - sphinx/sphinx.gradle | 2 - 41 files changed, 50 insertions(+), 185 deletions(-) rename engine/table/src/test/{java => resources}/io/deephaven/engine/table/impl/fuzzertest.groovy (100%) diff --git a/Configuration/build.gradle b/Configuration/build.gradle index 19ce7c547f2..c804e169f7b 100644 --- a/Configuration/build.gradle +++ b/Configuration/build.gradle @@ -39,7 +39,6 @@ test { maxHeapSize = '3g' systemProperty 'Configuration.rootFile', 'lib-tests.prop' - systemProperty 'devroot', "$rootDir" systemProperty 'workspace', "$rootDir/tmp/workspace" systemProperty 'configuration.quiet', 'true' diff --git a/Configuration/src/main/java/io/deephaven/configuration/Configuration.java b/Configuration/src/main/java/io/deephaven/configuration/Configuration.java index 92627530ca8..f51511f42be 100644 --- a/Configuration/src/main/java/io/deephaven/configuration/Configuration.java +++ b/Configuration/src/main/java/io/deephaven/configuration/Configuration.java @@ -24,10 +24,6 @@ public class Configuration extends PropertyFile { @SuppressWarnings("WeakerAccess") public static final String WORKSPACE_PROPERTY = "workspace"; - /** Property that specifies the software installation root directory. */ - @SuppressWarnings("WeakerAccess") - public static final String DEVROOT_PROPERTY = "devroot"; - /** Property that specifies the directory for process logs. */ @SuppressWarnings("WeakerAccess") public static final String LOGDIR_PROPERTY = "logDir"; // Defaults to getProperty(WORKSPACE_PROPERTY)/../logs @@ -44,9 +40,6 @@ public class Configuration extends PropertyFile { /** Token used for process name substitution */ private static final String PROCESS_NAME_TOKEN = ""; - /** Token used for devroot substitution */ - private static final String DEVROOT_TOKEN = ""; - /** Token used for workspace substitution */ private static final String WORKSPACE_TOKEN = ""; @@ -63,7 +56,6 @@ public class Configuration extends PropertyFile { private final String confFileName; private final String confFileProperty; private final String workspace; - private final String devroot; // This should never be null to meet the contract for getContextKeyValues() private Collection contextKeys = Collections.emptySet(); @@ -174,7 +166,6 @@ public String getLogDir() { * Normalize a directory path. This performs the following substitutions and manipulations. *
      *
    • {@code } - replaced with the process workspace
    • - *
    • {@code } - replaced with the installation root directory
    • *
    • {@code } - replaced with the process name
    • *
    • {@code } - replaced with the value found by the property {@link #LOGDIR_ROOT_PROPERTY}
    • *
    • After all substitutions, {@link #expandLinuxPath(String)} is called
    • @@ -218,15 +209,6 @@ public String normalizeLogDirectoryPath(@NotNull final String directoryName) { } } - if (substitutedPath.contains(DEVROOT_TOKEN)) { - if (devroot == null) { - throw new IllegalArgumentException("Directory " + substitutedPath + " (original path " + directoryName - + ") contains " + DEVROOT_TOKEN + " but " + DEVROOT_PROPERTY + " property is not defined"); - } else { - substitutedPath = substitutedPath.replace(DEVROOT_TOKEN, devroot); - } - } - // Now perform the expansion of any linux-like (i.e. ~) path pieces final String expandedPath = expandLinuxPath(substitutedPath); @@ -333,14 +315,6 @@ protected Configuration() { } workspace = workspacePropValue; - String devrootPropValue; - try { - devrootPropValue = lookupPath(DEVROOT_PROPERTY); - } catch (ConfigurationException e) { - devrootPropValue = null; - } - devroot = devrootPropValue; - // The quiet property is available because things like shell scripts may be parsing our System.out and they // don't // want to have to deal with these log messages @@ -350,11 +324,6 @@ protected Configuration() { } else { log.warn("Configuration: " + WORKSPACE_PROPERTY + " is undefined"); } - if (devroot != null) { - log.info("Configuration: " + DEVROOT_PROPERTY + " is " + devroot); - } else { - log.warn("Configuration: " + DEVROOT_PROPERTY + " is undefined"); - } log.info("Configuration: " + confFileProperty + " is " + confFileName); } } @@ -492,22 +461,6 @@ public String getTempPath(String componentName) { return f.getAbsolutePath(); } - private void checkDevRootDefined() { - if (devroot == null) { - throw new ConfigurationException(DEVROOT_PROPERTY + " property is not defined"); - } - } - - public String getDevRootPath(String propertyName) { - checkDevRootDefined(); - return devroot + File.separator + getProperty(propertyName); - } - - public String getDevRootPath() { - checkDevRootDefined(); - return devroot; - } - /** * @return the TimeZone the server is running in */ diff --git a/Configuration/src/test/java/io/deephaven/configuration/TestConfiguration.java b/Configuration/src/test/java/io/deephaven/configuration/TestConfiguration.java index 760d618032e..38a50f1ce02 100644 --- a/Configuration/src/test/java/io/deephaven/configuration/TestConfiguration.java +++ b/Configuration/src/test/java/io/deephaven/configuration/TestConfiguration.java @@ -12,8 +12,7 @@ * Test suite for Configuration. * * Must provide a Configuration.rootFile property in the VM arguments when running from IntelliJ, even though we set - * that in most of the tests. -ea -DConfiguration.rootFile=resources/lib-tests.prop -Ddevroot=/ -Dworkspace=/ - * -DcacheDir=/cache + * that in most of the tests. -ea -DConfiguration.rootFile=resources/lib-tests.prop -Dworkspace=/ -DcacheDir=/cache */ public class TestConfiguration extends TestCase { private final String FILENAME_PROPERTY = Configuration.getInstance().getConfFileProperty(); @@ -95,13 +94,8 @@ public void testIncludes() throws Exception { * Verify that specific operations of Configuration other than named properties work properly */ public void testProperties() { - assertNotNull(Configuration.getInstance().getDevRootPath()); - assertTrue(Configuration.getInstance().getDevRootPath().length() > 0); assertNotNull(Configuration.getInstance().getWorkspacePath()); assertTrue(Configuration.getInstance().getWorkspacePath().length() > 0); - assertNotNull(Configuration.getInstance().getDevRootPath("cacheDir")); - assertTrue(Configuration.getInstance().getDevRootPath("cacheDir").length() > 0); - assertTrue(Configuration.getInstance().getDevRootPath("cacheDir").endsWith("cache")); assertNotNull(Configuration.getInstance().getWorkspacePath("cacheDir")); assertTrue(Configuration.getInstance().getWorkspacePath("cacheDir").length() > 0); assertTrue(Configuration.getInstance().getWorkspacePath("cacheDir").endsWith("cache")); @@ -446,21 +440,21 @@ public void testShowHistory() { final String javaVersion = System.getProperty("java.specification.version"); if ("11".equals(javaVersion)) { assertEquals( - ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:439)\n" + ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:433)\n" + "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n", history.get(0).fileName); } else if ("17".equals(javaVersion)) { assertEquals( - ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:439)\n" + ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:433)\n" + "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\n", history.get(0).fileName); } else if ("18".equals(javaVersion)) { assertEquals( - ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:439)\n" + ": io.deephaven.configuration.TestConfiguration.testShowHistory(TestConfiguration.java:433)\n" + "java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)\n" + diff --git a/Generators/Generators.gradle b/Generators/Generators.gradle index 1c64962fd30..8582c10f3b9 100644 --- a/Generators/Generators.gradle +++ b/Generators/Generators.gradle @@ -6,7 +6,7 @@ plugins { evaluationDependsOn Docker.registryProject('python') configurations { - implementation.extendsFrom fishConfig, jdom + implementation.extendsFrom jdom testImplementation.extendsFrom fishBaseTest combinedJavadoc } @@ -17,6 +17,7 @@ dependencies { implementation project(':extensions-csv') implementation project(':extensions-kafka') implementation project(':extensions-parquet-table') + implementation depTrove3 Classpaths.inheritGroovy(project, 'groovy', 'implementation') Classpaths.inheritGroovy(project, 'groovy-json', 'implementation') @@ -66,7 +67,6 @@ task generateAxesPlotMethods(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } @@ -78,7 +78,6 @@ task generateAxesPlotMethodsAssert(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' onlyIf { System.getenv('NO_ASSERT') != 'true' } } @@ -91,7 +90,6 @@ task generateMultiSeries(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } @@ -103,7 +101,6 @@ task generateMultiSeriesAssert(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' onlyIf { System.getenv('NO_ASSERT') != 'true' } } @@ -117,7 +114,6 @@ task generateFigureImmutable(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } @@ -130,7 +126,6 @@ task generateFigureImmutableAssert(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' onlyIf { System.getenv('NO_ASSERT') != 'true' } } @@ -144,7 +139,6 @@ task generatePlottingConvenience(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } @@ -157,7 +151,6 @@ task generatePlottingConvenienceAssert(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } @@ -170,7 +163,6 @@ task generatePythonFigureWrapper(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' dependsOn ':Generators:generateFigureImmutable' } @@ -184,7 +176,6 @@ task generatePythonFigureWrapperAssert(type: JavaExec, dependsOn: 'classes') { classpath = sourceSets.main.runtimeClasspath workingDir = workDir systemProperty 'workspace', workspace - systemProperty 'devroot', devRoot systemProperty 'Configuration.rootFile', 'dh-defaults.prop' } diff --git a/Generators/src/main/java/io/deephaven/libs/GroovyStaticImportGenerator.java b/Generators/src/main/java/io/deephaven/libs/GroovyStaticImportGenerator.java index 18102b472d9..f0d2227b8c3 100644 --- a/Generators/src/main/java/io/deephaven/libs/GroovyStaticImportGenerator.java +++ b/Generators/src/main/java/io/deephaven/libs/GroovyStaticImportGenerator.java @@ -3,7 +3,6 @@ */ package io.deephaven.libs; -import io.deephaven.configuration.Configuration; import io.deephaven.util.type.TypeUtils; import org.jetbrains.annotations.NotNull; @@ -373,15 +372,13 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio String devroot = null; boolean assertNoChange = false; - if (args.length == 0) { - devroot = Configuration.getInstance().getDevRootPath(); - } else if (args.length == 1) { + if (args.length == 1) { devroot = args[0]; } else if (args.length == 2) { devroot = args[0]; assertNoChange = Boolean.parseBoolean(args[1]); } else { - System.out.println("Usage: [ [assertNoChange]]"); + System.out.println("Usage: [assertNoChange]"); System.exit(-1); } diff --git a/Generators/src/main/java/io/deephaven/plot/util/GenerateAxesPlotMethods.java b/Generators/src/main/java/io/deephaven/plot/util/GenerateAxesPlotMethods.java index d9df7a332b8..5e0467fce00 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GenerateAxesPlotMethods.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GenerateAxesPlotMethods.java @@ -4,7 +4,6 @@ package io.deephaven.plot.util; import io.deephaven.base.verify.Require; -import io.deephaven.configuration.Configuration; import java.io.IOException; import java.io.PrintWriter; @@ -882,15 +881,13 @@ public static void main(String[] args) throws IOException { String devroot = null; boolean assertNoChange = false; - if (args.length == 0) { - devroot = Configuration.getInstance().getDevRootPath(); - } else if (args.length == 1) { + if (args.length == 1) { devroot = args[0]; } else if (args.length == 2) { devroot = args[0]; assertNoChange = Boolean.parseBoolean(args[1]); } else { - System.out.println("Usage: [ [assertNoChange]]"); + System.out.println("Usage: [assertNoChange]"); System.exit(-1); } diff --git a/Generators/src/main/java/io/deephaven/plot/util/GenerateFigureImmutable.java b/Generators/src/main/java/io/deephaven/plot/util/GenerateFigureImmutable.java index 70a18b061b7..3a716e62c99 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GenerateFigureImmutable.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GenerateFigureImmutable.java @@ -3,7 +3,6 @@ */ package io.deephaven.plot.util; -import io.deephaven.configuration.Configuration; import io.deephaven.plot.*; import io.deephaven.plot.datasets.DataSeries; import io.deephaven.plot.datasets.multiseries.MultiSeries; @@ -1027,15 +1026,13 @@ private static void generateFile(final String devroot, final boolean assertNoCha public static void main(String[] args) throws ClassNotFoundException, IOException { String devroot = null; boolean assertNoChange = false; - if (args.length == 0) { - devroot = Configuration.getInstance().getDevRootPath(); - } else if (args.length == 1) { + if (args.length == 1) { devroot = args[0]; } else if (args.length == 2) { devroot = args[0]; assertNoChange = Boolean.parseBoolean(args[1]); } else { - System.out.println("Usage: [ [assertNoChange]]"); + System.out.println("Usage: [assertNoChange]"); System.exit(-1); } diff --git a/Generators/src/main/java/io/deephaven/plot/util/GenerateMultiSeries.java b/Generators/src/main/java/io/deephaven/plot/util/GenerateMultiSeries.java index dcf625a6819..e5d9db6b7c9 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GenerateMultiSeries.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GenerateMultiSeries.java @@ -5,7 +5,6 @@ import io.deephaven.base.ClassUtil; import io.deephaven.base.Pair; -import io.deephaven.configuration.Configuration; import io.deephaven.plot.util.functions.ClosureFunction; import io.deephaven.engine.table.Table; import io.deephaven.libs.GroovyStaticImportGenerator; @@ -36,15 +35,13 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio String devroot = null; boolean assertNoChange = false; - if (args.length == 0) { - devroot = Configuration.getInstance().getDevRootPath(); - } else if (args.length == 1) { + if (args.length == 1) { devroot = args[0]; } else if (args.length == 2) { devroot = args[0]; assertNoChange = Boolean.parseBoolean(args[1]); } else { - System.out.println("Usage: [ [assertNoChange]]"); + System.out.println("Usage: [assertNoChange]"); System.exit(-1); } diff --git a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java index d865afbc4f6..a86bac79500 100644 --- a/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java +++ b/Generators/src/main/java/io/deephaven/plot/util/GeneratePlottingConvenience.java @@ -3,7 +3,6 @@ */ package io.deephaven.plot.util; -import io.deephaven.configuration.Configuration; import io.deephaven.plot.BaseFigureImpl; import io.deephaven.plot.FigureImpl; import io.deephaven.libs.GroovyStaticImportGenerator.JavaFunction; @@ -323,15 +322,13 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio String devroot = null; boolean assertNoChange = false; - if (args.length == 0) { - devroot = Configuration.getInstance().getDevRootPath(); - } else if (args.length == 1) { + if (args.length == 1) { devroot = args[0]; } else if (args.length == 2) { devroot = args[0]; assertNoChange = Boolean.parseBoolean(args[1]); } else { - System.out.println("Usage: [ [assertNoChange]]"); + System.out.println("Usage: [assertNoChange]"); System.exit(-1); } diff --git a/Integrations/build.gradle b/Integrations/build.gradle index ca41bb1c204..e739a810a56 100644 --- a/Integrations/build.gradle +++ b/Integrations/build.gradle @@ -72,7 +72,6 @@ def runInDocker = { String name, String sourcePath, List command, Closur mkdir -p /workspace/cache/classes''' environmentVariable 'DEEPHAVEN_CLASSPATH', '/classpath/*:/classpath:/opt/deephaven/server/lib/*:/opt/deephaven/server/lib/' environmentVariable 'DEEPHAVEN_WORKSPACE', '/workspace' - environmentVariable 'DEEPHAVEN_DEVROOT', '/python' environmentVariable 'DEEPHAVEN_PROPFILE', 'dh-defaults.prop' environmentVariable 'DEEPHAVEN_VERSION', project.version diff --git a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java index a7198b6f330..3ade63ca29e 100644 --- a/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java +++ b/Integrations/src/main/java/io/deephaven/integrations/python/PythonDeephavenSession.java @@ -56,9 +56,7 @@ public class PythonDeephavenSession extends AbstractScriptSession", Configuration.getInstance().getDevRootPath()) - .replace("", Configuration.getInstance().getWorkspacePath()); + .getStringWithDefault("PythonDeephavenSession.defaultScriptPath", "."); public static String SCRIPT_TYPE = "Python"; diff --git a/Net/build.gradle b/Net/build.gradle index 0fe27c5bf83..f905e0e9f7b 100644 --- a/Net/build.gradle +++ b/Net/build.gradle @@ -23,7 +23,6 @@ test { maxHeapSize = '3g' systemProperty 'Configuration.rootFile', 'lib-tests.prop' - systemProperty 'devroot', "$rootDir" systemProperty 'workspace', "$rootDir/tmp/workspace" systemProperty 'configuration.quiet', 'true' diff --git a/Stats/build.gradle b/Stats/build.gradle index e7a4b21e674..dc814e00861 100644 --- a/Stats/build.gradle +++ b/Stats/build.gradle @@ -26,7 +26,6 @@ test { maxHeapSize = '3g' systemProperty 'Configuration.rootFile', 'lib-tests.prop' - systemProperty 'devroot', "$rootDir" systemProperty 'workspace', "$rootDir/tmp/workspace" systemProperty 'configuration.quiet', 'true' diff --git a/Util/src/test/java/io/deephaven/utils/test/PropertySaverTest.java b/Util/src/test/java/io/deephaven/utils/test/PropertySaverTest.java index 17dbbad3053..c4e72e0f76c 100644 --- a/Util/src/test/java/io/deephaven/utils/test/PropertySaverTest.java +++ b/Util/src/test/java/io/deephaven/utils/test/PropertySaverTest.java @@ -21,7 +21,7 @@ public class PropertySaverTest { // Add this to IntelliJ Unit Test Run Configuration to mimic gradle test // - // -ea -DConfiguration.rootFile=dh-tests.prop -Dworkspace=./tmp/workspace -Ddevroot=. + // -ea -DConfiguration.rootFile=dh-tests.prop -Dworkspace=./tmp/workspace // -ea is for JVM to honor assertions // // CommandLine: diff --git a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle index 9684a2eb297..cefbd84752f 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle @@ -58,7 +58,9 @@ project.tasks.withType(Test).all { Test t -> } systemProperty 'Configuration.rootFile', 'dh-tests.prop' - systemProperty 'devroot', "$rootDir" + systemProperty 'GroovyDeephavenSession.defaultScriptPath', "$rootDir" + systemProperty 'PythonDeephavenSession.defaultScriptPath', "$rootDir" + systemProperty 'WorkerPythonEnvironment.defaultScriptPath', "$rootDir" systemProperty 'workspace', "$rootDir/tmp/workspace" systemProperty 'configuration.quiet', 'true' diff --git a/docker/server-jetty/src/main/configure/image-bootstrap.properties b/docker/server-jetty/src/main/configure/image-bootstrap.properties index 490d83f2e75..65db0ef474c 100644 --- a/docker/server-jetty/src/main/configure/image-bootstrap.properties +++ b/docker/server-jetty/src/main/configure/image-bootstrap.properties @@ -1,6 +1,5 @@ Configuration.rootFile=dh-defaults.prop workspace=. -devroot=. deephaven.cache.dir=/cache storage.path=/data diff --git a/docker/server-slim/src/main/docker/image-bootstrap.properties b/docker/server-slim/src/main/docker/image-bootstrap.properties index 7b403f1b946..be4b120a375 100644 --- a/docker/server-slim/src/main/docker/image-bootstrap.properties +++ b/docker/server-slim/src/main/docker/image-bootstrap.properties @@ -1,6 +1,5 @@ Configuration.rootFile=dh-defaults.prop workspace=. -devroot=. deephaven.console.type=groovy deephaven.cache.dir=/cache diff --git a/docker/server/src/main/configure/image-bootstrap.properties b/docker/server/src/main/configure/image-bootstrap.properties index 490d83f2e75..65db0ef474c 100644 --- a/docker/server/src/main/configure/image-bootstrap.properties +++ b/docker/server/src/main/configure/image-bootstrap.properties @@ -1,6 +1,5 @@ Configuration.rootFile=dh-defaults.prop workspace=. -devroot=. deephaven.cache.dir=/cache storage.path=/data diff --git a/engine/benchmark/build.gradle b/engine/benchmark/build.gradle index a9789b5feed..0b0a127f357 100644 --- a/engine/benchmark/build.gradle +++ b/engine/benchmark/build.gradle @@ -54,7 +54,6 @@ task jmhRun(type: JavaExec) { // arguments to pass to the application jvmArgs '-DConfiguration.rootFile=dh-tests.prop', - "-Ddevroot=$rootDir", "-Dworkspace=$rootDir/tmp/workspace", '-Dconfiguration.quiet=true', '-Djava.awt.headless=true', @@ -74,7 +73,6 @@ def createJmhTask = { // arguments to pass to the application def jvmArgs = [ '-DConfiguration.rootFile=dh-tests.prop', - "-Ddevroot=$rootDir", "-Dworkspace=$rootDir/tmp/workspace", '-Dconfiguration.quiet=true', '-Djava.awt.headless=true', @@ -110,7 +108,6 @@ def createDeephavenTestExecTask = { task.main = mainClass task.jvmArgs '-DConfiguration.rootFile=dh-tests.prop', - "-Ddevroot=$rootDir", "-Dworkspace=$rootDir/tmp/workspace", "-Dtest.output.dir=$rootDir/tmp/logs", '-Dconfiguration.quiet=true', diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 9d10648394a..70f1d16f4b5 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -131,6 +131,7 @@ test { def props = project.properties.subMap(["jpy.pythonLib", "jpy.jpyLib", "jpy.jdlLib"]) systemProperties props + systemProperty 'ModelFileGenerator.testSource', layout.projectDirectory.dir('src/test/java/').toString() } // Adds a custom testParallel task which is allowed to run tests in parallel. diff --git a/engine/table/groovy/core/deephaven_core_utils.groovy b/engine/table/groovy/core/deephaven_core_utils.groovy index e578a783da8..71cbbcc0384 100644 --- a/engine/table/groovy/core/deephaven_core_utils.groovy +++ b/engine/table/groovy/core/deephaven_core_utils.groovy @@ -3,7 +3,6 @@ */ __QUERY_NAME__="core" -getDevRootPath = {io.deephaven.configuration.Configuration.getInstance().getDevRootPath()} source = {fileName -> __groovySession.runScript(fileName) diff --git a/engine/table/groovy/groovy/0-base.groovy b/engine/table/groovy/groovy/0-base.groovy index e668f5a357e..6ebef841f89 100644 --- a/engine/table/groovy/groovy/0-base.groovy +++ b/engine/table/groovy/groovy/0-base.groovy @@ -1,5 +1,4 @@ __QUERY_NAME__="core" -getDevRootPath = {io.deephaven.configuration.Configuration.getInstance().getDevRootPath()} source = {fileName -> __groovySession.runScript(fileName) diff --git a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java index fbee4a166d7..3cb162ab3a5 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/GroovyDeephavenSession.java @@ -61,9 +61,7 @@ public class GroovyDeephavenSession extends AbstractScriptSession", Configuration.getInstance().getDevRootPath()) - .replace("", Configuration.getInstance().getWorkspacePath()); + .getStringWithDefault("GroovyDeephavenSession.defaultScriptPath", "."); private static final boolean ALLOW_UNKNOWN_GROOVY_PACKAGE_IMPORTS = Configuration.getInstance() .getBooleanForClassWithDefault(GroovyDeephavenSession.class, "allowUnknownGroovyPackageImports", false); diff --git a/engine/table/src/main/java/io/deephaven/engine/util/ScriptFinder.java b/engine/table/src/main/java/io/deephaven/engine/util/ScriptFinder.java index aac86a2f515..16fe919be4f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/ScriptFinder.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/ScriptFinder.java @@ -79,6 +79,7 @@ InputStream findScript(final String script, final String dbScriptPath) throws IO } private FileOrStream findScriptEx(final String script, final String dbScriptPath) throws IOException { + // TODO(deephaven-core#2978): Cleanup ScriptSession initialization logic / ScriptFinder /* * NB: This code is overdue for some cleanup. In practice, there are two modes: (1) local - a user runs a local * groovy session from IntelliJ or otherwise, and needs to find scripts under their devroot. (2) deployed - a diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java index 25b2c5c4394..b240370501b 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/FuzzerTest.java @@ -23,23 +23,19 @@ import io.deephaven.util.SafeCloseable; import org.apache.commons.lang3.mutable.MutableLong; import org.jetbrains.annotations.Nullable; -import org.junit.After; import org.junit.Assume; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; -import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @Category(SerialTest.class) public class FuzzerTest { - private static final String TEST_ROOT = System.getProperty("devroot", "."); - private static final String OUTPUT_ROOT = TEST_ROOT + "/tmp/" + FuzzerTest.class.getSimpleName() + "output"; private static final boolean REALTIME_FUZZER_ENABLED = Configuration.getInstance().getBooleanWithDefault("FuzzerTest.realTime", false); @@ -71,26 +67,6 @@ private FuzzDescriptor(long querySeed, long tableSeed, int steps, int sleepPerSt } }; - private void cleanupPersistence() { - FileUtils.deleteRecursively(new File(OUTPUT_ROOT)); - } - - private void setupPersistence() { - cleanupPersistence(); - // noinspection ResultOfMethodCallIgnored - new File(OUTPUT_ROOT).mkdirs(); - } - - @Before - public void setUp() throws Exception { - setupPersistence(); - } - - @After - public void tearDown() throws Exception { - cleanupPersistence(); - } - private GroovyDeephavenSession getGroovySession() throws IOException { return getGroovySession(null); } @@ -103,13 +79,16 @@ private GroovyDeephavenSession getGroovySession(@Nullable TimeProvider timeProvi @Test public void testFuzzer() throws IOException, InterruptedException { - testFuzzerScriptFile(0, "/engine/table/src/test/java/io/deephaven/engine/table/impl/fuzzertest.groovy", true); + testFuzzerScriptFile(0, "fuzzertest.groovy", true); } private void testFuzzerScriptFile(final long timeSeed, String s, boolean realtime) throws IOException, InterruptedException { final Random timeRandom = new Random(timeSeed); - final String groovyString = FileUtils.readTextFile(new File(Configuration.getInstance().getDevRootPath() + s)); + final String groovyString; + try (final InputStream in = FuzzerTest.class.getResourceAsStream(s)) { + groovyString = FileUtils.readTextFile(in); + } final DateTime fakeStart = DateTimeUtils.convertDateTime("2020-03-17T13:53:25.123456 NY"); final MutableLong now = new MutableLong(fakeStart.getNanos()); diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/ModelFileGenerator.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/ModelFileGenerator.java index 300e5828eec..b3feb5d6b46 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/util/ModelFileGenerator.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/util/ModelFileGenerator.java @@ -3,7 +3,6 @@ */ package io.deephaven.engine.table.impl.util; -import io.deephaven.configuration.Configuration; import junit.framework.TestCase; import java.io.FileNotFoundException; @@ -21,8 +20,8 @@ public ModelFileGenerator(Class classType) { } private String getPath() { - return Configuration.getInstance().getProperty("devroot") + - "/engine/table/src/test/java/" + classType.getCanonicalName().replace('.', '/') + ".java"; + return System.getProperty("ModelFileGenerator.testSource") + "/" + + classType.getCanonicalName().replace('.', '/') + ".java"; } public void generateFile(final String rawClassDef) throws FileNotFoundException { diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/fuzzertest.groovy b/engine/table/src/test/resources/io/deephaven/engine/table/impl/fuzzertest.groovy similarity index 100% rename from engine/table/src/test/java/io/deephaven/engine/table/impl/fuzzertest.groovy rename to engine/table/src/test/resources/io/deephaven/engine/table/impl/fuzzertest.groovy diff --git a/extensions/kafka/src/test/java/io/deephaven/kafka/ingest/TestAvroAdapter.java b/extensions/kafka/src/test/java/io/deephaven/kafka/ingest/TestAvroAdapter.java index 93ae19eff8b..951a176f968 100644 --- a/extensions/kafka/src/test/java/io/deephaven/kafka/ingest/TestAvroAdapter.java +++ b/extensions/kafka/src/test/java/io/deephaven/kafka/ingest/TestAvroAdapter.java @@ -4,7 +4,6 @@ package io.deephaven.kafka.ingest; import io.deephaven.chunk.attributes.Values; -import io.deephaven.configuration.Configuration; import io.deephaven.engine.table.TableDefinition; import io.deephaven.time.DateTime; import io.deephaven.time.DateTimeUtils; @@ -18,8 +17,9 @@ import org.jetbrains.annotations.NotNull; import org.junit.Test; -import java.io.File; +import java.io.BufferedInputStream; import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -27,15 +27,19 @@ public class TestAvroAdapter { @NotNull - private File getSchemaFile(String name) { - final String avscPath = - Configuration.getInstance().getDevRootPath() + "/extensions/kafka/src/test/resources/avro-examples/"; - return new File(avscPath + name); + private InputStream getSchemaFile(String name) { + return new BufferedInputStream(TestAvroAdapter.class.getResourceAsStream("/avro-examples/" + name)); + } + + private Schema getSchema(String name) throws IOException { + try (final InputStream in = getSchemaFile(name)) { + return new Schema.Parser().parse(in); + } } @Test public void testSimple() throws IOException { - final Schema avroSchema = new Schema.Parser().parse(getSchemaFile("pageviews.avc")); + final Schema avroSchema = getSchema("pageviews.avc"); final String[] names = new String[] {"viewtime", "userid", "pageid"}; final Class[] types = new Class[] {long.class, String.class, String.class}; @@ -84,7 +88,7 @@ public void testSimple() throws IOException { @Test public void testTimestamp() throws IOException { - final Schema avroSchema = new Schema.Parser().parse(getSchemaFile("fieldtest.avsc")); + final Schema avroSchema = getSchema("fieldtest.avsc"); final String[] names = new String[] {"last_name", "number", "truthiness", "timestamp", "timestampMicros", "timeMillis", "timeMicros"}; diff --git a/extensions/parquet/benchmark/build.gradle b/extensions/parquet/benchmark/build.gradle index 0a1ebc9d674..c0b41bf4226 100644 --- a/extensions/parquet/benchmark/build.gradle +++ b/extensions/parquet/benchmark/build.gradle @@ -54,7 +54,6 @@ task jmhRun(type: JavaExec) { // arguments to pass to the application jvmArgs '-DConfiguration.rootFile=dh-tests.prop', - "-Ddevroot=$rootDir", "-Dworkspace=$rootDir/tmp/workspace", '-Dconfiguration.quiet=true', '-Djava.awt.headless=true', @@ -74,7 +73,6 @@ def createJmhTask = { // arguments to pass to the application def jvmArgs = [ '-DConfiguration.rootFile=dh-tests.prop', - "-Ddevroot=$rootDir", "-Dworkspace=$rootDir/tmp/workspace", '-Dconfiguration.quiet=true', '-Djava.awt.headless=true', diff --git a/props/configs/src/main/resources/dh-defaults.prop b/props/configs/src/main/resources/dh-defaults.prop index 24a71e5ffaf..047281f100a 100644 --- a/props/configs/src/main/resources/dh-defaults.prop +++ b/props/configs/src/main/resources/dh-defaults.prop @@ -32,16 +32,12 @@ Calendar.importPath=/default_calendar_imports.txt NIO.wireLagClock.native=false -WorkerPythonEnvironment.defaultScriptPath= - QueryPerformanceRecorder.packageFilter.internal=defaultPackageFilters.qpr ########## Deephaven Groovy and Python Session defaults ########## -GroovyDeephavenSession.defaultScriptPath= GroovyDeephavenSession.initScripts=core/deephaven_core_utils.groovy -PythonDeephavenSession.defaultScriptPath= PythonDeephavenSession.initScripts=core/deephaven_jpy_init.py ###### Server's timezone ##### diff --git a/props/test-configs/src/main/resources/dh-tests.prop b/props/test-configs/src/main/resources/dh-tests.prop index e270fa9e6de..2e8f9301213 100644 --- a/props/test-configs/src/main/resources/dh-tests.prop +++ b/props/test-configs/src/main/resources/dh-tests.prop @@ -28,8 +28,6 @@ QueryLibrary.defaultPackageImportList=default_package_imports.txt QueryLibrary.defaultClassImportList=default_class_imports.txt QueryLibrary.defaultStaticImportList=default_static_imports.txt -GroovyDeephavenSession.defaultScriptPath= - StringUtils.cacheSize=0 TrackedFileHandleFactory.maxOpenFiles=1024 @@ -50,7 +48,6 @@ default.processEnvironmentFactory=io.deephaven.util.process.DefaultProcessEnviro jpy.pythonLib=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so,/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib,/usr/lib64/libpython2.7.so jpy.jpyLib=/usr/local/lib/python2.7/dist-packages/jpy.so,/Library/Python/2.7/site-packages/jpy.so,/usr/lib64/python2.7/site-packages/jpy.so,~/.local/lib/python2.7/site-packages/jpy.so jpy.jdlLib=/usr/local/lib/python2.7/dist-packages/jdl.so,/Library/Python/2.7/site-packages/jdl.so,/usr/lib64/python2.7/site-packages/jdl.so,~/.local/lib/python2.7/site-packages/jpy.so -WorkerPythonEnvironment.defaultScriptPath=/engine/table/python Comm.fatalErrorHandlerFactoryClass=io.deephaven.console.utils.ProcessEnvironmentRedirectFactory @@ -61,14 +58,10 @@ QueryPerformanceRecorder.packageFilter.internal=defaultPackageFilters.qpr ########## Deephaven Groovy and Python Session defaults ########## -GroovyDeephavenSession.defaultScriptPath= GroovyDeephavenSession.initScripts=core/deephaven_core_utils.groovy -PythonDeephavenSession.defaultScriptPath= PythonDeephavenSession.initScripts=core/deephaven_jpy_init.py -WorkerPythonEnvironment.defaultScriptPath= - ###### Server's timezone ##### server.timezone=America/New_York diff --git a/py/embedded-server/deephaven_server/start_jvm.py b/py/embedded-server/deephaven_server/start_jvm.py index 359605bf08f..5f19b69963c 100644 --- a/py/embedded-server/deephaven_server/start_jvm.py +++ b/py/embedded-server/deephaven_server/start_jvm.py @@ -54,7 +54,6 @@ def start_jvm( java_home: str = os.environ.get('JAVA_HOME', None), extra_classpath = [], propfile: str = None, - devroot: str = '.', workspace: str = '.', config = None): """ This function uses the default DH property file to embed the Deephaven server and starts a Deephaven Python @@ -65,7 +64,6 @@ def start_jvm( # Build jvm system properties starting with defaults we accept as args system_properties = { - 'devroot': os.path.realpath(devroot), 'workspace': workspace, 'Configuration.rootFile': propfile, } diff --git a/py/embedded-server/java-runtime/src/main/resources/bootstrap.properties b/py/embedded-server/java-runtime/src/main/resources/bootstrap.properties index 2092671977c..5fdba865bd7 100644 --- a/py/embedded-server/java-runtime/src/main/resources/bootstrap.properties +++ b/py/embedded-server/java-runtime/src/main/resources/bootstrap.properties @@ -2,7 +2,6 @@ Configuration.rootFile=dh-defaults.prop io.deephaven.configuration.PropertyInputStreamLoader.override=io.deephaven.configuration.PropertyInputStreamLoaderTraditional LoggerFactory.silenceOnProcessEnvironment=true workspace=. -devroot=. stdout.toLogBuffer=false stderr.toLogBuffer=false logback.configurationFile=logback-minimal.xml \ No newline at end of file diff --git a/py/server/test_helper/__init__.py b/py/server/test_helper/__init__.py index 76085f41632..f7efcbd9a4e 100644 --- a/py/server/test_helper/__init__.py +++ b/py/server/test_helper/__init__.py @@ -26,15 +26,8 @@ def start_jvm(jvm_props: Dict[str, str] = None): # we will try to initialize the jvm workspace = os.environ.get('DEEPHAVEN_WORKSPACE', '.') - devroot = os.environ.get('DEEPHAVEN_DEVROOT', '.') propfile = os.environ.get('DEEPHAVEN_PROPFILE', 'dh-defaults.prop') - # validate devroot & workspace - if devroot is None: - raise IOError("dh.init: devroot is not specified.") - if not os.path.isdir(devroot): - raise IOError("dh.init: devroot={} does not exist.".format(devroot)) - if workspace is None: raise IOError("dh.init: workspace is not specified.") if not os.path.isdir(workspace): @@ -65,7 +58,6 @@ def start_jvm(jvm_props: Dict[str, str] = None): 'MetricsManager.enabled': 'true', 'Configuration.rootFile': propfile, - 'devroot': os.path.realpath(devroot), 'workspace': os.path.realpath(workspace), } diff --git a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java index ee7232022d6..bc005845e0b 100644 --- a/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java +++ b/python-engine-test/src/test/java/io/deephaven/engine/util/WorkerPythonEnvironment.java @@ -65,9 +65,7 @@ public enum WorkerPythonEnvironment { } final String defaultScriptPath = Configuration.getInstance() - .getProperty("WorkerPythonEnvironment.defaultScriptPath") - .replace("", Configuration.getInstance().getDevRootPath()) - .replace("", Configuration.getInstance().getWorkspacePath()); + .getStringWithDefault("WorkerPythonEnvironment.defaultScriptPath", "."); final ScriptFinder scriptFinder = new ScriptFinder(defaultScriptPath); final String initScript = Configuration.getInstance().getStringWithDefault("WorkerPythonEnvironment.initScript", diff --git a/server/build.gradle b/server/build.gradle index 0d6dab7ca60..a07bf1da209 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -99,3 +99,7 @@ dependencies { } TestTools.addEngineOutOfBandTest(project) + +test { + systemProperty 'ApplicationConfigs.testAppDir', layout.projectDirectory.dir('src/test/app.d/').toString() +} diff --git a/server/jetty-app/src/main/resources/bootstrap.properties b/server/jetty-app/src/main/resources/bootstrap.properties index c3786cbb4e7..4e1add6198d 100644 --- a/server/jetty-app/src/main/resources/bootstrap.properties +++ b/server/jetty-app/src/main/resources/bootstrap.properties @@ -2,6 +2,5 @@ Configuration.rootFile=dh-defaults.prop io.deephaven.configuration.PropertyInputStreamLoader.override=io.deephaven.configuration.PropertyInputStreamLoaderTraditional LoggerFactory.silenceOnProcessEnvironment=true workspace=. -devroot=. stdout.toLogBuffer=true stderr.toLogBuffer=true diff --git a/server/netty-app/src/main/resources/bootstrap.properties b/server/netty-app/src/main/resources/bootstrap.properties index 2f8344af92a..0adf794d2f5 100644 --- a/server/netty-app/src/main/resources/bootstrap.properties +++ b/server/netty-app/src/main/resources/bootstrap.properties @@ -1,3 +1,2 @@ Configuration.rootFile=dh-defaults.prop workspace=. -devroot=. diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationConfigs.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationConfigs.java index 7eca29ce4b5..e5aa3b02fd3 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationConfigs.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationConfigs.java @@ -50,7 +50,7 @@ static Path resolve(String path) { } static Path testAppDir() { - return Paths.get(System.getProperty("devroot")).resolve("server/src/test/app.d"); + return Paths.get(System.getProperty("ApplicationConfigs.testAppDir")); } public static class App00 implements Application.Factory { diff --git a/sphinx/source/conf.py b/sphinx/source/conf.py index aad195d1d48..a34ceb6e9aa 100644 --- a/sphinx/source/conf.py +++ b/sphinx/source/conf.py @@ -79,11 +79,9 @@ import os workspace = os.environ.get('DEEPHAVEN_WORKSPACE', '.') -devroot = os.environ.get('DEEPHAVEN_DEVROOT', '.') propfile = os.environ.get('DEEPHAVEN_PROPFILE', 'dh-defaults.prop') jvm_properties = { 'Configuration.rootFile': propfile, - 'devroot': os.path.realpath(devroot), 'workspace': os.path.realpath(workspace), } diff --git a/sphinx/sphinx.gradle b/sphinx/sphinx.gradle index aae3e841277..7e960940a31 100644 --- a/sphinx/sphinx.gradle +++ b/sphinx/sphinx.gradle @@ -36,12 +36,10 @@ def sphinxDockerfile = tasks.register('sphinxDockerfile', Dockerfile) { environmentVariable 'DEEPHAVEN_CLASSPATH', "/opt/deephaven/server/lib/*.jar" environmentVariable 'DEEPHAVEN_WORKSPACE', '/tmp/workspace' - environmentVariable 'DEEPHAVEN_DEVROOT', '/tmp/devroot' environmentVariable 'DEEPHAVEN_PROPFILE', 'dh-defaults.prop' environmentVariable 'DEEPHAVEN_VERSION', project.version runCommand '''set -eux; \\ - mkdir /tmp/devroot; \\ mkdir /tmp/workspace; \\ python -m pip install sphinx==4.0.3 sphinx-autodoc-typehints==1.12.0 pyarrow==7.0.0 protobuf==3.20.1 grpcio==1.46.0 bitstring==3.1.9 /wheel/*.whl breathe==4.31.0 furo==2021.9.8 ''' From 79ab8d273721d76fda3ac540a68510096c62a012 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 7 Oct 2022 14:53:20 -0700 Subject: [PATCH 205/215] Bump kafka clients and avro (#2970) --- extensions/kafka/build.gradle | 6 +++--- redpanda-standalone/docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/kafka/build.gradle b/extensions/kafka/build.gradle index ed0e5e40d15..7525fd20631 100644 --- a/extensions/kafka/build.gradle +++ b/extensions/kafka/build.gradle @@ -8,13 +8,13 @@ description 'Kafka: Integrating Engine tables with Kafka' dependencies { api project(':engine-table') - api 'org.apache.avro:avro:1.11.0' + api 'org.apache.avro:avro:1.11.1' // Using io.confluent dependencies requires code in the toplevel build.gradle to add their maven repository. // Note: the -ccs flavor is provided by confluent as their community edition. It is equivalent to the maven central // version, but has a different version to make it easier to keep confluent dependencies aligned. - api 'org.apache.kafka:kafka-clients:7.1.1-ccs' - api 'io.confluent:kafka-avro-serializer:7.1.1' + api 'org.apache.kafka:kafka-clients:7.2.1-ccs' + api 'io.confluent:kafka-avro-serializer:7.2.1' implementation project(':Configuration') implementation project(':log-factory') diff --git a/redpanda-standalone/docker-compose.yml b/redpanda-standalone/docker-compose.yml index 3cc82d1ecb5..edac6326b13 100644 --- a/redpanda-standalone/docker-compose.yml +++ b/redpanda-standalone/docker-compose.yml @@ -15,7 +15,7 @@ services: - PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092 - --pandaproxy-addr 0.0.0.0:8082 - --advertise-pandaproxy-addr redpanda:8082 - image: docker.redpanda.com/vectorized/redpanda:v21.9.5 + image: docker.redpanda.com/vectorized/redpanda:v22.2.5 ports: - 8081:8081 - 8082:8082 From fa816e58d068781252898950f6769c7f7862f29c Mon Sep 17 00:00:00 2001 From: Matthew Runyon Date: Fri, 7 Oct 2022 16:57:13 -0500 Subject: [PATCH 206/215] Auto create docs issues from closed PRs (#2971) --- .github/workflows/create-docs-issues.js | 41 ++++++++++++++++++++++++ .github/workflows/create-docs-issues.yml | 39 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/create-docs-issues.js create mode 100644 .github/workflows/create-docs-issues.yml diff --git a/.github/workflows/create-docs-issues.js b/.github/workflows/create-docs-issues.js new file mode 100644 index 00000000000..daac12f7455 --- /dev/null +++ b/.github/workflows/create-docs-issues.js @@ -0,0 +1,41 @@ +module.exports = async ({ github, context }) => { + const ISSUE_REPO_NAME = "deephaven.io"; + const ISSUE_TYPES = ["how-to", "conceptual", "reference", "blog"]; + + const body = + `_This issue was auto-generated_\n\n` + + `PR: ${context.payload.pull_request.html_url}\n` + + `Author: ${context.payload.pull_request.user.login}\n\n` + + "## Original PR Body\n\n" + + context.payload.pull_request.body; + + const promises = ISSUE_TYPES.map((type) => + github.rest.issues.create({ + owner: context.repo.owner, + repo: ISSUE_REPO_NAME, + title: `${type.toUpperCase()}: ${context.payload.pull_request.title}`, + body, + labels: [type, "documentation", "triage", "autogenerated"], + }) + ); + + const issues = await Promise.allSettled(promises); + const issuesLinks = issues.map((promise, i) => { + const type = ISSUE_TYPES[i]; + const { status, value, reason } = promise; + const link = + status === "fulfilled" + ? value.data.html_url + : `Failed to create issue: ${reason}`; + return `${type[0].toUpperCase() + type.slice(1)}: ${link}`; + }); + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: + "Labels indicate documentation is required. Issues for documentation have been opened:\n\n" + + issuesLinks.join("\n"), + }); +}; diff --git a/.github/workflows/create-docs-issues.yml b/.github/workflows/create-docs-issues.yml new file mode 100644 index 00000000000..44a1563c1e8 --- /dev/null +++ b/.github/workflows/create-docs-issues.yml @@ -0,0 +1,39 @@ +name: Create documentation ticket + +on: + pull_request_target: + branches: + - main + types: + - closed + +jobs: + create-docs-ticket: + # Only on merged PRs that contain the DocumentationNeeded flag + if: github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'DocumentationNeeded') + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + + - name: Create Issues + id: create-issues + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.DOCS_ISSUES_PAT }} + script: | + const script = require('.github/workflows/create-docs-issues.js'); + await script({github, context}); + + - name: Slack Failure Message + uses: slackapi/slack-github-action@v1.15.0 + id: slack-failure-message + if: failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'deephaven' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVREL }} + with: + payload: | + { + "repository": "${{ github.repository }}", + "message": "${{ github.workflow }}/${{ github.job }} failure", + "link": "${{ github.event.pull_request.html_url }}" + } From c599c7803ca59efa32d0453b5abfdf322931b936 Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Sun, 9 Oct 2022 20:57:51 -0400 Subject: [PATCH 207/215] Update CPP client (#2981) * Reorganize code so that it can do an Arrow GetSchema call rather than doing a Get call and ignoring the results. * move some code to a new arrow_traits.h and arrow_util.h files * Code for demo chapter 3 * Respond to review feedback --- cpp-client/deephaven/client/CMakeLists.txt | 18 +- .../deephaven/client/arrowutil/arrow_traits.h | 88 +++++ .../deephaven/client/arrowutil/arrow_util.h | 17 + .../client/arrowutil/arrow_value_converter.h | 12 +- .../client/arrowutil/arrow_visitors.h | 25 -- .../client/immerutil/abstract_flex_vector.h | 52 +-- .../client/immerutil/immer_column_source.h | 1 + .../deephaven/client/impl/table_handle_impl.h | 69 ++-- .../client/subscription/update_processor.h | 5 +- .../public/deephaven/client/table/table.h | 49 ++- .../deephaven/client/utility/callbacks.h | 8 +- .../deephaven/client/utility/cbfuture.h | 45 ++- .../client/src/arrowutil/arrow_util.cc | 17 + .../client/src/chunk/chunk_filler.cc | 1 + .../client/src/impl/table_handle_impl.cc | 300 +++++++++--------- .../src/impl/table_handle_manager_impl.cc | 22 +- .../src/subscription/classic_table_state.cc | 1 + .../src/subscription/subscribe_thread.cc | 2 +- .../src/subscription/update_processor.cc | 13 +- .../deephaven/client/src/table/table.cc | 15 +- .../deephaven/client/src/utility/cbfuture.cc | 20 +- cpp-examples/demos/CMakeLists.txt | 8 +- cpp-examples/demos/chapter3.cc | 259 +++++++++++++++ 23 files changed, 716 insertions(+), 331 deletions(-) create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_traits.h create mode 100644 cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_util.h create mode 100644 cpp-client/deephaven/client/src/arrowutil/arrow_util.cc create mode 100644 cpp-examples/demos/chapter3.cc diff --git a/cpp-client/deephaven/client/CMakeLists.txt b/cpp-client/deephaven/client/CMakeLists.txt index 007302f06a1..09be477d3cc 100644 --- a/cpp-client/deephaven/client/CMakeLists.txt +++ b/cpp-client/deephaven/client/CMakeLists.txt @@ -42,6 +42,10 @@ set(ALL_FILES include/private/deephaven/client/impl/table_handle_manager_impl.h include/private/deephaven/client/impl/util.h + src/arrowutil/arrow_util.cc + + include/private/deephaven/client/arrowutil/arrow_traits.h + include/private/deephaven/client/arrowutil/arrow_util.h include/private/deephaven/client/arrowutil/arrow_visitors.h include/private/deephaven/client/arrowutil/arrow_value_converter.h @@ -71,6 +75,13 @@ set(ALL_FILES include/public/deephaven/client/container/row_sequence.h include/public/deephaven/client/table/table.h + src/subscription/classic_table_state.cc + src/subscription/immer_table_state.cc + src/subscription/index_decoder.cc + src/subscription/shift_processor.cc + src/subscription/space_mapper.cc + src/subscription/subscribe_thread.cc + src/subscription/update_processor.cc include/private/deephaven/client/subscription/classic_table_state.h include/private/deephaven/client/subscription/immer_table_state.h include/private/deephaven/client/subscription/index_decoder.h @@ -79,13 +90,6 @@ set(ALL_FILES include/private/deephaven/client/subscription/subscribe_thread.h include/private/deephaven/client/subscription/subscription_handle.h include/private/deephaven/client/subscription/update_processor.h - src/subscription/classic_table_state.cc - src/subscription/immer_table_state.cc - src/subscription/index_decoder.cc - src/subscription/shift_processor.cc - src/subscription/space_mapper.cc - src/subscription/subscribe_thread.cc - src/subscription/update_processor.cc src/immerutil/abstract_flex_vector.cc src/immerutil/immer_column_source.cc diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_traits.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_traits.h new file mode 100644 index 00000000000..c98863f8cf2 --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_traits.h @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once +#include +#include +#include +#include + +#include "deephaven/client/types.h" + +namespace deephaven::client::arrowutil { +/** + * Returns true iff type T is one of the numeric types. + */ +template +constexpr bool isNumericType() { + static_assert( + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v , + "T is not one of the supported element types for Deephaven columns"); + + return std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v; +} + +/** + * Maps the Deephaven element type to its corresponding Arrow array type. + */ +template +struct CorrespondingArrowArrayType {}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int8Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int16Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int32Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::Int64Array type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::FloatArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::DoubleArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::BooleanArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::StringArray type_t; +}; + +template<> +struct CorrespondingArrowArrayType { + typedef arrow::TimestampArray type_t; +}; +} // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_util.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_util.h new file mode 100644 index 00000000000..11f72ca79dd --- /dev/null +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_util.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#pragma once +#include +#include +#include + +#include "deephaven/client/types.h" + +namespace deephaven::client::arrowutil { +class ArrowUtil { +public: + static bool tryConvertTicketToFlightDescriptor(const std::string &ticket, + arrow::flight::FlightDescriptor *fd); +}; +} // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h index 3294db399f2..42c67029275 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_value_converter.h @@ -11,18 +11,26 @@ namespace deephaven::client::arrowutil { class ArrowValueConverter { public: - // "convert" function for anything except string_view is the identity function. + /** + * The default "convert" function is the identity function. + */ template static void convert(SRC src, DEST *dest) { *dest = src; } - // "convert" function for string_view is std::string + /** + * The "convert" function for string_view is std::string + */ static void convert(arrow::util::string_view sv, std::string *dest) { dest->clear(); dest->append(sv.data(), sv.size()); } + /** + * The "convert" function for the nanos-since-epoch representation of timestamps is + * deephaven::client::DateTime. + */ static void convert(int64_t src, deephaven::client::DateTime *dest) { *dest = deephaven::client::DateTime::fromNanos(src); } diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h index 927b662af00..c14ff43a695 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/arrowutil/arrow_visitors.h @@ -123,29 +123,4 @@ class ArrowArrayTypeVisitor : public arrow::ArrayVisitor { private: Inner inner_; }; - -/** - * Returns true iff type T is one of the numeric types. - */ -template -constexpr bool isNumericType() { - static_assert( - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v, - "T is not one of the supported element types for Deephaven columns"); - - return std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v || - std::is_same_v; -} } // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h index e69fc990dba..9c17113f691 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/abstract_flex_vector.h @@ -14,53 +14,6 @@ namespace deephaven::client::immerutil { namespace internal { -template -struct CorrespondingArrowArrayType {}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::Int8Array type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::Int16Array type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::Int32Array type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::Int64Array type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::FloatArray type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::DoubleArray type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::BooleanArray type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::StringArray type_t; -}; - -template<> -struct CorrespondingArrowArrayType { - typedef arrow::TimestampArray type_t; -}; struct FlexVectorAppender { template @@ -142,7 +95,7 @@ class NumericAbstractFlexVector final : public AbstractFlexVectorBase { } void inPlaceAppendArrow(const arrow::Array &data, size_t offset, size_t count) final { - typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; + typedef typename deephaven::client::arrowutil::CorrespondingArrowArrayType::type_t arrowArrayType_t; auto *typedArrow = deephaven::client::utility::verboseCast( DEEPHAVEN_EXPR_MSG(&data)); internal::FlexVectorAppender::append(*typedArrow, offset, count, &vec_, nullptr); @@ -189,7 +142,8 @@ class GenericAbstractFlexVector final : public AbstractFlexVectorBase { } void inPlaceAppendArrow(const arrow::Array &data, size_t offset, size_t count) final { - typedef typename internal::CorrespondingArrowArrayType::type_t arrowArrayType_t; + typedef typename deephaven::client::arrowutil::CorrespondingArrowArrayType::type_t + arrowArrayType_t; auto *typedArrow = deephaven::client::utility::verboseCast( DEEPHAVEN_EXPR_MSG(&data)); internal::FlexVectorAppender::append(*typedArrow, offset, count, &data_, &nulls_); diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h index fc68a6c997a..a93007fe589 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/immerutil/immer_column_source.h @@ -4,6 +4,7 @@ #pragma once #include #include +#include "deephaven/client/arrowutil/arrow_traits.h" #include "deephaven/client/arrowutil/arrow_visitors.h" #include "deephaven/client/chunk/chunk.h" #include "deephaven/client/column/column_source.h" diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h index d567548337d..e11f26f0cc1 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/impl/table_handle_impl.h @@ -37,11 +37,8 @@ class TableHandleManagerImpl; namespace internal { class GetColumnDefsCallback; -class LazyState final +class ExportedTableCreationCallback final : public deephaven::client::utility::SFCallback { - struct Private { - }; - typedef io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse ExportedTableCreationResponse; typedef io::deephaven::proto::backplane::grpc::Ticket Ticket; typedef deephaven::client::server::Server Server; @@ -56,34 +53,55 @@ class LazyState final using CBFuture = deephaven::client::utility::CBFuture; public: - static std::shared_ptr create(std::shared_ptr server, - std::shared_ptr flightExecutor); - static std::shared_ptr createSatisfied(std::shared_ptr server, - std::shared_ptr flightExecutor, Ticket ticket); - - LazyState(Private, std::shared_ptr &&server, std::shared_ptr &&flightExecutor); - ~LazyState() final; - - void waitUntilReady(); + explicit ExportedTableCreationCallback(CBPromise &&ticketPromise); + ~ExportedTableCreationCallback() final; void onSuccess(ExportedTableCreationResponse item) final; void onFailure(std::exception_ptr ep) final; +private: + CBPromise ticketPromise_; + + friend class GetColumnDefsCallback; +}; + +class LazyState final { + typedef io::deephaven::proto::backplane::grpc::ExportedTableCreationResponse ExportedTableCreationResponse; + typedef io::deephaven::proto::backplane::grpc::Ticket Ticket; + typedef deephaven::client::server::Server Server; + typedef deephaven::client::utility::ColumnDefinitions ColumnDefinitions; + typedef deephaven::client::utility::Executor Executor; + + template + using SFCallback = deephaven::client::utility::SFCallback; + template + using CBPromise = deephaven::client::utility::CBPromise; + template + using CBFuture = deephaven::client::utility::CBFuture; + +public: + LazyState(std::shared_ptr server, std::shared_ptr flightExecutor, + CBFuture ticketFuture); + ~LazyState(); + std::shared_ptr getColumnDefinitions(); - void - getColumnDefinitionsAsync(std::shared_ptr>> cb); + void getColumnDefinitionsAsync( + std::shared_ptr>> cb); + + /** + * Used in tests. + */ + void waitUntilReady(); private: std::shared_ptr server_; std::shared_ptr flightExecutor_; - - CBPromise ticketPromise_; CBFuture ticketFuture_; + std::atomic_flag requestSent_ = {}; + CBPromise> colDefsPromise_; CBFuture> colDefsFuture_; - std::weak_ptr weakSelf_; - friend class GetColumnDefsCallback; }; } // namespace internal @@ -106,14 +124,11 @@ class TableHandleImpl { template using SFCallback = deephaven::client::utility::SFCallback; public: - static std::shared_ptr createEtcCallback(const TableHandleManagerImpl *thm); - // Create a callback that is already satisfied by "ticket". - static std::shared_ptr - createSatisfiedCallback(const TableHandleManagerImpl *thm, - Ticket ticket); + static std::pair, std::shared_ptr> + createEtcCallback(const TableHandleManagerImpl *thm); static std::shared_ptr create(std::shared_ptr thm, - Ticket ticket, std::shared_ptr etcCallback); + Ticket ticket, std::shared_ptr lazyState); TableHandleImpl(Private, std::shared_ptr &&thm, Ticket &&ticket, std::shared_ptr &&lazyState); ~TableHandleImpl(); @@ -179,7 +194,9 @@ class TableHandleImpl { std::shared_ptr subscribe(std::shared_ptr callback); void unsubscribe(std::shared_ptr handle); - // For debugging + /** + * Used in tests. + */ void observe(); const std::shared_ptr &managerImpl() const { return managerImpl_; } diff --git a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h index 7bed257455a..b8daefd321b 100644 --- a/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h +++ b/cpp-client/deephaven/client/include/private/deephaven/client/subscription/update_processor.h @@ -16,11 +16,13 @@ class UpdateProcessor final { struct Private {}; public: static std::shared_ptr startThread( + std::unique_ptr fsw, std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback); - UpdateProcessor(std::unique_ptr fsr, + UpdateProcessor(std::unique_ptr fsw, + std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback); ~UpdateProcessor(); @@ -31,6 +33,7 @@ class UpdateProcessor final { void runForeverHelper(); public: + std::unique_ptr fsw_; std::unique_ptr fsr_; std::shared_ptr colDefs_; std::shared_ptr callback_; diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h index da83426efcf..952e1c87ef0 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/table/table.h @@ -59,21 +59,66 @@ class Table { Table() = default; virtual ~Table() = default; + /** + * Get the RowSequence (in position space) that underlies this Table. + */ virtual std::shared_ptr getRowSequence() const = 0; + /** + * Gets a ColumnSource from the table by index. + * @param columnIndex Must be in the range [0, numColumns). + */ virtual std::shared_ptr getColumn(size_t columnIndex) const = 0; + /** + * Gets a ColumnSource from the table by name. 'strict' controls whether the method + * must succeed. + * @param name The name of the column. + * @param strict Whether the method must succeed. + * @return If 'name' was found, returns the ColumnSource. If 'name' was not found and 'strict' + * is true, throws an exception. If 'name' was not found and 'strict' is false, returns nullptr. + */ std::shared_ptr getColumn(std::string_view name, bool strict) const; - + /** + * Gets the index of a ColumnSource from the table by name. 'strict' controls whether the method + * must succeed. + * @param name The name of the column. + * @param strict Whether the method must succeed. + * @return If 'name' was found, returns the index of the ColumnSource. If 'name' was not found and + * 'strict' is true, throws an exception. If 'name' was not found and 'strict' is false, returns + * (size_t)-1. + */ + size_t getColumnIndex(std::string_view name, bool strict) const; + + /** + * Number of rows in the table. + */ virtual size_t numRows() const = 0; + /** + * Number of columns in the table. + */ virtual size_t numColumns() const = 0; - + /** + * The table schema. + */ virtual const Schema &schema() const = 0; + /** + * Creates an 'ostream adaptor' to use when printing the table. Example usage: + * std::cout << myTable.stream(true, false). + */ internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers) const; + /** + * Creates an 'ostream adaptor' to use when printing the table. Example usage: + * std::cout << myTable.stream(true, false, rowSeq). + */ internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers, std::shared_ptr rowSequence) const; + /** + * Creates an 'ostream adaptor' to use when printing the table. Example usage: + * std::cout << myTable.stream(true, false, rowSequences). + */ internal::TableStreamAdaptor stream(bool wantHeaders, bool wantRowNumbers, std::vector> rowSequences) const; }; diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h index 945b8433f01..7dd11e3a6ba 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/callbacks.h @@ -38,7 +38,7 @@ class SFCallback : public FailureCallback { createForFuture(); ~SFCallback() override = default; - virtual void onSuccess(Args... item) = 0; + virtual void onSuccess(Args ...args) = 0; }; // This helps us make a Callback that can hold some kind of invokeable item (function object or @@ -84,7 +84,7 @@ class SFCallbackCallable final : public SFCallback { template class SFCallbackFutureable final : public SFCallback { public: - void onSuccess(Args... args) final { + void onSuccess(Args ...args) final { promise_.set_value(std::make_tuple(std::forward(args)...)); } @@ -115,8 +115,8 @@ std::shared_ptr> SFCallback::createFromCallable(Cal std::forward(callable)); } -// Returns a pair whose first item is a SFCallback which satisfies a promise, and whose second -// item is a std::future which is the future corresponding to that promise. +// Returns a pair whose first item is a SFCallback which satisfies a promise, and whose second +// item is a std::future which is the future corresponding to that promise. template std::pair>, std::future>> SFCallback::createForFuture() { diff --git a/cpp-client/deephaven/client/include/public/deephaven/client/utility/cbfuture.h b/cpp-client/deephaven/client/include/public/deephaven/client/utility/cbfuture.h index d21dedecef2..e42398b310c 100644 --- a/cpp-client/deephaven/client/include/public/deephaven/client/utility/cbfuture.h +++ b/cpp-client/deephaven/client/include/public/deephaven/client/utility/cbfuture.h @@ -9,18 +9,16 @@ #include #include "deephaven/client/utility/callbacks.h" -namespace deephaven { -namespace client { -namespace utility { +namespace deephaven::client::utility { namespace internal { class PromiseStateBase { public: bool valid(); protected: - void checkValidLocked(bool expected); + void checkValidLocked(const std::unique_lock &guard, bool expected); void waitValidLocked(std::unique_lock *guard); - virtual bool validLocked() = 0; + virtual bool validLocked(const std::unique_lock &/*guard*/) = 0; std::mutex mutex_; std::condition_variable condVar_; @@ -38,13 +36,13 @@ class PromiseState final : public PromiseStateBase { return *value_; } - // oops. need to invoke all the waiters void setValue(T value) { - std::unique_lock guard(mutex_); - checkValidLocked(false); + // Need to invoke all the waiters. + std::unique_lock guard(mutex_); + checkValidLocked(guard, false); value_ = std::move(value); - std::vector>> cbs; + std::vector>> cbs; cbs.swap(callbacks_); guard.unlock(); @@ -56,11 +54,12 @@ class PromiseState final : public PromiseStateBase { // oops. need to invoke all the waiters void setError(std::exception_ptr ep) { - std::unique_lock guard(mutex_); - checkValidLocked(false); + // Need to invoke all the waiters. + std::unique_lock guard(mutex_); + checkValidLocked(guard, false); eptr_ = std::move(ep); - std::vector>> cbs; + std::vector>> cbs; cbs.swap(callbacks_); guard.unlock(); condVar_.notify_all(); @@ -69,13 +68,11 @@ class PromiseState final : public PromiseStateBase { } } - // Returns true if cb is the first-ever callback waiting for a result from this future. - // (Can be used to trigger deferred work that eventually sets the promise). - bool invoke(std::shared_ptr> cb) { + void invoke(std::shared_ptr> cb) { std::unique_lock guard(mutex_); - if (!validLocked()) { + if (!validLocked(guard)) { callbacks_.push_back(std::move(cb)); - return callbacks_.size() == 1; + return; } guard.unlock(); @@ -84,16 +81,15 @@ class PromiseState final : public PromiseStateBase { } else { cb->onFailure(eptr_); } - return false; } private: - bool validLocked() final { + bool validLocked(const std::unique_lock &/*guard*/) final { return value_.has_value() || eptr_ != nullptr; } std::optional value_; - std::vector>> callbacks_; + std::vector>> callbacks_; }; } @@ -125,10 +121,11 @@ class CBFuture { CBFuture(CBFuture &&other) noexcept = default; bool valid() { return state_->valid(); } + const T &value() { return state_->value(); } - bool invoke(std::shared_ptr> cb) { - return state_->invoke(std::move(cb)); + void invoke(std::shared_ptr> cb) { + state_->invoke(std::move(cb)); } private: @@ -144,6 +141,4 @@ template CBFuture CBPromise::makeFuture() { return CBFuture(state_); } -} // namespace utility -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::utility diff --git a/cpp-client/deephaven/client/src/arrowutil/arrow_util.cc b/cpp-client/deephaven/client/src/arrowutil/arrow_util.cc new file mode 100644 index 00000000000..ff9a40bdc71 --- /dev/null +++ b/cpp-client/deephaven/client/src/arrowutil/arrow_util.cc @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include "deephaven/client/arrowutil/arrow_util.h" + +namespace deephaven::client::arrowutil { +bool ArrowUtil::tryConvertTicketToFlightDescriptor(const std::string &ticket, + arrow::flight::FlightDescriptor *fd) { + if (ticket.length() != 5 || ticket[0] != 'e') { + return false; + } + uint32_t value; + memcpy(&value, ticket.data() + 1, sizeof(uint32_t)); + *fd = arrow::flight::FlightDescriptor::Path({"export", std::to_string(value)}); + return true; +}; +} // namespace deephaven::client::arrowutil diff --git a/cpp-client/deephaven/client/src/chunk/chunk_filler.cc b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc index 999ab8de090..e1045866139 100644 --- a/cpp-client/deephaven/client/src/chunk/chunk_filler.cc +++ b/cpp-client/deephaven/client/src/chunk/chunk_filler.cc @@ -3,6 +3,7 @@ */ #include "deephaven/client/chunk/chunk_filler.h" +#include "deephaven/client/arrowutil/arrow_traits.h" #include "deephaven/client/arrowutil/arrow_visitors.h" #include "deephaven/client/arrowutil/arrow_value_converter.h" #include "deephaven/client/container/row_sequence.h" diff --git a/cpp-client/deephaven/client/src/impl/table_handle_impl.cc b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc index 439f63981d4..a4e28df76fc 100644 --- a/cpp-client/deephaven/client/src/impl/table_handle_impl.cc +++ b/cpp-client/deephaven/client/src/impl/table_handle_impl.cc @@ -12,6 +12,7 @@ #include #include #include +#include "deephaven/client/arrowutil/arrow_util.h" #include "deephaven/client/impl/boolean_expression_impl.h" #include "deephaven/client/impl/columns_impl.h" #include "deephaven/client/impl/table_handle_manager_impl.h" @@ -35,6 +36,7 @@ using io::deephaven::proto::backplane::grpc::TableReference; using io::deephaven::proto::backplane::grpc::Ticket; using io::deephaven::proto::backplane::script::grpc::BindTableToVariableResponse; using deephaven::client::SortDirection; +using deephaven::client::arrowutil::ArrowUtil; using deephaven::client::impl::ColumnImpl; using deephaven::client::impl::DateTimeColImpl; using deephaven::client::impl::NumColImpl; @@ -46,11 +48,14 @@ using deephaven::client::column::MutableColumnSource; using deephaven::client::container::RowSequence; using deephaven::client::container::RowSequenceBuilder; using deephaven::client::container::RowSequenceIterator; +using deephaven::client::server::Server; using deephaven::client::table::Table; using deephaven::client::subscription::startSubscribeThread; using deephaven::client::subscription::SubscriptionHandle; using deephaven::client::utility::Callback; +using deephaven::client::utility::CBPromise; using deephaven::client::utility::ColumnDefinitions; +using deephaven::client::utility::Executor; using deephaven::client::utility::makeReservedVector; using deephaven::client::utility::okOrThrow; using deephaven::client::utility::separatedList; @@ -70,20 +75,20 @@ using io::deephaven::barrage::flatbuf::CreateBarrageSubscriptionRequest; namespace deephaven::client { namespace impl { -std::shared_ptr TableHandleImpl::createEtcCallback(const TableHandleManagerImpl *thm) { - return internal::LazyState::create(thm->server(), thm->flightExecutor()); -} - -std::shared_ptr TableHandleImpl::createSatisfiedCallback( - const TableHandleManagerImpl *thm, Ticket ticket) { - return internal::LazyState::createSatisfied(thm->server(), thm->flightExecutor(), - std::move(ticket)); +std::pair, std::shared_ptr> +TableHandleImpl::createEtcCallback(const TableHandleManagerImpl *thm) { + CBPromise ticketPromise; + auto ticketFuture = ticketPromise.makeFuture(); + auto cb = std::make_shared(std::move(ticketPromise)); + auto ls = std::make_shared(thm->server(), thm->flightExecutor(), + std::move(ticketFuture)); + return std::make_pair(std::move(cb), std::move(ls)); } std::shared_ptr TableHandleImpl::create(std::shared_ptr thm, - Ticket ticket, std::shared_ptr etcCallback) { + Ticket ticket, std::shared_ptr lazyState) { return std::make_shared(Private(), std::move(thm), std::move(ticket), - std::move(etcCallback)); + std::move(lazyState)); } TableHandleImpl::TableHandleImpl(Private, std::shared_ptr &&thm, @@ -95,43 +100,49 @@ TableHandleImpl::TableHandleImpl(Private, std::shared_ptr TableHandleImpl::select(std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->selectAsync(ticket_, std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->selectAsync(ticket_, std::move(columnSpecs), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::update(std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->updateAsync(ticket_, std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->updateAsync(ticket_, std::move(columnSpecs), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::view(std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->viewAsync(ticket_, std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->viewAsync(ticket_, std::move(columnSpecs), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::dropColumns(std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->dropColumnsAsync(ticket_, std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->dropColumnsAsync(ticket_, std::move(columnSpecs), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::updateView(std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->updateViewAsync(ticket_, std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->updateViewAsync(ticket_, std::move(columnSpecs), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::where(std::string condition) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->whereAsync(ticket_, std::move(condition), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->whereAsync(ticket_, std::move(condition), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::sort(std::vector sortPairs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); std::vector sortDescriptors; sortDescriptors.reserve(sortPairs.size()); @@ -144,12 +155,13 @@ std::shared_ptr TableHandleImpl::sort(std::vector sor sd.set_direction(which); sortDescriptors.push_back(std::move(sd)); } - auto resultTicket = managerImpl_->server()->sortAsync(ticket_, std::move(sortDescriptors), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto resultTicket = managerImpl_->server()->sortAsync(ticket_, std::move(sortDescriptors), + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::preemptive(int32_t sampleIntervalMs) { - throw std::runtime_error("SAD203"); + throw std::runtime_error("TODO: kosak"); // auto itdCallback = TableHandleImpl::createItdCallback(scope_->lowLevelSession()->executor()); // auto resultHandle = scope_->lowLevelSession()->preemptiveAsync(tableHandle_, sampleIntervalMs, // itdCallback); @@ -162,10 +174,10 @@ std::shared_ptr TableHandleImpl::defaultAggregateByDescriptor( descriptors.reserve(1); descriptors.push_back(std::move(descriptor)); - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->comboAggregateDescriptorAsync(ticket_, - std::move(descriptors), std::move(columnSpecs), false, cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(descriptors), std::move(columnSpecs), false, std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::defaultAggregateByType( @@ -182,10 +194,10 @@ std::shared_ptr TableHandleImpl::by(std::vector co std::shared_ptr TableHandleImpl::by( std::vector descriptors, std::vector groupByColumns) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->comboAggregateDescriptorAsync(ticket_, - std::move(descriptors), std::move(groupByColumns), false, cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(descriptors), std::move(groupByColumns), false, std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::minBy(std::vector columnSpecs) { @@ -270,10 +282,10 @@ std::shared_ptr TableHandleImpl::headBy(int64_t n, std::shared_ptr TableHandleImpl::headOrTailByHelper(int64_t n, bool head, std::vector columnSpecs) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->headOrTailByAsync(ticket_, head, n, - std::move(columnSpecs), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(columnSpecs), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::tail(int64_t n) { @@ -285,58 +297,58 @@ std::shared_ptr TableHandleImpl::head(int64_t n) { } std::shared_ptr TableHandleImpl::headOrTailHelper(bool head, int64_t n) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); - auto resultTicket = managerImpl_->server()->headOrTailAsync(ticket_, head, n, cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto resultTicket = managerImpl_->server()->headOrTailAsync(ticket_, head, n, std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::ungroup(bool nullFill, std::vector groupByColumns) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->ungroupAsync(ticket_, nullFill, std::move(groupByColumns), - cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::merge(std::string keyColumn, std::vector sourceTickets) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->mergeAsync(std::move(sourceTickets), - std::move(keyColumn), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(keyColumn), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::crossJoin(const TableHandleImpl &rightSide, std::vector columnsToMatch, std::vector columnsToAdd) const { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->crossJoinAsync(ticket_, rightSide.ticket_, - std::move(columnsToMatch), std::move(columnsToAdd), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(columnsToMatch), std::move(columnsToAdd), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::naturalJoin(const TableHandleImpl &rightSide, std::vector columnsToMatch, std::vector columnsToAdd) const { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->naturalJoinAsync(ticket_, rightSide.ticket_, - std::move(columnsToMatch), std::move(columnsToAdd), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(columnsToMatch), std::move(columnsToAdd), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::exactJoin(const TableHandleImpl &rightSide, std::vector columnsToMatch, std::vector columnsToAdd) const { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->exactJoinAsync(ticket_, rightSide.ticket_, - std::move(columnsToMatch), std::move(columnsToAdd), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + std::move(columnsToMatch), std::move(columnsToAdd), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::asOfJoin(AsOfJoinTablesRequest::MatchRule matchRule, const TableHandleImpl &rightSide, std::vector columnsToMatch, std::vector columnsToAdd) { - auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get()); + auto [cb, ls] = TableHandleImpl::createEtcCallback(managerImpl_.get()); auto resultTicket = managerImpl_->server()->asOfJoinAsync(matchRule, ticket_, - rightSide.ticket(), std::move(columnsToMatch), std::move(columnsToAdd), cb); - return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb)); + rightSide.ticket(), std::move(columnsToMatch), std::move(columnsToAdd), std::move(cb)); + return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleImpl::subscribe( @@ -404,7 +416,8 @@ void TableHandleImpl::lookupHelper(const std::string &columnName, auto colDefs = lazyState_->getColumnDefinitions(); auto ip = colDefs->map().find(columnName); if (ip == colDefs->map().end()) { - throw std::runtime_error(stringf(R"(Column name "%o" is not in the table)", columnName)); + auto message = stringf(R"(Column name "%o" is not in the table)", columnName); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } auto actualType = ip->second->id(); for (auto type : validTypes) { @@ -419,7 +432,7 @@ void TableHandleImpl::lookupHelper(const std::string &columnName, }; auto message = stringf("Column lookup for %o: Expected Arrow type: one of {%o}. Actual type %o", columnName, separatedList(validTypes.begin(), validTypes.end(), ", ", render), actualType); - throw std::runtime_error(message); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } void TableHandleImpl::bindToVariableAsync(std::string variable, @@ -447,38 +460,21 @@ void TableHandleImpl::observe() { } namespace internal { -std::shared_ptr LazyState::create(std::shared_ptr server, - std::shared_ptr flightExecutor) { - auto result = std::make_shared(Private(), std::move(server), std::move(flightExecutor)); - result->weakSelf_ = result; - return result; -} - -std::shared_ptr -LazyState::createSatisfied(std::shared_ptr server, std::shared_ptr flightExecutor, - Ticket ticket) { - auto result = create(std::move(server), std::move(flightExecutor)); - result->ticketPromise_.setValue(std::move(ticket)); - return result; -} - -LazyState::LazyState(Private, std::shared_ptr &&server, - std::shared_ptr &&flightExecutor) : server_(std::move(server)), - flightExecutor_(std::move(flightExecutor)), ticketFuture_(ticketPromise_.makeFuture()), - colDefsFuture_(colDefsPromise_.makeFuture()) {} -LazyState::~LazyState() = default; +ExportedTableCreationCallback::ExportedTableCreationCallback(CBPromise &&ticketPromise) : + ticketPromise_(std::move(ticketPromise)) {} +ExportedTableCreationCallback::~ExportedTableCreationCallback() = default; -void LazyState::onSuccess(ExportedTableCreationResponse item) { +void ExportedTableCreationCallback::onSuccess(ExportedTableCreationResponse item) { if (!item.result_id().has_ticket()) { - auto ep = std::make_exception_ptr(std::runtime_error( - "ExportedTableCreationResponse did not contain a ticket")); + const char *message = "ExportedTableCreationResponse did not contain a ticket"; + auto ep = std::make_exception_ptr(std::runtime_error(DEEPHAVEN_DEBUG_MSG(message))); onFailure(std::move(ep)); return; } ticketPromise_.setValue(item.result_id().ticket()); } -void LazyState::onFailure(std::exception_ptr error) { +void ExportedTableCreationCallback::onFailure(std::exception_ptr error) { ticketPromise_.setError(std::move(error)); } @@ -486,77 +482,50 @@ void LazyState::waitUntilReady() { (void)ticketFuture_.value(); } -std::shared_ptr LazyState::getColumnDefinitions() { - // Shortcut if we have column definitions - if (colDefsFuture_.valid()) { - // value or exception - return colDefsFuture_.value(); - } - - auto res = SFCallback>::createForFuture(); - getColumnDefinitionsAsync(std::move(res.first)); - return std::get<0>(res.second.get()); -} - class GetColumnDefsCallback final : - public SFCallback, - public SFCallback &>, - public Callback<> { - struct Private {}; + public SFCallback, + public Callback<>, + public std::enable_shared_from_this { public: - static std::shared_ptr create(std::shared_ptr owner, - std::shared_ptr>> cb) { - auto result = std::make_shared(Private(), std::move(owner), std::move(cb)); - result->weakSelf_ = result; - return result; - } - - GetColumnDefsCallback(Private, std::shared_ptr &&owner, - std::shared_ptr>> &&cb) : - owner_(std::move(owner)), outer_(std::move(cb)) {} + GetColumnDefsCallback(std::shared_ptr server, std::shared_ptr flightExecutor, + CBPromise> colDefsPromise) : server_(std::move(server)), + flightExecutor_(std::move(flightExecutor)), colDefsPromise_(std::move(colDefsPromise)) {} ~GetColumnDefsCallback() final = default; void onFailure(std::exception_ptr ep) final { - outer_->onFailure(std::move(ep)); + colDefsPromise_.setError(std::move(ep)); } - void onSuccess(const Ticket &ticket) final { - auto needsTrigger = owner_->colDefsFuture_.invoke(weakSelf_.lock()); - if (!needsTrigger) { - return; - } - ticket_ = ticket; - owner_->flightExecutor_->invoke(weakSelf_.lock()); + void onSuccess(Ticket ticket) final { + ticket_ = std::move(ticket); + flightExecutor_->invoke(shared_from_this()); } - void onSuccess(const std::shared_ptr &colDefs) final { - outer_->onSuccess(colDefs); + void invoke() final { + try { + invokeHelper(); + } catch (...) { + colDefsPromise_.setError(std::current_exception()); + } } - void invoke() final { + void invokeHelper() { arrow::flight::FlightCallOptions options; - options.headers.push_back(owner_->server_->makeBlessing()); - std::unique_ptr fsr; - arrow::flight::Ticket tkt; - tkt.ticket = ticket_.ticket(); - - auto doGetRes = owner_->server_->flightClient()->DoGet(options, tkt, &fsr); - if (!doGetRes.ok()) { - auto message = stringf("Doget failed with status %o", doGetRes.ToString()); - auto ep = std::make_exception_ptr(std::runtime_error(message)); - owner_->colDefsPromise_.setError(std::move(ep)); - return; - } + options.headers.push_back(server_->makeBlessing()); - auto schemaHolder = fsr->GetSchema(); - if (!schemaHolder.ok()) { - auto message = stringf("GetSchema failed with status %o", schemaHolder.status().ToString()); - auto ep = std::make_exception_ptr(std::runtime_error(message)); - owner_->colDefsPromise_.setError(std::move(ep)); - return; + arrow::flight::FlightDescriptor fd; + if (!ArrowUtil::tryConvertTicketToFlightDescriptor(ticket_.ticket(), &fd)) { + auto message = stringf("Couldn't convert ticket %o to a flight descriptor", ticket_.ticket()); + throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } - auto &schema = schemaHolder.ValueOrDie(); + std::unique_ptr schemaResult; + auto gsResult = server_->flightClient()->GetSchema(options, fd, &schemaResult); + okOrThrow(DEEPHAVEN_EXPR_MSG(gsResult)); + + std::shared_ptr schema; + auto schemaRes = schemaResult->GetSchema(nullptr, &schema); + okOrThrow(DEEPHAVEN_EXPR_MSG(schemaRes)); std::vector>> colVec; std::map> colMap; @@ -565,22 +534,49 @@ class GetColumnDefsCallback final : colVec.emplace_back(f->name(), f->type()); colMap[f->name()] = f->type(); } - std::shared_ptr colDefs(new ColumnDefinitions(std::move(colVec), std::move(colMap))); - owner_->colDefsPromise_.setValue(std::move(colDefs)); + std::shared_ptr colDefs(new ColumnDefinitions(std::move(colVec), + std::move(colMap))); + colDefsPromise_.setValue(std::move(colDefs)); } - std::shared_ptr owner_; - std::shared_ptr>> outer_; - std::weak_ptr weakSelf_; + std::shared_ptr server_; + std::shared_ptr flightExecutor_; + CBPromise> colDefsPromise_; Ticket ticket_; }; +LazyState::LazyState(std::shared_ptr server, std::shared_ptr flightExecutor, + CBFuture ticketFuture) : server_(std::move(server)), + flightExecutor_(std::move(flightExecutor)), ticketFuture_(std::move(ticketFuture)), + requestSent_(false), colDefsFuture_(colDefsPromise_.makeFuture()) {} + +LazyState::~LazyState() = default; + +std::shared_ptr LazyState::getColumnDefinitions() { + // Shortcut if we have column definitions + if (colDefsFuture_.valid()) { + // value or exception + return colDefsFuture_.value(); + } + + auto [cb, fut] = SFCallback>::createForFuture(); + getColumnDefinitionsAsync(std::move(cb)); + auto resultTuple = fut.get(); + return std::get<0>(resultTuple); +} + void LazyState::getColumnDefinitionsAsync( std::shared_ptr>> cb) { - auto innerCb = GetColumnDefsCallback::create(weakSelf_.lock(), std::move(cb)); - ticketFuture_.invoke(std::move(innerCb)); -} + colDefsFuture_.invoke(std::move(cb)); + if (requestSent_.test_and_set()) { + return; + } + + auto cdCallback = std::make_shared(server_, flightExecutor_, + std::move(colDefsPromise_)); + ticketFuture_.invoke(std::move(cdCallback)); +} } // namespace internal } // namespace impl } // namespace deephaven::client diff --git a/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc b/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc index bc3d9250acd..c32577ac57e 100644 --- a/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc +++ b/cpp-client/deephaven/client/src/impl/table_handle_manager_impl.cc @@ -35,29 +35,33 @@ TableHandleManagerImpl::TableHandleManagerImpl(Private, Ticket &&consoleId, TableHandleManagerImpl::~TableHandleManagerImpl() = default; std::shared_ptr TableHandleManagerImpl::emptyTable(int64_t size) { - auto cb = TableHandleImpl::createEtcCallback(this); + auto [cb, ls] = TableHandleImpl::createEtcCallback(this); auto resultTicket = server_->emptyTableAsync(size, cb); - return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(cb)); + return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleManagerImpl::fetchTable(std::string tableName) { - auto cb = TableHandleImpl::createEtcCallback(this); + auto [cb, ls] = TableHandleImpl::createEtcCallback(this); auto resultTicket = server_->fetchTableAsync(std::move(tableName), cb); - return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(cb)); + return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(ls)); } std::shared_ptr TableHandleManagerImpl::timeTable(int64_t startTimeNanos, int64_t periodNanos) { - auto cb = TableHandleImpl::createEtcCallback(this); - auto resultTicket = server_->timeTableAsync(startTimeNanos, periodNanos, cb); - return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(cb)); + auto [cb, ls] = TableHandleImpl::createEtcCallback(this); + auto resultTicket = server_->timeTableAsync(startTimeNanos, periodNanos, std::move(cb)); + return TableHandleImpl::create(self_.lock(), std::move(resultTicket), std::move(ls)); } std::tuple, arrow::flight::FlightDescriptor> TableHandleManagerImpl::newTicket() const { auto[ticket, fd] = server_->newTicketAndFlightDescriptor(); - auto cb = TableHandleImpl::createSatisfiedCallback(this, ticket); - auto th = TableHandleImpl::create(self_.lock(), std::move(ticket), std::move(cb)); + + utility::CBPromise ticketPromise; + ticketPromise.setValue(ticket); + auto ls = std::make_shared(server_, flightExecutor_, + ticketPromise.makeFuture()); + auto th = TableHandleImpl::create(self_.lock(), std::move(ticket), std::move(ls)); return std::make_tuple(std::move(th), std::move(fd)); } } // namespace deephaven::client::impl diff --git a/cpp-client/deephaven/client/src/subscription/classic_table_state.cc b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc index 48a2f8fb4b2..786eba73437 100644 --- a/cpp-client/deephaven/client/src/subscription/classic_table_state.cc +++ b/cpp-client/deephaven/client/src/subscription/classic_table_state.cc @@ -5,6 +5,7 @@ #include #include "deephaven/client/arrowutil/arrow_visitors.h" +#include "deephaven/client/arrowutil/arrow_traits.h" #include "deephaven/client/chunk/chunk_filler.h" #include "deephaven/client/chunk/chunk_maker.h" #include "deephaven/client/column/column_source.h" diff --git a/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc index 04814213e38..8a6d530afc8 100644 --- a/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc +++ b/cpp-client/deephaven/client/src/subscription/subscribe_thread.cc @@ -148,7 +148,7 @@ std::shared_ptr SubscribeState::invokeHelper() { okOrThrow(DEEPHAVEN_EXPR_MSG(fsw->WriteMetadata(std::move(buffer)))); // Run forever (until error or cancellation) - auto processor = UpdateProcessor::startThread(std::move(fsr), std::move(colDefs_), + auto processor = UpdateProcessor::startThread(std::move(fsw), std::move(fsr), std::move(colDefs_), std::move(callback_)); return std::make_shared(std::move(processor)); } diff --git a/cpp-client/deephaven/client/src/subscription/update_processor.cc b/cpp-client/deephaven/client/src/subscription/update_processor.cc index 8386b6180b4..f4278917a6a 100644 --- a/cpp-client/deephaven/client/src/subscription/update_processor.cc +++ b/cpp-client/deephaven/client/src/subscription/update_processor.cc @@ -84,20 +84,22 @@ class FlightStreamState final { } // namespace std::shared_ptr UpdateProcessor::startThread( + std::unique_ptr fsw, std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback) { - auto result = std::make_shared(std::move(fsr), + auto result = std::make_shared(std::move(fsw), std::move(fsr), std::move(colDefs), std::move(callback)); std::thread t(&UpdateProcessor::runForever, result); t.detach(); return result; } -UpdateProcessor::UpdateProcessor(std::unique_ptr fsr, +UpdateProcessor::UpdateProcessor(std::unique_ptr fsw, + std::unique_ptr fsr, std::shared_ptr colDefs, std::shared_ptr callback) : - fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), callback_(std::move(callback)), - cancelled_(false) {} + fsw_(std::move(fsw)), fsr_(std::move(fsr)), colDefs_(std::move(colDefs)), + callback_(std::move(callback)), cancelled_(false) {} UpdateProcessor::~UpdateProcessor() = default; @@ -355,8 +357,7 @@ FlightStreamState::processModifies(const std::shared_ptr
    {@link Builder#port(int)}
    {@value HTTP_TARGET_URL}{@link Builder#targetUrl(String)}
    {@value SCHEDULER_POOL_SIZE}{@link Builder#schedulerPoolSize(int)}
    &beforeModifies) auto rowsAvailable = mr->take(numRowsAvailable); mr = mr->drop(numRowsAvailable); - auto indexRowsAvailable = tableState_->convertKeysToIndices(*rowsAvailable); - tableState_->modifyData(i, *cols[i], srcChunkOffset_[i], *indexRowsAvailable); + tableState_->modifyData(i, *cols[i], srcChunkOffset_[i], *rowsAvailable); // This doesn't *really* matter because it will be reset by the readNext(). srcChunkOffset_[i] += numRowsAvailable; } diff --git a/cpp-client/deephaven/client/src/table/table.cc b/cpp-client/deephaven/client/src/table/table.cc index 2defa7f9810..b5c81690e22 100644 --- a/cpp-client/deephaven/client/src/table/table.cc +++ b/cpp-client/deephaven/client/src/table/table.cc @@ -28,20 +28,29 @@ void printTableData(std::ostream &stream, const Table &table, bool wantHeaders, bool wantRowNumbers, bool highlightCells); } // namespace -std::shared_ptr Table::getColumn(std::string_view name, bool strict) const { +size_t Table::getColumnIndex(std::string_view name, bool strict) const { // TODO(kosak): improve linear search. const auto &cols = schema().columns(); for (size_t i = 0; i < cols.size(); ++i) { if (cols[i].first == name) { - return getColumn(i); + return i; } } + // Not found: check strictness flag. if (strict) { auto message = stringf("Column name '%o' not found", name); throw std::runtime_error(DEEPHAVEN_DEBUG_MSG(message)); } - return {}; + return (size_t)-1; +} + +std::shared_ptr Table::getColumn(std::string_view name, bool strict) const { + auto index = getColumnIndex(name, strict); + if (index == (size_t)-1) { + return {}; + } + return getColumn(index); } internal::TableStreamAdaptor Table::stream(bool wantHeaders, bool wantRowNumbers) const { diff --git a/cpp-client/deephaven/client/src/utility/cbfuture.cc b/cpp-client/deephaven/client/src/utility/cbfuture.cc index f9790d55c07..a274d6878ca 100644 --- a/cpp-client/deephaven/client/src/utility/cbfuture.cc +++ b/cpp-client/deephaven/client/src/utility/cbfuture.cc @@ -5,19 +5,16 @@ #include "deephaven/client/utility/utility.h" -namespace deephaven { -namespace client { -namespace utility { -namespace internal { +namespace deephaven::client::utility::internal { using deephaven::client::utility::stringf; bool PromiseStateBase::valid() { - std::unique_lock guard(mutex_); - return validLocked(); + std::unique_lock guard(mutex_); + return validLocked(guard); } -void PromiseStateBase::checkValidLocked(bool expected) { - bool actual = validLocked(); +void PromiseStateBase::checkValidLocked(const std::unique_lock &guard, bool expected) { + bool actual = validLocked(guard); if (expected != actual) { auto message = stringf("Expected lock state %o, actual lock state %o", expected, actual); throw std::runtime_error(message); @@ -25,14 +22,11 @@ void PromiseStateBase::checkValidLocked(bool expected) { } void PromiseStateBase::waitValidLocked(std::unique_lock *guard) { - while (!validLocked()) { + while (!validLocked(*guard)) { condVar_.wait(*guard); } if (eptr_ != nullptr) { std::rethrow_exception(eptr_); } } -} // namespace internal -} // namespace utility -} // namespace client -} // namespace deephaven +} // namespace deephaven::client::utility::internal diff --git a/cpp-examples/demos/CMakeLists.txt b/cpp-examples/demos/CMakeLists.txt index 1739b6f870b..398940f2aa2 100644 --- a/cpp-examples/demos/CMakeLists.txt +++ b/cpp-examples/demos/CMakeLists.txt @@ -6,14 +6,10 @@ set(CMAKE_CXX_STANDARD 17) add_subdirectory(../../cpp-client/deephaven deephaven_dir) #find_package(deephaven REQUIRED) -find_package(Arrow REQUIRED) -find_package(ArrowFlight REQUIRED HINTS ${Arrow_DIR}) -find_package(Protobuf REQUIRED) -find_package(gRPC REQUIRED) -find_package(Threads REQUIRED) - add_executable(chapter1 chapter1.cc) add_executable(chapter2 chapter2.cc) +add_executable(chapter3 chapter3.cc) target_link_libraries(chapter1 deephaven::client) target_link_libraries(chapter2 deephaven::client) +target_link_libraries(chapter3 deephaven::client) diff --git a/cpp-examples/demos/chapter3.cc b/cpp-examples/demos/chapter3.cc new file mode 100644 index 00000000000..e7f4c8396e7 --- /dev/null +++ b/cpp-examples/demos/chapter3.cc @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +#include +#include +#include +#include +#include "deephaven/client/client.h" +#include "deephaven/client/chunk/chunk.h" +#include "deephaven/client/column/column_source.h" +#include "deephaven/client/utility/utility.h" + +using deephaven::client::Client; +using deephaven::client::TableHandle; +using deephaven::client::TableHandleManager; +using deephaven::client::chunk::Int64Chunk; +using deephaven::client::column::Int64ColumnSource; +using deephaven::client::container::RowSequence; +using deephaven::client::table::Table; +using deephaven::client::utility::verboseCast; + +namespace { +void mainMenu(const TableHandleManager &manager); + +// demo options +void printFull(const TableHandleManager &manager); +void printDiffs(const TableHandleManager &manager); +void sumDiffs(const TableHandleManager &manager); + +// utilities +int64_t readNumber(std::string_view prompt); +std::string readString(std::string_view prompt); + +// a bunch of work to create an ostream adaptor +template +class OptionalAdaptor { +public: + explicit OptionalAdaptor(const ARROW_OPTIONAL &optional) : optional_(optional) {} + +private: + const ARROW_OPTIONAL &optional_; + + friend std::ostream &operator<<(std::ostream &s, const OptionalAdaptor &self) { + if (!self.optional_.has_value()) { + return s << "null"; + } + return s << *self.optional_; + } +}; + +template +inline OptionalAdaptor adaptOptional(const ARROW_OPTIONAL &optional) { + return OptionalAdaptor(optional); +} +} // namespace + +int main() { + try { + const char *server = "localhost:10000"; + auto client = Client::connect(server); + auto manager = client.getManager(); + + while (true) { + mainMenu(manager); + } + } catch (const std::exception &e) { + std::cerr << "Caught exception: " << e.what() << '\n'; + } +} + +namespace { +void mainMenu(const TableHandleManager &manager) { + auto selection = readNumber( + "*** CHAPTER 3: MAIN MENU ***\n" + "1 - print full table\n" + "2 - print diffs with library\n" + "3 - process diffs\n" + "\n" + "Please select 1-3: " + ); + + switch (selection) { + case 1: + printFull(manager); + break; + + case 2: + printDiffs(manager); + break; + + case 3: + sumDiffs(manager); + break; + + default: + std::cout << "Invalid selection\n"; + } +} + +class CallbackPrintFull final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + std::cout << "=== The Full Table ===\n" + << update.current()->stream(true, true) + << '\n'; + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } +}; + +void printFull(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +class CallbackPrintDiffs final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + if (update.beforeRemoves() != update.afterRemoves()) { + std::cout << "=== REMOVES ===\n" + << update.beforeRemoves()->stream(true, true, update.removedRows()) + << '\n'; + } + if (update.beforeAdds() != update.afterAdds()) { + std::cout << "=== ADDS ===\n" + << update.afterAdds()->stream(true, true, update.addedRows()) + << '\n'; + } + if (update.beforeModifies() != update.afterModifies()) { + std::cout << "=== MODIFIES (BEFORE) ===\n" + << update.beforeModifies()->stream(true, true, update.modifiedRows()) + << '\n'; + std::cout << "=== MODIFIES (AFTER) ===\n" + << update.afterModifies()->stream(true, true, update.modifiedRows()) + << '\n'; + } + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } +}; + +void printDiffs(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +class CallbackSumDiffs final : public deephaven::client::TickingCallback { +public: + void onTick(deephaven::client::TickingUpdate update) final { + auto colIndex = update.current()->getColumnIndex("IntValue", true); + + processDeltas(*update.beforeRemoves(), colIndex, update.removedRows(), -1); + processDeltas(*update.afterAdds(), colIndex, update.addedRows(), 1); + + size_t numModifies = 0; + if (update.modifiedRows().size() > colIndex) { + auto rowSequence = update.modifiedRows()[colIndex]; + processDeltas(*update.beforeModifies(), colIndex, rowSequence, -1); + processDeltas(*update.afterModifies(), colIndex, rowSequence, 1); + + numModifies += rowSequence->size(); + } + std::cout << "int64Sum is " << int64Sum_ + << ", adds=" << update.addedRows()->size() + << ", removes=" << update.removedRows()->size() + << ", modifies=" << numModifies + << '\n'; + } + + void onFailure(std::exception_ptr ep) final { + try { + std::rethrow_exception(ep); + } catch (const std::runtime_error &e) { + std::cout << "Caught error: " << e.what() << std::endl; + } + } + +private: + void processDeltas(const Table &table, size_t colIndex, std::shared_ptr rows, + int64_t parity) { + const auto int64ColGeneric = table.getColumn(colIndex); + const auto *typedInt64Col = + verboseCast(DEEPHAVEN_EXPR_MSG(int64ColGeneric.get())); + + size_t chunkSize = 8192; + auto dataChunk = Int64Chunk::create(chunkSize); + + while (!rows->empty()) { + auto theseRows = rows->take(chunkSize); + auto theseRowsSize = theseRows->size(); + rows = rows->drop(chunkSize); + + typedInt64Col->fillChunk(*theseRows, &dataChunk, nullptr); + + for (size_t i = 0; i < theseRowsSize; ++i) { + int64Sum_ += dataChunk.data()[i] * parity; + } + } + } + +private: + int64_t int64Sum_ = 0; +}; + +void sumDiffs(const TableHandleManager &manager) { + auto tableName = readString("Please enter the table name: "); + + auto table = manager.fetchTable(tableName); + + auto callback = std::make_shared(); + auto cookie = table.subscribe(std::move(callback)); + auto dummy = readString("Press enter to unsubscribe: "); + table.unsubscribe(std::move(cookie)); +} + +std::string readString(std::string_view prompt) { + std::cout << prompt; + std::string line; + std::getline(std::cin, line); + return line; +} + +int64_t readNumber(std::string_view prompt) { + while (true) { + auto line = readString(prompt); + if (line.empty()) { + continue; + } + int64_t result; + auto [ptr, ec] = std::from_chars(line.data(), line.data() + line.size(), result); + if (ec == std::errc()) { + return result; + } + std::cout << "Input not parseable as int64. Please try again\n"; + } +} +} // namespace From 58ec9703b6493d24ce6a510dd8ed748241330a30 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Mon, 10 Oct 2022 09:09:11 -0600 Subject: [PATCH 208/215] QueryCompiler: Use SHA-256 hash instead of String#hashCode on class body (#2962) --- .../java/io/deephaven/util/ByteUtils.java | 22 +++++ .../engine/context/QueryCompiler.java | 93 +++++++++---------- 2 files changed, 64 insertions(+), 51 deletions(-) create mode 100644 Util/src/main/java/io/deephaven/util/ByteUtils.java diff --git a/Util/src/main/java/io/deephaven/util/ByteUtils.java b/Util/src/main/java/io/deephaven/util/ByteUtils.java new file mode 100644 index 00000000000..4eac172e688 --- /dev/null +++ b/Util/src/main/java/io/deephaven/util/ByteUtils.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.util; + +public class ByteUtils { + private static final char[] HEX_LOOKUP = "0123456789abcdef".toCharArray(); + + public static String byteArrToHex(byte[] bytes) { + // our output size will be exactly 2x byte-array length + final char[] buffer = new char[bytes.length * 2]; + + for (int ii = 0; ii < bytes.length; ii++) { + // extract the upper 4 bits + buffer[ii << 1] = HEX_LOOKUP[(bytes[ii] >> 4) & 0xF]; + // extract the lower 4 bits + buffer[(ii << 1) + 1] = HEX_LOOKUP[bytes[ii] & 0xF]; + } + + return new String(buffer); + } +} diff --git a/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java index 2e522750d84..dc17f706cbe 100644 --- a/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java +++ b/engine/context/src/main/java/io/deephaven/engine/context/QueryCompiler.java @@ -10,6 +10,7 @@ import io.deephaven.datastructures.util.CollectionUtil; import io.deephaven.internal.log.LoggerFactory; import io.deephaven.io.logger.Logger; +import io.deephaven.util.ByteUtils; import org.apache.commons.text.StringEscapeUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -21,10 +22,13 @@ import java.net.URI; import java.net.URL; import java.net.URLClassLoader; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -228,34 +232,34 @@ public Class compile(@NotNull final String className, @NotNull final String packageNameRoot, @Nullable final StringBuilder codeLog, @NotNull final Map> parameterClasses) { - CompletableFuture> promise; - final boolean promiseAlreadyMade; + CompletableFuture> future; + final boolean alreadyExists; synchronized (this) { - promise = knownClasses.get(classBody); - if (promise != null) { - promiseAlreadyMade = true; + future = knownClasses.get(classBody); + if (future != null) { + alreadyExists = true; } else { - promise = new CompletableFuture<>(); - knownClasses.put(classBody, promise); - promiseAlreadyMade = false; + future = new CompletableFuture<>(); + knownClasses.put(classBody, future); + alreadyExists = false; } } - // Someone else has already made the promise. I'll just wait for the answer. - if (promiseAlreadyMade) { + // Someone else has already made the future. I'll just wait for the answer. + if (alreadyExists) { try { - return promise.get(); + return future.get(); } catch (InterruptedException | ExecutionException error) { throw new UncheckedDeephavenException(error); } } - // It's my job to fulfill the promise + // It's my job to fulfill the future. try { - return compileHelper(className, classBody, packageNameRoot, codeLog, parameterClasses); + return compileHelper(className, classBody, packageNameRoot, codeLog, parameterClasses, future); } catch (RuntimeException e) { - promise.completeExceptionally(e); + future.completeExceptionally(e); throw e; } } @@ -409,23 +413,23 @@ private String getClassPath() { return sb.toString(); } - private WritableURLClassLoader getClassLoader() { - return ucl; - } - private Class compileHelper(@NotNull final String className, @NotNull final String classBody, @NotNull final String packageNameRoot, @Nullable final StringBuilder codeLog, - @NotNull final Map> parameterClasses) { - // NB: We include class name hash in order to (hopefully) account for case insensitive file systems. - final int classNameHash = className.hashCode(); - final int classBodyHash = classBody.hashCode(); + @NotNull final Map> parameterClasses, + @NotNull final CompletableFuture> resultFuture) { + final MessageDigest digest; + try { + digest = MessageDigest.getInstance("SHA-256"); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("Unable to create SHA-256 hashing digest", e); + } + final String basicHashText = + ByteUtils.byteArrToHex(digest.digest(classBody.getBytes(StandardCharsets.UTF_8))); for (int pi = 0; pi < MAX_CLASS_COLLISIONS; ++pi) { - final String packageNameSuffix = "c" - + (classBodyHash < 0 ? "m" : "") + (classBodyHash & Integer.MAX_VALUE) - + (classNameHash < 0 ? "n" : "") + (classNameHash & Integer.MAX_VALUE) + final String packageNameSuffix = "c_" + basicHashText + (pi == 0 ? "" : ("p" + pi)) + "v" + JAVA_CLASS_VERSION; final String packageName = (packageNameRoot.isEmpty() @@ -468,43 +472,30 @@ private Class compileHelper(@NotNull final String className, final String identifyingFieldValue = loadIdentifyingField(result); - // We have a class. It either contains the formula we are looking for (cases 2, A, and B) or a different - // formula with the same name (cases 3 and C). In either case, we should store the result in our cache, - // either fulfilling an existing promise or making a new, fulfilled promise. - synchronized (this) { - // Note we are doing something kind of subtle here. We are removing an entry whose key was matched by - // value equality and replacing it with a value-equal but reference-different string that is a static - // member of the class we just loaded. This should be easier on the garbage collector because we are - // replacing a calculated value with a classloaded value and so in effect we are "canonicalizing" the - // string. This is important because these long strings stay in knownClasses forever. - CompletableFuture> p = knownClasses.remove(identifyingFieldValue); - if (p == null) { - // If we encountered a different class than the one we're looking for, make a fresh promise and - // immediately fulfill it. This is for the purpose of populating the cache in case someone comes - // looking for that class later. Rationale: we already did all the classloading work; no point in - // throwing it away now, even though this is not the class we're looking for. - p = new CompletableFuture<>(); - } - knownClasses.put(identifyingFieldValue, p); - // It's also possible that some other code has already fulfilled this promise with exactly the same - // class. That's ok though: the promise code does not reject multiple sets to the identical value. - p.complete(result); - } - - // If the class we found was indeed the class we were looking for, then return it + // If the class we found was indeed the class we were looking for, then complete the future and return it. if (classBody.equals(identifyingFieldValue)) { - // Cases 2, A, and B. if (codeLog != null) { // If the caller wants a textual copy of the code we either made, or just found in the cache. codeLog.append(makeFinalCode(className, classBody, packageName)); } + resultFuture.complete(result); + synchronized (this) { + // Note we are doing something kind of subtle here. We are removing an entry whose key was matched + // by value equality and replacing it with a value-equal but reference-different string that is a + // static member of the class we just loaded. This should be easier on the garbage collector because + // we are replacing a calculated value with a classloaded value and so in effect we are + // "canonicalizing" the string. This is important because these long strings stay in knownClasses + // forever. + knownClasses.remove(identifyingFieldValue); + knownClasses.put(identifyingFieldValue, resultFuture); + } return result; } // Try the next hash name } throw new IllegalStateException("Found too many collisions for package name root " + packageNameRoot + ", class name=" + className - + ", class body hash=" + classBodyHash + " - contact Deephaven support!"); + + ", class body hash=" + basicHashText + " - contact Deephaven support!"); } private Class tryLoadClassByFqName(String fqClassName, Map> parameterClasses) { From e5d9c826f6c157777b08a2e26478ac7c24e39e32 Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Tue, 11 Oct 2022 09:29:37 -0600 Subject: [PATCH 209/215] Barrage: apply redirection mapping is broken into disjoint groups (#2942) --- .../util/datastructures/SizeException.java | 18 +- .../distinct/LongChunkedDistinctOperator.java | 1 + .../distinct/LongRollupDistinctOperator.java | 1 + .../unique/LongChunkedUniqueOperator.java | 1 + .../unique/LongRollupUniqueOperator.java | 1 + .../chunk/BaseChunkInputStreamGenerator.java | 23 ++- .../chunk/ByteChunkInputStreamGenerator.java | 9 +- .../chunk/CharChunkInputStreamGenerator.java | 9 +- .../chunk/ChunkInputStreamGenerator.java | 87 +++++---- .../DoubleChunkInputStreamGenerator.java | 9 +- .../chunk/FloatChunkInputStreamGenerator.java | 9 +- .../chunk/IntChunkInputStreamGenerator.java | 9 +- .../chunk/LongChunkInputStreamGenerator.java | 9 +- .../chunk/ShortChunkInputStreamGenerator.java | 9 +- .../VarBinaryChunkInputStreamGenerator.java | 3 +- .../VarListChunkInputStreamGenerator.java | 6 +- .../VectorChunkInputStreamGenerator.java | 11 +- .../barrage/util/BarrageStreamReader.java | 8 +- .../chunk/BarrageColumnRoundTripTest.java | 2 +- .../server/arrow/ArrowFlightUtil.java | 5 +- .../barrage/BarrageMessageProducer.java | 62 +++---- .../barrage/BarrageStreamGenerator.java | 173 +++++++++++++----- .../barrage/BarrageMessageRoundTripTest.java | 79 +++++++- .../test/FlightMessageRoundTripTest.java | 75 ++++---- 24 files changed, 414 insertions(+), 205 deletions(-) diff --git a/Util/src/main/java/io/deephaven/util/datastructures/SizeException.java b/Util/src/main/java/io/deephaven/util/datastructures/SizeException.java index c6747165f2b..e0b81e36c7e 100644 --- a/Util/src/main/java/io/deephaven/util/datastructures/SizeException.java +++ b/Util/src/main/java/io/deephaven/util/datastructures/SizeException.java @@ -14,9 +14,11 @@ */ public class SizeException extends UncheckedDeephavenException { + private final long maximumSize; + /** * Construct an exception, with a message appropriate for the given arguments. - * + * * @param messagePrefix An optional prefix for the message * @param inputSize The input size for the message * @param maximumSize The maximum size for the message @@ -24,12 +26,13 @@ public class SizeException extends UncheckedDeephavenException { public SizeException(@Nullable final String messagePrefix, final long inputSize, final long maximumSize) { super((messagePrefix == null ? "" : messagePrefix + ": ") + "Input size " + inputSize + " larger than maximum " + maximumSize); + this.maximumSize = maximumSize; } /** * Construct an exception, with a message appropriate for the given arguments. Maximum size is assumed to be * {@link Integer#MAX_VALUE}. - * + * * @param messagePrefix An optional prefix for the message * @param inputSize The input size for the message */ @@ -40,11 +43,20 @@ public SizeException(@Nullable final String messagePrefix, final long inputSize) /** * Construct an exception, with a message appropriate for the given arguments. Maximum size is assumed to be * {@link Integer#MAX_VALUE}, and no prefix is included. - * + * * @param inputSize The input size for the message */ @SuppressWarnings("unused") public SizeException(final long inputSize) { this(null, inputSize, Integer.MAX_VALUE); } + + /** + * Get the maximum size that was exceeded. + * + * @return The maximum size + */ + public long getMaximumSize() { + return maximumSize; + } } diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java index 282d3edf9ab..2b52e084a1a 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongChunkedDistinctOperator.java @@ -8,6 +8,7 @@ */ package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; +import io.deephaven.engine.table.impl.sources.BoxedColumnSource; import io.deephaven.time.DateTime; import io.deephaven.engine.table.impl.by.ssmcountdistinct.DateTimeSsmSourceWrapper; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java index b765503d9ab..fcd9012cd0e 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/distinct/LongRollupDistinctOperator.java @@ -8,6 +8,7 @@ */ package io.deephaven.engine.table.impl.by.ssmcountdistinct.distinct; +import io.deephaven.engine.table.impl.sources.BoxedColumnSource; import io.deephaven.time.DateTime; import io.deephaven.engine.table.impl.by.ssmcountdistinct.DateTimeSsmSourceWrapper; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java index 5c1b5269558..2c73b45fd6b 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongChunkedUniqueOperator.java @@ -10,6 +10,7 @@ import io.deephaven.engine.table.impl.sources.BoxedColumnSource; import io.deephaven.time.DateTime; +import io.deephaven.engine.table.impl.by.ssmcountdistinct.DateTimeSsmSourceWrapper; import io.deephaven.engine.rowset.WritableRowSet; import io.deephaven.engine.rowset.RowSet; diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java index 5f7b68f7898..a8ad50b5a79 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/by/ssmcountdistinct/unique/LongRollupUniqueOperator.java @@ -10,6 +10,7 @@ import io.deephaven.engine.table.impl.sources.BoxedColumnSource; import io.deephaven.time.DateTime; +import io.deephaven.engine.table.impl.by.ssmcountdistinct.DateTimeSsmSourceWrapper; import io.deephaven.engine.rowset.WritableRowSet; import io.deephaven.engine.rowset.RowSet; diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BaseChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BaseChunkInputStreamGenerator.java index eab10f56b1d..52647b2d5bc 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BaseChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BaseChunkInputStreamGenerator.java @@ -3,7 +3,6 @@ */ package io.deephaven.extensions.barrage.chunk; -import io.deephaven.base.verify.Assert; import io.deephaven.chunk.attributes.Values; import io.deephaven.engine.rowset.RowSequence; import io.deephaven.engine.rowset.RowSequenceFactory; @@ -28,13 +27,25 @@ public abstract class BaseChunkInputStreamGenerator> imp protected static final AtomicIntegerFieldUpdater REFERENCE_COUNT_UPDATER = AtomicIntegerFieldUpdater.newUpdater(BaseChunkInputStreamGenerator.class, "refCount"); + protected final T chunk; protected final int elementSize; - protected final T chunk; + private final long rowOffset; - BaseChunkInputStreamGenerator(final T chunk, final int elementSize) { + BaseChunkInputStreamGenerator(final T chunk, final int elementSize, final long rowOffset) { this.chunk = chunk; this.elementSize = elementSize; + this.rowOffset = rowOffset; + } + + @Override + public long getRowOffset() { + return rowOffset; + } + + @Override + public long getLastRowOffset() { + return rowOffset + chunk.size() - 1; } @Override @@ -65,7 +76,11 @@ abstract class BaseChunkInputStream extends DrainableColumn { this.options = options; this.subset = chunk.size() == 0 ? RowSequenceFactory.EMPTY : subset != null ? subset.copy() : RowSequenceFactory.forRange(0, chunk.size() - 1); REFERENCE_COUNT_UPDATER.incrementAndGet(BaseChunkInputStreamGenerator.this); - Assert.leq(this.subset.lastRowKey(), "this.subset.lastRowKey()", Integer.MAX_VALUE, "Integer.MAX_VALUE"); + // ignore the empty chunk as these are intentionally empty generators that should work for any subset + if (chunk.size() > 0 && this.subset.lastRowKey() >= chunk.size()) { + throw new IllegalStateException( + "Subset " + this.subset + " is out of bounds for chunk of size " + chunk.size()); + } } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java index 4e441e3a169..9935d1f869c 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class ByteChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "ByteChunkInputStreamGenerator"; - public static ByteChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static ByteChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableByteChunk outChunk = WritableByteChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static ByteChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + ByteChunkInputStreamGenerator(final ByteChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/CharChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/CharChunkInputStreamGenerator.java index 9fa3bb59a9f..3811f8a7621 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/CharChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/CharChunkInputStreamGenerator.java @@ -29,7 +29,8 @@ public class CharChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "CharChunkInputStreamGenerator"; - public static CharChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static CharChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableCharChunk outChunk = WritableCharChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -39,11 +40,11 @@ public static CharChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + CharChunkInputStreamGenerator(final CharChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkInputStreamGenerator.java index 28d70753065..96bcb96fc18 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkInputStreamGenerator.java @@ -33,53 +33,57 @@ public interface ChunkInputStreamGenerator extends SafeCloseable { static ChunkInputStreamGenerator makeInputStreamGenerator( - final ChunkType chunkType, final Class type, final Class componentType, final Chunk chunk) { + final ChunkType chunkType, + final Class type, + final Class componentType, + final Chunk chunk, + final long rowOffset) { switch (chunkType) { case Boolean: throw new UnsupportedOperationException("Booleans are reinterpreted as bytes"); case Char: - return new CharChunkInputStreamGenerator(chunk.asCharChunk(), Character.BYTES); + return new CharChunkInputStreamGenerator(chunk.asCharChunk(), Character.BYTES, rowOffset); case Byte: - return new ByteChunkInputStreamGenerator(chunk.asByteChunk(), Byte.BYTES); + return new ByteChunkInputStreamGenerator(chunk.asByteChunk(), Byte.BYTES, rowOffset); case Short: - return new ShortChunkInputStreamGenerator(chunk.asShortChunk(), Short.BYTES); + return new ShortChunkInputStreamGenerator(chunk.asShortChunk(), Short.BYTES, rowOffset); case Int: - return new IntChunkInputStreamGenerator(chunk.asIntChunk(), Integer.BYTES); + return new IntChunkInputStreamGenerator(chunk.asIntChunk(), Integer.BYTES, rowOffset); case Long: - return new LongChunkInputStreamGenerator(chunk.asLongChunk(), Long.BYTES); + return new LongChunkInputStreamGenerator(chunk.asLongChunk(), Long.BYTES, rowOffset); case Float: - return new FloatChunkInputStreamGenerator(chunk.asFloatChunk(), Float.BYTES); + return new FloatChunkInputStreamGenerator(chunk.asFloatChunk(), Float.BYTES, rowOffset); case Double: - return new DoubleChunkInputStreamGenerator(chunk.asDoubleChunk(), Double.BYTES); + return new DoubleChunkInputStreamGenerator(chunk.asDoubleChunk(), Double.BYTES, rowOffset); case Object: if (type.isArray()) { - return new VarListChunkInputStreamGenerator<>(type, chunk.asObjectChunk()); + return new VarListChunkInputStreamGenerator<>(type, chunk.asObjectChunk(), rowOffset); } if (Vector.class.isAssignableFrom(type)) { //noinspection unchecked - return new VectorChunkInputStreamGenerator((Class>) type, componentType, chunk.asObjectChunk()); + return new VectorChunkInputStreamGenerator( + (Class>) type, componentType, chunk.asObjectChunk(), rowOffset); } if (type == String.class) { - return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), (out, str) -> { - out.write(str.getBytes(Charsets.UTF_8)); - }); + return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), rowOffset, + (out, str) -> out.write(str.getBytes(Charsets.UTF_8))); } if (type == BigInteger.class) { - return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), (out, item) -> { - out.write(item.toByteArray()); - }); + return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), rowOffset, + (out, item) -> out.write(item.toByteArray())); } if (type == BigDecimal.class) { - return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), (out, item) -> { - final BigDecimal normal = item.stripTrailingZeros(); - final int v = normal.scale(); - // Write as little endian, arrow endianness. - out.write(0xFF & v); - out.write(0xFF & (v >> 8)); - out.write(0xFF & (v >> 16)); - out.write(0xFF & (v >> 24)); - out.write(normal.unscaledValue().toByteArray()); - }); + return new VarBinaryChunkInputStreamGenerator(chunk.asObjectChunk(), rowOffset, + (out, item) -> { + final BigDecimal normal = item.stripTrailingZeros(); + final int v = normal.scale(); + // Write as little endian, arrow endianness. + out.write(0xFF & v); + out.write(0xFF & (v >> 8)); + out.write(0xFF & (v >> 16)); + out.write(0xFF & (v >> 24)); + out.write(normal.unscaledValue().toByteArray()); + }); } if (type == DateTime.class) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. @@ -91,34 +95,33 @@ static ChunkInputStreamGenerator makeInputStreamGenerator( if (chunk instanceof PoolableChunk) { ((PoolableChunk) chunk).close(); } - return new LongChunkInputStreamGenerator(outChunk, Long.BYTES); + return new LongChunkInputStreamGenerator(outChunk, Long.BYTES, rowOffset); } if (type == Byte.class) { - return ByteChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return ByteChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Character.class) { - return CharChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return CharChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Double.class) { - return DoubleChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return DoubleChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Float.class) { - return FloatChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return FloatChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Integer.class) { - return IntChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return IntChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Long.class) { - return LongChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return LongChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } if (type == Short.class) { - return ShortChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk()); + return ShortChunkInputStreamGenerator.convertBoxed(chunk.asObjectChunk(), rowOffset); } // TODO (core#936): support column conversion modes - return new VarBinaryChunkInputStreamGenerator<>(chunk.asObjectChunk(), (out, item) -> { - out.write(item.toString().getBytes(Charsets.UTF_8)); - }); + return new VarBinaryChunkInputStreamGenerator<>(chunk.asObjectChunk(), rowOffset, + (out, item) -> out.write(item.toString().getBytes(Charsets.UTF_8))); default: throw new UnsupportedOperationException(); } @@ -270,6 +273,16 @@ static WritableChunk extractChunkFromInputStream( } } + /** + * Returns the number of rows that were sent before the first row in this generator. + */ + long getRowOffset(); + + /** + * Returns the offset of the final row this generator can produce. + */ + long getLastRowOffset(); + /** * Get an input stream optionally position-space filtered using the provided RowSet. * diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java index 0885cbcf12a..b01062b2f18 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DoubleChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class DoubleChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "DoubleChunkInputStreamGenerator"; - public static DoubleChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static DoubleChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableDoubleChunk outChunk = WritableDoubleChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static DoubleChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + DoubleChunkInputStreamGenerator(final DoubleChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java index 9da01bb472f..50e0aa55cbf 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/FloatChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class FloatChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "FloatChunkInputStreamGenerator"; - public static FloatChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static FloatChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableFloatChunk outChunk = WritableFloatChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static FloatChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + FloatChunkInputStreamGenerator(final FloatChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java index fc667cdd5a1..71a656fad79 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/IntChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class IntChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "IntChunkInputStreamGenerator"; - public static IntChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static IntChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableIntChunk outChunk = WritableIntChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static IntChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + IntChunkInputStreamGenerator(final IntChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java index 599d30ad425..7577bbfe7a6 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/LongChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class LongChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "LongChunkInputStreamGenerator"; - public static LongChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static LongChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableLongChunk outChunk = WritableLongChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static LongChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + LongChunkInputStreamGenerator(final LongChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java index 6e2e315648a..3abcc5f2cfd 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ShortChunkInputStreamGenerator.java @@ -34,7 +34,8 @@ public class ShortChunkInputStreamGenerator extends BaseChunkInputStreamGenerator> { private static final String DEBUG_NAME = "ShortChunkInputStreamGenerator"; - public static ShortChunkInputStreamGenerator convertBoxed(final ObjectChunk inChunk) { + public static ShortChunkInputStreamGenerator convertBoxed( + final ObjectChunk inChunk, final long rowOffset) { // This code path is utilized for arrays and vectors of DateTimes, which cannot be reinterpreted. WritableShortChunk outChunk = WritableShortChunk.makeWritableChunk(inChunk.size()); for (int i = 0; i < inChunk.size(); ++i) { @@ -44,11 +45,11 @@ public static ShortChunkInputStreamGenerator convertBoxed(final ObjectChunk chunk, final int elementSize) { - super(chunk, elementSize); + ShortChunkInputStreamGenerator(final ShortChunk chunk, final int elementSize, final long rowOffset) { + super(chunk, elementSize, rowOffset); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarBinaryChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarBinaryChunkInputStreamGenerator.java index fb899d7aff7..4d681c324c4 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarBinaryChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarBinaryChunkInputStreamGenerator.java @@ -190,8 +190,9 @@ public interface Mapper { } VarBinaryChunkInputStreamGenerator(final ObjectChunk chunk, + final long rowOffset, final Appender appendItem) { - super(chunk, 0); + super(chunk, 0, rowOffset); this.appendItem = appendItem; } diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarListChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarListChunkInputStreamGenerator.java index dfa2864bb02..02e4b375aea 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarListChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VarListChunkInputStreamGenerator.java @@ -37,8 +37,8 @@ public class VarListChunkInputStreamGenerator extends BaseChunkInputStreamGen private WritableIntChunk offsets; private ChunkInputStreamGenerator innerGenerator; - VarListChunkInputStreamGenerator(final Class type, final ObjectChunk chunk) { - super(chunk, 0); + VarListChunkInputStreamGenerator(final Class type, final ObjectChunk chunk, final long rowOffset) { + super(chunk, 0, rowOffset); this.type = type; } @@ -55,7 +55,7 @@ private synchronized void computePayload() { final WritableChunk innerChunk = kernel.expand(chunk, offsets); innerGenerator = ChunkInputStreamGenerator.makeInputStreamGenerator( - chunkType, myType, myComponentType, innerChunk); + chunkType, myType, myComponentType, innerChunk, 0); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VectorChunkInputStreamGenerator.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VectorChunkInputStreamGenerator.java index 8b24b17ad86..16995017eef 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VectorChunkInputStreamGenerator.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/VectorChunkInputStreamGenerator.java @@ -38,9 +38,12 @@ public class VectorChunkInputStreamGenerator extends BaseChunkInputStreamGenerat private WritableIntChunk offsets; private ChunkInputStreamGenerator innerGenerator; - VectorChunkInputStreamGenerator(final Class> type, final Class componentType, - final ObjectChunk, Values> chunk) { - super(chunk, 0); + VectorChunkInputStreamGenerator( + final Class> type, + final Class componentType, + final ObjectChunk, Values> chunk, + final long rowOffset) { + super(chunk, 0, rowOffset); this.componentType = VectorExpansionKernel.getComponentType(type, componentType); } @@ -56,7 +59,7 @@ private synchronized void computePayload() { final WritableChunk innerChunk = kernel.expand(chunk, offsets); innerGenerator = ChunkInputStreamGenerator.makeInputStreamGenerator( - chunkType, componentType, innerComponentType, innerChunk); + chunkType, componentType, innerComponentType, innerChunk, 0); } @Override diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageStreamReader.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageStreamReader.java index 06c1f0c7d37..d97bf229f99 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageStreamReader.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageStreamReader.java @@ -194,7 +194,6 @@ public BarrageMessage safelyParseFrom(final StreamReaderOptions options, // noinspection UnstableApiUsage try (final LittleEndianDataInputStream ois = new LittleEndianDataInputStream(new BarrageProtoUtil.ObjectInputStreamAdapter(decoder, size))) { - final MutableInt bufferOffset = new MutableInt(); final Iterator fieldNodeIter = new FlatBufferIteratorAdapter<>(batch.nodesLength(), i -> new ChunkInputStreamGenerator.FieldNodeInfo(batch.nodes(i))); @@ -209,7 +208,6 @@ public BarrageMessage safelyParseFrom(final StreamReaderOptions options, // our parsers handle overhanging buffers length += Math.max(0, nextOffset - offset - length); } - bufferOffset.setValue(offset + length); bufferInfo.add(length); } final TLongIterator bufferInfoIter = bufferInfo.iterator(); @@ -270,7 +268,9 @@ public BarrageMessage safelyParseFrom(final StreamReaderOptions options, final int chunkOffset; long rowOffset = numModRowsRead - lastModStartIndex; // this batch might overflow the chunk - if (rowOffset + Math.min(remaining, batch.length()) > chunkSize) { + final int numRowsToRead = LongSizedDataStructure.intSize("BarrageStreamReader", + Math.min(remaining, batch.length())); + if (rowOffset + numRowsToRead > chunkSize) { lastModStartIndex += chunkSize; // create a new chunk before trying to write again @@ -288,7 +288,7 @@ public BarrageMessage safelyParseFrom(final StreamReaderOptions options, mcd.data.set(lastChunkIndex, ChunkInputStreamGenerator.extractChunkFromInputStream(options, columnChunkTypes[ci], columnTypes[ci], componentTypes[ci], fieldNodeIter, bufferInfoIter, ois, - chunk, chunkOffset, chunkSize)); + chunk, chunkOffset, numRowsToRead)); } numModRowsRead += batch.length(); } diff --git a/extensions/barrage/src/test/java/io/deephaven/extensions/barrage/chunk/BarrageColumnRoundTripTest.java b/extensions/barrage/src/test/java/io/deephaven/extensions/barrage/chunk/BarrageColumnRoundTripTest.java index 365c2bb7272..b18a87e9504 100644 --- a/extensions/barrage/src/test/java/io/deephaven/extensions/barrage/chunk/BarrageColumnRoundTripTest.java +++ b/extensions/barrage/src/test/java/io/deephaven/extensions/barrage/chunk/BarrageColumnRoundTripTest.java @@ -509,7 +509,7 @@ private static void testRoundTripSerialization( initData.accept(data); try (ChunkInputStreamGenerator generator = - ChunkInputStreamGenerator.makeInputStreamGenerator(chunkType, type, type.getComponentType(), data)) { + ChunkInputStreamGenerator.makeInputStreamGenerator(chunkType, type, type.getComponentType(), data, 0)) { // full sub logic try (final BarrageProtoUtil.ExposedByteArrayOutputStream baos = diff --git a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java index cabc5aae122..8f6ca1d2e53 100644 --- a/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java +++ b/server/src/main/java/io/deephaven/server/arrow/ArrowFlightUtil.java @@ -260,6 +260,7 @@ public static class DoPutObserver implements StreamObserver, Closea private final TicketRouter ticketRouter; private final StreamObserver observer; + private long totalRowsRead = 0; private BarrageTable resultTable; private SessionState.ExportBuilder
    resultExportBuilder; private Flight.FlightDescriptor flightDescriptor; @@ -376,10 +377,10 @@ public void onNext(final InputStream request) { acd.componentType = componentTypes[ci]; } - msg.rowsAdded = - RowSetFactory.fromRange(resultTable.size(), resultTable.size() + numRowsAdded - 1); + msg.rowsAdded = RowSetFactory.fromRange(totalRowsRead, totalRowsRead + numRowsAdded - 1); msg.rowsIncluded = msg.rowsAdded.copy(); msg.modColumnData = ZERO_MOD_COLUMNS; + totalRowsRead += numRowsAdded; resultTable.handleBarrageMessage(msg); diff --git a/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java b/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java index 27b622bae9a..fcf0930dc2f 100644 --- a/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java +++ b/server/src/main/java/io/deephaven/server/barrage/BarrageMessageProducer.java @@ -1801,8 +1801,8 @@ private BarrageMessage aggregateUpdatesInRange(final int startDelta, final int e final class ColumnInfo { final WritableRowSet modified = RowSetFactory.empty(); final WritableRowSet recordedMods = RowSetFactory.empty(); - ArrayList addedMappings = new ArrayList<>(); - ArrayList modifiedMappings = new ArrayList<>(); + long[][] addedMappings; + long[][] modifiedMappings; } final HashMap infoCache = new HashMap<>(); @@ -1835,23 +1835,8 @@ final class ColumnInfo { retval.modified.remove(coalescer.added); retval.recordedMods.remove(coalescer.added); - try (final RowSequence.Iterator it = localAdded.getRowSequenceIterator()) { - while (it.hasMore()) { - final RowSequence rs = it.getNextRowSequenceWithLength(SNAPSHOT_CHUNK_SIZE); - long[] addedMapping = new long[rs.intSize()]; - Arrays.fill(addedMapping, RowSequence.NULL_ROW_KEY); - retval.addedMappings.add(addedMapping); - } - } - - try (final RowSequence.Iterator it = retval.recordedMods.getRowSequenceIterator()) { - while (it.hasMore()) { - final RowSequence rs = it.getNextRowSequenceWithLength(SNAPSHOT_CHUNK_SIZE); - long[] modifiedMapping = new long[rs.intSize()]; - Arrays.fill(modifiedMapping, RowSequence.NULL_ROW_KEY); - retval.modifiedMappings.add(modifiedMapping); - } - } + retval.addedMappings = newMappingArray(localAdded.size()); + retval.modifiedMappings = newMappingArray(retval.recordedMods.size()); final WritableRowSet unfilledAdds = localAdded.isEmpty() ? RowSetFactory.empty() : RowSetFactory.flat(localAdded.size()); @@ -1987,29 +1972,32 @@ final class ColumnInfo { return downstream; } + private static long[][] newMappingArray(final long size) { + final int numAddChunks = LongSizedDataStructure.intSize("BarrageMessageProducer", + (size + SNAPSHOT_CHUNK_SIZE - 1) / SNAPSHOT_CHUNK_SIZE); + final long[][] result = new long[numAddChunks][]; + for (int ii = 0; ii < numAddChunks; ++ii) { + final int chunkSize = (ii < numAddChunks - 1 || size % SNAPSHOT_CHUNK_SIZE == 0) + ? SNAPSHOT_CHUNK_SIZE + : (int) (size % SNAPSHOT_CHUNK_SIZE); + final long[] newChunk = new long[chunkSize]; + result[ii] = newChunk; + Arrays.fill(newChunk, RowSequence.NULL_ROW_KEY); + } + return result; + } + // Updates provided mapping so that mapping[i] returns values.get(i) for all i in keys. - private static void applyRedirMapping(final RowSet keys, final RowSet values, final ArrayList mappings) { + private static void applyRedirMapping(final RowSet keys, final RowSet values, final long[][] mapping) { Assert.eq(keys.size(), "keys.size()", values.size(), "values.size()"); - MutableLong mapCount = new MutableLong(0L); - mappings.forEach((arr) -> mapCount.add(arr.length)); - Assert.leq(keys.size(), "keys.size()", mapCount.longValue(), "mapping.length"); - - // we need to track our progress through multiple mapping arrays - MutableLong arrOffset = new MutableLong(0L); - MutableInt arrIdx = new MutableInt(0); final RowSet.Iterator vit = values.iterator(); keys.forAllRowKeys(lkey -> { - long[] mapping = mappings.get(arrIdx.intValue()); - int keyIdx = LongSizedDataStructure.intSize("applyRedirMapping", lkey - arrOffset.longValue()); - - Assert.eq(mapping[keyIdx], "mapping[keyIdx]", RowSequence.NULL_ROW_KEY, "RowSet.NULL_ROW_KEY"); - mapping[keyIdx] = vit.nextLong(); - - if (keyIdx == mapping.length - 1) { - arrOffset.add(mapping.length); - arrIdx.add(1); - } + final int arrIdx = (int) (lkey / SNAPSHOT_CHUNK_SIZE); + final int keyIdx = (int) (lkey % SNAPSHOT_CHUNK_SIZE); + final long[] chunk = mapping[arrIdx]; + Assert.eq(chunk[keyIdx], "chunk[keyIdx]", RowSequence.NULL_ROW_KEY, "RowSet.NULL_ROW_KEY"); + chunk[keyIdx] = vit.nextLong(); }); } diff --git a/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java b/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java index 2de5ca76aab..ad8078a4c50 100644 --- a/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java +++ b/server/src/main/java/io/deephaven/server/barrage/BarrageStreamGenerator.java @@ -14,7 +14,7 @@ import io.deephaven.barrage.flatbuf.BarrageMessageWrapper; import io.deephaven.barrage.flatbuf.BarrageModColumnMetadata; import io.deephaven.barrage.flatbuf.BarrageUpdateMetadata; -import io.deephaven.base.verify.Assert; +import io.deephaven.chunk.Chunk; import io.deephaven.chunk.ChunkType; import io.deephaven.chunk.WritableChunk; import io.deephaven.chunk.WritableLongChunk; @@ -29,7 +29,6 @@ import io.deephaven.extensions.barrage.BarragePerformanceLog; import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; import io.deephaven.extensions.barrage.BarrageSnapshotOptions; -import io.deephaven.extensions.barrage.BarrageSubscriptionOptions; import io.deephaven.extensions.barrage.chunk.ChunkInputStreamGenerator; import io.deephaven.extensions.barrage.util.BarrageProtoUtil.ExposedByteArrayOutputStream; import io.deephaven.extensions.barrage.util.BarrageUtil; @@ -123,24 +122,30 @@ public static class ChunkListInputStreamGenerator implements SafeCloseable { // create an input stream generator for each chunk generators = new ChunkInputStreamGenerator[acd.data.size()]; + long rowOffset = 0; for (int i = 0; i < acd.data.size(); ++i) { + final Chunk valuesChunk = acd.data.get(i); generators[i] = ChunkInputStreamGenerator.makeInputStreamGenerator( - acd.data.get(i).getChunkType(), acd.type, acd.componentType, acd.data.get(i)); + valuesChunk.getChunkType(), acd.type, acd.componentType, valuesChunk, rowOffset); + rowOffset += valuesChunk.size(); } emptyGenerator = ChunkInputStreamGenerator.makeInputStreamGenerator( - acd.chunkType, acd.type, acd.componentType, acd.chunkType.getEmptyChunk()); + acd.chunkType, acd.type, acd.componentType, acd.chunkType.getEmptyChunk(), 0); } ChunkListInputStreamGenerator(BarrageMessage.ModColumnData mcd) { // create an input stream generator for each chunk generators = new ChunkInputStreamGenerator[mcd.data.size()]; + long rowOffset = 0; for (int i = 0; i < mcd.data.size(); ++i) { + final Chunk valuesChunk = mcd.data.get(i); generators[i] = ChunkInputStreamGenerator.makeInputStreamGenerator( - mcd.chunkType, mcd.type, mcd.componentType, mcd.data.get(i)); + mcd.chunkType, mcd.type, mcd.componentType, valuesChunk, rowOffset); + rowOffset += valuesChunk.size(); } emptyGenerator = ChunkInputStreamGenerator.makeInputStreamGenerator( - mcd.chunkType, mcd.type, mcd.componentType, mcd.chunkType.getEmptyChunk()); + mcd.chunkType, mcd.type, mcd.componentType, mcd.chunkType.getEmptyChunk(), 0); } @Override @@ -420,6 +425,9 @@ public RowSet addRowOffsets() { @Override public RowSet modRowOffsets(int col) { + if (modRowOffsets == null) { + return null; + } return modRowOffsets[col]; } } @@ -736,7 +744,7 @@ private void processBatches(Consumer visitor, final View view, long offset = 0; MutableInt actualBatchSize = new MutableInt(); - int batchSize = DEFAULT_INITIAL_BATCH_SIZE; + int batchSize = Math.min(DEFAULT_INITIAL_BATCH_SIZE, maxBatchSize); // allow the client to override the default message size final int maxMessageSize = @@ -751,6 +759,10 @@ private void processBatches(Consumer visitor, final View view, getInputStream(view, offset, batchSize, actualBatchSize, metadata, columnVisitor); int bytesToWrite = is.available(); + if (actualBatchSize.intValue() == 0) { + throw new IllegalStateException("No data was written for a batch"); + } + // treat this as a hard limit, exceeding fails a client or w2w (unless we are sending a single // row then we must send and let it potentially fail) if (sendAllowed && (bytesToWrite < maxMessageSize || batchSize == 1)) { @@ -783,27 +795,69 @@ private void processBatches(Consumer visitor, final View view, throw (new UncheckedDeephavenException( "BarrageStreamGenerator - single row (" + offset + ") exceeds transmissible size", ex)); } - batchSize = Math.max(1, batchSize / 2); + final int maximumSize = LongSizedDataStructure.intSize( + "BarrageStreamGenerator", ex.getMaximumSize()); + batchSize = maximumSize >= batchSize ? batchSize / 2 : maximumSize; + } + } + } + + private static int findGeneratorForOffset(final ChunkInputStreamGenerator[] generators, final long offset) { + // fast path for smaller updates + if (generators.length <= 1) { + return 0; + } + + int low = 0; + int high = generators.length; + + while (low + 1 < high) { + int mid = (low + high) / 2; + int cmp = Long.compare(generators[mid].getRowOffset(), offset); + + if (cmp < 0) { + // the generator's first key is low enough + low = mid; + } else if (cmp > 0) { + // the generator's first key is too high + high = mid; + } else { + // first key matches + return mid; } } + + // desired generator is at low as the high is exclusive + return low; } private long appendAddColumns(final View view, final long startRange, final int targetBatchSize, final Consumer addStream, final ChunkInputStreamGenerator.FieldNodeListener fieldNodeListener, final ChunkInputStreamGenerator.BufferListener bufferListener) throws IOException { - long endRange = startRange + targetBatchSize; - int chunkIdx = 0; - if (addGeneratorCount > 0) { - // identify the chunk that holds this startRange (NOTE: will be same for all columns) - chunkIdx = (int) (startRange / SNAPSHOT_CHUNK_SIZE); - // verify the selected chunk index is valid - Assert.assertion(chunkIdx >= 0 && chunkIdx < addGeneratorCount, "appendAddColumns - chunk lookup failed"); - // adjust the batch size if we would cross a chunk boundary - endRange = Math.min((long) (chunkIdx + 1) * SNAPSHOT_CHUNK_SIZE, endRange); - } - try (final WritableRowSet myAddedOffsets = view.addRowOffsets().subSetByPositionRange(startRange, endRange); - final RowSet adjustedOffsets = - myAddedOffsets.shift((long) chunkIdx * -SNAPSHOT_CHUNK_SIZE)) { + if (addColumnData.length == 0) { + return view.addRowOffsets().size(); + } + + // find the generator for the initial position-space key + long startPos = view.addRowOffsets().get(startRange); + int chunkIdx = findGeneratorForOffset(addColumnData[0].generators, startPos); + + // adjust the batch size if we would cross a chunk boundary + long shift = 0; + long endPos = view.addRowOffsets().get(startRange + targetBatchSize - 1); + if (endPos == RowSet.NULL_ROW_KEY) { + endPos = Long.MAX_VALUE; + } + if (addColumnData[0].generators.length > 0) { + final ChunkInputStreamGenerator tmpGenerator = addColumnData[0].generators[chunkIdx]; + endPos = Math.min(endPos, tmpGenerator.getLastRowOffset()); + shift = -tmpGenerator.getRowOffset(); + } + + // all column generators have the same boundaries, so we can re-use the offsets internal to this chunkIdx + try (final RowSet allowedRange = RowSetFactory.fromRange(startPos, endPos); + final WritableRowSet myAddedOffsets = view.addRowOffsets().intersect(allowedRange); + final RowSet adjustedOffsets = shift == 0 ? null : myAddedOffsets.shift(shift)) { // every column must write to the stream for (final ChunkListInputStreamGenerator data : addColumnData) { if (myAddedOffsets.isEmpty() || data.generators.length == 0) { @@ -820,7 +874,7 @@ private long appendAddColumns(final View view, final long startRange, final int } else { final ChunkInputStreamGenerator generator = data.generators[chunkIdx]; final ChunkInputStreamGenerator.DrainableColumn drainableColumn = - generator.getInputStream(view.options(), adjustedOffsets); + generator.getInputStream(view.options(), shift == 0 ? myAddedOffsets : adjustedOffsets); drainableColumn.visitFieldNodes(fieldNodeListener); drainableColumn.visitBuffers(bufferListener); // Add the drainable last as it is allowed to immediately close a row set the visitors need @@ -835,37 +889,72 @@ private long appendModColumns(final View view, final long startRange, final int final Consumer addStream, final ChunkInputStreamGenerator.FieldNodeListener fieldNodeListener, final ChunkInputStreamGenerator.BufferListener bufferListener) throws IOException { - long endRange = startRange + targetBatchSize; int[] columnChunkIdx = new int[modColumnData.length]; + // for each column identify the chunk that holds this startRange + long maxLength = targetBatchSize; + + // adjust the batch size if we would cross a chunk boundary for (int ii = 0; ii < modColumnData.length; ++ii) { final ModColumnData mcd = modColumnData[ii]; - int chunkIdx = (int) (startRange / SNAPSHOT_CHUNK_SIZE); - // adjust the batch size if we would cross a chunk boundary - endRange = Math.min((long) (chunkIdx + 1) * SNAPSHOT_CHUNK_SIZE, endRange); - columnChunkIdx[ii] = chunkIdx; + final ChunkInputStreamGenerator[] generators = mcd.data.generators; + if (generators.length == 0) { + continue; + } + + final RowSet modOffsets = view.modRowOffsets(ii); + // if all mods are being sent, then offsets yield an identity mapping + final long startPos = modOffsets != null ? modOffsets.get(startRange) : startRange; + if (startPos != RowSet.NULL_ROW_KEY) { + final int chunkIdx = findGeneratorForOffset(generators, startPos); + if (chunkIdx < generators.length - 1) { + maxLength = Math.min(maxLength, generators[chunkIdx].getLastRowOffset() + 1 - startPos); + } + columnChunkIdx[ii] = chunkIdx; + } } + // now add mod-column streams, and write the mod column indexes long numRows = 0; for (int ii = 0; ii < modColumnData.length; ++ii) { final ModColumnData mcd = modColumnData[ii]; + final ChunkInputStreamGenerator generator = mcd.data.generators.length > 0 + ? mcd.data.generators[columnChunkIdx[ii]] + : null; + + final RowSet modOffsets = view.modRowOffsets(ii); + long startPos, endPos; + if (modOffsets != null) { + startPos = modOffsets.get(startRange); + final long endRange = startRange + maxLength - 1; + endPos = endRange >= modOffsets.size() ? modOffsets.lastRowKey() : modOffsets.get(endRange); + } else if (startRange >= mcd.rowsModified.original.size()) { + startPos = RowSet.NULL_ROW_KEY; + endPos = RowSet.NULL_ROW_KEY; + } else { + // if all mods are being sent, then offsets yield an identity mapping + startPos = startRange; + endPos = startRange + maxLength - 1; + if (generator != null) { + endPos = Math.min(endPos, generator.getLastRowOffset()); + } + } final RowSet myModOffsets; - if (view.isViewport()) { - // only include modified rows that are within the viewport - myModOffsets = view.modRowOffsets(ii).subSetByPositionRange(startRange, endRange); - } else { - final long lastKey = Math.min(endRange - 1, mcd.rowsModified.original.size() - 1); - if (lastKey < startRange) { - // not all mod columns have the same length - myModOffsets = RowSetFactory.empty(); - } else { - myModOffsets = RowSetFactory.fromRange(startRange, lastKey); + if (startPos == RowSet.NULL_ROW_KEY) { + // not all mod columns have the same length + myModOffsets = RowSetFactory.empty(); + } else if (modOffsets != null) { + try (final RowSet allowedRange = RowSetFactory.fromRange(startPos, endPos)) { + myModOffsets = modOffsets.intersect(allowedRange); } + } else { + myModOffsets = RowSetFactory.fromRange(startPos, endPos); } numRows = Math.max(numRows, myModOffsets.size()); + try { - if (myModOffsets.isEmpty() || mcd.data.generators.length == 0) { + if (myModOffsets.isEmpty() || generator == null) { // use the empty generator to publish the column data try (final RowSet empty = RowSetFactory.empty()) { final ChunkInputStreamGenerator.DrainableColumn drainableColumn = @@ -876,13 +965,11 @@ private long appendModColumns(final View view, final long startRange, final int addStream.accept(drainableColumn); } } else { - final int chunkIdx = columnChunkIdx[ii]; - final ChunkInputStreamGenerator generator = mcd.data.generators[chunkIdx]; + final long shift = -generator.getRowOffset(); // normalize to the chunk offsets - try (final WritableRowSet adjustedOffsets = - myModOffsets.shift((long) chunkIdx * -SNAPSHOT_CHUNK_SIZE)) { + try (final WritableRowSet adjustedOffsets = shift == 0 ? null : myModOffsets.shift(shift)) { final ChunkInputStreamGenerator.DrainableColumn drainableColumn = - generator.getInputStream(view.options(), adjustedOffsets); + generator.getInputStream(view.options(), shift == 0 ? myModOffsets : adjustedOffsets); drainableColumn.visitFieldNodes(fieldNodeListener); drainableColumn.visitBuffers(bufferListener); // Add the drainable last as it is allowed to immediately close a row set the visitors need diff --git a/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java b/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java index 26e09215fb8..0519c70e8b8 100644 --- a/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java +++ b/server/src/test/java/io/deephaven/server/barrage/BarrageMessageRoundTripTest.java @@ -69,6 +69,7 @@ import static io.deephaven.engine.table.impl.TstUtils.getTable; import static io.deephaven.engine.table.impl.TstUtils.i; import static io.deephaven.engine.table.impl.TstUtils.initColumnInfos; +import static io.deephaven.engine.table.impl.remote.ConstructSnapshot.SNAPSHOT_CHUNK_SIZE; @Category(OutOfBandTest.class) public class BarrageMessageRoundTripTest extends RefreshingTableTestCase { @@ -738,7 +739,6 @@ public void testRoundTripIncrementalSharedProducer() { } // These test mid-cycle subscription changes and snapshot content - private abstract class SubscriptionChangingHelper extends SharedProducerForAllClients { SubscriptionChangingHelper(final int numProducerCoalesce, final int numConsumerCoalesce, final int size, final int seed, final MutableInt numSteps) { @@ -1196,6 +1196,83 @@ public void testRegressModificationsInPrevView() { remoteNugget.validate("new viewport with modification"); } + public void testCoalescingLargeUpdates() { + final BitSet allColumns = new BitSet(1); + allColumns.set(0); + + final QueryTable queryTable = TstUtils.testRefreshingTable(i(0).toTracking(), c("intCol", 0)); + TstUtils.removeRows(queryTable, i(0)); + + final RemoteNugget remoteNugget = new RemoteNugget(() -> queryTable); + + // Create a few interesting clients around the mapping boundary. + final int mb = SNAPSHOT_CHUNK_SIZE; + final int sz = 2 * mb; + final RemoteClient[] remoteClients = new RemoteClient[] { + remoteNugget.newClient(null, allColumns, "full"), + remoteNugget.newClient(RowSetFactory.fromRange(0, 100), allColumns, "start"), + remoteNugget.newClient(RowSetFactory.fromRange(mb - 100, mb + 100), allColumns, "middle"), + remoteNugget.newClient(RowSetFactory.fromRange(sz - 100, sz + 100), allColumns, "end"), + }; + + // Obtain snapshot of original viewport. + flushProducerTable(); + remoteNugget.flushClientEvents(); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(updateSourceCombiner::run); + remoteNugget.validate("original viewport"); + + // Add all of our new rows spread over multiple deltas. + final int numDeltas = 4; + for (int ii = 0; ii < numDeltas; ++ii) { + final RowSetBuilderSequential newRowsBuilder = RowSetFactory.builderSequential(); + final Integer[] values = new Integer[sz / numDeltas]; + for (int jj = ii; jj < sz; jj += numDeltas) { + newRowsBuilder.appendKey(jj); + values[jj / numDeltas] = ii; + } + final RowSet newRows = newRowsBuilder.build(); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + TstUtils.addToTable(queryTable, newRows, c("intCol", values)); + queryTable.notifyListeners(new TableUpdateImpl( + newRows, + RowSetFactory.empty(), + RowSetFactory.empty(), + RowSetShiftData.EMPTY, ModifiedColumnSet.ALL)); + }); + } + + // Coalesce these to ensure mappings larger than a single chunk are handled correctly. + flushProducerTable(); + remoteNugget.flushClientEvents(); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(updateSourceCombiner::run); + remoteNugget.validate("large add rows update"); + + // Modify all of our rows spread over multiple deltas. + for (int ii = 0; ii < numDeltas; ++ii) { + final RowSetBuilderSequential modRowsBuilder = RowSetFactory.builderSequential(); + final Integer[] values = new Integer[sz / numDeltas]; + for (int jj = ii; jj < sz; jj += numDeltas) { + modRowsBuilder.appendKey(jj); + values[jj / numDeltas] = numDeltas + ii; + } + final RowSet modRows = modRowsBuilder.build(); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(() -> { + TstUtils.addToTable(queryTable, modRows, c("intCol", values)); + queryTable.notifyListeners(new TableUpdateImpl( + RowSetFactory.empty(), + RowSetFactory.empty(), + modRows, + RowSetShiftData.EMPTY, ModifiedColumnSet.ALL)); + }); + } + + // Coalesce these to ensure mappings larger than a single chunk are handled correctly. + flushProducerTable(); + remoteNugget.flushClientEvents(); + UpdateGraphProcessor.DEFAULT.runWithinUnitTestCycle(updateSourceCombiner::run); + remoteNugget.validate("large mod rows update"); + } + public void testAllUniqueChunkTypeColumnSourcesWithValidityBuffers() { testAllUniqueChunkTypeColumnSources(false); } diff --git a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java index 48f54787c5a..cc94e2f990f 100644 --- a/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java +++ b/server/test/src/main/java/io/deephaven/server/test/FlightMessageRoundTripTest.java @@ -451,25 +451,26 @@ public void testSimpleEmptyTableDoGet() throws Exception { currentSession.newExport(simpleTableTicket, "test") .submit(() -> TableTools.emptyTable(10).update("I=i")); + long totalRowCount = 0; try (FlightStream stream = client.getStream(new Ticket(simpleTableTicket.getTicket().toByteArray()))) { - assertTrue(stream.next()); - VectorSchemaRoot root = stream.getRoot(); - // row count should match what we expect - assertEquals(10, root.getRowCount()); - - // only one column was sent - assertEquals(1, root.getFieldVectors().size()); - Field i = root.getSchema().findField("I"); - - // all DH columns are nullable, even primitives - assertTrue(i.getFieldType().isNullable()); - // verify it is a java int type, which is an arrow 32bit int - assertEquals(ArrowType.ArrowTypeID.Int, i.getFieldType().getType().getTypeID()); - assertEquals(32, ((ArrowType.Int) i.getFieldType().getType()).getBitWidth()); - assertEquals("int", i.getMetadata().get("deephaven:type")); + while (stream.next()) { + VectorSchemaRoot root = stream.getRoot(); + totalRowCount += root.getRowCount(); + + // only one column was sent + assertEquals(1, root.getFieldVectors().size()); + Field i = root.getSchema().findField("I"); + + // all DH columns are nullable, even primitives + assertTrue(i.getFieldType().isNullable()); + // verify it is a java int type, which is an arrow 32bit int + assertEquals(ArrowType.ArrowTypeID.Int, i.getFieldType().getType().getTypeID()); + assertEquals(32, ((ArrowType.Int) i.getFieldType().getType()).getBitWidth()); + assertEquals("int", i.getMetadata().get("deephaven:type")); + } - // verify that the server didn't send more data after the first payload - assertFalse(stream.next()); + // row count should match what we expect + assertEquals(10, totalRowCount); } } @@ -497,8 +498,8 @@ public void testRoundTripData() throws Exception { assertRoundTripDataEqual( TableTools.emptyTable(10).update("empty= ((i % 2) == 0) ? String.valueOf(i) : (String)null")); - // list columns TODO(#755): support for Vector - // assertRoundTripDataEqual(TableTools.emptyTable(5).update("A=i").groupBy().join(TableTools.emptyTable(5))); + // list columns + assertRoundTripDataEqual(TableTools.emptyTable(5).update("A=i").groupBy().join(TableTools.emptyTable(5))); } @Test @@ -666,26 +667,26 @@ public void testDoExchangeSnapshot() throws Exception { erw.getWriter().completed(); // read everything from the server (expecting schema message and one data message) - int numMessages = 0; + int totalRowCount = 0; while (erw.getReader().next()) { - ++numMessages; - } - assertEquals(1, numMessages); // only one data message - - // at this point should have the data, verify it matches the created table - assertEquals(erw.getReader().getRoot().getRowCount(), table.size()); - - // check the values against the source table - org.apache.arrow.vector.IntVector iv = - (org.apache.arrow.vector.IntVector) erw.getReader().getRoot().getVector(0); - for (int i = 0; i < table.size(); i++) { - assertEquals("int match:", table.getColumn(0).get(i), iv.get(i)); - } - org.apache.arrow.vector.Float8Vector dv = - (org.apache.arrow.vector.Float8Vector) erw.getReader().getRoot().getVector(1); - for (int i = 0; i < table.size(); i++) { - assertEquals("double match: ", table.getColumn(1).get(i), dv.get(i)); + final int offset = totalRowCount; + final VectorSchemaRoot root = erw.getReader().getRoot(); + final int rowCount = root.getRowCount(); + totalRowCount += rowCount; + + // check the values against the source table + org.apache.arrow.vector.IntVector iv = + (org.apache.arrow.vector.IntVector) root.getVector(0); + for (int i = 0; i < rowCount; ++i) { + assertEquals("int match:", table.getColumn(0).get(offset + i), iv.get(i)); + } + org.apache.arrow.vector.Float8Vector dv = + (org.apache.arrow.vector.Float8Vector) root.getVector(1); + for (int i = 0; i < rowCount; ++i) { + assertEquals("double match: ", table.getColumn(1).get(offset + i), dv.get(i)); + } } + assertEquals(table.size(), totalRowCount); } } } From 7d6b4ffbb0b663aca1ee2d4e1002981c80fa54dd Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 11 Oct 2022 11:01:35 -0500 Subject: [PATCH 210/215] Refine Authentication apis, clarify deprecation and migration (#2865) Partial #2564 --- .../deephaven/auth/BasicAuthMarshaller.java | 12 +- go/internal/proto/session/session.pb.go | 175 ++++++++++-------- go/internal/proto/session/session_grpc.pb.go | 18 ++ .../main/proto/deephaven/proto/session.proto | 33 +++- py/client/pydeephaven/proto/session_pb2.py | 76 ++++---- .../pydeephaven/proto/session_pb2_grpc.py | 4 + .../server/arrow/FlightServiceGrpcImpl.java | 26 ++- .../server/auth/AuthContextModule.java | 28 ++- .../server/session/SessionService.java | 31 +--- .../session/SessionServiceGrpcImpl.java | 11 +- .../ApplicationServiceGrpcImplTest.java | 2 +- .../server/session/SessionServiceTest.java | 2 +- .../deephaven/server/test/AuthTestModule.java | 14 +- 13 files changed, 241 insertions(+), 191 deletions(-) diff --git a/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java b/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java index d774ad68383..a960bea7b06 100644 --- a/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java +++ b/authentication/src/main/java/io/deephaven/auth/BasicAuthMarshaller.java @@ -27,6 +27,8 @@ * This class delegates to a typed auth handler once it is certain that the payload appears to be a BasicAuth value. */ public class BasicAuthMarshaller implements AuthenticationRequestHandler { + public static final String AUTH_TYPE = Auth2Constants.BASIC_PREFIX.trim(); + private final static Logger log = LoggerFactory.getLogger(AnonymousAuthenticationHandler.class); public interface Handler { @@ -41,21 +43,17 @@ public BasicAuthMarshaller(Handler handler) { @Override public String getAuthType() { - return Auth2Constants.BASIC_PREFIX.trim(); + return AUTH_TYPE; } @Override public void initialize(String targetUrl) { - for (int ii = 0; ii < 5; ++ii) { - log.warn().endl(); - } + log.warn().endl().endl().endl().endl().endl(); log.warn().append("================================================================================").endl(); log.warn().append("Basic Authentication is enabled.").endl(); log.warn().append(" Listening on ").append(targetUrl).endl(); log.warn().append("================================================================================").endl(); - for (int ii = 0; ii < 5; ++ii) { - log.warn().endl(); - } + log.warn().endl().endl().endl().endl().endl(); } @Override diff --git a/go/internal/proto/session/session.pb.go b/go/internal/proto/session/session.pb.go index 7eb629e60ea..d5b0549fe52 100644 --- a/go/internal/proto/session/session.pb.go +++ b/go/internal/proto/session/session.pb.go @@ -109,9 +109,9 @@ type WrappedAuthenticationRequest struct { unknownFields protoimpl.UnknownFields // The type of the protobuf the auth payload protobuf. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` // The serialized payload of the protobuf instance. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` } func (x *WrappedAuthenticationRequest) Reset() { @@ -171,8 +171,12 @@ type HandshakeRequest struct { // Deephaven's OSS protocols are as follows: // - protocol = 0: most recent HandshakeResponse payload // - protocol = 1: payload is BasicAuth + // + // Deprecated: Do not use. AuthProtocol int32 `protobuf:"zigzag32,1,opt,name=auth_protocol,json=authProtocol,proto3" json:"auth_protocol,omitempty"` // Arbitrary auth/handshake info. + // + // Deprecated: Do not use. Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` } @@ -208,6 +212,7 @@ func (*HandshakeRequest) Descriptor() ([]byte, []int) { return file_deephaven_proto_session_proto_rawDescGZIP(), []int{1} } +// Deprecated: Do not use. func (x *HandshakeRequest) GetAuthProtocol() int32 { if x != nil { return x.AuthProtocol @@ -215,6 +220,7 @@ func (x *HandshakeRequest) GetAuthProtocol() int32 { return 0 } +// Deprecated: Do not use. func (x *HandshakeRequest) GetPayload() []byte { if x != nil { return x.Payload @@ -231,13 +237,21 @@ type HandshakeResponse struct { unknownFields protoimpl.UnknownFields // The metadata header to identify the session. This value is static and defined via configuration. + // + // Deprecated: Do not use. MetadataHeader []byte `protobuf:"bytes,1,opt,name=metadata_header,json=metadataHeader,proto3" json:"metadata_header,omitempty"` // Arbitrary session_token to assign to the value to the provided metadata header. + // + // Deprecated: Do not use. SessionToken []byte `protobuf:"bytes,2,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` // When this session_token will be considered invalid by the server. + // + // Deprecated: Do not use. TokenDeadlineTimeMillis int64 `protobuf:"zigzag64,3,opt,name=token_deadline_time_millis,json=tokenDeadlineTimeMillis,proto3" json:"token_deadline_time_millis,omitempty"` // The length of time that this token was intended to live. Note that `refreshSessionToken` may return the // existing token to reduce overhead and to prevent denial-of-service caused by refreshing too frequently. + // + // Deprecated: Do not use. TokenExpirationDelayMillis int64 `protobuf:"zigzag64,4,opt,name=token_expiration_delay_millis,json=tokenExpirationDelayMillis,proto3" json:"token_expiration_delay_millis,omitempty"` } @@ -273,6 +287,7 @@ func (*HandshakeResponse) Descriptor() ([]byte, []int) { return file_deephaven_proto_session_proto_rawDescGZIP(), []int{2} } +// Deprecated: Do not use. func (x *HandshakeResponse) GetMetadataHeader() []byte { if x != nil { return x.MetadataHeader @@ -280,6 +295,7 @@ func (x *HandshakeResponse) GetMetadataHeader() []byte { return nil } +// Deprecated: Do not use. func (x *HandshakeResponse) GetSessionToken() []byte { if x != nil { return x.SessionToken @@ -287,6 +303,7 @@ func (x *HandshakeResponse) GetSessionToken() []byte { return nil } +// Deprecated: Do not use. func (x *HandshakeResponse) GetTokenDeadlineTimeMillis() int64 { if x != nil { return x.TokenDeadlineTimeMillis @@ -294,6 +311,7 @@ func (x *HandshakeResponse) GetTokenDeadlineTimeMillis() int64 { return 0 } +// Deprecated: Do not use. func (x *HandshakeResponse) GetTokenExpirationDelayMillis() int64 { if x != nil { return x.TokenExpirationDelayMillis @@ -813,29 +831,31 @@ var file_deephaven_proto_session_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1c, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x4c, 0x0a, 0x1c, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x22, 0x58, 0x0a, 0x1c, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x51, - 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0xe9, 0x01, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x64, - 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x69, 0x6c, - 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, 0x01, 0x52, 0x17, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x45, 0x0a, 0x1d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, - 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x02, 0x30, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4a, 0x04, + 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x59, 0x0a, 0x10, 0x48, 0x61, + 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, + 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x11, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xf5, 0x01, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x0f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x02, 0x18, 0x01, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x41, 0x0a, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, + 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x12, 0x42, 0x04, 0x18, 0x01, 0x30, 0x01, 0x52, 0x17, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x69, + 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x47, 0x0a, 0x1d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, + 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x12, 0x42, 0x04, 0x18, 0x01, 0x30, 0x01, 0x52, 0x1a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, @@ -914,8 +934,8 @@ var file_deephaven_proto_session_proto_rawDesc = []byte{ 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, - 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xb5, 0x07, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x4e, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xbb, 0x07, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, @@ -923,62 +943,63 @@ var file_deephaven_proto_session_proto_rawDesc = []byte{ 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x2e, - 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x0c, 0x43, 0x6c, - 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, - 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, - 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x07, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x85, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, + 0x12, 0x7e, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x33, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x72, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x31, 0x2e, 0x69, 0x6f, + 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, + 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, + 0x6f, 0x6d, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, - 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, - 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x30, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, - 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x13, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, + 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x69, 0x6f, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x8e, 0x01, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, + 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, + 0x12, 0xa2, 0x01, 0x0a, 0x17, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x69, + 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x35, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, + 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, 0x12, 0xa2, 0x01, 0x0a, 0x17, 0x54, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x69, 0x6f, 0x2e, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x69, 0x6f, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, - 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x43, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, + 0x6e, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x2d, 0x63, 0x6f, 0x72, 0x65, + 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/go/internal/proto/session/session_grpc.pb.go b/go/internal/proto/session/session_grpc.pb.go index 575b5df7574..87d9038f3b5 100644 --- a/go/internal/proto/session/session_grpc.pb.go +++ b/go/internal/proto/session/session_grpc.pb.go @@ -22,11 +22,19 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SessionServiceClient interface { + // Deprecated: Do not use. + // // Handshake between client and server to create a new session. The response includes a metadata header name and the // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + // + // Deprecated: Please use Flight's Handshake or http authorization headers instead. NewSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) + // Deprecated: Do not use. + // // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated // token that should replace the existing token for subsequent requests. + // + // Deprecated: Please use Flight's Handshake with an empty payload. RefreshSessionToken(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all // unreleased exports will be automatically released. @@ -58,6 +66,7 @@ func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { return &sessionServiceClient{cc} } +// Deprecated: Do not use. func (c *sessionServiceClient) NewSession(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) { out := new(HandshakeResponse) err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/NewSession", in, out, opts...) @@ -67,6 +76,7 @@ func (c *sessionServiceClient) NewSession(ctx context.Context, in *HandshakeRequ return out, nil } +// Deprecated: Do not use. func (c *sessionServiceClient) RefreshSessionToken(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error) { out := new(HandshakeResponse) err := c.cc.Invoke(ctx, "/io.deephaven.proto.backplane.grpc.SessionService/RefreshSessionToken", in, out, opts...) @@ -148,11 +158,19 @@ func (c *sessionServiceClient) TerminationNotification(ctx context.Context, in * // All implementations must embed UnimplementedSessionServiceServer // for forward compatibility type SessionServiceServer interface { + // Deprecated: Do not use. + // // Handshake between client and server to create a new session. The response includes a metadata header name and the // token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + // + // Deprecated: Please use Flight's Handshake or http authorization headers instead. NewSession(context.Context, *HandshakeRequest) (*HandshakeResponse, error) + // Deprecated: Do not use. + // // Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated // token that should replace the existing token for subsequent requests. + // + // Deprecated: Please use Flight's Handshake with an empty payload. RefreshSessionToken(context.Context, *HandshakeRequest) (*HandshakeResponse, error) // Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all // unreleased exports will be automatically released. diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto index 56fcbc7d295..78b9759613f 100644 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto +++ b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/session.proto @@ -30,14 +30,23 @@ service SessionService { /* * Handshake between client and server to create a new session. The response includes a metadata header name and the * token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + * + * Deprecated: Please use Flight's Handshake or http authorization headers instead. */ - rpc NewSession(HandshakeRequest) returns (HandshakeResponse) {} + rpc NewSession(HandshakeRequest) returns (HandshakeResponse) { + option deprecated = true; + } /* * Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated * token that should replace the existing token for subsequent requests. + * + * Deprecated: Please use Flight's Handshake with an empty payload. */ - rpc RefreshSessionToken(HandshakeRequest) returns (HandshakeResponse) {} + rpc RefreshSessionToken(HandshakeRequest) returns (HandshakeResponse) { + option deprecated = true; + } + /* * Proactively close an open session. Sessions will automatically close on timeout. When a session is closed, all @@ -76,15 +85,19 @@ service SessionService { } message WrappedAuthenticationRequest { + // do not allow tag 2, since that occurs in flight's BasicAuth + reserved 2; + // do not allow tag 3, since that occurs in flight's BasicAuth + reserved 3; /* * The type of the protobuf the auth payload protobuf. */ - string type = 1; + string type = 4; /* * The serialized payload of the protobuf instance. */ - bytes payload = 2; + bytes payload = 5; } /* @@ -99,12 +112,12 @@ message HandshakeRequest { * - protocol = 0: most recent HandshakeResponse payload * - protocol = 1: payload is BasicAuth */ - sint32 auth_protocol = 1; + sint32 auth_protocol = 1 [deprecated=true]; /* * Arbitrary auth/handshake info. */ - bytes payload = 2; + bytes payload = 2 [deprecated=true]; } /* @@ -117,23 +130,23 @@ message HandshakeResponse { /* * The metadata header to identify the session. This value is static and defined via configuration. */ - bytes metadata_header = 1; + bytes metadata_header = 1 [deprecated=true]; /* * Arbitrary session_token to assign to the value to the provided metadata header. */ - bytes session_token = 2; + bytes session_token = 2 [deprecated=true]; /* * When this session_token will be considered invalid by the server. */ - sint64 token_deadline_time_millis = 3 [jstype=JS_STRING]; + sint64 token_deadline_time_millis = 3 [jstype=JS_STRING, deprecated = true]; /* * The length of time that this token was intended to live. Note that `refreshSessionToken` may return the * existing token to reduce overhead and to prevent denial-of-service caused by refreshing too frequently. */ - sint64 token_expiration_delay_millis = 4 [jstype=JS_STRING]; + sint64 token_expiration_delay_millis = 4 [jstype=JS_STRING, deprecated = true]; } message CloseSessionResponse { diff --git a/py/client/pydeephaven/proto/session_pb2.py b/py/client/pydeephaven/proto/session_pb2.py index 98e4781aa6a..531c13a69fc 100644 --- a/py/client/pydeephaven/proto/session_pb2.py +++ b/py/client/pydeephaven/proto/session_pb2.py @@ -14,7 +14,7 @@ from pydeephaven.proto import ticket_pb2 as deephaven_dot_proto_dot_ticket__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"=\n\x1cWrappedAuthenticationRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\":\n\x10HandshakeRequest\x12\x15\n\rauth_protocol\x18\x01 \x01(\x11\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x96\x01\n\x11HandshakeResponse\x12\x17\n\x0fmetadata_header\x18\x01 \x01(\x0c\x12\x15\n\rsession_token\x18\x02 \x01(\x0c\x12&\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x02\x30\x01\x12)\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x02\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xb5\x07\n\x0eSessionService\x12y\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12\x82\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x00\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/sessionb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64\x65\x65phaven/proto/session.proto\x12!io.deephaven.proto.backplane.grpc\x1a\x1c\x64\x65\x65phaven/proto/ticket.proto\"I\n\x1cWrappedAuthenticationRequest\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\x0f\n\x07payload\x18\x05 \x01(\x0cJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04\"B\n\x10HandshakeRequest\x12\x19\n\rauth_protocol\x18\x01 \x01(\x11\x42\x02\x18\x01\x12\x13\n\x07payload\x18\x02 \x01(\x0c\x42\x02\x18\x01\"\xa2\x01\n\x11HandshakeResponse\x12\x1b\n\x0fmetadata_header\x18\x01 \x01(\x0c\x42\x02\x18\x01\x12\x19\n\rsession_token\x18\x02 \x01(\x0c\x42\x02\x18\x01\x12(\n\x1atoken_deadline_time_millis\x18\x03 \x01(\x12\x42\x04\x18\x01\x30\x01\x12+\n\x1dtoken_expiration_delay_millis\x18\x04 \x01(\x12\x42\x04\x18\x01\x30\x01\"\x16\n\x14\x43loseSessionResponse\"G\n\x0eReleaseRequest\x12\x35\n\x02id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x11\n\x0fReleaseResponse\"\x8b\x01\n\rExportRequest\x12<\n\tsource_id\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12<\n\tresult_id\x18\x02 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\"\x10\n\x0e\x45xportResponse\"\x1b\n\x19\x45xportNotificationRequest\"\xb7\x03\n\x12\x45xportNotification\x12\x39\n\x06ticket\x18\x01 \x01(\x0b\x32).io.deephaven.proto.backplane.grpc.Ticket\x12Q\n\x0c\x65xport_state\x18\x02 \x01(\x0e\x32;.io.deephaven.proto.backplane.grpc.ExportNotification.State\x12\x0f\n\x07\x63ontext\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65pendent_handle\x18\x04 \x01(\t\"\xe7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nPUBLISHING\x10\x02\x12\n\n\x06QUEUED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\x0c\n\x08\x45XPORTED\x10\x05\x12\x0c\n\x08RELEASED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08\x12\x15\n\x11\x44\x45PENDENCY_FAILED\x10\t\x12\x1a\n\x16\x44\x45PENDENCY_NEVER_FOUND\x10\n\x12\x18\n\x14\x44\x45PENDENCY_CANCELLED\x10\x0b\x12\x17\n\x13\x44\x45PENDENCY_RELEASED\x10\x0c\" \n\x1eTerminationNotificationRequest\"\x97\x02\n\x1fTerminationNotificationResponse\x12\x1c\n\x14\x61\x62normal_termination\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\"\n\x1ais_from_uncaught_exception\x18\x03 \x01(\x08\x12\x63\n\x0cstack_traces\x18\x04 \x03(\x0b\x32M.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse.StackTrace\x1a=\n\nStackTrace\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x10\n\x08\x65lements\x18\x03 \x03(\t2\xbb\x07\n\x0eSessionService\x12|\n\nNewSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x03\x88\x02\x01\x12\x85\x01\n\x13RefreshSessionToken\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x34.io.deephaven.proto.backplane.grpc.HandshakeResponse\"\x03\x88\x02\x01\x12~\n\x0c\x43loseSession\x12\x33.io.deephaven.proto.backplane.grpc.HandshakeRequest\x1a\x37.io.deephaven.proto.backplane.grpc.CloseSessionResponse\"\x00\x12r\n\x07Release\x12\x31.io.deephaven.proto.backplane.grpc.ReleaseRequest\x1a\x32.io.deephaven.proto.backplane.grpc.ReleaseResponse\"\x00\x12y\n\x10\x45xportFromTicket\x12\x30.io.deephaven.proto.backplane.grpc.ExportRequest\x1a\x31.io.deephaven.proto.backplane.grpc.ExportResponse\"\x00\x12\x8e\x01\n\x13\x45xportNotifications\x12<.io.deephaven.proto.backplane.grpc.ExportNotificationRequest\x1a\x35.io.deephaven.proto.backplane.grpc.ExportNotification\"\x00\x30\x01\x12\xa2\x01\n\x17TerminationNotification\x12\x41.io.deephaven.proto.backplane.grpc.TerminationNotificationRequest\x1a\x42.io.deephaven.proto.backplane.grpc.TerminationNotificationResponse\"\x00\x42\x43H\x01P\x01Z=github.com/deephaven/deephaven-core/go/internal/proto/sessionb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'deephaven.proto.session_pb2', globals()) @@ -22,38 +22,50 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'H\001P\001Z=github.com/deephaven/deephaven-core/go/internal/proto/session' + _HANDSHAKEREQUEST.fields_by_name['auth_protocol']._options = None + _HANDSHAKEREQUEST.fields_by_name['auth_protocol']._serialized_options = b'\030\001' + _HANDSHAKEREQUEST.fields_by_name['payload']._options = None + _HANDSHAKEREQUEST.fields_by_name['payload']._serialized_options = b'\030\001' + _HANDSHAKERESPONSE.fields_by_name['metadata_header']._options = None + _HANDSHAKERESPONSE.fields_by_name['metadata_header']._serialized_options = b'\030\001' + _HANDSHAKERESPONSE.fields_by_name['session_token']._options = None + _HANDSHAKERESPONSE.fields_by_name['session_token']._serialized_options = b'\030\001' _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._options = None - _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._serialized_options = b'0\001' + _HANDSHAKERESPONSE.fields_by_name['token_deadline_time_millis']._serialized_options = b'\030\0010\001' _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._options = None - _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._serialized_options = b'0\001' + _HANDSHAKERESPONSE.fields_by_name['token_expiration_delay_millis']._serialized_options = b'\030\0010\001' + _SESSIONSERVICE.methods_by_name['NewSession']._options = None + _SESSIONSERVICE.methods_by_name['NewSession']._serialized_options = b'\210\002\001' + _SESSIONSERVICE.methods_by_name['RefreshSessionToken']._options = None + _SESSIONSERVICE.methods_by_name['RefreshSessionToken']._serialized_options = b'\210\002\001' _WRAPPEDAUTHENTICATIONREQUEST._serialized_start=98 - _WRAPPEDAUTHENTICATIONREQUEST._serialized_end=159 - _HANDSHAKEREQUEST._serialized_start=161 - _HANDSHAKEREQUEST._serialized_end=219 - _HANDSHAKERESPONSE._serialized_start=222 - _HANDSHAKERESPONSE._serialized_end=372 - _CLOSESESSIONRESPONSE._serialized_start=374 - _CLOSESESSIONRESPONSE._serialized_end=396 - _RELEASEREQUEST._serialized_start=398 - _RELEASEREQUEST._serialized_end=469 - _RELEASERESPONSE._serialized_start=471 - _RELEASERESPONSE._serialized_end=488 - _EXPORTREQUEST._serialized_start=491 - _EXPORTREQUEST._serialized_end=630 - _EXPORTRESPONSE._serialized_start=632 - _EXPORTRESPONSE._serialized_end=648 - _EXPORTNOTIFICATIONREQUEST._serialized_start=650 - _EXPORTNOTIFICATIONREQUEST._serialized_end=677 - _EXPORTNOTIFICATION._serialized_start=680 - _EXPORTNOTIFICATION._serialized_end=1119 - _EXPORTNOTIFICATION_STATE._serialized_start=888 - _EXPORTNOTIFICATION_STATE._serialized_end=1119 - _TERMINATIONNOTIFICATIONREQUEST._serialized_start=1121 - _TERMINATIONNOTIFICATIONREQUEST._serialized_end=1153 - _TERMINATIONNOTIFICATIONRESPONSE._serialized_start=1156 - _TERMINATIONNOTIFICATIONRESPONSE._serialized_end=1435 - _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_start=1374 - _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_end=1435 - _SESSIONSERVICE._serialized_start=1438 - _SESSIONSERVICE._serialized_end=2387 + _WRAPPEDAUTHENTICATIONREQUEST._serialized_end=171 + _HANDSHAKEREQUEST._serialized_start=173 + _HANDSHAKEREQUEST._serialized_end=239 + _HANDSHAKERESPONSE._serialized_start=242 + _HANDSHAKERESPONSE._serialized_end=404 + _CLOSESESSIONRESPONSE._serialized_start=406 + _CLOSESESSIONRESPONSE._serialized_end=428 + _RELEASEREQUEST._serialized_start=430 + _RELEASEREQUEST._serialized_end=501 + _RELEASERESPONSE._serialized_start=503 + _RELEASERESPONSE._serialized_end=520 + _EXPORTREQUEST._serialized_start=523 + _EXPORTREQUEST._serialized_end=662 + _EXPORTRESPONSE._serialized_start=664 + _EXPORTRESPONSE._serialized_end=680 + _EXPORTNOTIFICATIONREQUEST._serialized_start=682 + _EXPORTNOTIFICATIONREQUEST._serialized_end=709 + _EXPORTNOTIFICATION._serialized_start=712 + _EXPORTNOTIFICATION._serialized_end=1151 + _EXPORTNOTIFICATION_STATE._serialized_start=920 + _EXPORTNOTIFICATION_STATE._serialized_end=1151 + _TERMINATIONNOTIFICATIONREQUEST._serialized_start=1153 + _TERMINATIONNOTIFICATIONREQUEST._serialized_end=1185 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_start=1188 + _TERMINATIONNOTIFICATIONRESPONSE._serialized_end=1467 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_start=1406 + _TERMINATIONNOTIFICATIONRESPONSE_STACKTRACE._serialized_end=1467 + _SESSIONSERVICE._serialized_start=1470 + _SESSIONSERVICE._serialized_end=2425 # @@protoc_insertion_point(module_scope) diff --git a/py/client/pydeephaven/proto/session_pb2_grpc.py b/py/client/pydeephaven/proto/session_pb2_grpc.py index 34acc362539..929823e9cd7 100644 --- a/py/client/pydeephaven/proto/session_pb2_grpc.py +++ b/py/client/pydeephaven/proto/session_pb2_grpc.py @@ -86,6 +86,8 @@ def NewSession(self, request, context): """ Handshake between client and server to create a new session. The response includes a metadata header name and the token to send on every subsequent request. The auth mechanisms here are unary to best support grpc-web. + + Deprecated: Please use Flight's Handshake or http authorization headers instead. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -95,6 +97,8 @@ def RefreshSessionToken(self, request, context): """ Keep-alive a given token to ensure that a session is not cleaned prematurely. The response may include an updated token that should replace the existing token for subsequent requests. + + Deprecated: Please use Flight's Handshake with an empty payload. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') diff --git a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java index ff9326e46e7..08d1ba312a8 100644 --- a/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/arrow/FlightServiceGrpcImpl.java @@ -44,23 +44,19 @@ public class FlightServiceGrpcImpl extends FlightServiceGrpc.FlightServiceImplBa private final TicketRouter ticketRouter; private final ArrowFlightUtil.DoExchangeMarshaller.Factory doExchangeFactory; - private final BasicAuthMarshaller basicAuthMarshaller; private final Map authRequestHandlers; - @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @Inject public FlightServiceGrpcImpl( @Nullable final ScheduledExecutorService executorService, final SessionService sessionService, final TicketRouter ticketRouter, final ArrowFlightUtil.DoExchangeMarshaller.Factory doExchangeFactory, - final Optional basicAuthMarshaller, Map authRequestHandlers) { this.executorService = executorService; this.sessionService = sessionService; this.ticketRouter = ticketRouter; this.doExchangeFactory = doExchangeFactory; - this.basicAuthMarshaller = basicAuthMarshaller.orElse(null); this.authRequestHandlers = authRequestHandlers; } @@ -100,19 +96,12 @@ public void onNext(final Flight.HandshakeRequest value) { final ByteString payload = value.getPayload(); final long protocolVersion = value.getProtocolVersion(); - Optional auth = Optional.empty(); + Optional auth; try { - if (basicAuthMarshaller != null) { - auth = basicAuthMarshaller.login(protocolVersion, payload.asReadOnlyByteBuffer(), - handshakeResponseListener); - } + auth = login(BasicAuthMarshaller.AUTH_TYPE, protocolVersion, payload, handshakeResponseListener); if (auth.isEmpty()) { final WrappedAuthenticationRequest req = WrappedAuthenticationRequest.parseFrom(payload); - final AuthenticationRequestHandler handler = authRequestHandlers.get(req.getType()); - if (handler != null) { - auth = handler.login(protocolVersion, req.getPayload().asReadOnlyByteBuffer(), - handshakeResponseListener); - } + auth = login(req.getType(), protocolVersion, req.getPayload(), handshakeResponseListener); } } catch (final AuthenticationException | InvalidProtocolBufferException err) { log.error().append("Authentication failed: ").append(err).endl(); @@ -129,6 +118,15 @@ public void onNext(final Flight.HandshakeRequest value) { respondWithAuthTokenBin(session); } + private Optional login(String type, long version, ByteString payload, + AuthenticationRequestHandler.HandshakeResponseListener listener) throws AuthenticationException { + AuthenticationRequestHandler handler = authRequestHandlers.get(type); + if (handler == null) { + return Optional.empty(); + } + return handler.login(version, payload.asReadOnlyByteBuffer(), listener); + } + /** send the bearer token as an AuthTokenBin, as headers might have already been sent */ private void respondWithAuthTokenBin(SessionState session) { isComplete = true; diff --git a/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java b/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java index c1a0e689ca1..f477fddc2a7 100644 --- a/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java +++ b/server/src/main/java/io/deephaven/server/auth/AuthContextModule.java @@ -17,16 +17,14 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Optional; -@Module() +@Module public class AuthContextModule { private static final Logger log = LoggerFactory.getLogger(BarrageStreamGenerator.class); private static final String[] AUTH_HANDLERS = Configuration.getInstance() .getStringArrayFromPropertyWithDefault("AuthHandlers", new String[] {AnonymousAuthenticationHandler.class.getCanonicalName()}); - private static BasicAuthMarshaller basicAuthMarshaller; private static Map authHandlerMap; private static void initializeAuthHandlers() { @@ -41,14 +39,18 @@ private static void initializeAuthHandlers() { final Class clazz = AuthContextModule.class.getClassLoader().loadClass(handler); Object instance = clazz.getDeclaredConstructor().newInstance(); if (instance instanceof BasicAuthMarshaller.Handler) { - if (basicAuthMarshaller != null) { - throw new UncheckedDeephavenException("Found multiple BasicAuthMarshaller.Handlers"); - } - basicAuthMarshaller = new BasicAuthMarshaller((BasicAuthMarshaller.Handler) instance); - authHandlerMap.put(basicAuthMarshaller.getAuthType(), basicAuthMarshaller); - } else if (instance instanceof AuthenticationRequestHandler) { + // Re-wrap this special case in a general auth request handler + instance = new BasicAuthMarshaller((BasicAuthMarshaller.Handler) instance); + } + if (instance instanceof AuthenticationRequestHandler) { final AuthenticationRequestHandler authHandler = (AuthenticationRequestHandler) instance; - authHandlerMap.put(authHandler.getAuthType(), authHandler); + AuthenticationRequestHandler existing = authHandlerMap.put(authHandler.getAuthType(), authHandler); + if (existing != null) { + log.error().append("Multiple handlers registered for authentication type ") + .append(existing.getAuthType()).end(); + throw new UncheckedDeephavenException( + "Multiple authentication handlers registered for type " + existing.getAuthType()); + } } else { log.error().append("Provided auth handler does not implement an auth interface: ") .append(handler).endl(); @@ -64,12 +66,6 @@ private static void initializeAuthHandlers() { authHandlerMap = Collections.unmodifiableMap(authHandlerMap); } - @Provides - public Optional bindBasicAuth() { - initializeAuthHandlers(); - return Optional.ofNullable(basicAuthMarshaller); - } - @Provides public Map bindAuthHandlerMap() { initializeAuthHandlers(); diff --git a/server/src/main/java/io/deephaven/server/session/SessionService.java b/server/src/main/java/io/deephaven/server/session/SessionService.java index 0303d255464..0af292120b0 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionService.java +++ b/server/src/main/java/io/deephaven/server/session/SessionService.java @@ -7,7 +7,6 @@ import com.google.protobuf.ByteString; import io.deephaven.auth.AuthenticationException; import io.deephaven.auth.AuthenticationRequestHandler; -import io.deephaven.auth.BasicAuthMarshaller; import io.deephaven.configuration.Configuration; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.proto.backplane.grpc.TerminationNotificationResponse; @@ -31,7 +30,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedDeque; @@ -63,19 +61,15 @@ public class SessionService { private final List terminationListeners = new CopyOnWriteArrayList<>(); - private final BasicAuthMarshaller basicAuthMarshaller; private final Map authRequestHandlers; - @Inject() - @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + @Inject public SessionService(final Scheduler scheduler, final SessionState.Factory sessionFactory, @Named("session.tokenExpireMs") final long tokenExpireMs, - final Optional basicAuthMarshaller, Map authRequestHandlers) { this.scheduler = scheduler; this.sessionFactory = sessionFactory; this.tokenExpireMs = tokenExpireMs; - this.basicAuthMarshaller = basicAuthMarshaller.orElse(null); this.authRequestHandlers = authRequestHandlers; if (tokenExpireMs < MIN_COOKIE_EXPIRE_MS) { @@ -243,21 +237,16 @@ public SessionState getSessionForAuthToken(final String token) throws Authentica } } - Optional context = Optional.empty(); - if (token.startsWith(Auth2Constants.BASIC_PREFIX) && basicAuthMarshaller != null) { - final String payload = token.substring(Auth2Constants.BASIC_PREFIX.length()); - context = basicAuthMarshaller.login(payload, SessionServiceGrpcImpl::insertCallHeader); - } else { - int offset = token.indexOf(' '); - final String key = token.substring(0, offset < 0 ? token.length() : offset); - final String payload = offset < 0 ? "" : token.substring(offset + 1); - AuthenticationRequestHandler handler = authRequestHandlers.get(key); - if (handler != null) { - context = handler.login(payload, SessionServiceGrpcImpl::insertCallHeader); - } + int offset = token.indexOf(' '); + final String key = token.substring(0, offset < 0 ? token.length() : offset); + final String payload = offset < 0 ? "" : token.substring(offset + 1); + AuthenticationRequestHandler handler = authRequestHandlers.get(key); + if (handler == null) { + throw new AuthenticationException(); } - - return context.map(this::newSession).orElse(null); + return handler.login(payload, SessionServiceGrpcImpl::insertCallHeader) + .map(this::newSession) + .orElseThrow(AuthenticationException::new); } /** diff --git a/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java b/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java index 4b59d2f2383..744db577aa3 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java +++ b/server/src/main/java/io/deephaven/server/session/SessionServiceGrpcImpl.java @@ -5,6 +5,7 @@ import com.google.protobuf.ByteString; import com.google.rpc.Code; +import io.deephaven.auth.AuthContext; import io.deephaven.auth.AuthenticationException; import io.deephaven.extensions.barrage.util.GrpcUtil; import io.deephaven.internal.log.LoggerFactory; @@ -21,7 +22,6 @@ import io.deephaven.proto.backplane.grpc.SessionServiceGrpc; import io.deephaven.proto.backplane.grpc.TerminationNotificationRequest; import io.deephaven.proto.backplane.grpc.TerminationNotificationResponse; -import io.deephaven.auth.AuthContext; import io.grpc.Context; import io.grpc.Contexts; import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; @@ -295,8 +295,13 @@ public ServerCall.Listener interceptCall(final ServerCall() {}; } } final InterceptedCall serverCall = new InterceptedCall<>(service, call, session); diff --git a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java index ecd8a8072a4..6d1caa5a716 100644 --- a/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java +++ b/server/src/test/java/io/deephaven/server/appmode/ApplicationServiceGrpcImplTest.java @@ -44,7 +44,7 @@ public void setup() { scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, authContext -> new SessionState(scheduler, ExecutionContext::createForUnitTests, authContext), - TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); + TOKEN_EXPIRE_MS, Collections.emptyMap()); applicationServiceGrpcImpl = new ApplicationServiceGrpcImpl(scheduler, sessionService, new TypeLookup(ObjectTypeLookup.NoOp.INSTANCE)); } diff --git a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java index 8253f5527d6..4b7e067a380 100644 --- a/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java +++ b/server/src/test/java/io/deephaven/server/session/SessionServiceTest.java @@ -32,7 +32,7 @@ public void setup() { scheduler = new TestControlledScheduler(); sessionService = new SessionService(scheduler, authContext -> new SessionState(scheduler, ExecutionContext::createForUnitTests, authContext), - TOKEN_EXPIRE_MS, Optional.empty(), Collections.emptyMap()); + TOKEN_EXPIRE_MS, Collections.emptyMap()); } @After diff --git a/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java b/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java index 7126f279ff4..2a5f80116c5 100644 --- a/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java +++ b/server/test/src/main/java/io/deephaven/server/test/AuthTestModule.java @@ -16,7 +16,7 @@ import java.util.Objects; import java.util.Optional; -@Module() +@Module public class AuthTestModule { public static class BasicAuthTestImpl implements BasicAuthMarshaller.Handler { public Map validLogins = new HashMap<>(); @@ -45,14 +45,10 @@ public BasicAuthMarshaller bindBasicAuth(BasicAuthTestImpl handler) { @Provides @Singleton - public Optional bindBasicAuthProvider(BasicAuthMarshaller marshaller) { - return Optional.of(marshaller); - } - - @Provides - @Singleton - public Map bindAuthHandlerMap() { + public Map bindAuthHandlerMap(BasicAuthMarshaller basicAuthMarshaller) { // note this is mutable - return new HashMap<>(); + HashMap map = new HashMap<>(); + map.put(basicAuthMarshaller.getAuthType(), basicAuthMarshaller); + return map; } } From e582a421567aba6459edb5b9093f7d7f47903814 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 11 Oct 2022 13:28:03 -0500 Subject: [PATCH 211/215] Better handling for session expiry (#2986) Server should send a non-empty message when the session ends, and js client should notify user of failure in all cases. Partial #2985 --- .../main/java/io/deephaven/server/session/SessionService.java | 4 ++++ .../java/io/deephaven/web/client/api/WorkerConnection.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/server/src/main/java/io/deephaven/server/session/SessionService.java b/server/src/main/java/io/deephaven/server/session/SessionService.java index 0af292120b0..86cc84e111f 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionService.java +++ b/server/src/main/java/io/deephaven/server/session/SessionService.java @@ -5,6 +5,7 @@ import com.github.f4b6a3.uuid.UuidCreator; import com.google.protobuf.ByteString; +import com.google.rpc.Code; import io.deephaven.auth.AuthenticationException; import io.deephaven.auth.AuthenticationRequestHandler; import io.deephaven.configuration.Configuration; @@ -383,6 +384,9 @@ public TerminationNotificationListener( @Override void onClose() { + GrpcUtil.safelyExecuteLocked(responseObserver, () -> { + responseObserver.onError(GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, "Session has ended")); + }); terminationListeners.remove(this); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index 9e9e9896d3f..6a6e6dbdb7f 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -438,8 +438,11 @@ private void subscribeToTerminationNotification() { // restart the termination notification subscribeToTerminationNotification(); return; + } else { + info.notifyConnectionError(Js.cast(fail)); } } + assert success != null; // welp; the server is gone -- let everyone know info.notifyConnectionError(new ResponseStreamWrapper.Status() { From 9034a48f17cc9525ae2fb6af14002d4dd3f5b97d Mon Sep 17 00:00:00 2001 From: JJ Brosnan <84038776+jjbrosnan@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:28:45 -0400 Subject: [PATCH 212/215] Upgrade to Jetty images (#2945) * Update docker-compose files to use jetty image, remove use of `notebook` and `reverse-proxy` services * netty to jetty, also remove traefik label from all files * Add deephaven port and remove jetty from names, as there is no jetty suffix * Add port 6006 to TensorFlow and PyTorch examples for TensorBoard support * Add latest tag to examples containers --- containers/groovy-examples/docker-compose.yml | 44 +++---------------- containers/groovy/docker-compose.yml | 42 +++--------------- .../docker-compose.yml | 43 +++--------------- .../python-examples/All-AI/docker-compose.yml | 41 ++--------------- .../python-examples/NLTK/docker-compose.yml | 41 +++-------------- .../PyTorch/docker-compose.yml | 40 ++--------------- .../SciKit-Learn/docker-compose.yml | 41 +++-------------- .../TensorFlow/docker-compose.yml | 40 ++--------------- .../python-examples/base/docker-compose.yml | 42 +++--------------- containers/python/All-AI/docker-compose.yml | 41 ++--------------- containers/python/NLTK/docker-compose.yml | 41 +++-------------- containers/python/PyTorch/docker-compose.yml | 40 ++--------------- .../python/SciKit-Learn/docker-compose.yml | 41 +++-------------- .../python/TensorFlow/docker-compose.yml | 40 ++--------------- containers/python/base/docker-compose.yml | 42 +++--------------- 15 files changed, 70 insertions(+), 549 deletions(-) diff --git a/containers/groovy-examples/docker-compose.yml b/containers/groovy-examples/docker-compose.yml index 8ac7e9e7a3a..24b781819d7 100644 --- a/containers/groovy-examples/docker-compose.yml +++ b/containers/groovy-examples/docker-compose.yml @@ -1,49 +1,17 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-slim:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=groovy - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: - image: ghcr.io/deephaven/examples + image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: - diff --git a/containers/groovy/docker-compose.yml b/containers/groovy/docker-compose.yml index 0e22898c9ca..4718dfdbfce 100644 --- a/containers/groovy/docker-compose.yml +++ b/containers/groovy/docker-compose.yml @@ -1,43 +1,11 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-slim:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=groovy - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: - + - JAVA_OPTS=-Xmx4g diff --git a/containers/python-examples-redpanda/docker-compose.yml b/containers/python-examples-redpanda/docker-compose.yml index 9585008d32d..c951b378d09 100644 --- a/containers/python-examples-redpanda/docker-compose.yml +++ b/containers/python-examples-redpanda/docker-compose.yml @@ -1,41 +1,14 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '80' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples @@ -43,7 +16,6 @@ services: - ./data:/data command: initialize - redpanda: command: - redpanda @@ -75,8 +47,3 @@ services: KAFKA_BOOTSTRAP_SERVERS: redpanda:9092 APPLICATION_ID: registry_id APPLICATION_SERVER: localhost:9000 - -volumes: - web-tmp: - api-cache: - diff --git a/containers/python-examples/All-AI/docker-compose.yml b/containers/python-examples/All-AI/docker-compose.yml index 8ea30148574..d84367d3942 100644 --- a/containers/python-examples/All-AI/docker-compose.yml +++ b/containers/python-examples/All-AI/docker-compose.yml @@ -1,50 +1,17 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-all-ai:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-all-ai:latest ports: - - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: diff --git a/containers/python-examples/NLTK/docker-compose.yml b/containers/python-examples/NLTK/docker-compose.yml index 8cb69624db0..a75f7fcb68a 100644 --- a/containers/python-examples/NLTK/docker-compose.yml +++ b/containers/python-examples/NLTK/docker-compose.yml @@ -1,48 +1,17 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-nltk:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-nltk:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: diff --git a/containers/python-examples/PyTorch/docker-compose.yml b/containers/python-examples/PyTorch/docker-compose.yml index c515d6215e5..f39ff15ac21 100644 --- a/containers/python-examples/PyTorch/docker-compose.yml +++ b/containers/python-examples/PyTorch/docker-compose.yml @@ -1,50 +1,18 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-pytorch:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-pytorch:latest ports: + - "${DEEPHAVEN_PORT:-10000}:10000" - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: diff --git a/containers/python-examples/SciKit-Learn/docker-compose.yml b/containers/python-examples/SciKit-Learn/docker-compose.yml index ea292c53f2a..c4d5afa0359 100644 --- a/containers/python-examples/SciKit-Learn/docker-compose.yml +++ b/containers/python-examples/SciKit-Learn/docker-compose.yml @@ -1,48 +1,17 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-sklearn:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-sklearn:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: diff --git a/containers/python-examples/TensorFlow/docker-compose.yml b/containers/python-examples/TensorFlow/docker-compose.yml index 23b4bc00d3e..9fefe698413 100644 --- a/containers/python-examples/TensorFlow/docker-compose.yml +++ b/containers/python-examples/TensorFlow/docker-compose.yml @@ -1,50 +1,18 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-tensorflow:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-tensorflow:latest ports: + - "${DEEPHAVEN_PORT:-10000}:10000" - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: diff --git a/containers/python-examples/base/docker-compose.yml b/containers/python-examples/base/docker-compose.yml index ee1e969d323..97e0daa6dc8 100644 --- a/containers/python-examples/base/docker-compose.yml +++ b/containers/python-examples/base/docker-compose.yml @@ -1,49 +1,17 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" + - JAVA_OPTS=-Xmx4g examples: image: ghcr.io/deephaven/examples:latest volumes: - ./data:/data command: initialize - -volumes: - web-tmp: - api-cache: - diff --git a/containers/python/All-AI/docker-compose.yml b/containers/python/All-AI/docker-compose.yml index 5a1fc96df25..bfc4e0971f0 100644 --- a/containers/python/All-AI/docker-compose.yml +++ b/containers/python/All-AI/docker-compose.yml @@ -1,44 +1,11 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-all-ai:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-all-ai:latest ports: - - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: + - JAVA_OPTS=-Xmx4g diff --git a/containers/python/NLTK/docker-compose.yml b/containers/python/NLTK/docker-compose.yml index 60877c52bec..5b545c500d9 100644 --- a/containers/python/NLTK/docker-compose.yml +++ b/containers/python/NLTK/docker-compose.yml @@ -1,42 +1,11 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-nltk:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-nltk:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: + - JAVA_OPTS=-Xmx4g diff --git a/containers/python/PyTorch/docker-compose.yml b/containers/python/PyTorch/docker-compose.yml index e3cc3a28d99..4b78ceaba58 100644 --- a/containers/python/PyTorch/docker-compose.yml +++ b/containers/python/PyTorch/docker-compose.yml @@ -1,44 +1,12 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-pytorch:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-pytorch:latest ports: + - "${DEEPHAVEN_PORT:-10000}:10000" - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: + - JAVA_OPTS=-Xmx4g diff --git a/containers/python/SciKit-Learn/docker-compose.yml b/containers/python/SciKit-Learn/docker-compose.yml index 3839500dcaf..d4b67fafbff 100644 --- a/containers/python/SciKit-Learn/docker-compose.yml +++ b/containers/python/SciKit-Learn/docker-compose.yml @@ -1,42 +1,11 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-sklearn:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server-sklearn:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: + - JAVA_OPTS=-Xmx4g diff --git a/containers/python/TensorFlow/docker-compose.yml b/containers/python/TensorFlow/docker-compose.yml index 83605868615..74c976cafc6 100644 --- a/containers/python/TensorFlow/docker-compose.yml +++ b/containers/python/TensorFlow/docker-compose.yml @@ -1,44 +1,12 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server-tensorflow:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - api-cache:/cache - environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python + deephaven: + image: ghcr.io/deephaven/server-tensorflow:latest ports: + - "${DEEPHAVEN_PORT:-10000}:10000" - 6006:6006 - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' volumes: - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: + - JAVA_OPTS=-Xmx4g diff --git a/containers/python/base/docker-compose.yml b/containers/python/base/docker-compose.yml index b2c6f863699..67ebddd5311 100644 --- a/containers/python/base/docker-compose.yml +++ b/containers/python/base/docker-compose.yml @@ -1,43 +1,11 @@ version: "3.4" services: - server: - image: ghcr.io/deephaven/server:${VERSION:-latest} - expose: - - '8080' + deephaven: + image: ghcr.io/deephaven/server:latest + ports: + - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data - - api-cache:/cache environment: - - JAVA_TOOL_OPTIONS=-Xmx4g -Ddeephaven.console.type=python - - web: - image: ghcr.io/deephaven/web:${VERSION:-latest} - expose: - - '8080' - volumes: - - ./data:/data - - web-tmp:/tmp - - grpc-proxy: - image: ghcr.io/deephaven/grpc-proxy:${VERSION:-latest} - environment: - - BACKEND_ADDR=server:8080 - depends_on: - - server - expose: - - '8080' - - envoy: - image: ghcr.io/deephaven/envoy:${VERSION:-latest} - depends_on: - - web - - grpc-proxy - - server - ports: - - "${DEEPHAVEN_PORT:-10000}:10000" - -volumes: - web-tmp: - api-cache: - + - JAVA_OPTS=-Xmx4g From 02937cac01cf0e4515874a25c313852fbb1f15ed Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 12 Oct 2022 13:45:44 -0700 Subject: [PATCH 213/215] Bump base images, includes deephaven-plugin bump to 0.3.0 (#2990) --- docker/registry/all-ai-base/gradle.properties | 2 +- docker/registry/go/gradle.properties | 2 +- docker/registry/nltk-base/gradle.properties | 2 +- docker/registry/protoc-base/gradle.properties | 2 +- docker/registry/python/gradle.properties | 2 +- docker/registry/pytorch-base/gradle.properties | 2 +- docker/registry/server-base/gradle.properties | 2 +- docker/registry/sklearn-base/gradle.properties | 2 +- docker/registry/tensorflow-base/gradle.properties | 2 +- docker/server-jetty/src/main/server-jetty/requirements.txt | 6 +++--- docker/server/src/main/server-all-ai-netty/requirements.txt | 6 +++--- docker/server/src/main/server-netty/requirements.txt | 6 +++--- docker/server/src/main/server-nltk-netty/requirements.txt | 6 +++--- .../server/src/main/server-pytorch-netty/requirements.txt | 6 +++--- .../server/src/main/server-sklearn-netty/requirements.txt | 6 +++--- .../src/main/server-tensorflow-netty/requirements.txt | 6 +++--- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docker/registry/all-ai-base/gradle.properties b/docker/registry/all-ai-base/gradle.properties index a477faf9555..e45f1b07f4b 100644 --- a/docker/registry/all-ai-base/gradle.properties +++ b/docker/registry/all-ai-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/all-ai-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/all-ai-base@sha256:d92177b3fadc9f78282f96e9c8d1b54c5c03b8879164351f114446af92d12781 +deephaven.registry.imageId=ghcr.io/deephaven/all-ai-base@sha256:967c025b5598f0375aaa1eb95c68a04643e798d3a2b01eddf81381324c17c858 diff --git a/docker/registry/go/gradle.properties b/docker/registry/go/gradle.properties index a4f656d8ee8..5dcbd10f6e1 100644 --- a/docker/registry/go/gradle.properties +++ b/docker/registry/go/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=golang:1 -deephaven.registry.imageId=golang@sha256:c17baa6873e2deca671d240a654d716f76f6e1c7a264461a42eb3ee07eb718c9 +deephaven.registry.imageId=golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 diff --git a/docker/registry/nltk-base/gradle.properties b/docker/registry/nltk-base/gradle.properties index ad1a41fa05b..7e24a18f1dc 100644 --- a/docker/registry/nltk-base/gradle.properties +++ b/docker/registry/nltk-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/nltk-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:32d627476695bb0f0d8be99968135e96b17dfedb8dbcfacd3c839183fb845ecd +deephaven.registry.imageId=ghcr.io/deephaven/nltk-base@sha256:a9170a586099cd4f26d0b00ce14a311b0480acdae71c1f241674dbe7a9aaf794 diff --git a/docker/registry/protoc-base/gradle.properties b/docker/registry/protoc-base/gradle.properties index 64b19d85c8a..1a5926370b0 100644 --- a/docker/registry/protoc-base/gradle.properties +++ b/docker/registry/protoc-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/protoc-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:1c6b9de6e47173a4b569496ac4efc3a33b6d0988e9a80a78050d36b397338a11 +deephaven.registry.imageId=ghcr.io/deephaven/protoc-base@sha256:e3c59e0441d60d0d99708bc659c83bd6790a6cd8374164825bbd58063288a4cf diff --git a/docker/registry/python/gradle.properties b/docker/registry/python/gradle.properties index 78eecda3358..2a880016a4e 100644 --- a/docker/registry/python/gradle.properties +++ b/docker/registry/python/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=python:3.7 -deephaven.registry.imageId=python@sha256:ab5e518c3bed5619d2170a6c3e6a1a341466688c367ebf2b102329d171691450 +deephaven.registry.imageId=python@sha256:51dcbb98ba807f3631366d5a0678bc6815ca71901ddab6ed2ed5319da79f1c4d diff --git a/docker/registry/pytorch-base/gradle.properties b/docker/registry/pytorch-base/gradle.properties index 4ecc94c25ea..dd1e1d9b5d6 100644 --- a/docker/registry/pytorch-base/gradle.properties +++ b/docker/registry/pytorch-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/pytorch-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:e656a3a1b78cb547ef8b42d1ee7d4293f9efa1874d7d7bd6aa543b341ffe7c75 +deephaven.registry.imageId=ghcr.io/deephaven/pytorch-base@sha256:c79a8149bf0e497b37546ab3a42857dafcc3f12c0d4bace53451837bec5f77aa diff --git a/docker/registry/server-base/gradle.properties b/docker/registry/server-base/gradle.properties index 927b192c7e3..572ef81574d 100644 --- a/docker/registry/server-base/gradle.properties +++ b/docker/registry/server-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/server-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:7752c3dbb4ad1f2b47ab16dea225e2229729aa4e95d97d6cd9ec9255a368b9ae +deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:101c080344ade2a9eeb8e037b9d47a3c3bd45be36c316265a5365a5125f9b2e1 diff --git a/docker/registry/sklearn-base/gradle.properties b/docker/registry/sklearn-base/gradle.properties index e275e758592..5b975c830eb 100644 --- a/docker/registry/sklearn-base/gradle.properties +++ b/docker/registry/sklearn-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/sklearn-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:f26b1e0fda4f5fb1e578d01d6b909a198b390d439ffc45aedc1143d7f1d10559 +deephaven.registry.imageId=ghcr.io/deephaven/sklearn-base@sha256:32462edc3798b9bc5c1a780cc2fd7216fb84245f227580b65fbcfbbc3e804028 diff --git a/docker/registry/tensorflow-base/gradle.properties b/docker/registry/tensorflow-base/gradle.properties index d32ab4feabc..d84271732c2 100644 --- a/docker/registry/tensorflow-base/gradle.properties +++ b/docker/registry/tensorflow-base/gradle.properties @@ -1,3 +1,3 @@ io.deephaven.project.ProjectType=DOCKER_REGISTRY deephaven.registry.imageName=ghcr.io/deephaven/tensorflow-base:latest -deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:3f9c9b403743b056a59d16c4982a165162a20ce6223251b810b5adc06affb991 +deephaven.registry.imageId=ghcr.io/deephaven/tensorflow-base@sha256:1d665e346d4b30dfc2144510dc0cfab7b69c0c0dfb1fb766389f9db8d5bbbb98 diff --git a/docker/server-jetty/src/main/server-jetty/requirements.txt b/docker/server-jetty/src/main/server-jetty/requirements.txt index 0f53f784b8b..36abd4d093a 100644 --- a/docker/server-jetty/src/main/server-jetty/requirements.txt +++ b/docker/server-jetty/src/main/server-jetty/requirements.txt @@ -1,4 +1,4 @@ -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 @@ -9,5 +9,5 @@ pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.4 six==1.16.0 -typing_extensions==4.3.0 -zipp==3.8.1 +typing_extensions==4.4.0 +zipp==3.9.0 diff --git a/docker/server/src/main/server-all-ai-netty/requirements.txt b/docker/server/src/main/server-all-ai-netty/requirements.txt index 3f56b42550e..bb514987f9b 100644 --- a/docker/server/src/main/server-all-ai-netty/requirements.txt +++ b/docker/server/src/main/server-all-ai-netty/requirements.txt @@ -4,7 +4,7 @@ cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 click==8.1.3 -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 flatbuffers==2.0.7 gast==0.4.0 google-auth==2.12.0 @@ -51,8 +51,8 @@ termcolor==2.0.1 threadpoolctl==3.1.0 torch==1.12.1 tqdm==4.64.1 -typing_extensions==4.3.0 +typing_extensions==4.4.0 urllib3==1.26.12 Werkzeug==2.2.2 wrapt==1.14.1 -zipp==3.8.1 +zipp==3.9.0 diff --git a/docker/server/src/main/server-netty/requirements.txt b/docker/server/src/main/server-netty/requirements.txt index 0f53f784b8b..36abd4d093a 100644 --- a/docker/server/src/main/server-netty/requirements.txt +++ b/docker/server/src/main/server-netty/requirements.txt @@ -1,4 +1,4 @@ -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 importlib-metadata==5.0.0 java-utilities==0.2.0 jpy==0.12.0 @@ -9,5 +9,5 @@ pandas==1.3.5 python-dateutil==2.8.2 pytz==2022.4 six==1.16.0 -typing_extensions==4.3.0 -zipp==3.8.1 +typing_extensions==4.4.0 +zipp==3.9.0 diff --git a/docker/server/src/main/server-nltk-netty/requirements.txt b/docker/server/src/main/server-nltk-netty/requirements.txt index 6a224d7b7ed..9fc6732b717 100644 --- a/docker/server/src/main/server-nltk-netty/requirements.txt +++ b/docker/server/src/main/server-nltk-netty/requirements.txt @@ -1,5 +1,5 @@ click==8.1.3 -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 importlib-metadata==5.0.0 java-utilities==0.2.0 joblib==1.2.0 @@ -14,5 +14,5 @@ pytz==2022.4 regex==2022.9.13 six==1.16.0 tqdm==4.64.1 -typing_extensions==4.3.0 -zipp==3.8.1 +typing_extensions==4.4.0 +zipp==3.9.0 diff --git a/docker/server/src/main/server-pytorch-netty/requirements.txt b/docker/server/src/main/server-pytorch-netty/requirements.txt index 4d91ebcdfbf..afffd674cc8 100644 --- a/docker/server/src/main/server-pytorch-netty/requirements.txt +++ b/docker/server/src/main/server-pytorch-netty/requirements.txt @@ -2,7 +2,7 @@ absl-py==1.2.0 cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 google-auth==2.12.0 google-auth-oauthlib==0.4.6 grpcio==1.49.1 @@ -30,7 +30,7 @@ tensorboard==2.10.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 torch==1.10.2 -typing_extensions==4.3.0 +typing_extensions==4.4.0 urllib3==1.26.12 Werkzeug==2.2.2 -zipp==3.8.1 +zipp==3.9.0 diff --git a/docker/server/src/main/server-sklearn-netty/requirements.txt b/docker/server/src/main/server-sklearn-netty/requirements.txt index 5e7a23ebf48..7d904fcc865 100644 --- a/docker/server/src/main/server-sklearn-netty/requirements.txt +++ b/docker/server/src/main/server-sklearn-netty/requirements.txt @@ -1,4 +1,4 @@ -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 importlib-metadata==5.0.0 java-utilities==0.2.0 joblib==1.2.0 @@ -13,5 +13,5 @@ scikit-learn==0.24.2 scipy==1.7.3 six==1.16.0 threadpoolctl==3.1.0 -typing_extensions==4.3.0 -zipp==3.8.1 +typing_extensions==4.4.0 +zipp==3.9.0 diff --git a/docker/server/src/main/server-tensorflow-netty/requirements.txt b/docker/server/src/main/server-tensorflow-netty/requirements.txt index 7d44695d1f9..667f1745d77 100644 --- a/docker/server/src/main/server-tensorflow-netty/requirements.txt +++ b/docker/server/src/main/server-tensorflow-netty/requirements.txt @@ -3,7 +3,7 @@ astunparse==1.6.3 cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 -deephaven-plugin==0.2.0 +deephaven-plugin==0.3.0 flatbuffers==2.0.7 gast==0.4.0 google-auth==2.12.0 @@ -42,8 +42,8 @@ tensorflow==2.7.4 tensorflow-estimator==2.7.0 tensorflow-io-gcs-filesystem==0.27.0 termcolor==2.0.1 -typing_extensions==4.3.0 +typing_extensions==4.4.0 urllib3==1.26.12 Werkzeug==2.2.2 wrapt==1.14.1 -zipp==3.8.1 +zipp==3.9.0 From b0a89dbcb2cbd23408b9103a84d10ee7fdab97aa Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 13 Oct 2022 10:24:44 -0500 Subject: [PATCH 214/215] Allow configuration to specify what kind of websockets will be supported --- .../server/jetty/JettyBackedGrpcServer.java | 18 ++++-- .../deephaven/server/jetty/JettyConfig.java | 57 ++++++++++++++++--- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index 88924452f14..af816fe23e8 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -94,13 +94,21 @@ public JettyBackedGrpcServer( // Wire up the provided grpc filter context.addFilter(new FilterHolder(filter), "/*", EnumSet.noneOf(DispatcherType.class)); - // Set up websockets for grpc-web - we register both in case we encounter a client using "vanilla" + // Set up websockets for grpc-web - depending on configuration, we can register both in case we encounter a + // client using "vanilla" // grpc-websocket, that can't multiplex all streams on a single socket - if (config.websocketsOrDefault()) { + if (config.websocketsOrDefault() != JettyConfig.WebsocketsSupport.NONE) { JakartaWebSocketServletContainerInitializer.configure(context, (servletContext, container) -> { - Map> endpoints = Map.of( - "grpc-websockets", () -> filter.create(WebSocketServerStream::new), - "grpc-websockets-multiplex", () -> filter.create(MultiplexedWebSocketServerStream::new)); + final Map> endpoints = new HashMap<>(); + if (config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.BOTH + || config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.GRPC_WEBSOCKET) { + endpoints.put("grpc-websockets", () -> filter.create(WebSocketServerStream::new)); + } + if (config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.BOTH + || config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.GRPC_WEBSOCKET_MULTIPLEXED) { + endpoints.put("grpc-websockets-multiplex", + () -> filter.create(MultiplexedWebSocketServerStream::new)); + } container.addEndpoint(ServerEndpointConfig.Builder.create(GrpcWebsocket.class, "/{service}/{method}") .configurator(new ServerEndpointConfig.Configurator() { @Override diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java index 52857d1250c..416c3606791 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyConfig.java @@ -27,6 +27,33 @@ public abstract class JettyConfig implements ServerConfig { public static final String HTTP_WEBSOCKETS = "http.websockets"; public static final String HTTP_HTTP1 = "http.http1"; + /** + * Values to indicate what kind of websocket support should be offered. + */ + public enum WebsocketsSupport { + + /** + * Disable all websockets. Recommended for use with https, including behind a proxy that will offer its own + * https. + */ + NONE, + /** + * Establish one websocket per grpc stream (including unary calls). Compatible with the websocket client + * provided by https://github.com/improbable-eng/grpc-web/, but not recommended. + */ + GRPC_WEBSOCKET, + /** + * Allows reuse of a single websocket for many grpc streams, even between services. This reduces latency by + * avoiding a fresh websocket handshake per rpc. + */ + GRPC_WEBSOCKET_MULTIPLEXED, + + /** + * Enables both {@link #GRPC_WEBSOCKET} and {@link #GRPC_WEBSOCKET_MULTIPLEXED}, letting the client specify + * which to use via websocket subprotocols. + */ + BOTH; + } public static Builder builder() { return ImmutableJettyConfig.builder(); @@ -48,7 +75,7 @@ public static JettyConfig defaultConfig() { * {@link ServerConfig#buildFromConfig(ServerConfig.Builder, Configuration)}. * *

    - * Additionally, parses the property {@value HTTP_WEBSOCKETS} into {@link Builder#websockets(Boolean)} and + * Additionally, parses the property {@value HTTP_WEBSOCKETS} into {@link Builder#websockets(WebsocketsSupport)} and * {@value HTTP_HTTP1} into {@link Builder#http1(Boolean)}. * * @param config the config @@ -59,7 +86,21 @@ public static Builder buildFromConfig(Configuration config) { String httpWebsockets = config.getStringWithDefault(HTTP_WEBSOCKETS, null); String httpHttp1 = config.getStringWithDefault(HTTP_HTTP1, null); if (httpWebsockets != null) { - builder.websockets(Boolean.parseBoolean(httpWebsockets)); + switch (httpWebsockets.toLowerCase()) { + case "true":// backwards compatible + case "both": + builder.websockets(WebsocketsSupport.BOTH); + break; + case "grpc-websockets": + builder.websockets(WebsocketsSupport.GRPC_WEBSOCKET); + break; + case "grpc-websockets-multiplex": + builder.websockets(WebsocketsSupport.GRPC_WEBSOCKET_MULTIPLEXED); + break; + default: + // backwards compatible, either "false" or "none" or anything else + builder.websockets(WebsocketsSupport.NONE); + } } if (httpHttp1 != null) { builder.http1(Boolean.parseBoolean(httpHttp1)); @@ -80,7 +121,7 @@ public int port() { * Include websockets. */ @Nullable - public abstract Boolean websockets(); + public abstract WebsocketsSupport websockets(); /** * Include HTTP/1.1. @@ -93,15 +134,15 @@ public int port() { * Otherwise, defaults to {@code true} when {@link #ssl()} is empty, and {@code false} when {@link #ssl()} is * present. */ - public final boolean websocketsOrDefault() { - final Boolean websockets = websockets(); + public final WebsocketsSupport websocketsOrDefault() { + final WebsocketsSupport websockets = websockets(); if (websockets != null) { return websockets; } if (Boolean.TRUE.equals(proxyHint())) { - return false; + return WebsocketsSupport.NONE; } - return ssl().isEmpty(); + return ssl().isEmpty() ? WebsocketsSupport.BOTH : WebsocketsSupport.NONE; } /** @@ -124,7 +165,7 @@ public final boolean http1OrDefault() { public interface Builder extends ServerConfig.Builder { - Builder websockets(Boolean websockets); + Builder websockets(WebsocketsSupport websockets); Builder http1(Boolean http1); } From 45c579730710b56adafb34e202f5f954f579a359 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 25 Oct 2022 15:24:45 -0500 Subject: [PATCH 215/215] doc cleanup, better assertions, constants for strings --- .../servlet/web/websocket/GrpcWebsocket.java | 4 ++-- .../MultiplexedWebSocketServerStream.java | 16 +++++++++++----- .../MultiplexedWebsocketStreamImpl.java | 7 +++++-- .../web/websocket/WebSocketServerStream.java | 4 ++++ .../server/jetty/JettyBackedGrpcServer.java | 10 +++++++--- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java index ae747dc85ba..4840646d86d 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/GrpcWebsocket.java @@ -12,8 +12,8 @@ import java.util.function.Supplier; /** - * Supports both grpc-websockets and grpc-websockets-multiplex subprotocols, and delegates to the correct implementation - * after protocol negotiation. + * Supports multiple endpoints, based on the negotiated sub-protocol. If a protocol isn't supported, an error will be + * sent to the client. */ public class GrpcWebsocket extends Endpoint { private final Map> endpointFactories = new HashMap<>(); diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java index 21350ba8cd4..9e75d9560ab 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebSocketServerStream.java @@ -28,11 +28,15 @@ /** * Each instance of this type represents a single active websocket, which can allow several concurrent/overlapping gRPC * streams. This is in contrast to the {@link WebSocketServerStream} type, which supports one websocket per gRPC stream. - * - * To achieve this, each frame starts with a 32 bit integer indicating the ID of the stream. If the MSB of that int is - * 1, then the request must be closed by this frame, and that MSB is set to zero to read the ID of the stream. On the - * initial request, an extra header is sent from the client, indicating the path to the service method, and each frame - * + *

    + *

    + * To achieve this, each grpc message starts with a 32 bit integer indicating the ID of the stream. If the MSB of that + * int is 1, then the request must be closed by this message, and that MSB is set to zero to read the ID of the stream. + * On the initial request, an extra header is sent from the client, indicating the path to the service method. + * Technically, this makes it possible for a grpc message to split across several websocket frames, but at this time + * each grpc message is exactly one websocket frame. + *

    + *

    * JSR356 websockets always handle their incoming messages in a serial manner, so we don't need to worry here about * runOnTransportThread while in onMessage, as we're already in the transport thread. */ @@ -42,6 +46,8 @@ public class MultiplexedWebSocketServerStream extends AbstractWebSocketServerStr public static final Metadata.Key PATH = Metadata.Key.of("grpc-websockets-path", Metadata.ASCII_STRING_MARSHALLER); + public static final String GRPC_WEBSOCKETS_MULTIPLEX_PROTOCOL = "grpc-websockets-multiplex"; + private final InternalLogId logId = InternalLogId.allocate(MultiplexedWebSocketServerStream.class, null); // No need to be thread-safe, this will only be accessed from the transport thread. diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java index 4fcb0e7b663..9b7273c0e6f 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/MultiplexedWebsocketStreamImpl.java @@ -32,6 +32,9 @@ public MultiplexedWebsocketStreamImpl(StatsTraceContext statsTraceCtx, int maxIn Session websocketSession, InternalLogId logId, Attributes attributes, int streamId) { super(ByteArrayWritableBuffer::new, statsTraceCtx, maxInboundMessageSize, websocketSession, logId, attributes, logger); + if (streamId < 0) { + throw new IllegalStateException("Can't create stream with negative id"); + } this.streamId = streamId; } @@ -97,9 +100,9 @@ public void writeFrame(@Nullable WritableBuffer frame, boolean flush, int numMes onSendingBytes(numBytes); } - ByteBuffer payload = ByteBuffer.allocate(frame.readableBytes() + 4); + ByteBuffer payload = ByteBuffer.allocate(numBytes + 4); payload.putInt(streamId); - payload.put(((ByteArrayWritableBuffer) frame).bytes, 0, frame.readableBytes()); + payload.put(((ByteArrayWritableBuffer) frame).bytes, 0, numBytes); payload.flip(); websocketSession.getBasicRemote().sendBinary(payload); diff --git a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java index 7f226a13923..4d3323e3b21 100644 --- a/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java +++ b/grpc-java/grpc-servlet-websocket-jakarta/src/main/java/io/grpc/servlet/web/websocket/WebSocketServerStream.java @@ -31,6 +31,8 @@ public class WebSocketServerStream extends AbstractWebSocketServerStream { private final InternalLogId logId = InternalLogId.allocate(WebSocketServerStream.class, null); + public static final String GRPC_WEBSOCKETS_PROTOCOL = "grpc-websockets"; + // fields set after headers are decoded private WebsocketStreamImpl stream; private boolean headersProcessed = false; @@ -42,6 +44,7 @@ public WebSocketServerStream(ServerTransportListener transportListener, super(transportListener, streamTracerFactories, maxInboundMessageSize, attributes); } + @Override public void onMessage(String message) { if (stream != null) { // This means the stream opened correctly, then sent a text payload, which doesn't make sense. @@ -56,6 +59,7 @@ public void onMessage(String message) { } } + @Override public void onMessage(ByteBuffer message) throws IOException { if (message.remaining() == 0) { // message is empty (no control flow, no data), error diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java index af816fe23e8..eb592c2e4c3 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java @@ -12,6 +12,7 @@ import io.deephaven.ssl.config.impl.KickstartUtils; import io.grpc.servlet.web.websocket.GrpcWebsocket; import io.grpc.servlet.web.websocket.MultiplexedWebSocketServerStream; +import io.grpc.servlet.web.websocket.MultiplexedWebsocketStreamImpl; import io.grpc.servlet.web.websocket.WebSocketServerStream; import io.grpc.servlet.jakarta.web.GrpcWebFilter; import jakarta.servlet.DispatcherType; @@ -41,6 +42,7 @@ import java.io.IOException; import java.io.UncheckedIOException; import java.net.URL; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.EnumSet; @@ -49,6 +51,8 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import static io.grpc.servlet.web.websocket.MultiplexedWebSocketServerStream.GRPC_WEBSOCKETS_MULTIPLEX_PROTOCOL; +import static io.grpc.servlet.web.websocket.WebSocketServerStream.GRPC_WEBSOCKETS_PROTOCOL; import static org.eclipse.jetty.servlet.ServletContextHandler.SESSIONS; public class JettyBackedGrpcServer implements GrpcServer { @@ -102,11 +106,11 @@ public JettyBackedGrpcServer( final Map> endpoints = new HashMap<>(); if (config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.BOTH || config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.GRPC_WEBSOCKET) { - endpoints.put("grpc-websockets", () -> filter.create(WebSocketServerStream::new)); + endpoints.put(GRPC_WEBSOCKETS_PROTOCOL, () -> filter.create(WebSocketServerStream::new)); } if (config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.BOTH || config.websocketsOrDefault() == JettyConfig.WebsocketsSupport.GRPC_WEBSOCKET_MULTIPLEXED) { - endpoints.put("grpc-websockets-multiplex", + endpoints.put(GRPC_WEBSOCKETS_MULTIPLEX_PROTOCOL, () -> filter.create(MultiplexedWebSocketServerStream::new)); } container.addEndpoint(ServerEndpointConfig.Builder.create(GrpcWebsocket.class, "/{service}/{method}") @@ -117,7 +121,7 @@ public T getEndpointInstance(Class endpointClass) throws InstantiationExc return (T) new GrpcWebsocket(endpoints); } }) - .subprotocols(Arrays.asList("grpc-websockets", "grpc-websockets-multiplex")) + .subprotocols(new ArrayList<>(endpoints.keySet())) .build() );